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.

427 lines
7.6 KiB

1 year ago
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter,dateFormatter2 } from '@/utils/formatTime'
/**
* @returns {Array}
*/
export const Transaction = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '事务号',
field: 'number',
sort: 'custom',
table: {
width: 180
},
},
{
label: '事务类型',
field: 'transactionType',
sort: 'custom',
table: {
width: 150
},
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
table: {
width: 150
},
},
{
9 months ago
label: '业务记录号',
1 year ago
field: 'recordNumber',
sort: 'custom',
isTable: true,
isSearch: true,
1 year ago
table: {
width: 180
1 year ago
},
},
{
9 months ago
label: '操作时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
1 year ago
},
sort: 'custom',
table: {
9 months ago
width: 180
1 year ago
},
form: {
9 months ago
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isForm: false
1 year ago
},
{
9 months ago
label: '操作人',
field: 'worker',
1 year ago
sort: 'custom',
table: {
width: 150
},
},
{
9 months ago
label: '库存动作',
field: 'inventoryAction',
dictType: DICT_TYPE.INVENTORY_ACTION,
1 year ago
dictClass: 'string',
isTable: true,
9 months ago
isSearch: true,
1 year ago
sort: 'custom',
table: {
width: 150
},
},
{
9 months ago
label: '库位代码',
field: 'locationCode',
1 year ago
sort: 'custom',
table: {
width: 150
},
},
{
9 months ago
label: '物料代码',
field: 'itemCode',
1 year ago
sort: 'custom',
table: {
width: 150
},
9 months ago
isSearch: true,
1 year ago
},
{
9 months ago
label: '数量',
field: 'qty',
1 year ago
sort: 'custom',
table: {
width: 150
},
9 months ago
form: {
component: 'InputNumber',
}
1 year ago
},
{
9 months ago
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
1 year ago
sort: 'custom',
table: {
width: 150
},
},
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 150
},
isSearch: true,
},
{
9 months ago
label: '包装号',
field: 'packingNumber',
1 year ago
sort: 'custom',
table: {
width: 150
},
},
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
isSearch: true,
sort: 'custom',
table: {
width: 150
},
},
{
9 months ago
label: '包装规格',
field: 'packUnit',
1 year ago
sort: 'custom',
table: {
width: 150
},
},
{
9 months ago
label: '包装数量',
field: 'packQty',
1 year ago
sort: 'custom',
table: {
width: 150
},
},
{
label: '库位组代码',
field: 'locationGroupCode',
sort: 'custom',
table: {
width: 150
},
},
{
9 months ago
label: '库区类型',
field: 'areaType',
sort: 'custom',
dictType: DICT_TYPE.AREA_TYPE,
1 year ago
dictClass: 'string',
isTable: true,
table: {
width: 150
},
},
{
9 months ago
label: '仓库代码',
field: 'warehouseCode',
1 year ago
sort: 'custom',
table: {
width: 150
},
},
{
label: '到货日期',
field: 'arriveDate',
isTable: true,
formatter: dateFormatter2,
detail: {
dateFormat: 'YYYY-MM-DD'
},
sort: 'custom',
table: {
width: 150
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
}
},
},
{
label: '生产日期',
field: 'produceDate',
isTable: true,
formatter: dateFormatter2,
detail: {
dateFormat: 'YYYY-MM-DD'
},
sort: 'custom',
table: {
width: 150
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
}
},
},
{
label: '生效时间',
field: 'activeTime',
isTable: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 150
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
}
}
},
{
label: '失效日期',
field: 'expireDate',
isTable: true,
formatter: dateFormatter2,
detail: {
dateFormat: 'YYYY-MM-DD'
},
sort: 'custom',
table: {
width: 150
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
}
},
},
{
label: '货主代码',
field: 'ownerCode',
sort: 'custom',
table: {
width: 150
},
},
9 months ago
// {
// label: '单价',
// field: 'singlePrice',
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '金额',
// field: 'amount',
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '器具号',
// field: 'containerNumber',
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '库区代码',
// field: 'areaCode',
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: 'ERP库位代码',
// field: 'erpLocationCode',
// dictType: DICT_TYPE.ERP_LOCATION,
// dictClass: 'string',
// isTable: true,
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '替代批次',
// field: 'altBatch',
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '创建者',
// field: 'creator',
// sort: 'custom',
// table: {
// width: 150
// },
// isForm: false
// },
// {
// label: '最后更新时间',
// field: 'updateTime',
// formatter: dateFormatter,
// detail: {
// dateFormat: 'YYYY-MM-DD HH:mm:ss'
// },
// sort: 'custom',
// table: {
// width: 180
// },
// form: {
// component: 'DatePicker',
// componentProps: {
// style: {width:'100%'},
// type: 'datetime',
// dateFormat: 'YYYY-MM-DD HH:mm:ss',
// valueFormat: 'x',
// }
// },
// isForm: false,
// isTable: false
// },
// {
// label: '最后更新者',
// field: 'updater',
// sort: 'custom',
// table: {
// width: 150
// },
// isForm: false,
// isTable: false
// },
1 year ago
]))
// 表单校验
export const TransactionRules = reactive({
number: [
{ required: true, message: '请输入事务号', trigger: 'blur' }
],
transactionType: [
{ required: true, message: '请选择事务类型', trigger: 'change' }
],
inventoryAction: [
{ required: true, message: '请选择库存动作', trigger: 'change' }
],
worker: [
{ required: true, message: '请选择操作员', trigger: 'change' }
],
businessType: [
{ required: true, message: '请选择业务类型', trigger: 'change' }
],
recordNumber: [
{ required: true, message: '请选择记录号', trigger: 'change' }
],
activeTime: [
{ required: true, message: '请选择生效时间', trigger: 'change' }
],
itemCode: [
{ required: true, message: '请选择物料代码', trigger: 'change' }
],
batch: [
{ required: true, message: '请输入批次', trigger: 'blur' }
],
inventoryStatus: [
{ required: true, message: '请选择库存状态', trigger: 'change' }
],
})