diff --git a/src/api/part/bomManagement.js b/src/api/part/bomManagement.js index 603debc..29eb315 100644 --- a/src/api/part/bomManagement.js +++ b/src/api/part/bomManagement.js @@ -169,5 +169,12 @@ export const getBomEngChgLevel = data => createAPI(`/part/bomManagement/getBomEn */ export const queryPartListAll = data => createAPI(`/part/bomManagement/queryPartListAll`,'post',data) +/** + * 批量新增子件 + * @param data + * @returns {*} + */ +export const batchSaveBomComponent = data => createAPI(`/part/bomManagement/batchSaveBomComponent`,'post',data) + diff --git a/src/views/modules/part/bomManagement.vue b/src/views/modules/part/bomManagement.vue index 789fe16..6e968c2 100644 --- a/src/views/modules/part/bomManagement.vue +++ b/src/views/modules/part/bomManagement.vue @@ -227,45 +227,90 @@ 新增 + 批量新增 删除 - - - - - - - - - +
+ + + + + + + + + + + + + + + + + + + + + +
@@ -739,6 +784,68 @@ + + + + + + + + + + + 查询 + + + + + + + + + + + + + + + + + 保存 + 关闭 + + + @@ -770,6 +877,7 @@ import { queryBomComponentTable, // 刷新子物料 getBomEngChgLevel, // 获取物料的BOM版本号 queryPartListAll, // 查询包含Purchase(Raw)的物料 + batchSaveBomComponent, // 批量新增子件 } from '@/api/part/bomManagement.js' import {getSiteAndBuByUserName, getSiteAndBuByUserName2} from "@/api/qc/qc.js" import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" @@ -851,6 +959,9 @@ export default { pageIndex4: 1, pageSize4: 20, totalPage4: 0, + pageIndex5: 1, + pageSize5: 20, + totalPage5: 0, selectedDataNum: 0, // 条件查询 searchData: { @@ -957,6 +1068,15 @@ export default { page: 1, limit: 10 }, + batchComponentPartData: { + site: '', + buNo: '', + partNo: '', + partDesc: '', + shrinkageFactor: '', + page: 1, + limit: 10 + }, copyPartData: { type: '', site: '', @@ -1024,6 +1144,7 @@ export default { dataList: [], partList: [], componentPartList: [], + batchComponentPartList: [], copyPartList: [], componentPartSelections: [], subDetailList: [], @@ -1384,7 +1505,7 @@ export default { columnWidth: 150 } ], - columnSubDetailList: [ + columnSubDetailList1: [ { userId: this.$store.state.user.name, functionId: 601002, @@ -1439,60 +1560,8 @@ export default { fixed: '', columnWidth: 300 }, - { - userId: this.$store.state.user.name, - functionId: 601002, - serialNumber: '601002Table2QtyPerAssembly', - tableId: '601002Table2', - tableName: 'BOM子物料表', - columnProp: 'qtyPerAssembly', - headerAlign: 'center', - align: 'right', - columnLabel: '单位用量', - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: '', - columnWidth: 80 - }, - { - userId: this.$store.state.user.name, - functionId: 601002, - serialNumber: '601002Table2ComponentScrap', - tableId: '601002Table2', - tableName: 'BOM子物料表', - columnProp: 'componentScrap', - headerAlign: 'center', - align: 'right', - columnLabel: '调机量', - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: '', - columnWidth: 80 - }, - { - userId: this.$store.state.user.name, - functionId: 601002, - serialNumber: '601002Table2ShrinkageFactor', - tableId: '601002Table2', - tableName: 'BOM子物料表', - columnProp: 'shrinkageFactor', - headerAlign: 'center', - align: 'right', - columnLabel: '损耗率', - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: '', - columnWidth: 80 - }, + ], + columnSubDetailList2: [ { userId: this.$store.state.user.name, functionId: 601002, @@ -1602,206 +1671,6 @@ export default { columnWidth: 150 }, ], - columnSubDetailList2: [ - { - userId: this.$store.state.user.name, - functionId: 601002, - serialNumber: '601002Table3LineSequence', - tableId: '601002Table3', - tableName: 'BOM副产品表', - columnProp: 'lineSequence', - headerAlign: 'center', - align: 'center', - columnLabel: '序号', - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: '', - columnWidth: 60 - }, - { - userId: this.$store.state.user.name, - functionId: 601002, - serialNumber: '601002Table3ComponentPart', - tableId: '601002Table3', - tableName: 'BOM副产品表', - columnProp: 'componentPart', - 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: 601002, - serialNumber: '601002Table3ComponentPartDesc', - tableId: '601002Table3', - tableName: 'BOM副产品表', - columnProp: 'componentPartDesc', - headerAlign: 'center', - align: 'left', - columnLabel: '物料名称', - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: '', - columnWidth: 120 - }, - { - userId: this.$store.state.user.name, - functionId: 601002, - serialNumber: '601002Table3QtyPerAssembly', - tableId: '601002Table3', - tableName: 'BOM副产品表', - columnProp: 'qtyPerAssembly', - headerAlign: 'center', - align: 'right', - columnLabel: '单位用量', - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: '', - columnWidth: 80 - }, - { - userId: this.$store.state.user.name, - functionId: 601002, - serialNumber: '601002Table3ComponentScrap', - tableId: '601002Table3', - tableName: 'BOM副产品表', - columnProp: 'componentScrap', - headerAlign: 'center', - align: 'right', - columnLabel: '调机量', - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: '', - columnWidth: 80 - }, - { - userId: this.$store.state.user.name, - functionId: 601002, - serialNumber: '601002Table3ShrinkageFactor', - tableId: '601002Table3', - tableName: 'BOM副产品表', - columnProp: 'shrinkageFactor', - headerAlign: 'center', - align: 'right', - columnLabel: '损耗率', - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: '', - columnWidth: 80 - }, - { - userId: this.$store.state.user.name, - functionId: 601002, - serialNumber: '601002Table3PrintUnit', - tableId: '601002Table3', - tableName: 'BOM副产品表', - columnProp: 'printUnit', - headerAlign: 'center', - align: 'center', - columnLabel: '物料单位', - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: '', - columnWidth: 60 - }, - { - userId: this.$store.state.user.name, - functionId: 601002, - serialNumber: '601002Table3IssueType', - tableId: '601002Table3', - tableName: 'BOM副产品表', - columnProp: 'issueType', - headerAlign: 'center', - align: 'center', - columnLabel: '生产属性', - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: '', - columnWidth: 140 - }, - { - userId: this.$store.state.user.name, - functionId: 601002, - serialNumber: '601002Table3OperationDesc', - tableId: '601002Table3', - tableName: 'BOM副产品表', - columnProp: 'operationId', - headerAlign: 'center', - align: 'center', - columnLabel: '工序', - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: '', - columnWidth: 80 - }, - { - userId: this.$store.state.user.name, - functionId: 601002, - serialNumber: '601002Table3IssueToLoc', - tableId: '601002Table3', - tableName: 'BOM副产品表', - columnProp: 'issueToLocName', - headerAlign: 'center', - align: 'center', - columnLabel: '发料库位', - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: '', - columnWidth: 80 - }, - { - userId: this.$store.state.user.name, - functionId: 601002, - serialNumber: '601002Table3NoteText', - tableId: '601002Table3', - tableName: 'BOM副产品表', - columnProp: 'noteText', - headerAlign: 'center', - align: 'left', - columnLabel: '备注', - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: '', - columnWidth: 150 - }, - ], operationDetailList: [ { columnProp: 'routingRevision', @@ -2037,6 +1906,7 @@ export default { }, // ======== 复选数据集 ======== bomSelections: [], + batchComponentSelections: [], // ======== 模态框开关控制 ======== authSearch: false, authSave: false, @@ -2056,6 +1926,7 @@ export default { copyAlternativeModelFlag: false, headerSaveFlag: false, menuId: this.$route.meta.menuId, + batchComponentPartModelFlag: false } }, @@ -2199,6 +2070,25 @@ export default { this.queryCopyPartModal() }, + /** + * 每页数 + * @param val + */ + sizeChangeHandle5 (val) { + this.pageSize5 = val + this.pageIndex5 = 1 + this.queryBatchComponentPartList() + }, + + /** + * 当前页 + * @param val + */ + currentChangeHandle5 (val) { + this.pageIndex5 = val + this.queryBatchComponentPartList() + }, + // ======== 页签切换相关方法 ======== /** @@ -2256,6 +2146,16 @@ export default { this.$refs.selectDiv.setLengthselected(this.bomSelections.length) }, + // 点击行选中复选框 + batchSaveClickRow (row) { + this.$refs.batchSaveTable.toggleRowSelection(row) + }, + + // 复选子物料信息 + selectionSaveComponent (val) { + this.batchComponentSelections = val + }, + // ======== 新增/编辑模态框 ======== /** * bom新增模态框 @@ -2269,7 +2169,7 @@ export default { buNo: this.userBuList[0].buNo.split('_')[1], partNo: '', partDesc: '', - engChgLevel: '', + engChgLevel: undefined, bomType: 'Manufacturing', noteText: '', effPhaseInDate: new Date(+ new Date() + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, ''), @@ -2496,6 +2396,26 @@ export default { this.componentSaveModal = true }, + // 批量新增子物料模态框 + batchSaveComponentModal () { + this.batchComponentPartData.limit = this.pageSize5 + this.batchComponentPartData.page = this.pageIndex5 + this.batchComponentPartData.site = this.modalData.site + this.batchComponentPartData.buNo = this.modalData.buNo + // 查询所有物料 + queryPartListAll(this.batchComponentPartData).then(({data}) => { + if (data && data.code === 0) { + this.batchComponentPartList = data.page.list + this.pageIndex5 = data.page.currPage + this.pageSize5 = data.page.pageSize + this.totalPage5 = data.page.totalCount + this.batchComponentPartModelFlag = true + } else { + this.batchComponentPartList = [] + } + }) + }, + /** * 副产品新增模态框 */ @@ -2880,9 +2800,7 @@ export default { this.totalPage3 = data.page.totalCount this.componentPartModelFlag = true } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) + this.componentPartList = [] } }) }, @@ -2931,6 +2849,25 @@ export default { }) }, + /** + * 子物料查询列表 + */ + queryBatchComponentPartList () { + this.batchComponentPartData.limit = this.pageSize5 + this.batchComponentPartData.page = this.pageIndex5 + // 查询所有物料 + queryPartList(this.batchComponentPartData).then(({data}) => { + if (data && data.code === 0) { + this.batchComponentPartList = data.page.list + this.pageIndex5 = data.page.currPage + this.pageSize5 = data.page.pageSize + this.totalPage5 = data.page.totalCount + } else { + this.batchComponentPartList = [] + } + }) + }, + /** * copy物料查询列表 */ @@ -2960,7 +2897,7 @@ export default { this.componentPartData.partNo = this.componentData.componentPart queryPartListAll(this.componentPartData).then(({data}) => { if (data && data.code === 0) { - if (data.page.list.length === 1) { + if (data.page.list.length > 0) { this.componentData.componentPartDesc = data.page.list[0].partDesc this.componentData.printUnit = data.page.list[0].printUnit this.componentData.printUnitName = data.page.list[0].printUnitName @@ -3182,6 +3119,64 @@ export default { } }, + // 批量新增子件 + batchComponentDataSave () { + this.$confirm("是否确认添加该"+ this.batchComponentSelections.length +"条子件记录?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }).then(() => { + let tempData = { + site: this.modalData.site, + buNo: this.modalData.buNo, + partNo: this.modalData.partNo, + engChgLevel: this.modalData.engChgLevel, + bomType: this.modalData.bomType, + alternativeNo: this.detailData.alternativeNo, + consumptionItem: 'Consumed', + qtyPerAssembly: 0, + componentScrap: 0, + shrinkageFactor: this.batchComponentPartData.shrinkageFactor, + lineItemNo: '', + operationId: '', + operationNo: '', + issueToLoc: '', + issueToLocName: '', + noteText: '', + createBy: this.$store.state.user.name, + lineSequence: '', + issueType: 'Reserve And Backflush', + productFlag: 'component', + batchSaveList: this.batchComponentSelections + } + batchSaveBomComponent(tempData).then(({data}) => { + if (data && data.code === 0) { + this.subDetailList = data.rows.subDetailList + this.batchComponentPartModelFlag = false + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + this.batchComponentPartData = { + site: '', + buNo: '', + partNo: '', + partDesc: '', + shrinkageFactor: '', + page: 1, + limit: 10 + } + }) + }) + }, + /** * 回车事件 */ diff --git a/src/views/modules/part/routingManagement.vue b/src/views/modules/part/routingManagement.vue index 57eb7f1..ea0c653 100644 --- a/src/views/modules/part/routingManagement.vue +++ b/src/views/modules/part/routingManagement.vue @@ -151,7 +151,7 @@ - + @@ -350,8 +350,8 @@ - 加工中心编码 - + 加工中心编码 + @@ -2281,7 +2281,7 @@ export default { buNo: this.userBuList[0].buNo.split('_')[1], partNo: '', partDesc: '', - routingRevision: '', + routingRevision: undefined, routingType: 'Manufacturing', noteText: '', phaseInDate: new Date(+ new Date() + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, ''), @@ -3492,7 +3492,8 @@ export default { strVal = this.componentData.setupLaborClassNo } } - if (val === 216) { + if (val === 516) { + conSql = '' strVal = this.componentData.workCenterNo } this.$refs.baseList.init(val, strVal, conSql) @@ -3512,7 +3513,7 @@ export default { this.componentData.setupLaborClassDesc = val.class_desc } } - if (this.tagNo === 216) { + if (this.tagNo === 516) { this.componentData.workCenterNo = val.work_center_no this.componentData.workCenterDesc = val.work_center_desc this.componentData.workCenterType = val.work_center_type @@ -3558,7 +3559,7 @@ export default { if (this.componentData.workCenterNo != null && this.componentData.workCenterNo !== '') { let tempData = { tagno: tagNo, - conditionSql: " and work_center_no = '" + this.componentData.workCenterNo + "'" + " and site = '" + this.modalData.site + "'" + " and bu_no = '" + this.modalData.buNo + "'" + conditionSql: " and work_center_no = '" + this.componentData.workCenterNo + "'" + " and site = '" + this.modalData.site + "'" } verifyData(tempData).then(({data}) => { if (data && data.code === 0) { diff --git a/src/views/modules/report/FAI_detail_report.vue b/src/views/modules/report/FAI_detail_report.vue index 3a25997..8445c9d 100644 --- a/src/views/modules/report/FAI_detail_report.vue +++ b/src/views/modules/report/FAI_detail_report.vue @@ -27,25 +27,28 @@ - + - + - + + + + + + + + + - - - - - @@ -188,7 +191,8 @@ export default { responsiblePersonName: '', itemResult: '', downloadType: 'fai', - itemNo: '' + itemNo: '', + itemDesc: '' }, pageIndex: 1, pageSize: 20, diff --git a/src/views/modules/report/FQC_detail_report.vue b/src/views/modules/report/FQC_detail_report.vue index aa659de..2fbd458 100644 --- a/src/views/modules/report/FQC_detail_report.vue +++ b/src/views/modules/report/FQC_detail_report.vue @@ -27,25 +27,29 @@ - + - + - + + + + + + + + + - - - - - + @@ -188,7 +192,8 @@ export default { responsiblePersonName: '', itemResult: '', downloadType: 'fqc', - itemNo: '' + itemNo: '', + itemDesc: '' }, pageIndex: 1, pageSize: 20, diff --git a/src/views/modules/report/IPQC_detail_report.vue b/src/views/modules/report/IPQC_detail_report.vue index 7fc9c95..62f7552 100644 --- a/src/views/modules/report/IPQC_detail_report.vue +++ b/src/views/modules/report/IPQC_detail_report.vue @@ -27,25 +27,28 @@ - + - + - + + + + + + + + + - - - - - @@ -197,7 +200,8 @@ export default { responsiblePersonName: '', itemResult: '', downloadType: 'ipqc', - itemNo: '' + itemNo: '', + itemDesc: '' }, pageIndex: 1, pageSize: 20, diff --git a/src/views/modules/report/IQC_detail_report.vue b/src/views/modules/report/IQC_detail_report.vue index fcecd19..130594f 100644 --- a/src/views/modules/report/IQC_detail_report.vue +++ b/src/views/modules/report/IQC_detail_report.vue @@ -67,6 +67,9 @@ + + + @@ -223,7 +226,9 @@ export default { operatorName: '', responsiblePersonName: '', itemResult: '', - downloadType: 'iqc' + downloadType: 'iqc', + itemNo: '', + itemDesc: '' }, pageIndex: 1, pageSize: 20,