Kaynağa Gözat

装箱单编辑

jbb 2 yıl önce
ebeveyn
işleme
02097cfc88

+ 3 - 1
src/api/document/packing-list/packinglist-clothes.js

@@ -21,6 +21,8 @@ const editSpltList = params => postAction('/splt/syPackingListTailoring/edit', p
 //新增
 const addSpltList = params => postAction('/splt/syPackingListTailoring/add', params)
 
+//装箱单成衣-通过id查询
+const spltListId = params => getAction('/splt/syPackingListTailoring/queryById', params)
 
-export {spltList,orderSpltList,deleteSpltList,batchDelete,orderSpltListId,editSpltList,addSpltList}
+export {spltList,orderSpltList,deleteSpltList,batchDelete,orderSpltListId,editSpltList,addSpltList,spltListId}
 

+ 32 - 3
src/views/packing-list/clothes-list.vue

@@ -152,7 +152,7 @@
     <div>
       <clothesAdd-drawer ref="clothesAddDrawer" :fatherList="getSpltList" @ok="modalFormOk"></clothesAdd-drawer>
       <detailsClothes-drawer ref="detailsClothesDrawer" :father="bb" @ok="modalFormOk"></detailsClothes-drawer>
-      <editClothes-drawer ref="editClothesDrawer" :father="cc" @ok="modalFormOk"></editClothes-drawer>
+      <!-- <editClothes-drawer ref="editClothesDrawer" :father="cc" @ok="modalFormOk"></editClothes-drawer> -->
     </div>
   </div>
 </template>
@@ -163,7 +163,7 @@ import JEllipsis from '@/components/jeecg/JEllipsis'
 import clothesAddDrawer from '@views/packing-list/packinglist-clothes/clothesAddDrawer.vue'
 import detailsClothesDrawer from '@views/packing-list/packinglist-clothes/detailsClothesDrawer.vue'
 import editClothesDrawer from '@views/packing-list/packinglist-clothes/editClothesDrawer.vue'
-import { spltList,deleteSpltList} from '@api/document/packing-list/packinglist-clothes'
+import { spltList,deleteSpltList,spltListId} from '@api/document/packing-list/packinglist-clothes'
 
 
 export default {
@@ -457,7 +457,36 @@ export default {
     // 操作 编辑
     edit(record) {
       console.log('编辑')
-      this.$refs.editClothesDrawer.visible = true
+       spltListId({id:record.id}).then(res => {
+           if (res.success) {
+             var editData = res.result
+             this.$refs.clothesAddDrawer.visible = true
+             this.$refs.clothesAddDrawer.editDecide = 'edit';
+             this.$refs.clothesAddDrawer.dynamicColumns(editData.sizeTables)
+             this.$refs.clothesAddDrawer.clothesAdd = {
+                orderNum:editData.orderNumber,
+                styleNum:editData.itemNumber,
+                name:editData.productName,
+                sizeRange:editData.sizeRange,
+                customer:editData.customer,
+                containerCode:editData.containerCode,
+                containerNo:editData.containerNumber,
+                note:editData.memo,
+                clothesFactory:editData.garmentFactory,
+                exportInvoiceNo:editData.exportInvoiceNo,
+                bookNum:editData.shippingOrderNumber
+            };
+            this.$refs.clothesAddDrawer.clothesAddData = editData.syPackingListTailoringItemList
+             for (var i=0; i<res.result.syPackingListTailoringItemList.length;i++){
+                 var row = res.result.syPackingListTailoringItemList[i];
+                 var sizeTables = row.sizeTables;
+                 for (var j=0; j<sizeTables.length;j++){
+                  row['size-'+sizeTables[j].size] = sizeTables[j].proportion;
+                 }
+          }
+           }
+       })
+      
     },
     // 操作 删除
     handleDelete(record) {

+ 18 - 3
src/views/packing-list/packinglist-clothes/clothesAddDrawer.vue

@@ -250,7 +250,7 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import { JVXETypes } from '@/components/jeecg/JVxeTable'
 import JEllipsis from '@/components/jeecg/JEllipsis'
 import ReferencePrePacklist from '@views/packing-list/packinglist-clothes/referencePrePacklist'
-import { orderSpltListId,addSpltList } from '@api/document/packing-list/packinglist-clothes.js'
+import { orderSpltListId,addSpltList,editSpltList } from '@api/document/packing-list/packinglist-clothes.js'
 
 
 export default {
@@ -490,6 +490,7 @@ export default {
         // current: 0,
         // pageSize: 0
       },
+      editDecide:'add',
       visible: false,
       sizeFields:[], // 尺码字段
       confirmLoading: false,
@@ -519,7 +520,6 @@ export default {
      var preId = idArr[0]
      orderSpltListId({id:preId}).then(res => {
           var data = res.result
-          console.log(data)
           if (res.success) {
             this.clothesAdd = {
               orderNum: data.orderNumber,
@@ -741,7 +741,20 @@ export default {
          }
          tableRow.sort = ++sort;
       } 
-           addSpltList(newObj).then(res => {
+      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()
@@ -752,6 +765,7 @@ export default {
           this.$message.error(res.message)
         }
       })
+      }
         }
       })
     },
@@ -773,6 +787,7 @@ export default {
       this.visible = false
       this.clothesAdd = {}
       this.clothesAddData = []
+      this.editDecide = 'add'
       // this.$refs.form.resetFields()
     },
     // - father------------------------------------

+ 0 - 2
src/views/packing-list/packinglist-clothes/referencePrePacklist.vue

@@ -338,8 +338,6 @@ export default {
     // 选中行
     onSelectChange(keys, rows) {
       this.selectedRowKeys = keys;
-      console.log(rows)
-      debugger
     },
     deliveryDateChange(value, dateString) {
       this.queryParam.preDeliveryDate = dateString