Эх сурвалжийг харах

Merge branch 'master' of http://120.26.64.82:3000/BFFE/CABaggageData2.0

zhaoke 2 жил өмнө
parent
commit
7277b1085b

+ 24 - 1
src/router/routes/routes-file-two.js

@@ -126,7 +126,30 @@ const systemSettingsRoutes = {
           },
           ]
         },
-
+        {
+          path: '/systemSettings/queryTemplate',
+          name: 'queryTemplate',
+          component: { render(c) { return c('router-view') } },
+          redirect: '/systemSettings/queryTemplate',
+          meta: { title: '查询模板' },
+          hidden: true,
+          src: require('@/assets/nav/ic_setting_top_default.png'),
+          srcer: require('@/assets/nav/ic_setting_top_check.png'),
+          children: [{
+            path: '/systemSettings/queryTemplate',
+            component: () => import('@/views/systemSettings/views/queryTemplate/queryTemplate'),
+          },
+          {
+            path: '/systemSettings/queryTemplate/queryTemplateadd',
+            name: 'queryTemplateadd',
+            component: () => import('@/views/systemSettings/views/queryTemplate/queryTemplateadd'),
+            meta: { title: '新增查询模板' },
+            hidden: false,
+            isAlone: true,
+            src: require('@/assets/nav/ic_setting_top@2x.png')
+          },
+          ]
+        },
       ]
     }
   ]

+ 453 - 0
src/views/systemSettings/views/queryTemplate/queryTemplate.vue

