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.
 
 
 

225 lines
4.0 KiB

import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
const { t } = useI18n() // 国际化
/**
* @returns {Array} 客户月台
*/
export const Customerdock = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '代码',
field: 'code',
sort: 'custom',
table: {
width: 150,
fixed: 'left'
},
isSearch: true
},
{
label: '名称',
field: 'name',
sort: 'custom',
table: {
width: 150
},
},
{
label: '描述',
field: 'description',
sort: 'custom',
table: {
width: 150
},
},
{
label: '城市',
field: 'city',
sort: 'custom',
table: {
width: 150
},
},
{
label: '地址',
field: 'address',
sort: 'custom',
table: {
width: 150
},
},
{
label: '联系人姓名',
field: 'contactPerson',
sort: 'custom',
table: {
width: 150
},
},
{
label: '联系人电话',
field: 'contactPhone',
sort: 'custom',
table: {
width: 150
},
},
{
label: '客户代码',
field: 'customerCode',
sort: 'custom',
table: {
width: 150
}
},
{
label: '仓库',
field: 'warehouseCode',
sort: 'custom',
table: {
width: 150
},
isSearch: true
},
{
label: '默认库位',
field: 'defaultLocationCode',
sort: 'custom',
table: {
width: 150
},
isSearch: true
},
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
},
{
label: '生效时间',
field: 'activeTime',
isTable: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '失效时间',
field: 'expireTime',
isTable: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
},
{
label: '创建时间',
field: 'createTime',
isTable: false,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isSearch: false,
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isForm: false,
},
{
label: '创建者',
field: 'creator',
isSearch: false,
isTable: false,
isForm: false,
sort: 'custom',
table: {
width: 150
},
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false ,
table: {
width: 150,
fixed: 'right'
}
}
]))
//表单校验
export const CustomerdockRules = reactive({
code: [
{ required: true, message: '请输入代码', trigger: 'blur' }
],
customerCode: [
{ required: true, message: '请输入客户代码', trigger: 'blur' }
],
defaultLocationCode: [
{ required: true, message: '请输入默认库位', trigger: 'blur' }
],
available: [
{ required: true, message: '请选择是否可用', trigger: 'change' }
],
})