import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter,dateFormatter2 } from '@/utils/formatTime' import * as ShiftApi from '@/api/wms/shift' const shiftList = await ShiftApi.getShiftPage({available:'TRUE',pageSize: 500,pageNo: 1,sort:'',by: 'ASC'}) /** * @returns {Array} 制品收货任务主表 */ export const ProductreceiptJobMain = useCrudSchemas(reactive([ { label: '单据号', field: 'number', sort: 'custom', table: { width: 180, fixed: 'left' }, isSearch: true, sortTableDefault:1 }, { label: '申请单号', field: 'requestNumber', sort: 'custom', table: { width: 180 }, isSearch: true, sortTableDefault:7 }, { label: '状态', field: 'status', dictType: DICT_TYPE.JOB_STATUS, dictClass: 'string', isSearch: true, isTable: true, sort: 'custom', table: { width: 150 }, sortTableDefault:8 }, { label: '生产计划单号', field: 'productionPlanNumber', sort: 'custom', table: { width: 180 }, isSearch: true, isForm: false, isTable:true, sortTableDefault:10 }, { label: '车间代码', field: 'workShopCode', sort: 'custom', table: { width: 150 }, sortTableDefault:13 }, { label: '生产线代码', field: 'productionPlanNumber', isTable:false, sort: 'custom', table: { width: 150 }, sortTableDefault:16 }, { label: '班组', field: 'team', sort: 'custom', isTable:false, table: { width: 150 }, sortTableDefault:13 }, { label: '班组', field: 'teamName', sort: 'custom', isTable:true, isDetail:false, table: { width: 150 }, }, { label: '班次', field: 'shift', sort: 'custom', isTable:false, table: { width: 150 }, sortTableDefault:14 }, { label: '班次', field: 'shiftName', sort: 'custom', isTable:true, isDetail:false, table: { width: 150 }, isSearch: true, search: { component:'Select', componentProps:{ options:shiftList.list, optionsAlias: { labelField: 'name', valueField: 'name' }, } } }, { label: '收货类型', field: 'type', dictType: DICT_TYPE.PLAN_PRODUCTION_TYPE, dictClass: 'string', sort: 'custom', isTable:false, table: { width: 150 }, isForm: false }, { label: '到仓库代码', field: 'toWarehouseCode', sort: 'custom', isTable:false, table: { width: 150 }, }, { label: '申请时间', field: 'requestTime', formatter: dateFormatter, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' }, sort: 'custom', isTable:false, table: { width: 180 }, form: { component: 'DatePicker', componentProps: { type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', } }, }, { label: '要求截止时间', field: 'requestDueTime', isTable:false, 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', } }, }, { label: '过期时间', field: 'expiredTime', isTable:false, 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', } }, }, { label: '最后更新时间', field: 'updateTime', isTable:false, 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', } }, }, { label: '最后更新者', field: 'updater', isTable:false, sort: 'custom', table: { width: 150 }, }, { label: '优先级', field: 'priority', sort: 'custom', isTable:false, table: { width: 150 }, form: { component: 'InputNumber', } }, { label: '优先级增量', field: 'priorityIncrement', sort: 'custom', isTable:false, table: { width: 150 }, form: { component: 'InputNumber', } }, { label: '部门', field: 'departmentCode', sort: 'custom', isTable:false, table: { width: 150 }, }, { label: '承接人', field: 'acceptUserId', isTable:false, sort: 'custom', table: { width: 150 }, }, { label: '承接时间', field: 'acceptTime', isTable:false, 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', } }, }, { label: '完成人', field: 'completeUserId', isTable:false, sort: 'custom', table: { width: 150 }, }, { label: '完成时间', field: 'completeTime', isTable:false, 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', } }, }, { label: '从库区类型范围', field: 'fromAreaTypes', isTable:false, dictType: DICT_TYPE.AREA_TYPE, dictClass: 'string', sort: 'custom', table: { width: 150 }, }, { label: '到库区类型范围', field: 'toAreaTypes', dictType: DICT_TYPE.AREA_TYPE, dictClass: 'string', isTable: false, sort: 'custom', table: { width: 150 }, }, { label: '业务类型', field: 'businessType', isTable:false, sort: 'custom', table: { width: 150 }, }, { label: '备注', field: 'remark', isTable:false, sort: 'custom', table: { width: 150 }, }, { label: '创建时间', field: 'createTime', isTable:false, 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', } }, isForm: false, isSearch: true, 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', isTable:false, sort: 'custom', table: { width: 150 }, }, { label: '到库区代码范围', field: 'toAreaCodes', isTable:false, sort: 'custom', table: { width: 150 }, }, { label: '自动完成', field: 'autoComplete', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', isTable: false, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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 ProductreceiptJobMainRules = reactive({ requestNumber: [ { required: true, message: '请选择申请单号', trigger: 'change' } ], toWarehouseCode: [ { required: true, message: '请选择到仓库代码', trigger: 'change' } ], toAreaTypes: [ { required: true, message: '请选择到库区类型范围', trigger: 'change' } ], toAreaCodes: [ { 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 ProductreceiptJobDetail = useCrudSchemas(reactive([ { label: '生产线代码', field: 'productionLineCode', sort: 'custom', table: { width: 150 }, }, { label: '工位代码', field: 'workStationCode', sort: 'custom', table: { width: 150 }, }, { label: '工序代码', field: 'processCode', sort: 'custom', table: { width: 150 }, }, { label: '包装号', field: 'packingNumber', sortTableDefault:1003, sort: 'custom', table: { width: 150 }, }, // { // label: '器具号', // field: 'containerNumber', // isTable:false, // hiddenInMain:true, // sort: 'custom', // table: { // width: 150 // }, // }, { label: '批次', field: 'batch', sort: 'custom', table: { width: 150 }, sortTableDefault:12 }, { label: '生产日期', field: 'produceDate', formatter: dateFormatter2, detail: { dateFormat: 'YYYY-MM-DD' }, sort: 'custom', table: { width: 180 }, form: { component: 'DatePicker', componentProps: { style: {width: '100%'}, type: 'date', dateFormat: 'YYYY-MM-DD', valueFormat: 'x', } }, sortTableDefault:9 }, { label: '过期日期', field: 'expireDate', hiddenInMain:true, isTable:false, formatter: dateFormatter2, detail: { dateFormat: 'YYYY-MM-DD' }, sort: 'custom', table: { width: 180 }, form: { component: 'DatePicker', componentProps: { style: {width: '100%'}, type: 'date', dateFormat: 'YYYY-MM-DD', valueFormat: 'x', } }, }, { label: '库存状态', field: 'inventoryStatus', dictType: DICT_TYPE.INVENTORY_STATUS, dictClass: 'string', isTable: true, sort: 'custom', table: { width: 150 }, sortTableDefault:11 }, { label: '到库位代码', field: 'toLocationCode', sort: 'custom', table: { width: 150 }, sortTableDefault:10 }, { label: '订单号', hiddenInMain:true, isTable:false, field: 'woNumber', sort: 'custom', table: { width: 150 }, }, { label: '订单行', field: 'woLine', hiddenInMain:true, isTable:false, sort: 'custom', table: { width: 150 }, }, { label: '包装数量', field: 'packQty', isTable:false, hiddenInMain:true, sort: 'custom', table: { width: 150 }, form: { component: 'InputNumber', } }, { label: '包装规格', field: 'packUnit', sortTableDefault:1004, // dictType: DICT_TYPE.PACK_UNIT, // dictClass: 'string', isTable: true, sort: 'custom', table: { width: 150 }, }, { label: '品番', field: 'itemCode', sort: 'custom', table: { width: 150 }, sortTableDefault:2 }, { label: '品名', field: 'itemName', sort: 'custom', table: { width: 150 }, sortTableDefault:4 }, { label: '背番', field: 'itemDesc1', sort: 'custom', isSearch:true, table: { width: 150 }, isTableForm: false, isForm: false, tableForm: { disabled: true }, form: { componentProps: { disabled: true } }, sortTableDefault:3 }, // { // label: '背番', // field: 'itemDesc1', // isTable:false, // hiddenInMain:true, // sort: 'custom', // table: { // width: 150 // }, // }, { label: '描述', field: 'itemDesc2', isTable:false, hiddenInMain:true, sort: 'custom', table: { width: 150 }, }, { label: '项目代码', field: 'projectCode', isTable:false, hiddenInMain:true, sort: 'custom', table: { width: 150 }, }, { label: '数量', field: 'qty', sort: 'custom', table: { width: 150 }, form: { component: 'InputNumber', } ,sortTableDefault:5 }, { label: '计量单位', field: 'uom', dictType: DICT_TYPE.UOM, sortTableDefault:1006, dictClass: 'string', isTable: true, sort: 'custom', table: { width: 150 }, }, { label: '单据号', field: 'number', isTable:false, hiddenInMain:true, sort: 'custom', table: { width: 180 }, }, { label: '备注', field: 'remark', isTable:false, hiddenInMain:true, sort: 'custom', table: { width: 150 }, }, { label: '创建者', field: 'creator', sort: 'custom', table: { width: 150 }, sortTableDefault:6 }, { label: '创建时间', field: 'createTime', sortTableDefault:1010, 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', } }, }, { label: '到货主代码', field: 'toOwnerCode', isTable:false, hiddenInMain:true, sort: 'custom', table: { width: 150 }, }, // { // label: '操作', // hiddenInMain:true, // field: 'action', // isDetail: false, // isForm: false , // table: { // width: 150, // fixed: 'right' // }, // isTableForm:false, // } ])) //表单校验 export const ProductreceiptJobDetailRules = reactive({ productionLineCode: [ { required: true, message: '请选择生产线代码', trigger: 'change' } ], packingNumber: [ { required: true, message: '请选择包装号', trigger: 'change' } ], batch: [ { required: true, message: '请输入批次', trigger: 'blur' } ], produceDate: [ { required: true, message: '请输入生产日期', trigger: 'change' } ], expireDate: [ { required: true, message: '请输入过期日期', trigger: 'change' } ], inventoryStatus: [ { required: true, message: '请选择库存状态', trigger: 'change' } ], woNumber: [ { required: true, message: '请选择订单号', trigger: 'change' } ], woLine: [ { required: true, message: '请输入订单行', trigger: 'blur' } ], packQty: [ { required: true, message: '请输入包装数量', trigger: 'blur' } ], packUnit: [ { 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' } ], })