|
@@ -1,31 +1,34 @@
|
|
|
<template>
|
|
|
- <div class="table-box">
|
|
|
- <ProTable ref="proTable" :columns="columns" row-key="id" :request-api="listSortieApi">
|
|
|
- <!-- 表格 header 按钮 -->
|
|
|
- <template #tableHeader="scope">
|
|
|
- <el-button type="primary" v-auth="['als:sortie:add']" icon="CirclePlus" @click="openDialog(1, '架次新增')"> 新增 </el-button>
|
|
|
- <el-button type="primary" v-auth="['als:sortie:import']" icon="Upload" plain @click="batchAdd"> 导入 </el-button>
|
|
|
- <el-button type="primary" v-auth="['als:sortie:export']" icon="Download" plain @click="downloadFile"> 导出 </el-button>
|
|
|
- <el-button
|
|
|
- type="danger"
|
|
|
- v-auth="['als:sortie:remove']"
|
|
|
- icon="Delete"
|
|
|
- plain
|
|
|
- :disabled="!scope.isSelected"
|
|
|
- @click="batchDelete(scope.selectedListIds)"
|
|
|
- >
|
|
|
- 批量删除
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- <!-- 表格操作 -->
|
|
|
- <template #operation="scope">
|
|
|
- <el-button type="primary" link icon="View" v-auth="['als:sortie:query']" @click="openDialog(3, '架次查看', scope.row)"> 查看 </el-button>
|
|
|
- <el-button type="primary" link icon="EditPen" v-auth="['als:sortie:edit']" @click="openDialog(2, '架次编辑', scope.row)"> 编辑 </el-button>
|
|
|
- <el-button type="primary" link icon="Delete" v-auth="['als:sortie:remove']" @click="deleteSortie(scope.row)"> 删除 </el-button>
|
|
|
- </template>
|
|
|
- </ProTable>
|
|
|
- <FormDialog ref="formDialogRef" :items-options="itemsOptions" :model="model" />
|
|
|
- <ImportExcel ref="dialogRef" />
|
|
|
+ <div class="main-box">
|
|
|
+ <TreeFilter title="机型机号" :is-all="false" :data="treeFilterData" :default-value="'0'" @change="changeTreeFilter" />
|
|
|
+ <div class="table-box">
|
|
|
+ <ProTable ref="proTable" :columns="columns" row-key="id" :init-param="initParam" :request-api="listSortieApi">
|
|
|
+ <!-- 表格 header 按钮 -->
|
|
|
+ <template #tableHeader="scope">
|
|
|
+ <el-button type="primary" v-auth="['als:sortie:add']" icon="CirclePlus" @click="openDialog(1, '架次新增')"> 新增 </el-button>
|
|
|
+ <el-button type="primary" v-auth="['als:sortie:import']" icon="Upload" plain @click="batchAdd"> 导入 </el-button>
|
|
|
+ <el-button type="primary" v-auth="['als:sortie:export']" icon="Download" plain @click="downloadFile"> 导出 </el-button>
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ v-auth="['als:sortie:remove']"
|
|
|
+ icon="Delete"
|
|
|
+ plain
|
|
|
+ :disabled="!scope.isSelected"
|
|
|
+ @click="batchDelete(scope.selectedListIds)"
|
|
|
+ >
|
|
|
+ 批量删除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <!-- 表格操作 -->
|
|
|
+ <template #operation="scope">
|
|
|
+ <el-button type="primary" link icon="View" v-auth="['als:sortie:query']" @click="openDialog(3, '架次查看', scope.row)"> 查看 </el-button>
|
|
|
+ <el-button type="primary" link icon="EditPen" v-auth="['als:sortie:edit']" @click="openDialog(2, '架次编辑', scope.row)"> 编辑 </el-button>
|
|
|
+ <el-button type="primary" link icon="Delete" v-auth="['als:sortie:remove']" @click="deleteSortie(scope.row)"> 删除 </el-button>
|
|
|
+ </template>
|
|
|
+ </ProTable>
|
|
|
+ <FormDialog ref="formDialogRef" :items-options="itemsOptions" :model="model" />
|
|
|
+ <ImportExcel ref="dialogRef" />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -46,11 +49,35 @@ import {
|
|
|
exportSortieApi,
|
|
|
getSortieApi
|
|
|
} from '@/api/modules/als/sortie'
|
|
|
-
|
|
|
+import { treeSelectApi } from '@/api/modules/als/aircraft'
|
|
|
+onMounted(() => {
|
|
|
+ getTreeFilter()
|
|
|
+})
|
|
|
// ProTable 实例
|
|
|
const proTable = ref<ProTableInstance>()
|
|
|
// 表单model
|
|
|
const model = ref({})
|
|
|
+
|
|
|
+let initParam = reactive({ aircraftId: '' })
|
|
|
+let treeFilterData = ref<any>([])
|
|
|
+let treeOptions = ref<any>([])
|
|
|
+const getTreeFilter = async () => {
|
|
|
+ const { data } = await treeSelectApi()
|
|
|
+ treeOptions.value = data
|
|
|
+ treeFilterData.value.push({
|
|
|
+ id: '0',
|
|
|
+ label: '所有机型',
|
|
|
+ parentId: '',
|
|
|
+ children: data
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// 树形筛选切换
|
|
|
+const changeTreeFilter = (val: string) => {
|
|
|
+ proTable.value!.pageable.pageNum = 1
|
|
|
+ initParam.aircraftId = val === '0' ? '' : val
|
|
|
+}
|
|
|
+
|
|
|
// 删除架次信息
|
|
|
const deleteSortie = async (params: any) => {
|
|
|
await useHandleData(delSortieApi, params.id, '删除【' + params.id + '】架次')
|
|
@@ -117,9 +144,6 @@ const columns = reactive<ColumnProps<any>[]>([
|
|
|
{
|
|
|
prop: 'aircraftNo',
|
|
|
label: '机号',
|
|
|
- search: {
|
|
|
- el: 'input'
|
|
|
- },
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
@@ -182,10 +206,13 @@ const setItemsOptions = () => {
|
|
|
},
|
|
|
{
|
|
|
label: '机号',
|
|
|
- prop: 'aircraftNo',
|
|
|
- rules: [{ required: true, message: '机号不能为空', trigger: 'blur' }],
|
|
|
+ prop: 'aircraftId',
|
|
|
+ rules: [{ required: true, message: '机号不能为空', trigger: 'change' }],
|
|
|
compOptions: {
|
|
|
- placeholder: '请输入机号'
|
|
|
+ elTagName: 'tree-select',
|
|
|
+ enum: treeOptions.value,
|
|
|
+ valueKey: 'id',
|
|
|
+ placeholder: '请选择机号'
|
|
|
}
|
|
|
},
|
|
|
{
|