From fee2f2532144fca6c81b1523aeef54165c5263b2 Mon Sep 17 00:00:00 2001
From: hsy <1029150275@qq.com>
Date: 星期二, 25 八月 2026 16:50:38 +0800
Subject: [PATCH] Merge branch 'refs/heads/dev_pro2.0' into fix/hsy/20260812
---
src/views/erp/purchase/invoice/data.ts | 71 ++++++++++++++++++++---------------
1 files changed, 40 insertions(+), 31 deletions(-)
diff --git a/src/views/erp/purchase/invoice/data.ts b/src/views/erp/purchase/invoice/data.ts
index e222159..018c084 100644
--- a/src/views/erp/purchase/invoice/data.ts
+++ b/src/views/erp/purchase/invoice/data.ts
@@ -1,7 +1,10 @@
+import type { Ref } from 'vue';
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import { getSupplierSimpleList } from '#/api/srm/supplier';
+
+import { z } from '#/adapter/form';
import { markRaw } from 'vue';
@@ -11,7 +14,9 @@
export type FormType = 'create' | 'detail' | 'edit';
/** 鏂板/淇敼鐨勮〃鍗� */
-export function useFormSchema(): VbenFormSchema[] {
+export function useFormSchema(
+ orderTotalTaxPrice?: Ref<number | undefined>,
+): VbenFormSchema[] {
return [
{
fieldName: 'id',
@@ -41,8 +46,15 @@
},
componentProps: (_values, form) => ({
placeholder: '璇烽�夋嫨閲囪喘璁㈠崟',
- onChange: (order: { supplierName?: string } | undefined) => {
+ onChange: (
+ order:
+ | { supplierName?: string; totalTaxPrice?: number }
+ | undefined,
+ ) => {
form.setFieldValue('supplierName', order?.supplierName);
+ if (orderTotalTaxPrice) {
+ orderTotalTaxPrice.value = order?.totalTaxPrice;
+ }
},
}),
},
@@ -78,11 +90,37 @@
label: '鏉ョエ閲戦锛堝厓锛�',
component: 'InputNumber',
rules: 'required',
+ description: () =>
+ orderTotalTaxPrice?.value != null
+ ? `閲囪喘璁㈠崟鏈紑绁ㄩ噾棰濓細${Number(orderTotalTaxPrice.value).toFixed(2)} 鍏僠
+ : '',
componentProps: {
class: '!w-full',
placeholder: '璇疯緭鍏ユ潵绁ㄩ噾棰�',
min: 0,
precision: 2,
+ },
+ dependencies: {
+ triggerFields: ['purchaseOrderId'],
+ componentProps: () => ({
+ class: '!w-full',
+ placeholder: '璇疯緭鍏ユ潵绁ㄩ噾棰�',
+ min: 0,
+ max: orderTotalTaxPrice?.value ?? undefined,
+ precision: 2,
+ }),
+ rules: () => {
+ const max = orderTotalTaxPrice?.value;
+ if (max != null) {
+ return z
+ .number({ message: '璇疯緭鍏ユ潵绁ㄩ噾棰�' })
+ .min(0, '鏉ョエ閲戦涓嶈兘灏忎簬 0')
+ .max(max, `鏉ョエ閲戦涓嶈兘澶т簬鏈紑绁ㄩ噾棰� ${Number(max).toFixed(2)}`);
+ }
+ return z
+ .number({ message: '璇疯緭鍏ユ潵绁ㄩ噾棰�' })
+ .min(0, '鏉ョエ閲戦涓嶈兘灏忎簬 0');
+ },
},
},
{
@@ -148,22 +186,6 @@
valueField: 'id',
},
},
- {
- fieldName: 'auditStatus',
- label: '瀹℃壒鐘舵��',
- component: 'Select',
- componentProps: {
- options: [
- { label: '鏈彁浜�', value: 0 },
- { label: '瀹℃壒涓�', value: 10 },
- { label: '瀹℃牳閫氳繃', value: 20 },
- { label: '瀹℃牳涓嶉�氳繃', value: 30 },
- { label: '宸蹭綔搴�', value: 40 },
- ],
- placeholder: '璇烽�夋嫨瀹℃壒鐘舵��',
- allowClear: true,
- },
- },
];
}
@@ -200,12 +222,6 @@
formatter: 'formatAmount2',
},
{
- title: '鍓╀綑鍙粯閲戦',
- field: 'remainingInvoicePrice',
- minWidth: 150,
- formatter: 'formatAmount2',
- },
- {
title: '鏉ョエ鏃ユ湡',
field: 'invoiceTime',
minWidth: 150,
@@ -222,13 +238,6 @@
minWidth: 100,
fixed: 'right',
slots: { default: 'attachment' },
- },
- {
- title: '瀹℃壒鐘舵��',
- field: 'auditStatus',
- minWidth: 100,
- fixed: 'right',
- slots: { default: 'auditStatus' },
},
{
title: '鎿嶄綔',
--
Gitblit v1.9.3