16 小时以前 c77086ad2d7949ab36dd0c4e0b59907e672dd64f
src/views/erp/sale/order/data.ts
@@ -7,7 +7,7 @@
import { getAccountSimpleList } from '#/api/erp/finance/account';
import { getItemPage } from '#/api/mdm/item';
import { getSimpleUserList } from '#/api/system/user';
import { getRangePickerDefaultProps } from '#/utils';
import { getRangePickerDefaultProps, withoutFixedColumns } from '#/utils';
import CrmCustomerSelect from '#/components/crm-customer-select.vue';
import { markRaw } from 'vue';
@@ -181,14 +181,27 @@
    },
    {
      component: 'InputNumber',
      componentProps: {
      componentProps: (values) => ({
        class: '!w-full',
        placeholder: '请输入收取订金',
        precision: 2,
        min: 0,
      },
        max: values.totalPrice ?? undefined,
      }),
      fieldName: 'depositPrice',
      label: '收取订金',
      dependencies: {
        triggerFields: ['totalPrice'],
        rules(values) {
          if (values.totalPrice != null) {
            return z
              .number()
              .min(0, '订金不能小于0')
              .max(values.totalPrice, '收取订金不能大于优惠后金额');
          }
          return z.number().min(0, '订金不能小于0').optional();
        },
      },
      rules: z.number().min(0).optional(),
    },
  ];
@@ -198,7 +211,7 @@
export function useFormItemColumns(
  disabled: boolean,
): VxeTableGridOptions['columns'] {
  return [
  const columns: VxeTableGridOptions['columns'] = [
    { type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
    {
      field: 'productId',
@@ -298,6 +311,8 @@
      visible: !disabled,
    },
  ];
  // 查看审批明细(只读)时取消固定列,避免窄弹窗里挤掉产品名称、单位、备注等列
  return disabled ? withoutFixedColumns(columns) : columns;
}
/** 列表的搜索表单 */
@@ -365,8 +380,10 @@
      component: 'Select',
      componentProps: {
        options: [
          { label: '未审核', value: 10 },
          { label: '未提交', value: 0 },
          { label: '审批中', value: 15 },
          { label: '已审核', value: 20 },
          { label: '已驳回', value: 35 },
          { label: '已作废', value: 30 },
        ],
        placeholder: '请选择状态',