|
|
@ -33,6 +33,9 @@ |
|
|
|
<template v-for="name in tableObjectHead.tableList" :key="name" #[name]="{row}"> |
|
|
|
<span :class="{'success-text':row['planType_F'].indexOf(name)>-1}">{{ row[name] }}</span> |
|
|
|
</template> |
|
|
|
<template #action="{ row,$index }"> |
|
|
|
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" /> |
|
|
|
</template> |
|
|
|
</Table> |
|
|
|
</ContentWrap> |
|
|
|
<!-- :vLoading="formLoadingPlan" --> |
|
|
@ -41,13 +44,16 @@ |
|
|
|
width="80%" |
|
|
|
:close-on-click-modal="false" |
|
|
|
> |
|
|
|
<Table :columns="tableColumnsPlan" |
|
|
|
<Table |
|
|
|
ref="tablePlanRef" |
|
|
|
:selection="true" |
|
|
|
:columns="tableColumnsPlan" |
|
|
|
:data="tableObjectPlan.tableList" |
|
|
|
:loading="tableObjectPlan.loading" |
|
|
|
v-model:pageSize="tableObjectPlan.pageSize" |
|
|
|
v-model:currentPage="tableObjectPlan.currentPage" |
|
|
|
v-model:sort="tableObjectPlan.sort" |
|
|
|
@getSelectionRows="getSelectionRows" |
|
|
|
@getSelectionRows="getSelectionRowsPlan" |
|
|
|
/> |
|
|
|
<template #footer> |
|
|
|
<slot name="foorter"></slot> |
|
|
@ -193,6 +199,34 @@ const buttonBaseClick = async (val, item) => { |
|
|
|
console.log('其他按钮', item) |
|
|
|
} |
|
|
|
} |
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = (row,$index) => { |
|
|
|
return [ |
|
|
|
{ |
|
|
|
label: t(`ts.生成要货计划`).replace('ts.', ''), |
|
|
|
name: 'previewPlan', |
|
|
|
hide: !(row['planType_F'].length>0&&(!tableObject.params.version || tableObject.params.version.length == 0)), |
|
|
|
type: 'primary', |
|
|
|
color: '', |
|
|
|
link: true, // 文本展现按钮 |
|
|
|
hasPermi: '' |
|
|
|
} |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'previewPlan') { // 生成要货计划 |
|
|
|
tableObjectPlan.params.masterIds = row.mainId |
|
|
|
handlePreviewPlan() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const dialogVisiblePlan = ref(false) |
|
|
|
// 批量 |
|
|
|
const selectionRows = ref<any>([]) |
|
|
@ -215,6 +249,7 @@ const { tableObject:tableObjectPlan, tableMethods:tableMethodsPlan } = useTable( |
|
|
|
}) |
|
|
|
// 获得表格的各种操作 |
|
|
|
const { getList:getListPlan} = tableMethodsPlan |
|
|
|
// 批量生成要货计划 |
|
|
|
const selectionPlan = async ()=>{ |
|
|
|
let rows: any = [] |
|
|
|
selectionRows.value.forEach((item) => { |
|
|
@ -222,6 +257,10 @@ const selectionPlan = async ()=>{ |
|
|
|
}) |
|
|
|
console.log('批量生成要货计划', rows.join(',')) |
|
|
|
tableObjectPlan.params.masterIds = rows.join(',') |
|
|
|
handlePreviewPlan() |
|
|
|
} |
|
|
|
const handlePreviewPlan = async ()=>{ |
|
|
|
|
|
|
|
if(tableObject.params.dueDate&&tableObject.params.dueDate.length>0){ |
|
|
|
if(isString(tableObject.params.dueDate[0])){ |
|
|
|
tableObjectPlan.params.startDate = tableObject.params.dueDate[0] |
|
|
@ -242,6 +281,7 @@ const selectionPlan = async ()=>{ |
|
|
|
} |
|
|
|
|
|
|
|
await getListPlan() |
|
|
|
selectionPlanRows.value = [] |
|
|
|
dialogVisiblePlan.value = true |
|
|
|
} |
|
|
|
|
|
|
@ -249,12 +289,36 @@ const buttonBaseClickPlan = (val)=>{ |
|
|
|
if (val == 'save') { |
|
|
|
// 保存 |
|
|
|
dialogVisiblePlan.value = false |
|
|
|
let rows: any = [] |
|
|
|
selectionPlanRows.value.forEach((item) => { |
|
|
|
rows = [...rows, ...item.selectionRows.map((item1) => item1.id)] |
|
|
|
}) |
|
|
|
console.log('预览要货计划', selectionPlanRows.value) |
|
|
|
console.log('预览要货计划', rows.join(',')) |
|
|
|
|
|
|
|
} |
|
|
|
// 关闭 |
|
|
|
else if (val == 'close') { |
|
|
|
dialogVisiblePlan.value = false |
|
|
|
} |
|
|
|
} |
|
|
|
// 预览要货计划-批量 |
|
|
|
const selectionPlanRows = ref<any>([]) |
|
|
|
const tablePlanRef = ref() |
|
|
|
const getSelectionRowsPlan = (currentPage, currentPageSelectionRows) => { |
|
|
|
const currentRows = selectionPlanRows.value.find((item) => item.currentPage == currentPage) |
|
|
|
if (currentRows) { |
|
|
|
currentRows.selectionRows = currentPageSelectionRows |
|
|
|
} else { |
|
|
|
selectionPlanRows.value.push({ |
|
|
|
currentPage, |
|
|
|
selectionRows: currentPageSelectionRows |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const seachRef = ref() |
|
|
|
const onSearchChange = (field, value)=>{ |
|
|
|