Bladeren bron

2025.12.15

wfg 1 maand geleden
bovenliggende
commit
f6ea6b90a2

+ 8 - 0
src/api/iosBasicData/bills.js

@@ -96,6 +96,14 @@ export const postMagicHandImportBills = (data) => {
     })
 }
 
+// 提交 MagicHand 修改的数据
+export const postImportMscBillNo = (data) => {
+  return request({
+    url: '/api/blade-los/magicHandImport/submit',
+    method: 'POST',
+    data: data
+  })
+}
 
 export const billsRemove = (ids) => {
   return request({

+ 4 - 0
src/enums/column-name.js

@@ -1579,6 +1579,10 @@ const columnName = [{
   name: '货运代理-基础资料-凭证模板列表'
 },
 {
+  code: 328.1,
+  name: '货运代理-审核列表'
+},
+{
   code: 329,
   name: '货运代理-财务管理-总账'
 },

+ 4 - 1
src/util/contrastData.js

@@ -13,6 +13,9 @@ export function contrastObj(newval, oldval) {
 
 //比较数组的值(有序)
 export function contrastList(newlist, oldlist) {
+  if (!Array.isArray(newlist) || !Array.isArray(oldlist)) {
+    return true
+  }
   if (newlist.length != oldlist.length) {
     return true
   }
@@ -69,4 +72,4 @@ export function contrastList2(newlist, oldlist) {
     }
   }
   return false;
-}
+}

+ 3 - 1
src/views/approveDataH/configuration/mainList.json

@@ -23,7 +23,7 @@
     "searchIndex": 2,
     "addBtn": false,
     "headerAlign": "center",
-    "columnBtn": false,
+    "columnBtn-BAK": false,
     "column": [
         {
             "label": "业务编号",
@@ -120,6 +120,7 @@
             "search": true,
             "overHidden": true,
             "index": 1,
+            "width": 100,
             "sortable": true
         },
         {
@@ -264,6 +265,7 @@
             "searchValue": "S",
             "overHidden": true,
             "index": 1,
+            "width": 100,
             "sortable": true
         },
         {

+ 36 - 8
src/views/approveDataH/index.vue

@@ -16,6 +16,8 @@
       @size-change="sizeChange"
       @refresh-change="refreshChange"
       @on-load="onLoad"
+      @resetColumn="resetColumn('crud', 'option', 'optionBack', 328.1)"
+      @saveColumn="saveColumn('crud', 'option', 'optionBack', 328.1)"
     >
       <!--        <select-component v-model="search.corpId" :configuration="configuration"></select-component>-->
       <!--      <template slot="corpIdSearch">-->
@@ -142,7 +144,7 @@
           @click.stop="printWindowfun(scope.row, 'aia-approve')"
           >审批
         </el-button>
-        <el-button type="text" size="small" v-else :disabled="scope.row.auditStatus != 'S'" @click.stop="openCheck(scope.row)">审批 </el-button>
+        <el-button type="text" size="small" v-else :disabled="scope.row.auditStatus != 'S'" @click.stop="openCheck(scope.row)">审批</el-button>
         <!--          暂时隐藏-->
         <!--        <el-button type="text" size="small" @click.stop="openCheckSchedule(scope.row)">审批流程</el-button>-->
       </template>
@@ -239,6 +241,7 @@ export default {
       checkScheduleDialog: false,
       detailData: {},
       option: {},
+      optionBack: {},
       parentId: 0,
       checkData: {},
       dataList: [],
@@ -274,11 +277,12 @@ export default {
         } else if (this.$store.getters.userInfo.tenant_id === "064132") {
           this.option = option4;
         } else {
-          let columns = JSON.parse(JSON.stringify(option));
-          isProcurement({ param: "business" }).then(res => {
+          this.optionBack = JSON.parse(JSON.stringify(option));
+
+          isProcurement({ param: "business" }).then(async res => {
             this.business = res.data.data;
             if (res.data.data == 1) {
-              columns.column.forEach((item, index) => {
+              this.optionBack.column.forEach((item, index) => {
                 item.index = index + 1;
                 if (
                   item.prop == "customizeOne" ||
@@ -293,8 +297,7 @@ export default {
                 }
               });
             }
-            console.log(columns);
-            this.option = columns;
+            this.option = await this.getColumnData(this.getColumnName(328.1), this.optionBack);;
           });
         }
       }
@@ -457,7 +460,7 @@ export default {
       options.toolbar.printDestination = Stimulsoft.Viewer.StiPrintDestination.Direct;
       options.appearance.htmlRenderMode = Stimulsoft.Report.Export.StiHtmlExportMode.Table;
       let viewer = new Stimulsoft.Viewer.StiViewer(options, "StiViewer", false);
-     
+
       // viewer.onEmailReport = this.testMail;
       // 报表
       console.log("创建一个报表实例");
@@ -676,7 +679,32 @@ export default {
     },
     cellStyle() {
       return "padding:0;height:40px;";
-    }
+    },
+    //自定义列保存
+    async saveColumn(ref, option, optionBack, code) {
+      /**
+       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+       */
+      const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+        this.searchReset();
+      }
+    },
+    //自定义列重置
+    async resetColumn(ref, option, optionBack, code) {
+      this[option] = this[optionBack];
+      const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
+      if (inSave) {
+        this.$message.success("重置成功");
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+        this.searchReset();
+      }
+    },
   }
 };
 </script>

+ 14 - 3
src/views/iosBasicData/SeafreightExportF/bills/assembly/DistributionBox.vue

@@ -70,9 +70,17 @@ export default {
             this.$emit('billsAddfun')
         },
         // 详情接口
-        billsDetailfun(status) {
-          console.log("dis.billsDetailfun", this.assemblyForm.id, status);
-            this.$emit('billsDetailfun', this.assemblyForm.id, status)
+        async billsDetailfun(status) {
+          let that = this
+            await this.$emit('billsDetailfun', this.assemblyForm.id, status, function(){
+              that.$nextTick(() => {
+                if(Array.isArray(that.assemblyForm.containersList) && that.assemblyForm.containersList[0]) {
+                  that.selectionChange([that.assemblyForm.containersList[0]])
+                }else{
+                  that.selectionChange([])
+                }
+              })
+            })
         },
       editCustomer (callback){
         this.$emit("editCustomer", undefined, callback);
@@ -83,6 +91,9 @@ export default {
             if (list.length > 0) {
                 this.$refs.PackingBusiness.containersBillsList = this.selectionList[0].containersBillsList
                 this.$refs.PackingBusiness.containersCommodityList = this.selectionList[0].containersCommodityList
+            }else{
+              this.$refs.PackingBusiness.containersCommodityList = []
+              this.$refs.PackingBusiness.containersBillsList = []
             }
         },
         // 分配

+ 80 - 38
src/views/iosBasicData/SeafreightExportF/bills/assembly/DistributionBox/containers.vue

@@ -19,15 +19,36 @@
         @row-del="rowDel"
         @selection-change="selectionChange"
         @refresh-change="refreshChange"
-        @row-click="(row) => $refs.crud.toggleRowSelection(row)"
+        @row-click="row => $refs.crud.toggleRowSelection(row)"
       >
         <template slot="menuLeft">
           <div style="display: flex;align-items: center;justify-content: space-between">
             <div>
               <!--<el-button type="primary" size="small" @click="DistributionBox">配箱</el-button>-->
-              <el-button type="success" size="small" plain :disabled="detailData.seeDisabled || !assemblyForm.id || pleasereviewType || showLock" @click.stop="equalDistribution2()">配箱 </el-button>
-              <el-button type="success" size="small" plain :disabled="detailData.seeDisabled || !assemblyForm.id || pleasereviewType || showLock" @click.stop="equalDistribution(1)">按TEU配箱 </el-button>
-              <el-button type="success" size="small" plain :disabled="detailData.seeDisabled || !assemblyForm.id || pleasereviewType || showLock" @click.stop="equalDistribution(2)">按箱量配箱 </el-button>
+              <el-button
+                type="success"
+                size="small"
+                plain
+                :disabled="detailData.seeDisabled || !assemblyForm.id || pleasereviewType || showLock"
+                @click.stop="equalDistribution2()"
+                >配箱
+              </el-button>
+              <el-button
+                type="success"
+                size="small"
+                plain
+                :disabled="detailData.seeDisabled || !assemblyForm.id || pleasereviewType || showLock"
+                @click.stop="equalDistribution(1)"
+                >按TEU配箱
+              </el-button>
+              <el-button
+                type="success"
+                size="small"
+                plain
+                :disabled="detailData.seeDisabled || !assemblyForm.id || pleasereviewType || showLock"
+                @click.stop="equalDistribution(2)"
+                >按箱量配箱
+              </el-button>
               <el-button type="primary" size="small" :disabled="detailData.seeDisabled || pleasereviewType || showLock" @click="rootEditfun"
                 >一键编辑
               </el-button>
@@ -122,7 +143,7 @@
           <el-input
             v-if="scope.row.edit"
             v-model="scope.row.sealNo"
-            maxlength="11"
+            maxlength="32"
             size="small"
             clearable
             placeholder="请输入封号"
@@ -264,11 +285,29 @@
     </el-dialog>
 
     <!--预览报表弹窗-->
-<!--    style="height: 60%;"-->
-    <el-dialog append-to-body title="预览报表" class="el-dialogDeep" :visible.sync="previewDialog" width="60%"
-               :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" @close-dialog="previewDialog=false" v-dialog-drag>
-      <business-reports ref="businessReports" :id="assemblyForm.id" :classifycode="'业务'" :groupcode="'分箱明细'" v-if="previewDialog"
-                        :disabled="detailData.seeDisabled" :previewifonereport="true" @close-dialog="previewDialog=false" ></business-reports>
+    <!--    style="height: 60%;"-->
+    <el-dialog
+      append-to-body
+      title="预览报表"
+      class="el-dialogDeep"
+      :visible.sync="previewDialog"
+      width="60%"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :close-on-press-escape="false"
+      @close-dialog="previewDialog = false"
+      v-dialog-drag
+    >
+      <business-reports
+        ref="businessReports"
+        :id="assemblyForm.id"
+        :classifycode="'业务'"
+        :groupcode="'分箱明细'"
+        v-if="previewDialog"
+        :disabled="detailData.seeDisabled"
+        :previewifonereport="true"
+        @close-dialog="previewDialog = false"
+      ></business-reports>
     </el-dialog>
   </div>
 </template>
@@ -721,16 +760,18 @@ export default {
     },
     verifyChange(row, name) {
       if (name == "cntrNo") {
-        const regex = /^([a-zA-Z]{4})([0-9]{7})$/;
-        if (regex.test(row[name])) {
-          if (this.calculateCheckDigit(row[name]) == row[name][10]) {
-            this.$message.success("集装箱校验正确!");
+        if (row[name]) {
+          const regex = /^([a-zA-Z]{4})([0-9]{7})$/;
+          if (regex.test(row[name])) {
+            if (this.calculateCheckDigit(row[name]) == row[name][10]) {
+              this.$message.success("集装箱校验正确!");
+            } else {
+              this.$message.error("集装箱校验不正确!");
+            }
           } else {
-            this.$message.error("集装箱校验不正确!");
+            // this.$set(row, [name], null);
+            this.$message.error("请正确输入4个字母+7个数字!");
           }
-        } else {
-          this.$set(row, [name], null);
-          this.$message.error("请正确输入4个字母+7个数字!");
         }
       }
     },
@@ -776,8 +817,8 @@ export default {
       });
     },
     async equalDistribution2() {
-      let that = this
-      await that.$emit("editCustomer", function(){
+      let that = this;
+      await that.$emit("editCustomer", function() {
         distributionBox({ billId: that.assemblyForm.id }).then(res => {
           that.$message({
             type: "success",
@@ -786,7 +827,7 @@ export default {
           that.$emit("billsDetailfun");
         });
       });
-      return
+      return;
 
       if (!this.assemblyForm.id) {
         this.$message({
@@ -833,8 +874,8 @@ export default {
         return;
       }
 
-      let that = this
-      that.$emit("editCustomer", function(){
+      let that = this;
+      that.$emit("editCustomer", function() {
         that.containersEqualDistributionfun(type);
       });
       return;
@@ -997,8 +1038,8 @@ export default {
       let arr = this.assemblyForm.containersList.map(item => {
         return item.id;
       });
-      if(arr.length == 0) {
-        return
+      if (arr.length == 0) {
+        return;
       }
       this.$confirm("确定将数据撤销全部?", {
         confirmButtonText: "确定",
@@ -1010,7 +1051,7 @@ export default {
             type: "success",
             message: "全部撤销成功!"
           });
-          this.$emit("billsDetailfun",); // containersList
+          this.$emit("billsDetailfun"); // containersList
         });
       });
     },
@@ -1037,19 +1078,20 @@ export default {
         this.$message.warning("请先大保存");
         return;
       }
-      this.$confirm("确定全部保存配箱?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      }).then(() => {
+      // this.$confirm("确定全部保存配箱?", {
+      //   confirmButtonText: "确定",
+      //   cancelButtonText: "取消",
+      //   type: "warning"
+      // }).then(() => {
         containersSubmitList(this.assemblyForm.containersList).then(res => {
           this.$message({
             type: "success",
             message: "操作成功!"
           });
-          this.$emit("billsDetailfun", ); // containersList
+          this.$emit("billsDetailfun"); // containersList
         });
-      });
+      //});
+
       // this.$emit('editCustomer');
     },
 
@@ -1109,8 +1151,8 @@ export default {
       for (let item of this.assemblyForm.containersList) {
         if (item.quantity > 0) return this.$message.error("请先撤销,再删除配箱");
       }
-      if(this.assemblyForm.containersList.length == 0) {
-        return
+      if (this.assemblyForm.containersList.length == 0) {
+        return;
       }
       this.$confirm("确定将全部数据删除?", {
         confirmButtonText: "确定",
@@ -1126,8 +1168,8 @@ export default {
             type: "success",
             message: "操作成功!"
           });
-          // this.$emit("billsDetailfun");
-          this.$set(this.assemblyForm, "containersList", [])
+          this.$emit("billsDetailfun");
+          // this.$set(this.assemblyForm, "containersList", []);
           this.$refs.crud.toggleSelection();
         });
       });
@@ -1141,7 +1183,7 @@ export default {
         return;
       }
 
-      this.previewDialog = true
+      this.previewDialog = true;
     },
     beforeOpen(done, type) {
       if (["edit", "view"].includes(type)) {

+ 62 - 26
src/views/iosBasicData/SeafreightExportF/bills/assembly/feecenter.vue

@@ -2308,12 +2308,14 @@ export default {
       let arr = selection.map(item => {
         let obj = {};
         if (dc === "C") {
-          // 结算单位拿主表客户名称
+          // 应付生成应收时,结算单位拿主表客户名称
           obj.corpId = this.assemblyForm.corpId;
           obj.corpCnName = this.assemblyForm.corpCnName;
           obj.corpEnName = this.assemblyForm.corpEnName;
           obj.shortName = shortName;
           obj.dc = "D";
+        } else {
+          obj.dc = "C";
         }
 
         obj.feeId = item.feeId;
@@ -2339,6 +2341,7 @@ export default {
         obj.rmbAmountNet = item.rmbAmountNet;
         obj.usdAmountNet = item.usdAmountNet;
         obj.exrate = item.exrate;
+        obj.accStatus = 0;
         return obj;
       });
       if (dc == "D") {
@@ -2518,6 +2521,7 @@ export default {
           this.assemblyForm.feeCenterListD.push(obj);
         });
       }
+      obj.accStatus = 0;
       this.$nextTick(() => {
         const container = this.$refs.crudD.$el.querySelector(".el-table__body-wrapper");
         if (container) {
@@ -2606,6 +2610,7 @@ export default {
         // })
         this.assemblyForm.feeCenterListC.push(obj);
       }
+      obj.accStatus = 0;
       this.$nextTick(() => {
         const container = this.$refs.crudC.$el.querySelector(".el-table__body-wrapper");
         if (container) {
@@ -2864,7 +2869,7 @@ export default {
     },
     // 客户的回调
     async corpChange(value, name, row, dc) {
-      console.log("corpChange", "value", value, "name", name, "row", row, "dc", dc);
+      // console.log("corpChange", "value", value, "name", name, "row", row, "dc", dc);
       if (name == "shortName") {
         console.log(value, name);
         if (!value) {
@@ -2875,7 +2880,7 @@ export default {
         }
         for (let item of this.corpCnNameData) {
           if (item.shortName == value) {
-            console.log(item);
+            // console.log(item);
             this.$set(row, "shortName", item.shortName);
             this.$set(row, "corpCnName", item.cnName);
             this.$set(row, "corpEnName", item.enName);
@@ -2902,7 +2907,7 @@ export default {
         }
         for (let item of this.feeCnNameData) {
           if (item.cnName == value) {
-            if (value == "PS") {
+            if (value == "PS" || value == "P/S") {
               // 判断是否是分单
               if (this.assemblyForm.billType == "MH") {
                 this.$confirm("分单不能添加PS", {
@@ -2963,7 +2968,7 @@ export default {
             // 拿取费用简称下的计量单位
             this.getBunitsPagefun(true, item, row);
             // 币别
-            if (value == "PS") {
+            if (value == "PS" || value == "P/S") {
               this.$set(row, "curCode", "USD");
             } else {
               this.$set(row, "curCode", item.curNo);
@@ -2996,7 +3001,7 @@ export default {
           }
         }
       } else if (name == "unitNo") {
-        console.log(value, name, row);
+        // console.log(value, name, row);
         // 计量单位
         this.$set(row, name, value);
         for (let item of this.unitNoData) {
@@ -3369,7 +3374,6 @@ export default {
     },
     // 获取计算属性
     async getBunitsPagefun(type, feeRow, row) {
-      // console.log('getBunitsPagefun')
       let srcBillId = null;
       if (this.assemblyForm.billType == "MH") {
         srcBillId = this.assemblyForm.masterId;
@@ -3380,7 +3384,6 @@ export default {
       this.unitNoData = [];
       let units = {};
       let teunum = 0;
-      // console.log("getBunitsPagefun", res.data.data, "feeRow", feeRow)
       for (let item of res.data.data) {
         if (feeRow && item.id == feeRow.unitId) {
           units = item;
@@ -3429,7 +3432,6 @@ export default {
         }
       });
       this.unitNoData = [...arr, ...this.unitNoData];
-      console.log("getBunitsPagefun.unitNoData", this.unitNoData, "units", units, "feeRow", feeRow);
       // 选择费用时带出第一条
       if (type) {
         let feeunitNodata = [];
@@ -3439,7 +3441,19 @@ export default {
         //     }
         // }
         feeunitNodata = this.unitNoData.filter(u => u.quantityRule == units.quantityRule);
-        this.corpChange(feeunitNodata.length > 0 ? feeunitNodata[0].code : "JOB", "unitNo", row);
+        // OF 改运费 1722822288795000833
+        let unitNo = feeunitNodata.length > 0 ? feeunitNodata[0].code : "JOB";
+        if (feeRow && feeRow.code === "OF") {
+          let accDeptId = this.assemblyForm.accDept + "";
+          // 海运费:市场部 1753232111692791810 默认按箱型箱量计算;海运部 1717838531146289153 默认按票
+          if (accDeptId == "1753232111692791810") {
+            unitNo = "CNTRTYPE";
+          }
+          if (accDeptId == "1717838531146289153") {
+            unitNo = "JOB";
+          }
+        }
+        this.corpChange(unitNo, "unitNo", row);
       }
     },
 
@@ -3767,22 +3781,44 @@ export default {
       }
     },
     upSibmit(dc) {
-      const obj = {
-        corpId: this.upForm.corpId,
-        corpCnName: this.upForm.corpCnName,
-        corpEnName: this.upForm.corpEnName,
-        shortName: this.upForm.shortName,
-        feeCenterListD: dc == "D" ? this.selectionDList : this.selectionCList
-      };
-      updateCorpBatch(obj).then(res => {
-        this.$message({
-          type: "success",
-          message: "操作成功!"
+      let sels = dc === "D" ? this.selectionDList : this.selectionCList;
+      let items = []
+
+      console.log("sels", sels)
+
+      sels.forEach(item => {
+        if(!!item.id){
+          items.push(item);
+        }else{
+          item.corpId=this.upForm.corpId;
+          item.corpCnName=this.upForm.corpCnName;
+          item.corpEnName=this.upForm.corpEnName;
+          item.shortName=this.upForm.shortName;
+        }
+      })
+
+      console.log("items", items)
+      if (items.length > 0) {
+        const obj = {
+          corpId: this.upForm.corpId,
+          corpCnName: this.upForm.corpCnName,
+          corpEnName: this.upForm.corpEnName,
+          shortName: this.upForm.shortName,
+          feeCenterListD: items
+        };
+        updateCorpBatch(obj).then(res => {
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          this.dialogVisible = false;
+          this.dc = null;
+          this.$emit("billsDetailfun");
         });
-        this.dialogVisible = false;
+      }else{
         this.dc = null;
-        this.$emit("billsDetailfun");
-      });
+        this.dialogVisible = false;
+      }
     },
     dicChange(name, row) {
       if (name == "shortName") {
@@ -4043,7 +4079,7 @@ export default {
       let that = this;
       // 关闭按钮的监听点击
       closeBtn.action = function() {
-        console.log(that.$refs.ReportContainer, "1022");
+        // console.log(that.$refs.ReportContainer, "1022");
         if (that.$refs.reportContainer) that.$refs.reportContainer.hideContainer();
       };
 
@@ -4147,7 +4183,7 @@ export default {
     "assemblyForm.mblno": {
       // 执行方法
       handler(oldValue, newValue) {
-        console.log(oldValue, newValue);
+        // console.log(oldValue, newValue);
         if (oldValue) {
           amendsList(1, 10, { status: 3, mblno: this.assemblyForm.mblno, businessType: "SEA" }).then(res => {
             if (res.data.data.records.length > 0) {

+ 62 - 5
src/views/iosBasicData/SeafreightExportF/bills/billsDetails.vue

@@ -573,6 +573,7 @@ import { isProcurement } from "@/api/basicData/configuration";
 import { similarValues } from "@/util/verifyData";
 import _ from "lodash";
 import Fingerprint2 from "fingerprintjs2";
+import { containersSubmitList } from "@/api/iosBasicData/containers";
 export default {
   components: {
     checkSchedule,
@@ -1279,7 +1280,12 @@ export default {
     },
     // 主要信息是否更改
     mainDataChanged() {
-      let changed =
+      let changed = {
+        changed: false,
+        main: false,
+        containersList: false,
+      }
+      changed.changed =
         !this.form.id ||
         contrastObj(this.form, this.oldForm) ||
         contrastObj(this.form.hmmEdi, this.oldForm.hmmEdi) ||
@@ -1291,13 +1297,42 @@ export default {
         contrastList(this.form.filesList, this.oldForm.filesList) ||
         contrastList(this.form.waitingBoxList, this.oldForm.waitingBoxList);
 
+      changed.c1 = !this.form.id
+      changed.c2 = contrastObj(this.form, this.oldForm)
+      changed.c3 = contrastObj(this.form.hmmEdi, this.oldForm.hmmEdi)
+      changed.c4 = contrastObj(this.form.preContainersList, this.oldForm.preContainersList)
+      changed.c5 = contrastList(this.form.containersList, this.oldForm.containersList)
+      changed.c6 = contrastList(this.form.feeCenterListC, this.oldForm.feeCenterListC)
+      changed.c7 = contrastList(this.form.feeCenterListD, this.oldForm.feeCenterListD)
+      changed.c8 = contrastList(this.form.filesList, this.oldForm.filesList)
+      changed.c9 = contrastList(this.form.waitingBoxList, this.oldForm.waitingBoxList)
+
+      if(changed.changed){
+        if(!this.form.id ||
+          contrastObj(this.form, this.oldForm) ||
+          contrastObj(this.form.hmmEdi, this.oldForm.hmmEdi) ||
+          contrastObj(this.form.detail, this.oldForm.detail) ||
+          contrastList(this.form.preContainersList, this.oldForm.preContainersList) ||
+          contrastList(this.form.feeCenterListC, this.oldForm.feeCenterListC) ||
+          contrastList(this.form.feeCenterListD, this.oldForm.feeCenterListD) ||
+          contrastList(this.form.filesList, this.oldForm.filesList) ||
+          contrastList(this.form.waitingBoxList, this.oldForm.waitingBoxList)
+        ){
+          changed.main=true;
+        }
+
+        if(contrastList(this.form.containersList, this.oldForm.containersList)){
+          changed.containersList=true;
+        }
+      }
+
       return changed;
     },
     addEdit() {
       if (this.form.billStatus >= 3) {
         this.$emit("toAddEdit");
       } else {
-        if (this.mainDataChanged()) {
+        if (this.mainDataChanged().changed) {
           this.$confirm("是否需要保存?", "提示", {
             confirmButtonText: "确定",
             cancelButtonText: "取消",
@@ -2559,7 +2594,7 @@ export default {
     },
     //返回列表
     backToList() {
-      if (this.mainDataChanged()) {
+      if (this.mainDataChanged().changed) {
         this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
@@ -2842,7 +2877,8 @@ export default {
     },
     // 大保存按钮
     async editCustomer(status, callback) {
-      if(!this.mainDataChanged()){
+      let changed = this.mainDataChanged()
+      if(!changed.changed){
         if(typeof callback == "function"){
           callback()
         }
@@ -2871,8 +2907,18 @@ export default {
         // 未更改,无需保存
       }
 
+      console.log(changed);
+
       await this.$refs.form.validate(async valid => {
+        // 没有校验项
+        valid = true
         if (valid) {
+          if(!changed.main && changed.containersList){
+            await containersSubmitList(this.form.containersList);
+            this.billsDetailfun(this.form.id);
+            return
+          }
+
           if (this.business == 1) {
             for (let item of this.columnforfun("accDeptName").dicData) {
               if (this.form.accDeptName == item.title) {
@@ -3459,8 +3505,14 @@ export default {
       }
 
       billsSubmit(this.form)
-        .then(res => {
+        .then(async res => {
           this.pageLoading = false;
+
+          // 保存箱号
+          if(contrastList(this.form.containersList, this.oldForm.containersList)){
+            await containersSubmitList(this.form.containersList);
+          }
+
           if (res.data.code === 601) {
             this.billsDetailfun(this.form.id, undefined, callback);
             this.$message({
@@ -3699,12 +3751,16 @@ export default {
 
       if (status === "containersList") {
         this.$set(this.form, "containersList", res.data.data.containersList);
+        this.$set(this.oldForm, "containersList", res.data.data.containersList);
 
         return;
       }
 
       // this.form = res.data.data;
       this.$set(this, "form", res.data.data);
+
+      console.log(this.form);
+
       // 如果已经请核就禁用按钮
       if (this.form.status == 1 || this.form.status == 2 || this.form.status == 3) {
         this.detailData.seeDisabled = true;
@@ -3850,6 +3906,7 @@ export default {
       }
 
       if (typeof callback === "function") {
+        console.log("do callback", callback)
         callback();
       }
     },

+ 93 - 18
src/views/iosBasicData/SeafreightExportF/bills/index.vue

@@ -52,7 +52,16 @@
           <el-button type="primary" size="small" plain v-if="query.billStatus == 1" @click="revokeWithdrawalfun(1)">撤销退舱 </el-button>
           <el-button type="danger" size="small" plain v-if="query.billStatus != 3" @click="handleDelete">删 除 </el-button>
           <el-button type="warning" size="small" @click="outExport">导 出 </el-button>
-          <el-button type="primary" size="small" plain @click="importMagicHand">导入 MH </el-button>
+          <!--          <el-button type="primary" size="small" plain @click="importMagicHand">导入 MH</el-button>-->
+          <!--          <el-button type="primary" size="small" plain @click="importMscBlNo">导入 MSC 主单号</el-button>-->
+          <el-dropdown style="line-height: 0">
+            <el-button size="small" type="success"> 导入<i class="el-icon-arrow-down el-icon--right"></i> </el-button>
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item :key="'mh'" @click.native="importMagicHand">导入 MH</el-dropdown-item>
+              <el-dropdown-item :key="'msc-blno'" @click.native="importMscBlNo">导入 MSC 主单号</el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
+
           <el-dropdown v-if="ediData_SO.length > 0" style="line-height: 0">
             <el-button size="small" type="success" :disabled="selectionList.length == 0">
               发送 SO EDI<i class="el-icon-arrow-down el-icon--right"></i>
@@ -89,7 +98,7 @@
           </el-dropdown>
           <div style="margin-top: 10px">
             <el-tabs type="card" v-model="query.billStatus" @tab-click="handleClick">
-<!--              <el-tab-pane label="全部" name="999"></el-tab-pane>-->
+              <!--              <el-tab-pane label="全部" name="999"></el-tab-pane>-->
               <el-tab-pane label="处理中" name="888"></el-tab-pane>
               <el-tab-pane label="接单" name="0">
                 <span slot="label">接单</span>
@@ -389,11 +398,22 @@
       class="avue-dialog avue-dialog--top"
       width="30%"
     >
-      <span>{{ediTypeRow.progressText}}<br /><br /></span>
+      <span>{{ ediTypeRow.progressText }}<br /><br /></span>
       <div class="avue-dialog__footer">
         <!--        <el-button @click="ediShowProgress = false">取消保存</el-button>-->
       </div>
     </el-dialog>
+
+    <el-dialog title="导入 MSC 主单号文件" append-to-body :visible.sync="mscBox" width="555px" :close-on-click-modal="false" v-dialog-drag>
+      <avue-form
+        :option="mscOption"
+        v-model="mscForm"
+        :table-loading="mscLoading"
+        :upload-before="beforeUploadMscFile"
+        :upload-after="onSuccessUploadMscFile"
+      >
+      </avue-form>
+    </el-dialog>
   </div>
 </template>
 
@@ -415,7 +435,8 @@ import {
   revokeBillBatch,
   batchCopyBills,
   postMagicHandImportBills,
-  beforeSendingEdi
+  beforeSendingEdi,
+  postImportMscBillNo
 } from "@/api/iosBasicData/bills";
 import { mapGetters } from "vuex";
 import billsDetails from "@/views/iosBasicData/SeafreightExportF/bills/billsDetails.vue";
@@ -724,7 +745,7 @@ export default {
             search: true,
             span: 6,
             searchOrder: 5,
-            hide: true,
+            hide: true
             // showColumn: false
           },
           {
@@ -818,7 +839,7 @@ export default {
             hide: true,
             filterable: true,
             filters: true,
-            sortable: true,
+            sortable: true
             // showColumn: false
           },
           {
@@ -913,7 +934,7 @@ export default {
             search: true,
             span: 6,
             searchOrder: 14,
-            hide: true,
+            hide: true
             // showColumn: false
           },
           {
@@ -1684,7 +1705,30 @@ export default {
             action: "api/blade-los/magicHandImport/importZip"
           }
         ]
-      }
+      },
+
+      mscBox: false,
+      mscForm: {},
+      mscLoading: false,
+      mscOption: {
+        submitBtn: false,
+        emptyBtn: false,
+        column: [
+          {
+            label: "模板上传",
+            prop: "mscFile",
+            type: "upload",
+            drag: true,
+            loadText: "模板上传中,请稍等",
+            span: 24,
+            propsHttp: {
+              res: "data"
+            },
+            tip: "请上传 .zip,.xls,.xlsx 标准格式文件",
+            action: "api/blade-los/magicHandImport/importMscBlNo"
+          }
+        ]
+      },
     };
   },
   computed: {
@@ -2010,10 +2054,10 @@ export default {
 
       this.ediTypeRow.filesFunction = this.ediTypeRow["func_" + func];
 
-      this.ediShowProgress = true
+      this.ediShowProgress = true;
       editypesSendingEdi(this.ediTypeRow)
         .then(res => {
-          this.ediShowProgress = false
+          this.ediShowProgress = false;
           // 判断data是否有值,没有值说明不成功给个弹窗返回
           if (!res.data.data) {
             let text = res.data.msg.replace("\r\n", "<br>");
@@ -2030,7 +2074,7 @@ export default {
           }
         })
         .catch(err => {
-          this.ediShowProgress = false
+          this.ediShowProgress = false;
         });
     },
     async editypesSendingEdifun(row) {
@@ -2046,8 +2090,8 @@ export default {
       }
 
       this.ediTypeRow = row;
-      this.$set(this.ediTypeRow, 'progressText', `正在发送 ${row.cnName},请稍候...`)
-      this.ediShowProgress = true
+      this.$set(this.ediTypeRow, "progressText", `正在发送 ${row.cnName},请稍候...`);
+      this.ediShowProgress = true;
 
       if (this.ids.indexOf(",") < 0) {
         // 单选
@@ -2082,10 +2126,10 @@ export default {
         }
       }
 
-      this.ediShowProgress = true
+      this.ediShowProgress = true;
       editypesSendingEdi(row)
         .then(res => {
-          this.ediShowProgress = false
+          this.ediShowProgress = false;
           // 判断data是否有值,没有值说明不成功给个弹窗返回
           if (!res.data.data) {
             let text = res.data.msg.replace("\r\n", "<br>");
@@ -2102,7 +2146,7 @@ export default {
           }
         })
         .catch(err => {
-          this.ediShowProgress = false
+          this.ediShowProgress = false;
         });
     },
     // 获取EDI列表数据
@@ -2159,7 +2203,7 @@ export default {
         pageSize: 10,
         currentPage: 1,
         total: 0
-      }
+      };
       this.onLoad(this.page, this.query);
     },
     // 获取委托人数据
@@ -2702,7 +2746,7 @@ export default {
       let q = JSON.parse(JSON.stringify(this.query));
       this.query = {
         billStatus: q.billStatus ? q.billStatus : "888",
-        billSort: q.billSort ? q.billSort : "3",
+        billSort: q.billSort ? q.billSort : "3"
       };
       // this.query.billSort = this.query.billSort ? this.query.billSort : "3";
       this.onLoad(this.page);
@@ -2820,6 +2864,37 @@ export default {
         this.magicHandBox = false;
       }
     },
+    importMscBlNo() {
+      this.mscBox = true
+    },
+    beforeUploadMscFile(file, done, loading) {
+      done();
+      loading = true;
+    },
+    // 上传成功
+    onSuccessUploadMscFile(res, done, loading, column) {
+      try {
+        if (Array.isArray(res) && res.length>0) {
+          let html = "成功导入下列主单号:";
+          res.forEach(item => {
+            html += `<br>${item.billNo} ${item.bookingNo} ${item.mblno}`
+          })
+          this.$message({
+            type: "success",
+            dangerouslyUseHTMLString: true,
+            message: html,
+            duration: 5000
+          })
+          this.onLoad(this.page);
+        }else{
+          this.$message.warning("没有导入任何主单号!");
+        }
+      } finally {
+        loading = false;
+        done();
+        this.mscBox = false;
+      }
+    },
     //自定义列保存
     async saveColumn(ref, option, optionBack, code) {
       /**

+ 29 - 27
src/views/iosBasicData/accounts/index.vue

@@ -165,14 +165,14 @@ import {
               label: "科目代码",
               prop: "code",
               search: true,
-              width: "80",
+              width: 100,
               overHidden: true,
             },
             {
               label: "中文名称",
               prop: "cnName",
               search: true,
-              width: "80",
+              width: 200,
               overHidden: true,
             },
             {
@@ -181,7 +181,7 @@ import {
               overHidden: true,
               type:'select',
               search: true,
-                width: "50",
+                width: 50,
               dicData:[
                   {
                       label:'借方',
@@ -199,7 +199,7 @@ import {
               overHidden: true,
               search: true,
               type:'select',
-                width: "50",
+                width: 50,
               dicData:[
                   {
                       label:'否',
@@ -216,7 +216,7 @@ import {
               prop: "curCode",
               overHidden: true,
               search: true,
-                width: "50",
+                width: 50,
             },
             // {
             //   label: "数量",
@@ -242,7 +242,7 @@ import {
               overHidden: true,
               search: true,
               type:'select',
-                width: "50",
+                width: 50,
               dicData:[
                   {
                       label:'否',
@@ -260,7 +260,7 @@ import {
               overHidden: true,
               search: true,
               type:'select',
-                width: "50",
+                width: 50,
               dicData:[
                   {
                       label:'否',
@@ -278,7 +278,7 @@ import {
               overHidden: true,
               search: true,
               type:'select',
-                width: "50",
+                width: 50,
               dicData:[
                   {
                       label:'否',
@@ -314,7 +314,7 @@ import {
                 overHidden: true,
                 search: true,
                 type:'select',
-                width: "120",
+                width: 120,
                 dicData:[
                     {
                         label:'否',
@@ -330,6 +330,7 @@ import {
                 label: "上级科目",
                 prop: "parentCode",
                 overHidden: true,
+              width: 120,
             },
               // {
               //     label: "children",
@@ -339,115 +340,116 @@ import {
             {
                 label: "期初数量借方",
                 prop: "quantityOpenDr",
-                width: "100",
+                width: 120,
                 overHidden: true,
             },
             {
               label: "期初本币借方金额",
               prop: "amountOpenDr",
-              width: "120",
+              width: 120,
               overHidden: true,
             },
             {
               label: "期初外币借方金额",
               prop: "amountOpenDrUsd",
-              width: "120",
+              width: 120,
               overHidden: true,
             },
             {
                 label: "期初数量贷方",
                 prop: "quantityOpenCr",
                 overHidden: true,
-                width: "120",
+                width: 120,
             },
             {
               label: "期初本币贷方金额",
               prop: "amountOpenCr",
               overHidden: true,
-              width: "120",
+              width: 120,
             },
             {
               label: "期初外币贷方金额",
               prop: "amountOpenCrUsd",
               overHidden: true,
-              width: "120",
+              width: 120,
             },
             {
                 label: "期初数量余额",
                 prop: "quantityOpenUsdBlc",
                 overHidden: true,
-                width: "120",
+                width: 120,
             },
             {
                 label: "期初本币余额",
                 prop: "amountOpenBlc",
                 overHidden: true,
-                width: "120",
+                width: 120,
             },
             {
                 label: "期初外币余额",
                 prop: "amountOpenUsdBlc",
                 overHidden: true,
-                width: "120",
+                width: 120,
             },
             {
                 label: "本期数量借方",
                 prop: "quantityDr",
-                width: "120",
+                width: 120,
                 overHidden: true,
             },
             {
                 label: "本期本币借方金额",
                 prop: "amountDr",
-                width: "120",
+                width: 120,
                 overHidden: true,
             },
             {
                 label: "本期外币借方金额",
                 prop: "amountDrUsd",
-                width: "120",
+                width: 120,
                 overHidden: true,
             },
             {
                 label: "本期数量贷方",
                 prop: "quantityCr",
-                width: "120",
+                width: 120,
                 overHidden: true,
             },
             {
                 label: "本期本币贷方金额",
                 prop: "amountCr",
-                width: "120",
+                width: 120,
                 overHidden: true,
             },
             {
                 label: "本期外币贷方金额",
                 prop: "amountCrUsd",
-                width: "120",
+                width: 120,
                 overHidden: true,
             },
             {
                 label: "本期数量余额",
                 prop: "quantityUsdBlc",
-                width: "120",
+                width: 120,
                 overHidden: true,
             },
             {
                 label: "本期本币余额",
                 prop: "amountBlc",
-                width: "120",
+                width: 120,
                 overHidden: true,
             },
             {
                 label: "本期外币余额",
                 prop: "amountUsdBlc",
-                width: "120",
+                width: 120,
                 overHidden: true,
             },
             {
                 label: "备注",
                 prop: "remarks",
                 overHidden: true,
+              width: 200,
             },
           ]
         },

+ 12 - 7
src/views/iosBasicData/baccelements/index.vue

@@ -135,12 +135,12 @@ export default {
         viewBtn: true,
         selection: true,
         dialogClickModal: false,
-          menuWidth:260,
+        menuWidth:260,
         column: [
           {
             label: "编码",
             prop: "code",
-            width: "180",
+            width: 180,
             search: true,
             slot: true,
             rules: [{
@@ -152,7 +152,7 @@ export default {
           {
             label: "中文名称",
             prop: "cnName",
-            width: "180",
+            width: 180,
             search: true,
             slot: true,
             rules: [{
@@ -164,7 +164,7 @@ export default {
           {
             label: "英文名称",
             prop: "enName",
-            width: "180",
+            width: 180,
             search: true,
             slot: true,
             rules: [{
@@ -177,6 +177,7 @@ export default {
             label: "状态",
             prop: "status",
             type: "select",
+            width: 100,
             dicData: [{
               label: '启用',
               value: 0
@@ -190,27 +191,30 @@ export default {
               label: "创建人",
               prop: "createUserName",
                 display: false,
+              width: 100,
             },
             {
               label: "创建部门",
               prop: "createDeptName",
                 display: false,
+              width: 100,
             },
             {
               label: "创建时间",
               prop: "createTime",
-                width: "160",
+                width: 160,
                 display: false,
             },
             {
               label: "修改人",
               prop: "updateUserName",
                 display: false,
+              width: 100,
             },
             {
               label: "修改时间",
               prop: "updateTime",
-                width: "160",
+                width: 160,
                 display: false,
             },
           {
@@ -218,12 +222,13 @@ export default {
             prop: "isDeleted",
               hide: true,
               display: false,
+            width: 100,
           },
           {
             label: "备注",
             prop: "remarks",
             type: 'textarea',
-            width: "180",
+            width: 180,
             span: 24,
             minRows: 3,
             slot: true