Browse Source

YT-2150:SCP《要货预测-计划员》增加批量发布功能,可以勾选多条数据,批量发布。

intex_online20250327
songguoqiang 2 weeks ago
parent
commit
781ccd1900
  1. 4
      src/api/wms/demandforecastingMain/index.ts
  2. 38
      src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue

4
src/api/wms/demandforecastingMain/index.ts

@ -173,7 +173,7 @@ export const publish = async (data) => {
}
//批量重试
//批量发布
export const batchPublish = async(ids: string) => {
// return request.get({
// url: '/wms/outer/batchRetry?ids=' + ids+'&type='+type
@ -182,6 +182,6 @@ export const batchPublish = async(ids: string) => {
let data={
'ids':ids
}
return await request.post({ url: `/wms/outer/batchRetry`, data })
return await request.post({ url: `/wms/demandforecasting-main/batchPublish`, data })
}

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

@ -174,6 +174,7 @@ defaultButtons.defaultExportBtn({hasPermi:'wms:demandforecasting-main:export'}),
defaultButtons.defaultFreshBtn(null), //
// defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.mainListSelectionOrderPubBtn(null), //
]
//
@ -195,6 +196,8 @@ const buttonBaseClick = async (val, item) => {
} else if (val == 'filtrate') { //
} else if (val == 'selectionPlan') { //
selectionPlan()
} else if (val == 'mainOrderSelectionPub') { //
handleSelectionPublish()
} else { //
console.log('其他按钮', item)
}
@ -357,6 +360,41 @@ const getSelectionRowsPlan = (currentPage, currentPageSelectionRows) => {
}
}
//
const handleSelectionPublish = async ()=>{
tableObject.loading = true
let rows: any = []
selectionRows.value.forEach((item) => {
rows = [...rows, ...item.selectionRows.map((item1) => item1.mainId)]
})
console.log('批量生成要货计划', rows.join(','))
let ids = rows.join(',')
await DemandforecastingMainApi.batchPublish(ids)
.then((res) => {
// if (res?.status == '2') {
// message.error(res.message)
// } else {
// message.success(res.message)
// }
console.log('获取到的数据',res);
message.success(res.message)
tableObject.loading = false
buttonBaseClick('refresh', null)
})
.catch((err) => {
tableObject.loading = false
console.log(err)
})
// await PackageApi.batchPrintingLable(rows.join(',')).then(res => {
// console.log(res)
// window.open(srcPoint.value+'&relateNumber='+res)
// message.success('')
// }).catch(err => {
// console.log(err)
// message.error('')
// })
}

Loading…
Cancel
Save