refactor(wms/report/zha): 统一从configJson解析报表配置参数

将多个页面中直接从res.rows[0]读取参数的逻辑,改为先解析configJson字段再取值,优化代码一致性和可维护性
This commit is contained in:
2026-05-26 09:13:06 +08:00
parent 6f7a85025d
commit 6f3bd2165f
7 changed files with 40 additions and 33 deletions

View File

@@ -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
}
})

View File

@@ -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
}
})

View File

@@ -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
}
})

View File

@@ -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
}
})

View File

@@ -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
}
})

View File

@@ -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
}
})

View File

@@ -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
}
})