ljlong_2630
7 months ago
9 changed files with 1427 additions and 42 deletions
@ -0,0 +1,63 @@ |
|||||
|
import request from '@/config/axios' |
||||
|
|
||||
|
export interface DeviceMoldItemsVO { |
||||
|
name: string |
||||
|
deviceNumber: string |
||||
|
type: string |
||||
|
status: string |
||||
|
siteId: string |
||||
|
available: string |
||||
|
concurrencyStamp: number |
||||
|
} |
||||
|
|
||||
|
|
||||
|
// 查询模具项记录表(设备 模具 保养 维修 巡检点检)列表
|
||||
|
export const getMoldItemsPage = async (params) => { |
||||
|
params.type="MOLD" |
||||
|
params.status="INSPECTION" |
||||
|
if (params.isSearch) { |
||||
|
delete params.isSearch |
||||
|
const data = {...params} |
||||
|
return await request.post({ url: '/eam/device-mold-items/senior', data }) |
||||
|
} else { |
||||
|
return await request.get({ url: `/eam/device-mold-items/page`, params }) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
// 查询项记录表(设备 模具 保养 维修 巡检点检)详情
|
||||
|
export const getDeviceMoldItems = async (id: number) => { |
||||
|
return await request.get({ url: `/eam/device-mold-items/get?id=` + id }) |
||||
|
} |
||||
|
|
||||
|
// 查询供应商发票申请主详情
|
||||
|
export const getNumber = async (params) => { |
||||
|
return await request.get({ url: `/eam/device-mold-items/getNumber`, params}) |
||||
|
} |
||||
|
|
||||
|
//新增模具
|
||||
|
export const creatMoldItems = async (data: DeviceMoldItemsVO) => { |
||||
|
data.type="MOLD" |
||||
|
data.status="INSPECTION" |
||||
|
return await request.post({ url: `/eam/device-mold-items/create`, data }) |
||||
|
} |
||||
|
|
||||
|
|
||||
|
// 修改模具项记录表(设备 模具 保养 维修 巡检点检)
|
||||
|
export const updateMoldItems = async (data: DeviceMoldItemsVO) => { |
||||
|
data.type="MOLD" |
||||
|
data.status="INSPECTION" |
||||
|
return await request.put({ url: `/eam/device-mold-items/update`, data }) |
||||
|
} |
||||
|
|
||||
|
// 删除项记录表(设备 模具 保养 维修 巡检点检)
|
||||
|
export const deleteDeviceMoldItems = async (id: number) => { |
||||
|
return await request.delete({ url: `/eam/device-mold-items/delete?id=` + id }) |
||||
|
} |
||||
|
|
||||
|
// 导出项记录表(设备 模具 保养 维修 巡检点检) Excel
|
||||
|
export const exportDeviceMoldItems = async (params) => { |
||||
|
return await request.download({ url: `/eam/device-mold-items/export-excel`, params }) |
||||
|
} |
||||
|
|
||||
|
|
@ -0,0 +1,57 @@ |
|||||
|
import request from '@/config/axios' |
||||
|
|
||||
|
export interface DeviceSpotInspectionRecordMainVO { |
||||
|
number: string |
||||
|
deviceNumber: string |
||||
|
describe: string |
||||
|
maintenance: number |
||||
|
maintenancePhone: string |
||||
|
status: string |
||||
|
type: string |
||||
|
siteId: string |
||||
|
available: string |
||||
|
approveOpinion?: string |
||||
|
concurrencyStamp: number |
||||
|
} |
||||
|
|
||||
|
// 查询检修工单主列表
|
||||
|
export const getDeviceSpotInspectionRecordMainPage = async (params) => { |
||||
|
params.type = 'MOLD' |
||||
|
if (params.isSearch) { |
||||
|
delete params.isSearch |
||||
|
const data = {...params} |
||||
|
return await request.post({ url: '/eam/device-spot-inspection-record-main/senior', data }) |
||||
|
} else { |
||||
|
return await request.get({ url: `/eam/device-spot-inspection-record-main/page`, params }) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 查询检修工单主详情
|
||||
|
export const getDeviceSpotInspectionRecordMain = async (id: number) => { |
||||
|
return await request.get({ url: `/eam/device-spot-inspection-record-main/get?id=` + id }) |
||||
|
} |
||||
|
|
||||
|
// 新增检修工单主
|
||||
|
export const createDeviceSpotInspectionRecordMain = async (data: DeviceSpotInspectionRecordMainVO) => { |
||||
|
return await request.post({ url: `/eam/device-spot-inspection-record-main/create`, data }) |
||||
|
} |
||||
|
|
||||
|
// 修改检修工单主
|
||||
|
export const updateDeviceSpotInspectionRecordMain = async (data: DeviceSpotInspectionRecordMainVO) => { |
||||
|
return await request.put({ url: `/eam/device-spot-inspection-record-main/update`, data }) |
||||
|
} |
||||
|
|
||||
|
// 删除检修工单主
|
||||
|
export const deleteDeviceSpotInspectionRecordMain = async (id: number) => { |
||||
|
return await request.delete({ url: `/eam/device-spot-inspection-record-main/delete?id=` + id }) |
||||
|
} |
||||
|
|
||||
|
// 导出检修工单主 Excel
|
||||
|
export const exportDeviceSpotInspectionRecordMain = async (params) => { |
||||
|
return await request.download({ url: `/eam/device-spot-inspection-record-main/export-excel`, params }) |
||||
|
} |
||||
|
|
||||
|
// 下载用户导入模板
|
||||
|
export const importTemplate = () => { |
||||
|
return request.download({ url: '/eam/device-spot-inspection-record-main/get-import-template' }) |
||||
|
} |
@ -0,0 +1,224 @@ |
|||||
|
<template> |
||||
|
<ContentWrap> |
||||
|
<!-- 搜索工作栏 --> |
||||
|
<Search :schema="DeviceMoldItems.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
||||
|
</ContentWrap> |
||||
|
|
||||
|
<!-- 列表头部 --> |
||||
|
<TableHead |
||||
|
:HeadButttondata="HeadButttondata" |
||||
|
@button-base-click="buttonBaseClick" |
||||
|
:routeName="routeName" |
||||
|
@updataTableColumns="updataTableColumns" |
||||
|
@searchFormClick="searchFormClick" |
||||
|
:allSchemas="DeviceMoldItems.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 #action="{ row }"> |
||||
|
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
||||
|
</template> |
||||
|
</Table> |
||||
|
</ContentWrap> |
||||
|
|
||||
|
<!-- 表单弹窗:添加/修改 --> |
||||
|
<BasicForm |
||||
|
ref="basicFormRef" |
||||
|
@success="formsSuccess" |
||||
|
:rules="DeviceMoldItemsRules" |
||||
|
:formAllSchemas="DeviceMoldItems.allSchemas" |
||||
|
:apiUpdate="DeviceMoldItemsApi.updateMoldItems" |
||||
|
:apiCreate="DeviceMoldItemsApi.creatMoldItems" |
||||
|
@searchTableSuccess="searchTableSuccess" |
||||
|
:isBusiness="false" |
||||
|
/> |
||||
|
|
||||
|
<!-- 详情 --> |
||||
|
<Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceMoldItems.allSchemas" /> |
||||
|
|
||||
|
</template> |
||||
|
|
||||
|
<script setup lang="ts"> |
||||
|
import download from '@/utils/download' |
||||
|
import { DeviceMoldItems,DeviceMoldItemsRules } from './moldInspection.data' |
||||
|
import * as DeviceMoldItemsApi from '@/api/eam/basic/moldInspection' |
||||
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
||||
|
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: 'MoldInspection' }) |
||||
|
|
||||
|
const message = useMessage() // 消息弹窗 |
||||
|
const { t } = useI18n() // 国际化 |
||||
|
const route = useRoute() // 路由信息 |
||||
|
const routeName = ref() |
||||
|
routeName.value = route.name |
||||
|
const tableColumns = ref(DeviceMoldItems.allSchemas.tableColumns) |
||||
|
|
||||
|
// 查询页面返回 |
||||
|
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: DeviceMoldItemsApi.getMoldItemsPage // 分页接口 |
||||
|
}) |
||||
|
|
||||
|
// 获得表格的各种操作 |
||||
|
const { getList, setSearchParams } = tableMethods |
||||
|
|
||||
|
// 列表头部按钮 |
||||
|
const HeadButttondata = [ |
||||
|
defaultButtons.defaultAddBtn(null), // 新增 |
||||
|
defaultButtons.defaultExportBtn(null), // 导出 |
||||
|
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 == 'export') { // 导出 |
||||
|
handleExport() |
||||
|
} else if (val == 'refresh') { // 刷新 |
||||
|
getList() |
||||
|
} else if (val == 'filtrate') { // 筛选 |
||||
|
} else { // 其他按钮 |
||||
|
console.log('其他按钮', item) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 列表-操作按钮 |
||||
|
const butttondata = [ |
||||
|
defaultButtons.mainListEditBtn(null), // 编辑 |
||||
|
defaultButtons.mainListDeleteBtn(null), // 删除 |
||||
|
] |
||||
|
|
||||
|
// 列表-操作按钮事件 |
||||
|
const buttonTableClick = async (val, row) => { |
||||
|
if (val == 'edit') { // 编辑 |
||||
|
openForm('update', row) |
||||
|
} else if (val == 'delete') { // 删除 |
||||
|
handleDelete(row.id) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** 添加/修改操作 */ |
||||
|
const basicFormRef = ref() |
||||
|
const openForm = (type: string, row?: any) => { |
||||
|
basicFormRef.value.open(type, row) |
||||
|
} |
||||
|
|
||||
|
// form表单提交 |
||||
|
const formsSuccess = async (formType,data) => { |
||||
|
var isHave =DeviceMoldItems.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; |
||||
|
if (formType === 'create') { |
||||
|
await DeviceMoldItemsApi.creatMoldItems(data) |
||||
|
message.success(t('common.createSuccess')) |
||||
|
} else { |
||||
|
await DeviceMoldItemsApi.updateMoldItems(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, 'basicDeviceMoldItems') |
||||
|
} |
||||
|
|
||||
|
/** 删除按钮操作 */ |
||||
|
const handleDelete = async (id: number) => { |
||||
|
try { |
||||
|
// 删除的二次确认 |
||||
|
await message.delConfirm() |
||||
|
// 发起删除 |
||||
|
await DeviceMoldItemsApi.deleteDeviceMoldItems(id) |
||||
|
message.success(t('common.delSuccess')) |
||||
|
// 刷新列表 |
||||
|
await getList() |
||||
|
} catch {} |
||||
|
} |
||||
|
|
||||
|
/** 导出按钮操作 */ |
||||
|
const exportLoading = ref(false) // 导出的加载中 |
||||
|
const handleExport = async () => { |
||||
|
try { |
||||
|
// 导出的二次确认 |
||||
|
await message.exportConfirm() |
||||
|
// 发起导出 |
||||
|
exportLoading.value = true |
||||
|
tableObject.params.type="MOLD" |
||||
|
tableObject.params.status="INSPECTION" |
||||
|
const data = await DeviceMoldItemsApi.exportDeviceMoldItems(tableObject.params) |
||||
|
download.excel(data, '项记录表(设备 模具 保养 维修 巡检点检).xlsx') |
||||
|
} catch { |
||||
|
} finally { |
||||
|
exportLoading.value = false |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 筛选提交 |
||||
|
const searchFormClick = (searchData) => { |
||||
|
tableObject.params = { |
||||
|
isSearch: true, |
||||
|
filters: searchData.filters |
||||
|
} |
||||
|
getList() // 刷新当前列表 |
||||
|
} |
||||
|
|
||||
|
/** 初始化 **/ |
||||
|
onMounted(async () => { |
||||
|
getList() |
||||
|
}) |
||||
|
|
||||
|
</script> |
@ -0,0 +1,166 @@ |
|||||
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
||||
|
import { dateFormatter } from '@/utils/formatTime' |
||||
|
import * as DeviceMoldItemsApi from '@/api/eam/basic/deviceMaintenance' |
||||
|
|
||||
|
// 表单校验
|
||||
|
export const DeviceMoldItemsRules = reactive({ |
||||
|
name: [required], |
||||
|
deviceNumber: [required], |
||||
|
type: [required], |
||||
|
status: [required], |
||||
|
concurrencyStamp: [required], |
||||
|
}) |
||||
|
|
||||
|
export const DeviceMOLD = useCrudSchemas(reactive<CrudSchema[]>([ |
||||
|
{ |
||||
|
label: '编号', |
||||
|
field: 'number', |
||||
|
sort: 'custom', |
||||
|
isForm: false, |
||||
|
table: { |
||||
|
width: 180, |
||||
|
fixed: 'left' |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '名称', |
||||
|
field: 'name', |
||||
|
sort: 'custom', |
||||
|
}, |
||||
|
{ |
||||
|
label: '规格型号', |
||||
|
field: 'specification', |
||||
|
sort: 'custom', |
||||
|
}, |
||||
|
|
||||
|
])) |
||||
|
|
||||
|
export const DeviceMoldItems = useCrudSchemas(reactive<CrudSchema[]>([ |
||||
|
{ |
||||
|
label: '巡检点检项', |
||||
|
field: 'name', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
form: { |
||||
|
componentProps: { |
||||
|
type: 'textarea', |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '类型', |
||||
|
field: 'type', |
||||
|
dictType: DICT_TYPE.DEVICE_MOLD_TYPE, |
||||
|
dictClass: 'string', |
||||
|
sort: 'custom', |
||||
|
isSearch: false, |
||||
|
form: { |
||||
|
value: 'MOLD', |
||||
|
componentProps: { |
||||
|
disabled: true, |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '模具编号', |
||||
|
field: 'deviceNumber', |
||||
|
sort: 'custom', |
||||
|
isSearch: false, |
||||
|
form: { |
||||
|
// labelMessage: '信息提示说明!!!',
|
||||
|
componentProps: { |
||||
|
isSearchList: true, // 开启查询弹窗
|
||||
|
searchListPlaceholder: '请选择单号', // 输入框占位文本
|
||||
|
searchField: 'number', // 查询弹窗赋值字段
|
||||
|
searchTitle: '单号信息', // 查询弹窗标题
|
||||
|
searchAllSchemas: DeviceMOLD.allSchemas, // 查询弹窗所需类
|
||||
|
searchPage: DeviceMoldItemsApi.getNumber, // 查询弹窗所需分页方法
|
||||
|
searchCondition: [ |
||||
|
{ |
||||
|
key: 'available', |
||||
|
value: "TRUE", |
||||
|
isMainValue: false |
||||
|
}, { |
||||
|
key: 'type', |
||||
|
value: 'type', |
||||
|
isMainValue: true |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '模具名称', |
||||
|
field: 'deviceName', |
||||
|
sort: 'custom', |
||||
|
isSearch: false, |
||||
|
isForm: false, |
||||
|
}, |
||||
|
{ |
||||
|
label: '项类型', |
||||
|
field: 'status', |
||||
|
dictType: DICT_TYPE.DEVICEMOLDITEMS_STATUS, |
||||
|
dictClass: 'string', |
||||
|
sort: 'custom', |
||||
|
isSearch: false, |
||||
|
form: { |
||||
|
component: 'Select', |
||||
|
value: 'INSPECTION', |
||||
|
componentProps: { |
||||
|
disabled: true |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
label: '模具部位', |
||||
|
field: 'equipmentParts', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
}, |
||||
|
|
||||
|
// {
|
||||
|
// label: '是否可用',
|
||||
|
// field: 'available',
|
||||
|
// dictType: DICT_TYPE.TRUE_FALSE,
|
||||
|
// dictClass: 'string',
|
||||
|
// isSearch: false,
|
||||
|
// isTable: true,
|
||||
|
// sort: 'custom',
|
||||
|
// table: {
|
||||
|
// width: 150
|
||||
|
// },
|
||||
|
// tableForm: {
|
||||
|
// type: 'Select',
|
||||
|
// inactiveValue: 'FALSE',
|
||||
|
// disabled: true
|
||||
|
// },
|
||||
|
// form: {
|
||||
|
// component: 'Switch',
|
||||
|
// value: 'TRUE',
|
||||
|
// componentProps: {
|
||||
|
// inactiveValue: 'FALSE',
|
||||
|
// activeValue: 'TRUE'
|
||||
|
// }
|
||||
|
// }
|
||||
|
// },
|
||||
|
{ |
||||
|
label: '创建时间', |
||||
|
field: 'createTime', |
||||
|
sort: 'custom', |
||||
|
formatter: dateFormatter, |
||||
|
isForm: false, |
||||
|
table: { |
||||
|
width: 170 |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '操作', |
||||
|
field: 'action', |
||||
|
isForm: false, |
||||
|
table: { |
||||
|
width: 150, |
||||
|
fixed: 'right' |
||||
|
} |
||||
|
} |
||||
|
])) |
@ -0,0 +1,549 @@ |
|||||
|
<template> |
||||
|
<ContentWrap> |
||||
|
<!-- 搜索工作栏 --> |
||||
|
<Search |
||||
|
:schema="DeviceSpotInspectionRecordMain.allSchemas.searchSchema" |
||||
|
@search="setSearchParams" |
||||
|
@reset="setSearchParams" |
||||
|
/> |
||||
|
</ContentWrap> |
||||
|
|
||||
|
<!-- 列表头部 --> |
||||
|
<TableHead |
||||
|
:HeadButttondata="HeadButttondata" |
||||
|
@button-base-click="buttonBaseClick" |
||||
|
:routeName="routeName" |
||||
|
@updataTableColumns="updataTableColumns" |
||||
|
@searchFormClick="searchFormClick" |
||||
|
:allSchemas="DeviceSpotInspectionRecordMain.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 #number="{ row }"> |
||||
|
<el-button type="primary" link @click="openDetail(row, '代码', row.number)"> |
||||
|
<span>{{ row.number }}</span> |
||||
|
</el-button> |
||||
|
</template> |
||||
|
<template #action="{ row }"> |
||||
|
<ButtonBase |
||||
|
:Butttondata="butttondata(row)" |
||||
|
@button-base-click="buttonTableClick($event, row)" |
||||
|
/> |
||||
|
</template> |
||||
|
</Table> |
||||
|
</ContentWrap> |
||||
|
|
||||
|
<!-- 表单弹窗:添加/修改 --> |
||||
|
<BasicForm |
||||
|
ref="formRef" |
||||
|
:rules="DeviceSpotInspectionRecordMainRules" |
||||
|
:formAllSchemas="DeviceSpotInspectionRecordMain.allSchemas" |
||||
|
:tableAllSchemas="DeviceSpotInspectionRecordDetail.allSchemas" |
||||
|
:tableFormRules="DeviceSpotInspectionRecordDetailRules" |
||||
|
:tableData="tableData" |
||||
|
:apiUpdate="DeviceSpotInspectionRecordMainApi.updateDeviceSpotInspectionRecordMain" |
||||
|
:apiCreate="DeviceSpotInspectionRecordMainApi.createDeviceSpotInspectionRecordMain" |
||||
|
:isBusiness="true" |
||||
|
@onChange="onChange" |
||||
|
@handleAddTable="handleAddTable" |
||||
|
@handleDeleteTable="handleDeleteTable" |
||||
|
@searchTableSuccess="searchTableSuccess" |
||||
|
@submitForm="submitForm" |
||||
|
:isSearchTableItem="true" |
||||
|
/> |
||||
|
|
||||
|
<!-- 详情 --> |
||||
|
<!-- <Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceSpotInspectionRecordMain.allSchemas" /> --> |
||||
|
<Detail |
||||
|
ref="detailRef" |
||||
|
:isBasic="false" |
||||
|
:allSchemas="DeviceSpotInspectionRecordMain.allSchemas" |
||||
|
:detailAllSchemas="DeviceSpotInspectionRecordDetail.allSchemas" |
||||
|
:detailAllSchemasRules="DeviceSpotInspectionRecordDetailRules" |
||||
|
:apiCreate="DeviceSpotInspectionRecordDetailApi.createDeviceSpotInspectionRecordDetail" |
||||
|
:apiUpdate="DeviceSpotInspectionRecordDetailApi.updateDeviceSpotInspectionRecordDetail" |
||||
|
:apiPage="DeviceSpotInspectionRecordDetailApi.getDeviceSpotInspectionRecordDetailPage" |
||||
|
:apiDelete="DeviceSpotInspectionRecordDetailApi.deleteDeviceSpotInspectionRecordDetail" |
||||
|
:Echo="Echo" |
||||
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
||||
|
@detailOpenForm="detailOpenForm" |
||||
|
:detailValidate="detailValidate" |
||||
|
@detailSubmitForm="detailSubmitForm" |
||||
|
:isSearchTableItem="true" |
||||
|
:buttonControllFunction="buttonControllFunction" |
||||
|
/> |
||||
|
|
||||
|
<Dialog |
||||
|
ref="updateDialog" |
||||
|
title="审批意见" |
||||
|
v-model="dialogVisible" |
||||
|
:width="600" |
||||
|
:maxHeight="700" |
||||
|
:style="{height:'450px'}" |
||||
|
:before-close="handleBeforeClose" |
||||
|
> |
||||
|
<el-form :model="updateFormValue" class="demo-form-inline"> |
||||
|
<el-form-item label="审批意见"> |
||||
|
<el-input |
||||
|
type="textarea" |
||||
|
v-model="updateFormValue.approveOpinion" |
||||
|
placeholder="请对审批添加意见" |
||||
|
clearable |
||||
|
:rows="12" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<template #footer> |
||||
|
<div style="text-align: center;"> |
||||
|
<el-button type="success" @click="onSubmit('APPROVEPASS')">通过</el-button> |
||||
|
<el-button type="danger" @click="onSubmit('APPROVEREJECTED')">不通过</el-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
</Dialog> |
||||
|
|
||||
|
<!-- 导入 --> |
||||
|
<ImportForm |
||||
|
ref="importFormRef" |
||||
|
url="/eam/device-maintenance-job-main/import" |
||||
|
:importTemplateData="importTemplateData" |
||||
|
@success="importSuccess" |
||||
|
/> |
||||
|
</template> |
||||
|
|
||||
|
<script setup lang="ts"> |
||||
|
import download from '@/utils/download' |
||||
|
import { |
||||
|
DeviceSpotInspectionRecordMain, |
||||
|
DeviceSpotInspectionRecordMainRules, |
||||
|
DeviceSpotInspectionRecordDetail, |
||||
|
DeviceSpotInspectionRecordDetailRules |
||||
|
} from './moldSpotInspectionRecordMain.data' |
||||
|
import * as DeviceSpotInspectionRecordMainApi from '@/api/eam/mold/moldSpotInspectionRecordMain' |
||||
|
import { DeviceSpotInspectionRecordMainVO } from '@/api/eam/mold/moldSpotInspectionRecordMain' |
||||
|
import * as DeviceSpotInspectionRecordDetailApi from '@/api/eam/device/deviceSpotInspectionRecordDetail' |
||||
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
||||
|
import { useUserStore } from '@/store/modules/user' |
||||
|
import * as UserApi from '@/api/system/user' |
||||
|
|
||||
|
defineOptions({ name: 'MoldSpotInspectionRecordMain' }) |
||||
|
const message = useMessage() // 消息弹窗 |
||||
|
const { t } = useI18n() // 国际化 |
||||
|
const userStore = useUserStore() // 用户信息 |
||||
|
const route = useRoute() // 路由信息 |
||||
|
const routeName = ref() |
||||
|
const formRef = ref() |
||||
|
routeName.value = route.name |
||||
|
const tableColumns = ref(DeviceSpotInspectionRecordMain.allSchemas.tableColumns) |
||||
|
|
||||
|
const apiPage = ref(DeviceSpotInspectionRecordDetailApi.getDeviceSpotInspectionRecordDetailPage) |
||||
|
const detailAllSchemas = ref(DeviceSpotInspectionRecordDetail.allSchemas) |
||||
|
const tableData = ref([]) |
||||
|
const dialogVisible = ref(false) |
||||
|
const updateFormValue = ref({//审批 |
||||
|
approveOpinion:'', |
||||
|
id:null, |
||||
|
status:null |
||||
|
}) |
||||
|
// 字段设置 更新主列表字段 |
||||
|
const updataTableColumns = (val) => { |
||||
|
tableColumns.value = val |
||||
|
} |
||||
|
// 查询页面返回 |
||||
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
||||
|
nextTick(() => { |
||||
|
if (type == 'tableForm') { |
||||
|
// 明细查询页赋值 |
||||
|
if (formField == 'itemNumbers1') { |
||||
|
let str = '' |
||||
|
val.forEach((element) => { |
||||
|
str += element.name + ':' + element.qty + ',' |
||||
|
}) |
||||
|
str = str.substring(0, str.length - 1) |
||||
|
row['itemNumbers1'] = str |
||||
|
row['itemNumbers'] = val |
||||
|
} |
||||
|
} else { |
||||
|
// const setV = {} |
||||
|
// setV[formField] = val[0][searchField] |
||||
|
// setV['supplierCode'] = val[0]['code'] |
||||
|
// formRef.setValues(setV) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 查询页面返回——详情 |
||||
|
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
||||
|
nextTick(() => { |
||||
|
setV[formField] = val[0][searchField] |
||||
|
const setV = {} |
||||
|
if (formField == 'itemNumbers1') { |
||||
|
let str = '' |
||||
|
val.forEach((element) => { |
||||
|
str += element.name + ':' + element.qty + ',' |
||||
|
}) |
||||
|
str = str.substring(0, str.length - 1) |
||||
|
setV['itemNumbers'] = val |
||||
|
setV['itemNumbers1'] = str |
||||
|
} |
||||
|
formRef.setValues(setV) |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 子表新增的时候选择表格之后需要会显得字段 |
||||
|
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom'] |
||||
|
const Echo = [] |
||||
|
|
||||
|
|
||||
|
const { tableObject, tableMethods } = useTable({ |
||||
|
getListApi: DeviceSpotInspectionRecordMainApi.getDeviceSpotInspectionRecordMainPage // 分页接口 |
||||
|
}) |
||||
|
|
||||
|
// 获得表格的各种操作 |
||||
|
const { getList, setSearchParams } = tableMethods |
||||
|
|
||||
|
// 列表头部按钮 |
||||
|
const HeadButttondata = [ |
||||
|
// defaultButtons.defaultAddBtn(null), // 新增 |
||||
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
||||
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
||||
|
defaultButtons.defaultSetBtn(null) // 设置 |
||||
|
] |
||||
|
|
||||
|
// 头部按钮事件 |
||||
|
const buttonBaseClick = (val, item) => { |
||||
|
if (val == 'add') { |
||||
|
// 新增 |
||||
|
DeviceSpotInspectionRecordMain.allSchemas.formSchema.find(item => { |
||||
|
return item.field == 'type' |
||||
|
}).value = 'DEVICE' |
||||
|
DeviceSpotInspectionRecordMain.allSchemas.formSchema.find(item => { |
||||
|
return item.field == 'deviceNumber' |
||||
|
}).componentProps.disabled = false |
||||
|
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 isShowMainButton = (row, val) => { |
||||
|
if (val.indexOf(row.status) > -1) { |
||||
|
return false |
||||
|
} else { |
||||
|
return true |
||||
|
} |
||||
|
} |
||||
|
// 列表-操作按钮 |
||||
|
const butttondata = (row) => { |
||||
|
return [ |
||||
|
defaultButtons.approveBtn({ hide: !(row.status == 'COMPLETED' && judgeIfMoldRole())}), // 审批 |
||||
|
] |
||||
|
} |
||||
|
const onChange = (field, cur, item) => { |
||||
|
if (field == 'deviceNumber') { |
||||
|
formRef.value.formRef.formModel.factoryAreaNumber =String(item.componentProps.options.find((item) => item.number == cur).factoryAreaNumber) |
||||
|
console.log(typeof formRef.value.formRef.formModel.factoryAreaNumber) |
||||
|
// console.log(item) |
||||
|
// console.log(item.componentProps.options) |
||||
|
formRef.value.formRef.formModel.maintenance = Number(userStore?.getUser?.id) |
||||
|
} |
||||
|
} |
||||
|
// 列表-操作按钮事件 |
||||
|
const buttonTableClick = async (val, row) => { |
||||
|
if (val == 'approve') {//审批 |
||||
|
dialogVisible.value = true; |
||||
|
updateFormValue.value.id = row.id |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
/** 添加/修改操作 */ |
||||
|
|
||||
|
const openForm = (type: string, row?: any) => { |
||||
|
tableData.value = [] // 重置明细数据 |
||||
|
formRef.value.open(type, row) |
||||
|
} |
||||
|
|
||||
|
/** 详情操作 */ |
||||
|
const detailRef = ref() |
||||
|
const openDetail =async (row: any, titleName: any, titleValue: any) => { |
||||
|
const userListAll = await UserApi.getSimpleUserList() |
||||
|
row.maintenanceName = userListAll.find((account) => account.id == row.maintenance)?.nickname |
||||
|
detailRef.value.openDetail(row, titleName, titleValue,'DeviceSpotInspectionRecordMain') |
||||
|
} |
||||
|
|
||||
|
/** 删除按钮操作 */ |
||||
|
const handleDelete = async (id: number) => { |
||||
|
try { |
||||
|
// 删除的二次确认 |
||||
|
await message.delConfirm() |
||||
|
// 发起删除 |
||||
|
await DeviceSpotInspectionRecordMainApi.deleteDeviceSpotInspectionRecordMain(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 DeviceSpotInspectionRecordMainApi.exportDeviceSpotInspectionRecordMain(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 acceptOrder(row) { |
||||
|
DeviceSpotInspectionRecordMainApi.orderStepChange(row) |
||||
|
} |
||||
|
// 转办 |
||||
|
function turnOrder() {} |
||||
|
// 完成 |
||||
|
function finishOrder() {} |
||||
|
// 验证 |
||||
|
function verifyOrder() {} |
||||
|
// 维修 |
||||
|
function repair() {} |
||||
|
|
||||
|
// 详情 |
||||
|
function mainListDetail() {} |
||||
|
/** |
||||
|
* tableForm方法 |
||||
|
*/ |
||||
|
const tableFormKeys = {} |
||||
|
DeviceSpotInspectionRecordDetail.allSchemas.tableFormColumns.forEach((item) => { |
||||
|
tableFormKeys[item.field] = item.default ? item.default : '' |
||||
|
}) |
||||
|
|
||||
|
// 添加明细 |
||||
|
const handleAddTable = () => { |
||||
|
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys))) |
||||
|
} |
||||
|
// 删除明细 |
||||
|
const handleDeleteTable = (item, index) => { |
||||
|
tableData.value.splice(index, 1) |
||||
|
} |
||||
|
|
||||
|
// 主子数据 提交 |
||||
|
const submitForm = async (formType, data) => { |
||||
|
data.subList = tableData.value.map((item) => { |
||||
|
return { |
||||
|
describes: item.describes, |
||||
|
describes1: item.describes1, |
||||
|
itemNumbers: item.itemNumbers1, |
||||
|
maintenances: item.maintenances.join(','), |
||||
|
workOut: item.workOut, |
||||
|
} |
||||
|
}) // 拼接子表数据参数 |
||||
|
console.log(data.subList) |
||||
|
try { |
||||
|
if (formType === 'create') { |
||||
|
await DeviceSpotInspectionRecordMainApi.createDeviceSpotInspectionRecordMain(data) |
||||
|
message.success(t('common.createSuccess')) |
||||
|
} else { |
||||
|
await DeviceSpotInspectionRecordMainApi.updateDeviceSpotInspectionRecordMain(data) |
||||
|
message.success(t('common.updateSuccess')) |
||||
|
} |
||||
|
formRef.value.dialogVisible = false |
||||
|
// 刷新当前列表 |
||||
|
getList() |
||||
|
} finally { |
||||
|
formRef.value.formLoading = false |
||||
|
} |
||||
|
} |
||||
|
const detailOpenForm = (type, row) =>{ |
||||
|
console.log("type",type); |
||||
|
console.log("row",row); |
||||
|
DeviceSpotInspectionRecordDetail.allSchemas.tableFormColumns.map((item) => { |
||||
|
// if(purchaseReceiptRecordNumberRef.value == ''){ |
||||
|
// if (item.field == 'itemCode') { |
||||
|
// item.form.componentProps.disabled = true |
||||
|
// item.form.componentProps.isSearchList = true |
||||
|
// } |
||||
|
// if(item.field == 'poLine'){ |
||||
|
// item.form.componentProps.disabled = true |
||||
|
// item.form.componentProps.isSearchList = false |
||||
|
// } |
||||
|
// }else{ |
||||
|
// if (item.field == 'itemCode') { |
||||
|
// item.form.componentProps.disabled = true |
||||
|
// item.form.componentProps.isSearchList = false |
||||
|
// } |
||||
|
// if(item.field == 'poLine'){ |
||||
|
// item.form.componentProps.disabled = true |
||||
|
// item.form.componentProps.isSearchList = true |
||||
|
// } |
||||
|
// } |
||||
|
}) |
||||
|
} |
||||
|
// 子表新增/编辑校验 |
||||
|
const detailValidate = (data) => { |
||||
|
return true; |
||||
|
let tag = false; |
||||
|
if(data.qty <= 0){ |
||||
|
message.warning('数量必须大于0') |
||||
|
tag = false; |
||||
|
return tag; |
||||
|
}else { |
||||
|
tag = true; |
||||
|
return tag; |
||||
|
} |
||||
|
} |
||||
|
// 子表提交 |
||||
|
const detailSubmitForm= async (formType,data,getList,formRef,tableList) => { |
||||
|
try { |
||||
|
let data1 = { |
||||
|
id:data.id, |
||||
|
maintenanceNumber:data.maintenanceNumber, |
||||
|
describes:data.describes, |
||||
|
describes1:data.describes1, |
||||
|
itemNumbers:data.itemNumbers, |
||||
|
maintenances:data.maintenances?.join(','), |
||||
|
workOut:data.workOut, |
||||
|
} |
||||
|
console.log(data1) |
||||
|
if (formType === 'create') { |
||||
|
await DeviceSpotInspectionRecordDetailApi.createDeviceSpotInspectionRecordDetail(data1) |
||||
|
message.success(t('common.createSuccess')) |
||||
|
} else { |
||||
|
await DeviceSpotInspectionRecordDetailApi.updateDeviceSpotInspectionRecordDetail(data1) |
||||
|
message.success(t('common.updateSuccess')) |
||||
|
} |
||||
|
formRef.dialogVisible = false |
||||
|
// 刷新当前列表 |
||||
|
await getList() |
||||
|
detailRef.value.tableObject.tableList.forEach(item=>{ |
||||
|
if (item.itemNumbers?.length>0) { |
||||
|
let str = '' |
||||
|
item.itemNumbers.forEach(element => { |
||||
|
str += element.name + ':' + element.qty + ',' |
||||
|
}) |
||||
|
item.itemNumbers1 = str.substring(0, str.length - 1) |
||||
|
} |
||||
|
|
||||
|
}) |
||||
|
} finally { |
||||
|
formRef.formLoading = false |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
function buttonControllFunction(row, val) { |
||||
|
if (val == 'delete') { |
||||
|
if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' ) { |
||||
|
return false |
||||
|
} else { |
||||
|
return true |
||||
|
} |
||||
|
} else if (val == 'edit') { |
||||
|
if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' ) { |
||||
|
return false |
||||
|
} else { |
||||
|
return true |
||||
|
} |
||||
|
} else if(val == 'add') { |
||||
|
if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED') { |
||||
|
return false |
||||
|
} else { |
||||
|
return true |
||||
|
} |
||||
|
} else { |
||||
|
return true |
||||
|
} |
||||
|
} |
||||
|
/** |
||||
|
* 判断是否为模具工程师 |
||||
|
*/ |
||||
|
const judgeIfMoldRole = () => { |
||||
|
const rolesOk = userStore.roles.find(item => { |
||||
|
return item == 'mold_class_Engineer_role' |
||||
|
}) |
||||
|
if (rolesOk != undefined && rolesOk != null) { |
||||
|
return true |
||||
|
} else { |
||||
|
return false |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
const handleBeforeClose = async(done)=>{ |
||||
|
done() |
||||
|
} |
||||
|
|
||||
|
const onSubmit = async (status: string) => { |
||||
|
try { |
||||
|
const data: DeviceSpotInspectionRecordMainVO = { |
||||
|
approveOpinion: updateFormValue.value.approveOpinion, |
||||
|
status: status, |
||||
|
id:updateFormValue.value.id |
||||
|
}; |
||||
|
await DeviceSpotInspectionRecordMainApi.updateDeviceSpotInspectionRecordMain(data); |
||||
|
message.success(t('common.updateSuccess')); |
||||
|
dialogVisible.value = false; |
||||
|
// Refresh the current list |
||||
|
getList(); |
||||
|
} finally { |
||||
|
formRef.value.formLoading = false; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** 初始化 **/ |
||||
|
onMounted(async () => { |
||||
|
getList() |
||||
|
importTemplateData.templateUrl = await DeviceSpotInspectionRecordMainApi.importTemplate() |
||||
|
}) |
||||
|
</script> |
@ -0,0 +1,263 @@ |
|||||
|
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 { useUserStore } from '@/store/modules/user' |
||||
|
import { selecUserByType } from '@/api/system/dept' |
||||
|
import { ItemSearchTable } from '../../basic/item/item.data' |
||||
|
import * as ItemApi from '@/api/eam/basic/item' |
||||
|
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' |
||||
|
import * as UserApi from '@/api/system/user' |
||||
|
import { fa } from 'element-plus/es/locale' |
||||
|
// 邮箱账号的列表
|
||||
|
const factoryList = await selectAllFactoryArea() |
||||
|
const deviceList = await DeviceAccountsApi.getDeviceAccountsNoPage({}) |
||||
|
const userList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: 1 }) |
||||
|
const userListAll = await UserApi.getSimpleUserList() |
||||
|
const deviceListNoPage = await DeviceAccountsApi.getDeviceAccountsAllNoPage({}) |
||||
|
const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value == 'DEVICE') |
||||
|
const deviceDeviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE) |
||||
|
const isConformList = [{ |
||||
|
label:'是', |
||||
|
value:'TRUE' |
||||
|
},{ |
||||
|
label:'否', |
||||
|
value:'FALSE' |
||||
|
}] |
||||
|
// 表单校验
|
||||
|
export const DeviceSpotInspectionRecordMainRules = reactive({ |
||||
|
deviceNumber: [required], |
||||
|
status: [required], |
||||
|
type: [required], |
||||
|
concurrencyStamp: [required], |
||||
|
}) |
||||
|
|
||||
|
export const DeviceSpotInspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([ |
||||
|
{ |
||||
|
label: '巡检点检编号', |
||||
|
field: 'number', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
table: { |
||||
|
width: '150', |
||||
|
fixed: 'left', |
||||
|
}, |
||||
|
isForm: false, |
||||
|
}, |
||||
|
{ |
||||
|
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: deviceList, |
||||
|
optionsAlias: { |
||||
|
labelField: 'name', |
||||
|
valueField: 'number' |
||||
|
}, |
||||
|
filterable: true, |
||||
|
}, |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '维修人', |
||||
|
field: 'maintenance', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: '150', |
||||
|
}, |
||||
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
||||
|
return userListAll.find((account) => account.id == cellValue)?.nickname |
||||
|
}, |
||||
|
isDetail:false, |
||||
|
form: { |
||||
|
component: 'Select', |
||||
|
api: () => userList, |
||||
|
componentProps: { |
||||
|
disabled: true, |
||||
|
optionsAlias: { |
||||
|
labelField: 'name', |
||||
|
valueField: 'id' |
||||
|
}, |
||||
|
filterable: true, |
||||
|
}, |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '维修人', |
||||
|
field: 'maintenanceName', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: '150', |
||||
|
}, |
||||
|
isForm:false, |
||||
|
isDetail:true, |
||||
|
isSearch:false, |
||||
|
isTable:false |
||||
|
}, |
||||
|
{ |
||||
|
label: '状态', |
||||
|
field: 'status', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS, |
||||
|
dictClass: 'string', |
||||
|
table: { |
||||
|
width: 'c', |
||||
|
}, |
||||
|
form: { |
||||
|
component: 'Select' |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '类型', |
||||
|
field: 'type', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: 'getDeviceSpotInspectionRecordMainSenior', |
||||
|
}, |
||||
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
||||
|
return deviceDeviceTypeList.find((account) => account.value == cellValue)?.label |
||||
|
}, |
||||
|
isSearch: false, |
||||
|
isTable: false, |
||||
|
search: { |
||||
|
component: 'Select', |
||||
|
componentProps: { |
||||
|
options: deviceTypeList, |
||||
|
optionsAlias: { |
||||
|
labelField: 'label', |
||||
|
valueField: 'value' |
||||
|
}, |
||||
|
filterable: true, |
||||
|
}, |
||||
|
}, |
||||
|
form: { |
||||
|
component: 'Select', |
||||
|
componentProps: { |
||||
|
options: deviceTypeList, |
||||
|
optionsAlias: { |
||||
|
labelField: 'label', |
||||
|
valueField: 'value' |
||||
|
}, |
||||
|
filterable: true, |
||||
|
placeholder: "请选择设备" |
||||
|
} |
||||
|
}, |
||||
|
detail:{ |
||||
|
dictType:DICT_TYPE.APP_DEVICE_MOLD_TYPE |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '描述', |
||||
|
field: 'describes', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: '300', |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '审批意见', |
||||
|
field: 'approveOpinion', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: '300', |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '操作', |
||||
|
field: 'action', |
||||
|
isForm: false, |
||||
|
isTable: true, |
||||
|
isDetail:false, |
||||
|
table: { |
||||
|
width: 150, |
||||
|
fixed: 'right' |
||||
|
} |
||||
|
} |
||||
|
])) |
||||
|
|
||||
|
|
||||
|
// 表单校验
|
||||
|
export const DeviceSpotInspectionRecordDetailRules = reactive({ |
||||
|
number: [required], |
||||
|
concurrencyStamp: [required], |
||||
|
name: [required], |
||||
|
equipmentPosition: [required] |
||||
|
}) |
||||
|
|
||||
|
export const DeviceSpotInspectionRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([ |
||||
|
|
||||
|
{ |
||||
|
label: '检修工单号', |
||||
|
field: 'number', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
table: { |
||||
|
width: '300', |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '是否符合', |
||||
|
field: 'isConform', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
table: { |
||||
|
width: 'auto', |
||||
|
}, |
||||
|
formatter: (_: Recordable, __: TableColumn, cellValue: String) => { |
||||
|
return isConformList.find((account) => account.value == cellValue)?.label |
||||
|
}, |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
label: '检查内容', |
||||
|
field: 'name', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: '300', |
||||
|
}, |
||||
|
isSearch: true |
||||
|
}, |
||||
|
{ |
||||
|
label: '设备部位名称', |
||||
|
field: 'equipmentPosition', |
||||
|
sort: 'custom', |
||||
|
table: { |
||||
|
width: '300', |
||||
|
}, |
||||
|
isSearch: true |
||||
|
}, |
||||
|
{ |
||||
|
label: '操作', |
||||
|
field: 'action', |
||||
|
isForm: false, |
||||
|
isTable: true, |
||||
|
table: { |
||||
|
width: 150, |
||||
|
fixed: 'right' |
||||
|
} |
||||
|
} |
||||
|
])) |
Loading…
Reference in new issue