diff --git a/src/views/productionManagement/beforeAndAfterPlating/afterPlating.vue b/src/views/productionManagement/beforeAndAfterPlating/afterPlating.vue index 83edda1..6c6f5fd 100644 --- a/src/views/productionManagement/beforeAndAfterPlating/afterPlating.vue +++ b/src/views/productionManagement/beforeAndAfterPlating/afterPlating.vue @@ -23,6 +23,9 @@ + - + - + - + - - - - + + + - + + + + + - + - + - + - + - + + - @@ -95,6 +110,17 @@ export default { }, data() { return { + tableHeight: 400, + descriptionList: [ + { + label: '入库', + value: 1, + }, + { + label: '转工', + value: 0, + }, + ], sunmitLoading: false, tableLoading: false, formError: '', @@ -145,8 +171,32 @@ export default { }, }; }, - mounted() {}, + mounted() { + this.$nextTick(() => { + this.calculateTableHeight(); + }); + }, methods: { + // 计算表格高度 + calculateTableHeight() { + this.$nextTick(() => { + const dialogContainer = document.querySelector('.el-dialog__body'); + if (!dialogContainer) return; + + const containerHeight = dialogContainer.clientHeight; + + // 减去其他元素高度 + const inputAreaHeight = 50; + const errorHeight = 30; + const formPadding = 40; + const footerHeight = 10; + + const calculatedHeight = + containerHeight - inputAreaHeight - errorHeight - formPadding - footerHeight; + + this.tableHeight = Math.max(300, Math.min(calculatedHeight, 800)); + }); + }, open() { this.cardNo = ''; this.form.beforePlatingEntryData = []; @@ -155,7 +205,8 @@ export default { this.tableLoading = true; getAfterPlatCardNo({ cardNo: this.cardNo }) .then(res => { - this.form.beforePlatingEntryData = res.data; + this.form.beforePlatingEntryData.push(res.data.data); + this.tableLoading = false; }) .catch(err => { this.tableLoading = false; @@ -190,10 +241,24 @@ export default { const { _select, ...validData } = row; // 剔除选择状态字段 return validData; }); + this.sunmitLoading = true; + // 调用接口提交(实际项目替换) try { - savePlateAroundPlateAfterEnter(this.form.beforePlatingEntryData) + let query = []; + this.form.beforePlatingEntryData.forEach(item => { + query.push({ + wpId: item.wpId, + tsId: item.teamId, + ocId: item.ocId ? item.ocId : null, + quantity: item.inQuantity, + hrTypeBool:item.hrTypeBool, + useDept:item.useDept, + weight:item.weight + }); + }); + savePlateAroundPlateAfterEnter(query) .then(res => { this.$message.success('提交成功'); this.closeDialog(); diff --git a/src/views/productionManagement/beforeAndAfterPlating/components/beforePlatingBoundDialog.vue b/src/views/productionManagement/beforeAndAfterPlating/components/beforePlatingBoundDialog.vue index 1043a68..c2a4a20 100644 --- a/src/views/productionManagement/beforeAndAfterPlating/components/beforePlatingBoundDialog.vue +++ b/src/views/productionManagement/beforeAndAfterPlating/components/beforePlatingBoundDialog.vue @@ -53,16 +53,16 @@ align="center" width="200" > - + - - + + - + @@ -129,7 +129,7 @@ export default { this.tableLoading = true; getBeforePlatOutCardNo({ cardNo: this.cardNo }) .then(res => { - this.form.beforePlatingEntryData.push(res.data); + this.form.beforePlatingEntryData.push(res.data.data); this.tableLoading = false; }) .catch(err => { @@ -175,8 +175,11 @@ export default { wpId: item.wpId, tsId: item.teamId, ocId: item.ocId ? item.ocId : null, + id: item.id, + quantity: item.inQuantity, }); }); + savePlateAroundPlateFrontIssue(query) .then(res => { this.$message.success('提交成功'); diff --git a/src/views/productionManagement/beforeAndAfterPlating/components/beforePlatingEntryDialog.vue b/src/views/productionManagement/beforeAndAfterPlating/components/beforePlatingEntryDialog.vue index 551f168..985058c 100644 --- a/src/views/productionManagement/beforeAndAfterPlating/components/beforePlatingEntryDialog.vue +++ b/src/views/productionManagement/beforeAndAfterPlating/components/beforePlatingEntryDialog.vue @@ -257,6 +257,7 @@ export default { wpId: item.wpId, tsId: item.teamId, ocId: item.ocId ? item.ocId : null, + quantity:item.inQuantity }); }); savePlateAroundPlateFrontEnter(query) diff --git a/src/views/productionManagement/beforeAndAfterPlating/index.vue b/src/views/productionManagement/beforeAndAfterPlating/index.vue index 084b9f0..f0b845f 100644 --- a/src/views/productionManagement/beforeAndAfterPlating/index.vue +++ b/src/views/productionManagement/beforeAndAfterPlating/index.vue @@ -20,6 +20,7 @@ :data="data" v-model="form" v-model:page="page" + v-model.query="query" ref="crud" @row-del="rowDel" @search-change="searchChange" @@ -124,7 +125,7 @@ export default { total: 0, }, query: { - paType: 1, //1-镀前入库 2-镀前出库 3-镀后入库 + paType: 3, //1-镀前入库 2-镀前出库 3-镀后入库 }, }; }, @@ -183,21 +184,15 @@ export default { this.showDialog = false; this.boundDialog = false; this.afterBoundDialog = false; + this.onLoad(this.page, this.query); }, tabPositionChange(value, event) { this.option.column = columnData[this.tabPosition]; this.option.menu = false; - if (this.tabPosition == 'beforePlatingEntry') { - this.query.paType = 1; - this.onLoad(this.page, this.query); - } else if (this.tabPosition == 'beforePlatingBound') { - this.query.paType = 2; - this.onLoad(this.page, this.query); - } else { - this.option.menu = true; + if (this.tabPosition == 'afterPlatingEntry') { this.query.paType = 3; this.onLoad(this.page, this.query); - } + } }, onLoad(page, params = {}) { this.loading = true; diff --git a/src/views/productionManagement/js/platingColumnData.js b/src/views/productionManagement/js/platingColumnData.js index 3b1aa44..b14c539 100644 --- a/src/views/productionManagement/js/platingColumnData.js +++ b/src/views/productionManagement/js/platingColumnData.js @@ -60,7 +60,7 @@ export default { }, { label: '入库班组/供应商', - prop: 'tsName', + prop: 'tsId', span: 24, width: 200, search: false, @@ -175,7 +175,7 @@ export default { }, { label: '出库班组/供应商', - prop: 'tsName', + prop: 'tsId', width: 200, span: 24, search: false, @@ -192,7 +192,7 @@ export default { }, { label: '出库工序名称', - prop: 'ppsName', + prop: 'ppsId', width: 150, span: 24, search: true, @@ -201,7 +201,7 @@ export default { }, { label: '出库人员', - prop: 'userName', + prop: 'createUser', width: 150, span: 24, search: false, @@ -289,30 +289,30 @@ export default { }, { label: '入库班组/供应商', - prop: 'tsName', + prop: 'tsId', span: 24, width: 200, search: false, }, - { - label: '班组', - prop: 'tsId', - type: 'select', - span: 24, - search: true, - hide: true, + // { + // label: '班组', + // prop: 'tsId', + // type: 'select', + // span: 24, + // search: true, + // hide: true, - }, - { - label: '供应商', - prop: 'ocId', - type: 'select', - span: 24, - search: true, - hide: true, + // }, + // { + // label: '供应商', + // prop: 'ocId', + // type: 'select', + // span: 24, + // search: true, + // hide: true, - }, + // }, { label: '入库工序号', prop: 'orders', @@ -324,7 +324,7 @@ export default { }, { label: '入库工序名称', - prop: 'ppsName', + prop: 'ppsId', width: 150, span: 24, search: true, @@ -333,7 +333,7 @@ export default { }, { label: '入库人员', - prop: 'userName', + prop: 'createUser', width: 150, span: 24, search: false,