Kaynağa Gözat

refactor(销售订单): 新增销售订单传发货类型

liujt 7 ay önce
ebeveyn
işleme
875ff40e03

+ 13 - 73
src/views/saleManage/saleOrder/invoice/components/addInvoiceDialog.vue

@@ -351,7 +351,7 @@ import {
         replaceList: [],
         deliveryTypeId: '',
         receiptRequirementTypeId: 2,
-        sourceType: '',
+        sourceType: '',  // 1 销售订单 2 受托收货单 3 退货单
         sourceId: '',
         sourceNo: ''
       };
@@ -433,7 +433,8 @@ import {
           productionRequirements: obj.map((item) => item.productionRequirements).toString(),
           orderIds: obj.map((item) => item.id).toString(),
           orderNo: obj.map((item) => item.orderNo).toString(),
-          needProduce: obj.map((item) => item.needProduce)
+          needProduce: obj.map((item) => item.needProduce),
+          sourceType: 1,
         });
         this.getSaleOrderDetails(obj.map((item) => item.id));
       },
@@ -650,7 +651,9 @@ import {
             entrustedId: '',
             sendNoteNo: '',
             pricingWay: '',
-
+            sourceNo: '',
+            sourceId: '',
+            sourceType: '',
           });
           this.$refs.inventoryTableref &&
             this.$refs.inventoryTableref.putTableValue([], true);
@@ -753,76 +756,9 @@ import {
 
             this.$refs.inventoryTableref &&
               this.$refs.inventoryTableref.putTableValue(productList, true);
-            // this.setReturnData(data);
           })
         }
       },
-      setReturnData(data) {
-        this.$nextTick(() => {
-          let {
-            partaId,
-            partaName,
-            partaTel,
-            orderIds,
-            orderNo,
-            partaLinkName,
-            partaAddress,
-            productList,
-            trayList,
-            trakNoteList,
-            totalAmount,
-            payAmount,
-            projectName,
-            projectId,
-            projectCode,
-            totalPrice,
-            receiveAddress
-          } = data;
-          if (productList && productList.length > 0) {
-            productList.forEach((v) => {
-              v.orderTotalCount = v.totalCount;
-              v.extField = {};
-            });
-          }
-          this.form = Object.assign({}, this.form, {
-            contactId: partaId,
-            contactName: partaName,
-            linkName: partaLinkName,
-            linkPhone: partaTel,
-            orderNo,
-            orderIds,
-            receiveAddress: receiveAddress || partaAddress,
-            productList,
-            trakNoteList,
-            trayList,
-            totalAmount,
-            totalPrice,
-            payAmount,
-            projectName,
-            projectId,
-            projectSn: projectCode
-          });
-          productList.forEach((item, index) => {
-            item['tempId'] = index;
-            item.id = '';
-          });
-          // this.$refs.inventoryTableref &&
-          //   this.$refs.inventoryTableref.putTableValue(productList);
-          this.oldProductList = JSON.parse(JSON.stringify(productList));
-    
-            // this.$refs.inventoryTableref &&
-            //   this.$refs.inventoryTableref.$refs.productListRef.open(
-            //     productList
-            //   );
-
-          // this.$refs.taskInfoTableRef &&
-          //   this.$refs.taskInfoTableRef.putTableValue(trakNoteList);
-          // this.setAddress();
-          // if (projectId) {
-          //   this.getProjectData(projectId);
-          // }
-        });
-      },
       //选择受托收货单弹框
       handleEntrustedReceive(e) {
         if (e.target.nodeName == 'I') {
@@ -843,7 +779,7 @@ import {
             pricingWay: '',
             sourceNo: '',
             sourceId: '',
-
+            sourceType: '',
           });
           this.$refs.inventoryTableref &&
             this.$refs.inventoryTableref.putTableValue([], true);
@@ -891,7 +827,8 @@ import {
             carNo: carNo ? carNo.split(',') : [],
             pricingWay,
             entrustedCode: code,
-            entrustedId: id
+            entrustedId: id,
+            sourceType: 2,
           });
           this.getSaleOrderDetails([orderId]);
           // productList.forEach((item, index) => {
@@ -923,7 +860,10 @@ import {
             pricingWay: '',
             entrustedCode: '',
             entrustedId: '',
-            productionRequirements: ''
+            productionRequirements: '',
+            sourceType: '',
+            sourceNo: '',
+            sourceId: '',
           });
           this.$refs.inventoryTableref &&
             this.$refs.inventoryTableref.putTableValue([]);