diff --git a/src/api/wms/demandforecastingMain/index.ts b/src/api/wms/demandforecastingMain/index.ts index 7bade4c22..e15029d57 100644 --- a/src/api/wms/demandforecastingMain/index.ts +++ b/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 }) } diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue index 3f98521ed..5bc12936e 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue +++ b/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('创建标签失败') + // }) +} +