From cbef8fa558dad5e994827bf1bd05e3abf8940d80 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期一, 29 四月 2024 13:43:28 +0800
Subject: [PATCH] 任务检验模板切换完成80%'
---
src/components/do/b1-inspect-order-plan/Inspection.vue | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++++----
src/components/view/b3-classes.vue | 0
2 files changed, 105 insertions(+), 8 deletions(-)
diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue
index 4e7f56e..3f82a71 100644
--- a/src/components/do/b1-inspect-order-plan/Inspection.vue
+++ b/src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -189,6 +189,12 @@
</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;`">
@@ -347,7 +353,9 @@
reviewLoading: false,
reviewDia: false,
noReason: '',
- tableWidth: 1000
+ tableWidth: 1000,
+ currentTable:null,
+ tableLists:[]
}
},
created() {
@@ -387,10 +395,22 @@
})
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: {
@@ -407,7 +427,8 @@
insResult: null
}
})
- this.handleTableData()
+ // this.handleTableData()
+ this.getTableLists();
this.sampleVisible = false;
this.currentKey = row.index
},
@@ -466,10 +487,9 @@
}) {
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({
@@ -481,7 +501,16 @@
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 => {
@@ -614,7 +643,7 @@
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 = ''
@@ -700,6 +729,7 @@
} catch (e) {}
})
this.handleExcelMethod()
+ console.log(55555555555,this.currentSample.insProduct,this.tableList,this.param)
},
changeInput(m, code) {
let str = code.split('-')
@@ -826,6 +856,73 @@
}
}
})
+ 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) {
diff --git a/src/components/view/b3-classes.vue b/src/components/view/b3-classes.vue
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/components/view/b3-classes.vue
--
Gitblit v1.9.3