Browse Source

调整业务数据几个页面代码、智能问答

Rmengdi 7 months ago
parent
commit
794563d481
36 changed files with 949 additions and 554 deletions
  1. 5 0
      src/api/als/smTask.js
  2. 22 22
      src/router/modules/als/dataManage.js
  3. 35 47
      src/views/als/MDCData/index.vue
  4. 1 1
      src/views/als/airConfiguration/index.vue
  5. 187 42
      src/views/als/airInstall/index.vue
  6. 1 1
      src/views/als/aircraft/index.vue
  7. 116 0
      src/views/als/components/Charts/graph.vue
  8. 1 1
      src/views/als/dataImport/index.vue
  9. 3 3
      src/views/als/falseAlarm/index.vue
  10. 55 45
      src/views/als/faultCase/index.vue
  11. 1 1
      src/views/als/faultConsumable/index.vue
  12. 3 3
      src/views/als/faultDiagnosis/index.vue
  13. 1 1
      src/views/als/faultDiagnosisResult/index.vue
  14. 1 1
      src/views/als/faultEquipment/index.vue
  15. 1 1
      src/views/als/faultNotes/index.vue
  16. 1 1
      src/views/als/faultPersonnel/index.vue
  17. 1 1
      src/views/als/faultSpareParts/index.vue
  18. 89 66
      src/views/als/flightData/index.vue
  19. 1 1
      src/views/als/flightSplitask/index.vue
  20. 20 4
      src/views/als/intelligentQA/index.scss
  21. 50 12
      src/views/als/intelligentQA/index.vue
  22. 3 3
      src/views/als/lifePrediction/index.vue
  23. 1 1
      src/views/als/lifePredictionResult/index.vue
  24. 1 1
      src/views/als/maintainRecord/index.vue
  25. 1 1
      src/views/als/maintenance/index.vue
  26. 3 3
      src/views/als/maintenanceDecision/index.vue
  27. 2 2
      src/views/als/maintenanceRecord/index.vue
  28. 59 63
      src/views/als/maintenanceask/index.vue
  29. 53 17
      src/views/als/maintenanceask/viewDetails.vue
  30. 2 3
      src/views/als/partReplacement/index.vue
  31. 3 3
      src/views/als/preProcessing/index.vue
  32. 64 32
      src/views/als/smTask/SMTaskDetails.vue
  33. 83 128
      src/views/als/smTask/index.vue
  34. 0 1
      src/views/als/trainingData/index.vue
  35. 20 0
      src/views/als/utils/common.js
  36. 59 42
      src/views/als/warning/index.vue

+ 5 - 0
src/api/als/smTask.js

@@ -5,6 +5,11 @@ export const getSmTask = async (data) => {
   return await get('/als/smTask/list', data)
 }
 
+// 查询定检任务详情
+export const getSmTaskDetail = async (id) => {
+  return await get('/als/smTask/' + id)
+}
+
 // 新增定检任务
 export const addSmTask = async (data) => {
   return await post('/als/smTask', data)

+ 22 - 22
src/router/modules/als/dataManage.js

@@ -15,7 +15,7 @@ export const flightData = {
       component: () => import('@/views/als/flightData/index.vue'),
       meta: {
         title: '飞参数据',
-        sort: 2
+        sort: 1
       }
     }
   ]
@@ -35,31 +35,31 @@ export const MDCData = {
       component: () => import('@/views/als/MDCData/index.vue'),
       meta: {
         title: 'MDC数据',
-        sort: 1
-      }
-    }
-  ]
-}
-export const trainingData = {
-  path: '/dataManage',
-  redirect: '/dataManage/trainingData',
-  name: 'TrainingData',
-  component: Layout,
-  meta: {
-    title: '业务数据管理',
-    icon: 'el-icon-s-platform'
-  },
-  children: [
-    {
-      path: '/dataManage/trainingData',
-      component: () => import('@/views/als/trainingData/index.vue'),
-      meta: {
-        title: '作训数据',
-        sort: 3
+        sort: 2
       }
     }
   ]
 }
+// export const trainingData = {
+//   path: '/dataManage',
+//   redirect: '/dataManage/trainingData',
+//   name: 'TrainingData',
+//   component: Layout,
+//   meta: {
+//     title: '业务数据管理',
+//     icon: 'el-icon-s-platform'
+//   },
+//   children: [
+//     {
+//       path: '/dataManage/trainingData',
+//       component: () => import('@/views/als/trainingData/index.vue'),
+//       meta: {
+//         title: '作训数据',
+//         sort: 3
+//       }
+//     }
+//   ]
+// }
 // export const maintainRecord = {
 //   path: '/dataManage',
 //   redirect: '/dataManage/maintainRecord',

+ 35 - 47
src/views/als/MDCData/index.vue

@@ -25,7 +25,10 @@
             <el-input v-model="form.ossId" placeholder="请输入文件编号" />
           </el-form-item> -->
           <el-form-item label="数据源" prop="source">
-            <el-input v-model="form.source" placeholder="请输入数据源" disabled />
+            <el-select v-model="form.source" placeholder="请选择数据源" disabled>
+              <el-option label="飞参数据" value="1"></el-option>
+              <el-option label="MDC数据" value="2"></el-option>
+            </el-select>
           </el-form-item>
           <el-form-item label="机型" prop="aircaftModel">
             <el-select v-model="form.aircaftModel" placeholder="请选择机型" disabled>
@@ -40,7 +43,7 @@
           </el-form-item>
           <el-form-item label="架次号" prop="sortieNo">
             <!-- <el-input v-model="form.sortieNo" placeholder="请输入架次号" /> -->
-            <el-select v-model="form.sortieNo" placeholder="请选择架次号" @click="selectSortieNo">
+            <el-select v-model="form.sortieNo" placeholder="请选择架次号">
               <el-option v-for="item in sortieNoList" :key="item.taskId" :label="item.taskName" :value="item.taskId"> </el-option>
             </el-select>
           </el-form-item>
@@ -51,7 +54,7 @@
 
         <span slot="footer" class="dialog-footer">
           <el-button @click="handleClose">取 消</el-button>
-          <el-button type="primary" @click="submit">确 定</el-button>
+          <el-button type="primary" :loading="submitBtnLoading" @click="submit">确 定</el-button>
         </span>
       </el-dialog>
     </div>
@@ -60,13 +63,13 @@
 
 <script>
 import { getDataImport, addDataImport, updateDataImport, removeDataImport } from '@/api/als/dataImport'
-import { getAircaftCatalogTree, getAircaftTypeAndModelTree } from '@/api/als/sideTree'
+import { getAircaftCatalogTree } from '@/api/als/sideTree'
 import { getAircaftModelAll, getAircaftCatalogAll, getSortieNo } from '@/api/als/aircraft'
 import { getTaskExecondRegister } from '@/api/carrierStandard/carrierListExecutionRegistration'
 import { deepClone, debounce } from '@/utils/index'
-import { getItem } from '@/utils/index'
-
 import FileUpload from '@/views/als/components/FileUpload'
+import { flattenTree } from '../utils/common'
+
 export default {
   name: 'MDCData',
   components: { FileUpload },
@@ -76,6 +79,7 @@ export default {
       dialogTitle: '新增',
       dialogVisible: false,
       keyWordData: '',
+      submitBtnLoading: false,
       aircaftModelIdList: [],
       currentNodeKey: '',
       currentNode: {},
@@ -110,20 +114,15 @@ export default {
         },
         {
           prop: 'sortieNo',
-          label: '架次号'
-          // render: (h, params) => {
-          // const Item = this.aircaftCatalogAll.find((item) => params.row.aircraftId.trim() === item.aircaftCatalogId.trim())
-          // this.getSortieNoAPI(Item.aircaftCatalogCode)
-          // if (code === 200) {
-          //   console.log('data', data)
-          //   const matchedItem = data.find((item) => params.row.sortieNo === item.taskId)
-          //   if (matchedItem) {
-          //     return h('span', matchedItem.taskName)
-          //   } else {
-          //     return h('span', {}, '')
-          //   }
-          // }
-          // }
+          label: '架次号',
+          render: (h, params) => {
+            const matchedItem = this.allTaskExecond.find((item) => params.row.sortieNo.trim() === item.taskId.trim())
+            if (matchedItem) {
+              return h('span', matchedItem.taskName)
+            } else {
+              return h('span', {}, '')
+            }
+          }
         },
         {
           prop: 'source',
@@ -204,19 +203,7 @@ export default {
       aircaftModelAll: [],
       aircaftCatalogAll: [],
       sortieNoList: [],
-      upload: {
-        open: false,
-        title: '',
-        // 是否禁用上传
-        isUploading: false,
-        // 是否更新已经存在的用户数据
-        updateSupport: 0,
-        // 设置上传的请求头部
-        // headers: { Authorization: 'Bearer ' + getToken() },
-        headers: { Authorization: getItem('token') },
-        // 上传的地址
-        url: '/als' + '/dataImport/importData'
-      }
+      allTaskExecond: []
     }
   },
   watch: {
@@ -255,6 +242,13 @@ export default {
 
           this.getDataImportAPI({ aircraftId: this.aircaftModelIdList })
         }
+        const res = await getTaskExecondRegister({
+          status: null,
+          queryParam: '',
+          taskId: '',
+          aircaftCatalogId: ''
+        })
+        this.allTaskExecond = flattenTree(res.data)
       } catch (error) {}
     },
 
@@ -266,20 +260,11 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
-          // await this.getDataImportAPI(this.currentNodeKey === 'quanbu' ? null : this.currentNodeKey)
           await this.getDataImportAPI({ aircraftId: this.aircaftModelIdList })
           this.handleClose()
         }
       } catch (error) {}
     },
-    async selectSortieNo() {
-      try {
-        const { code, data } = await getTaskExecondRegister(this.form.sortieNo)
-        if (code == 200) {
-          this.form.flightDate = data.taskTime
-        }
-      } catch (error) {}
-    },
 
     getTreeLeafData(list) {
       const newArr = []
@@ -306,7 +291,6 @@ export default {
       } = await getDataImport({ pageSize, pageNum: pageIndex, ...params, source: 2 })
       this.tableData = list
       this.tableRequset.total = total
-      // list.
     },
 
     fetch() {
@@ -326,6 +310,8 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.submitBtnLoading = false
+          this.handleClose()
           this.getDataImportAPI({ aircraftId: this.aircaftModelIdList })
         }
       } catch (error) {}
@@ -339,6 +325,8 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.submitBtnLoading = false
+          this.handleClose()
           this.getDataImportAPI({ aircraftId: this.aircaftModelIdList })
         }
       } catch (error) {}
