Browse Source

预览要货计划功能

intex_online20241111
yufei_wang 3 weeks ago
parent
commit
84513ed15c
  1. 10
      src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/demandforecastingMain.data.ts
  2. 68
      src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue

10
src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/demandforecastingMain.data.ts

@ -272,6 +272,14 @@ export const DemandforecastingMain = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 '), new Date('1 ')]
}
},
},
{
label: '操作',
field: 'action',
table: {
width: 150,
fixed: 'right'
}
}
]))
@ -568,5 +576,5 @@ export const DemandforecastingMainPlan = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 150
},
},
}
]))

68
src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue

@ -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)=>{

Loading…
Cancel
Save