@@ -0,0 +1,453 @@
+<!--
+ * @Author: your name
+ * @Date: 2021-11-17 13:43:58
+ * @LastEditTime: 2021-11-17 13:43:59
+ * @LastEditors: Please set LastEditors
+ * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ * @FilePath: \CABaggageData\src\views\dashboard\views\info.vue
+-->
+<template>
+  <div class="airportInfo">
+    <!--搜索-->
+    <div class="airportInfo-search">
+      <Search title="查询模板" @getSearchData="getSearchData" :isSearch="false">
+        <button @click="handleAdd" class="btnAdd">新增</button>
+      </Search>
+    </div>
+    <!--内容区域-->
+    <div class="airportInfo-content">
+      <el-row :gutter="24">
+        <el-col
+          v-for="(item, index) in arr"
+          class="airportInfo-content-list"
+          :key="index"
+          :data="serachBox"
+          :span="4"
+        >
+          <div class="grid-content box-public-shadow">
+            <div class="flex list">
+              <div class="ult flex-wrap er">
+                <el-tooltip
+                  class="item"
+                  effect="dark"
+                  :content="item.typeName"
+                  placement="bottom"
+                >
+                  <div class="title">{{ item.typeName }}</div>
+                </el-tooltip>
+                <!-- <div class="title">{{ item.typeName }}</div> -->
+                <div @click="airEdit(item)" class="edit_log"></div>
+              </div>
+              <div class="close">
+                <span
+                  @click.stop="handleMove(item, index)"
+                  class="el-icon-close icon"
+                ></span>
+              </div>
+            </div>
+            <div class="list desc">{{ item.typeCode }}</div>
+          </div>
+        </el-col>
+      </el-row>
+      <!-- <img v-if="!arr.length" src="../../../assets/logo/nodata.png" /> -->
+    </div>
+    <!--删除弹框-->
+    <Dialog :flag="flag">
+      <div class="airportInfoDialog">
+        <div class="del-title">删除分类信息</div>
+        <div class="content er">
+          <div class="log"></div>
+          是否确认删除
+          <p style="color: #eb2f3b; margin-top: 0px; margin-bottom: 0px">
+            {{ rmObj.name }}
+          </p>
+          ?
+        </div>
+        <div class="DelFoot right t30">
+          <el-button
+            size="medium"
+            @click="remove()"
+            class="r25 buwitch"
+            type="danger"
+            >删除</el-button
+          >
+          <el-button size="medium" class="r26" @click="flag = false"
+            >取消</el-button
+          >
+        </div>
+      </div>
+    </Dialog>
+    <!--新增机场信息弹框-->
+    <Dialog :flag="addFlag" @close="closeForm" v-if="addFlag">
+      <div class="airportInfoDialog dialog-public-background">
+        <div class="flx">新增分类信息</div>
+        <div class="content">
+          <el-form
+            :model="ruleForm"
+            :rules="rules"
+            ref="ruleForms"
+            label-width="100px"
+            class="demo-ruleForm"
+          >
+            <el-form-item label="分类名称" prop="name">
+              <el-input
+                size="medium"
+                placeholder="请输入分类名称(必填)"
+                v-model="ruleForm.name"
+              ></el-input>
+            </el-form-item>
+            <el-form-item label="分类标识符" prop="fullName">
+              <el-input
+                size="medium"
+                placeholder="请输入分类标识符(必填)"
+                v-model="ruleForm.fullName"
+              ></el-input>
+            </el-form-item>
+            <el-form-item label="描述" prop="fullName">
+              <el-input
+                size="medium"
+                type="textarea"
+                maxlength="200"
+                rows="3"
+                resize="none"
+                :autosize="{ minRows: 3, maxRows: 3 }"
+                placeholder="请输入描述"
+                v-model="ruleForm.fullName"
+              ></el-input>
+            </el-form-item>
+          </el-form>
+        </div>
+        <div class="foot center t30">
+          <el-button
+            size="medium"
+            type="primary"
+            @click="addSubmit()"
+            class="r25 r26"
+            >提交</el-button
+          >
+          <el-button class="r26" size="medium" @click="resetForm()"
+            >取消</el-button
+          >
+        </div>
+      </div>
+    </Dialog>
+    <Dialog :flag="EditFlag" @close="closeForm" v-if="EditFlag">
+      <div class="airportInfoDialog dialog-public-background">
+        <div class="flx">编辑分类信息</div>
+        <div class="content">
+          <el-form
+            :model="EditForm"
+            :rules="rules"
+            ref="ruleFormall"
+            label-width="100px"
+            class="demo-ruleForm"
+          >
+            <el-form-item label="分类名称" prop="name">
+              <el-input
+                size="medium"
+                placeholder="请输入分类名称(必填)"
+                v-model="EditForm.name"
+              ></el-input>
+            </el-form-item>
+            <el-form-item label="分类标识符" prop="fullName">
+              <el-input
+                size="medium"
+                placeholder="请输入分类全称(必填)"
+                v-model="EditForm.fullName"
+              ></el-input>
+            </el-form-item>
+            <el-form-item label="描述" prop="fullName">
+              <el-input
+                size="medium"
+                type="textarea"
+                maxlength="200"
+                rows="3"
+                resize="none"
+                :autosize="{ minRows: 3, maxRows: 3 }"
+                placeholder="请输入描述"
+                v-model="ruleForm.fullName"
+              ></el-input>
+            </el-form-item>
+          </el-form>
+        </div>
+        <div class="foot center t30">
+          <el-button
+            size="medium"
+            type="primary"
+            @click="EditSubmit()"
+            class="r25 r26"
+            >提交</el-button
+          >
+          <el-button class="r26" size="medium" @click="resetForm()"
+            >取消</el-button
+          >
+        </div>
+      </div>
+    </Dialog>
+  </div>
+</template>
+<script>
+import Search from "@/layout/components/Search/index.vue";
+import Dialog from "@/layout/components/Dialog/index.vue";
+import { findarrays } from "@/utils/validate";
+import {
+  AirlinesInquiry,
+  DelAirlines,
+  AddAirlines,
+} from "@/api/SystemSettings";
+import { exceptiontype, exceptionadd, exceptiondel } from "@/api/acquisition";
+export default {
+  name: "AirportInfo",
+  components: { Search, Dialog },
+  data() {
+    return {
+      arr: [
+        {
+          typeName: "名称",
+          typeCode: "测试",
+        },
+      ], //内容数据
+      flag: false, //删除弹框开关
+      addFlag: false, //新增机场信息弹框开关
+      EditFlag: false,
+      ids: null,
+      idss: null,
+      rmObj: {
+        //删除内容
+        name: "",
+      },
+      ruleForm: {
+        //新增机场信息表单
+        name: "",
+        fullName: "",
+        code: "",
+      },
+      EditForm: {
+        name: "",
+        fullName: "",
+        code: "",
+      },
+      rules: {
+        //新增机场信息表单验证
+        name: [{ required: true, message: "请输入航司简称", trigger: "blur" }],
+        fullName: [
+          { required: true, message: "请输入航司全称", trigger: "blur" },
+        ],
+        code: [
+          { required: true, message: "请输入航司二字码", trigger: "blur" },
+        ],
+      },
+      modid: "",
+    };
+  },
+  created() {
+    // this.exceptionlist();
+  },
+  computed: {
+    serachBox() {
+      if (this.searchInfo) {
+        return this.arr.filter((data) => {
+          return Object.keys(data).some((key) => {
+            return (
+              String(data[key]).toLowerCase().indexOf(this.searchInfo) > -1
+            );
+          });
+        });
+      }
+      return this.arr;
+    },
+  },
+  methods: {
+    //异常列表查询
+    async exceptionlist() {
+      let params = {
+        id: "",
+      };
+      const result = await exceptiontype(params);
+      if (result.code == 0) {
+        this.arr = result.returnData;
+      }
+    },
+    //搜索
+    getSearchData(val) {
+      let that = this;
+      that.exceptionlist().then(function (data) {
+        if (val) {
+          that.arr = findarrays(that.arr, "typeName", val);
+        } else {
+          that.exceptionlist();
+        }
+      });
+      // console.log(this.searchInfo);
+    },
+    //删除信息
+    handleMove(item) {
+      this.ids = item.id;
+      this.flag = true;
+      this.rmObj = {
+        name: item.typeName,
+      };
+    },
+    airEdit(item) {
+      this.modid = item;
+      this.EditForm.name = item.typeName;
+      this.EditForm.fullName = item.typeCode;
+      // this.EditForm.code = item.code2;
+      this.EditFlag = true;
+    },
+    async EditSubmit() {
+      let arr = 0;
+      this.$refs["ruleFormall"].validate((valid) => {
+        if (valid) {
+          arr = 1;
+        } else {
+          arr = 0;
+          return false;
+        }
+      });
+      if (arr == 1) {
+        let params = {
+          id: this.modid.id,
+          typeName: this.EditForm.name,
+          typeCode: this.EditForm.fullName,
+        };
+        const result = await exceptionadd(params);
+        if (result.code == 0) {
+          this.$message.success("成功");
+          this.exceptionlist();
+          this.$refs.ruleFormall.resetFields();
+        }
+        this.EditFlag = false;
+      }
+    },
+    closeForm() {
+      this.$refs.ruleForm.resetFields();
+    },
+    //获取航司信息列表
+    async getAirlines() {
+      const result = await AirlinesInquiry({});
+      if (result.code === 0) {
+        this.arr = result.returnData;
+      } else {
+        this.$message.error.message;
+      }
+    },
+
+    //新增机场信息-弹框
+    handleAdd() {
+      this.$router.push("/systemSettings/queryTemplate/queryTemplateadd");
+    },
+    //新增机场信息-弹框-提交
+    async addSubmit() {
+      let arr = 0;
+      this.$refs["ruleForms"].validate((valid) => {
+        if (valid) {
+          arr = 1;
+        } else {
+          arr = 0;
+          return false;
+        }
+      });
+      if (arr == 1) {
+        let params = {
+          id: "",
+          typeName: this.ruleForm.name,
+          typeCode: this.ruleForm.fullName,
+        };
+        const result = await exceptionadd(params);
+        if (result.code == 0) {
+          this.ruleForm.name = "";
+          this.ruleForm.fullName = "";
+          this.$refs.ruleForms.resetFields();
+          this.$message.success("成功");
+          this.exceptionlist();
+        }
+        this.addFlag = false;
+      }
+    },
+    //新增机场信息-弹框-取消
+    resetForm() {
+      this.addFlag = false;
+      this.EditFlag = false;
+      this.ruleForm.name = "";
+      this.ruleForm.fullName = "";
+      this.$refs.ruleForms.resetFields();
+      this.$refs.ruleFormall.resetFields();
+    },
+    //删除
+    async remove() {
+      const result = await exceptiondel({
+        id: this.ids,
+      });
+      if (result.code === 0) {
+        this.flag = false;
+        this.exceptionlist();
+        this.$message.success("删除成功");
+      } else {
+        this.$message.error.message;
+      }
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.airportInfo {
+  .log {
+    width: 26px;
+    height: 26px;
+    background: #eb2f3b;
+    border-radius: 50%;
+    margin-right: 15px;
+    background: url("../../../../assets/index/ic_close_hint.png") no-repeat;
+    background-size: 100% 100%;
+  }
+  .er {
+    display: flex;
+    align-items: center;
+  }
+  .airportInfo-search {
+    margin: 40px 0 30px 0;
+  }
+  .airportInfo-content {
+    img {
+      margin: 0 auto;
+      margin-top: 10%;
+      display: -webkit-box;
+      -webkit-box-pack: center;
+      -webkit-box-align: center;
+      -webkit-box-orient: vertical;
+      text-align: center;
+    }
+    .grid-content {
+      height: 144px;
+      padding: 24px;
+      margin-bottom: 24px;
+      .title {
+        font-size: 16px;
+        font-family: Microsoft YaHei;
+        font-weight: bold;
+        color: #303133;
+        white-space: nowrap;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        max-width: 150px;
+      }
+      .edit_log {
+        position: relative;
+        // top: -2px;
+      }
+      .icon {
+        cursor: pointer;
+      }
+      .desc {
+        font-size: 14px;
+        font-family: Microsoft YaHei;
+        font-weight: 400;
+        color: #101116;
+        margin-top: 60px;
+      }
+    }
+  }
+}
+</style>

+ 17 - 0
src/views/systemSettings/views/queryTemplate/queryTemplateadd.vue

@@ -0,0 +1,17 @@
+<template>
+  <div class="queryTemplate"></div>
+</template>
+<script>
+export default {
+  data() {
+    return {};
+  },
+};
+</script>
+<style lang="scss" scoped>
+.queryTemplate {
+  height: 87vh;
+  background: #ffffff;
+  border-radius: 4px;
+}
+</style>