Browse Source

要货预测修改

master_hella_20240701
zhaoxuebing 7 months ago
parent
commit
1e8c9d4ff5
  1. 18
      src/api/wms/demandforecastingMain/index.ts
  2. 99
      src/views/wms/purchasereceiptManage/supplierdeliver/demandforecastingMain/index.vue

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

@ -48,6 +48,24 @@ export const deleteDemandforecastingMain = async (id: number) => {
return await request.delete({ url: `/wms/demandforecasting-main/delete?id=` + id }) return await request.delete({ url: `/wms/demandforecasting-main/delete?id=` + id })
} }
// 关闭要货预测
export const closePurchaseMain = async (id: number) => {
return await request.post({ url: `/wms/demandforecasting-main/close?id=` + id })
}
// 打开要货预测
export const openPurchaseMain = async (id: number) => {
return await request.post({ url: `/wms/demandforecasting-main/open?id=` + id })
}
// 发布要货预测
export const publishPurchaseMain = async (id: number) => {
return await request.post({ url: `/wms/demandforecasting-main/publish?id=` + id })
}
// 下架要货预测
export const witPurchaseMain = async (id: number) => {
return await request.post({ url: `/wms/demandforecasting-main/wit?id=` + id })
}
// 导出要货预测主 Excel // 导出要货预测主 Excel
export const exportDemandforecastingMain = async (params) => { export const exportDemandforecastingMain = async (params) => {
if (params.isSearch) { if (params.isSearch) {

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

@ -195,13 +195,11 @@ const butttondata = (row,$index) => {
return [] return []
} }
return [ return [
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6'])}), // defaultButtons.mainListOrderCloBtn({ hide: isShowMainButton(row, ['1']) }), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5'])}), // defaultButtons.mainListOrderOpeBtn({ hide: isShowMainButton(row, ['3']) }), //
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1'])}), // defaultButtons.mainListOrderPubBtn({ hide: isShowMainButton(row, ['1']) }), //
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2'])}), // defaultButtons.mainListOrderWitBtn({ hide: isShowMainButton(row, ['2']) }), //
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2'])}), // defaultButtons.mainListEditBtn({ hasPermi: 'wms:demandforecasting-main:update', hide: isShowMainButton(row, ['1']) }), //
defaultButtons.mainListEditBtn({hasPermi:'wms:demandforecasting-main:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:demandforecasting-main:delete'}), //
] ]
} }
@ -209,16 +207,14 @@ const butttondata = (row,$index) => {
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'mainClose') { // if (val == 'mainOrderClo') { //
console.log('列表-操作按钮事件-关闭') handleClose(row.masterId)
} else if (val == 'mainReAdd') { // } else if (val == 'mainOrderOpe') { //
console.log('列表-操作按钮事件-重新添加') handleOpen(row.masterId)
} else if (val == 'mainSubmit') { // } else if (val == 'mainOrderPub') { //
console.log('列表-操作按钮事件-提交审批') handlePublish(row.masterId)
} else if (val == 'mainTurnDown') { // } else if (val == 'mainOrderWit') { //
console.log('列表-操作按钮事件-驳回') handleWit(row.masterId)
} else if (val == 'mainApprove') { //
console.log('列表-操作按钮事件-审批通过')
} else if (val == 'edit') { // } else if (val == 'edit') { //
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') { //
@ -233,6 +229,75 @@ const openForm =async (type: string, row?: number) => {
formRef.value.open(type, row) formRef.value.open(type, row)
} }
/** 关闭按钮操作 */
const handleClose = async (id : number) => {
try {
//
await message.confirm('是否关闭所选中数据?')
tableObject.loading = true
//
await DemandforecastingMainApi.closePurchaseMain(id)
message.success(t('关闭成功!'))
tableObject.loading = false
//
await getList()
} catch { }finally{
tableObject.loading = false
}
}
/** 打开按钮操作 */
const handleOpen = async (id : number) => {
try {
//
await message.confirm('是否打开所选中数据?')
tableObject.loading = true
//
await DemandforecastingMainApi.openPurchaseMain(id)
message.success(t('打开成功!'))
tableObject.loading = false
//
await getList()
} catch { }finally{
tableObject.loading = false
}
}
/** 发布按钮操作 */
const handlePublish = async (id : number) => {
try {
//
await message.confirm('是否发布所选中数据?')
tableObject.loading = true
//
await DemandforecastingMainApi.publishPurchaseMain(id)
message.success(t('发布成功!'))
tableObject.loading = false
//
await getList()
} catch { }finally{
tableObject.loading = false
}
}
/** 下架按钮操作 */
const handleWit = async (id : number) => {
try {
//
await message.confirm('是否下架所选中数据?')
tableObject.loading = true
//
await DemandforecastingMainApi.witPurchaseMain(id)
message.success(t('下架成功!'))
tableObject.loading = false
//
await getList()
} catch { }finally{
tableObject.loading = false
}
}
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {

Loading…
Cancel
Save