移动端
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

237 行
7.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="getList()">
  18. <van-list
  19. v-model="loading"
  20. :finished="finished"
  21. finished-text="没有更多了"
  22. @load="getList('+1')"
  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'">{{ formatDict(houseApplyStatus, item.houseApplyStatus) }} </span>
  37. <span v-else-if="item.auditStatus !== '0' && item.auditStatus === '2' " style="color: #F56C6C">{{ formatDict(houseApplyStatus, item.houseApplyStatus) + ' ● 已驳回' }} </span>
  38. <span v-else style="color: #67c23a;">{{ formatDict(houseApplyStatus, item.houseApplyStatus) }} </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.houseApplyStatus=='1'" @click="submitApplyProposer(item)" class="delete-button" />
  47. </van-col>
  48. <van-col>
  49. <van-button square text="修改" type="info" v-if="item.houseApplyStatus=='1'" :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.houseApplyStatus=='1'" @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. import {updateOpretion} from "@/api/onlineHome/homestead/application";
  65. export default {
  66. name: "applicationList",
  67. data() {
  68. return {
  69. applicationList:[],
  70. houseApplyStatus:[],
  71. loading: false,
  72. finished: false,
  73. refreshing: false,
  74. total: 0,
  75. queryParams:{
  76. pageNum:1,
  77. pageSize:10,
  78. orderByColumn:'createTime',
  79. isAsc:'desc'
  80. }
  81. };
  82. },
  83. created() {
  84. this.houseGetDicts("house_apply_status").then((response) => {
  85. this.houseApplyStatus = response.data;
  86. });
  87. this.getList();
  88. },
  89. methods: {
  90. goAdd(){
  91. window.location = 'applicationAdd';
  92. },
  93. goAddLite(){
  94. //window.location = 'applicationAdd';
  95. window.location = 'proposerLite?type=add';
  96. },
  97. viewItem(row){
  98. let type = /*row.houseApplyStatus == '1' // 申请草稿
  99. ||*/ row.houseApplyStatus == '10' // 申请通过
  100. || row.houseApplyStatus == '12' // 开工草稿
  101. || row.houseApplyStatus == '18' // 开工通过
  102. || row.houseApplyStatus == '20' // 验收草稿
  103. ? 'modify' : 'view';
  104. window.location = 'proposerLite?type=' + type + '&id=' + row.id;
  105. },
  106. getList(target){
  107. let type = typeof (target);
  108. console.log(type, target);
  109. if(target && this.finished)
  110. return;
  111. if (target === 0) {
  112. this.refreshing = true;
  113. this.finished = true;
  114. this.total = 0;
  115. this.queryParams.pageNum = 1;
  116. this.applicationList = [];
  117. }
  118. else if (type === 'number')
  119. this.queryParams.pageNum = target;
  120. else if (type === 'string') {
  121. this.queryParams.pageNum = eval(this.queryParams.pageNum + target)
  122. }
  123. else
  124. {
  125. this.refreshing = true;
  126. this.finished = true;
  127. this.total = 0;
  128. this.queryParams.pageNum = 1;
  129. this.applicationList = []
  130. }
  131. getList(this.queryParams).then(response => {
  132. console.log(response)
  133. if (response.rows.length === 0) {
  134. this.finished = true;
  135. return;
  136. }
  137. for (var i = 0; i < response.rows.length; i++) {
  138. /*var houseApplyStatusName = this.selectDictLabel(this.houseApplyStatus, response.rows[i].houseApplyStatus);
  139. // if(response.rows[i].auditStatus !== '0' && response.rows[i].auditStatus === '2'){
  140. // houseApplyStatusName = houseApplyStatusName+ ' ● 已驳回';
  141. // }
  142. response.rows[i].houseApplyStatusName = houseApplyStatusName;*/
  143. this.applicationList.push(response.rows[i]);
  144. }
  145. this.total += response.rows.length;
  146. this.finished = this.total >= response.total;
  147. }).finally(() => {
  148. this.loading = false;
  149. this.refreshing = false;
  150. });
  151. },
  152. formatDict(dict, value) {
  153. return this.selectDictLabel(dict, value);
  154. },
  155. deleteList(id,index){
  156. this.$dialog.confirm({
  157. message: '您确认删除申请草稿?',
  158. })
  159. .then(() => {
  160. // on confirm
  161. this.applicationList.splice(index,1)
  162. removeList(id).then(res => {
  163. if(res.code = 200){
  164. this.$toast.success('删除成功');
  165. }
  166. });
  167. })
  168. .catch(() => {
  169. // on cancel
  170. });
  171. },
  172. refresh() {
  173. this.getList(); return;
  174. this.applicationList = [];
  175. this.queryParams.pageNum = 1;
  176. this.refreshing = true;
  177. this.finished = false;
  178. },
  179. submitApplyProposer(item) {
  180. this.$dialog.confirm({
  181. message: '您确认提交申请草稿?',
  182. }).then(() => {
  183. let func = 1 || item.processKey.endsWith('WLHT') ? customSubmitWLHT : customSubmit; //TODO: 总是走简化流程
  184. if(item.auditStatus == '2'){
  185. updateOpretion(item.id).then();
  186. }
  187. func(item.id).then((resp) => {
  188. this.$toast.success("提交成功");
  189. this.refresh();
  190. }).catch((e) => {
  191. this.$toast.fail("提交失败!");
  192. });
  193. }).catch(() => {});
  194. },
  195. },
  196. }
  197. </script>
  198. <style scoped lang="scss">
  199. .app-container {
  200. padding: 0.2rem 3%;
  201. }
  202. /deep/.van-cell__title{
  203. flex: 0.7;
  204. }
  205. /deep/.van-cell__title span{
  206. font-family: Arial;
  207. font-size: 0.4rem;
  208. font-weight: normal;
  209. }
  210. /deep/.van-cell__value{
  211. flex: 0.3;
  212. color: #1D6FE9;
  213. font-weight: bold;
  214. }
  215. /deep/.van-swipe-cell{
  216. margin-bottom: 0.2rem;
  217. border-radius: 0.2rem;
  218. overflow: hidden;
  219. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  220. }
  221. /deep/van-ellipsis{
  222. font-weight: bold;
  223. }
  224. .van-row{
  225. height: 100%;
  226. }
  227. .van-col{
  228. height: 100%;
  229. }
  230. .delete-button {
  231. height: 100%;
  232. }
  233. </style>