移动端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

list_complaint.vue 7.0 KiB

2 years ago
2 years ago
3 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 months ago
2 years ago
3 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. <template>
  2. <div class="home_wrapper">
  3. <div
  4. class="header_main"
  5. :style="`background-image:url(${require(showBtn?'@/assets/images/sunVillage_info/list_head_green.png':'@/assets/images/sunVillage_info/list_head_red.png')})`"
  6. >
  7. 投诉建议
  8. <div class="return_btn" @click="onClickLeft"></div>
  9. <div class="add_btn" @click="goAdd" v-show="showBtn || isVisitor"></div>
  10. </div>
  11. <van-list
  12. v-model="loading"
  13. :finished="finished"
  14. finished-text="没有更多了"
  15. @load="getList"
  16. >
  17. <van-swipe-cell v-for="(item,index) in applicationList" :key="index" >
  18. <van-cell
  19. :border="false"
  20. center
  21. :to="{name: 'sunVillageInfoListComplaintDetail',query:{id:item.id,type:showBtn?'':'code'}}"
  22. >
  23. <template #right-icon>
  24. <p :class="{
  25. 'state1':item.advideState=='已解决',
  26. 'state2':item.advideState!='已解决',
  27. }">{{item.advideState}}</p>
  28. </template>
  29. <template #title>
  30. <p class="tit">{{item.title}}</p>
  31. <p class="time">{{item.adviceTime}}</p>
  32. <p class="dept"><van-icon name="location" color="#3977e7" />{{item.deptName}}</p>
  33. </template>
  34. <template #icon>
  35. <img src="../../assets/images/sunVillage_info/complaint_add_icon_05.png" style="width: 1.5rem;margin-right: 2%;">
  36. </template>
  37. </van-cell>
  38. <!-- <template #right v-if="showBtn">-->
  39. <!-- <div style="background-color: #ee0a24;height: 100%" @click="goRemove(item.id)">删除</div>-->
  40. <!-- <div style="background-color: #07c160" @click="goEdit(item.id)">修改</div>-->
  41. <!-- <div style="background-color: rgb(255, 166, 62);" v-if="item.status != '3'" @click="goRanking(item.id)">发布</div>-->
  42. <!-- </template>-->
  43. </van-swipe-cell>
  44. </van-list>
  45. </div>
  46. </template>
  47. <script>
  48. import { adviceList , delPoll , publicPoll } from "@/api/sunVillage_info/fixedAssets";
  49. import Cookies from "js-cookie";
  50. import request from '@/utils/request'
  51. import {Dialog} from "vant";
  52. export default {
  53. name: "certificateList",
  54. data() {
  55. return {
  56. applicationList:[],
  57. loading: false,
  58. finished: false,
  59. show: true,
  60. fileList:[],
  61. showBtn:true,
  62. queryParams:{},
  63. isVisitor: false,
  64. };
  65. },
  66. created() {
  67. if (this.$route.query.typeX!=1){
  68. if (!Cookies.get('user')){
  69. Dialog.confirm({
  70. title: '系统提示',
  71. message: '登录状态已过期,请重新登录',
  72. confirmButtonText: '重新登录',
  73. cancelButtonText: '取消'
  74. }).then(() => {
  75. this.$router.push({path:'/sunVillage_info/login_code'})
  76. })
  77. }
  78. this.queryParams = {
  79. advicePhone:JSON.parse(Cookies.get('user')).phone,
  80. translate_dict:1,
  81. }
  82. }else{
  83. this.isVisitor = true;
  84. this.showBtn = false;
  85. this.queryParams = {
  86. deptId:Cookies.get('deptId'),
  87. translate_dict:1,
  88. }
  89. }
  90. },
  91. methods: {
  92. getList(){
  93. var _this = this;
  94. adviceList(this.queryParams).then(response => {
  95. _this.listLength = response.total;
  96. response.rows.map(res=>{
  97. _this.applicationList.push(res);
  98. })
  99. if(_this.applicationList.length >= response.total){
  100. _this.finished = true;
  101. return;
  102. }else{
  103. _this.loading = false;
  104. _this.queryParams.pageNum += 1 ;
  105. }
  106. });
  107. },
  108. goAdd(){
  109. this.$router.push({path:'/sunVillage_info/list_complaint_add', query: {type: 'code'}})
  110. },
  111. goDetail(id){
  112. this.$router.push({path:'/sunVillage_info/list_vote_detail',query: {id:id}})
  113. },
  114. goEdit(id){
  115. this.$router.push({path:'/sunVillage_info/list_vote_edit',query: {id:id}})
  116. },
  117. goRanking(id){
  118. this.$dialog.alert({
  119. title: '提示',
  120. message: '确认发布?',
  121. showCancelButton:true,
  122. })
  123. .then(() => {
  124. publicPoll(id).then(response => {
  125. this.$notify({ type: 'success', message: '发布成功' });
  126. this.applicationList = [];
  127. this.getList()
  128. });
  129. })
  130. .catch(() => {
  131. // on cancel
  132. });
  133. },
  134. goRemove(id){
  135. this.$dialog.alert({
  136. title: '提示',
  137. message: '确认删除?',
  138. showCancelButton:true,
  139. })
  140. .then(() => {
  141. delPoll(id).then(response => {
  142. this.$notify({ type: 'success', message: '删除成功' });
  143. this.applicationList = [];
  144. this.getList()
  145. });
  146. })
  147. .catch(() => {
  148. // on cancel
  149. });
  150. }
  151. },
  152. }
  153. </script>
  154. <style scoped lang="scss">
  155. .home_wrapper{
  156. background: #e9e9e9;
  157. min-height: 100vh;
  158. width: 100vw;
  159. .header_main{
  160. height: 116px;
  161. background: url('../../assets/images/sunVillage_info/list_head.png') no-repeat;
  162. background-size: 100% 100%;
  163. position: fixed;
  164. top: 0;
  165. left: 0;
  166. width: 100%;
  167. font-size: 36px;
  168. line-height: 116px;
  169. text-align: center;
  170. color: #fff;
  171. position: relative;
  172. .return_btn{
  173. width: 24px;
  174. height: 43.2px;
  175. background: url('../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
  176. background-size: 20px 36px;
  177. position: absolute;
  178. left: 38px;
  179. top: 36px;
  180. }
  181. .add_btn{
  182. width: 56.4px;
  183. height: 40.8px;
  184. background: url('../../assets/images/sunVillage_info/list_icon_9.png') center center no-repeat;
  185. background-size: 47px 34px;
  186. position: absolute;
  187. right: 38px;
  188. top: 36px;
  189. }
  190. }
  191. .van-swipe-cell {
  192. position: relative;
  193. overflow: hidden;
  194. cursor: grab;
  195. width: 96%;
  196. margin: 0 auto;
  197. margin-top: 15PX;
  198. box-shadow: 5PX 5PX 2PX #ccc;
  199. border-radius: 10PX;
  200. }
  201. /deep/ .van-swipe-cell__right{
  202. display: flex;
  203. align-items: center;
  204. width: 150PX;
  205. margin-left: 5PX;
  206. a,div{
  207. margin: 0;
  208. display: flex;
  209. align-items: center;
  210. justify-content: center;
  211. color: #ffffff;
  212. font-size: 14PX;
  213. height: 100%;
  214. flex: 1;
  215. }
  216. }
  217. .tit{
  218. color: #333333;
  219. font-size: .45rem;
  220. }
  221. .time{
  222. color: #aaaaaa;
  223. font-size: .35rem;
  224. }
  225. .dept{
  226. color: #3977e7;
  227. font-size: .35rem;
  228. display: flex;
  229. align-items: center;
  230. }
  231. .state1{
  232. background: #e4f8f4;
  233. border: 1px solid #c5efe7;
  234. color: #2ec6a9;
  235. padding: 0 3vw;
  236. border-radius: 5vw;
  237. }
  238. .state2{
  239. background: #fedfe3;
  240. border: 1px solid #fcb9c2;
  241. color: #f60325;
  242. padding: 0 3vw;
  243. border-radius: 5vw;
  244. }
  245. }
  246. </style>