From a6c14c75e5a5f677c2a3571cad426d50cb106e3d Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期五, 09 八月 2024 09:02:59 +0800
Subject: [PATCH] 修改检验任务、下单bug
---
src/components/do/b1-ins-order/add.vue | 70 ++++++++++++++++++++++++++++++++--
1 files changed, 65 insertions(+), 5 deletions(-)
diff --git a/src/components/do/b1-ins-order/add.vue b/src/components/do/b1-ins-order/add.vue
index d08b861..b06da57 100644
--- a/src/components/do/b1-ins-order/add.vue
+++ b/src/components/do/b1-ins-order/add.vue
@@ -475,7 +475,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&&isAskOnlyRead"></el-input>
+ v-if="active==1&&isAskOnlyRead&&scope.row.inspectionValueType!='5'"></el-input>
<span v-else>
<!-- <template v-if="(scope.row.ask.indexOf('D')>-1
||scope.row.ask.indexOf('W')>-1
@@ -1573,10 +1573,27 @@
isHaveBushing = false
}
})
+ //杩囨护妫�娴嬮」锛氬幓闄ょ壒娈婇」
+ let filterProductList = this.productListSelected.filter(ele=>ele.bsm==0&&/[0-9]/.test(ele.ask)).filter(ele=>{
+ if(select[1].indexOf('閫氫俊')>=0 && ['鍏夌紗','鍏夌氦'].includes(select[2])){
+ return !['娓╁害寰幆','鍏夌氦鎺ュご鎹熻��'].includes(ele.inspectionItem)
+ }
+ return true
+ }).filter(ele=>{
+ if(select[1].indexOf('鐢靛姏')>=0){
+ return !['娓╁崌璇曢獙','鐑惊鐜�'].includes(ele.inspectionItem)
+ }
+ return true
+ })
+ //鏍¢獙妫�楠岄」鐨勮姹傚�煎拰瑕佹眰鎻忚堪
+ const isTrue = this.checkRequiredValueAndRemark(filterProductList)
+ if(!isTrue){
+ this.$message.error('妫�楠岄」鐨勮姹傚�间笌瑕佹眰鎻忚堪涓嶅尮閰嶏紝 璇锋鏌�')
+ return
+ }
+
// console.log('isHaveBushing===', this.totalArr)
- // inspectionItem
let spcialItem = this.totalArr.find(a => a.state == 1 && a.inspectionItem.includes('鏉惧绠�'))
- // console.log('isHaveBushing===', isHaveBushing)
if (productListSelected && select[2] === '鍏夌紗' && isHaveBushing === false) {
this.$message.error('鍏夌紗娓╁害寰幆椤圭洰蹇呴』杩涜鍏夌氦閰嶇疆')
this.$refs.sampleTable.setCurrentRow(this.currentMethod, true)
@@ -1615,6 +1632,50 @@
this.saveMethod(sampleList)
}
}
+ },
+ checkRequiredValueAndRemark(data){
+ let isTrue = true
+ try{
+ data.forEach(ele=>{
+ if(['鈮�','鈮�','>','<','='].includes(ele.ask[0])){
+ const askVal = ele.ask.substring(1,ele.ask.length)
+ if(isNaN(askVal) || ele.tell.indexOf(askVal)<0){
+ isTrue = false
+ }
+ }
+ if(ele.ask.indexOf('-')>0 && ele.ask.length>1){
+ let tell = ele.tell
+ if(ele.tell.indexOf('~')>0){
+ tell = ele.tell.replace('~','-')
+ }
+ const splits = ele.ask.split('-')
+ if(splits.length==2 && !isNaN(splits[0]) && !isNaN(splits[1])){
+ let min = Math.min(...splits)
+ let max = Math.max(...splits)
+ if(ele.tell.indexOf('卤')<0&&tell.indexOf(ele.ask)<0){
+ isTrue = false
+ }else if(ele.tell.indexOf('卤')>0&&ele.tell!=ele.ask){
+ let splitNums = ele.tell.split('卤')
+ if(splitNums.length<2){
+ isTrue = false
+ }else{
+ let minTell = Number(splitNums[0])-Number(splitNums[1])
+ let maxTell = Number(splitNums[0])+Number(splitNums[1])
+ if(minTell!=min || maxTell!=max){
+ isTrue = false
+ }
+ }
+ }
+ }else{
+ isTrue = false
+ }
+ }
+ })
+ }catch(error){
+ console.log(error);
+ isTrue = false
+ }
+ return isTrue
},
save0(){
if(this.editTable.every(m=>m.value)){
@@ -2897,9 +2958,8 @@
getTotal() {
this.totalArr = []
this.total = 0;
- // console.log(this.sampleList)
this.sampleList.forEach(item => {
- if (item.insProduct && item.insProduct.length > 0) {
+ if (item.insProduct && item.insProduct.length > 0) {
item.insProduct.forEach(a => {
this.totalArr.push(a)
})
--
Gitblit v1.9.3