import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' const { t } = useI18n() // 国际化 /** * @returns {Array} 采购订单主表 */ export const PurchaseMain = useCrudSchemas(reactive([ { label: '供应商代码', field: 'supplierCode', sort: 'custom', table: { width: 150 }, }, { label: '单据号', field: 'number', sort: 'custom', table: { width: 150 }, }, { label: '订单类型', field: 'type', dictType: DICT_TYPE.PURCHASE_ORDER_TYPE, dictClass: 'string', isTable: true, isSearch: true, sort: 'custom', table: { width: 150 }, }, { label: '状态', field: 'status', dictType: DICT_TYPE.PURCHASE_ORDER_STATUS, dictClass: 'string', isTable: true, isSearch: true, sort: 'custom', table: { width: 150 }, }, { label: '订单日期', field: 'orderDate', isTable: true, formatter: dateFormatter, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' }, sort: 'custom', table: { width: 150 }, form: { component: 'DatePicker', componentProps: { type: 'datetime', } } }, { label: '截止日期', field: 'dueDate', isTable: true, formatter: dateFormatter, detail:{ dateFormat: 'YYYY-MM-DD HH:mm:ss' }, sort: 'custom', table: { width: 150 }, form: { component: 'DatePicker', componentProps: { type: 'datetime', } } }, { label: '版本', field: 'version', sort: 'custom', table: { width: 150 }, }, { label: '税率', field: 'taxRate', sort: 'custom', table: { width: 150 }, }, { label: '联系人姓名', field: 'contactName', sort: 'custom', table: { width: 150 }, }, { label: '联系人电话', field: 'contactPhone', sort: 'custom', table: { width: 150 }, }, { label: '联系人电子邮件', field: 'contactEmail', sort: 'custom', table: { width: 150 }, }, { label: '是否寄存订单', field: 'isConsignment', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', isSearch: true, isTable: true, sort: 'custom', table: { width: 150 }, form: { component: 'Switch', value: 'TRUE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE' } }, }, { label: '业务类型', field: 'businessType', sort: 'custom', table: { width: 150 }, }, { label: '当前阶段', field: 'currentStage', sort: 'custom', table: { width: 150 }, }, { label: '是否可用', field: 'available', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', isSearch: true, isTable: true, sort: 'custom', table: { width: 150 }, form: { component: 'Switch', value: 'TRUE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE' } }, }, { label: '创建者', field: 'creator', sort: 'custom', table: { width: 150 }, }, { label: '创建时间', field: 'createTime', isTable: true, formatter: dateFormatter, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' }, sort: 'custom', table: { width: 150 }, form: { component: 'DatePicker', componentProps: { type: 'datetime', } } }, { label: '最后更新者', field: 'updater', sort: 'custom', table: { width: 150 }, }, { label: '最后更新时间', field: 'updateTime', isTable: true, formatter: dateFormatter, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' }, sort: 'custom', table: { width: 150 }, form: { component: 'DatePicker', componentProps: { type: 'datetime', } } } ])) /** * @returns {Array} 采购订单子表 */ export const PurchaseDetail = useCrudSchemas(reactive([ { label: '行号', field: 'lineNumber' }, { label: 'ERP库位', field: 'erpLocationCode' }, { label: '项目代码', field: 'projectCode' }, { label: '标包数量', field: 'stdPackQty' }, { label: '标包单位', field: 'stdPackUnit', dictType: DICT_TYPE.PACK_UNIT, dictClass: 'string', isSearch: true, isTable: true }, { label: '供应商计量数量', field: 'supplierQty' }, { label: '供应商计量单位', field: 'supplierUom', dictType: DICT_TYPE.UOM, dictClass: 'string', isSearch: true, isTable: true }, { label: '转换率', field: 'convertRate' }, { label: '已发货数量', field: 'shippedQty' }, { label: '已收货数量', field: 'receivedQty' }, { label: '已退货数量', field: 'returnedQty' }, { label: '已上架数量', field: 'putawayQty' }, { label: '超收百分比', field: 'overReceivingPercent' }, { label: '单价', field: 'singlePrice' }, { label: '金额', field: 'amount' }, { label: '订单数量', field: 'orderQty' }, { lable: '计量单位', field: 'uom', dictType: DICT_TYPE.UOM, dictClass: 'string', isSearch: true, isTable: true }, { label: '单据号', field: 'nuumber' }, { label: '物品代码', field: 'itemCode' }, { label: 'status', field: '明细状态', dictType: DICT_TYPE.PURCHASE_ORDER_DETAIL_STATUS, dictClass: 'string', isSearch: true, isTable: true }, { label: '备注', fielc: 'remark' }, { label: '是否可用', field: 'available', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', isSearch: true, isTable: true, table: { width: 150 }, form: { component: 'Switch', value: 'TRUE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE' } } }, { label: '创建者', field: 'creator', }, { label: '创建时间', field: 'createTime', isTable: true, formatter: dateFormatter, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' } }, { label: '最后更新者', field: 'updater', }, { label: '最后更新时间', field: 'updateTime', isTable: true, formatter: dateFormatter, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' } } ]))