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' import * as InspectionProcessPageApi from '@/api/qms/inspectionTemplate' // const inspectionProcessPage = await InspectionProcessPageApi.getInspectionProcessPage() // 表单校验 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: { isSearchList: true, // 开启查询弹窗 searchListPlaceholder: '请选择库区代码', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '库区信息', // 查询弹窗标题 searchAllSchemas: Area.allSchemas, // 查询弹窗所需类 searchPage: AreaApi.getAreaPage, // 查询弹窗所需分页方法 searchCondition: [{ key: 'available', value: 'TRUE', isMainValue: false }] } } }, { label: 'WMS库位', field: 'wmsPosition', sort: 'custom', table: { width: 150 }, form: { // labelMessage: '信息提示说明!!!', componentProps: { 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 }] } } }, { 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: 'createTime', sort: 'custom', formatter: dateFormatter, 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')] } }, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' }, isForm: false, }, { label: '备注', field: 'remark', sort: 'custom', isSearch: false, }, { label: '操作', field: 'action', isForm: false, isDetail: false, table: { width: 150, fixed: 'right' } } ])) export const InspectionTemplateMain = useCrudSchemas(reactive([ { label: '编码', field: 'code', sort: 'custom', form:{ componentProps:{ disabled:true, placeholder:'系统自动获取' } } }, { label: '描述', field: 'description', sort: 'custom', },{ label: '版本', field: 'version', sort: 'custom', } ])) export const InspectionTemplateProcess = useCrudSchemas(reactive([ { label: '编码', field: 'code', sort: 'custom', form:{ componentProps:{ disabled:true, placeholder:'系统自动获取' } } }, { label: '描述', field: 'description', sort: 'custom', isForm:false },{ label: '检验方案模板编码', field: 'inspectionCode', sort: 'custom', },{ label: '顺序号', field: 'sequenceCode', },{ label: '检验特性编码', field: 'inspectionCharCode', sort: 'custom', form:{ component:'Select', // api: () => inspectionProcessPage, // componentProps:{ // optionsAlias: { // labelField: 'name', // valueField: 'id' // } // } } // form: { // value: userDept.id, // component: 'Select', // api: () => userDeptArray, // componentProps: { // disabled: true, // optionsAlias: { // labelField: 'name', // valueField: 'id' // } // } // } } ])) export const InspectionTemplateFeatures= useCrudSchemas(reactive([ { label: '编码', field: 'code', sort: 'custom', form:{ componentProps:{ disabled:true, placeholder:'系统自动获取' } } }, { label: '描述', field: 'describe', sort: 'custom', },{ label: '检验方法编码', field: 'inspectionMethodCode', sort: 'custom', form:{ component:'Select' } },{ label: '采样过程编码', field: 'dynamicUpdateCode', sort: 'custom', form:{ component:'Select' } },{ label: '动态修改规则编码', field: 'inspectionMethod', sort: 'custom', form:{ component:'Select' } },{ label: '是否允许修改特征值', field: 'isCanUpdate', sort: 'custom', form:{ component:'Select' } },{ label: '是否破坏性检验', field: 'isDestructionInspection', sort: 'custom', form:{ component:'Select' } },{ label: '结果录入方式', field: 'resultEntryMethod', sort: 'custom', form:{ component:'Select' } },{ label: '特征类型', field: 'featureType', sort: 'custom', form:{ component:'Select' } },{ label: '是否设定上限', field: 'quantifyIsCapping', sort: 'custom', },{ label: '是否设定下限', field: 'quantifyIsLowlimit', sort: 'custom', },{ label: '目标值', field: 'quantifyTarget', sort: 'custom', },{ label: '上限值', field: 'quantifyCapping', sort: 'custom', },{ label: '下限值', field: 'quantifyLowlimit', sort: 'custom', },{ label: '计量单位', field: 'quantifyUom', sort: 'custom', },{ label: '小数位', field: 'quantifyDecimal', sort: 'custom', },{ label: '选择集编码', field: 'quantifyQuantifyCode', sort: 'custom', form:{ component:'Select' } } ]))