From 84b2fab29fc8c44173b5564e08d6eeb6e6e0a581 Mon Sep 17 00:00:00 2001 From: "han\\hanst" Date: Mon, 25 May 2026 09:13:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E9=AA=8C=E6=A0=87=E5=87=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/qc/qc.js | 2 + src/api/sift/queryUserSetting.js | 5 + src/views/modules/eam/eamProjectPartInfo.vue | 2 +- src/views/modules/qc/PQCResultEntry.vue | 97 ++++++++++++-- src/views/modules/qc/qcPartAttribute.vue | 131 ++++++++++++++++++- 5 files changed, 222 insertions(+), 15 deletions(-) diff --git a/src/api/qc/qc.js b/src/api/qc/qc.js index 0b53a68..2b16c45 100644 --- a/src/api/qc/qc.js +++ b/src/api/qc/qc.js @@ -83,6 +83,8 @@ export const uploadPartAttributeExcel = data => createAPI(`/pms/qc/uploadPartAtt export const getOperationDescList = data => createAPI(`/pms/qc/getOperationDescList`,'post',data) export const getManufacturerList = data => createAPI(`/pms/qc/getManufacturerList`,'post',data) export const getPartTemplateLists = data => createAPI(`/pms/qc/getPartTemplateLists`,'post',data) +export const qcAttributeTemplateItemDetailsSearch = data => createAPI(`/pms/qc/qcAttributeTemplateItemDetailsSearch`,'post',data) +export const qcAttributeTemplateItemSave = data => createAPI(`/pms/qc/qcAttributeTemplateItemSave`,'post',data) export const qcPartAttributeEdit = data => createAPI(`/pms/qc/qcPartAttributeEdit`,'post',data) export const overLoadSearchPartInfo = data => createAPI(`/pms/qc/overLoadSearchPartInfo`,'post',data) diff --git a/src/api/sift/queryUserSetting.js b/src/api/sift/queryUserSetting.js index ded10df..97bc12c 100644 --- a/src/api/sift/queryUserSetting.js +++ b/src/api/sift/queryUserSetting.js @@ -7,3 +7,8 @@ export const saveOrUpdateBatch = (data) => createAPI(`/sift/saveOrUpdateBatch`,' export const saveQueryHeaderDetail = (data) => createAPI(`/sift/saveRecord`,'post',data) export const removeQueryHeaderDetail = (data) => createAPI(`/sift/record/remove`,'post',data) export const updateQueryHeaderDetail = (data) => createAPI(`/sift/record/update`,'post',data) +export const searchSavedSchemeSummary = (data) => createAPI(`/sift/center/summary`,'post',data) +export const searchSavedSchemeCount = (data) => createAPI(`/sift/center/count`,'post',data) +export const resolveSavedSchemeRoute = (data) => createAPI(`/sift/center/resolveRoute`,'post',data) +export const searchCenterMenuSearchFields = (data) => createAPI(`/sift/center/menuSearchFields`,'post',data) +export const saveCenterScheme = (data) => createAPI(`/sift/center/saveScheme`,'post',data) diff --git a/src/views/modules/eam/eamProjectPartInfo.vue b/src/views/modules/eam/eamProjectPartInfo.vue index 3bb36ce..84d0fc0 100644 --- a/src/views/modules/eam/eamProjectPartInfo.vue +++ b/src/views/modules/eam/eamProjectPartInfo.vue @@ -96,7 +96,7 @@ - +
- + 0) { - let filterList = this.roleList.filter(item => item.roleName === '机修人员') + let filterList = this.roleList.filter(item => item.roleName && item.roleName.indexOf('换线点检') > -1) if (filterList.length > 0) { this.operatorData.roleId = filterList[0].roleId } else { @@ -2780,6 +2782,13 @@ export default { } else { this.operatorData.roleId = '' } + }, + + // 获取协同人员列表 + getOperatorList () { + this.operatorData.flag = '1' + this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo + this.setDefaultLineInspectionRole() // 先清空缓存选中 this.$nextTick(() => this.$refs.operatorTable.clearSelection()) // 拿到选中的人员编号 @@ -2806,6 +2815,7 @@ export default { getResponsiblePersonList () { this.operatorData.flag = '2' this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo + this.setDefaultLineInspectionRole() // 先清空缓存选中 this.$nextTick(() => this.$refs.operatorTable.clearSelection()) @@ -2934,6 +2944,42 @@ export default { } }, + // 获取默认BU(优先RFID) + getDefaultBuNo () { + if (!this.userBuList || this.userBuList.length === 0) { + return '' + } + // 先精确匹配“RFID”,再模糊匹配,避免“软标&RFID”被误判 + let exactRfidBu = this.userBuList.find(item => (item.buDesc || '').trim().toUpperCase() === 'RFID') + if (exactRfidBu) { + return exactRfidBu.buNo + } + let fuzzyRfidBu = this.userBuList.find(item => (item.buDesc || '').toUpperCase().indexOf('RFID') > -1) + return fuzzyRfidBu ? fuzzyRfidBu.buNo : this.userBuList[0].buNo + }, + + // 由前端bu值解析site和buNo + resolveSiteAndBuNoByBu (bu) { + if (!bu) { + return { + site: '', + buNo: '' + } + } + const buVal = String(bu) + if (buVal.indexOf('_') > -1) { + const buArr = buVal.split('_') + return { + site: buArr[0], + buNo: buArr[1] || '' + } + } + return { + site: this.$store.state.user.site, + buNo: buVal + } + }, + // 获取用户的bu getSiteAndBuByUserName () { let tempData = { @@ -2942,6 +2988,9 @@ export default { getSiteAndBuByUserName(tempData).then(({data}) => { if (data.code === 0) { this.userBuList = data.rows + if (!this.modalData.bu) { + this.modalData.bu = this.getDefaultBuNo() + } } }) }, @@ -3203,10 +3252,29 @@ export default { }) }, queryALLPartList(){ - queryPartDescByNo(this.partModalData).then(({data})=>{ + this.partFlag = true + const partNo = (this.partModalData.partNo || '').trim() + const partDesc = (this.partModalData.partDesc || '').trim() + const buInfo = this.resolveSiteAndBuNoByBu(this.modalData.bu) + if (!buInfo.site || !buInfo.buNo) { + this.$message.warning('请先选择BU!') + return + } + const queryData = { + site: buInfo.site, + sourceBu: buInfo.buNo, + partNo: partNo, + partDesc: partDesc + } + const cacheKey = `${queryData.site}|${queryData.sourceBu}|${queryData.partNo}|${queryData.partDesc}` + if (this.partList2CacheMap[cacheKey]) { + this.partList2 = this.partList2CacheMap[cacheKey] + return + } + queryPartDescByNo(queryData).then(({data})=>{ if (data.code==0){ - this.partList2 = data.rows - this.partFlag = true + this.partList2 = data.rows || [] + this.partList2CacheMap[cacheKey] = this.partList2 }else { this.$message.error("系统异常") } @@ -3277,7 +3345,7 @@ export default { this.modalData = { flag: '1', site: '', - bu: this.userBuList[0].buNo, + bu: this.getDefaultBuNo(), inspectionNo: '', partNo: '', partDesc: '', @@ -3541,7 +3609,7 @@ export default { this.modalData = { flag: '1', site: '', - bu: this.userBuList[0].buNo, + bu: this.getDefaultBuNo(), inspectionNo: '', partNo: '', partDesc: '', @@ -3576,6 +3644,11 @@ export default { changePeople:[this.$store.state.user.name], sopType: 'SOP-ST', } + this.partModalData = { + partNo: '', + partDesc: '' + } + this.partList2 = [] this.operationList = [] this.resourceList = [] this.partList = [] diff --git a/src/views/modules/qc/qcPartAttribute.vue b/src/views/modules/qc/qcPartAttribute.vue index f7a0388..743aabe 100644 --- a/src/views/modules/qc/qcPartAttribute.vue +++ b/src/views/modules/qc/qcPartAttribute.vue @@ -254,9 +254,10 @@ fixed="right" header-align="center" align="center" - width="80" + width="150" label="操作"> @@ -268,6 +269,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 保存 + 关闭 + + +
@@ -678,6 +715,8 @@ deletePartAttributeDetails, // 删除物料属性模板 saveAttributeDetailed, // 新增物料属性模板详情 getPartTemplateLists, // 获取模板列表 + qcAttributeTemplateItemDetailsSearch, // 查询物料模板检验标准明细 + qcAttributeTemplateItemSave, // 保存物料模板检验标准明细 inspectionTypeSearch, // 搜索所有检验类型 getOperationDescList, // 查询工序列表 getManufacturerList, // 查询供应商列表 @@ -1251,6 +1290,18 @@ // 单选框绑定的值 operationCurrent: -1, resourceCurrent: -1, + inspectionStandardListFlag: false, + standardHeader: { + site: '', + buNo: '', + attributeNo: '', + attributeType: 'A', + partDesc: '', + templateId: '', + inspectionTypeNo: '', + inspectionTypeName: '' + }, + standardList: [], sopData: { site: '', buNo: '', @@ -1685,6 +1736,7 @@ this.detailData.buNo = row.buNo this.detailData.partNo = row.partNo this.detailData.attributeNo = row.partNo + this.detailData.attributeType = row.attributeType || 'A' this.detailData.partDesc = row.partDesc this.detailModelFlag = true this.loadTemplateDetailList() @@ -1784,7 +1836,9 @@ resourceID: this.resourceId, manufacturerList: this.selectionManufacturer, attributeType: this.detailData.attributeType, - inspectionTypeNo: this.detailData.inspectionTypeNo + inspectionTypeNo: this.detailData.inspectionTypeNo, + createBy: this.$store.state.user.name, + updateBy: this.$store.state.user.name } savePartAttributeDetails(inData).then(({data}) => { if (data && data.code === 0) { @@ -1866,6 +1920,79 @@ }) }, + // 物料模板检验标准弹窗 + inspectionStandardListModal (row) { + this.standardHeader = { + site: row.site || this.detailData.site, + buNo: row.buNo || this.detailData.buNo, + attributeNo: this.detailData.partNo, + attributeType: this.detailData.attributeType || 'A', + partDesc: this.detailData.partDesc, + templateId: row.templateId, + inspectionTypeNo: row.inspectionTypeNo || '', + inspectionTypeName: row.inspectionTypeName || '' + } + let req = { + site: this.standardHeader.site, + buNo: this.standardHeader.buNo, + attributeNo: this.standardHeader.attributeNo, + templateId: this.standardHeader.templateId + } + qcAttributeTemplateItemDetailsSearch(req).then(({data}) => { + if (data && data.code === 0) { + this.standardList = data.rows || [] + this.inspectionStandardListFlag = true + } else { + this.$alert(data.msg || '查询失败', '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + + // 保存物料模板检验标准 + saveStandardList () { + if (!this.standardHeader.templateId) { + this.$message.warning('请先选择模板!') + return + } + if (this.standardList == null || this.standardList.length === 0) { + this.$message.warning('当前模板没有可保存的检验项目!') + return + } + let req = { + site: this.standardHeader.site, + buNo: this.standardHeader.buNo, + attributeNo: this.standardHeader.attributeNo, + attributeType: this.standardHeader.attributeType, + templateId: this.standardHeader.templateId, + createBy: this.$store.state.user.name, + updateBy: this.$store.state.user.name, + itemList: this.standardList.map(item => ({ + itemNo: item.itemNo, + defaultValue: item.defaultValue, + maxValue: item.maxValue, + minValue: item.minValue, + orderId: item.orderId + })) + } + qcAttributeTemplateItemSave(req).then(({data}) => { + if (data && data.code === 0) { + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + this.inspectionStandardListFlag = false + } else { + this.$alert(data.msg || '保存失败', '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + // 校验用户是否收藏 favoriteIsOk () { let userFavorite = {