Sfoglia il codice sorgente

装箱单复制和删除功能

jbb 2 anni fa
parent
commit
12c837bb8f

+ 2 - 2
src/views/packing-list/clothes-list.vue

@@ -474,7 +474,8 @@ export default {
                 note:editData.memo,
                 clothesFactory:editData.garmentFactory,
                 exportInvoiceNo:editData.exportInvoiceNo,
-                bookNum:editData.shippingOrderNumber
+                bookNum:editData.shippingOrderNumber,
+                id:editData.id
             };
             this.$refs.clothesAddDrawer.clothesAddData = editData.syPackingListTailoringItemList
              for (var i=0; i<res.result.syPackingListTailoringItemList.length;i++){
@@ -494,7 +495,6 @@ export default {
        this.$nextTick(() => {
         deleteSpltList({ id: record }).then(res => {
           if (res.success) {
-
             this.getSpltList()
             this.$message.success('删除成功')
           } else {

+ 43 - 36
src/views/packing-list/packinglist-clothes/clothesAddDrawer.vue

@@ -263,10 +263,10 @@ export default {
 
     return {
 
-      toolbarConfig: {
-          // add 新增按钮;remove 删除按钮;clearSelection 清空选择按钮
-          btn: []
-        },
+      // toolbarConfig: {
+      //     // add 新增按钮;remove 删除按钮;clearSelection 清空选择按钮
+      //     btn: []
+      //   },
       // 表头
       clothesAddColumns: [
         {
@@ -371,7 +371,7 @@ export default {
           title: '颜色(中英文)',
           key: 'colour',
           width: 140,
-         type: JVXETypes.normal,
+         type: JVXETypes.input,
         },
         {
           title: '配码',
@@ -618,8 +618,10 @@ export default {
 
     // -------------------------------------
     // 操作 删除
-    handleDelete(id) {
-      console.log('id:', id)
+    handleDelete(ind) {
+     var delectId = ind.rowIndex
+     this.clothesAddData.splice(delectId, 1);
+     console.log(this.clothesAddData)
     },
 
      handleValueChange(event) {
@@ -650,7 +652,11 @@ export default {
      },
 
     // 操作按钮 复制
-    copy(record) {},
+    copy(record) {
+      var newRow = JSON.parse(JSON.stringify(record.row));
+      newRow.isAdd = 1
+      this.clothesAddData.push(newRow);
+    },
     // -------------------------------------
 
     // 抽屉 取消
@@ -681,6 +687,7 @@ export default {
           newObj.garmentFactory = this.clothesAdd.clothesFactory
           newObj.exportInvoiceNo = this.clothesAdd.exportInvoiceNo
           newObj.shippingOrderNumber = this.clothesAdd.bookNum
+          newObj.id = this.clothesAdd.id
           newObj.syPackingListTailoringItemList = this.clothesAddData
           var sort = 0;
           for (var i=0; i<newObj.syPackingListTailoringItemList.length;i++){
@@ -738,34 +745,34 @@ export default {
            var sizeTable = tableRow.sizeTables[j];
             var field = 'size-'+sizeTable.size;
             tableRow.sizeTables[j].proportion = tableRow[field];
-         }
-         tableRow.sort = ++sort;
-      } 
-      if(this.editDecide === 'edit'){
-         editSpltList(newObj).then(res => {
-           if (res.success) {
-           this.$message.success('编辑成功')
-           this.close()
-           //清空信息
-           newObj = {};
-           that.fatherList() // 调用父组件 查询方法
-        }else{
-          this.$message.error(res.message)
-        }
-      })
-      }else {
-         addSpltList(newObj).then(res => {
-           if (res.success) {
-           this.$message.success('新增成功')
-           this.close()
-           //清空信息
-           newObj = {};
-           that.fatherList() // 调用父组件 查询方法
-        }else{
-          this.$message.error(res.message)
-        }
-      })
-      }
+          }
+           tableRow.sort = ++sort;
+         } 
+         if(this.editDecide === 'edit'){
+           editSpltList(newObj).then(res => {
+             if (res.success) {
+             this.$message.success('编辑成功')
+             this.close()
+             //清空信息
+             newObj = {};
+             that.fatherList() // 调用父组件 查询方法
+             }else{
+              this.$message.error(res.message)
+            }
+           })
+        }else {
+          addSpltList(newObj).then(res => {
+             if (res.success) {
+              this.$message.success('新增成功')
+              this.close()
+              //清空信息
+              newObj = {};
+             that.fatherList() // 调用父组件 查询方法
+           }else{
+             this.$message.error(res.message)
+           }
+         })
+       }
         }
       })
     },