移动端
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

184 rader
5.2 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.shyqrdm" :value="item.auditStatus" center :to="{name:'circulationDetail', query: {id:item.id}}">
  25. <template #icon>
  26. <van-icon name="../../../static/images/onlineHome/icon_zjd2.png" size="30" color="#539FFD" style="margin-right: 10px;" />
  27. </template>
  28. <template #label>
  29. <p><b style="color: #FFA63E;">{{item.lzfs}}</b><i style="margin-right: 0.5rem;"></i><b style="color: #333333;">{{item.zrfdbmc}}</b><i style="margin-right: 0.5rem;"></i>{{item.lzmj}}㎡</p>
  30. </template>
  31. </van-cell>
  32. <template #right>
  33. <van-row>
  34. <van-col>
  35. <van-button square text="修改" type="info" v-if="item.auditStatus=='草稿'" class="delete-button" :to="{name:'circulationModify', query: {id:item.id}}" />
  36. </van-col>
  37. <van-col>
  38. <van-button square text="提交" type="primary" v-if="item.auditStatus=='草稿'" class="delete-button" @click="submit(item)" />
  39. </van-col>
  40. <van-col>
  41. <van-button square text="删除" type="danger" v-if="item.auditStatus=='草稿'" @click="deleteList(item.id,index)" class="delete-button" />
  42. </van-col>
  43. </van-row>
  44. </template>
  45. </van-swipe-cell>
  46. </van-list>
  47. </div>
  48. </template>
  49. <script>
  50. import { getList , removeList, goApply } from "@/api/onlineHome/homestead/circulation";
  51. export default {
  52. name: "circulationList",
  53. data() {
  54. return {
  55. applicationList:[],
  56. houseApplyStatus:[],
  57. auditStatus:[],
  58. loading: false,
  59. finished: false,
  60. queryParams:{
  61. pageNum:1,
  62. pageSize:10,
  63. orderByColumn:'createTime',
  64. isAsc:'desc'
  65. }
  66. };
  67. },
  68. created() {
  69. this.houseGetDicts("lzfs").then((response) => {
  70. this.houseApplyStatus = response.data;
  71. });
  72. this.houseGetDicts("audit_status").then((response) => {
  73. this.auditStatus = response.data;
  74. });
  75. },
  76. methods: {
  77. goAdd(){
  78. window.location = 'circulationAdd';
  79. },
  80. getList(){
  81. setTimeout(() => {
  82. getList(this.queryParams).then(response => {
  83. console.log(response)
  84. for (var i = 0; i < response.rows.length; i++) {
  85. var houseApplyStatus = this.selectDictLabel(this.houseApplyStatus, response.rows[i].lzfs);
  86. response.rows[i].lzfs = houseApplyStatus;
  87. var auditStatus = this.selectDictLabel(this.auditStatus, response.rows[i].auditStatus);
  88. response.rows[i].auditStatus = auditStatus;
  89. this.applicationList.push(response.rows[i]);
  90. }
  91. console.log(this.applicationList.length >= response.total)
  92. if(this.applicationList.length >= response.total){
  93. this.finished = true;
  94. return;
  95. }else{
  96. this.loading = false;
  97. this.queryParams.pageNum += 1 ;
  98. }
  99. });
  100. }, 1000);
  101. },
  102. deleteList(id,index){
  103. this.$dialog.confirm({
  104. message: '您确认删除申请草稿?',
  105. })
  106. .then(() => {
  107. // on confirm
  108. this.applicationList.splice(index,1)
  109. removeList(id).then(res => {
  110. if(res.code = 200){
  111. this.$toast.success('删除成功');
  112. //this.refresh();
  113. }
  114. });
  115. })
  116. .catch(() => {
  117. // on cancel
  118. });
  119. },
  120. submit(item) {
  121. this.$dialog.confirm({
  122. message: '确认提交该草稿?',
  123. })
  124. .then(() => {
  125. // on confirm
  126. goApply(item.id).then(res => {
  127. if(res.code = 200){
  128. this.$toast.success('提交成功');
  129. this.refresh();
  130. }
  131. });
  132. })
  133. .catch(() => {
  134. // on cancel
  135. });
  136. },
  137. refresh() {
  138. this.finished = false;
  139. this.queryParams.pageNum = 1;
  140. this.applicationList = [];
  141. this.getList();
  142. },
  143. },
  144. }
  145. </script>
  146. <style scoped lang="scss">
  147. .app-container {
  148. padding: 0.2rem 3%;
  149. }
  150. /deep/.van-cell__title{
  151. flex: 0.7;
  152. }
  153. /deep/.van-cell__title span{
  154. font-family: Arial;
  155. font-size: 0.4rem;
  156. font-weight: normal;
  157. }
  158. /deep/.van-cell__value{
  159. flex: 0.3;
  160. color: #1D6FE9;
  161. font-weight: bold;
  162. }
  163. /deep/.van-swipe-cell{
  164. margin-bottom: 0.2rem;
  165. border-radius: 0.2rem;
  166. overflow: hidden;
  167. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  168. }
  169. /deep/van-ellipsis{
  170. font-weight: bold;
  171. }
  172. .delete-button {
  173. height: 100%;
  174. }
  175. .van-row{
  176. height: 100%;
  177. }
  178. .van-col{
  179. height: 100%;
  180. }
  181. </style>