| | |
| | | </el-form> |
| | | </div> |
| | | <div class="center"> |
| | | <div class="search"> |
| | | <el-radio-group v-model="currentTable" size="small"> |
| | | <el-radio-button :label="item.templateId" v-for="(item,index) in tableLists" |
| | | :key="index" size="small">{{ item.templateName }}</el-radio-button> |
| | | </el-radio-group> |
| | | </div> |
| | | <div class="center-box"> |
| | | <table border="1" class="tables" cellpadding="10" v-for="(item,index) in tableList" :key="index" |
| | | :style="`width: ${tableWidth}px;`"> |
| | |
| | | reviewLoading: false, |
| | | reviewDia: false, |
| | | noReason: '', |
| | | tableWidth: 1000 |
| | | tableWidth: 1000, |
| | | currentTable:null, |
| | | tableLists:[] |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | }) |
| | | if (this.currentSample.index == undefined) this.currentSample['index'] = 1 |
| | | this.loading = false |
| | | this.handleTableData() |
| | | // this.handleTableData() |
| | | this.getTableLists(); |
| | | this.componentData.currentId = val; |
| | | this.currentKey = 1; |
| | | }) |
| | | }, |
| | | currentTable(val1,val0){ |
| | | if(val0!=null&&val1!=val0){ |
| | | this.tableLists.forEach((m,i)=>{ |
| | | if(m.templateId==val1){ |
| | | this.tableList = null; |
| | | this.tableList = [(this.tableLists[i])]; |
| | | this.handleTableData() |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | insResult: null |
| | | } |
| | | }) |
| | | this.handleTableData() |
| | | // this.handleTableData() |
| | | this.getTableLists(); |
| | | this.sampleVisible = false; |
| | | this.currentKey = row.index |
| | | }, |
| | |
| | | }) { |
| | | row.index = rowIndex + 1; |
| | | }, |
| | | handleTableData() { |
| | | this.excelMethodList = [] |
| | | getTableLists(){ |
| | | const mySet1 = new Set(); |
| | | this.tableList = JSON.parse(JSON.stringify(this.currentSample.insProduct)).filter(m => { |
| | | this.tableLists = this.currentSample.insProduct.filter(m => { |
| | | let num0 = mySet1.size; |
| | | if (m.templateId != null) { |
| | | mySet1.add(JSON.stringify({ |
| | |
| | | if (num1 > num0) { |
| | | return m |
| | | } |
| | | }) |
| | | }); |
| | | if(this.tableLists&&this.tableLists.length>0){ |
| | | this.tableList = null; |
| | | this.tableList = [this.tableLists[0]] |
| | | this.currentTable = this.tableLists[0].templateId; |
| | | this.handleTableData() |
| | | } |
| | | }, |
| | | handleTableData() { |
| | | this.excelMethodList = [] |
| | | this.tableList.forEach(a => { |
| | | let mcList = [] |
| | | a.template.forEach(b => { |
| | |
| | | if (b.v.ps != undefined && b.v.ps.value === '检验值') { |
| | | b.v.v = '' |
| | | b.u = '' |
| | | this.param[b.i].insValue.push(b) |
| | | b.i&&this.param[b.i].insValue.push(b) |
| | | } |
| | | if (b.v.ps != undefined && b.v.ps.value === '计算值') { |
| | | b.v.v = '' |
| | |
| | | } catch (e) {} |
| | | }) |
| | | this.handleExcelMethod() |
| | | console.log(55555555555,this.currentSample.insProduct,this.tableList,this.param) |
| | | }, |
| | | changeInput(m, code) { |
| | | let str = code.split('-') |
| | |
| | | } |
| | | } |
| | | }) |
| | | this.getCurrentInsProduct(pId) |
| | | }, |
| | | getCurrentInsProduct(pId){ |
| | | if(!this.tableList[0].insProductResult){ |
| | | this.tableList[0].insProductResult = {} |
| | | } |
| | | for (let m in this.param[pId]){ |
| | | let value = this.param[pId][m] |
| | | switch (m){ |
| | | case 'comValue': |
| | | if(value&&value.length>0){ |
| | | this.tableList[0].insProductResult[m]=[]; |
| | | value.forEach((a,i)=>{ |
| | | let obj = { |
| | | v:a.v.v, |
| | | } |
| | | this.tableList[0].insProductResult[m].push(obj); |
| | | }) |
| | | } |
| | | this.tableList[0].insProductResult[m] = JSON.stringify(this.tableList[0].insProductResult[m]) |
| | | break; |
| | | case 'insValue': |
| | | if(value&&value.length>0){ |
| | | this.tableList[0].insProductResult[m]=[]; |
| | | value.forEach((a,i)=>{ |
| | | let obj = { |
| | | v:a.v.v, |
| | | u:a.u, |
| | | } |
| | | this.tableList[0].insProductResult[m].push(obj); |
| | | }) |
| | | } |
| | | this.tableList[0].insProductResult[m] = JSON.stringify(this.tableList[0].insProductResult[m]) |
| | | break; |
| | | case 'equipValue': |
| | | if(value&&value.length>0){ |
| | | this.tableList[0].insProductResult[m]=[]; |
| | | value.forEach((a,i)=>{ |
| | | let obj = { |
| | | v:a.v.v, |
| | | } |
| | | this.tableList[0].insProductResult[m].push(obj); |
| | | }) |
| | | } |
| | | this.tableList[0].insProductResult[m] = JSON.stringify(this.tableList[0].insProductResult[m]) |
| | | break; |
| | | case 'equipName': |
| | | if(value&&value.length>0){ |
| | | this.tableList[0].insProductResult[m]=[]; |
| | | value.forEach((a,i)=>{ |
| | | let obj = { |
| | | v:a.v.v, |
| | | } |
| | | this.tableList[0].insProductResult[m].push(obj); |
| | | }) |
| | | } |
| | | this.tableList[0].insProductResult[m] = JSON.stringify(this.tableList[0].insProductResult[m]) |
| | | break; |
| | | case 'resValue': |
| | | console.log(this.param) |
| | | this.tableList[0].lastValue = value.v.v |
| | | break; |
| | | case 'insResult': |
| | | this.tableList[0].insResult = value.v.v |
| | | break; |
| | | } |
| | | } |
| | | }, |
| | | handleExcelMethod() { |
| | | if (this.excelMethodList.length > 0) { |