From f4eab4ac499da47618dd3a33eae29b641597d1ae Mon Sep 17 00:00:00 2001 From: liutao <790864623@qq.com> Date: Thu, 16 Jul 2026 15:52:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E4=B8=AD=E8=8B=B1=E6=96=87=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../erp/purchase/supplier/SupplierForm.vue | 70 ++++++++++++------- src/views/erp/purchase/supplier/index.vue | 44 ++++++------ 2 files changed, 67 insertions(+), 47 deletions(-) diff --git a/src/views/erp/purchase/supplier/SupplierForm.vue b/src/views/erp/purchase/supplier/SupplierForm.vue index 7833672d..cd9509c9 100644 --- a/src/views/erp/purchase/supplier/SupplierForm.vue +++ b/src/views/erp/purchase/supplier/SupplierForm.vue @@ -9,32 +9,47 @@ > - - + + - - + + - - + + - - + + - - + + - + - + - - + + @@ -81,10 +102,10 @@ const { t } = useI18n() // 国际化 const message = useMessage() // 消息弹窗 const dialogVisible = ref(false) // 弹窗的是否展示 -const dialogTitle = ref('') // 弹窗的标题 const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 const formType = ref('') // 表单的类型:create - 新增;update - 修改 -const formData = ref({ +const dialogTitle = computed(() => (formType.value ? t('action.' + formType.value) : '')) // 弹窗的标题 +const formData = ref>({ id: undefined, name: undefined, contact: undefined, @@ -95,11 +116,11 @@ const formData = ref({ status: undefined, sort: undefined, }) -const formRules = reactive({ - name: [{ required: true, message: '名称不能为空', trigger: 'blur' }], - status: [{ required: true, message: '开启状态不能为空', trigger: 'blur' }], - sort: [{ required: true, message: '排序不能为空', trigger: 'blur' }] -}) +const formRules = computed(() => ({ + name: [{ required: true, message: t('ErpPurchase.Supplier.nameRequired'), trigger: 'blur' }], + status: [{ required: true, message: t('ErpPurchase.Supplier.statusRequired'), trigger: 'blur' }], + sort: [{ required: true, message: t('ErpPurchase.Supplier.sortRequired'), trigger: 'blur' }] +})) const formRef = ref() // 表单 Ref const omittedSubmitFields = ['fax', 'taxNo', 'taxPercent', 'bankName', 'bankAccount', 'bankAddress'] @@ -113,7 +134,6 @@ const buildSubmitData = () => { /** 打开弹窗 */ const open = async (type: string, id?: number) => { dialogVisible.value = true - dialogTitle.value = t('action.' + type) formType.value = type resetForm() // 修改时,设置数据 diff --git a/src/views/erp/purchase/supplier/index.vue b/src/views/erp/purchase/supplier/index.vue index 2af7fd6a..c2e463db 100644 --- a/src/views/erp/purchase/supplier/index.vue +++ b/src/views/erp/purchase/supplier/index.vue @@ -10,43 +10,43 @@ :inline="true" label-width="68px" > - + - + - + - 搜索 - 重置 + {{ t('common.query') }} + {{ t('common.reset') }} - 新增 + {{ t('action.create') }} - 导出 + {{ t('action.export') }} @@ -64,19 +64,19 @@ - - - - - - - - + + + + + + + + - + @@ -200,7 +200,7 @@ const handleExport = async () => { // 发起导出 exportLoading.value = true const data = await SupplierApi.exportSupplier(queryParams) - download.excel(data, 'ERP 供应商.xls') + download.excel(data, t('ErpPurchase.Supplier.exportFilename')) } catch { } finally { exportLoading.value = false