Jelajahi Sumber

fix:5390【报损报溢】新增操作,点击保存,然后去修改,修改完成去提交又会产生一条新数据

mlchen 1 Minggu lalu
induk
melakukan
3c8e4a53c1

+ 6 - 4
src/views/warehouseManagement/stocktaking/reportLoss/components/addReportDialog.vue

@@ -408,7 +408,7 @@
         }
       },
       id: {
-        type: String,
+        type: [String, Number],
         default: ''
       }
     },
@@ -513,8 +513,6 @@
         if (val) {
           // 获取审核人列表数据
           this.getUserList();
-          // 获取计划单号
-          this.getOrderCode();
           if (
             this.dialogTile === '修改报损报溢' ||
             this.dialogTile === '报损报溢详情'
@@ -545,6 +543,10 @@
               approvalUserName: '' // 审核人name
             };
           }
+          // 仅新增单据生成编码,编辑时保留原单号。
+          if (!this.id) {
+            this.getOrderCode();
+          }
         }
       }
     },
@@ -783,7 +785,7 @@
               params.status = 0;
             }
             if (this.productList?.length > 0) {
-              if (this.dialogTile === '修改报损报溢') {
+              if (params.id) {
                 res = await updateReportsList(params);
               } else {
                 res = await saveReportsList(params);