@@ -348,7 +336,6 @@ export default {
       this.$refs.table.clearSelection()
       this.currentNodeKey = data.id
       this.currentNode = data
-      console.log('deta', data)
       this.aircaftModelIdList = this.getTreeLeafData(data.children.length ? data.children : [data])
         .map((e) => e.id)
         .toString()
@@ -396,7 +383,8 @@ export default {
 
     handUpdate(row) {
       this.dialogTitle = '编辑'
-      console.log('row', row)
+      const matchedItem = this.aircaftCatalogAll.find((item) => row.aircraftId.trim() === item.aircaftCatalogId.trim())
+      this.getSortieNoAPI(matchedItem.aircaftCatalogCode)
       this.form = deepClone(row)
       this.dialogVisible = true
     },
@@ -404,12 +392,12 @@ export default {
     submit() {
       switch (this.dialogTitle) {
         case '编辑':
+          this.submitBtnLoading = true
           this.updateDataImportAPI()
-          this.handleClose()
           break
         case '新增':
+          this.submitBtnLoading = true
           this.addDataImportAPI()
-          this.handleClose()
           break
       }
     },

+ 1 - 1
src/views/als/airConfiguration/index.vue

@@ -6,7 +6,7 @@
     <div class="view-dataSpecies-right">
       <div class="view-dataType-title">
         <div class="view-dataType-title-btn">
-          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 1 && currentNode.children.length == 0)">新增</el-button>
+          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 1)">新增</el-button>
           <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
         </div>
         <div class="view-dataType-title-search">

+ 187 - 42
src/views/als/airInstall/index.vue

@@ -22,53 +22,55 @@
       </div>
 
       <!-- 添加或修改装机信息对话框 -->
-      <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="600px" :before-close="handleClose">
-        <el-form ref="form" :model="form" label-width="80px">
-          <el-form-item label="器材编码" prop="devicesEncode">
-            <el-input v-model="form.devicesEncode" placeholder="请输入航材编码" />
+      <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="1000px" :before-close="handleClose">
+        <LTable ref="avmatTableRef" @current-change="avmatSelection" :defaultFetch="false" :columns="avmatColumns" :dataSource="avmatTableData" :options="avmatOptions" :pagination="avmatTableRequset"></LTable>
+        <el-form ref="form" style="margin-top: 20px" :inline="true" :model="form" label-width="80px">
+          <el-form-item label="航材名称" prop="devicesName">
+            <el-input v-model="form.devicesName" placeholder="请输入航材名称" disabled />
           </el-form-item>
-          <el-form-item label="器材代码" prop="devicesCode">
-            <el-input v-model="form.devicesCode" placeholder="请输入航材代码" />
-          </el-form-item>
-          <el-form-item label="器材名称" prop="devicesName">
-            <el-input v-model="form.devicesName" placeholder="请输入器材名称" />
+          <el-form-item label="航材编码" prop="devicesEncode">
+            <el-input v-model="form.devicesEncode" placeholder="请输入航材编码" disabled />
           </el-form-item>
           <el-form-item label="规格型号" prop="specsModel">
-            <el-input v-model="form.specsModel" placeholder="请输入规格型号" />
+            <el-input disabled v-model="form.specsModel" placeholder="请输入规格型号" />
           </el-form-item>
           <el-form-item label="图号" prop="drawingNumber">
-            <el-input v-model="form.drawingNumber" placeholder="请输入图号" />
+            <el-input disabled v-model="form.drawingNumber" placeholder="请输入图号" />
           </el-form-item>
           <el-form-item label="所属分类" prop="category">
-            <el-input v-model="form.category" placeholder="请输入所属分类" />
-          </el-form-item>
-          <el-form-item label="装机数量" prop="quantity">
-            <el-input v-model="form.quantity" placeholder="请输入装机数量" />
-          </el-form-item>
-          <el-form-item label="装机时间" prop="installTime">
-            <el-date-picker v-model="form.installTime" type="date" placement="bottom-start" value-format="yyyy-MM-dd" placeholder="请选择装机时间"></el-date-picker>
-          </el-form-item>
-          <el-form-item label="软件版本" prop="softwareVersion">
-            <el-input v-model="form.softwareVersion" placeholder="请输入软件版本" />
+            <el-input disabled v-model="form.category" placeholder="请输入所属分类" />
           </el-form-item>
           <el-form-item label="是否可修" prop="repairable">
-            <el-select v-model="form.repairable" placeholder="请选择是否可修">
-              <el-option label="是" value="1"></el-option>
-              <el-option label="否" value="0"></el-option>
+            <el-select disabled v-model="form.repairable" placeholder="请选择是否可修">
+              <el-option label="是" :value="1"></el-option>
+              <el-option label="否" :value="0"></el-option>
             </el-select>
           </el-form-item>
           <el-form-item label="是否成套" prop="completeSet">
-            <el-select v-model="form.completeSet" placeholder="请选择是否成套">
-              <el-option label="是" value="1"></el-option>
-              <el-option label="否" value="0"></el-option>
+            <el-select v-model="form.completeSet" placeholder="请选择是否成套" disabled>
+              <el-option label="是" :value="1"></el-option>
+              <el-option label="否" :value="0"></el-option>
             </el-select>
           </el-form-item>
           <el-form-item label="是否有寿" prop="serviceLife">
-            <el-select v-model="form.serviceLife" placeholder="请选择是否有寿">
-              <el-option label="是" value="1"></el-option>
-              <el-option label="否" value="0"></el-option>
+            <el-select v-model="form.serviceLife" placeholder="请选择是否有寿" disabled>
+              <el-option label="是" :value="1"></el-option>
+              <el-option label="否" :value="0"></el-option>
             </el-select>
           </el-form-item>
+          <el-form-item label="航材代码" prop="devicesCode">
+            <el-input v-model="form.devicesCode" placeholder="请输入航材代码" />
+          </el-form-item>
+          <el-form-item label="装机数量" prop="quantity">
+            <el-input v-model="form.quantity" placeholder="请输入装机数量" />
+          </el-form-item>
+          <el-form-item label="装机时间" prop="installTime">
+            <el-date-picker v-model="form.installTime" type="date" placement="bottom-start" value-format="yyyy-MM-dd" placeholder="请选择装机时间"></el-date-picker>
+          </el-form-item>
+          <el-form-item label="软件版本" prop="softwareVersion">
+            <el-input v-model="form.softwareVersion" placeholder="请输入软件版本" />
+          </el-form-item>
+
           <el-form-item label="备注" prop="remarks">
             <el-input v-model="form.remarks" type="textarea" :rows="2" placeholder="请输入备注" />
           </el-form-item>
@@ -89,7 +91,9 @@ import { getAircaftCatalogTree, getAircaftTypeAndModelTree } from '@/api/als/sid
 import { getAircaftModelAll, getAircaftCatalogAll } from '@/api/als/aircraft'
 import { getAirConfiguration } from '@/api/als/airConfiguration'
 import { deepClone, debounce } from '@/utils/index'
-import { handleTree } from '../utils/common'
+import { handleTree, flattenTree } from '../utils/common'
+import { getAvmatCatalog } from '@/api/basicData/dataSailingMaterialMaterialCoding'
+
 export default {
   name: 'AirInstall',
   components: {},
@@ -132,15 +136,15 @@ export default {
       columns: [
         {
           prop: 'devicesEncode',
-          label: '材编码'
+          label: '材编码'
         },
         {
           prop: 'devicesCode',
-          label: '材代码'
+          label: '材代码'
         },
         {
           prop: 'devicesName',
-          label: '材名称'
+          label: '材名称'
         },
         {
           prop: 'specsModel',
@@ -225,6 +229,85 @@ export default {
           ]
         }
       ],
+      avmatColumns: [
+        {
+          prop: 'avmatCatalogName',
+          label: '航材名称',
+          align: 'left'
+        },
+        {
+          prop: 'avmatCatalogCode',
+          label: '航材编码'
+        },
+        {
+          prop: 'avmatCategoriesName',
+          label: '所属分类'
+        },
+        {
+          prop: 'specification',
+          label: '规格型号'
+        },
+        {
+          prop: 'diagramNumber',
+          label: '图号'
+        },
+        {
+          prop: 'unit',
+          label: '计量单位'
+        },
+        {
+          prop: 'specialty',
+          label: '专业'
+        },
+        {
+          prop: 'manufacturer',
+          label: '生产厂家'
+        },
+        {
+          prop: 'isRepairable',
+          label: '是否可修',
+          render: (h, params) => {
+            if (params.row.status == 1) {
+              return h('span', { class: 'success-state' }, '是')
+            } else {
+              return h('span', { class: 'warning-state' }, '否')
+            }
+          }
+        },
+        {
+          prop: 'isCompleteSet',
+          label: '是否成套',
+          render: (h, params) => {
+            if (params.row.isCompleteSet == 1) {
+              return h('span', { class: 'success-state' }, '是')
+            } else {
+              return h('span', { class: 'warning-state' }, '否')
+            }
+          }
+        },
+        {
+          prop: 'isOrdered',
+          label: '是否有寿',
+          render: (h, params) => {
+            if (params.row.isOrdered == 1) {
+              return h('span', { class: 'success-state' }, '是')
+            } else {
+              return h('span', { class: 'warning-state' }, '否')
+            }
+          }
+        },
+        {
+          prop: 'isImported',
+          label: '是否进口',
+          render: (h, params) => {
+            if (params.row.isImported == 1) {
+              return h('span', { class: 'theme-state' }, '进口')
+            } else {
+              return h('span', { class: 'success-state' }, '国产')
+            }
+          }
+        }
+      ],
       options: {
         stripe: true, // 斑马纹
         mutiSelect: false, // 多选框
@@ -234,17 +317,35 @@ export default {
         border: true,
         height: 'calc(100vh - 300px)'
       },
+      avmatOptions: {
+        stripe: true, // 斑马纹
+        mutiSelect: false, // 多选框
+        index: true, // 显示序号, 多选则 mutiSelect
+        loading: false, // 表格动画
+        initTable: false, // 是否一挂载就加载数据
+        border: true,
+        height: '300px'
+      },
       tableCheckItems: [],
       tableData: [],
+      avmatTableData: [],
       tableRequset: {
         total: 0,
         pageIndex: 1,
         pageSize: 10,
         searchValue: ''
       },
+      avmatTableRequset: {
+        total: 0,
+        pageIndex: 1,
+        pageSize: 20,
+        searchValue: ''
+      },
       form: {
         id: '',
-        configId: '',
+        airId: '', //编目id
+        airModelId: '', //机号id
+        configId: '', //构型id
         devicesEncode: '',
         devicesCode: '',
         devicesName: '',
@@ -266,7 +367,8 @@ export default {
         updatedBy: '',
         updatedTime: ''
       },
-      debounceFn: debounce(this.fetch, 500)
+      debounceFn: debounce(this.fetch, 500),
+      currentAirModelId: ''
     }
   },
   watch: {
@@ -282,6 +384,17 @@ export default {
     async getAircaftCatalogTreeAPI(params) {
       const { data } = await getAircaftCatalogTree(params)
       this.menuTreeData = data
+      const { pageSize, pageIndex } = this.avmatTableRequset
+      const {
+        data: { list, totalCount }
+      } = await getAvmatCatalog({
+        pageIndex,
+        pageSize,
+        avmatCategoriesId: '',
+        avmatType: '1'
+      })
+      this.avmatTableData = flattenTree(list)
+      this.avmatTableRequset.total = totalCount
       // if (data.length) {
       //   this.currentNodeKey = data[0].id
       //   this.currentNode = data[0]
@@ -307,7 +420,7 @@ export default {
       const newArr = []
       function getLeaf(data, arr) {
         data.forEach((e) => {
-          if (e.type === 1) {
+          if (e.type === 2) {
             arr.push(e)
           }
           if (e.children.length) {
@@ -369,16 +482,22 @@ export default {
 
     async treeNodeClick(data) {
       // this.$refs.table.clearSelection()
-      // this.currentNodeKey = this.form.aircraftId = data.id
+      this.currentAirModelId = this.form.airId = this.form.airModelId = data.id
       // this.currentNode = data
       // this.form.aircraftType = data.label
       // this.getAirInstallAPI(this.currentNodeKey)
-      console.log('data', data)
+      let dataTree = []
+      if (data.type === 1) {
+        const { data: data1 } = await getAirConfiguration({ aircraftType: data.id })
+        dataTree = data1
+      } else if (data.type === 2) {
+        const { data: data1 } = await getAirConfiguration({ aircraftType: data.parentId })
+        dataTree = data1
+      }
       this.configTreeData = []
-      const { data: data1 } = await getAirConfiguration({ aircraftType: data.parentId })
       const topNode = { id: 1, name: '整机', children: [] }
       // topNode.children = data1
-      topNode.children = handleTree(data1, 'id')
+      topNode.children = handleTree(dataTree, 'id')
       this.configTreeData.push(topNode)
     },
 
@@ -393,13 +512,17 @@ export default {
       this.dialogTitle = '新增'
       this.dialogVisible = true
       this.form.configId = this.currentConfigNodeKey
+      this.form.airId = this.form.airModelId = this.currentAirModelId
     },
 
     handleClose() {
+      this.$refs.avmatTableRef.clearSelection()
       this.dialogVisible = false
       this.form = {
         id: '',
-        configId: '',
+        airId: '', //编目id
+        airModelId: '', //机号id
+        configId: '', //构型id
         devicesEncode: '',
         devicesCode: '',
         devicesName: '',
@@ -444,6 +567,17 @@ export default {
       this.tableCheckItems = val
     },
 
+    avmatSelection(val) {
+      this.form.devicesName = val.avmatCatalogName
+      this.form.devicesEncode = val.avmatCatalogCode
+      this.form.category = val.avmatCategoriesName
+      this.form.specsModel = val.specification
+      this.form.drawingNumber = val.diagramNumber
+      this.form.repairable = val.isRepairable
+      this.form.completeSet = val.isCompleteSet
+      this.form.serviceLife = val.isOrdered
+    },
+
     remove(row) {
       this.$confirm('是否删除该数据', '提示', {
         confirmButtonText: '确定',
@@ -454,6 +588,17 @@ export default {
           this.removeAirInstallAPI(row.map((e) => e.id))
         })
         .catch(() => {})
+    },
+
+    async changeDevicesName(avmatCatalogId) {
+      console.log('avmatCatalogId', avmatCatalogId)
+      const {
+        data: { list }
+      } = await getAvmatCatalog({
+        avmatCatalogId: avmatCatalogId
+      })
+      // this.form = list[0]
+      // console.log(this.form, list[0])
     }
   }
 }

+ 1 - 1
src/views/als/aircraft/index.vue

@@ -193,7 +193,7 @@ export default {
       const newArr = []
       function getLeaf(data, arr) {
         data.forEach((e) => {
-          if (e.type === 1) {
+          if (e.type === 2) {
             arr.push(e)
           }
           if (e.children.length) {

+ 116 - 0
src/views/als/components/Charts/graph.vue

@@ -0,0 +1,116 @@
+<template>
+  <div ref="chart" class="chart" :style="{ width: width + 'px', height: height + 'px' }"></div>
+</template>
+
+<script>
+import * as echarts from 'echarts'
+
+export default {
+  name: 'Graph',
+  props: {
+    // 图表宽度
+    width: {
+      type: Number,
+      default: 500
+    },
+    // 图表高度
+    height: {
+      type: Number,
+      default: 200
+    },
+    // 关系图数据
+    graphData: {
+      type: Object,
+      required: true
+    }
+  },
+  data() {
+    return {
+      chartInstance: null
+    }
+  },
+  watch: {
+    graphData: {
+      handler(newVal) {
+        if (this.chartInstance) {
+          this.setOptions()
+        }
+      },
+      deep: true
+    }
+  },
+  mounted() {
+    this.initChart()
+  },
+  beforeDestroy() {
+    if (this.chartInstance) {
+      this.chartInstance.dispose()
+    }
+  },
+  methods: {
+    initChart() {
+      this.chartInstance = echarts.init(this.$refs.chart)
+      this.setOptions()
+    },
+    setOptions() {
+      const options = {
+        title: {},
+        tooltip: {},
+        legend: {},
+        animationDurationUpdate: 1500,
+        animationEasingUpdate: 'quinticInOut',
+        series: [
+          {
+            type: 'graph',
+            layout: 'force',
+            // 设置节点符号为矩形
+            // symbol: 'rect',
+            // symbolSize: (value) => {
+            //   if (!value || !value.name) {
+            //     return [80, 30] // 返回默认大小
+            //   }
+            //   // 根据节点名称长度或其他属性来确定大小
+            //   const textSize = value.name.length * 10 // 假设每增加一个字符宽度增加10px
+            //   return [textSize, 30]
+            // },
+            symbolSize: 50,
+            roam: true,
+            draggable: true,
+            label: {
+              show: true
+            },
+            edgeSymbol: ['circle', 'arrow'],
+            edgeSymbolSize: [4, 10],
+            edgeLabel: {
+              show: true,
+              formatter: '{c}',
+              position: 'middle',
+              textStyle: {
+                fontSize: 14,
+                color: '#333'
+              }
+            },
+            // edgeLabel: {
+            //   fontSize: 20
+            // },
+            data: this.graphData.data,
+            links: this.graphData.links,
+            categories: this.graphData.categories,
+            force: {
+              repulsion: 1500
+            }
+          }
+        ]
+      }
+      this.chartInstance.setOption(options)
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.chart {
+  background-color: aliceblue;
+  border-radius: 10px;
+}
+</style>

+ 1 - 1
src/views/als/dataImport/index.vue

@@ -204,7 +204,7 @@ export default {
       const newArr = []
       function getLeaf(data, arr) {
         data.forEach((e) => {
-          if (e.type === 1) {
+          if (e.type === 2) {
             arr.push(e)
           }
           if (e.children.length) {

+ 3 - 3
src/views/als/falseAlarm/index.vue

@@ -6,12 +6,12 @@
     <div class="view-dataSpecies-right">
       <div class="view-dataType-title">
         <div class="view-dataType-title-btn">
-          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 1 && currentNode.children.length == 0)">新增</el-button>
+          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 2)">新增</el-button>
           <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
         </div>
         <div class="view-dataType-title-search">
           <el-input placeholder="请输入架次号" v-model="keyWordData" class="input1">
-            <el-button slot="append" icon="el-icon-search" @click="searchClick" :disabled="!(currentNode.type == 1 && currentNode.children.length == 0)"></el-button>
+            <el-button slot="append" icon="el-icon-search" @click="searchClick" :disabled="!(currentNode.type == 2)"></el-button>
           </el-input>
         </div>
       </div>
@@ -390,7 +390,7 @@ export default {
       const newArr = []
       function getLeaf(data, arr) {
         data.forEach((e) => {
-          if (e.type === 1) {
+          if (e.type === 2) {
             arr.push(e)
           }
           if (e.children.length) {

+ 55 - 45
src/views/als/faultCase/index.vue

@@ -6,7 +6,7 @@
     <div class="view-dataSpecies-right">
       <div class="view-dataType-title">
         <div class="view-dataType-title-btn">
-          <el-button type="success" @click="openDialog()" :disabled="currentNode && !currentNode.type == 1">新增</el-button>
+          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 2)">新增</el-button>
           <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
         </div>
         <div class="view-dataType-title-search">
@@ -21,8 +21,13 @@
       <!-- 添加或修改故障案例对话框 -->
       <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="600px" :before-close="handleClose">
         <el-form ref="form" :model="form" label-width="80px">
-          <el-form-item label="飞机编号" prop="aircraftCode">
-            <el-select v-model="form.aircraftCode" placeholder="请选择飞机编号">
+          <el-form-item label="机型" prop="aircraftType">
+            <el-select v-model="form.aircraftType" placeholder="请选择机型" disabled>
+              <el-option v-for="item in aircaftModelAll" :key="item.aircaftModelId" :label="item.aircaftModelName" :value="item.aircaftModelId"> </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="编目" prop="aircraftCode">
+            <el-select v-model="form.aircraftCode" placeholder="请选择编目" disabled>
               <el-option v-for="item in aircaftCatalogAll" :key="item.aircaftCatalogId" :label="item.aircaftCatalogCode" :value="item.aircaftCatalogId"> </el-option>
             </el-select>
           </el-form-item>
@@ -83,7 +88,7 @@
       <el-dialog title="故障案例详情" :visible.sync="detailVisible" width="1000px" :show-close="false">
         <el-descriptions border>
           <el-descriptions-item label="飞机型号">{{ detailAircraftType }}</el-descriptions-item>
-          <el-descriptions-item label="飞机编号">{{ detailAircraftCode }}</el-descriptions-item>
+          <el-descriptions-item label="编目">{{ detailAircraftCode }}</el-descriptions-item>
           <el-descriptions-item label="故障名称">{{ form.faultName }}</el-descriptions-item>
           <el-descriptions-item label="故障日期">{{ form.faultDate }}</el-descriptions-item>
           <el-descriptions-item label="故障现象">{{ form.symptoms }}</el-descriptions-item>
@@ -97,7 +102,7 @@
           <el-descriptions-item label="故障文件">{{ detailOssId }}</el-descriptions-item>
         </el-descriptions>
         <span slot="footer" class="dialog-footer">
-          <el-button @click="detailVisible = false">确 定</el-button>
+          <el-button @click="detailSubmit">确 定</el-button>
         </span>
       </el-dialog>
     </div>
@@ -111,6 +116,7 @@ import { getAircaftModelAll, getAircaftCatalogAll } from '@/api/als/aircraft'
 import { deepClone, debounce } from '@/utils/index'
 import { getListByIdsApi } from '@/api/als/oss'
 import FileUpload from '@/views/als/components/FileUpload'
+import { flattenTree } from '../utils/common'
 
 export default {
   name: 'FaultCase',
@@ -123,8 +129,8 @@ export default {
       detailVisible: false,
       keyWordData: '',
       aircaftModelIdList: [],
-      currentNodeKey: null,
-      currentNode: null,
+      currentNodeKey: '',
+      currentNode: {},
       menuTreeData: [],
       treeObj: {
         title: '所属机种',
@@ -141,7 +147,6 @@ export default {
       },
       searchValue: '',
       columns: [
-        { prop: 'id', label: '编号' },
         {
           prop: 'aircraftType',
           label: '机型',
@@ -156,9 +161,9 @@ export default {
         },
         {
           prop: 'aircraftCode',
-          label: '飞机编号',
+          label: '编目',
           render: (h, params) => {
-            const matchedItem = this.aircaftCatalogAll.find((item) => params.row.aircraftCode.trim() === item.aircaftCatalogId.trim())
+            const matchedItem = this.aircaftCatalogAll.find((item) => params.row.aircraftCode === item.aircaftCatalogId)
             if (matchedItem) {
               return h('span', matchedItem.aircaftCatalogCode)
             } else {
@@ -225,6 +230,7 @@ export default {
           ]
         }
       ],
+
       options: {
         stripe: true, // 斑马纹
         mutiSelect: true, // 多选框
@@ -299,23 +305,28 @@ export default {
   },
   methods: {
     async getAircaftCatalogTreeAPI(params) {
-      const { data } = await getAircaftTypeAndModelTree(params)
-      this.menuTreeData = data
-      const getAircaftModelAllParams = {
-        aircaftTypeCode: '',
-        aircaftTypeId: '',
-        queryParam: ''
-      }
-      const { data: data1 } = await getAircaftModelAll(getAircaftModelAllParams)
-      this.aircaftModelAll = data1
-      if (data.length) {
-        this.currentNodeKey = data[0].id
-        this.currentNode = data[0]
-        // this.aircaftModelIdList = this.getTreeLeafData(data[0]?.children)
-        //   .map((e) => e.id)
-        //   .toString()
-        // this.getFaultCaseAPI({ aircraftId: this.aircaftModelIdList })
-      }
+      try {
+        const { data } = await getAircaftCatalogTree(params)
+        this.menuTreeData = data
+        const getAircaftModelAllParams = {
+          aircaftTypeCode: '',
+          aircaftTypeId: '',
+          queryParam: ''
+        }
+        const { data: data1 } = await getAircaftModelAll(getAircaftModelAllParams)
+        this.aircaftModelAll = data1
+        if (data.length) {
+          this.currentNodeKey = data[0].id
+          this.currentNode = data[0]
+          this.aircaftModelIdList = String(this.getTreeLeafData(data[0]?.children).map((e) => e.id))
+          this.getFaultCaseAPI({ aircraftCodes: this.aircaftModelIdList })
+        }
+        const { data: data2 } = await getAircaftCatalogAll({
+          keyWord: '',
+          aircaftModelIdList: []
+        })
+        this.aircaftCatalogAll = flattenTree(data2)
+      } catch (error) {}
     },
 
     async removeFaultCaseAPI(params) {
@@ -326,7 +337,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
-          await this.getFaultCaseAPI({ aircraftType: this.aircaftModelIdList })
+          await this.getFaultCaseAPI({ aircraftCodes: this.aircaftModelIdList })
           this.handleClose()
         }
       } catch (error) {}
@@ -336,7 +347,7 @@ export default {
       const newArr = []
       function getLeaf(data, arr) {
         data.forEach((e) => {
-          if (e.type === 1) {
+          if (e.type === 2) {
             arr.push(e)
           }
           if (e.children.length) {
@@ -360,11 +371,11 @@ export default {
     },
 
     fetch() {
-      this.getFaultCaseAPI({ aircraftType: this.aircaftModelIdList })
+      this.getFaultCaseAPI({ aircraftCodes: this.aircaftModelIdList })
     },
 
     async searchClick() {
-      this.getFaultCaseAPI({ aircraftType: this.aircaftModelIdList, faultName: this.keyWordData })
+      this.getFaultCaseAPI({ aircraftCodes: this.aircaftModelIdList, faultName: this.keyWordData })
     },
 
     async addFaultCaseAPI() {
@@ -376,7 +387,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
-          this.getFaultCaseAPI({ aircraftType: this.aircaftModelIdList })
+          this.getFaultCaseAPI({ aircraftCodes: this.aircaftModelIdList })
         }
       } catch (error) {}
     },
@@ -389,31 +400,24 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
-          this.getFaultCaseAPI({ aircraftType: this.aircaftModelIdList })
+          this.getFaultCaseAPI({ aircraftCodes: this.aircaftModelIdList })
         }
       } catch (error) {}
     },
 
     async treeNodeClick(data) {
       this.$refs.table.clearSelection()
-      this.currentNodeKey = this.form.aircraftType = data.id
+      this.currentNodeKey = this.form.aircraftCode = data.id
       this.currentNode = data
-      this.aircaftModelIdList = this.getTreeLeafData(data.children.length ? data.children : [data])
-        .map((e) => e.id)
-        .toString()
-      this.getFaultCaseAPI({ aircraftType: this.currentNode.id })
-      const getAircaftCatalogAllParams = {
-        keyWord: '',
-        aircaftModelIdList: [this.currentNodeKey]
-      }
-      const { data: data2 } = await getAircaftCatalogAll(getAircaftCatalogAllParams)
-      this.aircaftCatalogAll = data2
+      this.aircaftModelIdList = String(this.getTreeLeafData(data.children.length ? data.children : [data]).map((e) => e.id))
+      this.getFaultCaseAPI({ aircraftCodes: this.aircaftModelIdList })
     },
 
     openDialog() {
       this.dialogTitle = '新增'
       this.dialogVisible = true
-      this.form.aircraftType = this.currentNode.id
+      this.form.aircraftType = this.currentNode.parentId
+      this.form.aircraftCode = this.currentNodeKey
     },
 
     handleClose() {
@@ -441,6 +445,7 @@ export default {
     handUpdate(row) {
       this.dialogTitle = '编辑'
       this.form = deepClone(row)
+      this.form.aircraftType = this.currentNode.parentId
       this.dialogVisible = true
     },
 
@@ -486,6 +491,11 @@ export default {
       this.detailAircraftType = aircraftTypeItem.aircaftModelName
       this.detailAircraftCode = aircraftCodeItem.aircaftCatalogCode
       this.detailVisible = true
+    },
+
+    detailSubmit() {
+      this.handleClose()
+      this.detailVisible = false
     }
   }
 }

+ 1 - 1
src/views/als/faultConsumable/index.vue

@@ -193,7 +193,7 @@ export default {
       const newArr = []
       function getLeaf(data, arr) {
         data.forEach((e) => {
-          if (e.type === 1) {
+          if (e.type === 2) {
             arr.push(e)
           }
           if (e.children.length) {

+ 3 - 3
src/views/als/faultDiagnosis/index.vue

@@ -6,12 +6,12 @@
     <div class="view-dataSpecies-right">
       <div class="view-dataType-title">
         <div class="view-dataType-title-btn">
-          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 1 && currentNode.children.length == 0)">新增</el-button>
+          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 2)">新增</el-button>
           <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
         </div>
         <div class="view-dataType-title-search">
           <el-input placeholder="请输入架次号" v-model="keyWordData" class="input1">
-            <el-button slot="append" icon="el-icon-search" @click="searchClick" :disabled="!(currentNode.type == 1 && currentNode.children.length == 0)"></el-button>
+            <el-button slot="append" icon="el-icon-search" @click="searchClick" :disabled="!(currentNode.type == 2)"></el-button>
           </el-input>
         </div>
       </div>
@@ -375,7 +375,7 @@ export default {
       const newArr = []
       function getLeaf(data, arr) {
         data.forEach((e) => {
-          if (e.type === 1) {
+          if (e.type === 2) {
             arr.push(e)
           }
           if (e.children.length) {

+ 1 - 1
src/views/als/faultDiagnosisResult/index.vue

@@ -188,7 +188,7 @@ export default {
       const newArr = []
       function getLeaf(data, arr) {
         data.forEach((e) => {
-          if (e.type === 1) {
+          if (e.type === 2) {
             arr.push(e)
           }
           if (e.children.length) {

+ 1 - 1
src/views/als/faultEquipment/index.vue

@@ -209,7 +209,7 @@ export default {
       const newArr = []
       function getLeaf(data, arr) {
         data.forEach((e) => {
-          if (e.type === 1) {
+          if (e.type === 2) {
             arr.push(e)
           }
           if (e.children.length) {

+ 1 - 1
src/views/als/faultNotes/index.vue

@@ -185,7 +185,7 @@ export default {
       const newArr = []
       function getLeaf(data, arr) {
         data.forEach((e) => {
-          if (e.type === 1) {
+          if (e.type === 2) {
             arr.push(e)
           }
           if (e.children.length) {

+ 1 - 1
src/views/als/faultPersonnel/index.vue

@@ -201,7 +201,7 @@ export default {
       const newArr = []
       function getLeaf(data, arr) {
         data.forEach((e) => {
-          if (e.type === 1) {
+          if (e.type === 2) {
             arr.push(e)
           }
           if (e.children.length) {

+ 1 - 1
src/views/als/faultSpareParts/index.vue

@@ -209,7 +209,7 @@ export default {
       const newArr = []
       function getLeaf(data, arr) {
         data.forEach((e) => {
-          if (e.type === 1) {
+          if (e.type === 2) {
             arr.push(e)
           }
           if (e.children.length) {

+ 89 - 66
src/views/als/flightData/index.vue

@@ -6,7 +6,7 @@
     <div class="view-dataSpecies-right">
       <div class="view-dataType-title">
         <div class="view-dataType-title-btn">
-          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 1 && currentNode.children.length == 0)">新增</el-button>
+          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 2)">新增</el-button>
           <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
         </div>
         <div class="view-dataType-title-search">
@@ -25,7 +25,10 @@
             <el-input v-model="form.ossId" placeholder="请输入文件编号" />
           </el-form-item> -->
           <el-form-item label="数据源" prop="source">
-            <el-input v-model="form.source" placeholder="请输入数据源" disabled />
+            <el-select v-model="form.source" placeholder="请选择数据源" disabled>
+              <el-option label="飞参数据" value="1"></el-option>
+              <el-option label="MDC数据" value="2"></el-option>
+            </el-select>
           </el-form-item>
           <el-form-item label="机型" prop="aircaftModel">
             <el-select v-model="form.aircaftModel" placeholder="请选择机型" disabled>
@@ -39,11 +42,9 @@
             </el-select>
           </el-form-item>
           <el-form-item label="架次号" prop="sortieNo">
-            <el-input v-model="form.sortieNo" placeholder="请输入架次号" />
-          </el-form-item>
-          <el-form-item label="飞行日期" prop="flightDate">
-            <el-date-picker v-model="form.flightDate" type="date" value-format="yyyy-MM-dd" placement="bottom-start" placeholder="请选择飞行日期"> </el-date-picker>
-            <!-- <el-date-picker v-model="form.flightDate" type="datetime" value-format="YYYY-MM-DD HH:MM:SS" placeholder="请选择飞行日期"> </el-date-picker> -->
+            <el-select v-model="form.sortieNo" placeholder="请选择架次号">
+              <el-option v-for="item in sortieNoList" :key="item.taskId" :label="item.taskName" :value="item.taskId"> </el-option>
+            </el-select>
           </el-form-item>
           <el-form-item label="数据导入" prop="ossId">
             <FileUpload v-model="form.ossId" :limit="1" :fileSize="500" :fileType="['xls', 'xlsx']" />
@@ -52,7 +53,7 @@
 
         <span slot="footer" class="dialog-footer">
           <el-button @click="handleClose">取 消</el-button>
-          <el-button type="primary" @click="submit">确 定</el-button>
+          <el-button type="primary" :loading="submitBtnLoading" @click="submit">确 定</el-button>
         </span>
       </el-dialog>
     </div>
@@ -61,10 +62,12 @@
 
 <script>
 import { getDataImport, addDataImport, updateDataImport, removeDataImport } from '@/api/als/dataImport'
-import { getAircaftCatalogTree, getAircaftTypeAndModelTree } from '@/api/als/sideTree'
-import { getAircaftModelAll, getAircaftCatalogAll } from '@/api/als/aircraft'
+import { getAircaftCatalogTree } from '@/api/als/sideTree'
+import { getAircaftModelAll, getAircaftCatalogAll, getSortieNo } from '@/api/als/aircraft'
+import { getTaskExecondRegister } from '@/api/carrierStandard/carrierListExecutionRegistration'
 import { deepClone, debounce } from '@/utils/index'
 import FileUpload from '@/views/als/components/FileUpload'
+import { flattenTree } from '../utils/common'
 
 export default {
   name: 'DataImport',
@@ -76,6 +79,7 @@ export default {
       dialogVisible: false,
       keyWordData: '',
       aircaftModelIdList: [],
+      submitBtnLoading: false,
       currentNodeKey: '',
       currentNode: {},
       menuTreeData: [],
@@ -94,16 +98,6 @@ export default {
       },
       searchValue: '',
       columns: [
-        { prop: 'id', label: '唯一编号' },
-        {
-          prop: 'ossId',
-          label: '文件编号'
-        },
-
-        {
-          prop: 'source',
-          label: '数据源'
-        },
         {
           prop: 'aircraftId',
           label: '编目',
@@ -118,15 +112,30 @@ export default {
         },
         {
           prop: 'sortieNo',
-          label: '架次号'
+          label: '架次号',
+          render: (h, params) => {
+            const matchedItem = this.allTaskExecond.find((item) => params.row.sortieNo.trim() === item.taskId.trim())
+            if (matchedItem) {
+              return h('span', matchedItem.taskName)
+            } else {
+              return h('span', {}, '')
+            }
+          }
         },
         {
-          prop: 'flightDate',
-          label: '飞行日期'
+          prop: 'source',
+          label: '数据源',
+          render: (h, params) => {
+            if (params.row.source == 1) {
+              return h('span', { class: 'success-state' }, '飞参数据')
+            } else {
+              return h('span', { class: 'success-state' }, 'MDC数据')
+            }
+          }
         },
         {
-          prop: 'status',
-          label: '状态'
+          prop: 'ossId',
+          label: '文件编号'
         },
         {
           button: true,
@@ -190,7 +199,9 @@ export default {
       },
       debounceFn: debounce(this.fetch, 500),
       aircaftModelAll: [],
-      aircaftCatalogAll: []
+      aircaftCatalogAll: [],
+      sortieNoList: [],
+      allTaskExecond: []
     }
   },
   watch: {
@@ -204,29 +215,38 @@ export default {
   },
   methods: {
     async getAircaftCatalogTreeAPI(params) {
-      const { data } = await getAircaftCatalogTree(params)
-      this.menuTreeData = data
-      const getAircaftModelAllParams = {
-        aircaftTypeCode: '',
-        aircaftTypeId: '',
-        queryParam: ''
-      }
-      const { data: data1 } = await getAircaftModelAll(getAircaftModelAllParams)
-      this.aircaftModelAll = data1
-      const getAircaftCatalogAllParams = {
-        keyWord: '',
-        aircaftModelIdList: []
-      }
-      const { data: data2 } = await getAircaftCatalogAll(getAircaftCatalogAllParams)
-      this.aircaftCatalogAll = data2
-      if (data.length) {
-        this.currentNodeKey = data[0].id
-        this.currentNode = data[0]
-        this.aircaftModelIdList = this.getTreeLeafData(data[0]?.children)
-          .map((e) => e.id)
-          .toString()
-        this.getDataImportAPI({ aircraftId: this.aircaftModelIdList })
-      }
+      try {
+        const { data } = await getAircaftCatalogTree(params)
+        this.menuTreeData = data
+        const getAircaftModelAllParams = {
+          aircaftTypeCode: '',
+          aircaftTypeId: '',
+          queryParam: ''
+        }
+        const { data: data1 } = await getAircaftModelAll(getAircaftModelAllParams)
+        this.aircaftModelAll = data1
+        const getAircaftCatalogAllParams = {
+          keyWord: '',
+          aircaftModelIdList: []
+        }
+        const { data: data2 } = await getAircaftCatalogAll(getAircaftCatalogAllParams)
+        this.aircaftCatalogAll = data2
+        if (data.length) {
+          this.currentNodeKey = data[0].id
+          this.currentNode = data[0]
+          this.aircaftModelIdList = this.getTreeLeafData(data[0]?.children)
+            .map((e) => e.id)
+            .toString()
+          this.getDataImportAPI({ aircraftId: this.aircaftModelIdList })
+        }
+        const res = await getTaskExecondRegister({
+          status: null,
+          queryParam: '',
+          taskId: '',
+          aircaftCatalogId: ''
+        })
+        this.allTaskExecond = flattenTree(res.data)
+      } catch (error) {}
     },
 
     async removeDataImportAPI(params) {
@@ -247,7 +267,7 @@ export default {
       const newArr = []
       function getLeaf(data, arr) {
         data.forEach((e) => {
-          if (e.type === 1) {
+          if (e.type === 2) {
             arr.push(e)
           }
           if (e.children.length) {
@@ -287,6 +307,8 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.handleClose()
+          this.submitBtnLoading = false
           this.getDataImportAPI({ aircraftId: this.aircaftModelIdList })
         }
       } catch (error) {}
@@ -300,6 +322,8 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.handleClose()
+          this.submitBtnLoading = false
           this.getDataImportAPI({ aircraftId: this.aircaftModelIdList })
         }
       } catch (error) {}
@@ -312,7 +336,18 @@ export default {
       this.aircaftModelIdList = this.getTreeLeafData(data.children.length ? data.children : [data])
         .map((e) => e.id)
         .toString()
+      if (!this.aircaftModelIdList) {
+        this.aircaftModelIdList = '#'
+      }
       this.getDataImportAPI({ aircraftId: this.aircaftModelIdList })
+      this.getSortieNoAPI(data.label)
+    },
+
+    async getSortieNoAPI(aircaftCatalogCode) {
+      const res = await getSortieNo({ aircaftCatalogCode })
+      this.sortieNoList = res.data.filter((item) => {
+        return item.taskName
+      })
     },
 
     openDialog() {
@@ -322,8 +357,6 @@ export default {
       this.form.aircaftModel = this.currentNode.parentId
     },
 
-    checkDetails(row) {},
-
     handleClose() {
       this.dialogVisible = false
       this.form = {
@@ -347,6 +380,8 @@ export default {
 
     handUpdate(row) {
       this.dialogTitle = '编辑'
+      const matchedItem = this.aircaftCatalogAll.find((item) => row.aircraftId.trim() === item.aircaftCatalogId.trim())
+      this.getSortieNoAPI(matchedItem.aircaftCatalogCode)
       this.form = deepClone(row)
       this.dialogVisible = true
     },
@@ -354,12 +389,12 @@ export default {
     submit() {
       switch (this.dialogTitle) {
         case '编辑':
+          this.submitBtnLoading = true
           this.updateDataImportAPI()
-          this.handleClose()
           break
         case '新增':
+          this.submitBtnLoading = true
           this.addDataImportAPI()
-          this.handleClose()
           break
       }
     },
@@ -378,18 +413,6 @@ export default {
           this.removeDataImportAPI(row.map((e) => e.id))
         })
         .catch(() => {})
-    },
-    async downloadFile() {
-      this.$confirm('确认导出飞参数据?', '温馨提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      })
-        .then(() => {
-          //       exportDownApi(proTable.value?.searchParam)
-          // taskDialogRef.value?.openExportDialog()
-        })
-        .catch(() => {})
     }
   }
 }

+ 1 - 1
src/views/als/flightSplitask/index.vue

@@ -230,7 +230,7 @@ export default {
       const newArr = []
       function getLeaf(data, arr) {
         data.forEach((e) => {
-          if (e.type === 1) {
+          if (e.type === 2) {
             arr.push(e)
           }
           if (e.children.length) {

+ 20 - 4
src/views/als/intelligentQA/index.scss

@@ -37,13 +37,16 @@
     flex: 1;
     // background-color: #f8f8fc4c;
     display: flex;
-      flex-direction: column;
+    flex-direction: column;
+    overflow: scroll;
+
     .chatLine {
       flex: 1;
       width: 100%;
       max-width: 1200px;
       margin: 0 auto;
-      overflow-y: auto;
+      
+      // overflow-y: auto;
     }
     .chatRow {
       margin: 20px 10px;
@@ -56,11 +59,23 @@
         display: inline-block;
         border-radius: 8px;
         padding: 6px 12px;
-        background: rgba(255, 255, 255, 0.4);
+        background: #11536771;
         box-shadow: 0 16px 20px 0 rgba(174, 167, 223, 0.06);
         color: #fff;
       }
     }
+    .answerData{
+      max-width: 800px;
+        display: inline-block;
+        border-radius: 8px;
+        padding: 6px 12px;
+        background: #11536771;
+        box-shadow: 0 16px 20px 0 rgba(174, 167, 223, 0.06);
+        color: #fff;
+        .answer{
+          margin: 20px 0;
+        }
+    }
   }
 
   .footer{
@@ -101,7 +116,8 @@
   }
 }
 
-::-webkit-scrollbar{ /*滚动条整体样式*/
+::-webkit-scrollbar{
+  display: none;  //隐藏滚动条
   width: 5px;
   height: 1px;
 }

+ 50 - 12
src/views/als/intelligentQA/index.vue

@@ -3,12 +3,17 @@
     <div class="aside">历史记录</div>
     <div class="chat">
       <!-- <div class="header">Header</div> -->
-      <div class="main">
+      <div ref="main" class="main">
         <div class="chatLine">
           <div v-for="(item, index) in chatInfo" :key="index">
-            <div class="chatRow" v-if="item.type === 'HMC'"></div>
-            <div class="chatRow" v-if="item.type === 'QA'"></div>
-            <div class="chatRow chatQ" v-if="item.type === 'question'">
+            <div class="chatRow" v-if="item.code === 200">
+              <div class="answerData">
+                <div class="answer">{{ item.data.answer }}</div>
+                <!-- <div class="graph"></div> -->
+                <graphECharts :graphData="item.data.graph" class="charts"></graphECharts>
+              </div>
+            </div>
+            <div class="chatRow chatQ" v-if="item.userId">
               <div class="questionContent">{{ item.data }}</div>
             </div>
           </div>
@@ -19,19 +24,21 @@
           <textarea v-model="questionInput" :style="{ height: `${currentHeight}px`, overflowY: isScrollable ? 'auto' : 'hidden' }" placeholder="请输入您的问题..." @keydown="handleKeydown"> </textarea>
           <i class="el-icon-s-promotion icon" @click="sendQuestion"></i>
         </div>
-
-        <!-- :rows="3" type="textarea" -->
-        <!-- <el-input ref="textareaRef" v-model="questionInput" class="textarea" @input="adjustHeight" @keyup.enter.native="sendQuestion()" placeholder="请输入问题" suffix-icon="el-icon-date" :style="{ height: `${currentHeight}px` }"> </el-input> -->
       </div>
     </div>
   </div>
 </template>
 
 <script>
+import store from '@/store'
+import graphECharts from '@/views/als/components/Charts/graph.vue'
+
 export default {
   name: 'IntelligentQA',
+  components: { graphECharts },
   data() {
     return {
+      userId: '',
       chatInfo: [],
       questionInput: '',
       currentHeight: 'auto',
@@ -40,11 +47,16 @@ export default {
     }
   },
   mounted() {
+    this.getUserInfo()
     this.adjustHeight()
   },
   watch: {},
   created() {},
   methods: {
+    async getUserInfo() {
+      const { user } = await store.dispatch('user/getUserInfo')
+      this.userId = user.userId
+    },
     adjustHeight() {
       const textarea = this.$el.querySelector('textarea')
       this.currentHeight = 'auto'
@@ -87,12 +99,38 @@ export default {
       if (this.questionInput.trim() === '') {
         return
       }
-      this.chatInfo.push({
-        data: this.questionInput,
-        type: 'question'
-        // time: '当前时间'
-      })
+      this.chatInfo.push(
+        {
+          data: this.questionInput,
+          userId: this.userId
+        },
+        {
+          code: 200,
+          msg: '',
+          data: {
+            user_id: 'user',
+            answer: '发生。。。。。。。xxxxxxx',
+            graph: {
+              data: [
+                { name: '111', category: 'HMC' },
+                { name: '更换手机屏幕', category: '维修策略' }
+              ],
+              links: [{ source: '111', target: '更换手机屏幕', value: '维修策略' }],
+              categories: [{ name: 'HMC' }, { name: '维修策略' }]
+            }
+          }
+        }
+      )
+      console.log('this.chatInfo', this.chatInfo)
       this.questionInput = ''
+      // 等处理过返回数据后,调用使视图保持在最底部
+      let main = this.$refs.main
+      setTimeout(() => {
+        main.scrollTop = main.scrollHeight
+      }, 0)
+    },
+    showGraph(graphData) {
+      const { data, links } = graphData
     }
   }
 }

+ 3 - 3
src/views/als/lifePrediction/index.vue

@@ -7,13 +7,13 @@
       <div class="view-dataType-title">
         <div class="view-dataType-title-btn">
           <div class="view-dataType-title-btn">
-            <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 1 && currentNode.children.length == 0)">新增</el-button>
+            <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 2)">新增</el-button>
             <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
           </div>
         </div>
         <div class="view-dataType-title-search">
           <el-input placeholder="请输入关键字" v-model="keyWordData" class="input1">
-            <el-button slot="append" icon="el-icon-search" @click="searchClick" :disabled="!(currentNode.type == 1 && currentNode.children.length == 0)"></el-button>
+            <el-button slot="append" icon="el-icon-search" @click="searchClick" :disabled="!(currentNode.type == 2)"></el-button>
           </el-input>
         </div>
       </div>
@@ -297,7 +297,7 @@ export default {
       const newArr = []
       function getLeaf(data, arr) {
         data.forEach((e) => {
-          if (e.type === 1) {
+          if (e.type === 2) {
             arr.push(e)
           }
           if (e.children.length) {

+ 1 - 1
src/views/als/lifePredictionResult/index.vue

@@ -217,7 +217,7 @@ export default {
       const newArr = []
       function getLeaf(data, arr) {
         data.forEach((e) => {
-          if (e.type === 1) {
+          if (e.type === 2) {
             arr.push(e)
           }
           if (e.children.length) {

+ 1 - 1
src/views/als/maintainRecord/index.vue

@@ -379,7 +379,7 @@ export default {
       const newArr = []
       function getLeaf(data, arr) {
         data.forEach((e) => {
-          if (e.type === 1) {
+          if (e.type === 2) {
             arr.push(e)
           }
           if (e.children.length) {

+ 1 - 1
src/views/als/maintenance/index.vue

@@ -308,7 +308,7 @@ export default {
       const newArr = []
       function getLeaf(data, arr) {
         data.forEach((e) => {
-          if (e.type === 1) {
+          if (e.type === 2) {
             arr.push(e)
           }
           if (e.children.length) {

+ 3 - 3
src/views/als/maintenanceDecision/index.vue

@@ -6,12 +6,12 @@
     <div class="view-dataSpecies-right">
       <div class="view-dataType-title">
         <div class="view-dataType-title-btn">
-          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 1 && currentNode.children.length == 0)">新增</el-button>
+          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 2)">新增</el-button>
           <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
         </div>
         <div class="view-dataType-title-search">
           <el-input placeholder="请输入架次号" v-model="keyWordData" class="input1">
-            <el-button slot="append" icon="el-icon-search" @click="searchClick" :disabled="!(currentNode.type == 1 && currentNode.children.length == 0)"></el-button>
+            <el-button slot="append" icon="el-icon-search" @click="searchClick" :disabled="!(currentNode.type == 2)"></el-button>
           </el-input>
         </div>
       </div>
@@ -301,7 +301,7 @@ export default {
       const newArr = []
       function getLeaf(data, arr) {
         data.forEach((e) => {
-          if (e.type === 1) {
+          if (e.type === 2) {
             arr.push(e)
           }
           if (e.children.length) {

+ 2 - 2
src/views/als/maintenanceRecord/index.vue

@@ -6,7 +6,7 @@
     <div class="view-dataSpecies-right">
       <div class="view-dataType-title">
         <div class="view-dataType-title-btn">
-          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 1 && currentNode.children.length == 0)">新增</el-button>
+          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 2)">新增</el-button>
           <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
         </div>
         <div class="view-dataType-title-search">
@@ -432,7 +432,7 @@ export default {
       const newArr = []
       function getLeaf(data, arr) {
         data.forEach((e) => {
-          if (e.type === 1) {
+          if (e.type === 2) {
             arr.push(e)
           }
           if (e.children.length) {

+ 59 - 63
src/views/als/maintenanceask/index.vue

@@ -6,11 +6,11 @@
     <div class="view-dataSpecies-right">
       <div class="view-dataType-title">
         <div class="view-dataType-title-btn">
-          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 1 && currentNode.children.length == 0)">新增</el-button>
+          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 2)">新增</el-button>
           <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
         </div>
         <div class="view-dataType-title-search">
-          <el-input placeholder="请输入关键字" v-model="keyWord" class="input1">
+          <el-input placeholder="请输入故障代码" v-model="keyWordData" class="input1">
             <el-button slot="append" icon="el-icon-search" @click="searchClick"></el-button>
           </el-input>
         </div>
@@ -23,12 +23,12 @@
     <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="600px" :before-close="handleClose">
       <el-form ref="form" :model="form" label-width="80px">
         <el-form-item label="机型" prop="aircraftType">
-          <el-select v-model="form.aircraftType" placeholder="请选择机型">
+          <el-select v-model="form.aircraftType" placeholder="请选择机型" disabled>
             <el-option v-for="item in aircaftModelAll" :key="item.aircaftModelId" :label="item.aircaftModelName" :value="item.aircaftModelId"> </el-option>
           </el-select>
         </el-form-item>
         <el-form-item label="编目" prop="aircraftCode">
-          <el-select v-model="form.aircraftCode" placeholder="请选择编目">
+          <el-select v-model="form.aircraftCode" placeholder="请选择编目" disabled>
             <el-option v-for="item in aircaftCatalogAll" :key="item.aircaftCatalogId" :label="item.aircaftCatalogCode" :value="item.aircaftCatalogId"> </el-option>
           </el-select>
         </el-form-item>
@@ -61,6 +61,9 @@
         <el-form-item label="故障原因" prop="faultCause">
           <el-input type="textarea" :rows="2" v-model="form.faultCause" placeholder="请输入故障原因" />
         </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" placeholder="请输入备注" />
+        </el-form-item>
       </el-form>
 
       <span slot="footer" class="dialog-footer">
@@ -73,9 +76,11 @@
 
 <script>
 import { getMaintenanceask, addMaintenanceask, updateMaintenanceask, removeMaintenanceask } from '@/api/als/maintenanceask'
-import { getAircaftTypeAndModelTree } from '@/api/als/sideTree'
+import { getAircaftCatalogTree } from '@/api/als/sideTree'
 import { getAircaftModelAll, getAircaftCatalogAll } from '@/api/als/aircraft'
 import { deepClone, debounce } from '@/utils/index'
+import { flattenTree } from '../utils/common'
+
 export default {
   name: 'Maintenanceask',
   components: {},
@@ -85,7 +90,7 @@ export default {
       dialogTitle: '新增',
       dialogVisible: false,
       detailVisible: false,
-      keyWord: '',
+      keyWordData: '',
       aircaftModelIdList: [],
       currentNodeKey: '',
       currentNode: {},
@@ -105,7 +110,6 @@ export default {
       },
       searchValue: '',
       columns: [
-        { prop: 'id', label: '编号' },
         {
           prop: 'aircraftType',
           label: '机型',
@@ -130,6 +134,10 @@ export default {
             }
           }
         },
+        {
+          prop: 'faultCode',
+          label: '故障代码'
+        },
         {
           prop: 'faultDescription',
           label: '故障描述'
@@ -139,8 +147,12 @@ export default {
           label: '数据来源'
         },
         {
-          prop: 'createTime',
-          label: '创建时间'
+          prop: 'location',
+          label: '故障位置'
+        },
+        {
+          prop: 'level',
+          label: '故障等级'
         },
         {
           prop: 'status',
@@ -215,14 +227,7 @@ export default {
         faultPart: '',
         proposal: '',
         handlerDate: '',
-        status: '',
-        tenantId: '',
-        version: '',
-        delFlag: '',
-        createBy: '',
-        createTime: '',
-        updateBy: '',
-        updateTime: ''
+        status: ''
       },
       debounceFn: debounce(this.fetch, 500),
       aircaftModelAll: [],
@@ -246,27 +251,32 @@ export default {
     }
   },
   mounted() {
-    this.getAircaftTypeAndModelTreeAPI()
+    this.getAircaftCatalogTreeAPI()
   },
   methods: {
-    async getAircaftTypeAndModelTreeAPI(params) {
-      const { data } = await getAircaftTypeAndModelTree(params)
-      this.menuTreeData = data
-      const getAircaftModelAllParams = {
-        aircaftTypeCode: '',
-        aircaftTypeId: '',
-        queryParam: ''
-      }
-      const { data: data1 } = await getAircaftModelAll(getAircaftModelAllParams)
-      this.aircaftModelAll = data1
-      if (data.length) {
-        this.currentNodeKey = data[0].id
-        this.currentNode = data[0]
-        this.aircaftModelIdList = this.getTreeLeafData(data[0]?.children)
-          .map((e) => e.id)
-          .toString()
-        this.getMaintenanceaskAPI({ aircraftType: this.aircaftModelIdList })
-      }
+    async getAircaftCatalogTreeAPI(params) {
+      try {
+        const { data } = await getAircaftCatalogTree(params)
+        this.menuTreeData = data
+        const getAircaftModelAllParams = {
+          aircaftTypeCode: '',
+          aircaftTypeId: '',
+          queryParam: ''
+        }
+        const { data: data1 } = await getAircaftModelAll(getAircaftModelAllParams)
+        this.aircaftModelAll = data1
+        if (data.length) {
+          this.currentNodeKey = data[0].id
+          this.currentNode = data[0]
+          this.aircaftModelIdList = String(this.getTreeLeafData(data[0]?.children).map((e) => e.id))
+          this.getMaintenanceaskAPI({ aircraftCodes: this.aircaftModelIdList })
+        }
+        const { data: data2 } = await getAircaftCatalogAll({
+          keyWord: '',
+          aircaftModelIdList: []
+        })
+        this.aircaftCatalogAll = flattenTree(data2)
+      } catch (error) {}
     },
 
     async removeMaintenanceaskAPI(params) {
@@ -277,7 +287,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
-          await this.getMaintenanceaskAPI({ aircraftType: this.aircaftModelIdList })
+          await this.getMaintenanceaskAPI({ aircraftCodes: this.aircaftModelIdList })
           this.handleClose()
         }
       } catch (error) {}
@@ -287,7 +297,7 @@ export default {
       const newArr = []
       function getLeaf(data, arr) {
         data.forEach((e) => {
-          if (e.type === 1) {
+          if (e.type === 2) {
             arr.push(e)
           }
           if (e.children.length) {
@@ -311,11 +321,11 @@ export default {
     },
 
     fetch() {
-      this.getMaintenanceaskAPI({ aircraftType: this.aircaftModelIdList })
+      this.getMaintenanceaskAPI({ aircraftCodes: this.aircaftModelIdList })
     },
 
     searchClick() {
-      this.getMaintenanceaskAPI({ aircraftType: this.aircaftModelIdList })
+      this.getMaintenanceaskAPI({ aircraftCodes: this.aircaftModelIdList, faultCode: this.keyWordData })
     },
 
     async addMaintenanceaskAPI() {
@@ -327,7 +337,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
-          this.getMaintenanceaskAPI({ aircraftType: this.aircaftModelIdList })
+          this.getMaintenanceaskAPI({ aircraftCodes: this.aircaftModelIdList })
         }
       } catch (error) {}
     },
@@ -340,31 +350,24 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
-          this.getMaintenanceaskAPI({ aircraftType: this.aircaftModelIdList })
+          this.getMaintenanceaskAPI({ aircraftCodes: this.aircaftModelIdList })
         }
       } catch (error) {}
     },
 
     async treeNodeClick(data) {
       this.$refs.table.clearSelection()
-      this.currentNodeKey = this.form.aircraftType = data.id
+      this.currentNodeKey = this.form.aircraftCode = data.id
       this.currentNode = data
-      this.aircaftModelIdList = this.getTreeLeafData(data.children.length ? data.children : [data])
-        .map((e) => e.id)
-        .toString()
-      this.getMaintenanceaskAPI({ aircraftType: this.aircaftModelIdList })
-      const getAircaftCatalogAllParams = {
-        keyWord: '',
-        aircaftModelIdList: [this.currentNodeKey]
-      }
-      const { data: data2 } = await getAircaftCatalogAll(getAircaftCatalogAllParams)
-      this.aircaftCatalogAll = data2
+      this.aircaftModelIdList = String(this.getTreeLeafData(data.children.length ? data.children : [data]).map((e) => e.id))
+      this.getMaintenanceaskAPI({ aircraftCodes: this.aircaftModelIdList })
     },
 
     openDialog() {
       this.dialogTitle = '新增'
       this.dialogVisible = true
-      this.form.aircraftType = this.currentNode.id
+      this.form.aircraftType = this.currentNode.parentId
+      this.form.aircraftCode = this.currentNodeKey
       this.form.status = 0
     },
 
@@ -380,14 +383,7 @@ export default {
         faultPart: '',
         proposal: '',
         handlerDate: '',
-        status: '',
-        tenantId: '',
-        version: '',
-        delFlag: '',
-        createBy: '',
-        createTime: '',
-        updateBy: '',
-        updateTime: ''
+        status: ''
       }
     },
 
@@ -426,7 +422,7 @@ export default {
         .catch(() => {})
     },
     checkDetails(row) {
-      this.$router.push({ name: 'ViewDetails', params: { maintenanceaskId: row.id } })
+      this.$router.push({ name: 'ViewDetails', query: { id: row.id } })
     }
   }
 }

+ 53 - 17
src/views/als/maintenanceask/viewDetails.vue

@@ -1,16 +1,16 @@
 <template>
   <div class="view-table-content">
     <div style="width: 80%; margin: auto">
-      <el-descriptions size="medium" border>
+      <el-descriptions class="detail" :column="4">
         <el-descriptions-item label="机型">{{ maintenanceaskForm.aircraftType }}</el-descriptions-item>
-        <el-descriptions-item label="机号">{{ maintenanceaskForm.aircraftCode }}</el-descriptions-item>
+        <el-descriptions-item label="编目">{{ maintenanceaskForm.aircraftCode }}</el-descriptions-item>
         <el-descriptions-item label="数据来源">{{ maintenanceaskForm.dataType }}</el-descriptions-item>
         <el-descriptions-item label="故障代码">{{ maintenanceaskForm.faultCode }}</el-descriptions-item>
         <el-descriptions-item label="故障描述">{{ maintenanceaskForm.faultDescription }}</el-descriptions-item>
         <el-descriptions-item label="故障位置">{{ maintenanceaskForm.location }}</el-descriptions-item>
-        <el-descriptions-item :span="1" label="故障等级">{{ maintenanceaskForm.level }}</el-descriptions-item>
-        <el-descriptions-item :span="2" label="故障现象">{{ maintenanceaskForm.symptoms }}</el-descriptions-item>
-        <el-descriptions-item :span="3" label="故障原因">{{ maintenanceaskForm.faultCause }}</el-descriptions-item>
+        <el-descriptions-item label="故障等级">{{ maintenanceaskForm.level }}</el-descriptions-item>
+        <el-descriptions-item label="故障现象">{{ maintenanceaskForm.symptoms }}</el-descriptions-item>
+        <el-descriptions-item label="故障原因">{{ maintenanceaskForm.faultCause }}</el-descriptions-item>
       </el-descriptions>
       <el-tabs type="card" v-model="tabActiveName" style="margin-top: 30px">
         <el-tab-pane label="资源分配" name="first">
@@ -38,7 +38,7 @@
       </el-tabs>
 
       <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="600px" :before-close="handleClose">
-        <el-form ref="form" :model="form" label-width="80px" style="height: 50vh; overflow-y: scroll">
+        <el-form ref="form" :model="form" label-width="80px" style="height: 400px; overflow-y: scroll">
           <!-- <el-form-item label="任务" prop="taskId">
             <el-input v-model="form.taskId" placeholder="请输入任务" />
           </el-form-item> -->
@@ -52,7 +52,11 @@
             <el-input v-model="form.deviceCode" placeholder="请输入设备编码" />
           </el-form-item>
           <el-form-item label="类型" prop="type">
-            <el-input v-model="form.type" placeholder="请输入类型" />
+            <el-select v-model="form.type" placeholder="请选择类型">
+              <el-option label="设备" value="设备"></el-option>
+              <el-option label="备件" value="备件"></el-option>
+              <el-option label="耗材" value="耗材"></el-option>
+            </el-select>
           </el-form-item>
           <el-form-item label="数量" prop="quantity">
             <el-input v-model="form.quantity" placeholder="请输入数量" />
@@ -69,7 +73,7 @@
       </el-dialog>
 
       <el-dialog :title="dialogTitle2" :visible.sync="dialogVisible2" width="600px" :before-close="handleClose2">
-        <el-form ref="form2" :model="form2" label-width="80px" style="height: 50vh; overflow-y: scroll">
+        <el-form ref="form2" :model="form2" label-width="80px" style="height: 350px; overflow-y: scroll">
           <!-- <el-form-item label="任务" prop="taskId">
             <el-input v-model="form.taskId" placeholder="请输入任务" />
           </el-form-item> -->
@@ -102,8 +106,11 @@
 <script>
 import { getResourceAllocation, addResourceAllocation, updateResourceAllocation, removeResourceAllocation } from '@/api/als/resourceAllocation'
 import { getPersonnelAllocation, addPersonnelAllocation, updatePersonnelAllocation, removePersonnelAllocation } from '@/api/als/personnelAllocation'
-import { getMaintenanceaskInfo } from '@/api/als/maintenanceask'
+import { getAircaftModelAll, getAircaftCatalogAll } from '@/api/als/aircraft'
+import { getMaintenanceaskInfo, updateMaintenanceask } from '@/api/als/maintenanceask'
 import { deepClone, debounce } from '@/utils/index'
+import { flattenTree } from '../utils/common'
+
 export default {
   name: 'ViewDetails',
   components: {},
@@ -227,7 +234,7 @@ export default {
         loading: false, // 表格动画
         initTable: false, // 是否一挂载就加载数据
         border: true,
-        height: 'calc(100vh - 550px)'
+        height: 'calc(100vh - 480px)'
       },
       tableCheckItems: [],
       tableCheckItems2: [],
@@ -280,7 +287,9 @@ export default {
       debounceFn: debounce(this.fetch, 500),
       maintenanceaskId: '',
       maintenanceaskForm: [],
-      tabActiveName: 'first'
+      tabActiveName: 'first',
+      aircaftModelAll: [],
+      aircaftCatalogAll: []
     }
   },
   watch: {
@@ -303,11 +312,24 @@ export default {
   },
   methods: {
     async getMaintenanceaskInfoAPI() {
-      this.maintenanceaskId = this.$route.params.maintenanceaskId
+      this.maintenanceaskId = this.$route.query.id
       this.form.taskId = this.maintenanceaskId
       const res = await getMaintenanceaskInfo(this.maintenanceaskId)
+
+      const { data: data1 } = await getAircaftModelAll({
+        aircaftTypeCode: '',
+        aircaftTypeId: '',
+        queryParam: ''
+      })
+      this.aircaftModelAll = data1
+      const { data: data2 } = await getAircaftCatalogAll({
+        keyWord: '',
+        aircaftModelIdList: []
+      })
+      this.aircaftCatalogAll = flattenTree(data2)
+      res.data.aircraftType = this.aircaftModelAll.find((item) => res.data.aircraftType === item.aircaftModelId).aircaftModelName
+      res.data.aircraftCode = this.aircaftCatalogAll.find((item) => res.data.aircraftCode === item.aircaftCatalogId)?.aircaftCatalogCode
       this.maintenanceaskForm = res.data
-      console.log('this.maintenanceaskForm', this.maintenanceaskForm)
       this.getResourceAllocationAPI({ taskId: this.maintenanceaskId })
     },
 
@@ -378,6 +400,9 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.handleClose()
+          const res = await getMaintenanceaskInfo(this.maintenanceaskId)
+          await updateMaintenanceask({ id: this.maintenanceaskId, status: 1, version: res.data.version })
           this.getResourceAllocationAPI({ taskId: this.maintenanceaskId })
         }
       } catch (error) {}
@@ -392,6 +417,9 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.handleClose2()
+          const res = await getMaintenanceaskInfo(this.maintenanceaskId)
+          await updateMaintenanceask({ id: this.maintenanceaskId, status: 1, version: res.data.version })
           this.getPersonnelAllocationAPI({ taskId: this.maintenanceaskId })
         }
       } catch (error) {}
@@ -405,6 +433,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.handleClose()
           this.getResourceAllocationAPI({ taskId: this.maintenanceaskId })
         }
       } catch (error) {}
@@ -418,6 +447,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.handleClose2()
           this.getPersonnelAllocationAPI({ taskId: this.maintenanceaskId })
         }
       } catch (error) {}
@@ -495,11 +525,9 @@ export default {
       switch (this.dialogTitle) {
         case '编辑':
           this.updateResourceAllocationAPI()
-          this.handleClose()
           break
         case '新增':
           this.addResourceAllocationAPI()
-          this.handleClose()
           break
       }
     },
@@ -508,11 +536,9 @@ export default {
       switch (this.dialogTitle) {
         case '编辑':
           this.updatePersonnelAllocationAPI()
-          this.handleClose2()
           break
         case '新增':
           this.addPersonnelAllocationAPI()
-          this.handleClose2()
           break
       }
     },
@@ -542,4 +568,14 @@ export default {
 
 <style lang="scss" scoped>
 @import '../index.scss';
+.detail {
+  .el-descriptions {
+    margin-bottom: 20px;
+  }
+
+  .el-descriptions-item__label .is-bordered-label,
+  .el-descriptions__body {
+    background-color: transparent !important;
+  }
+}
 </style>

+ 2 - 3
src/views/als/partReplacement/index.vue

@@ -6,7 +6,7 @@
     <div class="view-dataSpecies-right">
       <div class="view-dataType-title">
         <div class="view-dataType-title-btn">
-          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 1 && currentNode.children.length == 0)">新增</el-button>
+          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 2)">新增</el-button>
           <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
         </div>
         <div class="view-dataType-title-search">
@@ -97,7 +97,6 @@ export default {
       },
       searchValue: '',
       columns: [
-        { prop: 'id', label: '编号' },
         {
           prop: 'aircraftCode',
           label: '编目',
@@ -256,7 +255,7 @@ export default {
       const newArr = []
       function getLeaf(data, arr) {
         data.forEach((e) => {
-          if (e.type === 1) {
+          if (e.type === 2) {
             arr.push(e)
           }
           if (e.children.length) {

+ 3 - 3
src/views/als/preProcessing/index.vue

@@ -6,12 +6,12 @@
     <div class="view-dataSpecies-right">
       <div class="view-dataType-title">
         <div class="view-dataType-title-btn">
-          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 1 && currentNode.children.length == 0)">新增</el-button>
+          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 2)">新增</el-button>
           <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
         </div>
         <div class="view-dataType-title-search">
           <el-input placeholder="请输入架次号" v-model="keyWordData" class="input1">
-            <el-button slot="append" icon="el-icon-search" @click="searchClick" :disabled="!(currentNode.type == 1 && currentNode.children.length == 0)"></el-button>
+            <el-button slot="append" icon="el-icon-search" @click="searchClick" :disabled="!(currentNode.type == 2)"></el-button>
           </el-input>
         </div>
       </div>
@@ -356,7 +356,7 @@ export default {
       const newArr = []
       function getLeaf(data, arr) {
         data.forEach((e) => {
-          if (e.type === 1) {
+          if (e.type === 2) {
             arr.push(e)
           }
           if (e.children.length) {

+ 64 - 32
src/views/als/smTask/SMTaskDetails.vue

@@ -1,17 +1,17 @@
 <template>
-  <div class="view-table-content">
-    <div style="width: 80%; margin: auto">
-      <el-descriptions size="medium" border>
+  <div class="view-table-content" style="width: 80%; margin: 0 auto">
+    <div>
+      <el-descriptions class="detail" :column="4">
         <el-descriptions-item label="机型">{{ smTaskForm.aircraftModel }}</el-descriptions-item>
         <el-descriptions-item label="编目">{{ smTaskForm.aircraftId }}</el-descriptions-item>
         <el-descriptions-item label="任务名称">{{ smTaskForm.name }}</el-descriptions-item>
-        <el-descriptions-item label="任务编码">{{ smTaskForm.code }}</el-descriptions-item>
-        <el-descriptions-item label="维修时间">{{ smTaskForm.endTime }}</el-descriptions-item>
-        <el-descriptions-item label="剩余时间">{{ smTaskForm.remainTime }}</el-descriptions-item>
         <el-descriptions-item label="专业">{{ smTaskForm.specialty }}</el-descriptions-item>
-        <el-descriptions-item :span="1" label="负责人">{{ smTaskForm.headName }}</el-descriptions-item>
-        <el-descriptions-item :span="2" label="单位">{{ smTaskForm.unitName }}</el-descriptions-item>
-        <el-descriptions-item :span="3" label="维修内容">{{ smTaskForm.contents }}</el-descriptions-item>
+        <el-descriptions-item label="任务编码">{{ smTaskForm.taskCode }}</el-descriptions-item>
+        <el-descriptions-item label="周期">{{ smTaskForm.periodTime }}</el-descriptions-item>
+        <el-descriptions-item label="剩余时间">{{ smTaskForm.remainTime }}</el-descriptions-item>
+        <el-descriptions-item label="负责人">{{ smTaskForm.headName }}</el-descriptions-item>
+        <el-descriptions-item label="系统">{{ smTaskForm.systemName }}</el-descriptions-item>
+        <el-descriptions-item label="任务内容">{{ smTaskForm.contents }}</el-descriptions-item>
       </el-descriptions>
       <el-tabs type="card" v-model="tabActiveName" style="margin-top: 30px">
         <el-tab-pane label="资源分配" name="first">
@@ -39,7 +39,7 @@
       </el-tabs>
 
       <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="600px" :before-close="handleClose">
-        <el-form ref="form" :model="form" label-width="80px" style="height: 50vh; overflow-y: scroll">
+        <el-form ref="form" :model="form" label-width="80px" style="height: 400px; overflow-y: scroll">
           <!-- <el-form-item label="任务" prop="taskId">
             <el-input v-model="form.taskId" placeholder="请输入任务" />
           </el-form-item> -->
@@ -53,7 +53,12 @@
             <el-input v-model="form.deviceCode" placeholder="请输入设备编码" />
           </el-form-item>
           <el-form-item label="类型" prop="type">
-            <el-input v-model="form.type" placeholder="请输入类型" />
+            <!-- <el-input v-model="form.type" placeholder="请输入类型" /> -->
+            <el-select v-model="form.type" placeholder="请选择类型">
+              <el-option label="设备" value="设备"></el-option>
+              <el-option label="备件" value="备件"></el-option>
+              <el-option label="耗材" value="耗材"></el-option>
+            </el-select>
           </el-form-item>
           <el-form-item label="数量" prop="quantity">
             <el-input v-model="form.quantity" placeholder="请输入数量" />
@@ -70,7 +75,7 @@
       </el-dialog>
 
       <el-dialog :title="dialogTitle2" :visible.sync="dialogVisible2" width="600px" :before-close="handleClose2">
-        <el-form ref="form2" :model="form2" label-width="80px" style="height: 50vh; overflow-y: scroll">
+        <el-form ref="form2" :model="form2" label-width="80px" style="height: 350px; overflow-y: scroll">
           <!-- <el-form-item label="任务" prop="taskId">
             <el-input v-model="form.taskId" placeholder="请输入任务" />
           </el-form-item> -->
@@ -103,8 +108,11 @@
 <script>
 import { getResourceAllocation, addResourceAllocation, updateResourceAllocation, removeResourceAllocation } from '@/api/als/resourceAllocation'
 import { getPersonnelAllocation, addPersonnelAllocation, updatePersonnelAllocation, removePersonnelAllocation } from '@/api/als/personnelAllocation'
-import { getSmTask } from '@/api/als/smTask'
+import { getAircaftModelAll, getAircaftCatalogAll } from '@/api/als/aircraft'
+import { updateSmTask, getSmTaskDetail } from '@/api/als/smTask'
 import { deepClone, debounce } from '@/utils/index'
+import { flattenTree } from '../utils/common'
+
 export default {
   name: 'SMTaskDetails',
   components: {},
@@ -118,7 +126,6 @@ export default {
       keyWord: '',
       searchValue: '',
       columns: [
-        { prop: 'id', label: '编号' },
         {
           prop: 'deviceName',
           label: '名称'
@@ -172,7 +179,6 @@ export default {
         }
       ],
       columns2: [
-        { prop: 'id', label: '编号' },
         {
           prop: 'personnel',
           label: '人员'
@@ -228,7 +234,7 @@ export default {
         loading: false, // 表格动画
         initTable: false, // 是否一挂载就加载数据
         border: true,
-        height: 'calc(100vh - 550px)'
+        height: 'calc(100vh - 480px)'
       },
       tableCheckItems: [],
       tableCheckItems2: [],
@@ -300,18 +306,32 @@ export default {
     }
   },
   mounted() {
-    this.getSmTaskAPI()
+    this.getSmTaskDetailAPI()
   },
   methods: {
-    async getSmTaskAPI() {
-      this.smTaskId = this.$route.params.smTaskId
-      this.form.taskId = this.smTaskId
-      const {
-        data: { list, totalCount }
-      } = await getSmTask({ id: this.smTaskId })
-      this.smTaskForm = list
-      console.log('this.smTaskForm', this.smTaskForm)
-      this.getResourceAllocationAPI({ taskId: this.smTaskId })
+    async getSmTaskDetailAPI() {
+      try {
+        this.smTaskId = this.$route.query.smTaskId
+        this.form.taskId = this.smTaskId
+        const { data } = await getSmTaskDetail(this.smTaskId)
+
+        const { data: data1 } = await getAircaftModelAll({
+          aircaftTypeCode: '',
+          aircaftTypeId: '',
+          queryParam: ''
+        })
+        this.aircaftModelAll = data1
+        const { data: data2 } = await getAircaftCatalogAll({
+          keyWord: '',
+          aircaftModelIdList: []
+        })
+        this.aircaftCatalogAll = flattenTree(data2)
+
+        data.aircraftModel = this.aircaftModelAll.find((item) => data.aircraftModel === item.aircaftModelId)?.aircaftModelName
+        data.aircraftId = this.aircaftCatalogAll.find((item) => data.aircraftId === item.aircaftCatalogId)?.aircaftCatalogCode
+        this.smTaskForm = data
+        this.getResourceAllocationAPI({ taskId: this.smTaskId })
+      } catch (error) {}
     },
 
     async removeResourceAllocationAPI(params) {
@@ -381,6 +401,8 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.handleClose()
+          await updateSmTask({ id: this.smTaskId, status: 1, version: this.smTaskForm.version })
           this.getResourceAllocationAPI({ taskId: this.smTaskId })
         }
       } catch (error) {}
@@ -395,6 +417,9 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.handleClose2()
+          const res = await getSmTaskDetail(this.smTaskId)
+          await updateSmTask({ id: this.smTaskId, status: 1, version: res.data.version })
           this.getPersonnelAllocationAPI({ taskId: this.smTaskId })
         }
       } catch (error) {}
@@ -408,6 +433,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.handleClose()
           this.getResourceAllocationAPI({ taskId: this.smTaskId })
         }
       } catch (error) {}
@@ -421,6 +447,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.handleClose2()
           this.getPersonnelAllocationAPI({ taskId: this.smTaskId })
         }
       } catch (error) {}
@@ -430,8 +457,6 @@ export default {
       this.dialogTitle = '新增'
       this.dialogVisible = true
       this.form.taskId = this.smTaskId
-      // this.form.aircraftId = { taskId: this.smTaskId }
-      // this.form.aircraftType = this.currentNode.label
     },
 
     openDialog2() {
@@ -498,11 +523,9 @@ export default {
       switch (this.dialogTitle) {
         case '编辑':
           this.updateResourceAllocationAPI()
-          this.handleClose()
           break
         case '新增':
           this.addResourceAllocationAPI()
-          this.handleClose()
           break
       }
     },
@@ -511,11 +534,9 @@ export default {
       switch (this.dialogTitle) {
         case '编辑':
           this.updatePersonnelAllocationAPI()
-          this.handleClose2()
           break
         case '新增':
           this.addPersonnelAllocationAPI()
-          this.handleClose2()
           break
       }
     },
@@ -545,4 +566,15 @@ export default {
 
 <style lang="scss" scoped>
 @import '../index.scss';
+
+.detail {
+  .el-descriptions {
+    margin-bottom: 20px;
+  }
+
+  .el-descriptions-item__label .is-bordered-label,
+  .el-descriptions__body {
+    background-color: transparent !important;
+  }
+}
 </style>

+ 83 - 128
src/views/als/smTask/index.vue

@@ -6,7 +6,7 @@
     <div class="view-dataSpecies-right">
       <div class="view-dataType-title">
         <div class="view-dataType-title-btn">
-          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 1 && currentNode.children.length == 0)">新增</el-button>
+          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 2)">新增</el-button>
           <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
         </div>
         <div class="view-dataType-title-search">
@@ -27,48 +27,34 @@
             </el-select>
           </el-form-item>
           <el-form-item label="编目" prop="aircraftId">
-            <el-select v-model="form.aircraftId" placeholder="请选择编目">
+            <el-select v-model="form.aircraftId" placeholder="请选择编目" disabled>
               <el-option v-for="item in aircaftCatalogAll" :key="item.aircaftCatalogId" :label="item.aircaftCatalogCode" :value="item.aircaftCatalogId"> </el-option>
             </el-select>
           </el-form-item>
-
           <el-form-item label="任务名称" prop="name">
             <el-input v-model="form.name" placeholder="请输入任务名称" />
-            <!-- <el-date-picker clearable v-model="form.name" type="date" value-format="yyyy-MM-dd" placement="bottom-start" placeholder="请选择维修时间"> </el-date-picker> -->
           </el-form-item>
-          <el-form-item label="任务编码" prop="code">
-            <el-input v-model="form.code" placeholder="请输入任务编码" />
+          <el-form-item label="专业" prop="specialty">
+            <el-input v-model="form.specialty" placeholder="请输入专业" />
+          </el-form-item>
+          <el-form-item label="任务编码" prop="taskCode">
+            <el-input v-model="form.taskCode" placeholder="请输入任务编码" />
           </el-form-item>
-          <el-form-item label="维修时间" prop="endTime">
-            <el-date-picker clearable v-model="form.endTime" type="date" value-format="yyyy-MM-dd" placement="bottom-start" placeholder="请选择维修时间"> </el-date-picker>
+          <el-form-item label="周期" prop="periodTime">
+            <el-input v-model="form.periodTime" placeholder="请输入周期" />
           </el-form-item>
           <el-form-item label="剩余时间" prop="remainTime">
             <el-input v-model="form.remainTime" placeholder="请输入剩余时间" />
           </el-form-item>
-          <el-form-item label="专业" prop="specialty">
-            <el-input v-model="form.specialty" placeholder="请输入专业" />
-          </el-form-item>
-          <!-- <el-form-item label="下发日期" prop="issueDate">
-            <el-date-picker clearable v-model="form.issueDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择下发日期"> </el-date-picker>
-          </el-form-item>
-          <el-form-item label="完成日期" prop="finishDate">
-            <el-date-picker clearable v-model="form.finishDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择完成日期"> </el-date-picker>
-          </el-form-item> -->
           <el-form-item label="负责人" prop="headName">
             <el-input v-model="form.headName" placeholder="请输入负责人" />
           </el-form-item>
-          <el-form-item label="单位" prop="unitName">
-            <el-input v-model="form.unitName" placeholder="请输入单位" />
-          </el-form-item>
-          <el-form-item label="维修内容" prop="contents">
-            <el-input v-model="form.contents" placeholder="请输入维修内容" />
+          <el-form-item label="系统" prop="systemName">
+            <el-input v-model="form.systemName" placeholder="请输入系统" />
           </el-form-item>
-          <!-- <el-form-item label="质检员" prop="qcBy">
-            <el-input v-model="form.qcBy" placeholder="请输入质检员" />
+          <el-form-item label="任务内容" prop="contents">
+            <el-input v-model="form.contents" placeholder="请输入任务内容" />
           </el-form-item>
-          <el-form-item label="填写人" prop="fillBy">
-            <el-input v-model="form.fillBy" placeholder="请输入填写人" />
-          </el-form-item> -->
           <el-form-item label="备注" prop="remark">
             <el-input v-model="form.remark" placeholder="请输入备注" />
           </el-form-item>
@@ -86,11 +72,12 @@
 <script>
 import { getSmTask, addSmTask, updateSmTask, removeSmTask } from '@/api/als/smTask'
 import { deepClone, debounce } from '@/utils/index'
-import { getAircaftTypeAndModelTree } from '@/api/als/sideTree'
+import { getAircaftCatalogTree } from '@/api/als/sideTree'
 import { getAircaftModelAll, getAircaftCatalogAll } from '@/api/als/aircraft'
+import { flattenTree } from '../utils/common'
+
 export default {
   name: 'SmTask',
-
   components: {},
   data() {
     // 这里存放数据
@@ -117,26 +104,25 @@ export default {
       },
       searchValue: '',
       columns: [
-        { prop: 'id', label: '编号' },
         {
-          prop: 'aircraftId',
-          label: '编目',
+          prop: 'aircraftModel',
+          label: '机型',
           render: (h, params) => {
-            const matchedItem = this.aircaftCatalogAll.find((item) => params.row.aircraftId.trim() === item.aircaftCatalogId.trim())
+            const matchedItem = this.aircaftModelAll.find((item) => params.row.aircraftModel === item.aircaftModelId)
             if (matchedItem) {
-              return h('span', matchedItem.aircaftCatalogCode)
+              return h('span', matchedItem.aircaftModelName)
             } else {
               return h('span', {}, '')
             }
           }
         },
         {
-          prop: 'aircraftModel',
-          label: '机型',
+          prop: 'aircraftId',
+          label: '编目',
           render: (h, params) => {
-            const matchedItem = this.aircaftModelAll.find((item) => params.row.aircraftModel === item.aircaftModelId)
+            const matchedItem = this.aircaftCatalogAll.find((item) => params.row.aircraftId.trim() === item.aircaftCatalogId.trim())
             if (matchedItem) {
-              return h('span', matchedItem.aircaftModelName)
+              return h('span', matchedItem.aircaftCatalogCode)
             } else {
               return h('span', {}, '')
             }
@@ -147,53 +133,36 @@ export default {
           label: '任务名称'
         },
         {
-          prop: 'code',
+          prop: 'specialty',
+          label: '专业'
+        },
+        {
+          prop: 'taskCode',
           label: '任务编码'
         },
         {
-          prop: 'endTime',
-          label: '维修时间'
+          prop: 'periodTime',
+          label: '周期'
         },
         {
           prop: 'remainTime',
           label: '剩余时间'
         },
-
-        // {
-        //   prop: 'issueDate',
-        //   label: '下发日期'
-        // },
-        // {
-        //   prop: 'finishDate',
-        //   label: '完成日期'
-        // },
         {
           prop: 'headName',
           label: '负责人'
         },
         {
-          prop: 'unitName',
-          label: '单位'
+          prop: 'systemName',
+          label: '系统'
         },
         {
           prop: 'contents',
-          label: '维修内容'
+          label: '任务内容'
         },
-        // {
-        //   prop: 'qcBy',
-        //   label: '质检员'
-        // },
-        // {
-        //   prop: 'fillBy',
-        //   label: '填写人'
-        // },
         {
           prop: 'status',
-          label: '状态'
-        },
-        {
-          prop: 'remark',
-          label: '备注',
+          label: '状态',
           render: (h, params) => {
             if (params.row.status == 0) {
               return h('span', { class: 'warning-state' }, '未分配')
@@ -202,6 +171,10 @@ export default {
             }
           }
         },
+        {
+          prop: 'remark',
+          label: '备注'
+        },
         {
           button: true,
           label: '操作',
@@ -259,26 +232,15 @@ export default {
         aircraftId: '',
         aircraftModel: '',
         name: '',
-        code: '',
-        endTime: '',
-        remainTime: '',
         specialty: '',
-        issueDate: '',
-        finishDate: '',
+        taskCode: '',
+        periodTime: '',
+        remainTime: '',
         headName: '',
-        unitName: '',
+        systemName: '',
         contents: '',
-        qcBy: '',
-        fillBy: '',
         status: '',
-        remark: '',
-        tenantId: '',
-        version: '',
-        delFlag: '',
-        createBy: '',
-        createTime: '',
-        updateBy: '',
-        updateTime: ''
+        remark: ''
       },
       debounceFn: debounce(this.fetch, 500),
       aircaftModelAll: [],
@@ -292,11 +254,11 @@ export default {
     }
   },
   mounted() {
-    this.getAircaftTypeAndModelTreeAPI()
+    this.getAircaftCatalogTreeAPI()
   },
   methods: {
-    async getAircaftTypeAndModelTreeAPI(params) {
-      const { data } = await getAircaftTypeAndModelTree(params)
+    async getAircaftCatalogTreeAPI(params) {
+      const { data } = await getAircaftCatalogTree(params)
       this.menuTreeData = data
       const getAircaftModelAllParams = {
         aircaftTypeCode: '',
@@ -308,11 +270,14 @@ export default {
       if (data.length) {
         this.currentNodeKey = data[0].id
         this.currentNode = data[0]
-        this.aircaftModelIdList = this.getTreeLeafData(data[0]?.children)
-          .map((e) => e.id)
-          .toString()
-        this.getSmTaskAPI({ aircraftType: this.aircaftModelIdList })
+        this.aircaftModelIdList = String(this.getTreeLeafData(data[0]?.children).map((e) => e.id))
+        this.getSmTaskAPI({ aircraftId: this.aircaftModelIdList })
       }
+      const { data: data2 } = await getAircaftCatalogAll({
+        keyWord: '',
+        aircaftModelIdList: []
+      })
+      this.aircaftCatalogAll = flattenTree(data2)
     },
 
     async removeSmTaskAPI(params) {
@@ -323,7 +288,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
-          await this.getSmTaskAPI({ aircraftType: this.aircaftModelIdList })
+          await this.getSmTaskAPI({ aircraftId: this.aircaftModelIdList })
           this.handleClose()
         }
       } catch (error) {}
@@ -333,7 +298,7 @@ export default {
       const newArr = []
       function getLeaf(data, arr) {
         data.forEach((e) => {
-          if (e.type === 1) {
+          if (e.type === 2) {
             arr.push(e)
           }
           if (e.children.length) {
@@ -357,60 +322,55 @@ export default {
     },
 
     fetch() {
-      this.getSmTaskAPI({ aircraftType: this.aircaftModelIdList })
+      this.getSmTaskAPI({ aircraftId: this.aircaftModelIdList })
     },
 
     searchClick() {
-      this.getSmTaskAPI({ aircraftType: this.aircaftModelIdList })
+      this.getSmTaskAPI({ aircraftId: this.aircaftModelIdList })
     },
 
     async addSmTaskAPI() {
       try {
         delete this.form.aircaftModelName
-        const { success } = await addSmTask({ ...this.form })
-        if (success) {
+        const { code } = await addSmTask({ ...this.form })
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          this.getSmTaskAPI({ aircraftType: this.aircaftModelIdList })
+          this.handleClose()
+          this.getSmTaskAPI({ aircraftId: this.aircaftModelIdList })
         }
       } catch (error) {}
     },
 
     async updateSmTaskAPI() {
       try {
-        const { success } = await updateSmTask({ ...this.form })
-        if (success) {
+        const { code } = await updateSmTask({ ...this.form })
+        if (code === 200) {
           this.$message({
             type: 'success',
             message: '操作成功!'
           })
-          this.getSmTaskAPI({ aircraftType: this.aircaftModelIdList })
+          this.handleClose()
+          this.getSmTaskAPI({ aircraftId: this.aircaftModelIdList })
         }
       } catch (error) {}
     },
 
     async treeNodeClick(data) {
       this.$refs.table.clearSelection()
-      this.currentNodeKey = this.form.aircraftType = data.id
+      this.currentNodeKey = this.form.aircraftId = data.id
       this.currentNode = data
-      this.aircaftModelIdList = this.getTreeLeafData(data.children.length ? data.children : [data])
-        .map((e) => e.id)
-        .toString()
-      this.getSmTaskAPI({ aircraftType: this.aircaftModelIdList })
-      const getAircaftCatalogAllParams = {
-        keyWord: '',
-        aircaftModelIdList: [this.currentNodeKey]
-      }
-      const { data: data2 } = await getAircaftCatalogAll(getAircaftCatalogAllParams)
-      this.aircaftCatalogAll = data2
+      this.aircaftModelIdList = String(this.getTreeLeafData(data.children.length ? data.children : [data]).map((e) => e.id))
+      this.getSmTaskAPI({ aircraftId: this.aircaftModelIdList })
     },
 
     openDialog() {
       this.dialogTitle = '新增'
       this.dialogVisible = true
-      this.form.aircraftModel = this.currentNode.id
+      this.form.aircraftModel = this.currentNode.parentId
+      this.form.aircraftId = this.currentNodeKey
       this.form.status = 0
     },
 
@@ -421,26 +381,15 @@ export default {
         aircraftId: '',
         aircraftModel: '',
         name: '',
-        code: '',
-        endTime: '',
-        remainTime: '',
         specialty: '',
-        issueDate: '',
-        finishDate: '',
+        taskCode: '',
+        periodTime: '',
+        remainTime: '',
         headName: '',
-        unitName: '',
+        systemName: '',
         contents: '',
-        qcBy: '',
-        fillBy: '',
         status: '',
-        remark: '',
-        tenantId: '',
-        version: '',
-        delFlag: '',
-        createBy: '',
-        createTime: '',
-        updateBy: '',
-        updateTime: ''
+        remark: ''
       }
     },
 
@@ -480,7 +429,13 @@ export default {
     },
 
     checkDetails(row) {
-      this.$router.push({ name: 'SMTaskDetails', params: { maintenanceaskId: row.id } })
+      // this.$router.push({ name: 'SMTaskDetails', params: { smTaskId: row.id } })
+      this.$router.push({
+        name: 'SMTaskDetails',
+        query: {
+          smTaskId: row.id
+        }
+      })
     }
   }
 }

+ 0 - 1
src/views/als/trainingData/index.vue

@@ -88,7 +88,6 @@ export default {
       },
       searchValue: '',
       columns: [
-        { prop: 'id', label: '编号' },
         {
           prop: 'name',
           label: '名称'

+ 20 - 0
src/views/als/utils/common.js

@@ -48,3 +48,23 @@ export function handleTree(data, id, parentId, children) {
   }
   return tree
 }
+
+// 树 扁平化的方法
+export function flattenTree(treeNodes) {
+  let result = []
+
+  //递归函数 traverse,用于处理单个节点
+  function traverse(node) {
+    const newNode = { ...node }
+    delete newNode.children
+    // 将没有子节点的新节点添加到结果数组中
+    result.push(newNode)
+
+    // 如果当前节点包含 children 属性(即有子节点)
+    if (node.children) {
+      node.children.forEach(traverse)
+    }
+  }
+  treeNodes.forEach(traverse)
+  return result
+}

+ 59 - 42
src/views/als/warning/index.vue

@@ -6,7 +6,7 @@
     <div class="view-dataSpecies-right">
       <div class="view-dataType-title">
         <div class="view-dataType-title-btn">
-          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 1 && currentNode.children.length == 0)">新增</el-button>
+          <el-button type="success" @click="openDialog()" :disabled="!(currentNode.type == 2)">新增</el-button>
           <el-button type="warning" @click="remove(tableCheckItems)" :disabled="tableCheckItems.length == 0">删除</el-button>
         </div>
         <div class="view-dataType-title-search">
@@ -23,14 +23,13 @@
         <el-form ref="form" :model="form" label-width="80px">
           <el-form-item label="编目" prop="aircraftId">
             <!-- <el-input v-model="form.aircraftId" placeholder="请输入机号" /> -->
-            <el-select v-model="form.aircraftId" placeholder="请选择编目" @change="changeAircraftId(form.aircraftId)">
+            <el-select v-model="form.aircraftId" placeholder="请选择编目" @change="changeAircraftId(form.aircraftId)" disabled>
               <el-option v-for="item in aircaftCatalogAll" :key="item.aircaftCatalogId" :label="item.aircaftCatalogCode" :value="item.aircaftCatalogId"> </el-option>
             </el-select>
           </el-form-item>
           <el-form-item label="架次号" prop="sortieNo">
-            <!-- <el-input v-model="form.sortieNo" placeholder="请输入架次号" /> -->
             <el-select v-model="form.sortieNo" placeholder="请选择架次号">
-              <el-option v-for="item in sortieNoList" :key="item.sortieNo" :label="item.sortieNo" :value="item.sortieNo"> </el-option>
+              <el-option v-for="item in sortieNoList" :key="item.taskId" :label="item.taskName" :value="item.taskId"> </el-option>
             </el-select>
           </el-form-item>
           <el-form-item label="警告代码" prop="code">
@@ -56,9 +55,12 @@
 <script>
 import { getWarning, addWarning, updateWarning, removeWarning } from '@/api/als/warning'
 import { getAircaftCatalogTree } from '@/api/als/sideTree'
-import { getAircaftCatalogAll } from '@/api/als/aircraft'
+import { getAircaftCatalogAll, getSortieNo } from '@/api/als/aircraft'
 import { deepClone, debounce } from '@/utils/index'
 import { getDataImport } from '@/api/als/dataImport'
+import { getTaskExecondRegister } from '@/api/carrierStandard/carrierListExecutionRegistration'
+import { flattenTree } from '../utils/common'
+
 export default {
   name: 'Warning',
   components: {},
@@ -90,7 +92,15 @@ export default {
         // { prop: 'id', label: '编号' },
         {
           prop: 'sortieNo',
-          label: '架次号'
+          label: '架次号',
+          render: (h, params) => {
+            const matchedItem = this.allTaskExecond.find((item) => params.row.sortieNo.trim() === item.taskId.trim())
+            if (matchedItem) {
+              return h('span', matchedItem.taskName)
+            } else {
+              return h('span', {}, '')
+            }
+          }
         },
         {
           prop: 'aircraftId',
@@ -116,10 +126,6 @@ export default {
           prop: 'describe',
           label: '警告描述'
         },
-        {
-          prop: 'status',
-          label: '状态'
-        },
         {
           button: true,
           label: '操作',
@@ -181,7 +187,8 @@ export default {
       },
       debounceFn: debounce(this.fetch, 500),
       aircaftCatalogAll: [],
-      sortieNoList: []
+      sortieNoList: [],
+      allTaskExecond: []
     }
   },
   watch: {
@@ -195,22 +202,31 @@ export default {
   },
   methods: {
     async getAircaftCatalogTreeAPI(params) {
-      const { data } = await getAircaftCatalogTree(params)
-      this.menuTreeData = data
-      const getAircaftCatalogAllParams = {
-        keyWord: '',
-        aircaftModelIdList: []
-      }
-      const { data: data2 } = await getAircaftCatalogAll(getAircaftCatalogAllParams)
-      this.aircaftCatalogAll = data2
-      if (data.length) {
-        this.currentNodeKey = data[0].id
-        this.currentNode = data[0]
-        this.aircaftModelIdList = this.getTreeLeafData(data[0]?.children)
-          .map((e) => e.id)
-          .toString()
-        this.getWarningAPI({ aircraftId: this.aircaftModelIdList })
-      }
+      try {
+        const { data } = await getAircaftCatalogTree(params)
+        this.menuTreeData = data
+        const getAircaftCatalogAllParams = {
+          keyWord: '',
+          aircaftModelIdList: []
+        }
+        const { data: data2 } = await getAircaftCatalogAll(getAircaftCatalogAllParams)
+        this.aircaftCatalogAll = data2
+        if (data.length) {
+          this.currentNodeKey = data[0].id
+          this.currentNode = data[0]
+          this.aircaftModelIdList = this.getTreeLeafData(data[0]?.children)
+            .map((e) => e.id)
+            .toString()
+          this.getWarningAPI({ aircraftId: this.aircaftModelIdList })
+        }
+        const res = await getTaskExecondRegister({
+          status: null,
+          queryParam: '',
+          taskId: '',
+          aircaftCatalogId: ''
+        })
+        this.allTaskExecond = flattenTree(res.data)
+      } catch (error) {}
     },
 
     async removeWarningAPI(params) {
@@ -231,7 +247,7 @@ export default {
       const newArr = []
       function getLeaf(data, arr) {
         data.forEach((e) => {
-          if (e.type === 1) {
+          if (e.type === 2) {
             arr.push(e)
           }
           if (e.children.length) {
@@ -271,6 +287,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.handleClose()
           this.getWarningAPI({ aircraftId: this.aircaftModelIdList })
         }
       } catch (error) {}
@@ -284,6 +301,7 @@ export default {
             type: 'success',
             message: '操作成功!'
           })
+          this.handleClose()
           this.getWarningAPI({ aircraftId: this.aircaftModelIdList })
         }
       } catch (error) {}
@@ -296,16 +314,24 @@ export default {
       this.aircaftModelIdList = this.getTreeLeafData(data.children.length ? data.children : [data])
         .map((e) => e.id)
         .toString()
+      if (!this.aircaftModelIdList) {
+        this.aircaftModelIdList = '#'
+      }
       this.getWarningAPI({ aircraftId: this.aircaftModelIdList })
+      this.getSortieNoAPI(data.label)
+    },
+
+    async getSortieNoAPI(aircaftCatalogCode) {
+      const res = await getSortieNo({ aircaftCatalogCode })
+      this.sortieNoList = res.data.filter((item) => {
+        return item.taskName
+      })
     },
 
     openDialog() {
       this.dialogTitle = '新增'
       this.dialogVisible = true
       this.form.aircraftId = this.currentNode.id
-      if (this.form.aircraftId !== '') {
-        this.changeAircraftId(this.form.aircraftId)
-      }
     },
 
     handleClose() {
@@ -331,6 +357,8 @@ export default {
     handUpdate(row) {
       this.dialogTitle = '编辑'
       this.form = deepClone(row)
+      const matchedItem = this.aircaftCatalogAll.find((item) => row.aircraftId.trim() === item.aircaftCatalogId.trim())
+      this.getSortieNoAPI(matchedItem.aircaftCatalogCode)
       this.form.aircraftId = this.currentNode.id
       this.dialogVisible = true
     },
@@ -339,13 +367,9 @@ export default {
       switch (this.dialogTitle) {
         case '编辑':
           this.updateWarningAPI()
-          this.handleClose()
           break
         case '新增':
-          console.log('this.form ', this.form)
-          debugger
           this.addWarningAPI()
-          this.handleClose()
           break
       }
     },
@@ -364,13 +388,6 @@ export default {
           this.removeWarningAPI(row.map((e) => e.id))
         })
         .catch(() => {})
-    },
-    async changeAircraftId(aircraftId) {
-      const {
-        data: { list }
-      } = await getDataImport({ aircraftId })
-      console.log('list', list)
-      this.sortieNoList = list
     }
   }
 }