From 3c12c78290488e8be95632c5c8b6c39c353e8f92 Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Thu, 24 Apr 2025 10:36:38 +0800 Subject: [PATCH] =?UTF-8?q?2025-04-24=20=E6=B4=BE=E5=B7=A5=E5=8D=95?= =?UTF-8?q?=E7=94=9F=E6=88=90=E6=A3=80=E9=AA=8C=E4=BB=BB=E5=8A=A1=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E7=94=9F=E6=88=90=20IPQC=E4=BB=BB=E5=8A=A1=E7=9A=84?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=8A=A0=E4=B8=80=E4=B8=AA=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E9=87=8D=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/qc/qc.js | 3 +- src/views/modules/qc/DoInspectionBySeqNo.vue | 201 ++++++++++++++++--- src/views/modules/qc/IPQCResultEntry.vue | 75 +++++-- 3 files changed, 231 insertions(+), 48 deletions(-) diff --git a/src/api/qc/qc.js b/src/api/qc/qc.js index bd96b22..0d04f26 100644 --- a/src/api/qc/qc.js +++ b/src/api/qc/qc.js @@ -143,8 +143,9 @@ export const rollNoEnter = data => createAPI(`/pms/qc/rollNoEnter`,'post',data) export const boxNoEnter = data => createAPI(`/pms/qc/boxNoEnter`,'post',data) export const queryPartList = data => createAPI(`/pms/qc/queryPartList`,'post',data) export const umSearch = data => createAPI(`/pms/qc/umSearch`,'post',data) - export const getShiftList = data => createAPI(`/pms/qc/getShiftList`,'post',data) +export const batchSaveOsInspection = data => createAPI(`/pms/qc/batchSaveOsInspection`,'post',data) +export const ipqcRecordOverLoad = data => createAPI(`/pms/qc/ipqcRecordOverLoad`,'post',data) // ===================================== IQC检验 ===================================== export const qcIQCInspectionSearch = data => createAPI(`/pms/qc/qcIQCInspectionSearch`,'post',data) diff --git a/src/views/modules/qc/DoInspectionBySeqNo.vue b/src/views/modules/qc/DoInspectionBySeqNo.vue index ed807a7..e88718b 100644 --- a/src/views/modules/qc/DoInspectionBySeqNo.vue +++ b/src/views/modules/qc/DoInspectionBySeqNo.vue @@ -75,6 +75,7 @@ 查询 + 批量生成检验任务 @@ -85,7 +86,14 @@ border :row-style="rowStyle" @row-click="clickRow" + @selection-change="selectionOrder" style="width: 100%;"> + + - + - - - - + 机台 @@ -226,6 +227,55 @@ + + + + + + + {{ i.sitename }} + + {{ i.buDesc }} + + + + + + + + + + + + + + + + 重点检验 + + + + + 检验模板 + 检验模板 + + + + + + + + + + 保存 + 关闭 + + +
@@ -275,13 +325,13 @@ import { getSiteAndBuByUserName, // 获取site、bu searchSeqInfo2, // 派工单号查询 - getOperationList, // 查询工序列表 umSearch, // 查询单位列表 queryController, // 检查动控 queryTemplateList, // 获取检验模板列表 saveOsInspection, // 新增检验记录 inspectionTypeSearch, // 搜索所有检验类型 getShiftList, // 获取班次 + batchSaveOsInspection, // 批量新增检验记录 } from "@/api/qc/qc.js" import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js' @@ -322,6 +372,7 @@ height: 200, dataList: [], modalFlag: false, + batchModalFlag: false, modalDisableFlag: false, modalData: { flag: '', @@ -356,78 +407,113 @@ createBy: '', importantFlag: '' }, + batchModalData: { + flag: '', + bu: '', + inspectionTypeNo: '', + inspectionTypeName: '', + specialRequirements: '', + templateId: '', + templateName: '', + createBy: '', + importantFlag: '', + submitList: [] + }, rules: { seqNoType: [ { required: true, message: ' ', - trigger: 'change' + trigger: ['blur','change'] } ], orderNoType: [ { required: true, message: ' ', - trigger: 'change' + trigger: ['blur','change'] } ], operationDescType: [ { required: true, message: ' ', - trigger: 'change' + trigger: ['blur','change'] } ], resourceIdType: [ { required: true, message: ' ', - trigger: 'change' + trigger: ['blur','change'] } ], rollQtyType: [ { required: true, message: ' ', - trigger: 'change' + trigger: ['blur','change'] } ], inspectionTypeNoType: [ { required: true, message: ' ', - trigger: 'change' + trigger: ['blur','change'] } ], partNoType: [ { required: true, message: ' ', - trigger: 'change' + trigger: ['blur','change'] } ], umIdType: [ { required: true, message: ' ', - trigger: 'change' + trigger: ['blur','change'] } ], templateId: [ { required: true, message: ' ', - trigger: 'change' + trigger: ['blur','change'] } ], bu:[ { required: true, message: ' ', - trigger: 'change' + trigger: ['blur','change'] } ] }, + batchRules: { + bu: [ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + inspectionTypeNo: [ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + templateId: [ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + }, templateData: { site: '', bu: '', @@ -855,7 +941,6 @@ fixed: '', }, ], - operationList: [], userBuList: [], umList: [], templateList: [], @@ -869,6 +954,7 @@ typeOptions: [], currentRow: {}, shiftList: [], + orderSelections: [] } }, @@ -1033,7 +1119,6 @@ createBy: this.$store.state.user.name, importantFlag: '' } - this.getOperationList() this.modalDisableFlag = false this.modalFlag = true this.checked = false @@ -1081,7 +1166,6 @@ saveOsInspection(this.modalData).then(({data}) => { if (data && data.code === 0) { this.getDataList() - this.operationList = [] this.modalFlag = false // 跳转IPQC任务 this.checkOutToIPQC(data.no) @@ -1096,14 +1180,55 @@ }) }, - // 获取工序列表 - getOperationList () { - getOperationList(this.modalData).then(({data}) => { + // 生成检验任务 + batchDoInspectionModal () { + if (this.orderSelections.length === 0) { + this.$message.warning('请勾选单据!') + return + } + if (!this.orderSelections.every(item => item.workCenterNo === this.orderSelections[0].workCenterNo)) { + this.$message.warning('所选单据的加工中心必须相同!') + return + } + this.batchModalData = { + flag: 'doInspection', + bu: this.userBuList[0].buNo, + inspectionTypeNo: '', + inspectionTypeName: '', + templateId: '', + templateName: '', + createBy: this.$store.state.user.name, + importantFlag: '', + specialRequirements: '', + submitList: [] + } + this.batchModalFlag = true + }, + + // 批量新增IPQC巡检记录 + batchSaveData () { + if (this.batchModalData.bu === '' || this.batchModalData.bu == null) { + this.$message.warning('请选择BU!') + return + } + if (this.controlData.baseData === '控制' && (this.batchModalData.templateId == null || this.batchModalData.templateId === '')) { + this.$message.warning('请选择检验模板!') + return + } + this.batchModalData.submitList = this.orderSelections + this.saveLoading = true + batchSaveOsInspection(this.batchModalData).then(({data}) => { if (data && data.code === 0) { - this.operationList = data.rows + this.getDataList() + this.batchModalFlag = false } else { - this.operationList = [] + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) } + this.saveLoading = false + }).catch(()=>{ + this.saveLoading = false }) }, @@ -1123,7 +1248,11 @@ // 获取检验模板列表 queryTemplateList () { - this.templateData.bu = this.modalData.bu + if (this.batchModalFlag) { + this.templateData.bu = this.batchModalData.bu + } else { + this.templateData.bu = this.modalData.bu + } // 查询所有检验模板 queryTemplateList(this.templateData).then(({data}) => { if (data && data.code === 0) { @@ -1135,10 +1264,20 @@ }) }, + // 复选 + selectionOrder (val) { + this.orderSelections = val + }, + // 选中检验模板 getRowData (row) { - this.modalData.templateId = row.templateId - this.modalData.templateName = row.templateName + if (this.batchModalFlag) { + this.batchModalData.templateId = row.templateId + this.batchModalData.templateName = row.templateName + } else { + this.modalData.templateId = row.templateId + this.modalData.templateName = row.templateName + } this.templateModelFlag = false }, diff --git a/src/views/modules/qc/IPQCResultEntry.vue b/src/views/modules/qc/IPQCResultEntry.vue index 49485df..1793e33 100644 --- a/src/views/modules/qc/IPQCResultEntry.vue +++ b/src/views/modules/qc/IPQCResultEntry.vue @@ -105,6 +105,7 @@ 新增 审核 删除 + 任务重载 val.state === '待检验' || val.state === '未开始')) { + this.$confirm(`是否重载该 `+ this.IPQCSelections.length +` 条检验单?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + let tempData = { + site: '', + submitList: this.IPQCSelections + } + this.overLoading = true + ipqcRecordOverLoad(tempData).then(({data}) => { + if (data && data.code === 0) { + this.getDataList() + this.IPQCSelections = [] + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + this.overLoading = false + } else { + this.overLoading = false + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }).catch(() => { + this.overLoading = false + }) + }) + } else { + this.$message.warning('检验单必须为待检验状态!') + return + } + }, + Transfer () { if (this.detailData.inspectionResult === '' || this.detailData.inspectionResult == null) { this.$message.warning('请选择检验结论!')