添加请求接口

master
yujialong 3 years ago
parent 86308ff643
commit b50840c6fe
  1. 87
      src/views/List.vue

@ -10,7 +10,7 @@
<div class="footer"> <div class="footer">
<div class="flex-end"> <div class="flex-end">
<div> <div>
<el-input placeholder="请输入判分点名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input> <el-input placeholder="请输入判分点名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</div> </div>
</div> </div>
<div class="flex footer_h"> <div class="flex footer_h">
@ -24,11 +24,11 @@
<el-col :span="24"> <el-col :span="24">
<el-card shadow="hover"> <el-card shadow="hover">
<el-table <el-table
:data="tableData" :data="tableData"
:cell-style="rowClass" :cell-style="rowClass"
:header-cell-style="headClass" :header-cell-style="headClass"
:stripe="true" :stripe="true"
header-align="center" header-align="center"
> >
<el-table-column type="index" label="序号" align="center"> <el-table-column type="index" label="序号" align="center">
<template slot-scope="scope">{{scope.$index + (pageNo - 1) * pageSize + 1}}</template> <template slot-scope="scope">{{scope.$index + (pageNo - 1) * pageSize + 1}}</template>
@ -54,12 +54,12 @@
<!-- 分页 --> <!-- 分页 -->
<div class="block"> <div class="block">
<el-pagination <el-pagination
background background
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page="pageNo" :current-page="pageNo"
:page-size="10" :page-size="10"
layout="total,prev, pager, next, jumper" layout="total,prev, pager, next, jumper"
:total="dataTotal" :total="dataTotal"
></el-pagination> ></el-pagination>
</div> </div>
</div> </div>
@ -91,10 +91,10 @@ export default {
components: {quill}, components: {quill},
watch: { watch: {
keyword: function(val) { keyword: function(val) {
clearTimeout(this.searchTimer) clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.handleCurrentChange(this.pageNo) this.handleCurrentChange(this.pageNo)
},500) },500)
}, },
}, },
mounted() { mounted() {
@ -128,13 +128,13 @@ export default {
userIdList: res.message.retvalue.join() userIdList: res.message.retvalue.join()
} }
this.$get(this.api.queryListTrading,data) this.$get(this.api.queryListTrading,data)
.then(res => { .then(res => {
this.tableData = res.message.rows this.tableData = res.message.rows
this.dataTotal = res.message.total this.dataTotal = res.message.total
}) })
.catch(err => { .catch(err => {
console.log(err); console.log(err);
}); });
}).catch(res => {}) }).catch(res => {})
}, },
// setCookie(name, value) { // setCookie(name, value) {
@ -198,33 +198,30 @@ export default {
type: "warning", type: "warning",
center: true center: true
}) })
.then(() => { .then(() => {
let data = [row.id] let data = [row.id]
this.$post(`${this.api.deleteTrading}`,data) this.$post(`${this.api.deleteTrading}`,data)
.then(res => { .then(res => {
this.handleCurrentChange(this.pageNo); this.handleCurrentChange(this.pageNo);
}) })
.catch(err => { .catch(err => {
console.log(err); console.log(err);
});
this.$message({
type: "success",
message: "删除成功!"
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除"
}); });
this.$message({
type: "success",
message: "删除成功!"
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除"
}); });
});
}, },
// //
handleClick(res) { handleClick(res) {
if (this.systemId == 11) { if(this.systemId == 2){
//
this.$router.push(`transaction?systemId=${this.systemId}&userId=${this.userId}&id=${res.id}`);
} else if(this.systemId == 2){
this.$router.push(`programOption?systemId=${this.systemId}&userId=${this.userId}&id=${res.id}`); this.$router.push(`programOption?systemId=${this.systemId}&userId=${this.userId}&id=${res.id}`);
}else{ }else{
this.$router.push(`programOptions?systemId=${this.systemId}&userId=${this.userId}&id=${res.id}&pattern=${this.pattern}`); this.$router.push(`programOptions?systemId=${this.systemId}&userId=${this.userId}&id=${res.id}&pattern=${this.pattern}`);

Loading…
Cancel
Save