From 6f3bd2165f57b99711234057349388f6280effbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= <2178503051@qq.com> Date: Tue, 26 May 2026 09:13:06 +0800 Subject: [PATCH] =?UTF-8?q?refactor(wms/report/zha):=20=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E4=BB=8EconfigJson=E8=A7=A3=E6=9E=90=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将多个页面中直接从res.rows[0]读取参数的逻辑,改为先解析configJson字段再取值,优化代码一致性和可维护性 --- klp-ui/src/views/wms/report/zha/comprehensive.vue | 11 ++++++----- klp-ui/src/views/wms/report/zha/day.vue | 11 ++++++----- klp-ui/src/views/wms/report/zha/loss.vue | 11 ++++++----- klp-ui/src/views/wms/report/zha/month.vue | 11 ++++++----- klp-ui/src/views/wms/report/zha/out.vue | 7 ++++--- klp-ui/src/views/wms/report/zha/team.vue | 11 ++++++----- klp-ui/src/views/wms/report/zha/year.vue | 11 ++++++----- 7 files changed, 40 insertions(+), 33 deletions(-) diff --git a/klp-ui/src/views/wms/report/zha/comprehensive.vue b/klp-ui/src/views/wms/report/zha/comprehensive.vue index 5b96adb3..4c8d75e7 100644 --- a/klp-ui/src/views/wms/report/zha/comprehensive.vue +++ b/klp-ui/src/views/wms/report/zha/comprehensive.vue @@ -36,11 +36,12 @@ export default { }).then(res => { console.log(res) if (res.rows.length == 1) { - this.actionTypes = res.rows[0].actionTypes - this.actionQueryParams = res.rows[0].actionQueryParams - this.baseQueryParams = res.rows[0].baseQueryParams - this.warehouseOptions = res.rows[0].warehouseOptions - this.productionLine = res.rows[0].productionLine + const config = JSON.parse(res.rows[0].configJson) + this.actionTypes = config.actionTypes + this.actionQueryParams = config.actionQueryParams + this.baseQueryParams = config.baseQueryParams + this.warehouseOptions = config.warehouseOptions + this.productionLine = config.productionLine this.loading = false } }) diff --git a/klp-ui/src/views/wms/report/zha/day.vue b/klp-ui/src/views/wms/report/zha/day.vue index 621d0424..70bb1b93 100644 --- a/klp-ui/src/views/wms/report/zha/day.vue +++ b/klp-ui/src/views/wms/report/zha/day.vue @@ -36,11 +36,12 @@ export default { }).then(res => { console.log(res) if (res.rows.length == 1) { - this.actionTypes = res.rows[0].actionTypes - this.actionQueryParams = res.rows[0].actionQueryParams - this.baseQueryParams = res.rows[0].baseQueryParams - this.warehouseOptions = res.rows[0].warehouseOptions - this.productionLine = res.rows[0].productionLine + const config = JSON.parse(res.rows[0].configJson) + this.actionTypes = config.actionTypes + this.actionQueryParams = config.actionQueryParams + this.baseQueryParams = config.baseQueryParams + this.warehouseOptions = config.warehouseOptions + this.productionLine = config.productionLine this.loading = false } }) diff --git a/klp-ui/src/views/wms/report/zha/loss.vue b/klp-ui/src/views/wms/report/zha/loss.vue index d7354b7e..89bfb1c5 100644 --- a/klp-ui/src/views/wms/report/zha/loss.vue +++ b/klp-ui/src/views/wms/report/zha/loss.vue @@ -36,11 +36,12 @@ export default { }).then(res => { console.log(res) if (res.rows.length == 1) { - this.actionTypes = res.rows[0].actionTypes - this.actionQueryParams = res.rows[0].actionQueryParams - this.baseQueryParams = res.rows[0].baseQueryParams - this.warehouseOptions = res.rows[0].warehouseOptions - this.productionLine = res.rows[0].productionLine + const config = JSON.parse(res.rows[0].configJson) + this.actionTypes = config.actionTypes + this.actionQueryParams = config.actionQueryParams + this.baseQueryParams = config.baseQueryParams + this.warehouseOptions = config.warehouseOptions + this.productionLine = config.productionLine this.loading = false } }) diff --git a/klp-ui/src/views/wms/report/zha/month.vue b/klp-ui/src/views/wms/report/zha/month.vue index d4564019..287f89a5 100644 --- a/klp-ui/src/views/wms/report/zha/month.vue +++ b/klp-ui/src/views/wms/report/zha/month.vue @@ -36,11 +36,12 @@ export default { }).then(res => { console.log(res) if (res.rows.length == 1) { - this.actionTypes = res.rows[0].actionTypes - this.actionQueryParams = res.rows[0].actionQueryParams - this.baseQueryParams = res.rows[0].baseQueryParams - this.warehouseOptions = res.rows[0].warehouseOptions - this.productionLine = res.rows[0].productionLine + const config = JSON.parse(res.rows[0].configJson) + this.actionTypes = config.actionTypes + this.actionQueryParams = config.actionQueryParams + this.baseQueryParams = config.baseQueryParams + this.warehouseOptions = config.warehouseOptions + this.productionLine = config.productionLine this.loading = false } }) diff --git a/klp-ui/src/views/wms/report/zha/out.vue b/klp-ui/src/views/wms/report/zha/out.vue index 3fcb2491..22ef5593 100644 --- a/klp-ui/src/views/wms/report/zha/out.vue +++ b/klp-ui/src/views/wms/report/zha/out.vue @@ -34,9 +34,10 @@ export default { }).then(res => { console.log(res) if (res.rows.length == 1) { - this.baseQueryParams = res.rows[0].baseQueryParams - this.warehouseOptions = res.rows[0].warehouseOptions - this.productionLine = res.rows[0].productionLine + const config = JSON.parse(res.rows[0].configJson) + this.baseQueryParams = config.baseQueryParams + this.warehouseOptions = config.warehouseOptions + this.productionLine = config.productionLine this.loading = false } }) diff --git a/klp-ui/src/views/wms/report/zha/team.vue b/klp-ui/src/views/wms/report/zha/team.vue index 44a3e292..edf11dcf 100644 --- a/klp-ui/src/views/wms/report/zha/team.vue +++ b/klp-ui/src/views/wms/report/zha/team.vue @@ -36,11 +36,12 @@ export default { }).then(res => { console.log(res) if (res.rows.length == 1) { - this.actionTypes = res.rows[0].actionTypes - this.actionQueryParams = res.rows[0].actionQueryParams - this.baseQueryParams = res.rows[0].baseQueryParams - this.warehouseOptions = res.rows[0].warehouseOptions - this.productionLine = res.rows[0].productionLine + const config = JSON.parse(res.rows[0].configJson) + this.actionTypes = config.actionTypes + this.actionQueryParams = config.actionQueryParams + this.baseQueryParams = config.baseQueryParams + this.warehouseOptions = config.warehouseOptions + this.productionLine = config.productionLine this.loading = false } }) diff --git a/klp-ui/src/views/wms/report/zha/year.vue b/klp-ui/src/views/wms/report/zha/year.vue index b43bb6fb..5b76a205 100644 --- a/klp-ui/src/views/wms/report/zha/year.vue +++ b/klp-ui/src/views/wms/report/zha/year.vue @@ -36,11 +36,12 @@ export default { }).then(res => { console.log(res) if (res.rows.length == 1) { - this.actionTypes = res.rows[0].actionTypes - this.actionQueryParams = res.rows[0].actionQueryParams - this.baseQueryParams = res.rows[0].baseQueryParams - this.warehouseOptions = res.rows[0].warehouseOptions - this.productionLine = res.rows[0].productionLine + const config = JSON.parse(res.rows[0].configJson) + this.actionTypes = config.actionTypes + this.actionQueryParams = config.actionQueryParams + this.baseQueryParams = config.baseQueryParams + this.warehouseOptions = config.warehouseOptions + this.productionLine = config.productionLine this.loading = false } })