瀏覽代碼

feat: 定检/定检子表/定检记录

wanggaokun 1 年之前
父節點
當前提交
e56dae9ba9

+ 251 - 0
src/api/interface/als/smTask.ts

@@ -0,0 +1,251 @@
+import { PageQuery, BaseEntity } from '@/api/interface/index'
+export interface SmTaskVO extends BaseEntity {
+  /**
+   * 机号
+   */
+  aircraftNo: string
+
+  /**
+   * 机型
+   */
+  aircraftModel: string
+
+  /**
+   * 任务名称
+   */
+  name: string
+
+  /**
+   * 任务编码
+   */
+  code: string
+
+  /**
+   * 维修时间
+   */
+  endTime: string
+
+  /**
+   * 剩余时间
+   */
+  remainTime: string
+
+  /**
+   * 专业
+   */
+  specialty: string
+
+  /**
+   * 下发日期
+   */
+  issueDate: string
+
+  /**
+   * 完成日期
+   */
+  finishDate: string
+
+  /**
+   * 负责人
+   */
+  headName: string
+
+  /**
+   * 单位
+   */
+  unitName: string
+
+  /**
+   * 维修内容
+   */
+  contents: string
+
+  /**
+   * 质检员
+   */
+  qcBy: string
+
+  /**
+   * 填写人
+   */
+  fillBy: string
+
+  /**
+   * 状态(1正常)
+   */
+  status: string
+
+  /**
+   * 备注
+   */
+  remark: string
+
+  /**
+   * 创建人
+   */
+  createBy: number
+
+  /**
+   * 创建时间
+   */
+  createTime: string
+
+  /**
+   * 更新人
+   */
+  updateBy: number
+
+  /**
+   * 更新时间
+   */
+  updateTime: string
+}
+
+export interface SmTaskForm {
+  /**
+   * 编号
+   */
+  id?: string | number
+
+  /**
+   * 机号
+   */
+  aircraftNo?: string
+
+  /**
+   * 机型
+   */
+  aircraftModel?: string
+
+  /**
+   * 任务名称
+   */
+  name?: string
+
+  /**
+   * 任务编码
+   */
+  code?: string
+
+  /**
+   * 维修时间
+   */
+  endTime?: string
+
+  /**
+   * 剩余时间
+   */
+  remainTime?: string
+
+  /**
+   * 专业
+   */
+  specialty?: string
+
+  /**
+   * 下发日期
+   */
+  issueDate?: string
+
+  /**
+   * 完成日期
+   */
+  finishDate?: string
+
+  /**
+   * 负责人
+   */
+  headName?: string
+
+  /**
+   * 单位
+   */
+  unitName?: string
+
+  /**
+   * 维修内容
+   */
+  contents?: string
+
+  /**
+   * 质检员
+   */
+  qcBy?: string
+
+  /**
+   * 填写人
+   */
+  fillBy?: string
+
+  /**
+   * 状态(1正常)
+   */
+  status?: string
+
+  /**
+   * 备注
+   */
+  remark?: string
+}
+
+export interface SmTaskQuery extends PageQuery {
+  /**
+   * 机号
+   */
+  aircraftNo?: string
+
+  /**
+   * 机型
+   */
+  aircraftModel?: string
+
+  /**
+   * 任务名称
+   */
+  name?: string
+
+  /**
+   * 任务编码
+   */
+  code?: string
+
+  /**
+   * 维修时间
+   */
+  endTime?: string
+
+  /**
+   * 剩余时间
+   */
+  remainTime?: string
+
+  /**
+   * 专业
+   */
+  specialty?: string
+
+  /**
+   * 下发日期
+   */
+  issueDate?: string
+
+  /**
+   * 完成日期
+   */
+  finishDate?: string
+
+  /**
+   * 负责人
+   */
+  headName?: string
+
+  /**
+   * 单位
+   */
+  unitName?: string
+
+  /**
+   * 日期范围参数
+   */
+  params?: any
+}

+ 166 - 0
src/api/interface/als/smTaskRecord.ts

@@ -0,0 +1,166 @@
+import { PageQuery, BaseEntity } from '@/api/interface/index'
+export interface SmTaskRecordVO extends BaseEntity {
+  /**
+   * 机号
+   */
+  aircraftNo: string
+
+  /**
+   * 机型
+   */
+  aircraftModel: string
+
+  /**
+   * 任务名称
+   */
+  name: string
+
+  /**
+   * 任务编码
+   */
+  code: string
+
+  /**
+   * 维修时间
+   */
+  endTime: string
+
+  /**
+   * 剩余时间
+   */
+  remainTime: string
+
+  /**
+   * 专业
+   */
+  specialty: string
+
+  /**
+   * 维修内容
+   */
+  contents: string
+
+  /**
+   * 状态(1正常)
+   */
+  status: string
+
+  /**
+   * 创建人
+   */
+  createBy: number
+
+  /**
+   * 创建时间
+   */
+  createTime: string
+
+  /**
+   * 更新人
+   */
+  updateBy: number
+
+  /**
+   * 更新时间
+   */
+  updateTime: string
+}
+
+export interface SmTaskRecordForm {
+  /**
+   * 编号
+   */
+  id?: string | number
+
+  /**
+   * 机号
+   */
+  aircraftNo?: string
+
+  /**
+   * 机型
+   */
+  aircraftModel?: string
+
+  /**
+   * 任务名称
+   */
+  name?: string
+
+  /**
+   * 任务编码
+   */
+  code?: string
+
+  /**
+   * 维修时间
+   */
+  endTime?: string
+
+  /**
+   * 剩余时间
+   */
+  remainTime?: string
+
+  /**
+   * 专业
+   */
+  specialty?: string
+
+  /**
+   * 维修内容
+   */
+  contents?: string
+
+  /**
+   * 状态(1正常)
+   */
+  status?: string
+}
+
+export interface SmTaskRecordQuery extends PageQuery {
+  /**
+   * 机号
+   */
+  aircraftNo?: string
+
+  /**
+   * 机型
+   */
+  aircraftModel?: string
+
+  /**
+   * 任务名称
+   */
+  name?: string
+
+  /**
+   * 任务编码
+   */
+  code?: string
+
+  /**
+   * 维修时间
+   */
+  endTime?: string
+
+  /**
+   * 剩余时间
+   */
+  remainTime?: string
+
+  /**
+   * 专业
+   */
+  specialty?: string
+
+  /**
+   * 维修内容
+   */
+  contents?: string
+
+  /**
+   * 日期范围参数
+   */
+  params?: any
+}

