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

292 lines
9.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. <div class="header_main">
  18. 宅基地申请
  19. <div class="return_btn" @click="onClickLeft"></div>
  20. <div class="add_btn" @click="goAddLite"></div>
  21. </div>
  22. <van-pull-refresh v-model="refreshing" @refresh="getList()">
  23. <van-list
  24. v-model="loading"
  25. :finished="finished"
  26. finished-text="没有更多了"
  27. @load="getList('+1')"
  28. >
  29. <van-swipe-cell v-for="(item,index) in applicationList" :key="index">
  30. <van-cell :title="item.sqhhzxm" center @click="viewItem(item)">
  31. <!-- <van-cell :title="item.ywh" :value="item.houseApplyStatusName" center @click="viewItem(item)">-->
  32. <!-- <template #icon>-->
  33. <!-- <van-icon name="../../../static/images/onlineHome/icon_zjd1.png" size="30" color="#539FFD" style="margin-right: 10px;" />-->
  34. <!-- </template>-->
  35. <!-- <template #label>-->
  36. <!-- <p>{{item.projectName}}</p>-->
  37. <!-- </template>-->
  38. <template #icon>
  39. <van-icon name="../../../static/images/onlineHome/icon_zjd1.png" size="30" color="#539FFD" style="margin-right: 10px;" />
  40. </template>
  41. <span v-if="item.auditStatus === '0'">{{ formatDict(houseApplyStatus, item.homeApplyStatus) }} </span>
  42. <span v-else-if="item.auditStatus === '2' " style="color: #F56C6C">{{ formatDict(houseApplyStatus, item.homeApplyStatus) + ' ● 已驳回' }} </span>
  43. <span v-else style="color: #67c23a;">{{ formatDict(houseApplyStatus, item.homeApplyStatus) }} </span>
  44. <template #label>
  45. <p>{{item.projectName}}</p>
  46. </template>
  47. </van-cell>
  48. <template #right>
  49. <van-row>
  50. <van-col>
  51. <van-button square text="提交" type="primary" v-if="item.homeApplyStatus=='11' || item.homeApplyStatus=='31' || item.homeApplyStatus=='71'" @click="submitApplyProposer(item)" class="delete-button" />
  52. </van-col>
  53. <van-col>
  54. <van-button square text="修改" type="info" v-if="item.homeApplyStatus=='11' || item.homeApplyStatus=='31' || item.homeApplyStatus=='71'" :to="{name:'homesteadProposerLite', query: {id:item.id, type: 'modify'}}" class="delete-button" />
  55. </van-col>
  56. <van-col>
  57. <van-button square text="删除" type="danger" v-if="item.homeApplyStatus=='11'" @click="deleteList(item.id,index)" class="delete-button" />
  58. </van-col>
  59. </van-row>
  60. </template>
  61. </van-swipe-cell>
  62. </van-list>
  63. </van-pull-refresh>
  64. </div>
  65. </template>
  66. <script>
  67. import { getList , removeList } from "@/api/sunVillage_info/homestead/application";
  68. import { customSubmitWLHT, submitStartWLHT, submitEndWLHT,} from "@/api/sunVillage_info/homestead/application";
  69. import {updateOpretion} from "@/api/sunVillage_info/homestead/application";
  70. import Cookies from "js-cookie";
  71. export default {
  72. name: "applicationList",
  73. data() {
  74. return {
  75. applicationList:[],
  76. houseApplyStatus:[],
  77. loading: false,
  78. finished: false,
  79. refreshing: false,
  80. deptId:null,
  81. idcard:null,
  82. total: 0,
  83. queryParams:{
  84. pageNum:1,
  85. pageSize:10,
  86. deptId:null,
  87. orderByColumn:'createTime',
  88. isAsc:'desc'
  89. }
  90. };
  91. },
  92. created() {
  93. this.houseGetDicts("home_stage_status").then((response) => {
  94. this.houseApplyStatus = response.data;
  95. });
  96. this.deptId = this.$store.state.user.loginDeptId;
  97. this.$set(this.queryParams, "deptId", this.deptId);
  98. this.getList();
  99. },
  100. methods: {
  101. goAdd(){
  102. window.location = 'applicationAdd';
  103. },
  104. goAddLite(){
  105. //window.location = 'applicationAdd'
  106. this.$router.push({name:'homesteadProposerLite',query:{type:"add"}})
  107. },
  108. viewItem(row){
  109. let type = row.houseApplyStatus == '11' // 申请草稿
  110. || row.houseApplyStatus == '1F' // 申请通过
  111. || row.houseApplyStatus == '31' // 开工草稿
  112. || row.houseApplyStatus == '3F' // 开工通过
  113. || row.houseApplyStatus == '71' // 验收草稿
  114. ? 'modify' : 'view';
  115. this.$router.push({name:'homesteadProposerLite',query:{type:type,id:row.id}})
  116. },
  117. getList(target){
  118. let type = typeof (target);
  119. console.log(type, target);
  120. if(target && this.finished)
  121. return;
  122. if (target === 0) {
  123. this.refreshing = true;
  124. this.finished = true;
  125. this.total = 0;
  126. this.queryParams.pageNum = 1;
  127. this.applicationList = [];
  128. }
  129. else if (type === 'number')
  130. this.queryParams.pageNum = target;
  131. else if (type === 'string') {
  132. this.queryParams.pageNum = eval(this.queryParams.pageNum + target)
  133. }
  134. else
  135. {
  136. this.refreshing = true;
  137. this.finished = true;
  138. this.total = 0;
  139. this.queryParams.pageNum = 1;
  140. this.applicationList = []
  141. }
  142. getList(this.queryParams).then(response => {
  143. console.log(response)
  144. if (response.rows.length === 0) {
  145. this.finished = true;
  146. return;
  147. }
  148. for (var i = 0; i < response.rows.length; i++) {
  149. /*var houseApplyStatusName = this.selectDictLabel(this.houseApplyStatus, response.rows[i].houseApplyStatus);
  150. // if(response.rows[i].auditStatus !== '0' && response.rows[i].auditStatus === '2'){
  151. // houseApplyStatusName = houseApplyStatusName+ ' ● 已驳回';
  152. // }
  153. response.rows[i].houseApplyStatusName = houseApplyStatusName;*/
  154. this.applicationList.push(response.rows[i]);
  155. }
  156. this.total += response.rows.length;
  157. this.finished = this.total >= response.total;
  158. }).finally(() => {
  159. this.loading = false;
  160. this.refreshing = false;
  161. });
  162. },
  163. formatDict(dict, value) {
  164. return this.selectDictLabel(dict, value);
  165. },
  166. deleteList(id,index){
  167. this.$dialog.confirm({
  168. message: '您确认删除申请草稿?',
  169. })
  170. .then(() => {
  171. // on confirm
  172. this.applicationList.splice(index,1)
  173. removeList(id).then(res => {
  174. if(res.code = 200){
  175. this.$toast.success('删除成功');
  176. }
  177. });
  178. })
  179. .catch(() => {
  180. // on cancel
  181. });
  182. },
  183. refresh() {
  184. this.getList(); return;
  185. this.applicationList = [];
  186. this.queryParams.pageNum = 1;
  187. this.refreshing = true;
  188. this.finished = false;
  189. },
  190. submitApplyProposer(item) {
  191. this.$router.push({name:'homesteadProposerLite',query:{type:"edit",id:item.id}})
  192. // if(item.homeApplyStatus === '11'){
  193. // customSubmitWLHT(item.id).then((resp) => {
  194. // this.$toast.success("提交成功");
  195. // this.refresh();
  196. // }).catch((e) => {
  197. // this.$toast.fail("提交失败!");
  198. // });
  199. // }else if(item.homeApplyStatus === '31'){
  200. // submitStartWLHT(item.id).then((resp) => {
  201. // this.$toast.success("提交成功");
  202. // this.refresh();
  203. // }).catch((e) => {
  204. // this.$toast.fail("提交失败!");
  205. // });
  206. // }else if(item.homeApplyStatus === '71'){
  207. // submitEndWLHT(item.id).then((resp) => {
  208. // this.$toast.success("提交成功");
  209. // this.refresh();
  210. // }).catch((e) => {
  211. // this.$toast.fail("提交失败!");
  212. // });
  213. // }
  214. },
  215. },
  216. }
  217. </script>
  218. <style scoped lang="scss">
  219. .app-container {
  220. .header_main{
  221. height: 116px;
  222. background: url('../../../../assets/images/sunVillage_info/list_head.png') no-repeat;
  223. background-size: 100% 100%;
  224. position: fixed;
  225. top: 0;
  226. left: 0;
  227. width: 100%;
  228. font-size: 36px;
  229. line-height: 116px;
  230. text-align: center;
  231. color: #fff;
  232. position: relative;
  233. .return_btn{
  234. width: 24px;
  235. height: 43.2px;
  236. background: url('../../../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
  237. background-size: 20px 36px;
  238. position: absolute;
  239. left: 38px;
  240. top: 36px;
  241. }
  242. .add_btn{
  243. width: 56.4px;
  244. height: 40.8px;
  245. background: url('../../../../assets/images/sunVillage_info/list_icon_9.png') center center no-repeat;
  246. background-size: 47px 34px;
  247. position: absolute;
  248. right: 38px;
  249. top: 36px;
  250. }
  251. }
  252. }
  253. /deep/.van-list{
  254. padding: 0.2rem 3%;
  255. }
  256. /deep/.van-cell__title{
  257. flex: 0.7;
  258. }
  259. /deep/.van-cell__title span{
  260. font-family: Arial;
  261. font-size: 0.4rem;
  262. font-weight: normal;
  263. }
  264. /deep/.van-cell__value{
  265. flex: 0.3;
  266. color: #1D6FE9;
  267. font-weight: bold;
  268. }
  269. /deep/.van-swipe-cell{
  270. margin-bottom: 0.2rem;
  271. border-radius: 0.2rem;
  272. overflow: hidden;
  273. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  274. }
  275. /deep/van-ellipsis{
  276. font-weight: bold;
  277. }
  278. .van-row{
  279. height: 100%;
  280. }
  281. .van-col{
  282. height: 100%;
  283. }
  284. .delete-button {
  285. height: 100%;
  286. }
  287. </style>