移动端
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.

155 lines
4.1 KiB

  1. <template>
  2. <div class="app-container">
  3. <van-nav-bar
  4. left-arrow
  5. fixed
  6. placeholder
  7. @click-left="$router.back(-1)"
  8. @click-right="goAdd"
  9. >
  10. <template #title>
  11. <p style="font-weight: bold;">农房利用情况</p>
  12. </template>
  13. <template #right>
  14. <van-icon name="add" size="18" />
  15. </template>
  16. </van-nav-bar>
  17. <van-list
  18. v-model="loading"
  19. :finished="finished"
  20. finished-text="没有更多了"
  21. @load="getList"
  22. >
  23. <van-swipe-cell v-for="(item,index) in applicationList" :key="index">
  24. <van-cell :title="item.nmfwdm" center :to="{name:'utilizationDetail', query: {id:item.id}}" >
  25. <template #icon>
  26. <van-icon name="../../../static/images/icon/icon_ly.png" size="22" color="#539FFD" style="margin-right: 10px;" />
  27. </template>
  28. <template #label>
  29. <p><b style="color: #7DDA4F;">{{item.lyzk}}</b><i style="margin-right: 0.5rem;"></i>{{item.fwzt}}<span style="float: right">{{item.dcsj}}</span></p>
  30. </template>
  31. </van-cell>
  32. <template #right>
  33. <van-row>
  34. <van-col>
  35. <van-button square text="修改" :to="{name:'utilizationModify', query: {id:item.id}}" type="info" class="delete-button" />
  36. </van-col>
  37. <van-col>
  38. <van-button square text="删除" type="danger" class="delete-button" @click="deleteList(item.id,index)" />
  39. </van-col>
  40. </van-row>
  41. </template>
  42. </van-swipe-cell>
  43. </van-list>
  44. </div>
  45. </template>
  46. <script>
  47. import { getList , nmfwlyRemove } from "@/api/onlineHome/homestead/utilization";
  48. export default {
  49. name: "utilizationList",
  50. data() {
  51. return {
  52. applicationList:[],
  53. zjdlyzkStatus:[],
  54. loading: false,
  55. finished: false,
  56. queryParams:{
  57. pageNum:1,
  58. pageSize:10,
  59. orderByColumn:'createTime',
  60. isAsc:'desc'
  61. }
  62. };
  63. },
  64. created() {
  65. this.houseGetDicts("nmfwlyzk").then((res) => {
  66. console.log(res)
  67. this.zjdlyzkStatus = res.data;
  68. });
  69. this.houseGetDicts("fwzt").then((res) => {
  70. console.log(res)
  71. this.fwztStatus = res.data;
  72. });
  73. },
  74. methods: {
  75. goAdd(){
  76. window.location = 'utilizationAdd';
  77. },
  78. getList(){
  79. setTimeout(() => {
  80. getList(this.queryParams).then(response => {
  81. console.log(response)
  82. for (var i = 0; i < response.rows.length; i++) {
  83. response.rows[i].lyzk = this.selectDictLabel(this.zjdlyzkStatus, response.rows[i].lyzk)
  84. response.rows[i].fwzt = this.selectDictLabel(this.fwztStatus, response.rows[i].fwzt)
  85. this.applicationList.push(response.rows[i]);
  86. }
  87. if(this.applicationList.length >= response.total){
  88. this.finished = true;
  89. return;
  90. }else{
  91. this.loading = false;
  92. this.queryParams.pageNum += 1 ;
  93. }
  94. });
  95. }, 1000);
  96. },
  97. deleteList(id,index){
  98. this.$dialog.confirm({
  99. message: '您确认删除申请草稿?',
  100. })
  101. .then(() => {
  102. // on confirm
  103. this.applicationList.splice(index,1)
  104. nmfwlyRemove(id).then(res => {
  105. if(res.code = 200){
  106. this.$toast.success('删除成功');
  107. }
  108. });
  109. })
  110. .catch(() => {
  111. // on cancel
  112. });
  113. }
  114. },
  115. }
  116. </script>
  117. <style scoped lang="scss">
  118. .app-container {
  119. padding: 0.2rem 3%;
  120. }
  121. /deep/.van-cell__title{
  122. flex: 1;
  123. }
  124. /deep/.van-cell__title span{
  125. font-family: Arial;
  126. font-size: 0.4rem;
  127. font-weight: normal;
  128. }
  129. /deep/.van-cell__value{
  130. flex: 0.3;
  131. color: #1D6FE9;
  132. font-weight: bold;
  133. }
  134. /deep/.van-swipe-cell{
  135. margin-bottom: 0.2rem;
  136. border-radius: 0.2rem;
  137. overflow: hidden;
  138. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  139. }
  140. /deep/van-ellipsis{
  141. font-weight: bold;
  142. }
  143. .delete-button {
  144. height: 100%;
  145. }
  146. .van-row{
  147. height: 100%;
  148. }
  149. .van-col{
  150. height: 100%;
  151. }
  152. </style>