| | |
| | | placeholder="请输入检测地点" size="small" style="width: 200px" |
| | | @change="m => subOtherForm(m, 'detectionPlace')"></el-input> |
| | | </el-form-item> |
| | | <el-form-item v-if="isDirectTemplateOrder()" label="设备:"> |
| | | <el-form-item label="设备:"> |
| | | <el-select v-model="currentOtherForm.deviceIds" :disabled="state != 1" multiple filterable clearable |
| | | size="small" placeholder="请选择设备" style="width: 360px" |
| | | @change="m => subOtherForm(m, 'deviceIds')"> |
| | |
| | | this.retestTag = '1' |
| | | } |
| | | this.getEquipOptions(1) |
| | | if (this.sonLaboratory === '新聚') { |
| | | this.loadDeviceOptions() |
| | | } |
| | | this.loadDeviceOptions() |
| | | // 获取当前样品的检验项 |
| | | let list = await this.getCurrentProduct(this.currentSample.id, 0) |
| | | if (list === undefined) { |
| | |
| | | }) |
| | | } |
| | | }, |
| | | // 新聚直接绑定模板的单据,设备按模板选择 |
| | | isDirectTemplateOrder() { |
| | | return this.sonLaboratory === '新聚' && |
| | | Array.isArray(this.insOrder.templateConditions) && |
| | | this.insOrder.templateConditions.length > 0 |
| | | }, |
| | | loadDeviceOptions() { |
| | | search({ status: 0 }).then(res => { |
| | | this.deviceOptions = (res.data || []).map(device => ({ |
| | |
| | | upInsReview(e) { |
| | | if (e == 1) { |
| | | // 通过 |
| | | // 每个模板都要有结论;全部合格才算整单合格 |
| | | const insResults = this.tableLists.map( |
| | | item => (this.otherForm[item.templateId] || {}).insResult |
| | | ) |
| | | const missingIndex = insResults.findIndex(result => result !== 0 && result !== 1) |
| | | if (this.isDirectTemplateOrder() && missingIndex > -1) { |
| | | if (missingIndex > -1) { |
| | | this.$message.error(`请选择「${this.tableLists[missingIndex].templateName}」的检验结论`) |
| | | return |
| | | } |
| | |
| | | laboratory: this.sonLaboratory, |
| | | tell: null, |
| | | userId: this.checkUser, |
| | | insResult: this.isDirectTemplateOrder() |
| | | ? (insResults.every(result => result === 1) ? 1 : 0) |
| | | : this.insOrder.insResult |
| | | insResult: insResults.every(result => result === 1) ? 1 : 0 |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success("操作成功") |
| | |
| | | if (!form.humidity) missing.push(`请填写「${m.templateName}」的湿度`) |
| | | if (!form.detectionTime) missing.push(`请选择「${m.templateName}」的检测时间`) |
| | | if (!form.detectionPlace) missing.push(`请填写「${m.templateName}」的检测地点`) |
| | | if (this.isDirectTemplateOrder() && (!form.deviceIds || form.deviceIds.length === 0)) { |
| | | if (!form.deviceIds || form.deviceIds.length === 0) { |
| | | missing.push(`请选择「${m.templateName}」的设备`) |
| | | } |
| | | }) |