| | |
| | | |
| | | import { z } from '#/adapter/form'; |
| | | import { getAccountSimpleList } from '#/api/erp/finance/account'; |
| | | import { getSupplierSimpleList } from '#/api/erp/purchase/supplier'; |
| | | import { getSupplierSimpleList } from '#/api/srm/supplier'; |
| | | import { getSimpleUserList } from '#/api/system/user'; |
| | | import { MdmItemSelect } from '#/views/basicData/mdm/components'; |
| | | import { getRangePickerDefaultProps } from '#/utils'; |
| | | import { getRangePickerDefaultProps, withoutFixedColumns } from '#/utils'; |
| | | |
| | | /** 表单类型 */ |
| | | export type FormType = 'create' | 'detail' | 'edit'; |
| | |
| | | placeholder: '选择订单时间', |
| | | showTime: true, |
| | | format: 'YYYY-MM-DD HH:mm:ss', |
| | | valueFormat: 'x', |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | }, |
| | | rules: 'required', |
| | | }, |
| | |
| | | }, |
| | | { |
| | | 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'); |
| | | }, |
| | | }, |
| | | rules: 'required', |
| | | }, |
| | | { |
| | |
| | | export function useFormItemColumns( |
| | | disabled: boolean, |
| | | ): VxeTableGridOptions['columns'] { |
| | | return [ |
| | | const columns: VxeTableGridOptions['columns'] = [ |
| | | { type: 'seq', title: '序号', minWidth: 50, fixed: 'left' }, |
| | | { |
| | | field: 'productId', |
| | |
| | | visible: !disabled, |
| | | }, |
| | | ]; |
| | | // 查看审批明细(只读)时取消固定列,避免窄弹窗里挤掉产品名称、单位、备注等列 |
| | | return disabled ? withoutFixedColumns(columns) : columns; |
| | | } |
| | | |
| | | /** 列表的搜索表单 */ |