Browse Source

保存加校验

qukaidi 4 năm trước cách đây
mục cha
commit
1a5796c6b0
1 tập tin đã thay đổi với 52 bổ sung24 xóa
  1. 52 24
      src/views/warehouseBusiness/inStock/index.vue

+ 52 - 24
src/views/warehouseBusiness/inStock/index.vue

@@ -927,7 +927,7 @@
               </el-col>
             </el-row>
           </el-col>
-           <el-col :span="8">
+          <el-col :span="8">
             <el-form-item>
               <el-table
                 :data="CntrTable"
@@ -4635,7 +4635,8 @@ export default {
           index === 13 ||
           index === 10 ||
           index === 11 ||
-          index === 12
+          index === 12 ||
+          index === 14
         ) {
           const values = data.map((item) => Number(item[column.property]));
           if (!values.every((value) => isNaN(value))) {
@@ -4647,9 +4648,12 @@ export default {
                 return prev;
               }
             }, 0);
-            if (index === 13 || index === 12) {
+            if (index === 13 || index === 14) {
               sums[index] = (sums[index] / 1000).toFixed(2) + "(吨)";
             }
+            if (index === 12) {
+              sums[index] = sums[index];
+            }
           }
         }
       });
@@ -7302,33 +7306,57 @@ export default {
               "tWarehousebillsfeesDr",
               JSON.stringify(this.warehouseDrList)
             );
+            formDatae.append("mblnoStatus", this.mblnoStatus);
             addWarehousebills(formDatae).then((response) => {
-              this.msgSuccess("保存成功");
-              this.form = response.data.warehouseBills;
-              this.$set(this.form, "fEta", Date.parse(this.form.fEta));
-              this.$set(this.form, "fStltypeid", this.form.fStltypeid + "");
-              this.$set(this.form, "fBsdate", Date.parse(this.form.fBsdate));
-              this.$set(this.form, "fTrademodeid", this.form.fTrademodeid + "");
-              this.$set(
-                this.form,
-                "createTime",
-                Date.parse(this.form.createTime)
-              );
-              this.dataList = response.data.warehousebillsitems;
-              for (let list in this.dataList) {
+              if (response.data == false) {
+                this.$confirm(response.msg, "提示", {
+                  confirmButtonText: "确定",
+                  cancelButtonText: "取消",
+                  type: "warning",
+                })
+                  .then(() => {
+                    this.mblnoStatus = true;
+                    this.preservation();
+                  })
+                  .catch(() => {
+                    this.$message({
+                      type: "info",
+                      message: "已取消",
+                    });
+                  });
+              } else {
+                this.mblnoStatus = "";
+                this.msgSuccess("保存成功");
+                this.form = response.data.warehouseBills;
+                this.$set(this.form, "fEta", Date.parse(this.form.fEta));
+                this.$set(this.form, "fStltypeid", this.form.fStltypeid + "");
+                this.$set(this.form, "fBsdate", Date.parse(this.form.fBsdate));
                 this.$set(
-                  this.dataList[list],
-                  "fBsdate",
-                  Date.parse(this.dataList[list].fBsdate)
+                  this.form,
+                  "fTrademodeid",
+                  this.form.fTrademodeid + ""
                 );
                 this.$set(
-                  this.dataList[list],
-                  "fBusinessType",
-                  this.dataList[list].fBusinessType + ""
+                  this.form,
+                  "createTime",
+                  Date.parse(this.form.createTime)
                 );
+                this.dataList = response.data.warehousebillsitems;
+                for (let list in this.dataList) {
+                  this.$set(
+                    this.dataList[list],
+                    "fBsdate",
+                    Date.parse(this.dataList[list].fBsdate)
+                  );
+                  this.$set(
+                    this.dataList[list],
+                    "fBusinessType",
+                    this.dataList[list].fBusinessType + ""
+                  );
+                }
+                this.fid = response.data.warehouseBills.fId;
+                this.getList();
               }
-              this.fid = response.data.warehouseBills.fId;
-              this.getList();
             });
           }
         }