From 91c82965b2d987452ca276e3a03b48c8dcda2ae9 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期三, 19 八月 2026 11:47:26 +0800
Subject: [PATCH] config(env): 更新生产环境配置和公司名称
---
src/views/erp/finance/payment/data.ts | 102 ++++++++++++++++++++++++++++++++++----------------
1 files changed, 69 insertions(+), 33 deletions(-)
diff --git a/src/views/erp/finance/payment/data.ts b/src/views/erp/finance/payment/data.ts
index d3746b9..5e15d1e 100644
--- a/src/views/erp/finance/payment/data.ts
+++ b/src/views/erp/finance/payment/data.ts
@@ -1,12 +1,13 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
-import { DICT_TYPE } from '../../../../packages/constants/src';
-import { getDictOptions } from '../../../../packages/effects/hooks/src';
-import { erpPriceInputFormatter } from '../../../../packages/utils/src';
+import { DICT_TYPE } from '@vben/constants';
+import { getDictOptions } from '@vben/hooks';
+import { erpPriceInputFormatter } from '@vben/utils';
import { getAccountSimpleList } from '#/api/erp/finance/account';
-import { getSupplierSimpleList } from '#/api/erp/purchase/supplier';
+import { getPurchaseInvoiceSimpleList } from '#/api/erp/purchase/invoice';
+import { getSupplierSimpleList } from '#/api/srm/supplier';
import { getSimpleUserList } from '#/api/system/user';
import { getRangePickerDefaultProps } from '#/utils';
@@ -42,7 +43,7 @@
placeholder: '閫夋嫨浠樻鏃堕棿',
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
- valueFormat: 'x',
+ valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
rules: 'required',
},
@@ -50,7 +51,7 @@
fieldName: 'supplierId',
label: '渚涘簲鍟�',
component: 'ApiSelect',
- componentProps: {
+ componentProps: (_values, form) => ({
disabled: formType === 'detail',
placeholder: '璇烽�夋嫨渚涘簲鍟�',
allowClear: true,
@@ -58,8 +59,54 @@
api: getSupplierSimpleList,
labelField: 'name',
valueField: 'id',
- },
+ onChange: () => {
+ // 渚涘簲鍟嗗彉鍖栧悗锛屾竻绌哄凡閫夌殑鍏宠仈鏉ョエ
+ form.setFieldValue('invoiceId', undefined);
+ },
+ }),
rules: 'required',
+ },
+ {
+ fieldName: 'invoiceId',
+ label: '鍏宠仈鏉ョエ',
+ component: formType === 'detail' ? 'Input' : 'Select',
+ componentProps:
+ formType === 'detail'
+ ? {
+ disabled: true,
+ placeholder: '--',
+ }
+ : undefined,
+ rules: 'required',
+ dependencies: {
+ // 渚濊禆 invoiceId 鑷韩锛岀‘淇濈紪杈戝洖鏄炬椂閲嶆柊鍔犺浇閫夐」浠ュ尮閰嶅凡閫夋潵绁�
+ triggerFields: ['supplierId', 'invoiceId'],
+ disabled: (values) => formType === 'detail' || !values.supplierId,
+ async componentProps(values) {
+ if (formType === 'detail') {
+ return {};
+ }
+ if (!values.supplierId) {
+ return {
+ options: [],
+ placeholder: '璇峰厛閫夋嫨渚涘簲鍟�',
+ };
+ }
+ const invoices = await getPurchaseInvoiceSimpleList(
+ values.supplierId,
+ );
+ return {
+ options: invoices.map((item) => {
+ const remain = item.remainingInvoicePrice ?? item.price ?? 0;
+ return {
+ label: `${item.no} / ${item.invoiceNo ?? '-'} / 楼${item.price ?? 0} / 鍓╀綑鍙粯 楼${remain.toFixed(2)}`,
+ value: item.id,
+ };
+ }),
+ placeholder: '璇烽�夋嫨鍏宠仈鏉ョエ',
+ } as any;
+ },
+ },
},
{
fieldName: 'financeUserId',
@@ -86,23 +133,13 @@
formItemClass: 'col-span-2',
},
{
- fieldName: 'fileUrl',
+ fieldName: 'blobIds',
label: '闄勪欢',
component: 'FileUpload',
componentProps: {
- maxNumber: 1,
- maxSize: 10,
- accept: [
- 'pdf',
- 'doc',
- 'docx',
- 'xls',
- 'xlsx',
- 'txt',
- 'jpg',
- 'jpeg',
- 'png',
- ],
+ valueKey: 'id',
+ maxNumber: 10,
+ multiple: true,
showDescription: formType !== 'detail',
disabled: formType === 'detail',
},
@@ -126,6 +163,7 @@
labelField: 'name',
valueField: 'id',
},
+ help: '浠樻璐︽埛鏁版嵁鏉ヨ嚜銆愯储鍔$鐞� 鈫� 缁撶畻璐︽埛銆戣彍鍗曠淮鎶ょ殑寮�鍚姸鎬佽处鎴凤紝鏃犻�夐」鏃惰鍏堝湪缁撶畻璐︽埛椤甸潰鏂板銆�',
},
{
fieldName: 'totalPrice',
@@ -143,6 +181,7 @@
fieldName: 'discountPrice',
label: '浼樻儬閲戦',
component: 'InputNumber',
+ defaultValue: 0,
componentProps: {
class: '!w-full',
disabled: formType === 'detail',
@@ -175,15 +214,13 @@
];
}
-/** 琛ㄥ崟鐨勬槑缁嗚〃鏍煎垪 */
-export function useFormItemColumns(
- disabled: boolean,
-): VxeTableGridOptions['columns'] {
+/** 琛ㄥ崟鐨勬槑缁嗚〃鏍煎垪锛堜粯娆惧熀浜庢潵绁紝鏄庣粏鐢辨潵绁ㄨ嚜鍔ㄧ敓鎴愶紝涓嶅彲鍒犻櫎锛� */
+export function useFormItemColumns(): VxeTableGridOptions['columns'] {
return [
{ type: 'seq', title: '搴忓彿', minWidth: 50, fixed: 'left' },
{
field: 'bizNo',
- title: '閲囪喘鍗曟嵁缂栧彿',
+ title: '鏉ョエ缂栧彿',
minWidth: 200,
},
{
@@ -210,13 +247,6 @@
title: '澶囨敞',
minWidth: 150,
slots: { default: 'remark' },
- },
- {
- title: '鎿嶄綔',
- width: 50,
- fixed: 'right',
- slots: { default: 'actions' },
- visible: !disabled,
},
];
}
@@ -345,6 +375,12 @@
minWidth: 120,
},
{
+ field: 'invoice',
+ title: '鍏宠仈鏉ョエ',
+ minWidth: 200,
+ slots: { default: 'invoice' },
+ },
+ {
field: 'paymentTime',
title: '浠樻鏃堕棿',
width: 160,
--
Gitblit v1.9.3