From c05756a311828b95f3763d2019d134fdc61ffbef Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Mon, 12 Jan 2026 22:02:37 +0800 Subject: [PATCH] 2026-01-12 --- src/api/qc/qc.js | 1 + src/views/modules/qc/qcPartAttribute.vue | 119 +++++++++++++++++- .../modules/yieldReport/com_separate_roll.vue | 30 ++++- 3 files changed, 144 insertions(+), 6 deletions(-) diff --git a/src/api/qc/qc.js b/src/api/qc/qc.js index 2449168..c504e3b 100644 --- a/src/api/qc/qc.js +++ b/src/api/qc/qc.js @@ -91,6 +91,7 @@ export const getPatrolConfigList = data => createAPI(`/pms/qc/getPatrolConfigLis export const savePatrolConfig = data => createAPI(`/pms/qc/savePatrolConfig`,'post',data) export const updatePatrolConfig = data => createAPI(`/pms/qc/updatePatrolConfig`,'post',data) export const deletePatrolConfig = data => createAPI(`/pms/qc/deletePatrolConfig`,'post',data) +export const getAllOperationDescList = data => createAPI(`/pms/qc/getAllOperationDescList`,'post',data) export const updateLabelTemplate = data => createAPI(`/pms/qc/updateLabelTemplate`,'post',data) // ===================================== FAI检验 ===================================== diff --git a/src/views/modules/qc/qcPartAttribute.vue b/src/views/modules/qc/qcPartAttribute.vue index 7fa0ca6..33762b5 100644 --- a/src/views/modules/qc/qcPartAttribute.vue +++ b/src/views/modules/qc/qcPartAttribute.vue @@ -332,7 +332,9 @@ @@ -362,6 +364,7 @@ + 保存 关闭 @@ -428,8 +431,22 @@ :min-width="item.columnWidth" :label="item.columnLabel"> { + if (data && data.code === 0) { + this.operationDescList = data.rows || [] + } + }) }, // 获取巡检特殊配置列表 @@ -2264,6 +2315,68 @@ } }, + // 批量保存巡检配置 + batchSavePatrolConfig() { + if (this.patrolConfigList.length === 0) { + this.$message.warning('没有需要保存的数据') + return + } + // 验证数据 + for (let i = 0; i < this.patrolConfigList.length; i++) { + const item = this.patrolConfigList[i] + if (!item.operationDesc) { + this.$message.warning(`第${i + 1}行工序不能为空`) + return + } + } + this.patrolConfigSaveLoading = true + let successCount = 0 + let errorCount = 0 + const promises = this.patrolConfigList.map(row => { + const params = { + site: row.site, + buNo: row.buNo, + partNo: row.partNo, + operationDesc: row.operationDesc, + firstInspectionDuration: row.firstInspectionDuration, + nextInspectionDuration: row.nextInspectionDuration, + totalInspectionDuration: row.totalInspectionDuration, + defaultFlag: row.defaultFlag || 'N' + } + if (row.isNew) { + return savePatrolConfig(params).then(({data}) => { + if (data && data.code === 0) { + successCount++ + row.isNew = false + } else { + errorCount++ + } + }).catch(() => { + errorCount++ + }) + } else { + return updatePatrolConfig(params).then(({data}) => { + if (data && data.code === 0) { + successCount++ + } else { + errorCount++ + } + }).catch(() => { + errorCount++ + }) + } + }) + Promise.all(promises).then(() => { + this.patrolConfigSaveLoading = false + if (errorCount === 0) { + this.$message.success('保存成功') + } else { + this.$message.warning(`保存完成,成功${successCount}条,失败${errorCount}条`) + } + this.getPatrolConfigList() + }) + }, + // 获取用户的bu getSiteAndBuByUserName () { let tempData = { diff --git a/src/views/modules/yieldReport/com_separate_roll.vue b/src/views/modules/yieldReport/com_separate_roll.vue index add4ea0..d002519 100644 --- a/src/views/modules/yieldReport/com_separate_roll.vue +++ b/src/views/modules/yieldReport/com_separate_roll.vue @@ -120,9 +120,9 @@ - 产量报告 - 换班结转 - 异常截卷 + 产量报告 + 换班结转 + 异常截卷 {{ buttons.closeButton }} @@ -269,6 +269,10 @@ export default { return { titleCon: '创建分卷', showDefault: false, + // 按钮loading状态 + yieldReportLoading: false, // 产量报告loading + shiftChangeLoading: false, // 换班结转loading + abnormalCutLoading: false, // 异常截卷loading scheduleData: { site: this.$store.state.user.site, username: this.$store.state.user.name, @@ -682,6 +686,9 @@ export default { return false; } + // 开启loading + this.shiftChangeLoading = true; + try { // 构建保存数据 const saveData = { @@ -719,6 +726,8 @@ export default { } catch (error) { console.error('换班结转保存失败:', error); this.$message.error('换班结转保存失败:' + error.message); + } finally { + this.shiftChangeLoading = false; } }, @@ -760,6 +769,9 @@ export default { return false; // 用户取消 } + // 开启loading + this.abnormalCutLoading = true; + try { // ========== 第一步:执行产量报告 + 保存缓存数据 ========== // 计算分卷 @@ -892,11 +904,13 @@ export default { // 延时关闭弹窗 setTimeout(() => { this.closeDialog(); + this.abnormalCutLoading = false; }, 1000); } catch (error) { console.error('异常截卷操作失败:', error); this.$message.error('异常截卷操作失败:' + error.message); + this.abnormalCutLoading = false; } }, @@ -1182,12 +1196,15 @@ export default { // this.$message.error(this.labels.rollQtyMustMoreTanZeroAndBeInteger); // return false; // } + // 开启loading + this.yieldReportLoading = true; //校验是否继续 checkCreateSplitSfdcRoll(this.pageData) .then(({data}) => { //判断是否成功 if (data.code == 500) { this.$message.error(data.msg); + this.yieldReportLoading = false; } else if (data.resultMap.resultCode == '201') { //打开异常原因录入的界面 this.$confirm(data.resultMap.resultMsg, '提示', { @@ -1197,10 +1214,14 @@ export default { }).then(() => { //执行切换卷的操作 this.createSeparateRolllOperation(); + }).catch(() => { + this.yieldReportLoading = false; }); } else { //执行切换卷的操作 this.createSeparateRolllOperation(); } + }).catch(() => { + this.yieldReportLoading = false; }); }, @@ -1208,6 +1229,7 @@ export default { async createSeparateRolllOperation() { // 验证排数据 if (!this.validateRowData()) { + this.yieldReportLoading = false; return false } @@ -1310,10 +1332,12 @@ export default { setTimeout(() =>{ //关闭当前的页面 this.closeDialog() + this.yieldReportLoading = false; }, 1000) } catch (error) { this.$message.error('创建分卷失败: ' + error.message) + this.yieldReportLoading = false; } },