| | |
| | | <el-descriptions-item label="零件号">{{insOrder.partNo}}</el-descriptions-item> |
| | | <el-descriptions-item label="零件名称">{{insOrder.partDetail}}</el-descriptions-item> |
| | | <el-descriptions-item label="批次号">{{ insOrder.lotBatchNo }}</el-descriptions-item> |
| | | <el-descriptions-item label="样品型号" >{{currentSample.model}}</el-descriptions-item> |
| | | <el-descriptions-item label="抽检数量">{{insOrder.testQuantity}}</el-descriptions-item> |
| | | <el-descriptions-item label="厂家密度">{{supplierDensity}}</el-descriptions-item> |
| | | <template v-if="insOrder.ifsOrderType && insOrder.ifsOrderType==='02wg'"> |
| | |
| | | <el-descriptions-item label="委托编号">{{ insOrder.entrustCode }}</el-descriptions-item> |
| | | <el-descriptions-item label="样品编号">{{ currentSample.sampleCode }}</el-descriptions-item> |
| | | <el-descriptions-item label="样品名称">{{ currentSample.sample }}</el-descriptions-item> |
| | | <el-descriptions-item label="样品数量">{{ sampleProduct.length }}</el-descriptions-item> |
| | | <el-descriptions-item label="样品型号">{{ currentSample.model }}</el-descriptions-item> |
| | | <el-descriptions-item label="样品数量">{{ insOrder.testQuantity }}</el-descriptions-item> |
| | | <el-descriptions-item label="下发时间">{{ insOrder.sendTime }}</el-descriptions-item> |
| | | <el-descriptions-item label="紧急程度">{{ insOrder.typeName }}</el-descriptions-item> |
| | | <el-descriptions-item label="约定时间">{{ insOrder.appointed }}</el-descriptions-item> |
| | |
| | | <el-descriptions-item label="备注"> |
| | | <el-input v-model="insOrder.remark" :disabled="state != 1" clearable placeholder="请输入" size="small" |
| | | @blur="subOtherForm(insOrder.remark, 'remark')"></el-input> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item v-if="isDirectTemplateOrder()" label="设备" :span="2"> |
| | | <el-select v-model="selectedDeviceIds" multiple filterable clearable size="small" placeholder="请选择设备" |
| | | :disabled="state != 1" @change="saveOverviewDevices"> |
| | | <el-option v-for="device in orderDeviceOptions" :key="device.id" :label="device.label" :value="device.id" /> |
| | | </el-select> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="检验结论"> |
| | | <el-radio-group v-model="reviewInsResult" :disabled="state != 2"> |
| | | <el-radio :label="1">合格</el-radio> |
| | | <el-radio :label="0">不合格</el-radio> |
| | | </el-radio-group> |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | </div> |
| | |
| | | </el-select> |
| | | </div> |
| | | </div> |
| | | <div class="body" style="display: flex; padding: 10px; align-items: center"> |
| | | <div class="search_label" style="width: 150px"> |
| | | <span class="required-span">*</span>报告类型 |
| | | </div> |
| | | <div class="search_input" style="width: 100%"> |
| | | <el-select v-model="reportType" clearable placeholder="请选择" size="small" style="width: 100%"> |
| | | <el-option label="检测报告" :value="0"></el-option> |
| | | <el-option label="检验报告" :value="1"></el-option> |
| | | </el-select> |
| | | </div> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="addVerifyDia = false">取 消</el-button> |
| | | <el-button :loading="submitLoading" type="primary" @click="submit()">确 定</el-button> |
| | |
| | | checkSubmitPlan, |
| | | submitPlan, |
| | | saveInsContext, |
| | | saveTemplateContext, |
| | | getOrderDevices, |
| | | saveOrderDevices, |
| | | selectUserCondition, |
| | | downFile, |
| | | getFileList, |
| | |
| | | comparisonList: [], |
| | | excelMethodList: [], |
| | | equipOptions: [], |
| | | orderDeviceOptions: [], |
| | | selectedDeviceIds: [], |
| | | reviewLoading: false, |
| | | reviewDia: false, |
| | | noReason: "", |
| | | reviewInsResult: null, |
| | | tableWidth: 1000, |
| | | currentTable: null, |
| | | tableLists: [], |
| | | widthList: [], |
| | | addVerifyDia: false, |
| | | verifyUser: null, |
| | | reportType: null, |
| | | personList: [], |
| | | enumList: [], |
| | | tableLoading: false, |
| | |
| | | worker0: null, |
| | | // 检验值按触发顺序串行保存,避免同一检验项的旧请求覆盖新请求。 |
| | | saveQueue: null, |
| | | calculationRevision: 0, |
| | | completedCalculationRevision: 0, |
| | | wareLength: [], |
| | | dataAcquisitionInfo: {}, |
| | | dataAcquisitionInfoNew: {}, |
| | |
| | | }, |
| | | tableLoading0: false, |
| | | // 任务切换列表--结束 |
| | | isSplit: 0, // 是否是拆单过来的 |
| | | }; |
| | | }, |
| | | // 用于上传文件的信息 |
| | |
| | | }, |
| | | created() { |
| | | this.saveQueue = Promise.resolve(); |
| | | let { sonLaboratory, orderId, state, inspectorList, typeSource,isSplit } = |
| | | let { sonLaboratory, orderId, state, inspectorList, typeSource } = |
| | | this.$route.query; |
| | | this.sonLaboratory = sonLaboratory; |
| | | this.orderId = orderId; |
| | |
| | | this.state = state; |
| | | this.inspectorList = inspectorList; |
| | | this.typeSource = typeSource; |
| | | this.isSplit = isSplit; |
| | | }, |
| | | mounted() { |
| | | this.getTypeDicts(); // 获取紧急程度下拉框选项 |
| | |
| | | laboratory: this.sonLaboratory, |
| | | }).then(async (res) => { |
| | | this.insOrder = res.data.insOrder; |
| | | this.reviewInsResult = this.insOrder.insResult; |
| | | if(res.data.insOrder.ifsOrderType==='02wg'){ |
| | | //查询零件属性 |
| | | this.getPartProps(res.data.insOrder.ifsInventoryId) |
| | |
| | | this.rawMaterialTag = "1"; |
| | | } |
| | | this.getEquipOptions(1); |
| | | if (this.sonLaboratory === "新聚") { |
| | | this.loadOverviewDevices(); |
| | | } |
| | | // 获取当前样品的检验项 |
| | | let list = await this.getCurrentProduct(this.currentSample.id, 0); |
| | | this.currentSample.insProduct = this.HaveJson(list); |
| | |
| | | } |
| | | } |
| | | try { |
| | | const revision = ++this.calculationRevision; |
| | | // 向 Worker 发送消息,开始处理逻辑 |
| | | this.worker.postMessage( |
| | | JSON.stringify({ |
| | |
| | | getDataTypeId: this.getDataTypeId, |
| | | modelType: this.sampleProduct[0].model, |
| | | currentInsItem: n, |
| | | revision: revision, |
| | | }) |
| | | ); |
| | | // 先保存主线程中已经输入的原始值。Worker 完成计算后会再次入队保存计算结果。 |
| | |
| | | // 监听 Worker 返回的结果 |
| | | this.worker.onmessage = (event) => { |
| | | const workerResult = JSON.parse(event.data); |
| | | if (workerResult.revision != null && workerResult.revision < this.calculationRevision) { |
| | | return; |
| | | } |
| | | this.result = workerResult; |
| | | switch (workerResult.method) { |
| | | case "saveInsContext": |
| | |
| | | ); |
| | | this.param = resultValue.param; |
| | | this.saveInsContext(); |
| | | this.completedCalculationRevision = Math.max( |
| | | this.completedCalculationRevision, |
| | | workerResult.revision || 0 |
| | | ); |
| | | }); |
| | | break; |
| | | case "tableList": |
| | |
| | | upInsReview(e) { |
| | | if (e == 1) { |
| | | // 通过 |
| | | if (this.reviewInsResult !== 0 && this.reviewInsResult !== 1) { |
| | | this.$message.error("请选择检验结论"); |
| | | return; |
| | | } |
| | | this.reviewLoading = true; |
| | | verifyPlan({ |
| | | orderId: this.orderId, |
| | |
| | | laboratory: this.sonLaboratory, |
| | | tell: null, |
| | | userId: this.checkUser, |
| | | insResult: this.reviewInsResult, |
| | | }).then((res) => { |
| | | if (res.code === 200) { |
| | | this.$message.success("操作成功"); |
| | |
| | | this.$refs.viewManHourDia.showDialog(this.id, 99); |
| | | }, |
| | | openAddVerifyDia() { |
| | | this.reportType = null; |
| | | this.addVerifyDia = true; |
| | | }, |
| | | confirmSubmit(registerInsResults){ |
| | | confirmSubmit(){ |
| | | submitPlan({ |
| | | orderId: this.orderId, |
| | | laboratory: this.sonLaboratory, |
| | | verifyUser: this.verifyUser, |
| | | entrustCode: this.insOrder.entrustCode, |
| | | registerInsResults: this.reportType === 1 && registerInsResults, |
| | | reportType: this.reportType |
| | | registerInsResults: false, |
| | | }).then((res) => { |
| | | if (res.code === 200) { |
| | | this.$message.success("操作成功"); |
| | |
| | | this.$message.error("请指定复核人员"); |
| | | return; |
| | | } |
| | | if (this.reportType === null || this.reportType === "") { |
| | | this.$message.error("请选择报告类型"); |
| | | if (this.isDirectTemplateOrder() && (!this.selectedDeviceIds || this.selectedDeviceIds.length === 0)) { |
| | | this.$message.error("请选择设备"); |
| | | return; |
| | | } |
| | | if (!this.otherForm.humidity && this.insOrder.ifsOrderType!=='02wg') { |
| | |
| | | checkSubmitPlan({ |
| | | orderId: this.orderId, |
| | | laboratory: this.sonLaboratory, |
| | | reportType: this.reportType, |
| | | }).then((res) => { |
| | | if (res.code === 200) { |
| | | if (!res.data || res.data.errorMsg.length == 0) { |
| | | this.submitLoading = true; |
| | | //检验类型为原材料 |
| | | if(this.reportType === 1 && this.typeSource==1 && res.data.unInsOrderCount==0 && this.isSplit==1){ |
| | | const htmlStr = "是否登记IFS采购检验结果并移库?该操作会登记<span style='color:#ff4949'>同一零件同一订单的所有拆分批次</span>,请谨慎选择。" |
| | | this.$confirm(htmlStr, '提示', { |
| | | confirmButtonText: '是', |
| | | cancelButtonText: '否', |
| | | type: 'warning', |
| | | dangerouslyUseHTMLString: true |
| | | }).then(() => { |
| | | this.confirmSubmit(true) |
| | | }).catch(() => { |
| | | this.confirmSubmit(false) |
| | | }); |
| | | }else{ |
| | | this.confirmSubmit(true) |
| | | } |
| | | this.confirmSubmit(); |
| | | } else { |
| | | let newData = []; |
| | | const h = this.$createElement; |
| | |
| | | }) |
| | | .then(() => { |
| | | this.submitLoading = true; |
| | | this.confirmSubmit(false) |
| | | this.confirmSubmit() |
| | | // submitPlan({ |
| | | // orderId: this.orderId, |
| | | // laboratory: this.sonLaboratory, |
| | |
| | | const param = {}; |
| | | this.tableList.forEach((a) => { |
| | | param[a.templateId] = {}; |
| | | a.template.forEach((cell) => { |
| | | // Worker 回传后 arr 是页面上的最新对象,template 仍可能保留计算前的旧值。 |
| | | const cells = a.arr && a.arr.length |
| | | ? a.arr.reduce((all, row) => all.concat(row), []) |
| | | : a.template; |
| | | const resultHeader = cells.find((cell) => |
| | | cell.v && String(cell.v.v || "").trim() === "检验结果" |
| | | ); |
| | | const exportRows = new Set(cells.filter((cell) => |
| | | cell.v && cell.v.ps && cell.v.ps.value === "导出值" |
| | | ).map((cell) => cell.r)); |
| | | cells.forEach((cell) => { |
| | | const isEditable = |
| | | cell.v.ps != undefined && |
| | | typeof cell.v.ps.value === "string" && |
| | |
| | | cell.v.ps.value === "计算值" || |
| | | cell.v.ps.value === "最终值" || |
| | | cell.v.ps.value === "设备名称"); |
| | | if (!isEditable) { |
| | | const isExportResult = resultHeader && exportRows.has(cell.r) && cell.c === resultHeader.c; |
| | | if (!isEditable && !isExportResult) { |
| | | return; |
| | | } |
| | | if ( |
| | | isEditable && |
| | | cell.v.ps.value.includes("检验值") && |
| | | (cell.v.v === "" || cell.v.v === null || cell.v.v === undefined) |
| | | ) { |
| | |
| | | const previousSave = this.saveQueue || Promise.resolve(); |
| | | this.saveQueue = previousSave |
| | | .catch(() => undefined) |
| | | .then(() => saveInsContext(payload)) |
| | | .then(() => this.isDirectTemplateOrder() |
| | | ? saveTemplateContext({ |
| | | orderId: this.orderId, |
| | | sampleId: this.currentSample.id, |
| | | templateId: this.currentTable, |
| | | values: param[this.currentTable] || {}, |
| | | }) |
| | | : saveInsContext(payload)) |
| | | .then(() => { |
| | | this.$message.success("已保存"); |
| | | }) |
| | |
| | | } |
| | | }, |
| | | async waitForPendingSaves() { |
| | | const targetRevision = this.calculationRevision; |
| | | if (this.completedCalculationRevision < targetRevision) { |
| | | await new Promise((resolve) => { |
| | | const startedAt = Date.now(); |
| | | const waitWorker = () => { |
| | | if (this.completedCalculationRevision >= targetRevision || Date.now() - startedAt > 5000) { |
| | | resolve(); |
| | | return; |
| | | } |
| | | setTimeout(waitWorker, 20); |
| | | }; |
| | | waitWorker(); |
| | | }); |
| | | } |
| | | if (this.saveQueue) { |
| | | await this.saveQueue; |
| | | } |
| | |
| | | // 选择、移除、清空均由 change 事件触发,立即保存。 |
| | | this.saveInsContext(); |
| | | }, |
| | | isDirectTemplateOrder() { |
| | | return this.sonLaboratory === "新聚" && this.currentSample && |
| | | (this.currentSample.insProduct || []).some((product) => product.templateRowIndex != null); |
| | | }, |
| | | loadOverviewDevices() { |
| | | Promise.all([search({ status: 0 }), getOrderDevices({ orderId: this.orderId })]).then(([devices, selected]) => { |
| | | this.orderDeviceOptions = (devices.data || []).map((device) => ({ |
| | | id: device.id, |
| | | label: `${device.deviceName}--${device.managementNumber}`, |
| | | })); |
| | | this.selectedDeviceIds = selected.data || []; |
| | | }); |
| | | }, |
| | | saveOverviewDevices() { |
| | | return saveOrderDevices({ orderId: this.orderId, deviceIds: this.selectedDeviceIds }) |
| | | .then(() => this.$message.success("设备已保存")); |
| | | }, |
| | | getAuthorizedPerson() { |
| | | selectUserCondition({ type: 1 }).then((res) => { |
| | | let data = []; |