+ 241 - 0
src/api/interface/als/smTaskSub.ts

@@ -0,0 +1,241 @@
+import { PageQuery, BaseEntity } from '@/api/interface/index'
+export interface SmTaskSubVO extends BaseEntity {
+  /**
+   * 编号
+   */
+  id: string | number
+
+  /**
+   * 机号
+   */
+  aircraftNo: string
+
+  /**
+   * 机型
+   */
+  aircraftModel: string
+
+  /**
+   * 任务名称
+   */
+  name: string
+
+  /**
+   * 任务编码
+   */
+  code: string
+
+  /**
+   * 维修时间
+   */
+  endTime: string
+
+  /**
+   * 剩余时间
+   */
+  remainTime: string
+
+  /**
+   * 专业
+   */
+  specialty: string
+
+  /**
+   * 下发日期
+   */
+  issueDate: string
+
+  /**
+   * 完成日期
+   */
+  finishDate: string
+
+  /**
+   * 工作人
+   */
+  staff: string
+
+  /**
+   * 复查人
+   */
+  reviewBy: string
+
+  /**
+   * 单位
+   */
+  unitName: string
+
+  /**
+   * 维修内容
+   */
+  contents: string
+
+  /**
+   * 状态(1正常)
+   */
+  status: string
+
+  /**
+   * 创建人
+   */
+  createBy: number
+
+  /**
+   * 创建时间
+   */
+  createTime: string
+
+  /**
+   * 更新人
+   */
+  updateBy: number
+
+  /**
+   * 更新时间
+   */
+  updateTime: string
+}
+
+export interface SmTaskSubForm {
+  /**
+   * 机号
+   */
+  aircraftNo?: string
+
+  /**
+   * 机型
+   */
+  aircraftModel?: string
+
+  /**
+   * 任务名称
+   */
+  name?: string
+
+  /**
+   * 任务编码
+   */
+  code?: string
+
+  /**
+   * 维修时间
+   */
+  endTime?: string
+
+  /**
+   * 剩余时间
+   */
+  remainTime?: string
+
+  /**
+   * 专业
+   */
+  specialty?: string
+
+  /**
+   * 下发日期
+   */
+  issueDate?: string
+
+  /**
+   * 完成日期
+   */
+  finishDate?: string
+
+  /**
+   * 工作人
+   */
+  staff?: string
+
+  /**
+   * 复查人
+   */
+  reviewBy?: string
+
+  /**
+   * 单位
+   */
+  unitName?: string
+
+  /**
+   * 维修内容
+   */
+  contents?: string
+
+  /**
+   * 状态(1正常)
+   */
+  status?: string
+}
+
+export interface SmTaskSubQuery extends PageQuery {
+  /**
+   * 机号
+   */
+  aircraftNo?: string
+
+  /**
+   * 机型
+   */
+  aircraftModel?: string
+
+  /**
+   * 任务名称
+   */
+  name?: string
+
+  /**
+   * 任务编码
+   */
+  code?: string
+
+  /**
+   * 维修时间
+   */
+  endTime?: string
+
+  /**
+   * 剩余时间
+   */
+  remainTime?: string
+
+  /**
+   * 专业
+   */
+  specialty?: string
+
+  /**
+   * 下发日期
+   */
+  issueDate?: string
+
+  /**
+   * 完成日期
+   */
+  finishDate?: string
+
+  /**
+   * 工作人
+   */
+  staff?: string
+
+  /**
+   * 复查人
+   */
+  reviewBy?: string
+
+  /**
+   * 单位
+   */
+  unitName?: string
+
+  /**
+   * 维修内容
+   */
+  contents?: string
+
+  /**
+   * 日期范围参数
+   */
+  params?: any
+}

+ 70 - 0
src/api/modules/als/smTask.ts

