|
@@ -13,7 +13,12 @@
|
|
<div class="tree_left">
|
|
<div class="tree_left">
|
|
<el-scrollbar style="height: 100%">
|
|
<el-scrollbar style="height: 100%">
|
|
<div class="corporate">{{ company }}</div>
|
|
<div class="corporate">{{ company }}</div>
|
|
- <el-tree :data="data2" accordion @node-click="handleNodeClick">
|
|
|
|
|
|
+ <el-tree
|
|
|
|
+ :data="data.value"
|
|
|
|
+ :props="defaultProps"
|
|
|
|
+ accordion
|
|
|
|
+ @node-click="handleNodeClick"
|
|
|
|
+ >
|
|
</el-tree>
|
|
</el-tree>
|
|
</el-scrollbar>
|
|
</el-scrollbar>
|
|
</div>
|
|
</div>
|
|
@@ -22,7 +27,7 @@
|
|
<div class="app-containers">
|
|
<div class="app-containers">
|
|
<DataTable
|
|
<DataTable
|
|
BtnGroupWidth="300px"
|
|
BtnGroupWidth="300px"
|
|
- :tableHeader="state.list"
|
|
|
|
|
|
+ :tableHeader="tableCols"
|
|
:tableData="tableData"
|
|
:tableData="tableData"
|
|
:tableBtnGroup="tableBtnGroup"
|
|
:tableBtnGroup="tableBtnGroup"
|
|
:tableProperty="{ rowKey: 'ID' }"
|
|
:tableProperty="{ rowKey: 'ID' }"
|
|
@@ -39,6 +44,8 @@
|
|
:msgTitle="msgTitle"
|
|
:msgTitle="msgTitle"
|
|
@resetForm="resetForm"
|
|
@resetForm="resetForm"
|
|
@delRest="delRest"
|
|
@delRest="delRest"
|
|
|
|
+ @submitForm="submitForm"
|
|
|
|
+ @delRemove="delRemove"
|
|
>
|
|
>
|
|
<div class="diacont">
|
|
<div class="diacont">
|
|
<el-form :model="tableForm">
|
|
<el-form :model="tableForm">
|
|
@@ -46,7 +53,7 @@
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
<el-form-item label="机场名称" size="default">
|
|
<el-form-item label="机场名称" size="default">
|
|
<el-input
|
|
<el-input
|
|
- v-model="tableForm.name"
|
|
|
|
|
|
+ v-model="tableForm.airportName"
|
|
placeholder="请输入机场名称"
|
|
placeholder="请输入机场名称"
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -54,7 +61,7 @@
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
<el-form-item label="三字码" size="default">
|
|
<el-form-item label="三字码" size="default">
|
|
<el-input
|
|
<el-input
|
|
- v-model="tableForm.china"
|
|
|
|
|
|
+ v-model="tableForm.IATACode"
|
|
placeholder="请输入三字码"
|
|
placeholder="请输入三字码"
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -62,7 +69,7 @@
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
<el-form-item label="四字码" size="default">
|
|
<el-form-item label="四字码" size="default">
|
|
<el-input
|
|
<el-input
|
|
- v-model="tableForm.englin"
|
|
|
|
|
|
+ v-model="tableForm.ICAOCode"
|
|
placeholder="请输入四字码"
|
|
placeholder="请输入四字码"
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -70,7 +77,7 @@
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
<el-form-item label="中文简称" size="default">
|
|
<el-form-item label="中文简称" size="default">
|
|
<el-input
|
|
<el-input
|
|
- v-model="tableForm.two"
|
|
|
|
|
|
+ v-model="tableForm.abbreviation"
|
|
placeholder="请输入中文简称"
|
|
placeholder="请输入中文简称"
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -78,14 +85,17 @@
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
<el-form-item label="英文简称" size="default">
|
|
<el-form-item label="英文简称" size="default">
|
|
<el-input
|
|
<el-input
|
|
- v-model="tableForm.three"
|
|
|
|
|
|
+ v-model="tableForm.englishAbbreviation"
|
|
placeholder="请输入英文简称"
|
|
placeholder="请输入英文简称"
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
<el-form-item label="全称" size="default">
|
|
<el-form-item label="全称" size="default">
|
|
- <el-input v-model="tableForm.text" placeholder="请输入全称" />
|
|
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="tableForm.fullName"
|
|
|
|
+ placeholder="请输入全称"
|
|
|
|
+ />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
@@ -93,7 +103,7 @@
|
|
<!-- <el-input v-model="tableForm.china" /> -->
|
|
<!-- <el-input v-model="tableForm.china" /> -->
|
|
<el-select
|
|
<el-select
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
- v-model="tableForm.text1"
|
|
|
|
|
|
+ v-model="tableForm.airportTimeZone"
|
|
class="input-shadow"
|
|
class="input-shadow"
|
|
filterable
|
|
filterable
|
|
default-first-option
|
|
default-first-option
|
|
@@ -111,10 +121,10 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
- <el-form-item label="描述" size="default">
|
|
|
|
|
|
+ <el-form-item label="公司名称" size="default">
|
|
<el-input
|
|
<el-input
|
|
- v-model="tableForm.text2"
|
|
|
|
- placeholder="请输入机场三字码"
|
|
|
|
|
|
+ v-model="tableForm.companyName"
|
|
|
|
+ placeholder="请输入公司名称"
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
@@ -127,6 +137,9 @@
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
import DataTable from "@/components/tableTemp/index.vue";
|
|
import DataTable from "@/components/tableTemp/index.vue";
|
|
import Dialog from "@/components/dialog/index.vue";
|
|
import Dialog from "@/components/dialog/index.vue";
|
|
|
|
+import { translateDataToTreeAll } from "@/utils/validate";
|
|
|
|
+import { Query, GeneralDataReception } from "@/api/webApi";
|
|
|
|
+import { ElMessage } from "element-plus";
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
const tableBtnGroup = ref<Array>([
|
|
const tableBtnGroup = ref<Array>([
|
|
{
|
|
{
|
|
@@ -145,20 +158,35 @@ const tableBtnGroup = ref<Array>([
|
|
param: 3,
|
|
param: 3,
|
|
},
|
|
},
|
|
]); //单独的编辑
|
|
]); //单独的编辑
|
|
|
|
+const page = ref<number>(0); //分页参数
|
|
|
|
+const dataContent = ref<object>({});
|
|
|
|
+const noMore = ref<Boolean>(false);
|
|
|
|
+const rowTitle = ref<String>("");
|
|
|
|
+const tableCols = ref([]); //表头数据
|
|
|
|
+const serviceId = ref<String>("");
|
|
|
|
+const tableObj = ref({}); //增删改数据缓存
|
|
|
|
+const defaultProps = ref({
|
|
|
|
+ children: "children",
|
|
|
|
+ label: "companyName",
|
|
|
|
+});
|
|
|
|
+const companyID = ref(""); //机场id
|
|
const flag = ref<Boolean>(false); //弹窗开关
|
|
const flag = ref<Boolean>(false); //弹窗开关
|
|
const type = ref<String>(""); //判断是否删除
|
|
const type = ref<String>(""); //判断是否删除
|
|
const msgTitle = ref<String>("新增机场信息维护"); //弹窗标题
|
|
const msgTitle = ref<String>("新增机场信息维护"); //弹窗标题
|
|
const tableOptionser = ref<Array>([]); //弹窗下拉
|
|
const tableOptionser = ref<Array>([]); //弹窗下拉
|
|
const tableColsCopys = reactive<Object>({}); //弹窗
|
|
const tableColsCopys = reactive<Object>({}); //弹窗
|
|
const tableForm = reactive({
|
|
const tableForm = reactive({
|
|
- name: "",
|
|
|
|
- china: "",
|
|
|
|
- englin: "",
|
|
|
|
- two: "",
|
|
|
|
- three: "",
|
|
|
|
- text: "",
|
|
|
|
- text1: "",
|
|
|
|
- text2: "",
|
|
|
|
|
|
+ airportID: "",
|
|
|
|
+ airportName: "",
|
|
|
|
+ IATACode: "",
|
|
|
|
+ ICAOCode: "",
|
|
|
|
+ abbreviation: "",
|
|
|
|
+ englishAbbreviation: "",
|
|
|
|
+ fullName: "",
|
|
|
|
+ companyID: "",
|
|
|
|
+ airportTimeZone: "",
|
|
|
|
+ companyName: "",
|
|
|
|
+ event: "",
|
|
}); //弹窗内容
|
|
}); //弹窗内容
|
|
const tableColumnProperty = reactive({
|
|
const tableColumnProperty = reactive({
|
|
width: "120px",
|
|
width: "120px",
|
|
@@ -169,38 +197,7 @@ const tableColumnProperty = reactive({
|
|
headerAlign: "",
|
|
headerAlign: "",
|
|
}); //弹窗内容
|
|
}); //弹窗内容
|
|
//列表
|
|
//列表
|
|
-const tableData = ref([
|
|
|
|
- {
|
|
|
|
- name: "成都双流机场",
|
|
|
|
- china: "CTU",
|
|
|
|
- englin: "ZUUU",
|
|
|
|
- two: "",
|
|
|
|
- three: "CHENGDU",
|
|
|
|
- text: "成都双流机场",
|
|
|
|
- text1: "",
|
|
|
|
- text2: "西南分公司",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- name: "成都双流机场",
|
|
|
|
- china: "CTU",
|
|
|
|
- englin: "ZUUU",
|
|
|
|
- two: "",
|
|
|
|
- three: "CHENGDU",
|
|
|
|
- text: "成都双流机场",
|
|
|
|
- text1: "",
|
|
|
|
- text2: "西南分公司",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- name: "成都双流机场",
|
|
|
|
- china: "CTU",
|
|
|
|
- englin: "ZUUU",
|
|
|
|
- two: "",
|
|
|
|
- three: "CHENGDU",
|
|
|
|
- text: "成都双流机场",
|
|
|
|
- text1: "",
|
|
|
|
- text2: "西南分公司",
|
|
|
|
- },
|
|
|
|
-]);
|
|
|
|
|
|
+const tableData = ref([]);
|
|
//表头
|
|
//表头
|
|
const state = reactive({
|
|
const state = reactive({
|
|
list: [
|
|
list: [
|
|
@@ -216,39 +213,14 @@ const state = reactive({
|
|
listLoading: true,
|
|
listLoading: true,
|
|
});
|
|
});
|
|
const company = ref("所属公司");
|
|
const company = ref("所属公司");
|
|
-const data2 = reactive([
|
|
|
|
- {
|
|
|
|
- id: 1,
|
|
|
|
- label: "中国国际航空",
|
|
|
|
- children: [
|
|
|
|
- {
|
|
|
|
- id: 2,
|
|
|
|
- label: "西南分公司",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: 3,
|
|
|
|
- label: "浙江分公司",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: 4,
|
|
|
|
- label: "重庆分公司",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: 5,
|
|
|
|
- label: "天津分公司",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: 6,
|
|
|
|
- label: "上海分公司",
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- },
|
|
|
|
-]);
|
|
|
|
|
|
+const data = reactive([]);
|
|
//新增
|
|
//新增
|
|
const addForm = () => {
|
|
const addForm = () => {
|
|
msgTitle.value = "新增机场信息维护";
|
|
msgTitle.value = "新增机场信息维护";
|
|
flag.value = true;
|
|
flag.value = true;
|
|
type.value = "";
|
|
type.value = "";
|
|
|
|
+ tableForm.event = 1;
|
|
|
|
+ tableForm.companyID = companyID;
|
|
};
|
|
};
|
|
//取消
|
|
//取消
|
|
const resetForm = () => {
|
|
const resetForm = () => {
|
|
@@ -288,26 +260,158 @@ const btnClick = (row, index, param) => {
|
|
msgTitle.value = "编辑机场信息维护";
|
|
msgTitle.value = "编辑机场信息维护";
|
|
flag.value = true;
|
|
flag.value = true;
|
|
type.value = "";
|
|
type.value = "";
|
|
- tableForm.name = index.name;
|
|
|
|
- tableForm.china = index.china;
|
|
|
|
- tableForm.englin = index.englin;
|
|
|
|
- tableForm.two = index.two;
|
|
|
|
- tableForm.three = index.three;
|
|
|
|
- tableForm.text = index.text;
|
|
|
|
- tableForm.text1 = index.text1;
|
|
|
|
- tableForm.text2 = index.text2;
|
|
|
|
|
|
+ tableForm.airportID = index.airportID;
|
|
|
|
+ tableForm.airportName = index.airportName;
|
|
|
|
+ tableForm.IATACode = index.IATACode;
|
|
|
|
+ tableForm.ICAOCode = index.ICAOCode;
|
|
|
|
+ tableForm.abbreviation = index.abbreviation;
|
|
|
|
+ tableForm.englishAbbreviation = index.englishAbbreviation;
|
|
|
|
+ tableForm.fullName = index.fullName;
|
|
|
|
+ tableForm.companyID = index.companyID;
|
|
|
|
+ tableForm.airportTimeZone = index.airportTimeZone;
|
|
|
|
+ tableForm.companyName = index.companyName;
|
|
|
|
+ tableForm.event = index.event;
|
|
} else if (param === 3) {
|
|
} else if (param === 3) {
|
|
msgTitle.value = "删除机场信息维护";
|
|
msgTitle.value = "删除机场信息维护";
|
|
flag.value = true;
|
|
flag.value = true;
|
|
type.value = "del";
|
|
type.value = "del";
|
|
|
|
+ tableForm.event = 3;
|
|
|
|
+ tableForm.airportID = index.airportID;
|
|
|
|
+ tableForm.airportName = index.airportName;
|
|
|
|
+ tableForm.IATACode = index.IATACode;
|
|
|
|
+ tableForm.ICAOCode = index.ICAOCode;
|
|
|
|
+ tableForm.abbreviation = index.abbreviation;
|
|
|
|
+ tableForm.englishAbbreviation = index.englishAbbreviation;
|
|
|
|
+ tableForm.fullName = index.fullName;
|
|
|
|
+ tableForm.companyID = index.companyID;
|
|
|
|
+ tableForm.airportTimeZone = index.airportTimeZone;
|
|
|
|
+ tableForm.companyName = index.companyName;
|
|
|
|
+ tableForm.event = index.event;
|
|
} else if (param === 4) {
|
|
} else if (param === 4) {
|
|
router.push({ path: "/BasicsData/airportInfoChild" });
|
|
router.push({ path: "/BasicsData/airportInfoChild" });
|
|
}
|
|
}
|
|
};
|
|
};
|
|
//点击树事件
|
|
//点击树事件
|
|
const handleNodeClick = (data) => {
|
|
const handleNodeClick = (data) => {
|
|
- company.value = data.label;
|
|
|
|
|
|
+ // console.log(data);
|
|
|
|
+ company.value = data.companyName;
|
|
|
|
+ companyID.value = data.companyID;
|
|
|
|
+ tableData.value = [];
|
|
|
|
+ getQuery();
|
|
|
|
+};
|
|
|
|
+//获取表格数据
|
|
|
|
+const getQuery = async () => {
|
|
|
|
+ try {
|
|
|
|
+ const { code, returnData } = await Query({
|
|
|
|
+ id: DATACONTENT_ID.airportTableId,
|
|
|
|
+ needPage: ++page.value,
|
|
|
|
+ dataContent: [JSON.stringify(companyID.value)],
|
|
|
|
+ });
|
|
|
|
+ if (code === "0") {
|
|
|
|
+ if (returnData.listValues.length === 0) {
|
|
|
|
+ page.value--;
|
|
|
|
+ noMore.value = true;
|
|
|
|
+ }
|
|
|
|
+ const titleColumn = returnData.columnSet.find(
|
|
|
|
+ (item) => item.needShow === 1
|
|
|
|
+ );
|
|
|
|
+ if (titleColumn) {
|
|
|
|
+ rowTitle.value = titleColumn.columnName;
|
|
|
|
+ }
|
|
|
|
+ tableData.value.push(...returnData.listValues);
|
|
|
|
+ tableCols.value = returnData.columnSet;
|
|
|
|
+ tableCols.value.forEach((element) => {
|
|
|
|
+ element.label = element.columnLabel;
|
|
|
|
+ element.key = element.columnName;
|
|
|
|
+ // if (element.columnName === "queryTemplate") {
|
|
|
|
+ // element.width = "300px";
|
|
|
|
+ // }
|
|
|
|
+ });
|
|
|
|
+ serviceId.value = returnData.submitID;
|
|
|
|
+ } else {
|
|
|
|
+ page.value--;
|
|
|
|
+ }
|
|
|
|
+ } catch (error) {
|
|
|
|
+ page.value--;
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+//公司列表
|
|
|
|
+const getAirlines = async () => {
|
|
|
|
+ try {
|
|
|
|
+ const res = await Query({
|
|
|
|
+ id: DATACONTENT_ID.airportTreeId,
|
|
|
|
+ dataContent: [],
|
|
|
|
+ });
|
|
|
|
+ if (res.code === "0") {
|
|
|
|
+ let arr = [];
|
|
|
|
+ arr = translateDataToTreeAll(
|
|
|
|
+ res.returnData.listValues,
|
|
|
|
+ "parentID",
|
|
|
|
+ "companyID"
|
|
|
|
+ );
|
|
|
|
+ data.value = arr;
|
|
|
|
+ // if (!company.length) {
|
|
|
|
+ // company.value = arr[0].companyID;
|
|
|
|
+ // company.value = arr[0].companyName;
|
|
|
|
+ // }
|
|
|
|
+ } else {
|
|
|
|
+ // this.$message.error(res.message ?? "失败");
|
|
|
|
+ }
|
|
|
|
+ } catch (error) {
|
|
|
|
+ // this.$message.error("失败");
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+//确认提交
|
|
|
|
+const submitForm = () => {
|
|
|
|
+ generalDataReception(tableForm);
|
|
};
|
|
};
|
|
|
|
+const resetTable = () => {
|
|
|
|
+ page.value = 0;
|
|
|
|
+ noMore.value = false;
|
|
|
|
+ tableData.value = [];
|
|
|
|
+};
|
|
|
|
+//新增-编辑-删除
|
|
|
|
+const generalDataReception = async (data) => {
|
|
|
|
+ try {
|
|
|
|
+ data = {
|
|
|
|
+ ...data,
|
|
|
|
+ ...dataContent,
|
|
|
|
+ };
|
|
|
|
+ const { code } = await GeneralDataReception({
|
|
|
|
+ serviceId: serviceId.value,
|
|
|
|
+ dataContent: JSON.stringify(data),
|
|
|
|
+ });
|
|
|
|
+ if (code == 0) {
|
|
|
|
+ ElMessage.success(`操作成功`);
|
|
|
|
+ // this.$message.success("操作成功");
|
|
|
|
+ resetTable();
|
|
|
|
+ getQuery();
|
|
|
|
+ resetForm();
|
|
|
|
+ flag.value = false;
|
|
|
|
+ // rmFlag.value = false;
|
|
|
|
+ tableObj.value = {};
|
|
|
|
+ // this.$router.go(0);
|
|
|
|
+ } else {
|
|
|
|
+ ElMessage.error(`操作失败`);
|
|
|
|
+ // this.$message.error("操作失败");
|
|
|
|
+ // this.flag = false;
|
|
|
|
+ // this.rmFlag = false;
|
|
|
|
+ tableObj.value = {};
|
|
|
|
+ resetForm();
|
|
|
|
+ }
|
|
|
|
+ } catch (error) {
|
|
|
|
+ flag.value = false;
|
|
|
|
+ // rmFlag.value = false;
|
|
|
|
+ tableObj.value = {};
|
|
|
|
+ resetForm();
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+const delRemove = () => {
|
|
|
|
+ tableForm.event = 3;
|
|
|
|
+ generalDataReception(tableForm);
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+getAirlines();
|
|
</script>
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
::v-deep .el-form-item__label {
|
|
::v-deep .el-form-item__label {
|