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.
 
 
 

342 lines
8.0 KiB

import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as LocationApi from '@/api/dbc/location'
import { Location } from '@/views/dbc/location/location.data'
import * as BalanceApi from '@/api/wms/balanceDifference'
import { Balance } from '@/views/wms/inventoryManage/balance/balance.data'
// 表单校验
export const DifferenceRequestMainRules = reactive({
// toLocationCode: [required]
})
export const DifferenceRequestMain = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
table: {
width: 200,
// fixed: 'right'
}
},
{
label: '状态',
field: 'status',
dictType: DICT_TYPE.REQUEST_STATUS,
dictClass: 'string',
sort: 'custom',
isSearch: true,
isForm: false,
table: {
width: 100,
// fixed: 'right'
}
},
// {
// label: '到库位代码',
// field: 'toLocationCode',
// sort: 'custom',
// table: {
// width: 150
// },
// // isSearch: true,
// isForm: false,
// isTable: false,
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// enterSearch: false,
// isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择到库位代码', // 输入框占位文本
// searchField: 'code', // 查询弹窗赋值字段
// searchTitle: '到库位代码', // 查询弹窗标题
// searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
// searchPage: LocationApi.selectBusinessTypeOutLocation, // 查询弹窗所需分页方法
// searchCondition: [
// {
// key: 'businessType',
// value: 'CustomerReject',
// isMainValue: false
// },
// {
// key: 'isIn',
// value: 'in',
// isMainValue: false
// }
// ],
// verificationParams: [
// {
// key: 'code',
// action: '==',
// value: '',
// isMainValue: false,
// isSearch: true,
// isFormModel: true
// }
// ] // 失去焦点校验参数
// }
// }
// },
])
)
// 表单校验
export const DifferenceRequestDetailRules = reactive({
itemCode: [required]
})
export const DifferenceRequestDetail = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
tableForm: {
multiple: true, //多选
disabled: true,
isInpuFocusShow: false, // 开启查询弹窗
searchListPlaceholder: '请输入包装号',
searchField: 'itemCode',
searchTitle: '库存余额信息',
searchAllSchemas: Balance.allSchemas,
searchPage: BalanceApi.getBalanceItemPage,
searchCondition: [
{
key: 'available',
value: 'TRUE',
action: '==',
isSearch: true,
isMainValue: false
},
{
key: 'businessType',
value: 'UnplannedDeliver',
action: '==',
isSearch: true,
isMainValue: false
},
{
key: 'inOrOut',
value: 'out',
action: '==',
isSearch: true,
isMainValue: false
},
{
key: 'locationCode',
value: 'DIFF',
action: '==',
isSearch: true,
isMainValue: false
}
]
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请输入包装号',
searchField: 'packingNumber',
searchTitle: '库存余额信息',
searchAllSchemas: Balance.allSchemas,
searchPage: BalanceApi.getBalanceItemPage,
searchCondition: [
{
key: 'available',
value: 'TRUE',
action: '==',
isSearch: true,
isMainValue: false
},
{
key: 'businessType',
value: 'UnplannedDeliver',
action: '==',
isSearch: true,
isMainValue: false
},
{
key: 'inOrOut',
value: 'out',
action: '==',
isSearch: true,
isMainValue: false
},{
key: 'locationCode',
value: 'DIFF',
action: '==',
isSearch: true,
isMainValue: false
}
]
}
}
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
tableForm: {
disabled: true
}
},
{
label: '物料描述1',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true
}
},
{
label: '物料描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
tableForm: {
disabled: true
}
},
// {
// label: '物料类型',
// dictType: DICT_TYPE.ITEM_TYPE,
// field: 'itemType',
// // hiddenInMain: true,
// // isSearch: true,
// // tableForm: {
// // type: 'Select',
// // disabled: true
// // },
// width: 100
// },
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
type: 'Select',
disabled: true
}
},
{
label: '出库数量',
field: 'requestQty',
sort: 'custom',
tableForm: {
type: 'InputNumber',
componentProps: {
min: 0,
precision: 2
}
}
},
{
label: '批次',
field: 'batch',
sort: 'custom',
isSearch: true,
tableForm: {
disabled: true
}
},
{
label: '包装号',
field: 'packingNumber',
sort: 'custom',
// isSearch: true,
tableForm: {
disabled: true
}
},
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
sort: 'custom',
// isSearch: true,
tableForm: {
type: 'Select',
disabled: true
}
},
{
label: '从库位代码',
field: 'fromLocationCode',
sort: 'custom',
// isSearch: true
isTableForm: false,
tableForm: {
disabled: true
}
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
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')]
}
},
isTableForm: false,
isForm: false,
tableForm: {
disabled: true
}
},
{
label: '创建人',
field: 'creator',
isForm: false,
isDetail: false,
isTableForm: false,
tableForm: {
disabled: true
}
},
{
label: '操作',
field: 'action',
isForm: false,
isDetail: false,
table: {
width: 200,
fixed: 'right'
},
isTableForm: false,
tableForm: {
disabled: true
}
}
])
)