Bladeren bron

预装箱单字段调整

jbb 2 jaren geleden
bovenliggende
commit
4953ce0c6f

+ 37 - 38
src/views/advance-packingList/adPaList-clothes.vue

@@ -6,22 +6,34 @@
       <div class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="searchQuery">
           <a-row :gutter="24">
-             <a-col :md="6" :sm="8">
+             <!-- <a-col :md="6" :sm="8">
               <a-form-item label="单据号">
                 <a-input placeholder="请输入单据号" v-model="queryParam.documentNo"></a-input>
               </a-form-item>
-            </a-col>
-            <a-col :md="6" :sm="8">
+            </a-col> -->
+            <!-- <a-col :md="6" :sm="8">
               <a-form-item label="订单号">
                 <a-input placeholder="请输入订单号" v-model="queryParam.orderNumber"></a-input>
               </a-form-item>
-            </a-col>
+            </a-col> -->
 
             <a-col :md="6" :sm="8">
               <a-form-item label="款号">
                 <a-input placeholder="请输入款号" v-model="queryParam.itemNumber"></a-input>
               </a-form-item>
             </a-col>
+               <a-col :md="6" :sm="8">
+              <a-form-item label="小po">
+                <a-input placeholder="请输入小po" v-model="queryParam.smallPo"></a-input>
+              </a-form-item>
+            </a-col>
+
+            <a-col :md="6" :sm="8">
+              <a-form-item label="分销点">
+                <a-input placeholder="请输入分销点" v-model="queryParam.distributionPoint"></a-input>
+              </a-form-item>
+            </a-col>
+
 
            
             <template v-if="toggleSearchStatus">
@@ -37,24 +49,11 @@
                 />
               </a-form-item>
             </a-col> -->
-             <a-col :md="6" :sm="8">
+             <!-- <a-col :md="6" :sm="8">
               <a-form-item label="品名">
                 <a-input placeholder="请输入品名" v-model="queryParam.productName"></a-input>
               </a-form-item>
-            </a-col>
-
-            <a-col :md="6" :sm="8">
-              <a-form-item label="小po">
-                <a-input placeholder="请输入小po" v-model="queryParam.smallPo"></a-input>
-              </a-form-item>
-            </a-col>
-
-            <a-col :md="6" :sm="8">
-              <a-form-item label="分销点">
-                <a-input placeholder="请输入分销点" v-model="queryParam.distributionPoint"></a-input>
-              </a-form-item>
-            </a-col>
-
+            </a-col> -->
 
             <a-col :md="6" :sm="8">
                <a-form-item label="预发货日期">
@@ -119,7 +118,7 @@
         :scroll="{ x: 1500 }"
       >
         <!-- 推送状态 -->
-        <span slot="pushStatesSlot" slot-scope="text, record">
+        <span slot="pushStatesSlot" slot-scope="text, record" :title="record.memo">
           <a-tag color="#2db7f5" v-if="record.pushStatus == '0' || record.pushStatus == null ">未推送</a-tag>
           <a-tag color="#87d068" v-if="record.pushStatus == '1'">推送成功</a-tag>
           <a-tag color="#f50" v-if="record.pushStatus == '2'">推送失败</a-tag>
@@ -264,15 +263,15 @@ export default {
           className: 'replacecolor'
         },
         {
-          title: '号',
-          dataIndex: 'itemNumber',
+          title: '订单号',
+          dataIndex: 'orderNumber',
           width: 120,
           fixed: 'left',
           className: 'replacecolor'
         },
         {
-          title: '订单号',
-          dataIndex: 'orderNumber',
+          title: '号',
+          dataIndex: 'itemNumber',
           width: 120,
           fixed: 'left',
           className: 'replacecolor'
@@ -368,12 +367,12 @@ export default {
           width: 100,
           className: 'replacecolor'
         },
-        {
-          title: '总价',
-          dataIndex: 'totalPrice',
-          width: 100,
-          className: 'replacecolor'
-        },
+        // {
+        //   title: '总价',
+        //   dataIndex: 'totalPrice',
+        //   width: 100,
+        //   className: 'replacecolor'
+        // },
         {
           title: '集装箱代号',
           dataIndex: 'containerCode',
@@ -415,14 +414,14 @@ export default {
           fixed: 'right',
           className: 'replacecolor'
         },
-        {
-          title: '原因',
-          dataIndex: 'memo',
-          width: 220,
-          fixed: 'right',
-          customRender: t => ellipsis(t),
-          className: 'replacecolor'
-        },
+        // {
+        //   title: '原因',
+        //   dataIndex: 'memo',
+        //   width: 220,
+        //   fixed: 'right',
+        //   customRender: t => ellipsis(t),
+        //   className: 'replacecolor'
+        // },
         {
           title: '操作',
           dataIndex: 'operation',

+ 131 - 143
src/views/advance-packingList/addAdpackingDrawer.vue

@@ -16,19 +16,28 @@
           <a-form-model layout="inline" ref="form" :model="addAdpacking">
             <a-row :gutter="24">
               <a-col :md="6" :sm="8">
-                <a-form-model-item label="单据号" prop="orderNumber">
-                  <a-input placeholder="自动生成" v-model="addAdpacking.orderNumber" readOnly></a-input>
+                <a-form-model-item label="单据号" prop="documentNo">
+                  {{addAdpacking.documentNo | ellipsis}}
+                  <!-- <a-input placeholder="自动生成" v-model="addAdpacking.orderNumber" readOnly></a-input> -->
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="8">
+                <a-form-model-item label="单据号" prop="documentNo">
+                  {{addAdpacking.orderNumber | ellipsis}}
+                  <!-- <a-input placeholder="自动生成" v-model="addAdpacking.orderNumber" readOnly></a-input> -->
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="集装箱代号" prop="containerCode">
-                  <a-input placeholder="请输入集装箱代号" v-model="addAdpacking.containerCode" readOnly></a-input>
+                  {{addAdpacking.containerCode | ellipsis}}
+                  <!-- <a-input placeholder="请输入集装箱代号" v-model="addAdpacking.containerCode" readOnly></a-input> -->
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="集装箱号" prop="containerNumber">
-                  <a-input placeholder="请输入集装箱号" v-model="addAdpacking.containerNumber" readOnly></a-input>
+                  {{addAdpacking.containerNumber | ellipsis}}
+                  <!-- <a-input placeholder="请输入集装箱号" v-model="addAdpacking.containerNumber" readOnly></a-input> -->
                 </a-form-model-item>
               </a-col>
 
@@ -44,31 +53,36 @@
               </a-col>
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="款号" prop="itemNumber">
-                  <a-input placeholder="选择子表自动生成" v-model="addAdpacking.itemNumber"></a-input>
+                  {{addAdpacking.itemNumber | ellipsis}}
+                  <!-- <a-input placeholder="选择子表自动生成" v-model="addAdpacking.itemNumber"></a-input> -->
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="中文品名" prop="productName">
-                  <a-input placeholder="选择子表自动生成" v-model="addAdpacking.productName"></a-input>
+                  {{addAdpacking.productName | ellipsis}}
+                  <!-- <a-input placeholder="选择子表自动生成" v-model="addAdpacking.productName"></a-input> -->
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="英文品名" prop="productName">
-                  <a-input placeholder="选择子表自动生成" v-model="addAdpacking.englishProductName"></a-input>
+                  {{addAdpacking.englishProductName | ellipsis}}
+                  <!-- <a-input placeholder="选择子表自动生成" v-model="addAdpacking.englishProductName"></a-input> -->
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="尺码范围" prop="sizeRange">
-                  <a-input placeholder="选择子表自动生成" v-model="addAdpacking.sizeRange" readOnly></a-input>
+                  {{addAdpacking.sizeRange | ellipsis}}
+                  <!-- <a-input placeholder="选择子表自动生成" v-model="addAdpacking.sizeRange" readOnly></a-input> -->
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="客户" prop="customer">
-                  <a-input placeholder="选择子表自动生成" v-model="addAdpacking.customer"></a-input>
+                  {{addAdpacking.customer  | ellipsis }}
+                  <!-- <a-input placeholder="选择子表自动生成" v-model="addAdpacking.customer"></a-input> -->
                 </a-form-model-item>
               </a-col>
 
@@ -81,32 +95,38 @@
               </a-col> -->
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="总箱数" prop="totalBoxes">
-                  <a-input placeholder="自动生成" v-model="addAdpacking.totalBoxes" readOnly></a-input>
+                  {{addAdpacking.totalBoxes | ellipsis }}
+                  <!-- <a-input placeholder="自动生成" v-model="addAdpacking.totalBoxes" readOnly></a-input> -->
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="总净重" prop="totalNetWeight">
-                  <a-input placeholder="自动生成" v-model="addAdpacking.totalNetWeight" readOnly></a-input>
+                  {{addAdpacking.totalNetWeight | ellipsis}}
+                  <!-- <a-input placeholder="自动生成" v-model="addAdpacking.totalNetWeight" readOnly></a-input> -->
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="总毛重" prop="totalGrossWeight">
-                  <a-input placeholder="自动生成" v-model="addAdpacking.totalGrossWeight" readOnly></a-input>
+                  {{addAdpacking.totalGrossWeight  | ellipsis}}
+                  <!-- <a-input placeholder="自动生成" v-model="addAdpacking.totalGrossWeight" readOnly></a-input> -->
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="总体积" prop="totalVolume">
-                  <a-input placeholder="自动生成" v-model="addAdpacking.totalVolume" readOnly></a-input>
+                  {{addAdpacking.totalVolume | ellipsis}}
+                  <!-- <a-input placeholder="自动生成" v-model="addAdpacking.totalVolume" readOnly></a-input> -->
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="总价" prop="totalPrice">
-                  <a-input placeholder="自动生成" v-model="addAdpacking.totalPrice" readOnly></a-input>
+                  {{addAdpacking.totalPrice  | ellipsis}}
+                  <!-- <a-input placeholder="自动生成" v-model="addAdpacking.totalPrice" readOnly></a-input> -->
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="总件数" prop="totalNumber">
-                  <a-input placeholder="自动生成" v-model="addAdpacking.total" readOnly></a-input>
+                  {{addAdpacking.total  | ellipsis}}
+                  <!-- <a-input placeholder="自动生成" v-model="addAdpacking.total" readOnly></a-input> -->
                 </a-form-model-item>
               </a-col>
             </a-row>
@@ -278,8 +298,6 @@ export default {
           key: 'startingBoxNumber',
           width: 120,
           type: JVXETypes.inputNumber ,
-          validateRules:[{ required: true, message: '${title}不能为空' },
-          {pattern: /^[1-9]\d*$/, message: '请输入零以上的正整数' }],
         },
 
         {
@@ -287,8 +305,6 @@ export default {
           key: 'endCaseNumber',
           width: 140,
           type: JVXETypes.inputNumber ,
-          validateRules:[{ required: true, message: '${title}不能为空' },
-          {pattern: /^[1-9]\d*$/, message: '请输入零以上的正整数' }],
         },
 
         {
@@ -301,7 +317,7 @@ export default {
           title: '配码--根据U8订单来显示',
           key: 'withCode',
           width: 240,
-          type: JVXETypes.input ,
+          type: JVXETypes.normal ,
         },
         {
           title: '计划尺码数量',
@@ -326,8 +342,6 @@ export default {
           key: 'boxNumber',
           width: 140,
           type: JVXETypes.normal ,
-          validateRules:[{ required: true, message: '${title}不能为空' },
-            {pattern: /^[1-9]\d*$/, message: '请输入零以上的正整数' }],
         },
 
         {
@@ -341,8 +355,6 @@ export default {
           key: 'netWeight',
           width: 90,
           type: JVXETypes.inputNumber,
-          validateRules: [{ required: true, message: '${title}不能为空' },
-            {pattern: /^\d+(\.\d{1,2})?$/, message: '小数点位数不能超过2位' }]
         },
         {
           title: '总净重',
@@ -356,8 +368,6 @@ export default {
           key: 'grossWeight',
           width: 120,
           type: JVXETypes.inputNumber,
-          validateRules: [{ required: true, message: '${title}不能为空' },
-            {pattern: /^\d+(\.\d{1,2})?$/, message: '小数点位数不能超过2位' }]
         },
         {
           title: '总毛重',
@@ -369,9 +379,7 @@ export default {
           title: '外箱长度',
           key: 'outerBoxLength',
           width: 120,
-          type: JVXETypes.inputNumber,
-          validateRules: [{ required: true, message: '${title}不能为空' },
-            ]
+          type: JVXETypes.inputNumber
         },
 
         {
@@ -379,15 +387,11 @@ export default {
           key: 'outerBoxWidth',
           width: 140,
           type: JVXETypes.inputNumber,
-          validateRules: [{ required: true, message: '${title}不能为空' },
-         ]
         },
         {
           title: '外箱高度',
           key: 'outerBoxHeight',
           type: JVXETypes.inputNumber ,
-          validateRules: [{ required: true, message: '${title}不能为空' },
-          ],
           width: 140,
         },
 
@@ -403,8 +407,6 @@ export default {
           key: 'netWeightToo',
           width: 120,
           type: JVXETypes.inputNumber,
-          validateRules: [{ required: true, message: '${title}不能为空' },
-            {pattern: /^\d+(\.\d{1,2})?$/, message: '小数点位数不能超过2位' }],
         },
         {
           title: '单价',
@@ -420,6 +422,14 @@ export default {
         //    validateRules: [{ required: true, message: '${title}不能为空' },
         //     {pattern: /^\d+(\.\d{1,2})?$/, message: '小数点位数不能超过2位' }],
         },
+        {
+          title: '备注',
+          key: 'memo',          
+          width: 120,
+          type: JVXETypes.normal,
+        //    validateRules: [{ required: true, message: '${title}不能为空' },
+        //     {pattern: /^\d+(\.\d{1,2})?$/, message: '小数点位数不能超过2位' }],
+        },
         {
           title: '操作',
           key: 'action',
@@ -452,6 +462,7 @@ export default {
       // },
       sizeFields:[], // 尺码字段
       dotConfig:{}, // 小数点配置
+      judge : 0 ,
     }
   },
   // 接收父组件查询方法
@@ -543,114 +554,20 @@ export default {
         this.$message.error('当前记录没有尺码字段,无法保存');
         return;
       }
-      if (newObj.totalBoxes == 0){
-        this.$message.error('总箱数为0,无法保存');
-        return;
-      }
-      var sort = 0;
-      for (var i=0; i<newObj.syPreAssembledPackingListItemList.length;i++){
-        var tableRow = newObj.syPreAssembledPackingListItemList[i];
-        tableRow = JSON.parse(JSON.stringify(tableRow))
-        var allSizeSum = this.getAllSizeSum(tableRow);
-        if (allSizeSum == 0){
-          this.$message.error('第'+(i+1)+'行所有尺码数量为0,无法保存');
-          return;
-        }
-        if(tableRow.startingBoxNumber > tableRow.endCaseNumber) {
-           this.$message.error('第'+(i+1)+'行起始箱号大于结束箱号,无法保存');
-          return;
-        }
-        if (tableRow.startingBoxNumber == ""){
-          this.$message.error('第'+(i+1)+'行起始箱号未填,无法保存');
-          return;
-        }
-
-        //起始箱数判断
-        if(!Number.isInteger(Number(tableRow.startingBoxNumber))){
-          this.$message.error('第'+(i+1)+'行起始箱号不为整数,无法保存');
-          return
-        }
-        if (tableRow.endCaseNumber == ""){
-          this.$message.error('第'+(i+1)+'行结束箱号未填,无法保存');
-          return;
-        }
-        //结束箱数小数判断
-         if(!Number.isInteger(Number(tableRow.endCaseNumber))){
-          this.$message.error('第'+(i+1)+'行结束箱号不为整数,无法保存');
-          return
-        }
-        if (tableRow.boxNumber == "" || tableRow.boxNumber == 0){
-          this.$message.error('第'+(i+1)+'行箱数,无法保存');
-          return;
-        }
-        if (tableRow.netWeight == null || tableRow.netWeight == "" || tableRow.netWeight == undefined){
-          this.$message.error('第'+(i+1)+'行净重/箱未填,无法保存');
-          return;
-        }
-        //净重/箱小数判断
-        if(!Number.isInteger(Number(tableRow.netWeight))){
-           var position = tableRow.netWeight.toString().indexOf('.') + 1;   //小数点的位置
-            var digit = tableRow.netWeight.toString().length - position;  //小数的位数
-            if(digit > 2){
-              this.$message.error('第'+(i+1)+'行净重/箱超过两位小数,无法保存');
-              return 
-            }
-        }
-        if (tableRow.piecesBox == null || tableRow.piecesBox == "" || tableRow.piecesBox == undefined){
-          this.$message.error('第'+(i+1)+'行件数/箱未填,无法保存');
-          return;
-        }
-        //件数/箱小数判断
-        if(!Number.isInteger(tableRow.piecesBox)){
-          for (var i=0; i<this.sizeFields.length; i++){
-           if (!Number.isInteger(tableRow[this.sizeFields[i]]) ){
-             this.$message.error('第'+(i+1)+'行'+this.sizeFields[i]+'不为整数,无法保存');
-             return;
-           }
-           }
-        }
-        if (tableRow.grossWeight == null || tableRow.grossWeight == "" || tableRow.grossWeight == undefined){
-          this.$message.error('第'+(i+1)+'行毛重/箱未填,无法保存');
-          return;
-        }
-        //毛重/箱小数判断
-        if(!Number.isInteger(Number(tableRow.grossWeight))){
-           var position = tableRow.grossWeight.toString().indexOf('.') + 1;   //小数点的位置
-            var digit = tableRow.grossWeight.toString().length - position;  //小数的位数
-            if(digit > 2){
-              this.$message.error('第'+(i+1)+'行毛重/箱超过两位小数,无法保存');
-              return 
-            }
-        }
-        if (tableRow.outerBoxLength == null || tableRow.outerBoxLength == "" || tableRow.outerBoxLength == undefined){
-          this.$message.error('第'+(i+1)+'行外箱长度未填,无法保存');
-          return;
-        }
-        if (tableRow.outerBoxWidth == null || tableRow.outerBoxWidth == "" || tableRow.outerBoxWidth == undefined){
-          this.$message.error('第'+(i+1)+'行外箱宽度未填,无法保存');
-          return;
-        }
-        if (tableRow.outerBoxHeight == null || tableRow.outerBoxHeight == "" || tableRow.outerBoxHeight == undefined){
-          this.$message.error('第'+(i+1)+'行外箱高度未填,无法保存');
-          return;
-        }
-        if (tableRow.netWeightToo == null || tableRow.netWeightToo == "" || tableRow.netWeightToo == undefined){
-          this.$message.error('第'+(i+1)+'行净净重未填,无法保存');
-          return;
-        }
-        tableRow.sort = ++sort;
-      }
-
+      // if (newObj.totalBoxes == 0){
+      //   this.$message.error('总箱数为0,无法保存');
+      //   return;
+      // }
+      await this.JudgeVluabled()
       //尺码赋值
       for(var i =0;i<newObj.syPreAssembledPackingListItemList.length;i++){
         var dataTable = newObj.syPreAssembledPackingListItemList[i]
-        for (var j=0; j<tableRow.sizeTables.length; j++){
-          var sizeTable = tableRow.sizeTables[j];
+        for (var j=0; j<dataTable.sizeTables.length; j++){
+          var sizeTable = dataTable.sizeTables[j];
           var field = 'size-'+sizeTable.size;
          dataTable.sizeTables[j].proportion =  dataTable[field];
         }
       }
-
       // 日期格式转换
       if (newObj.preDeliveryDate != "" && newObj.preDeliveryDate != undefined){
         newObj.preDeliveryDate = newObj.preDeliveryDate+" 00:00:00";
@@ -659,8 +576,9 @@ export default {
       if (newObj.id == undefined || newObj.id == ""){
           newObj.push_status = 0;
       }
-      if(this.editDecide === 'edit'){
-       await  editById(newObj).then(res => {
+      if(this.judge == 0){
+        if(this.editDecide === 'edit'){
+        await  editById(newObj).then(res => {
           this.btnLoading = true
           if (res.success) {
              this.$message.success('编辑成功')
@@ -672,12 +590,12 @@ export default {
 
              this.fatherList() // 调用父组件 查询方法
             // this.msgFormSon = {}  清空子表信息
-          }else{
+           }else{
              this.$message.error(res.message)
               this.btnLoading = false
           }
          })
-      }else {
+       }else {
         await addAdvPac(newObj).then(res => {
           this.btnLoading = true
         if (res.success) {
@@ -689,12 +607,14 @@ export default {
           this.row = res.result
           this.fatherList() // 调用父组件 查询方法
           // this.msgFormSon = {}  清空子表信息
-        }else{
+         }else{
           this.$message.error(res.message)
            this.btnLoading = false
         }
       })
       }
+      }
+      
       
       
 
@@ -705,6 +625,74 @@ export default {
       //     that.confirmLoading = true
       //   }
       // })
+    },
+      JudgeVluabled(){
+          this.judge = 0
+           for (var i=0; i<this.addAdpacking.syPreAssembledPackingListItemList.length;i++){
+            var tableRow = this.addAdpacking.syPreAssembledPackingListItemList[i];
+             tableRow = JSON.parse(JSON.stringify(tableRow))
+            var allSizeSum = this.getAllSizeSum(tableRow);
+            if (allSizeSum == 0){
+              this.$message.error('第'+(i+1)+'行所有尺码数量为0,无法保存');
+              this.judge += 1
+              return;
+            }
+            if(tableRow.startingBoxNumber > tableRow.endCaseNumber) {
+              this.$message.error('第'+(i+1)+'行起始箱号大于结束箱号,无法保存');
+              this.judge += 1
+              return;
+            }
+            //是否未填
+            var required = [
+            {key:'startingBoxNumber',value:'起始箱号'},
+            {key:'endCaseNumber',value:'结束箱号'},
+            {key:'netWeight',value:'净重/箱'},
+            {key:'grossWeight',value:'毛重/箱'},
+            {key:'outerBoxLength',value:'外箱长度'},
+            {key:'outerBoxHeight',value:'外箱高度'},
+            {key:'outerBoxWidth',value:'外箱宽度'},
+            {key:'netWeightToo',value:'净净重'},
+            ]
+             for(var j=0 ; j<required.length;j++){
+                if(tableRow[required[j].key] == null || tableRow[required[j].key] == "" || tableRow[required[j].key] == undefined){
+                  this.$message.error('第'+(i+1)+'行'+required[j].value+'无值,无法保存');
+                  this.judge+=1
+                  return
+                }
+             }
+             
+
+             //是否为整
+             var integer = [
+               {key:'startingBoxNumber',value:'起始箱号'},
+               {key:'endCaseNumber',value:'结束箱号'},
+               {key:'piecesBox',value:'件数/箱'},
+             ]
+             for(var v=0 ; v<integer.length;v++){
+                if(!Number.isInteger(Number(tableRow[integer[v].key]))){
+                  this.$message.error('第'+(i+1)+'行'+integer[v].value+'不为整数,无法保存');
+                  this.judge+=1
+                  return
+                }
+             }
+
+            //判断小数位数
+            var Several = [
+               {key:'netWeight',value:'净重/箱'},
+               {key:'grossWeight',value:'毛重/箱'},
+               {key:'netWeightToo',value:'净净重'}
+             ]
+            for(var s=0 ; s<Several.length;s++){
+                var position =  tableRow[Several[s].key].toString().indexOf('.')  + 1;   //小数点的位置
+                var digit = tableRow[Several[s].key].toString().length - position;  //小数的位值
+                if(digit > 2 && position!==0 ){
+                 this.$message.error('第'+(i+1)+'行'+Several[s].value+'小数超过两位,无法保存');
+                this.judge+=1
+                 return 
+              }
+             }   
+           }
+      
     },
     // 设置表头信息
     setHeadData(referData, mData){
@@ -833,10 +821,10 @@ export default {
         event.row.totalPrice = (event.row.unitPrice*event.row.total).toFixed(2);
       }
       if (event.row.netWeight != "" && event.row.netWeight != undefined){
-        event.row.totalNetWeight = event.row.netWeight * event.row.boxNumber;
+        event.row.totalNetWeight = (event.row.netWeight * event.row.boxNumber).toFixed(2);
       }
       if (event.row.grossWeight != "" && event.row.grossWeight != undefined){
-        event.row.totalGrossWeight = event.row.grossWeight * event.row.boxNumber;
+        event.row.totalGrossWeight = (event.row.grossWeight * event.row.boxNumber).toFixed(2);
       }
       if (event.row.outerBoxLength != "" && event.row.outerBoxLength != undefined &&
       event.row.outerBoxWidth != "" && event.row.outerBoxWidth != undefined &&

+ 39 - 21
src/views/advance-packingList/detailsAdpackingDrawer.vue

@@ -16,19 +16,24 @@
           <a-form-model layout="inline" ref="form" :model="addAdpacking">
             <a-row :gutter="24">
               <a-col :md="6" :sm="8">
-                <a-form-model-item label="单据号" prop="orderNumber">
-                  {{addAdpacking.orderNumber}}
+                <a-form-model-item label="单据号" prop="documentNo">
+                  {{addAdpacking.orderNumber | ellipsis}}
+                </a-form-model-item>
+              </a-col>
+               <a-col :md="6" :sm="8">
+                <a-form-model-item label="单据号" prop="documentNo">
+                  {{addAdpacking.orderNumber | ellipsis}}
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="集装箱代号" prop="containerCode">
-                  {{addAdpacking.containerCode}}
+                  {{addAdpacking.containerCode | ellipsis}}
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="集装箱号" prop="containerNumber">
-                  {{addAdpacking.containerNumber}}
+                  {{addAdpacking.containerNumber | ellipsis}}
                 </a-form-model-item>
               </a-col>
 
@@ -39,36 +44,36 @@
               </a-col> -->
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="u8备注" prop="u8Remarks">
-                  {{addAdpacking.u8Remarks}}
+                  {{addAdpacking.u8Remarks | ellipsis}}
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="款号" prop="itemNumber">
-                  {{addAdpacking.itemNumber}}
+                  {{addAdpacking.itemNumber | ellipsis}}
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="中文品名" prop="productName">
-                 {{addAdpacking.productName}}
+                 {{addAdpacking.productName | ellipsis}}
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="英文品名" prop="productName">
-                  {{addAdpacking.englishProductName}}
+                  {{addAdpacking.englishProductName | ellipsis}}
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="尺码范围" prop="sizeRange">
-                  {{addAdpacking.sizeRange}}
+                  {{addAdpacking.sizeRange | ellipsis}}
                 </a-form-model-item>
               </a-col>
 
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="客户" prop="customer">
-                  {{addAdpacking.customer}}
+                  {{addAdpacking.customer | ellipsis}}
                 </a-form-model-item>
               </a-col>
 
@@ -82,32 +87,32 @@
               </a-col> -->
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="总箱数" prop="totalBoxes">
-                  {{addAdpacking.totalBoxes}}
+                  {{addAdpacking.totalBoxes | ellipsis}}
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="总净重" prop="totalNetWeight">
-                  {{addAdpacking.totalNetWeight}}
+                  {{addAdpacking.totalNetWeight | ellipsis}}
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="总毛重" prop="totalGrossWeight">
-                  {{addAdpacking.totalGrossWeight}}
+                  {{addAdpacking.totalGrossWeight | ellipsis}}
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="总体积" prop="totalVolume">
-                  {{addAdpacking.totalVolume}}
+                  {{addAdpacking.totalVolume | ellipsis}}
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="总价" prop="totalPrice">
-                  {{addAdpacking.totalPrice}}
+                  {{addAdpacking.totalPrice | ellipsis}}
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="总件数" prop="totalNumber">
-                  {{addAdpacking.total}}
+                  {{addAdpacking.total | ellipsis}}
                 </a-form-model-item>
               </a-col>
             </a-row>
@@ -125,14 +130,12 @@
               ref="vTable"
               toolbar
               row-number
-              row-selection
               drag-sort
               keep-source
               :height="300"
               :loading="loading"
               :dataSource="addAdpacking.syPreAssembledPackingListItemList"
               :columns="columns"
-              :alwaysEdit=true
               :bordered=true
               :scroll="{ x: 1500 }"
               style="margin-top: 5px;"
@@ -191,7 +194,7 @@ export default {
         },
       // 表头
       columns: [
-        {
+       {
           title: '账套',
           key: 'acSetNo',
           width: 120,
@@ -273,7 +276,7 @@ export default {
           width: 240,
           type: JVXETypes.normal ,
         },
-          {
+        {
           title: '计划尺码数量',
           key: 'planSize',
           width: 240,
@@ -333,7 +336,7 @@ export default {
           title: '外箱长度',
           key: 'outerBoxLength',
           width: 120,
-          type: JVXETypes.normal,
+          type: JVXETypes.normal
         },
 
         {
@@ -374,6 +377,21 @@ export default {
           width: 120,
           type: JVXETypes.normal,
         },
+        {
+          title: '备注',
+          key: 'memo',          
+          width: 120,
+          type: JVXETypes.normal,
+        },
+        {
+          title: '操作',
+          key: 'action',
+          type: JVXETypes.slot,
+          fixed: 'right',
+          width: 160,
+          align: 'center',
+         slotName: 'action',
+        }
       ],
 
       loading: false, // 表格加载

+ 85 - 78
src/views/advance-packingList/referShipmentDetailsModal.vue

@@ -13,11 +13,11 @@
       <div class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="searchQuery">
           <a-row :gutter="24">
-            <a-col :md="6" :sm="8">
+            <!-- <a-col :md="6" :sm="8">
               <a-form-item label="发运明细单号">
                 <a-input placeholder="请输入发运明细单号" v-model="queryParam.documentNo"></a-input>
               </a-form-item>
-            </a-col>
+            </a-col> -->
 
             <a-col :md="6" :sm="8">
               <a-form-item label="客户">
@@ -37,7 +37,17 @@
                </a-select>
               </a-form-item>
             </a-col>
+            <a-col :md="6" :sm="8">
+               <a-form-item label="业务员">
+                 <a-input placeholder="请输入Po" v-model="queryParam.salesman"></a-input>
+               </a-form-item>
+              </a-col>
             <template v-if="toggleSearchStatus">
+              <a-col :md="6" :sm="8">
+               <a-form-item label="成衣工厂">
+                 <a-input placeholder="请输入成衣工厂" v-model="queryParam.garmentFactory"></a-input>
+               </a-form-item>
+              </a-col>
               <a-col :md="6" :sm="8">
                <a-form-item label="Po">
                  <a-input placeholder="请输入Po" v-model="queryParam.smallPo"></a-input>
@@ -175,6 +185,13 @@ export default {
           width: 120,
           className: 'replacecolor'
         },
+         {
+          title: '数量(合计)',
+          dataIndex: 'shipmentQuantity',
+          width: 100,
+          className: 'replacecolor'
+        },
+
         //         {
         //   title: '创建时间',
         //   dataIndex: 'createTime',
@@ -191,73 +208,66 @@ export default {
           className: 'replacecolor'
         },
 
-        {
-          title: '预完工日期',
-          dataIndex: 'preCompletionDate',
-          width: 120,
-          className: 'replacecolor'
-        },
+        // {
+        //   title: '预完工日期',
+        //   dataIndex: 'preCompletionDate',
+        //   width: 120,
+        //   className: 'replacecolor'
+        // },
         {
           title: '存货名称',
           dataIndex: 'inventoryName',
           width: 220,
           className: 'replacecolor'
         },
-        {
-          title: '数量(合计)',
-          dataIndex: 'shipmentQuantity',
-          width: 100,
-          className: 'replacecolor'
-        },
-
-        {
-          title: '单价(销售)',
-          dataIndex: 'salesUnitPrice',
-          width: 120,
-          className: 'replacecolor'
-        },
-        {
-          title: '采购/委外订单号',
-          dataIndex: 'purOrSubOrder',
-          width: 140,
-          className: 'replacecolor'
-        },
-        {
-          title: '订单类型',
-          dataIndex: 'orderType',
-          width: 120,
-          className: 'replacecolor'
-        },
-        {
-          // (采购/委外单价)
-          title: '工厂单价',
-          dataIndex: 'factoryUnitPrice',
-          width: 100,
-          className: 'replacecolor'
-        },
-        {
-          // (单证维护)
-          title: '申报要素',
-          dataIndex: 'declarationElements',
-          width: 120,
-          customRender: t => ellipsis(t),
-          className: 'replacecolor'
-        },
+        // {
+        //   title: '单价(销售)',
+        //   dataIndex: 'salesUnitPrice',
+        //   width: 120,
+        //   className: 'replacecolor'
+        // },
+        // {
+        //   title: '采购/委外订单号',
+        //   dataIndex: 'purOrSubOrder',
+        //   width: 140,
+        //   className: 'replacecolor'
+        // },
+        // {
+        //   title: '订单类型',
+        //   dataIndex: 'orderType',
+        //   width: 120,
+        //   className: 'replacecolor'
+        // },
+        // {
+        //   // (采购/委外单价)
+        //   title: '工厂单价',
+        //   dataIndex: 'factoryUnitPrice',
+        //   width: 100,
+        //   className: 'replacecolor'
+        // },
+        // {
+        //   // (单证维护)
+        //   title: '申报要素',
+        //   dataIndex: 'declarationElements',
+        //   width: 120,
+        //   customRender: t => ellipsis(t),
+        //   className: 'replacecolor'
+        // },
 
-        {
-          // (存货自定义项)
-          title: '套装件数',
-          dataIndex: 'numberOfSets',
-          width: 100,
-          className: 'replacecolor'
-        },
-        {
-          title: '是否TC功能',
-          dataIndex: 'isTc',
-          // 0 否 、 1 是
-          width: 90,
-          className: 'replacecolor'
-        },
+        // {
+        //   // (存货自定义项)
+        //   title: '套装件数',
+        //   dataIndex: 'numberOfSets',
+        //   width: 100,
+        //   className: 'replacecolor'
+        // },
+        // {
+        //   title: '是否TC功能',
+        //   dataIndex: 'isTc',
+        //   // 0 否 、 1 是
+        //   width: 90,
+        //   className: 'replacecolor'
+        // },
         // {
         //   title: 'HScode',
         //   dataIndex: 'hsCode',
@@ -283,12 +293,12 @@ export default {
           width: 120,
           className: 'replacecolor'
         },
-        {
-          title: '报关单价',
-          dataIndex: 'customsDeclarationUnitPrice',
-          width: 120,
-          className: 'replacecolor'
-        }
+        // {
+        //   title: '报关单价',
+        //   dataIndex: 'customsDeclarationUnitPrice',
+        //   width: 120,
+        //   className: 'replacecolor'
+        // }
       ],
       data: [],
       confirmLoading: false,
@@ -296,14 +306,7 @@ export default {
 
       // 查询条件
       queryParam: {
-        documentNo: '',
-        customer: '',
-        status:'',
-        smallPo:'',
-        distributionPoint:'',
-        startDate:'',
-        endDate:'',
-        pageNo: ''
+        status:'y',
       },
       // 分页
       pagination: {
@@ -374,7 +377,9 @@ export default {
     },
     // 重置
     searchReset() {
-      this.queryParam = {}
+      this.queryParam = {
+        status:'y'
+      }
       this.preDeliveryDate = []
       this.getShipData()
     },
@@ -384,7 +389,9 @@ export default {
       this.referShipDetModVis = false
       this.selectedRowKeys = []
       this.data = []
-      this.queryParam = {}
+      this.queryParam = {
+        status:'y'
+      }
       this.preDeliveryDate = []
       this.getShipData()
     },