| | |
| | | <lims-table :tableData="tableData0" :column="column0" :page="page0" :tableLoading="tableLoading0" |
| | | :height="'calc(100vh - 90px)'" :currentChange="handleChangeTask"></lims-table> |
| | | </el-drawer> |
| | | <el-dialog |
| | | title="哑铃片设备试样类型" |
| | | :visible.sync="dialogVisible" |
| | | :before-close="handleDialogCancel" |
| | | width="30%"> |
| | | <el-select v-model="deviceDbTableName" placeholder="请选择试样类型" style="width:100%" size="small"> |
| | | <el-option label="片状" value="TestData"></el-option> |
| | | <el-option label="管状" value="TestData2"></el-option> |
| | | </el-select> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="handleDialogConfirm">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog :visible.sync="reviewDia" title="检验复核" width="500px"> |
| | | <div v-if="reviewDia" class="body" style="display: flex; padding: 10px"> |
| | | <div class="search_label" style="width: 150px"> |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | // 存储 Promise 的 resolve/reject,用于弹框确认/取消时调用 |
| | | dialogResolve: null, |
| | | dialogReject: null, |
| | | dialogVisible: false, |
| | | deviceDbTableName: '', |
| | | outerColorList:[], |
| | | insulationColorList:[], |
| | | letteringInfoList: [], |
| | |
| | | this.$refs.purchaseDialog.$refs["purchaseForm"].resetFields(); |
| | | this.purchaseDialog = false; |
| | | }, |
| | | openDialog() { |
| | | this.dialogVisible = true; |
| | | this.deviceDbTableName = ''; // 重置表单 |
| | | // 返回 Promise,等待用户操作 |
| | | return new Promise((resolve, reject) => { |
| | | this.dialogResolve = resolve; |
| | | this.dialogReject = reject; |
| | | }); |
| | | }, |
| | | // 弹框确认提交 |
| | | handleDialogConfirm() { |
| | | // 关闭弹框 |
| | | this.dialogVisible = false; |
| | | // 调用 resolve,传递表单数据,恢复执行后续代码 |
| | | this.dialogResolve(this.deviceDbTableName); |
| | | }, |
| | | |
| | | // 弹框取消/关闭 |
| | | handleDialogCancel() { |
| | | console.log(111) |
| | | this.dialogVisible = false; |
| | | // 调用 reject,终止后续代码 |
| | | this.dialogReject(); |
| | | }, |
| | | // 数据采集 |
| | | |
| | | getDataAcquisitionDevice() { |
| | | let itemIds = []; |
| | | this.currentSample.insProduct.forEach((item) => { |
| | | if (item.inspectionItemType === "1") { |
| | | itemIds.push(item.id); |
| | | async getDataAcquisitionDevice() { |
| | | //过滤选中的设备列表 |
| | | let deviceList = [] |
| | | for (let item in this.param){ |
| | | let val1 = this.param[item] |
| | | for(let item2 in val1){ |
| | | if(item2==='equipName'){ |
| | | let equipName = val1[item2] |
| | | equipName.forEach(item=>{ |
| | | if(item.v.v && Array.isArray(item.v.v)){ |
| | | deviceList.push(...item.v.v) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }); |
| | | const params = { |
| | | entrustCode: this.insOrder.entrustCode, |
| | | lotBatchNo: this.insOrder.lotBatchNo, |
| | | sampleCode: this.currentSample.sampleCode, |
| | | id: this.currentSample.id, |
| | | itemIds: itemIds, |
| | | }; |
| | | this.dataAcquisitionLoading = true; |
| | | dataCollection(params).then((res) => { |
| | | this.dataAcquisitionLoading = false; |
| | | if (res.code != 200) { |
| | | return; |
| | | } |
| | | //数组去重 |
| | | let deviceSetList = [...new Set(deviceList)] |
| | | try{ |
| | | if(deviceSetList.includes('NS-YL3141') && !this.deviceDbTableName){ |
| | | await this.openDialog(); |
| | | } |
| | | this.dataAcquisitionInfoNew = this.HaveJson(res.data); |
| | | // 对数采回来的值进行处理 |
| | | this.handleDataAcquisition(res.data); |
| | | }).catch(err => { |
| | | this.dataAcquisitionLoading = false; |
| | | }); |
| | | let itemIds = []; |
| | | this.currentSample.insProduct.forEach((item) => { |
| | | if (item.inspectionItemType === "1") { |
| | | itemIds.push(item.id); |
| | | } |
| | | }); |
| | | const params = { |
| | | entrustCode: this.insOrder.entrustCode, |
| | | lotBatchNo: this.insOrder.lotBatchNo, |
| | | sampleCode: this.currentSample.sampleCode, |
| | | id: this.currentSample.id, |
| | | itemIds: itemIds, |
| | | dbTable: this.deviceDbTableName, |
| | | }; |
| | | this.dataAcquisitionLoading = true; |
| | | dataCollection(params).then((res) => { |
| | | this.dataAcquisitionLoading = false; |
| | | if (res.code != 200) { |
| | | return; |
| | | } |
| | | this.dataAcquisitionInfoNew = this.HaveJson(res.data); |
| | | // 对数采回来的值进行处理 |
| | | this.handleDataAcquisition(res.data); |
| | | }).catch(err => { |
| | | this.dataAcquisitionLoading = false; |
| | | }); |
| | | }catch (error){ |
| | | console.error('数据采集设备列表处理失败',error) |
| | | } |
| | | }, |
| | | objectOrder(obj) { |
| | | let newkey = Object.keys(obj).sort(); |