songguoqiang
6 months ago
41 changed files with 3314 additions and 180 deletions
@ -0,0 +1,51 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface DeviceMaintenanceDetailVO { |
|||
describes: string |
|||
describes1: string |
|||
workOut: string |
|||
maintenances: string |
|||
} |
|||
|
|||
// 查询维修工单子列表
|
|||
export const getDeviceMaintenanceDetailPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/eam/tech-maintenance-job-detail/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/eam/tech-maintenance-job-detail/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询维修工单子详情
|
|||
export const getPurchasereceiptRequestDetail = async (id) => { |
|||
return await request.get({ url: `/eam/tech-maintenance-job-detail/selectListByNumber?id=` + id }) |
|||
} |
|||
|
|||
// 新增维修工单子
|
|||
export const createDeviceMaintenanceDetail = async (data: DeviceMaintenanceDetailVO) => { |
|||
return await request.post({ url: `/eam/tech-maintenance-job-detail/create`, data }) |
|||
} |
|||
|
|||
// 修改维修工单子
|
|||
export const updateDeviceMaintenanceDetail = async (data: DeviceMaintenanceDetailVO) => { |
|||
return await request.put({ url: `/eam/tech-maintenance-job-detail/update`, data }) |
|||
} |
|||
|
|||
// 删除维修工单子
|
|||
export const deleteDeviceMaintenanceDetail = async (id: number) => { |
|||
return await request.delete({ url: `/eam/tech-maintenance-job-detail/delete?id=` + id }) |
|||
} |
|||
|
|||
|
|||
|
|||
// 导出维修工单子 Excel
|
|||
export const exportPurchasereceiptRequestDetail = async (params) => { |
|||
return await request.download({ url: `/eam/tech-maintenance-job-detail/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/eam/tech-maintenance-job-detail/get-import-template' }) |
|||
} |
@ -0,0 +1,94 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface DeviceMaintenanceMainVO { |
|||
id: number |
|||
number: string |
|||
requestNumber: string |
|||
describe: string |
|||
deviceNumber: string |
|||
factoryAreaNumber: string |
|||
maintenance: number |
|||
maintenancePhone: string |
|||
status: string |
|||
type: string |
|||
siteId: string |
|||
available: string |
|||
concurrencyStamp: number |
|||
} |
|||
|
|||
// 查询工艺维修工单主列表
|
|||
export const getTechMaintenanceMainPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/eam/tech-maintenance-job-main/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/eam/tech-maintenance-job-main/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询维修工单主详情
|
|||
export const getDeviceMaintenanceMain = async (id: number) => { |
|||
return await request.get({ url: `/eam/tech-maintenance-job-main/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增维修工单主
|
|||
export const createDeviceMaintenanceMain = async (data: DeviceMaintenanceMainVO) => { |
|||
return await request.post({ url: `/eam/tech-maintenance-job-main/createPC`, data }) |
|||
} |
|||
|
|||
// 修改维修工单主
|
|||
export const updateDeviceMaintenanceMain = async (data: DeviceMaintenanceMainVO) => { |
|||
return await request.put({ url: `/eam/tech-maintenance-job-main/update`, data }) |
|||
} |
|||
// 删除维修工单主
|
|||
export const deleteDeviceMaintenanceMain = async (id: number) => { |
|||
return await request.delete({ url: `/eam/tech-maintenance-job-main/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出维修工单主 Excel
|
|||
export const exportDeviceMaintenanceMain = async (params) => { |
|||
return await request.download({ url: `/eam/tech-maintenance-job-main/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/eam/tech-maintenance-job-main/get-import-template' }) |
|||
} |
|||
|
|||
// 修改维修工单主
|
|||
export const orderStepChange = async (data: DeviceMaintenanceMainVO) => { |
|||
return await request.get({ url: `/eam/tech-maintenance-job-main/orderClick?number=`+data.number+`&status=`+data.status+`&id=`+data.id+`&requestNumber=`+data.requestNumber }) |
|||
} |
|||
|
|||
// 修改维修工单主
|
|||
export const orderTurnTo = async (data: DeviceMaintenanceMainVO) => { |
|||
return await request.get({ url: `/eam/tech-maintenance-job-main/turnTo?deviceNumber=`+data.deviceNumber +`&id=`+data.id + `&receiverType=`+ data.type +`&receiverUserId=` + data.maintenance }) |
|||
} |
|||
|
|||
|
|||
// 查询维修工单主列表不分页
|
|||
export const getDeviceMainTempList = async (type: String) => { |
|||
return await request.get({ url: `/eam/tech-maintenance-job-main/getList?type=` + type }) |
|||
} |
|||
|
|||
|
|||
|
|||
// 完成维修工单
|
|||
export const finishOrder = async (params) => { |
|||
return await request.get({ url: `/eam/tech-maintenance-job-main/orderClickFinish`, params}) |
|||
} |
|||
|
|||
|
|||
|
|||
// 校验维修工单
|
|||
export const verifyOrder = async (params) => { |
|||
return await request.get({ url: `/eam/tech-maintenance-job-main/orderClickVerify`, params}) |
|||
} |
|||
|
|||
|
|||
// 确认维修工单
|
|||
export const confirmOrder = async (params) => { |
|||
return await request.get({ url: `/eam/tech-maintenance-job-main/orderClickConfirm`, params}) |
|||
} |
|||
|
@ -0,0 +1,68 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface DeviceRepairVO { |
|||
id: number |
|||
number: string |
|||
describe: string |
|||
deviceNumber: string |
|||
factoryAreaNumber: string |
|||
declarer: number |
|||
declarerPhone: string |
|||
faultType: string |
|||
type: string |
|||
siteId: string |
|||
available: string |
|||
concurrencyStamp: number |
|||
} |
|||
|
|||
// 查询报修申请列表
|
|||
export const getDeviceRepairPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = { ...params } |
|||
return await request.post({ url: '/eam/tech-repair-request/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/eam/tech-repair-request/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询报修申请详情
|
|||
export const getDeviceRepair = async (id: number) => { |
|||
return await request.get({ url: `/eam/tech-repair-request/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增报修申请
|
|||
export const createDeviceRepair = async (data: DeviceRepairVO) => { |
|||
return await request.post({ url: `/eam/tech-repair-request/create`, data }) |
|||
} |
|||
|
|||
// 修改报修申请
|
|||
export const updateDeviceRepair = async (data: DeviceRepairVO) => { |
|||
return await request.put({ url: `/eam/tech-repair-request/update`, data }) |
|||
} |
|||
|
|||
// 删除报修申请
|
|||
export const deleteDeviceRepair = async (id: number) => { |
|||
return await request.delete({ url: `/eam/tech-repair-request/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出报修申请 Excel
|
|||
export const exportDeviceRepair = async (params) => { |
|||
return await request.download({ url: `/eam/tech-repair-request/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/eam/tech-repair-request/get-import-template' }) |
|||
} |
|||
|
|||
// 撤销申请
|
|||
export const cancel = (id: Number) => { |
|||
return request.delete({ url: '/eam/tech-repair-request/cancel?id=' + id }) |
|||
} |
|||
|
|||
|
|||
// 根据单号查询申请工单信息
|
|||
export const getOrderByNumber = (number: Number) => { |
|||
return request.get({ url: '/eam/tech-repair-request/getOrderByNumber?number=' + number }) |
|||
} |
@ -0,0 +1,391 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="DeviceRepair.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" :allSchemas="DeviceRepair.allSchemas" /> |
|||
|
|||
<!-- 列表 --> |
|||
<ContentWrap> |
|||
<Table :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{ |
|||
total: tableObject.total |
|||
}" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage" |
|||
v-model:sort="tableObject.sort"> |
|||
<template #code="{ row }"> |
|||
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> |
|||
<span>{{ row.code }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #upload="{ row }"> |
|||
<ButtonBase v-if="row.filePathList != null && row.filePathList.length != 0" :Butttondata="butttondataView(row)" @button-base-click="buttonTableClick($event, row)" /> |
|||
</template> |
|||
<template #action="{ row }"> |
|||
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event, row)" /> |
|||
</template> |
|||
|
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="basicFormRef" |
|||
@success="formsSuccess" |
|||
:rules="DeviceRepairRules" |
|||
:formAllSchemas="DeviceRepair.allSchemas" |
|||
:apiUpdate="DeviceRepairApi.updateDeviceRepair" |
|||
:apiCreate="DeviceRepairApi.createDeviceRepair" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
@onChange="onChange" |
|||
/> |
|||
|
|||
<!-- 详情 --> |
|||
<Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceRepair.allSchemas" /> |
|||
|
|||
<Dialog |
|||
ref="basicFormViewRef" |
|||
v-model="showView" |
|||
:key="viewKey" |
|||
:closeOnClickModal="true" |
|||
:title="viewTitle" |
|||
> |
|||
<el-image v-for="url in urls" :key="url" :src="url" lazy /> |
|||
</Dialog> |
|||
|
|||
<!-- 导入 --> |
|||
<ImportForm ref="importFormRef" url="/eam/tech-repair-request/import" :importTemplateData="importTemplateData" |
|||
@success="importSuccess" /> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { DeviceRepair, DeviceRepairRules } from './techRepair.data' |
|||
import * as DeviceRepairApi from '@/api/eam/device/techRepair' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
import * as DeviceAccountApi from '@/api/eam/device/deviceAccounts' |
|||
import * as MoldAccountApi from '@/api/eam/mold/moldAccounts' |
|||
import { DeviceAccounts } from '../deviceAccounts/deviceAccounts.data' |
|||
import { useUserStore } from '@/store/modules/user' |
|||
// import TableHead from '@/components/TableHead/src/TableHead.vue' |
|||
// import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|||
// import Detail from '@/components/Detail/src/Detail.vue' |
|||
|
|||
defineOptions({ name: 'TechRepair' }) |
|||
|
|||
|
|||
const userStore = useUserStore() |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
const showView = ref(false) |
|||
const viewTitle = ref('图片预览') |
|||
const urls = ref([]) |
|||
const viewKey = ref(0) |
|||
routeName.value = route.name |
|||
const tableColumns = ref(DeviceRepair.allSchemas.tableColumns) |
|||
const factoryAreaNumber = ref(''); |
|||
const type = ref(''); |
|||
// 查询页面返回 |
|||
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|||
nextTick(() => { |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
formRef.setValues(setV) |
|||
}) |
|||
} |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: DeviceRepairApi.getDeviceRepairPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn({hasPermi:'eam:tech-repair-request:create'}), // 新增 |
|||
// defaultButtons.defaultImportBtn({hasPermi:'eam:tech-repair-request:import'}), // 导入 |
|||
// defaultButtons.defaultExportBtn({hasPermi:'eam:tech-repair-request:export'}), // 导出 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultFilterBtn(null), // 筛选 |
|||
defaultButtons.defaultSetBtn(null), // 设置 |
|||
// { |
|||
// label: '自定义扩展按钮', |
|||
// name: 'zdy', |
|||
// hide: false, |
|||
// type: 'primary', |
|||
// icon: 'Select', |
|||
// color: '' |
|||
// }, |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'add') { // 新增 |
|||
openForm('create') |
|||
} else if (val == 'import') { // 导入 |
|||
handleImport() |
|||
} else if (val == 'export') { // 导出 |
|||
handleExport() |
|||
} else if (val == 'refresh') { // 刷新 |
|||
getList() |
|||
} else if (val == 'filtrate') { // 筛选 |
|||
} else { // 其他按钮 |
|||
console.log('其他按钮', item) |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = (row) => { |
|||
return [ |
|||
// defaultButtons.mainListEditBtn({hasPermi:'eam:deviceRepair:update'}), // 编辑 |
|||
// defaultButtons.mainListDeleteBtn({ hasPermi: 'eam:deviceRepair:delete' }), // 删除 |
|||
|
|||
defaultButtons.backoutBtn({hasPermi:'eam:tech-repair-request:cancel', hide: !(row.result == 'PENDING' && row.declarer == userStore.getUser.id )}), // 撤销 |
|||
|
|||
] |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondataView = (row) => { |
|||
return [ |
|||
defaultButtons.viewBtn(null), |
|||
|
|||
] |
|||
} |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'edit') { // 编辑 |
|||
openForm('update', row) |
|||
} else if (val == 'delete') { // 删除 |
|||
handleDelete(row.id) |
|||
} else if (val == 'backout') { //撤销 |
|||
handleBackout(row) |
|||
} else if (val == 'view') { //预览 |
|||
openForm('view', row) |
|||
} |
|||
} |
|||
|
|||
/** 添加/修改操作 */ |
|||
const basicFormRef = ref() |
|||
const basicFormViewRef = ref() |
|||
const openForm = (type: string, row?: any) => { |
|||
// if(type == 'create'){ |
|||
// DeviceRepair.allSchemas.formSchema.find(item => { |
|||
// return item.field == 'type' |
|||
// }).value = 'TECH' |
|||
// } |
|||
if (type == 'view') { |
|||
showView.value = true |
|||
urls.value = row.filePathList |
|||
viewKey.value += 1 |
|||
} else { |
|||
basicFormRef.value.open(type, row) |
|||
} |
|||
|
|||
} |
|||
|
|||
// form表单提交 |
|||
const formsSuccess = async (formType, data) => { |
|||
var isHave = DeviceRepair.allSchemas.formSchema.some(function (item) { |
|||
return item.field === 'activeTime' || item.field === 'expireTime'; |
|||
}); |
|||
if (isHave) { |
|||
if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) { |
|||
message.error('失效时间要大于生效时间') |
|||
return; |
|||
} |
|||
} |
|||
if (data.activeTime == 0) data.activeTime = null; |
|||
if (data.expireTime == 0) data.expireTime = null; |
|||
data.result = 'PENDING'; |
|||
if (data.upload != null && data.upload != "") { |
|||
data.filePathList = data?.upload?.map((item: any) => { |
|||
return item.url |
|||
}) |
|||
} |
|||
if (formType === 'create') { |
|||
await DeviceRepairApi.createDeviceRepair(data) |
|||
message.success(t('common.createSuccess')) |
|||
} else { |
|||
await DeviceRepairApi.updateDeviceRepair(data) |
|||
message.success(t('common.updateSuccess')) |
|||
} |
|||
basicFormRef.value.dialogVisible = false |
|||
getList() |
|||
} |
|||
|
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
detailRef.value.openDetail(row, titleName, titleValue, 'basicDeviceRepair') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await DeviceRepairApi.deleteDeviceRepair(id) |
|||
message.success(t('common.delSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch { } |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await DeviceRepairApi.exportDeviceRepair(tableObject.params) |
|||
download.excel(data, '报修申请.xlsx') |
|||
} catch { |
|||
} finally { |
|||
exportLoading.value = false |
|||
} |
|||
} |
|||
|
|||
/** 导入 */ |
|||
const importFormRef = ref() |
|||
const handleImport = () => { |
|||
importFormRef.value.open() |
|||
} |
|||
// 导入附件弹窗所需的参数 |
|||
const importTemplateData = reactive({ |
|||
templateUrl: '', |
|||
templateTitle: '报修申请导入模版.xlsx' |
|||
}) |
|||
// 导入成功之后 |
|||
const importSuccess = () => { |
|||
getList() |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
|
|||
// function getAllFactoryAreaList() { |
|||
// selectAllFactoryArea().then(res => { |
|||
// factoryAreaList.value = res.data |
|||
// }) |
|||
// } |
|||
|
|||
function handleBackout(row) { |
|||
if (row.result != 'PENDING') { |
|||
message.error('该报修单正在处理中,不能撤销!') |
|||
} |
|||
DeviceRepairApi.cancel(row.id).then(res => { |
|||
console.log("撤销成功!") |
|||
getList() // 刷新当前列表 |
|||
}) |
|||
|
|||
} |
|||
|
|||
const onChange = (field, cur, item,formRef) => { |
|||
if (field == 'factoryAreaNumber') { |
|||
nextTick(() => { |
|||
const setV = {} |
|||
setV['deviceNumber'] = '' |
|||
formRef.setValues(setV) |
|||
}) |
|||
factoryAreaNumber.value = cur |
|||
if(type.value != 'MOLD'){ |
|||
DeviceAccountApi.getDeviceAccountsAllNoPage({ |
|||
factoryAreaNumber: cur, |
|||
type: type.value, |
|||
status: '0' |
|||
}).then((res) => { |
|||
DeviceRepair.allSchemas.formSchema.find(item => { |
|||
return item.field == 'deviceNumber' |
|||
}).componentProps.options = res |
|||
}) |
|||
}else{ |
|||
MoldAccountApi.getMoldAccountsAllNoPage({ |
|||
factoryAreaNumber: cur, |
|||
type: type.value, |
|||
status: '0' |
|||
}).then((res) => { |
|||
DeviceRepair.allSchemas.formSchema.find(item => { |
|||
return item.field == 'deviceNumber' |
|||
}).componentProps.options = res |
|||
}) |
|||
} |
|||
} |
|||
|
|||
if (field == 'type') { |
|||
nextTick(() => { |
|||
const setV = {} |
|||
setV['deviceNumber'] = '' |
|||
formRef.setValues(setV) |
|||
}) |
|||
type.value = cur |
|||
if(cur != 'MOLD'){ |
|||
type.value = 'DEVICE' |
|||
DeviceAccountApi.getDeviceAccountsAllNoPage({ |
|||
factoryAreaNumber: factoryAreaNumber.value, |
|||
type: 'DEVICE', |
|||
status: '0' |
|||
}).then((res) => { |
|||
DeviceRepair.allSchemas.formSchema.find(item => { |
|||
return item.field == 'deviceNumber' |
|||
}).componentProps.options = res |
|||
}) |
|||
}else{ |
|||
type.value = 'MOLD' |
|||
MoldAccountApi.getMoldAccountsAllNoPage({ |
|||
factoryAreaNumber: factoryAreaNumber.value, |
|||
type: 'MOLD', |
|||
status: '0' |
|||
}).then((res) => { |
|||
DeviceRepair.allSchemas.formSchema.find(item => { |
|||
return item.field == 'deviceNumber' |
|||
}).componentProps.options = res |
|||
}) |
|||
} |
|||
|
|||
} |
|||
|
|||
// if (field == 'factoryAreaNumber') { |
|||
// // 获取当前的工厂区域编号 |
|||
// debugger |
|||
// delete DeviceRepair.allSchemas.formSchema.find(item => { |
|||
// return item.field == 'deviceNumber' |
|||
// }).value |
|||
// } |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
importTemplateData.templateUrl = await DeviceRepairApi.importTemplate() |
|||
}) |
|||
|
|||
|
|||
</script> |
|||
|
|||
|
@ -0,0 +1,248 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
import { selectAllFactoryArea } from '@/api/system/dept' |
|||
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' |
|||
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 factoryList = await selectAllFactoryArea() |
|||
const deviceList = ref([]); |
|||
const deviceListNoPage = await DeviceAccountsApi.getDeviceAccountsAllNoPage({}) |
|||
const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value != 'MOLD') |
|||
const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE) |
|||
// 表单校验
|
|||
export const DeviceRepairRules = reactive({ |
|||
number: [required], |
|||
deviceNumber: [required], |
|||
factoryAreaNumber: [required], |
|||
declarer: [required], |
|||
faultType: [required], |
|||
type: [required], |
|||
available: [required], |
|||
declarerPhone: [ |
|||
required, |
|||
{ validator:validateHanset, message: '输入手机号格式不正确', trigger: 'blur'} |
|||
] |
|||
// result: [required],
|
|||
}) |
|||
|
|||
export const DeviceRepair = 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' |
|||
}, |
|||
filterable: true, |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'Select', |
|||
api: () => factoryList, |
|||
componentProps: { |
|||
optionsAlias: { |
|||
labelField: 'name', |
|||
valueField: 'id' |
|||
}, |
|||
filterable: true, |
|||
}, |
|||
} |
|||
}, |
|||
{ |
|||
label: '类型', |
|||
field: 'type', |
|||
sort: 'custom', |
|||
table: { |
|||
width: '150', |
|||
}, |
|||
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|||
return deviceMoldTypeList.find((account) => account.value == cellValue)?.label |
|||
}, |
|||
isSearch: true, |
|||
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: "请选择类型" |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '设备', |
|||
field: 'deviceNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: '150', |
|||
}, |
|||
isSearch: true, |
|||
api: () => DeviceAccountsApi.getDeviceAccountsNoPage({ |
|||
isSearch: false |
|||
}), |
|||
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|||
return deviceListNoPage.find((account) => account.number == cellValue)?.name |
|||
}, |
|||
search: { |
|||
component: 'Select', |
|||
componentProps: { |
|||
options: deviceListNoPage, |
|||
optionsAlias: { |
|||
labelField: 'name', |
|||
valueField: 'number' |
|||
}, |
|||
filterable: true, |
|||
}, |
|||
}, |
|||
form: { |
|||
component: 'Select', |
|||
componentProps: { |
|||
options: deviceListNoPage, |
|||
optionsAlias: { |
|||
labelField: 'name', |
|||
valueField: 'number' |
|||
}, |
|||
filterable: true, |
|||
}, |
|||
} |
|||
}, |
|||
{ |
|||
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: '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' |
|||
} |
|||
} |
|||
])) |
File diff suppressed because it is too large
@ -0,0 +1,950 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { selectAllFactoryArea } from '@/api/system/dept' |
|||
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' |
|||
import { useUserStore } from '@/store/modules/user' |
|||
import { ItemSearchTable } from '../../basic/item/item.data' |
|||
import * as ItemApi from '@/api/eam/basic/item' |
|||
import * as UserApi from '@/api/system/user' |
|||
import { getStrDictOptions } from '@/utils/dict' |
|||
import { selecUserByType } from '@/api/system/dept' |
|||
const userStore = useUserStore() |
|||
const factoryList = await selectAllFactoryArea() |
|||
const deviceList = await DeviceAccountsApi.getDeviceAccountsNoPage({}) |
|||
const userListAll = await UserApi.getSimpleUserList() |
|||
const deviceListAll = await DeviceAccountsApi.getDeviceAccountsAllNoPage({}) |
|||
const dutyUserList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: null }) |
|||
const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value != 'MOLD') |
|||
const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE) |
|||
// 表单校验
|
|||
export const DeviceMaintenanceMainRules = reactive({ |
|||
number: [required], |
|||
requestNumber: [required], |
|||
deviceNumber: [required], |
|||
factoryAreaNumber: [required], |
|||
maintenance: [required], |
|||
type: [required], |
|||
classes: [required], |
|||
faultType: [required], |
|||
describes: [ |
|||
required, |
|||
{ max: 200, message: '不得超过200个字符', trigger: 'blur' }, |
|||
], |
|||
}) |
|||
|
|||
export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '维修工单编号', |
|||
field: 'number', |
|||
sort: 'custom', |
|||
table: { |
|||
width: '150', |
|||
fixed: 'left', |
|||
}, |
|||
isSearch: false, |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '报修工单编号', |
|||
field: 'requestNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: '150', |
|||
}, |
|||
isForm: false, |
|||
isSearch: false, |
|||
isTable: true, |
|||
}, |
|||
{ |
|||
label: '设备', |
|||
field: 'deviceNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: '150', |
|||
}, |
|||
isDetail: false, |
|||
api: () => deviceList, |
|||
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|||
return deviceListAll.find((account) => account.number == cellValue)?.name |
|||
}, |
|||
search: { |
|||
show: false, |
|||
component: 'Input', |
|||
api: () => deviceList, |
|||
componentProps: { |
|||
optionsAlias: { |
|||
labelField: 'name', |
|||
valueField: 'number' |
|||
}, |
|||
filterable: true, |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'Select', |
|||
api: () => deviceList, |
|||
componentProps: { |
|||
optionsAlias: { |
|||
labelField: 'name', |
|||
valueField: 'number' |
|||
}, |
|||
filterable: true, |
|||
}, |
|||
} |
|||
}, |
|||
{ |
|||
label: '设备', |
|||
field: 'deviceNumberDetail', |
|||
sort: 'custom', |
|||
isDetail: true, |
|||
isForm: false, |
|||
isSearch: false, |
|||
isTable: false, |
|||
isTableForm: false, |
|||
}, |
|||
{ |
|||
label: '厂区', |
|||
field: 'factoryAreaNumber', |
|||
sort: 'custom', |
|||
isDetail: false, |
|||
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' |
|||
}, |
|||
filterable: true, |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'Select', |
|||
api: () => factoryList, |
|||
componentProps: { |
|||
disabled: true, |
|||
optionsAlias: { |
|||
labelField: 'name', |
|||
valueField: 'id' |
|||
}, |
|||
filterable: true, |
|||
placeholder: "请先选择设备" |
|||
}, |
|||
} |
|||
}, |
|||
{ |
|||
label: '厂区', |
|||
field: 'factoryAreaNumberDetail', |
|||
sort: 'custom',etail: true, |
|||
isForm: false, |
|||
isSearch: false, |
|||
isTable: false, |
|||
isTableForm: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '维修人', |
|||
field: 'maintenance', |
|||
sort: 'custom', |
|||
isDetail: false, |
|||
table: { |
|||
width: '150', |
|||
}, |
|||
api: () => userListAll, |
|||
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|||
return userListAll.find((account) => account.id == cellValue)?.nickname |
|||
}, |
|||
form: { |
|||
component: 'Select', |
|||
api: () => userListAll, |
|||
componentProps: { |
|||
disabled: true, |
|||
optionsAlias: { |
|||
labelField: 'nickname', |
|||
valueField: 'id' |
|||
}, |
|||
filterable: true, |
|||
placeholder: "请先选择设备" |
|||
}, |
|||
}, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'Select', |
|||
api: () => userListAll, |
|||
componentProps: { |
|||
collapseTags: true, |
|||
collapseTagsTooltip: true, |
|||
optionsAlias: { |
|||
labelField: 'nickname', |
|||
valueField: 'id' |
|||
}, |
|||
filterable: true, |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '维修人', |
|||
field: 'maintenanceDetail', |
|||
sort: 'custom', |
|||
isDetail: true, |
|||
isForm: false, |
|||
isSearch: false, |
|||
isTable: false, |
|||
isTableForm: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '类型', |
|||
field: 'type', |
|||
sort: 'custom', |
|||
table: { |
|||
width: '150', |
|||
}, |
|||
isDetail: false, |
|||
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|||
return deviceMoldTypeList.find((account) => account.value == cellValue)?.label |
|||
}, |
|||
// dictType: DICT_TYPE.APP_DEVICE_MOLD_TYPE,
|
|||
isSearch: true, |
|||
form: { |
|||
component: 'Select', |
|||
componentProps: { |
|||
options: deviceTypeList, |
|||
optionsAlias: { |
|||
labelField: 'label', |
|||
valueField: 'value' |
|||
}, |
|||
disabled: true, |
|||
filterable: true, |
|||
placeholder: "请选择设备" |
|||
}, |
|||
}, |
|||
search: { |
|||
component: 'Select', |
|||
componentProps: { |
|||
options: deviceMoldTypeList, |
|||
optionsAlias: { |
|||
labelField: 'label', |
|||
valueField: 'value' |
|||
}, |
|||
disabled: false, |
|||
filterable: true, |
|||
placeholder: "请选择设备" |
|||
}, |
|||
}, |
|||
}, |
|||
{ |
|||
label: '类型', |
|||
field: 'typeDetail', |
|||
sort: 'custom', |
|||
isDetail: true, |
|||
isForm: false, |
|||
isSearch: false, |
|||
isTable: false, |
|||
isTableForm: false, |
|||
}, |
|||
{ |
|||
label: '班次', |
|||
field: 'classes', |
|||
sort: 'custom', |
|||
table: { |
|||
width: '150', |
|||
}, |
|||
isSearch: true, |
|||
dictType: DICT_TYPE.MAINTENANCE_SHIFT, |
|||
dictClass: 'string', |
|||
form: { |
|||
component: 'Select' |
|||
}, |
|||
}, |
|||
{ |
|||
label: '故障类型', |
|||
field: 'faultType', |
|||
sort: 'custom', |
|||
table: { |
|||
width: '150', |
|||
}, |
|||
isDetail: false, |
|||
isSearch: false, |
|||
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: 'status', |
|||
sort: 'custom', |
|||
table: { |
|||
width: '150', |
|||
}, |
|||
isSearch: false, |
|||
isTable: true, |
|||
isForm: false, |
|||
dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS, |
|||
dictClass: 'string', |
|||
form: { |
|||
component: 'Select', |
|||
componentProps: { |
|||
disabled: false, |
|||
} |
|||
}, |
|||
tableForm: { |
|||
type: 'Select', |
|||
componentProps: { |
|||
disabled: false, |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '完成方式', |
|||
field: 'result', |
|||
sort: 'custom', |
|||
table: { |
|||
width: '150', |
|||
}, |
|||
isSearch: false, |
|||
isTable: true, |
|||
isForm: false, |
|||
dictType: DICT_TYPE.ORDER_COMPLETE_RESULT, |
|||
dictClass: 'string', |
|||
}, |
|||
{ |
|||
label: '报修人', |
|||
field: 'declarer', |
|||
sort: 'custom', |
|||
isDetail: false, |
|||
isForm: false, |
|||
isSearch: true, |
|||
table: { |
|||
width: '150', |
|||
}, |
|||
api: () => userListAll, |
|||
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|||
return userListAll.find((account) => account.id == cellValue)?.nickname |
|||
}, |
|||
search: { |
|||
component: 'Select', |
|||
api: () => userListAll, |
|||
componentProps: { |
|||
collapseTags: true, |
|||
collapseTagsTooltip: true, |
|||
optionsAlias: { |
|||
labelField: 'nickname', |
|||
valueField: 'id' |
|||
}, |
|||
filterable: true, |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '报修人', |
|||
field: 'declarerDetail', |
|||
sort: 'custom', |
|||
isDetail: true, |
|||
isForm: false, |
|||
isSearch: false, |
|||
isTable: false, |
|||
isTableForm: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '报修人意见', |
|||
field: 'applyContent', |
|||
sort: 'custom', |
|||
isForm: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '验证人', |
|||
field: 'verifyer', |
|||
sort: 'custom', |
|||
isDetail: false, |
|||
isForm: false, |
|||
table: { |
|||
width: '150', |
|||
}, |
|||
api: () => userListAll, |
|||
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|||
return userListAll.find((account) => account.id == cellValue)?.nickname |
|||
}, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'Select', |
|||
api: () => userListAll, |
|||
componentProps: { |
|||
collapseTags: true, |
|||
collapseTagsTooltip: true, |
|||
optionsAlias: { |
|||
labelField: 'nickname', |
|||
valueField: 'id' |
|||
}, |
|||
filterable: true, |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '验证人', |
|||
field: 'verifyerDetail', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
isDetail: true, |
|||
isForm: false, |
|||
isSearch: false, |
|||
isTable: false, |
|||
isTableForm: false, |
|||
}, |
|||
{ |
|||
label: '验证人意见', |
|||
field: 'verifyContent', |
|||
sort: 'custom', |
|||
isForm: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
|
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 300, |
|||
fixed: 'right' |
|||
}, |
|||
isDetail: false |
|||
} |
|||
])) |
|||
|
|||
export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '维修编号', |
|||
field: 'number', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
form: { |
|||
component: 'Input', |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '故障描述', |
|||
field: 'describes', |
|||
sort: 'custom', |
|||
table: { |
|||
}, |
|||
isSearch: false, |
|||
form: { |
|||
component: 'Input', |
|||
componentProps: { |
|||
type: 'textarea', |
|||
} |
|||
|
|||
}, |
|||
}, |
|||
{ |
|||
label: '故障真因', |
|||
field: 'describes1', |
|||
sort: 'custom', |
|||
table: { |
|||
}, |
|||
isSearch: false, |
|||
form: { |
|||
component: 'Input', |
|||
componentProps: { |
|||
type: 'textarea', |
|||
} |
|||
|
|||
}, |
|||
}, |
|||
{ |
|||
label: '解决措施', |
|||
field: 'workOut', |
|||
sort: 'custom', |
|||
table: { |
|||
}, |
|||
isSearch: false, |
|||
form: { |
|||
component: 'Input', |
|||
componentProps: { |
|||
type: 'textarea', |
|||
} |
|||
|
|||
}, |
|||
}, |
|||
{ |
|||
label: '维修人', |
|||
field: 'maintenances', |
|||
sort: 'custom', |
|||
isDetail: false, |
|||
// formatter: (_: Recordable, __: TableColumn, cellValue) => {
|
|||
// let cellValueList = []
|
|||
// if (Array.isArray(cellValue)) {
|
|||
// cellValueList = cellValue
|
|||
// } else {
|
|||
// cellValueList = cellValue ? cellValue.split(',') : [];
|
|||
// }
|
|||
// // const cellValueList = cellValue ? cellValue.split(',') : [];
|
|||
// return userListAll
|
|||
// .filter(item => cellValueList.includes(item.id.toString()))
|
|||
// .map(item => item.nickname)
|
|||
// .join(',');
|
|||
// },
|
|||
isTable:true, |
|||
tableForm: { |
|||
type: 'Select', |
|||
initOptions: userListAll, |
|||
multiple: true, |
|||
collapseTags: true, |
|||
collapseTagsTooltip: true, |
|||
optionsAlias: { |
|||
labelField: 'nickname', |
|||
valueField: 'id' |
|||
}, |
|||
filterable: true, |
|||
}, |
|||
form: { |
|||
component: 'Select', |
|||
// api: () => dutyUserList,
|
|||
componentProps: { |
|||
multiple: true, |
|||
collapseTags: true, |
|||
collapseTagsTooltip: true, |
|||
optionsAlias: { |
|||
labelField: 'name', |
|||
valueField: 'id' |
|||
}, |
|||
filterable: true, |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '维修人', |
|||
field: 'maintenancesName', |
|||
sort: 'custom', |
|||
isForm:false, |
|||
isDetail:true, |
|||
isTable:false, |
|||
isTableForm:false |
|||
}, |
|||
{ |
|||
label: '备件', |
|||
field: 'itemNumbers1', |
|||
sort: 'custom', |
|||
table: { |
|||
}, |
|||
tableForm: { |
|||
isInpuFocusShow: true, // 开启查询弹窗
|
|||
searchListPlaceholder: '请选择备件', |
|||
searchField: 'itemNumbers1', |
|||
searchTitle: '备件', |
|||
multiple: true, |
|||
searchAllSchemas: ItemSearchTable.allSchemas, |
|||
searchPage: ItemApi.getItemList, |
|||
searchCondition: [{ |
|||
key: 'number', |
|||
value: 'deviceNumber', |
|||
message: '请选择设备模具编号!', |
|||
isMainValue: true |
|||
}] |
|||
}, |
|||
form: { |
|||
// labelMessage: '信息提示说明!!!',
|
|||
componentProps: { |
|||
isSearchList: true, // 开启查询弹窗
|
|||
searchListPlaceholder: '请选择备件', // 输入框占位文本
|
|||
searchField: 'itemNumbers1', // 查询弹窗赋值字段
|
|||
searchTitle: '备件', // 查询弹窗标题
|
|||
multiple: true, |
|||
searchAllSchemas: ItemSearchTable.allSchemas, // 查询弹窗所需类
|
|||
searchPage: ItemApi.getItemList, // 查询弹窗所需分页方法
|
|||
searchCondition: [{ |
|||
key: 'number', |
|||
value: 'deviceNumber', |
|||
message: '请选择设备模具编号!', |
|||
isMainValue: true |
|||
}] |
|||
} |
|||
}, |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '备件1', |
|||
field: 'itemNumbers', |
|||
sort: 'custom', |
|||
table: { |
|||
}, |
|||
isForm: false, |
|||
isDetail: false, |
|||
isTable: false, |
|||
isSearch: false, |
|||
isTableForm: false, |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 300, |
|||
fixed: 'right' |
|||
}, |
|||
isDetail: false, |
|||
isTableForm: false, |
|||
} |
|||
])) |
|||
// 表单校验
|
|||
export const DeviceMaintenanceDetailRules = reactive({ |
|||
describes: [ |
|||
required, |
|||
{ max: 200, message: '不得超过200个字符', trigger: 'blur' }, |
|||
], |
|||
describes1: [ |
|||
required, |
|||
{ max: 200, message: '不得超过200个字符', trigger: 'blur' }, |
|||
], |
|||
workOut: [ |
|||
required, |
|||
{ max: 200, message: '不得超过200个字符', trigger: 'blur' }, |
|||
], |
|||
maintenances: [required], |
|||
}) |
|||
|
|||
|
|||
|
|||
// 表单校验
|
|||
export const DeviceMaintenanceMainSecRules = reactive({ |
|||
number: [required], |
|||
requestNumber: [required], |
|||
deviceNumber: [required], |
|||
factoryAreaNumber: [required], |
|||
maintenance: [required], |
|||
turnType: [required], |
|||
type: [required], |
|||
classes: [required], |
|||
faultType: [required], |
|||
describes: [ |
|||
required, |
|||
{ max: 200, message: '不得超过200个字符', trigger: 'blur' }, |
|||
], |
|||
}) |
|||
|
|||
export const DeviceMaintenanceMainSec = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '维修工单编号', |
|||
field: 'number', |
|||
sort: 'custom', |
|||
table: { |
|||
width: '150', |
|||
}, |
|||
isSearch: false, |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '报修工单编号', |
|||
field: 'requestNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: '150', |
|||
}, |
|||
isForm: false, |
|||
isSearch: false, |
|||
isTable: true, |
|||
}, |
|||
{ |
|||
label: '转办类型', |
|||
field: 'turnType', |
|||
sort: 'custom', |
|||
isDetail: false, |
|||
isTable: false, |
|||
isSearch: false, |
|||
isForm: true, |
|||
dictType: DICT_TYPE.TURN_TYPE, |
|||
dictClass: 'string', |
|||
form: { |
|||
component: 'Select', |
|||
} |
|||
}, |
|||
{ |
|||
label: '类型', |
|||
field: 'type', |
|||
sort: 'custom', |
|||
table: { |
|||
width: '150', |
|||
}, |
|||
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|||
return deviceMoldTypeList.find((account) => account.value == cellValue)?.label |
|||
}, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'Select', |
|||
componentProps: { |
|||
options: deviceMoldTypeList, |
|||
optionsAlias: { |
|||
labelField: 'label', |
|||
valueField: 'value' |
|||
}, |
|||
filterable: true, |
|||
}, |
|||
}, |
|||
form: { |
|||
component: 'Select', |
|||
componentProps: { |
|||
options: deviceMoldTypeList, |
|||
optionsAlias: { |
|||
labelField: 'label', |
|||
valueField: 'value' |
|||
}, |
|||
filterable: true, |
|||
placeholder: "请选择设备" |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '厂区', |
|||
field: 'factoryAreaNumber', |
|||
sort: 'custom', |
|||
isDetail: false, |
|||
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' |
|||
}, |
|||
filterable: true, |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'Select', |
|||
api: () => factoryList, |
|||
componentProps: { |
|||
disabled: true, |
|||
optionsAlias: { |
|||
labelField: 'name', |
|||
valueField: 'id' |
|||
}, |
|||
filterable: true, |
|||
placeholder: "请先选择设备" |
|||
}, |
|||
} |
|||
}, |
|||
{ |
|||
label: '厂区', |
|||
field: 'factoryAreaNumber1', |
|||
sort: 'custom', |
|||
isDetail: true, |
|||
isSearch: false, |
|||
isForm: false, |
|||
isTable: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '设备模具', |
|||
field: 'deviceNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: '150', |
|||
}, |
|||
api: () => deviceList, |
|||
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|||
return deviceListAll.find((account) => account.number == cellValue)?.name |
|||
}, |
|||
search: { |
|||
show: false, |
|||
component: 'Input', |
|||
api: () => deviceList, |
|||
componentProps: { |
|||
optionsAlias: { |
|||
labelField: 'name', |
|||
valueField: 'number' |
|||
}, |
|||
filterable: true, |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'Select', |
|||
api: () => deviceList, |
|||
componentProps: { |
|||
optionsAlias: { |
|||
labelField: 'name', |
|||
valueField: 'number' |
|||
}, |
|||
filterable: true, |
|||
}, |
|||
} |
|||
}, |
|||
{ |
|||
label: '维修人', |
|||
field: 'maintenance', |
|||
sort: 'custom', |
|||
isDetail: false, |
|||
table: { |
|||
width: '150', |
|||
}, |
|||
api: () => dutyUserList, |
|||
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|||
return dutyUserList.find((account) => account.id == cellValue)?.name |
|||
}, |
|||
form: { |
|||
component: 'Select', |
|||
api: () => dutyUserList, |
|||
componentProps: { |
|||
disabled: false, |
|||
optionsAlias: { |
|||
labelField: 'name', |
|||
valueField: 'id' |
|||
}, |
|||
filterable: true, |
|||
placeholder: "请先选择设备" |
|||
}, |
|||
} |
|||
}, |
|||
{ |
|||
label: '维修人', |
|||
field: 'maintenance1', |
|||
sort: 'custom', |
|||
isDetail: true, |
|||
isSearch: false, |
|||
isForm: false, |
|||
isTable: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '班次', |
|||
field: 'classes', |
|||
sort: 'custom', |
|||
table: { |
|||
width: '150', |
|||
}, |
|||
isSearch: true, |
|||
dictType: DICT_TYPE.MAINTENANCE_SHIFT, |
|||
dictClass: 'string', |
|||
form: { |
|||
component: 'Select' |
|||
}, |
|||
}, |
|||
{ |
|||
label: '故障类型', |
|||
field: 'faultType', |
|||
sort: 'custom', |
|||
table: { |
|||
width: '150', |
|||
}, |
|||
isSearch: true, |
|||
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: 'status', |
|||
sort: 'custom', |
|||
table: { |
|||
width: '150', |
|||
}, |
|||
isSearch: false, |
|||
isTable: true, |
|||
isForm: false, |
|||
dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS, |
|||
dictClass: 'string', |
|||
form: { |
|||
component: 'Select', |
|||
componentProps: { |
|||
disabled: false, |
|||
} |
|||
}, |
|||
tableForm: { |
|||
type: 'Select', |
|||
componentProps: { |
|||
disabled: false, |
|||
} |
|||
}, |
|||
}, |
|||
// {
|
|||
// label: '完成方式',
|
|||
// field: 'result',
|
|||
// sort: 'custom',
|
|||
// table: {
|
|||
// width: '150',
|
|||
// },
|
|||
// isSearch: false,
|
|||
// isTable: true,
|
|||
// isForm: false,
|
|||
// dictType: DICT_TYPE.ORDER_COMPLETE_RESULT,
|
|||
// dictClass: 'string',
|
|||
// },
|
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 300, |
|||
fixed: 'right' |
|||
}, |
|||
isDetail: false |
|||
} |
|||
])) |
Loading…
Reference in new issue