Inffrm.vue 4.19 KB
Newer Older
fukai committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
<template>
  <div class="eibs-tab">
    <c-col :span="12" class="col-left">
      <c-col :span="24">
        <el-form-item label="银行BIC">
            <c-input  v-model="model.biccod"  placeholder="" @change="BicRul"></c-input>
        </el-form-item>
      </c-col>
    </c-col>
 <!------------- 右 ---------->
    <c-col :span="12" class="col-right">
       <c-col :span="24">
        <el-form-item label="报文类型">
            <c-select v-model="model.msgtyp"  placeholder="" dbCode="GSPMSG"></c-select>
        </el-form-item>
       </c-col>
    </c-col>
    
    <c-col :span="12" class="col-left">
      <c-col :span="24">
        <el-form-item label="渠道信息">
            <c-select  v-model="model.chl"  placeholder="" :code="getCodesByKey('gimchl')"></c-select>
        </el-form-item>
      </c-col>
    </c-col>

    <c-col :span="24" style="text-align: right; height: 36.8px">
      <el-button size="small" @click="handleReset">重置</el-button>
      <el-button type="primary" icon="el-icon-search" size="small" @click="onSearch()">查询
      </el-button>
    </c-col>

    <c-col :span="24">
      <c-paging-table :data="gimgseData" :columns="gimgseColumns" :pageNumber="model.pageNum" :pageSize="model.pageSize"
        :total="model.total" v-on:queryFunc="queryFunc" :border="false" ref="tablelist">
      </c-paging-table>
    </c-col>
  </div>
</template>

<script>
import { queryByPage } from "~/service/manage/gimgse.js";
import Gimgse, { Pattern } from "./Gimgse.js";
import commonFunctions from '~/mixin/commonFunctions.js';
import codes from "~/config/CodeTable";

export default {
  props: ["data"],
  inject: ["root"],
  mixins: [commonFunctions],
  data() {
    return {
      rules:Pattern,
      model: new Gimgse().data,
      gimgseData: [],
      gimgseColumns: [
        { label: '银行BIC', prop: 'biccod', width: 'auto' },
        { label: '银行状态', prop: 'bnksta', width: 'auto' },
        { label: '报文类型', prop: 'msgtyp', width: 'auto' },
        { label: '银行BIC(前8位)', prop: 'biccod8', width: 'auto' },
        { label: '银行状态(前8位)', prop: 'bnksta8', width: 'auto' },
        { label: '可发送标志', prop: 'stscod', width: 'auto' },
        { label: '是否可发送', prop: 'issend', width: 'auto' },
      ],
    };
  },
  created() {
    // this.onInffrmSearch();
  },
  methods: {
    handleReset() {
        this.model.biccod = "";
        this.model.msgtyp = "";
    },
    onSearch() {
      this.model.pageSize=PageSize;
      this.model.pageNum = 1;
      if (this.model.chl == ""){
        this.$notify.error("渠道信息必填");
        return;
      }
      if (this.model.biccod != "") {
          if(this.model.biccod.length > 0 && this.model.biccod.length < 8) {
            this.$notify.error("行号至少输入8位");
          } else if(this.model.biccod.length > 11) {
            this.$notify.error("行号不得超过11位");
          } else {
            this.onInffrmSearch();
          }
      } else if(this.model.biccod == "") {
        this.onInffrmSearch();
      }
    },
    BicRul() {
      this.model.biccod = this.model.biccod.toUpperCase();
      if (this.model.biccod != "") {
          if(this.model.biccod.length > 0 && this.model.biccod.length < 8) {
            this.$notify.error("行号至少输入8位");
          }
        } 
    },
    onInffrmSearch() {
      const loading = this.loading();
      queryByPage(this.model).then(res => {
        if(res.respCode == SUCCESS) {
        const list = res.data.list
        this.gimgseData = list
        this.model.pageNum = res.data.pageNumber
        this.model.pageSize = res.data.pageSize
        this.model.total = res.data.total
        } else {
          this.$notify.error("列表查询失败");
        }
      })
      loading.close();
    },
    queryFunc(pageNumber, pageSize) {
      this.model.pageNum = pageNumber
      this.model.pageSize = pageSize
      this.onInffrmSearch()
    },

    getCodesByKey(key) {
      return codes[key] || [];
    },
  },
};
</script>

<style scoped>
.table-button-item-list {
  padding: 0;
  margin: 0;
}

.table-button-item-list li {
  list-style: none;
  padding: 5px 0;
  text-align: center;
  color: #606266;
  cursor: pointer;
}
</style>