import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' import * as WarehouseApi from '@/api/wms/warehouse' import { Warehouse } from '@/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data' import * as LocationApi from '@/api/wms/location' import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data' const { t } = useI18n() // 国际化 /** * @returns {Array} 月台 */ export const Dock = useCrudSchemas(reactive([ { label: '代码', field: 'code', sort: 'custom', table: { width: 150, fixed: 'left' }, isSearch: true }, { label: '名称', field: 'name', sort: 'custom', table: { width: 150 }, isSearch: true }, { label: '城市', field: 'city', sort: 'custom', table: { width: 150 }, }, { label: '地址', field: 'address', sort: 'custom', table: { width: 150 }, }, { label: '类型', field: 'type', dictType: DICT_TYPE.DOCK_TYPE, dictClass: 'string', isSearch: true, isTable: true, sort: 'custom', table: { width: 150 }, }, { label: '仓库代码', field: 'warehouseCode', sort: 'custom', table: { width: 150 }, form: { // labelMessage: '信息提示说明!!!', componentProps: { isSearchList: true, // 开启查询弹窗 searchListPlaceholder: '请选择仓库代码', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '仓库信息', // 查询弹窗标题 searchAllSchemas: Warehouse.allSchemas, // 查询弹窗所需类 searchPage: WarehouseApi.getWarehousePage // 查询弹窗所需分页方法 } } }, { label: '默认库位代码', field: 'defaultLocationCode', sort: 'custom', table: { width: 150 }, form: { // labelMessage: '信息提示说明!!!', componentProps: { isSearchList: true, // 开启查询弹窗 searchListPlaceholder: '请选择库位代码', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '库位信息', // 查询弹窗标题 searchAllSchemas: Location.allSchemas, // 查询弹窗所需类 searchPage: LocationApi.getLocationPage // 查询弹窗所需分页方法 } } }, { label: '联系人姓名', field: 'contactPerson', sort: 'custom', table: { width: 150 }, }, { label: '联系人电话', field: 'contactPhone', sort: 'custom', table: { width: 150 }, }, { label: '是否可用', field: 'available', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', isTable: true, isSearch: true, sort: 'custom', table: { width: 150 }, form: { component: 'Switch', value: 'TRUE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE' } }, }, { label: '生效时间', field: 'activeTime', isTable: true, formatter: dateFormatter, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' }, sort: 'custom', table: { width: 150 }, form: { component: 'DatePicker', componentProps: { type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', } }, }, { label: '失效时间', field: 'expireTime', isTable: true, formatter: dateFormatter, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' }, sort: 'custom', table: { width: 150 }, form: { component: 'DatePicker', componentProps: { type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', } }, }, { label: '备注', field: 'remark', sort: 'custom', table: { width: 150 }, }, { label: '创建时间', field: 'createTime', formatter: dateFormatter, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' }, sort: 'custom', table: { width: 150 }, form: { component: 'DatePicker', componentProps: { type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', } }, isTable: false, isForm: false }, { label: '创建者', field: 'creator', sort: 'custom', table: { width: 150 }, isTable: false, isForm: false }, { label: '操作', field: 'action', isDetail: false, isForm: false , table: { width: 150, fixed: 'right' } } ])) //表单校验 export const DockRules = reactive({ code: [ { required: true, message: '请输入代码', trigger: 'blur' } ], type: [ { required: true, message: '请输入类型', trigger: 'change' } ], warehouseCode: [ { required: true, message: '请输入仓库代码', trigger: 'change' } ], defaultLocationCode: [ { required: true, message: '请输入默认库位代码', trigger: 'change' } ], available: [ { required: true, message: '请选择是否可用', trigger: 'change' } ], })