From d18fbc1edfd8a9897be51ef9aa99ece75f67d17c Mon Sep 17 00:00:00 2001 From: yufei_wang <2267742828@qq.com> Date: Tue, 24 Dec 2024 11:01:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A6=81=E8=B4=A7=E9=A2=84=E6=B5=8B-=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E8=A1=A8=E5=A4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/customerDeliveryForecast/index.ts | 45 ++++++++ .../customerDeliveryForecast.data.ts | 105 +++++++++++++++++- .../customerDeliveryForecast/index.vue | 62 ++++++++++- 3 files changed, 207 insertions(+), 5 deletions(-) diff --git a/src/api/wms/customerDeliveryForecast/index.ts b/src/api/wms/customerDeliveryForecast/index.ts index d249cd0b7..72028b054 100644 --- a/src/api/wms/customerDeliveryForecast/index.ts +++ b/src/api/wms/customerDeliveryForecast/index.ts @@ -1,4 +1,5 @@ import request from '@/config/axios' +import { isString } from '@/utils/is' export interface CustomerDeliveryForecastVO { schdSite: string @@ -62,6 +63,50 @@ export const importTemplate = () => { return request.download({ url: '/wms/customer-delivery-forecast/get-import-template' }) } + +// 要货预测-列表和头部请求参数 +const getPageParams = (params)=>{ + // 到货日期 + if(params.schdDate&¶ms.schdDate.length>0){ + if(isString(params.schdDate[0])){ + params.startDate = params.schdDate[0] + }else{ + params.startDate = params.schdDate[0].format('YYYY-MM-DD') + } + + } + if(params.schdDate&¶ms.schdDate.length>1){ + if(isString(params.schdDate[1])){ + params.endDate = params.schdDate[1] + }else{ + params.endDate = params.schdDate[1].format('YYYY-MM-DD') + } + } + console.log(params.schdDate) + if (!params.schdDate || params.schdDate.length == 0) { + params.startDate = '' + params.endDate = '' + } + + + // 物料代码 + if(params.schdPart&¶ms.schdPart.length>0){ + let keyValue = params.schdPart.split(' ') + keyValue.forEach(item=>{item = item.trim()}) + params.schdParts = keyValue.join(',') + } + params.schdPart = '' + + // 版本号 + 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 +} + // 查询发货预测主列表 export const getPageTableHead = async (params) => { params = getPageParams(params) diff --git a/src/views/wms/basicDataManage/customerManage/customerDeliveryForecast/customerDeliveryForecast.data.ts b/src/views/wms/basicDataManage/customerManage/customerDeliveryForecast/customerDeliveryForecast.data.ts index 1884f5fa9..073eed020 100644 --- a/src/views/wms/basicDataManage/customerManage/customerDeliveryForecast/customerDeliveryForecast.data.ts +++ b/src/views/wms/basicDataManage/customerManage/customerDeliveryForecast/customerDeliveryForecast.data.ts @@ -1,6 +1,41 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' +import dayjs from 'dayjs' +import * as DemandforecastingDetailApi from '@/api/wms/demandforecastingDetail' +import * as SupplieritemApi from '@/api/wms/supplieritem' +import { Supplieritem } from '@/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data' +Supplieritem.allSchemas.searchSchema = Supplieritem.allSchemas.searchSchema.filter(item=>item.field!="allowOverShipment") +export const Version = useCrudSchemas(reactive([ + { + label: '供应商代码', + field: 'supplierCodes', + sort: 'custom', + isSearch:true, + }, + { + label: '订单号', + field: 'poNumber', + sort: 'custom', + isSearch:true, + }, + { + label: '订单行', + field: 'poLine', + sort: 'custom', + }, + { + label: '物料代码', + field: 'itemCode', + isSearch:true, + sort: 'custom', + }, + { + label: '子表版本', + field: 'detailVersion', + sort: 'custom', + } +])) // 表单校验 export const CustomerDeliveryForecastRules = reactive({ }) @@ -44,7 +79,65 @@ export const CustomerDeliveryForecast = useCrudSchemas(reactive([ label: '物料编码', field: 'schdPart', sort: 'custom', + isSearch:true, + search: { + // labelMessage: '信息提示说明!!!', + componentProps: { + multiple: true, + enterSearch: true, + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择物料代码', // 输入框占位文本 + searchField: 'itemCode', // 查询弹窗赋值字段 + searchTitle: '物料基础信息', // 查询弹窗标题 + searchAllSchemas: Supplieritem.allSchemas, // 查询弹窗所需类 + searchPage: SupplieritemApi.getSupplieritemPageSCP, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'supplierCodes', + value: 'supplierCode', + 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: 'itemCodes', + value: 'itemCode', + message: '请填写物料代码!', + isMainValue: true, + isCSV:true,//是否用逗号分隔参数 + },{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] + } + } + }, { label: '净需求', field: 'schdNetReq', @@ -61,7 +154,17 @@ export const CustomerDeliveryForecast = useCrudSchemas(reactive([ type: 'datetime', valueFormat: 'x' } - } + }, + isSearch:true, + search: { + component: 'DatePicker', + value: [dayjs(), dayjs().subtract(-3,'month')], + componentProps: { + valueFormat: 'YYYY-MM-DD', + type: 'daterange', + defaultTime: [new Date('1 '), new Date('1 ')] + } + }, }, { label: '需求时间', diff --git a/src/views/wms/basicDataManage/customerManage/customerDeliveryForecast/index.vue b/src/views/wms/basicDataManage/customerManage/customerDeliveryForecast/index.vue index 39689c7a3..7ea2310f4 100644 --- a/src/views/wms/basicDataManage/customerManage/customerDeliveryForecast/index.vue +++ b/src/views/wms/basicDataManage/customerManage/customerDeliveryForecast/index.vue @@ -1,7 +1,7 @@