From b1b8d681adaffa6a489eb78bb60c032b55a4d29a Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期二, 23 七月 2024 10:23:31 +0800
Subject: [PATCH] 修改数采权限
---
src/components/do/b1-inspect-order-plan/Inspection.vue | 152 +++++++++++++++++++++++++++++++++++---------------
1 files changed, 106 insertions(+), 46 deletions(-)
diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue
index 4e6cafe..5653f45 100644
--- a/src/components/do/b1-inspect-order-plan/Inspection.vue
+++ b/src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -209,9 +209,6 @@
<div v-loading="loading" class="inspection">
<el-row class="title">
<el-col :span="12" style="padding-left: 20px;text-align: left;">妫�楠屽崟璇︽儏
- <!-- <span style="color: #3A7BFA;"> 鏍峰搧</span>
- <span v-if="currentFiberOpticTape" style="color: #3A7BFA;"> - 鍏夌氦甯�</span>
- <span v-if="currentFiberOptic" style="color: #3A7BFA;"> - 鍏夌氦</span> -->
</el-col>
<el-col :span="12" style="text-align: right;">
<!-- <el-button size="small" type="primary" @click="fiberOpticVisible=true" v-if="fiberOptic.length>0">鍏夌氦鍒囨崲</el-button>
@@ -299,7 +296,7 @@
</el-form-item>
</el-form>
<el-button type="primary" size="small" v-if="dataAcquisitionEidt>0&&PROJECT=='妫�娴嬩腑蹇�'" @click="getDataAcquisitionDevice" :loading="dataAcquisitionLoading">鏁版嵁閲囬泦</el-button>
- <el-button :type="dataAcquisitionEidtAble?'':'primary'" size="small" v-if="dataAcquisitionEidt>0&&PROJECT=='妫�娴嬩腑蹇�'" @click="dataAcquisitionEidtAble=!dataAcquisitionEidtAble">{{dataAcquisitionEidtAble?'鍏抽棴缂栬緫':'缂栬緫鏁伴噰'}}</el-button>
+ <el-button :type="dataAcquisitionEidtAble?'':'primary'" size="small" v-if="dataAcquisitionEidt>0&&PROJECT=='妫�娴嬩腑蹇�'&&collected" @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!='娓╁害寰幆妫�楠屽師濮嬭褰�'">
@@ -689,6 +686,7 @@
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: {
@@ -846,7 +844,8 @@
dataAcquisitionInfo:{},
dataAcquisitionEidt:0,
dataAcquisitionEidtAble:false,
- dataAcquisitionLoading:false
+ dataAcquisitionLoading:false,
+ collected:false
}
},
computed: {
@@ -1009,13 +1008,13 @@
methods: {
getDataAcquisitionDevice(){
this.dataAcquisitionLoading = true
- this.$axios.get(this.$api.deviceScope.dataCollection+'?entrustCode='+this.insOrder.entrustCode+'&sampleCode='+this.currentSample.sampleCode).then(res=>{
+ this.$axios.get(this.$api.deviceScope.dataCollection+'?entrustCode='+this.insOrder.entrustCode+'&sampleCode='+this.currentSample.sampleCode + '&id=' + this.currentSample.id).then(res=>{
this.dataAcquisitionLoading = false
if(res.code!=200){
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=='妫�楠岄」')){
@@ -1026,19 +1025,22 @@
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)){
+ let arr = n.v.ps.value.split('鍊�')
+ if(arr[1] ==this.dataAcquisitionInfo.frequency){
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)
}
}
}
@@ -1256,7 +1258,6 @@
}
arr2.push(obj)
})
- console.log(arr2)
this.wareTableData = arr2
})
this.getEquipOptions(true,this.currentSample.insProduct[0].id)
@@ -1284,6 +1285,7 @@
let power = JSON.parse(sessionStorage.getItem('power'))
let fileDel = false
let fileAdd = false
+ let collected = false
for (var i = 0; i < power.length; i++) {
if (power[i].menuMethod == 'uploadFile') {
fileAdd = true
@@ -1291,11 +1293,15 @@
if (power[i].menuMethod == 'delfile') {
fileDel = true
}
+ if (power[i].menuMethod == 'isItAllowedToModifyTheCollectedValues') {
+ collected = true
+ }
}
if (!fileDel) {
this.componentData0.do.splice(1, 1)
}
this.fileAdd = fileAdd
+ this.collected = collected
},
async getCurrentProduct(id,type){
this.tableLoading = true;
@@ -1605,22 +1611,44 @@
if (size1 < size2) {
let str = ''
let count4 = 0
+ let isThree = 0
a.template.forEach(c => {
if (b.r === c.r) {
- if (c.v.ps != undefined && c.v.ps.value === '妫�楠岄」') {
- if (count4 === 0) {
- str += c.v.v
- count4 += 1
+ if(c.v.ps != undefined && c.v.ps.value === '妫�楠岄」鍒嗙被'&&count4 === 0){
+ // 涓夌骇鍒嗙被
+ isThree = 1
+ }else if(c.v.ps != undefined && c.v.ps.value === '妫�楠岄」'&&count4 === 0){
+ // 浜岀骇鍒嗙被
+ isThree = 0
+ }
+ if(isThree==0){
+ if (c.v.ps != undefined && c.v.ps.value === '妫�楠岄」') {
+ if (count4 === 0) {
+ str += c.v.v
+ count4 += 1
+ }
+ } else if (c.v.ps != undefined && c.v.ps.value === '妫�楠屽瓙椤�') {
+ if (count4 === 1) {
+ str += c.v.v
+ count4 += 1
+ }
}
- } else if (c.v.ps != undefined && c.v.ps.value === '妫�楠屽瓙椤�') {
- if (count4 === 1) {
- str += c.v.v
- count4 += 1
- }
- }else if (c.v.ps != undefined && c.v.ps.value === '妫�楠屽瓙瀛愰」'&&this.PROJECT=='瑁呭鐢电紗') {
- if (count4 === 2) {
- str += c.v.v
- count4 += 1
+ }else if(isThree==1){
+ if (c.v.ps != undefined && c.v.ps.value === '妫�楠岄」鍒嗙被') {
+ if (count4 === 0) {
+ str += c.v.v
+ count4 += 1
+ }
+ }else if (c.v.ps != undefined && c.v.ps.value === '妫�楠岄」') {
+ if (count4 === 1) {
+ str += c.v.v
+ count4 += 1
+ }
+ } else if (c.v.ps != undefined && c.v.ps.value === '妫�楠屽瓙椤�') {
+ if (count4 === 2) {
+ str += c.v.v
+ count4 += 1
+ }
}
}
}
@@ -1628,8 +1656,16 @@
if (str != '') {
let count2 = 0
for (let i in this.currentSample.insProduct) {
- if (this.currentSample.insProduct[i].templateId === a.templateId && this.currentSample
- .insProduct[i].inspectionItem +(this.currentSample.insProduct[i].inspectionItemSubclass == null ? '' : this.currentSample.insProduct[i].inspectionItemSubclass)+(this.currentSample.insProduct[i].inspectionItemClass==null||this.PROJECT!='瑁呭鐢电紗'?'':this.currentSample.insProduct[i].inspectionItemClass) ===
+ let inspectionItemClass = this.currentSample.insProduct[i].inspectionItemClass==null||this.currentSample.insProduct[i].inspectionItemClass==undefined?'':this.currentSample.insProduct[i].inspectionItemClass
+ let inspectionItem = this.currentSample
+ .insProduct[i].inspectionItem==null||this.currentSample
+ .insProduct[i].inspectionItem==undefined?'':this.currentSample
+ .insProduct[i].inspectionItem
+ let inspectionItemSubclass = this.currentSample
+ .insProduct[i].inspectionItemSubclass==null||this.currentSample
+ .insProduct[i].inspectionItemSubclass==undefined?'':this.currentSample
+ .insProduct[i].inspectionItemSubclass
+ if (this.currentSample.insProduct[i].templateId === a.templateId && inspectionItemClass +inspectionItem+inspectionItemSubclass ===
str) {
ids.push({
r: b.r,
@@ -1796,18 +1832,19 @@
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++
+ }
+ })
+ }
}
}
}
@@ -1831,7 +1868,6 @@
this.handleExcelMethod()
},
changeInput(m, code, n) {
- console.log(m, code)
if (n) {
// if (this.PROJECT === '瑁呭鐢电紗') {
// let num2 = new this.$Big(n.v.v)
@@ -1864,7 +1900,8 @@
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){
@@ -1875,21 +1912,31 @@
}
}
}
+ // let obj = this.param[code.split('-')[3]]
+ // this.tableList[0].arr.forEach(item=>{
+ // item.forEach(m=>{
+ // if(obj&&obj.insResult&&m.c==obj.insResult.c&&m.r==obj.insResult.r){
+ // m.v.v = obj.insResult.v.v
+ // }
+ // if(obj&&obj.resValue&&m.c==obj.resValue.c&&m.r==obj.resValue.r){
+ // m.v.v = obj.resValue.v.v
+ // }
+ // })
+ // })
+ // console.log(this.tableList,this.param)
this.saveInsContext()
})
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){
@@ -2178,7 +2225,9 @@
this.$axios.post(this.$api.insOrderPlan.submitPlan, {
orderId: this.orderId,
laboratory: this.sonLaboratory,
- verifyUser: this.verifyUser
+ verifyUser: this.verifyUser,
+ entrustCode: this.insOrder.entrustCode,
+ sampleCode: this.currentSample.sampleCode
}).then(res => {
if (res.code === 200) {
this.$message.success("鎿嶄綔鎴愬姛")
@@ -2231,6 +2280,7 @@
return
},
saveInsContext() {
+ // console.log(1111,this.param)
if(this.param){
this.$axios.post(this.$api.insOrderPlan.saveInsContext, {
param: JSON.stringify(this.param)
@@ -2255,6 +2305,16 @@
}
}
}
+ this.dataAcquisitionEidt = 0
+ if(this.param){
+ for (let key in this.param) {
+ this.param[key].equipValue.forEach(m=>{
+ if(m.isItADataAcquisitionDevice){
+ this.dataAcquisitionEidt++
+ }
+ })
+ }
+ }
this.saveInsContext()
},
getAuthorizedPerson() {
--
Gitblit v1.9.3