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.

633 lines
13 KiB

12 months ago
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter,dateFormatter2 } from '@/utils/formatTime'
import { Itembasic } from "@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data";
import * as ItembasicApi from "@/api/wms/itembasic";
import { Productionline } from "@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data";
import * as ProductionlineApi from "@/api/wms/productionline";
import { Shift } from "@/views/wms/basicDataManage/orderManage/shift/shift.data";
import * as ShiftApi from "@/api/wms/shift";
import { Team } from "@/views/wms/basicDataManage/orderManage/team/team.data";
import * as TeamApi from "@/api/wms/team";
// 表单校验
export const PackageRules = reactive({
number: [required],
itemCode: [required],
itemName: [required],
})
export const Package = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '标签号',
field: 'number',
sort: 'custom',
isSearch: true,
table: {
fixed: 'left'
}
},
{
label: '标签类型',
field: 'type',
sort: 'custom',
isSearch: false,
12 months ago
dictType: DICT_TYPE.LABEL_TYPE,
dictClass: 'string'
},
{
label: '标签模板',
field: 'template',
sort: 'custom',
},
{
label: '标签状态',
field: 'status',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.LABEL_STATUS,
dictClass: 'string'
},
{
label: '关联号',
field: 'relateNumber',
sort: 'custom',
isSearch:true
12 months ago
},
{
label: '标签条码字符串',
field: 'barcodeString',
sort: 'custom',
table: {
width: 180,
}
},
{
label: '打印次数',
field: 'printTimes',
sort: 'custom',
form: {
component: 'InputNumber',
componentProps: {
min: 0
},
value: 0
},
},
{
label: '最后打印时间',
field: 'lastPrintTime',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '最后打印人ID',
field: 'lastPrintUserId',
sort: 'custom'
},
{
label: '最后打印人用户名',
field: 'lastPrintUserName',
sort: 'custom',
table: {
width: 180,
}
},
{
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: 'createTime',
isForm: false,
table: {
width: 180
},
formatter: dateFormatter,
detail: {
dateFormat : 'YYYY-MM-DD HH:mm:ss'
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
}
},
{
label: '创建者',
field: 'creator',
table: {
width: 130
},
isForm: false,
isTable: true
},
{
label: '最后更新时间',
field: 'updateTime',
sort: 'custom',
isDetail: true,
isForm: false,
isTable: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
}
},
{
label: '最后更新者',
field: 'updater',
isDetail: true,
isForm: false,
isTable: true,
table: {
width: 150
}
},
12 months ago
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
export const PackageInventory = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
isSearch: true,
table: {
width: 150,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
9 months ago
enterSearch: true,
12 months ago
isSearchList: true,
searchListPlaceholder: '请选择物料代码',
searchField: 'code',
searchTitle: '物料信息',
searchAllSchemas: Itembasic.allSchemas,
searchPage: ItembasicApi.getItembasicPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
8 months ago
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
12 months ago
}
}
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150,
},
isForm:false
},
{
label: '物料描述1',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150,
},
isForm:false
},
{
label: '物料描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150,
},
isForm:false
},
{
label: '批次',
field: 'batch',
sort: 'custom',
isSearch: true,
table: {
width: 150,
},
},
// {
// label: '替代批次',
// field: 'altBatch',
// sort: 'custom',
// table: {
// width: 150,
// },
// },
12 months ago
{
label: '生产日期',
field: 'produceDate',
sort: 'custom',
formatter: dateFormatter2,
search: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
valueFormat: 'YYYY-MM-DD',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')],
disabled: true
}
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
disabled: true
}
},
table: {
width: 180,
},
},
{
label: '有效期(日)',
field: 'validityDays',
sort: 'custom',
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 0,
disabled: true
},
value: 0
},
table: {
width: 150,
},
},
{
label: '失效日期',
field: 'expireDate',
sort: 'custom',
formatter: dateFormatter,
search: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')],
disabled: true
}
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
disabled: true
}
},
table: {
width: 180,
},
},
{
label: '计量单位',
field: 'uom',
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
component: 'Select'
},
table: {
width: 150,
},
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150,
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 6
},
value: 0
},
},
{
label: '替代计量单位',
field: 'altUom',
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
component: 'Select'
},
table: {
width: 150,
},
},
{
label: '替代数量',
field: 'altQty',
sort: 'custom',
table: {
width: 150,
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 6
},
value: 0
},
},
{
label: '转换率',
field: 'convertRate',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '包装数量',
field: 'packQty',
sort: 'custom',
table: {
width: 150,
},
form: {
componentProps:{
disabled: true
}
},
tableForm: {
disabled: true
}
},
{
label: '包装规格',
field: 'packUnit',
sort: 'custom',
// dictType: DICT_TYPE.PACK_UNIT,
// dictClass: 'string', // 默认都是字符串类型其他暂不考虑
table: {
width: 150,
},
form: {
component: 'Select',
componentProps:{
disabled: true
}
},
tableForm: {
disabled: true
}
},
// {
// label: '生产订单号',
// field: 'woNumber',
// sort: 'custom',
// table: {
// width: 150,
// },
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// isSearchList: true,
// searchListPlaceholder: '请选择物料代码',
// searchField: 'code',
// searchTitle: '物料信息',
// searchAllSchemas: Itembasic.allSchemas,
// searchPage: ItembasicApi.getItembasicPage,
// searchCondition: [{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// }]
// }
// }
// },
// {
// label: '生产订单行',
// field: 'woLine',
// sort: 'custom',
// table: {
// width: 150,
// },
// },
{
label: '生产线代码',
field: 'productionLineCodePackage',
sort: 'custom',
table: {
width: 150,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
9 months ago
enterSearch: true,
12 months ago
isSearchList: true,
searchListPlaceholder: '请选择生产线代码',
searchField: 'code',
searchTitle: '生产线信息',
searchAllSchemas: Productionline.allSchemas,
searchPage: ProductionlineApi.getProductionlinePage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
8 months ago
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
12 months ago
}
}
},
{
label: '班组代码',
field: 'teamCode',
sort: 'custom',
table: {
width: 150,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
9 months ago
enterSearch: true,
12 months ago
isSearchList: true,
searchListPlaceholder: '请选择生产线代码',
searchField: 'code',
searchTitle: '生产线信息',
searchAllSchemas: Team.allSchemas,
searchPage: TeamApi.getTeamPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
8 months ago
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
12 months ago
}
}
},
{
label: '班次代码',
field: 'shiftCode',
sort: 'custom',
table: {
width: 150,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
9 months ago
enterSearch: true,
12 months ago
isSearchList: true,
searchListPlaceholder: '请选择生产线代码',
searchField: 'code',
searchTitle: '生产线信息',
searchAllSchemas: Shift.allSchemas,
searchPage: ShiftApi.getShiftPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
8 months ago
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
12 months ago
}
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
//表单校验
export const PackageRulesInventor = reactive({
itemCode: [
{ required: true, message: '请选择物料代码', trigger: 'change' }
],
batch: [
{ required: true, message: '请输入批次', trigger: 'blur' }
],
produceDate: [
{ required: true, message: '请选择生产日期', trigger: 'change' }
],
validityDays: [
{ required: true, message: '请输入有效期(日)', trigger: 'blur' }
],
expireDate: [
{ required: true, message: '请选择失效日期', trigger: 'change' }
],
uom: [
{ required: true, message: '请选择计量单位', trigger: 'change' }
],
qty: [
{ required: true, message: '请输入数量', trigger: 'blur' }
],
woNumber: [
{ required: true, message: '请选择生产订单号', trigger: 'change' }
],
woLine: [
{ required: true, message: '请选择生产订单行', trigger: 'change' }
],
productionLineCodePackage: [
{ required: true, message: '请选择生产线代码', trigger: 'change' }
],
})