居民档案
This commit is contained in:
		| @@ -48,127 +48,125 @@ | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
| import {mapState} from 'vuex' | ||||
|   import {mapState} from 'vuex' | ||||
|  | ||||
| export default { | ||||
|   name: 'AppResidentDocument', | ||||
|   appName: '居民管理', | ||||
|   components: {}, | ||||
|   props: {}, | ||||
|   data() { | ||||
|     return { | ||||
|       keyword: '', | ||||
|       datas: [], | ||||
|       current: 1, | ||||
|       size: 20, | ||||
|       tabList: [ | ||||
|         { | ||||
|           name: '本地居民', | ||||
|         }, | ||||
|         { | ||||
|           name: '流动人员', | ||||
|         }, | ||||
|       ], | ||||
|       currentTabs: 0, | ||||
|       areaId: '', | ||||
|       isMore: false, | ||||
|       areaName: '' | ||||
|     } | ||||
|   }, | ||||
|   computed: { | ||||
|     ...mapState(['user']), | ||||
|   }, | ||||
|   watch: {}, | ||||
|   onLoad() { | ||||
|     this.areaId = this.user.areaId | ||||
|     this.areaName = this.user.areaName | ||||
|     this.getList() | ||||
|     uni.$on('reload', res => { | ||||
|       this.current = 1 | ||||
|   export default { | ||||
|     name: 'AppResidentDocument', | ||||
|     appName: '居民管理', | ||||
|  | ||||
|     data () { | ||||
|       return { | ||||
|         keyword: '', | ||||
|         datas: [], | ||||
|         current: 1, | ||||
|         size: 20, | ||||
|         tabList: [ | ||||
|           { | ||||
|             name: '本地居民', | ||||
|           }, | ||||
|           { | ||||
|             name: '流动人员', | ||||
|           }, | ||||
|         ], | ||||
|         currentTabs: 0, | ||||
|         areaId: '', | ||||
|         isMore: false, | ||||
|         areaName: '' | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     computed: { | ||||
|       ...mapState(['user']), | ||||
|     }, | ||||
|  | ||||
|     onLoad () { | ||||
|       this.areaId = this.user.areaId | ||||
|       this.areaName = this.user.areaName | ||||
|       this.getList() | ||||
|     }) | ||||
|   }, | ||||
|   onShow() { | ||||
|     document.title = '居民管理' | ||||
|   }, | ||||
|   methods: { | ||||
|     getList() { | ||||
|       this.$loading() | ||||
|       this.$http.post('/app/appresident/list', null, { | ||||
|         params: { | ||||
|           size: this.size, | ||||
|           current: this.current, | ||||
|           con: this.keyword, | ||||
|           residentType: this.currentTabs == 0 ? '0' : '1', | ||||
|         } | ||||
|       }).then((res) => { | ||||
|         if (res.code == 0) { | ||||
|           this.datas = this.current > 1 ? [...this.datas, ...res.data.records] : res.data.records | ||||
|  | ||||
|           this.pages = res.data.pages | ||||
|  | ||||
|           if (this.current === 1 && !res.data.records.length) { | ||||
|             this.isMore = true | ||||
|           } else { | ||||
|             this.isMore = false | ||||
|           } | ||||
|         } | ||||
|       uni.$on('reload', res => { | ||||
|         this.current = 1 | ||||
|         this.getList() | ||||
|       }) | ||||
|     }, | ||||
|  | ||||
|     change(index) { | ||||
|       this.isMore = false | ||||
|       this.currentTabs = index | ||||
|       this.current = 1 | ||||
|       this.datas = [] | ||||
|       this.getList() | ||||
|     }, | ||||
|  | ||||
|     toDetailCard(item) { | ||||
|       uni.navigateTo({url: `./DetailCard?id=${item.id}`}) | ||||
|     }, | ||||
|  | ||||
|     seachObj(e) { | ||||
|       this.areaId = e | ||||
|       this.current = 1 | ||||
|       this.getList() | ||||
|     }, | ||||
|  | ||||
|     handerSearch(e) { | ||||
|       this.keyword = e | ||||
|       this.current = 1 | ||||
|       this.getList() | ||||
|     }, | ||||
|  | ||||
|     handerClear() { | ||||
|       this.keyword = '' | ||||
|       this.current = 1 | ||||
|       this.getList() | ||||
|     }, | ||||
|     edit(id) { | ||||
|       uni.navigateTo({url: `./Add?id=${id}&type=${this.currentTabs}`}) | ||||
|     }, | ||||
|     del(id) { | ||||
|       this.$confirm('确定删除该数据?').then(() => { | ||||
|         uni.showLoading() | ||||
|         this.$http.post(`/app/appresident/delete?ids=${id}`).then((res) => { | ||||
|     methods: { | ||||
|       getList() { | ||||
|         this.$loading() | ||||
|         this.$http.post('/app/appresident/list', null, { | ||||
|           params: { | ||||
|             size: this.size, | ||||
|             current: this.current, | ||||
|             con: this.keyword, | ||||
|             residentType: this.currentTabs == 0 ? '0' : '1', | ||||
|           } | ||||
|         }).then((res) => { | ||||
|           if (res.code == 0) { | ||||
|             this.$u.toast('删除成功!') | ||||
|             this.current = 1 | ||||
|             this.getList() | ||||
|             this.datas = this.current > 1 ? [...this.datas, ...res.data.records] : res.data.records | ||||
|  | ||||
|             this.pages = res.data.pages | ||||
|  | ||||
|             if (this.current === 1 && !res.data.records.length) { | ||||
|               this.isMore = true | ||||
|             } else { | ||||
|               this.isMore = false | ||||
|             } | ||||
|           } | ||||
|           uni.hideLoading() | ||||
|         }) | ||||
|       }).catch(() => { | ||||
|       }) | ||||
|     } | ||||
|   }, | ||||
|   onReachBottom() { | ||||
|     console.log("reachBottom") | ||||
|     this.current++ | ||||
|     this.getList() | ||||
|   }, | ||||
| } | ||||
|       }, | ||||
|  | ||||
|       change(index) { | ||||
|         this.isMore = false | ||||
|         this.currentTabs = index | ||||
|         this.current = 1 | ||||
|         this.datas = [] | ||||
|         this.getList() | ||||
|       }, | ||||
|  | ||||
|       toDetailCard(item) { | ||||
|         uni.navigateTo({url: `./DetailCard?id=${item.id}`}) | ||||
|       }, | ||||
|  | ||||
|       seachObj(e) { | ||||
|         this.areaId = e | ||||
|         this.current = 1 | ||||
|         this.getList() | ||||
|       }, | ||||
|  | ||||
|       handerSearch(e) { | ||||
|         this.keyword = e | ||||
|         this.current = 1 | ||||
|         this.getList() | ||||
|       }, | ||||
|  | ||||
|       handerClear() { | ||||
|         this.keyword = '' | ||||
|         this.current = 1 | ||||
|         this.getList() | ||||
|       }, | ||||
|       edit(id) { | ||||
|         uni.navigateTo({url: `./Add?id=${id}&type=${this.currentTabs}`}) | ||||
|       }, | ||||
|       del(id) { | ||||
|         this.$confirm('确定删除该数据?').then(() => { | ||||
|           uni.showLoading() | ||||
|           this.$http.post(`/app/appresident/delete?ids=${id}`).then((res) => { | ||||
|             if (res.code == 0) { | ||||
|               this.$u.toast('删除成功!') | ||||
|               this.current = 1 | ||||
|               this.getList() | ||||
|             } | ||||
|             uni.hideLoading() | ||||
|           }) | ||||
|         }).catch(() => { | ||||
|         }) | ||||
|       } | ||||
|     }, | ||||
|     onReachBottom() { | ||||
|       console.log("reachBottom") | ||||
|       this.current++ | ||||
|       this.getList() | ||||
|     }, | ||||
|   } | ||||
| </script> | ||||
|  | ||||
| <style scoped lang="scss"> | ||||
|   | ||||
| @@ -1,6 +1,5 @@ | ||||
| <template> | ||||
|   <div class="DetailCard" v-if="pageShow"> | ||||
|     <div class="top"></div> | ||||
|     <div class="middle"> | ||||
|       <div class="hint">家庭地址</div> | ||||
|       <div class="areaHint"> | ||||
|   | ||||
| @@ -198,9 +198,19 @@ | ||||
|         display: flex; | ||||
|         justify-content: space-between; | ||||
|         padding: 14px 0; | ||||
|  | ||||
|         .phones { | ||||
|           color: #3d94fb; | ||||
|         } | ||||
|  | ||||
|         span:first-child { | ||||
|           flex-shrink: 1; | ||||
|           margin-right: 20rpx; | ||||
|         } | ||||
|  | ||||
|         span:last-child { | ||||
|  | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|   } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user