From 7a5c5250b66cc6faffbcac9e192073473c50f79f Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 28 八月 2026 17:02:04 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_pro2.0' into dev_pro2.0
---
src/views/erp/purchase/order/index.vue | 48 +++++++++++++-----------------------------------
1 files changed, 13 insertions(+), 35 deletions(-)
diff --git a/src/views/erp/purchase/order/index.vue b/src/views/erp/purchase/order/index.vue
index cc275a3..79a6a6c 100644
--- a/src/views/erp/purchase/order/index.vue
+++ b/src/views/erp/purchase/order/index.vue
@@ -2,7 +2,8 @@
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { ErpPurchaseOrderApi } from '#/api/erp/purchase/order';
-import { ref } from 'vue';
+import { onMounted, ref } from 'vue';
+import { useRoute } from 'vue-router';
import { Page, useVbenModal } from '@vben/common-ui';
import { downloadFileFromBlobPart, isEmpty } from '@vben/utils';
@@ -15,7 +16,6 @@
deletePurchaseOrder,
exportPurchaseOrder,
getPurchaseOrderPage,
- updatePurchaseOrderStatus,
} from '#/api/erp/purchase/order';
import { $t } from '#/locales';
@@ -24,6 +24,8 @@
/** ERP 閲囪喘璁㈠崟鍒楄〃 */
defineOptions({ name: 'ErpPurchaseOrder' });
+
+const route = useRoute();
const [FormModal, formModalApi] = useVbenModal({
connectedComponent: Form,
@@ -60,24 +62,6 @@
try {
await deletePurchaseOrder(ids);
message.success($t('ui.actionMessage.deleteSuccess'));
- handleRefresh();
- } finally {
- hideLoading();
- }
-}
-
-/** 瀹℃壒/鍙嶅鎵规搷浣� */
-async function handleUpdateStatus(
- row: ErpPurchaseOrderApi.PurchaseOrder,
- status: number,
-) {
- const hideLoading = message.loading({
- content: `纭畾${status === 20 ? '瀹℃壒' : '鍙嶅鎵�'}璇ヨ鍗曞悧锛焋,
- duration: 0,
- });
- try {
- await updatePurchaseOrderStatus(row.id!, status);
- message.success(`${status === 20 ? '瀹℃壒' : '鍙嶅鎵�'}鎴愬姛`);
handleRefresh();
} finally {
hideLoading();
@@ -146,10 +130,18 @@
checkboxChange: handleRowCheckboxChange,
},
});
+
+onMounted(() => {
+ const id = route.query.id;
+ if (id) {
+ formModalApi.setData({ formType: 'detail', id: Number(id) }).open();
+ }
+});
</script>
<template>
- <Page auto-content-height><FormModal @success="handleRefresh" />
+ <Page auto-content-height>
+ <FormModal @success="handleRefresh" />
<Grid table-title="閲囪喘璁㈠崟鍒楄〃">
<template #toolbar-tools>
<TableAction
@@ -205,20 +197,6 @@
auth: ['erp:purchase-order:update'],
ifShow: () => row.status !== 20,
onClick: handleEdit.bind(null, row),
- },
- {
- label: row.status === 10 ? '瀹℃壒' : '鍙嶅鎵�',
- type: 'link',
- icon: ACTION_ICON.AUDIT,
- auth: ['erp:purchase-order:update-status'],
- popConfirm: {
- title: `纭${row.status === 10 ? '瀹℃壒' : '鍙嶅鎵�'}${row.no}鍚楋紵`,
- confirm: handleUpdateStatus.bind(
- null,
- row,
- row.status === 10 ? 20 : 10,
- ),
- },
},
{
label: '纭鏀惰揣',
--
Gitblit v1.9.3