feat(wms/report): 新增报表配置动态加载功能,替换本地静态配置

1.  新增wms报表通用配置的CRUD接口文件
2.  替换所有酸轧报表页面的本地静态配置为从后台接口动态获取
3.  添加加载状态提示,优化页面初始加载体验
This commit is contained in:
2026-05-25 16:19:00 +08:00
parent 9b5ae03c37
commit 95c23462c9
8 changed files with 282 additions and 72 deletions

View File

@@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询WMS报通用配置列表
export function listReportConfig(query) {
return request({
url: '/wms/reportConfig/list',
method: 'get',
params: query
})
}
// 查询WMS报通用配置详细
export function getReportConfig(configId) {
return request({
url: '/wms/reportConfig/' + configId,
method: 'get'
})
}
// 新增WMS报通用配置
export function addReportConfig(data) {
return request({
url: '/wms/reportConfig',
method: 'post',
data: data
})
}
// 修改WMS报通用配置
export function updateReportConfig(data) {
return request({
url: '/wms/reportConfig',
method: 'put',
data: data
})
}
// 删除WMS报通用配置
export function delReportConfig(configId) {
return request({
url: '/wms/reportConfig/' + configId,
method: 'delete'
})
}

View File

@@ -1,16 +1,14 @@
<template>
<ComprehensiveTemplate
:actionTypes="actionTypes"
:actionQueryParams="actionQueryParams"
:baseQueryParams="baseQueryParams"
:warehouseOptions="warehouseOptions"
:productionLine="productionLine"
/>
<div>
<ComprehensiveTemplate v-if="!loading" :actionTypes="actionTypes" :actionQueryParams="actionQueryParams"
:baseQueryParams="baseQueryParams" :warehouseOptions="warehouseOptions" :productionLine="productionLine" />
<el-empty v-else description="正在加载报表配置..." />
</div>
</template>
<script>
import ComprehensiveTemplate from '@/views/wms/report/template/comprehensive.vue'
import { suanzhaConfig } from '@/views/wms/report/js/config.js'
import { listReportConfig } from '@/api/wms/reportConfig.js'
export default {
name: 'ComprehensiveReport',
@@ -19,7 +17,33 @@ export default {
},
data() {
return {
...suanzhaConfig,
loading: true,
actionTypes: [],
actionQueryParams: {},
baseQueryParams: {},
warehouseOptions: [],
productionLine: '',
}
},
mounted() {
this.getReportConfig()
},
methods: {
getReportConfig() {
this.loading = true
listReportConfig({
reportCode: 'acid'
}).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
this.loading = false
}
})
}
}
}

View File

@@ -1,25 +1,49 @@
<template>
<DayTemplate
:actionTypes="actionTypes"
:actionQueryParams="actionQueryParams"
:baseQueryParams="baseQueryParams"
:warehouseOptions="warehouseOptions"
:productionLine="productionLine"
/>
<div>
<DayTemplate v-if="!loading" :actionTypes="actionTypes" :actionQueryParams="actionQueryParams"
:baseQueryParams="baseQueryParams" :warehouseOptions="warehouseOptions" :productionLine="productionLine" />
<el-empty v-else description="正在加载报表配置..." />
</div>
</template>
<script>
import DayTemplate from '@/views/wms/report/template/day.vue'
import { suanzhaConfig } from '@/views/wms/report/js/config.js'
import { listReportConfig } from '@/api/wms/reportConfig.js'
export default {
name: 'LossReport',
name: 'DayReport',
components: {
DayTemplate,
},
data() {
return {
...suanzhaConfig,
loading: true,
actionTypes: [],
actionQueryParams: {},
baseQueryParams: {},
warehouseOptions: [],
productionLine: '',
}
},
mounted() {
this.getReportConfig()
},
methods: {
getReportConfig() {
this.loading = true
listReportConfig({
reportCode: 'acid'
}).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
this.loading = false
}
})
}
}
}

View File

@@ -1,26 +1,50 @@
<template>
<LossTemplate
:actionTypes="actionTypes"
:actionQueryParams="actionQueryParams"
:baseQueryParams="baseQueryParams"
:warehouseOptions="warehouseOptions"
:productionLine="productionLine"
></LossTemplate>
<div>
<LossTemplate v-if="!loading" :actionTypes="actionTypes" :actionQueryParams="actionQueryParams"
:baseQueryParams="baseQueryParams" :warehouseOptions="warehouseOptions" :productionLine="productionLine" />
<el-empty v-else description="正在加载报表配置..." />
</div>
</template>
<script>
import LossTemplate from '@/views/wms/report/template/loss.vue'
import { suanzhaConfig } from '@/views/wms/report/js/config.js'
import LossTemplate from '@/views/wms/report/template/loss.vue'
import { listReportConfig } from '@/api/wms/reportConfig.js'
export default {
name: 'LossReport',
components: {
LossTemplate,
},
data() {
return {
...suanzhaConfig,
}
export default {
name: 'LossReport',
components: {
LossTemplate,
},
data() {
return {
loading: true,
actionTypes: [],
actionQueryParams: {},
baseQueryParams: {},
warehouseOptions: [],
productionLine: '',
}
},
mounted() {
this.getReportConfig()
},
methods: {
getReportConfig() {
this.loading = true
listReportConfig({
reportCode: 'acid'
}).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
this.loading = false
}
})
}
}
}
</script>

