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.

693 lines
16 KiB

1 year 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 {Warehouse} from "@/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data";
import * as WarehouseApi from "@/api/wms/warehouse";
import {Dock} from "@/views/wms/basicDataManage/factoryModeling/dock/dock.data";
import * as DockApi from "@/api/wms/dock";
import {Packageunit} from "@/views/wms/basicDataManage/itemManage/packageunit/packageunit.data";
import * as PackageunitApi from "@/api/wms/packageunit";
import {Location} from "@/views/wms/basicDataManage/factoryModeling/location/location.data";
import * as LocationApi from "@/api/wms/location";
import {Supplier} from "@/views/wms/basicDataManage/supplierManage/supplier/supplier.data";
import * as SupplierApi from "@/api/wms/supplier";
import {Itempackaging} from "@/views/wms/basicDataManage/itemManage/itempackage/itempackage.data";
import * as ItempackagingApi from "@/api/wms/itempackage";
import * as SupplieritemApi from "@/api/wms/supplieritem";
9 months ago
import { formatTime } from '@/utils/index'
import {
Supplieritem
} from "@/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data";
1 year ago
// 表单校验
export const PackageRules = reactive({
// number: [required],
1 year ago
itemCode: [required],
itemName: [required],
packUnit: [required],
packQty: [required],
1 year ago
})
export const Package = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '包装号',
field: 'number',
sort: 'custom',
isSearch: true,
table: {
width: 180,
fixed: 'left'
},
isForm:false
1 year ago
},
// {
// label: '父包装号',
// field: 'parentNumber',
// sort: 'custom',
// isSearch: true,
// table: {
// width: 180,
// },
// },
1 year ago
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '物料基础信息', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
}
1 year ago
},
isSearch: true
1 year ago
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '物料描述1',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150,
},
form: {
componentProps: {
disabled: true
}
},
1 year ago
},
{
label: '物料描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150,
},
form: {
componentProps: {
disabled: true
}
},
1 year ago
},
{
label: '批次',
field: 'batch',
sort: 'custom',
isSearch: true,
9 months ago
form:{
value: formatTime(new Date(), 'yyyyMMdd')
},
1 year ago
table: {
width: 150,
},
},
// {
// label: '替代批次',
// field: 'altBatch',
// sort: 'custom',
// table: {
// width: 150,
// },
// },
// {
// label: '器具号',
// field: 'containerNumber',
// sort: 'custom',
// table: {
// width: 150,
// },
// },
1 year ago
{
label: '生产日期',
field: 'produceDate',
sort: 'custom',
formatter: dateFormatter2,
detail: {
dateFormat : 'YYYY-MM-DD'
},
1 year ago
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')]
}
},
form: {
component: 'DatePicker',
9 months ago
value: formatTime(new Date(), 'yyyy-MM-dd'),
1 year ago
componentProps: {
style: {width: '100%'},
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
}
},
table: {
width: 180,
},
},
{
label: '有效期(日)',
field: 'validityDays',
sort: 'custom',
form: {
component: 'InputNumber',
componentProps: {
min: 0
},
value: 0
},
table: {
width: 150,
},
},
{
label: '失效日期',
field: 'expireDate',
sort: 'custom',
formatter: dateFormatter2,
detail: {
dateFormat : 'YYYY-MM-DD'
},
1 year ago
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
}
},
table: {
width: 180,
},
},
{
label: '计量单位',
field: 'uom',
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
component: 'SelectV2',
componentProps: {
disabled: true
}
1 year ago
},
table: {
width: 150,
},
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '替代计量单位',
field: 'altUom',
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
component: 'SelectV2',
componentProps: {
disabled: true
}
1 year ago
},
table: {
width: 150,
},
},
{
label: '替代数量',
field: 'altQty',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '转换率',
field: 'convertRate',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '包装规格',
field: 'packUnit',
sort: 'custom',
// dictType: DICT_TYPE.PACK_UNIT,
// dictClass: 'string', // 默认都是字符串类型其他暂不考虑
// form: {
// component: 'SelectV2'
// },
table: {
width: 150,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch:true,
isSearch:true,
isSearchList: true, // 开启查询弹窗
9 months ago
searchListPlaceholder: '请选择物料代码',
searchField: 'packUnit',
searchTitle: '物料包装信息',
searchAllSchemas: Itempackaging.allSchemas,
searchPage: ItempackagingApi.getItempackagingPageTree,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
9 months ago
key:'itemCode', // 查询列表中字段
value:'itemCode', // 指主表某字段
message: '请选择物料代码!', // 当前置条件为空时 弹出信息提示
isMainValue: true, // 表示查询条件是主表的字段的值
action: '==', // 查询拼接条件
}],
verificationParams: [{
key: 'packUnit',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
9 months ago
}
}
},
{
label: '包装数量',
field: 'packQty',
sort: 'custom',
table: {
width: 150,
},
form: {
componentProps: {
disabled: true
}
},
1 year ago
},
9 months ago
// {
// label: '仓库代码',
// field: 'toWarehouseCode',
// sort: 'custom',
// table: {
// width: 150,
// },
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// enterSearch:true,
// isSearch:true,
// isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择仓库代码', // 输入框占位文本
// searchField: 'code', // 查询弹窗赋值字段
// searchTitle: '仓库信息', // 查询弹窗标题
// searchAllSchemas: Warehouse.allSchemas, // 查询弹窗所需类
// searchPage: WarehouseApi.getWarehousePage, // 查询弹窗所需分页方法
// searchCondition: [{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// }]
// }
// }
// },
// {
// label: '月台代码',
// field: 'toDockCode',
// sort: 'custom',
// table: {
// width: 150,
// },
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// enterSearch: true,
// isSearchList: true,
// searchListPlaceholder: '请选择月台代码',
// searchField: 'code',
// searchTitle: '客户月台',
// searchAllSchemas: Dock.allSchemas,
// searchPage: DockApi.getDockPage,
// searchCondition: [{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// }],
// }
// }
// },
// {
// label: '库位代码',
// field: 'toLocationCode',
// sort: 'custom',
// table: {
// width: 150,
// },
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// enterSearch: true,
// isSearchList: true,
// searchListPlaceholder: '请选择库位代码',
// searchField: 'code',
// searchTitle: '库位信息',
// searchAllSchemas: Location.allSchemas,
// searchPage: LocationApi.getLocationPage,
// searchCondition: [{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// },{
// key: 'warehouseCode',
// value: 'toWarehouseCode',
// message: '请填写仓库代码!',
// isMainValue: true
// }],
// }
// }
// },
1 year ago
{
9 months ago
label: '供应商代码',
field: 'supplierCode',
1 year ago
sort: 'custom',
table: {
width: 150,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch:true,
9 months ago
isInpuFocusShow: true,
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'supplierCode', // 查询弹窗赋值字段
searchTitle: '供应商物料信息',
isSearchList: true, // 开启查询弹窗
9 months ago
searchAllSchemas: Supplieritem.allSchemas, // 查询弹窗所需类
searchPage: SupplieritemApi.getSupplieritemPage, // 查询弹窗所需分页方法
searchCondition:[{
key: 'itemCode',
value: 'itemCode',
message: '请填写物料代码!',
isMainValue: true
}],
verificationParams: [
{
9 months ago
key: 'supplierCode',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true
}
] // 失去焦点校验参数
9 months ago
}
}
1 year ago
},
{
label: '供应商物料代码',
field: 'supplierItemCode',
sort: 'custom',
table: {
width: 150,
},
form: {
componentProps: {
9 months ago
disabled: true
// enterSearch: true,
// isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择供应商物料', // 输入框占位文本
// searchField: 'supplierItemCode', // 查询弹窗赋值字段
// searchTitle: '供应商信息', // 查询弹窗标题
// searchAllSchemas: Supplieritem.allSchemas, // 查询弹窗所需类
// searchPage: SupplieritemApi.getSupplieritemPage, // 查询弹窗所需分页方法
// searchCondition: [
// {
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// },{
// key: 'supplierCode',
// value: 'supplierCode',
// message: '请填写物料代码!',
// isMainValue: true
// }
// ],
// verificationParams: [
// {
// key: 'code',
// action: '==',
// value: '',
// isMainValue: false,
// isSearch: true,
// isFormModel: true
// }
// ] // 失去焦点校验参数
}
}
1 year ago
},
// {
// label: '采购订单号',
// field: 'poNumber',
// sort: 'custom',
// table: {
// width: 150,
// },
// },
// {
// label: '采购订单行',
// field: 'poLine',
// sort: 'custom',
// table: {
// width: 150,
// },
// },
// {
// label: '采购计划单号',
// field: 'rpNumber',
// sort: 'custom',
// table: {
// width: 150,
// },
// },
// {
// label: '发货单号',
// field: 'asnNumber',
// sort: 'custom',
// table: {
// width: 182,
// },
// },
// {
// label: '生产订单号',
// field: 'woNumber',
// sort: 'custom',
// table: {
// width: 150,
// },
// },
// {
// label: '生产订单行',
// field: 'woLine',
// sort: 'custom',
// table: {
// width: 150,
// },
// },
// {
// label: '生产线代码',
// field: 'productionLineCode',
// sort: 'custom',
// table: {
// width: 150,
// },
// },
// {
// label: '班组代码',
// field: 'teamCode',
// sort: 'custom',
// table: {
// width: 150,
// },
// },
// {
// label: '班次代码',
// field: 'shiftCode',
// sort: 'custom',
// table: {
// width: 150,
// },
// },
// {
// label: '客户代码',
// field: 'customerCode',
// sort: 'custom',
// table: {
// width: 150,
// },
// },
// {
// label: '客户月台代码',
// field: 'customerDockCode',
// sort: 'custom',
// table: {
// width: 150,
// },
// },
// {
// label: '客户物料代码',
// field: 'customerItemCode',
// sort: 'custom',
// table: {
// width: 150,
// },
// },
// {
// label: '销售订单号',
// field: 'soNumber',
// sort: 'custom',
// table: {
// width: 150,
// },
// },
// {
// label: '销售订单行',
// field: 'soLine',
// sort: 'custom',
// table: {
// width: 150,
// },
// },
// {
// label: '质量等级',
// field: 'eqLevel',
// sort: 'custom',
// table: {
// width: 150,
// },
// },
// {
// label: '货主代码',
// field: 'ownerCode',
// sort: 'custom',
// table: {
// width: 150,
// },
// },
// {
// label: '重量',
// field: 'weight',
// sort: 'custom',
// table: {
// width: 150,
// },
// },
// {
// label: '面积',
// field: 'area',
// sort: 'custom',
// table: {
// width: 150,
// },
// },
// {
// label: '体积',
// field: 'volume',
// sort: 'custom',
// table: {
// width: 150,
// },
// },
{
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
},
1 year ago
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 120,
1 year ago
fixed: 'right'
}
}
]))