Infsea.vue 4.47 KB
Newer Older
huangxin committed
1 2
<template>
  <div class="eibs-tab">
huangxin committed
3 4 5
<!-- ----------左 ---------->
    <c-col :span="12" class="col-left">
      <c-col :span="24">
huangxin committed
6
        <el-form-item label="国家代码" prop="cod">
huangxin committed
7
            <c-input  v-model="model.cod"  placeholder=""></c-input>
huangxin committed
8 9
        </el-form-item>
       </c-col>
huangxin committed
10
       </c-col>
huangxin committed
11

huangxin committed
12 13 14
 <!------------- 右 ---------->
 <c-col :span="12" class="col-right">
       <c-col :span="24">
huangxin committed
15 16
        <el-form-item label="国家简称" prop="txtBopcty">
            <c-input  v-model="model.txtBopcty"  placeholder=""></c-input>
huangxin committed
17 18
        </el-form-item>
       </c-col>
huangxin committed
19
       </c-col>
huangxin committed
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35

    <c-col :span="24">
      <c-col :span="12" style="text-align: left">
        <el-button type="primary" size="small" @click="ctyAdd">新增</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="onInfctySearch()"
          >查询
        </el-button>
      </c-col>
    </c-col>
huangxin committed
36 37 38


    <c-col :span="24">
huangxin committed
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
      <c-paging-table 
        :data="ctyData"
        :columns="ctyColumns"
        :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="ctyInfo(scope.$index, scope.row)"
              >详情</c-button
            >
            <c-button
              style="margin-left: 5px"
              size="small"
              type="primary"
              @click="ctyEdit(scope.$index, scope.row)"
              >修改</c-button
            >
            <c-button
              size="small"
              style="margin-left: 5px"
              @click="ctyDelete(scope.$index, scope.row)"
              >删除</c-button
            >
huangxin committed
69
            <!-- <el-popover placement="top-start" width="50" trigger="click">
huangxin committed
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
              <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>
huangxin committed
85
            </el-popover> -->
huangxin committed
86 87 88
          </template>
        </c-table-column>
      </c-paging-table>
huangxin committed
89
    </c-col>
huangxin committed
90 91 92 93 94 95 96 97 98
  </div>
</template>

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

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

export default {
huangxin committed
99
  name: "",
huangxin committed
100 101 102 103 104
  props: ["model"],
  inject: ["root"],
  data() {
    return {
      ctyData: [],
huangxin committed
105
      ctyColumns: [
huangxin committed
106 107 108 109
				{ label: '国家代码', prop: 'cod', width: 'auto' },
				{ label: '国家简称', prop: 'txtBopcty', width: 'auto' },
				{ label: '币种', prop: 'cur', width: 'auto' },
				{ label: '区域', prop: 'reg', width: 'auto' },
huangxin committed
110
			],
huangxin committed
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 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
    };
  },

  activated() {
    const { update } = this.$route.params
    if (update) {
      this.onInfctySearch()
    }
  },
  methods: {
    handleReset() {
      this.root.$refs.modelForm.resetFields();
    },
    onInfctySearch() {
			queryByPage(this.model).then(res => {
        /**
         * pageNumber: 0
         * pageSize:	0
         * total: 69
         * totalPage: 0
         */
        const list = res.list
        this.ctyData = list
        this.model.pageNum = res.pageNumber
        this.model.pageSize = res.pageSize
        this.model.total = res.total
      }) 
		},
    queryFunc(pageNumber, pageSize) {
      this.model.pageNum = pageNumber
      this.model.pageSize = pageSize
      this.onInfctySearch()
    },
    ctyAdd() {
			this.$router.push(`/statics/dbacty`)
		},
    ctyInfo(index, row) {
			this.$router.push(`/statics/dbicty/${row.inr}`)
		},
    ctyEdit(index, row) {
			this.$router.push(`/statics/dbecty/${row.inr}`)
		},
    ctyDelete(index, row) {
			this.$router.push(`/statics/dbdcty/${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>