From 1fa4c558699e121396cbdda2abf68720c95f3e07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Mon, 6 Apr 2026 13:16:45 +0800 Subject: [PATCH] =?UTF-8?q?feat(CoilSelector):=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=85=A5=E5=9C=BA=E5=8D=B7=E5=8F=B7=E5=AD=97=E6=AE=B5=E5=B9=B6?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=BD=93=E5=89=8D=E5=8D=B7=E5=8F=B7=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit feat(customer): 新增客户相关配卷和财务信息查询接口 fix(base.vue): 修复发货单时间条件显示问题 refactor(CustomerEdit): 替换地址选择组件为普通输入框 feat(CoilSelector): 增加入场卷号查询条件并调整对话框宽度 style(OrderEdit): 调整客户名称和销售员选择框宽度 refactor(ChinaAreaSelect): 优化地址解析逻辑并支持空对象处理 feat(FileUpload/FileList): 新增文件预览功能组件 refactor(KLPService/CustomerSelect): 优化客户选择组件并支持自定义字段绑定 fix(AbnormalForm): 修复异常位置校验逻辑并保留当前卷号 feat(ContractTabs): 新增合同附件展示功能 refactor(warehouse/record): 重构操作记录统计展示方式 feat(contract): 集成客户选择组件并优化合同信息填充 refactor(order): 调整订单表单布局并集成合同信息 feat(FilePreview): 新增文件预览组件 feat(customer): 新增财务状态和发货配卷展示 refactor(CustomerOrder): 移除冗余代码并优化布局 feat(PlanDetailForm): 新增合同附件查看功能 feat(dict): 新增字典管理页面 --- klp-ui/src/api/crm/customer.js | 16 + .../src/components/ChinaAreaSelect/index.js | 23 +- .../src/components/ChinaAreaSelect/index.vue | 30 +- klp-ui/src/components/CoilSelector/data.js | 8 +- klp-ui/src/components/CoilSelector/index.vue | 10 +- klp-ui/src/components/FileList/index.vue | 58 +- klp-ui/src/components/FilePreview/index.vue | 185 +++++++ klp-ui/src/components/FileUpload/index.vue | 22 + .../KLPService/CustomerSelect/index.vue | 20 +- .../views/aps/planSheet/PlanDetailForm.vue | 104 +++- .../src/views/crm/components/CustomerEdit.vue | 9 +- .../views/crm/components/CustomerOrder.vue | 86 +-- klp-ui/src/views/crm/components/OrderEdit.vue | 6 +- .../crm/contract/components/ContractTabs.vue | 59 ++- klp-ui/src/views/crm/contract/index.vue | 39 +- klp-ui/src/views/crm/customer/index.vue | 63 ++- klp-ui/src/views/crm/dict/index.vue | 497 ++++++++++++++++++ klp-ui/src/views/crm/order/index.vue | 33 +- .../wms/coil/components/AbnormalForm.vue | 31 +- klp-ui/src/views/wms/coil/panels/base.vue | 4 +- klp-ui/src/views/wms/warehouse/record.vue | 47 +- 21 files changed, 1158 insertions(+), 192 deletions(-) create mode 100644 klp-ui/src/components/FilePreview/index.vue create mode 100644 klp-ui/src/views/crm/dict/index.vue diff --git a/klp-ui/src/api/crm/customer.js b/klp-ui/src/api/crm/customer.js index 5a25a60e..4a9b97de 100644 --- a/klp-ui/src/api/crm/customer.js +++ b/klp-ui/src/api/crm/customer.js @@ -42,3 +42,19 @@ export function delCustomer(customerId) { method: 'delete' }) } + +// 查询该客户相关的配卷情况 +export function listCoilByCustomerId(customerId) { + return request({ + url: '/crm/orderItem/coils/customer/' + customerId, + method: 'get' + }) +} + +// 查询该项目相关的订单异议和财务信息 +export function listFinanceByCustomerId(customerId) { + return request({ + url: '/crm/orderItem/customerFinance/' + customerId, + method: 'get' + }) +} \ No newline at end of file diff --git a/klp-ui/src/components/ChinaAreaSelect/index.js b/klp-ui/src/components/ChinaAreaSelect/index.js index 283aa378..2e2a106b 100644 --- a/klp-ui/src/components/ChinaAreaSelect/index.js +++ b/klp-ui/src/components/ChinaAreaSelect/index.js @@ -47,12 +47,17 @@ function formatAreaText(value) { return { standard, custom }; } - // 非组合格式(纯标准地址/纯自定义地址)→ 默认归为standard - return { standard: trimVal, custom: '' }; + // 非组合格式(纯任意字符串)→ 归为custom + return { standard: '', custom: trimVal }; } // ========== 场景3:输入是对象 → 格式化为组合字符串 ========== if (typeof value === 'object' && !Array.isArray(value)) { + // 处理空对象 + if (Object.keys(value).length === 0) { + return '[]()'; + } + const { standard = '', custom = '' } = value; // 转字符串并去空格 const standardStr = String(standard).trim(); @@ -71,11 +76,19 @@ function formatAreaText(value) { */ function formatAreaTextEnhanced(value, keyType = 'name') { // 先调用基础版解析/格式化 - const result = formatAreaText(value); + let result = formatAreaText(value); - // 如果是解析模式(返回对象)且keyType为name,转换code为name + // 如果是解析模式(返回对象)且keyType为name,检查是否为代码输入 if (typeof result === 'object' && keyType === 'name') { - result.standard = convertCodeToName(result.standard); + // 检查custom是否可能是代码(不包含中文) + if (result.custom && !/[\u4e00-\u9fa5]/.test(result.custom)) { + // 尝试转换code为name + const convertedName = convertCodeToName(result.custom); + // 如果转换成功(返回非空字符串),则将其移到standard字段 + if (convertedName) { + result = { standard: convertedName, custom: '' }; + } + } } return result; diff --git a/klp-ui/src/components/ChinaAreaSelect/index.vue b/klp-ui/src/components/ChinaAreaSelect/index.vue index ab219741..14f2c545 100644 --- a/klp-ui/src/components/ChinaAreaSelect/index.vue +++ b/klp-ui/src/components/ChinaAreaSelect/index.vue @@ -26,6 +26,7 @@ + + \ No newline at end of file diff --git a/klp-ui/src/components/FileUpload/index.vue b/klp-ui/src/components/FileUpload/index.vue index 9958b1b5..f6fbffce 100644 --- a/klp-ui/src/components/FileUpload/index.vue +++ b/klp-ui/src/components/FileUpload/index.vue @@ -32,19 +32,31 @@ {{ getFileName(file.name) }}
+ 预览 删除
+ + + diff --git a/klp-ui/src/components/KLPService/CustomerSelect/index.vue b/klp-ui/src/components/KLPService/CustomerSelect/index.vue index df170a1e..0ce3c7c7 100644 --- a/klp-ui/src/components/KLPService/CustomerSelect/index.vue +++ b/klp-ui/src/components/KLPService/CustomerSelect/index.vue @@ -1,6 +1,6 @@ @@ -13,6 +13,14 @@ value: { type: String, default: '' + }, + bindField: { + type: String, + default: 'customerId' + }, + style: { + type: Object, + default: () => ({}) } }, computed: { @@ -22,6 +30,12 @@ }, set(value) { this.$emit('input', value); + // 找到对应的客户信息 + const customer = this.customerList.find(item => item[this.bindField] === value); + // 触发 change 事件,传递客户信息 + if (customer) { + this.$emit('change', customer); + } } } }, @@ -37,7 +51,7 @@ methods: { remoteSearchCustomer(query) { this.customerLoading = true; - listCustomer({ name: query, pageNum: 1, pageSize: 10 }).then(response => { + listCustomer({ companyName: query, pageNum: 1, pageSize: 10 }).then(response => { this.customerList = response.rows; }).finally(() => { this.customerLoading = false; diff --git a/klp-ui/src/views/aps/planSheet/PlanDetailForm.vue b/klp-ui/src/views/aps/planSheet/PlanDetailForm.vue index 1e3a5a9e..769306bd 100644 --- a/klp-ui/src/views/aps/planSheet/PlanDetailForm.vue +++ b/klp-ui/src/views/aps/planSheet/PlanDetailForm.vue @@ -7,9 +7,14 @@ @@ -207,12 +212,8 @@ - + @@ -250,14 +251,26 @@
- + +
+ + + + +
+ +
+

技术附件

+ +
+
+

排产函

+
@@ -265,8 +278,9 @@ + + \ No newline at end of file diff --git a/klp-ui/src/views/crm/order/index.vue b/klp-ui/src/views/crm/order/index.vue index ff75ec6b..2eb761ce 100644 --- a/klp-ui/src/views/crm/order/index.vue +++ b/klp-ui/src/views/crm/order/index.vue @@ -102,28 +102,28 @@ + + + + + - - + - - - - + - - - - + + item.contractId === contractId) if (contract) { + console.log(contract) this.form.contractCode = contract.contractNo + this.form.deliveryDate = contract.deliveryDate + this.form.customerId = contract.customerId } }, @@ -284,7 +291,7 @@ export default { orderId: undefined, orderCode: undefined, orderType: ORDER_TYPE['正式订单'], - customerId: undefined, + customerId: this.customerId, orderAmount: undefined, salesman: undefined, deliveryDate: undefined, diff --git a/klp-ui/src/views/wms/coil/components/AbnormalForm.vue b/klp-ui/src/views/wms/coil/components/AbnormalForm.vue index 5a26cc38..68589610 100644 --- a/klp-ui/src/views/wms/coil/components/AbnormalForm.vue +++ b/klp-ui/src/views/wms/coil/components/AbnormalForm.vue @@ -73,12 +73,12 @@ export default { { required: true, message: '请选择位置', trigger: 'change' } ], startPosition: [ - { required: true, message: '请输入开始位置', trigger: 'blur' }, - // { type: 'number', message: '请输入数字', trigger: 'blur' } + { required: true, message: '请输入开始位置', trigger: ['blur', 'change'] }, + { validator: this.validateStartPosition, trigger: ['blur', 'change'] } ], endPosition: [ - { required: true, message: '请输入结束位置', trigger: 'blur' }, - // { type: 'number', message: '请输入数字', trigger: 'blur' } + { required: true, message: '请输入结束位置', trigger: ['blur', 'change'] }, + { validator: this.validateEndPosition, trigger: ['blur', 'change'] } ], defectCode: [ { required: true, message: '请选择缺陷代码', trigger: 'change' } @@ -102,14 +102,19 @@ export default { methods: { /** 表单验证 */ validate(callback) { + if (this.formData.startPosition > this.formData.endPosition) { + this.$message.error('开始位置必须小于结束位置'); + return false; + } return this.$refs.form.validate(callback); }, /** 重置表单 */ resetFields() { this.$refs.form.resetFields(); + const currentCoilId = this.formData.coilId; this.formData = { abnormalId: undefined, - coilId: undefined, + coilId: currentCoilId, position: undefined, startPosition: undefined, endPosition: undefined, @@ -124,6 +129,22 @@ export default { if (this.formData.startPosition && this.formData.endPosition) { this.formData.length = this.formData.endPosition - this.formData.startPosition; } + }, + /** 校验开始位置 */ + validateStartPosition(rule, value, callback) { + if (value <= 0) { + callback(new Error('开始位置必须为正数')); + } else { + callback(); + } + }, + /** 校验结束位置 */ + validateEndPosition(rule, value, callback) { + if (value <= 0) { + callback(new Error('结束位置必须为正数')); + } else { + callback(); + } } } }; diff --git a/klp-ui/src/views/wms/coil/panels/base.vue b/klp-ui/src/views/wms/coil/panels/base.vue index 96ec8526..40c8bbed 100644 --- a/klp-ui/src/views/wms/coil/panels/base.vue +++ b/klp-ui/src/views/wms/coil/panels/base.vue @@ -48,8 +48,8 @@ - - + diff --git a/klp-ui/src/views/wms/warehouse/record.vue b/klp-ui/src/views/wms/warehouse/record.vue index e68e9bc6..89dd57bf 100644 --- a/klp-ui/src/views/wms/warehouse/record.vue +++ b/klp-ui/src/views/wms/warehouse/record.vue @@ -28,6 +28,8 @@ 重置 + + @@ -71,14 +73,27 @@ + + +
+ 操作记录趋势 +
+
+
+ -
- 操作记录趋势 -
-
+ + + + + + +
@@ -212,6 +227,8 @@ export default { totalWeight: 0, warehouseCount: 0 }, + // 操作人汇总数据 + userSummaryData: [], // 图表实例 trendChart: null, pieChart: null, @@ -258,7 +275,7 @@ export default { this.queryParams.createEndTime = this.queryParams.createTimeRange[1]; } // 移除分页参数,获取全部数据 - const params = { ...this.queryParams, pageNum:1, pageSize: 10000 }; + const params = { ...this.queryParams, pageNum: 1, pageSize: 10000 }; listCoilWarehouseOperationLog(params).then(response => { this.allData = response.rows; @@ -296,6 +313,26 @@ export default { }); this.stats.warehouseCount = warehouseIds.size; + // 按操作人汇总数据 + const userMap = {}; + this.allData.forEach(item => { + const user = item.createBy || '未知'; + if (!userMap[user]) { + userMap[user] = { + createBy: user, + coilCount: 0, + totalWeight: 0 + }; + } + userMap[user].coilCount++; + if (item.coil && item.coil.netWeight) { + userMap[user].totalWeight += parseFloat(item.coil.netWeight); + } + }); + + // 转换为数组并按操作卷数降序排序 + this.userSummaryData = Object.values(userMap).sort((a, b) => b.coilCount - a.coilCount); + // 更新图表数据 this.updateCharts(); },