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.
275 lines
6.0 KiB
275 lines
6.0 KiB
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
|
|
import { dateFormatter } from '@/utils/formatTime'
|
|
import { selectAllFactoryArea } from '@/api/system/dept'
|
|
import * as MoldAccountsApi from '@/api/eam/mold/moldAccounts'
|
|
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
|
|
import { validateHanset,validateNumDot, validateEmail } from '@/utils/validator'
|
|
import * as UserApi from '@/api/system/user'
|
|
const userListAll = await UserApi.getSimpleUserList()
|
|
const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE)
|
|
|
|
|
|
// 邮箱账号的列表
|
|
const factoryList = await selectAllFactoryArea()
|
|
const moldList = ref([]);
|
|
const moldListNoPage = await MoldAccountsApi.getMoldAccountsAllNoPage({
|
|
status: '0',
|
|
sourceType: '0'
|
|
} as MoldAccountsApi.MoldAccountsVO)
|
|
|
|
// 表单校验
|
|
export const MoldRepairRules = reactive({
|
|
number: [required],
|
|
deviceNumber: [required],
|
|
factoryAreaNumber: [required],
|
|
declarer: [required],
|
|
faultType: [required],
|
|
type: [required],
|
|
available: [required],
|
|
concurrencyStamp: [required],
|
|
declarerPhone: [
|
|
required,
|
|
{ validator:validateHanset, message: '输入手机号格式不正确', trigger: 'blur'}
|
|
]
|
|
// result: [required],
|
|
})
|
|
|
|
export const MoldRepair = useCrudSchemas(reactive<CrudSchema[]>([
|
|
{
|
|
label: '报修工单编号',
|
|
field: 'number',
|
|
sort: 'custom',
|
|
table: {
|
|
width: '150',
|
|
fixed: 'left',
|
|
},
|
|
isSearch: false,
|
|
isForm: false
|
|
},
|
|
{
|
|
label: '厂区',
|
|
field: 'factoryAreaNumber',
|
|
sort: 'custom',
|
|
table: {
|
|
width: '150',
|
|
},
|
|
api: () => factoryList,
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
|
|
return factoryList.find((account) => account.id == cellValue)?.name
|
|
},
|
|
search: {
|
|
show: true,
|
|
component: 'Select',
|
|
api: () => factoryList,
|
|
componentProps: {
|
|
optionsAlias: {
|
|
labelField: 'name',
|
|
valueField: 'id'
|
|
}
|
|
}
|
|
},
|
|
form: {
|
|
component: 'Select',
|
|
api: () => factoryList,
|
|
componentProps: {
|
|
optionsAlias: {
|
|
labelField: 'name',
|
|
valueField: 'id'
|
|
},
|
|
},
|
|
}
|
|
},
|
|
{
|
|
label: '类型',
|
|
field: 'type',
|
|
sort: 'custom',
|
|
table: {
|
|
width: '150',
|
|
},
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
|
|
return deviceMoldTypeList.find((account) => account.value == cellValue)?.label
|
|
},
|
|
isSearch: false,
|
|
// search: {
|
|
// component: 'Select',
|
|
// componentProps: {
|
|
// options: deviceMoldTypeList,
|
|
// optionsAlias: {
|
|
// labelField: 'label',
|
|
// valueField: 'value'
|
|
// },
|
|
// // disabled: true,
|
|
// filterable: true,
|
|
// placeholder: "请选择类型"
|
|
// }
|
|
// },
|
|
form: {
|
|
component: 'Select',
|
|
componentProps: {
|
|
options: deviceMoldTypeList,
|
|
optionsAlias: {
|
|
labelField: 'label',
|
|
valueField: 'value'
|
|
},
|
|
disabled: true,
|
|
filterable: true,
|
|
placeholder: "请选择类型"
|
|
},
|
|
value: 'MOLD'
|
|
},
|
|
},
|
|
{
|
|
label: '模具',
|
|
field: 'deviceNumber',
|
|
sort: 'custom',
|
|
table: {
|
|
width: '150',
|
|
},
|
|
isSearch: true,
|
|
api: () => moldListNoPage,
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
|
|
return moldListNoPage.find((account) => account.number == cellValue)?.name
|
|
},
|
|
form: {
|
|
component: 'Select',
|
|
componentProps: {
|
|
options: moldListNoPage,
|
|
optionsAlias: {
|
|
labelField: 'name',
|
|
valueField: 'number'
|
|
},
|
|
filterable: true,
|
|
},
|
|
},
|
|
search: {
|
|
component: 'Select',
|
|
componentProps: {
|
|
options: moldListNoPage,
|
|
optionsAlias: {
|
|
labelField: 'name',
|
|
valueField: 'number'
|
|
},
|
|
filterable: true,
|
|
},
|
|
}
|
|
},
|
|
{
|
|
label: '工单来源',
|
|
field: 'sourceType',
|
|
sort: 'custom',
|
|
dictType: DICT_TYPE.ORDER_SOURCE_TYPE,
|
|
dictClass: 'string',
|
|
isSearch: false,
|
|
isForm: false,
|
|
table: {
|
|
width: '150',
|
|
},
|
|
},
|
|
{
|
|
label: '报修人电话',
|
|
field: 'declarerPhone',
|
|
sort: 'custom',
|
|
table: {
|
|
width: '150',
|
|
},
|
|
},
|
|
{
|
|
label: '报修人',
|
|
field: 'declarer',
|
|
sort: 'custom',
|
|
table: {
|
|
width: '150',
|
|
},
|
|
isForm: false,
|
|
isDetail: false,
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
|
|
return userListAll.find((account) => account.id == cellValue)?.nickname
|
|
},
|
|
search: {
|
|
component: 'Select',
|
|
componentProps: {
|
|
options: userListAll,
|
|
optionsAlias: {
|
|
labelField: 'nickname',
|
|
valueField: 'id'
|
|
},
|
|
filterable: true,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
label: '报修时间',
|
|
field: 'createTime',
|
|
sort: 'custom',
|
|
formatter: dateFormatter,
|
|
isSearch: false,
|
|
isTableForm: false,
|
|
isForm: false,
|
|
table: {
|
|
width: '200',
|
|
},
|
|
},
|
|
// {
|
|
// label: '故障类型',
|
|
// field: 'faultType',
|
|
// sort: 'custom',
|
|
// table: {
|
|
// width: '150',
|
|
// },
|
|
// dictType: DICT_TYPE.FAULT_TYPE,
|
|
// dictClass: 'string',
|
|
// form: {
|
|
// component: 'Select'
|
|
// },
|
|
// },
|
|
{
|
|
label: '描述',
|
|
field: 'describes',
|
|
sort: 'custom',
|
|
table: {
|
|
width: '150',
|
|
},
|
|
form: {
|
|
component: 'Input',
|
|
componentProps: {
|
|
type: 'textarea',
|
|
}
|
|
|
|
},
|
|
},
|
|
{
|
|
label: '维修状态',
|
|
field: 'result',
|
|
sort: 'custom',
|
|
table: {
|
|
width: '150',
|
|
},
|
|
dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS,
|
|
dictClass: 'string',
|
|
isSearch: true,
|
|
isForm: false,
|
|
form: {
|
|
component: 'Select',
|
|
},
|
|
},
|
|
{
|
|
label: '图片',
|
|
field: 'upload',
|
|
isForm: true,
|
|
form: {
|
|
component: 'UploadImgs',
|
|
componentProps: {
|
|
limit:3,
|
|
}
|
|
}
|
|
},
|
|
{
|
|
label: '操作',
|
|
field: 'action',
|
|
isForm: false,
|
|
table: {
|
|
width: 150,
|
|
fixed: 'right'
|
|
}
|
|
}
|
|
]))
|
|
|