Browse Source

要货预测

linshi20240813
wangyufei 4 months ago
parent
commit
f7be8ea9a4
  1. 3
      src/api/wms/demandforecastingDetail/index.ts
  2. 52
      src/api/wms/demandforecastingMain/index.ts
  3. 2
      src/components/Search/src/Search.vue
  4. 13
      src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue
  5. 78
      src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingSupplierMain/demandforecastingMain.data.ts
  6. 11
      src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingSupplierMain/index.vue

3
src/api/wms/demandforecastingDetail/index.ts

@ -72,6 +72,9 @@ const getPageParams = (params)=>{
export const getDemandforecastingDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
if(params.flag){
delete params.flag
}
const data = {...params}
return await request.post({ url: '/wms/demandforecasting-detail/senior', data })
} else {

52
src/api/wms/demandforecastingMain/index.ts

@ -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&&params.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&&params.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&&params.planerId.length>0){
params.planers = params.planerId.join(',')
}
params.planerId = ''
// 供应商代码
if(params.supplierCode&&params.supplierCode.length>0){
let keyValue = params.supplierCode.split(' ')
keyValue.forEach(item=>{item = item.trim()})
params.supplierCodes = keyValue.join(',')
}
params.supplierCode = ''
// 物料代码
if(params.itemCode&&params.itemCode.length>0){
let keyValue = params.itemCode.split(' ')
keyValue.forEach(item=>{item = item.trim()})
params.itemCodes = keyValue.join(',')
}
params.itemCode = ''
// 版本号
if(params.version&&params.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 })
}
}

2
src/components/Search/src/Search.vue

@ -271,7 +271,7 @@ const searchTableSuccess = (formField, searchField, val, type, row) => {
}
const Search = ref()
onMounted(() => {})
defineExpose({setFormValues}) // open
defineExpose({setFormValues,search}) // open
</script>

13
src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue

@ -208,13 +208,14 @@ const searchFormClick = (searchData) => {
/** 初始化 **/
onMounted(async () => {
try {
await getListHead()
} catch (error) {
// try {
// await getListHead()
// } catch (error) {
}
// updateDateTableColumns()
getList()
// }
// // updateDateTableColumns()
// getList()
seachRef.value.search()
importTemplateData.templateUrl = await DemandforecastingMainApi.importTemplate()
})
</script>

78
src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingSupplierMain/demandforecastingMain.data.ts

@ -109,45 +109,45 @@ export const DemandforecastingMain = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
{
label: '版本号',
field: 'version',
sort: 'custom',
table: {
width: 150
},
isSearch:true,
search: {
// labelMessage: '信息提示说明!!!',
componentProps: {
multiple: true,
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择版本号', // 输入框占位文本
searchField: 'detailVersion', // 查询弹窗赋值字段
searchTitle: '版本号', // 查询弹窗标题
searchAllSchemas: Version.allSchemas, // 查询弹窗所需类
searchPage: DemandforecastingDetailApi.queryVersion, // 查询弹窗所需分页方法
searchCondition: [{
key: 'supplierCodes',
value: 'supplierCode',
message: '请填写供应商代码!',
isMainValue: true,
isCSV:true,//是否用逗号分隔参数
},{
key: 'itemCodes',
value: 'itemCode',
message: '请填写物料代码!',
isMainValue: true,
isCSV:true,//是否用逗号分隔参数
},{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
// {
// label: '版本号',
// field: 'version',
// sort: 'custom',
// table: {
// width: 150
// },
// isSearch:true,
// search: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// multiple: true,
// enterSearch: true,
// isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择版本号', // 输入框占位文本
// searchField: 'detailVersion', // 查询弹窗赋值字段
// searchTitle: '版本号', // 查询弹窗标题
// searchAllSchemas: Version.allSchemas, // 查询弹窗所需类
// searchPage: DemandforecastingDetailApi.queryVersion, // 查询弹窗所需分页方法
// searchCondition: [{
// key: 'supplierCodes',
// value: 'supplierCode',
// message: '请填写供应商代码!',
// isMainValue: true,
// isCSV:true,//是否用逗号分隔参数
// },{
// key: 'itemCodes',
// value: 'itemCode',
// message: '请填写物料代码!',
// isMainValue: true,
// isCSV:true,//是否用逗号分隔参数
// },{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// }]
// }
// }
// },
{
label: '到货日期',
field: 'dueDate',

11
src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingSupplierMain/index.vue

@ -1,7 +1,7 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :showSearchTableQueryFields="['supplierCode','itemCode','version']" :hiddenFilterBtnFields="['supplierCode','itemCode','version']" :schema="DemandforecastingMain.allSchemas.searchSchema" @search="searchClick" @reset="searchClick" @searchTableSuccess="searchQueryTableSuccess"/>
<Search ref="seachRef" :showSearchTableQueryFields="['supplierCode','itemCode','version']" :hiddenFilterBtnFields="['supplierCode','itemCode','version']" :schema="DemandforecastingMain.allSchemas.searchSchema" @search="searchClick" @reset="searchClick" @searchTableSuccess="searchQueryTableSuccess"/>
</ContentWrap>
<!-- 列表头部 -->
@ -174,6 +174,7 @@ const buttonBaseClick = async (val, item) => {
const searchClick = async (data)=>{
data.flag = 1
console.log('searchClick',data)
await setSearchParamsHead(data)
// updateDateTableColumns()
@ -267,12 +268,14 @@ const readHandle = (row,isAll)=>{
})
}
const seachRef = ref()
/** 初始化 **/
onMounted(async () => {
await getListHead()
// updateDateTableColumns()
getList()
// await getListHead()
// // updateDateTableColumns()
// getList()
seachRef.value.search()
importTemplateData.templateUrl = await DemandforecastingMainApi.importTemplate()
})
</script>

Loading…
Cancel
Save