| | |
| | | <el-form-item label="委托编号:"> |
| | | <el-input v-model="insOrder.entrustCode" clearable disabled placeholder="请输入" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="检测依据:"> |
| | | <el-tooltip :content="standardDisplayName(insOrder.sample)" :disabled="!insOrder.sample"> |
| | | <el-input :value="standardDisplayName(insOrder.sample)" clearable disabled size="small"></el-input> |
| | | </el-tooltip> |
| | | </el-form-item> |
| | | <el-form-item label="样品名称:"> |
| | | <el-input :value="insOrder.sampleView || '-'" clearable disabled size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="样品编号:"> |
| | | <el-tooltip :content="currentSample.sampleCode" :disabled="!currentSample.sampleCode"> |
| | | <el-input v-model="currentSample.sampleCode" clearable disabled placeholder="请输入" size="small"></el-input> |
| | | </el-tooltip> |
| | | </el-form-item> |
| | | <el-form-item label="样品名称:"> |
| | | <el-input v-model="currentSample.sample" clearable disabled placeholder="请输入" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="样品数量:"> |
| | | <el-input v-model="insOrder.testQuantity" clearable disabled placeholder="请输入" size="small"></el-input> |
| | |
| | | </div> |
| | | <!-- 当前检验模板的检测条件与检验结论 --> |
| | | <div class="template-panel"> |
| | | <el-form v-if="showTemplateConditions" :inline="true" :model="currentOtherForm" class="form-inline" |
| | | <el-form :inline="true" :model="currentOtherForm" class="form-inline" |
| | | size="small" label-width="84px"> |
| | | <el-form-item v-if="insOrder.ifsOrderType !== '02wg'" label="温度:"> |
| | | <el-input v-model="currentOtherForm.temperature" :disabled="state > 1" size="small" |
| | |
| | | style="width: 90px" @change="m => subOtherForm(m, 'humidity')" /> |
| | | <span class="template-panel__unit">%RH</span> |
| | | </el-form-item> |
| | | <el-form-item v-if="insOrder.ifsOrderType !== '02wg'" label="检测时间:"> |
| | | <el-form-item label="检测时间:"> |
| | | <el-date-picker v-model="currentOtherForm.detectionTime" :disabled="state > 1" type="date" |
| | | value-format="yyyy-MM-dd" placeholder="请选择日期" size="small" style="width: 160px" |
| | | @change="m => subOtherForm(m, 'detectionTime')" /> |
| | | </el-form-item> |
| | | <el-form-item v-if="insOrder.ifsOrderType !== '02wg'" label="检测地点:"> |
| | | <el-form-item label="检测地点:"> |
| | | <el-input v-model="currentOtherForm.detectionPlace" :disabled="state > 1" clearable |
| | | placeholder="请输入检测地点" size="small" style="width: 200px" |
| | | @change="m => subOtherForm(m, 'detectionPlace')" /> |
| | | </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 |
| | | placeholder="请选择设备" size="small" style="width: 360px" |
| | | @change="m => subOtherForm(m, 'deviceIds')"> |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-form :inline="true" :model="currentOtherForm" |
| | | :class="['form-inline', { 'template-panel__conclusion--divided': showTemplateConditions }]" |
| | | <el-form :inline="true" :model="currentOtherForm" class="form-inline template-panel__conclusion--divided" |
| | | size="small" label-width="84px"> |
| | | <el-form-item label="检验结论:"> |
| | | <el-radio-group v-model="currentOtherForm.insResult" :disabled="state != 2" |
| | |
| | | reviewLoading: false, |
| | | reviewDia: false, |
| | | noReason: "", |
| | | reviewInsResult: null, |
| | | tableWidth: 1000, |
| | | currentTable: null, |
| | | tableLists: [], |
| | |
| | | insResult: null, |
| | | }; |
| | | }, |
| | | showTemplateConditions() { |
| | | return this.insOrder.ifsOrderType !== "02wg" || this.isDirectTemplateOrder(); |
| | | }, |
| | | }, |
| | | created() { |
| | | this.saveQueue = Promise.resolve(); |
| | |
| | | laboratory: this.sonLaboratory, |
| | | }).then(async (res) => { |
| | | this.insOrder = res.data.insOrder; |
| | | this.reviewInsResult = this.insOrder.insResult; |
| | | this.supplierDensity = res.data.supplierDensity; |
| | | this.getList() |
| | | this.urgentList.forEach((m) => { |
| | |
| | | this.rawMaterialTag = "1"; |
| | | } |
| | | this.getEquipOptions(1); |
| | | if (this.sonLaboratory === "新聚") { |
| | | this.loadDeviceOptions(); |
| | | } |
| | | this.loadDeviceOptions(); |
| | | // 获取当前样品的检验项 |
| | | let list = await this.getCurrentProduct(this.currentSample.id, 0); |
| | | this.currentSample.insProduct = this.HaveJson(list); |
| | |
| | | upInsReview(e) { |
| | | if (e == 1) { |
| | | // 通过 |
| | | let finalInsResult = this.reviewInsResult; |
| | | if (this.isDirectTemplateOrder()) { |
| | | const insResults = this.tableLists.map( |
| | | item => (this.otherForm[item.templateId] || {}).insResult |
| | | ); |
| | | const missingIndex = insResults.findIndex(result => result !== 0 && result !== 1); |
| | | if (missingIndex > -1) { |
| | | this.$message.error(`请选择「${this.tableLists[missingIndex].templateName}」的检验结论`); |
| | | return; |
| | | } |
| | | finalInsResult = insResults.every(result => result === 1) ? 1 : 0; |
| | | } else if (finalInsResult !== 0 && finalInsResult !== 1) { |
| | | this.$message.error("请选择检验结论"); |
| | | // 每个模板都要有结论;全部合格才算整单合格 |
| | | const insResults = this.tableLists.map( |
| | | item => (this.otherForm[item.templateId] || {}).insResult |
| | | ); |
| | | const missingIndex = insResults.findIndex(result => result !== 0 && result !== 1); |
| | | if (missingIndex > -1) { |
| | | this.$message.error(`请选择「${this.tableLists[missingIndex].templateName}」的检验结论`); |
| | | return; |
| | | } |
| | | const finalInsResult = insResults.every(result => result === 1) ? 1 : 0; |
| | | this.reviewLoading = true; |
| | | verifyPlan({ |
| | | orderId: this.orderId, |
| | |
| | | if (this.insOrder.ifsOrderType !== "02wg") { |
| | | if (!form.temperature) missing.push(`请填写「${item.templateName}」的温度`); |
| | | if (!form.humidity) missing.push(`请填写「${item.templateName}」的湿度`); |
| | | if (!form.detectionTime) missing.push(`请选择「${item.templateName}」的检测时间`); |
| | | if (!form.detectionPlace) missing.push(`请填写「${item.templateName}」的检测地点`); |
| | | } |
| | | if (this.isDirectTemplateOrder() && (!form.deviceIds || form.deviceIds.length === 0)) { |
| | | if (!form.detectionTime) missing.push(`请选择「${item.templateName}」的检测时间`); |
| | | if (!form.detectionPlace) missing.push(`请填写「${item.templateName}」的检测地点`); |
| | | if (!form.deviceIds || form.deviceIds.length === 0) { |
| | | missing.push(`请选择「${item.templateName}」的设备`); |
| | | } |
| | | }); |
| | |
| | | // 选择、移除、清空均由 change 事件触发,立即保存。 |
| | | this.saveInsContext(); |
| | | }, |
| | | standardDisplayName(value) { |
| | | if (!value) return "-"; |
| | | const separatorIndex = value.indexOf(" - "); |
| | | return separatorIndex > -1 ? value.slice(0, separatorIndex) : value; |
| | | }, |
| | | isDirectTemplateOrder() { |
| | | return this.sonLaboratory === "新聚" && |
| | | Array.isArray(this.insOrder.templateConditions) && |