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 { Dock } from "@/views/wms/basicDataManage/factoryModeling/dock/dock.data"; import * as DockApi from "@/api/wms/dock"; import { Supplier } from "@/views/wms/basicDataManage/supplierManage/supplier/supplier.data"; import * as SupplierApi from "@/api/wms/supplier"; import { SupplierdeliverRecordMain } from "@/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/supplierdeliverRecordMain.data"; import * as SupplierdeliverRecordMainApi from "@/api/wms/supplierdeliverRecordMain"; import * as ItemPackageApi from "@/api/wms/itempackage"; import {Itempackaging} from "@/views/wms/basicDataManage/itemManage/itempackage/itempackage.data"; import {validatePositiveNumber} from "@/utils/validator"; import { Productionlineitem } from "@/views/wms/basicDataManage/itemManage/productionlineitem/productionlineitem.data"; import {getProductionlineitemPage} from "@/api/wms/productionlineitem"; import * as ProductionlineitemApi from "@/api/wms/productionlineitem"; import { Supplieritem } from "@/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data"; import {getSupplieritemPage} from "@/api/wms/supplieritem"; import * as SupplieritemApi from "@/api/wms/supplieritem"; // 表单校验 export const PackageRules = reactive({ number: [required], itemCode: [required], itemName: [required], }) export const Package = useCrudSchemas(reactive([ { label: '标签号', field: 'number', sort: 'custom', isSearch: true, table: { fixed: 'left' } }, { label: '标签类型', field: 'type', sort: 'custom', isSearch: false, 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', isSearch:true }, { 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: 'available', sort: 'custom', isSearch:true, isForm: false, dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', // 默认都是字符串类型其他暂不考虑 search: { value: 'TRUE', }, form: { component: 'Switch', value: 'TRUE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE' } }, table: { width: 110 } }, { 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 }, { label: '最后更新时间', field: 'updateTime', sort: 'custom', isDetail: true, isForm: false, isTable: true, formatter: dateFormatter, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' }, table: { width: 180 }, form: { component: 'DatePicker', componentProps: { style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', } } }, { label: '最后更新者', field: 'updater', isDetail: true, isForm: false, isTable: true, table: { width: 150 } }, { label: '操作', field: 'action', isForm: false, table: { width: 150, fixed: 'right' } } ])) export const PackageInventory = useCrudSchemas(reactive([ { label: '物料代码', field: 'itemCode', sort: 'custom', isSearch: true, 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, }], // 失去焦点校验参数 } } }, { label: '物料名称', field: 'itemName', sort: 'custom', table: { width: 150, }, form: { componentProps:{ disabled: true } }, }, { label: '物料描述1', field: 'itemDesc1', sort: 'custom', table: { width: 150, }, form: { componentProps:{ disabled: true } }, }, { label: '物料描述2', field: 'itemDesc2', sort: 'custom', table: { width: 150, }, form: { componentProps:{ disabled: true } }, }, { label: '背番', field: 'backNumber', sort: 'custom', table: { width: 150, }, form: { componentProps:{ disabled: true } }, }, { label: '色番', field: 'colorCode', sort: 'custom', table: { width: 150, }, form: { componentProps:{ disabled: true } }, }, { label: '包装规格', field: 'packUnit', sort: 'custom', table: { width: 150, }, form: { componentProps: { enterSearch: true, disabled: true, isSearchList: true, searchListPlaceholder: '请选择包装', searchField: 'packUnit', searchTitle: '物品包装信息', searchAllSchemas: Itempackaging.allSchemas, searchPage: ItemPackageApi.getItemPackagingPageByItemCode, searchCondition: [ { key: 'itemCode', value: 'itemCode', message: '请选择物料代码', isMainValue: true }, { key: 'available', value: 'TRUE', isMainValue: false } ] } } }, { label: '包装数量', field: 'packQty', sort: 'custom', table: { width: 150, }, form: { componentProps:{ disabled: true } }, tableForm: { disabled: true } }, { label: '数量', field: 'qty', sort: 'custom', table: { width: 150, }, form: { component: 'InputNumber', componentProps: { min: 0, precision: 6 }, value: 0 }, }, { label: '受入号', field: 'receivedNumber', sort: 'custom', isSearch: false, table: { width: 150 }, form: { componentProps:{ disabled: true } }, }, { label: '生产线区分', field: 'productionLine', sort: 'custom', isSearch: false, table: { width: 150 }, form: { componentProps: { enterSearch: true, disabled: true, isSearchList: true, searchListPlaceholder: '请选择生产线区分', searchField: 'packUnit', searchTitle: '生产线', searchAllSchemas: Productionlineitem.allSchemas, searchPage: ProductionlineitemApi.getProductionlineitemPage, searchCondition: [ { key: 'itemCode', value: 'itemCode', message: '请选择物料代码', isMainValue: true }, { key: 'available', value: 'TRUE', isMainValue: false } ] } } }, { label: '物料状态', field: 'status', sort: 'custom', dictType: DICT_TYPE.ITEM_STATUS, dictClass: 'string', table: { width: 120 }, form: { componentProps:{ disabled: true } }, }, { label: '供应商代码', field: 'supplierCode', sort: 'custom', table: { width: 150, }, form: { // labelMessage: '信息提示说明!!!', componentProps: { enterSearch: true, isSearchList: true, searchListPlaceholder: '请选择供应商代码', searchField: 'code', searchTitle: '供应商信息', searchAllSchemas: Supplieritem.allSchemas, searchPage: SupplieritemApi.getSupplieritemPage, searchCondition: [ { key: 'itemCode', value: 'itemCode', message: '请选择物料代码', isMainValue: true }, { key: 'available', value: 'TRUE', isMainValue: false }], verificationParams: [{ key: 'supplierCode', action: '==', value: '', isMainValue: false, isSearch: true, isFormModel: true, }], // 失去焦点校验参数 } } }, { label: '供应商名称', field: 'supplierName', sort: 'custom', table: { width: 150, }, form: { componentProps:{ disabled: true } }, }, { label: '送货日期', field: 'deliveryDate', sort: 'custom', formatter: dateFormatter2, search: { component: 'DatePicker', componentProps: { style: {width:'100%'}, valueFormat: 'YYYY-MM-DD', type: 'daterange', disabled: false, 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: false } }, table: { width: 180, }, }, { label: '便次', field: 'stoolTime', sort: 'custom', table: { width: 150, }, }, { label: 'ASN单号', field: 'asnNumber', sort: 'custom', table: { width: 182, }, form: { // labelMessage: '信息提示说明!!!', componentProps: { enterSearch: true, 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 }], verificationParams: [{ key: 'asnNumber', action: '==', value: '', isMainValue: false, isSearch: true, isFormModel: true, }], // 失去焦点校验参数 } } }, { label: '采购订单备注', field: 'purchaseOrderRemarks', sort: 'custom', isSearch: true, table: { width: 150, }, form: { componentProps:{ disabled: true } }, }, { 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 }], verificationParams: [{ key: 'code', action: '==', value: '', isMainValue: false, isSearch: true, isFormModel: true, }], // 失去焦点校验参数 } } }, { label: '受入地', field: 'receivedLocation', sort: 'custom', isSearch: true, table: { width: 150 }, form: { componentProps:{ disabled: true } }, }, { label: '默认收货库区', field: 'defaultReceivingArea', sort: 'custom', isSearch: true, table: { width: 150 }, form: { componentProps:{ disabled: true } }, }, { label: '批次', field: 'batch', sort: 'custom', isSearch: true, table: { width: 150 }, }, ])) //表单校验 export const PackageRulesInventor = reactive({ itemCode: [ { required: true, message: '请选择物料代码', trigger: 'change' } ], qty: [ { required: true, message: '请输入数量', trigger: 'blur' }, { validator:validatePositiveNumber, message: '必须是一个正数', trigger: 'change'} ], toDockCode: [ { required: true, message: '请选择月台代码', trigger: 'change' } ], supplierCode: [ { required: true, message: '请选择供应商代码', trigger: 'change' } ], asnNumber: [ { required: true, message: '请选择ASN单号', trigger: 'change' } ], packUnit: [ { required: true, message: '请选择包装规格', trigger: 'change' } ], deliveryDate: [ { required: true, message: '请选择送货日期', trigger: 'change' } ], })