diff --git a/src/views/wms/purchasereceiptManage/putaway/putawayJobMain/index.vue b/src/views/wms/purchasereceiptManage/putaway/putawayJobMain/index.vue index 3f6f6edd5..4beac21ea 100644 --- a/src/views/wms/purchasereceiptManage/putaway/putawayJobMain/index.vue +++ b/src/views/wms/purchasereceiptManage/putaway/putawayJobMain/index.vue @@ -174,9 +174,9 @@ const isShowMainButton = (row,val) => { // 列表-操作按钮 const butttondata = (row) => { return [ - defaultButtons.mainListJobAccBtn({hide:isShowMainButton(row,['1'])}), // 承接 - defaultButtons.mainListJobCloBtn({hide:isShowMainButton(row,['1'])}), // 关闭 - defaultButtons.mainListJobAbaBtn({hide:isShowMainButton(row,['2'])}), // 放弃 + // defaultButtons.mainListJobAccBtn({hide:isShowMainButton(row,['1'])}), // 承接 + defaultButtons.mainListJobCloBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchasereceipt-job-main:close'}), // 关闭 + // defaultButtons.mainListJobAbaBtn({hide:isShowMainButton(row,['2'])}), // 放弃 // defaultButtons.mainListJobExeBtn({hide:isShowMainButton(row,['2'])}), // 执行 ] } @@ -188,7 +188,7 @@ const buttonTableClick = async (val, row) => { } else if (val == 'mainJobAba') { // 放弃 console.log('列表-操作按钮事件-放弃') } else if (val == 'mainJobClo') { // 关闭 - console.log('列表-操作按钮事件-关闭') + handleClose(row.id) } else if (val == 'mainJobAcc') { // 承接 console.log('列表-操作按钮事件-承接') } @@ -200,6 +200,16 @@ const openDetail = (row: any, titleName: any, titleValue: any) => { detailRef.value.openDetail(row, titleName, titleValue) } +/** 关闭按钮操作 */ +const handleClose = async (id: number) => { + try { + await message.confirm(t('common.confirmColse')) + await PutawayJobMainApi.closePutawayJobMain(id) + message.success(t('common.closeSuccess')) + await getList() + } catch {} +} + /** 导出按钮操作 */ const exportLoading = ref(false) // 导出的加载中 const handleExport = async () => { diff --git a/src/views/wms/purchasereceiptManage/putaway/putawayRequestMain/index.vue b/src/views/wms/purchasereceiptManage/putaway/putawayRequestMain/index.vue index 2a5302fec..67f6a8985 100644 --- a/src/views/wms/purchasereceiptManage/putaway/putawayRequestMain/index.vue +++ b/src/views/wms/purchasereceiptManage/putaway/putawayRequestMain/index.vue @@ -184,13 +184,13 @@ const isShowMainButton = (row,val) => { // 列表-操作按钮 const butttondata = (row) => { 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:putaway-request-main:update'}), // 编辑 - defaultButtons.mainListDeleteBtn({hasPermi:'wms:putaway-request-main:delete'}), // 删除 + defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6']),hasPermi:'wms:purchasereceipt-request-main:close'}), // 关闭 + defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['5']),hasPermi:'wms:purchasereceipt-request-main:reAdd'}), //重新添加 + defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchasereceipt-request-main:submit'}), // 提交审批 + defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:purchasereceipt-request-main:refused'}), // 驳回 + defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:purchasereceipt-request-main:agree'}), // 审批通过 + defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:purchasereceipt-request-main:handle'}), // 处理 + defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchasereceipt-request-main:update'}), // 编辑 ] } @@ -199,19 +199,19 @@ const butttondata = (row) => { // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { if (val == 'mainClose') { // 关闭 - console.log('列表-操作按钮事件-关闭') + handleClose(row.id) } else if (val == 'mainReAdd') { // 重新添加 - console.log('列表-操作按钮事件-重新添加') + handleReAdd(row.id) } else if (val == 'mainSubmit') { // 提交审批 - console.log('列表-操作按钮事件-提交审批') + handleSubmit(row.id) } else if (val == 'mainTurnDown') { // 驳回 - console.log('列表-操作按钮事件-驳回') + handleRefused(row.id) } else if (val == 'mainApprove') { // 审批通过 - console.log('列表-操作按钮事件-审批通过') + handleAgree(row.id) + } else if (val == 'mainHandle') { // 处理 + handleHandle(row.id) } else if (val == 'edit') { // 编辑 openForm('update', row) - } else if (val == 'delete') { // 删除 - handleDelete(row.id) } } @@ -222,6 +222,66 @@ const openForm =async (type: string, row?: number) => { formRef.value.open(type, row) } +/** 关闭按钮操作 */ +const handleClose = async (id: number) => { + try { + await message.confirm(t('common.confirmColse')) + await PutawayRequestMainApi.closePutawayRequestMain(id) + message.success(t('common.closeSuccess')) + await getList() + } catch {} +} + +/** 重新添加按钮操作 */ +const handleReAdd = async (id: number) => { + try { + await message.confirm(t('common.confirmReAdd')) + await PutawayRequestMainApi.reAddPutawayRequestMain(id) + message.success(t('common.reAddSuccess')) + await getList() + } catch {} +} + +/** 审批通过按钮操作 */ +const handleAgree = async (id: number) => { + try { + await message.confirm(t('common.confirmAgree')) + await PutawayRequestMainApi.agreePutawayRequestMain(id) + message.success(t('common.agreeSuccess')) + await getList() + } catch {} +} + +/** 审批驳回按钮操作 */ +const handleRefused = async (id: number) => { + try { + await message.confirm(t('common.confirmRefused')) + await PutawayRequestMainApi.refusedPutawayRequestMain(id) + message.success(t('common.refusedSuccess')) + await getList() + } catch {} +} + +/** 处理按钮操作 */ +const handleHandle = async (id: number) => { + try { + await message.confirm(t('common.confirmHandle')) + await PutawayRequestMainApi.handlePutawayRequestMain(id) + message.success(t('common.handleSuccess')) + await getList() + } catch {} +} + +/** 提交按钮操作 */ +const handleSubmit = async (id: number) => { + try { + await message.confirm(t('common.confirmSubmit')) + await PutawayRequestMainApi.submitPutawayRequestMain(id) + message.success(t('common.submitSuccess')) + await getList() + } catch {} +} + /** 详情操作 */ const detailRef = ref() const openDetail = (row: any, titleName: any, titleValue: any) => {