diff --git a/src/utils/disposition/tableColumns.ts b/src/utils/disposition/tableColumns.ts index 0de764777..4c59a2607 100644 --- a/src/utils/disposition/tableColumns.ts +++ b/src/utils/disposition/tableColumns.ts @@ -1,27 +1,231 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' /** * @returns {Array} 基础物料信息 */ -export const ItemBasic = [{ - label: "物料代码", - prop: "code", - fixed: "left", - type: "name", -}, -{ label: "物料名称", prop: "name", }, -{ type: "filter", label: "状态", prop: "status", filters: "itemStatus", }, -{ label: "有效值", prop: "validity", }, -{ label: "项目", prop: "project", }, -{ type: "filter", label: "有效期", prop: "validityUnit", filters: "validityUnit", }, -{ type: "filter", label: "ABC类", prop: 'abcClass', filters: "abcClass", }, -{ type: "filter", label: "制造件", prop: 'canMake', filters: "whetherOrNot", }, -{ type: "filter", label: "采购件", prop: 'canBuy', filters: "whetherOrNot", }, -{ label: "产品类", prop: 'productLine', }, -{ label: "E-LEVEL等级", prop: 'elevel', }, -{ type: "filter", label: "是否虚拟物料", prop: "isPhantom", filters: "whetherOrNot" }, -{ type: "filter", label: "是否是下线结算件", prop: "isOfflineSettlement", filters: "whetherOrNot" }, -{ label: "特性", prop: 'characteristic' }, -{ label: "管理类型", prop: 'remark' }, -] +export const ItemBasic = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + table: { + width: 150 + } + }, + { + label: '名称', + field: 'name', + table: { + width: 150 + } + }, + { + label: '描述1', + field: 'desc1', + table: { + width: 150 + } + }, + { + label: '描述2', + field: 'desc2', + table: { + width: 150 + } + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.ITEM_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '替代计量单位', + field: 'altUom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '是否标包', + field: 'isStdPack', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '可采购', + field: 'enableBuy', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '可制造', + field: 'enableMake', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '可委外加工', + field: 'enableOutsourcing', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '回收件', + field: 'isRecycled', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '虚零件', + field: 'isPhantom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: 'ABC类', + field: 'abcClass', + dictType: DICT_TYPE.ABC_CLASS, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '类型', + field: 'type', + dictType: DICT_TYPE.ITEM_TYPE, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '种类', + field: 'category', + dictType: DICT_TYPE.ITEM_CATEGORY, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '分组', + field: 'itemGroup', + dictType: DICT_TYPE.ITEM_GROUP, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '颜色', + field: 'color', + dictType: DICT_TYPE.ITEM_COLOR, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '配置', + field: 'configuration', + dictType: DICT_TYPE.ITEM_CONFIGURATION, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { label: '项目', field: 'project' }, + { + label: '质量等级', + field: 'eqLevel', + dictType: DICT_TYPE.EQ_LEVEL, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { label: '有效天数', field: 'validityDays' }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + } + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + } + }, + { + label: '创建时间', + field: 'createTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + } + }, + { label: '备注', field: 'remark', isTable: false }, + { label: '创建者ID', field: 'creator', isTable: false }, + { + label: '操作', + field: 'action', + isDetail: false, + table: { + width: 150 + } + } +])) + +// 表单校验 +export const ItemBasicRules = reactive({ + mail: [ + { required: true, message: 'profile.rules.mail', trigger: 'blur' }, + { + type: 'email', + message: 'profile.rules.truemail', + trigger: ['blur', 'change'] + } + ], + username: [required], + password: [required], + host: [required], + port: [required], + sslEnable: [required] +}) + /** * @returns {Array} 基础质量信息 */ diff --git a/src/views/wms/itembasic/index.vue b/src/views/wms/itembasic/index.vue index 0414093bf..bc03da6ed 100644 --- a/src/views/wms/itembasic/index.vue +++ b/src/views/wms/itembasic/index.vue @@ -1,7 +1,8 @@