|
@ -69,6 +69,8 @@ import * as DemandforecastingDetailApi from '@/api/wms/demandforecastingDetail' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
import { usePageLoading } from '@/hooks/web/usePageLoading' |
|
|
import { usePageLoading } from '@/hooks/web/usePageLoading' |
|
|
|
|
|
import { isString } from '@/utils/is' |
|
|
|
|
|
|
|
|
const { loadStart, loadDone } = usePageLoading() |
|
|
const { loadStart, loadDone } = usePageLoading() |
|
|
// 要货预测 |
|
|
// 要货预测 |
|
|
defineOptions({ name: 'DemandforecastingMain' }) |
|
|
defineOptions({ name: 'DemandforecastingMain' }) |
|
@ -209,7 +211,7 @@ const getSelectionRows = (currentPage, currentPageSelectionRows) => { |
|
|
} |
|
|
} |
|
|
const tableColumnsPlan = ref(DemandforecastingMainPlan.allSchemas.tableColumns) |
|
|
const tableColumnsPlan = ref(DemandforecastingMainPlan.allSchemas.tableColumns) |
|
|
const { tableObject:tableObjectPlan, tableMethods:tableMethodsPlan } = useTable({ |
|
|
const { tableObject:tableObjectPlan, tableMethods:tableMethodsPlan } = useTable({ |
|
|
getListApi: DemandforecastingDetailApi.getDemandforecastingDetailPage // 分页接口 |
|
|
getListApi: DemandforecastingDetailApi.getPreviewPlan // 分页接口 |
|
|
}) |
|
|
}) |
|
|
// 获得表格的各种操作 |
|
|
// 获得表格的各种操作 |
|
|
const { getList:getListPlan} = tableMethodsPlan |
|
|
const { getList:getListPlan} = tableMethodsPlan |
|
@ -219,6 +221,26 @@ const selectionPlan = async ()=>{ |
|
|
rows = [...rows, ...item.selectionRows.map((item1) => item1.mainId)] |
|
|
rows = [...rows, ...item.selectionRows.map((item1) => item1.mainId)] |
|
|
}) |
|
|
}) |
|
|
console.log('批量生成要货计划', rows.join(',')) |
|
|
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() |
|
|
await getListPlan() |
|
|
dialogVisiblePlan.value = true |
|
|
dialogVisiblePlan.value = true |
|
|
} |
|
|
} |
|
|