import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' import * as ItembasicApi from '@/api/wms/itembasic' import { Itembasic } from '../itembasic/itembasic.data' import * as AreaApi from '@/api/wms/areabasic' import { Area } from '../../factoryModeling/areabasic/areabasic.data' import * as LocationApi from '@/api/wms/location' import { Location } from '../../factoryModeling/location/location.data' import * as ItempackageApi from '@/api/wms/itempackage' import { Itempackaging } from '../itempackage/itempackage.data' import { t } from '@/hooks/web/useI18n' export const Itemarea = useCrudSchemas(reactive([ { label: '物料代码', field: 'itemCode', sort: 'custom', isSearch: true, table: { width: 180, fixed: 'left' }, form: { // labelMessage: '信息提示说明!!!', componentProps: { isSearchList: true, // 开启查询弹窗 searchListPlaceholder: '请选择物料代码', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '物料基础信息', // 查询弹窗标题 searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类 searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法 searchCondition: [{ key: 'available', value: 'TRUE', isMainValue: false }] } } }, { label: '区域代码', field: 'areaCode', sort: 'custom', isSearch: true, table: { width: 150 }, form: { // labelMessage: '信息提示说明!!!', componentProps: { isSearchList: true, // 开启查询弹窗 searchListPlaceholder: '请选择库区代码', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '库区基础信息', // 查询弹窗标题 searchAllSchemas: Area.allSchemas, // 查询弹窗所需类 searchPage: AreaApi.getAreaPage, // 查询弹窗所需分页方法 searchCondition: [{ key: 'available', value: 'TRUE', isMainValue: false }] } } }, { label: '库区类型', field: 'areaType', dictType: DICT_TYPE.AREA_TYPE, dictClass: 'string', isSearch: true, isTable: true, sort: 'custom', table: { width: 150 }, form: { componentProps: { disabled: true } } }, { label: '溢出库位', field: 'overflowLocationCode', isTable: true, 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', }] } } }, { label: '入库包装规格', field: 'inPackUnit', sort: 'custom', isSearch: false, table: { width: 150 }, form: { // labelMessage: '信息提示说明!!!', componentProps: { isSearchList: true, // 开启查询弹窗 searchListPlaceholder: '请选择物料包装代码', // 输入框占位文本 searchField: 'packUnit', // 查询弹窗赋值字段 searchTitle: '物料包装信息', // 查询弹窗标题 searchAllSchemas: Itempackaging.allSchemas, // 查询弹窗所需类 searchPage: ItempackageApi.getItempackagingPage, // 查询弹窗所需分页方法 searchCondition: [{ key: 'available', value: 'TRUE', },{ key: 'itemCode', value: 'itemCode', message: "请选择物料代码", isMainValue: true }] } } }, { label: '出库包装规格', field: 'outPackUnit', sort: 'custom', isSearch: false, table: { width: 150 }, form: { // labelMessage: '信息提示说明!!!', componentProps: { isSearchList: true, // 开启查询弹窗 searchListPlaceholder: '请选择物料包装代码', // 输入框占位文本 searchField: 'packUnit', // 查询弹窗赋值字段 searchTitle: '物料包装信息', // 查询弹窗标题 searchAllSchemas: Itempackaging.allSchemas, // 查询弹窗所需类 searchPage: ItempackageApi.getItempackagingPage, // 查询弹窗所需分页方法 searchCondition: [{ key: 'available', value: 'TRUE', },{ key: 'itemCode', value: 'itemCode', message: "请选择物料代码", isMainValue: true }] } } }, { label: '管理精度', field: 'manageMode', sort: 'custom', isSearch: false, dictType: DICT_TYPE.MANAGEMENT_MODE, dictClass: 'string', // colorType: 'danger', isTable: true, table: { width: 150 }, }, { label: '最高库存数量', field: 'maxQty', sort: 'custom', table: { width: 150 }, form: { component: 'InputNumber', componentProps: { min: 0, precision: 6 } }, }, { label: '最低库存数量', field: 'minQty', sort: 'custom', table: { width: 150 }, form: { component: 'InputNumber', componentProps: { min: 0, precision: 6 } }, }, { label: '安全预警库存数量', field: 'safeQty', sort: 'custom', table: { width: 180 }, form: { component: 'InputNumber', componentProps: { min: 0, precision: 6 } }, }, { label: '是否自动补料', field: 'autoRepleinsh', sort: 'custom', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', // colorType: 'danger', isTable: true, table: { width: 140 }, form: { component: 'Switch', value: 'FALSE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE' } }, }, { label: '补料来源库区', field: 'repleinshFromArea', sort: 'custom', isSearch: false, table: { width: 150 }, form: { // labelMessage: '信息提示说明!!!', componentProps: { isSearchList: true, // 开启查询弹窗 searchListPlaceholder: '请选择库区代码', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '库区基础信息', // 查询弹窗标题 searchAllSchemas: Area.allSchemas, // 查询弹窗所需类 searchPage: AreaApi.getAreaPage, // 查询弹窗所需分页方法 searchCondition: [{ key: 'available', value: 'TRUE', isMainValue: false }] } } }, { label: '补料数量', field: 'repleinshQty', sort: 'custom', table: { width: 150 }, form: { component: 'InputNumber', componentProps: { min: 0, precision: 6 } }, }, { label: '入库自动转为出库包装规格', field: 'newlyToOutpackunit', sort: 'custom', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', // colorType: 'danger', isTable: true, table: { width: 150 }, form: { component: 'Switch', value: 'TRUE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE' } }, }, { label: '出库自动转为出库包装规格', field: 'surplusToOutpackunit', sort: 'custom', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', // colorType: 'danger', isTable: true, table: { width: 150 }, form: { component: 'Switch', value: 'TRUE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE' } }, }, { label: '需要接收确认', field: 'needReceive', sort: 'custom', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', // colorType: 'danger', isTable: true, table: { width: 150 }, form: { component: 'Switch', value: 'FALSE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE' } }, }, { label: '是否可用', field: 'available', sort: 'custom', isSearch: false, dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', // colorType: 'danger', isTable: true, table: { width: 150 }, form: { component: 'Switch', value: 'TRUE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE' } }, }, { label: '出库后剩余库存自动转换为出库包装规格', field: 'surplusToOutpackunit', sort: 'custom', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', form: { component: 'Switch', value: 'FALSE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE' } }, isTable:false }, { label: '超过高储是否允许叫料', field: 'allowIssueRequest', sort: 'custom', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', form: { component: 'Switch', value: 'TRUE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE' } }, isTable:false }, { label: '优先空库位', field: 'emptyLocationFirst', sort: 'custom', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', form: { component: 'Switch', value: 'TRUE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE', } }, }, { label: '优先非空库位', field: 'notEmptyLocationFirst', sort: 'custom', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', form: { component: 'Switch', value: 'FALSE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE', disabled: true } }, }, { label: '可以混批次', field: 'enableMixLot', sort: 'custom', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', form: { component: 'Switch', value: 'TRUE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE' } }, }, { label: '可以混物品', field: 'enableMixItem', sort: 'custom', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', form: { component: 'Switch', value: 'FALSE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE' } }, }, { label: '可以混状态', field: 'enableMixStatus', sort: 'custom', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', form: { component: 'Switch', value: 'TRUE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE' } }, }, { label: '巷道排序方向', field: 'aisleOrder', sort: 'custom', dictType: DICT_TYPE.BATCH_DIRECTION, dictClass: 'string', // colorType: 'danger', isTable: true, form: { component: 'Select', value: 'ASC', componentProps: { inactiveValue: 'DESC', activeValue: 'ASC' } }, table: { width: 150 }, }, { label: '货架排序方向', field: 'sheIfOrder', sort: 'custom', dictType: DICT_TYPE.BATCH_DIRECTION, dictClass: 'string', isTable: true, form: { component: 'Select', value: 'ASC', componentProps: { inactiveValue: 'DESC', activeValue: 'ASC' } }, table: { width: 150 }, }, { label: '行排序方向', field: 'rowOrder', sort: 'custom', dictType: DICT_TYPE.BATCH_DIRECTION, dictClass: 'string', // colorType: 'danger', isTable: true, form: { component: 'Select', value: 'ASC', componentProps: { inactiveValue: 'DESC', activeValue: 'ASC' } }, table: { width: 150 }, }, { label: '列排序方向', field: 'columOrder', sort: 'custom', dictType: DICT_TYPE.BATCH_DIRECTION, dictClass: 'string', // colorType: 'danger', isTable: true, form: { component: 'Select', value: 'ASC', componentProps: { inactiveValue: 'DESC', activeValue: 'ASC' } }, table: { width: 150 }, }, { label: '生效时间', field: 'activeTime', sort: 'custom', formatter: dateFormatter, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' }, table: { width: 150 } , form: { component: 'DatePicker', componentProps: { type: 'datetime', valueFormat: 'x' } }, }, { label: '失效时间', field: 'expireTime', sort: 'custom', formatter: dateFormatter, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' }, table: { width: 150 } , form: { component: 'DatePicker', componentProps: { type: 'datetime', valueFormat: 'x' } }, }, { label: '创建时间', field: 'createTime', sort: 'custom', formatter: dateFormatter, isForm: false, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' }, table: { width: 180 }, }, { label: '创建者', field: 'creator', sort: 'custom', isForm: false, isTable: false, table: { width: 150 }, }, { label: '最后更新时间', field: 'updateTime', sort: 'custom', formatter: dateFormatter, isForm: false, isTable: false, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' }, table: { width: 150 }, }, { label: '最后更新者', field: 'updater', sort: 'custom', isForm: false, isTable: false, table: { width: 150 }, }, { label: '备注', field: 'remark', sort: 'custom', table: { width: 120 } , }, { label: '操作', field: 'action', isForm: false, table: { width: 150, fixed: 'right' } } ])) // 表单校验 export const ItemareaRules = reactive({ itemCode: [ { required: true, message: '请选择物料代码', trigger: 'change' } ], areaCode: [ { required: true, message: '请选择到区域代码', trigger: 'change' } ], inPackUnit: [ { required: true, message: '请选择入库包装规格', trigger: 'change' } ], outPackUnit: [ { required: true, message: '请选择出库包装规格', trigger: 'change' } ], manageMode: [ { required: true, message: '请选择管理精度', trigger: 'change' } ], }) /** * @returns {Array} 库存转移申请子表 */ export const ItemareaDetail = useCrudSchemas(reactive([ { label: '库位代码', field: 'locationCode', sort: 'custom', tableForm:{ multiple:true,//多选 isInpuFocusShow: true, // 开启查询弹窗 searchListPlaceholder: '请选择库位代码', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '库位基础信息', // 查询弹窗标题 searchAllSchemas: Location.allSchemas, // 查询弹窗所需类 searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法 searchCondition: [{ key: 'available', value: 'TRUE', isMainValue: false },{ key: 'areaCode', value: 'areaCode', message: '请选择区域代码!', isMainValue: true }] }, form: { // labelMessage: '信息提示说明!!!', componentProps: { isSearchList: true, // 开启查询弹窗 multiple:true,//多选 searchListPlaceholder: '请选择库位代码', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '库位基础信息', // 查询弹窗标题 searchAllSchemas: Location.allSchemas, // 查询弹窗所需类 searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法 searchCondition: [{ key: 'available', value: 'TRUE', isMainValue: false },{ key: 'areaCode', value: 'areaCode', message: '请选择区域代码!', isMainValue: true }] } } }, { label: '库位组', field: 'locationGroupCode', sort: 'custom', isForm: false, isTableForm: false, }, { label: '备注', field: 'remark', sort: 'custom', }, { label: '操作', field: 'action', isForm: false, table: { width: 150, fixed: 'right' } } ])) // 表单校验 export const ItemareaDetailRules = reactive({ })