|
|
@ -1,4 +1,5 @@ |
|
|
|
import request from '@/config/axios' |
|
|
|
import { isString } from '@/utils/is' |
|
|
|
|
|
|
|
export interface DemandforecastingMainVO { |
|
|
|
supplierCode: string |
|
|
@ -66,6 +67,56 @@ export const witPurchaseMain = async (id: number) => { |
|
|
|
return await request.post({ url: `/wms/demandforecasting-main/wit?id=` + id }) |
|
|
|
} |
|
|
|
|
|
|
|
// 要货预测-列表和头部请求参数
|
|
|
|
const getPageParams = (params)=>{ |
|
|
|
// 到货日期
|
|
|
|
if(params.dueDate&¶ms.dueDate.length>0){ |
|
|
|
if(isString(params.dueDate[0])){ |
|
|
|
params.startDate = params.dueDate[0] |
|
|
|
}else{ |
|
|
|
params.startDate = params.dueDate[0].format('YYYY-MM-DD') |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if(params.dueDate&¶ms.dueDate.length>1){ |
|
|
|
if(isString(params.dueDate[1])){ |
|
|
|
params.endDate = params.dueDate[1] |
|
|
|
}else{ |
|
|
|
params.endDate = params.dueDate[1].format('YYYY-MM-DD') |
|
|
|
} |
|
|
|
} |
|
|
|
params.dueDate = '' |
|
|
|
|
|
|
|
//计划员
|
|
|
|
if(params.planerId&¶ms.planerId.length>0){ |
|
|
|
params.planers = params.planerId.join(',') |
|
|
|
} |
|
|
|
params.planerId = '' |
|
|
|
// 供应商代码
|
|
|
|
if(params.supplierCode&¶ms.supplierCode.length>0){ |
|
|
|
let keyValue = params.supplierCode.split(' ') |
|
|
|
keyValue.forEach(item=>{item = item.trim()}) |
|
|
|
params.supplierCodes = keyValue.join(',') |
|
|
|
} |
|
|
|
params.supplierCode = '' |
|
|
|
|
|
|
|
// 物料代码
|
|
|
|
if(params.itemCode&¶ms.itemCode.length>0){ |
|
|
|
let keyValue = params.itemCode.split(' ') |
|
|
|
keyValue.forEach(item=>{item = item.trim()}) |
|
|
|
params.itemCodes = keyValue.join(',') |
|
|
|
} |
|
|
|
params.itemCode = '' |
|
|
|
|
|
|
|
// 版本号
|
|
|
|
if(params.version&¶ms.version.length>0){ |
|
|
|
let keyValue = params.version.split(' ') |
|
|
|
keyValue.forEach(item=>{item = item.trim()}) |
|
|
|
params.versions = keyValue.join(',') |
|
|
|
} |
|
|
|
params.version = '' |
|
|
|
return params |
|
|
|
} |
|
|
|
// 导出要货预测主 Excel
|
|
|
|
export const exportDemandforecastingMain = async (params) => { |
|
|
|
if (params.isSearch) { |
|
|
@ -73,6 +124,7 @@ export const exportDemandforecastingMain = async (params) => { |
|
|
|
const data = {...params} |
|
|
|
return request.post({ url: '/wms/demandforecasting-main/export-excel-senior', data }) |
|
|
|
} else { |
|
|
|
params = getPageParams(params) |
|
|
|
return await request.download({ url: `/wms/demandforecasting-main/export-excel`, params }) |
|
|
|
} |
|
|
|
} |
|
|
|