From b7513bdd2dd1f9556c790f216792495433495210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Thu, 18 Dec 2025 10:51:00 +0800 Subject: [PATCH 1/2] =?UTF-8?q?refactor(ui):=20=E4=BC=98=E5=8C=96=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E4=BA=8B=E4=BB=B6=E5=A4=84=E7=90=86=E5=8F=8A=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E5=88=97=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复按钮事件冒泡问题,移除未使用的表格列和代码 清理库存管理页面冗余状态和表单校验逻辑 --- klp-ui/src/views/crm/preOrder/index.vue | 6 +- klp-ui/src/views/wms/delivery/plan/index.vue | 4 +- klp-ui/src/views/wms/stock/index.vue | 104 +------------------ 3 files changed, 6 insertions(+), 108 deletions(-) diff --git a/klp-ui/src/views/crm/preOrder/index.vue b/klp-ui/src/views/crm/preOrder/index.vue index d0b7ab48..33316890 100644 --- a/klp-ui/src/views/crm/preOrder/index.vue +++ b/klp-ui/src/views/crm/preOrder/index.vue @@ -96,19 +96,19 @@ size="mini" type="text" icon="el-icon-check" - @click="handleApprove(scope.row)" + @click.stop="handleApprove(scope.row)" >审批 修改 删除 diff --git a/klp-ui/src/views/wms/delivery/plan/index.vue b/klp-ui/src/views/wms/delivery/plan/index.vue index b247cfa7..27f06f7b 100644 --- a/klp-ui/src/views/wms/delivery/plan/index.vue +++ b/klp-ui/src/views/wms/delivery/plan/index.vue @@ -89,7 +89,7 @@ - + - + diff --git a/klp-ui/src/views/wms/stock/index.vue b/klp-ui/src/views/wms/stock/index.vue index 692dd1ab..2859875a 100644 --- a/klp-ui/src/views/wms/stock/index.vue +++ b/klp-ui/src/views/wms/stock/index.vue @@ -115,12 +115,6 @@ export default { buttonLoading: false, // 遮罩层 loading: true, - // 选中数组 - ids: [], - // 非单个禁用 - single: true, - // 非多个禁用 - multiple: true, // 显示搜索条件 showSearch: true, // 总条数 @@ -146,31 +140,6 @@ export default { warehouseType: 'real', // 表单参数 form: {}, - // 表单校验 - rules: { - warehouseId: [ - { required: true, message: "仓库/库区/库位ID不能为空", trigger: "blur" } - ], - itemType: [ - { required: true, message: "物品类型不能为空", trigger: "change" } - ], - itemId: [ - { required: true, message: "物品ID不能为空", trigger: "blur" } - ], - quantity: [ - { required: true, message: "库存数量不能为空", trigger: "blur" } - ], - unit: [ - { required: true, message: "单位不能为空", trigger: "blur" } - ], - batchNo: [ - { required: true, message: "批次号不能为空", trigger: "blur" } - ], - }, - // 暂存用于创建出库单或移库单的数据 - stockBoxData: [], - // 选中的数据 - selectedRows: [], // 钻取相关数据 drillDownVisible: false, dialogTitle: '', @@ -270,11 +239,6 @@ export default { this.queryParams.pageNum = 1; this.getList(); }, - // 取消按钮 - cancel() { - this.open = false; - this.reset(); - }, // 表单重置 reset() { this.form = { @@ -304,78 +268,12 @@ export default { this.resetForm("queryForm"); this.handleQuery(); }, - // 多选框选中数据 - handleSelectionChange(selection) { - this.selectedRows = selection; - this.ids = selection.map(item => item.stockId) - this.single = selection.length !== 1 - this.multiple = !selection.length - }, - /** 提交按钮 */ - submitForm() { - this.$refs["form"].validate(valid => { - if (valid) { - this.buttonLoading = true; - if (this.form.stockId != null) { - updateStock(this.form).then(response => { - this.$modal.msgSuccess("修改成功"); - this.open = false; - this.getList(); - }).finally(() => { - this.buttonLoading = false; - }); - } else { - addStock(this.form).then(response => { - this.$modal.msgSuccess("新增成功"); - this.open = false; - this.getList(); - }).finally(() => { - this.buttonLoading = false; - }); - } - } - }); - }, - /** 删除按钮操作 */ - handleDelete(row) { - const stockIds = row.stockId || this.ids; - this.$modal.confirm('是否确认删除库存:原材料/产品与库区/库位的存放关系编号为"' + stockIds + '"的数据项?').then(() => { - this.loading = true; - return delStock(stockIds); - }).then(() => { - this.loading = false; - this.getList(); - this.$modal.msgSuccess("删除成功"); - }).catch(() => { - }).finally(() => { - this.loading = false; - }); - }, /** 导出按钮操作 */ handleExport() { this.download('wms/stock/export', { ...this.queryParams }, `stock_${new Date().getTime()}.xlsx`) }, - handleStockBox() { - // 添加到暂存单据中,并且去重,去重依据为stockId是否相同 - const list = [...this.selectedRows, ...this.stockBoxData]; - const uniqueStockBoxData = list.filter((item, index, self) => - index === self.findIndex(t => t.stockId === item.stockId) - ); - this.stockBoxData = uniqueStockBoxData; - - this.$modal.msgSuccess("暂存成功,请点击“暂存单据”按钮生成单据"); - }, - handleGenerateBill(data) { - addStockIoWithDetail(data).then(response => { - this.$modal.msgSuccess("生成单据成功"); - }); - }, - handleViewStockBox() { - // 查看暂存单据 - this.stockBoxVisible = true; - }, /** 处理表格行点击 */ handleTableRowClick(row) { this.handleDrillDown(row); @@ -411,7 +309,7 @@ export default { '未知物料'; // 设置对话框标题 - this.dialogTitle = `${row.itemType === 'product' ? '成品' : '原材料'}库存明细 - ${this.drillDownParams.itemName}`; + this.dialogTitle = `${row.itemType === 'product' ? '成品' : '原材料'}库存明细`; // 打开弹窗 this.drillDownVisible = true; From e900aec86b529815369fc48b7582d0a26a24d59f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Thu, 18 Dec 2025 11:51:14 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat(=E9=94=80=E5=94=AE=E6=9D=83=E9=99=90):?= =?UTF-8?q?=20=E5=AE=9E=E7=8E=B0=E9=92=A2=E5=8D=B7=E9=94=80=E5=94=AE?= =?UTF-8?q?=E6=9D=83=E9=99=90=E5=88=86=E9=85=8D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增销售权限管理模块,包含以下功能: 1. 在用户模块添加id字段用于权限控制 2. 重构CoilSelector组件支持销售视角权限过滤 3. 新增销售权限分配页面,支持钢卷分配与移除 4. 优化表格样式和交互体验 组件现在支持根据用户权限动态显示和过滤钢卷数据,管理员可在新页面为销售分配钢卷权限 --- klp-ui/src/assets/styles/element-ui.scss | 4 +- klp-ui/src/components/CoilSelector/data.js | 52 ++ klp-ui/src/components/CoilSelector/index.vue | 172 ++--- .../components/HomeModules/StatisticGroup.vue | 4 +- klp-ui/src/store/getters.js | 1 + klp-ui/src/store/modules/user.js | 7 +- klp-ui/src/views/index.vue | 3 +- klp-ui/src/views/wms/delivery/permi/index.vue | 586 ++++++++++++++++++ klp-ui/src/views/wms/delivery/plan/index.vue | 2 +- 9 files changed, 749 insertions(+), 82 deletions(-) create mode 100644 klp-ui/src/components/CoilSelector/data.js create mode 100644 klp-ui/src/views/wms/delivery/permi/index.vue diff --git a/klp-ui/src/assets/styles/element-ui.scss b/klp-ui/src/assets/styles/element-ui.scss index 7ea86558..480f6e59 100644 --- a/klp-ui/src/assets/styles/element-ui.scss +++ b/klp-ui/src/assets/styles/element-ui.scss @@ -1551,8 +1551,8 @@ body { .el-pager li { margin: 0 2px; min-width: 30px; - height: 30px; - line-height: 30px; + // height: 30px; + // line-height: 30px; border-radius: 4px; background: $--metal-gradient-light; border: 1px solid $--border-color-light; diff --git a/klp-ui/src/components/CoilSelector/data.js b/klp-ui/src/components/CoilSelector/data.js new file mode 100644 index 00000000..85762b0e --- /dev/null +++ b/klp-ui/src/components/CoilSelector/data.js @@ -0,0 +1,52 @@ +export const defaultColumns = [ + { + label: '卷号', + align: 'center', + prop: 'currentCoilNo', + showOverflowTooltip: true + }, + { + label: '存储位置', + align: 'center', + prop: 'actualWarehouseName', + width: '120', + showOverflowTooltip: true + }, + { + label: '物料', + align: 'center', + prop: 'itemName', + width: '100' + }, + { + label: '规格', + align: 'center', + prop: 'specification', + width: '100' + }, + { + label: '材质', + align: 'center', + prop: 'material', + width: '100' + }, + { + label: '厂家', + align: 'center', + prop: 'manufacturer', + width: '100' + }, + { + label: '重量(t)', + align: 'center', + prop: 'netWeight', + width: '100' + }, + { + label: '库区', + align: 'center', + prop: 'warehouseName', + width: '120', + showOverflowTooltip: true + }, +] \ No newline at end of file diff --git a/klp-ui/src/components/CoilSelector/index.vue b/klp-ui/src/components/CoilSelector/index.vue index 20fe5010..e03cd460 100644 --- a/klp-ui/src/components/CoilSelector/index.vue +++ b/klp-ui/src/components/CoilSelector/index.vue @@ -24,19 +24,22 @@ @keyup.enter.native="handleQuery" /> - + - + - + - + - + 搜索 重置 @@ -44,22 +47,32 @@ - + - + +
+ + + + + + + + + + +
+ - +