@@ -0,0 +1,70 @@
+import http from '@/api'
+import { SmTaskVO, SmTaskForm, SmTaskQuery } from '@/api/interface/als/smTask'
+/**
+ * @name 查询定检任务列表
+ * @param query 参数
+ * @returns 返回列表
+ */
+export const listSmTaskApi = (query: SmTaskQuery) => {
+  return http.get<SmTaskVO[]>('/als/smTask/list', query, { loading: true })
+}
+
+/**
+ * @name 查询定检任务详细
+ * @param id id
+ * @returns returns
+ */
+export const getSmTaskApi = (id: string | number) => {
+  return http.get<SmTaskVO>(`/als/smTask/${id}`)
+}
+
+/**
+ * @name 新增定检任务
+ * @param data data
+ * @returns returns
+ */
+export const addSmTaskApi = (data: SmTaskForm) => {
+  return http.post<any>('/als/smTask', data, { loading: false })
+}
+
+/**
+ * @name 修改定检任务
+ * @param data data
+ * @returns returns
+ */
+export const updateSmTaskApi = (data: SmTaskForm) => {
+  return http.put<any>('/als/smTask', data, { loading: false })
+}
+
+/**
+ * @name 删除定检任务
+ * @param id id
+ * @returns returns
+ */
+export const delSmTaskApi = (id: string | number | Array<string | number>) => {
+  return http.delete<any>(`/als/smTask/${id}`)
+}
+
+/**
+ * @name 下载模板
+ * @returns returns
+ */
+export const importTemplateApi = () => {
+  return http.downloadPost('/als/smTask/importTemplate', {})
+}
+
+/**
+ * @name 导入数据
+ * @returns returns
+ */
+export const importSmTaskDataApi = (data: any) => {
+  return http.post('/als/smTask/importData', data)
+}
+
+/**
+ * @name 导出数据
+ * @returns returns
+ */
+export const exportSmTaskApi = (data: any) => {
+  return http.post('/als/smTask/export', data)
+}

+ 70 - 0
src/api/modules/als/smTaskRecord.ts

@@ -0,0 +1,70 @@
+import http from '@/api'
+import { SmTaskRecordVO, SmTaskRecordForm, SmTaskRecordQuery } from '@/api/interface/als/smTaskRecord'
+/**
+ * @name 查询定检任务记录列表
+ * @param query 参数
+ * @returns 返回列表
+ */
+export const listSmTaskRecordApi = (query: SmTaskRecordQuery) => {
+  return http.get<SmTaskRecordVO[]>('/als/smTaskRecord/list', query, { loading: true })
+}
+
+/**
+ * @name 查询定检任务记录详细
+ * @param id id
+ * @returns returns
+ */
+export const getSmTaskRecordApi = (id: string | number) => {
+  return http.get<SmTaskRecordVO>(`/als/smTaskRecord/${id}`)
+}
+
+/**
+ * @name 新增定检任务记录
+ * @param data data
+ * @returns returns
+ */
+export const addSmTaskRecordApi = (data: SmTaskRecordForm) => {
+  return http.post<any>('/als/smTaskRecord', data, { loading: false })
+}
+
+/**
+ * @name 修改定检任务记录
+ * @param data data
+ * @returns returns
+ */
+export const updateSmTaskRecordApi = (data: SmTaskRecordForm) => {
+  return http.put<any>('/als/smTaskRecord', data, { loading: false })
+}
+
+/**
+ * @name 删除定检任务记录
+ * @param id id
+ * @returns returns
+ */
+export const delSmTaskRecordApi = (id: string | number | Array<string | number>) => {
+  return http.delete<any>(`/als/smTaskRecord/${id}`)
+}
+
+/**
+ * @name 下载模板
+ * @returns returns
+ */
+export const importTemplateApi = () => {
+  return http.downloadPost('/als/smTaskRecord/importTemplate', {})
+}
+
+/**
+ * @name 导入数据
+ * @returns returns
+ */
+export const importSmTaskRecordDataApi = (data: any) => {
+  return http.post('/als/smTaskRecord/importData', data)
+}
+
+/**
+ * @name 导出数据
+ * @returns returns
+ */
+export const exportSmTaskRecordApi = (data: any) => {
+  return http.post('/als/smTaskRecord/export', data)
+}

+ 70 - 0
src/api/modules/als/smTaskSub.ts

@@ -0,0 +1,70 @@
+import http from '@/api'
+import { SmTaskSubVO, SmTaskSubForm, SmTaskSubQuery } from '@/api/interface/als/smTaskSub'
+/**
+ * @name 查询定检任务子列表
+ * @param query 参数
+ * @returns 返回列表
+ */
+export const listSmTaskSubApi = (query: SmTaskSubQuery) => {
+  return http.get<SmTaskSubVO[]>('/als/smTaskSub/list', query, { loading: true })
+}
+
+/**
+ * @name 查询定检任务子详细
+ * @param id id
+ * @returns returns
+ */
+export const getSmTaskSubApi = (id: string | number) => {
+  return http.get<SmTaskSubVO>(`/als/smTaskSub/${id}`)
+}
+
+/**
+ * @name 新增定检任务子
+ * @param data data
+ * @returns returns
+ */
+export const addSmTaskSubApi = (data: SmTaskSubForm) => {
+  return http.post<any>('/als/smTaskSub', data, { loading: false })
+}
+
+/**
+ * @name 修改定检任务子
+ * @param data data
+ * @returns returns
+ */
+export const updateSmTaskSubApi = (data: SmTaskSubForm) => {
+  return http.put<any>('/als/smTaskSub', data, { loading: false })
+}
+
+/**
+ * @name 删除定检任务子
+ * @param id id
+ * @returns returns
+ */
+export const delSmTaskSubApi = (id: string | number | Array<string | number>) => {
+  return http.delete<any>(`/als/smTaskSub/${id}`)
+}
+
+/**
+ * @name 下载模板
+ * @returns returns
+ */
+export const importTemplateApi = () => {
+  return http.downloadPost('/als/smTaskSub/importTemplate', {})
+}
+
+/**
+ * @name 导入数据
+ * @returns returns
+ */
+export const importSmTaskSubDataApi = (data: any) => {
+  return http.post('/als/smTaskSub/importData', data)
+}
+
+/**
+ * @name 导出数据
+ * @returns returns
+ */
+export const exportSmTaskSubApi = (data: any) => {
+  return http.post('/als/smTaskSub/export', data)
+}

