Просмотр исходного кода

进口联调存为模板接口
结算中心已完成新加导出模块

qukaidi 1 неделя назад
Родитель
Сommit
edcdedba6f

+ 200 - 0
src/views/iosBasicData/OceanFreightImport/bills/assembly/components/costTemplate.vue

@@ -0,0 +1,200 @@
+<template>
+  <div>
+    <el-dialog title="费用模板" :visible.sync="dialogVisible" append-to-body width="30%" :before-close="handleClose">
+      <avue-form v-if="dialogVisible" :option="optionForm" v-model="form" ref="form">
+        <tempalte slot="shippingCompanyCname">
+          <dic-select
+            v-model="form.shippingCompanyCname"
+            placeholder="港口"
+            key="id"
+            label="cnName"
+            url="/blade-los/bcorps/listAll?status=0&corpTypeName=船公司"
+            :filterable="true"
+            dataName="cnName"
+            :multiple="true"
+            :collapseTags="true"
+            dataType="string"
+            @selectChange="dicChange('shippingCompanyCname', $event)"
+            :multipleStrings="true"
+          ></dic-select>
+        </tempalte>
+        <tempalte slot="branchName">
+          <dic-select
+            v-model="form.branchName"
+            placeholder="所属公司"
+            key="id"
+            label="deptName"
+            url="/blade-system/dept/top-list"
+            :filterable="true"
+            :multiple="true"
+            :collapseTags="true"
+            dataType="string"
+            @selectChange="dicChange('branchName', $event)"
+            :multipleStrings="true"
+          ></dic-select>
+        </tempalte>
+      </avue-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false" size="mini">取 消</el-button>
+        <el-button type="primary" @click="submit" size="mini">保 存</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { saveTemplate } from "@/api/iosBasicData/feecenter";
+import dicSelect from "@/components/dicSelect/main";
+export default {
+  components: { dicSelect },
+  props: {},
+  data() {
+    return {
+      form: {},
+      selectionList: [],
+      dialogVisible: false,
+      loading: false,
+      optionForm: {
+        menuBtn: false,
+        span: 8,
+        disabled: false,
+        labelWidth: 100,
+        column: [
+          {
+            label: "模版编号",
+            span: 24,
+            prop: "code",
+            rules: [
+              {
+                required: true,
+                message: "请输入模版编号",
+                trigger: "blur"
+              }
+            ]
+          },
+          {
+            label: "模版中文名称",
+            span: 24,
+            prop: "cnName",
+            rules: [
+              {
+                required: true,
+                message: "请输入模版中文名称",
+                trigger: "blur"
+              }
+            ]
+          },
+          {
+            label: "模版英文名称",
+            span: 24,
+            prop: "enName",
+            rules: [
+              {
+                required: true,
+                message: "请输入模版英文名称",
+                trigger: "blur"
+              }
+            ]
+          },
+          {
+            label: "船公司",
+            prop: "shippingCompanyCname",
+            span: 24,
+            disabled: false,
+            rules: [
+              {
+                required: true,
+                message: "请选择船公司",
+                trigger: "blur"
+              }
+            ]
+          },
+          {
+            label: "所属公司",
+            prop: "branchName",
+            span: 24,
+            disabled: false,
+            rules: [
+              {
+                required: true,
+                message: "请选择所属公司",
+                trigger: "blur"
+              }
+            ]
+          }
+        ]
+      }
+    };
+  },
+  async created() {},
+  methods: {
+    openDialog(val, type, list) {
+      this.dialogVisible = true;
+      this.form = {
+        branchId: val.branchId,
+        branchName: val.branchName,
+        code: null,
+        cnName: null,
+        enName: null,
+        dc: type,
+        shippingCompanyId: val.carrierId,
+        shippingCompanyCname: val.carrierCnName,
+        shippingCompanyCode: val.carrierCode,
+        businessTypeCode: "HYJK",
+        feeCenterList: list
+      };
+    },
+    dicChange(name, row) {
+      if (name == "shippingCompanyCname") {
+        let codes = [];
+        for (let item of row.multipleData) {
+          codes.push(item.code);
+        }
+        if (row) {
+          this.form.shippingCompanyId = row.ids;
+          this.form.shippingCompanyCname = row.names;
+          this.form.shippingCompanyCode = codes.join(",");
+        } else {
+          this.form.shippingCompanyId = null;
+          this.form.shippingCompanyCode = null;
+          this.form.shippingCompanyCname = null;
+        }
+      }
+      if (name == "branchName") {
+        if (row) {
+          this.form.branchId = row.ids;
+          this.form.branchName = row.names;
+        } else {
+          this.form.branchId = null;
+          this.form.branchName = null;
+        }
+      }
+    },
+    submit() {
+      this.$refs["form"].validate((valid, done) => {
+        done();
+        if (valid) {
+          const loading = this.$loading({
+            lock: true,
+            text: "加载中",
+            spinner: "el-icon-loading",
+            background: "rgba(255,255,255,0.7)"
+          });
+          saveTemplate(this.form)
+            .then(res => {
+              this.$message.success("保存成功");
+              this.dialogVisible = false;
+            })
+            .finally(() => {
+              loading.close();
+            });
+        } else {
+          return false;
+        }
+      });
+    }
+  }
+};
+</script>
+
+<style scoped></style>

