Преглед изворни кода

优化采购委外出库逻辑和数据处理

yusheng пре 10 месеци
родитељ
комит
0b4902b97f

+ 1 - 1
src/views/bpm/handleTask/components/purchaseOrder/outSourceSend/boxTabPage.vue

@@ -79,7 +79,7 @@
             return {
               form: this.form,
               bizType: 7,
-              sourceBizNo: this.form.code
+              sourceBizNo: this.form.code,
             };
           case 'tab3':
             return {

+ 40 - 2
src/views/bpm/outgoingManagement/outbound.vue

@@ -1066,7 +1066,7 @@
               return {
                 categoryId: item.productId || item.categoryId,
                 num: item.totalCount,
-                batchNo: item.batchNo || '',
+                batchNo: item.batchNo || ''
               };
             })
           };
@@ -1083,6 +1083,44 @@
             .catch((err) => {
               console.log(err);
             });
+          return;
+        }
+        //采购委外
+        if (this.form.productList?.length > 0) {
+          this.getStaffList({ id: this.form.deptId }).then(() => {
+            this.formData.fromId = this.form.makerId;
+            this.formData.fromUser = this.form.makerName;
+            this.formData.extInfo.verifyDeptCode = this.form.deptId;
+            this.formData.extInfo.verifyDeptName = this.form.deptName;
+          });
+          let pData = {
+            type: '1',
+            builders: this.form.productList.map((item) => {
+              return {
+                categoryId: item.productId,
+                num: item.totalCount,
+                price: item.totalPrice,
+                unitPrice: item.singlePrice,
+                weight: item.singleWeight * item.totalCount || 0,
+                batchNo: item.batchNo || '',
+                taskId: item.taskId || ''
+              };
+            })
+          };
+          let pData2 = {
+            type: 3,
+            taskIds: this.form.productList.map((item) => item.taskId),
+            workOrderIds: [this.form.sourceId]
+          };
+
+          storageApi
+            .getHierarchyFifo(this.form.sourceId ? pData2 : pData)
+            .then((data) => {
+              this.detailData(data, this.dimension);
+            })
+            .catch((err) => {
+              console.log(err);
+            });
         }
         // if (this.form.productList?.length > 0) {
         //   this.getStaffList({ id: this.form.deptId }).then(() => {
@@ -1213,7 +1251,7 @@
           );
         },
         deep: true
-      },
+      }
       // detailList: {
       //   handler(newVal) {
       //     if (newVal.length) {

+ 0 - 3
src/views/bpm/stockManagement/storage.vue

@@ -3580,11 +3580,8 @@
           );
           this.packingList.splice(packingIndex + 1, 0, ...packingList);
         }
-        const lastIndex = this.packingList.length - 1;
-
         let remainder =
           row.measureQuantity % row.packingSpecificationOption[1]?.packageCell;
-        console.log(remainder, 'remainder');
         if (remainder > 0) {
           let onlyCode = packingCodeList[packingCodeList.length - 1]?.onlyCode;
           let index = this.packingList.findIndex(