소스 검색

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

mlchen 1 주 전
부모
커밋
3c8e4a53c1
1개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 6 4
      src/views/warehouseManagement/stocktaking/reportLoss/components/addReportDialog.vue

+ 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);