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.

297 lines
5.2 KiB

import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const UnfinishedShipmentMainRules = reactive({
orderNumber: [required],
shipmentRecordNumber: [required],
shipmentType: [required],
customerOrderNumber: [required],
available: [required],
concurrencyStamp: [required]
})
export const UnfinishedShipmentMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 150,
},
isSearch: true
},
{
label: '发货记录单号',
field: 'shipmentRecordNumber',
sort: 'custom',
table: {
width: 150,
},
isSearch: true
},
{
label: '发货类型',
field: 'shipmentType',
sort: 'custom',
table: {
width: 150,
},
dictType: DICT_TYPE.DELIVER_METHOD,
dictClass: 'string',
form: {
component: 'SelectV2'
}
},
{
label: '客户订单号',
field: 'customerOrderNumber',
sort: 'custom',
table: {
width: 150,
},
isSearch: true
},
5 months ago
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
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')]
}
},
detail: {
dateFormat : 'YYYY-MM-DD HH:mm:ss'
},
isTable:true,
isForm: false,
table:{
width:180
},
sortTableDefault:10000
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
isDetail: true,
isForm: false,
isTable: true,
sortTableDefault: 10000
},
{
label: '最后更新时间',
field: 'updateTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: false,
form: {
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
},
isForm: false
},
{
label: '最后更新者',
field: 'updater',
sort: 'custom',
table: {
width: 150
},
isTable: false,
isForm: false
},
{
label: '操作',
field: 'action',
isForm: false,
isDetail: false,
isTable: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
// 表单校验
export const UnfinishedShipmentDetailRules = reactive({
materialCode: [required],
materialName: [required],
backNumber: [required],
materialDescription: [required],
shipmentQuantity: [required],
unitPrice: [required],
lockedQuantity: [required],
available: [required],
concurrencyStamp: [required]
})
export const UnfinishedShipmentDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
isSearch: true
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150
},
isSearch: true
},
{
label: '背番',
field: 'backNumber',
sort: 'custom',
table: {
width: 150,
},
},
// {
// label: '物料描述',
// field: 'itemDescription',
// sort: 'custom',
// table: {
// width: 150,
// },
// form: {
// component: 'Editor',
// componentProps: {
// valueHtml: '',
// height: 200
// }
// }
// },
5 months ago
{
label: '库位',
field: 'toLocationCode',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '发货数量',
field: 'shipmentQuantity',
sort: 'custom',
table: {
width: 150,
},
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '锁定数量',
field: 'lockedQuantity',
sort: 'custom',
table: {
width: 150,
},
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '已结数量',
field: 'finishdQuantity',
sort: 'custom',
table: {
width: 150,
},
isTableForm:false,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '销售单价',
field: 'unitPrice',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
table: {
width: 150
},
formatter: dateFormatter,
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')]
}
},
isForm: false,
hiddenInMain:true
},
{
label: '创建人',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
isTable: true,
hiddenInMain:true
},
// {
// label: '操作',
// field: 'action',
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
// }
]))