Infsea.vue 5.95 KB
Newer Older
Wuyuqiu committed
1 2 3 4 5
<template>
  <div class="eibs-tab">
  
    <c-col :span="12" class="col-left">
      <c-col :span="24">
zhanghou committed
6
        <el-form-item label="费用代码" prop="cod">
Wuyuqiu committed
7 8
            <c-input
                v-model="model.cod"
zhanghou committed
9
                placeholder="请输入费用代码"
Wuyuqiu committed
10 11 12 13 14 15 16 17 18 19
                style="width: 100%"
            >
            </c-input>
        </el-form-item>
    </c-col>
    </c-col>

      
      <c-col :span="12" class="col-right">
        <c-col :span="24">
zhanghou committed
20
          <el-form-item label="名称" prop="nam">
Wuyuqiu committed
21 22
            <c-input
                v-model="model.nam"
zhanghou committed
23
                placeholder="请输入名称"
Wuyuqiu committed
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
                style="width: 100%"
            >
            </c-input>
        </el-form-item>
        </c-col>
      </c-col>

    <c-col :span="24">
      <c-col :span="12" style="text-align: left">
        <el-button type="primary" size="small" @click="feeAdd">新增</el-button>
      </c-col>
      <c-col :span="12" style="text-align: right">
        <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>
    <c-col :span="24">
      <c-paging-table 
        :data="feeData"
        :columns="feeColumns"
        :pageNumber="model.pageNum"
        :pageSize="model.pageSize"
        :total="model.total"
        v-on:queryFunc="queryFunc"
        :border="true"
      >
        <c-table-column fixed="right" prop="op" label="操作" width="240px">
          <template slot-scope="{ scope }">
            <c-button
              style="margin-left: 0"
              size="small"
              @click="feeInfo(scope.$index, scope.row)"
              >详情</c-button
            >
            <c-button
              style="margin-left: 5px"
              size="small"
              type="primary"
              @click="feeEdit(scope.$index, scope.row)"
              >修改</c-button
            >
            <c-button
              size="small"
              style="margin-left: 5px"
              @click="feeDelete(scope.$index, scope.row)"
              >删除</c-button
            >
            <el-popover placement="top-start" width="50" trigger="click">
              <ul class="table-button-item-list">
                <li>
                  <c-button size="small" style="margin-left: 0">指派</c-button>
                </li>
                <li>
                  <c-button size="small" style="margin-left: 0">删除</c-button>
                </li>
              </ul>
              <a
                slot="reference"
                href="javascript:void(0)"
                style="margin-left: 5px"
              >
                <i class="el-icon-more"></i>
              </a>
            </el-popover>
          </template>
        </c-table-column>
      </c-paging-table>
    </c-col>
  </div>
</template>

<script>
import codes from "~/config/CodeTable";

import { queryByPage } from "~/service/test/fee.js";

export default {
  name: "",
  props: ["model"],
  inject: ["root"],
  data() {
    return {
      feeData: [],
      feeColumns: [
zhanghou committed
114 115
				{ label: '费用代码', prop: 'cod', width: '120' },
        { label: '名称', prop: 'descrp', width: '120' },
116 117
				{ label: '计算费用相关的金额类型', prop: 'reltir', width: '190' },
				{ label: 'SWIFT报文费用代码', prop: 'sftcod', width: '170' },
zhanghou committed
118 119
        { label: 'DTA报文中的费用代码', prop: 'dtacod', width: '170' },
				{ label: '统计标志', prop: 'staflg', width: '120' },
120 121
				{ label: '默认付费角色', prop: 'rol', width: '170' },
        { label: '费用账号', prop: 'acc', width: '120' }
Wuyuqiu committed
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
			],
    };
  },
  computed: {
  },
  activated() {
    const { update } = this.$route.params
    if (update) {
      this.onInffeeSearch()
    }
  },
  methods: {
    handleReset() {
      this.root.$refs.modelForm.resetFields();
    },
    onSearch(){
        this.model.pageNum = 1;
        this.model.pageSize = 5;
        this.onInffeeSearch();
    },
    onInffeeSearch() {
      var objectArr = codes['fepfeecod'];
      var map = new Map();
      for(let i =0;i<objectArr.length;i++){
        map.set(objectArr[i].value,objectArr[i].label);
      }
      var feeList = [];
zhanghou committed
149 150 151 152 153 154 155 156 157
      if(!this.model.cod&&this.model.nam){
        for(var fee of map){
        if(fee[1].includes(this.model.nam)){
            feeList.push(fee[0])
          }
        }
      }
      if(this.model.cod&&this.model.nam){
        for(var fee of map){
Wuyuqiu committed
158 159 160
        if(fee[0].includes(this.model.cod)&&fee[1].includes(this.model.nam)){
            feeList.push(fee[0])
          }
zhanghou committed
161
        }
Wuyuqiu committed
162 163
      }
      this.model.feelist = feeList;
164
      this.model.etgextkey = 'CEBGRP';
Wuyuqiu committed
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179
			queryByPage(this.model).then(res => {
        /**
         * pageNumber: 0
         * pageSize:	0
         * total: 69
         * totalPage: 0
         */
      const list = res.list;
      this.feeData = list;
      for(let i =0;i<list.length;i++){
        this.feeData[i].descrp = map.get(this.feeData[i].cod)
      }
        this.model.pageNum = res.pageNumber
        this.model.pageSize = res.pageSize
        this.model.total = res.total
zhanghou committed
180
        this.model.feelist=[];
Wuyuqiu committed
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221
      }) 
		},
    queryFunc(pageNumber, pageSize) {
      this.model.pageNum = pageNumber
      this.model.pageSize = pageSize
      this.onInffeeSearch()
    },
    feetypeChange(val) {
      this.model.feetyp = val;
    },
    getCodesByKey(key) {
      return codes[key] ?? [];
    },
    feeAdd() {
			this.$router.push(`/statics/dbafee`)
		},
    feeInfo(index, row) {
			this.$router.push(`/statics/dbifee/${row.inr}`)
		},
    feeEdit(index, row) {
			this.$router.push(`/statics/dbefee/${row.inr}`)
		},
    feeDelete(index, row) {
			this.$router.push(`/statics/dbdfee/${row.inr}`)
		},
  },
};
</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>