import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' import * as AreaApi from '@/api/wms/areabasic' import { Area } from '@/views/wms/basicDataManage/factoryModeling/areabasic/areabasic.data' import * as LocationApi from '@/api/wms/location' import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data' // 表单校验 export const AgvLocationrelationRules = reactive({ positionCode: [ { required: true, message: '请填写AGV点位', trigger: 'change' } ], positionArea: [ { required: true, message: '请填写AGV库区', trigger: 'change' } ], wmsArea: [ { required: true, message: '请填写WMS库区', trigger: 'change' } ], wmsPosition: [ { required: true, message: '请填写WMS库位', trigger: 'change' } ] }) export const AgvLocationrelation = useCrudSchemas(reactive([ { label: '单据号', field: 'reqCode', sort: 'custom', isSearch: true, isForm: false, }, { label: 'AGV点位', field: 'positionCode', sort: 'custom', isSearch: false, }, { label: 'AGV库区', field: 'positionArea', sort: 'custom', isSearch: false, }, { label: 'WMS库区', field: 'wmsArea', sort: 'custom', isSearch: false, form: { // labelMessage: '信息提示说明!!!', componentProps: { enterSearch: true, isSearchList: true, // 开启查询弹窗 searchListPlaceholder: '请选择库区代码', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '库区信息', // 查询弹窗标题 searchAllSchemas: Area.allSchemas, // 查询弹窗所需类 searchPage: AreaApi.getAreaPage, // 查询弹窗所需分页方法 searchCondition: [{ key: 'available', value: 'TRUE', isMainValue: false }], verificationParams: [{ key: 'code', action: '==', value: '', isMainValue: false, isSearch: true, isFormModel: true, }], // 失去焦点校验参数 } } }, { label: 'WMS库位', field: 'wmsPosition', sort: 'custom', table: { width: 150 }, form: { // labelMessage: '信息提示说明!!!', componentProps: { enterSearch: true, isSearchList: true, // 开启查询弹窗 searchListPlaceholder: '请选择库位代码', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '库位信息', // 查询弹窗标题 searchAllSchemas: Location.allSchemas, // 查询弹窗所需类 searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法 searchCondition: [{ key: 'available', value: 'TRUE', isMainValue: false }, { key: 'areaCode', value: "wmsArea", message: '请选择库区代码!', isMainValue: true }], verificationParams: [{ key: 'code', action: '==', value: '', isMainValue: false, isSearch: true, isFormModel: true, }], // 失去焦点校验参数 } } }, { label: '是否可用', field: 'available', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', isTable: true, isSearch: false, sort: 'custom', table: { width: 150 }, form: { component: 'Switch', value: 'TRUE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE' } } }, { label: '备注', field: 'remark', sort: 'custom', isSearch: false, }, { label: '创建时间', field: 'createTime', isForm: false, table: { width: 180 }, formatter: dateFormatter, detail: { dateFormat : 'YYYY-MM-DD HH:mm:ss' }, form: { component: 'DatePicker', componentProps: { style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', } }, isSearch: true, search: { component: 'DatePicker', componentProps: { valueFormat: 'YYYY-MM-DD HH:mm:ss', type: 'daterange', defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] }, }, }, { label: '创建者', field: 'creator', table: { width: 130 }, isForm: false, isTable: true }, { label: '最后更新时间', field: 'updateTime', sort: 'custom', isDetail: true, isForm: false, isTable: false, formatter: dateFormatter, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' }, table: { width: 180 }, form: { component: 'DatePicker', componentProps: { style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', } } }, { label: '最后更新者', field: 'updater', isDetail: true, isForm: false, isTable: false, table: { width: 150 } }, { label: '操作', field: 'action', isForm: false, isDetail: false, table: { width: 150, fixed: 'right' } } ]))