From 22556f404c1fc911d9274c1a7c414ea9c52e4ee6 Mon Sep 17 00:00:00 2001 From: chenfang Date: Thu, 16 Nov 2023 17:26:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E8=B4=A7=E8=AE=A1=E5=88=92=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E5=8F=8A=E6=97=B6=E9=97=B4=E5=B1=95=E7=A4=BA=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/deliverPlanMain/index.ts | 35 ++++++++ .../deliverplan/deliverPlanMain/index.vue | 79 ++++++++++++++++--- 2 files changed, 103 insertions(+), 11 deletions(-) diff --git a/src/api/wms/deliverPlanMain/index.ts b/src/api/wms/deliverPlanMain/index.ts index 2bf9d0e23..04021ab44 100644 --- a/src/api/wms/deliverPlanMain/index.ts +++ b/src/api/wms/deliverPlanMain/index.ts @@ -55,4 +55,39 @@ export const exportDeliverPlanMain = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/deliver-plan-main/get-import-template' }) +} + +// 关闭 +export const close = (id) => { + return request.put({ url: '/wms/deliver-plan-main/close?id=' + id }) +} + +// 提交审批 +export const submit = (id) => { + return request.put({ url: '/wms/deliver-plan-main/submit?id=' + id }) +} + +// 打开 +export const open = (id) => { + return request.put({ url: '/wms/deliver-plan-main/open?id=' + id }) +} + +// 驳回 +export const refies = (id) => { + return request.put({ url: '/wms/deliver-plan-main/refies?id=' + id }) +} + +// 通过 +export const agree = (id) => { + return request.put({ url: '/wms/deliver-plan-main/agree?id=' + id }) +} + +// 发布 +export const publish = (id) => { + return request.put({ url: '/wms/deliver-plan-main/publish?id=' + id }) +} + +// 重置 +export const resetting = (id) => { + return request.put({ url: '/wms/deliver-plan-main/resetting?id=' + id }) } \ No newline at end of file diff --git a/src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/index.vue b/src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/index.vue index f41654672..436d8db66 100644 --- a/src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/index.vue +++ b/src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/index.vue @@ -33,7 +33,7 @@ @@ -41,7 +41,6 @@ { // 列表-操作按钮 const butttondata = (row) => { return [ - defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5','4'])}), // 打开 - defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4','6'])}), // 关闭 + defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5'])}), // 打开 + defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4'])}), // 关闭 defaultButtons.mainListPlanSubBtn({hide:isShowMainButton(row,['1'])}), // 提交审批 defaultButtons.mainListPlanTurBtn({hide:isShowMainButton(row,['2'])}), // 驳回 defaultButtons.mainListPlanAppBtn({hide:isShowMainButton(row,['2'])}), // 审批通过 defaultButtons.mainListPlanPubBtn({hide:isShowMainButton(row,['3'])}), // 发布 - defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:update'}), // 编辑 - defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:delete'}), // 删除 + defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4'])}), // 重置 + defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:deliver-plan-main:update'}), // 编辑 ] } // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { if (val == 'mainPlanOpe') { // 打开 - console.log('列表-操作按钮事件-打开') + DeliverPlanMainApi.open(row.id).then(() => { + message.success(t('common.updateSuccess')) + getList() + }).catch(err => { + console.log(err) + }) } else if (val == 'mainPlanClo') { // 关闭 - console.log('列表-操作按钮事件-关闭') + await message.confirm('确认要关闭吗?') + DeliverPlanMainApi.close(row.id).then(() => { + message.success(t('common.updateSuccess')) + getList() + }).catch(err => { + console.log(err) + }) } else if (val == 'mainPlanSub') { // 提交审批 - console.log('列表-操作按钮事件-提交审批') + await message.confirm('确认要提交审批吗?') + DeliverPlanMainApi.submit(row.id).then(() => { + message.success(t('common.updateSuccess')) + getList() + }).catch(err => { + console.log(err) + }) } else if (val == 'mainPlanTur') { // 驳回 - console.log('列表-操作按钮事件-驳回') + await message.confirm('确认要驳回吗?') + DeliverPlanMainApi.refies(row.id).then(() => { + message.success(t('common.updateSuccess')) + getList() + }).catch(err => { + console.log(err) + }) } else if (val == 'mainPlanApp') { // 审批通过 - console.log('列表-操作按钮事件-审批通过') + await message.confirm('确认要审批通过吗?') + DeliverPlanMainApi.agree(row.id).then(() => { + message.success(t('common.updateSuccess')) + getList() + }).catch(err => { + console.log(err) + }) + } else if (val == 'mainPlanPub') { // 发布 + await message.confirm('确认要发布吗?') + DeliverPlanMainApi.publish(row.id).then(() => { + message.success(t('common.updateSuccess')) + getList() + }).catch(err => { + console.log(err) + }) + } else if (val == 'mainPlanRes') { // 重置 + await message.confirm('确认要重置吗?') + DeliverPlanMainApi.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') { // 删除 @@ -270,6 +314,19 @@ const handleDeleteTable = (item, index) => { // 主子数据 提交 const submitForm = async (formType, data) => { data.subList = tableData.value // 拼接子表数据参数 + var isHave =DeliverPlanMain.allSchemas.formSchema.some(function (item) { + return item.field === 'beginTime' || item.field === 'endTime'; + }); + if(isHave){ + if(data.beginTime && data.endTime && data.beginTime >=data.expireTime){ + message.error('结束时间要大于开始时间') + return; + } + } + console.log(data.beginTime) + if(!data.beginTime)data.beginTime = null; + if(!data.planDate)data.planDate = null; + if(!data.endTime)data.endTime = null; try { if (formType === 'create') { await DeliverPlanMainApi.createDeliverPlanMain(data)