From bcc5265467b4f38a95d38bee32681d4842e100d9 Mon Sep 17 00:00:00 2001 From: shenzhouyu Date: Wed, 13 May 2026 14:21:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/dm/DMQcPartAttribute.vue | 12 ++++-- src/views/modules/qc/IPQCResultEntry.vue | 2 +- src/views/modules/qc/qcPartAttribute.vue | 48 ++++++++++++++-------- 3 files changed, 40 insertions(+), 22 deletions(-) diff --git a/src/views/modules/dm/DMQcPartAttribute.vue b/src/views/modules/dm/DMQcPartAttribute.vue index cf783c1..ccd6447 100644 --- a/src/views/modules/dm/DMQcPartAttribute.vue +++ b/src/views/modules/dm/DMQcPartAttribute.vue @@ -178,8 +178,8 @@ - - + + 新增 @@ -869,7 +869,7 @@ export default { resourceCurrent: -1, inspectionStandardListFlag: false, standardFastAddFlag: false, - standardHeader: { site: "", buNo: "", attributeNo: "", partDesc: "", templateId: "", inspectionTypeName: "" }, + standardHeader: { site: "", buNo: "", attributeNo: "", partDesc: "", templateId: "", inspectionTypeName: "",inspectionTypeNo: "" }, standardList: [], standardRow1: [], standardRow2: [], @@ -1080,6 +1080,7 @@ export default { deletePropertiesModel(row) { this.$confirm(`是否删除这个检验模板?`, "提示", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning" }) .then(() => { + row.bu = row.site + "_" + row.buNo; dmPartAttributeDelete(row).then(({ data }) => { if (data && data.code === 0) { this.getDataList(); @@ -1149,6 +1150,7 @@ export default { this.resourceId = ""; this.operationCurrent = -1; this.resourceCurrent = -1; + this.$set(this.detailDataAdd,'inspectionTypeNo','823') this.checkInspectionType(); this.fastAddFlag = true; }, @@ -1159,6 +1161,7 @@ export default { this.detailDataAdd.site = this.detailData.site this.detailDataAdd.partDesc = this.detailData.partDesc this.detailDataAdd.partNo = this.detailData.partNo + dmAttributeTemplateList(this.detailDataAdd).then(({ data }) => { this.operation = ""; this.resourceId = ""; @@ -1563,6 +1566,7 @@ export default { // ======================= 检验标准清单(物料+模板覆盖) ======================= inspectionStandardListModal(row) { + console.log("inspectionStandardListModal", row); this.standardHeader = { site: row.site, buNo: row.buNo, @@ -1570,6 +1574,7 @@ export default { partDesc: this.detailData.partDesc, templateId: row.templateId, inspectionTypeName: row.inspectionTypeName, + inspectionTypeNo: row.inspectionTypeNo }; const req = { site: row.site, buNo: row.buNo, attributeNo: this.detailData.partNo, templateId: row.templateId }; dmAttributeTemplateItemDetailsSearch(req).then(({ data }) => { @@ -1632,6 +1637,7 @@ export default { templateId: this.standardHeader.templateId, itemNo: this.standardSearch.itemNo, itemDesc: this.standardSearch.itemDesc, + inspectionTypeNo: this.standardHeader.inspectionTypeNo, }; dmAttributeTemplateItemGetItemList(req).then(({ data }) => { this.standardRow1 = data.row1 || []; diff --git a/src/views/modules/qc/IPQCResultEntry.vue b/src/views/modules/qc/IPQCResultEntry.vue index f90ff31..2535d19 100644 --- a/src/views/modules/qc/IPQCResultEntry.vue +++ b/src/views/modules/qc/IPQCResultEntry.vue @@ -2640,7 +2640,7 @@ }) } else { this.$message({ - message: data.msg, + message: "暂无获取到异常数据", type: 'warning', duration: 1500 }) diff --git a/src/views/modules/qc/qcPartAttribute.vue b/src/views/modules/qc/qcPartAttribute.vue index 94bc8a5..e8b605c 100644 --- a/src/views/modules/qc/qcPartAttribute.vue +++ b/src/views/modules/qc/qcPartAttribute.vue @@ -268,8 +268,8 @@ - - + +
@@ -1643,6 +1643,27 @@ } }, + /** + * 加载「检验模板清单」表格;使用序号丢弃过期响应,避免打开弹框时的请求晚于「新增」关闭后的刷新而把列表覆盖成旧数据。 + */ + loadTemplateDetailList () { + this._detailListLoadSeq = (this._detailListLoadSeq || 0) + 1 + const seq = this._detailListLoadSeq + const param = { + site: this.detailData.site, + buNo: this.detailData.buNo, + partNo: this.detailData.partNo, + attributeNo: this.detailData.attributeNo || this.detailData.partNo, + attributeType: this.detailData.attributeType || 'A', + createBy: this.detailData.createBy + } + return searchPartAttributeDetails(param).then(({ data }) => { + if (seq !== this._detailListLoadSeq) return + const rows = (data && data.rows) ? data.rows : [] + this.detailList = rows.slice() + }) + }, + // 打开物料模板清单 detailModal (row) { this.detailData.site = row.site @@ -1650,12 +1671,8 @@ this.detailData.partNo = row.partNo this.detailData.attributeNo = row.partNo this.detailData.partDesc = row.partDesc - let detailDataTemp = JSON.parse(JSON.stringify(this.detailData)); - detailDataTemp.inspectionTypeNo=''; - searchPartAttributeDetails(detailDataTemp).then(({data}) => { - this.detailList = data.rows - }) this.detailModelFlag = true + this.loadTemplateDetailList() }, checkInspectionType () { @@ -1748,6 +1765,7 @@ this.itemList1 = data.row1 this.itemList2 = data.row2 }) + this.loadTemplateDetailList() this.itemSelections1 = [] this.operation = '' this.resourceId = '' @@ -1779,6 +1797,7 @@ this.itemList1 = data.row1 this.itemList2 = data.row2 }) + this.loadTemplateDetailList() this.itemSelections2 = [] } else { this.$alert(data.msg, '错误', { @@ -1788,13 +1807,10 @@ }) }, - // 关闭后刷新列表 + // 关闭「新增」弹框后刷新父弹框清单(与 loadTemplateDetailList 共用防竞态逻辑) refreshDetailList () { - let detailDataTemp = JSON.parse(JSON.stringify(this.detailData)); - detailDataTemp.inspectionTypeNo=''; - searchPartAttributeDetails(detailDataTemp).then(({data}) => { - this.detailList = data.rows - }) + if (!this.detailModelFlag) return + this.loadTemplateDetailList() }, // 删除物料属性中的模板 @@ -1806,11 +1822,7 @@ }).then(() => { deletePartAttributeDetails(row).then(({data}) => { if (data && data.code === 0) { - let detailDataTemp = JSON.parse(JSON.stringify(this.detailData)); - detailDataTemp.inspectionTypeNo=''; - searchPartAttributeDetails(detailDataTemp).then(({data}) => { - this.detailList = data.rows - }) + this.loadTemplateDetailList() this.$message({ message: '操作成功', type: 'success',