diff --git a/src/api/qc/qc.js b/src/api/qc/qc.js index a5d9cd7..d5ef199 100644 --- a/src/api/qc/qc.js +++ b/src/api/qc/qc.js @@ -82,8 +82,17 @@ export const saveAttributeDetailed = data => createAPI(`/pms/qc/saveAttributeDet export const uploadPartAttributeExcel = data => createAPI(`/pms/qc/uploadPartAttributeExcel`,'post',data) export const getOperationDescList = data => createAPI(`/pms/qc/getOperationDescList`,'post',data) export const getManufacturerList = data => createAPI(`/pms/qc/getManufacturerList`,'post',data) +export const getCustomerList = data => createAPI(`/pms/qc/getCustomerList`,'post',data) export const getPartTemplateLists = data => createAPI(`/pms/qc/getPartTemplateLists`,'post',data) export const qcPartAttributeEdit = data => createAPI(`/pms/qc/qcPartAttributeEdit`,'post',data) + +// IPQC 巡检特殊配置(按工序) +export const getPatrolConfigList = data => createAPI(`/pms/qc/getPatrolConfigList`, 'post', data) +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 getPatrolOperationDescList = data => createAPI(`/pms/qc/getPatrolOperationDescList`, 'post', data) +export const patrolConfigUpload = data => createAPI(`/pms/qc/patrolConfigUpload`, 'post', data) export const overLoadSearchPartInfo = data => createAPI(`/pms/qc/overLoadSearchPartInfo`,'post',data) export const partAttrDetailedSearch = data => createAPI(`/pms/qc/partAttrDetailedSearch`,'post',data) export const getPartAttrItemList = data => createAPI(`/pms/qc/getPartAttrItemList`,'post',data) @@ -249,6 +258,32 @@ export const goUpItemQC = data => createAPI(`/pms/qc/goUpItemQC`,'post',data) export const goDownItemQC = data => createAPI(`/pms/qc/goDownItemQC`,'post',data) export const cancelApproval2 = data => createAPI(`/pms/qc/cancelApproval2`,'post',data) +// ===================================== OQC / FQAS(OQCResultEntry) ===================================== +export const qcOQCInspectionSearch = data => createAPI(`/pms/qc/qcOQCInspectionSearch`,'post',data) +export const fqasDetailSearch = data => createAPI(`/pms/qc/fqasDetailSearch`,'post',data) +export const selectFQASSubDetailedRecord = data => createAPI(`/pms/qc/selectFQASSubDetailedRecord`,'post',data) +export const saveFQASDetailedRecord = data => createAPI(`/pms/qc/saveFQASDetailedRecord`,'post',data) +export const checkFQASIsSubmit = data => createAPI(`/pms/qc/checkFQASIsSubmit`,'post',data) +export const saveFQASSubDetailed = data => createAPI(`/pms/qc/saveFQASSubDetailed`,'post',data) +export const saveFQASSubmitResult = data => createAPI(`/pms/qc/saveFQASSubmitResult`,'post',data) +export const cancelFQASSubmitResult = data => createAPI(`/pms/qc/cancelFQASSubmitResult`,'post',data) +export const fqasRecordDelete = data => createAPI(`/pms/qc/fqasRecordDelete`,'post',data) +export const fqasRecordOverLoad = data => createAPI(`/pms/qc/fqasRecordOverLoad`,'post',data) +export const actionFQASInspection = data => createAPI(`/pms/qc/actionFQASInspection`,'post',data) +export const changeInspectionWay = data => createAPI(`/pms/qc/changeInspectionWay`,'post',data) +export const getFileContentList2 = data => createAPI('sys/file/getFileContentList2','post',data) +export const downLoadObjectFile = data => createAPI(`pms/eamObject/downLoadObjectFile?id=`+data.id,'post',777) +export const deleteObjectFile = data => createAPI(`/pms/qc/deleteObjectFile`,'post',data) +export const getUserRoleList = data => createAPI(`/pms/qc/getUserRoleList`,'post',data) +export const getOperatorList = data => createAPI(`/pms/qc/getOperatorList`,'post',data) +export const searchQcSopFileList = data => createAPI(`/pms/qc/searchQcSopFileList`,'post',data) +export const downloadSopFile = sopUrl => createAPI(`/pms/qc/downloadSopFile?sopUrl=${encodeURIComponent(sopUrl)}`,'post', 777) +export const getOQCItemList = data => createAPI(`/pms/qc/getOQCItemList`,'post',data) +export const addOQCItemDetails = data => createAPI(`/pms/qc/addOQCItemDetails`,'post',data) +export const deleteOQCItemDetails = data => createAPI(`/pms/qc/deleteOQCItemDetails`,'post',data) +export const getOQCTemplateList = data => createAPI(`/pms/qc/getOQCTemplateList`,'post',data) +export const importOQCTemplateItems = data => createAPI(`/pms/qc/importOQCTemplateItems`,'post',data) + // ===================================== SQC取消审核 ===================================== export const cancelSQCApproval = data => createAPI(`/pms/qc/cancelSQCApproval`,'post',data) diff --git a/src/views/modules/qc/FAIResultEntry.vue b/src/views/modules/qc/FAIResultEntry.vue index 3f8f6c8..3490c54 100644 --- a/src/views/modules/qc/FAIResultEntry.vue +++ b/src/views/modules/qc/FAIResultEntry.vue @@ -144,7 +144,12 @@ :min-width="item.columnWidth" :label="item.columnLabel"> @@ -451,7 +456,12 @@ :min-width="item.columnWidth" :label="item.columnLabel"> @@ -520,8 +530,8 @@ 应用 - 保存 关闭 + 保存 @@ -574,6 +584,15 @@ :fixed="item.fixed==''?false:item.fixed" :min-width="item.columnWidth" :label="item.columnLabel"> + @@ -718,7 +737,12 @@ :min-width="item.columnWidth" :label="item.columnLabel"> @@ -766,7 +790,12 @@ :min-width="item.columnWidth" :label="item.columnLabel"> @@ -839,7 +868,12 @@ :min-width="item.columnWidth" :label="item.columnLabel"> @@ -870,7 +904,12 @@ :min-width="item.columnWidth" :label="item.columnLabel"> @@ -1748,6 +1787,24 @@ export default { fixed: '', columnWidth: 120, }, + { + userId: this.$store.state.user.name, + functionId: 301006, + serialNumber: '301006Table2ObjectDesc', + tableId: "301006Table2", + tableName: "检验单明细表", + columnProp: 'pictureFlag', + headerAlign: "center", + align: "center", + columnLabel: '图片是否必填', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 120, + }, { userId: this.$store.state.user.name, functionId: 301007, @@ -3320,17 +3377,31 @@ export default { // 上传项目图片 uploadImageModal (row) { - let currentData = { - site: this.detailData.site, - buNo: this.detailData.buNo, - createBy: this.$store.state.user.name, - inspectionNo: this.detailData.inspectionNo, - itemNo: row.itemNo, - folder: 'FAIItemImageFile' + const openImage = () => { + let currentData = { + site: this.detailData.site, + buNo: this.detailData.buNo, + createBy: this.$store.state.user.name, + inspectionNo: this.detailData.inspectionNo, + itemNo: row.itemNo, + folder: 'FAIItemImageFile' + } + this.$nextTick(() => { + this.$refs.comQcItemImageUploadFile.init(currentData) + }) } - //打开组件 去做新增业务 - this.$nextTick(() => { - this.$refs.comQcItemImageUploadFile.init(currentData) + if (this.detailData.state !== '待检验') { + openImage() + return + } + if (this.detailData.passQty > this.detailData.rollQty) { + this.$message.warning('合格数量不能大于送检数量!') + return + } + this.saveDetailInformation('1', { + keepDetailOpen: true, + skipSuccessMessage: true, + afterSuccess: openImage }) }, @@ -3472,6 +3543,13 @@ export default { this.detailData.disposalMeasures = '' this.detailData.disposalRemark = '' } + const picRequiredRow = this.detailList.find( + item => item.pictureFlag === 'Y' && !(Number(item.imageDetailNum) > 0) + ) + if (picRequiredRow) { + this.$message.warning(`项目编码:${picRequiredRow.itemNo || ''}图片必填,请检查!`) + return + } } if (this.detailData.passQty>this.detailData.rollQty){ this.$message.warning('合格数量不能大于送检数量!') @@ -3481,7 +3559,8 @@ export default { }, // 新增明细信息 - saveDetailInformation (type) { + saveDetailInformation (type, options = {}) { + const keepDetailOpen = options.keepDetailOpen === true this.saveInformationData.site = this.detailData.site this.saveInformationData.buNo = this.detailData.buNo this.saveInformationData.inspectionNo = this.detailData.inspectionNo @@ -3507,13 +3586,28 @@ export default { saveFAIDetailedRecord(this.saveInformationData).then(({data}) => { if (data && data.code === 0) { this.getDataList() - this.detailInformationFlag = false - this.$message({ - message: '操作成功', - type: 'success', - duration: 1500, - onClose: () => {} - }) + if (keepDetailOpen) { + this.getInspectionFormData() + if (!options.skipSuccessMessage) { + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } + } else { + this.detailInformationFlag = false + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } + if (typeof options.afterSuccess === 'function') { + options.afterSuccess() + } } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' diff --git a/src/views/modules/qc/FQCResultEntry.vue b/src/views/modules/qc/FQCResultEntry.vue index ad5d16f..9f4b86c 100644 --- a/src/views/modules/qc/FQCResultEntry.vue +++ b/src/views/modules/qc/FQCResultEntry.vue @@ -144,7 +144,12 @@ :min-width="item.columnWidth" :label="item.columnLabel"> @@ -431,7 +436,12 @@ :min-width="item.columnWidth" :label="item.columnLabel"> @@ -500,8 +510,8 @@ 应用 - 保存 关闭 + 保存 @@ -632,7 +642,12 @@ :min-width="item.columnWidth" :label="item.columnLabel"> @@ -680,7 +695,12 @@ :min-width="item.columnWidth" :label="item.columnLabel"> @@ -753,6 +773,15 @@ :fixed="item.fixed==''?false:item.fixed" :min-width="item.columnWidth" :label="item.columnLabel"> + @@ -810,7 +839,12 @@ :min-width="item.columnWidth" :label="item.columnLabel"> @@ -841,7 +875,12 @@ :min-width="item.columnWidth" :label="item.columnLabel"> @@ -1718,6 +1757,24 @@ fixed: '', columnWidth: 120, }, + { + userId: this.$store.state.user.name, + functionId: 301006, + serialNumber: '301006Table2ObjectDesc', + tableId: "301006Table2", + tableName: "检验单明细表", + columnProp: 'pictureFlag', + headerAlign: "center", + align: "center", + columnLabel: '图片是否必填', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 120, + }, { userId: this.$store.state.user.name, functionId: 301015, @@ -3284,17 +3341,31 @@ // 上传项目图片 uploadImageModal (row) { - let currentData = { - site: this.detailData.site, - buNo: this.detailData.buNo, - createBy: this.$store.state.user.name, - inspectionNo: this.detailData.inspectionNo, - itemNo: row.itemNo, - folder: 'FQCItemImageFile' + const openImage = () => { + let currentData = { + site: this.detailData.site, + buNo: this.detailData.buNo, + createBy: this.$store.state.user.name, + inspectionNo: this.detailData.inspectionNo, + itemNo: row.itemNo, + folder: 'FQCItemImageFile' + } + this.$nextTick(() => { + this.$refs.comQcItemImageUploadFile.init(currentData) + }) } - //打开组件 去做新增业务 - this.$nextTick(() => { - this.$refs.comQcItemImageUploadFile.init(currentData) + if (this.detailData.state !== '待检验') { + openImage() + return + } + if (this.detailData.passQty > this.detailData.rollQty) { + this.$message.warning('合格数量不能大于送检数量!') + return + } + this.saveDetailInformation('1', { + keepDetailOpen: true, + skipSuccessMessage: true, + afterSuccess: openImage }) }, @@ -3436,6 +3507,13 @@ this.detailData.disposalMeasures = '' this.detailData.disposalRemark = '' } + const picRequiredRow = this.detailList.find( + item => item.pictureFlag === 'Y' && !(Number(item.imageDetailNum) > 0) + ) + if (picRequiredRow) { + this.$message.warning(`项目编码:${picRequiredRow.itemNo || ''}图片必填,请检查!`) + return + } } if (this.detailData.passQty>this.detailData.rollQty){ this.$message.warning('合格数量不能大于送检数量!') @@ -3445,7 +3523,8 @@ }, // 新增明细信息 - saveDetailInformation (type) { + saveDetailInformation (type, options = {}) { + const keepDetailOpen = options.keepDetailOpen === true this.saveInformationData.site = this.detailData.site this.saveInformationData.buNo = this.detailData.buNo this.saveInformationData.inspectionNo = this.detailData.inspectionNo @@ -3471,13 +3550,28 @@ saveFQCDetailedRecord(this.saveInformationData).then(({data}) => { if (data && data.code === 0) { this.getDataList() - this.detailInformationFlag = false - this.$message({ - message: '操作成功', - type: 'success', - duration: 1500, - onClose: () => {} - }) + if (keepDetailOpen) { + this.getInspectionFormData() + if (!options.skipSuccessMessage) { + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } + } else { + this.detailInformationFlag = false + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } + if (typeof options.afterSuccess === 'function') { + options.afterSuccess() + } } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' diff --git a/src/views/modules/qc/IPQCResultEntry.vue b/src/views/modules/qc/IPQCResultEntry.vue index 273596d..fb5c09a 100644 --- a/src/views/modules/qc/IPQCResultEntry.vue +++ b/src/views/modules/qc/IPQCResultEntry.vue @@ -148,7 +148,12 @@ :min-width="item.columnWidth" :label="item.columnLabel"> @@ -443,7 +448,12 @@ :min-width="item.columnWidth" :label="item.columnLabel"> @@ -512,8 +522,8 @@ 应用 - 保存 关闭 + 保存 @@ -643,6 +653,15 @@ :fixed="item.fixed==''?false:item.fixed" :min-width="item.columnWidth" :label="item.columnLabel"> + @@ -710,7 +729,12 @@ :min-width="item.columnWidth" :label="item.columnLabel"> @@ -758,7 +782,12 @@ :min-width="item.columnWidth" :label="item.columnLabel"> @@ -831,7 +860,12 @@ :min-width="item.columnWidth" :label="item.columnLabel"> @@ -862,7 +896,12 @@ :min-width="item.columnWidth" :label="item.columnLabel"> @@ -1763,6 +1802,24 @@ fixed: '', columnWidth: 120, }, + { + userId: this.$store.state.user.name, + functionId: 301006, + serialNumber: '301006Table2ObjectDesc', + tableId: "301006Table2", + tableName: "检验单明细表", + columnProp: 'pictureFlag', + headerAlign: "center", + align: "center", + columnLabel: '图片是否必填', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 120, + }, { userId: this.$store.state.user.name, functionId: 301014, @@ -2951,17 +3008,31 @@ // 上传项目图片 uploadImageModal (row) { - let currentData = { - site: this.detailData.site, - buNo: this.detailData.buNo, - createBy: this.$store.state.user.name, - inspectionNo: this.detailData.inspectionNo, - itemNo: row.itemNo, - folder: 'IPQCItemImageFile' + const openImage = () => { + let currentData = { + site: this.detailData.site, + buNo: this.detailData.buNo, + createBy: this.$store.state.user.name, + inspectionNo: this.detailData.inspectionNo, + itemNo: row.itemNo, + folder: 'IPQCItemImageFile' + } + this.$nextTick(() => { + this.$refs.comQcItemImageUploadFile.init(currentData) + }) } - //打开组件 去做新增业务 - this.$nextTick(() => { - this.$refs.comQcItemImageUploadFile.init(currentData) + if (this.detailData.state !== '待检验') { + openImage() + return + } + if (this.detailData.passQty > this.detailData.rollQty) { + this.$message.warning('合格数量不能大于送检数量!') + return + } + this.saveDetailInformation('1', { + keepDetailOpen: true, + skipSuccessMessage: true, + afterSuccess: openImage }) }, @@ -3512,6 +3583,13 @@ this.detailData.disposalMeasures = '' this.detailData.disposalRemark = '' } + const picRequiredRow = this.detailList.find( + item => item.pictureFlag === 'Y' && !(Number(item.imageDetailNum) > 0) + ) + if (picRequiredRow) { + this.$message.warning(`项目编码:${picRequiredRow.itemNo || ''}图片必填,请检查!`) + return + } } if (this.detailData.passQty>this.detailData.rollQty){ this.$message.warning('合格数量不能大于送检数量!') @@ -3521,7 +3599,8 @@ }, // 新增明细信息 - saveDetailInformation (type) { + saveDetailInformation (type, options = {}) { + const keepDetailOpen = options.keepDetailOpen === true this.saveInformationData.site = this.detailData.site this.saveInformationData.buNo = this.detailData.buNo this.saveInformationData.inspectionNo = this.detailData.inspectionNo @@ -3547,13 +3626,28 @@ saveIPQCDetailedRecord(this.saveInformationData).then(({data}) => { if (data && data.code === 0) { this.getDataList() - this.detailInformationFlag = false - this.$message({ - message: '操作成功', - type: 'success', - duration: 1500, - onClose: () => {} - }) + if (keepDetailOpen) { + this.getInspectionFormData() + if (!options.skipSuccessMessage) { + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } + } else { + this.detailInformationFlag = false + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } + if (typeof options.afterSuccess === 'function') { + options.afterSuccess() + } } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' diff --git a/src/views/modules/qc/IQCResultEntry.vue b/src/views/modules/qc/IQCResultEntry.vue index 3661634..f163984 100644 --- a/src/views/modules/qc/IQCResultEntry.vue +++ b/src/views/modules/qc/IQCResultEntry.vue @@ -165,7 +165,12 @@ :min-width="item.columnWidth" :label="item.columnLabel"> @@ -355,7 +360,12 @@ :min-width="item.columnWidth" :label="item.columnLabel"> @@ -424,8 +434,8 @@ 应用 - 保存 关闭 + 保存 @@ -702,7 +712,12 @@ :min-width="item.columnWidth" :label="item.columnLabel"> @@ -732,7 +747,12 @@ :min-width="item.columnWidth" :label="item.columnLabel"> @@ -1605,6 +1625,24 @@ fixed: '', columnWidth: 120, }, + { + userId: this.$store.state.user.name, + functionId: 301006, + serialNumber: '301006Table2ObjectDesc', + tableId: "301006Table2", + tableName: "检验单明细表", + columnProp: 'pictureFlag', + headerAlign: "center", + align: "center", + columnLabel: '图片是否必填', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 120, + }, { userId: this.$store.state.user.name, functionId: 301006, @@ -2422,17 +2460,31 @@ // 上传项目图片 uploadImageModal (row) { - let currentData = { - site: this.detailData.site, - buNo: this.detailData.buNo, - createBy: this.$store.state.user.name, - inspectionNo: this.detailData.inspectionNo, - itemNo: row.itemNo, - folder: 'IQCItemImageFile' + const openImage = () => { + let currentData = { + site: this.detailData.site, + buNo: this.detailData.buNo, + createBy: this.$store.state.user.name, + inspectionNo: this.detailData.inspectionNo, + itemNo: row.itemNo, + folder: 'IQCItemImageFile' + } + this.$nextTick(() => { + this.$refs.comQcItemImageUploadFile.init(currentData) + }) } - //打开组件 去做新增业务 - this.$nextTick(() => { - this.$refs.comQcItemImageUploadFile.init(currentData) + if (this.detailData.state !== '待检验') { + openImage() + return + } + if (this.detailData.passQty > this.detailData.rollQty) { + this.$message.warning('合格数量不能大于送检数量!') + return + } + this.saveDetailInformation('1', { + keepDetailOpen: true, + skipSuccessMessage: true, + afterSuccess: openImage }) }, @@ -2542,6 +2594,13 @@ this.detailData.disposalMeasures = '' this.detailData.disposalRemark = '' } + const picRequiredRow = this.detailList.find( + item => item.pictureFlag === 'Y' && !(Number(item.imageDetailNum) > 0) + ) + if (picRequiredRow) { + this.$message.warning(`项目编码:${picRequiredRow.itemNo || ''}图片必填,请检查!`) + return + } } if (this.detailData.passQty>this.detailData.rollQty){ this.$message.warning('合格数量不能大于送检数量!') @@ -2551,7 +2610,8 @@ }, // 新增明细信息 - saveDetailInformation (type) { + saveDetailInformation (type, options = {}) { + const keepDetailOpen = options.keepDetailOpen === true this.saveInformationData.site = this.detailData.site this.saveInformationData.buNo = this.detailData.buNo this.saveInformationData.inspectionNo = this.detailData.inspectionNo @@ -2580,13 +2640,28 @@ saveIQCDetailedRecord(this.saveInformationData).then(({data}) => { if (data && data.code === 0) { this.getDataList() - this.detailInformationFlag = false - this.$message({ - message: '操作成功', - type: 'success', - duration: 1500, - onClose: () => {} - }) + if (keepDetailOpen) { + this.getInspectionFormData() + if (!options.skipSuccessMessage) { + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } + } else { + this.detailInformationFlag = false + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } + if (typeof options.afterSuccess === 'function') { + options.afterSuccess() + } } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' diff --git a/src/views/modules/qc/OQCResultEntry.vue b/src/views/modules/qc/OQCResultEntry.vue new file mode 100644 index 0000000..91f1059 --- /dev/null +++ b/src/views/modules/qc/OQCResultEntry.vue @@ -0,0 +1,3529 @@ + + + + + diff --git a/src/views/modules/qc/PQCResultEntry.vue b/src/views/modules/qc/PQCResultEntry.vue index 20642d1..298662e 100644 --- a/src/views/modules/qc/PQCResultEntry.vue +++ b/src/views/modules/qc/PQCResultEntry.vue @@ -625,8 +625,8 @@ 应用 - 保存 关闭 + 保存 diff --git a/src/views/modules/qc/SQCResultEntry.vue b/src/views/modules/qc/SQCResultEntry.vue index 1837ce2..fd24a69 100644 --- a/src/views/modules/qc/SQCResultEntry.vue +++ b/src/views/modules/qc/SQCResultEntry.vue @@ -148,7 +148,12 @@ :min-width="item.columnWidth" :label="item.columnLabel"> @@ -311,7 +316,12 @@ :min-width="item.columnWidth" :label="item.columnLabel"> @@ -379,9 +389,9 @@ - 应用 - 保存 + 应用 关闭 + 保存 @@ -506,7 +516,12 @@ :min-width="item.columnWidth" :label="item.columnLabel"> @@ -534,7 +549,12 @@ :min-width="item.columnWidth" :label="item.columnLabel"> @@ -1410,6 +1430,24 @@ fixed: '', columnWidth: 120 }, + { + userId: this.$store.state.user.name, + functionId: 301006, + serialNumber: '301006Table2ObjectDesc', + tableId: "301006Table2", + tableName: "检验单明细表", + columnProp: 'pictureFlag', + headerAlign: "center", + align: "center", + columnLabel: '图片是否必填', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 120, + }, { userId: this.$store.state.user.name, functionId: 301015, @@ -1824,6 +1862,13 @@ this.detailData.disposalMeasures = '' this.detailData.disposalRemark = '' } + const picRequiredRow = this.detailList.find( + item => item.pictureFlag === 'Y' && !(Number(item.imageDetailNum) > 0) + ) + if (picRequiredRow) { + this.$message.warning(`项目编码:${picRequiredRow.itemNo || ''}图片必填,请检查!`) + return + } } if (this.detailData.passQty > this.detailData.rollQty) { this.$message.warning('合格数量不能大于送检数量!') @@ -1831,7 +1876,8 @@ } this.saveDetailInformation(type) }, - saveDetailInformation (type) { + saveDetailInformation (type, options = {}) { + const keepDetailOpen = options.keepDetailOpen === true this.saveInformationData.site = this.detailData.site this.saveInformationData.buNo = this.detailData.buNo this.saveInformationData.inspectionNo = this.detailData.inspectionNo @@ -1856,8 +1902,18 @@ saveSQCDetailedRecord(this.saveInformationData).then(({data}) => { if (data && data.code === 0) { this.getDataList() - this.detailInformationFlag = false - this.$message.success('操作成功') + if (keepDetailOpen) { + this.getInspectionFormData() + if (!options.skipSuccessMessage) { + this.$message.success('操作成功') + } + } else { + this.detailInformationFlag = false + this.$message.success('操作成功') + } + if (typeof options.afterSuccess === 'function') { + options.afterSuccess() + } } else { this.$message.warning((data && data.msg) || '操作失败') } @@ -2162,16 +2218,31 @@ } }, uploadImageModal (row) { - let currentData = { - site: this.detailData.site, - buNo: this.detailData.buNo, - createBy: this.$store.state.user.name, - inspectionNo: this.detailData.inspectionNo, - itemNo: row.itemNo, - folder: 'SQCItemImageFile' + const openImage = () => { + let currentData = { + site: this.detailData.site, + buNo: this.detailData.buNo, + createBy: this.$store.state.user.name, + inspectionNo: this.detailData.inspectionNo, + itemNo: row.itemNo, + folder: 'SQCItemImageFile' + } + this.$nextTick(() => { + this.$refs.comQcItemImageUploadFile.init(currentData) + }) } - this.$nextTick(() => { - this.$refs.comQcItemImageUploadFile.init(currentData) + if (this.detailData.state !== '待检验') { + openImage() + return + } + if (this.detailData.passQty > this.detailData.rollQty) { + this.$message.warning('合格数量不能大于送检数量!') + return + } + this.saveDetailInformation('1', { + keepDetailOpen: true, + skipSuccessMessage: true, + afterSuccess: openImage }) }, inspectorSearch () { diff --git a/src/views/modules/qc/com_qc_itemImage_upload_file.vue b/src/views/modules/qc/com_qc_itemImage_upload_file.vue index ff8452b..7abdc79 100644 --- a/src/views/modules/qc/com_qc_itemImage_upload_file.vue +++ b/src/views/modules/qc/com_qc_itemImage_upload_file.vue @@ -155,7 +155,7 @@ export default { // 清空文件上传记录 this.$refs.uploadFile.clearFiles() // 刷新报工的页面 - //this.$emit('refreshPageTables2') + this.$emit('refreshPageTables2') // 关闭当前的页面 this.visible = false }, diff --git a/src/views/modules/qc/patrol_config_upload.vue b/src/views/modules/qc/patrol_config_upload.vue new file mode 100644 index 0000000..43cde2b --- /dev/null +++ b/src/views/modules/qc/patrol_config_upload.vue @@ -0,0 +1,126 @@ + + + + diff --git a/src/views/modules/qc/qcItem.vue b/src/views/modules/qc/qcItem.vue index c6edaf8..3d90d5d 100644 --- a/src/views/modules/qc/qcItem.vue +++ b/src/views/modules/qc/qcItem.vue @@ -194,9 +194,9 @@ - - - + + 需上传图片 + @@ -1272,6 +1272,7 @@ samplingLevelNo: '', samplingLevelDesc: '', defaultSamplingProportion: '', + pictureFlag:'N', collectionFlag: '', collectionSource: '', collectionSourceList: [], @@ -1313,6 +1314,7 @@ samplingLevelNo: row.samplingLevelNo, samplingLevelDesc: row.samplingLevelDesc, defaultSamplingProportion: row.defaultSamplingProportion, + pictureFlag: row.pictureFlag, collectionFlag: row.collectionFlag, collectionSource: row.collectionSource, collectionSourceList: row.collectionSource == null || row.collectionSource === '' ? [] : row.collectionSource.split(','), diff --git a/src/views/modules/qc/qcPartAttribute.vue b/src/views/modules/qc/qcPartAttribute.vue index e88d662..493f5ed 100644 --- a/src/views/modules/qc/qcPartAttribute.vue +++ b/src/views/modules/qc/qcPartAttribute.vue @@ -83,14 +83,26 @@ fixed="right" header-align="center" align="center" - width="240" + width="160" label="操作"> @@ -124,20 +136,21 @@ - + - + + 物料编码: + 物料编码: + + + - - 物料编码: - 物料编码: - - + - + @@ -167,20 +180,20 @@ IQC检验 - + IPQC检验 - PQC检验 + OQC检验 - - - + FQC检验 + + SQC检验 @@ -359,7 +372,12 @@ - + +
@@ -370,135 +388,125 @@ - + + v-for="i in options" + :key="i.inspectionTypeNo" + :label="i.inspectionTypeName" + :value="i.inspectionTypeNo"> - 查询 + 查询 - - 工序 - 供应商 + + 工序 + 供应商 + 客户 - - 机台 + + 机台
- - - 可选模板: - - - - - - - - - - - - -
- 添加>> -
-
- 删除<< + + + + + 可选模板: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 添加 + 删除
- - 已有模板: - - - - - - - - - - - - - - - - - + + 已有模板: +
+ + + + + + + + + + +
+
- + 关闭 @@ -687,7 +695,7 @@ - +
@@ -695,33 +703,24 @@ - 查询 + 查询 - - - - - + +
- 确认 + 确认
@@ -736,39 +735,25 @@ - 查询 + 查询 - - - - - - - + + +
- 确认 + 确认
@@ -783,7 +768,7 @@ - 查询 + 查询 - - - - - - + + + - 确认 + 确认 关闭 + + +
+ + + + + + + + + 查询 + + + + + + + +
+ + 确认 + 关闭 + +
+ - + 上传文件 @@ -932,6 +936,63 @@
+ + +
+ 新增 + 删除 + 导入 +
+ + + + + + + + + + + + + + + + + + + + + + + 保存 + 关闭 + +
+ + + @@ -956,6 +1017,7 @@ inspectionTypeSearch, // 搜索所有检验类型 getOperationDescList, // 查询工序列表 getManufacturerList, // 查询供应商列表 + getCustomerList, // 查询客户列表 getAllResourceList, // 查询机台列表 getSiteAndBuByUserName, searchPartInfo, // 查询物料信息 @@ -966,7 +1028,12 @@ delPartAttrItemDetails, savePartAttrDetailed, goUpPartAttrItem, - goDownPartAttrItem + goDownPartAttrItem, + getPatrolConfigList as fetchPatrolConfigListApi, + savePatrolConfig as savePatrolConfigApi, + updatePatrolConfig as updatePatrolConfigApi, + deletePatrolConfig as deletePatrolConfigApi, + getPatrolOperationDescList as getPatrolOperationDescListApi } from "@/api/qc/qc.js" import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" import Chooselist from '@/views/modules/common/Chooselist_eam' @@ -975,11 +1042,13 @@ import {deleteObjectFile} from '@/api/eam/eam.js' import qcUpload from "./qc_upload" import qcSOPUploadFile from "./qc_SOP_upload_file" + import PatrolConfigUpload from './patrol_config_upload' export default { components: { qcSOPUploadFile, Chooselist, - qcUpload + qcUpload, + PatrolConfigUpload }, data () { return { @@ -994,6 +1063,17 @@ exportList: [], // 导出 end tagNo: '', + patrolConfigDialogFlag: false, + patrolConfigLoading: false, + patrolConfigList: [], + patrolConfigSelections: [], + operationDescList: [], + patrolConfigSaveLoading: false, + patrolContextRow: { + site: '', + buNo: '', + partNo: '' + }, searchData: { site: '', userName: this.$store.state.user.name, @@ -1658,11 +1738,33 @@ fixed: '', columnWidth: 200, }, + { + userId: this.$store.state.user.name, + functionId: 301003, + serialNumber: '301003Table2CustomerName', + tableId: "301003Table2", + tableName: "检验模板清单表", + columnProp: 'customerName', + headerAlign: "center", + align: "left", + columnLabel: '客户', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 200, + }, ], // 快速添加 fastAddFlag: false, itemList1: [], itemList2: [], + itemList1Loading: false, + itemList2Loading: false, + addItemLoading: false, + deleteItemLoading: false, itemListRow1: {}, itemListRow2: {}, tempLevelRow: '', @@ -1707,7 +1809,8 @@ resourceModelFlag: false, dataListOperationSelections: [], operationData: { - operationDesc: '' + operationDesc: '', + inspectionTypeNo: '' }, resourceData: { site: '', @@ -1717,6 +1820,14 @@ operation: '', resourceId: '', selectionManufacturer: [], + selectionManufacturer2: [], + selectionCustomer: [], + selectionCustomer2: [], + span1: 12, + span2: 12, + span3: 12, + operationSelections: [], + resourceSelections: [], // 供应商 manufacturerList: [], manufacturerModelFlag: false, @@ -1726,6 +1837,14 @@ manufacturerID: '', manufacturerName: '' }, + customerData: { + site: '', + customerID: '', + customerName: '' + }, + customerModelFlag: false, + customerList: [], + dataListCustomerSelections: [], // 单选框绑定的值 operationCurrent: -1, resourceCurrent: -1, @@ -1985,6 +2104,221 @@ }) }, + patrolInspection (row) { + this.patrolContextRow = { + site: row.site, + buNo: row.buNo, + partNo: row.partNo + } + this.patrolConfigDialogFlag = true + this.getPatrolConfigList() + this.loadPatrolOperationDescList() + }, + + loadPatrolOperationDescList () { + const params = { + site: this.patrolContextRow.site, + userName: this.$store.state.user.name + } + getPatrolOperationDescListApi(params).then(({ data }) => { + if (data && data.code === 0) { + this.operationDescList = data.rows || [] + } + }) + }, + + getPatrolConfigList () { + this.patrolConfigLoading = true + const params = { + site: this.patrolContextRow.site, + buNo: this.patrolContextRow.buNo, + partNo: this.patrolContextRow.partNo + } + fetchPatrolConfigListApi(params).then(({ data }) => { + if (data && data.code === 0) { + this.patrolConfigList = data.rows || [] + } else { + this.$message.error((data && data.msg) || '获取巡检配置失败') + } + this.patrolConfigLoading = false + }).catch(() => { + this.patrolConfigLoading = false + }) + }, + + patrolConfigSelectionChange (selections) { + this.patrolConfigSelections = selections + }, + + addPatrolConfig () { + this.patrolConfigList.push({ + site: this.patrolContextRow.site, + buNo: this.patrolContextRow.buNo, + partNo: this.patrolContextRow.partNo, + operationDesc: '', + firstInspectionDuration: 0, + nextInspectionDuration: 0, + totalInspectionDuration: 0, + defaultFlag: 'N', + isNew: true + }) + }, + + savePatrolConfigRow (row) { + if (!row.operationDesc) { + this.$message.warning('请输入工序') + return + } + 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 + } + if (row.isNew) { + savePatrolConfigApi(params).then(({ data }) => { + if (data && data.code === 0) { + this.$message.success('保存成功') + this.getPatrolConfigList() + } else { + this.$message.error((data && data.msg) || '保存失败') + } + }) + } else { + updatePatrolConfigApi(params).then(({ data }) => { + if (data && data.code === 0) { + this.$message.success('更新成功') + this.getPatrolConfigList() + } else { + this.$message.error((data && data.msg) || '更新失败') + } + }) + } + }, + + deletePatrolConfigRows () { + if (this.patrolConfigSelections.length === 0) { + this.$message.warning('请选择要删除的数据') + return + } + this.$confirm('确定删除选中的配置吗?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + const deleteList = this.patrolConfigSelections.filter(item => !item.isNew) + if (deleteList.length === 0) { + this.patrolConfigSelections.forEach(item => { + const index = this.patrolConfigList.indexOf(item) + if (index > -1) { + this.patrolConfigList.splice(index, 1) + } + }) + this.patrolConfigSelections = [] + return + } + const params = { + list: deleteList.map(item => ({ + site: item.site, + buNo: item.buNo, + partNo: item.partNo, + operationDesc: item.operationDesc + })) + } + deletePatrolConfigApi(params).then(({ data }) => { + if (data && data.code === 0) { + this.$message.success('删除成功') + this.getPatrolConfigList() + } else { + this.$message.error((data && data.msg) || '删除失败') + } + }) + }).catch(() => {}) + }, + + handleDefaultFlagChange (row) { + if (row.defaultFlag === 'Y') { + this.patrolConfigList.forEach(item => { + if (item !== row) { + item.defaultFlag = 'N' + } + }) + } + }, + + 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 savePatrolConfigApi(params).then(({ data }) => { + if (data && data.code === 0) { + successCount++ + row.isNew = false + } else { + errorCount++ + } + }).catch(() => { + errorCount++ + }) + } else { + return updatePatrolConfigApi(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() + }) + }, + + openPatrolConfigImport () { + const params = { + site: this.patrolContextRow.site, + buNo: this.patrolContextRow.buNo, + partNo: this.patrolContextRow.partNo + } + this.$refs.patrolConfigUpload.init(params) + }, + getRowData1 (row) { this.modalData.sku = row.sku this.modalData.cinvSourceCode = row.cinvSourceCode @@ -2213,46 +2547,92 @@ }, checkInspectionType () { - this.operationData.inspectionTypeNo = this.detailData.inspectionTypeNo + this.refreshTemplateLists() + if (this.detailData.inspectionTypeNo === '101' || this.detailData.inspectionTypeNo === '107') { + this.span1 = 12 + this.span2 = 6 + this.span3 = 6 + } else if (this.detailData.inspectionTypeNo === '105' || this.detailData.inspectionTypeNo === '110') { + this.span1 = 12 + this.span2 = 12 + } else { + this.span1 = 24 + } + }, + + checkInspectionType2 () { + this.refreshTemplateLists() + }, + + refreshTemplateLists () { + this.itemList1Loading = true + this.itemList2Loading = true getPartTemplateLists(this.detailData).then(({data}) => { - this.operation = '' - this.resourceId = '' - this.itemList1 = data.row1 - this.itemList2 = data.row2 + if (data) { + this.itemList1 = data.row1 || [] + this.itemList2 = data.row2 || [] + } + }).catch(err => { + console.error('加载模板列表失败:', err) + }).finally(() => { + this.itemList1Loading = false + this.itemList2Loading = false }) }, - // 快速新增 + // 快速新增(与 boying-vue 一致) addFastModal () { - this.itemSelections1 = null - this.itemSelections2 = null - getPartTemplateLists(this.detailData).then(({data}) => { - this.itemList1 = data.row1 - this.itemList2 = data.row2 - }) + if (!this.detailData.partNo || !this.detailData.site) { + this.$message.warning('请先选择要设置模板的物料!') + return + } + if (!this.options || this.options.length === 0) { + this.$message.warning('检验类型数据加载中,请稍后再试') + return + } + this.itemSelections1 = [] + this.itemSelections2 = [] this.detailData.inspectionTypeNo = this.options[0].inspectionTypeNo - this.checkInspectionType() + if (this.detailData.inspectionTypeNo === '101' || this.detailData.inspectionTypeNo === '107') { + this.span1 = 12 + this.span2 = 6 + this.span3 = 6 + } else if (this.detailData.inspectionTypeNo === '105' || this.detailData.inspectionTypeNo === '110') { + this.span1 = 12 + this.span2 = 12 + } else { + this.span1 = 24 + } + this.operationSelections = [] + this.resourceSelections = [] this.dataListOperationSelections = [] - this.operation = '' - this.resourceId = '' this.operationData.operationDesc = '' this.resourceData.resourceId = '' this.resourceData.resourceDesc = '' - this.operationCurrent = -1 - this.resourceCurrent = -1 this.selectionManufacturer = [] + this.selectionManufacturer2 = [] this.dataListManufacturerSelections = [] + this.selectionCustomer = [] + this.selectionCustomer2 = [] + this.dataListCustomerSelections = [] this.fastAddFlag = true + this.$nextTick(() => { + this.refreshTemplateLists() + }) }, // 可选项目 itemClickRow1 (row) { - this.$refs.itemTable1.toggleRowSelection(row) + if (this.$refs.itemTable1) { + this.$refs.itemTable1.toggleRowSelection(row) + } }, // 已有项目 itemClickRow2 (row) { - this.$refs.itemTable2.toggleRowSelection(row) + if (this.$refs.itemTable2) { + this.$refs.itemTable2.toggleRowSelection(row) + } }, selectFlag () { @@ -2273,44 +2653,43 @@ this.$message.warning('请选择可选模板!') return } - /* if ((this.detailData.inspectionTypeNo === '101' || this.detailData.inspectionTypeNo === '102' || this.detailData.inspectionTypeNo === '103' || this.detailData.inspectionTypeNo === '104' || this.detailData.inspectionTypeNo === '106' || this.detailData.inspectionTypeNo === '107' || this.detailData.inspectionTypeNo === '108') && (this.operation == null || this.operation === '')) { - this.$message.warning('请选择工序!') - return - } - if ((this.detailData.inspectionTypeNo === '101' || this.detailData.inspectionTypeNo === '102' || this.detailData.inspectionTypeNo === '103' || this.detailData.inspectionTypeNo === '104' || this.detailData.inspectionTypeNo === '106' || this.detailData.inspectionTypeNo === '107') && (this.resourceId == null || this.resourceId === '')) { - this.$message.warning('请选择机台!') - return - } */ - if ((this.detailData.inspectionTypeNo === '105') && (this.selectionManufacturer == null || this.selectionManufacturer.length === 0)) { - this.$message.warning('请选择供应商!') - return + if ((this.detailData.inspectionTypeNo === '101' || this.detailData.inspectionTypeNo === '102' || this.detailData.inspectionTypeNo === '103' || this.detailData.inspectionTypeNo === '104' || this.detailData.inspectionTypeNo === '106' || this.detailData.inspectionTypeNo === '107')) { + if (this.resourceSelections.length > 0 && this.operationSelections.length === 0) { + this.$message.warning('如果选择机台,必须要选择工序!') + return + } } + this.addItemLoading = true let inData = { site: this.detailData.site, buNo: this.detailData.buNo, attributeNo: this.detailData.partNo, itemList: this.itemSelections1, - operation: this.operation, - resourceID: this.resourceId, - manufacturerList: this.selectionManufacturer, + operationList: this.operationSelections.map(item => item.operationDesc), + resourceIDList: this.resourceSelections.map(item => item.resourceId), + manufacturerList: this.selectionManufacturer || [], + customerList: this.selectionCustomer || [], attributeType: this.detailData.attributeType, inspectionTypeNo: this.detailData.inspectionTypeNo } savePartAttributeDetails(inData).then(({data}) => { if (data && data.code === 0) { - getPartTemplateLists(this.detailData).then(({data}) => { - this.itemList1 = data.row1 - this.itemList2 = data.row2 - }) + this.$message.success('添加成功!') + this.refreshTemplateLists() this.itemSelections1 = [] - this.operation = '' - this.resourceId = '' + this.operationSelections = [] + this.resourceSelections = [] this.selectionManufacturer = [] + this.selectionManufacturer2 = [] + this.selectionCustomer = [] + this.selectionCustomer2 = [] } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) + this.$message.error(data && data.msg ? data.msg : '添加失败') } + }).catch(err => { + this.$message.error('添加失败:' + (err.message || '未知错误')) + }).finally(() => { + this.addItemLoading = false }) }, @@ -2320,8 +2699,9 @@ this.$message.warning('请选择已有模板!') return } + this.deleteItemLoading = true let inData = { - attributeNo:this.detailData.partNo, + attributeNo: this.detailData.partNo, itemList: this.itemSelections2, attributeType: this.detailData.attributeType, site: this.detailData.site, @@ -2329,16 +2709,16 @@ } deletePartAttributeDetails(inData).then(({data}) => { if (data && data.code === 0) { - getPartTemplateLists(this.detailData).then(({data}) => { - this.itemList1 = data.row1 - this.itemList2 = data.row2 - }) + this.$message.success('删除成功!') + this.refreshTemplateLists() this.itemSelections2 = [] } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) + this.$message.error(data && data.msg ? data.msg : '删除失败') } + }).catch(err => { + this.$message.error('删除失败:' + (err.message || '未知错误')) + }).finally(() => { + this.deleteItemLoading = false }) }, @@ -2712,25 +3092,13 @@ // 获取工序列表 getOperationList () { + this.operationData.inspectionTypeNo = this.detailData.inspectionTypeNo getOperationDescList(this.operationData).then(({data}) => { if (data && data.code === 0) { this.operationList = data.rows - // // 回显数据 - // // 先清空缓存选中 - // this.$nextTick(() => this.$refs.operationTable.clearSelection()) - // // 拿到选中的工序 - // let tempDataList = this.operationDesc - // this.operationList.forEach(val => { - // // 回显选中的工序 - // if (tempDataList === val.operationDesc) { - // this.$nextTick(() => this.$refs.operationTable.toggleRowSelection(val, true)) - // } - // }) this.operationModelFlag = true } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) + this.$message.error(data.msg) } }) }, @@ -2743,140 +3111,177 @@ this.resourceList = data.rows this.resourceModelFlag = true } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) + this.$message.error(data.msg) } }) }, - // 条件查询获取工序列表 getOperationList2 () { + this.operationData.inspectionTypeNo = this.detailData.inspectionTypeNo getOperationDescList(this.operationData).then(({data}) => { if (data && data.code === 0) { this.operationList = data.rows - this.operationCurrent = -1 } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) + this.$message.error(data.msg) } }) }, - // 条件查询获取机台列表 getAllResourceList2 () { this.resourceData.site = this.detailData.site getAllResourceList(this.resourceData).then(({data}) => { if (data && data.code === 0) { this.resourceList = data.rows - this.resourceCurrent = -1 } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) + this.$message.error(data.msg) } }) }, - // 点击行选中工序复选框 - operationClickRow (row) { - this.$refs.operationTable.toggleRowSelection(row) + selectionOperationChangeHandle (val) { + this.operationSelections = val }, - // 点击行选中机台复选框 - resourceClickRow (row) { - this.$refs.resourceTable.toggleRowSelection(row) - }, + operationSelect () {}, - // 多选工序 - selectionOperationChangeHandle (val) { - this.operation = val[0].operationDesc - if (val) { - this.operationCurrent = val.index - } + getRowKeys (row) { + return row.operationDesc }, - // 多选机台 selectionResourceChangeHandle (val) { - this.resourceId = val[0].resourceId - if (val) { - this.resourceCurrent = val.index - } + this.resourceSelections = val }, - operationRowClassName ({row, rowIndex}) { - row.index = rowIndex // 在原有的数据上加一个index - }, + resourceSelect () {}, - resourceRowClassName ({row, rowIndex}) { - row.index = rowIndex // 在原有的数据上加一个index + getRowKeys2 (row) { + return row.resourceId }, - // // 单选 - // clickChange (row) { - // this.radioOperation = row.operationDesc - // }, - // 确认选择工序 + confirmOperation () { - //this.operationDesc = '' - // this.operationDesc = this.radioOperation - // this.radioOperation = '' - // for (let i = 0; i < this.dataListOperationSelections.length; i++) { - // this.selectionOperation.push(this.dataListOperationSelections[i].operationDesc) - // } this.operationModelFlag = false }, - // 确认选择工序 confirmResource () { this.resourceModelFlag = false }, - // 获取供应商列表 getManufacturerList () { this.manufacturerData.site = this.detailData.site getManufacturerList(this.manufacturerData).then(({data}) => { if (data && data.code === 0) { this.manufacturerList = data.rows - // 回显数据 - // 先清空缓存选中 this.$nextTick(() => this.$refs.manufacturerTable.clearSelection()) - // 拿到选中的供应商 let tempDataList = this.selectionManufacturer this.manufacturerList.forEach(val => { - // 回显选中的供应商 if (tempDataList.includes(val.manufacturerID)) { this.$nextTick(() => this.$refs.manufacturerTable.toggleRowSelection(val, true)) } }) this.manufacturerModelFlag = true } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' + this.$message.error(data.msg) + } + }) + }, + + getManufacturerList2 () { + this.manufacturerData.site = this.detailData.site + getManufacturerList(this.manufacturerData).then(({data}) => { + if (data && data.code === 0) { + this.manufacturerList = data.rows + let tempDataList = this.selectionManufacturer + this.manufacturerList.forEach(val => { + if (tempDataList.includes(val.manufacturerID)) { + this.$nextTick(() => this.$refs.manufacturerTable.toggleRowSelection(val, true)) + } }) + } else { + this.manufacturerList = [] } }) }, - // 点击行选中复选框 + getRowKeys3 (row) { + return row.manufacturerID + }, + manufacturerClickRow (row) { this.$refs.manufacturerTable.toggleRowSelection(row) }, - // 多选 selectionManufacturerChangeHandle (val) { this.dataListManufacturerSelections = val }, - // 确认多选供应商 confirmManufacturer () { this.selectionManufacturer = [] + this.selectionManufacturer2 = [] for (let i = 0; i < this.dataListManufacturerSelections.length; i++) { this.selectionManufacturer.push(this.dataListManufacturerSelections[i].manufacturerID) + this.selectionManufacturer2.push(this.dataListManufacturerSelections[i]) } this.manufacturerModelFlag = false }, + getCustomerList () { + this.customerData.site = this.detailData.site + getCustomerList(this.customerData).then(({data}) => { + if (data && data.code === 0) { + this.customerList = data.rows + this.$nextTick(() => this.$refs.customerTable.clearSelection()) + let tempDataList = this.selectionCustomer + this.customerList.forEach(val => { + if (tempDataList.includes(val.customerID)) { + this.$nextTick(() => this.$refs.customerTable.toggleRowSelection(val, true)) + } + }) + this.customerModelFlag = true + } else { + this.$message.error(data.msg) + } + }) + }, + + getCustomerList2 () { + this.customerData.site = this.detailData.site + getCustomerList(this.customerData).then(({data}) => { + if (data && data.code === 0) { + this.customerList = data.rows + let tempDataList = this.selectionCustomer + this.customerList.forEach(val => { + if (tempDataList.includes(val.customerID)) { + this.$nextTick(() => this.$refs.customerTable.toggleRowSelection(val, true)) + } + }) + } else { + this.customerList = [] + } + }) + }, + + customerClickRow (row) { + this.$refs.customerTable.toggleRowSelection(row) + }, + + selectionCustomerChangeHandle (val) { + this.dataListCustomerSelections = val + }, + + getRowKeys4 (row) { + return row.customerID + }, + + confirmCustomer () { + this.selectionCustomer = [] + this.selectionCustomer2 = [] + for (let i = 0; i < this.dataListCustomerSelections.length; i++) { + this.selectionCustomer.push(this.dataListCustomerSelections[i].customerID) + this.selectionCustomer2.push(this.dataListCustomerSelections[i]) + } + this.customerModelFlag = false + }, + // sop文件列表 sopFileList (row) { this.sopData = { @@ -2908,7 +3313,7 @@ // 上传sop文件模态框 uploadSopFile () { let currentData = { - titleCon: 'SOP文件上传', + titleCon: '文件上传', site: this.sopData.site, buNo: this.sopData.buNo, createBy: this.$store.state.user.name, @@ -3067,4 +3472,11 @@ height: auto; line-height: 1.5; } +.qc-more-dropdown-trigger { + cursor: pointer; + color: #45C2B5; + margin-left: 1px; + font-size: 12px; + white-space: nowrap; +}