import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' import * as SupplierApi from '@/api/wms/supplier' import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/supplier.data' import * as ItembasicApi from '@/api/wms/itembasic' import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data' import * as AreaApi from '@/api/wms/areabasic' import { Area } from '@/views/wms/basicDataManage/factoryModeling/areabasic/areabasic.data' // 表单校验 export const ItemPullRules = reactive({ defaultErpLocationCode: [required], replenishType: [required], pullType: [required] }) export const ItemPull = useCrudSchemas( reactive([ { label: 'ERP默认收货库位', field: 'defaultErpLocationCode', sort: 'custom', table: { width: 150, fixed: 'left' }, form: { // labelMessage: '信息提示说明!!!', componentProps: { multiple: true, enterSearch: true, isSearchList: true, // 开启查询弹窗 searchListPlaceholder: '请选择ERP默认收货库位', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '库区信息', // 查询弹窗标题 searchAllSchemas: Area.allSchemas, // 查询弹窗所需类 searchPage: AreaApi.getAreaPage, // 查询弹窗所需分页方法 verificationParams: [ { key: 'code', action: '==', value: '', isMainValue: false, isSearch: true, isFormModel: true } ] // 失去焦点校验参数 } } }, { label: '品番', field: 'itemCode', sort: 'custom', isSearch: true, table: { width: 180, }, 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', form: { componentProps: { disabled: true } }, isSearch: false }, { label: '背番', field: 'backNumber', sort: 'custom', form: { componentProps: { disabled: true } }, isSearch: true }, { label: '受入号', field: 'receivedNumber', sort: 'custom', form: { componentProps: { disabled: true } }, isSearch: false }, { label: '生产线区分', field: 'productionLine', sort: 'custom', form: { componentProps: { disabled: true } }, isSearch: false }, { label: '供应商代码', field: 'supplierCode', sort: 'custom', isSearch: true, table: { width: 150, }, form: { // labelMessage: '信息提示说明!!!', componentProps: { enterSearch: true, isSearchList: true, // 开启查询弹窗 searchListPlaceholder: '请选择供应商代码', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '供应商信息', // 查询弹窗标题 searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类 searchPage: SupplierApi.getSupplierPage, // 查询弹窗所需分页方法 searchCondition: [ { key: 'available', value: 'TRUE', isMainValue: false } ], verificationParams: [ { key: 'code', action: '==', value: '', isMainValue: false, isSearch: true, isFormModel: true } ] // 失去焦点校验参数 } } }, { label: '补充方式', field: 'replenishType', sort: 'custom', dictType: DICT_TYPE.REPLENISH_TYPE, dictClass: 'string', isSearch: true, isTable: true, table: { width: 120 } }, { label: '拉动方式', field: 'pullType', sort: 'custom', dictType: DICT_TYPE.PULL_TYPE, dictClass: 'string', isSearch: true, isTable: true, table: { width: 120 } }, { label: '创建者', field: 'creator', sort: 'custom', table: { width: 150 }, isTable: true, isForm: false }, { label: '创建时间', field: 'createTime', formatter: dateFormatter, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' }, sort: 'custom', table: { width: 180 }, isTable: true, form: { component: 'DatePicker', componentProps: { style: { width: '100%' }, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x' } }, isForm: false, 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')] } } }, { label: '操作', field: 'action', isForm: false, table: { width: 150, fixed: 'right' } } ]) )