From 5d681a5c48d6b09b7bc053795760fa8030f5f1cf Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期五, 15 九月 2023 14:24:59 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.22:9001/r/mom-before

---
 src/components/view/rawInsDetail.vue |   47 +++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 43 insertions(+), 4 deletions(-)

diff --git a/src/components/view/rawInsDetail.vue b/src/components/view/rawInsDetail.vue
index 2ab34d0..13741d8 100644
--- a/src/components/view/rawInsDetail.vue
+++ b/src/components/view/rawInsDetail.vue
@@ -12,7 +12,7 @@
             >鎻� 浜�</el-button
           >
           <el-button
-            icon="el-icon-download"
+            icon="el-icon-back"
             @click="
               () => {
                 goBack();
@@ -194,6 +194,7 @@
           <template slot-scope="scope">
             <el-input
               :disabled="detailId != null"
+              @blur="assertTest(scope.row)"
               v-model="scope.row.required"
               placeholder="璇疯緭鍏ユ爣鍑嗗��"
             ></el-input>
@@ -202,6 +203,7 @@
         <el-table-column prop="internal" label="鍐呮帶鍊�" min-width="150">
           <template slot-scope="scope">
             <el-input
+              @blur="assertTest(scope.row)"
               :disabled="detailId != null"
               v-model="scope.row.internal"
               placeholder="璇疯緭鍏ュ唴鎺у��"
@@ -350,6 +352,7 @@
 </template>
 
 <script>
+import { triggerRef } from "vue";
 import RawIns from "./raw-ins.vue";
 export default {
   components: { RawIns },
@@ -383,6 +386,7 @@
       } else {
         conclusion.testState = 1;
       }
+      console.log([conclusion]);
       return [conclusion];
     }
   },
@@ -422,6 +426,23 @@
     }
   },
   methods: {
+    assertTest(row){
+      let fuArr=['>', '<', '=']
+      if(!fuArr.includes(row.required[0])){
+        this.$message({
+                    message: "鏍囧噯鍊糩"+row.required+"]鏍煎紡棣栦綅搴斿寘鍚�>,<鎴栬��=",
+                    type: 'warning'
+                });
+                return
+      }
+      if(!fuArr.includes(row.internal[0])){
+        this.$message({
+                    message: "鍐呮帶鍊糩"+row.internal+"]鏍煎紡棣栦綅搴斿寘鍚�>,<鎴栬��=",
+                    type: 'warning'
+                });
+                return
+      }
+    },
     // 璁惧鏍戣繃婊ゆ悳绱�
     filterNode(value, data) {
       if (!value) return true;
@@ -454,6 +475,20 @@
     },
     // 鏂板妫�楠屽崟
     async addNewRawInspect() {
+      //TODO:
+      console.log(this.projectTable);
+      if(this.projectTable.length>0){
+        let filterTable= this.projectTable.filter(item=>{
+        return item.required===''||item.internal===''||item.required===null||item.internal===null
+        })
+        if(filterTable.length>0) {
+          this.$message({
+                    message: "鏍囧噯鍊煎拰鍐呮帶鍊间笉鑳戒负绌猴紒",
+                    type: 'warning'
+                });
+          return
+        }
+      }
       this.projectTable.forEach(i => {
         // 灏嗗垪琛ㄨ浆鎹负瀛楃涓�
         i.testValue = i.testValueList.join(",");
@@ -467,6 +502,7 @@
       this.detailId = res.data;
       this.getDetailInfo();
       this.$message.success(res.message);
+      this.goBack();
     },
 
     // 淇敼椤圭洰鐨勬娴嬪�兼敼鍙樼粨璁�
@@ -484,9 +520,11 @@
     async submitSave() {
       const res = await this.$axios.post(
         this.$api.url.updateRawInspectsById + `${this.detailId}`
-      );
-      this.$message.success("鎻愪氦鎴愬姛");
-      this.getDetailInfo();
+      ).then(res=>{
+        this.$message.success("鎻愪氦鎴愬姛");
+        this.getDetailInfo();
+        this.goBack()
+聽 聽 聽 });
     },
     // 鑾峰彇璁惧鏍戝唴瀹�
     getOptions() {
@@ -503,6 +541,7 @@
         name: "",
         required: "",
         textValue: "",
+        testState:null,
         testValueList: [],
         unit: ""
       };

--
Gitblit v1.9.3