|
|
@ -78,6 +78,7 @@ import { formatDate } from '@/utils/formatTime' |
|
|
|
import { usePageLoading } from '@/hooks/web/usePageLoading' |
|
|
|
import { isString } from '@/utils/is' |
|
|
|
import {publish} from "@/api/wms/demandforecastingMain"; |
|
|
|
import { disable } from '@/api/infra/outerApiHis' |
|
|
|
|
|
|
|
const { loadStart, loadDone } = usePageLoading() |
|
|
|
// 要货预测 |
|
|
@ -223,7 +224,7 @@ const butttondata = (row,$index) => { |
|
|
|
{ |
|
|
|
label: t(`ts.生成要货计划`).replace('ts.', ''), |
|
|
|
name: 'previewPlan', |
|
|
|
hide: isShowMainButton(row, ['2']) || !(row['planType_F'].length>0&&(!tableObject.params.version || tableObject.params.version.length == 0)), |
|
|
|
hide: isShowMainButton(row, ['2']) || !(row['planType_F'].length>0&&(!tableObject.params.version || tableObject.params.version.length == 0)) || row.isMaxScpVersion == '1', |
|
|
|
type: 'primary', |
|
|
|
color: '', |
|
|
|
link: true, // 文本展现按钮 |
|
|
@ -232,7 +233,7 @@ const butttondata = (row,$index) => { |
|
|
|
{ |
|
|
|
label: '发布', |
|
|
|
name: 'publish', |
|
|
|
hide: isShowMainButton(row, ['1']), |
|
|
|
hide: isShowMainButton(row, ['1']) || row.isMaxScpVersion == '1', |
|
|
|
type: 'primary', |
|
|
|
color: '', |
|
|
|
link: true, // 文本展现按钮 |
|
|
@ -290,11 +291,23 @@ const { tableObject:tableObjectPlan, tableMethods:tableMethodsPlan } = useTable( |
|
|
|
const { getList:getListPlan} = tableMethodsPlan |
|
|
|
// 批量生成要货计划 |
|
|
|
const selectionPlan = async ()=>{ |
|
|
|
if(!tableObject.tableList || tableObject.tableList.length === 0){ |
|
|
|
return |
|
|
|
} |
|
|
|
if(tableObject.tableList[0].isMaxScpVersion == '1'){ |
|
|
|
message.alert('选择版本号时无法生成要货计划选中!'); |
|
|
|
return; |
|
|
|
} |
|
|
|
let rows: any = [] |
|
|
|
selectionRows.value.forEach((item) => { |
|
|
|
rows = [...rows, ...item.selectionRows.map((item1) => item1.mainId)] |
|
|
|
}) |
|
|
|
console.log('批量生成要货计划', rows.join(',')) |
|
|
|
if(!rows || rows.length ===0){ |
|
|
|
message.alert('勾选数据不能为空!'); |
|
|
|
return |
|
|
|
} |
|
|
|
console.log('批量生成要货计划', rows.join(',')) |
|
|
|
tableObjectPlan.params.masterIds = rows.join(',') |
|
|
|
tableObjectPlan.params.dueDate = tableObject.params.dueDate |
|
|
|
handlePreviewPlan() |
|
|
@ -372,12 +385,25 @@ const getSelectionRowsPlan = (currentPage, currentPageSelectionRows) => { |
|
|
|
|
|
|
|
// 批量发布 |
|
|
|
const handleSelectionPublish = async ()=>{ |
|
|
|
tableObject.loading = true |
|
|
|
if(!tableObject.tableList || tableObject.tableList.length === 0){ |
|
|
|
message.alert('选择版本号时无法批量发布选中!'); |
|
|
|
return |
|
|
|
} |
|
|
|
if(tableObject.tableList[0].isMaxScpVersion == '1'){ |
|
|
|
message.alert('选择版本号时无法批量发布选中!'); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
let rows: any = [] |
|
|
|
selectionRows.value.forEach((item) => { |
|
|
|
rows = [...rows, ...item.selectionRows.map((item1) => item1.mainId)] |
|
|
|
}) |
|
|
|
console.log('批量生成要货计划', rows.join(',')) |
|
|
|
if(!rows || rows.length ===0){ |
|
|
|
message.alert('勾选数据不能为空!'); |
|
|
|
return |
|
|
|
} |
|
|
|
tableObject.loading = true |
|
|
|
let ids = rows.join(',') |
|
|
|
await DemandforecastingMainApi.batchPublish(ids) |
|
|
|
.then((res) => { |
|
|
|