|
@@ -32,14 +32,15 @@
|
|
|
</ProTable>
|
|
|
<FormDialog ref="formDialogRef" :items-options="itemsOptions" :model="model" />
|
|
|
<ImportExcel ref="dialogRef" />
|
|
|
+ <TaskDialog ref="taskDialogRef" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="tsx" name="MaintenanceRecord">
|
|
|
import { useHandleData } from '@/hooks/useHandleData'
|
|
|
-import { useDownload } from '@/hooks/useDownload'
|
|
|
import { ElMessageBox } from 'element-plus'
|
|
|
import ImportExcel from '@/components/ImportExcel/index.vue'
|
|
|
+import TaskDialog from '@/components/TaskDialog/index.vue'
|
|
|
import FormDialog from '@/components/FormDialog/index.vue'
|
|
|
import { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
|
|
|
import {
|
|
@@ -52,6 +53,8 @@ import {
|
|
|
exportMaintenanceRecordApi,
|
|
|
getMaintenanceRecordApi
|
|
|
} from '@/api/modules/als/maintenanceRecord'
|
|
|
+const { proxy } = getCurrentInstance() as ComponentInternalInstance
|
|
|
+const { sys_yes_no, sys_app_type } = toRefs<any>(proxy?.useDict('sys_yes_no', 'sys_app_type'))
|
|
|
|
|
|
// ProTable 实例
|
|
|
const proTable = ref<ProTableInstance>()
|
|
@@ -70,11 +73,13 @@ const batchDelete = async (ids: string[]) => {
|
|
|
proTable.value?.getTableList()
|
|
|
}
|
|
|
|
|
|
+const taskDialogRef = ref<InstanceType<typeof TaskDialog> | null>(null)
|
|
|
// 导出维修记录列表
|
|
|
const downloadFile = async () => {
|
|
|
- ElMessageBox.confirm('确认导出维修记录数据?', '温馨提示', { type: 'warning' }).then(() =>
|
|
|
- useDownload(exportMaintenanceRecordApi, '维修记录列表', proTable.value?.searchParam)
|
|
|
- )
|
|
|
+ ElMessageBox.confirm('确认导出维修记录数据?', '温馨提示', { type: 'warning' }).then(async () => {
|
|
|
+ exportMaintenanceRecordApi(proTable.value?.searchParam)
|
|
|
+ taskDialogRef.value?.openExportDialog()
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
// 批量添加维修记录
|
|
@@ -101,7 +106,7 @@ const openDialog = async (type: number, title: string, row?: any) => {
|
|
|
setItemsOptions()
|
|
|
const params = {
|
|
|
title,
|
|
|
- width: 580,
|
|
|
+ width: 900,
|
|
|
isEdit: type !== 3,
|
|
|
api: type == 1 ? addMaintenanceRecordApi : updateMaintenanceRecordApi,
|
|
|
getTableList: proTable.value?.getTableList
|
|
@@ -112,13 +117,15 @@ const openDialog = async (type: number, title: string, row?: any) => {
|
|
|
// 表格配置项
|
|
|
const columns = reactive<ColumnProps<any>[]>([
|
|
|
{ type: 'selection', fixed: 'left', width: 70 },
|
|
|
+ { prop: 'id', label: '编号' },
|
|
|
{
|
|
|
prop: 'aircraftType',
|
|
|
label: '机型',
|
|
|
+ tag: true,
|
|
|
+ enum: sys_yes_no,
|
|
|
search: {
|
|
|
- el: 'input'
|
|
|
- },
|
|
|
- width: 120
|
|
|
+ el: 'tree-select'
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
prop: 'aircraftNo',
|
|
@@ -139,151 +146,214 @@ const columns = reactive<ColumnProps<any>[]>([
|
|
|
{
|
|
|
prop: 'specialty',
|
|
|
label: '专业',
|
|
|
+ search: {
|
|
|
+ el: 'input'
|
|
|
+ },
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
prop: 'systemName',
|
|
|
label: '系统',
|
|
|
+ search: {
|
|
|
+ el: 'input'
|
|
|
+ },
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
prop: 'engineType',
|
|
|
label: '发动机型别',
|
|
|
- width: 120
|
|
|
+ tag: true,
|
|
|
+ enum: sys_app_type,
|
|
|
+ search: {
|
|
|
+ el: 'tree-select'
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
prop: 'engineSerialNumber',
|
|
|
label: '发动机号码',
|
|
|
+ search: {
|
|
|
+ el: 'input'
|
|
|
+ },
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
prop: 'unitName',
|
|
|
label: '单位',
|
|
|
+ search: {
|
|
|
+ el: 'input'
|
|
|
+ },
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
prop: 'faultPhenomenon',
|
|
|
label: '故障现象',
|
|
|
+ search: {
|
|
|
+ el: 'input'
|
|
|
+ },
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
prop: 'locationFault',
|
|
|
label: '故障发生地点',
|
|
|
+ search: {
|
|
|
+ el: 'input'
|
|
|
+ },
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
prop: 'discoveryTime',
|
|
|
label: '发现时机',
|
|
|
+ search: {
|
|
|
+ el: 'input'
|
|
|
+ },
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
prop: 'itemName',
|
|
|
label: '故障件名称',
|
|
|
+ search: {
|
|
|
+ el: 'input'
|
|
|
+ },
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
prop: 'itemType',
|
|
|
label: '故障件型别',
|
|
|
- width: 120
|
|
|
+ tag: true,
|
|
|
+ enum: sys_app_type,
|
|
|
+ search: {
|
|
|
+ el: 'tree-select'
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
prop: 'partNumber',
|
|
|
label: '故换件号码',
|
|
|
+ search: {
|
|
|
+ el: 'input'
|
|
|
+ },
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
- prop: 'parttype',
|
|
|
+ prop: 'partType',
|
|
|
label: '故换件型别',
|
|
|
- width: 120
|
|
|
+ tag: true,
|
|
|
+ enum: sys_app_type,
|
|
|
+ search: {
|
|
|
+ el: 'tree-select'
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
- prop: 'faultcode',
|
|
|
+ prop: 'faultCode',
|
|
|
label: '故障失常码',
|
|
|
+ search: {
|
|
|
+ el: 'input'
|
|
|
+ },
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
prop: 'installationDate',
|
|
|
label: '故障件装机日期',
|
|
|
+ search: {
|
|
|
+ el: 'date-picker',
|
|
|
+ props: { type: 'datetimerange', valueFormat: 'YYYY-MM-DD HH:mm:ss' }
|
|
|
+ },
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
prop: 'causeFault',
|
|
|
label: '故障原因',
|
|
|
+ search: {
|
|
|
+ el: 'input'
|
|
|
+ },
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
prop: 'natureFault',
|
|
|
label: '故障性质',
|
|
|
+ search: {
|
|
|
+ el: 'input'
|
|
|
+ },
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
prop: 'liabilityFault',
|
|
|
label: '故障责任',
|
|
|
+ search: {
|
|
|
+ el: 'input'
|
|
|
+ },
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
prop: 'consequencesFault',
|
|
|
label: '故障后果',
|
|
|
+ search: {
|
|
|
+ el: 'input'
|
|
|
+ },
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
prop: 'occurDate',
|
|
|
label: '发生日期',
|
|
|
+ search: {
|
|
|
+ el: 'date-picker',
|
|
|
+ props: { type: 'datetimerange', valueFormat: 'YYYY-MM-DD HH:mm:ss' }
|
|
|
+ },
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
prop: 'methodDetermination',
|
|
|
label: '判明方法',
|
|
|
+ search: {
|
|
|
+ el: 'input'
|
|
|
+ },
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
prop: 'methodRectification',
|
|
|
label: '排除方法',
|
|
|
+ search: {
|
|
|
+ el: 'input'
|
|
|
+ },
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
prop: 'discoveredBy',
|
|
|
label: '发现人',
|
|
|
+ search: {
|
|
|
+ el: 'input'
|
|
|
+ },
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
prop: 'rectificationBy',
|
|
|
label: '排故人',
|
|
|
+ search: {
|
|
|
+ el: 'input'
|
|
|
+ },
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
prop: 'reviewerBy',
|
|
|
label: '审核人',
|
|
|
+ search: {
|
|
|
+ el: 'input'
|
|
|
+ },
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
prop: 'rectificationNumber',
|
|
|
label: '排故人数',
|
|
|
+ search: {
|
|
|
+ el: 'input'
|
|
|
+ },
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
prop: 'remarks',
|
|
|
label: '备注',
|
|
|
- width: 120
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'createBy',
|
|
|
- label: '创建人',
|
|
|
- width: 120
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'createTime',
|
|
|
- label: '创建时间',
|
|
|
- width: 120
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'updateBy',
|
|
|
- label: '更新人',
|
|
|
- width: 120
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'updateTime',
|
|
|
- label: '更新时间',
|
|
|
+ search: {
|
|
|
+ el: 'input'
|
|
|
+ },
|
|
|
width: 120
|
|
|
},
|
|
|
{ prop: 'operation', label: '操作', width: 230, fixed: 'right' }
|
|
@@ -295,15 +365,19 @@ const setItemsOptions = () => {
|
|
|
{
|
|
|
label: '机型',
|
|
|
prop: 'aircraftType',
|
|
|
- rules: [{ required: true, message: '机型不能为空', trigger: 'blur' }],
|
|
|
+ rules: [{ required: true, message: '机型不能为空', trigger: 'change' }],
|
|
|
+ span: 12,
|
|
|
compOptions: {
|
|
|
- placeholder: '请输入机型'
|
|
|
+ elTagName: 'select',
|
|
|
+ enum: sys_yes_no.value,
|
|
|
+ placeholder: '请选择机型'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
label: '机号',
|
|
|
prop: 'aircraftNo',
|
|
|
rules: [{ required: true, message: '机号不能为空', trigger: 'blur' }],
|
|
|
+ span: 12,
|
|
|
compOptions: {
|
|
|
placeholder: '请输入机号'
|
|
|
}
|
|
@@ -312,6 +386,7 @@ const setItemsOptions = () => {
|
|
|
label: '出厂号码',
|
|
|
prop: 'serialNumber',
|
|
|
rules: [{ required: true, message: '出厂号码不能为空', trigger: 'blur' }],
|
|
|
+ span: 12,
|
|
|
compOptions: {
|
|
|
placeholder: '请输入出厂号码'
|
|
|
}
|
|
@@ -319,6 +394,7 @@ const setItemsOptions = () => {
|
|
|
{
|
|
|
label: '专业',
|
|
|
prop: 'specialty',
|
|
|
+ span: 12,
|
|
|
compOptions: {
|
|
|
placeholder: '请输入专业'
|
|
|
}
|
|
@@ -326,6 +402,7 @@ const setItemsOptions = () => {
|
|
|
{
|
|
|
label: '系统',
|
|
|
prop: 'systemName',
|
|
|
+ span: 12,
|
|
|
compOptions: {
|
|
|
placeholder: '请输入系统'
|
|
|
}
|
|
@@ -333,13 +410,17 @@ const setItemsOptions = () => {
|
|
|
{
|
|
|
label: '发动机型别',
|
|
|
prop: 'engineType',
|
|
|
+ span: 12,
|
|
|
compOptions: {
|
|
|
- placeholder: '请输入发动机型别'
|
|
|
+ elTagName: 'select',
|
|
|
+ enum: sys_app_type.value,
|
|
|
+ placeholder: '请选择发动机型别'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
label: '发动机号码',
|
|
|
prop: 'engineSerialNumber',
|
|
|
+ span: 12,
|
|
|
compOptions: {
|
|
|
placeholder: '请输入发动机号码'
|
|
|
}
|
|
@@ -347,6 +428,7 @@ const setItemsOptions = () => {
|
|
|
{
|
|
|
label: '单位',
|
|
|
prop: 'unitName',
|
|
|
+ span: 12,
|
|
|
compOptions: {
|
|
|
placeholder: '请输入单位'
|
|
|
}
|
|
@@ -354,6 +436,7 @@ const setItemsOptions = () => {
|
|
|
{
|
|
|
label: '故障现象',
|
|
|
prop: 'faultPhenomenon',
|
|
|
+ span: 12,
|
|
|
compOptions: {
|
|
|
placeholder: '请输入故障现象'
|
|
|
}
|
|
@@ -361,6 +444,7 @@ const setItemsOptions = () => {
|
|
|
{
|
|
|
label: '故障发生地点',
|
|
|
prop: 'locationFault',
|
|
|
+ span: 12,
|
|
|
compOptions: {
|
|
|
placeholder: '请输入故障发生地点'
|
|
|
}
|
|
@@ -368,6 +452,7 @@ const setItemsOptions = () => {
|
|
|
{
|
|
|
label: '发现时机',
|
|
|
prop: 'discoveryTime',
|
|
|
+ span: 12,
|
|
|
compOptions: {
|
|
|
placeholder: '请输入发现时机'
|
|
|
}
|
|
@@ -375,6 +460,7 @@ const setItemsOptions = () => {
|
|
|
{
|
|
|
label: '故障件名称',
|
|
|
prop: 'itemName',
|
|
|
+ span: 12,
|
|
|
compOptions: {
|
|
|
placeholder: '请输入故障件名称'
|
|
|
}
|
|
@@ -382,27 +468,37 @@ const setItemsOptions = () => {
|
|
|
{
|
|
|
label: '故障件型别',
|
|
|
prop: 'itemType',
|
|
|
+ span: 12,
|
|
|
compOptions: {
|
|
|
- placeholder: '请输入故障件型别'
|
|
|
+ elTagName: 'select',
|
|
|
+ enum: sys_app_type.value,
|
|
|
+ placeholder: '请选择故障件型别'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
label: '故换件号码',
|
|
|
prop: 'partNumber',
|
|
|
+ span: 12,
|
|
|
compOptions: {
|
|
|
placeholder: '请输入故换件号码'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
label: '故换件型别',
|
|
|
- prop: 'parttype',
|
|
|
+ prop: 'partType',
|
|
|
+ rules: [{ required: true, message: '故换件型别不能为空', trigger: 'change' }],
|
|
|
+ span: 12,
|
|
|
compOptions: {
|
|
|
- placeholder: '请输入故换件型别'
|
|
|
+ elTagName: 'select',
|
|
|
+ enum: sys_app_type.value,
|
|
|
+ placeholder: '请选择故换件型别'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
label: '故障失常码',
|
|
|
- prop: 'faultcode',
|
|
|
+ prop: 'faultCode',
|
|
|
+ rules: [{ required: true, message: '故障失常码不能为空', trigger: 'blur' }],
|
|
|
+ span: 12,
|
|
|
compOptions: {
|
|
|
placeholder: '请输入故障失常码'
|
|
|
}
|
|
@@ -410,6 +506,7 @@ const setItemsOptions = () => {
|
|
|
{
|
|
|
label: '故障件装机日期',
|
|
|
prop: 'installationDate',
|
|
|
+ span: 12,
|
|
|
compOptions: {
|
|
|
elTagName: 'date-picker',
|
|
|
type: 'date',
|
|
@@ -419,6 +516,7 @@ const setItemsOptions = () => {
|
|
|
{
|
|
|
label: '故障原因',
|
|
|
prop: 'causeFault',
|
|
|
+ span: 12,
|
|
|
compOptions: {
|
|
|
placeholder: '请输入故障原因'
|
|
|
}
|
|
@@ -426,6 +524,7 @@ const setItemsOptions = () => {
|
|
|
{
|
|
|
label: '故障性质',
|
|
|
prop: 'natureFault',
|
|
|
+ span: 12,
|
|
|
compOptions: {
|
|
|
placeholder: '请输入故障性质'
|
|
|
}
|
|
@@ -433,6 +532,7 @@ const setItemsOptions = () => {
|
|
|
{
|
|
|
label: '故障责任',
|
|
|
prop: 'liabilityFault',
|
|
|
+ span: 12,
|
|
|
compOptions: {
|
|
|
placeholder: '请输入故障责任'
|
|
|
}
|
|
@@ -440,6 +540,7 @@ const setItemsOptions = () => {
|
|
|
{
|
|
|
label: '故障后果',
|
|
|
prop: 'consequencesFault',
|
|
|
+ span: 12,
|
|
|
compOptions: {
|
|
|
placeholder: '请输入故障后果'
|
|
|
}
|
|
@@ -447,6 +548,7 @@ const setItemsOptions = () => {
|
|
|
{
|
|
|
label: '发生日期',
|
|
|
prop: 'occurDate',
|
|
|
+ span: 12,
|
|
|
compOptions: {
|
|
|
elTagName: 'date-picker',
|
|
|
type: 'date',
|
|
@@ -456,6 +558,7 @@ const setItemsOptions = () => {
|
|
|
{
|
|
|
label: '判明方法',
|
|
|
prop: 'methodDetermination',
|
|
|
+ span: 12,
|
|
|
compOptions: {
|
|
|
placeholder: '请输入判明方法'
|
|
|
}
|
|
@@ -463,6 +566,7 @@ const setItemsOptions = () => {
|
|
|
{
|
|
|
label: '排除方法',
|
|
|
prop: 'methodRectification',
|
|
|
+ span: 12,
|
|
|
compOptions: {
|
|
|
placeholder: '请输入排除方法'
|
|
|
}
|
|
@@ -470,6 +574,7 @@ const setItemsOptions = () => {
|
|
|
{
|
|
|
label: '发现人',
|
|
|
prop: 'discoveredBy',
|
|
|
+ span: 12,
|
|
|
compOptions: {
|
|
|
placeholder: '请输入发现人'
|
|
|
}
|
|
@@ -477,6 +582,7 @@ const setItemsOptions = () => {
|
|
|
{
|
|
|
label: '排故人',
|
|
|
prop: 'rectificationBy',
|
|
|
+ span: 12,
|
|
|
compOptions: {
|
|
|
placeholder: '请输入排故人'
|
|
|
}
|
|
@@ -484,6 +590,7 @@ const setItemsOptions = () => {
|
|
|
{
|
|
|
label: '审核人',
|
|
|
prop: 'reviewerBy',
|
|
|
+ span: 12,
|
|
|
compOptions: {
|
|
|
placeholder: '请输入审核人'
|
|
|
}
|
|
@@ -491,6 +598,7 @@ const setItemsOptions = () => {
|
|
|
{
|
|
|
label: '排故人数',
|
|
|
prop: 'rectificationNumber',
|
|
|
+ span: 12,
|
|
|
compOptions: {
|
|
|
placeholder: '请输入排故人数'
|
|
|
}
|
|
@@ -498,6 +606,7 @@ const setItemsOptions = () => {
|
|
|
{
|
|
|
label: '备注',
|
|
|
prop: 'remarks',
|
|
|
+ span: 12,
|
|
|
compOptions: {
|
|
|
placeholder: '请输入备注'
|
|
|
}
|