+ 43 - 6
src/views/iosBasicData/OceanFreightImport/bills/assembly/feecenter.vue

@@ -176,6 +176,14 @@
             >{{ $t("btn118n.unAplly") }}</el-button
           >
           <el-button plain size="small" :disabled="disabled || isFeedDisabled" @click="allClick('同步结算单位', 'D')">同步收费对象</el-button>
+          <el-button
+            type="success"
+            plain
+            size="small"
+            :disabled="assemblyForm.feeCenterListD.filter(item => item.id).length == 0 || selectionDList.length == 0"
+            @click="allClick('存为模板', 'D')"
+            >存为模板</el-button
+          >
         </template>
         <template slot="indexHeader" slot-scope="scope">
           <el-button v-if="isFeeEditD" type="primary" size="small" icon="el-icon-plus" circle :disabled="disabled" @click="addDfun"></el-button>
@@ -343,7 +351,7 @@
             :controls="false"
             :precision="5"
             placeholder="请输入"
-            :disabled="row.curCode==getLocalCurrency()"
+            :disabled="row.curCode == getLocalCurrency()"
             style="width: 100%;"
           ></el-input-number>
           <span v-else>{{ row.exrate }}</span>
@@ -527,6 +535,14 @@
             >{{ $t("btn118n.unAplly") }}</el-button
           >
           <el-button plain size="small" :disabled="disabled || isFeedDisabled" @click="allClick('同步结算单位', 'C')">同步收费对象</el-button>
+          <el-button
+            type="success"
+            plain
+            size="small"
+            :disabled="assemblyForm.feeCenterListC.filter(item => item.id).length == 0 || selectionCList.length == 0"
+            @click="allClick('存为模板', 'C')"
+            >存为模板</el-button
+          >
         </template>
         <template slot="indexHeader" slot-scope="scope">
           <el-button v-if="isFeeEditC" type="primary" size="small" icon="el-icon-plus" circle :disabled="disabled" @click="addCfun"> </el-button>
@@ -677,7 +693,7 @@
             :controls="false"
             :precision="5"
             placeholder="请输入"
-            :disabled="row.curCode==getLocalCurrency()"
+            :disabled="row.curCode == getLocalCurrency()"
             style="width: 100%;"
           ></el-input-number>
           <span v-else>{{ row.exrate }}</span>
@@ -1078,6 +1094,7 @@
     ></fee-modify>
     <fee-modify-view ref="feeModifyView" :form="assemblyForm"></fee-modify-view>
     <sysn-corpName ref="sysnCorpName" @update="getData"></sysn-corpName>
+    <cost-template ref="costTemplate"></cost-template>
   </div>
 </template>
 
@@ -1121,6 +1138,7 @@ import mailComponent from "@/components/iosbasic-data/mail-component.vue";
 import feeModify from "@/components/feeModify/main.vue";
 import feeModifyView from "@/components/feeModify/view.vue";
 import sysnCorpName from "./sysnCorpName";
