移动端
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

206 lines
6.5 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="goAddLite()"
  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-pull-refresh v-model="refreshing" @refresh="refresh">
  18. <van-list
  19. v-model="loading"
  20. :finished="finished"
  21. finished-text="没有更多了"
  22. @load="getList"
  23. >
  24. <van-swipe-cell v-for="(item,index) in applicationList" :key="index">
  25. <van-cell :title="item.ywh" center @click="viewItem(item)">
  26. <!-- <van-cell :title="item.ywh" :value="item.houseApplyStatusName" center @click="viewItem(item)">-->
  27. <!-- <template #icon>-->
  28. <!-- <van-icon name="../../../static/images/onlineHome/icon_zjd1.png" size="30" color="#539FFD" style="margin-right: 10px;" />-->
  29. <!-- </template>-->
  30. <!-- <template #label>-->
  31. <!-- <p>{{item.projectName}}</p>-->
  32. <!-- </template>-->
  33. <template #icon>
  34. <van-icon name="../../../static/images/onlineHome/icon_zjd1.png" size="30" color="#539FFD" style="margin-right: 10px;" />
  35. </template>
  36. <span v-if="item.auditStatus === '0'">{{ item.houseApplyStatusName}} </span>
  37. <span v-else-if="item.auditStatus !== '0' && item.auditStatus === '2' " style="color: #F56C6C">{{ item.houseApplyStatusName + ' ● 已驳回' }} </span>
  38. <span v-else style="color: #67c23a;">{{item.houseApplyStatusName }} </span>
  39. <template #label>
  40. <p>{{item.projectName}}</p>
  41. </template>
  42. </van-cell>
  43. <template #right>
  44. <van-row>
  45. <van-col>
  46. <van-button square text="提交" type="primary" v-if="item.houseApplyStatusName=='申请草稿'" @click="submitApplyProposer(item)" class="delete-button" />
  47. </van-col>
  48. <van-col>
  49. <van-button square text="修改" type="info" v-if="item.houseApplyStatusName=='申请草稿'" :to="{name:'proposerLite', query: {id:item.id, type: 'modify'}}" class="delete-button" />
  50. </van-col>
  51. <van-col>
  52. <van-button square text="删除" type="danger" v-if="item.houseApplyStatusName=='申请草稿'" @click="deleteList(item.id,index)" class="delete-button" />
  53. </van-col>
  54. </van-row>
  55. </template>
  56. </van-swipe-cell>
  57. </van-list>
  58. </van-pull-refresh>
  59. </div>
  60. </template>
  61. <script>
  62. import { getList , removeList } from "@/api/onlineHome/homestead/application";
  63. import { customSubmit, customSubmitWLHT} from "@/api/onlineHome/homestead/application";
  64. export default {
  65. name: "applicationList",
  66. data() {
  67. return {
  68. applicationList:[],
  69. houseApplyStatus:[],
  70. loading: false,
  71. finished: false,
  72. refreshing: false,
  73. queryParams:{
  74. pageNum:1,
  75. pageSize:10,
  76. orderByColumn:'createTime',
  77. isAsc:'desc'
  78. }
  79. };
  80. },
  81. created() {
  82. this.houseGetDicts("house_apply_status").then((response) => {
  83. console.log(response)
  84. this.houseApplyStatus = response.data;
  85. });
  86. },
  87. methods: {
  88. goAdd(){
  89. window.location = 'applicationAdd';
  90. },
  91. goAddLite(){
  92. //window.location = 'applicationAdd';
  93. window.location = 'proposerLite?type=add';
  94. },
  95. viewItem(row){
  96. let type = /*row.houseApplyStatus == '1' // 申请草稿
  97. ||*/ row.houseApplyStatus == '10' // 申请通过
  98. || row.houseApplyStatus == '12' // 开工草稿
  99. || row.houseApplyStatus == '18' // 开工通过
  100. || row.houseApplyStatus == '20' // 验收草稿
  101. ? 'modify' : 'view';
  102. window.location = 'proposerLite?type=' + type + '&id=' + row.id;
  103. },
  104. getList(){
  105. setTimeout(() => {
  106. getList(this.queryParams).then(response => {
  107. console.log(response)
  108. for (var i = 0; i < response.rows.length; i++) {
  109. var houseApplyStatusName = this.selectDictLabel(this.houseApplyStatus, response.rows[i].houseApplyStatus);
  110. // if(response.rows[i].auditStatus !== '0' && response.rows[i].auditStatus === '2'){
  111. // houseApplyStatusName = houseApplyStatusName+ ' ● 已驳回';
  112. // }
  113. response.rows[i].houseApplyStatusName = houseApplyStatusName;
  114. this.applicationList.push(response.rows[i]);
  115. }
  116. if(this.applicationList.length >= response.total){
  117. this.finished = true;
  118. return;
  119. }else{
  120. this.loading = false;
  121. this.queryParams.pageNum += 1 ;
  122. }
  123. }).finally(() => {
  124. this.loading = false;
  125. this.refreshing = false;
  126. });
  127. }, 1000);
  128. },
  129. deleteList(id,index){
  130. this.$dialog.confirm({
  131. message: '您确认删除申请草稿?',
  132. })
  133. .then(() => {
  134. // on confirm
  135. this.applicationList.splice(index,1)
  136. removeList(id).then(res => {
  137. if(res.code = 200){
  138. this.$toast.success('删除成功');
  139. }
  140. });
  141. })
  142. .catch(() => {
  143. // on cancel
  144. });
  145. },
  146. refresh() {
  147. this.refreshing = true;
  148. this.finished = false;
  149. this.applicationList = []
  150. },
  151. submitApplyProposer(item) {
  152. this.$dialog.confirm({
  153. message: '您确认提交申请草稿?',
  154. }).then(() => {
  155. let func = 1 || item.processKey.endsWith('WLHT') ? customSubmitWLHT : customSubmit; //TODO: 总是走简化流程
  156. func(item.id).then((resp) => {
  157. this.$toast.success("提交成功");
  158. this.refresh();
  159. }).catch((e) => {
  160. this.$toast.fail("提交失败!");
  161. });
  162. }).catch(() => {});
  163. },
  164. },
  165. }
  166. </script>
  167. <style scoped lang="scss">
  168. .app-container {
  169. padding: 0.2rem 3%;
  170. }
  171. /deep/.van-cell__title{
  172. flex: 0.7;
  173. }
  174. /deep/.van-cell__title span{
  175. font-family: Arial;
  176. font-size: 0.4rem;
  177. font-weight: normal;
  178. }
  179. /deep/.van-cell__value{
  180. flex: 0.3;
  181. color: #1D6FE9;
  182. font-weight: bold;
  183. }
  184. /deep/.van-swipe-cell{
  185. margin-bottom: 0.2rem;
  186. border-radius: 0.2rem;
  187. overflow: hidden;
  188. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  189. }
  190. /deep/van-ellipsis{
  191. font-weight: bold;
  192. }
  193. .van-row{
  194. height: 100%;
  195. }
  196. .van-col{
  197. height: 100%;
  198. }
  199. .delete-button {
  200. height: 100%;
  201. }
  202. </style>