From 4f1575ee37bd2593b3b31e20213fe3065864a653 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期四, 06 六月 2024 13:47:51 +0800
Subject: [PATCH] Merge branch 'master' of http://114.132.189.42:9002/r/center-lims-before into master
---
src/components/do/b1-ins-order/add.vue | 110 +++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 103 insertions(+), 7 deletions(-)
diff --git a/src/components/do/b1-ins-order/add.vue b/src/components/do/b1-ins-order/add.vue
index f712e9b..82e3105 100644
--- a/src/components/do/b1-ins-order/add.vue
+++ b/src/components/do/b1-ins-order/add.vue
@@ -281,6 +281,12 @@
v-model="addObj.remark" :readonly="active>1"></el-input>
</div>
</el-col>
+ <el-col class="search_thing" :span="6" v-if="active==1">
+ <div class="search_label">RTS锛�</div>
+ <div class="search_input">
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="RTS"></el-input>
+ </div>
+ </el-col>
</el-row>
</div>
<div v-show="!configShow">
@@ -631,6 +637,8 @@
bsm1Val: null,
bsm1Dia: false,
total:0,
+ RTS:'',
+ totalArr:[]
}
},
watch: {
@@ -726,6 +734,37 @@
this.addObj.companyId = selects.id
this.selectUserDia = false
},
+ handleAsk(ask){
+ let code = [">","<","=","锛�","锛�","鈮�","鈮�","卤"];
+ if(ask.includes('RTS')){
+ if(ask.includes('&')){
+ // 澶氫釜鏉′欢
+ let arr0 = ask.split('&')
+ let arr1 = []
+ arr0.forEach(m=>{
+ let index = code.findIndex(b=>m.includes(b))
+ if(index>-1){
+ let arr = m.split(code[index]).filter(b=>!!b)
+ let num = eval(this.replaceAll(arr[0],'RTS', this.RTS))
+ m = code[index] + ''+ num
+ arr1.push(m)
+ }
+ })
+ return arr1.join('&')
+ }else{
+ // 鍗曚釜鏉′欢
+ let index = code.findIndex(b=>ask.includes(b))
+ if(index>-1){
+ let arr = ask.split(code[index]).filter(b=>!!b)
+ let num = eval(this.replaceAll(arr[0],'RTS', this.RTS))
+ return code[index] + ''+ num
+ }
+ }
+ }
+ },
+ replaceAll(str, find, replace) {
+ return str.replace(new RegExp(find, 'g'), replace);
+ },
save() {
if (!this.addObj.companyId) {
this.$message.error('鏈�夋嫨瀹㈡埛鍗曚綅')
@@ -749,11 +788,68 @@
this.$message.error('璇疯緭鍏ユ牱鍝佸瀷鍙�')
} else if (!this.sampleList.every(m => m.standardMethodListId)) {
this.$message.error('璇烽�夋嫨妫�楠屾爣鍑�')
+ }else if (this.totalArr.find(a=>a.ask.includes('RTS'))&&!this.RTS) {
+ this.$message.error('璇疯緭鍏TS')
} else {
+ let sampleList = this.HaveJson(this.sampleList)
+ let isRTS = this.totalArr.find(a=>a.ask.includes('RTS'))
+ if(isRTS){
+ sampleList.forEach(item=>{
+ if(item.insProduct&&item.insProduct.length>0){
+ item.insProduct.forEach(a=>{
+ let ask = this.handleAsk(a.ask)
+ if(ask){
+ a.ask = ask
+ }
+ })
+ }
+ // 鍏夌氦甯﹂」鐩�
+ if(item.bushing&&item.bushing.length>0){
+ item.bushing.forEach(a=>{
+ if(a.fiber&&a.fiber.length>0){
+ a.fiber.forEach(b=>{
+ if(b.productList&&b.productList.length>0){
+ b.productList.forEach(c=>{
+ let ask = this.handleAsk(c.ask)
+ if(ask){
+ c.ask = ask
+ }
+ })
+ }
+ })
+ }
+ if(a.fibers&&a.fibers.length>0){
+ a.fibers.forEach(b=>{
+ if(b.productList&&b.productList.length>0){
+ b.productList.forEach(c=>{
+ let ask = this.handleAsk(c.ask)
+ if(ask){
+ c.ask = ask
+ }
+ })
+ }
+ if(b.fiber&&b.fiber.length>0){
+ b.fiber.forEach(c=>{
+ if(c.productList&&c.productList.length>0){
+ c.productList.forEach(d=>{
+ let ask = this.handleAsk(d.ask)
+ if(ask){
+ d.ask = ask
+ }
+ })
+ }
+ })
+ }
+ })
+ }
+ })
+ }
+ })
+ }
this.saveLoad = true
this.$axios.post(this.$api.insOrder.addInsOrder, {
insOrder: this.addObj,
- list: JSON.stringify(this.sampleList.map(a => {
+ list: JSON.stringify(sampleList.map(a => {
a.model = a.model + ((a.modelNum == null || a.modelNum == '' || a.modelNum == 'null') ? '' : (
'-' + a.modelNum))
return a
@@ -1352,12 +1448,12 @@
done()
},
getTotal(){
- let arr = []
+ this.totalArr = []
this.total = 0;
this.sampleList.forEach(item=>{
if(item.insProduct&&item.insProduct.length>0){
item.insProduct.forEach(a=>{
- arr.push(a)
+ this.totalArr.push(a)
})
}
if(item.bushing&&item.bushing.length>0){
@@ -1366,7 +1462,7 @@
a.fiber.forEach(b=>{
if(b.productList&&b.productList.length>0){
b.productList.forEach(c=>{
- arr.push(c)
+ this.totalArr.push(c)
})
}
})
@@ -1375,14 +1471,14 @@
a.fibers.forEach(b=>{
if(b.productList&&b.productList.length>0){
b.productList.forEach(c=>{
- arr.push(c)
+ this.totalArr.push(c)
})
}
if(b.fiber&&b.fiber.length>0){
b.fiber.forEach(c=>{
if(c.productList&&c.productList.length>0){
c.productList.forEach(d=>{
- arr.push(d)
+ this.totalArr.push(d)
})
}
})
@@ -1393,7 +1489,7 @@
}
})
let mySet = new Set();
- let arr0 = arr.filter(item=>{
+ let arr0 = this.totalArr.filter(item=>{
if(item.state == 1){
let num1= mySet.size
if(item.manHourGroup===''||!item.manHourGroup){
--
Gitblit v1.9.3