| | |
| | | import type { VbenFormSchema } from '#/adapter/form'; |
| | | import type { VxeTableGridOptions } from '#/adapter/vxe-table'; |
| | | |
| | | import { DICT_TYPE } from '..\..\..\..\packages\constants\src'; |
| | | import { getDictOptions } from '..\..\..\..\packages\effects\hooks\src'; |
| | | import { erpPriceInputFormatter } from '..\..\..\..\packages\utils\src'; |
| | | import { markRaw } from 'vue'; |
| | | |
| | | import { DICT_TYPE } from '@vben/constants'; |
| | | import { getDictOptions } from '@vben/hooks'; |
| | | import { erpPriceInputFormatter } from '@vben/utils'; |
| | | |
| | | import { z } from '#/adapter/form'; |
| | | import { getAccountSimpleList } from '#/api/erp/finance/account'; |
| | | import { getProductSimpleList } from '#/api/erp/product/product'; |
| | | import { getSupplierSimpleList } from '#/api/erp/purchase/supplier'; |
| | | import { getSimpleUserList } from '#/api/system/user'; |
| | | import { MdmItemSelect } from '#/views/basicData/mdm/components'; |
| | | import { getRangePickerDefaultProps } from '#/utils'; |
| | | |
| | | /** 表单类型 */ |
| | |
| | | rules: 'required', |
| | | }, |
| | | { |
| | | component: 'InputNumber', |
| | | componentProps: { |
| | | class: '!w-full', |
| | | placeholder: '请输入支付订金', |
| | | precision: 2, |
| | | min: 0, |
| | | }, |
| | | fieldName: 'depositPrice', |
| | | label: '支付订金', |
| | | rules: 'required', |
| | | }, |
| | | { |
| | | fieldName: 'remark', |
| | | label: '备注', |
| | | component: 'Textarea', |
| | |
| | | formItemClass: 'col-span-2', |
| | | }, |
| | | { |
| | | fieldName: 'fileUrl', |
| | | fieldName: 'blobIds', |
| | | label: '附件', |
| | | component: 'FileUpload', |
| | | componentProps: { |
| | | maxNumber: 1, |
| | | maxSize: 10, |
| | | accept: [ |
| | | 'pdf', |
| | | 'doc', |
| | | 'docx', |
| | | 'xls', |
| | | 'xlsx', |
| | | 'txt', |
| | | 'jpg', |
| | | 'jpeg', |
| | | 'png', |
| | | ], |
| | | valueKey: 'id', |
| | | maxNumber: 10, |
| | | multiple: true, |
| | | showDescription: formType !== 'detail', |
| | | disabled: formType === 'detail', |
| | | }, |
| | |
| | | valueField: 'id', |
| | | }, |
| | | }, |
| | | { |
| | | component: 'InputNumber', |
| | | componentProps: { |
| | | class: '!w-full', |
| | | placeholder: '请输入支付订金', |
| | | precision: 2, |
| | | min: 0, |
| | | }, |
| | | fieldName: 'depositPrice', |
| | | label: '支付订金', |
| | | rules: z.number().min(0).optional(), |
| | | }, |
| | | ]; |
| | | } |
| | | |
| | |
| | | slots: { default: 'productId' }, |
| | | }, |
| | | { |
| | | field: 'stockCount', |
| | | title: '库存', |
| | | minWidth: 80, |
| | | }, |
| | | { |
| | | field: 'productBarCode', |
| | | title: '条码', |
| | | minWidth: 120, |
| | | }, |
| | | { |
| | | field: 'productUnitName', |
| | | title: '单位', |
| | | minWidth: 80, |
| | |
| | | title: '备注', |
| | | minWidth: 150, |
| | | slots: { default: 'remark' }, |
| | | }, |
| | | { |
| | | field: 'qcCheckFlag', |
| | | title: '是否质检', |
| | | minWidth: 80, |
| | | fixed: 'right', |
| | | slots: { default: 'qcCheckFlag' }, |
| | | }, |
| | | { |
| | | field: 'count', |
| | |
| | | { |
| | | fieldName: 'productId', |
| | | label: '产品', |
| | | component: 'ApiSelect', |
| | | component: markRaw(MdmItemSelect), |
| | | componentProps: { |
| | | placeholder: '请选择产品', |
| | | allowClear: true, |
| | | showSearch: true, |
| | | api: getProductSimpleList, |
| | | labelField: 'name', |
| | | valueField: 'id', |
| | | }, |
| | | }, |
| | | { |
| | |
| | | label: '状态', |
| | | component: 'Select', |
| | | componentProps: { |
| | | options: getDictOptions(DICT_TYPE.ERP_AUDIT_STATUS, 'number'), |
| | | options: getDictOptions(DICT_TYPE.ERP_AUDIT_STATUS, 'number').filter( |
| | | (opt) => opt.label !== '草稿' && opt.label !== '审批不通过', |
| | | ), |
| | | placeholder: '请选择状态', |
| | | allowClear: true, |
| | | }, |
| | |
| | | { label: '全部入库', value: 2 }, |
| | | ], |
| | | placeholder: '请选择入库状态', |
| | | allowClear: true, |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'returnStatus', |
| | | label: '退货状态', |
| | | component: 'Select', |
| | | componentProps: { |
| | | options: [ |
| | | { label: '未退货', value: 0 }, |
| | | { label: '部分退货', value: 1 }, |
| | | { label: '全部退货', value: 2 }, |
| | | ], |
| | | placeholder: '请选择退货状态', |
| | | allowClear: true, |
| | | }, |
| | | }, |
| | |
| | | field: 'status', |
| | | title: '状态', |
| | | minWidth: 120, |
| | | fixed: 'right', |
| | | cellRender: { |
| | | name: 'CellDict', |
| | | props: { type: DICT_TYPE.ERP_AUDIT_STATUS }, |
| | | }, |
| | | }, |
| | | { |
| | | field: 'inStatus', |
| | | title: '入库状态', |
| | | minWidth: 100, |
| | | fixed: 'right', |
| | | slots: { default: 'inStatus' }, |
| | | }, |
| | | { |
| | | title: '操作', |
| | | width: 260, |
| | | width: 340, |
| | | fixed: 'right', |
| | | slots: { default: 'actions' }, |
| | | }, |