diff --git a/src/api/part/bomManagement.js b/src/api/part/bomManagement.js index 29eb315..85c4cb8 100644 --- a/src/api/part/bomManagement.js +++ b/src/api/part/bomManagement.js @@ -176,5 +176,10 @@ export const queryPartListAll = data => createAPI(`/part/bomManagement/queryPart */ export const batchSaveBomComponent = data => createAPI(`/part/bomManagement/batchSaveBomComponent`,'post',data) - +/** + * 批量新增子件 + * @param data + * @returns {*} + */ +export const saveBomComponentByExcel = data => createAPI(`/part/bomManagement/saveBomComponentByExcel`,'post',data) diff --git a/src/views/modules/eam/eamWorkOrderForDefect.vue b/src/views/modules/eam/eamWorkOrderForDefect.vue index 9a8d779..82e9518 100644 --- a/src/views/modules/eam/eamWorkOrderForDefect.vue +++ b/src/views/modules/eam/eamWorkOrderForDefect.vue @@ -1421,6 +1421,14 @@ this.$message.warning('到达时间不能大于实际执行时间!') return } + if (this.detailData.faultReason === '' || this.detailData.faultReason == null || this.detailData.faultReason.length < 10) { + this.$message.warning('请填写故障原因,且不低于十个字数!') + return + } + if (this.detailData.handlingMethod === '' || this.detailData.handlingMethod == null || this.detailData.handlingMethod.length < 10) { + this.$message.warning('请填写处理方式,且不低于十个字数!') + return + } updateReportResult(this.detailData).then(({data}) => { if (data && data.code === 0) { this.getDataList() diff --git a/src/views/modules/part/bomManagement.vue b/src/views/modules/part/bomManagement.vue index 6e968c2..2879716 100644 --- a/src/views/modules/part/bomManagement.vue +++ b/src/views/modules/part/bomManagement.vue @@ -228,6 +228,7 @@ 新增 批量新增 + 导入 删除 @@ -784,68 +785,183 @@ - - - - - - - - - - - 查询 - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + 查询 + + + + + +
+ + + 可选物料 + + + + + + + + + + + + +
+ 添加>> +
+
+ 删除<< +
+
+ + 已选物料 + + + + + + + + + +
+ 保存 关闭
+ + + @@ -882,10 +998,12 @@ import { import {getSiteAndBuByUserName, getSiteAndBuByUserName2} from "@/api/qc/qc.js" import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" import ChooseList from '@/views/modules/common/Chooselist_eam' +import BomComponentUpload from "./bom_component_upload.vue"; export default { // 组件 components: { + BomComponentUpload, ChooseList }, // 监听 @@ -1152,6 +1270,7 @@ export default { checkedDetail: [], checkedByProduct: [], operationList: [], + choosePartList: [], // ======== 列表表头 ======== columnList: [ { @@ -1452,7 +1571,7 @@ export default { { columnProp: 'partNo', headerAlign: "center", - align: "center", + align: "left", columnLabel: '物料编码', columnHidden: false, columnImage: false, @@ -1907,6 +2026,7 @@ export default { // ======== 复选数据集 ======== bomSelections: [], batchComponentSelections: [], + batchComponentSelections2: [], // ======== 模态框开关控制 ======== authSearch: false, authSave: false, @@ -2156,6 +2276,16 @@ export default { this.batchComponentSelections = val }, + // 点击行选中复选框 + batchSaveClickRow2 (row) { + this.$refs.batchSaveTable2.toggleRowSelection(row) + }, + + // 复选子物料信息 + selectionSaveComponent2 (val) { + this.batchComponentSelections2 = val + }, + // ======== 新增/编辑模态框 ======== /** * bom新增模态框 @@ -2398,6 +2528,10 @@ export default { // 批量新增子物料模态框 batchSaveComponentModal () { + this.pageSize5 = 20 + this.pageIndex5 = 1 + this.batchComponentPartData.partNo = '' + this.batchComponentPartData.partDesc = '' this.batchComponentPartData.limit = this.pageSize5 this.batchComponentPartData.page = this.pageIndex5 this.batchComponentPartData.site = this.modalData.site @@ -2414,6 +2548,25 @@ export default { this.batchComponentPartList = [] } }) + this.batchComponentPartData.shrinkageFactor = 0 + this.choosePartList = [] + }, + + // 子物料批量导入 + bomComponentUpload () { + let currentData = { + site: this.detailData.site, + buNo: this.detailData.buNo, + partNo: this.detailData.partNo, + engChgLevel: this.detailData.engChgLevel, + bomType: this.detailData.bomType, + alternativeNo: this.detailData.alternativeNo, + createBy: this.$store.state.user.name, + } + //打开组件 去做新增业务 + this.$nextTick(() => { + this.$refs.BomComponentUpload.init(currentData) + }) }, /** @@ -2837,7 +2990,7 @@ export default { this.componentPartData.limit = this.pageSize3 this.componentPartData.page = this.pageIndex3 // 查询所有物料 - queryPartList(this.componentPartData).then(({data}) => { + queryPartListAll(this.componentPartData).then(({data}) => { if (data && data.code === 0) { this.componentPartList = data.page.list this.pageIndex3 = data.page.currPage @@ -2856,7 +3009,7 @@ export default { this.batchComponentPartData.limit = this.pageSize5 this.batchComponentPartData.page = this.pageIndex5 // 查询所有物料 - queryPartList(this.batchComponentPartData).then(({data}) => { + queryPartListAll(this.batchComponentPartData).then(({data}) => { if (data && data.code === 0) { this.batchComponentPartList = data.page.list this.pageIndex5 = data.page.currPage @@ -3018,13 +3171,13 @@ export default { } }, - /** - * 子物料 - * @param row - */ - componentClickRow (row) { - this.$refs.componentTable.toggleRowSelection(row) - }, + // /** + // * 子物料 + // * @param row + // */ + // componentClickRow (row) { + // this.$refs.componentTable.toggleRowSelection(row) + // }, /** * 新增子明细方法 @@ -3121,7 +3274,7 @@ export default { // 批量新增子件 batchComponentDataSave () { - this.$confirm("是否确认添加该"+ this.batchComponentSelections.length +"条子件记录?", "提示", { + this.$confirm("是否确认添加该"+ this.choosePartList.length +"条子件记录?", "提示", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning" @@ -3147,7 +3300,7 @@ export default { lineSequence: '', issueType: 'Reserve And Backflush', productFlag: 'component', - batchSaveList: this.batchComponentSelections + batchSaveList: this.choosePartList } batchSaveBomComponent(tempData).then(({data}) => { if (data && data.code === 0) { @@ -3177,6 +3330,33 @@ export default { }) }, + batchAddPart () { + if (this.batchComponentSelections == null || this.batchComponentSelections.length === 0) { + this.$message.warning('请选择可选物料!') + return + } + // 创建一个 Set 来存储已选择的元素 + const chosenSet = new Set(this.choosePartList.map(item => `${item.site}-${item.partNo}`)) + // 检查是否有重复元素 + const hasDuplicates = this.batchComponentSelections.some(item => chosenSet.has(`${item.site}-${item.partNo}`)) + if (hasDuplicates) { + this.$message.warning('所选物料中包含已存在的物料,请重新选择!') + return + } + this.choosePartList = [...this.choosePartList, ...this.batchComponentSelections] + }, + + batchDeletePart () { + if (this.batchComponentSelections2 == null || this.batchComponentSelections2.length === 0) { + this.$message.warning('请选择已选物料!') + return + } + // 创建一个 Set 来存储 batchComponentSelections 中的键值对 + const set = new Set(this.batchComponentSelections2.map(item => `${item.site}-${item.partNo}`)) + // 过滤 choosePartList,移除与 batchComponentSelections 匹配的元素 + this.choosePartList = this.choosePartList.filter(item => !set.has(`${item.site}-${item.partNo}`)) + }, + /** * 回车事件 */ diff --git a/src/views/modules/part/bom_component_upload.vue b/src/views/modules/part/bom_component_upload.vue new file mode 100644 index 0000000..3835fcf --- /dev/null +++ b/src/views/modules/part/bom_component_upload.vue @@ -0,0 +1,151 @@ + + + diff --git a/src/views/modules/part/partInformation.vue b/src/views/modules/part/partInformation.vue index 8de967f..6d5aeb1 100644 --- a/src/views/modules/part/partInformation.vue +++ b/src/views/modules/part/partInformation.vue @@ -280,7 +280,7 @@
- + @@ -290,7 +290,7 @@
/deep/ .customer-tab .el-tabs__content { padding: 0px !important; - height: 459px; -} -/deep/ .customer-tab .el-tabs__content { - height: 294px; } +///deep/ .customer-tab .el-tabs__content { +// +//} .el-table /deep/ .cell{ height: auto; line-height: 1.5; diff --git a/src/views/modules/part/standardRoutingOperation.vue b/src/views/modules/part/standardRoutingOperation.vue index 81fdf9e..f154b1c 100644 --- a/src/views/modules/part/standardRoutingOperation.vue +++ b/src/views/modules/part/standardRoutingOperation.vue @@ -133,6 +133,20 @@ + + + + + + + + + + + + + + 保存 关闭 @@ -215,6 +229,10 @@ export default { setupLaborClassDesc: '', setupCrewSize: '', crewSize: '', + refDailyProduction: '', + refSpeed: '', + refTime: '', + refEfficiency: '' }, // ======== 数据列表 ======== dataList: [], @@ -742,10 +760,13 @@ export default { setupCrewSize: 1, crewSize: 1, createBy: this.$store.state.user.name, + refDailyProduction: undefined, + refSpeed: undefined, + refTime: undefined, + refEfficiency: undefined } this.modalDisableFlag = false this.modalFlag = true - console.log(this.modalData) }, /** @@ -771,6 +792,10 @@ export default { setupCrewSize: row.setupCrewSize, crewSize: row.crewSize, updateBy: this.$store.state.user.name, + refDailyProduction: row.refDailyProduction, + refSpeed: row.refSpeed, + refTime: row.refTime, + refEfficiency: row.refEfficiency } this.modalDisableFlag = true this.modalFlag = true