chenrui  2 gadi atpakaļ
vecāks
revīzija
470c83cbdd

+ 2 - 0
public/demo.js

@@ -27,4 +27,6 @@ const DATACONTENT_ID = {
   airlineTableId: 80, //基础数据-航司信息维护-表格-id
   airportTreeId: 58, //基础数据-机场信息维护-公司列表-id
   airportTableId: 79, //基础数据-机场信息维护-表格-id
+  terminalTableId: 1803432, //基础数据-机场信息维护-航站楼-表格-id
+  airpositTableId: 1803433, //基础数据-机场信息维护-航站楼位置-表格-id
 };

+ 100 - 1
src/views/BasicsData/airportInfo/airportInfoChild/index.vue

@@ -10,7 +10,7 @@
       >
       <div class="app-containers">
         <DataTable
-          :tableHeader="state.list"
+          :tableHeader="tableCols"
           :tableData="tableData"
           :tableBtnGroup="tableBtnGroup"
           :tableProperty="{ rowKey: 'ID' }"
@@ -23,6 +23,8 @@
         :msgTitle="msgTitle"
         @resetForm="resetForm"
         @delRest="delRest"
+        @submitForm="submitForm"
+        @delRemove="delRemove"
       >
         <div class="diacont">
           <el-form :model="tableForm">
@@ -59,7 +61,16 @@
 import DataTable from "@/components/tableTemp/index.vue";
 import Minheader from "@/components/minheader/index.vue";
 import Dialog from "@/components/dialog/index.vue";
+import { Query, GeneralDataReception } from "@/api/webApi";
+import { ElMessage } from "element-plus";
 const router = useRouter();
+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 flag = ref<Boolean>(false); //弹窗开关
 const type = ref<String>(""); //判断是否删除
 const msgTitle = ref<String>("新增航站楼"); //弹窗标题
@@ -81,10 +92,12 @@ const tableBtnGroup = ref<Array>([
     param: 3,
   },
 ]); //单独的编辑