+ 379 - 0
src/views/als/smTask/index.vue

@@ -0,0 +1,379 @@
+<template>
+  <div class="table-box">
+    <ProTable ref="proTable" :columns="columns" row-key="id" :request-api="listSmTaskApi">
+      <!-- 表格 header 按钮 -->
+      <template #tableHeader="scope">
+        <el-button type="primary" v-auth="['als:smTask:add']" icon="CirclePlus" @click="openDialog(1, '定检任务新增')"> 新增 </el-button>
+        <el-button type="primary" v-auth="['als:smTask:import']" icon="Upload" plain @click="batchAdd"> 导入 </el-button>
+        <el-button type="primary" v-auth="['als:smTask:export']" icon="Download" plain @click="downloadFile"> 导出 </el-button>
+        <el-button
+          type="danger"
+          v-auth="['als:smTask:remove']"
+          icon="Delete"
+          plain
+          :disabled="!scope.isSelected"
+          @click="batchDelete(scope.selectedListIds)"
+        >
+          批量删除
+        </el-button>
+      </template>
+      <!-- 表格操作 -->
+      <template #operation="scope">
+        <el-button type="primary" link icon="View" v-auth="['als:smTask:query']" @click="openDialog(3, '定检任务查看', scope.row)"> 查看 </el-button>
+        <el-button type="primary" link icon="EditPen" v-auth="['als:smTask:edit']" @click="openDialog(2, '定检任务编辑', scope.row)">
+          编辑
+        </el-button>
+        <el-button type="primary" link icon="Delete" v-auth="['als:smTask:remove']" @click="deleteSmTask(scope.row)"> 删除 </el-button>
+      </template>
+    </ProTable>
+    <FormDialog ref="formDialogRef" :items-options="itemsOptions" :model="model" />
+    <ImportExcel ref="dialogRef" />
+    <TaskDialog ref="taskDialogRef" />
+  </div>
+</template>
+
+<script setup lang="tsx" name="SmTask">
+import { useHandleData } from '@/hooks/useHandleData'
+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 {
+  listSmTaskApi,
+  delSmTaskApi,
+  addSmTaskApi,
+  updateSmTaskApi,
+  importTemplateApi,
+  importSmTaskDataApi,
+  exportSmTaskApi,
+  getSmTaskApi
+} from '@/api/modules/als/smTask'
+const { proxy } = getCurrentInstance() as ComponentInternalInstance
+const { common_type } = toRefs<any>(proxy?.useDict('common_type'))
+
+// ProTable 实例
+const proTable = ref<ProTableInstance>()
+// 表单model
+const model = ref({})
+// 删除定检任务信息
+const deleteSmTask = async (params: any) => {
+  await useHandleData(delSmTaskApi, params.id, '删除【' + params.id + '】定检任务')
+  proTable.value?.getTableList()
+}
+
+// 批量删除定检任务信息
+const batchDelete = async (ids: string[]) => {
+  await useHandleData(delSmTaskApi, ids, '删除所选定检任务信息')
+  proTable.value?.clearSelection()
+  proTable.value?.getTableList()
+}
+
+const taskDialogRef = ref<InstanceType<typeof TaskDialog> | null>(null)
+// 导出定检任务列表
+const downloadFile = async () => {
+  ElMessageBox.confirm('确认导出定检任务数据?', '温馨提示', { type: 'warning' }).then(async () => {
+    exportSmTaskApi(proTable.value?.searchParam)
+    taskDialogRef.value?.openExportDialog()
+  })
+}
+
+// 批量添加定检任务
+const dialogRef = ref<InstanceType<typeof ImportExcel> | null>(null)
+const batchAdd = () => {
+  const params = {
+    title: '定检任务',
+    tempApi: importTemplateApi,
+    importApi: importSmTaskDataApi,
+    getTableList: proTable.value?.getTableList
+  }
+  dialogRef.value?.acceptParams(params)
+}
+
+const formDialogRef = ref<InstanceType<typeof FormDialog> | null>(null)
+// 打开弹框的功能
+const openDialog = async (type: number, title: string, row?: any) => {
+  let res = { data: {} }
+  if (row?.id) {
+    res = await getSmTaskApi(row?.id || null)
+  }
+  model.value = type == 1 ? {} : res.data
+  // 重置表单
+  setItemsOptions()
+  const params = {
+    title,
+    width: 580,
+    isEdit: type !== 3,
+    api: type == 1 ? addSmTaskApi : updateSmTaskApi,
+    getTableList: proTable.value?.getTableList
+  }
+  formDialogRef.value?.openDialog(params)
+}
+
+// 表格配置项
+const columns = reactive<ColumnProps<any>[]>([
+  { type: 'selection', fixed: 'left', width: 70 },
+  { prop: 'id', label: '编号' },
+  {
+    prop: 'aircraftNo',
+    label: '机号',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'aircraftModel',
+    label: '机型',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'name',
+    label: '任务名称',
+    search: {
+      el: 'date-picker',
+      props: { type: 'datetimerange', valueFormat: 'YYYY-MM-DD HH:mm:ss' }
+    },
+    width: 120
+  },
+  {
+    prop: 'code',
+    label: '任务编码',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'endTime',
+    label: '维修时间',
+    search: {
+      el: 'date-picker',
+      props: { type: 'datetimerange', valueFormat: 'YYYY-MM-DD HH:mm:ss' }
+    },
+    width: 120
+  },
+  {
+    prop: 'remainTime',
+    label: '剩余时间',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'specialty',
+    label: '专业',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'issueDate',
+    label: '下发日期',
+    search: {
+      el: 'date-picker',
+      props: { type: 'datetimerange', valueFormat: 'YYYY-MM-DD HH:mm:ss' }
+    },
+    width: 120
+  },
+  {
+    prop: 'finishDate',
+    label: '完成日期',
+    search: {
+      el: 'date-picker',
+      props: { type: 'datetimerange', valueFormat: 'YYYY-MM-DD HH:mm:ss' }
+    },
+    width: 120
+  },
+  {
+    prop: 'headName',
+    label: '负责人',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'unitName',
+    label: '单位',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'contents',
+    label: '维修内容',
+    width: 120
+  },
+  {
+    prop: 'qcBy',
+    label: '质检员',
+    width: 120
+  },
+  {
+    prop: 'fillBy',
+    label: '填写人',
+    width: 120
+  },
+  {
+    prop: 'status',
+    label: '状态',
+    tag: true,
+    enum: common_type
+  },
+  {
+    prop: 'remark',
+    label: '备注',
+    width: 120
+  },
+  {
+    prop: 'createBy',
+    label: '创建人',
+    width: 120
+  },
+  {
+    prop: 'createTime',
+    label: '创建时间',
+    width: 120
+  },
+  {
+    prop: 'updateBy',
+    label: '更新人',
+    width: 120
+  },
+  {
+    prop: 'updateTime',
+    label: '更新时间',
+    width: 120
+  },
+  { prop: 'operation', label: '操作', width: 230, fixed: 'right' }
+])
+// 表单配置项
+let itemsOptions = reactive<ProForm.ItemsOptions[]>([])
+const setItemsOptions = () => {
+  itemsOptions = [
+    {
+      label: '机号',
+      prop: 'aircraftNo',
+      rules: [{ required: true, message: '机号不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入机号'
+      }
+    },
+    {
+      label: '机型',
+      prop: 'aircraftModel',
+      rules: [{ required: true, message: '机型不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入机型'
+      }
+    },
+    {
+      label: '任务名称',
+      prop: 'name',
+      rules: [{ required: true, message: '任务名称不能为空', trigger: 'change' }],
+      compOptions: {
+        elTagName: 'date-picker',
+        type: 'date',
+        placeholder: '请选择任务名称'
+      }
+    },
+    {
+      label: '任务编码',
+      prop: 'code',
+      compOptions: {
+        placeholder: '请输入任务编码'
+      }
+    },
+    {
+      label: '维修时间',
+      prop: 'endTime',
+      compOptions: {
+        elTagName: 'date-picker',
+        type: 'date',
+        placeholder: '请选择维修时间'
+      }
+    },
+    {
+      label: '剩余时间',
+      prop: 'remainTime',
+      compOptions: {
+        placeholder: '请输入剩余时间'
+      }
+    },
+    {
+      label: '专业',
+      prop: 'specialty',
+      compOptions: {
+        placeholder: '请输入专业'
+      }
+    },
+    {
+      label: '下发日期',
+      prop: 'issueDate',
+      compOptions: {
+        elTagName: 'date-picker',
+        type: 'date',
+        placeholder: '请选择下发日期'
+      }
+    },
+    {
+      label: '完成日期',
+      prop: 'finishDate',
+      compOptions: {
+        elTagName: 'date-picker',
+        type: 'date',
+        placeholder: '请选择完成日期'
+      }
+    },
+    {
+      label: '负责人',
+      prop: 'headName',
+      compOptions: {
+        placeholder: '请输入负责人'
+      }
+    },
+    {
+      label: '单位',
+      prop: 'unitName',
+      compOptions: {
+        placeholder: '请输入单位'
+      }
+    },
+    {
+      label: '维修内容',
+      prop: 'contents',
+      compOptions: {
+        placeholder: '请输入维修内容'
+      }
+    },
+    {
+      label: '质检员',
+      prop: 'qcBy',
+      compOptions: {
+        placeholder: '请输入质检员'
+      }
+    },
+    {
+      label: '填写人',
+      prop: 'fillBy',
+      compOptions: {
+        placeholder: '请输入填写人'
+      }
+    },
+    {
+      label: '备注',
+      prop: 'remark',
+      compOptions: {
+        placeholder: '请输入备注'
+      }
+    }
+  ]
+}
+</script>

+ 281 - 0
src/views/als/smTaskRecord/index.vue

@@ -0,0 +1,281 @@
+<template>
+  <div class="table-box">
+    <ProTable ref="proTable" :columns="columns" row-key="id" :request-api="listSmTaskRecordApi">
+      <!-- 表格 header 按钮 -->
+      <template #tableHeader="scope">
+        <el-button type="primary" v-auth="['als:smTaskRecord:add']" icon="CirclePlus" @click="openDialog(1, '定检任务记录新增')"> 新增 </el-button>
+        <el-button type="primary" v-auth="['als:smTaskRecord:import']" icon="Upload" plain @click="batchAdd"> 导入 </el-button>
+        <el-button type="primary" v-auth="['als:smTaskRecord:export']" icon="Download" plain @click="downloadFile"> 导出 </el-button>
+        <el-button
+          type="danger"
+          v-auth="['als:smTaskRecord:remove']"
+          icon="Delete"
+          plain
+          :disabled="!scope.isSelected"
+          @click="batchDelete(scope.selectedListIds)"
+        >
+          批量删除
+        </el-button>
+      </template>
+      <!-- 表格操作 -->
+      <template #operation="scope">
+        <el-button type="primary" link icon="View" v-auth="['als:smTaskRecord:query']" @click="openDialog(3, '定检任务记录查看', scope.row)">
+          查看
+        </el-button>
+        <el-button type="primary" link icon="EditPen" v-auth="['als:smTaskRecord:edit']" @click="openDialog(2, '定检任务记录编辑', scope.row)">
+          编辑
+        </el-button>
+        <el-button type="primary" link icon="Delete" v-auth="['als:smTaskRecord:remove']" @click="deleteSmTaskRecord(scope.row)"> 删除 </el-button>
+      </template>
+    </ProTable>
+    <FormDialog ref="formDialogRef" :items-options="itemsOptions" :model="model" />
+    <ImportExcel ref="dialogRef" />
+    <TaskDialog ref="taskDialogRef" />
+  </div>
+</template>
+
+<script setup lang="tsx" name="SmTaskRecord">
+import { useHandleData } from '@/hooks/useHandleData'
+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 {
+  listSmTaskRecordApi,
+  delSmTaskRecordApi,
+  addSmTaskRecordApi,
+  updateSmTaskRecordApi,
+  importTemplateApi,
+  importSmTaskRecordDataApi,
+  exportSmTaskRecordApi,
+  getSmTaskRecordApi
+} from '@/api/modules/als/smTaskRecord'
+const { proxy } = getCurrentInstance() as ComponentInternalInstance
+const { common_type } = toRefs<any>(proxy?.useDict('common_type'))
+
+// ProTable 实例
+const proTable = ref<ProTableInstance>()
+// 表单model
+const model = ref({})
+// 删除定检任务记录信息
+const deleteSmTaskRecord = async (params: any) => {
+  await useHandleData(delSmTaskRecordApi, params.id, '删除【' + params.id + '】定检任务记录')
+  proTable.value?.getTableList()
+}
+
+// 批量删除定检任务记录信息
+const batchDelete = async (ids: string[]) => {
+  await useHandleData(delSmTaskRecordApi, ids, '删除所选定检任务记录信息')
+  proTable.value?.clearSelection()
+  proTable.value?.getTableList()
+}
+
+const taskDialogRef = ref<InstanceType<typeof TaskDialog> | null>(null)
+// 导出定检任务记录列表
+const downloadFile = async () => {
+  ElMessageBox.confirm('确认导出定检任务记录数据?', '温馨提示', { type: 'warning' }).then(async () => {
+    exportSmTaskRecordApi(proTable.value?.searchParam)
+    taskDialogRef.value?.openExportDialog()
+  })
+}
+
+// 批量添加定检任务记录
+const dialogRef = ref<InstanceType<typeof ImportExcel> | null>(null)
+const batchAdd = () => {
+  const params = {
+    title: '定检任务记录',
+    tempApi: importTemplateApi,
+    importApi: importSmTaskRecordDataApi,
+    getTableList: proTable.value?.getTableList
+  }
+  dialogRef.value?.acceptParams(params)
+}
+
+const formDialogRef = ref<InstanceType<typeof FormDialog> | null>(null)
+// 打开弹框的功能
+const openDialog = async (type: number, title: string, row?: any) => {
+  let res = { data: {} }
+  if (row?.id) {
+    res = await getSmTaskRecordApi(row?.id || null)
+  }
+  model.value = type == 1 ? {} : res.data
+  // 重置表单
+  setItemsOptions()
+  const params = {
+    title,
+    width: 580,
+    isEdit: type !== 3,
+    api: type == 1 ? addSmTaskRecordApi : updateSmTaskRecordApi,
+    getTableList: proTable.value?.getTableList
+  }
+  formDialogRef.value?.openDialog(params)
+}
+
+// 表格配置项
+const columns = reactive<ColumnProps<any>[]>([
+  { type: 'selection', fixed: 'left', width: 70 },
+  { prop: 'id', label: '编号' },
+  {
+    prop: 'aircraftNo',
+    label: '机号',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'aircraftModel',
+    label: '机型',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'name',
+    label: '任务名称',
+    search: {
+      el: 'date-picker',
+      props: { type: 'datetimerange', valueFormat: 'YYYY-MM-DD HH:mm:ss' }
+    },
+    width: 120
+  },
+  {
+    prop: 'code',
+    label: '任务编码',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'endTime',
+    label: '维修时间',
+    search: {
+      el: 'date-picker',
+      props: { type: 'datetimerange', valueFormat: 'YYYY-MM-DD HH:mm:ss' }
+    },
+    width: 120
+  },
+  {
+    prop: 'remainTime',
+    label: '剩余时间',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'specialty',
+    label: '专业',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'contents',
+    label: '维修内容',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'status',
+    label: '状态',
+    tag: true,
+    enum: common_type
+  },
+  {
+    prop: 'createBy',
+    label: '创建人',
+    width: 120
+  },
+  {
+    prop: 'createTime',
+    label: '创建时间',
+    width: 120
+  },
+  {
+    prop: 'updateBy',
+    label: '更新人',
+    width: 120
+  },
+  {
+    prop: 'updateTime',
+    label: '更新时间',
+    width: 120
+  },
+  { prop: 'operation', label: '操作', width: 230, fixed: 'right' }
+])
+// 表单配置项
+let itemsOptions = reactive<ProForm.ItemsOptions[]>([])
+const setItemsOptions = () => {
+  itemsOptions = [
+    {
+      label: '机号',
+      prop: 'aircraftNo',
+      rules: [{ required: true, message: '机号不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入机号'
+      }
+    },
+    {
+      label: '机型',
+      prop: 'aircraftModel',
+      rules: [{ required: true, message: '机型不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入机型'
+      }
+    },
+    {
+      label: '任务名称',
+      prop: 'name',
+      compOptions: {
+        elTagName: 'date-picker',
+        type: 'date',
+        placeholder: '请选择任务名称'
+      }
+    },
+    {
+      label: '任务编码',
+      prop: 'code',
+      compOptions: {
+        placeholder: '请输入任务编码'
+      }
+    },
+    {
+      label: '维修时间',
+      prop: 'endTime',
+      compOptions: {
+        elTagName: 'date-picker',
+        type: 'date',
+        placeholder: '请选择维修时间'
+      }
+    },
+    {
+      label: '剩余时间',
+      prop: 'remainTime',
+      compOptions: {
+        placeholder: '请输入剩余时间'
+      }
+    },
+    {
+      label: '专业',
+      prop: 'specialty',
+      compOptions: {
+        placeholder: '请输入专业'
+      }
+    },
+    {
+      label: '维修内容',
+      prop: 'contents',
+      compOptions: {
+        placeholder: '请输入维修内容'
+      }
+    }
+  ]
+}
+</script>

+ 362 - 0
src/views/als/smTaskSub/index.vue

@@ -0,0 +1,362 @@
+<template>
+  <div class="table-box">
+    <ProTable ref="proTable" :columns="columns" row-key="id" :request-api="listSmTaskSubApi">
+      <!-- 表格 header 按钮 -->
+      <template #tableHeader="scope">
+        <el-button type="primary" v-auth="['als:smTaskSub:add']" icon="CirclePlus" @click="openDialog(1, '定检任务子新增')"> 新增 </el-button>
+        <el-button type="primary" v-auth="['als:smTaskSub:import']" icon="Upload" plain @click="batchAdd"> 导入 </el-button>
+        <el-button type="primary" v-auth="['als:smTaskSub:export']" icon="Download" plain @click="downloadFile"> 导出 </el-button>
+        <el-button
+          type="danger"
+          v-auth="['als:smTaskSub:remove']"
+          icon="Delete"
+          plain
+          :disabled="!scope.isSelected"
+          @click="batchDelete(scope.selectedListIds)"
+        >
+          批量删除
+        </el-button>
+      </template>
+      <!-- 表格操作 -->
+      <template #operation="scope">
+        <el-button type="primary" link icon="View" v-auth="['als:smTaskSub:query']" @click="openDialog(3, '定检任务子查看', scope.row)">
+          查看
+        </el-button>
+        <el-button type="primary" link icon="EditPen" v-auth="['als:smTaskSub:edit']" @click="openDialog(2, '定检任务子编辑', scope.row)">
+          编辑
+        </el-button>
+        <el-button type="primary" link icon="Delete" v-auth="['als:smTaskSub:remove']" @click="deleteSmTaskSub(scope.row)"> 删除 </el-button>
+      </template>
+    </ProTable>
+    <FormDialog ref="formDialogRef" :items-options="itemsOptions" :model="model" />
+    <ImportExcel ref="dialogRef" />
+    <TaskDialog ref="taskDialogRef" />
+  </div>
+</template>
+
+<script setup lang="tsx" name="SmTaskSub">
+import { useHandleData } from '@/hooks/useHandleData'
+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 {
+  listSmTaskSubApi,
+  delSmTaskSubApi,
+  addSmTaskSubApi,
+  updateSmTaskSubApi,
+  importTemplateApi,
+  importSmTaskSubDataApi,
+  exportSmTaskSubApi,
+  getSmTaskSubApi
+} from '@/api/modules/als/smTaskSub'
+const { proxy } = getCurrentInstance() as ComponentInternalInstance
+const { common_type } = toRefs<any>(proxy?.useDict('common_type'))
+
+// ProTable 实例
+const proTable = ref<ProTableInstance>()
+// 表单model
+const model = ref({})
+// 删除定检任务子信息
+const deleteSmTaskSub = async (params: any) => {
+  await useHandleData(delSmTaskSubApi, params.id, '删除【' + params.id + '】定检任务子')
+  proTable.value?.getTableList()
+}
+
+// 批量删除定检任务子信息
+const batchDelete = async (ids: string[]) => {
+  await useHandleData(delSmTaskSubApi, ids, '删除所选定检任务子信息')
+  proTable.value?.clearSelection()
+  proTable.value?.getTableList()
+}
+
+const taskDialogRef = ref<InstanceType<typeof TaskDialog> | null>(null)
+// 导出定检任务子列表
+const downloadFile = async () => {
+  ElMessageBox.confirm('确认导出定检任务子数据?', '温馨提示', { type: 'warning' }).then(async () => {
+    exportSmTaskSubApi(proTable.value?.searchParam)
+    taskDialogRef.value?.openExportDialog()
+  })
+}
+
+// 批量添加定检任务子
+const dialogRef = ref<InstanceType<typeof ImportExcel> | null>(null)
+const batchAdd = () => {
+  const params = {
+    title: '定检任务子',
+    tempApi: importTemplateApi,
+    importApi: importSmTaskSubDataApi,
+    getTableList: proTable.value?.getTableList
+  }
+  dialogRef.value?.acceptParams(params)
+}
+
+const formDialogRef = ref<InstanceType<typeof FormDialog> | null>(null)
+// 打开弹框的功能
+const openDialog = async (type: number, title: string, row?: any) => {
+  let res = { data: {} }
+  if (row?.id) {
+    res = await getSmTaskSubApi(row?.id || null)
+  }
+  model.value = type == 1 ? {} : res.data
+  // 重置表单
+  setItemsOptions()
+  const params = {
+    title,
+    width: 580,
+    isEdit: type !== 3,
+    api: type == 1 ? addSmTaskSubApi : updateSmTaskSubApi,
+    getTableList: proTable.value?.getTableList
+  }
+  formDialogRef.value?.openDialog(params)
+}
+
+// 表格配置项
+const columns = reactive<ColumnProps<any>[]>([
+  { type: 'selection', fixed: 'left', width: 70 },
+  { prop: 'id', label: '编号' },
+  {
+    prop: 'aircraftNo',
+    label: '机号',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'aircraftModel',
+    label: '机型',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'name',
+    label: '任务名称',
+    search: {
+      el: 'date-picker',
+      props: { type: 'datetimerange', valueFormat: 'YYYY-MM-DD HH:mm:ss' }
+    },
+    width: 120
+  },
+  {
+    prop: 'code',
+    label: '任务编码',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'endTime',
+    label: '维修时间',
+    search: {
+      el: 'date-picker',
+      props: { type: 'datetimerange', valueFormat: 'YYYY-MM-DD HH:mm:ss' }
+    },
+    width: 120
+  },
+  {
+    prop: 'remainTime',
+    label: '剩余时间',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'specialty',
+    label: '专业',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'issueDate',
+    label: '下发日期',
+    search: {
+      el: 'date-picker',
+      props: { type: 'datetimerange', valueFormat: 'YYYY-MM-DD HH:mm:ss' }
+    },
+    width: 120
+  },
+  {
+    prop: 'finishDate',
+    label: '完成日期',
+    search: {
+      el: 'date-picker',
+      props: { type: 'datetimerange', valueFormat: 'YYYY-MM-DD HH:mm:ss' }
+    },
+    width: 120
+  },
+  {
+    prop: 'staff',
+    label: '工作人',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'reviewBy',
+    label: '复查人',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'unitName',
+    label: '单位',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'contents',
+    label: '维修内容',
+    search: {
+      el: 'input'
+    },
+    width: 120
+  },
+  {
+    prop: 'status',
+    label: '状态',
+    tag: true,
+    enum: common_type
+  },
+  {
+    prop: 'createBy',
+    label: '创建人',
+    width: 120
+  },
+  {
+    prop: 'createTime',
+    label: '创建时间',
+    width: 120
+  },
+  {
+    prop: 'updateBy',
+    label: '更新人',
+    width: 120
+  },
+  {
+    prop: 'updateTime',
+    label: '更新时间',
+    width: 120
+  },
+  { prop: 'operation', label: '操作', width: 230, fixed: 'right' }
+])
+// 表单配置项
+let itemsOptions = reactive<ProForm.ItemsOptions[]>([])
+const setItemsOptions = () => {
+  itemsOptions = [
+    {
+      label: '机号',
+      prop: 'aircraftNo',
+      rules: [{ required: true, message: '机号不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入机号'
+      }
+    },
+    {
+      label: '机型',
+      prop: 'aircraftModel',
+      rules: [{ required: true, message: '机型不能为空', trigger: 'blur' }],
+      compOptions: {
+        placeholder: '请输入机型'
+      }
+    },
+    {
+      label: '任务名称',
+      prop: 'name',
+      compOptions: {
+        elTagName: 'date-picker',
+        type: 'date',
+        placeholder: '请选择任务名称'
+      }
+    },
+    {
+      label: '任务编码',
+      prop: 'code',
+      compOptions: {
+        placeholder: '请输入任务编码'
+      }
+    },
+    {
+      label: '维修时间',
+      prop: 'endTime',
+      compOptions: {
+        elTagName: 'date-picker',
+        type: 'date',
+        placeholder: '请选择维修时间'
+      }
+    },
+    {
+      label: '剩余时间',
+      prop: 'remainTime',
+      compOptions: {
+        placeholder: '请输入剩余时间'
+      }
+    },
+    {
+      label: '专业',
+      prop: 'specialty',
+      compOptions: {
+        placeholder: '请输入专业'
+      }
+    },
+    {
+      label: '下发日期',
+      prop: 'issueDate',
+      compOptions: {
+        elTagName: 'date-picker',
+        type: 'date',
+        placeholder: '请选择下发日期'
+      }
+    },
+    {
+      label: '完成日期',
+      prop: 'finishDate',
+      compOptions: {
+        elTagName: 'date-picker',
+        type: 'date',
+        placeholder: '请选择完成日期'
+      }
+    },
+    {
+      label: '工作人',
+      prop: 'staff',
+      compOptions: {
+        placeholder: '请输入工作人'
+      }
+    },
+    {
+      label: '复查人',
+      prop: 'reviewBy',
+      compOptions: {
+        placeholder: '请输入复查人'
+      }
+    },
+    {
+      label: '单位',
+      prop: 'unitName',
+      compOptions: {
+        placeholder: '请输入单位'
+      }
+    },
+    {
+      label: '维修内容',
+      prop: 'contents',
+      compOptions: {
+        placeholder: '请输入维修内容'
+      }
+    }
+  ]
+}
+</script>