import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' import { getTenantId } from '@/utils/auth' let names =[{"text":"1379","value":1},{"text":"1397","value":2},{"text":"2379","value":3}] let tenant = names.find(item=>item.value == getTenantId()) // 表单校验 export const MesBarCodeRules = reactive({ available: [required], lowerLim: [required], partNumber: [required], available: [{ required: true, message: '是否可用不能为空', trigger: 'change' }] }) export const MesBarCode = useCrudSchemas(reactive([ { label: '租户', field: 'plnt', sort: 'custom', table: { width: 120 }, form: { componentProps: { disabled:true, value: tenant?.text }, }, }, // { // label: 'Counter', // field: 'counter', // sort: 'custom', // table: { // width: 150 // }, // isSearch:true // }, // { // label: 'SIGN', // field: 'sign', // sort: 'custom', // table: { // width: 120 // }, // }, // { // label: 'Option', // field: 'option', // sort: 'custom', // table: { // width: 120 // }, // }, { label: 'WMS物料代码', field: 'lowerLim', sort: 'custom', isSearch: true, table: { width: 150 }, }, // { // label: 'UpperLimit', // field: 'upperLimit', // sort: 'custom', // table: { // width: 150 // }, // }, // { // label: 'ITAC', // field: 'itac', // sort: 'custom', // table: { // width: 120 // }, // }, { label: '灯码标签类型', field: 'type', sort: 'custom', table: { width: 120 }, form: { component: 'Select', componentProps: { options: [{ label:'未加密标签', value:'P' },{ label:'加密标签', value:'Q' }], } }, detail:{ valueFilter:(value)=>{ if(value=='P'){ return `未加密标签` }else if(value=='Q'){ return '加密标签' }else{ return value } } } }, { label: '灯码标签字符总长度', field: 'lengthBc', sort: 'custom', table: { width: 150 }, form: { component: 'InputNumber', value: 0 }, }, // { // label: 'Pos. mat', // field: 'posMat', // sort: 'custom', // table: { // width: 150 // }, // }, { label: '客户物料代码字符长度', field: 'lengthMat', sort: 'custom', table: { width: 150 }, form: { component: 'InputNumber', value: 0 }, }, // { // label: 'Pos. revlv', // field: 'posRevlv', // sort: 'custom', // table: { // width: 150 // }, // }, { label: '客户物料代码', field: 'partNumber', sort: 'custom', isSearch: true, table: { width: 150 }, }, // { // label: 'Pack Label', // field: 'packLabel', // sort: 'custom', // table: { // width: 150 // }, // }, // { // label: 'OES-Label', // field: 'oesLabel', // sort: 'custom', // table: { // width: 150 // }, // }, // { // label: 'Check Rvl', // field: 'checkRvl', // sort: 'custom', // table: { // width: 150 // }, // }, // { // label: 'Days', // field: 'days', // sort: 'custom', // table: { // width: 120 // }, // form: { // component: 'InputNumber', // value: 0 // }, // }, { label: '是否可用', field: 'available', sort: 'custom', isSearch:true, isForm: false, dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', // 默认都是字符串类型其他暂不考虑 search: { value: 'TRUE', }, form: { component: 'Switch', value: 'TRUE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE' } }, table: { width: 110 } }, { label: '创建时间', field: 'createTime', isForm: false, table: { width: 180 }, formatter: dateFormatter, detail: { dateFormat : 'YYYY-MM-DD HH:mm:ss' }, isSearch: true, form: { component: 'DatePicker', componentProps: { style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', } }, 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: true, 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: true, table: { width: 150 } }, // { // label: '备注', // field: 'remark', // sort: 'custom', // table: { // width: 120 // }, // }, { label: '操作', field: 'action', isForm: false, table: { width: 150, fixed: 'right' } } ]))