Infsea.vue 6.13 KB
Newer Older
1 2 3 4 5
<template>
  <div class="eibs-tab">
    <!-- ----------左 ---------->
    <c-col :span="12" class="col-left">
      <c-col :span="24">
hewei committed
6 7
        <el-form-item label="货币种类" prop="cod">
          <c-input v-model="model.cod" placeholder="请输入货币种类" style="width: 100%">
nanrui committed
8
          </c-input>
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
        </el-form-item>
      </c-col>
    </c-col>
    <!------------- 右 ---------->
    <c-col :span="12" class="col-right">
      <c-col :span="24">
        <el-form-item label="货币描述" prop="cod">
          <c-select v-model="model.seanam" placeholder="请输入货币描述" style="width: 100%">
          </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>
hewei committed
24
      <el-button type="primary" icon="el-icon-search" size="small" @click="onSearch()">查询
25 26 27
      </el-button>
    </c-col>

nanrui committed
28 29 30 31
    <c-col :span="24" style="margin-top: 10px">
      <c-button class="medium_bcs" size="medium" style="margin-left: 0px" type="primary" @click="toBbacur">添加货币</c-button>
    </c-col>

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
    <c-col :span="24">
      <c-paging-table :data="curData" :columns="curColumns" :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="curInfo(scope.$index, scope.row)">详情</c-button>
            <c-button style="margin-left: 5px" size="small" type="primary" @click="curEdit(scope.$index, scope.row)">修改
            </c-button>
            <c-button size="small" style="margin-left: 5px" @click="curDelete(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";

nanrui committed
64
import { queryByPage, deleteById } from "~/service/test/cur.js";
65 66 67 68 69 70 71 72 73

export default {
  name: "",
  props: ["model"],
  inject: ["root"],
  data() {
    return {
      curData: [],
      curColumns: [
zhouqian committed
74 75
        { label: '货币', prop: 'cod', width: 'auto' },
        { label: '描述', prop: 'seanam', width: 'auto' },
76 77 78
      ],
    };
  },
hewei committed
79 80 81 82 83 84
  activated() {
    const { update } = this.$route.params
    if (update) {
      this.onSearch();
    }
  },
85
  methods: {
nanrui committed
86
    toBbacur(){
hewei committed
87
      this.$router.push("/statics/dbacur");
nanrui committed
88
    },
hewei committed
89 90 91
    // handleReset() {
    //   this.root.$refs.modelForm.resetFields();
    // },
xionglin committed
92
  async handleReset() {
93 94 95
      this.model.cod = ""
      this.model.seanam = ""
    },
hewei committed
96 97 98 99 100
    onSearch() {
      this.model.pageSize = 5;
      this.model.pageNum = 1;
      this.onInfcurSearch();
    },
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
    onInfcurSearch() {
      queryByPage(this.model).then(res => {
        /**
         * pageNumber: 0
         * pageSize:	0
         * total: 69
         * totalPage: 0
         */
        const list = res.list
        this.curData = list
        this.model.pageNum = res.pageNumber
        this.model.pageSize = res.pageSize
        this.model.total = res.total
      })
    },
116 117 118 119 120 121 122 123 124 125 126 127
    // async onInfbutSearow() {
    //   let rtnmsg = await this.executeRule("infbut.searow")
    //   if (rtnmsg.respCode == SUCCESS) {
    //     console.log(rtnmsg.data);
    //     //TODO 处理数据逻辑
    //     this.updateModel(rtnmsg.data);
    //     this.stmData.data = rtnmsg.data.infbut_dspstm.rows;
    //   }
    //   else {
    //     this.$notify.error({ title: '错误', message: '服务请求失败!' });
    //   }
    // },
128 129 130
    queryFunc(pageNumber, pageSize) {
      this.model.pageNum = pageNumber
      this.model.pageSize = pageSize
131
      // console.log(this.model);
132 133
      this.onInfcurSearch()
    },
134 135 136
    // curtypeChange(val) {
    //   this.model.curtyp = val;
    // },
137 138 139 140
    getCodesByKey(key) {
      return codes[key] ?? [];
    },
    curInfo(index, row) {
nanrui committed
141
      // console.log(row);
142 143 144
      this.$router.push(`/statics/dbicur/${row.inr}`)
    },
    curEdit(index, row) {
145
      this.$router.push(`/statics/dbecur/${row.inr}`);
146
    },
nanrui committed
147 148 149
    // curDelete(index, row) {
    //   this.$router.push(`/statics/dbdcur/${row.inr}`)
    // },
hewei committed
150
    //进行删除统一化
nanrui committed
151
    curDelete(idx, row) {
hewei committed
152
      this.$router.push(`/statics/dbdcur/${row.inr}`)
nanrui committed
153
    },
hewei committed
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181
    // curDelete(idx, row) {
    //   this.$confirm("是否确认删除?", "提示", {
    //     confirmButtonText: "确定",
    //     cancelButtonText: "取消",
    //     type: "warning",
    //   })
    //     .then(() => {
    //       let paramsData = { };
    //       paramsData.inr = row.inr;
    //       deleteById(paramsData)
    //         .then((res) => {
    //           console.log(res);
    //           this.$message.success("删除成功!");
    //           this.onInfcurSearch();
    //           // this.onSearch();
    //           // this.goBack(true)
    //         })
    //         .catch((err) => {
    //           console.log(err);
    //           this.$message.error("删除失败!");
    //         });
    //     }).catch(() => {
    //       this.$message({
    //         type: "info",
    //         message: "已取消删除",
    //       });
    //     });
    // },
nanrui committed
182 183 184
    goBack(update) {
      this.$store.dispatch("TagsView/delView", this.$route);
      this.$router.push({ name: "StaticsInfcur", params: { update } });
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203
    },
  },
};
</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>