userSelect

This commit is contained in:
shijing 2022-11-10 14:27:03 +08:00
parent ce0c440666
commit 411e2bb2b8
6 changed files with 395 additions and 66 deletions

View File

@ -0,0 +1,64 @@
<template>
<view class="componentWrap">
<uni-nav-bar
@clickLeft="goBack()"
class="nav-bar" leftText="人员选择"
height="110rpx" leftWidth="200rpx"
leftIcon="left" backgroundColor="#2cade8" color="#fff"
border fixed statusBar shadow
></uni-nav-bar>
<view class="apply-info">
<view> 返回上一级 </view>
<view> 返回上一级 </view>
<view> 返回上一级 </view>
<view> 返回上一级 </view>
<view> 返回上一级 </view>
<view> 返回上一级 </view>
<view> 返回上一级 </view>
</view>
</view>
</template>
<script>
export default {
data() {
return {};
},
onLoad() {},
onShow() {},
methods: {
goBack() {
uni.navigateBack({
delta: 1
});
}
}
};
</script>
<style scoped>
>>> .uni-navbar__header,
>>> .uni-status-bar {
background-image: linear-gradient(254deg, #0ca7ee 0%, #005aff 100%, #2a8cff 100%, #54bdff 100%),
linear-gradient(#e60012, #e60012);
}
>>> uni-image {
height: 200upx;
width: 200upx;
}
.componentWrap {
background-color: #f3fbff;
padding-bottom: 227rpx;
}
.apply-info {
width: 720rpx;
margin: 0 auto;
background-color: #FFFFFF;
border-radius: 10rpx;
padding: 25rpx 32rpx;
box-sizing: border-box;
margin-top: 24rpx;
}
</style>

View File

@ -16,7 +16,7 @@
"navigationBarTitleText": "曲阳金隅EHS-密码登录",
"enablePullDownRefresh": false
}
},{
}, {
"path": "pages/login/userRegister",
"style": {
"navigationBarTitleText": "曲阳金隅EHS-新用户注册",
@ -146,13 +146,13 @@
"enablePullDownRefresh": false
}
},
{
"path": "pages/workSpace/newWork/userList",
"style": {
"navigationBarTitleText": "选择人员",
"navigationStyle": "custom",
"enablePullDownRefresh": false
"enablePullDownRefresh": false
}
},
{
@ -160,7 +160,7 @@
"style": {
"navigationBarTitleText": "添加人员",
"navigationStyle": "custom",
"enablePullDownRefresh": false
"enablePullDownRefresh": false
}
},
{
@ -168,7 +168,7 @@
"style": {
"navigationBarTitleText": "新增违章",
"navigationStyle": "custom",
"enablePullDownRefresh": false
"enablePullDownRefresh": false
}
},
{
@ -232,7 +232,7 @@
"style": {
"navigationBarTitleText": "曲阳金隅EHS-来访项目",
"navigationStyle": "custom",
"enablePullDownRefresh": false
"enablePullDownRefresh": false
}
},
{
@ -240,7 +240,7 @@
"style": {
"navigationBarTitleText": "新建来访项目",
"navigationStyle": "custom",
"enablePullDownRefresh": false
"enablePullDownRefresh": false
}
},
{
@ -248,7 +248,7 @@
"style": {
"navigationBarTitleText": "选择人员",
"navigationStyle": "custom",
"enablePullDownRefresh": false
"enablePullDownRefresh": false
}
},
{
@ -256,7 +256,7 @@
"style": {
"navigationBarTitleText": "来访项目查看",
"navigationStyle": "custom",
"enablePullDownRefresh": false
"enablePullDownRefresh": false
}
},
{
@ -264,7 +264,7 @@
"style": {
"navigationBarTitleText": "动火作业许可证",
"navigationStyle": "custom",
"enablePullDownRefresh": false
"enablePullDownRefresh": false
}
},
{
@ -272,7 +272,7 @@
"style": {
"navigationBarTitleText": "高处作业许可证",
"navigationStyle": "custom",
"enablePullDownRefresh": false
"enablePullDownRefresh": false
}
},
{
@ -280,7 +280,7 @@
"style": {
"navigationBarTitleText": "临时用电许可证",
"navigationStyle": "custom",
"enablePullDownRefresh": false
"enablePullDownRefresh": false
}
},
{
@ -288,7 +288,7 @@
"style": {
"navigationBarTitleText": "动土作业许可证",
"navigationStyle": "custom",
"enablePullDownRefresh": false
"enablePullDownRefresh": false
}
},
{
@ -296,7 +296,7 @@
"style": {
"navigationBarTitleText": "预热器清堵作业许可证",
"navigationStyle": "custom",
"enablePullDownRefresh": false
"enablePullDownRefresh": false
}
},
{
@ -304,7 +304,7 @@
"style": {
"navigationBarTitleText": "吊装作业许可证",
"navigationStyle": "custom",
"enablePullDownRefresh": false
"enablePullDownRefresh": false
}
},
{
@ -312,7 +312,7 @@
"style": {
"navigationBarTitleText": "篦冷机清大块作业许可证",
"navigationStyle": "custom",
"enablePullDownRefresh": false
"enablePullDownRefresh": false
}
},
{
@ -320,7 +320,7 @@
"style": {
"navigationBarTitleText": "清库作业许可证",
"navigationStyle": "custom",
"enablePullDownRefresh": false
"enablePullDownRefresh": false
}
},
{
@ -328,7 +328,7 @@
"style": {
"navigationBarTitleText": "有限空间作业许可证",
"navigationStyle": "custom",
"enablePullDownRefresh": false
"enablePullDownRefresh": false
}
},
{
@ -336,7 +336,7 @@
"style": {
"navigationBarTitleText": "人员确定",
"navigationStyle": "custom",
"enablePullDownRefresh": false
"enablePullDownRefresh": false
}
},
{
@ -348,7 +348,7 @@
},
{
"path": "pages/my/myInfo",
"style": {
"style": {
"navigationBarTitleText": "个人信息",
"navigationStyle": "custom",
"enablePullDownRefresh": false
@ -356,7 +356,7 @@
},
{
"path": "pages/my/myInfoChange",
"style": {
"style": {
"navigationBarTitleText": "个人信息完善",
"navigationStyle": "custom",
"enablePullDownRefresh": false
@ -364,7 +364,7 @@
},
{
"path": "pages/my/myCertificates",
"style": {
"style": {
"navigationBarTitleText": "我的证书",
"navigationStyle": "custom",
"enablePullDownRefresh": false
@ -372,7 +372,7 @@
},
{
"path": "pages/my/clock_in",
"style": {
"style": {
"navigationBarTitleText": "打卡记录",
"navigationStyle": "custom",
"enablePullDownRefresh": false
@ -380,7 +380,7 @@
},
{
"path": "pages/my/passwordChange",
"style": {
"style": {
"navigationBarTitleText": "修改密码",
"navigationStyle": "custom",
"enablePullDownRefresh": false
@ -388,7 +388,7 @@
},
{
"path": "pages/workSpace/visit/visitor",
"style": {
"style": {
"navigationBarTitleText": "我的访客库",
"navigationStyle": "custom",
"enablePullDownRefresh": false
@ -396,11 +396,19 @@
},
{
"path": "pages/workSpace/rpj/remployee",
"style": {
"style": {
"navigationBarTitleText": "我的人员库",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},
{
"path": "pages/comm/userSelect/index",
"style": {
"navigationBarTitleText": "人员选择",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {

View File

@ -0,0 +1,266 @@
<template>
<view class="componentWrap">
<uni-nav-bar
@clickLeft="goBack()"
class="nav-bar" leftText="人员选择"
height="110rpx" leftWidth="200rpx"
leftIcon="left" backgroundColor="#2cade8" color="#fff"
border fixed statusBar shadow
></uni-nav-bar>
<view class="list-wrap">
<button @click="backPreLevel"> 返回上一级 </button>
<view>
<view v-for="(dept,index) in showDepts" :key="dept.id" class="listItem" @click="deptClick(dept,index)">
<image class="deptImage" src="../../../static/common/wenjianjia.png"></image>
<view class="itemName"> {{dept.name}}</view>
</view>
<radio-group @change="(e) => radioChange(e)">
<label class="listItem"v-for="(user,index1) in userLists" :key="user.id">
<view>
<radio :value="user.id" :id="user.id" :name=user.name :checked="user.checked" />
</view>
<image class="userImage" src="../../../static/login/userRegister.png"></image>
<view>{{user.name}}</view>
</label>
</radio-group>
</view>
</view>
<view class="bottomBlock">
<text v-if="selectedUser.length>0" class="checkUserShow">已选人员{{selectedUser[0].name}}</text>
<button size="mini" type="primary" class="submitBtn" @click="submitClick">确定</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
type:'',
typeName:'',
level:'dept',
showDepts:[],
deptLists:[],
userLists:[],
rpartyLists:[],
selectedUser:[],
currentDept:'',
currentIndex:'',
currentParent:'',
currentId:''
};
},
onLoad(params) {
this.type = params.type;
this.typeName = params.typeName;
},
onShow() {
this.getDept();
this.getRparty();
},
methods: {
getDept(){
let that = this;
that.$u.api.deptList({
page: 0,
type__in: 'dept',
query: '{id, name, parent, type}'
}).then(res => {
console.log(res);
that.showDepts = res;
that.deptLists = res;
})
},
getRparty(){
let that = this;
that.$u.api.deptList({
page: 0,
type__in: 'rparty',
query: '{id, name, parent, type}'
}).then(res => {
console.log(res);
that.rpartyLists = res;
})
},
//
deptClick(dept,index){
let that = this;
let showDepts = [];
let params = {
page: 0,
belong_dept: dept.id,
is_active: true,
query: '{id, name, belong_dept}'
};
if(that.level == 'dept'){
that.level = 'rparty';
that.currentIndex = index;
//
showDepts = that.rpartyLists.filter(item=>{
return item.parent==dept.id;
})
//
if(that.deptLists[index].childreUser){
that.userLists =that.deptLists[index].childreUser;
that.userLists
for(let i = 0;i<that.userLists.length;i++){
if(that.userLists[i].id==that.currentId){
that.userLists[i].checked = true
}
}
}else{
that.$u.api.userList(params).then(res=>{
let arr = [];
res.forEach(userItem=>{
let obj = {};
obj = userItem;
obj.checked = false;
arr.push(obj)
})
that.deptLists[index].childreUser = arr;
that.userLists =arr;
})
}
}else if(that.level == 'rparty'){
that.level = 'user';
showDepts = [];
//
that.$u.api.userList(params).then(res=>{
let arr = [];
res.forEach(userItem=>{
let obj = {};
obj = userItem;
if(that.currentId!==''&&that.currentId==userItem.id){
obj.checked = true;
}else{
obj.checked = false;
}
arr.push(obj)
})
that.userLists =arr;
})
}
that.currentDept = dept.id;
that.currentParent = dept.parent;
that.showDepts = showDepts;
},
//
backPreLevel(){
let that = this;
if(that.level == 'user'){//
//
that.level = 'rparty';
that.showDepts = that.deptList;
that.currentDept = that.currentParent;
//
that.showDepts = that.rpartyLists.filter(item=>{
return item.parent==that.currentDept;
})
that.userLists = that.deptLists[that.currentIndex].childreUser;
}else if(that.level == 'rparty'){
that.level = 'dept';
that.showDepts = that.deptLists;
//
that.userLists = [];
}
},
radioChange(e,item){
let that = this;
let value = e.detail.value;
that.currentId = value;
that.selectedUser = that.userLists.filter(item=>{
return item.id == value;
})
},
submitClick(){
debugger;
let pages = getCurrentPages(); //
let nowPage = pages[ pages.length - 1]; //
let prevPage = pages[ pages.length - 2 ]; //
prevPage.$vm.formData[this.type] = this.selectedUser[0].id;
prevPage.$vm[this.typeName] = this.selectedUser[0].name;
// uni.navigateBack({
// delta: 1
// });
// let obj={};
// obj.type=this.type;
// obj.id=this.selectedUser[0].id;
// obj.name=this.selectedUser[0].name;
// uni.$emit('Selection',obj)
uni.navigateBack({
delta: 1
});
},
goBack() {
uni.navigateBack({
delta: 1
});
}
}
};
</script>
<style scoped>
>>> .uni-navbar__header,
>>> .uni-status-bar {
background-image: linear-gradient(254deg, #0ca7ee 0%, #005aff 100%, #2a8cff 100%, #54bdff 100%),
linear-gradient(#e60012, #e60012);
}
>>> uni-image {
height: 200upx;
width: 200upx;
}
.componentWrap {
background-color: #f3fbff;
padding-bottom: 227rpx;
}
.list-wrap {
width: 720rpx;
margin: 0 auto;
background-color: #FFFFFF;
border-radius: 10rpx;
padding: 25rpx 32rpx;
box-sizing: border-box;
margin-top: 24rpx;
}
.listItem{
display: flex;
width: 100%;
padding: 28upx;
align-items: center;
border-bottom: 1upx solid #dddddd;
}
.deptImage{
width: 37upx;
height: 33upx;
margin-right: 28upx;
}
.userImage{
width: 50upx;
height: 50upx;
margin-right: 28upx;
}
.itemName{
line-height: 100%;
}
.bottomBlock{
width: 100%;
height: 150upx;
position: fixed;
bottom: 0;
background-color: #015efe;
color: #ffffff;
z-index: 100;
}
.checkUserShow{
padding-left:20upx;
line-height: 150upx;
}
.submitBtn{
position: absolute;
bottom: 40upx;
right: 30upx;
background-color: #ff7000;
}
</style>

View File

@ -30,7 +30,7 @@
</view>
<text class="title-text-left">待审批</text>
</view>
<view class="" @click="goIntoTargetPage('daiban')">
<view class="" @click="goIntoTargetPage('duty')">
<text class="title-text-right">查看更多</text>
<uni-icons type="right" :size="11" color="#ababab"></uni-icons>
</view>
@ -73,7 +73,7 @@
</view>
<text class="title-text-left">抄送我</text>
</view>
<view class="" @click="goIntoTargetPage('daiban')">
<view class="" @click="goIntoTargetPage('cc')">
<text class="title-text-right">查看更多</text>
<uni-icons type="right" :size="11" color="#ababab"></uni-icons>
</view>
@ -242,14 +242,15 @@
// debugger;
if(this.limitedVisit==true){
}else{
if (type == "daiban") {
let params = `?type=${type}`;
if (type == "duty") {
uni.navigateTo({
url: "./list/ticket"
url: "./list/ticket"+params
})
}
if (type == "copy") {
if (type == "cc") {
uni.navigateTo({
url: "./list/ticket"
url: "./list/ticket"+params
})
}
if (type == "warning") {

View File

@ -78,8 +78,8 @@
return {
params: {
search: '',
pageSize: 10,
pageNum: 1,
page_size: 10,
page: 1,
category: 'duty'
},
userId:'',
@ -88,11 +88,15 @@
ticketList: [],
}
},
onLoad(params) {
this.ticketTypye = params.type;
this.params.category = params.type;
},
//
onReachBottom() {
const totalPage = Math.ceil(this.totalNum / this.params.pageSize);
if (this.params.pageNum < totalPage) {
this.params.pageNum += 1;
const totalPage = Math.ceil(this.totalNum / this.params.page_size);
if (this.params.page < totalPage) {
this.params.page += 1;
this.getTicketLists();
} else {
uni.showToast({
@ -107,7 +111,7 @@
},
//
onPullDownRefresh() {
this.params.pageNum = 1;
this.params.page = 1;
this.ticketList = [];
this.getTicketLists();
},
@ -158,12 +162,12 @@
})
},
searchHandle() {
this.params.pageNum = 1;
this.params.page = 1;
this.ticketList = [];
this.getTicketLists()
},
resetSearch() {
this.params.pageNum = 1;
this.params.page = 1;
this.params.search = "";
this.ticketList = [];
this.getTicketLists();
@ -172,7 +176,7 @@
// debugger;
this.ticketTypye = index;
this.ticketList = [];
this.params.pageNum = 1;
this.params.page = 1;
if (index === 'duty') {
this.params.category = 'duty';
} else if (index === 'owner') {

View File

@ -58,21 +58,17 @@
</view>
</view> -->
<view class="form-item border-bottom" v-if="formData.purpose!==50">
<view class="form-left">
<view class="form-left" @click="Selection">
<text class="form-left-text">接待人</text>
</view>
<view class="form-right">
<ba-tree-picker ref="dcoordinator_Picker" :multiple='false' @select-change="select_coordinator_Change" title="选择接待人"
:localdata="vuex_userRange2" valueKey="id" textKey="name" childrenKey="children" :selectParent='false'/>
<!-- <ba-tree-picker ref="dcoordinator_Picker" :multiple='false' @select-change="select_coordinator_Change" title="选择接待人"
:localdata="vuex_userRange2" valueKey="id" textKey="name" childrenKey="children" :selectParent='false'/> -->
<view @click="showDcoordinatorPicker" style="position: relative;display: flex;">
<text type="text" >{{receptionist_name}}</text>
<uni-icons style="position: absolute; right: 0;" type="arrowright" color="#999999"/>
</view>
</view>
<!-- <view class="form-right">
<uni-data-select v-model="formData.receptionist" :localdata="userRange">
</uni-data-select>
</view> -->
</view>
<view class="form-item border-bottom" v-if="formData.purpose!==50">
<view class="form-left">
@ -94,7 +90,6 @@
</view>
<view class="form-item border-bottom">
<view class="form-left">
<!-- <text class="star">*</text> -->
<text class="form-left-text">来访人数</text>
</view>
<view class="form-right">
@ -110,14 +105,10 @@
</template>
<script>
import baTreePicker from "../../comm/ba-tree-picker/ba-tree-picker.vue";
import nonNullCheck from '../../../utils/nonNullCheck.js';
import resetData from '../../../utils/common.js';
export default {
name: "visit",
components:{
baTreePicker
},
data() {
return {
formData: {
@ -192,17 +183,17 @@
}
},
onShow() {
// uni.$once('Selection',function(e){
// debugger;
// console.log(e)
// })
},
methods: {
showDcoordinatorPicker(){
this.$refs.dcoordinator_Picker._show();
},
cancel(){
this.$refs.treePicker._hide();
},
select_coordinator_Change(ids, names){
this.formData.receptionist = ids[0];
this.receptionist_name = names;
let params='?type=receptionist&typeName=receptionist_name'
uni.navigateTo({
url:"../../comm/userSelect/index"+params
})
},
getVisitItem() {
this.$u.api.visitItem(this.visitId).then(res => {
@ -346,11 +337,6 @@
background-color: #f3fbff;
padding-bottom: 227rpx;
}
/* >>>.uni-status-bar {
height: 0 !important;
} */
>>>.uni-navbar-btn-text text {
font-size: 32rpx !important;
}