+// console.log(router.IATACode);
 const tableForm = reactive({
   name: "",
   china: "",
   englin: "",
+  event: "",
 }); //弹窗内容
 //列表
 const tableData = ref([
@@ -106,6 +119,7 @@ const state = reactive({
 //新增
 const addForm = () => {
   msgTitle.value = "新增航站楼";
+  tableForm.event = 1;
   flag.value = true;
   type.value = "";
 };
@@ -131,6 +145,10 @@ const eleDialog = () => {
   flag.value = true;
   type.value = "del";
 };
+const delRemove = () => {
+  tableForm.event = 3;
+  generalDataReception(tableForm);
+};
 //删除取消
 const delRest = () => {
   flag.value = false;
@@ -156,6 +174,87 @@ const btnClick = (row, index, param) => {
     router.push({ path: "/BasicsData/positionSetting" });
   }
 };
+//获取表格数据
+const getQuery = async () => {
+  try {
+    const { code, returnData } = await Query({
+      id: DATACONTENT_ID.terminalTableId,
+      needPage: ++page.value,
+      dataContent: Object.values(dataContent.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 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();
+  }
+};
 </script>
 <style lang="scss" scoped>
 ::v-deep .el-form-item__label {

+ 100 - 2
src/views/BasicsData/airportInfo/index.vue

@@ -174,7 +174,100 @@ const BtnGroupWidth = ref<String>("");
 const flag = ref<Boolean>(false); //弹窗开关
 const type = ref<String>(""); //判断是否删除
 const msgTitle = ref<String>("新增机场信息维护"); //弹窗标题
-const tableOptionser = ref<Array>([]); //弹窗下拉
+const tableOptionser = ref<Array>([
+  {
+    k: "UTC",
+    v: "1",
+  },
+  {
+    k: "UTC+1",
+    v: "+1",
+  },
+  {
+    k: "UTC+2",
+    v: "+2",
+  },
+  {
+    k: "UTC+3",
+    v: "+3",
+  },
+  {
+    k: "UTC+4",
+    v: "+4",
+  },
+  {
+    k: "UTC+5",
+    v: "+5",
+  },
+  {
+    k: "UTC+6",
+    v: "+6",
+  },
+  {
+    k: "UTC+7",
+    v: "+7",
+  },
+  {
+    k: "UTC+8",
+    v: "+8",
+  },
+  {
+    k: "UTC+9",
+    v: "+9",
+  },
+  {
+    k: "UTC+10",
+    v: "+10",
+  },
+  {
+    k: "UTC+11",
+    v: "+11",
+  },
+  {
+    k: "UTC-1",
+    v: "-1",
+  },
+  {
+    k: "UTC-2",
+    v: "-2",
+  },
+  {
+    k: "UTC-3",
+    v: "-3",
+  },
+  {
+    k: "UTC-4",
+    v: "-4",
+  },
+  {
+    k: "UTC-5",
+    v: "-5",
+  },
+  {
+    k: "UTC-6",
+    v: "-6",
+  },
+  {
+    k: "UTC-7",
+    v: "-7",
+  },
+  {
+    k: "UTC-8",
+    v: "-8",
+  },
+  {
+    k: "UTC-9",
+    v: "-9",
+  },
+  {
+    k: "UTC-10",
+    v: "-10",
+  },
+  {
+    k: "UTC-11",
+    v: "-11",
+  },
+]); //弹窗下拉
 const tableColsCopys = reactive<Object>({}); //弹窗
 const tableForm = reactive({
   airportID: "",
@@ -289,7 +382,12 @@ const btnClick = (row, index, param) => {
     tableForm.companyName = index.companyName;
     tableForm.event = index.event;
   } else if (param === 4) {
-    router.push({ path: "/BasicsData/airportInfoChild" });
+    router.push({
+      path: "/BasicsData/airportInfoChild",
+      params: {
+        IATACode: row.IATACode,
+      },
+    });
   }
 };
 //点击树事件

+ 99 - 1
src/views/BasicsData/airportInfo/positionSetting/index.vue

@@ -10,7 +10,7 @@
       >
       <div class="app-containers">
         <DataTable
-          :tableHeader="state.list"
+          :tableHeader="tableCols"
           :tableData="tableData"
           :tableBtnGroup="tableBtnGroup"
           :tableProperty="{ rowKey: 'ID' }"
@@ -23,6 +23,8 @@
         :msgTitle="msgTitle"
         @resetForm="resetForm"
         @delRest="delRest"
+        @submitForm="submitForm"
+        @delRemove="delRemove"
       >
         <div class="diacont">
           <el-form :model="tableForm">
@@ -79,6 +81,15 @@
 import DataTable from "@/components/tableTemp/index.vue";
 import Minheader from "@/components/minheader/index.vue";
 import Dialog from "@/components/dialog/index.vue";
+import { Query, GeneralDataReception } from "@/api/webApi";
+import { ElMessage } from "element-plus";
+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 flag = ref<Boolean>(false); //弹窗开关
 const type = ref<String>(""); //判断是否删除
 const msgTitle = ref<String>("新增位置设置"); //弹窗标题
@@ -89,6 +100,7 @@ const tableForm = reactive({
   englin: "",
   two: "",
   three: "",
+  event: "",
 }); //弹窗内容
 //列表
 const tableData = ref([
@@ -140,6 +152,7 @@ const tableBtnGroup = ref([
 //新增
 const addForm = () => {
   msgTitle.value = "新增位置";
+  tableForm.event = 1;
   flag.value = true;
   type.value = "";
 };
@@ -169,6 +182,10 @@ const eleDialog = () => {
   flag.value = true;
   type.value = "del";
 };
+const delRemove = () => {
+  tableForm.event = 3;
+  generalDataReception(tableForm);
+};
 //删除
 const delRest = () => {
   flag.value = false;
@@ -191,6 +208,87 @@ const btnClick = (row, index, param) => {
   } else if (param === 4) {
   }
 };
+//获取表格数据
+const getQuery = async () => {
+  try {
+    const { code, returnData } = await Query({
+      id: DATACONTENT_ID.airpositTableId,
+      needPage: ++page.value,
+      dataContent: Object.values(dataContent.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 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();
+  }
+};
 </script>
 <style lang="scss" scoped>
 ::v-deep .el-form-item__label {