Commit 573c634b by WF1020

分页功能优化

parent 4fb4f2ea
...@@ -23,11 +23,11 @@ export default { ...@@ -23,11 +23,11 @@ export default {
pageIndex: this.pagination.pageIndex, pageIndex: this.pagination.pageIndex,
pageSize: this.pagination.pageSize pageSize: this.pagination.pageSize
}; };
let rtnmsg = await Api.post('/service/infgid', params); let rtnmsg = await Api.post('/service/infgid/getList', params);
if (rtnmsg.respCode == SUCCESS) { if (rtnmsg.respCode == SUCCESS) {
this.stmData.data = []; this.stmData.data = [];
this.stmData.data = rtnmsg.data; this.stmData.data = rtnmsg.data.list;
// this.pagination.total = this.stmData.data.total this.pagination.total = rtnmsg.data.total
} else { } else {
this.$notify.error({ title: '错误', message: '服务请求失败!' }); this.$notify.error({ title: '错误', message: '服务请求失败!' });
} }
......
...@@ -31,12 +31,15 @@ export default { ...@@ -31,12 +31,15 @@ export default {
...this.model, ...this.model,
sourceList: this.sourceList, sourceList: this.sourceList,
userId: window.sessionStorage.userId || 'ZL', userId: window.sessionStorage.userId || 'ZL',
pageSize: this.pagination.pageSize,
pageNo: this.pagination.pageIndex,
inidatfro: moment(this.model.inidatfro).format('YYYY-MM-DD'), inidatfro: moment(this.model.inidatfro).format('YYYY-MM-DD'),
inidattil: moment(this.model.inidattil).format('YYYY-MM-DD'), inidattil: moment(this.model.inidattil).format('YYYY-MM-DD'),
}; };
const res = await Api.post('/service/sptsel/list', params); const res = await Api.post('/service/sptsel/list', params);
if (res.respCode === SUCCESS) { if (res.respCode === SUCCESS) {
this.stmData.data = res.data.sptselVos; this.stmData.data = res.data.records;
this.pagination.total = res.data.total;
this.$store.commit('setTaskList', { this.$store.commit('setTaskList', {
key: 'sptsel', key: 'sptsel',
val: this.stmData.data.length, val: this.stmData.data.length,
...@@ -44,8 +47,8 @@ export default { ...@@ -44,8 +47,8 @@ export default {
} }
}, },
async onDetails(idx, row) { async onDetails(idx, row) {
let id = row.id; let inr = row.inr;
this.$router.push({ path: 'business-new/sptpopup', query: { id: id || 'text'} }); this.$router.push({ path: 'business-new/sptpopup', query: { inr: inr } });
}, },
async continueEdit(row, scope) { async continueEdit(row, scope) {
//let rtnmsg = await Api.post("getPendingData",{params:{'selsptinr':row[0]}}) //let rtnmsg = await Api.post("getPendingData",{params:{'selsptinr':row[0]}})
...@@ -70,5 +73,18 @@ export default { ...@@ -70,5 +73,18 @@ export default {
// this.$notify.error({ title: '错误', message: '服务请求失败!' }); // this.$notify.error({ title: '错误', message: '服务请求失败!' });
// } // }
}, },
// pageSize改变
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
this.pagination.pageIndex = 1;
this.pagination.pageSize = val;
this.handleSearch();
},
// 页码改变
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
this.pagination.pageIndex = val;
this.handleSearch();
},
}, },
}; };
...@@ -127,6 +127,18 @@ ...@@ -127,6 +127,18 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination-box">
<el-pagination
style="margin-right: 30px;"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="pagination.pageIndex"
:page-sizes="[10, 20, 50, 100, 500]"
:page-size="pagination.pageSize"
layout="sizes, prev, pager, next"
:total="pagination.total">
</el-pagination>
</div>
</c-col> </c-col>
<el-dialog :visible.sync="initdialog" :title="'交易列表'" append-to-body> <el-dialog :visible.sync="initdialog" :title="'交易列表'" append-to-body>
<div class="m-list-btns"></div> <div class="m-list-btns"></div>
...@@ -157,6 +169,7 @@ export default { ...@@ -157,6 +169,7 @@ export default {
earnCount: 0, earnCount: 0,
earnAmt: 0, earnAmt: 0,
}, },
//以下是表格内容
stmData: { stmData: {
columns: [ columns: [
{ {
...@@ -179,9 +192,34 @@ export default { ...@@ -179,9 +192,34 @@ export default {
label: '创建时间', label: '创建时间',
prop: 'dattim' prop: 'dattim'
}, },
{
label: '银行名称',
prop: 'bchname'
},
{
label: '报文类型',
prop: 'msgType'
},
{
label: '对方银行BIC',
prop: 'sndkey'
},
{
label: '币种',
prop: 'relcur'
},
{
label: '金额',
prop: 'relAmt'
},
], ],
data: [], data: [],
}, },
pagination: {
pageIndex: 1,
pageSize: 10,
total: 0
},
}; };
}, },
async mounted() { async mounted() {
...@@ -241,4 +279,14 @@ c-istream-table label { ...@@ -241,4 +279,14 @@ c-istream-table label {
text-align: right; text-align: right;
color: yellow; color: yellow;
} }
.pagination-box {
width: 100%;
height: 30px;
display: flex;
align-items: center;
justify-content: flex-end;
padding: 0 10px;
background: #fff;
margin-top: 5px;
}
</style> </style>
...@@ -202,7 +202,7 @@ ...@@ -202,7 +202,7 @@
</c-col> </c-col>
<c-col :span="24" style=""> <c-col :span="24" style="">
<!-- <el-form-item label-width="500px"> --> <!-- <el-form-item label-width="500px"> -->
<c-table :paginationShow="false" :border="true"> <el-table :paginationShow="false" :border="true" :data="msgInfoTableData">
<el-table-column <el-table-column
label="编号" label="编号"
prop="groseq" prop="groseq"
...@@ -280,9 +280,9 @@ ...@@ -280,9 +280,9 @@
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
label="状态" label="状态"
prop="staflg"
width="auto" width="auto"
></el-table-column> >
</el-table-column>
<el-table-column <el-table-column
label="F20" label="F20"
prop="f20" prop="f20"
...@@ -293,7 +293,7 @@ ...@@ -293,7 +293,7 @@
prop="spt" prop="spt"
width="auto" width="auto"
></el-table-column> ></el-table-column>
</c-table> </el-table>
<!-- </el-form-item> --> <!-- </el-form-item> -->
</c-col> </c-col>
<c-col :span="24" style="height:24px;margin-top:20px"> <c-col :span="24" style="height:24px;margin-top:20px">
...@@ -314,7 +314,14 @@ ...@@ -314,7 +314,14 @@
:key="key" :key="key"
:label="item.label" :label="item.label"
:prop="item.prop" :prop="item.prop"
></el-table-column> >
<template slot-scope="scope">
<div v-if="item.prop === 'typ'">
<div v-if="scope.row[item.prop]"> {{ transactionCode(scope.row) }}</div>
</div>
<div v-else>{{ scope.row[item.prop] }}</div>
</template>
</el-table-column>
</el-table> </el-table>
</c-col> </c-col>
</el-form> </el-form>
...@@ -327,6 +334,7 @@ ...@@ -327,6 +334,7 @@
import Sptsel from "../model/sptpopup.js"; import Sptsel from "../model/sptpopup.js";
import event from '../event'; import event from '../event';
import CodeTable from "~/config/CodeTable"; import CodeTable from "~/config/CodeTable";
import Api from '~/service/Api';
export default { export default {
mixins: [event], mixins: [event],
data() { data() {
...@@ -334,19 +342,112 @@ export default { ...@@ -334,19 +342,112 @@ export default {
model: new Sptsel().data, model: new Sptsel().data,
codes:{ hldflg: CodeTable.hldflg ,...CodeTable}, codes:{ hldflg: CodeTable.hldflg ,...CodeTable},
trnName:"sptsel", trnName:"sptsel",
msgInfoTableData: [],
stmData:{ stmData:{
columns:[], columns: [
{
label: '开始时间',
prop: 'begdattim'
},
{
label: '类型',
prop: 'typ'
},
{
label: '用户',
prop: 'USR'
},
{
label: '交易代码',
prop: 'FRM'
},
{
label: '结束时间',
prop: 'ENDDATTIM'
},
{
label: '文本',
prop: 'ROUTXT'
},
],
data:[], data:[],
} },
}; };
}, },
mounted() { mounted() {
this.loadData(); this.loadData();
}, },
methods: { methods: {
loadData() { transactionCode(row){
const TYP = row.typ;
let typ = '';
switch(TYP) {
case 'CRE':
typ = '订单等待'
break;
case 'TRN':
typ = '等待'
break;
case 'COR':
typ = '修改'
break;
case 'DEL':
typ = '删除'
break;
case 'FIN':
typ = '确认'
break;
case 'CAN':
typ = '订单取消'
break;
case 'REL':
typ = '确认'
break;
case 'DES':
typ = '订单删除'
break;
case 'BRK':
typ = '暂停'
break;
case 'INC':
typ = '报文接受'
break;
case 'SPT':
typ = '订单确认'
break;
case 'SIG':
typ = '复核'
break;
case 'CMB':
typ = '订单暂停'
break;
case 'CTR':
typ = '总行退回'
break;
case 'CMR':
typ = '订单修改'
break;
case 'ROU':
typ = '重新路由'
break;
default:
return;
}
return typ;
},
async loadData() {
let routeQuery = this.$route.query let routeQuery = this.$route.query
console.log('111', routeQuery) const params = {
//根据inr 查询详情表的数据
// selsptinr: routeQuery.inr
selsptinr: '00006885'
}
const res = await Api.post('/service/sptsel/detail', params);
if (res.respCode === SUCCESS) {
this.$set(this.model, 'spt', res.data.spt)
this.msgInfoTableData = [res.data.smh]
this.stmData.data = res.data.oreList
}
}, },
exit() { exit() {
this.$store.dispatch("TagsView/delView", this.$route); this.$store.dispatch("TagsView/delView", this.$route);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment