Browse Source

表格控件修改

jbb 2 years ago
parent
commit
2e638d978c

+ 238 - 125
src/views/advance-packingList/addAdpackingDrawer.vue

@@ -136,8 +136,107 @@
 
       <!-- 参照发运明细 増行-->
       <a-card :bordered="false" style="margin:10px 0 60px 0;">
+        <div class="table-operator">
+           <a-button type="primary" @click="referShipmentDetails" icon="ordered-list">参照出运明细</a-button>
+        </div>
+         <a-spin :spinning="confirmLoading">
+          <a-form-model ref="formRef" :rules="validatorRules">
+            <a-table
+              bordered
+              :row-key="record => record.id"
+              :columns="columns"
+              :data-source="addAdpacking.syPreAssembledPackingListItemList"
+              :loading="loading"
+              :pagination="ipagination"
+              :scroll="{ x: 1500,y: 350 }"
+              @change="handleTableChange"
+            >
+             <!-- itemCode -->
+             <template slot="itemCode" slot-scope="text, record, index">
+                <a-form-model-item prop="itemCode" :rules="rules.itemCode">
+                  <a-input style="width:100%" type="text" v-model="record.itemCode"  />
+                </a-form-model-item>
+              </template>
+             <!-- prepackSku  -->
+             <template slot="prepackSku" slot-scope="text, record, index">
+                <a-form-model-item prop="prepackSku" :rules="rules.prepackSku">
+                  <a-input style="width:100%" type="text" v-model="record.prepackSku"  />
+                </a-form-model-item>
+              </template>
+              <!-- 起始箱号 -->
+              <template slot="startingBoxNumber" slot-scope="text, record, index">
+                <a-form-model-item prop="startingBoxNumber" :rules="rules.startingBoxNumber">
+                  <a-input style="width:100%" type="text" v-model="record.startingBoxNumber"  @change="handleValueChange(record)"/>
+                </a-form-model-item>
+              </template>
+              <!-- 结束箱号 -->
+              <template slot="endCaseNumber" slot-scope="text, record, index">
+                <a-form-model-item prop="endCaseNumber" :rules="rules.endCaseNumber">
+                  <a-input style="width:100%" type="text" v-model="record.endCaseNumber"  @change="handleValueChange(record)"/>
+                </a-form-model-item>
+              </template>
+              <!-- 颜色 -->
+              <template slot="colour" slot-scope="text, record, index">
+                <a-form-model-item prop="colour" :rules="rules.colour">
+                  <a-input style="width:100%" type="text" v-model="record.colour"  />
+                </a-form-model-item>
+              </template>
+              <!-- 净重 -->
+              <template slot="netWeight" slot-scope="text, record, index">
+                <a-form-model-item prop="netWeight" :rules="rules.netWeight">
+                  <a-input style="width:100%" type="text" v-model="record.netWeight"  @change="handleValueChange(record)"/>
+                </a-form-model-item>
+              </template>
+              <!-- 毛重 -->
+              <template slot="grossWeight" slot-scope="text, record, index">
+                <a-form-model-item prop="grossWeight" :rules="rules.grossWeight">
+                  <a-input style="width:100%" type="text" v-model="record.grossWeight"  @change="handleValueChange(record)"/>
+                </a-form-model-item>
+              </template>
+              <!-- 外箱长度 -->
+              <template slot="outerBoxLength" slot-scope="text, record, index">
+                <a-form-model-item prop="outerBoxLength" :rules="rules.outerBoxLength">
+                  <a-input style="width:100%" type="text" v-model="record.outerBoxLength"  @change="handleValueChange(record)"/>
+                </a-form-model-item>
+              </template>
+              <!-- 外箱宽度 -->
+               <template slot="outerBoxWidth" slot-scope="text, record, index">
+                <a-form-model-item prop="outerBoxWidth" :rules="rules.outerBoxWidth">
+                  <a-input style="width:100%" type="text" v-model="record.outerBoxWidth" @change="handleValueChange(record)" />
+                </a-form-model-item>
+              </template>
+              <!-- 外箱高度 -->
+              <template slot="outerBoxHeight" slot-scope="text, record, index">
+                <a-form-model-item prop="outerBoxHeight" :rules="rules.outerBoxHeight">
+                  <a-input style="width:100%" type="text" v-model="record.outerBoxHeight" @change="handleValueChange(record)" />
+                </a-form-model-item>
+              </template>
+              <!-- 净净重 -->
+              <template slot="netWeightToo" slot-scope="text, record, index">
+                <a-form-model-item prop="netWeightToo" :rules="rules.netWeightToo">
+                  <a-input style="width:100%" type="text" v-model="record.netWeightToo"  @change="handleValueChange(record)"/>
+                </a-form-model-item>
+              </template>
 
-        <!-- 子表 ipagination :rules="validatorRules"-->
+              <!-- 尺码字段 -->
+             <template v-for="i in inputName" :slot="i" slot-scope="text, record, index">
+               <a-form-model-item prop="i" :rules="rules.i" :key="i">
+                   <a-input style="width:100%" type="text" v-model="record[i]"  @change="handleValueChange(record)"/>
+                </a-form-model-item>
+              </template>
+             
+              <!-- 操作 -->
+              <span slot="action" slot-scope="text, record,index">
+                 <a @click="copy(record)">复制</a>
+                    <a-divider type="vertical"/>
+                    <a-popconfirm title="确定删除吗?" @confirm="handleDelete(props,index)">
+                    <a>删除</a>
+              </a-popconfirm>
+              </span>
+            </a-table>
+           
+<!-- 
+        子表 ipagination :rules="validatorRules"
         <a-spin :spinning="confirmLoading">
           <a-form-model ref="formRef">
             <j-vxe-table
@@ -157,34 +256,34 @@
               style="margin-top: 5px;"
               :toolbarConfig="toolbarConfig"
               @valueChange="handleValueChange"
-            >
+            > -->
             <!-- 起始箱号 -->
-            <template v-slot:startingBoxNumber="record" >
-              <a-input  v-model="record.row.startingBoxNumber"  style="border-color: red;"></a-input>
-           </template>
+            <!-- <template v-slot:startingBoxNumber="record" >
+              <a-input  v-model="record.startingBoxNumber"  style="border-color: red;"></a-input>
+           </template> -->
            <!-- 结束箱号 -->
