From f7be8ea9a4c783aad62937fa8433917ab41850dd Mon Sep 17 00:00:00 2001 From: wangyufei <2267742828@qq.com> Date: Tue, 13 Aug 2024 08:54:27 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=A6=81=E8=B4=A7=E9=A2=84=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/demandforecastingDetail/index.ts | 3 + src/api/wms/demandforecastingMain/index.ts | 52 +++++++++++++ src/components/Search/src/Search.vue | 2 +- .../demandforecastingMain/index.vue | 13 ++-- .../demandforecastingMain.data.ts | 78 +++++++++---------- .../demandforecastingSupplierMain/index.vue | 11 ++- 6 files changed, 109 insertions(+), 50 deletions(-) diff --git a/src/api/wms/demandforecastingDetail/index.ts b/src/api/wms/demandforecastingDetail/index.ts index e3303bbd1..309422d37 100644 --- a/src/api/wms/demandforecastingDetail/index.ts +++ b/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 { diff --git a/src/api/wms/demandforecastingMain/index.ts b/src/api/wms/demandforecastingMain/index.ts index 7d5596a8f..0433af12c 100644 --- a/src/api/wms/demandforecastingMain/index.ts +++ b/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&¶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 }) } } diff --git a/src/components/Search/src/Search.vue b/src/components/Search/src/Search.vue index c9745202f..a95460d5f 100644 --- a/src/components/Search/src/Search.vue +++ b/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 方法,用于打开弹窗 diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue index 1057b940a..43c77fb2d 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue +++ b/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() }) diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingSupplierMain/demandforecastingMain.data.ts b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingSupplierMain/demandforecastingMain.data.ts index b094557b3..19632d743 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingSupplierMain/demandforecastingMain.data.ts +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingSupplierMain/demandforecastingMain.data.ts @@ -109,45 +109,45 @@ export const DemandforecastingMain = useCrudSchemas(reactive([ } } }, - { - 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', diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingSupplierMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingSupplierMain/index.vue index 9e3dea6c8..d53844f8e 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingSupplierMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingSupplierMain/index.vue @@ -1,7 +1,7 @@