123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356 |
- <!--
- * @Author: your name
- * @Date: 2021-11-17 13:43:58
- * @LastEditTime: 2022-06-12 00:04:05
- * @LastEditors: your name
- * @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">
- <DataTable tableHeight="700" :data-id="dataId" :rows="12" labelWidth="100px" :min-height="70" width="800px" is-statuser show-overflow-tooltip with-column-set with-preview @handleAdd="handleAdd" @handleEdit="handleEdit" @preview="handlePreview">
- <template v-slot:header>
- <div class="status flex-wrap">
- <div class="manageTitle">查询模板</div>
- </div>
- </template>
- </DataTable>
- <!--搜索-->
- <!-- <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.queryTemplateName"
- placement="bottom"
- >
- <div class="title">{{ item.queryTemplateName }}</div>
- </el-tooltip>
- <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.queryTemplateDescribe }}</div>
- </div>
- </el-col>
- </el-row>
- </div> -->
- <!--删除弹框-->
- <Dialog :flag="flag">
- <div class="airportInfoDialog">
- <div class="del-title">删除分类信息</div>
- <div class="content er">
- <div class="log" />
- 是否确认删除
- <p style="color: #eb2f3b; margin-top: 0px; margin-bottom: 0px">
- {{ rmObj.name }}
- </p>
- ?
- </div>
- <div class="DelFoot right t30">
- <el-button size="medium" class="r25 buwitch" type="danger" @click="remove()">删除</el-button>
- <el-button size="medium" class="r26" @click="flag = false">取消</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 } from '@/api/SystemSettings'
- import {
- exceptiontype,
- exceptionadd,
- // exceptiondel
- } from "@/api/acquisition";
- import { GeneralDataReception, Query } from "@/api/dataIntegration";
- import DataTable from "@/components/Table";
- export default {
- name: "AirportInfo",
- components: {
- // Search,
- Dialog,
- DataTable,
- },
- data () {
- return {
- dataId: DATACONTENT_ID.sysQueryTabId,
- arr: [
- {
- typeName: "名称",
- typeCode: "测试",
- },
- ], // 内容数据
- flag: false, // 删除弹框开关
- addFlag: false, // 新增机场信息弹框开关
- EditFlag: false,
- ids: null,
- idss: null,
- listDate: {},
- 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: "",
- };
- },
- 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;
- },
- },
- created () {
- // this.getAirlines();
- // this.exceptionlist();
- },
- methods: {
- // 异常列表查询
- async exceptionlist () {
- const params = {
- id: "",
- };
- const result = await exceptiontype(params);
- if (Number(result.code) === 0) {
- this.arr = result.returnData;
- }
- },
- // 搜索
- getSearchData (val) {
- const that = this;
- that.exceptionlist().then(function (data) {
- if (val) {
- that.arr = findarrays(that.arr, "typeName", val);
- } else {
- that.exceptionlist();
- }
- });
- //
- },
- // 删除信息
- handleMove (item) {
- this.listDate = item;
- this.flag = true;
- this.rmObj = {
- name: item.queryTemplateName,
- };
- },
- async EditSubmit () {
- let arr = 0;
- this.$refs["ruleFormall"].validate((valid) => {
- if (valid) {
- arr = 1;
- } else {
- arr = 0;
- return false;
- }
- });
- if (arr === 1) {
- const params = {
- id: this.modid.id,
- typeName: this.EditForm.name,
- typeCode: this.EditForm.fullName,
- };
- const result = await exceptionadd(params);
- if (Number(result.code) === 0) {
- this.$message.success("成功");
- this.exceptionlist();
- this.$refs.ruleFormall.resetFields();
- }
- this.EditFlag = false;
- }
- },
- closeForm () {
- this.$refs.ruleForm.resetFields();
- },
- // 获取模板列表
- async getAirlines () {
- try {
- const res = await Query({
- id: 77,
- dataContent: [],
- });
- if (res.code === "0") {
- this.arr = res.returnData;
- } else {
- this.$message.error(res.message ?? "失败");
- }
- } catch (error) {
- this.$message.error("失败");
- }
- },
- // 新增机场信息-弹框
- handleAdd () {
- this.$router.push("/systemSettings/queryTemplateadd");
- },
- // 新增机场信息-弹框
- handleEdit (item) {
- // this.modid = item;
- // this.EditForm.name = item.typeName;
- // this.EditForm.fullName = item.typeCode;
- this.$router.push({
- path: "/systemSettings/queryTemplateedit",
- query: { queryTemplateID: item.queryTemplateID },
- });
- // this.EditForm.code = item.code2;
- // this.EditFlag = true;
- },
- // 新增机场信息-弹框-取消
- resetForm () {
- this.addFlag = false;
- this.EditFlag = false;
- this.ruleForm.name = "";
- this.ruleForm.fullName = "";
- this.$refs.ruleForms.resetFields();
- this.$refs.ruleFormall.resetFields();
- },
- // 删除
- async remove (data) {
- this.listDate.operate = "3";
- try {
- const res = await GeneralDataReception({
- serviceId: 5,
- dataContent: JSON.stringify(this.listDate),
- });
- if (res.code === "0") {
- this.$message.success(res.message ?? "成功");
- this.flag = false;
- this.listDate = {};
- this.getAirlines();
- } else {
- this.$message.error(res.message ?? "失败");
- }
- } catch (error) {
- this.$message.error("失败");
- }
- },
- // 查询模板预览
- handlePreview ({ queryTemplateID, queryTemplateName }) {
- this.$router.push({
- path: '/systemSettings/queryTemplatePreview',
- query: {
- queryTemplateID,
- queryTemplateName
- }
- })
- }
- },
- };
- </script>
- <style lang="scss" scoped>
- .airportInfo {
- ::v-deep .el-form-item {
- margin-bottom: 20px;
- }
- .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>
|