diff --git a/src/api/wms/demandforecastingDetail/index.ts b/src/api/wms/demandforecastingDetail/index.ts index f45e61a27..059cc4ce2 100644 --- a/src/api/wms/demandforecastingDetail/index.ts +++ b/src/api/wms/demandforecastingDetail/index.ts @@ -1,4 +1,6 @@ import request from '@/config/axios' +import { isString } from '@/utils/is' +import dayjs from 'dayjs' export interface DemandforecastingDetailVO { predictTimeType: string @@ -15,6 +17,57 @@ export interface DemandforecastingDetailVO { available: string } +// 要货预测-列表和头部请求参数 +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 +} + // 查询要货预测子列表 export const getDemandforecastingDetailPage = async (params) => { if (params.isSearch) { @@ -22,6 +75,8 @@ export const getDemandforecastingDetailPage = async (params) => { const data = {...params} return await request.post({ url: '/wms/demandforecasting-detail/senior', data }) } else { + params = getPageParams(params) + console.log('params',params) return await request.get({ url: `/wms/demandforecasting-detail/page`, params }) } } @@ -50,3 +105,16 @@ export const deleteDemandforecastingDetail = async (id: number) => { export const exportDemandforecastingDetail = async (params) => { return await request.download({ url: `/wms/demandforecasting-detail/export-excel`, params }) } + +// 查询要货预测主列表 +export const getPageTableHead = async (params) => { + params = getPageParams(params) + console.log('params',params) + return await request.get({ url: `/wms/demandforecasting-detail/queryPageTableHead`, params }) +} + + +// 查询版本号 +export const queryVersion = async (data) => { + return await request.post({ url: `/wms/demandforecasting-detail/queryVersion`, data }) +} \ No newline at end of file diff --git a/src/api/wms/demandforecastingMain/index.ts b/src/api/wms/demandforecastingMain/index.ts index 68b471769..7d5596a8f 100644 --- a/src/api/wms/demandforecastingMain/index.ts +++ b/src/api/wms/demandforecastingMain/index.ts @@ -80,4 +80,24 @@ export const exportDemandforecastingMain = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/demandforecasting-main/get-import-template' }) -} \ No newline at end of file +} + + +// 计划员 +export const queryUserPlanerList = async () => { + return await request.post({ url: `/wms/demandforecasting-main/queryUserPlanerList`,data:{} }) + +} + +// 供应商代码 +export const querySupplierList = async (data) => { + return await request.post({ url: `/wms/demandforecasting-main/querySupplierList`,data }) +} + + +// 是否已读接口 +export const updateIsRead = async (data) => { + return await request.post({ url: `/wms/demandforecasting-main/updateIsRead`,data }) +} + + diff --git a/src/api/wms/itempackage/index.ts b/src/api/wms/itempackage/index.ts index 555a174b0..0917dc431 100644 --- a/src/api/wms/itempackage/index.ts +++ b/src/api/wms/itempackage/index.ts @@ -29,7 +29,16 @@ export const getItempackagingPage = async (params) => { return await request.get({ url: `/wms/itempackage/page`, params }) } } - +// 查询物料包装信息树形列表 +export const getItempackagingPageTree = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/wms/itempackage/seniorTree', data }) + } else { + return await request.get({ url: `/wms/itempackage/pageTree`, params }) + } +} // 查询物料包装信息 列表--供应商发货申请 export const getItempackagingPageBySupplierdeliver = async (params) => { if (params.isSearch) { diff --git a/src/api/wms/packageunit/index.ts b/src/api/wms/packageunit/index.ts index fa1718d35..94f053f3a 100644 --- a/src/api/wms/packageunit/index.ts +++ b/src/api/wms/packageunit/index.ts @@ -33,7 +33,26 @@ export const getPackageunitPage = async (params) => { return await request.get({ url: `/wms/packageunit/page`, params }) } } - +// 查询物品包装规格信息 列表树状图 +export const getPackageunitPageTree = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/wms/packageunit/seniorTree', data }) + } else { + return await request.get({ url: `/wms/packageunit/pageTree`, params }) + } +} +// 查询物品父级包装规格信息 +export const getPackageunitPageParent = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/wms/packageunit/seniorParent', data }) + } else { + return await request.get({ url: `/wms/packageunit/pageParent`, params }) + } +} // 查询物品包装规格信息 详情 export const getPackageunit = async (id: number) => { return await request.get({ url: `/wms/packageunit/get?id=` + id }) diff --git a/src/api/wms/purchasePlanDetail/index.ts b/src/api/wms/purchasePlanDetail/index.ts index 3da2f8973..a436ab74a 100644 --- a/src/api/wms/purchasePlanDetail/index.ts +++ b/src/api/wms/purchasePlanDetail/index.ts @@ -15,7 +15,17 @@ export interface PurchasePlanDetailVO { updater: string available: string } +// 要货预测-列表和头部请求参数 +const getPageParams = (params)=>{ + console.log('params.status',params.status) + // 状态 + if(params.status&¶ms.status.length>0){ + params.statuss = params.status.join(',') + } + params.status = '' + return params +} // 查询要货计划子列表 export const getPurchasePlanDetailPage = async (params) => { if (params.isSearch) { @@ -23,6 +33,7 @@ export const getPurchasePlanDetailPage = async (params) => { const data = {...params} return await request.post({ url: '/wms/purchase-plan-detail/senior', data }) } else { + params = getPageParams(params) return await request.get({ url: `/wms/purchase-plan-detail/page`, params }) } } diff --git a/src/api/wms/purchasePlanMain/index.ts b/src/api/wms/purchasePlanMain/index.ts index 167e3ffd6..9d5e42230 100644 --- a/src/api/wms/purchasePlanMain/index.ts +++ b/src/api/wms/purchasePlanMain/index.ts @@ -85,7 +85,24 @@ export const exportPurchasePlanMain = async (params) => { return await request.download({ url: `/wms/purchase-plan-main/export-excel`, params }) } } - +// 导出明细要货计划主 Excel +export const exportDetailsPurchasePlanMain = async (params) => { + if (params.isSearch) { + const data = {...params} + return await request.downloadPost({ url: `/wms/purchase-plan-main/export-excel-senior`, data }) + } else { + return await request.download({ url: `/wms/purchase-plan-main/export-excel-detail`, params }) + } +} +// 导出要货计划二维表 Excel +export const exportTablePurchasePlanMain = async (params) => { + // if (params.isSearch) { + // const data = {...params} + // return await request.downloadPost({ url: `/wms/purchase-plan-main/export-excel-senior`, data }) + // } else { + return await request.download({ url: `/wms/purchase-plan-main/export-excel`, params }) + //} +} // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/purchase-plan-main/get-import-template' }) diff --git a/src/api/wms/supplierCycle/index.ts b/src/api/wms/supplierCycle/index.ts new file mode 100644 index 000000000..ddaf2013e --- /dev/null +++ b/src/api/wms/supplierCycle/index.ts @@ -0,0 +1,65 @@ +import request from '@/config/axios' + +export interface SupplierCycleVO { + id: number + supplierCode: string + monday: string + tuesday: string + wednesday: string + thursday: string + friday: string + saturday: string + sunday: string + version: string + remark: string + extraProperties: string + siteId: string + beginTime: Date + endTime: Date + available: string + status: string + concurrencyStamp: string + ruleUserId: number + departmentCode: string +} + +// 查询要货预测周期列表 +export const getSupplierCyclePage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/wms/supplier-cycle/senior', data }) + } else { + return await request.get({ url: `/wms/supplier-cycle/page`, params }) + } +} + +// 查询要货预测周期详情 +export const getSupplierCycle = async (id: number) => { + return await request.get({ url: `/wms/supplier-cycle/get?id=` + id }) +} + +// 新增要货预测周期 +export const createSupplierCycle = async (data: SupplierCycleVO) => { + return await request.post({ url: `/wms/supplier-cycle/create`, data }) +} + +// 修改要货预测周期 +export const updateSupplierCycle = async (data: SupplierCycleVO) => { + return await request.put({ url: `/wms/supplier-cycle/update`, data }) +} + +// 删除要货预测周期 +export const deleteSupplierCycle = async (id: number) => { + return await request.delete({ url: `/wms/supplier-cycle/delete?id=` + id }) +} + +// 导出要货预测周期 Excel +export const exportSupplierCycle = async (params) => { + return await request.download({ url: `/wms/supplier-cycle/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/wms/supplier-cycle/get-import-template' }) +} \ No newline at end of file diff --git a/src/api/wms/supplierdeliverRequestDetail/index.ts b/src/api/wms/supplierdeliverRequestDetail/index.ts index 64580a04e..ab0609463 100644 --- a/src/api/wms/supplierdeliverRequestDetail/index.ts +++ b/src/api/wms/supplierdeliverRequestDetail/index.ts @@ -43,7 +43,14 @@ export const getSupplierdeliverRequestDetailPage = async (params) => { return await request.get({ url: `/wms/supplierdeliver-request-detail/page`, params }) } } - +// 查询供应商发货申请子列表 +export const getGenerateLabelList = async (params) => { + return await request.get({ url: `/wms/supplierdeliver-request-detail/generateLabelList`, params }) +} +// 查询托规格列表 +export const getGenerateLabelParentList = async (params) => { + return await request.get({ url: `/wms/supplierdeliver-request-detail/generateLabelParentList`, params }) +} // 查询供应商发货申请子详情 export const getSupplierdeliverRequestDetail = async (id: number) => { return await request.get({ url: `/wms/supplierdeliver-request-detail/get?id=` + id }) diff --git a/src/api/wms/supplieritem/index.ts b/src/api/wms/supplieritem/index.ts index 81cbf3d12..274469390 100644 --- a/src/api/wms/supplieritem/index.ts +++ b/src/api/wms/supplieritem/index.ts @@ -51,16 +51,27 @@ export const getSupplieritem = async (id: number) => { export const createSupplieritem = async (data: SupplieritemVO) => { return await request.post({ url: `/wms/supplieritem/create`, data }) } +export const createSupplieritemSCP = async (data: SupplieritemVO) => { + return await request.post({ url: `/wms/supplieritem/createSCP`, data }) +} // 修改供应商物料 export const updateSupplieritem = async (data: SupplieritemVO) => { return await request.put({ url: `/wms/supplieritem/update`, data }) } +// 修改供应商物料 +export const updateSupplieritemSCP = async (data: SupplieritemVO) => { + return await request.put({ url: `/wms/supplieritem/updateSCP`, data }) +} // 删除供应商物料 export const deleteSupplieritem = async (id: number) => { return await request.delete({ url: `/wms/supplieritem/delete?id=` + id }) } +export const deleteSupplieritemSCP = async (id: number) => { + return await request.delete({ url: `/wms/supplieritem/deleteSCP?id=` + id }) +} + // 导出供应商物料 Excel export const exportSupplieritem = async (params) => { diff --git a/src/components/BasicForm/src/BasicForm.vue b/src/components/BasicForm/src/BasicForm.vue index 9b5e713cb..c9d62bbca 100644 --- a/src/components/BasicForm/src/BasicForm.vue +++ b/src/components/BasicForm/src/BasicForm.vue @@ -102,6 +102,7 @@ @clearInput='clearInput' @batchAdd="batchAdd" :routeName="routeName" + @visibleChange='visibleChange' > - + + + \ No newline at end of file diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingSupplierMain/demandforecastingMain.data.ts b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingSupplierMain/demandforecastingMain.data.ts new file mode 100644 index 000000000..b094557b3 --- /dev/null +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingSupplierMain/demandforecastingMain.data.ts @@ -0,0 +1,399 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter,dateFormatter2 } from '@/utils/formatTime' +import * as SupplierApi from '@/api/wms/supplier' +import { Supplier} from '@/views/wms/basicDataManage/supplierManage/supplier/supplier.data' +import * as SupplieritemApi from '@/api/wms/supplieritem' +import { Supplieritem } from '@/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data' +import * as ItembasicApi from '@/api/wms/itembasic' +import {Itembasic} from "@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data"; +import * as PurchaseMainApi from '@/api/wms/purchaseMain' +import * as PurchaseDetailApi from '@/api/wms/purchaseDetail' +import { PurchaseDetail, PurchaseMain } from '../purchaseMain/purchaseMain.data' +import * as DemandforecastingMainApi from '@/api/wms/demandforecastingMain' +import * as DemandforecastingDetailApi from '@/api/wms/demandforecastingDetail' +import dayjs from 'dayjs' + +const { t } = useI18n() // 国际化 + +/** + * @returns {Array} 要货预测主表 + */ +Supplieritem.allSchemas.searchSchema = Supplieritem.allSchemas.searchSchema.filter(item=>item.field!="allowOverShipment") +export const Version = useCrudSchemas(reactive([ + { + label: '供应商代码', + field: 'supplerCodes', + 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 DemandforecastingMain = useCrudSchemas(reactive([ + { + label: '是否已读', + field: 'isRead', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单号', + field: 'poNumber', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '订单行', + field: 'poLine', + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '物料代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + isSearch:true, + isTable:true, + isForm: false, + 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: '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', + formatter: dateFormatter, + sort: 'custom', + table: { + width: 150 + }, + isSearch:true, + isTable:false, + isForm: false, + search: { + value: [dayjs(), dayjs().subtract(-3,'month')], + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD', + type: 'daterange', + defaultTime: [new Date('1 '), new Date('1 ')] + } + }, + } +])) + +//表单校验 +export const DemandforecastingMainRules = reactive({ + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], + supplierCode: [ + { required: true, message: '请选择供应商代码', trigger: 'change' } + ], + version: [ + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], + remark: [ + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 要货预测子表 + */ +export const DemandforecastingDetail = useCrudSchemas(reactive([ + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 180 + }, + isTableForm: false, + hiddenInMain:true, + form: { + componentProps: { + disbaled: true + } + } + }, + { + label: '预测时间类型', + field: 'predictTimeType', + dictType: DICT_TYPE.PREDICT_TIME_TYPE, + sort: 'custom', + dictClass: 'string', + isTable: false, + table: { + width: 150 + }, + tableForm: { + type: 'Select' + } + }, + { + label: '预测日期', + field: 'predictTime', + formatter: dateFormatter2, + detail: { + dateFormat: 'YYYY-MM-DD' + }, + sort: 'custom', + table: { + width: 180 + }, + isTable:false, + form: { + component: 'DatePicker', + componentProps: { + style: {width: '100%'}, + type: 'date', + dateFormat: 'YYYY-MM-DD', + valueFormat: 'x', + } + }, + tableForm: { + type: 'FormDate', + dateFormat: 'YYYY-MM-DD', + valueFormat: 'x', + } + }, + + { + label: '计量单位', + field: 'uom', + sort: 'custom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isTable: true, + table: { + width: 150 + }, + tableForm: { + type: 'Select', + disabled: true + } + }, + { + label: '计划数量', + field: 'planQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + componentProps: { + min: 1, + precision: 6 + } + }, + tableForm: { + type: 'InputNumber', + min: 1, + precision: 6 + } + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + isTableForm: false, + isForm: false, + }, + { + label: '创建者', + field: 'creator', + sort: 'custom', + table: { + width: 150 + }, + isTableForm: false, + isForm: false, + }, + { + label: '最后更新时间', + field: 'updateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + isTableForm: false, + isForm: false, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + isTableForm: false, + isForm: false, + }, + { + label: '操作', + hiddenInMain:true, + field: 'action', + isDetail: false, + isForm: false, + table: { + width: 150, + fixed: 'right' + }, + isTableForm: false, + } +])) + +//表单校验 +export const DemandforecastingDetailRules = reactive({ + predictTimeType: [ + { required: true, message: '请选择预测时间类型', trigger: 'change' }, + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], + predictTime: [ + { required: true, message: '请输入预测时间', trigger: 'change' } + ], + planQty: [ + { required: true, message: '请输入计划数量', trigger: 'blur' } + ], + uom: [ + { required: true, message: '请选择计量单位', trigger: 'change' } + ], + number: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物料代码', trigger: 'change' } + ], + remark: [ + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], + poLine: [{required:true, message: '请选择订单行', trigger: 'blur'}] +}) diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingSupplierMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingSupplierMain/index.vue new file mode 100644 index 000000000..9e3dea6c8 --- /dev/null +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingSupplierMain/index.vue @@ -0,0 +1,285 @@ + + + + \ No newline at end of file diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue index 905708139..1e234687a 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue @@ -1,7 +1,7 @@