From dc65ec24e7d9b4b922ed5e46f516e1f7ca964e92 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期五, 02 八月 2024 17:22:48 +0800
Subject: [PATCH] 数采数据选择不能取消操作
---
src/components/do/b1-inspect-order-plan/Inspection.vue | 243 +++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 219 insertions(+), 24 deletions(-)
diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue
index fb42e85..fb039ae 100644
--- a/src/components/do/b1-inspect-order-plan/Inspection.vue
+++ b/src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -230,9 +230,9 @@
<template>
<div v-loading="loading" class="inspection">
<el-row class="title">
- <el-col :span="12" style="padding-left: 20px;text-align: left;" v-once>妫�楠屽崟璇︽儏
+ <el-col :span="12" style="padding-left: 20px;text-align: left;" >妫�楠屽崟璇︽儏
</el-col>
- <el-col :span="12" style="text-align: right;" v-once>
+ <el-col :span="12" style="text-align: right;">
<!-- <el-button size="small" type="primary" @click="fiberOpticVisible=true" v-if="fiberOptic.length>0">鍏夌氦鍒囨崲</el-button>
<el-button size="small" type="primary" @click="fiberOpticTapeVisible=true" v-if="fiberOpticTape.length>0">鍏夌氦甯﹀垏鎹�</el-button>
<el-button size="small" type="primary" @click="bushingVisible=true" v-if="bushing.length>0">濂楃鍒囨崲</el-button> -->
@@ -318,11 +318,11 @@
</el-form-item>
</el-form>
<el-button type="primary" size="small" v-if="(dataAcquisitionEidt>0||tableLists.find(m=>m.templateId==currentTable)&&tableLists.find(m=>m.templateId==currentTable).templateName=='娓╁害寰幆妫�楠屽師濮嬭褰�'&&temDataAcquisition)&&PROJECT=='妫�娴嬩腑蹇�'&&state==1" @click="getDataAcquisitionDevice" :loading="dataAcquisitionLoading">鏁版嵁閲囬泦</el-button>
- <el-button :type="dataAcquisitionEidtAble?'':'primary'" size="small" v-if="(dataAcquisitionEidt>0)&&PROJECT=='妫�娴嬩腑蹇�'&&collected&&state==1" @click="dataAcquisitionEidtAble=!dataAcquisitionEidtAble">{{dataAcquisitionEidtAble?'鍏抽棴缂栬緫':'缂栬緫鏁伴噰'}}</el-button>
+ <el-button :type="dataAcquisitionEidtAble?'':'primary'" size="small" v-if="(dataAcquisitionEidt>0||(tableLists.find(m=>m.templateId==currentTable)&&tableLists.find(m=>m.templateId==currentTable).templateName=='娓╁害寰幆妫�楠屽師濮嬭褰�'))&&PROJECT=='妫�娴嬩腑蹇�'&&collected&&state==1" @click="dataAcquisitionEidtAble=!dataAcquisitionEidtAble">{{dataAcquisitionEidtAble?'鍏抽棴缂栬緫':'缂栬緫鏁伴噰'}}</el-button>
</div>
</div>
<div class="center-box" id="nav" v-loading="tableLoading" v-if="!tableLists.find(m=>m.templateId==currentTable)||(tableLists.find(m=>m.templateId==currentTable).templateName!='娓╁害寰幆妫�楠屽師濮嬭褰�'&&!tableLists.find(m=>m.templateId==currentTable).templateName.includes('鐑惊鐜�')&&!tableLists.find(m=>m.templateId==currentTable).templateName.includes('娓╁崌璇曢獙'))">
- <table border="1" class="tables" cellpadding="10" v-for="(item,index) in tableList" :key="index">
+ <table border="1" class="tables" cellpadding="10" v-for="(item,index) in tableList" :key="index+currentTable+currentSample.id">
<tbody>
<tr v-for="(m,i) in item.arr" :key="i">
<td :id='item.templateId+"-"+n.i+"-"+n.r+"-"+n.c' v-for="(n,j) in m" :key="j"
@@ -376,6 +376,7 @@
<template v-else-if="n.v.ps!=undefined && n.v.ps.value==='瑕佹眰鍊�' && state==1">
<span :style="`font-family:${n.v.ff} !important;`">{{getTell(n.i)}}</span>
</template>
+ <template v-else-if="n.v.ps!=undefined && n.v.ps.value==='璁$畻鍊�' && state==1"><span :style="`font-family:${n.v.ff} !important;`">{{ toFixed(n.v.v,n.v.ct) }}</span></template>
<template v-else-if="n.v.ps!=undefined && n.v.ps.value==='鏈�缁堝��' && state==1">
<!-- <el-input class="table_input" type="textarea"
:disabled="getInspectionItemType(n.i) == 1 || (n.u != userId && n.u != undefined && n.u != '')"
@@ -424,7 +425,7 @@
v-if="currentFiberOptic" class="el-icon-caret-right table_caret" @click="caretOptic(1)"></i>
</div>
</template>
- <span v-else :style="`font-family:${n.v.ff} !important;`" v-html="getValue(n.v)" v-once></span>
+ <span v-else :style="`font-family:${n.v.ff} !important;`" v-html="getValue(n.v)" ></span>
</div>
</td>
</tr>
@@ -536,7 +537,7 @@
{{ '澶栫'+(index+1) }}
</template>
<template slot-scope="scope">
- <el-input size="small" v-model="scope.row.arr[index].value0" placeholder="" :disabled="state>1" @change="m=>changeItem(scope.row.arr[index])"></el-input>
+ <el-input size="small" v-model="scope.row.arr[index].value0" placeholder="" :disabled="state>1||!dataAcquisitionEidtAble" @change="m=>changeItem(scope.row.arr[index])"></el-input>
</template>
</el-table-column>
<el-table-column
@@ -548,7 +549,7 @@
{{ '鍐呯'+(index+1) }}
</template>
<template slot-scope="scope">
- <el-input size="small" :disabled="state>1" v-model="scope.row.arr[index].value1" placeholder="" @change="m=>changeItem(scope.row.arr[index])"></el-input>
+ <el-input size="small" :disabled="state>1||!dataAcquisitionEidtAble" v-model="scope.row.arr[index].value1" placeholder="" @change="m=>changeItem(scope.row.arr[index])"></el-input>
</template>
</el-table-column>
<el-table-column
@@ -783,6 +784,45 @@
<el-button type="primary" @click="submit()">纭� 瀹�</el-button>
</span>
</el-dialog>
+ <el-dialog title="鏁版嵁閲囬泦" :visible.sync="dataGetDia" min-width="400px" :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false">
+ <div>
+ <table border="1" cellpadding="10" class="thermal-table">
+ <tr>
+ <td style="width: 120px;">妫�楠岄」</td>
+ <td style="width: 120px;">妫�楠屽瓙椤�</td>
+ <td>鏁伴噰鏁版嵁</td>
+ </tr>
+ <template v-for="(item,index) in getData">
+ <tr>
+ <td :rowspan="item.child.length">{{item.faName}}</td>
+ <td>{{ item.child[0].name }}</td>
+ <td>
+ <el-checkbox-group
+ v-model="item.child[0].value"
+ :min="0"
+ :max="item.child[0].maxNum">
+ <el-checkbox v-for="(n,j) in item.child[0].arr" :label="n" :key="j+'ppppppppp'">{{n}}</el-checkbox>
+ </el-checkbox-group>
+ </td>
+ </tr>
+ <tr v-for="(m,i) in item.child" :key="i+'bbbbbbbbbbbbbb'" v-show="i>0">
+ <td>{{ m.name }}</td>
+ <td>
+ <el-checkbox-group
+ v-model="m.value"
+ :min="0"
+ :max="m.maxNum">
+ <el-checkbox v-for="(n,j) in m.arr" :label="n" :key="j+'bbbbbbbbbbbbbb'">{{n}}</el-checkbox>
+ </el-checkbox-group>
+ </td>
+ </tr>
+ </template>
+ </table>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button type="primary" @click="submitDataGet()">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
</div>
</template>
@@ -797,6 +837,7 @@
},
data() {
return {
+ dataGetDia:false,
wareTableDataLoading:false,
fileAdd:false,
sampleVisible: false,
@@ -960,6 +1001,36 @@
},
thermalCyclingLoading:false,
temDataAcquisition:false,
+ getData:[
+ {
+ faName:'娉㈤暱闄勫姞琛板噺',
+ child:[
+ {
+ name:'1285nm~1330nm',
+ arr:[12,13],
+ maxNum:1,
+ value:[]
+ },
+ {
+ name:'1525nm~1575nm',
+ arr:[12,13],
+ maxNum:1,
+ value:[]
+ },
+ ]
+ },
+ {
+ faName:'鎴嚦娉㈤暱',
+ child:[
+ {
+ name:'鎴嚦娉㈤暱',
+ arr:[12,13,14,15],
+ maxNum:3,
+ value:[]
+ }
+ ]
+ }
+ ]
}
},
computed: {
@@ -1050,11 +1121,48 @@
},
currentTable(val1, val0) {
if (val0 != null && val1 != val0) {
- this.tableLists.forEach((m, i) => {
+ this.tableLists.forEach(async (m, i) => {
if (m.templateId == val1) {
- this.tableList = null;
- this.tableList = [(this.tableLists[i])];
- this.handleTableData()
+ let list = await this.getCurrentProduct(this.currentSample.id,0)
+ this.currentSample.insProduct = this.HaveJson(list)
+ // console.log(this.currentSample)
+ this.currentSample.insProduct.forEach(a => {
+ this.param[a.id] = {
+ insValue: [],
+ comValue: [],
+ resValue: null,
+ equipValue: [],
+ equipName: [],
+ insResult: null
+ }
+ })
+ this.getReportModel(this.currentSample.id)
+ const mySet1 = new Set();
+ this.tableLists = this.currentSample.insProduct.filter(m => {
+ let num0 = mySet1.size;
+ if (m.templateId != null&&m.template != null) {
+ try {
+ mySet1.add(JSON.stringify({
+ template: m.template,
+ templateId: m.templateId
+ }))
+ } catch (error) {
+ console.log(222,error);
+ }
+ }
+ let num1 = mySet1.size;
+ if (num1 > num0) {
+ return m
+ }
+ });
+ if (this.tableLists && this.tableLists.length > 0) {
+ this.tableList = null;
+ this.tableList = this.tableLists.filter(m => m.templateId == val1)
+ this.handleTableData()
+ }
+ // this.$delete(this.tableList,0)
+ // this.$set(this.tableList, 0, m)
+ // this.handleTableData()
}
})
}
@@ -1180,6 +1288,20 @@
})
}
},
+ beforeDataGetDia(done){
+ this.$confirm('鏄惁鍙栨秷鏁版嵁閲囬泦?', "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning"
+ }).then(() => {
+ if(done){
+ done()
+ }else{
+ this.dataGetDia = false
+ }
+ }).catch(() => {})
+ },
+ submitDataGet(){},
// 澶氱嚎绋�
startWorker() {
if (this.worker) {
@@ -1205,7 +1327,11 @@
},
// 娓╁害寰幆---寮�濮�
changeItem(row){
- if(row.value0&&row.value1){
+ if(row.value0&&!row.value1){
+ this.$set(row,'comValue',Number(row.value0).toFixed(3))
+ }else if(!row.value0&&row.value1){
+ this.$set(row,'comValue',Number(row.value1).toFixed(3))
+ }else if(row.value0&&row.value1){
this.$set(row,'comValue',((Number(row.value0)+Number(row.value1))/2).toFixed(3))
}else{
return
@@ -1806,6 +1932,12 @@
this.getTableLists();
this.currentKey = row.index
this.currentTab = null;
+ this.worker.postMessage(JSON.stringify({
+ type: 'saveData',
+ tableList:this.tableList,
+ param:this.param,
+ currentTable:this.currentTable
+ }));
},
getReportModel(id){
if(this.PROJECT!='妫�娴嬩腑蹇�'){
@@ -1832,6 +1964,12 @@
})
this.getTableLists0(list)
this.getReportModel(this.currentSample.id)
+ this.worker.postMessage(JSON.stringify({
+ type: 'saveData',
+ tableList:this.tableList,
+ param:this.param,
+ currentTable:this.currentTable
+ }));
}else{
this.tableLists = []
this.tableList = []
@@ -1986,7 +2124,21 @@
label:m
})
})
- this.wareFormChange()
+ this.wareTableDataLoading = true
+ this.$axios.post(this.$api.deviceScope.temDataAcquisition2,{
+ entrustCode:this.insOrder.entrustCode,
+ sampleCode:this.currentSample.sampleCode,
+ model:this.currentSample.model,
+ }, {
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ noQs:true
+ }).then(res=>{
+ // console.log(res.data)
+ this.wareFormChange()
+ })
+ // this.wareFormChange()
}
// 娓╁害寰幆妫�楠屽師濮嬭褰�---缁撴潫
// 鐑惊鐜楠屽師濮嬭褰�---寮�濮�
@@ -2252,14 +2404,14 @@
try {
let comValue = JSON.parse(a.insProductResult.comValue)
for (var i = 0; i < comValue.length; i++) {
- this.param[a.id].comValue[i].v.v = comValue[i].v
+ this.param[a.id].comValue[i].v.v = this.toFixed(comValue[i].v,this.param[a.id].comValue[i].v.ct)
}
} catch (e) {}
try {
let insValue = JSON.parse(a.insProductResult.insValue)
for (let i = 0; i < insValue.length; i++) {
if(this.param[a.id].insValue.find(m=>m.c==insValue[i].c&&m.r==insValue[i].r)){
- this.param[a.id].insValue.find(m=>m.c==insValue[i].c&&m.r==insValue[i].r).v.v = insValue[i].v
+ this.param[a.id].insValue.find(m=>m.c==insValue[i].c&&m.r==insValue[i].r).v.v = this.toFixed(insValue[i].v,this.param[a.id].insValue.find(m=>m.c==insValue[i].c&&m.r==insValue[i].r).v.ct)
this.param[a.id].insValue.find(m=>m.c==insValue[i].c&&m.r==insValue[i].r).u = insValue[i].u
// this.param[a.id].insValue[i].v.v = insValue[i].v
// this.param[a.id].insValue[i].u = insValue[i].u
@@ -2328,7 +2480,7 @@
}
} catch (e) {}
try {
- this.param[a.id].resValue.v.v = a.lastValue
+ this.param[a.id].resValue.v.v = this.toFixed(a.lastValue,this.param[a.id].resValue.v.ct)
this.param[a.id].insResult.v.v = a.insResult
} catch (e) {}
})
@@ -2359,7 +2511,8 @@
comparisonList:this.comparisonList,
currentSample:this.currentSample,
PROJECT:this.PROJECT,
- param:this.param
+ param:this.param,
+ currentTable:this.currentTable
}));
} catch (error) {
console.log(444,error);
@@ -2533,6 +2686,15 @@
},
getValue(v){
let str = v.v?v.v:(v.v===0?v.v:(v.ct&&v.ct.s?v.ct.s.length>0&&v.ct.s[0].v.replace(new RegExp('\n', 'g'), '<br/>').replace(new RegExp('@', 'g'), '<br/>'):''))
+ if(v.ct&&v.ct.fa&&v.ct.fa.includes('.')&&str){
+ let num = 0
+ let str0 = v.ct.fa.split('.')[1]
+ num = str0.length
+ str = Number(str).toFixed(num)
+ }
+ if(v.v&&typeof v.v == 'string'&&v.v.includes('@')){
+ str = v.v.replace(new RegExp('@', 'g'), '<br/>')
+ }
return str
},
getInspectionValueType(id) {
@@ -2651,6 +2813,8 @@
getUserInfo() {
this.$axios.get(this.$api.user.getUserInfo).then(res => {
this.userId = res.data.id
+ this.componentData.entity.userId = res.data.id
+ console.log(1111,this.userId)
})
},
// 澶嶆牳
@@ -2705,6 +2869,14 @@
this.$message.error("璇锋寚瀹氬鏍镐汉鍛�")
return
}
+ if(!this.otherForm.humidity){
+ this.$message.error("璇疯緭鍏ユ箍搴�")
+ return
+ }
+ if(!this.otherForm.temperature){
+ this.$message.error("璇疯緭鍏ユ俯搴�")
+ return
+ }
this.addVerifyDia = false
this.submitLoading = true;
this.$axios.post(this.$api.insOrderPlan.checkSubmitPlan, {
@@ -2717,8 +2889,7 @@
orderId: this.orderId,
laboratory: this.sonLaboratory,
verifyUser: this.verifyUser,
- entrustCode: this.insOrder.entrustCode,
- sampleCode: this.currentSample.sampleCode
+ entrustCode: this.insOrder.entrustCode
}).then(res => {
if (res.code === 200) {
this.$message.success("鎿嶄綔鎴愬姛")
@@ -2771,7 +2942,7 @@
return
},
saveInsContext() {
- // console.log(1111,this.param)
+ console.log(1111,this.param)
try {
if(this.param){
this.$axios.post(this.$api.insOrderPlan.saveInsContext, {
@@ -2787,7 +2958,8 @@
this.worker.postMessage(JSON.stringify({
type: 'saveData',
tableList:this.tableList,
- param:this.param
+ param:this.param,
+ currentTable:this.currentTable
}));
}
}catch (error) {
@@ -2795,11 +2967,25 @@
}
},
changeEquip(val, n) {
+ this.tableList[0].arr.forEach((item,index)=>{
+ item.forEach((m,i)=>{
+ if(this.param[m.i]){
+ this.param[m.i].state = 1
+ }
+ })
+ })
+ for (let i in this.param) {
+ if(this.param[i].state!=1){
+ delete this.param[i]
+ }
+ }
for (let i in this.equipOptions) {
if (this.equipOptions[i].value === val) {
for (let i1 in this.param[n.i].equipName) {
if (this.param[n.i].equipName[i1].i === n.i && this.param[n.i].equipName[i1].r === n.r) {
+ this.$delete(this.param[n.i].equipValue[i1].v,'v')
this.$set(this.param[n.i].equipValue[i1].v,'v',val)
+ this.$delete(this.param[n.i].equipName[i1].v,'v')
this.$set(this.param[n.i].equipName[i1].v,'v',this.equipOptions[i].label)
this.param[n.i].equipValue[i1].isItADataAcquisitionDevice = this.equipOptions[i].isItADataAcquisitionDevice
}
@@ -2822,11 +3008,14 @@
getAuthorizedPerson() {
this.$axios.get(this.$api.user.getUserMenu).then(res => {
let data = []
+ let userName = JSON.parse(localStorage.getItem("user")).name;
res.data.forEach(a => {
- data.push({
+ if(a.name !== userName) {
+ data.push({
label: a.name,
value: a.id
})
+ }
})
this.personList = data
})
@@ -2883,6 +3072,12 @@
}
})
this.getTableLists()
+ this.worker.postMessage(JSON.stringify({
+ type: 'saveData',
+ tableList:this.tableList,
+ param:this.param,
+ currentTable:this.currentTable
+ }));
},
caretBushing(num){
let index = this.currentKey0 + num
@@ -3014,12 +3209,12 @@
* @returns 鏍煎紡鍖栧悗鐨勫瓧绗︿覆鎴栧師濮嬫暟鍊硷紙鑻ラ厤缃笉绗﹀悎瑕佹眰锛�
*/
toFixed(v,ct){
- if(v&&ct&&ct.fa&&ct.fa.includes('##')){
+ if(v&&ct&&ct.fa){
if(ct.fa.includes('.')){
let num = ct.fa.slice(4).length
return Number(v).toFixed(num)
}else{
- return Number(v).toFixed(0)
+ return v
}
}else{
return v
--
Gitblit v1.9.3