diff --git a/src/api/wms/countJobMain/index.ts b/src/api/wms/countJobMain/index.ts index a2c6bc5f9..48ce99185 100644 --- a/src/api/wms/countJobMain/index.ts +++ b/src/api/wms/countJobMain/index.ts @@ -79,4 +79,9 @@ export const exportCountJobMain = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/count-job-main/get-import-template' }) -} \ No newline at end of file +} + +// 关闭盘点任务主 +export const closeCountJobMain = (id: number) => { + return request.download({ url: '/wms/count-job-main/close?id=' + id }) +} diff --git a/src/api/wms/countPlanMain/index.ts b/src/api/wms/countPlanMain/index.ts index 58d45ba32..b62d13077 100644 --- a/src/api/wms/countPlanMain/index.ts +++ b/src/api/wms/countPlanMain/index.ts @@ -66,4 +66,39 @@ export const exportCountPlanMain = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/count-plan-main/get-import-template' }) +} + +// 关闭 +export const close = (id) => { + return request.put({ url: '/wms/count-plan-main/close?id=' + id }) +} + +// 提交审批 +export const submit = (id) => { + return request.put({ url: '/wms/count-plan-main/submit?id=' + id }) +} + +// 打开 +export const open = (id) => { + return request.put({ url: '/wms/count-plan-main/open?id=' + id }) +} + +// 驳回 +export const reject = (id) => { + return request.put({ url: '/wms/count-plan-main/reject?id=' + id }) +} + +// 通过 +export const agree = (id) => { + return request.put({ url: '/wms/count-plan-main/agree?id=' + id }) +} + +// 发布 +export const publish = (id) => { + return request.put({ url: '/wms/count-plan-main/publish?id=' + id }) +} + +// 重置 +export const resetting = (id) => { + return request.put({ url: '/wms/count-plan-main/resetting?id=' + id }) } \ No newline at end of file diff --git a/src/api/wms/countRequestMain/index.ts b/src/api/wms/countRequestMain/index.ts index 7d1eb304a..2f462c421 100644 --- a/src/api/wms/countRequestMain/index.ts +++ b/src/api/wms/countRequestMain/index.ts @@ -61,4 +61,34 @@ export const exportCountRequestMain = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/count-request-main/get-import-template' }) -} \ No newline at end of file +} + +// 关闭盘点申请主 Excel +export const closeCountRequestMain = async (id) => { + return await request.put({ url: `/wms/count-request-main/close?id=` + id }) +} + +// 重新添加盘点申请主 Excel +export const reAddCountRequestMain = async (id) => { + return await request.put({ url: `/wms/count-request-main/reAdd?id=` + id }) +} + +// 提交盘点申请主 Excel +export const submitCountRequestMain = async (id) => { + return await request.put({ url: `/wms/count-request-main/submit?id=` + id }) +} + +// 审批通过盘点申请主 Excel +export const agreeCountRequestMain = async (id) => { + return await request.put({ url: `/wms/count-request-main/agree?id=` + id }) +} + +// 审批驳回盘点申请主 Excel +export const refusedCountRequestMain = async (id) => { + return await request.put({ url: `/wms/count-request-main/refused?id=` + id }) +} + +// 处理盘点申请主 Excel +export const handleCountRequestMain = async (id) => { + return await request.put({ url: `/wms/count-request-main/handle?id=` + id }) +} diff --git a/src/views/wms/countManage/count/countJobMain/index.vue b/src/views/wms/countManage/count/countJobMain/index.vue index 8ee5228ee..45bd1d558 100644 --- a/src/views/wms/countManage/count/countJobMain/index.vue +++ b/src/views/wms/countManage/count/countJobMain/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:count-job-main:close'}), // 关闭 + // defaultButtons.mainListJobAbaBtn({hide:isShowMainButton(row,['2'])}), // 放弃 // defaultButtons.mainListJobExeBtn({hide:isShowMainButton(row,['2'])}), // 执行 ] } @@ -188,12 +188,22 @@ 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('列表-操作按钮事件-承接') } } +/** 关闭按钮操作 */ +const handleClose = async (id: number) => { + try { + await message.confirm(t('common.confirmColse')) + await CountJobMainApi.closeCountJobMain(id) + message.success(t('common.closeSuccess')) + await getList() + } catch {} +} + /** 详情操作 */ const detailRef = ref() const openDetail = (row: any, titleName: any, titleValue: any) => { diff --git a/src/views/wms/countManage/count/countPlanMain/index.vue b/src/views/wms/countManage/count/countPlanMain/index.vue index 46c9e687b..347151989 100644 --- a/src/views/wms/countManage/count/countPlanMain/index.vue +++ b/src/views/wms/countManage/count/countPlanMain/index.vue @@ -204,14 +204,14 @@ const isShowMainButton = (row,val) => { // 列表-操作按钮 const butttondata = (row) => { return [ - defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5']),hasPermi:'wms:count-plan-main:open'}), // 打开 - defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4']),hasPermi:'wms:count-plan-main:close'}), // 关闭 - defaultButtons.mainListPlanSubBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:count-plan-main:submit'}), // 提交审批 - defaultButtons.mainListPlanTurBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:count-plan-main:reject'}), // 驳回 - defaultButtons.mainListPlanAppBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:count-plan-main:agree'}), // 审批通过 - defaultButtons.mainListPlanPubBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:count-plan-main:publish'}), // 发布 - defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4']),hasPermi:'wms:count-plan-main:resetting'}), // 重置 - defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:count-plan-main:update'}), // 编辑 + defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5']),hasPermi:'wms:count-plan-main:open'}), // 打开 + defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4']),hasPermi:'wms:count-plan-main:close'}), // 关闭 + defaultButtons.mainListPlanSubBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:count-plan-main:submit'}), // 提交审批 + defaultButtons.mainListPlanTurBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:count-plan-main:reject'}), // 驳回 + defaultButtons.mainListPlanAppBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:count-plan-main:agree'}), // 审批通过 + defaultButtons.mainListPlanPubBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:count-plan-main:publish'}), // 发布 + defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4']),hasPermi:'wms:count-plan-main:resetting'}), // 重置 + defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:count-plan-main:update'}), // 编辑 ] } @@ -219,16 +219,61 @@ const butttondata = (row) => { // 列表-操作按钮事件 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 == 'mainPlanOpe') { // 打开 + CountPlanMainApi.open(row.id).then(() => { + message.success(t('common.updateSuccess')) + getList() + }).catch(err => { + console.log(err) + }) + } else if (val == 'mainPlanClo') { // 关闭 + await message.confirm('确认要关闭吗?') + CountPlanMainApi.close(row.id).then(() => { + message.success(t('common.updateSuccess')) + getList() + }).catch(err => { + console.log(err) + }) + } else if (val == 'mainPlanSub') { // 提交审批 + await message.confirm('确认要提交审批吗?') + CountPlanMainApi.submit(row.id).then(() => { + message.success(t('common.updateSuccess')) + getList() + }).catch(err => { + console.log(err) + }) + } else if (val == 'mainPlanTur') { // 驳回 + await message.confirm('确认要驳回吗?') + CountPlanMainApi.reject(row.id).then(() => { + message.success(t('common.updateSuccess')) + getList() + }).catch(err => { + console.log(err) + }) + } else if (val == 'mainPlanApp') { // 审批通过 + await message.confirm('确认要审批通过吗?') + CountPlanMainApi.agree(row.id).then(() => { + message.success(t('common.updateSuccess')) + getList() + }).catch(err => { + console.log(err) + }) + } else if (val == 'mainPlanPub') { // 发布 + await message.confirm('确认要发布吗?') + CountPlanMainApi.publish(row.id).then(() => { + message.success(t('common.updateSuccess')) + getList() + }).catch(err => { + console.log(err) + }) + } else if (val == 'mainPlanRes') { // 重置 + await message.confirm('确认要重置吗?') + CountPlanMainApi.resetting(row.id).then(() => { + message.success(t('common.updateSuccess')) + getList() + }).catch(err => { + console.log(err) + }) } else if (val == 'edit') { // 编辑 openForm('update', row) } else if (val == 'delete') { // 删除 diff --git a/src/views/wms/countManage/count/countRequestMain/index.vue b/src/views/wms/countManage/count/countRequestMain/index.vue index 877b6f7f4..923ec3a24 100644 --- a/src/views/wms/countManage/count/countRequestMain/index.vue +++ b/src/views/wms/countManage/count/countRequestMain/index.vue @@ -192,34 +192,32 @@ 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:count-request-main:update'}), // 编辑 - defaultButtons.mainListDeleteBtn({hasPermi:'wms:count-request-main:delete'}), // 删除 + defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6']),hasPermi:'wms:count-request-main:close'}), // 关闭 + defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['5']),hasPermi:'wms:count-request-main:reAdd'}), //重新添加 + defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:count-request-main:submit'}), // 提交审批 + defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:count-request-main:refused'}), // 驳回 + defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:count-request-main:agree'}), // 审批通过 + defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:count-request-main:handle'}), // 处理 + defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:count-request-main:update'}), // 编辑 ] } - - // 列表-操作按钮事件 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) } } @@ -230,6 +228,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 CountRequestMainApi.closeCountRequestMain(id) + message.success(t('common.closeSuccess')) + await getList() + } catch {} +} + +/** 重新添加按钮操作 */ +const handleReAdd = async (id: number) => { + try { + await message.confirm(t('common.confirmReAdd')) + await CountRequestMainApi.reAddCountRequestMain(id) + message.success(t('common.reAddSuccess')) + await getList() + } catch {} +} + +/** 审批通过按钮操作 */ +const handleAgree = async (id: number) => { + try { + await message.confirm(t('common.confirmAgree')) + await CountRequestMainApi.agreeCountRequestMain(id) + message.success(t('common.agreeSuccess')) + await getList() + } catch {} +} + +/** 审批驳回按钮操作 */ +const handleRefused = async (id: number) => { + try { + await message.confirm(t('common.confirmRefused')) + await CountRequestMainApi.refusedCountRequestMain(id) + message.success(t('common.refusedSuccess')) + await getList() + } catch {} +} + +/** 处理按钮操作 */ +const handleHandle = async (id: number) => { + try { + await message.confirm(t('common.confirmHandle')) + await CountRequestMainApi.handleCountRequestMain(id) + message.success(t('common.handleSuccess')) + await getList() + } catch {} +} + +/** 提交按钮操作 */ +const handleSubmit = async (id: number) => { + try { + await message.confirm(t('common.confirmSubmit')) + await CountRequestMainApi.submitCountRequestMain(id) + message.success(t('common.submitSuccess')) + await getList() + } catch {} +} + /** 详情操作 */ const detailRef = ref() const openDetail = (row: any, titleName: any, titleValue: any) => {