diff --git a/src/api/part/bomManagement.js b/src/api/part/bomManagement.js index 5f8eda8..614e9c1 100644 --- a/src/api/part/bomManagement.js +++ b/src/api/part/bomManagement.js @@ -84,6 +84,13 @@ export const queryBomHeader = data => createAPI(`/plm/bomManagement/queryBomHead */ export const saveBomComponent = data => createAPI(`/plm/bomManagement/saveBomComponent`,'post',data) +/** + * 修改bom子明细 + * @param data + * @returns {*} + */ +export const updateBomComponent = data => createAPI(`/plm/bomManagement/updateBomComponent`,'post',data) + /** * 删除bom子明细 * @param data diff --git a/src/api/part/routingManagement.js b/src/api/part/routingManagement.js new file mode 100644 index 0000000..e1aa96a --- /dev/null +++ b/src/api/part/routingManagement.js @@ -0,0 +1,102 @@ +import { createAPI } from "@/utils/httpRequest.js"; + +/** + * routing列表查询 + * @param data + * @returns {*} + */ +export const routingManagementSearch = data => createAPI(`/plm/routingManagement/routingManagementSearch`,'post',data) + +/** + * routing新增 + * @param data + * @returns {*} + */ +export const routingManagementSave = data => createAPI(`/plm/routingManagement/routingManagementSave`,'post',data) + +/** + * routing编辑 + * @param data + * @returns {*} + */ +export const routingManagementEdit = data => createAPI(`/plm/routingManagement/routingManagementEdit`,'post',data) + +/** + * routing删除 + * @param data + * @returns {*} + */ +export const routingManagementDelete = data => createAPI(`/plm/routingManagement/routingManagementDelete`,'post',data) + +/** + * 查询物料清单 + * @param data + * @returns {*} + */ +export const queryPartList = data => createAPI(`/plm/routingManagement/queryPartList`,'post',data) + +/** + * 查routing明细 + * @param data + * @returns {*} + */ +export const queryRoutingDetail = data => createAPI(`/plm/routingManagement/queryRoutingDetail`,'post',data) + +/** + * 查routing明细 + * @param data + * @returns {*} + */ +export const queryRoutingComponent = data => createAPI(`/plm/routingManagement/queryRoutingComponent`,'post',data) + +/** + * routing明细新增 + * @param data + * @returns {*} + */ +export const routingDetailSave = data => createAPI(`/plm/routingManagement/routingDetailSave`,'post',data) + +/** + * routing明细删除 + * @param data + * @returns {*} + */ +export const routingDetailDelete = data => createAPI(`/plm/routingManagement/routingDetailDelete`,'post',data) + +/** + * 新增routing主信息 + * @param data + * @returns {*} + */ +export const saveRoutingHeader = data => createAPI(`/plm/routingManagement/saveRoutingHeader`,'post',data) + +/** + * 查询routing主信息 + * @param data + * @returns {*} + */ +export const queryRoutingHeader = data => createAPI(`/plm/routingManagement/queryRoutingHeader`,'post',data) + +/** + * 新增routing子明细 + * @param data + * @returns {*} + */ +export const saveRoutingComponent = data => createAPI(`/plm/routingManagement/saveRoutingComponent`,'post',data) + +/** + * 修改routing子明细 + * @param data + * @returns {*} + */ +export const updateRoutingComponent = data => createAPI(`/plm/routingManagement/updateRoutingComponent`,'post',data) + +/** + * 删除routing子明细 + * @param data + * @returns {*} + */ +export const deleteRoutingComponent = data => createAPI(`/plm/routingManagement/deleteRoutingComponent`,'post',data) + + + diff --git a/src/views/modules/part/bomManagement.vue b/src/views/modules/part/bomManagement.vue index 8ff6ebf..379afa6 100644 --- a/src/views/modules/part/bomManagement.vue +++ b/src/views/modules/part/bomManagement.vue @@ -29,7 +29,7 @@ - + - 新增 + 新增 删除 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + @@ -294,6 +237,7 @@ + @@ -362,55 +306,99 @@ -
- - - - - - - - - 查询 - - - - - - - - - -
- - 确认 - 关闭 + + + + + + + + + 查询 + + + + + + + +
+ + + + + + 子物料编码 + 子物料编码 + + + + + + + + + + + + + + + + + + + + + + + + + 工序 + + + + 发料库位 + + + + + + + + + + + + + + + + + + + + + 保存 + 关闭 @@ -431,12 +419,14 @@ import { bomDetailSave, // bom明细新增 bomDetailDelete, // bom明细删除 queryPartList, // 查询物料清单 - queryBomComponent, // 查bom子明细 + queryBomComponent, // 查询bom子明细 saveBomComponent, // 新增bom子明细 + updateBomComponent, // 修改bom子明细 deleteBomComponent, // 删除bom子明细 } from '@/api/part/bomManagement.js' import ChooseList from '@/views/modules/common/Chooselist' import dayjs from "dayjs"; +import fa from "element-ui/src/locale/lang/fa"; export default { // 组件 @@ -522,7 +512,8 @@ export default { updateDate: '', updateBy: '' }, - subDetailData: { + componentData: { + flag: '', site: this.$store.state.user.site, partNo: '', engChgLevel: '', @@ -531,13 +522,16 @@ export default { componentPart: '', componentPartDesc: '', printUnit: '', + printUnitName: '', qtyPerAssembly: '', componentScrap: '', issueType: '', shrinkageFactor: '', lineItemNo: '', operationNo: '', + operationName: '', issueToLoc: '', + issueToLocName: '', noteText: '', createDate: '', createBy: '', @@ -839,7 +833,7 @@ export default { tableName: 'BOM子物料表', columnProp: 'printUnitName', headerAlign: 'center', - align: 'left', + align: 'center', columnLabel: '单位', columnHidden: false, columnImage: false, @@ -855,9 +849,9 @@ export default { serialNumber: '104002Table2IssueType', tableId: '104002Table2', tableName: 'BOM子物料表', - columnProp: 'issueType', + columnProp: 'issueTypeName', headerAlign: 'center', - align: 'left', + align: 'center', columnLabel: '生产属性', columnHidden: false, columnImage: false, @@ -891,9 +885,9 @@ export default { serialNumber: '104002Table2IssueToLoc', tableId: '104002Table2', tableName: 'BOM子物料表', - columnProp: 'issueToLoc', + columnProp: 'issueToLocName', headerAlign: 'center', - align: 'left', + align: 'center', columnLabel: '发料库位', columnHidden: false, columnImage: false, @@ -1004,6 +998,50 @@ export default { } ], }, + componentRules: { + componentPart: [ + { + required: true, + message: ' ', + trigger: 'change' + } + ], + componentPartDesc: [ + { + required: true, + message: ' ', + trigger: 'change' + } + ], + qtyPerAssembly: [ + { + required: true, + message: ' ', + trigger: 'change' + } + ], + componentScrap: [ + { + required: true, + message: ' ', + trigger: 'change' + } + ], + shrinkageFactor: [ + { + required: true, + message: ' ', + trigger: 'change' + } + ], + issueType: [ + { + required: true, + message: ' ', + trigger: 'change' + } + ] + }, // ======== 复选数据集 ======== bomSelections: [], // ======== 模态框开关控制 ======== @@ -1011,7 +1049,9 @@ export default { modalDisableFlag: false, partModelFlag: false, componentPartModelFlag: false, - saveDetailModalFlag :false + saveDetailModalFlag :false, + componentSaveModal: false, + componentDisableFlag: false } }, mounted () { @@ -1187,6 +1227,71 @@ export default { } }) }, + /** + * 新增子明细 + */ + saveComponentModal () { + if (this.detailData.alternativeNo === '' || this.detailData.alternativeNo == null) { + this.$message.warning('请先选择替代!') + return + } + this.componentData = { + flag: '1', + site: this.$store.state.user.site, + partNo: this.modalData.partNo, + engChgLevel: this.modalData.engChgLevel, + bomType: this.modalData.bomType, + alternativeNo: this.detailData.alternativeNo, + componentPart: '', + componentPartDesc: '', + printUnit: '', + printUnitName: '', + qtyPerAssembly: '', + componentScrap: '', + issueType: '', + shrinkageFactor: '', + lineItemNo: '', + operationNo: '', + operationName: '', + issueToLoc: '', + issueToLocName: '', + noteText: '', + createBy: this.$store.state.user.name, + } + this.componentDisableFlag = false + this.componentSaveModal = true + }, + /** + * 编辑模态框 + */ + updateComponentModal (row) { + this.componentData = { + flag: '2', + site: row.site, + partNo: row.partNo, + engChgLevel: row.engChgLevel, + bomType: row.bomType, + alternativeNo: row.alternativeNo, + componentPart: row.componentPart, + componentPartDesc: row.componentPartDesc, + printUnit: row.printUnit, + printUnitName: row.printUnitName, + qtyPerAssembly: row.qtyPerAssembly, + componentScrap: row.componentScrap, + issueType: row.issueType, + shrinkageFactor: row.shrinkageFactor, + lineItemNo: row.lineItemNo, + operationNo: row.operationNo, + operationName: row.operationName, + issueToLoc: row.issueToLoc, + issueToLocName: row.issueToLocName, + noteText: row.noteText, + updateBy: this.$store.state.user.name, + } + this.componentDisableFlag = true + this.componentSaveModal = true + }, + // ======== 新增/编辑/删除方法 ======== /** @@ -1351,7 +1456,7 @@ export default { }) }, /** - * 查询未建 bom 的物料 + * 查询物料 */ queryPartList () { queryPartList(this.partData).then(({data}) => { @@ -1374,14 +1479,15 @@ export default { this.modalData.partDesc = row.partDesc this.partModelFlag = false }, + getComponentRowData (row) { + this.componentData.componentPart = row.partNo + this.componentData.componentPartDesc = row.partDesc + this.componentPartModelFlag = false + }, /** - * 新增子明细 + * 物料列表 */ queryComponentPartList () { - if (this.detailData.alternativeNo === '' || this.detailData.alternativeNo == null) { - this.$message.warning('请先选择替代!') - return - } // 查询所有物料 queryPartList(this.componentPartData).then(({data}) => { if (data && data.code === 0) { @@ -1421,23 +1527,6 @@ export default { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning" - // callback: (action) => { - // if (action === "confirm") { - // let val = this.checkedDetail - // val.forEach((val, index) => { - // this.subDetailList.forEach((v, i) => { - // if (val.xh === v.xh) { - // this.subDetailList.splice(i, 1) - // } - // }) - // }) - // this.$message({message: "删除成功!", type: "success",}) - // return - // } else { - // this.$message({message: "已取消删除操作", type: "warning",}) - // return - // } - // }, }).then(() => { let tempData = { informationList: this.checkedDetail @@ -1465,60 +1554,98 @@ export default { * 子物料 * @param row */ - componentPartClickRow (row) { - this.$refs.componentPartTable.toggleRowSelection(row) - }, + // componentPartClickRow (row) { + // this.$refs.componentPartTable.toggleRowSelection(row) + // }, componentClickRow (row) { this.$refs.componentTable.toggleRowSelection(row) }, + // /** + // * 多选子物料 + // * @param val + // */ + // selectionComponentPart (val) { + // this.componentPartSelections = val + // }, + // getRowKeys(row) { + // // 唯一值,一般都为id + // return row.partNo + // }, /** - * 多选子物料 - * @param val - */ - selectionComponentPart (val) { - this.componentPartSelections = val - }, - getRowKeys(row) { - // 唯一值,一般都为id - return row.partNo - }, - /** - * 提交选中的子物料 + * 新增子明细方法 */ - confirmComponentPart () { - // for (let i = 0; i < this.componentPartSelections.length; i++) { - // let obj = {} - // obj.site = this.$store.state.user.site - // obj.partNo = this.modalData.partNo - // obj.engChgLevel = this.modalData.engChgLevel - // obj.bomType = this.modalData.bomType - // obj.alternativeNo = this.detailData.alternativeNo - // obj.componentPart = this.componentPartSelections[i].partNo - // obj.componentPartDesc = this.componentPartSelections[i].partDesc - // obj.qtyPerAssembly = '' - // obj.printUnit = this.componentPartSelections[i].umId - // obj.printUnitName = this.componentPartSelections[i].umName - // this.subDetailList.push(obj) - // } - let tempData = { - site: this.$store.state.user.site, - partNo: this.modalData.partNo, - engChgLevel: this.modalData.engChgLevel, - bomType: this.modalData.bomType, - alternativeNo: this.detailData.alternativeNo, - createBy: this.$store.state.user.name, - informationList: this.componentPartSelections + componentDataSave () { + if (this.componentData.partNo === '' || this.componentData.partNo == null) { + this.$message.warning('请选择主记录物料编码!') + return + } + if (this.componentData.bomType === '' || this.componentData.bomType == null) { + this.$message.warning('请选择主记录制造类型!') + return + } + if (this.componentData.engChgLevel === '' || this.componentData.engChgLevel == null) { + this.$message.warning('请填写主记录BOM版本号!') + return + } + if (this.componentData.componentPart === '' || this.componentData.componentPart == null) { + this.$message.warning('请选择子物料编码!') + return + } + if (this.componentData.componentPartDesc === '' || this.componentData.componentPartDesc == null) { + this.$message.warning('请选择子物料名称!') + return + } + if (this.componentData.qtyPerAssembly === '' || this.componentData.qtyPerAssembly == null) { + this.$message.warning('请填写单位用量!') + return + } + if (this.componentData.componentScrap === '' || this.componentData.componentScrap == null) { + this.$message.warning('请填写调机量!') + return + } + if (this.componentData.shrinkageFactor === '' || this.componentData.shrinkageFactor == null) { + this.$message.warning('请填写损耗率!') + return + } + if (this.componentData.issueType === '' || this.componentData.issueType == null) { + this.$message.warning('请选择生产属性!') + return + } + if (this.componentData.flag === '1') { + saveBomComponent(this.componentData).then(({data}) => { + if (data && data.code === 0) { + this.subDetailList = data.rows + this.componentSaveModal = false + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + } else if (this.componentData.flag === '2') { + updateBomComponent(this.componentData).then(({data}) => { + if (data && data.code === 0) { + this.subDetailList = data.rows + this.componentSaveModal = false + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) } - saveBomComponent(tempData).then(({data}) => { - if (data && data.code === 0) { - this.subDetailList = data.rows - this.componentPartModelFlag = false - } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) - } - }) }, /** * 回车事件 @@ -1743,8 +1870,8 @@ export default { this.tagNo = val this.$nextTick(() => { let strVal = '' - if (val === 116) { - strVal = this.modalData.partNo + if (val === 117) { + strVal = this.componentData.issueToLoc } this.$refs.baseList.init(val, strVal) }) @@ -1754,9 +1881,9 @@ export default { * @param val */ getBaseData (val) { - if (this.tagNo === 116) { - this.modalData.partNo = val.part_no - this.modalData.partDesc = val.part_desc + if (this.tagNo === 117) { + this.componentData.issueToLoc = val.location_id + this.componentData.issueToLocName = val.location_name } }, diff --git a/src/views/modules/part/routingManagement.vue b/src/views/modules/part/routingManagement.vue new file mode 100644 index 0000000..23e1205 --- /dev/null +++ b/src/views/modules/part/routingManagement.vue @@ -0,0 +1,1931 @@ + + + + + + + + + + + + + + +