You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

856 lines
20 KiB

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<CrudSchema[]>([
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
isSearch: true,
table: {
width: 180,
fixed: 'left'
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '物料基础信息', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
}
}
},
{
label: '背番',
field: 'itemDesc1',
sort: 'custom',
isSearch: true,
hiddenSearchHigh:true,
table: {
width: 150
},
form:{
componentProps:{
disabled: true,
}
}
},
{
label: '区域代码',
field: 'areaCode',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
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: '库区类型',
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: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择溢出库位代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '库位信息', // 查询弹窗标题
searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true
}], // 失去焦点校验参数
}
}
},
{
label: '入库包装规格',
field: 'inPackUnit',
sort: 'custom',
isSearch: false,
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料包装代码', // 输入框占位文本
searchField: 'packUnit', // 查询弹窗赋值字段
searchTitle: '物料包装信息', // 查询弹窗标题
searchAllSchemas: Itempackaging.allSchemas, // 查询弹窗所需类
searchPage: ItempackageApi.getItempackagingPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
}, {
key: 'itemCode',
value: 'itemCode',
message: "请选择物料代码",
isMainValue: true
}],
verificationParams: [{
key: 'packUnit',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
required: true,
message: '请选择物料代码',
}], // 失去焦点校验参数
}
}
},
{
label: '出库包装规格',
field: 'outPackUnit',
sort: 'custom',
isSearch: false,
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料包装代码', // 输入框占位文本
searchField: 'packUnit', // 查询弹窗赋值字段
searchTitle: '物料包装信息', // 查询弹窗标题
searchAllSchemas: Itempackaging.allSchemas, // 查询弹窗所需类
searchPage: ItempackageApi.getItempackagingPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
}, {
key: 'itemCode',
value: 'itemCode',
message: "请选择物料代码",
isMainValue: true
}],
verificationParams: [{
key: 'packUnit',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
required: true,
message: '请选择物料代码',
isBlurParams: 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: {
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,
required: true,
message: '请选择物料代码',
}], // 失去焦点校验参数
}
}
},
{
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: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: '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',
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: '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: true,
table: {
width: 150
},
},
{
label: '最后更新时间',
field: 'updateTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
isTable: true,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 150
},
},
{
label: '最后更新者',
field: 'updater',
sort: 'custom',
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'
}
}
]))
// 表单校验
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<CrudSchema[]>([
{
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
}],
verificationParams: [{
key: 'codes',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}],
verificationPage: LocationApi.getLocationByCodes, // 校验数去焦点输入是否正确的方法
isShowTableFormSearch: 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
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: 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({
})