+import costTemplate from "./components/costTemplate.vue";
 import _ from "lodash";
 export default {
   components: {
@@ -1132,7 +1150,8 @@ export default {
     mailComponent,
     feeModify,
     feeModifyView,
-    sysnCorpName
+    sysnCorpName,
+    costTemplate
   },
   props: {
     pid: {},
@@ -3887,6 +3906,24 @@ export default {
         });
     },
     allClick(name, type) {
+      if (name == "存为模板") {
+        if (type == "D") {
+          for (let item of this.selectionDList) {
+            if (!item.id) {
+              return this.$message.error("费用明细存在未保存数据,请保存");
+            }
+          }
+          this.$refs.costTemplate.openDialog(this.assemblyForm, type, this.selectionDList);
+        }
+        if (type == "C") {
+          for (let item of this.selectionCList) {
+            if (!item.id) {
+              return this.$message.error("费用明细存在未保存数据,请保存");
+            }
+          }
+          this.$refs.costTemplate.openDialog(this.assemblyForm, type, this.selectionCList);
+        }
+      }
       if (name == "同步结算单位") {
         this.$refs.sysnCorpName.openDialog(this.assemblyForm.id, type);
       }
@@ -4661,13 +4698,13 @@ export default {
     },
     rowStyle({ row, column, rowIndex }) {
       //已结算金额
-      if (Number(row.stlTtlAmount?row.stlTtlAmount:0) != 0) {
+      if (Number(row.stlTtlAmount ? row.stlTtlAmount : 0) != 0) {
         return {
           color: "#0000FF"
         };
       }
       //发票金额和付费申请金额
-      if (Number(row.appliedAmount?row.appliedAmount:0) != 0 || Number(row.appliedInvoiceAmount?row.appliedInvoiceAmount:0) != 0) {
+      if (Number(row.appliedAmount ? row.appliedAmount : 0) != 0 || Number(row.appliedInvoiceAmount ? row.appliedInvoiceAmount : 0) != 0) {
         return {
           color: "#FFC300"
         };
@@ -4805,7 +4842,7 @@ export default {
   padding: 0 2px !important;
 }
 ::v-deep .el-input__inner {
-  padding-left:5px !important;
+  padding-left: 5px !important;
 }
 
 .textoverflow {

+ 12 - 2
src/views/iosBasicData/SeafreightExportF/bills/assembly/feecenter.vue

@@ -180,7 +180,7 @@
             type="success"
             plain
             size="small"
-            :disabled="assemblyForm.feeCenterListD.filter(item => item.id).length == 0||selectionDList.length == 0"
+            :disabled="assemblyForm.feeCenterListD.filter(item => item.id).length == 0 || selectionDList.length == 0"
             @click="allClick('存为模板', 'D')"
             >存为模板</el-button
           >
@@ -534,7 +534,7 @@
             type="success"
             plain
             size="small"
-            :disabled="assemblyForm.feeCenterListC.filter(item => item.id).length == 0||selectionCList.length == 0"
+            :disabled="assemblyForm.feeCenterListC.filter(item => item.id).length == 0 || selectionCList.length == 0"
             @click="allClick('存为模板', 'C')"
             >存为模板</el-button
           >
@@ -3942,9 +3942,19 @@ export default {
     allClick(name, type) {
       if (name == "存为模板") {
         if (type == "D") {
+          for (let item of this.selectionDList) {
+            if (!item.id) {
+              return this.$message.error("费用明细存在未保存数据,请保存");
+            }
+          }
           this.$refs.costTemplate.openDialog(this.assemblyForm, type, this.selectionDList);
         }
         if (type == "C") {
+          for (let item of this.selectionCList) {
+            if (!item.id) {
+              return this.$message.error("费用明细存在未保存数据,请保存");
+            }
+          }
           this.$refs.costTemplate.openDialog(this.assemblyForm, type, this.selectionCList);
         }
       }

+ 24 - 0
src/views/iosBasicData/financialManagement/computationCenter/index.vue

@@ -44,6 +44,7 @@
           <el-button v-if="tabsValue == 'D'" type="success" size="small" plain @click="allClick('已开已收')">已开已收 </el-button>
           <el-button v-if="tabsValue == '业务单据'" type="primary" size="small" plain @click="addfun()">添加单据 </el-button>
           <el-button v-if="tabsValue == '业务单据'" type="danger" size="small" plain @click="handleDelete()">一键删除 </el-button>
+          <el-button v-if="tabsValue == '已完成'" type="success" size="small" plain @click="outExport()">导出 </el-button>
           <span style="font-size: 24px;font-weight: 600;">
             <span style="color: #67C23A;margin-right: 10px;"> 本币:{{ amountSubSum.toFixed(2) }}元 </span>
             <span style="color: #E6A23C;"> 外币:{{ amountSubUsdSum.toFixed(2) }}元 </span>
@@ -119,6 +120,7 @@ import { bbusinesstypeList } from "@/api/iosBasicData/bbusinesstype";
 import dicSelect from "@/components/dicSelect/main";
 import { dateFormat } from "@/util/date";
 import detailsPage from "./detailsPage";
+import { getToken } from "@/util/auth";
 export default {
   name:"结算中心(N)",
   components: { detailsPage, dicSelect },
@@ -958,6 +960,28 @@ export default {
         });
       });
     },
+     outExport() {
+      this.$confirm("是否导出当前所有数据?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        let queryParams = {};
+        queryParams = {
+          businessType: "STL",
+          ...this.query
+        };
+        delete queryParams.billStatus;
+        const routeData = this.$router.resolve({
+          path: "/api/blade-los/finstlbills/listExport", //跳转目标窗口的地址
+          query: {
+            "Blade-Auth": getToken(),
+            ...queryParams //括号内是要传递给新窗口的参数
+          }
+        });
+        window.open(routeData.href.slice(1, routeData.href.length));
+      });
+    },
     // 行删除回调
     rowDel(row) {
       console.log("行删除回调");