From 6dc991a3c60da2c1c9070a4dc3cd469e8fefe1d0 Mon Sep 17 00:00:00 2001 From: jiayang yue Date: Thu, 24 Apr 2025 14:52:19 +0800 Subject: [PATCH] 2025.04.24 IPQC\FQAS --- src/api/qc/qc.js | 1 + src/views/modules/qc/FQASResultEntry.vue | 476 ++++++++++++++++++++++- src/views/modules/qc/IPQCResultEntry.vue | 21 +- src/views/modules/qc/IQCResultEntry.vue | 28 ++ 4 files changed, 524 insertions(+), 2 deletions(-) diff --git a/src/api/qc/qc.js b/src/api/qc/qc.js index bd96b22..91c4be9 100644 --- a/src/api/qc/qc.js +++ b/src/api/qc/qc.js @@ -185,6 +185,7 @@ export const saveFQASSubmitResult = data => createAPI(`/pms/qc/saveFQASSubmitRes export const fqasRecordDelete = data => createAPI(`/pms/qc/fqasRecordDelete`,'post',data) export const fqasRecordOverLoad = data => createAPI(`/pms/qc/fqasRecordOverLoad`,'post',data) export const batchSaveIQCDetailedRecord = data => createAPI(`/pms/qc/batchSaveIQCDetailedRecord`,'post',data) +export const batchSaveFQASDetailedRecord = data => createAPI(`/pms/qc/batchSaveFQASDetailedRecord`,'post',data) export const changeInspectionWay = data => createAPI(`/pms/qc/changeInspectionWay`,'post',data) // ============================================= OQC ==================================================== diff --git a/src/views/modules/qc/FQASResultEntry.vue b/src/views/modules/qc/FQASResultEntry.vue index 0f27e71..c892986 100644 --- a/src/views/modules/qc/FQASResultEntry.vue +++ b/src/views/modules/qc/FQASResultEntry.vue @@ -98,6 +98,7 @@ 审核 删除 任务重载 + 批量合格处理 + + + + + 工作文件 + + + 明细导入 + + + 人员同步应用 + + + +
+ + + + + + + + + + + + + + + + + +
+
+ +
+ + + + + + + + + + + + + + + + + +
+
+
+
+ + 保存 + 关闭 + +
+ @@ -674,6 +835,7 @@ import qcFAIUploadFile from "./qc_FAI_upload_file" import comQcItemImageUploadFile from "./com_qc_itemImage_upload_file" import subDetailUpload from "./sub_detail_upload" + import {batchSaveFQASDetailedRecord} from "../../../api/qc/qc"; export default { components: { Chooselist, @@ -790,6 +952,105 @@ isQualified:'', isQualifiedChinese:'' }, + batchInformationFlag: false, + batchDetailList: [], + batchInformationTable: 'batchInfo', + batchColumnList: [ + { + columnProp: 'inspectionNo', + headerAlign: "center", + align: "center", + columnLabel: '检验单号', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 120, + }, + { + columnProp: 'partNo', + headerAlign: "center", + align: "center", + columnLabel: '物料编码', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 120, + }, + { + columnProp: 'partDesc', + headerAlign: "center", + align: "left", + columnLabel: '物料名称', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 200, + }, + { + columnProp: 'rollQty', + headerAlign: "center", + align: "right", + columnLabel: '到货数量', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 80, + }, + { + columnProp: 'rollCount', + headerAlign: "center", + align: "right", + columnLabel: '送检数量', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 80, + }, + { + columnProp: 'samplingQty', + headerAlign: "center", + align: "right", + columnLabel: '抽样数量', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 80, + }, + // { + // columnProp: 'passQty', + // headerAlign: "center", + // align: "right", + // columnLabel: '合格数量', + // columnHidden: false, + // columnImage: false, + // columnSortable: false, + // sortLv: 0, + // status: true, + // fixed: '', + // columnWidth: 80, + // }, + ], + batchIndex: '', + personnelSynchronizationFlag: true, + batchLoading: false, // 展示列集 // columnList1: [], columnList1: [ @@ -1988,7 +2249,7 @@ this.detailData.operator = this.detailData.operator.substring(1) this.detailData.operatorName = this.detailData.operatorName.substring(1) } - } else { + } else if (this.operatorData.flag === '2') { for (let i = 0; i < this.dataListSelections2.length; i++) { if (!this.detailData.responsiblePerson.split(';').includes(this.dataListSelections2[i].adminID)) { this.detailData.responsiblePersonName = this.detailData.responsiblePersonName + ";" + this.dataListSelections2[i].adminName @@ -1999,6 +2260,50 @@ this.detailData.responsiblePerson = this.detailData.responsiblePerson.substring(1) this.detailData.responsiblePersonName = this.detailData.responsiblePersonName.substring(1) } + } else if (this.operatorData.flag === '3') { + for (let i = 0; i < this.dataListSelections2.length; i++) { + if (!this.FQASSelections[this.batchIndex].operator.split(';').includes(this.dataListSelections2[i].adminID)) { + this.FQASSelections[this.batchIndex].operatorName = this.FQASSelections[this.batchIndex].operatorName + ";" + this.dataListSelections2[i].adminName + this.FQASSelections[this.batchIndex].operator = this.FQASSelections[this.batchIndex].operator + ";" + this.dataListSelections2[i].adminID + } + } + if (this.FQASSelections[this.batchIndex].operator.charAt(0) === ';') { + this.FQASSelections[this.batchIndex].operator = this.FQASSelections[this.batchIndex].operator.substring(1) + this.FQASSelections[this.batchIndex].operatorName = this.FQASSelections[this.batchIndex].operatorName.substring(1) + + // 如果是人员同步且有多条数据需要同步 那么就将其他数据的人员也同步 + if (this.personnelSynchronizationFlag && this.FQASSelections.length > 1) { + // 拿到除了this.batchIndex的所有数据 + let tempData = this.FQASSelections.filter((item, index) => index !== this.batchIndex) + // 遍历数据 + tempData.forEach(item => { + this.$set(item, 'operator', this.FQASSelections[this.batchIndex].operator) + this.$set(item, 'operatorName', this.FQASSelections[this.batchIndex].operatorName) + }) + } + } + } else if (this.operatorData.flag === '4') { + for (let i = 0; i < this.dataListSelections2.length; i++) { + if (!this.FQASSelections[this.batchIndex].responsiblePerson.split(';').includes(this.dataListSelections2[i].adminID)) { + this.FQASSelections[this.batchIndex].responsiblePersonName = this.FQASSelections[this.batchIndex].responsiblePersonName + ";" + this.dataListSelections2[i].adminName + this.FQASSelections[this.batchIndex].responsiblePerson = this.FQASSelections[this.batchIndex].responsiblePerson + ";" + this.dataListSelections2[i].adminID + } + } + if (this.FQASSelections[this.batchIndex].responsiblePerson.charAt(0) === ';') { + this.FQASSelections[this.batchIndex].responsiblePerson = this.FQASSelections[this.batchIndex].responsiblePerson.substring(1) + this.FQASSelections[this.batchIndex].responsiblePersonName = this.FQASSelections[this.batchIndex].responsiblePersonName.substring(1) + + // 如果是人员同步且有多条数据需要同步 那么就将其他数据的人员也同步 + if (this.personnelSynchronizationFlag && this.FQASSelections.length > 1) { + // 拿到除了this.batchIndex的所有数据 + let tempData = this.FQASSelections.filter((item, index) => index !== this.batchIndex) + // 遍历数据 + tempData.forEach(item => { + this.$set(item, 'responsiblePerson', this.FQASSelections[this.batchIndex].responsiblePerson) + this.$set(item, 'responsiblePersonName', this.FQASSelections[this.batchIndex].responsiblePersonName) + }) + } + } } this.operatorData = { flag: '', @@ -2088,6 +2393,146 @@ }) }, + batchQualifiedModal () { + if (this.FQASSelections.length === 0) { + this.$message.warning('请勾选要批量处理的检验单!') + return + } + // 判断检验单状态 + if (this.FQASSelections.every(val => val.state === '待检验')) { + // 校验检验明细 + if (this.FQASSelections.some(val => val.templateId == null || val.templateId === '')) { + this.$message.warning('检验单不存在检验明细!') + return + } + // 校验模板和供应商 + // 获取第一个对象的属性值作为参考 + const firstItem = this.FQASSelections[0] + const firstTemplateId = firstItem.templateId + const firstSupplierNo = firstItem.supplierNo + if (!this.FQASSelections.every(item => item.templateId === firstTemplateId)) { + this.$message.warning('所选检验单模板和供应商必须一致!') + return + } + this.FQASSelections.forEach((item, index) => { + this.$set(this.FQASSelections[index], 'inspectorNo', this.$store.state.user.name) + }) + this.detailModal2(this.FQASSelections[0]) + this.personnelSynchronizationFlag = true + } else { + this.$message.warning('检验单必须为待检验状态!') + return + } + }, + + // 获取协同人员列表 + batchGetOperatorList (index) { + this.operatorData.flag = '3' + this.operatorData.bu = this.FQASSelections[index].site + '_' + this.FQASSelections[index].buNo + if (this.roleList.length > 0) { + let filterList = this.roleList.filter(item => item.roleName === '机修人员') + if (filterList.length > 0) { + this.operatorData.roleId = filterList[0].roleId + } else { + this.operatorData.roleId = this.roleList[0].roleId + } + } else { + this.operatorData.roleId = '' + } + // 先清空缓存选中 + this.$nextTick(() => this.$refs.operatorTable.clearSelection()) + // 拿到选中的人员编号 + let tempDataList = (this.FQASSelections[index].operator == null ? '' : this.FQASSelections[index].operator).split(';') + getOperatorList(this.operatorData).then(({data}) => { + if (data && data.code === 0) { + this.operatorList = data.rows + this.operatorList.forEach(val => { + // 回显选中 + if (tempDataList.includes(val.adminID)) { + this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true)) + } + }) + this.batchIndex = index + this.operatorModelFlag = true + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + + // 获取责任人列表 + batchGetResponsiblePersonList (index) { + this.operatorData.flag = '4' + this.operatorData.bu = this.FQASSelections[index].site + '_' + this.FQASSelections[index].buNo + if (this.roleList.length > 0) { + let filterList = this.roleList.filter(item => item.roleName === '系统管理员') + if (filterList.length > 0) { + this.operatorData.roleId = filterList[0].roleId + } else { + this.operatorData.roleId = this.roleList[0].roleId + } + } else { + this.operatorData.roleId = '' + } + // 先清空缓存选中 + this.$nextTick(() => this.$refs.operatorTable.clearSelection()) + // 拿到选中的人员编号 + let tempDataList = (this.FQASSelections[index].responsiblePerson == null ? '' : this.FQASSelections[index].responsiblePerson).split(';') + getOperatorList(this.operatorData).then(({data}) => { + if (data && data.code === 0) { + this.operatorList = data.rows + this.operatorList.forEach(val => { + // 回显选中 + if (tempDataList.includes(val.adminID)) { + this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true)) + } + }) + this.batchIndex = index + this.operatorModelFlag = true + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + + // 保存批量合格信息 + batchSave () { + this.$confirm(`确认保存检验数据?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + let tempData = { + submitList: JSON.parse(JSON.stringify(this.FQASSelections)), + itemList: JSON.parse(JSON.stringify(this.batchDetailList)) + } + this.batchLoading = true + batchSaveFQASDetailedRecord(tempData).then(({data}) => { + if (data && data.code === 0) { + this.getDataList() + this.batchInformationFlag = false + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + this.batchLoading = false + }).catch(()=>{ + this.batchLoading = false + }) + }) + }, + // 单机选中 FQASClickRow (row) { this.currentRow = JSON.parse(JSON.stringify(row)) @@ -2515,6 +2960,35 @@ this.detailInformationFlag = true }, + detailModal2 (row) { + this.detailData.site = row.site + this.detailData.buNo = row.buNo + this.detailData.inspectionNo = row.inspectionNo + this.detailData.partNo = row.partNo + this.detailData.partDesc = row.partDesc + this.detailData.rollQty = row.rollQty + this.detailData.samplingQty = row.samplingQty + this.detailData.unqualifiedQty = row.unqualifiedQty + this.detailData.unqualifiedQuantity = row.unqualifiedQuantity + this.detailData.submitFlag = row.submitFlag + this.detailData.disposalMeasures = row.disposalMeasures + this.detailData.disposalRemark = row.disposalRemark + this.detailData.inspectionResult = row.inspectionResult + this.detailData.inspectorNo = row.inspectorNo + this.detailData.inspectionRemark = row.inspectionRemark + this.detailData.umId = row.umId + this.detailData.rollCount = row.rollCount + fqasDetailSearch(this.detailData).then(({data}) => { + if (data && data.code === 0) { + this.batchDetailList = data.rows + this.batchInformationTable = 'batchInfo' + this.batchInformationFlag = true + } else { + this.$message.warning('未查到检验单明细信息!') + } + }) + }, + // 检验单明细 getInspectionFormData () { fqasDetailSearch(this.detailData).then(({data}) => { diff --git a/src/views/modules/qc/IPQCResultEntry.vue b/src/views/modules/qc/IPQCResultEntry.vue index 49485df..05a9d4e 100644 --- a/src/views/modules/qc/IPQCResultEntry.vue +++ b/src/views/modules/qc/IPQCResultEntry.vue @@ -62,7 +62,14 @@ - + + + + @@ -942,6 +949,7 @@ import qcFAIUploadFile from "./qc_FAI_upload_file" import comQcItemImageUploadFile from "./com_qc_itemImage_upload_file" import subDetailUpload from "./sub_detail_upload"; + import {getWorkCenterData} from "../../../api/base/site"; /*上传文件的組件*/ export default { components: { @@ -1017,6 +1025,7 @@ exportFooter: [], exportList: [], // 导出 end + workCenterList: [], checkCompletedData:{ inspectionNo: '' }, @@ -2449,6 +2458,8 @@ this.inspectionTypeSearch() // 处置措施 this.disposalMeasuresSearch() + // 获取加工中心 + this.getWorkCenterList() // 单位 this.umSearch() // 查看 质量任务生成规则控制 动控是否开启 @@ -4040,6 +4051,14 @@ }) }, + getWorkCenterList(){ + getWorkCenterData().then(({data}) => { + if (data.code === 0) { + this.workCenterList = data.rows + } + }) + }, + // 收藏 OR 取消收藏 favoriteFunction () { let userFavorite = { diff --git a/src/views/modules/qc/IQCResultEntry.vue b/src/views/modules/qc/IQCResultEntry.vue index 2486590..167e6cb 100644 --- a/src/views/modules/qc/IQCResultEntry.vue +++ b/src/views/modules/qc/IQCResultEntry.vue @@ -612,6 +612,9 @@ 明细导入 + + 人员同步应用 +
@@ -848,6 +851,7 @@ import qcFAIUploadFile from "./qc_FAI_upload_file" import comQcItemImageUploadFile from "./com_qc_itemImage_upload_file" import subDetailUpload from "./sub_detail_upload" + import {getWorkCenterData} from "../../../api/base/site"; export default { components: { Chooselist, @@ -907,6 +911,7 @@ }, tagNo:'', tagType: '', + personnelSynchronizationFlag: true, searchData: { site: '', userName: this.$store.state.user.name, @@ -2194,6 +2199,7 @@ this.$set(this.IQCSelections[index], 'inspectorNo', this.$store.state.user.name) }) this.detailModal2(this.IQCSelections[0]) + this.personnelSynchronizationFlag = true } else { this.$message.warning('检验单必须为待检验状态!') return @@ -2573,6 +2579,17 @@ if (this.IQCSelections[this.batchIndex].operator.charAt(0) === ';') { this.IQCSelections[this.batchIndex].operator = this.IQCSelections[this.batchIndex].operator.substring(1) this.IQCSelections[this.batchIndex].operatorName = this.IQCSelections[this.batchIndex].operatorName.substring(1) + + // 如果是人员同步且有多条数据需要同步 那么就将其他数据的人员也同步 + if (this.personnelSynchronizationFlag && this.IQCSelections.length > 1) { + // 拿到除了this.batchIndex的所有数据 + let tempData = this.IQCSelections.filter((item, index) => index !== this.batchIndex) + // 遍历数据 + tempData.forEach(item => { + this.$set(item, 'operator', this.IQCSelections[this.batchIndex].operator) + this.$set(item, 'operatorName', this.IQCSelections[this.batchIndex].operatorName) + }) + } } } else if (this.operatorData.flag === '4') { for (let i = 0; i < this.dataListSelections2.length; i++) { @@ -2584,6 +2601,17 @@ if (this.IQCSelections[this.batchIndex].responsiblePerson.charAt(0) === ';') { this.IQCSelections[this.batchIndex].responsiblePerson = this.IQCSelections[this.batchIndex].responsiblePerson.substring(1) this.IQCSelections[this.batchIndex].responsiblePersonName = this.IQCSelections[this.batchIndex].responsiblePersonName.substring(1) + + // 如果是人员同步且有多条数据需要同步 那么就将其他数据的人员也同步 + if (this.personnelSynchronizationFlag && this.IQCSelections.length > 1) { + // 拿到除了this.batchIndex的所有数据 + let tempData = this.IQCSelections.filter((item, index) => index !== this.batchIndex) + // 遍历数据 + tempData.forEach(item => { + this.$set(item, 'responsiblePerson', this.IQCSelections[this.batchIndex].responsiblePerson) + this.$set(item, 'responsiblePersonName', this.IQCSelections[this.batchIndex].responsiblePersonName) + }) + } } } this.operatorData = {