View File

@@ -1,16 +1,14 @@
<template>
<MonthTemplate
:actionTypes="actionTypes"
:actionQueryParams="actionQueryParams"
:baseQueryParams="baseQueryParams"
:warehouseOptions="warehouseOptions"
:productionLine="productionLine"
/>
<div>
<MonthTemplate v-if="!loading" :actionTypes="actionTypes" :actionQueryParams="actionQueryParams"
:baseQueryParams="baseQueryParams" :warehouseOptions="warehouseOptions" :productionLine="productionLine" />
<el-empty v-else description="正在加载报表配置..." />
</div>
</template>
<script>
import MonthTemplate from '@/views/wms/report/template/month.vue'
import { suanzhaConfig } from '@/views/wms/report/js/config.js'
import { listReportConfig } from '@/api/wms/reportConfig.js'
export default {
name: 'MonthReport',
@@ -19,7 +17,33 @@ export default {
},
data() {
return {
...suanzhaConfig,
loading: true,
actionTypes: [],
actionQueryParams: {},
baseQueryParams: {},
warehouseOptions: [],
productionLine: '',
}
},
mounted() {
this.getReportConfig()
},
methods: {
getReportConfig() {
this.loading = true
listReportConfig({
reportCode: 'acid'
}).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
this.loading = false
}
})
}
}
}

View File

@@ -1,23 +1,45 @@
<template>
<OutTemplate
:baseQueryParams="baseQueryParams"
:warehouseOptions="warehouseOptions"
:productionLine="productionLine"
/>
<div>
<OutTemplate v-if="!loading" :baseQueryParams="baseQueryParams"
:warehouseOptions="warehouseOptions" :productionLine="productionLine" />
<el-empty v-else description="正在加载报表配置..." />
</div>
</template>
<script>
import OutTemplate from "@/views/wms/report/template/out.vue";
import { suanzhaConfig } from '@/views/wms/report/js/config.js'
import { listReportConfig } from '@/api/wms/reportConfig.js'
export default {
name: 'ZhaTemplate',
name: 'OutReport',
components: {
OutTemplate,
},
data() {
return {
...suanzhaConfig,
loading: true,
baseQueryParams: {},
warehouseOptions: [],
productionLine: '',
}
},
mounted() {
this.getReportConfig()
},
methods: {
getReportConfig() {
this.loading = true
listReportConfig({
reportCode: 'acid'
}).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
this.loading = false
}
})
}
}
}

View File

@@ -1,16 +1,14 @@
<template>
<TeamTemplate
:actionTypes="actionTypes"
:actionQueryParams="actionQueryParams"
:baseQueryParams="baseQueryParams"
:warehouseOptions="warehouseOptions"
:productionLine="productionLine"
/>
<div>
<TeamTemplate v-if="!loading" :actionTypes="actionTypes" :actionQueryParams="actionQueryParams"
:baseQueryParams="baseQueryParams" :warehouseOptions="warehouseOptions" :productionLine="productionLine" />
<el-empty v-else description="正在加载报表配置..." />
</div>
</template>
<script>
import TeamTemplate from '@/views/wms/report/template/team.vue'
import { suanzhaConfig } from '@/views/wms/report/js/config.js'
import { listReportConfig } from '@/api/wms/reportConfig.js'
export default {
name: 'TeamReport',
@@ -19,7 +17,33 @@ export default {
},
data() {
return {
...suanzhaConfig,
loading: true,
actionTypes: [],
actionQueryParams: {},
baseQueryParams: {},
warehouseOptions: [],
productionLine: '',
}
},
mounted() {
this.getReportConfig()
},
methods: {
getReportConfig() {
this.loading = true
listReportConfig({
reportCode: 'acid'
}).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
this.loading = false
}
})
}
}
}

View File

@@ -1,16 +1,14 @@
<template>
<YearTemplate
:actionTypes="actionTypes"
:actionQueryParams="actionQueryParams"
:baseQueryParams="baseQueryParams"
:warehouseOptions="warehouseOptions"
:productionLine="productionLine"
/>
<div>
<YearTemplate v-if="!loading" :actionTypes="actionTypes" :actionQueryParams="actionQueryParams"
:baseQueryParams="baseQueryParams" :warehouseOptions="warehouseOptions" :productionLine="productionLine" />
<el-empty v-else description="正在加载报表配置..." />
</div>
</template>
<script>
import YearTemplate from '@/views/wms/report/template/year.vue'
import { suanzhaConfig } from '@/views/wms/report/js/config.js'
import { listReportConfig } from '@/api/wms/reportConfig.js'
export default {
name: 'YearReport',
@@ -19,7 +17,33 @@ export default {
},
data() {
return {
...suanzhaConfig,
loading: true,
actionTypes: [],
actionQueryParams: {},
baseQueryParams: {},
warehouseOptions: [],
productionLine: '',
}
},
mounted() {
this.getReportConfig()
},
methods: {
getReportConfig() {
this.loading = true
listReportConfig({
reportCode: 'acid'
}).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
this.loading = false
}
})
}
}
}