liu
4 天以前 d3230d4bb80fbc7c2adb63c588c580ab94234ee8
src/views/erp/sale/order/data.ts
@@ -72,7 +72,7 @@
        placeholder: '选择订单时间',
        showTime: true,
        format: 'YYYY-MM-DD HH:mm:ss',
        valueFormat: 'x',
        valueFormat: 'YYYY-MM-DD HH:mm:ss',
      },
      rules: 'required',
    },
@@ -111,10 +111,13 @@
      formItemClass: 'col-span-2',
    },
    {
      fieldName: 'fileUrl',
      fieldName: 'blobIds',
      label: '附件',
      component: 'FileUpload',
      componentProps: {
        valueKey: 'id',
        maxNumber: 10,
        multiple: true,
        showDescription: formType !== 'detail',
        disabled: formType === 'detail',
      },
@@ -178,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(),
    },
  ];
@@ -213,6 +229,7 @@
      title: '库存',
      minWidth: 80,
      formatter: 'formatAmount3',
      visible: false,
    },
    {
      field: 'productUnitName',
@@ -223,11 +240,13 @@
      field: 'productUnitName2',
      title: '辅单位1',
      minWidth: 80,
      visible: false,
    },
    {
      field: 'productUnitName3',
      title: '辅单位2',
      minWidth: 80,
      visible: false,
    },
    {
      field: 'needProduction',
@@ -240,6 +259,7 @@
      title: '备注',
      minWidth: 150,
      slots: { default: 'remark' },
      visible: false,
    },
    {
      field: 'count',
@@ -396,24 +416,11 @@
      component: 'Select',
      componentProps: {
        options: [
          { label: '无需生产', value: -1 },
          { label: '未完成', value: 0 },
          { label: '已完成', value: 1 },
        ],
        placeholder: '请选择生产状态',
        allowClear: true,
      },
    },
    {
      fieldName: 'returnStatus',
      label: '退货状态',
      component: 'Select',
      componentProps: {
        options: [
          { label: '未退货', value: 0 },
          { label: '部分退货', value: 1 },
          { label: '全部退货', value: 2 },
        ],
        placeholder: '请选择退货状态',
        allowClear: true,
      },
    },