| | |
| | | } |
| | | return true |
| | | }) |
| | | //校验检验项的要求值和要求描述 |
| | | /* //校验检验项的要求值和要求描述 |
| | | const isTrue = this.checkRequiredValueAndRemark(filterProductList) |
| | | if(!isTrue){ |
| | | this.$message.error('检验项的要求值与要求描述不匹配, 请检查') |
| | | return |
| | | } */ |
| | | //校验检验项的要求值和要求描述,仅委托要求 |
| | | if(this.isAskOnlyRead){ |
| | | const isTrue = this.checkRequiredValueAndRemark(filterProductList) |
| | | if(!isTrue){ |
| | | this.$message.error('检验项的要求值与要求描述不匹配, 请检查') |
| | | return |
| | | } |
| | | } |
| | | |
| | | console.log('isHaveBushing===', this.totalArr) |
| | | // inspectionItem |
| | | let spcialItem = null//this.totalArr.find(a => a.state == 1 && a.inspectionItem.includes('松套管')) |
| | | let spcialItem = this.totalArr.find(a => a.state == 1 && a.inspectionItem.includes('松套管')) |
| | | // console.log('isHaveBushing===', isHaveBushing) |
| | | if (productListSelected && select[2] === '光缆' && isHaveBushing === false) { |
| | | this.$message.error('光缆温度循环项目必须进行光纤配置') |
| | |
| | | } |
| | | } |
| | | }, |
| | | checkRequiredValueAndRemark(data){ |
| | | /* checkRequiredValueAndRemark(data){ |
| | | let isTrue = true |
| | | try{ |
| | | data.forEach(ele=>{ |
| | |
| | | isTrue = false |
| | | } |
| | | return isTrue |
| | | }, */ |
| | | /** |
| | | * 校验委托要求的检验项的要求描述和要求值 |
| | | * |
| | | */ |
| | | checkRequiredValueAndRemark(data){ |
| | | let isTrue = true |
| | | try{ |
| | | data.forEach(ele=>{ |
| | | //判断(≤,≥,>,<,=)这几种情况 |
| | | //判断要求值中的数字是否包含在要求描述中 |
| | | if(['≤','≥','>','<','='].includes(ele.ask[0])){ |
| | | const askVal = ele.ask.substring(1,ele.ask.length) |
| | | if(isNaN(askVal) || ele.tell.indexOf(askVal)<0){ |
| | | isTrue = false |
| | | } |
| | | } |
| | | //判断范围(10-25),要求值必须是- |
| | | if(ele.ask.indexOf('-')>0 && ele.ask.length>1){ |
| | | //要求描述的~和要求值的-,等效 |
| | | let tell = ele.tell |
| | | if(ele.tell.indexOf('~')>0){ |
| | | tell = ele.tell.replace('~','-') |
| | | } |
| | | const splits = ele.ask.split('-') |
| | | //满足格式要求,并且两个都是数字 |
| | | if(splits.length==2 && !isNaN(splits[0]) && !isNaN(splits[1])){ |
| | | let min = Math.min(...splits) |
| | | let max = Math.max(...splits) |
| | | //判断±的情况 |
| | | if(ele.tell.indexOf('±')<0&&tell.indexOf(ele.ask)<0){ |
| | | isTrue = false |
| | | }else if(ele.tell.indexOf('±')>0&&ele.tell!=ele.ask){ |
| | | let splitNums = ele.tell.split('±') |
| | | if(splitNums.length<2){ |
| | | isTrue = false |
| | | }else{ |
| | | let minTell = Number(splitNums[0])-Number(splitNums[1]) |
| | | let maxTell = Number(splitNums[0])+Number(splitNums[1]) |
| | | if(minTell!=min || maxTell!=max){ |
| | | isTrue = false |
| | | } |
| | | } |
| | | } |
| | | }else{ |
| | | isTrue = false |
| | | } |
| | | } |
| | | }) |
| | | }catch(error){ |
| | | console.log(error); |
| | | isTrue = false |
| | | } |
| | | return isTrue |
| | | }, |
| | | |
| | | save0(){ |
| | | if(this.editTable.every(m=>m.value)){ |
| | | let sampleList = this.handleData(this.HaveJson(this.sampleList),this.handleAsk,1) |
| | |
| | | <template v-if="PROJECT=='检测中心'||PROJECT=='装备电缆'&&getInspectionValueType(n.i) != 2 "> |
| | | <span v-if="n.v.v===1" :style="`font-family:${n.v.ff} !important;color: green;`">合格</span> |
| | | <span v-else-if="n.v.v===0" :style="`font-family:${n.v.ff} !important;color: red;`">不合格</span> |
| | | <span v-else-if="n.v.v===3" :style="`font-family:${n.v.ff} !important;color: #3A7BFA;`">不判定</span> |
| | | <span v-else :style="`font-family:${n.v.ff} !important;`">待定</span> |
| | | </template> |
| | | </template> |
| | |
| | | <template slot-scope="scope"> |
| | | <span v-if="scope.row.arr[index].insResult===1" style="color: green;">合格</span> |
| | | <span v-else-if="scope.row.arr[index].insResult===0" style="color: red;">不合格</span> |
| | | <span v-else-if="scope.row.arr[index].insResult===3" style="color: #3A7BFA;">不判定</span> |
| | | <span v-else>待定</span> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <template v-else> |
| | | <span v-if="item.insResult===1" style="color: green;">合格</span> |
| | | <span v-else-if="item.insResult===0" style="color: red;">不合格</span> |
| | | <span v-else-if="item.insResult===3" style="color: #3A7BFA;">不判定</span> |
| | | <span v-else>待定</span> |
| | | </template> |
| | | </td> |
| | |
| | | requiredUp: [] |
| | | }, |
| | | upIndex: 0, |
| | | changeType:null, |
| | | getReportModelLoading:false, |
| | | insOrder: {}, |
| | | sampleProduct: [], |
| | |
| | | } |
| | | ], |
| | | getDataIndex:[], |
| | | getDataIndexLoading:false |
| | | getDataIndexLoading:false, |
| | | changeType:null, |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | } |
| | | let list = await this.getCurrentProduct(this.currentSample.id,0) |
| | | this.currentSample.insProduct = this.HaveJson(list) |
| | | // console.log(this.currentSample) |
| | | this.param = {} |
| | | this.changeType = 0; |
| | | this.currentSample.insProduct.forEach(a => { |
| | | this.param[a.id] = { |
| | | insValue: [], |
| | | comValue: [], |
| | | resValue: null, |
| | | equipValue: [], |
| | | equipName: [], |
| | | insResult: null |
| | | if(this.handleCasing(a.inspectionItem)){ |
| | | this.param[a.id] = { |
| | | insValue: [], |
| | | comValue: [], |
| | | resValue: null, |
| | | equipValue: [], |
| | | equipName: [], |
| | | insResult: null |
| | | } |
| | | } |
| | | }) |
| | | this.determineWhetherToCollectData() |
| | |
| | | }, |
| | | currentTable(val1, val0) { |
| | | if (val0 != null && val1 != val0) { |
| | | if(this.tableLists.find(m=>m.templateId==val1)&&(this.tableLists.find(m=>m.templateId==val1).templateName=='成品缆检验原始记录')){ |
| | | if(this.casing.length>0){ |
| | | this.handleChange(this.casing[0].id,3) |
| | | } |
| | | return |
| | | } |
| | | if(this.changeType&&this.changeType>0){ |
| | | return |
| | | } |
| | | this.tableLists.forEach(async (m, i) => { |
| | | if (m.templateId == val1) { |
| | | let list = await this.getCurrentProduct(this.currentSample.id,0) |
| | | this.currentSample.insProduct = this.HaveJson(list) |
| | | // console.log(this.currentSample) |
| | | this.param = {} |
| | | this.currentSample.insProduct.forEach(a => { |
| | | this.param[a.id] = { |
| | | insValue: [], |
| | | comValue: [], |
| | | resValue: null, |
| | | equipValue: [], |
| | | equipName: [], |
| | | insResult: null |
| | | if(this.handleCasing(a.inspectionItem)){ |
| | | this.param[a.id] = { |
| | | insValue: [], |
| | | comValue: [], |
| | | resValue: null, |
| | | equipValue: [], |
| | | equipName: [], |
| | | insResult: null |
| | | } |
| | | } |
| | | }) |
| | | this.getReportModel(this.currentSample.id) |
| | |
| | | } |
| | | } |
| | | }) |
| | | this.handleCasing() |
| | | if(this.tableLists.find(m=>m.templateId==val1)&&(this.tableLists.find(m=>m.templateId==val1).templateName=='成品缆检验原始记录')){ |
| | | if(this.casing.length>0){ |
| | | this.handleChange(this.casing[0].id,3) |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | equipForm:{ |
| | |
| | | maxNum = num |
| | | } |
| | | } |
| | | console.log('data[i][j].equipName',data[i][j].equipName,'data[i][j].equipValue',data[i][j].equipValue,'m.v',m.v,'m.v.ps',m.v.ps,'m.v.ps.value',m.v.ps.value,'str0',str0,'str',str,'m.v.v',m.v.v) |
| | | if(data[i][j].equipName&&data[i][j].equipValue&&m.v&&m.v.ps&&m.v.ps.value=='设备编码'&&str0==str){ |
| | | if(!m.v.v){ |
| | | this.changeEquip(data[i][j].equipValue,m,data[i][j].equipName) |
| | |
| | | this.currentSample = this.HaveJson(row) |
| | | let list = await this.getCurrentProduct(row.id,0) |
| | | this.currentSample.insProduct = this.HaveJson(list) |
| | | this.handleCasing() |
| | | this.param = {} |
| | | this.changeType = 0; |
| | | this.currentSample.insProduct.forEach(a => { |
| | | this.param[a.id] = { |
| | | insValue: [], |
| | | comValue: [], |
| | | resValue: null, |
| | | equipValue: [], |
| | | equipName: [], |
| | | insResult: null |
| | | if(this.handleCasing(a.inspectionItem)){ |
| | | this.param[a.id] = { |
| | | insValue: [], |
| | | comValue: [], |
| | | resValue: null, |
| | | equipValue: [], |
| | | equipName: [], |
| | | insResult: null |
| | | } |
| | | } |
| | | }) |
| | | this.getReportModel(row.id) |
| | |
| | | currentTable:this.currentTable |
| | | })); |
| | | }, |
| | | handleCasing(){ |
| | | if(this.tableLists.find(m=>m.templateId==this.currentTable)&&(this.tableLists.find(m=>m.templateId==this.currentTable).templateName!='成品缆检验原始记录')){ |
| | | this.currentSample.insProduct = this.currentSample.insProduct.filter(m=>!m.inspectionItem.includes('松套管')) |
| | | handleCasing(inspectionItem){ |
| | | if(this.changeType!=3){ |
| | | if(inspectionItem.includes('松套管')){ |
| | | return false |
| | | }else{ |
| | | return true |
| | | } |
| | | }else{ |
| | | return true |
| | | } |
| | | }, |
| | | getReportModel(id){ |
| | |
| | | }) |
| | | }, |
| | | async handleChange(m,type){ |
| | | this.changeType = type |
| | | if(m){ |
| | | let list = await this.getCurrentProduct(m,type) |
| | | if(list.length>0){ |
| | | this.param = {} |
| | | list.forEach(a => { |
| | | this.param[a.id] = { |
| | | insValue: [], |
| | |
| | | // return |
| | | // } |
| | | // } |
| | | let str = code.split('-') |
| | | let pId = str[3] |
| | | for(let i =0;i<this.currentSample.insProduct.length;i++){ |
| | | if(this.currentSample.insProduct[i].id==pId&&(this.currentSample.insProduct[i].ask=='-'||this.currentSample.insProduct[i].ask=='/')){ |
| | | this.tableList[0].arr.forEach(item=>{ |
| | | item.forEach(m=>{ |
| | | if(m.i==pId&&m.v.ps&&m.v.ps.value=='结论'){ |
| | | this.$set(m.v,'v',3) |
| | | } |
| | | }) |
| | | }) |
| | | if(this.param[pId].insResult&&this.param[pId].insResult.v){ |
| | | } |
| | | this.saveInsContext() |
| | | return |
| | | } |
| | | } |
| | | if (n) { |
| | | // if (this.PROJECT === '装备电缆') { |
| | | // let num2 = new this.$Big(n.v.v) |
| | |
| | | this.currentSample = this.HaveJson(this.sampleProduct[index - 1]) |
| | | let list = await this.getCurrentProduct(this.currentSample.id,0) |
| | | this.currentSample.insProduct = this.HaveJson(list) |
| | | this.handleCasing() |
| | | this.param = {} |
| | | this.changeType = 0; |
| | | this.currentSample.insProduct.forEach(a => { |
| | | this.param[a.id] = { |
| | | insValue: [], |
| | | comValue: [], |
| | | resValue: null, |
| | | equipValue: [], |
| | | equipName: [], |
| | | insResult: null |
| | | if(this.handleCasing(a.inspectionItem)){ |
| | | this.param[a.id] = { |
| | | insValue: [], |
| | | comValue: [], |
| | | resValue: null, |
| | | equipValue: [], |
| | | equipName: [], |
| | | insResult: null |
| | | } |
| | | } |
| | | }) |
| | | this.getTableLists() |
| | |
| | | font: '数据查看', |
| | | type: 'text', |
| | | method: 'handleDataLook', |
| | | disabFun: (row, index) => { |
| | | /* disabFun: (row, index) => { |
| | | const user = JSON.parse(localStorage.getItem('user')) |
| | | let currentUserName = '' |
| | | if(user){ |
| | | currentUserName = user.name |
| | | } |
| | | return row.userName!=currentUserName && row.checkName!=currentUserName |
| | | } |
| | | } */ |
| | | },{ |
| | | id: '', |
| | | font: '检验', |
| | |
| | | type: 'text', |
| | | method: 'claimFun', |
| | | disabFun: (row, index) => { |
| | | return row.userName != null||(row.userName&&!row.userName.includes(JSON.parse(localStorage.getItem("user")).name)) |
| | | return row.userName != null || row.checkName!=null |
| | | } |
| | | } |
| | | ], |
| | |
| | | } |
| | | }, |
| | | changeCheckBox(val) { |
| | | console.log(111,val) |
| | | this.componentData.entity.userId = val?0:null |
| | | this.refreshTable() |
| | | }, |
| | |
| | | this.sampleUserForm = { |
| | | entrustCode: row.entrustCode, |
| | | insSampleId: row.id, |
| | | sonLaboratory: row.sonLaboratory, |
| | | sonLaboratory: this.componentData.entity.sonLaboratory, |
| | | } |
| | | this.claimVisible = true |
| | | } |
| | |
| | | const hours = now.getHours(); |
| | | const minutes = now.getMinutes(); |
| | | |
| | | if (hours === 20 && minutes === 0) { |
| | | if (hours === 22 && minutes === 0) { |
| | | this.performTask(); |
| | | // 设置20分钟后提示关闭 |
| | | this.closeTimeout = setTimeout(() => { |
| | |
| | | a[b].v.v = isNaN(val) ? comResult : val |
| | | } |
| | | // console.log('a[b].v.ct', comResult) |
| | | // console.log('a[b].v.v', a[b].v.v) |
| | | // console.log('a[b].v.v', a[b]) |
| | | }catch(error){ |
| | | a[b].v.v = comResult |
| | | console.log('error---', error) |
| | |
| | | b.i &&b.v.v&& param[b.i].insValue.push(b) |
| | | } |
| | | if (b.v.ps != undefined && b.v.ps.value === '计算值') { |
| | | b.i &&b.v.v&& param[b.i].comValue.push(b) |
| | | b.i &&b.v.v&&b.valueList&&b.valueList.length>0&& param[b.i].comValue.push(b) |
| | | } |
| | | if (b.v.ps != undefined && b.v.ps.value === '设备编码') { |
| | | b.i &&b.v&& param[b.i].equipValue.push(b) |
| | |
| | | b.i &&b.v&& param[b.i].equipName.push(b) |
| | | } |
| | | if (b.v.ps != undefined && b.v.ps.value === '最终值') { |
| | | b.i &&b.v&& (param[b.i].resValue = b) |
| | | b.i &&b.v&&b.valueList&&b.valueList.length>0&& (param[b.i].resValue = b) |
| | | } |
| | | if (b.v.ps != undefined && b.v.ps.value === '结论') { |
| | | if(b.i &&(b.v.v||b.v.v===0||b.v.v==='0')){ |
| | |
| | | function SUM(...val){ |
| | | try { |
| | | let num = null; |
| | | if(val!=null&&val!=undefined&&val!='undefined'&&val.length>0){ |
| | | if(val!=null&&val!=undefined&&val!='undefined'&&val!='NaN'&&val.length>0){ |
| | | val.forEach(item=>{ |
| | | num+=item; |
| | | }) |
| | |
| | | function MAX(...val){ |
| | | try { |
| | | let max = null; |
| | | if(val!=null&&val!=undefined&&val!='undefined'&&val.length>0){ |
| | | if(val!=null&&val!=undefined&&val!='undefined'&&val!='NaN'&&val.length>0){ |
| | | val = val.filter(item=>item!=null&&item!=='') |
| | | if(val.length>0){ |
| | | max = Math.max(...val) |
| | |
| | | function MIN(...val){ |
| | | try { |
| | | let min = null; |
| | | if(val!=null&&val!=undefined&&val!='undefined'&&val.length>0){ |
| | | if(val!=null&&val!=undefined&&val!='undefined'&&val!='NaN'&&val.length>0){ |
| | | val = val.filter(item=>item!=null&&item!=='') |
| | | if(val.length>0){ |
| | | min = Math.min(...val) |
| | |
| | | try { |
| | | let num = null; |
| | | let arr = []; |
| | | if(val!=null&&val!=undefined&&val!='undefined'&&val.length>0){ |
| | | if(val!=null&&val!=undefined&&val!='undefined'&&val!='NaN'&&val.length>0){ |
| | | arr = val.filter(item=>item!==null&&item!==''&&item!=undefined) |
| | | arr.forEach(item=>{ |
| | | num+=item; |
| | |
| | | } else if (isPoint) { |
| | | return str.replace('ABS', '').replace(/\(|\)/g, '') |
| | | }else { |
| | | console.log('str', str,eval(str)) |
| | | console.log('str', str) |
| | | return eval(str) |
| | | } |
| | | } catch (error) { |