前端
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.
 
 
 
 
 

136 lines
2.9 KiB

import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import {Project } from '@/views/spc/project/project.data'
import * as ProjectApi from '@/api/spc/project/index'
const { t } = useI18n() // 国际化
/**
* @returns {Array} 基础物料信息
*/
export const Itembasic = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '项目编码',
field: 'projectCode',//传第给后端字段名称
sort: 'custom',
table: {
width: 150,
fixed: 'left'
},
isSearch: false,
isTable:false,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择项目编码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '项目信息', // 查询弹窗标题
searchAllSchemas: Project.allSchemas, // 查询弹窗所需类
searchPage: ProjectApi.getProjectPage // 查询弹窗所需分页方法
}
}
},
{
label: '项目名称',
field: 'projectName',
sort: 'custom',
isSearch: false,
isForm:false,
isTable:true,
table: {
width: 'auto',
fixed: 'left'
},
},
{
label: '物料编号',
field: 'code',
sort: 'custom',
isSearch: true,
isTable:true,
table: {
width: 'auto',
},
},
{
label: '物料名称',
field: 'name',
sort: 'custom',
isSearch: true,
isTable:true,
},
{
label: '颜色',
field: 'color',
sort: 'custom',
dictType: DICT_TYPE.ITEM_COLOR,
dictClass: 'string',
isTable: true,
table: {
width: 100
} ,
// form: {
// component: 'Select',
// componentProps: {
// // inactiveValue: 'DISABLE',
// // activeValue: 'ENABLE',
// }
// },
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
isTable: true,
formatter: dateFormatter,
isForm: false,
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: 'creator',
isForm: false,
isTable: false
},
{ label: '备注', field: 'remark', sort: 'custom', isTable: false},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false ,
table: {
width: 150,
fixed: 'right'
},
}
]))
// 表单校验
export const rules = reactive({
code: [
{ required: true, message: '请输入物料', trigger: 'blur' }
],
name: [
{ required: true, message: '请输入物料', trigger: 'blur' }
],
projcetCode: [
{ required: true, message: '请选择项目编码', trigger: 'change' }
],
})