| | |
| | | state == 1 |
| | | "><span :style="`font-family:${n.v.ff} !important;`">{{ |
| | | toFixed(n.v.v, n.v.ct) |
| | | }}</span></template> |
| | | }}</span></template> |
| | | <template v-else-if=" |
| | | n.v.ps != undefined && |
| | | n.v.ps.value === '最终值' && |
| | |
| | | sampleId: id, |
| | | sonLaboratory: sonLaboratory |
| | | }" v-if="state == 1 && fileAdd" :on-success="handleSuccessUp" :show-file-list="false" |
| | | accept=".jpg,.jpeg,.png,.gif,.docx,.xls,.xlsx,.pdf,.zip,.rar,.csv" :headers="headers" |
| | | accept=".jpg,.jpeg,.png,.gif,.docx,.doc,.xls,.xlsx,.pdf,.zip,.rar,.csv" :headers="headers" |
| | | :before-upload="beforeUpload" style="width: 80px !important;" :on-error="onError" ref="upload"> |
| | | <el-button size="small" type="primary" v-if="state == 1">附件上传</el-button></el-upload> |
| | | <!-- <span v-if="sonLaboratory === '远场'||sonLaboratory === '近场'" style="color: red;font-size: 12px;">辐射试验尽量上传设备导出的csv文件,不然触发不了报告生成</span> --> |
| | |
| | | } |
| | | } |
| | | // 通信特殊处理,检验值填入之后直接保存数据,判断结果默认为3 |
| | | for (var i in this.param) { |
| | | this.param[i].insResult = { v: { v: 3 } }; |
| | | } |
| | | // for (var i in this.param) { |
| | | // this.param[i].insResult = { v: { v: 3 } }; |
| | | // } |
| | | this.saveInsContext(n.i); |
| | | return; |
| | | // 以下是正常的判断流程,后面有需要则进入此流程 |
| | |
| | | if (name == '检验原始记录' || name == '辐射试验检测原始记录') { |
| | | let num = 0 |
| | | for (let i in this.param) { |
| | | if (this.param[i].insResult.v.v != 0 && this.param[i].insResult.v.v != 1) { |
| | | num++; |
| | | if(!this.param[i].insResult||!this.param[i].insResult.v||(!this.param[i].insResult.v.v&&this.param[i].insResult.v.v!==0)){ |
| | | this.$message.error("请输入检验过程值"); |
| | | return; |
| | | }else{ |
| | | if (this.param[i].insResult.v.v != 0 && this.param[i].insResult.v.v != 1) { |
| | | num++; |
| | | } |
| | | } |
| | | } |
| | | console.log(3333, num) |
| | |
| | | this.saveInsContext(n.i); |
| | | } else if ('实验结果') { |
| | | // 实验结果 |
| | | this.$set(this.param[n.i].insResult, "v", {}); |
| | | if (val == '无异常') { |
| | | this.$set(this.param[n.i], "insResult", {}); |
| | | this.$set(this.param[n.i].insResult, "v", {}); |
| | | this.$set(this.param[n.i].insResult.v, "v", 1); |
| | | } else if (val == '不合格') { |
| | | this.$set(this.param[n.i], "insResult", {}); |
| | | this.$set(this.param[n.i].insResult, "v", {}); |
| | | this.$set(this.param[n.i].insResult.v, "v", 0); |
| | | } |
| | | this.saveInsContext(n.i); |
| | |
| | | let list = await this.getCurrentProduct(this.currentSample.id, 0); |
| | | this.currentSample.insProduct = this.HaveJson(list); |
| | | this.currentNum++; |
| | | } else if (this.sonLaboratory === "振动") { |
| | | this.getDocAnalysis(response.data) |
| | | } |
| | | } else { |
| | | this.$message.error(response.message); |
| | | } |
| | | }, |
| | | getDocAnalysis (data) { |
| | | const psToDataKeyMap = { |
| | | '检验值1': '1', |
| | | '检验值9': '9', |
| | | '检验值10': '10', |
| | | '检验值11': '11', |
| | | '检验值12': '12', |
| | | '检验值13': '13', |
| | | }; |
| | | |
| | | for (let i in this.param) { |
| | | this.param[i].insValue.forEach(a => { |
| | | // 检查当前的ps.value是否在映射表中存在 |
| | | if (a.v.ps.value && psToDataKeyMap.hasOwnProperty(a.v.ps.value)) { |
| | | // 使用映射表中的值从data对象获取对应的值 |
| | | a.v.v = data[psToDataKeyMap[a.v.ps.value]]; |
| | | // 调用保存上下文的方法 |
| | | this.saveInsContext(a.i); |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | beforeUpload(file) { |
| | | if ( |
| | | this.sonLaboratory === "电路试验" && |