|
@@ -0,0 +1,211 @@
|
|
|
+<template>
|
|
|
+ <view class="car">
|
|
|
+ <view class="cartop">
|
|
|
+ <view class="topa flexc">
|
|
|
+ <image :src="reset" class="resetimg" @click="getReset"></image>
|
|
|
+ <picker range-key='dictLabel' :range="rymmList" @change='bindDateChangea'>
|
|
|
+ <view class="chekt flexc">
|
|
|
+ <view class="over">{{rymm|| "选择身份"}}</view>
|
|
|
+ <image :src="up"></image>
|
|
|
+ </view>
|
|
|
+ </picker>
|
|
|
+ <view class="search flexc">
|
|
|
+ <image :src="search"></image>
|
|
|
+ <!-- confirm-type="search" @confirm="getConfirm" -->
|
|
|
+ <input placeholder="请输入人员姓名进行搜索" v-model="text"/>
|
|
|
+ <view class="btn" @click="getConfirm">搜索</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <!-- 列表 -->
|
|
|
+ <view class="carlists">
|
|
|
+ <car-list :datainfo="list" :rymmList="rymmList" :wtdt="wtdt" type='fwpeople' @getDelFn="getDelFn" @getDetail="getDetail"></car-list>
|
|
|
+ </view>
|
|
|
+ <block v-if="checkPermi(['wuYe:residentInfo:add'])">
|
|
|
+ <view style="height: 100rpx;"></view>
|
|
|
+ <view class="rfbtn" @click="getAddFn">添加人员</view>
|
|
|
+ </block>
|
|
|
+ <loading></loading>
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import config from '@/config'
|
|
|
+ const baseUrl = config.baseUrl
|
|
|
+ import carList from "@/people/components/car/list.vue"
|
|
|
+ import {getDictionaryFn} from "@/api/system/user.js"
|
|
|
+ import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
|
|
|
+ import {houseInfoList} from "@/api/work/work.js"
|
|
|
+ import {residentInfoList,residentInfoDel} from "@/api/work/people.js"
|
|
|
+ export default{
|
|
|
+ components:{carList},
|
|
|
+ data(){
|
|
|
+ return{
|
|
|
+ reset:require('@/car/static/car/reset.png'),
|
|
|
+ up:require('@/car/static/car/up.png'),
|
|
|
+ car:require('@/car/static/car/car.png'),
|
|
|
+ cara:require('@/car/static/car/cara.png'),
|
|
|
+ carb:require('@/car/static/car/carb.png'),
|
|
|
+ search:require('@/car/static/car/search.png'),
|
|
|
+ sfxx:"",
|
|
|
+ text:'',
|
|
|
+ rymm:'',
|
|
|
+ rymmid:"",
|
|
|
+ rymmList:[],
|
|
|
+ list:[],
|
|
|
+ pageSize: 10,
|
|
|
+ pageNum: 1,
|
|
|
+ reachflag: true,
|
|
|
+ wtdt:'',
|
|
|
+ houseId:'',
|
|
|
+ ftype:'',
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onUnload() {
|
|
|
+ uni.$off('residentInfoList')
|
|
|
+ },
|
|
|
+ onLoad: function(e) {
|
|
|
+ uni.$on('residentInfoList',(res)=>{
|
|
|
+ this.getrefreshData()
|
|
|
+ })
|
|
|
+ if(e.data){
|
|
|
+ var newobj=JSON.parse(decodeURIComponent(e.data));
|
|
|
+ this.houseId=newobj.id;
|
|
|
+ this.ftype=newobj.type
|
|
|
+ }
|
|
|
+ this.init()
|
|
|
+ this.getDataFn()
|
|
|
+ },
|
|
|
+ // 上拉触底加载更多触发事件
|
|
|
+ onReachBottom() {
|
|
|
+ if (this.reachflag) {
|
|
|
+ this.pageNum++
|
|
|
+ this.getDataFn()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ checkPermi, checkRole,
|
|
|
+ init(){
|
|
|
+ //人员面貌
|
|
|
+ getDictionaryFn('affiliation_personnel').then(res=>{
|
|
|
+ if(res.code==200){
|
|
|
+ this.rymmList = res.data.map(v => {
|
|
|
+ return {
|
|
|
+ dictLabel: v.dictLabel,
|
|
|
+ dictValue: v.dictValue
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getAddFn(){
|
|
|
+ this.$tab.navigateTo("/health/pages/health/add?houseId="+this.houseId)
|
|
|
+ },
|
|
|
+ getDetail(id){
|
|
|
+ this.$tab.navigateTo("/health/pages/health/add?id="+id)
|
|
|
+ },
|
|
|
+ getConfirm(){
|
|
|
+ this.getrefreshData()
|
|
|
+ },
|
|
|
+ getReset(){
|
|
|
+ this.rymm='';
|
|
|
+ this.text='';
|
|
|
+ this.getrefreshData()
|
|
|
+ },
|
|
|
+ getrefreshData(){
|
|
|
+ this.pageNum=1;
|
|
|
+ this.list=[];
|
|
|
+ this.reachflag=true;
|
|
|
+ this.getDataFn()
|
|
|
+ },
|
|
|
+ getTabFn(val){
|
|
|
+ this.tabval=val
|
|
|
+ },
|
|
|
+ bindDateChangea(e){
|
|
|
+ var val=e.detail.value;
|
|
|
+ this.rymm=this.rymmList[val].dictLabel;
|
|
|
+ this.rymmid=this.rymmList[val].dictValue;
|
|
|
+ this.getrefreshData()
|
|
|
+ },
|
|
|
+ getDelFn(id){
|
|
|
+ var that=this;
|
|
|
+ residentInfoDel(id).then(res=>{
|
|
|
+ if(res.code==200){
|
|
|
+ that.$toast("删除成功")
|
|
|
+ setTimeout(function(){
|
|
|
+ that.getrefreshData()
|
|
|
+ },1500)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getDataFn(){
|
|
|
+ var params={
|
|
|
+ pageSize:this.pageSize,
|
|
|
+ pageNum: this.pageNum,
|
|
|
+ }
|
|
|
+ if(this.ftype=='house'){
|
|
|
+ params.houseId=this.houseId
|
|
|
+ }
|
|
|
+ if(this.text){
|
|
|
+ params.residentName=this.text
|
|
|
+ }
|
|
|
+ if(this.rymm){
|
|
|
+ params.residentAppearance=this.rymmid
|
|
|
+ }
|
|
|
+ residentInfoList(params).then(res=>{
|
|
|
+ if(res.code==200){
|
|
|
+ if (res.rows.length < this.pageSize) {
|
|
|
+ this.reachflag = false
|
|
|
+ this.wtdt = '到底了~';
|
|
|
+ } else {
|
|
|
+ var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
|
|
|
+ if (num < res.total) {
|
|
|
+ this.reachflag = true
|
|
|
+ this.wtdt = ''
|
|
|
+ } else {
|
|
|
+ this.reachflag = false
|
|
|
+ this.wtdt = '到底了~';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var newArr=JSON.parse(JSON.stringify(res.rows))
|
|
|
+ newArr.forEach(ite=>{
|
|
|
+ ite.right=0;
|
|
|
+ })
|
|
|
+ if (this.pageNum == 1) {
|
|
|
+ this.list = newArr;
|
|
|
+ } else {
|
|
|
+ this.list = this.list.concat(newArr)
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.$toast(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+<style>
|
|
|
+ page{background: #F3F3F0;}
|
|
|
+</style>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.car{padding-top: 140rpx;}
|
|
|
+.cartop{position: fixed;left: 0;right: 0;top: 0;background-color: #ffffff;z-index: 2;
|
|
|
+ .topa{padding: 20rpx 20rpx 32rpx;
|
|
|
+ .resetimg{width: 36rpx;height: 36rpx;margin-right: 24rpx;flex: 0 0 auto;}
|
|
|
+ .chekt{width: 150rpx;overflow: hidden;
|
|
|
+ view{font-weight: 500;font-size: 26rpx;color: #272727;flex: 1;}
|
|
|
+ image{width: 24rpx;height: 16rpx;margin-left: 18rpx;flex: 0 0 auto;}
|
|
|
+ }
|
|
|
+ .search{flex: 1;margin-left: 16rpx;height: 64rpx;background: #EEEEEE;border-radius: 32rpx;border: 2rpx solid #E6E6E6;padding-left: 24rpx;box-sizing: border-box;
|
|
|
+ image{width: 32rpx;height: 34rpx;margin-right: 22rpx;flex: 0 0 auto;}
|
|
|
+ input{flex: 1;font-size: 26rpx;color: #272727;}
|
|
|
+ .btn{width: 100rpx;height: 64rpx;background: #3565ED;border-radius: 32rpx;flex: 0 0 auto;font-weight: bold;text-align: center;line-height: 64rpx;
|
|
|
+font-size: 26rpx;
|
|
|
+color: #FFFFFF;}
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+.carlists{padding: 0 18rpx;}
|
|
|
+</style>
|