Browse Source

订单管理添加货品明细校验

lph 1 year ago
parent
commit
efe6603bea
1 changed files with 34 additions and 0 deletions
  1. 34 0
      zkqy-ui/src/views/orderMange/index.vue

+ 34 - 0
zkqy-ui/src/views/orderMange/index.vue

@@ -1520,11 +1520,45 @@ export default {
         callback(new Error("校验失败,请稍后再试"));
       }
     },
+    // 校验表格数据
+    validateTableData() {
+      if (this.productionTableData.length == 0) {
+        return {
+          res: false,
+          msg: "请添加货品明细",
+        };
+      }
+      let res = this.productionTableData.every((item) => {
+        return (
+          item.productNo &&
+          item.productNumber &&
+          item.productUnitPrice &&
+          item.productAmounts &&
+          item.sliceType &&
+          item.colourNumber
+        );
+      });
+      if (!res) {
+        return {
+          res: false,
+          msg: "请填写完整货品明细",
+        };
+      }
+      return {
+        res: true,
+        msg: "",
+      };
+    },
     // 审计   提交编辑结果按钮回调
     async editConfirm() {
       this.$refs.formDataRef.validate(async (valid) => {
         if (valid) {
           console.log(valid);
+          let tableValidate = this.validateTableData();
+          if (!tableValidate.res) {
+            this.$message.warning(tableValidate.msg);
+            return;
+          }
           let {
             id,
             //订单表数据