refactor(wms/report): 重构报表模块数据获取逻辑,提取公共方法到fetch.js
feat(wms/report): 新增报表结果存储页面,支持JSON数据横向对比 style(wms/coil/do): 调整钢卷修正页面样式和代码格式 fix(wms/coil/do): 修复操作记录查询参数传递问题,优化钢卷选择逻辑
This commit is contained in:
@@ -38,12 +38,6 @@
|
||||
<muti-select style="width: 200px;" v-model="queryParams.itemManufacturer"
|
||||
:options="dict.type.coil_manufacturer" placeholder="请选择厂家" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="收货计划" prop="planId">
|
||||
<el-select style="width: 200px;" v-model="queryParams.planId" placeholder="请输入计划名称搜索收货计划" filterable remote
|
||||
:remote-method="remoteMethod">
|
||||
<el-option v-for="item in planList" :key="item.planId" :label="item.planName" :value="item.planId" />
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item prop="endTime">
|
||||
<el-button type="primary" @click="getList">查询</el-button>
|
||||
<el-button type="primary" @click="exportData">导出</el-button>
|
||||
@@ -85,6 +79,8 @@ import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import { listDeliveryPlan } from '@/api/wms/deliveryPlan'
|
||||
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
|
||||
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
|
||||
import { fetchLossList } from "@/views/wms/report/js/fetch";
|
||||
|
||||
|
||||
export default {
|
||||
name: 'LossTemplate',
|
||||
@@ -186,44 +182,11 @@ export default {
|
||||
},
|
||||
async getList() {
|
||||
this.loading = true
|
||||
const resultList = await Promise.all(this.actionTypes.map(actionType => {
|
||||
return listPendingAction({
|
||||
actionStatus: 2,
|
||||
warehouseId: this.queryParams.planId,
|
||||
actionType,
|
||||
pageSize: 9999,
|
||||
pageNum: 1,
|
||||
startTime: this.queryParams.byCreateTimeStart,
|
||||
endTime: this.queryParams.byCreateTimeEnd,
|
||||
...this.actionQueryParams,
|
||||
})
|
||||
}))
|
||||
const actions = resultList.flatMap(item => item.rows)
|
||||
const actionIds = actions.map(item => item.actionId).join(',')
|
||||
if (!actionIds) {
|
||||
this.$message({
|
||||
message: '暂无数据',
|
||||
type: 'warning',
|
||||
})
|
||||
this.list = []
|
||||
this.loading = false
|
||||
return
|
||||
}
|
||||
listCoilWithIds({
|
||||
fetchLossList(this.actionTypes, {
|
||||
...this.queryParams,
|
||||
byCreateTimeStart: undefined,
|
||||
byCreateTimeEnd: undefined,
|
||||
actionIds: actionIds,
|
||||
...this.actionQueryParams,
|
||||
}).then(res => {
|
||||
this.list = res.rows.map(item => {
|
||||
// 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
|
||||
const [thickness, width] = item.specification?.split('*') || [undefined, undefined]
|
||||
return {
|
||||
...item,
|
||||
computedThickness: parseFloat(thickness),
|
||||
computedWidth: parseFloat(width),
|
||||
}
|
||||
})
|
||||
this.list = res
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user