refactor(wms/report/zha): 统一从configJson解析报表配置参数
将多个页面中直接从res.rows[0]读取参数的逻辑,改为先解析configJson字段再取值,优化代码一致性和可维护性
This commit is contained in:
@@ -36,11 +36,12 @@ export default {
|
|||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
if (res.rows.length == 1) {
|
if (res.rows.length == 1) {
|
||||||
this.actionTypes = res.rows[0].actionTypes
|
const config = JSON.parse(res.rows[0].configJson)
|
||||||
this.actionQueryParams = res.rows[0].actionQueryParams
|
this.actionTypes = config.actionTypes
|
||||||
this.baseQueryParams = res.rows[0].baseQueryParams
|
this.actionQueryParams = config.actionQueryParams
|
||||||
this.warehouseOptions = res.rows[0].warehouseOptions
|
this.baseQueryParams = config.baseQueryParams
|
||||||
this.productionLine = res.rows[0].productionLine
|
this.warehouseOptions = config.warehouseOptions
|
||||||
|
this.productionLine = config.productionLine
|
||||||
this.loading = false
|
this.loading = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -36,11 +36,12 @@ export default {
|
|||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
if (res.rows.length == 1) {
|
if (res.rows.length == 1) {
|
||||||
this.actionTypes = res.rows[0].actionTypes
|
const config = JSON.parse(res.rows[0].configJson)
|
||||||
this.actionQueryParams = res.rows[0].actionQueryParams
|
this.actionTypes = config.actionTypes
|
||||||
this.baseQueryParams = res.rows[0].baseQueryParams
|
this.actionQueryParams = config.actionQueryParams
|
||||||
this.warehouseOptions = res.rows[0].warehouseOptions
|
this.baseQueryParams = config.baseQueryParams
|
||||||
this.productionLine = res.rows[0].productionLine
|
this.warehouseOptions = config.warehouseOptions
|
||||||
|
this.productionLine = config.productionLine
|
||||||
this.loading = false
|
this.loading = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -36,11 +36,12 @@ export default {
|
|||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
if (res.rows.length == 1) {
|
if (res.rows.length == 1) {
|
||||||
this.actionTypes = res.rows[0].actionTypes
|
const config = JSON.parse(res.rows[0].configJson)
|
||||||
this.actionQueryParams = res.rows[0].actionQueryParams
|
this.actionTypes = config.actionTypes
|
||||||
this.baseQueryParams = res.rows[0].baseQueryParams
|
this.actionQueryParams = config.actionQueryParams
|
||||||
this.warehouseOptions = res.rows[0].warehouseOptions
|
this.baseQueryParams = config.baseQueryParams
|
||||||
this.productionLine = res.rows[0].productionLine
|
this.warehouseOptions = config.warehouseOptions
|
||||||
|
this.productionLine = config.productionLine
|
||||||
this.loading = false
|
this.loading = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -36,11 +36,12 @@ export default {
|
|||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
if (res.rows.length == 1) {
|
if (res.rows.length == 1) {
|
||||||
this.actionTypes = res.rows[0].actionTypes
|
const config = JSON.parse(res.rows[0].configJson)
|
||||||
this.actionQueryParams = res.rows[0].actionQueryParams
|
this.actionTypes = config.actionTypes
|
||||||
this.baseQueryParams = res.rows[0].baseQueryParams
|
this.actionQueryParams = config.actionQueryParams
|
||||||
this.warehouseOptions = res.rows[0].warehouseOptions
|
this.baseQueryParams = config.baseQueryParams
|
||||||
this.productionLine = res.rows[0].productionLine
|
this.warehouseOptions = config.warehouseOptions
|
||||||
|
this.productionLine = config.productionLine
|
||||||
this.loading = false
|
this.loading = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -34,9 +34,10 @@ export default {
|
|||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
if (res.rows.length == 1) {
|
if (res.rows.length == 1) {
|
||||||
this.baseQueryParams = res.rows[0].baseQueryParams
|
const config = JSON.parse(res.rows[0].configJson)
|
||||||
this.warehouseOptions = res.rows[0].warehouseOptions
|
this.baseQueryParams = config.baseQueryParams
|
||||||
this.productionLine = res.rows[0].productionLine
|
this.warehouseOptions = config.warehouseOptions
|
||||||
|
this.productionLine = config.productionLine
|
||||||
this.loading = false
|
this.loading = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -36,11 +36,12 @@ export default {
|
|||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
if (res.rows.length == 1) {
|
if (res.rows.length == 1) {
|
||||||
this.actionTypes = res.rows[0].actionTypes
|
const config = JSON.parse(res.rows[0].configJson)
|
||||||
this.actionQueryParams = res.rows[0].actionQueryParams
|
this.actionTypes = config.actionTypes
|
||||||
this.baseQueryParams = res.rows[0].baseQueryParams
|
this.actionQueryParams = config.actionQueryParams
|
||||||
this.warehouseOptions = res.rows[0].warehouseOptions
|
this.baseQueryParams = config.baseQueryParams
|
||||||
this.productionLine = res.rows[0].productionLine
|
this.warehouseOptions = config.warehouseOptions
|
||||||
|
this.productionLine = config.productionLine
|
||||||
this.loading = false
|
this.loading = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -36,11 +36,12 @@ export default {
|
|||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
if (res.rows.length == 1) {
|
if (res.rows.length == 1) {
|
||||||
this.actionTypes = res.rows[0].actionTypes
|
const config = JSON.parse(res.rows[0].configJson)
|
||||||
this.actionQueryParams = res.rows[0].actionQueryParams
|
this.actionTypes = config.actionTypes
|
||||||
this.baseQueryParams = res.rows[0].baseQueryParams
|
this.actionQueryParams = config.actionQueryParams
|
||||||
this.warehouseOptions = res.rows[0].warehouseOptions
|
this.baseQueryParams = config.baseQueryParams
|
||||||
this.productionLine = res.rows[0].productionLine
|
this.warehouseOptions = config.warehouseOptions
|
||||||
|
this.productionLine = config.productionLine
|
||||||
this.loading = false
|
this.loading = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user