| | |
| | | <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> |
| | |
| | | return { |
| | | sampleVisible: false, |
| | | taskVisible: false, |
| | | submitLoading:false, |
| | | searchForm: { |
| | | sampleName: null, |
| | | state: null |
| | |
| | | methods: { |
| | | handleChangeSample(row, column, event) { |
| | | this.currentSample = row; |
| | | this.param = {} |
| | | this.currentSample.insProduct.forEach(a => { |
| | | this.param[a.id] = { |
| | | insValue: [], |
| | |
| | | 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) { |
| | |
| | | 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() |
| | | }, |
| | |
| | | break |
| | | } |
| | | } |
| | | comValue[(tableCode + c.r)] = parseFloat(c.v.v) |
| | | comValue[(tableCode + (c.r+1))] = parseFloat(c.v.v) |
| | | } |
| | | } |
| | | }) |
| | |
| | | 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 => { |
| | |
| | | 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({ |
| | |
| | | laboratory:this.sonLaboratory, |
| | | tell:null |
| | | }).then(res => { |
| | | if (res.code === 200 && res.data) { |
| | | if (res.code === 200) { |
| | | this.$message.success("操作成功") |
| | | this.$emit('goback') |
| | | } |
| | |
| | | laboratory:this.sonLaboratory, |
| | | tell:this.noReason |
| | | }).then(res => { |
| | | if (res.code === 200 && res.data) { |
| | | if (res.code === 200) { |
| | | this.$message.success("操作成功") |
| | | this.$emit('goback') |
| | | } |
| | |
| | | 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> |