liu
4 天以前 6373c12e97dc5d52ad87271d1adb6743b0052607
src/views/erp/purchase/invoice/data.ts
@@ -15,7 +15,7 @@
/** 新增/修改的表单 */
export function useFormSchema(
  orderTotalTaxPrice?: Ref<number | undefined>,
  orderRemainInvoicePrice?: Ref<number | undefined>,
): VbenFormSchema[] {
  return [
    {
@@ -48,12 +48,12 @@
        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;
          }
        },
      }),
@@ -91,8 +91,8 @@
      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',
@@ -106,11 +106,11 @@
          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: '请输入来票金额' })