-           <template v-slot:endCaseNumber="record" >
-              <a-input  v-model="record.row.endCaseNumber"  style="border-color: red;"></a-input>
-           </template>
+           <!-- <template v-slot:endCaseNumber="record" >
+              <a-input  v-model="record.endCaseNumber"  style="border-color: red;"></a-input>
+           </template> -->
            <!-- 净重/箱 -->
-           <template v-slot:netWeight="record" >
-              <a-input  v-model="record.row.netWeight"  style="border-color: red;"></a-input>
-           </template>
+           <!-- <template v-slot:netWeight="record" >
+              <a-input  v-model="record.netWeight"  style="border-color: red;"></a-input>
+           </template> -->
            <!-- 毛重/箱 -->
-           <template v-slot:grossWeight="record" >
-              <a-input  v-model="record.row.grossWeight"  style="border-color: red;"></a-input>
-           </template>
+           <!-- <template v-slot:grossWeight="record" >
+              <a-input  v-model="record.grossWeight"  style="border-color: red;"></a-input>
+           </template> -->
            <!-- 外箱长度 -->
-           <template v-slot:outerBoxLength="record" >
-              <a-input  v-model="record.row.outerBoxLength"  style="border-color: red;"></a-input>
-           </template>
+           <!-- <template v-slot:outerBoxLength="record" >
+              <a-input  v-model="record.outerBoxLength"  style="border-color: red;"></a-input>
+           </template> -->
            <!-- 外箱高度 -->
-           <template v-slot:outerBoxHeight="record" >
-              <a-input  v-model="record.row.outerBoxHeight"  style="border-color: red;"></a-input>
-           </template>
+           <!-- <template v-slot:outerBoxHeight="record" >
+              <a-input  v-model="record.outerBoxHeight"  style="border-color: red;"></a-input>
+           </template> -->
            <!-- 外箱宽度 -->
-           <template v-slot:outerBoxWidth="record" >
-              <a-input  v-model="record.row.outerBoxWidth"  style="border-color: red;"></a-input>
+           <!-- <template v-slot:outerBoxWidth="record" >
+              <a-input  v-model="record.outerBoxWidth"  style="border-color: red;"></a-input>
            </template>
             <template v-slot:action="props">
               <a @click="copy(props)">复制</a>
@@ -196,7 +295,7 @@
             <template v-slot:toolbarSuffix>
               <a-button type="primary" @click="referShipmentDetails" icon="ordered-list">参照出运明细</a-button>
             </template>
-            </j-vxe-table>
+            </j-vxe-table> -->
           </a-form-model>
         </a-spin>
       </a-card>
@@ -263,216 +362,222 @@ export default {
           btn: []
         },
       btnLoading:false,//按钮等待状态
+      inputName:[],
       // 表头
       columns: [
         {
           title: '账套',
-          key: 'acSetNo',
+          dataIndex: 'acSetNo',
           width: 120,
           // fixed: 'left',
-          type: JVXETypes.normal,
+          className: 'replacecolor'
         },
         {
           title: '成衣工厂',
-          key: 'garmentFactory',
+          dataIndex: 'garmentFactory',
           width: 120,
           // fixed: 'left',
-          type: JVXETypes.normal,
+          className: 'replacecolor'
         },
         {
           title: 'HOD',
-          key: 'hod',
+          dataIndex: 'hod',
           width: 120,
           // fixed: 'left',
-          type: JVXETypes.normal,
+          className: 'replacecolor'
         },
         {
           title: 'STYLE NO.',
-          key: 'styleNo',
+          dataIndex: 'styleNo',
           width: 120,
-          type: JVXETypes.normal,
+          className: 'replacecolor'
         },
         {
           title: 'PO NO.',
-          key: 'poNo',
+          dataIndex: 'poNo',
           width: 120,
-          type: JVXETypes.normal,
+          className: 'replacecolor'
         },
-
-        {
+         {
           title: 'ITEM NO./SKU NO./UPC NO./PACKS CODE',
-          key: 'itemCode',
+          dataIndex: 'itemCode',
+          ellipsis: true,
+          scopedSlots: { customRender: 'itemCode' },
           width: 340,
-          type: JVXETypes.input,
+          className: 'replacecolor'
         },
         {
           title: '分销点/DC/LABEL',
-          key: 'distributionPoint',
+          dataIndex: 'distributionPoint',
           width: 180,
-          type: JVXETypes.normal,
+          className: 'replacecolor',
         },
 
         {
           title: 'PREPACK SKU',
-          key: 'prepackSku',
+          dataIndex: 'prepackSku',
           width: 140,
-          type: JVXETypes.input,
+         className: 'replacecolor',
           insertAfter:true,
-
+          scopedSlots: { customRender: 'prepackSku' },
         },
 
         {
           title: '起始箱号',
-          key: 'startingBoxNumber',
+          dataIndex: 'startingBoxNumber',
           width: 120,
-          type: JVXETypes.slot ,
-          slotName: 'startingBoxNumber'
+          className: 'replacecolor',
+          scopedSlots: { customRender: 'startingBoxNumber' },
+
         },
 
         {
           title: '结束箱号',
-          key: 'endCaseNumber',
+          dataIndex: 'endCaseNumber',
           width: 140,
-          type: JVXETypes.slot ,
-          slotName: 'endCaseNumber'
+          className: 'replacecolor',
+          scopedSlots: { customRender: 'endCaseNumber' },
+
         },
 
         {
           title: '颜色(中英文)',
-          key: 'colour',
+          dataIndex: 'colour',
           width: 140,
-          type: JVXETypes.input ,
+          className: 'replacecolor',
+          scopedSlots: { customRender: 'replacecolor' },
         },
         {
           title: '配码--根据U8订单来显示',
-          key: 'withCode',
+          dataIndex: 'withCode',
           width: 240,
-          type: JVXETypes.normal ,
+          className: 'replacecolor',
         },
         {
           title: '计划尺码数量',
-          key: 'planSize',
+          dataIndex: 'planSize',
           width: 240,
-          type: JVXETypes.normal ,
+          className: 'replacecolor',
         },
         {
           title: '计划装箱数量',
-          key: 'planQuantity',
+          dataIndex: 'planQuantity',
           width: 240,
-          type: JVXETypes.normal ,
+          className: 'replacecolor',
         },
         {
           title: '件数/箱',
-          key: 'piecesBox',
+          dataIndex: 'piecesBox',
           width: 90,
-          type: JVXETypes.normal ,
+          className: 'replacecolor',
         },
         {
           title: '箱数',
-          key: 'boxNumber',
+          dataIndex: 'boxNumber',
           width: 140,
-          type: JVXETypes.normal ,
+          className: 'replacecolor',
         },
 
         {
           title: '总件数',
-          key: 'total',          
+          dataIndex: 'total',          
           width: 140,
-          type: JVXETypes.normal,
+          className: 'replacecolor'
         },
         {
           title: '净重/箱',
-          key: 'netWeight',
+          dataIndex: 'netWeight',
           width: 90,
-          type: JVXETypes.slot,
-          slotName:'netWeight'
+          className: 'replacecolor',
+          scopedSlots: { customRender: 'netWeight' },
         },
         {
           title: '总净重',
-          key: 'totalNetWeight',
+          dataIndex: 'totalNetWeight',
           width: 140,
-          type: JVXETypes.normal,
+          className: 'replacecolor'
         },
 
         {
           title: '毛重/箱',
-          key: 'grossWeight',
+          dataIndex: 'grossWeight',
           width: 120,
-          type: JVXETypes.slot,
-          slotName:'grossWeight'
+          className: 'replacecolor',
+          scopedSlots: { customRender: 'grossWeight' },
         },
         {
           title: '总毛重',
-          key: 'totalGrossWeight',
+          dataIndex: 'totalGrossWeight',
           width: 140,
-          type: JVXETypes.normal,
+          className: 'replacecolor'
         },
         {
           title: '外箱长度',
-          key: 'outerBoxLength',
+          dataIndex: 'outerBoxLength',
           width: 120,
-          type: JVXETypes.slot,
-          slotName:'outerBoxLength'
+          className: 'replacecolor',
+          scopedSlots: { customRender: 'outerBoxLength' },
         },
 
         {
           title: '外箱宽度',
-          key: 'outerBoxWidth',
+          dataIndex: 'outerBoxWidth',
           width: 140,
-          type: JVXETypes.slot,
-          slotName:'outerBoxWidth'
+          className: 'replacecolor',
+          scopedSlots: { customRender: 'outerBoxWidth' },
         },
         {
           title: '外箱高度',
-          key: 'outerBoxHeight',
-          type: JVXETypes.slot ,
+          dataIndex: 'outerBoxHeight',
+          className: 'replacecolor',
           width: 140,
-          slotName:'outerBoxHeight'
+          scopedSlots: { customRender: 'outerBoxHeight' },
         },
 
         {
           title: '总体积',
-          key: 'totalVolume',
-          type: JVXETypes.normal ,
+          dataIndex: 'totalVolume',
+          className: 'replacecolor',
           width: 140,
           
         },
         {
           title: '净净重',
-          key: 'netWeightToo',
+          dataIndex: 'netWeightToo',
           width: 120,
-          type: JVXETypes.inputNumber,
+          className: 'replacecolor',
+          scopedSlots: { customRender: 'netWeightToo' },
         },
         {
           title: '单价',
-          key: 'unitPrice',
+          dataIndex: 'unitPrice',
           width: 120,
-          type: JVXETypes.normal,
+          className: 'replacecolor'
         },
         {
           title: '总价',
-          key: 'totalPrice',          
+          dataIndex: 'totalPrice',          
           width: 120,
-          type: JVXETypes.normal,
+          className: 'replacecolor'
         //    validateRules: [{ required: true, message: '${title}不能为空' },
         //     {pattern: /^\d+(\.\d{1,2})?$/, message: '小数点位数不能超过2位' }],
         },
         {
           title: '备注',
-          key: 'memo',          
+          dataIndex: 'memo',          
           width: 120,
-          type: JVXETypes.normal,
+          className: 'replacecolor'
         //    validateRules: [{ required: true, message: '${title}不能为空' },
         //     {pattern: /^\d+(\.\d{1,2})?$/, message: '小数点位数不能超过2位' }],
         },
         {
           title: '操作',
-          key: 'action',
-          type: JVXETypes.slot,
+          dataIndex: 'action',
+          className: 'replacecolor',
           fixed: 'right',
           width: 160,
           align: 'center',
-            slotName: 'action',
+          scopedSlots: { customRender: 'action' },
         }
       ],
       row:{},
@@ -489,11 +594,11 @@ export default {
       // pushState: '0' // 推送状态初始未【仅保存】
 
       // 待确定还有哪些必填信息 ----------------------------
-      // validatorRules: {
-      //   orderNumber: [{ required: true, message: '订单号不能为空', trigger: 'blur' }],
-      //   styleNum: [{ required: true, message: '款号不能为空', trigger: 'blur' }],
-      //   name: [{ required: true, message: '品名不能为空', trigger: 'blur' }]
-      // },
+      validatorRules: {
+        // orderNumber: [{ required: true, message: '订单号不能为空', trigger: 'blur' }],
+        // styleNum: [{ required: true, message: '款号不能为空', trigger: 'blur' }],
+        // name: [{ required: true, message: '品名不能为空', trigger: 'blur' }]
+      },
       sizeFields:[], // 尺码字段
       dotConfig:{}, // 小数点配置
       judge : 0 ,
@@ -522,6 +627,7 @@ export default {
       var selectData = val[0];      
       queryShippingDetails({id:selectData.id,groupId:selectData.groupId}).then(res => {
           if (res.success) {
+           
             // 放在前面,有小数位数设置
             this.setHeadData(val[0], res.result);
             this.loadSizeTables(res.result.sizeTables);          
@@ -539,6 +645,7 @@ export default {
       });            
 
       this.sizeFields = [];
+      this.inputName = []
       if (sizeTable != null){
         var i=0;
         // 找到插入位置点
@@ -553,12 +660,14 @@ export default {
           var validExpress = getDotValidExpress(this.dotConfig.quantity);
           var field = {
               title: sizeTable[j].size,
-              key: 'size-'+sizeTable[j].size,
-              type: JVXETypes.inputNumber ,
+              dataIndex: 'size-'+sizeTable[j].size,
               width: 80,
               isSize:true,
-              validateRules: [validExpress]
+              validateRules: [validExpress],
+               scopedSlots: { customRender: 'size-'+sizeTable[j].size },
+
           };
+          this.inputName.push('size-'+sizeTable[j].size)
           
           newColums.splice(i+1+j,0,field);
         }
@@ -724,8 +833,11 @@ export default {
                {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;  //小数的位值
+              console.log(tableRow[Several[s].key])
+              
+                var position =(tableRow[Several[s].key]==0 || !tableRow[Several[s].key])?0:tableRow[Several[s].key].toString().indexOf('.')  + 1;   //小数点的位置
+                
+                var digit =(tableRow[Several[s].key]==0 || !tableRow[Several[s].key])?0: tableRow[Several[s].key].toString().length - position;  //小数的位值
                 if(digit > 2 && position!==0 ){
                  this.$message.error('第'+(i+1)+'行'+Several[s].value+'小数超过两位,无法保存');
                 this.judge+=1
@@ -821,14 +933,14 @@ export default {
     },
 
     //  操作按钮 删除
-    handleDelete(index) {
-       var ret = this.addAdpacking.syPreAssembledPackingListItemList.splice(index.rowIndex, 1);
+    handleDelete(record,index) {
+       var ret = this.addAdpacking.syPreAssembledPackingListItemList.splice(index, 1);
       this.setHeadCalField();
       return ret;
     },
     // 复制
     copy(record) {
-      var newRow = JSON.parse(JSON.stringify(record.row));
+      var newRow = JSON.parse(JSON.stringify(record));
       newRow.isAdd = 1
       this.addAdpacking.syPreAssembledPackingListItemList.push(newRow);
       this.setHeadCalField();
@@ -850,27 +962,27 @@ export default {
       this.$refs.referShipmentDetailsModal.referShipmentDetailsModVis = true
     },
     // 表格字段值变动时触发
-    handleValueChange(event) {
-      if (event.row.startingBoxNumber != undefined && event.row.startingBoxNumber != "" &&
-      event.row.endCaseNumber != undefined && event.row.endCaseNumber != ""){
-        event.row.boxNumber = event.row.endCaseNumber*1-event.row.startingBoxNumber*1+1;
+    handleValueChange(record) {
+      if (record.startingBoxNumber != undefined && record.startingBoxNumber != "" &&
+      record.endCaseNumber != undefined && record.endCaseNumber != ""){
+        record.boxNumber = record.endCaseNumber*1-record.startingBoxNumber*1+1;
       }
-      var allSizeSum = this.getAllSizeSum(event.row);
-      event.row.piecesBox = allSizeSum;
-      event.row.total = (event.row.piecesBox*event.row.boxNumber);
-      if (event.row.unitPrice != undefined && event.row.unitPrice != ""){
-        event.row.totalPrice = (event.row.unitPrice*event.row.total).toFixed(2);
+      var allSizeSum = this.getAllSizeSum(record);
+      record.piecesBox = allSizeSum;
+      record.total = (record.piecesBox*record.boxNumber);
+      if (record.unitPrice != undefined && record.unitPrice != ""){
+        record.totalPrice = (record.unitPrice*record.total).toFixed(2);
       }
-      if (event.row.netWeight != "" && event.row.netWeight != undefined){
-        event.row.totalNetWeight = (event.row.netWeight * event.row.boxNumber).toFixed(2);
+      if (record.netWeight != "" && record.netWeight != undefined){
+        record.totalNetWeight = (record.netWeight * record.boxNumber).toFixed(2);
       }
-      if (event.row.grossWeight != "" && event.row.grossWeight != undefined){
-        event.row.totalGrossWeight = (event.row.grossWeight * event.row.boxNumber).toFixed(2);
+      if (record.grossWeight != "" && record.grossWeight != undefined){
+        record.totalGrossWeight = (record.grossWeight * record.boxNumber).toFixed(2);
       }
-      if (event.row.outerBoxLength != "" && event.row.outerBoxLength != undefined &&
-      event.row.outerBoxWidth != "" && event.row.outerBoxWidth != undefined &&
-      event.row.outerBoxHeight != "" && event.row.outerBoxHeight != undefined){
-        event.row.totalVolume = ((event.row.outerBoxLength * event.row.outerBoxWidth * event.row.outerBoxHeight * event.row.boxNumber)/1000000).toFixed(3);
+      if (record.outerBoxLength != "" && record.outerBoxLength != undefined &&
+      record.outerBoxWidth != "" && record.outerBoxWidth != undefined &&
+      record.outerBoxHeight != "" && record.outerBoxHeight != undefined){
+        record.totalVolume = ((record.outerBoxLength * record.outerBoxWidth * record.outerBoxHeight * record.boxNumber)/1000000).toFixed(3);
       }
       this.$forceUpdate()
       this.setHeadCalField();
@@ -914,7 +1026,8 @@ export default {
           total += rowData.total*1;
         }
       }
-      headData.totalBoxes = totalBoxes.toFixed(0);
+      
+      headData.totalBoxes =Number(totalBoxes).toFixed(0);
       headData.totalNetWeight = totalNetWeight;
       headData.totalGrossWeight = totalGrossWeight;
       headData.totalVolume = totalVolume.toFixed(3);

+ 252 - 164
src/views/packing-list/packinglist-clothes/clothesAddDrawer.vue

@@ -142,15 +142,93 @@
 
       <!--操作按钮区域 参照预装箱单 増行-->
       <a-card :bordered="true" style="margin:10px 0 60px 0;">
-        <!-- <div class="table-operator">
+        <div class="table-operator">
           <a-button type="primary" @click="referadvancePackingList" icon="ordered-list">参照预装箱单</a-button>
-          <a-button type="primary" @click="handleAddColumn" icon="plus" style="margin-left: 20px">増行</a-button>
-        </div> -->
+        </div>
 
         <!-- 子表 :pagination="ipagination"  -->
         <a-spin :spinning="confirmLoading">
           <a-form-model ref="formRef">
-            <j-vxe-table
+            <a-table
+              bordered
+              :row-dataIndex       ="record => record.id"
+              :columns="clothesAddColumns"
+              :data-source="clothesAddData"
+              :loading="loading"
+              :pagination="ipagination"
+              :scroll="{ x: 1500,y: 350 }"
+              @change="handleTableChange"
+            >
+             <!-- prepackSku  -->
+             <template slot="prepackSku" slot-scope="text, record, index">
+                <a-form-model-item prop="prepackSku" :rules="rules.prepackSku">
+                  <a-input style="width:100%" type="text" v-model="record.prepackSku"  />
+                </a-form-model-item>
+              </template>
+              <!-- 起始箱号 -->
+              <template slot="startingBoxNumber" slot-scope="text, record, index">
+                <a-form-model-item prop="startingBoxNumber" :rules="rules.startingBoxNumber">
+                  <a-input style="width:100%" type="text" v-model="record.startingBoxNumber"  @change="handleValueChange(record)"/>
+                </a-form-model-item>
+              </template>
+              <!-- 结束箱号 -->
+              <template slot="endCaseNumber" slot-scope="text, record, index">
+                <a-form-model-item prop="endCaseNumber" :rules="rules.endCaseNumber">
+                  <a-input style="width:100%" type="text" v-model="record.endCaseNumber"  @change="handleValueChange(record)"/>
+                </a-form-model-item>
+              </template>
+               <!-- 净重 -->
+              <template slot="netWeight" slot-scope="text, record, index">
+                <a-form-model-item prop="netWeight" :rules="rules.netWeight">
+                  <a-input style="width:100%" type="text" v-model="record.netWeight"  @change="handleValueChange(record)"/>
+                </a-form-model-item>
+              </template>
+              <!-- 毛重 -->
+              <template slot="grossWeight" slot-scope="text, record, index">
+                <a-form-model-item prop="grossWeight" :rules="rules.grossWeight">
+                  <a-input style="width:100%" type="text" v-model="record.grossWeight"  @change="handleValueChange(record)"/>
+                </a-form-model-item>
+              </template>
+              <!-- 外箱长度 -->
+              <template slot="outerBoxLength" slot-scope="text, record, index">
+                <a-form-model-item prop="outerBoxLength" :rules="rules.outerBoxLength">
+                  <a-input style="width:100%" type="text" v-model="record.outerBoxLength"  @change="handleValueChange(record)"/>
+                </a-form-model-item>
+              </template>
+              <!-- 外箱宽度 -->
+               <template slot="outerBoxWidth" slot-scope="text, record, index">
+                <a-form-model-item prop="outerBoxWidth" :rules="rules.outerBoxWidth">
+                  <a-input style="width:100%" type="text" v-model="record.outerBoxWidth" @change="handleValueChange(record)" />
+                </a-form-model-item>
+              </template>
+              <!-- 外箱高度 -->
+              <template slot="outerBoxHeight" slot-scope="text, record, index">
+                <a-form-model-item prop="outerBoxHeight" :rules="rules.outerBoxHeight">
+                  <a-input style="width:100%" type="text" v-model="record.outerBoxHeight" @change="handleValueChange(record)" />
+                </a-form-model-item>
+              </template>
+              <!-- 净净重 -->
+              <template slot="netWeightToo" slot-scope="text, record, index">
+                <a-form-model-item prop="netWeightToo" :rules="rules.netWeightToo">
+                  <a-input style="width:100%" type="text" v-model="record.netWeightToo"  @change="handleValueChange(record)"/>
+                </a-form-model-item>
+              </template>
+               <!-- 尺码字段 -->
+             <template v-for="i in inputName" :slot="i" slot-scope="text, record, index">
+               <a-form-model-item prop="i" :rules="rules.i" :key="i">
+                   <a-input style="width:100%" type="text" v-model="record[i]"  @change="handleValueChange(record)"/>
+                </a-form-model-item>
+              </template>
+              <!-- 操作 -->
+              <span slot="operation" slot-scope="text, record,index">
+                 <a @click="copy(record)">复制</a>
+                 <a-divider type="vertical"/>
+                 <a-popconfirm title="确定删除吗?" @confirm="handleDelete(record)">
+                   <a>删除</a>
+                </a-popconfirm>
+              </span>
+            </a-table>
+            <!-- <j-vxe-table
               ref="vTable"
               toolbar
               row-number
@@ -167,41 +245,41 @@
               style="margin-top: 5px;"
               :toolbarConfig="toolbarConfig"
               @valueChange="handleValueChange"
-            >
+            > -->
             <!-- 起始箱号 -->
-            <template v-slot:startingBoxNumber="record" >
+            <!-- <template v-slot:startingBoxNumber="record" >
               <a-input  v-model="record.row.startingBoxNumber"  style="border-color: red;"></a-input>
-           </template>
+           </template> -->
            <!-- 结束箱号 -->
-           <template v-slot:endCaseNumber="record" >
+           <!-- <template v-slot:endCaseNumber="record" >
               <a-input  v-model="record.row.endCaseNumber"  style="border-color: red;"></a-input>
-           </template>
+           </template> -->
            <!-- 净重/箱 -->
-           <template v-slot:netWeight="record" >
+           <!-- <template v-slot:netWeight="record" >
               <a-input  v-model="record.row.netWeight"  style="border-color: red;"></a-input>
-           </template>
+           </template> -->
            <!-- 毛重/箱 -->
-           <template v-slot:grossWeight="record" >
+           <!-- <template v-slot:grossWeight="record" >
               <a-input  v-model="record.row.grossWeight"  style="border-color: red;"></a-input>
-           </template>
+           </template> -->
            <!-- 外箱长度 -->
-           <template v-slot:outerBoxLength="record" >
+           <!-- <template v-slot:outerBoxLength="record" >
               <a-input  v-model="record.row.outerBoxLength"  style="border-color: red;"></a-input>
-           </template>
+           </template> -->
            <!-- 外箱高度 -->
-           <template v-slot:outerBoxHeight="record" >
+           <!-- <template v-slot:outerBoxHeight="record" >
               <a-input  v-model="record.row.outerBoxHeight"  style="border-color: red;"></a-input>
-           </template>
+           </template> -->
            <!-- 外箱宽度 -->
-           <template v-slot:outerBoxWidth="record" >
+           <!-- <template v-slot:outerBoxWidth="record" >
               <a-input  v-model="record.row.outerBoxWidth"  style="border-color: red;"></a-input>
-           </template>
+           </template> -->
            <!-- 箱数 -->
-           <template v-slot:boxNumber="record" >
+           <!-- <template v-slot:boxNumber="record" >
               <a-input  v-model="record.row.boxNumber"  style="border-color: red;"></a-input>
-           </template>
+           </template> -->
            <!-- 净净重 -->
-           <template v-slot:netWeightToo="record" >
+           <!-- <template v-slot:netWeightToo="record" >
               <a-input  v-model="record.row.netWeightToo"  style="border-color: red;"></a-input>
            </template>
             <template v-slot:action="props">
@@ -214,7 +292,7 @@
             <template v-slot:toolbarSuffix>
               <a-button type="primary" @click="referadvancePackingList" icon="ordered-list">参照预装箱单</a-button>
             </template>
-            </j-vxe-table>
+            </j-vxe-table> -->
           </a-form-model>
         </a-spin>
       </a-card>
@@ -268,207 +346,210 @@ export default {
           // add 新增按钮;remove 删除按钮;clearSelection 清空选择按钮
           btn: []
         },
+        inputName:[],
       // 表头
       clothesAddColumns: [
          {
           title: '账套',
-          key: 'acSetNo',
+          dataIndex: 'acSetNo',
           width: 160,
           // fixed: 'left',
-           type: JVXETypes.normal,
+            className: 'replacecolor'
         },
         {
           title: '成衣工厂',
-          key: 'garmentFactory',
+          dataIndex: 'garmentFactory',
           width: 120,
           // fixed: 'left',
-           type: JVXETypes.normal,
+            className: 'replacecolor'
         },
         {
           title: 'HOD',
-          key: 'hod',
+          dataIndex: 'hod',
           width: 120,
-          type: JVXETypes.normal,
+           className: 'replacecolor'
         },
         {
           title: 'STYLE NO.',
-          key: 'styleNo',
+          dataIndex: 'styleNo',
           width: 120,
-          type: JVXETypes.normal,
+           className: 'replacecolor'
         },
         {
           title: 'PO NO.',
-          key: 'poNo',
+          dataIndex: 'poNo',
           width: 90,
-           type: JVXETypes.normal,
+            className: 'replacecolor'
         },
 
         {
           title: 'ITEM NO./SKU NO./UPC NO./PACKS CODE',
-          key: 'itemCode',
+          dataIndex: 'itemCode',
           width: 340,
-          type: JVXETypes.normal,
+           className: 'replacecolor'
         },
          {
           title: 'PREPACK SKU',
-          key: 'prepackSku',
+          dataIndex: 'prepackSku',
           width: 200,
-          type: JVXETypes.input,
+          className: 'replacecolor',
+          scopedSlots: { customRender: 'prepackSku' },
         },
         {
           title: '分销点/DC/LABEL',
-          key: 'distributionPoint',
+          dataIndex: 'distributionPoint',
           width: 200,
-          type: JVXETypes.normal,
+           className: 'replacecolor',
           insertAfter:true,
         },
         {
           title: '启始箱号',
-          key: 'startingBoxNumber',
-          type: JVXETypes.slot ,
-          slotName:'startingBoxNumber',
+          dataIndex: 'startingBoxNumber',
+          className: 'replacecolor',
+          scopedSlots: { customRender: 'startingBoxNumber' }  ,        
           width: 120,
         },
 
         {
           title: '结束箱号',
-          key: 'endCaseNumber',
+          dataIndex: 'endCaseNumber',
           width: 120,
-          type: JVXETypes.slot,
-          slotName:'endCaseNumber' 
+           className: 'replacecolor',
+           scopedSlots: { customRender: 'endCaseNumber' }  ,   
         },
 
         {
           title: '颜色(中英文)',
-          key: 'colour',
+          dataIndex: 'colour',
           width: 140,
-         type: JVXETypes.normal,
+          className: 'replacecolor'
         },
         {
           title: '配码',
-          key: 'withCode',
+          dataIndex: 'withCode',
           width: 120,
-         type: JVXETypes.normal,
+          className: 'replacecolor'
         },
         {
           title: '件数/箱',
-          key: 'piecesBox',
+          dataIndex: 'piecesBox',
           width: 120,
           type: JVXETypes.normal 
         },
         {
           title: '箱数',
-          key: 'boxNumber',
+          dataIndex: 'boxNumber',
           width: 120,
-          type: JVXETypes.slot,
-          slotName:'boxNumber' 
+           className: 'replacecolor',
+           scopedSlots: { customRender: 'boxNumber' }  , 
         },
         {
           title: '计划尺码数量',
-          key: 'planSize',
+          dataIndex: 'planSize',
           width: 240,
-          type: JVXETypes.normal ,
+           className: 'replacecolor'
         },
         {
           title: '计划装箱数量',
-          key: 'planQuantity',
+          dataIndex: 'planQuantity',
           width: 240,
-          type: JVXETypes.normal ,
+           className: 'replacecolor'
         },
         {
           title: '总件数',
-          key: 'total',
+          dataIndex: 'total',
           width: 90,
-          type: JVXETypes.normal,
+           className: 'replacecolor'
         },
         {
           title: '净重/箱',
-          key: 'netWeight',
+          dataIndex: 'netWeight',
           width: 120,
-          type: JVXETypes.slot,
-          slotName:'netWeight' 
+           className: 'replacecolor',
+           scopedSlots: { customRender: 'netWeight' }  , 
         },
         {
           title: '总净重',
-          key: 'totalNetWeight',
+          dataIndex: 'totalNetWeight',
           width: 90,
-          type: JVXETypes.normal,
+           className: 'replacecolor'
         },
         {
           title: '毛重/箱',
-          key: 'grossWeight',
+          dataIndex: 'grossWeight',
           width: 120,
-          type: JVXETypes.slot,
-          slotName:'grossWeight' 
+           className: 'replacecolor',
+           scopedSlots: { customRender: 'grossWeight' }  , 
         },
         {
           title: '总毛重',
-          key: 'totalGrossWeight',
+          dataIndex: 'totalGrossWeight',
           width: 90,
-          type: JVXETypes.normal,
+           className: 'replacecolor'
         },
         {
           title: '外箱长度',
-          key: 'outerBoxLength',
+          dataIndex: 'outerBoxLength',
           width: 120,
-         type: JVXETypes.slot,
-         slotName:'outerBoxLength' 
+          className: 'replacecolor',
+          scopedSlots: { customRender: 'outerBoxLength' }  , 
         },
         {
           title: '外箱宽度',
-          key: 'outerBoxWidth',
+          dataIndex: 'outerBoxWidth',
           width: 120,
-          type: JVXETypes.slot,
-          slotName:'outerBoxWidth' 
+           className: 'replacecolor',
+           scopedSlots: { customRender: 'outerBoxWidth' }  , 
         },
         {
           title: '外箱高度',
-          key: 'outerBoxHeight',
+          dataIndex: 'outerBoxHeight',
           width: 120,
-          type: JVXETypes.slot,
-          slotName:'outerBoxHeight' 
+           className: 'replacecolor',
+           scopedSlots: { customRender: 'outerBoxHeight' }  , 
         },
         {
           title: '总体积',
-          key: 'totalVolume',
+          dataIndex: 'totalVolume',
           width: 120,
-          type: JVXETypes.normal,
+           className: 'replacecolor'
         },
         {
           title: '净净重',
-          key: 'netWeightToo',
+          dataIndex: 'netWeightToo',
           width: 120,
-          type: JVXETypes.slot,
-          slotName:'netWeightToo'
+           className: 'replacecolor',
+           scopedSlots: { customRender: 'netWeightToo' }  , 
         },
         // {
         //   title: '单价',
-        //   key: 'unitPrice',
+        //   dataIndex: 'unitPrice',
         //   width: 120,
-        //   type: JVXETypes.normal,
+        //    className: 'replacecolor'
         // },
         // {
         //   title: '总价',
-        //   key: 'totalPrice',
+        //   dataIndex: 'totalPrice',
         //   width: 120,
-        //   type: JVXETypes.normal,
+        //    className: 'replacecolor'
         // },
         {
           title: '备注',
-          key: 'remarks',
+          dataIndex: 'remarks',
           width: 140,
-          customRender: t => ellipsis(t),
+          
           // fixed: 'right',
-          type: JVXETypes.input,
+          className: 'replacecolor',
+          scopedSlots: { customRender: 'remarks' }  , 
         },
         {
           title: '操作',
-          key: 'operation',
-          type: JVXETypes.slot,
+          dataIndex: 'operation',
+           className: 'replacecolor',
           width: 160,
           fixed: 'right',
           align: 'center',
-            slotName: 'action',
+          scopedSlots: { customRender: 'operation' }  ,
         }
       ],
       clothesAddData: [],
@@ -574,13 +655,16 @@ export default {
           this.sizeFields.push('size-'+sizeTables[j].size);
           var field = {
               title: sizeTables[j].size,
-              key: 'size-'+sizeTables[j].size,
+              dataIndex: 'size-'+sizeTables[j].size,
               type: JVXETypes.inputNumber ,
               width: 80,
               isSize:true,
+              scopedSlots: { customRender: 'size-'+sizeTables[j].size },
           };
+          this.inputName.push('size-'+sizeTables[j].size)
           newColumns.splice(i+1+j,0,field);
         }
+        
         this.clothesAddColumns = newColumns
         }
     },
@@ -678,8 +762,8 @@ export default {
      this.setHeadCalField(this.clothesAddData)
     },
 
-     handleValueChange(event) {
-       var dataRow = event.row
+     handleValueChange(record) {
+       var dataRow = record
       //  if (dataRow.startingBoxNumber != undefined && dataRow.startingBoxNumber != "" &&
       //   dataRow.endCaseNumber != undefined && dataRow.endCaseNumber != ""){
       //     dataRow.boxNumber = dataRow.endCaseNumber*1-dataRow.startingBoxNumber*1+1;
@@ -706,7 +790,7 @@ export default {
 
     // 操作按钮 复制
     copy(record) {
-      var newRow = JSON.parse(JSON.stringify(record.row));
+      var newRow = JSON.parse(JSON.stringify(record));
       newRow.isAdd = 1
       this.clothesAddData.push(newRow);
       this.setHeadCalField(this.clothesAddData)
@@ -760,6 +844,7 @@ export default {
           newObj.depositaryReceiptNo = this.clothesAdd.depositaryReceiptNo
           await this.JudgeVluabled()
           if(this.judge == 0){
+            
              if(this.editDecide === 'edit'){
                editSpltList(newObj).then(res => {
                 if (res.success) {
@@ -799,7 +884,7 @@ export default {
              var allSizeSum = this.getAllSizeSum(tableRow);
              if (allSizeSum == 0){
                this.$message.error('第'+(i+1)+'行所有尺码数量为0,无法保存');
-               
+               this.judge+=1
                return;
              }
 
@@ -816,6 +901,7 @@ export default {
                {key:'boxNumber',value:'箱数'},
                ]
              for(var j=0 ; j<Valuable.length;j++){
+               
                 if(tableRow[Valuable[j].key] == null || tableRow[Valuable[j].key] == "" || tableRow[Valuable[j].key] == undefined){
                   this.$message.error('第'+(i+1)+'行'+Valuable[j].value+'无值,无法保存');
                   this.judge+=1
@@ -900,191 +986,193 @@ export default {
      this.clothesAddColumns= [
         {
           title: '账套',
-          key: 'acSetNo',
+          dataIndex       : 'acSetNo',
           width: 160,
           // fixed: 'left',
-           type: JVXETypes.normal,
+            className: 'replacecolor'
         },
         {
           title: '成衣工厂',
-          key: 'garmentFactory',
+          dataIndex       : 'garmentFactory',
           width: 120,
           // fixed: 'left',
-           type: JVXETypes.normal,
+            className: 'replacecolor'
         },
         {
           title: 'HOD',
-          key: 'hod',
+          dataIndex       : 'hod',
           width: 120,
-          type: JVXETypes.normal,
+           className: 'replacecolor'
         },
         {
           title: 'STYLE NO.',
-          key: 'styleNo',
+          dataIndex       : 'styleNo',
           width: 120,
-          type: JVXETypes.normal,
+           className: 'replacecolor'
         },
         {
           title: 'PO NO.',
-          key: 'poNo',
+          dataIndex       : 'poNo',
           width: 90,
-           type: JVXETypes.normal,
+            className: 'replacecolor'
         },
 
         {
           title: 'ITEM NO./SKU NO./UPC NO./PACKS CODE',
-          key: 'itemCode',
+          dataIndex       : 'itemCode',
           width: 340,
-          type: JVXETypes.normal,
+           className: 'replacecolor'
         },
           {
           title: 'PREPACK SKU',
-          key: 'prepackSku',
+          dataIndex       : 'prepackSku',
           width: 200,
-          type: JVXETypes.input,
+          className: 'replacecolor',
+          scopedSlots: { customRender: 'prepackSku' }  ,
         },
         {
           title: '分销点/DC/LABEL',
-          key: 'distributionPoint',
+          dataIndex       : 'distributionPoint',
           width: 200,
-          type: JVXETypes.normal,
+           className: 'replacecolor',
           insertAfter:true,
         },
         {
           title: '启始箱号',
-          key: 'startingBoxNumber',
-          type: JVXETypes.slot ,
+          dataIndex       : 'startingBoxNumber',
+          className: 'replacecolor',          
           width: 120,
-          slotName:'startingBoxNumber'
+          scopedSlots: { customRender: 'startingBoxNumber' }  ,
         },
 
         {
           title: '结束箱号',
-          key: 'endCaseNumber',
+          dataIndex       : 'endCaseNumber',
           width: 120,
-          type: JVXETypes.slot ,
-          slotName:'endCaseNumber'
+          className: 'replacecolor', 
+          scopedSlots: { customRender: 'endCaseNumber' }  ,         
         },
 
         {
           title: '颜色(中英文)',
-          key: 'colour',
+          dataIndex       : 'colour',
           width: 140,
-         type: JVXETypes.normal,
+          className: 'replacecolor'
         },
         {
           title: '配码',
-          key: 'withCode',
+          dataIndex       : 'withCode',
           width: 120,
-         type: JVXETypes.normal,
+          className: 'replacecolor'
         },
         {
           title: '件数/箱',
-          key: 'piecesBox',
+          dataIndex       : 'piecesBox',
           width: 120,
           type: JVXETypes.normal 
         },
         {
           title: '箱数',
-          key: 'boxNumber',
+          dataIndex       : 'boxNumber',
           width: 120,
-          type: JVXETypes.slot,
-          slotName:'boxNumber' 
+           className: 'replacecolor',
+           scopedSlots: { customRender: 'replacecolor' }  ,
         },
         {
           title: '计划尺码数量',
-          key: 'planSize',
+          dataIndex       : 'planSize',
           width: 240,
-          type: JVXETypes.normal ,
+           className: 'replacecolor'
         },
         {
           title: '计划装箱数量',
-          key: 'planQuantity',
+          dataIndex       : 'planQuantity',
           width: 240,
-          type: JVXETypes.normal ,
+           className: 'replacecolor'
         },
         {
           title: '总件数',
-          key: 'total',
+          dataIndex       : 'total',
           width: 90,
-          type: JVXETypes.normal,
+           className: 'replacecolor'
         },
         {
           title: '净重/箱',
-          key: 'netWeight',
+          dataIndex       : 'netWeight',
           width: 120,
-          type: JVXETypes.slot,
-          slotName:'netWeight' 
+           className: 'replacecolor',
+          scopedSlots: { customRender: 'netWeight' }  ,
         },
         {
           title: '总净重',
-          key: 'totalNetWeight',
+          dataIndex       : 'totalNetWeight',
           width: 90,
-          type: JVXETypes.normal,
+           className: 'replacecolor'
         },
         {
           title: '毛重/箱',
-          key: 'grossWeight',
+          dataIndex       : 'grossWeight',
           width: 120,
-          type: JVXETypes.slot,
-          slotName:'grossWeight' 
+           className: 'replacecolor',
+           scopedSlots: { customRender: 'grossWeight' }  ,
         },
         {
           title: '总毛重',
-          key: 'totalGrossWeight',
+          dataIndex       : 'totalGrossWeight',
           width: 90,
-          type: JVXETypes.normal,
+           className: 'replacecolor'
         },
         {
           title: '外箱长度',
-          key: 'outerBoxLength',
+          dataIndex       : 'outerBoxLength',
           width: 120,
-         type: JVXETypes.slot,
-         slotName:'outerBoxLength' 
+          className: 'replacecolor',
+          scopedSlots: { customRender: 'outerBoxLength' }  ,
         },
         {
           title: '外箱宽度',
-          key: 'outerBoxWidth',
+          dataIndex       : 'outerBoxWidth',
           width: 120,
-          type: JVXETypes.slot,
-          slotName:'outerBoxWidth' 
+           className: 'replacecolor',
+           scopedSlots: { customRender: 'outerBoxWidth' }  ,
         },
         {
           title: '外箱高度',
-          key: 'outerBoxHeight',
+          dataIndex       : 'outerBoxHeight',
           width: 120,
-          type: JVXETypes.slot,
-          slotName:'outerBoxHeight' 
+           className: 'replacecolor',
+           scopedSlots: { customRender: 'outerBoxHeight' }  ,
         },
         {
           title: '总体积',
-          key: 'totalVolume',
+          dataIndex       : 'totalVolume',
           width: 120,
-          type: JVXETypes.normal,
+           className: 'replacecolor'
         },
         {
           title: '净净重',
-          key: 'netWeightToo',
+          dataIndex       : 'netWeightToo',
           width: 120,
-          type: JVXETypes.slot,
-          slotName:'netWeightToo'
+           className: 'replacecolor',
+           scopedSlots: { customRender: 'netWeightToo' }  ,
         },
         {
           title: '备注',
-          key: 'remarks',
+          dataIndex       : 'remarks',
           width: 140,
-          customRender: t => ellipsis(t),
+          
           // fixed: 'right',
-          type: JVXETypes.input,
+          className: 'replacecolor',
+          scopedSlots: { customRender: 'remarks' }  ,
         },
         {
           title: '操作',
-          key: 'operation',
-          type: JVXETypes.slot,
+          dataIndex       : 'operation',
+           className: 'replacecolor',
           width: 160,
           fixed: 'right',
           align: 'center',
-            slotName: 'action',
+          scopedSlots: { customRender: 'operation' }  ,
         }
       ]
     },