| | |
| | | |
| | | /** 新增/修改的表单 */ |
| | | export function useFormSchema( |
| | | orderTotalTaxPrice?: Ref<number | undefined>, |
| | | orderRemainInvoicePrice?: Ref<number | undefined>, |
| | | ): VbenFormSchema[] { |
| | | return [ |
| | | { |
| | |
| | | placeholder: '请选择采购订单', |
| | | onChange: ( |
| | | order: |
| | | | { supplierName?: string; totalTaxPrice?: number } |
| | | | { supplierName?: string; remainInvoicePrice?: number } |
| | | | undefined, |
| | | ) => { |
| | | form.setFieldValue('supplierName', order?.supplierName); |
| | | if (orderTotalTaxPrice) { |
| | | orderTotalTaxPrice.value = order?.totalTaxPrice; |
| | | if (orderRemainInvoicePrice) { |
| | | orderRemainInvoicePrice.value = order?.remainInvoicePrice; |
| | | } |
| | | }, |
| | | }), |
| | |
| | | component: 'InputNumber', |
| | | rules: 'required', |
| | | description: () => |
| | | orderTotalTaxPrice?.value != null |
| | | ? `采购订单未开票金额:${Number(orderTotalTaxPrice.value).toFixed(2)} 元` |
| | | orderRemainInvoicePrice?.value != null |
| | | ? `采购订单未开票金额:${Number(orderRemainInvoicePrice.value).toFixed(2)} 元` |
| | | : '', |
| | | componentProps: { |
| | | class: '!w-full', |
| | |
| | | class: '!w-full', |
| | | placeholder: '请输入来票金额', |
| | | min: 0, |
| | | max: orderTotalTaxPrice?.value ?? undefined, |
| | | max: orderRemainInvoicePrice?.value ?? undefined, |
| | | precision: 2, |
| | | }), |
| | | rules: () => { |
| | | const max = orderTotalTaxPrice?.value; |
| | | const max = orderRemainInvoicePrice?.value; |
| | | if (max != null) { |
| | | return z |
| | | .number({ message: '请输入来票金额' }) |