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.

659 lines
15 KiB

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 { 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 { PurchaseMain } from "@/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/purchaseMain.data";
import * as PurchaseMainApi from "@/api/wms/purchaseMain";
import { PurchaseDetail } from "@/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/purchaseMain.data";
import * as PurchaseDetailApi from "@/api/wms/purchaseDetail";
import { PurchasePlanMain } from "@/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data";
import * as PurchasePlanMainApi from "@/api/wms/purchasePlanMain";
import { SupplierdeliverRecordMain } from "@/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/supplierdeliverRecordMain.data";
import * as SupplierdeliverRecordMainApi from "@/api/wms/supplierdeliverRecordMain";
// 表单校验
export const PackageRules = reactive({
number: [required],
itemCode: [required],
itemName: [required],
})
export const Package = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '标签号',
field: 'number',
sort: 'custom',
isSearch: true,
table: {
fixed: 'left'
}
},
{
label: '标签类型',
field: 'type',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.LABEL_TYPE,
dictClass: 'string'
},
{
label: '标签模板',
field: 'template',
sort: 'custom',
},
{
label: '标签状态',
field: 'status',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.LABEL_STATUS,
dictClass: 'string'
},
{
label: '关联号',
field: 'relateNumber',
sort: 'custom',
},
{
label: '标签条码字符串',
field: 'barcodeString',
sort: 'custom',
table: {
width: 180,
}
},
{
label: '打印次数',
field: 'printTimes',
sort: 'custom',
form: {
component: 'InputNumber',
componentProps: {
min: 0
},
value: 0
},
},
{
label: '最后打印时间',
field: 'lastPrintTime',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '最后打印人ID',
field: 'lastPrintUserId',
sort: 'custom'
},
{
label: '最后打印人用户名',
field: 'lastPrintUserName',
sort: 'custom',
table: {
width: 180,
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
export const PackageInventory = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
isSearch: true,
table: {
width: 150,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择物料代码',
searchField: 'code',
searchTitle: '物料信息',
searchAllSchemas: Itembasic.allSchemas,
searchPage: ItembasicApi.getItembasicPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150,
},
isForm:false
},
{
label: '物料描述1',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150,
},
isForm:false
},
{
label: '物料描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150,
},
isForm:false
},
{
label: '批次',
field: 'batch',
sort: 'custom',
isSearch: true,
table: {
width: 150,
},
},
{
label: '替代批次',
field: 'altBatch',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '生产日期',
field: 'produceDate',
sort: 'custom',
formatter: dateFormatter2,
search: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
valueFormat: 'YYYY-MM-DD',
type: 'daterange',
disabled: true,
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',
disabled: true
}
},
table: {
width: 180,
},
},
{
label: '有效期(日)',
field: 'validityDays',
sort: 'custom',
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 0,
disabled: true
},
value: 0
},
table: {
width: 150,
},
},
{
label: '失效日期',
field: 'expireDate',
sort: 'custom',
formatter: dateFormatter2,
search: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
valueFormat: 'YYYY-MM-DD',
type: 'daterange',
disabled: true,
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',
disabled: true,
}
},
table: {
width: 180,
},
},
{
label: '计量单位',
field: 'uom',
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
component: 'Select'
},
table: {
width: 150,
},
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150,
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 6
},
value: 0
},
},
{
label: '替代计量单位',
field: 'altUom',
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
component: 'Select'
},
table: {
width: 150,
},
},
{
label: '替代数量',
field: 'altQty',
sort: 'custom',
table: {
width: 150,
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 6
},
value: 0
},
},
{
label: '转换率',
field: 'convertRate',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '包装数量',
field: 'packQty',
sort: 'custom',
table: {
width: 150,
},
form: {
componentProps:{
disabled: true
}
},
tableForm: {
disabled: true
}
},
{
label: '包装规格',
field: 'packUnit',
sort: 'custom',
dictType: DICT_TYPE.PACK_UNIT,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
table: {
width: 150,
},
form: {
component: 'Select',
componentProps:{
disabled: true
}
},
tableForm: {
disabled: true
}
},
{
label: '仓库代码',
field: 'toWarehouseCode',
sort: 'custom',
table: {
width: 150,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
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: {
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: {
isSearchList: true,
searchListPlaceholder: '请选择库位代码',
searchField: 'code',
searchTitle: '库位信息',
searchAllSchemas: Location.allSchemas,
searchPage: LocationApi.getLocationPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '供应商代码',
field: 'supplierCode',
sort: 'custom',
table: {
width: 150,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择供应商代码',
searchField: 'code',
searchTitle: '供应商信息',
searchAllSchemas: Supplier.allSchemas,
searchPage: SupplierApi.getSupplierPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '供应商物料代码',
field: 'supplierItemCode',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '采购订单号',
field: 'poNumber',
sort: 'custom',
table: {
width: 150,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择采购订单号',
searchField: 'number',
searchTitle: '采购订单信息',
searchAllSchemas: PurchaseMain.allSchemas,
searchPage: PurchaseMainApi.getPurchaseMainPage,
searchCondition: [
{
key: 'supplierCode',
value: 'supplierCode',
message: '请填写供应商代码!',
isMainValue: true
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '采购订单行',
field: 'poLine',
sort: 'custom',
table: {
width: 150,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择采购订单行',
searchField: 'lineNumber',
searchTitle: '采购订单信息',
searchAllSchemas: PurchaseDetail.allSchemas,
searchPage: PurchaseDetailApi.getPurchaseDetailPage,
searchCondition: [
{
key: 'number',
value: 'poNumber',
message: '请填写采购订单号!',
isMainValue: true
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '采购计划单号',
field: 'rpNumber',
sort: 'custom',
table: {
width: 150,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择采购订单号',
searchField: 'number',
searchTitle: '采购订单信息',
searchAllSchemas: PurchasePlanMain.allSchemas,
searchPage: PurchasePlanMainApi.getPurchasePlanMainPage,
searchCondition: [
{
key: 'supplierCode',
value: 'supplierCode',
message: '请填写供应商代码!',
isMainValue: true
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '发货单号',
field: 'asnNumber',
sort: 'custom',
table: {
width: 182,
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择发货单号',
searchField: 'asnNumber',
searchTitle: '发货信息',
searchAllSchemas: SupplierdeliverRecordMain.allSchemas,
searchPage: SupplierdeliverRecordMainApi.getSupplierdeliverRecordMainPage,
searchCondition: [
{
key: 'supplierCode',
value: 'supplierCode',
message: '请填写供应商代码!',
isMainValue: true
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
//表单校验
export const PackageRulesInventor = reactive({
itemCode: [
{ required: true, message: '请选择物料代码', trigger: 'change' }
],
batch: [
{ required: true, message: '请输入批次', trigger: 'blur' }
],
produceDate: [
{ required: true, message: '请选择生产日期', trigger: 'change' }
],
validityDays: [
{ required: true, message: '请输入有效期(日)', trigger: 'blur' }
],
expireDate: [
{ required: true, message: '请选择失效日期', trigger: 'change' }
],
uom: [
{ required: true, message: '请选择计量单位', trigger: 'change' }
],
qty: [
{ required: true, message: '请输入数量', trigger: 'blur' }
],
// toWarehouseCode: [
// { required: true, message: '请选择仓库代码', trigger: 'change' }
// ],
// toDockCode: [
// { required: true, message: '请选择月台代码', trigger: 'change' }
// ],
// toLocationCode: [
// { required: true, message: '请选择库位代码', trigger: 'change' }
// ],
supplierCode: [
{ required: true, message: '请选择供应商代码', trigger: 'change' }
],
// supplierItemCode: [
// { required: true, message: '请选择供应商物料代码', trigger: 'change' }
// ],
// poNumber: [
// { required: true, message: '请选择采购订单号', trigger: 'change' }
// ],
// poLine: [
// { required: true, message: '请选择采购订单行', trigger: 'change' }
// ],
// rpNumber: [
// { required: true, message: '请选择采购计划单号', trigger: 'change' }
// ],
asnNumber: [
{ required: true, message: '请选择发货单号', trigger: 'change' }
],
})