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.
 
 
 

120 lines
2.7 KiB

import type {CrudSchema} from '@/hooks/web/useCrudSchemas'
import {dateFormatter} from '@/utils/formatTime'
import * as TenantApi from '@/api/system/tenant'
// 表单校验
export const MesOrderMonthMainRules = reactive({
planMasterCode: [required],
planSubCode: [required],
planType: [required],
factoryCode: [required]
})
export const FactoryList = useCrudSchemas(reactive<CrudSchema[]>([{
label: '工厂编码',
field: 'id'
},
{
label: '工厂名称',
field: 'name'
}]))
export const MesOrderMonthMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '主计划编码',
field: 'planMasterCode',
sort: 'custom',
isSearch: true
},
{
label: '计划辅助编码',
field: 'planSubCode',
sort: 'custom',
isSearch: true
}, {
label: '工厂编码',
field: 'factoryCode',
sort: 'custom',
isTable: false,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择工厂', // 输入框占位文本
searchField: 'factoryCode', // 查询弹窗赋值字段
searchTitle: '请选择工厂', // 查询弹窗标题
searchAllSchemas: FactoryList.allSchemas, // 查询弹窗所需类
searchPage: TenantApi.getTenantPage, // 查询弹窗所需分页方法
isHideFilterButton: true,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
}
},
{
label: '工厂名称',
field: 'factoryName',
sort: 'custom',
isSearch: true,
isForm: false
}, {
label: '计划类型',
field: 'planType',
sort: 'custom',
dictType: DICT_TYPE.PLAN_TYPE_MES,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'SelectV2'
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isTable: false
},
{
label: '创建者用户名',
field: 'creator',
sort: 'custom',
isSearch: true,
isForm: false
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
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')]
}
},
isForm: false
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
export const TabsList = [{
label: "子计划",
prop: 'mesOrderMonthSub',
}]