platform-agreement.vue
3.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
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
<style>
</style>
<template>
<div class="container resource " style="min-height: 490px;" >
<div class="pop-banner clearfix">
<form class="search-bar">
<div class="search-btn" v-on:click="getData('search')">
<input type="submit" value="搜索">
</div>
<input type="text" v-model="search.title"
placeholder="输入关键字" style="color: #373737;" v-rule>
</form>
<div class="operate-btns">
<!-- <a href="javascript:void(0)" class="fbtn fb-modify"
v-on:click="disabled=false">修改</a> -->
<a v-link="{path:'/platformAgreementEdit/0'}"
class="fbtn fb-add">添加</a>
<a href="javascript:void(0)" class="fbtn fb-remove"
v-on:click="remove()">删除</a>
<a href="javascript:;" class="fbtn fb-refresh"
v-on:click="getData('refresh')">刷新</a>
</div>
<h3 class="current-module">协议</h3>
</div>
<!--table-->
<table class="itable basic-user-info data-ind-table">
<thead>
<tr>
<th class="w70">选择</th>
<th class="w90">序号</th>
<th class="w450" style="text-align:left;">文件</th>
<th class="w150">日期</th>
<th class="w150">类型</th>
<th class="">操作</th>
</tr>
</thead>
<tbody>
<tr v-for="item in list">
<td>
<div class="checkbox-control checkbox-alone">
<input type="checkbox" id="ch_{{item.guid}}"
v-model="item.check"><!-- :disabled="disabled" -->
<label for="ch_{{item.guid}}" class="checkbox"></label>
</div>
</td>
<td>{{$index+1}}</td>
<td style="text-align:left;">{{item.title}}</td>
<td>{{item.creatdate}}</td>
<td>{{item.contenttype | ft-case "1:运营;2:金融" }}</td>
<td>
<a class="btn-d btn-d-activate"
href="#!/platformAgreementEdit/{{item.guid}}">
详情
</a>
</td>
</tr>
</tbody>
</table>
<!--end table-->
<pagination
@page-change="getData"
:class="['m-20-0']"
:page-no.sync="search.page"
:total-pages.sync="search.totalPages"></pagination>
</div>
</template>
<script>
module.exports={
data:function(){
return {
list:[
],search: {
pageSize: 10,
page: 1,
totalPages: 0,title:'' ,hptype:'AG'
},disabled:false
}
},methods:{
getData:function(casetxt){//请求数据
if(casetxt){
if( casetxt=='search' && this.search.searchtxt.length==''){
return ;
}
this.search.page=1;
}
Ajax.post('/platform/sys_helper_getList',this.search).then(function(res){
var result=res.data;
if(result.data && result.data.list){
this.$set('list',result.data.list);
this.search.totalPages = result.data.totalPages || 0;
}
}.bind(this))
},remove:function(){
if(this.disabled==true){
return ;
}
var ids=[];
var arrdel=[]
for(var i=0;i<this.list.length;i++){
if(this.list[i].check==1){
ids.push({guid:this.list[i].guid});
arrdel.push(this.list[i])
}
}
if(ids.length>0){
Ajax.post('/platform/sys_helper_delContent',
JSON.stringify(ids)).then(function(res){
var result=res.data;
if(result.errorCode==0){
this._arrremove(this.list,arrdel)
}
}.bind(this))
}
},_arrremove:function(arr,arrdel){
for(var i=0;i<arrdel.length;i++){
arr.$remove(arrdel[i])
}
}
},route:{
activate:function(){
this.getData();
}
}
}
</script>