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.

976 lines
18 KiB

1 year ago
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
/**
* @returns {Array}
*/
export const IssueJobMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 180,
fixed: 'left'
},
sortSearchDefault:1,
1 year ago
isSearch: true,
},
{
label: '申请单号',
field: 'requestNumber',
sort: 'custom',
table: {
width: 180
},
isTable: false,
1 year ago
},
{
label: '供应商代码',
field: 'supplierCode',
1 year ago
sort: 'custom',
table: {
width: 150
},
isTable: false,
1 year ago
},
{
label: '车间代码',
field: 'workShopCode',
sort: 'custom',
table: {
width: 150
},
isTable: false,
},
{
label: '从仓库代码',
field: 'fromWarehouseCode',
sort: 'custom',
table: {
width: 150
},
isTable: false,
},
1 year ago
{
label: '申请时间',
field: 'requestTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: false,
1 year ago
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '要求截止时间',
field: 'requestDueTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isTable: false,
1 year ago
},
{
label: '过期时间',
field: 'expiredTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: false,
1 year ago
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '状态',
field: 'status',
dictType: DICT_TYPE.JOB_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
sortTableDefault:1,
},
{
label: '到仓库代码',
field: 'toWarehouseCode',
sort: 'custom',
table: {
width: 150
},
isTable: false,
},
{
label: '生产线代码',
field: 'detailProductionLineCode',
sort: 'custom',
table: {
width: 150
},
isTable: false,
},
{
label: '工位代码',
field: 'detailWorkStationCode',
sort: 'custom',
table: {
width: 150
},
isTable: false,
},
1 year ago
{
label: '最后更新时间',
field: 'updateTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: false,
1 year ago
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '最后更新者',
field: 'update',
sort: 'custom',
table: {
width: 150
},
isTable: false,
1 year ago
},
1 year ago
{
label: '优先级',
field: 'priority',
sort: 'custom',
table: {
width: 150
},
isTable: false,
1 year ago
form: {
component: 'InputNumber',
}
},
{
label: '优先级增量',
field: 'priorityIncrement',
sort: 'custom',
table: {
width: 150
},
isTable: false,
1 year ago
form: {
component: 'InputNumber',
}
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
table: {
width: 150
},
isTable: false,
1 year ago
},
{
label: '承接人用户名',
field: 'acceptUserId',
sort: 'custom',
table: {
width: 150
},
isTable: false,
1 year ago
},
{
label: '承接时间',
field: 'acceptTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: false,
1 year ago
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '完成人用户名',
field: 'completeUserId',
sort: 'custom',
table: {
width: 150
},
isTable: false,
1 year ago
},
{
label: '完成时间',
field: 'completeTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: false,
1 year ago
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '从库区类型范围',
field: 'fromAreaTypes',
dictType: DICT_TYPE.AREA_TYPE,
dictClass: 'string',
isTable: false,
1 year ago
sort: 'custom',
table: {
width: 150
},
},
{
label: '到库区类型范围',
field: 'toAreaTypes',
dictType: DICT_TYPE.AREA_TYPE,
dictClass: 'string',
isTable: false,
1 year ago
sort: 'custom',
table: {
width: 150
},
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
table: {
width: 150
},
isTable: false,
1 year ago
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
isTable: false,
1 year ago
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: false,
1 year ago
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
isTable: false,
1 year ago
},
{
label: '从库区代码范围',
field: 'fromAreaCodes',
sort: 'custom',
table: {
width: 150
},
isTable: false,
1 year ago
},
{
label: '到库区代码范围',
field: 'toAreaCodes',
sort: 'custom',
table: {
width: 150
},
isTable: false,
1 year ago
},
// {
// label: '使用在途库',
// field: 'useOnTheWayLocation',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string',
// sort: 'custom',
// table: {
// width: 150
// },
// isTable: false,
// form: {
// component: 'Switch',
// value: 'TRUE',
// componentProps: {
// inactiveValue: 'FALSE',
// activeValue: 'TRUE'
// }
// }
// },
1 year ago
{
label: '自动完成',
field: 'autoComplete',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
1 year ago
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '允许修改库位',
field: 'allowModifyLocation',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
1 year ago
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '允许修改数量',
field: 'allowModifyQty',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
1 year ago
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '允许大于推荐数量',
field: 'allowBiggerQty',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
1 year ago
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '允许小于推荐数量',
field: 'allowSmallerQty',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
1 year ago
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '允许修改库存状态',
field: 'allowModifyInventoryStatus',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
1 year ago
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '允许连续扫描',
field: 'allowContinuousScanning',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
1 year ago
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '允许部分完成',
field: 'allowPartialComplete',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
1 year ago
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '允许修改批次',
field: 'allowModifyBatch',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
1 year ago
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '允许修改箱码',
field: 'allowModifyPackingNumber',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
1 year ago
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
// {
// label: '操作',
// field: 'action',
// isDetail: false,
// isForm: false,
// table: {
// width: 120,
// fixed: 'right'
// },
// }
]))
//表单校验
export const IssueJobMainRules = reactive({
requestNumber: [
{ required: true, message: '请选择申请单号', trigger: 'change' }
],
fromWarehouseCode: [
{ required: true, message: '请选择从仓库代码', trigger: 'change' }
],
fromAreaTypes: [
{ required: true, message: '请选择从库区类型范围', trigger: 'change' }
],
toWarehouseCode: [
{ required: true, message: '请选择到仓库代码', trigger: 'change' }
],
toAreaTypes: [
{ required: true, message: '请选择到库区类型范围', trigger: 'change' }
],
requestTime: [
{ required: true, message: '请输入申请时间', trigger: 'change' }
],
requestDueTime: [
{ required: true, message: '请输入要求截止时间', trigger: 'change' }
],
status: [
{ required: true, message: '请选择状态', trigger: 'change' }
],
// jobStageStatus: [
// { required: true, message: '请选择阶段状态', trigger: 'change' }
// ],
priority: [
{ required: true, message: '请输入优先级', trigger: 'blur' }
],
priorityIncrement: [
{ required: true, message: '请输入优先级增量', trigger: 'blur' }
],
departmentCode: [
{ required: true, message: '请输入部门', trigger: 'blur' }
],
userPositionCode: [
{ required: true, message: '请输入岗位', trigger: 'blur' }
],
number: [
{ required: true, message: '请输入单据号', trigger: 'blur' }
],
businessType: [
{ required: true, message: '请输入业务类型', trigger: 'blur' }
],
createTime: [
{ required: true, message: '请输入创建时间', trigger: 'blur' }
],
creator: [
{ required: true, message: '请输入创建者', trigger: 'blur' }
],
})
/**
* @returns {Array}
*/
export const IssueJobDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '生产线代码',
field: 'productionLineCode',
sort: 'custom',
table: {
width: 150
},
isTable:false,
hiddenInMain:true,
1 year ago
},
{
label: '工位代码',
field: 'workStationCode',
sort: 'custom',
table: {
width: 150
},
isTable:false,
hiddenInMain:true,
1 year ago
},
{
label: '在途库库位',
field: 'onTheWayLocationCode',
1 year ago
sort: 'custom',
table: {
width: 150
},
isTable:false,
hiddenInMain:true,
1 year ago
},
{
label: '包装号',
field: 'packingNumber',
1 year ago
sort: 'custom',
table: {
width: 150
},
isSearch: true,
sortTableDefault:5,
1 year ago
},
{
label: '包装规格',
field: 'packUnit',
1 year ago
sort: 'custom',
table: {
width: 150
},
sortTableDefault:5,
1 year ago
},
{
label: '包装数量',
field: 'packQty',
1 year ago
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
},
sortTableDefault:5,
1 year ago
},
{
label: '器具号',
field: 'containerNumber',
1 year ago
sort: 'custom',
table: {
width: 150
},
hiddenInMain: true,
isTable:false,
1 year ago
},
{
label: '批次',
field: 'batch',
1 year ago
sort: 'custom',
table: {
width: 150
},
isSearch: true,
sortSearchDefault:3,
sortTableDefault:4,
1 year ago
},
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
1 year ago
sort: 'custom',
table: {
width: 150
},
},
{
label: '采购订单号',
field: 'poNumber',
1 year ago
sort: 'custom',
table: {
width: 150
},
sortTableDefault:2,
1 year ago
},
{
label: '订单行',
field: 'poLine',
1 year ago
sort: 'custom',
table: {
width: 150
},
sortTableDefault:2,
1 year ago
},
{
label: '从库位代码',
field: 'fromLocationCode',
1 year ago
sort: 'custom',
table: {
width: 150
},
isSearch: true,
1 year ago
},
{
label: '到库位代码',
field: 'toLocationCode',
1 year ago
sort: 'custom',
table: {
width: 150
},
isSearch: true,
1 year ago
},
{
label: '物料代码',
field: 'itemCode',
1 year ago
sort: 'custom',
table: {
width: 150
},
sortSearchDefault:2,
isSearch: true,
sortTableDefault:3,
1 year ago
},
{
label: '物料名称',
field: 'itemName',
1 year ago
sort: 'custom',
table: {
width: 150
},
sortTableDefault:3,
1 year ago
},
{
label: '物料描述1',
field: 'itemDesc1',
1 year ago
sort: 'custom',
table: {
width: 150
},
hiddenInMain: true,
1 year ago
},
{
label: '物料描述2',
field: 'itemDesc2',
1 year ago
sort: 'custom',
table: {
width: 150
},
hiddenInMain: true,
1 year ago
},
{
label: '项目代码',
field: 'projectCode',
sort: 'custom',
table: {
width: 150
},
hiddenInMain: true,
1 year ago
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
},
hiddenInMain: true,
1 year ago
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
sortTableDefault:6,
1 year ago
},
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 180
},
hiddenInMain: true,
1 year ago
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
hiddenInMain: true,
},
{
label: '从货主代码',
field: 'fromOwnerCode',
sort: 'custom',
table: {
width: 150
},
hiddenInMain: true,
},
{
label: '到货主代码',
field: 'toOwnerCode',
sort: 'custom',
table: {
width: 150
},
hiddenInMain: true,
1 year ago
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
hiddenInMain: true,
1 year ago
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
hiddenInMain: true,
1 year ago
},
{
label: '供应商计量数量',
field: 'supplierQty',
1 year ago
sort: 'custom',
table: {
width: 150
},
isTable:false,
hiddenInMain: true,
form: {
component: 'InputNumber',
}
1 year ago
},
{
label: '供应商计量单位',
field: 'supplierUom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
1 year ago
sort: 'custom',
table: {
width: 150
},
isTable:false,
hiddenInMain:true,
1 year ago
},
1 year ago
]))
//表单校验
export const IssueJobDetailRules = reactive({
packingNumber: [
{ required: true, message: '请选择包装号', trigger: 'change' }
],
batch: [
{ required: true, message: '请输入批次', trigger: 'blur' }
],
inventoryStatus: [
{ required: true, message: '请选择库存状态', trigger: 'change' }
],
fromLocationCode: [
{ required: true, message: '请选择从库位代码', trigger: 'change' }
],
toLocationCode: [
{ required: true, message: '请选择到库位代码', trigger: 'change' }
],
number: [
{ required: true, message: '请输入单据号', trigger: 'blur' }
],
itemCode: [
{ required: true, message: '请选择物料代码', trigger: 'change' }
],
createTime: [
{ required: true, message: '请输入创建时间', trigger: 'blur' }
],
creator: [
{ required: true, message: '请输入创建者', trigger: 'blur' }
],
})