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.
 
 
 

271 lines
6.2 KiB

import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import {Owner} from "@/views/wms/basicDataManage/orderManage/owner/owner.data";
import * as OwnerApi from "@/api/wms/owner";
import {Warehouse} from "@/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data";
import * as WarehouseApi from "@/api/wms/warehouse";
import {Balance} from "@/views/wms/inventoryManage/balance/balance.data";
import * as BalanceApi from "@/api/wms/balance";
// 表单校验
export const ContainerMainRules = reactive({
type: [
{ required: true, message: '请选择类型', trigger: 'change' }
],
status: [
{ required: true, message: '请选择状态', trigger: 'change' }
]
})
export const ContainerMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
},
{
label: '类型',
field: 'type',
dictType: DICT_TYPE.CONTAINER_TYPE,
dictClass: 'string',
isTable: true,
isForm: true,
sort: 'custom',
isSearch: true,
},
{
label: '总容量',
field: 'capacity',
sort: 'custom',
form: {
component: 'InputNumber',
},
isSearch: true,
},
{
label: '器具状态',
field: 'containerStatus',
dictType: DICT_TYPE.CONTAINER_STATUS,
dictClass: 'string',
isTable: true,
isForm: true,
sort: 'custom',
isSearch: true,
},
{
label: '货主代码',
field: 'ownerCode',
sort: 'custom',
table: {
width: 150
},
tableForm:{
isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择货主代码',
searchField: 'code',
searchTitle: '货主信息',
searchAllSchemas: Owner.allSchemas,
searchPage: OwnerApi.getOwnerPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择货主代码',
searchField: 'code',
searchTitle: '货主信息',
searchAllSchemas: Owner.allSchemas,
searchPage: OwnerApi.getOwnerPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '仓库代码',
field: 'warehouseCode',
sort: 'custom',
table: {
width: 150
},
isSearch: true,
tableForm:{
isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择仓库代码',
searchField: 'code',
searchTitle: '仓库信息',
searchAllSchemas: Warehouse.allSchemas,
searchPage: WarehouseApi.getWarehousePage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择仓库代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '仓库信息', // 查询弹窗标题
searchAllSchemas: Warehouse.allSchemas, // 查询弹窗所需类
searchPage: WarehouseApi.getWarehousePage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 300,
fixed: 'right'
},
}
]))
/**
* @returns {Array} 器具子表
*/
export const ContainerDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '内容物类型',
field: 'containerContentType',
dictType: DICT_TYPE.CONTAINER_CONTENT_TYPE,
dictClass: 'string',
isTable: true,
isForm: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '内容物号',
field: 'contentNumber',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled:true,
isInpuFocusShow: true,
earchListPlaceholder: '请选择包装号',
searchField: 'packingNumber',
searchTitle: '库存余额信息',
searchAllSchemas: Balance.allSchemas,
searchPage: BalanceApi.getBalancePage,
searchCondition:[{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'workshopCode',
value: 'workshopCode',
isMainValue: true
}]
},
form:{
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择包装号',
searchField: 'packingNumber',
searchTitle: '库存余额信息',
searchAllSchemas: Balance.allSchemas,
searchPage: BalanceApi.getBalancePage,
searchCondition: [{
key: 'warehouseCode',
value: 'fromWarehouseCode',
isMainValue: true,
}]
}
}
},
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 150
},
},
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
isForm: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
isForm: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false ,
table: {
width: 150,
fixed: 'right'
},
isTableForm:false,
}
]))
// 表单校验
export const ContainerDetailRules = reactive({
containerContentType: [
{ required: true, message: '请选择内容物类型', trigger: 'change' }
],
})