| | |
| | | openAddCheck() { |
| | | this.addCheck = true; |
| | | }, |
| | | // 收集模板级检测条件的缺失项(每个模板都要填全) |
| | | getMissingConditions() { |
| | | const missing = []; |
| | | this.tableLists.forEach((m) => { |
| | | const form = this.otherForm[m.templateId] || {}; |
| | | if (this.insOrder.ifsOrderType !== "02wg") { |
| | | if (!form.temperature) missing.push(`请填写「${m.templateName}」的温度`); |
| | | if (!form.humidity) missing.push(`请填写「${m.templateName}」的湿度`); |
| | | } |
| | | if (!form.detectionTime) missing.push(`请选择「${m.templateName}」的检测时间`); |
| | | if (!form.detectionPlace) missing.push(`请填写「${m.templateName}」的检测地点`); |
| | | if (!form.deviceIds || form.deviceIds.length === 0) { |
| | | missing.push(`请选择「${m.templateName}」的设备`); |
| | | } |
| | | }); |
| | | return missing; |
| | | }, |
| | | // 复核 |
| | | upInsReview(e) { |
| | | if (e == 1) { |
| | | // 通过 |
| | | // 每个模板都要有检测条件,缺一不可 |
| | | const missing = this.getMissingConditions(); |
| | | if (missing.length > 0) { |
| | | this.$message.error(missing[0]); |
| | | return; |
| | | } |
| | | // 每个模板都要有结论;全部合格才算整单合格 |
| | | const insResults = this.tableLists.map( |
| | | (m) => (this.otherForm[m.templateId] || {}).insResult |
| | |
| | | this.$message.error("请指定复核人员"); |
| | | return; |
| | | } |
| | | const missing = []; |
| | | this.tableLists.forEach((m) => { |
| | | const form = this.otherForm[m.templateId] || {}; |
| | | if (this.insOrder.ifsOrderType !== "02wg") { |
| | | if (!form.temperature) missing.push(`请填写「${m.templateName}」的温度`); |
| | | if (!form.humidity) missing.push(`请填写「${m.templateName}」的湿度`); |
| | | } |
| | | if (!form.detectionTime) missing.push(`请选择「${m.templateName}」的检测时间`); |
| | | if (!form.detectionPlace) missing.push(`请填写「${m.templateName}」的检测地点`); |
| | | if (!form.deviceIds || form.deviceIds.length === 0) { |
| | | missing.push(`请选择「${m.templateName}」的设备`); |
| | | } |
| | | }); |
| | | const missing = this.getMissingConditions(); |
| | | if (missing.length > 0) { |
| | | this.$message.error(missing[0]); |
| | | return; |