| | |
| | | import ValueTable from '../../tool/value-table.vue' |
| | | import file from '../../../util/file' |
| | | import excelFunction from '../../../util/excelFountion' |
| | | import { number } from 'echarts' |
| | | export default { |
| | | props: ['sonLaboratory', 'orderId', 'state'], |
| | | components: { |
| | |
| | | }, |
| | | methods: { |
| | | getDataAcquisitionDevice(){ |
| | | |
| | | this.dataAcquisitionLoading = true |
| | | this.$axios.get(this.$api.deviceScope.dataCollection+'?entrustCode='+this.insOrder.entrustCode+'&sampleCode='+this.currentSample.sampleCode + '&id=' + this.currentSample.id).then(res=>{ |
| | | this.dataAcquisitionLoading = false |
| | |
| | | return |
| | | } |
| | | this.dataAcquisitionInfo = res.data |
| | | let list = this.currentSample.insProduct[0].arr |
| | | let list = this.tableList[0].arr |
| | | list.forEach((item,index)=>{ |
| | | item.forEach(m=>{ |
| | | if(m.v.ps&&(m.v.ps.value=='检验子项'||m.v.ps.value=='检验项')){ |
| | |
| | | num++ |
| | | } |
| | | }) |
| | | list[index].forEach(n=>{ |
| | | list[index].forEach((n,i)=>{ |
| | | if(n.v.ps&&n.v.ps.value&&typeof n.v.ps.value == 'string'&&n.v.ps.value.includes('检验值')){ |
| | | if(n.v.ps.value.includes(this.dataAcquisitionInfo.frequency)){ |
| | | if(n.v.ps.value.includes(this.dataAcquisitionInfo.frequency)&&!n.v.ps.value.includes(this.dataAcquisitionInfo.frequency+'0')){ |
| | | setTimeout(()=>{ |
| | | n.v.v = this.dataAcquisitionInfo[m.v.m] |
| | | this.$delete(n.v,'v') |
| | | this.$set(n.v,'v',this.dataAcquisitionInfo[m.v.m]) |
| | | this.changeInput('',`${this.currentSample.insProduct[0].templateId}-${n.r}-${n.c}-${n.i}`,n) |
| | | },1000) |
| | | }else if(this.dataAcquisitionInfo.frequency>num){ |
| | | }else if(Number(this.dataAcquisitionInfo.frequency)>num){ |
| | | if(n.v.ps.value.includes(num)){ |
| | | setTimeout(()=>{ |
| | | n.v.v = this.dataAcquisitionInfo[m.v.m] |
| | | this.$delete(n.v,'v') |
| | | this.$set(n.v,'v',this.dataAcquisitionInfo[m.v.m]) |
| | | this.changeInput('',`${this.currentSample.insProduct[0].templateId}-${n.r}-${n.c}-${n.i}`,n) |
| | | },200) |
| | | },1000) |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | arr2.push(obj) |
| | | }) |
| | | console.log(arr2) |
| | | this.wareTableData = arr2 |
| | | }) |
| | | this.getEquipOptions(true,this.currentSample.insProduct[0].id) |
| | |
| | | if(equipValue[i].v){ |
| | | let isItADataAcquisitionDevice = await this.determineWhetherToCollectData(equipValue[i].v) |
| | | this.param[a.id].equipValue[i].isItADataAcquisitionDevice = isItADataAcquisitionDevice |
| | | this.dataAcquisitionEidt = 0 |
| | | if(this.param){ |
| | | for (let key in this.param) { |
| | | this.param[key].equipValue.forEach(m=>{ |
| | | if(m.isItADataAcquisitionDevice){ |
| | | this.dataAcquisitionEidt++ |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | }else{ |
| | | this.param[a.id].equipValue[i].isItADataAcquisitionDevice = false |
| | | } |
| | | this.dataAcquisitionEidt = 0 |
| | | if(this.param){ |
| | | for (let key in this.param) { |
| | | this.param[key].equipValue.forEach(m=>{ |
| | | if(m.isItADataAcquisitionDevice){ |
| | | this.dataAcquisitionEidt++ |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | this.handleExcelMethod() |
| | | }, |
| | | changeInput(m, code, n) { |
| | | console.log(m, code) |
| | | if (n) { |
| | | // if (this.PROJECT === '装备电缆') { |
| | | // let num2 = new this.$Big(n.v.v) |
| | |
| | | switch (this.result.method){ |
| | | case 'saveInsContext': |
| | | this.$nextTick(()=>{ |
| | | this.tableList = this.result.value.tableList |
| | | this.$delete(this.tableList[0],'arr') |
| | | this.$set(this.tableList[0],'arr',this.result.value.tableList[0].arr) |
| | | this.param = this.result.value.param |
| | | for (var i in this.param){ |
| | | if(this.param[i].insResult&&this.param[i].insResult.v&&this.param[i].insResult.v.v){ |
| | |
| | | break; |
| | | case 'tableList': |
| | | this.$nextTick(()=>{ |
| | | this.tableList = this.result.value |
| | | this.$delete(this.tableList[0],'arr') |
| | | this.$set(this.tableList[0],'arr',this.result.value[0].arr) |
| | | }) |
| | | break; |
| | | case 'getCurrentInsProduct': |
| | | this.getCurrentInsProduct(this.result.value) |
| | | break; |
| | | } |
| | | // if(this.result.method=='saveInsContext'){ |
| | | // this.stopWorker(); // 处理完成后停止 Worker |
| | | // } |
| | | }; |
| | | }, |
| | | async determineWhetherToCollectData(managementNumber){ |
| | |
| | | return |
| | | }, |
| | | saveInsContext() { |
| | | console.log(1111,this.param) |
| | | // console.log(1111,this.param) |
| | | if(this.param){ |
| | | this.$axios.post(this.$api.insOrderPlan.saveInsContext, { |
| | | param: JSON.stringify(this.param) |