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> <template>
<ComprehensiveTemplate <div>
:actionTypes="actionTypes" <ComprehensiveTemplate v-if="!loading" :actionTypes="actionTypes" :actionQueryParams="actionQueryParams"
:actionQueryParams="actionQueryParams" :baseQueryParams="baseQueryParams" :warehouseOptions="warehouseOptions" :productionLine="productionLine" />
:baseQueryParams="baseQueryParams" <el-empty v-else description="正在加载报表配置..." />
:warehouseOptions="warehouseOptions" </div>
:productionLine="productionLine"
/>
</template> </template>
<script> <script>
import ComprehensiveTemplate from '@/views/wms/report/template/comprehensive.vue' 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 { export default {
name: 'ComprehensiveReport', name: 'ComprehensiveReport',
@@ -19,7 +17,33 @@ export default {
}, },
data() { data() {
return { 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> <template>
<DayTemplate <div>
:actionTypes="actionTypes" <DayTemplate v-if="!loading" :actionTypes="actionTypes" :actionQueryParams="actionQueryParams"
:actionQueryParams="actionQueryParams" :baseQueryParams="baseQueryParams" :warehouseOptions="warehouseOptions" :productionLine="productionLine" />
:baseQueryParams="baseQueryParams" <el-empty v-else description="正在加载报表配置..." />
:warehouseOptions="warehouseOptions" </div>
:productionLine="productionLine"
/>
</template> </template>
<script> <script>
import DayTemplate from '@/views/wms/report/template/day.vue' 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 { export default {
name: 'LossReport', name: 'DayReport',
components: { components: {
DayTemplate, DayTemplate,
}, },
data() { data() {
return { 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> <template>
<LossTemplate <div>
:actionTypes="actionTypes" <LossTemplate v-if="!loading" :actionTypes="actionTypes" :actionQueryParams="actionQueryParams"
:actionQueryParams="actionQueryParams" :baseQueryParams="baseQueryParams" :warehouseOptions="warehouseOptions" :productionLine="productionLine" />
:baseQueryParams="baseQueryParams" <el-empty v-else description="正在加载报表配置..." />
:warehouseOptions="warehouseOptions" </div>
:productionLine="productionLine"
></LossTemplate>
</template> </template>
<script> <script>
import LossTemplate from '@/views/wms/report/template/loss.vue' import LossTemplate from '@/views/wms/report/template/loss.vue'
import { suanzhaConfig } from '@/views/wms/report/js/config.js' import { listReportConfig } from '@/api/wms/reportConfig.js'
export default { export default {
name: 'LossReport', name: 'LossReport',
components: { components: {
LossTemplate, LossTemplate,
}, },
data() { data() {
return { 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
}
})
} }
} }
}
</script> </script>

View File

@@ -1,16 +1,14 @@
<template> <template>
<MonthTemplate <div>
:actionTypes="actionTypes" <MonthTemplate v-if="!loading" :actionTypes="actionTypes" :actionQueryParams="actionQueryParams"
:actionQueryParams="actionQueryParams" :baseQueryParams="baseQueryParams" :warehouseOptions="warehouseOptions" :productionLine="productionLine" />
:baseQueryParams="baseQueryParams" <el-empty v-else description="正在加载报表配置..." />
:warehouseOptions="warehouseOptions" </div>
:productionLine="productionLine"
/>
</template> </template>
<script> <script>
import MonthTemplate from '@/views/wms/report/template/month.vue' 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 { export default {
name: 'MonthReport', name: 'MonthReport',
@@ -19,7 +17,33 @@ export default {
}, },
data() { data() {
return { 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> <template>
<OutTemplate <div>
:baseQueryParams="baseQueryParams" <OutTemplate v-if="!loading" :baseQueryParams="baseQueryParams"
:warehouseOptions="warehouseOptions" :warehouseOptions="warehouseOptions" :productionLine="productionLine" />
:productionLine="productionLine" <el-empty v-else description="正在加载报表配置..." />
/> </div>
</template> </template>
<script> <script>
import OutTemplate from "@/views/wms/report/template/out.vue"; 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 { export default {
name: 'ZhaTemplate', name: 'OutReport',
components: { components: {
OutTemplate, OutTemplate,
}, },
data() { data() {
return { 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> <template>
<TeamTemplate <div>
:actionTypes="actionTypes" <TeamTemplate v-if="!loading" :actionTypes="actionTypes" :actionQueryParams="actionQueryParams"
:actionQueryParams="actionQueryParams" :baseQueryParams="baseQueryParams" :warehouseOptions="warehouseOptions" :productionLine="productionLine" />
:baseQueryParams="baseQueryParams" <el-empty v-else description="正在加载报表配置..." />
:warehouseOptions="warehouseOptions" </div>
:productionLine="productionLine"
/>
</template> </template>
<script> <script>
import TeamTemplate from '@/views/wms/report/template/team.vue' 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 { export default {
name: 'TeamReport', name: 'TeamReport',
@@ -19,7 +17,33 @@ export default {
}, },
data() { data() {
return { 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> <template>
<YearTemplate <div>
:actionTypes="actionTypes" <YearTemplate v-if="!loading" :actionTypes="actionTypes" :actionQueryParams="actionQueryParams"
:actionQueryParams="actionQueryParams" :baseQueryParams="baseQueryParams" :warehouseOptions="warehouseOptions" :productionLine="productionLine" />
:baseQueryParams="baseQueryParams" <el-empty v-else description="正在加载报表配置..." />
:warehouseOptions="warehouseOptions" </div>
:productionLine="productionLine"
/>
</template> </template>
<script> <script>
import YearTemplate from '@/views/wms/report/template/year.vue' 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 { export default {
name: 'YearReport', name: 'YearReport',
@@ -19,7 +17,33 @@ export default {
}, },
data() { data() {
return { 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
}
})
} }
} }
} }