644 lines
14 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="dangerbig-list">
<view class="fixedheader">
<headers :showBack="true">
<view class="headerName">
党员列表
</view>
<view class="right" @click="screenData()">
<image class="scancode" src="@/static/bthgIcon/screen.png" mode=""></image>
</view>
</headers>
<view class="searchBox">
<view class="uni-form-item">
<input class="uni-input" name="searchName" @input="handleInput" v-model="searchName"
placeholder="请输入姓名" />
<!-- <button class="mini-btn" type="primary" size="mini" @click="loadData">搜索</button> -->
<!-- <view class="screen" @click="screenData">筛选</view>
<view class="screen" style="margin-top: 6rpx;
margin-left: 10rpx; margin-right: 10rpx;">
<image src="/static/screenIcon.png" style="width: 30rpx;height: 30rpx">
</image>
</view> -->
</view>
</view>
</view>
<view :style="{ 'padding-top': statusBarHeight + (100 * 2)+ 'rpx' }">
<view class="list" v-if="workList && workList.length>0">
<view class="list-item" v-for="(item,index) in workList" :key="index" @click="checkItem(item)">
<view class="list-title">
<!-- 未销项 -->
<view>
<!-- <text class="tag" v-if="item.hiddenDangerNum > 0">未销项{{item.hiddenDangerNum}}</text> -->
姓名:{{item.workerName}}
</view>
<!-- <view :class="{'status2': item.engineeringState !== 4, 'status4': item.engineeringState === 4}">
{{item.engineeringState === 4 ? "已完工" : "在施"}}
</view> -->
</view>
<view class="list-content">
<view class="list-info">
性别:{{item.sex ? '男' : '女'}}
</view>
<view class="list-info">
党内职务:{{item.partyPosition}}
</view>
<view class="list-info">
民族:{{item.nation}}
</view>
<view class="list-info">
人员类别:{{item.personnelCategory}}
</view>
<view class="list-info">
学历:{{item.educationalBackground ? primarySchoolList[item.educationalBackground - 1].name : '' }}
</view>
<!-- <view class="list-info">
图片:<view class="download" v-for="item in item.image" :key="item.id">
<image :src="item.url.includes('http://') ? item.url : url_config+'image/'+item.url"
class="img"
@click="previewImage(item.url.includes('http://') ? item.url : url_config+'image/'+item.url)">
</image>
</view>
</view> -->
<!-- <view class="info-status" v-if="item.issuperdanger">超危</view> -->
</view>
<!-- <view class="btn_detail">查看明细</view> -->
</view>
<view class="loadMoreBox" v-if="isLoadMore">
<uni-load-more :status="loadStatus" iconType="auto"></uni-load-more>
</view>
</view>
<view class="no-data" v-else>
<image class="img" src="/static/noData.png"></image>
<text class="txt">暂无数据</text>
</view>
<!-- 筛选条件弹框 -->
<uni-popup class="screenDialog" ref="screenShow" :maskClick="true" @change="closeMenu" :show="popupShow">
<view class="screenContent">
<scroll-view style="height: 80%;" scroll-y>
<view class="closeIcon" @click="closeBtn">
×
</view>
<view class="screenTitle">
筛选条件
</view>
<tki-tree ref="locationTree" :multiple="false" @confirm="(val)=>checkPointBtn(val,1)" idKey='id'
:range="listData" rangeKey="classificationName" confirmColor="#4e8af7" />
</scroll-view>
<view class="footerBtn">
<view class="foterLeft" @click="closeBtn">
取消
</view>
<view class="foterRight" @click="closeRed">
确认
</view>
</view>
</view>
</uni-popup>
</view>
</view>
</template>
<script>
import tkiTree from "@/components/tki-tree_up/tki-tree.vue"
import {
isJSON
} from '@/utils/tool.js'
export default {
components: {
tkiTree
},
data() {
return {
statusBarHeight: 0,
pageNo: 1,
pageSize: 10,
projectSn: "",
oldListData: [],
listData: [],
isLoadMore: false,
loadStatus: 'more',
workList: [],
levelList: [{
id: 1,
workCategoryName: "一级"
}, {
id: 2,
workCategoryName: "二级"
}, {
id: 3,
workCategoryName: "三级"
}, {
id: 4,
workCategoryName: "普通"
}],
searchName: "",
popupShow: false,
partyConstructionOrganizationId: "",
primarySchoolList: [{
id: 1,
name: "小学",
}, {
id: 2,
name: "初中",
}, {
id: 3,
name: "中专",
}, {
id: 4,
name: "高中",
}, {
id: 5,
name: "大专",
}, {
id: 6,
name: "本科",
}, {
id: 7,
name: "研究生",
}, {
id: 8,
name: "博士",
}, {
id: 9,
name: "博士后",
}],
}
},
onShow() {
this.statusBarHeight = uni.getStorageSync('systemInfo').statusBarHeight;
this.projectSn = JSON.parse(uni.getStorageSync('userInfo')).sn
},
onLoad() {
this.projectSn = JSON.parse(uni.getStorageSync('userInfo')).sn
// this.initData()
this.getWorkList()
this.getConstructionTree();
},
onReachBottom() {
console.log(1)
if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
this.isLoadMore = true
this.pageNo += 1
this.getWorkList()
}
},
onPullDownRefresh() {
console.log(2)
this.pageNo = 1
this.getWorkList();
},
methods: {
//tree 树形选择器 选中--回显
checkPointBtn(val, type) {
console.log(val)
// type==1 检查项 3 通知人
if (type == 1) {
this.partyConstructionOrganizationId = val[0].id;
this.handleInput();
}
},
//点击打开筛选
screenData() {
this.$refs.screenShow.open();
this.listData = JSON.parse(JSON.stringify(this.oldListData));
console.log(this.listData, this.oldListData)
this._renderTreeList(this.listData)
this.popupShow = true
},
//扁平化树结构
_renderTreeList(list = []) {
const find = list.find(item => item.id == this.partyConstructionOrganizationId)
console.log(3333, find)
if (find) {
find.checked = true;
return;
}
list.forEach(item => {
if (Array.isArray(item.children) && item.children.length > 0) {
this._renderTreeList(item.children);
}
})
// console.log(list)
},
closeMenu(e) {
console.log("关闭!!!!", e)
if (e.show == false) {
// this.$refs.screenShow.close()
this.popupShow = false;
// this.resettingBtn()
}
},
//关闭筛选
closeBtn() {
this.$refs.screenShow.close()
this.popupShow = false;
},
closeRed() {
this.$refs.locationTree._confirm()
this.$refs.screenShow.close()
this.popupShow = false;
},
//预览图片
previewImage(url) {
uni.previewImage({
urls: [url]
})
},
handleInput() {
this.pageNo = 1;
this.workList = [];
this.getWorkList();
},
getConstructionTree() {
let data = {
projectSn: this.projectSn,
partyConstructionOrganizationId: "",
}
this.sendRequest({
url: 'xmgl/partyConstructionOrganization/tree/list',
method: 'get',
data: data,
success: res => {
uni.hideLoading()
if (res.code == 200) {
console.log("workList======================", res)
const newResult = [{
children:[],
classificationName: "全部",
id: "",
parentId: "0",
}, ...res.result]
this.listData = newResult;
this.oldListData = [...newResult];
}
}
})
},
getWorkList() {
let data = {
pageNo: this.pageNo,
pageSize: this.pageSize,
projectSn: this.projectSn,
workerName: this.searchName,
partyConstructionOrganizationId: this.partyConstructionOrganizationId,
}
this.sendRequest({
url: 'xmgl/partyConstructionMember/page',
method: 'get',
data: data,
success: res => {
uni.hideLoading()
if (res.code == 200) {
console.log("workList======================", res)
// this.listData = res.result.records
// this.workList=this.workList.concat(res.result)
const newResult = res.result.records.map(item => {
return {
...item,
image: isJSON(item.file) ? JSON
.parse(item.file) : [],
}
})
this.workList = this.workList.concat(newResult)
if (res.result.records.length < this.pageSize) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
this.isLoadMore = true
this.loadStatus = 'nomore'
} else {
this.isLoadMore = false
// that.loadStatus='more'
}
uni.stopPullDownRefresh()
}
}
})
},
checkItem(val) {
console.log(val)
uni.navigateTo({
url: './detail?id=' + val.id
})
}
}
}
</script>
<style lang="scss" scoped>
.tki-tree-view {
max-height: 70%;
}
.screenDialog {
position: absolute;
// top: 11%;
// height: 95%;
/* background: pink; */
background: white;
width: 100%;
border-radius: 40rpx;
margin-left: -4%;
background-color: white;
/* 设置为半透明的灰色 */
z-index: 9;
/* 设置一个较大的 z-index 值,保证遮罩层在最上层 */
.closeIcon {
float: right;
font-size: 50rpx;
color: gray;
margin-right: 3%;
}
.screenTitle {
text-align: center;
margin-top: 4%;
font-size: 36rpx;
font-weight: 500;
}
.uni-popup__wrapper-box {
height: 70vh;
overflow: scroll;
position: fixed;
bottom: 0,
}
.screenContent {
width: 100vw;
height: 70%;
// width: 90%;
// margin: -65% 0%;
overflow: scroll;
// position: relative;
// margin-top: 180%;
border-radius: 40rpx 40rpx 0 0;
// margin-left: -4%;
background-color: white;
padding-left: 10%;
position: fixed;
left: 0;
bottom: 0;
.titleItem {
font-size: 28rpx;
.regionText {
display: inline-block;
margin-left: 16%;
width: 380rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
}
}
.footerBtn {
display: flex;
text-align: center;
line-height: 80rpx;
margin-top: 2%;
// margin-left: 6%;
position: absolute;
bottom: 10%;
width: 100%;
.foterLeft {
width: 43%;
background: #f6f7f8;
height: 80rpx;
border-top-left-radius: 40rpx;
border-bottom-left-radius: 40rpx;
color: #5181f6;
}
.foterRight {
width: 43%;
background: #5181f6;
height: 80rpx;
border-top-right-radius: 40rpx;
border-bottom-right-radius: 40rpx;
color: #fff;
}
}
}
.searchBox {
// background-color: white;
background-color: #F3F5F7;
}
.uni-form-item {
position: relative;
display: flex;
align-items: center;
font-size: 28rpx;
/* .search-icon{
position: absolute;
top: 50%;
right: 50rpx;
transform: translateY(-50%);
} */
}
.uni-input {
border-radius: 40rpx;
margin: 20rpx;
// background-color: #f7f8fa;
background: #FFFFFF;
height: 70rpx;
line-height: 60rpx;
padding: 0 40rpx;
font-size: 28rpx;
flex: 1;
}
.screen {
line-height: 100rpx;
color: gray;
}
.flex {
display: flex;
align-items: center;
}
.content {
padding: 0px 30rpx 20rpx;
box-sizing: border-box;
width: 100%;
}
.download {
display: flex;
flex-wrap: wrap;
align-items: center;
margin-top: 10rpx;
// justify-content: center;
}
.img {
width: 120rpx;
height: 120rpx;
}
.dangerbig-list {
min-height: 100%;
// background: #F6F6F6;
background-color: #F3F5F7;
.fixedheader {
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 2;
.headerName {
z-index: 1;
}
:deep( .headerBox ){
background-color: #F3F5F7;
}
:deep( .right ){
font-size: 24rpx;
position: absolute;
right: 20rpx;
top: 50%;
z-index: 4;
transform: translateY(-50%);
.scancode {
width: 44rpx;
height: 44rpx;
}
}
}
.list {
padding: 20rpx 0;
margin: 0 20rpx;
.list-item {
background: #fff;
margin-bottom: 20rpx;
padding: 20rpx 0;
position: relative;
border-radius: 24rpx;
.list-title {
padding: 10rpx 20rpx;
// border-bottom: 4rpx solid #F6F6F6;
display: flex;
align-items: center;
justify-content: space-between;
.tag {
background: #F0AD4E;
color: #fff;
padding: 4rpx 8rpx;
font-size: 24rpx;
margin-right: 20rpx;
margin-left: -20rpx;
height: 32rpx;
}
.status1 {
background: #2b8df3;
color: #fff;
padding: 4rpx 8rpx;
font-size: 24rpx;
}
.status2 {
background: #F0AD4E;
color: #fff;
padding: 4rpx 8rpx;
font-size: 24rpx;
}
.status3 {
background: #B22222;
color: #fff;
padding: 4rpx 8rpx;
font-size: 24rpx;
}
.status4 {
background: #ccc;
color: #fff;
padding: 4rpx 8rpx;
font-size: 24rpx;
}
}
.list-info {
display: flex;
padding: 10rpx 20rpx;
font-size: 28rpx;
// border-bottom: 2rpx solid #F6F6F6;
}
.info-status {
padding: 3rpx 16rpx;
// border: 1px solid #DD524D;
// border-radius: 6rpx;
// color: #DD524D;
margin-left: 10rpx;
border-radius: 30rpx;
background-color: #DD524D;
color: white;
}
.btn_detail {
background-color: #4181FE;
color: white;
padding: 3rpx 16rpx;
border-radius: 30rpx;
position: absolute;
bottom: 16rpx;
right: 16rpx;
}
}
}
.btn {
height: 96rpx;
width: 100%;
line-height: 96rpx;
text-align: center;
background: #4181FE;
color: #fff;
position: fixed;
bottom: 0;
left: 0;
}
.no-data {
text-align: center;
.img {
display: block;
height: 200rpx;
width: 200rpx;
margin: 0 auto;
margin-top: 560rpx;
margin-bottom: 60rpx;
}
.txt {
color: #CFC8CC;
}
}
}
</style>