Эх сурвалжийг харах

优化出库逻辑和表格渲染

yusheng 10 сар өмнө
parent
commit
d8d7a2e713

+ 2 - 2
src/views/bpm/handleTask/components/saleOrder/invoice/detailDialog.vue

@@ -169,7 +169,7 @@
         :bizType="3"
         :saleProductList="form.productList"
         type="销售发货出库"
-        v-if="!isView && taskDefinitionKey == 'storemanApprove'"
+        v-if="!isView && taskDefinitionKey == 'storemanApprove'&&form.docNo"
       ></add>
     </keep-alive>
     <detailDialog
@@ -640,7 +640,7 @@
           this.form = data;
           this.detailData = data;
           this.$nextTick(() => {
-            this.$refs.add?.initFormData();
+            // this.$refs.add?.initFormData();
             this.$refs.outgoingDetai?._getInfo(data.docNo);
           });
         }

+ 46 - 45
src/views/bpm/outgoingManagement/outbound.vue

@@ -218,7 +218,7 @@
                 v-for="(item, index) in newColumns"
                 :label="item.label"
                 :align="item.align"
-                :key="index"
+                :key="item.prop"
                 :prop="item.prop"
                 :show-overflow-tooltip="item.showOverflowTooltip"
               ></el-table-column>
@@ -1065,7 +1065,8 @@
             builders: this.saleProductList.map((item) => {
               return {
                 categoryId: item.productId || item.categoryId,
-                num: item.totalCount
+                num: item.totalCount,
+                batchNo: item.batchNo || '',
               };
             })
           };
@@ -1083,42 +1084,42 @@
               console.log(err);
             });
         }
-        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]
-          };
+        // 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);
-            });
-        }
+        //   storageApi
+        //     .getHierarchyFifo(this.form.sourceId ? pData2 : pData)
+        //     .then((data) => {
+        //       this.detailData(data, this.dimension);
+        //     })
+        //     .catch((err) => {
+        //       console.log(err);
+        //     });
+        // }
       },
 
       // 初始化部门数据
@@ -1213,14 +1214,14 @@
         },
         deep: true
       },
-      detailList: {
-        handler(newVal) {
-          if (newVal.length) {
-            this.initFormData();
-          }
-        },
-        deep: true
-      }
+      // detailList: {
+      //   handler(newVal) {
+      //     if (newVal.length) {
+      //       this.initFormData();
+      //     }
+      //   },
+      //   deep: true
+      // }
     }
   };
 </script>