From a6a4092ce1899bd020bc15cff43f0977c87e6be8 Mon Sep 17 00:00:00 2001 From: zouyu <2723363702@qq.com> Date: 星期五, 15 九月 2023 16:20:25 +0800 Subject: [PATCH] Merge branch 'master' of http://192.168.0.22:9001/r/mom-before --- src/components/view/rawInsDetail.vue | 42 ++++++++++++++++++++++++++++++++++-------- 1 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/components/view/rawInsDetail.vue b/src/components/view/rawInsDetail.vue index 4b6009a..a028670 100644 --- a/src/components/view/rawInsDetail.vue +++ b/src/components/view/rawInsDetail.vue @@ -427,14 +427,15 @@ }, methods: { assertTest(row){ - if(!/^[^><=]/.test(row.required)){ + let fuArr=['>', '<', '='] + if(!fuArr.includes(row.required[0])){ this.$message({ message: "鏍囧噯鍊糩"+row.required+"]鏍煎紡棣栦綅搴斿寘鍚�>,<鎴栬��=", type: 'warning' }); return } - if(!/^[^><=]/.test(row.internal)){ + if(!fuArr.includes(row.internal[0])){ this.$message({ message: "鍐呮帶鍊糩"+row.internal+"]鏍煎紡棣栦綅搴斿寘鍚�>,<鎴栬��=", type: 'warning' @@ -474,20 +475,45 @@ }, // 鏂板妫�楠屽崟 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||item.name==='' + }) + if(filterTable.length>0) { + this.$message({ + message: "椤圭洰鍚嶇О锛屾爣鍑嗗�煎拰鍐呮帶鍊间笉鑳戒负绌猴紒", + type: 'warning' + }); + return + } + } this.projectTable.forEach(i => { // 灏嗗垪琛ㄨ浆鎹负瀛楃涓� i.testValue = i.testValueList.join(","); }); this.detailInfo.rawInsProducts = this.projectTable; - const res = await this.$axios.post( + this.$axios.post( this.$api.url.addRawInspects, { ...this.detailInfo }, { headers: { "Content-Type": "application/json" } } - ); - this.detailId = res.data; - this.getDetailInfo(); - this.$message.success(res.message); - this.goBack(); + ).then(res=>{ + console.log(res); + if(res.code=="201"){ + this.$message({ + message: res.message, + type: 'warning' + }); + return + }else{ + // this.detailId = res.data; + // this.getDetailInfo(); + // // this.$message.success(res.message); + // this.goBack(); + } + }); }, // 淇敼椤圭洰鐨勬娴嬪�兼敼鍙樼粨璁� -- Gitblit v1.9.3