| | |
| | | |
| | | import { z } from '#/adapter/form'; |
| | | 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 { MdmItemSelect } from '#/views/basicData/mdm/components'; |
| | | |
| | | import { markRaw } from 'vue'; |
| | | |
| | |
| | | component: 'DatePicker', |
| | | componentProps: { |
| | | placeholder: '选择订单时间', |
| | | showTime: true, |
| | | format: 'YYYY-MM-DD HH:mm:ss', |
| | | showTime: false, |
| | | format: 'YYYY-MM-DD', |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | }, |
| | | 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; |
| | | } |
| | | |
| | | /** 列表的搜索表单 */ |
| | |
| | | { |
| | | fieldName: 'productId', |
| | | label: '产品', |
| | | component: 'ApiSelect', |
| | | component: markRaw(MdmItemSelect), |
| | | componentProps: { |
| | | placeholder: '请选择产品', |
| | | allowClear: true, |
| | | showSearch: true, |
| | | api: async () => { |
| | | const res = await getItemPage({ pageNo: 1, pageSize: 100, status: 0 }); |
| | | return res.list || []; |
| | | }, |
| | | labelField: 'name', |
| | | valueField: 'id', |
| | | }, |
| | | }, |
| | | { |
| | |
| | | component: 'RangePicker', |
| | | componentProps: { |
| | | ...getRangePickerDefaultProps(), |
| | | showTime: false, |
| | | format: 'YYYY-MM-DD', |
| | | allowClear: true, |
| | | }, |
| | | }, |