From d975fc4756806f5b51f006c19c33571b9b8c0b3b Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期五, 20 十二月 2024 09:30:19 +0800
Subject: [PATCH] 修改下单时要求值输入限制

---
 src/components/do/b1-ins-order/add.vue |   42 +++++++++++++++++++++++++++++++-----------
 1 files changed, 31 insertions(+), 11 deletions(-)

diff --git a/src/components/do/b1-ins-order/add.vue b/src/components/do/b1-ins-order/add.vue
index 01ac43a..7794127 100644
--- a/src/components/do/b1-ins-order/add.vue
+++ b/src/components/do/b1-ins-order/add.vue
@@ -489,7 +489,7 @@
           <el-table-column prop="testRequirements" label="璇曢獙鏍囧噯" align="center" min-width="100">
             <template slot-scope="scope">
               <el-select v-model="scope.row.testRequirements" :disabled="scope.row.model==null||active>1"
-                placeholder="璇曢獙鏍囧噯" size="small" :readonly="active>1" style="width: 100%;" clearable>
+                placeholder="璇曢獙鏍囧噯" size="small" :readonly="active>1" style="width: 100%;" clearable @change="changeModel0(scope.row)">
                 <el-option v-for="item in standard" :key="item.id" :label="item.label" :value="item.value">
                 </el-option>
               </el-select>
@@ -562,7 +562,7 @@
             <template slot-scope="scope">
               <el-input size="small" placeholder="瑕佹眰鎻忚堪" v-model="scope.row.tell" clearable type="textarea"
                 :autosize="{ minRows: 1, maxRows: 3}" @change="e=>requestChange(e,scope.row,'tell')"
-                v-if="active==1"></el-input>
+                v-if="active==1" :disabled="!!scope.row.tell&&scope.row.tell.includes('[')&&scope.row.tell.includes(']')&&scope.row.tell.includes(',')"></el-input>
               <span v-else>
                 <template >{{ scope.row.tell }}</template>
               </span>
@@ -572,7 +572,7 @@
             <template slot-scope="scope">
               <el-input size="small" placeholder="瑕佹眰鍊�" v-model="scope.row.ask" clearable type="textarea"
                 :autosize="{ minRows: 1, maxRows: 3}" @change="e=>requestChange(e,scope.row,'ask')"
-                v-if="active==1&&scope.row.inspectionValueType!='5'"></el-input>
+                v-if="active==1&&scope.row.inspectionValueType!='5'" :disabled="!!scope.row.ask&&scope.row.ask.includes('[')&&scope.row.ask.includes(']')&&scope.row.ask.includes(',')"></el-input>
               <span v-else>
                 <!-- <template v-if="(scope.row.ask.indexOf('D')>-1
                 ||scope.row.ask.indexOf('W')>-1
@@ -1059,7 +1059,8 @@
       1銆佸鎵樻柟鎵胯鎻愪緵鐨勪俊鎭笌鏍峰搧鐨勭湡瀹炴��;<br/>
       2銆佸鎵橀�佹牱妫�楠岀粨鏋滀粎閫傜敤浜庢敹鍒扮殑鏍峰搧;<br/>
       3銆佽瘯楠岃繃绋嬪鑷寸殑鏍峰搧鎹熷潖銆侀厤浠舵崯鍧忋�佹崯鑰楋紝鏈祴璇曞満涓嶆壙鎷呰禂鍋胯矗浠�;<br/>
-      4銆佸疄楠屽鎵胯鍏寮�灞曟娴嬫椿鍔紝骞舵壙璇轰繚瀹堝湪妫�娴嬫椿鍔ㄨ繃绋嬩腑鎵�鑾风煡鐨勪繚瀵嗕俊鎭��</p>
+      4銆佸疄楠屽鎵胯鍏寮�灞曟娴嬫椿鍔紝骞舵壙璇轰繚瀹堝湪妫�娴嬫椿鍔ㄨ繃绋嬩腑鎵�鑾风煡鐨勪繚瀵嗕俊鎭��
+      </p>
   </div>
 </template>
 
@@ -1971,13 +1972,14 @@
 
           let projectNum = this.totalArr.filter(a => a.state == 1).length
           if(projectNum==0){
-            this.$confirm('妫�楠岄」鐩负绌猴紝鏄惁纭鎻愪氦?', "鎻愮ず", {
-              confirmButtonText: "纭畾",
-              cancelButtonText: "鍙栨秷",
-              type: "warning"
-            }).then(() => {
-              this.saveMethod(sampleList)
-            }).catch(() => {})
+            // this.$confirm('妫�楠岄」鐩负绌猴紝鏄惁纭鎻愪氦?', "鎻愮ず", {
+            //   confirmButtonText: "纭畾",
+            //   cancelButtonText: "鍙栨秷",
+            //   type: "warning"
+            // }).then(() => {
+            //   this.saveMethod(sampleList)
+            // }).catch(() => {})
+            return this.$message.error('璇锋坊鍔犳楠岄」鐩�')
           }else{
             let isRTS = this.totalArr.find(a => a.ask != null && this.symbolList.find(b=>a.ask&&a.ask.includes(b)) && a.state == 1)
             if (isRTS&&this.PROJECT=='妫�娴嬩腑蹇�') {
@@ -2321,10 +2323,20 @@
       },
       saveMethod(sampleList){
         let isHaveAsk = this.totalArr.filter(a => (a.ask === null||a.ask=='')&&a.state==1)
+        let isHaveAsk0 = this.totalArr.filter(a => (a.ask=='/'||a.ask=='-'||a.ask=='鈥斺��'||((/\d/.test(a.ask))&&(a.ask.includes('<')||a.ask.includes('>')||a.ask.includes('=')||a.ask.includes('锛�')||a.ask.includes('锛�')||a.ask.includes('鈮�')||a.ask.includes('鈮�'))))&&a.state==1)
+        let stateArr = this.totalArr.filter(a=>a.state==1)
         if (isHaveAsk.length > 0) {
           this.$message({
             type: 'error',
             message: '璇峰~鍐欒姹傚�煎悗鍐嶆彁浜�'
+          })
+          return false;
+        }
+        if (isHaveAsk0.length <stateArr.length) {
+          this.$message({
+            type: 'error',
+            message: '瑕佹眰鍊艰緭鍏ユ牸寮忎笉瀵癸紝鍙緭鍏�/銆�-銆佲�斺�斾唬琛ㄤ笉鍒ゅ畾锛�<銆�=銆�>銆佲墺銆佲墹鍔犱笂鏁板瓧浠h〃鑼冨洿锛岃閲嶆柊杈撳叆',
+            duration: 8 * 1000
           })
           return false;
         }
@@ -2960,10 +2972,18 @@
           let obj = this.sampleIds.find(b => b == a.id)
           if (obj) {
             this.$set(a,type, this.allInfo[type])
+            if(type=='testRequirements'&&a.standardMethodListId&&a.standardMethodListId.length>0){
+              this.methodChange(a.standardMethodListId, a)
+            }
             // a[type] = this.allInfo[type]
           }
         })
       },
+      changeModel0(row){
+        if(row.standardMethodListId&&row.standardMethodListId.length>0){
+          this.methodChange(row.standardMethodListId, row)
+        }
+      },
       changeStandardMethodListId() {
         this.sampleList.forEach(a => {
           let obj = this.sampleIds.find(b => b == a.id)

--
Gitblit v1.9.3