From 88389b278165806313d1f382da205caabbfe698a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= <2178503051@qq.com> Date: Mon, 11 May 2026 11:51:56 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat(CoilSelector):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E9=92=A2=E5=8D=B7=E9=80=89=E6=8B=A9=E5=99=A8=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E5=92=8C=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 重构钢卷选择器组件布局,改进多选模式下的用户体验。主要变更包括: 1. 调整列顺序和显示内容,优化表格布局 2. 添加全选当前页和清除全部功能按钮 3. 修复对话框滚动问题,优化样式 4. 完善已选钢卷统计区域的布局 5. 增加备注列显示 --- klp-ui/src/assets/styles/element-ui.scss | 3 +- klp-ui/src/components/CoilSelector/data.js | 29 +- klp-ui/src/components/CoilSelector/index.vue | 393 +++++++++++-------- 3 files changed, 243 insertions(+), 182 deletions(-) diff --git a/klp-ui/src/assets/styles/element-ui.scss b/klp-ui/src/assets/styles/element-ui.scss index 9a16eafb..8e0d00d7 100644 --- a/klp-ui/src/assets/styles/element-ui.scss +++ b/klp-ui/src/assets/styles/element-ui.scss @@ -947,7 +947,8 @@ body { .el-dialog.is-fullscreen { .el-dialog__body { padding: $--spacing-lg; - max-height: calc(100vh - 100px); + height: calc(100vh - 100px); + max-height: 100vh; overflow-y: auto; } } diff --git a/klp-ui/src/components/CoilSelector/data.js b/klp-ui/src/components/CoilSelector/data.js index 3bcbc004..1234331d 100644 --- a/klp-ui/src/components/CoilSelector/data.js +++ b/klp-ui/src/components/CoilSelector/data.js @@ -1,5 +1,4 @@ -export const defaultColumns = [ - { +export const defaultColumns = [{ label: '入场卷号', align: 'center', prop: 'enterCoilNo', @@ -30,6 +29,12 @@ export const defaultColumns = [ prop: 'specification', width: '100' }, + { + label: '重量(t)', + align: 'center', + prop: 'netWeight', + width: '100' + }, { label: '材质', align: 'center', @@ -42,12 +47,6 @@ export const defaultColumns = [ prop: 'manufacturer', width: '100' }, - { - label: '重量(t)', - align: 'center', - prop: 'netWeight', - width: '100' - }, { label: '库区', align: 'center', @@ -62,10 +61,10 @@ export const defaultColumns = [ width: '100', showOverflowTooltip: true }, - { - label: '备注', - align: 'center', - prop: 'remark', - showOverflowTooltip: true - } -] \ No newline at end of file + // { + // label: '备注', + // align: 'center', + // prop: 'remark', + // showOverflowTooltip: true + // } +] diff --git a/klp-ui/src/components/CoilSelector/index.vue b/klp-ui/src/components/CoilSelector/index.vue index c072d6b6..26701f9c 100644 --- a/klp-ui/src/components/CoilSelector/index.vue +++ b/klp-ui/src/components/CoilSelector/index.vue @@ -19,179 +19,190 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - 搜索 - 重置 - 显示钢卷地图 - 显示订单详情 - - + + 搜索 + 重置 + 全选当前卷 + 显示钢卷地图 + 显示订单详情 + + -
- - - + + +
+ + +
+ + + + + + + + + + + + + +
+ + 总净重:{{ coilTrimStatistics.total_net_weight || 0 }}t + + + +
+ @@ -287,6 +288,75 @@
+ + + +
+ +
+
选择合同
+ + + + + + + + + + + + 搜索 + 重置 + + + + + + + + + + + + + +
+ +
+
+ + +
+
选择明细(多选)
+ + + + + + + + + + + + + + + +
+
+ +
@@ -351,7 +421,31 @@ export default { // 订单明细加载状态 orderItemLoading: false, // 当前编辑的行 - currentEditingRow: null + currentEditingRow: null, + // 批量新增对话框 + batchAddDialogVisible: false, + // 批量查询参数 + batchQueryParams: { + pageNum: 1, + pageSize: 10, + contractCode: undefined, + customerName: undefined, + salesman: undefined + }, + // 批量订单列表 + batchOrderList: [], + // 批量订单总数 + batchOrderTotal: 0, + // 批量订单加载状态 + batchOrderLoading: false, + // 批量明细列表 + batchItemList: [], + // 批量明细加载状态 + batchItemLoading: false, + // 选中的合同 + selectedContract: null, + // 选中的明细 + selectedBatchItems: [] }; }, created() { @@ -582,6 +676,98 @@ export default { // 处理订单行点击 handleOrderSelect(row) { this.selectOrder(row); + }, + // 打开批量新增对话框 + handleBatchAdd() { + this.batchAddDialogVisible = true; + this.selectedContract = null; + this.selectedBatchItems = []; + this.getBatchOrderList(); + }, + // 获取批量订单列表 + getBatchOrderList() { + this.batchOrderLoading = true; + listOrder(this.batchQueryParams).then(response => { + this.batchOrderList = response.rows; + this.batchOrderTotal = response.total; + this.batchOrderLoading = false; + }); + }, + // 重置批量查询参数 + resetBatchQuery() { + this.batchQueryParams = { + pageNum: 1, + pageSize: 10, + contractCode: undefined, + customerName: undefined, + salesman: undefined + }; + this.getBatchOrderList(); + }, + // 选择批量合同 + selectBatchContract(row) { + this.selectedContract = row; + this.selectedBatchItems = []; + this.batchItemLoading = true; + listOrderItem({ orderId: row.orderId }).then(res => { + this.batchItemList = res.rows; + this.batchItemLoading = false; + }); + }, + // 处理批量明细选择变更 + handleBatchItemSelectionChange(selection) { + this.selectedBatchItems = selection; + }, + // 确认批量新增 + confirmBatchAdd() { + if (this.selectedBatchItems.length === 0) { + this.$message.warning('请至少选择一条明细'); + return; + } + + this.$confirm(`确认新增 ${this.selectedBatchItems.length} 条明细?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + const currentMaxSeqNo = this.planDetailList.length > 0 + ? Math.max(...this.planDetailList.map(item => parseInt(item.bizSeqNo) || 0)) + : 0; + + const addPromises = this.selectedBatchItems.map((item, index) => { + const newRow = { + planSheetId: this.currentPlanSheetId, + bizSeqNo: currentMaxSeqNo + index + 1, + orderCode: this.selectedContract.orderCode, + contractCode: this.selectedContract.contractCode, + customerName: this.selectedContract.companyName, + salesman: this.selectedContract.salesman, + orderId: this.selectedContract.orderId, + productName: item.productType, + productMaterial: item.material, + productWidth: item.width, + rollingThick: item.thickness, + markCoatThick: item.thickness, + tonSteelLengthRange: 0, + planQty: item.productNum, + planWeight: item.weight, + surfaceTreatment: item.surfaceTreatment, + productPackaging: item.packagingReq, + widthReq: item.edgeCuttingReq, + productEdgeReq: item.widthTolerance, + usageReq: item.purpose + }; + return addPlanDetail(newRow); + }); + + Promise.all(addPromises).then(() => { + this.$message.success('批量新增成功'); + this.batchAddDialogVisible = false; + this.getList(); + }).catch(error => { + this.$message.error('批量新增失败'); + }); + }); } } }; @@ -654,4 +840,25 @@ export default { /* ::v-deep .el-input__inner { padding: 0 1px; } */ + +.batch-add-content { + padding: 10px 0; +} + +.contract-section { + margin-bottom: 30px; + padding-bottom: 20px; + border-bottom: 1px solid #eee; +} + +.item-section { + margin-top: 20px; +} + +.section-title { + font-size: 14px; + font-weight: 600; + margin-bottom: 15px; + color: #303133; +}