|
@@ -1,13 +1,23 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
+ <el-form-item label="机型" prop="aircraftTypeId">
|
|
|
+ <el-select v-model="queryParams.aircraftTypeId" placeholder="请选择" @change="handleaircraftChange">
|
|
|
+ <el-option
|
|
|
+ v-for="item in typeOption"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="系统" prop="aircraftSystemId">
|
|
|
<el-select v-model="queryParams.aircraftSystemId" placeholder="请选择" @change="handlesystemChange">
|
|
|
<!-- -->
|
|
|
<el-option
|
|
|
- v-for="item in allsystemOption"
|
|
|
+ v-for="item in systemOption"
|
|
|
:key="item.id"
|
|
|
- :label="item.aircraft_type_name"
|
|
|
+ :label="item.aircraftSystemName"
|
|
|
:value="item.id">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
@@ -18,9 +28,9 @@
|
|
|
<el-select v-model="queryParams.aircraftTypeName" placeholder="请选择">
|
|
|
<el-option
|
|
|
v-for="item in subSystemOption"
|
|
|
- :key="item.id"
|
|
|
- :label="item.aircraftTypeName"
|
|
|
- :value="item.aircraftTypeName">
|
|
|
+ :key="item.aircraftSubsystemName"
|
|
|
+ :label="item.aircraftSubsystemName"
|
|
|
+ :value="item.aircraftSubsystemName">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
@@ -80,8 +90,9 @@
|
|
|
<el-table v-loading="loading" :data="subsystemList" @selection-change="handleSelectionChange">
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
<el-table-column label="编号" align="center" prop="id" />
|
|
|
- <el-table-column label="系统" align="center" prop="aircraftSystemId" />
|
|
|
- <el-table-column label="分系统名称" align="center" prop="aircraftTypeName" />
|
|
|
+ <el-table-column label="机型" align="center" prop="aircraftTypeName" />
|
|
|
+ <el-table-column label="系统" align="center" prop="aircraftSystemName" />
|
|
|
+ <el-table-column label="分系统名称" align="center" prop="aircraftSubsystemName" />
|
|
|
<el-table-column label="备注" align="center" prop="remark" />
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
@@ -114,19 +125,29 @@
|
|
|
<!-- 添加或修改分系统信息管理对话框 -->
|
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
- <el-form-item label="系统" prop="aircraftSystemId">
|
|
|
- <el-select v-model="form.aircraftSystemId" placeholder="请选择">
|
|
|
- <el-option
|
|
|
- v-for="item in allsystemOption1"
|
|
|
- :key="item.id"
|
|
|
- :label="item.aircraft_type_name"
|
|
|
- :value="item.id">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
+ <el-form-item label="机型" prop="aircraftTypeId">
|
|
|
+ <el-select v-model="form.airname" placeholder="请选择" @change="handleaircraftChange1">
|
|
|
+ <el-option
|
|
|
+ v-for="item in typeOption1"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="系统" prop="aircraftSystemId">
|
|
|
+ <el-select v-model="form.aircraftSystemId" placeholder="请选择">
|
|
|
+ <el-option
|
|
|
+ v-for="item in systemOption1"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.aircraftSystemName"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
|
|
|
- <el-form-item label="分系统名称" prop="aircraftTypeName">
|
|
|
- <el-input v-model="form.aircraftTypeName" placeholder="请输入分系统名称" />
|
|
|
+ <el-form-item label="分系统名称" prop="aircraftSubsystemName">
|
|
|
+ <el-input v-model="form.aircraftSubsystemName" placeholder="请输入分系统名称" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
|
@@ -141,9 +162,13 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { getSystem} from "@/api/system/system";
|
|
|
import { listSubsystem, getSubsystem, delSubsystem, addSubsystem, updateSubsystem } from "@/api/system/subsystem";
|
|
|
+import { getTypeOption } from '@/api/system/type'
|
|
|
+import { getSystemOption } from '@/api/system/system'
|
|
|
+import { getSubSystemOption } from '@/api/system/subsystem'
|
|
|
import { getSysOption } from "@/api/system/system";
|
|
|
-import { getSubSystemOption } from "@/api/system/subsystem"
|
|
|
+
|
|
|
|
|
|
export default {
|
|
|
name: "Subsystem",
|
|
@@ -173,50 +198,103 @@ export default {
|
|
|
pageSize: 10,
|
|
|
aircraftSystemId: null,
|
|
|
aircraftTypeName: null,
|
|
|
- aircraftSubsystemId:null
|
|
|
+ aircraftSubsystemId:null,
|
|
|
+ aircraftSubsystemName:null,
|
|
|
},
|
|
|
// 表单参数
|
|
|
form: {
|
|
|
+ aircraftSystemName:null,
|
|
|
+ aircraftTypeId:null,
|
|
|
aircraftSystemId: null,
|
|
|
aircraftTypeName: null,
|
|
|
+ aircraftSubsystemName:null,
|
|
|
+ aircraftSubsystemId:null,
|
|
|
remark:null,
|
|
|
+ airname:null,
|
|
|
+
|
|
|
},
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
},
|
|
|
- allsystemOption:[],
|
|
|
- allsystemOption1:[],
|
|
|
+ typeOption:[],
|
|
|
+ systemOption:[],
|
|
|
+ typeOption1: [],
|
|
|
subSystemOption:[],
|
|
|
systemOption1:[],
|
|
|
+ subSystemOption1: [],
|
|
|
+
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
this.getList();
|
|
|
- this.getSystemOption();
|
|
|
- this.getSystemOption1();
|
|
|
+ this.getOption()
|
|
|
+ this.getOption1()
|
|
|
},
|
|
|
activated() {
|
|
|
- this.getSystemOption();
|
|
|
- this.getSystemOption1();
|
|
|
+ this.getOption()
|
|
|
+ this.getOption1()
|
|
|
},
|
|
|
methods: {
|
|
|
- getSystemOption() {
|
|
|
- getSysOption().then(resp => {
|
|
|
- this.allsystemOption = resp.data
|
|
|
+ getOption() {
|
|
|
+ getTypeOption().then(resp => {
|
|
|
+ this.typeOption = resp.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 用于获取飞机机型(放到添加功能中)
|
|
|
+ getOption1() {
|
|
|
+ getTypeOption().then(resp => {
|
|
|
+ this.typeOption1 = resp.data
|
|
|
})
|
|
|
},
|
|
|
- getSystemOption1() {
|
|
|
- getSysOption().then(resp => {
|
|
|
- this.allsystemOption1 = resp.data
|
|
|
+
|
|
|
+ // getSystemOption() {
|
|
|
+ // getSysOption().then(resp => {
|
|
|
+ // this.allsystemOption = resp.data
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+ // getSystemOption1() {
|
|
|
+ // getSysOption().then(resp => {
|
|
|
+ // this.allsystemOption1 = resp.data
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+ // 机型变化后更新系统下拉框
|
|
|
+ handleaircraftChange() {
|
|
|
+ this.queryParams.aircraftSystemId = ''
|
|
|
+ this.queryParams.aircraftSubsystemId = ''
|
|
|
+ this.queryParams.aircraftTypeName = ''
|
|
|
+ // alert(this.queryParams.aircraftTypeId)
|
|
|
+ getSystemOption(this.queryParams.aircraftTypeId).then(resp => {
|
|
|
+ this.systemOption = resp.data
|
|
|
})
|
|
|
},
|
|
|
//系统变化后更新分系统
|
|
|
handlesystemChange(){
|
|
|
- this.queryParams.aircraftSubsystemId = '';
|
|
|
+ this.queryParams.aircraftTypeName = ''
|
|
|
getSubSystemOption(this.queryParams.aircraftSystemId).then(resp =>{
|
|
|
this.subSystemOption = resp.data;
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
+ // 添加或修改对话框中机型变化后,修改系统
|
|
|
+ handleaircraftChange1() {
|
|
|
+ this.form.aircraftSystemName = ''
|
|
|
+ // alert(this.queryParams.aircraftTypeId)
|
|
|
+ this.form.aircraftTypeId = this.form.airname;
|
|
|
+ getSystemOption(this.form.aircraftTypeId).then(resp => {
|
|
|
+ this.systemOption1 = resp.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 添加或修改对话框中系统变化后,修改分系统
|
|
|
+ handlesystemChange1() {
|
|
|
+ //this.form.aircraftSystemId = this.form.aircraftSystemName
|
|
|
+ // getSubSystemOption(this.form.aircraftSystemId).then(resp => {
|
|
|
+ // this.subSystemOption1 = resp.data
|
|
|
+ // })
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
/** 查询分系统信息管理列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
@@ -253,6 +331,8 @@ export default {
|
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
|
this.resetForm("queryForm");
|
|
|
+ this.systemOption = []
|
|
|
+ this.subSystemOption = []
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
// 多选框选中数据
|
|
@@ -273,6 +353,8 @@ export default {
|
|
|
const id = row.id || this.ids
|
|
|
getSubsystem(id).then(response => {
|
|
|
this.form = response.data;
|
|
|
+ this.form.airname = this.form.aircraftTypeName;
|
|
|
+ console.log(this.form)
|
|
|
this.open = true;
|
|
|
this.title = "修改分系统信息管理";
|
|
|
});
|
|
@@ -281,7 +363,9 @@ export default {
|
|
|
submitForm() {
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
|
+ this.form.aircraftTypeName = this.form.aircraftSubsystemName;
|
|
|
if (this.form.id != null) {
|
|
|
+ this.form.aircraftTypeName = this.form.aircraftSubsystemName;
|
|
|
updateSubsystem(this.form).then(response => {
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
this.open = false;
|
|
@@ -289,8 +373,12 @@ export default {
|
|
|
});
|
|
|
} else {
|
|
|
addSubsystem(this.form).then(response => {
|
|
|
+ console.log(this.form.aircraftSubsystemName)
|
|
|
+ //this.form.aircraftTypeName = this.form.aircraftSubsystemName;
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
+
|
|
|
this.open = false;
|
|
|
+
|
|
|
this.queryParams.aircraftSystemId= null;
|
|
|
this.queryParams.aircraftTypeName= null;
|
|
|
this.queryParams.aircraftSubsystemId=null;
|