From c1e5dfb4c72a0ab2478d3b7295ab7deecd3f8c8c Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期二, 16 四月 2024 16:47:36 +0800 Subject: [PATCH] 修改样式 --- src/components/do/b1-inspect-order-plan/Inspection.vue | 122 ++++++++++++++++++++++++++-------------- 1 files changed, 78 insertions(+), 44 deletions(-) diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue index 7b70bdc..c405c31 100644 --- a/src/components/do/b1-inspect-order-plan/Inspection.vue +++ b/src/components/do/b1-inspect-order-plan/Inspection.vue @@ -124,6 +124,7 @@ <el-col :span="12" style="text-align: right;"> <el-button size="small" type="primary" @click="sampleVisible=true">鏍峰搧鍒囨崲</el-button> <el-button size="small" type="primary" @click="taskVisible=true">浠诲姟鍒囨崲</el-button> + <el-button size="small" type="primary" @click="submit" v-show="state==1" :loading="submitLoading">鎻愪氦</el-button> <!-- 澶嶆牳 --> <el-button size="medium" type="primary" @click="upInsReview(1)" :loading="reviewLoading" v-show="state>1">閫氳繃</el-button> @@ -241,7 +242,7 @@ :componentData="componentData" :key="upIndex" /> </el-drawer> <el-dialog title="妫�楠屽鏍�" :visible.sync="reviewDia" width="400px"> - <div class="body" style="display: flex;align-items: center;" v-if="reviewDia"> + <div class="body" style="display: flex;" v-if="reviewDia"> <div class="search_label" style="width: 120px;"><span class="required-span">* </span>涓嶉�氳繃鍘熷洜锛�</div> <div class="search_input"> <el-input size="small" clearable v-model="noReason" type="textarea" :autosize="{ minRows: 3, maxRows: 5}"></el-input> @@ -266,6 +267,7 @@ return { sampleVisible: false, taskVisible: false, + submitLoading:false, searchForm: { sampleName: null, state: null @@ -331,7 +333,8 @@ id(val) { this.loading = true this.$axios.post(this.$api.insOrderPlan.doInsOrder, { - id: val + id: val, + laboratory: this.sonLaboratory }).then(res => { this.insOrder = res.data.insOrder; this.urgentList.forEach(m => { @@ -361,6 +364,7 @@ methods: { handleChangeSample(row, column, event) { this.currentSample = row; + this.param = {} this.currentSample.insProduct.forEach(a => { this.param[a.id] = { insValue: [], @@ -446,26 +450,26 @@ this.tableList.forEach(a => { let dels = [] let ids = [] - a.template.forEach(b => { - if (b.v.ps != undefined && b.v.ps.value === '妫�楠屽瓙椤�') { - let count = 0 - for (let i in this.currentSample.insProduct) { - if (this.currentSample.insProduct[i].inspectionItemSubclass === b.v.v && this.currentSample - .insProduct[i].templateId === a.templateId) { - ids.push({ - r: b.r, - id: this.currentSample.insProduct[i].id, - product: this.currentSample.insProduct[i] - }) - break - } - count++ - } - if (count === this.currentSample.insProduct.length) { - dels.push(b) - } - } - }) + a.template.forEach(b => { + if (b.v.ps != undefined && b.v.ps.value === '妫�楠屽瓙椤�') { + let count = 0 + for (let i in this.currentSample.insProduct) { + if (this.currentSample.insProduct[i].inspectionItemSubclass === b.v.v && this.currentSample + .insProduct[i].templateId === a.templateId) { + ids.push({ + r: b.r, + id: this.currentSample.insProduct[i].id, + product: this.currentSample.insProduct[i] + }) + break + } + count++ + } + if (count === this.currentSample.insProduct.length) { + dels.push(b) + } + } + }) dels.forEach(del => { for (let b = 0; b < a.template.length; b++) { if (a.template[b].r === del.r) { @@ -588,11 +592,14 @@ this.param[a.id].insValue[i].u = insValue[i].u } }catch(e){} - try{ - this.param[a.id].equipValue.v.v = a.insProductResult.equipValue - }catch(e){} - this.param[a.id].resValue.v.v = a.lastValue - this.param[a.id].insResult.v.v = a.insResult + try{ + this.param[a.id].equipValue.v.v = a.insProductResult.equipValue + }catch(e){} + try{ + this.param[a.id].resValue.v.v = a.lastValue + this.param[a.id].insResult.v.v = a.insResult + }catch(e){ + } }) this.handleExcelMethod() }, @@ -625,7 +632,7 @@ break } } - comValue[(tableCode + c.r)] = parseFloat(c.v.v) + comValue[(tableCode + (c.r+1))] = parseFloat(c.v.v) } } }) @@ -689,6 +696,25 @@ comResult = sum break; default: + let valueList = []; + item.valueList.forEach(a => { + valueList.push({ + name:`${this.comparisonList[a.c].label}${a.r+1}`, + value:0, + }) + }) + for (var a in comValue) { + valueList.forEach(b => { + if(b.name==a){ + b.value = comValue[a] + } + }) + } + let str = item.v.f.replace(/=/g,' '); + valueList.forEach(b => { + str = str.replace(b.name,b.value) + }) + comResult = eval(str) break; } list.forEach(a => { @@ -736,9 +762,9 @@ item.valueList = valueList; } else { valueList = [] - let regex = /[=\+\-\*\%\(\)\s]/g + let regex = /[=\+\-\*\%\(\)\/\s]/g let mode = item.v.f.replace(regex, ' ').split(' '); - mode.filter(m => m).forEach(m => { + mode.filter(m => m&&!Number(m)).forEach(m => { let r = m.split('')[1] - 1 let c = this.comparisonList.find(j => j.label == m.split('')[0]).value valueList.push({ @@ -820,16 +846,12 @@ type:1, laboratory:this.sonLaboratory, tell:null - }, { - headers: { - 'Content-Type': 'application/json' - } }).then(res => { - if (res.code === 200 && res.data) { - this.reviewLoading = false; - this.$message.success("澶嶆牳閫氳繃") + if (res.code === 200) { + this.$message.success("鎿嶄綔鎴愬姛") this.$emit('goback') } + this.reviewLoading = false; }).catch(error => { console.error(error) this.reviewLoading = false; @@ -847,16 +869,12 @@ type:0, laboratory:this.sonLaboratory, tell:this.noReason - }, { - headers: { - 'Content-Type': 'application/json' - } }).then(res => { - if (res.code === 200 && res.data) { - this.reviewLoading = false; - this.$message.success("澶嶆牳涓嶉�氳繃") + if (res.code === 200) { + this.$message.success("鎿嶄綔鎴愬姛") this.$emit('goback') } + this.reviewLoading = false; }).catch(error => { console.error(error) this.reviewLoading = false; @@ -865,6 +883,22 @@ this.$message.error('鏈緭鍏ヤ笉閫氳繃鍘熷洜') } }, + submit(){ + this.submitLoading = true; + this.$axios.post(this.$api.insOrderPlan.submitPlan, { + orderId:this.orderId, + laboratory:this.sonLaboratory, + }).then(res => { + if (res.code === 200) { + this.$message.success("鎿嶄綔鎴愬姛") + this.$emit('goback') + } + this.submitLoading = false; + }).catch(error => { + console.error(error) + this.submitLoading = false; + }) + } } } </script> -- Gitblit v1.9.3