From 1144e5b8b0d8846d1b04d16944dcc270b0e495a0 Mon Sep 17 00:00:00 2001 From: yufei_wang <2267742828@qq.com> Date: Thu, 21 Nov 2024 13:55:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E6=A8=A1=E5=85=B7?= =?UTF-8?q?=E8=B4=B9=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/suppliperMoldCostMain/index.ts | 16 ++++ src/locales/en-US.ts | 3 +- src/locales/zh-CN.ts | 3 +- .../supplierMoldCostMain/index.vue | 80 +++++++++++++++++-- .../supplierMoldCostMain.data.ts | 11 +++ 5 files changed, 103 insertions(+), 10 deletions(-) diff --git a/src/api/wms/suppliperMoldCostMain/index.ts b/src/api/wms/suppliperMoldCostMain/index.ts index bc8e40319..c017c1541 100644 --- a/src/api/wms/suppliperMoldCostMain/index.ts +++ b/src/api/wms/suppliperMoldCostMain/index.ts @@ -31,3 +31,19 @@ export const verifyDataExist = async (yearsMonthStr: String,supplierCode:String) } + + +// 发布 +export const publish = async (id: number) => { + return await request.get({ url: `/wms/supplier-tool-apport-statement-main/publish?id=` + id }) +} + +// 废除 +export const nodeAbrogate = async (id: number) => { + return await request.get({ url: `/wms/supplier-tool-apport-statement-main/nodeAbrogate?id=` + id }) +} + +// 退回 +export const sendBack = async (id: number) => { + return await request.get({ url: `/wms/supplier-tool-apport-statement-main/sendBack?id=` + id }) +} \ No newline at end of file diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index 6c6b30820..5e7924a15 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -1315,7 +1315,8 @@ export default { 退回成功: 'Returned successfully', 是否确认分摊金额: 'Do you want to confirm the allocation amount?', 创建开票申请: 'Create an invoice request?', - 详情:'Detail' + 详情:'Detail', + 退回:'Return' }, diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 597143fcf..2ffb5015d 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -1316,7 +1316,8 @@ export default { 退回成功: '退回成功', 是否确认分摊金额: '是否确认分摊金额?', 创建开票申请: '创建开票申请', - 详情:'详情' + 详情:'详情', + 退回:'退回', }, } diff --git a/src/views/wms/deliversettlementManage/moldAllocation/supplierMoldCostMain/index.vue b/src/views/wms/deliversettlementManage/moldAllocation/supplierMoldCostMain/index.vue index afeb10a82..d2e069f9f 100644 --- a/src/views/wms/deliversettlementManage/moldAllocation/supplierMoldCostMain/index.vue +++ b/src/views/wms/deliversettlementManage/moldAllocation/supplierMoldCostMain/index.vue @@ -128,13 +128,13 @@ ] // 头部按钮事件 - const buttonBaseClick = (val, item) => { +const buttonBaseClick = (val, item) => { if (val == 'import') { - // 导入 - handleImport() - } else if (val == 'export') { // 导出 - handleExport() - } else if (val == 'refresh') { + // 导入 + handleImport() + } else if (val == 'export') { // 导出 + handleExport() + } else if (val == 'refresh') { // 刷新 getList() } else if (val == 'filtrate') { @@ -143,7 +143,7 @@ // 其他按钮 console.log('其他按钮', item) } - } +} // 列表-操作按钮 const butttondata = (row, $index) => { @@ -154,14 +154,78 @@ return [] } return [ - + { + label: t('ts.发布'), + name: 'publish', + hide: row.status!=0, + type: 'primary', + icon: '', + color: '', + hasPermi: '', + link: true // 文本展现按钮 + }, + { + label: t('ts.作废'), + name: 'abrogate', + hide: row.isAbrogate!=1, + type: 'danger', + icon: '', + color: '', + hasPermi: '', + link: true // 文本展现按钮 + }, + { + label: t('ts.退回'), + name: 'back', + hide: row.isBack!=1, + type: 'warning', + icon: '', + color: '', + hasPermi: '', + link: true // 文本展现按钮 + } ] } // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { + if(val=='publish'){ + //发布 + try { + // 删除的二次确认 + await message.confirm('确认发布吗?') + // 发起删除 + await SuppliperMoldCostMainApi.publish(row.id) + message.success('发布成功') + // 刷新列表 + buttonBaseClick('refresh') + } catch {} + }else if(val=='abrogate'){ + //作废 + try { + // 删除的二次确认 + await message.confirm('确认作废吗?') + // 发起删除 + await SuppliperMoldCostMainApi.nodeAbrogate(row.id) + message.success('作废成功') + // 刷新列表 + buttonBaseClick('refresh') + } catch {} + }else if(val=='back'){ + //作废 + try { + // 删除的二次确认 + await message.confirm('确认退回吗?') + // 发起删除 + await SuppliperMoldCostMainApi.sendBack(row.id) + message.success('退回成功') + // 刷新列表 + buttonBaseClick('refresh') + } catch {} + } } + /** 详情操作 */ const detailRef = ref() diff --git a/src/views/wms/deliversettlementManage/moldAllocation/supplierMoldCostMain/supplierMoldCostMain.data.ts b/src/views/wms/deliversettlementManage/moldAllocation/supplierMoldCostMain/supplierMoldCostMain.data.ts index de91af5b7..395b8c2ab 100644 --- a/src/views/wms/deliversettlementManage/moldAllocation/supplierMoldCostMain/supplierMoldCostMain.data.ts +++ b/src/views/wms/deliversettlementManage/moldAllocation/supplierMoldCostMain/supplierMoldCostMain.data.ts @@ -138,6 +138,17 @@ export const SupplierMoldCostMain = useCrudSchemas(reactive([ table:{ width:180 } + }, + { + label: '操作', + field: 'action', + isForm: false, + isTable:true, + isDetail:false, + table: { + width: 180, + fixed: 'right' + } } ]))