|
|
@ -195,13 +195,11 @@ const butttondata = (row,$index) => { |
|
|
|
return [] |
|
|
|
} |
|
|
|
return [ |
|
|
|
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6'])}), // 关闭 |
|
|
|
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5'])}), // 重新添加 |
|
|
|
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1'])}), // 提交审批 |
|
|
|
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2'])}), // 驳回 |
|
|
|
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2'])}), // 审批通过 |
|
|
|
defaultButtons.mainListEditBtn({hasPermi:'wms:demandforecasting-main:update'}), // 编辑 |
|
|
|
defaultButtons.mainListDeleteBtn({hasPermi:'wms:demandforecasting-main:delete'}), // 删除 |
|
|
|
defaultButtons.mainListOrderCloBtn({ hide: isShowMainButton(row, ['1']) }), // 关闭 |
|
|
|
defaultButtons.mainListOrderOpeBtn({ hide: isShowMainButton(row, ['3']) }), // 打开 |
|
|
|
defaultButtons.mainListOrderPubBtn({ hide: isShowMainButton(row, ['1']) }), // 发布 |
|
|
|
defaultButtons.mainListOrderWitBtn({ hide: isShowMainButton(row, ['2']) }), // 下架 |
|
|
|
defaultButtons.mainListEditBtn({ hasPermi: 'wms:demandforecasting-main:update', hide: isShowMainButton(row, ['1']) }), // 编辑 |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
@ -209,16 +207,14 @@ const butttondata = (row,$index) => { |
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'mainClose') { // 关闭 |
|
|
|
console.log('列表-操作按钮事件-关闭') |
|
|
|
} else if (val == 'mainReAdd') { // 重新添加 |
|
|
|
console.log('列表-操作按钮事件-重新添加') |
|
|
|
} else if (val == 'mainSubmit') { // 提交审批 |
|
|
|
console.log('列表-操作按钮事件-提交审批') |
|
|
|
} else if (val == 'mainTurnDown') { // 驳回 |
|
|
|
console.log('列表-操作按钮事件-驳回') |
|
|
|
} else if (val == 'mainApprove') { // 审批通过 |
|
|
|
console.log('列表-操作按钮事件-审批通过') |
|
|
|
if (val == 'mainOrderClo') { // 关闭 |
|
|
|
handleClose(row.masterId) |
|
|
|
} else if (val == 'mainOrderOpe') { // 打开 |
|
|
|
handleOpen(row.masterId) |
|
|
|
} else if (val == 'mainOrderPub') { // 发布 |
|
|
|
handlePublish(row.masterId) |
|
|
|
} else if (val == 'mainOrderWit') { // 下架 |
|
|
|
handleWit(row.masterId) |
|
|
|
} else if (val == 'edit') { // 编辑 |
|
|
|
openForm('update', row) |
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
@ -233,6 +229,75 @@ const openForm =async (type: string, row?: number) => { |
|
|
|
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 openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
|