diff --git a/.env.wyf b/.env.wyf index c7e026438..0538084bc 100644 --- a/.env.wyf +++ b/.env.wyf @@ -3,11 +3,18 @@ NODE_ENV=development VITE_DEV=false +# # 请求路径 +# VITE_BASE_URL='http://dev.ccwin-in.com:28040/api' + +# # 上传路径 +# VITE_UPLOAD_URL='http://dev.ccwin-in.com:28040/admin-api/infra/file/upload' + # 请求路径 -VITE_BASE_URL='http://dev.ccwin-in.com:28040/api' +VITE_BASE_URL='http://192.168.1.35:12080' # 上传路径 -VITE_UPLOAD_URL='http://dev.ccwin-in.com:28040/admin-api/infra/file/upload' +VITE_UPLOAD_URL='http://192.168.1.35:12080/admin-api/infra/file/upload' + # 接口前缀 VITE_API_BASEPATH=/dev-api diff --git a/src/api/wms/demandforecastingDetail/index.ts b/src/api/wms/demandforecastingDetail/index.ts index 753c999d9..27a835055 100644 --- a/src/api/wms/demandforecastingDetail/index.ts +++ b/src/api/wms/demandforecastingDetail/index.ts @@ -124,4 +124,9 @@ export const getPageTableHead = async (params) => { // 查询版本号 export const queryVersion = async (params) => { return await request.get({ url: `/wms/demandforecasting-detail/queryVersion`, params }) -} \ No newline at end of file +} + +// 预览要货计划 +export const getPreviewPlan = async (params) => { + return await request.get({ url: `/wms/demandforecasting-detail/preview`, params }) +} diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/demandforecastingMain.data.ts b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/demandforecastingMain.data.ts index 9241aadf0..72624bd24 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/demandforecastingMain.data.ts +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/demandforecastingMain.data.ts @@ -506,7 +506,7 @@ export const DemandforecastingDetailRules = reactive({ export const DemandforecastingMainPlan = useCrudSchemas(reactive([ { label: '版本号', - field: 'version', + field: 'detailVersion', sort: 'custom', table: { width: 150 @@ -514,7 +514,7 @@ export const DemandforecastingMainPlan = useCrudSchemas(reactive([ }, { label: '供应商代码', - field: 'supplierCode', + field: 'detailSupplierCode', sort: 'custom', table: { width: 150, @@ -555,7 +555,7 @@ export const DemandforecastingMainPlan = useCrudSchemas(reactive([ }, { label: '数量', - field: 'qty', + field: 'planQty', sort: 'custom', }, { diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue index 1872d4e2e..77c454790 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue @@ -69,6 +69,8 @@ import * as DemandforecastingDetailApi from '@/api/wms/demandforecastingDetail' import * as defaultButtons from '@/utils/disposition/defaultButtons' import { formatDate } from '@/utils/formatTime' import { usePageLoading } from '@/hooks/web/usePageLoading' +import { isString } from '@/utils/is' + const { loadStart, loadDone } = usePageLoading() // 要货预测 defineOptions({ name: 'DemandforecastingMain' }) @@ -209,7 +211,7 @@ const getSelectionRows = (currentPage, currentPageSelectionRows) => { } const tableColumnsPlan = ref(DemandforecastingMainPlan.allSchemas.tableColumns) const { tableObject:tableObjectPlan, tableMethods:tableMethodsPlan } = useTable({ - getListApi: DemandforecastingDetailApi.getDemandforecastingDetailPage // 分页接口 + getListApi: DemandforecastingDetailApi.getPreviewPlan // 分页接口 }) // 获得表格的各种操作 const { getList:getListPlan} = tableMethodsPlan @@ -219,6 +221,26 @@ const selectionPlan = async ()=>{ rows = [...rows, ...item.selectionRows.map((item1) => item1.mainId)] }) console.log('批量生成要货计划', rows.join(',')) + tableObjectPlan.params.masterIds = rows.join(',') + if(tableObject.params.dueDate&&tableObject.params.dueDate.length>0){ + if(isString(tableObject.params.dueDate[0])){ + tableObjectPlan.params.startDate = tableObject.params.dueDate[0] + }else{ + tableObjectPlan.params.startDate = tableObject.params.dueDate[0].format('YYYY-MM-DD') + } + } + if(tableObject.params.dueDate&&tableObject.params.dueDate.length>1){ + if(isString(tableObject.params.dueDate[1])){ + tableObjectPlan.params.endDate = tableObject.params.dueDate[1] + }else{ + tableObjectPlan.params.endDate = tableObject.params.dueDate[1].format('YYYY-MM-DD') + } + } + if (!tableObject.params.dueDate || tableObject.params.dueDate.length == 0) { + tableObjectPlan.params.startDate = '' + tableObjectPlan.params.endDate = '' + } + await getListPlan() dialogVisiblePlan.value = true }