人员缓存优化
This commit is contained in:
parent
e70d70edff
commit
959a846bcf
171
App.vue
171
App.vue
|
@ -4,6 +4,57 @@
|
||||||
globalData: {
|
globalData: {
|
||||||
appid: 'wxf7d6140f507466be'
|
appid: 'wxf7d6140f507466be'
|
||||||
},
|
},
|
||||||
|
getUserRange() {
|
||||||
|
let that = this;
|
||||||
|
that.$u.api.deptList({
|
||||||
|
page: 0,
|
||||||
|
type__in: 'rparty,dept',
|
||||||
|
query: '{id, name, parent, type}'
|
||||||
|
}).then(res => {
|
||||||
|
let list1 = res;
|
||||||
|
let list2 = [];
|
||||||
|
let reqList = [];
|
||||||
|
list1.forEach(function(item) {
|
||||||
|
reqList.push(that.$u.api.userList({
|
||||||
|
page: 0,
|
||||||
|
belong_dept: item.id,
|
||||||
|
is_active: true,
|
||||||
|
query: '{id, name, belong_dept}'
|
||||||
|
}))
|
||||||
|
})
|
||||||
|
Promise.all(reqList).then(res => {
|
||||||
|
for (let i = 0; i < res.length; i++) {
|
||||||
|
list1[i].children = res[i]
|
||||||
|
}
|
||||||
|
list1.forEach(item=>{
|
||||||
|
if(item.type == 'dept'){
|
||||||
|
list2.push({ ...item })
|
||||||
|
}
|
||||||
|
})
|
||||||
|
that.$u.vuex('vuex_userRange', that.parseData(list1))
|
||||||
|
that.$u.vuex('vuex_userRange2', that.parseData(list2))
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
parseData(data) {
|
||||||
|
// * 先生成parent建立父子关系
|
||||||
|
const obj = {};
|
||||||
|
data.forEach((item) => {
|
||||||
|
obj[item.id] = item;
|
||||||
|
});
|
||||||
|
const parentList = [];
|
||||||
|
data.forEach((item) => {
|
||||||
|
const parent = obj[item.parent];
|
||||||
|
if (parent) {
|
||||||
|
// * 当前项有父节点
|
||||||
|
parent.children = parent.children || [];
|
||||||
|
parent.children.unshift(item);
|
||||||
|
} else {
|
||||||
|
parentList.push(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return parentList;
|
||||||
|
},
|
||||||
onLaunch() {
|
onLaunch() {
|
||||||
|
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
|
@ -68,7 +119,6 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
uni.getSystemInfo({
|
uni.getSystemInfo({
|
||||||
success(res) {
|
success(res) {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
|
@ -99,125 +149,6 @@
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
uni.showLoading({
|
|
||||||
title: '自动登录中...',
|
|
||||||
mask: true
|
|
||||||
})
|
|
||||||
uni.getStorage({
|
|
||||||
key: 'mySecret',
|
|
||||||
success: function(res) {
|
|
||||||
let secret = res.data
|
|
||||||
if (secret) {
|
|
||||||
uni.showToast({
|
|
||||||
title: JSON.parse(secret).username,
|
|
||||||
icon: "none"
|
|
||||||
})
|
|
||||||
that.$u.api.loginSecret(JSON.parse(secret)).then(res => {
|
|
||||||
that.$u.vuex('vuex_token', res.access)
|
|
||||||
that.$u.api.getUserInfo().then(res => {
|
|
||||||
if(res.avatar){
|
|
||||||
res.avatar = this.vuex_host + res.avatar
|
|
||||||
}
|
|
||||||
that.$u.vuex('vuex_user', res)
|
|
||||||
let perms = [];
|
|
||||||
for (let key in user.perms) {
|
|
||||||
perms.push(key);
|
|
||||||
}
|
|
||||||
console.log(perms);
|
|
||||||
that.$u.vuex('vuex_perm', perms)
|
|
||||||
// 修改资源请求地址
|
|
||||||
})
|
|
||||||
uni.reLaunch({
|
|
||||||
url: '/pages/home/home_'
|
|
||||||
})
|
|
||||||
}).catch(e=>{
|
|
||||||
uni.reLaunch({
|
|
||||||
url: '/pages/login/login_'
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
uni.reLaunch({
|
|
||||||
url: '/pages/login/login_'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
fail() {
|
|
||||||
uni.reLaunch({
|
|
||||||
url: '/pages/login/login_'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
complete() {
|
|
||||||
uni.hideLoading()
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// 根据设备唯一标识进行自动登录
|
|
||||||
uni.showToast({
|
|
||||||
title: qyjyClientId,
|
|
||||||
icon: "none"
|
|
||||||
})
|
|
||||||
/* that.$u.api.loginCOde(qyjyClientId).then(res => {
|
|
||||||
that.$u.api.getUserInfo().then(res => {
|
|
||||||
that.$u.vuex('vuex_user', res)
|
|
||||||
// 修改资源请求地址
|
|
||||||
})
|
|
||||||
uni.reLaunch({
|
|
||||||
url: '/pages/home/home_'
|
|
||||||
})
|
|
||||||
}).catch(res=>{
|
|
||||||
uni.reLaunch({
|
|
||||||
url: '/pages/login/login_'
|
|
||||||
})
|
|
||||||
}) */
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
uni.showLoading({
|
|
||||||
title: '自动登录中...',
|
|
||||||
mask: true
|
|
||||||
})
|
|
||||||
uni.getStorage({
|
|
||||||
key: 'mySecret',
|
|
||||||
success: function(res) {
|
|
||||||
let secret = res.data
|
|
||||||
if (secret) {
|
|
||||||
|
|
||||||
uni.showToast({
|
|
||||||
title: JSON.parse(secret).username,
|
|
||||||
icon: "none"
|
|
||||||
})
|
|
||||||
let a=JSON.parse(secret).username;
|
|
||||||
console.log(a)
|
|
||||||
that.$u.api.getUserInfo().then(res => {
|
|
||||||
that.$u.vuex('vuex_user', res)
|
|
||||||
let perms = [];
|
|
||||||
for (let key in user.perms) {
|
|
||||||
perms.push(key);
|
|
||||||
}
|
|
||||||
console.log(perms);
|
|
||||||
that.$u.vuex('vuex_perm', perms)
|
|
||||||
if(res.type==='employee'||res.type==='remployee'){
|
|
||||||
uni.reLaunch({
|
|
||||||
url: '/pages/home/home_'
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
uni.reLaunch({
|
|
||||||
url: '/pages/workSpace/workSpace'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 修改资源请求地址
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
complete() {
|
|
||||||
uni.hideLoading()
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
"name" : "曲阳金隅EHS",
|
"name" : "曲阳金隅EHS",
|
||||||
"appid" : "__UNI__B00D419",
|
"appid" : "__UNI__B00D419",
|
||||||
"description" : "曲阳金隅EHS",
|
"description" : "曲阳金隅EHS",
|
||||||
"versionName" : "1.01.04",
|
"versionName" : "1.01.06",
|
||||||
"versionCode" : 10104,
|
"versionCode" : 10106,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
|
@ -121,6 +121,6 @@
|
||||||
"mode" : "history",
|
"mode" : "history",
|
||||||
"base" : "/h5/"
|
"base" : "/h5/"
|
||||||
},
|
},
|
||||||
"title" : "共享平台"
|
"title" : "曲阳金隅EHS"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
{
|
{
|
||||||
"path": "pages/home/home_",
|
"path": "pages/home/home_",
|
||||||
"style": {
|
"style": {
|
||||||
// "navigationBarTitleText": "曲阳金隅EHS主页",
|
"navigationBarTitleText": "曲阳金隅EHS主页",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,32 +2,32 @@
|
||||||
<view class="ticket-handle">
|
<view class="ticket-handle">
|
||||||
<uni-nav-bar @clickLeft="goBack()" class="nav-bar" height="110rpx" leftWidth="200rpx" leftText="工单审批"
|
<uni-nav-bar @clickLeft="goBack()" class="nav-bar" height="110rpx" leftWidth="200rpx" leftText="工单审批"
|
||||||
leftIcon="left" border backgroundColor="#2cade8" color="#fff" fixed statusBar shadow></uni-nav-bar>
|
leftIcon="left" border backgroundColor="#2cade8" color="#fff" fixed statusBar shadow></uni-nav-bar>
|
||||||
<view class="ticket-info">
|
<view class="ticket-info">
|
||||||
<view class="form-item border-bottom">
|
<view class="form-item border-bottom">
|
||||||
<view class="form-left">
|
<view class="form-left">
|
||||||
<text class="form-left-text">工单流水号</text>
|
<text class="form-left-text">工单流水号</text>
|
||||||
</view>
|
|
||||||
<view class="form-right">
|
|
||||||
<view>{{ticketDetail.sn}}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="form-item border-bottom">
|
<view class="form-right">
|
||||||
<view class="form-left">
|
<view>{{ticketDetail.sn}}</view>
|
||||||
<text class="form-left-text">工单名称</text>
|
|
||||||
</view>
|
|
||||||
<view class="form-right">
|
|
||||||
<view>{{ticketDetail.title}}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="form-item" @click="logView">
|
|
||||||
<view class="form-left">
|
|
||||||
<text class="form-left-text">工单状态</text>
|
|
||||||
</view>
|
|
||||||
<view class="form-right" style="color:blue">
|
|
||||||
<view>{{ticketDetail.state_.name}}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="form-item border-bottom">
|
||||||
|
<view class="form-left">
|
||||||
|
<text class="form-left-text">工单名称</text>
|
||||||
|
</view>
|
||||||
|
<view class="form-right">
|
||||||
|
<view>{{ticketDetail.title}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="form-item" @click="logView">
|
||||||
|
<view class="form-left">
|
||||||
|
<text class="form-left-text">工单状态</text>
|
||||||
|
</view>
|
||||||
|
<view class="form-right" style="color:blue">
|
||||||
|
<view v-if="ticketDetail.state">{{ticketDetail.state_.name}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<block v-if="cateType==='visit'">
|
<block v-if="cateType==='visit'">
|
||||||
<view class="ticket-info">
|
<view class="ticket-info">
|
||||||
<view class="form-content ">
|
<view class="form-content ">
|
||||||
|
@ -192,7 +192,7 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</block>
|
</block>
|
||||||
<block v-else-if="cateType==='opl'">
|
<block v-else-if="cateType==='opl'">
|
||||||
<view class="ticket-info">
|
<view class="ticket-info">
|
||||||
|
@ -269,7 +269,8 @@
|
||||||
<text class="form-left-text">所属作业</text>
|
<text class="form-left-text">所属作业</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="form-right">
|
<view class="form-right">
|
||||||
<view v-if="oplDetail.operation_" style="color:blue" @click="goOp">{{oplDetail.operation_.name}}</view>
|
<view v-if="oplDetail.operation_" style="color:blue" @click="goOp">{{oplDetail.operation_.name}}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="form-item border-bottom">
|
<view class="form-item border-bottom">
|
||||||
|
@ -332,42 +333,44 @@
|
||||||
</block>
|
</block>
|
||||||
<block v-if="type=='handle'">
|
<block v-if="type=='handle'">
|
||||||
<view class="ticket-info">
|
<view class="ticket-info">
|
||||||
<view class="form-item" v-if="ticketDetail.state_&&ticketDetail.state_.key==='opl_close'">
|
<view class="form-item" v-if="ticketDetail.state_&&ticketDetail.state_.key==='opl_close'">
|
||||||
<view class="form-left-text" style="width: 100%;">
|
<view class="form-left-text" style="width: 100%;">
|
||||||
<text class="star">*</text>
|
<text class="star">*</text>
|
||||||
<text>作业情况</text>
|
<text>作业情况</text>
|
||||||
</view>
|
|
||||||
<uni-data-select v-model="form.close_note" :localdata="noteOption" label="选择关闭原因"></uni-data-select>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="form-item" v-if="ticketDetail.state_&&ticketDetail.state_.key==='opl_close'">
|
<uni-data-select v-model="form.close_note" :localdata="noteOption" label="选择关闭原因"></uni-data-select>
|
||||||
<!-- <view class="form-left-text">
|
</view>
|
||||||
|
<view class="form-item" v-if="ticketDetail.state_&&ticketDetail.state_.key==='opl_close'">
|
||||||
|
<!-- <view class="form-left-text">
|
||||||
<text class="star">*</text>
|
<text class="star">*</text>
|
||||||
<text>关闭处理</text>
|
<text>关闭处理</text>
|
||||||
</view> -->
|
</view> -->
|
||||||
<uni-data-select v-model="form.close_dos" :localdata="dosOption" label="关闭处理"></uni-data-select>
|
<uni-data-select v-model="form.close_dos" :localdata="dosOption" label="关闭处理"></uni-data-select>
|
||||||
|
</view>
|
||||||
|
<view class="form-item" style="height: 300rpx;">
|
||||||
|
<view class="form-left-text">
|
||||||
|
<text class="star">*</text>
|
||||||
|
<text>审批意见</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="form-item" style="height: 300rpx;">
|
<textarea class="apply-reason-text" v-model="form.name" maxlength="250" placeholder="请输入" />
|
||||||
<view class="form-left-text">
|
</view>
|
||||||
<text class="star">*</text>
|
<view class="btn" style="display: flex;justify-content: space-between;margin-top: 20rpx;">
|
||||||
<text>审批意见</text>
|
<view class="left-content">
|
||||||
</view>
|
<button class="mini-btn" size="mini" type="primary" @click="addNode">加签</button>
|
||||||
<textarea class="apply-reason-text" v-model="form.name" maxlength="250" placeholder="请输入" />
|
<button class="mini-btn" size="mini"
|
||||||
|
v-if="ticketDetail.state_&&ticketDetail.state_.enable_deliver" type="primary" plain
|
||||||
|
@click="deliverNode">转交
|
||||||
|
</button>
|
||||||
</view>
|
</view>
|
||||||
<view class="btn" style="display: flex;justify-content: space-between;margin-top: 20rpx;">
|
<view class="right-time">
|
||||||
<view class="left-content">
|
<button v-for="item in operationBtn" :key="item.id" class="mini-btn" size="mini"
|
||||||
<button class="mini-btn" size="mini" type="primary" @click="addNode">加签</button>
|
:type="item.attribute_type===2?'warn':'primary'" @click="operationSubmit(item.id)"
|
||||||
<button class="mini-btn" size="mini" v-if="ticketDetail.state_&&ticketDetail.state_.enable_deliver"
|
style="margin-left:8upx">
|
||||||
type="primary" plain @click="deliverNode">转交
|
{{item.name}}
|
||||||
</button>
|
</button>
|
||||||
</view>
|
|
||||||
<view class="right-time">
|
|
||||||
<button v-for="item in operationBtn" :key="item.id" class="mini-btn" size="mini"
|
|
||||||
:type="item.attribute_type===2?'warn':'primary'" @click="operationSubmit(item.id)" style="margin-left:8upx">
|
|
||||||
{{item.name}}
|
|
||||||
</button>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
</block>
|
</block>
|
||||||
<view class="dialogWrap" v-if="logDialog">
|
<view class="dialogWrap" v-if="logDialog">
|
||||||
<view class="dialogCont">
|
<view class="dialogCont">
|
||||||
|
@ -376,19 +379,19 @@
|
||||||
<view class="dialogCloseImg" @click="closeDialog"></view>
|
<view class="dialogCloseImg" @click="closeDialog"></view>
|
||||||
</view>
|
</view>
|
||||||
<scroll-view style="height: 300px;" scroll-y="true">
|
<scroll-view style="height: 300px;" scroll-y="true">
|
||||||
<uni-list>
|
<uni-list>
|
||||||
<uni-list-item v-for="item in tLog" :key="item.id">
|
<uni-list-item v-for="item in tLog" :key="item.id">
|
||||||
<text slot="body">
|
<text slot="body">
|
||||||
<view>{{item.state_.name}}</view>
|
<view>{{item.state_.name}}</view>
|
||||||
<view style="color:gray">
|
<view style="color:gray;font-size: 28rpx;">
|
||||||
<span v-if="item.participant">{{item.participant_.name}}-</span>
|
<span v-if="item.participant">{{item.participant_.name}}-</span>
|
||||||
<span v-if="item.transition_attribute==1" style="color:green">同意-</span>
|
<span v-if="item.transition_attribute==1" style="color:green">同意-</span>
|
||||||
<span v-if="item.transition_attribute==2" style="color:red">拒绝-</span>
|
<span v-if="item.transition_attribute==2" style="color:red">拒绝-</span>
|
||||||
<span>{{item.create_time}}</span>
|
<span>{{item.create_time}}</span>
|
||||||
</view>
|
</view>
|
||||||
</text>
|
</text>
|
||||||
</uni-list-item>
|
</uni-list-item>
|
||||||
</uni-list>
|
</uni-list>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -406,7 +409,7 @@
|
||||||
})
|
})
|
||||||
return {
|
return {
|
||||||
logDialog: false,
|
logDialog: false,
|
||||||
tLog:[],
|
tLog: [],
|
||||||
form: {
|
form: {
|
||||||
suggestion: '',
|
suggestion: '',
|
||||||
close_note: '',
|
close_note: '',
|
||||||
|
@ -548,7 +551,7 @@
|
||||||
this.$u.api.getTicketLog(this.ticketId).then((res) => {
|
this.$u.api.getTicketLog(this.ticketId).then((res) => {
|
||||||
this.logDialog = true;
|
this.logDialog = true;
|
||||||
this.tLog = res;
|
this.tLog = res;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//工单详情
|
//工单详情
|
||||||
getticketItem() {
|
getticketItem() {
|
||||||
|
@ -676,7 +679,7 @@
|
||||||
url: '../detail/addNode' + params,
|
url: '../detail/addNode' + params,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
deliverNode(){
|
deliverNode() {
|
||||||
let params = `?ticketId=${this.ticketId}&type=deliver`;
|
let params = `?ticketId=${this.ticketId}&type=deliver`;
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '../detail/addNode' + params,
|
url: '../detail/addNode' + params,
|
||||||
|
@ -693,34 +696,36 @@
|
||||||
}
|
}
|
||||||
debugger;
|
debugger;
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
mask:true,
|
mask: true,
|
||||||
title:'正在提交...'
|
title: '正在提交...'
|
||||||
})
|
})
|
||||||
this.$u.api.ticketHandle(this.ticketId, params).then(res => {
|
this.$u.api.ticketHandle(this.ticketId, params).then(res => {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
}).catch(e=>{uni.hideLoading()})
|
}).catch(e => {
|
||||||
},
|
uni.hideLoading()
|
||||||
goOp(){
|
|
||||||
uni.navigateTo({
|
|
||||||
url:'/pages/workSpace/operation/operationDetail?operationId='+this.oplDetail.operation
|
|
||||||
})
|
|
||||||
|
|
||||||
},
|
|
||||||
goOpl(){
|
|
||||||
uni.navigateTo({
|
|
||||||
url:'/pages/workSpace/operation/oplDetail?oplId='+this.oplDetail.id
|
|
||||||
})
|
|
||||||
|
|
||||||
},
|
|
||||||
goVisit(){
|
|
||||||
uni.navigateTo({
|
|
||||||
url:'/pages/workSpace/visit/visitDetail?visit='+that.projectId
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
goRpj(){
|
goOp() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:'/pages/workSpace/rpj/rpjDetail?rpjId='+that.projectId
|
url: '/pages/workSpace/operation/operationDetail?operationId=' + this.oplDetail.operation
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
goOpl() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/workSpace/operation/oplDetail?oplId=' + this.oplDetail.id
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
goVisit() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/workSpace/visit/visitDetail?visit=' + that.projectId
|
||||||
|
})
|
||||||
|
},
|
||||||
|
goRpj() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/workSpace/rpj/rpjDetail?rpjId=' + that.projectId
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -975,6 +980,7 @@
|
||||||
border-top-width: 0;
|
border-top-width: 0;
|
||||||
border-bottom-color: #EBEEF5;
|
border-bottom-color: #EBEEF5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dialogWrap {
|
.dialogWrap {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
|
@ -984,7 +990,7 @@
|
||||||
left: 0;
|
left: 0;
|
||||||
z-index: 110;
|
z-index: 110;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dialogCont {
|
.dialogCont {
|
||||||
width: 90vw;
|
width: 90vw;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -996,7 +1002,7 @@
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dialogTitle {
|
.dialogTitle {
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
padding-bottom: 20rpx;
|
padding-bottom: 20rpx;
|
||||||
|
@ -1004,7 +1010,7 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dialogCloseImg {
|
.dialogCloseImg {
|
||||||
width: 52rpx;
|
width: 52rpx;
|
||||||
height: 52rpx;
|
height: 52rpx;
|
||||||
|
|
|
@ -81,7 +81,7 @@
|
||||||
</view>
|
</view>
|
||||||
<text>司机</text>
|
<text>司机</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -119,8 +119,14 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad(options) {
|
||||||
that = this;
|
that = this
|
||||||
|
var autoLoading = options.autoLoading;
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
if(autoLoading != 'no'){
|
||||||
|
that.appLogin()
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
checkboxChange(e) {
|
checkboxChange(e) {
|
||||||
|
@ -302,26 +308,26 @@
|
||||||
this.isMessage = true;
|
this.isMessage = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
userRegister(type){
|
userRegister(type) {
|
||||||
let params = `?type=${type}`;
|
let params = `?type=${type}`;
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/login/userRegister'+params
|
url: '/pages/login/userRegister' + params
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
ranStr(e) {
|
ranStr(e) {
|
||||||
//形参e,需要产生随机字符串的长度
|
//形参e,需要产生随机字符串的长度
|
||||||
//如果没有传参,默认生成32位长度随机字符串
|
//如果没有传参,默认生成32位长度随机字符串
|
||||||
e = e || 32;
|
e = e || 32;
|
||||||
//模拟随机字符串库
|
//模拟随机字符串库
|
||||||
var t = "ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz0123456789",
|
var t = "ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz0123456789",
|
||||||
a = t.length,//字符串t的长度,随机数生成最大值
|
a = t.length, //字符串t的长度,随机数生成最大值
|
||||||
n = "";
|
n = "";
|
||||||
for (let i = 0; i < e; i++) {
|
for (let i = 0; i < e; i++) {
|
||||||
//随机生成长度为e的随机字符串拼接
|
//随机生成长度为e的随机字符串拼接
|
||||||
n += t.charAt(Math.floor(Math.random() * a));
|
n += t.charAt(Math.floor(Math.random() * a));
|
||||||
}
|
}
|
||||||
//返回随机组合字符串
|
//返回随机组合字符串
|
||||||
return n
|
return n
|
||||||
},
|
},
|
||||||
//获取客户端ID
|
//获取客户端ID
|
||||||
getClientId() {
|
getClientId() {
|
||||||
|
@ -361,51 +367,51 @@
|
||||||
formSubmit(e) {
|
formSubmit(e) {
|
||||||
// debugger;
|
// debugger;
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '加载中'
|
title: '加载中'
|
||||||
});
|
});
|
||||||
var that = this;
|
var that = this;
|
||||||
const obj = e.target.value;
|
const obj = e.target.value;
|
||||||
if (!that.checkedParams(obj)) return;
|
if (!that.checkedParams(obj)) return;
|
||||||
that.$u.api.login(obj).then(res => {
|
that.$u.api.login(obj).then(res => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
that.$u.vuex('vuex_token', res.access)
|
that.$u.vuex('vuex_token', res.access)
|
||||||
that.$u.vuex('vuex_refresh', res.refresh);
|
that.$u.vuex('vuex_refresh', res.refresh);
|
||||||
that.getUserRange();
|
|
||||||
that.$u.api.getUserInfo().then(user => {
|
that.$u.api.getUserInfo().then(user => {
|
||||||
if(user.avatar){
|
if (user.avatar) {
|
||||||
user.avatar = this.vuex_host + user.avatar
|
user.avatar = this.vuex_host + user.avatar
|
||||||
}
|
}
|
||||||
that.$u.vuex('vuex_user', user)
|
that.$u.vuex('vuex_user', user)
|
||||||
if(user.avatar){
|
if (user.avatar) {
|
||||||
user.avatar = this.vuex_host + user.avatar
|
user.avatar = this.vuex_host + user.avatar
|
||||||
}
|
}
|
||||||
let perms = [];
|
let perms = [];
|
||||||
for (let key in user.perms) {
|
for (let key in user.perms) {
|
||||||
perms.push(key);
|
perms.push(key);
|
||||||
}
|
}
|
||||||
console.log(perms);
|
console.log(perms);
|
||||||
that.$u.vuex('vuex_perm', perms)
|
that.$u.vuex('vuex_perm', perms)
|
||||||
})
|
})
|
||||||
that.$u.api.hrmUserInfo().then(res => {
|
that.$u.api.hrmUserInfo().then(res => {
|
||||||
that.$u.vuex('vuex_employee', res)
|
that.$u.vuex('vuex_employee', res)
|
||||||
if(res.type==='employee'){
|
if (res.type === 'employee') {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/home/home_'
|
url: '/pages/home/home_'
|
||||||
})
|
})
|
||||||
}else{
|
} else {
|
||||||
//非正式员工
|
//非正式员工
|
||||||
if(res.id_number==''||res.photo==''||res.id_number==null||res.photo==null){
|
if (res.id_number == '' || res.photo == '' || res.id_number == null || res
|
||||||
|
.photo == null) {
|
||||||
//信息不完善,进入信息完善页面
|
//信息不完善,进入信息完善页面
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/my/myInfoChange'
|
url: '/pages/my/myInfoChange'
|
||||||
})
|
})
|
||||||
}else{
|
} else {
|
||||||
//信息完善
|
//信息完善
|
||||||
if(res.type==='remployee'){
|
if (res.type === 'remployee') {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/home/home_'
|
url: '/pages/home/home_'
|
||||||
})
|
})
|
||||||
}else{
|
} else {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/workSpace/workSpace'
|
url: '/pages/workSpace/workSpace'
|
||||||
})
|
})
|
||||||
|
@ -415,113 +421,77 @@
|
||||||
})
|
})
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
let secret = that.ranStr(12)
|
let secret = that.ranStr(12)
|
||||||
let mySecret = {'username': obj.username, 'secret': secret}
|
let mySecret = {
|
||||||
that.$u.api.bindSecret({secret: secret}).then(res=>{
|
'username': obj.username,
|
||||||
|
'secret': secret
|
||||||
|
}
|
||||||
|
that.$u.api.bindSecret({
|
||||||
|
secret: secret
|
||||||
|
}).then(res => {
|
||||||
uni.setStorageSync('mySecret', JSON.stringify(mySecret))
|
uni.setStorageSync('mySecret', JSON.stringify(mySecret))
|
||||||
uni.reLaunch({
|
// uni.reLaunch({
|
||||||
url: '/pages/home/home_'
|
// url: '/pages/home/home_'
|
||||||
})
|
// })
|
||||||
}).catch(e=>{})
|
}).catch(e => {})
|
||||||
// #endif
|
// #endif
|
||||||
|
that.getUserRange();
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getUserRange(){
|
getUserRange() {
|
||||||
let that = this;
|
let that = this;
|
||||||
that.$u.api.deptList({page: 0,type__in:'rparty,dept'}).then(res => {
|
that.$u.api.deptList({
|
||||||
let arr = [];
|
page: 0,
|
||||||
let obj = {};
|
type__in: 'rparty,dept',
|
||||||
res.forEach(item=>{
|
query: '{id, name, parent, type}'
|
||||||
obj = {...item};
|
}).then(res => {
|
||||||
obj.children = [];
|
let list1 = res;
|
||||||
arr.push(obj)
|
let list2 = [];
|
||||||
|
let reqList = [];
|
||||||
|
list1.forEach(function(item) {
|
||||||
|
reqList.push(that.$u.api.userList({
|
||||||
|
page: 0,
|
||||||
|
belong_dept: item.id,
|
||||||
|
is_active: true,
|
||||||
|
query: '{id, name, belong_dept}'
|
||||||
|
}))
|
||||||
})
|
})
|
||||||
var useArr = that.resetData(arr);
|
Promise.all(reqList).then(res => {
|
||||||
for (let i=0;i<useArr.length;i++){
|
for (let i = 0; i < res.length; i++) {
|
||||||
let requestList = []
|
list1[i].children = res[i]
|
||||||
requestList.push(that.$u.api.userList({page: 0,belong_dept:useArr[i].id}))
|
|
||||||
Promise.all(requestList).then(res=>{
|
|
||||||
res.forEach(item=>{
|
|
||||||
item.forEach(item0=>{
|
|
||||||
useArr[i].children.push(item0);
|
|
||||||
if(useArr[i].children.length>0){
|
|
||||||
let childrenArr = useArr[i].children;
|
|
||||||
for(let j = 0;j<childrenArr.length;j++){
|
|
||||||
let requestList2= []
|
|
||||||
if(childrenArr[j].children){
|
|
||||||
requestList2.push(that.$u.api.userList({page: 0,belong_dept:childrenArr[j].id}))
|
|
||||||
Promise.all(requestList2).then(res2=>{
|
|
||||||
res2.forEach(item=>{
|
|
||||||
item.forEach(item1=>{
|
|
||||||
useArr[i].children[j].children.push(item1);
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
that.$u.vuex('vuex_userRange', useArr)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getUser1(id) {
|
|
||||||
that.$u.api.userList({page: 0,belong_dept:id}).then(res0 => {
|
|
||||||
res0.forEach(item0=>{
|
|
||||||
useArr[i].children.push(item0);
|
|
||||||
that.$u.vuex('vuex_userRange', useArr);
|
|
||||||
if(useArr[i].children.length>0){
|
|
||||||
let childrenArr = useArr[i].children;
|
|
||||||
for(let j = 0;j<childrenArr.length;j++){
|
|
||||||
if(childrenArr[j].children){
|
|
||||||
that.$u.api.userList({page: 0,belong_dept:childrenArr[j].id}).then(res1 => {
|
|
||||||
res1.forEach(item1=>{
|
|
||||||
useArr[i].children[j].children.push(item1);
|
|
||||||
that.$u.vuex('vuex_userRange', useArr)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
list1.forEach(item => {
|
||||||
|
if (item.type == 'dept') {
|
||||||
|
list2.push({
|
||||||
|
...item
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
that.$u.vuex('vuex_userRange', that.parseData(list1))
|
||||||
|
that.$u.vuex('vuex_userRange2', that.parseData(list2))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
resetData(params) {
|
parseData(data) {
|
||||||
let posts = [];
|
// * 先生成parent建立父子关系
|
||||||
params.forEach((item) => {
|
const obj = {};
|
||||||
let obj = new Object();
|
data.forEach((item) => {
|
||||||
obj = {
|
obj[item.id] = item;
|
||||||
...item
|
});
|
||||||
};
|
const parentList = [];
|
||||||
obj.value = item.id;
|
data.forEach((item) => {
|
||||||
obj.text = item.name;
|
const parent = obj[item.parent];
|
||||||
obj.parentId = item.parent;
|
if (parent) {
|
||||||
posts.push(obj);
|
// * 当前项有父节点
|
||||||
});
|
parent.children = parent.children || [];
|
||||||
let obj = posts.reduce((res, v) => ((res[v.id] = v), res), {}); //Object
|
parent.children.unshift(item);
|
||||||
let arr = [];
|
} else {
|
||||||
for (let item of posts) {
|
parentList.push(item);
|
||||||
console.log(item)
|
}
|
||||||
if (item.parentId == null||item.parentId=="1561653664806998016") {
|
});
|
||||||
arr.push(item);
|
return parentList;
|
||||||
continue;
|
},
|
||||||
}else{
|
|
||||||
let parent = obj[item.parentId];
|
|
||||||
if(obj[item.parentId]!==undefined){
|
|
||||||
parent.children = parent.children ? parent.children : [];
|
|
||||||
parent.children.push(item);
|
|
||||||
}else{}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return arr;
|
|
||||||
},
|
|
||||||
formSubmit2(e) {
|
formSubmit2(e) {
|
||||||
var that = this;
|
var that = this;
|
||||||
const obj = e.target.value;
|
const obj = e.target.value;
|
||||||
|
@ -531,7 +501,7 @@
|
||||||
that.$u.vuex('vuex_refresh', res.refresh)
|
that.$u.vuex('vuex_refresh', res.refresh)
|
||||||
that.getUserRange();
|
that.getUserRange();
|
||||||
that.$u.api.getUserInfo().then(res => {
|
that.$u.api.getUserInfo().then(res => {
|
||||||
if(res.avatar){
|
if (res.avatar) {
|
||||||
res.avatar = this.vuex_host + res.avatar
|
res.avatar = this.vuex_host + res.avatar
|
||||||
}
|
}
|
||||||
that.$u.vuex('vuex_user', res)
|
that.$u.vuex('vuex_user', res)
|
||||||
|
@ -539,17 +509,21 @@
|
||||||
})
|
})
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
let secret = that.ranStr(12)
|
let secret = that.ranStr(12)
|
||||||
let mySecret = {'username': obj.username, 'secret': secret}
|
let mySecret = {
|
||||||
that.$u.api.bindSecret({secret: secret}).then(res=>{
|
'username': obj.username,
|
||||||
|
'secret': secret
|
||||||
|
}
|
||||||
|
that.$u.api.bindSecret({
|
||||||
|
secret: secret
|
||||||
|
}).then(res => {
|
||||||
uni.setStorageSync('mySecret', JSON.stringify(mySecret))
|
uni.setStorageSync('mySecret', JSON.stringify(mySecret))
|
||||||
}).catch(e=>{})
|
}).catch(e => {})
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/home/home_'
|
url: '/pages/home/home_'
|
||||||
})
|
})
|
||||||
}).catch(e => {
|
}).catch(e => {})
|
||||||
})
|
|
||||||
},
|
},
|
||||||
codeChange(text) {
|
codeChange(text) {
|
||||||
this.codeTips = text;
|
this.codeTips = text;
|
||||||
|
@ -559,7 +533,7 @@
|
||||||
// debugger;
|
// debugger;
|
||||||
console.log(this.phoneNumber)
|
console.log(this.phoneNumber)
|
||||||
if (this.phoneNumber !== '') {
|
if (this.phoneNumber !== '') {
|
||||||
if (this.$refs.uCode.canGetCode){
|
if (this.$refs.uCode.canGetCode) {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '正在获取验证码',
|
title: '正在获取验证码',
|
||||||
mask: true
|
mask: true
|
||||||
|
@ -580,15 +554,77 @@
|
||||||
this.$u.toast('请输入手机号');
|
this.$u.toast('请输入手机号');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
agreementFn(e){
|
agreementFn(e) {
|
||||||
if(e == 1){
|
if (e == 1) {
|
||||||
that.content = that.userContent;
|
that.content = that.userContent;
|
||||||
that.agreement = true;
|
that.agreement = true;
|
||||||
}else if(e == 2){
|
} else if (e == 2) {
|
||||||
that.content = that.privacyContent;
|
that.content = that.privacyContent;
|
||||||
that.agreement = true;
|
that.agreement = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
appLogin() {
|
||||||
|
var that = this;
|
||||||
|
// App自动登录
|
||||||
|
uni.showLoading({
|
||||||
|
title: '自动登录中...',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
uni.getStorage({
|
||||||
|
key: 'mySecret',
|
||||||
|
success: function(res) {
|
||||||
|
let secret = res.data
|
||||||
|
if (secret) {
|
||||||
|
that.$u.api.loginSecret(JSON.parse(secret)).then(res1 => {
|
||||||
|
that.$u.vuex('vuex_token', res1.access)
|
||||||
|
that.$u.api.getUserInfo().then(res2 => {
|
||||||
|
console.log(res2);
|
||||||
|
if (res2.avatar) {
|
||||||
|
res2.avatar = this.vuex_host + res2.avatar
|
||||||
|
}
|
||||||
|
that.$u.vuex('vuex_user', res2)
|
||||||
|
let perms = [];
|
||||||
|
for (let key in res2.perms) {
|
||||||
|
perms.push(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
that.$u.vuex('vuex_perm', perms)
|
||||||
|
// 修改资源请求地址
|
||||||
|
})
|
||||||
|
that.$u.api.hrmUserInfo().then(res3 => {
|
||||||
|
that.$u.vuex('vuex_employee', res3)
|
||||||
|
if (res3.type === 'employee') {
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pages/home/home_'
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
//非正式员工
|
||||||
|
if (res3.id_number == '' || res3.photo == '' || res3
|
||||||
|
.id_number == null || res3.photo == null) {
|
||||||
|
//信息不完善,进入信息完善页面
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pages/my/myInfoChange'
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
//信息完善
|
||||||
|
if (res3.type === 'remployee') {
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pages/home/home_'
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pages/workSpace/workSpace'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
that.getUserRange()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -833,30 +869,37 @@
|
||||||
padding-left: 12rpx;
|
padding-left: 12rpx;
|
||||||
padding-right: 12rpx;
|
padding-right: 12rpx;
|
||||||
}
|
}
|
||||||
.registerWrap{
|
|
||||||
|
.registerWrap {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-top: 40upx;
|
margin-top: 40upx;
|
||||||
}
|
}
|
||||||
.visitorReg{
|
|
||||||
|
.visitorReg {
|
||||||
margin-right: 50upx;
|
margin-right: 50upx;
|
||||||
}
|
}
|
||||||
.visitorReg,.driverRegWrap{
|
|
||||||
|
.visitorReg,
|
||||||
|
.driverRegWrap {
|
||||||
display: flex;
|
display: flex;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
.visitorReg>image{
|
|
||||||
|
.visitorReg>image {
|
||||||
width: 90upx;
|
width: 90upx;
|
||||||
height: 90upx;
|
height: 90upx;
|
||||||
}
|
}
|
||||||
.driverReg{
|
|
||||||
|
.driverReg {
|
||||||
width: 80upx;
|
width: 80upx;
|
||||||
height: 80upx;
|
height: 80upx;
|
||||||
border-radius: 40upx;
|
border-radius: 40upx;
|
||||||
background: #0075ff;
|
background: #0075ff;
|
||||||
margin-bottom: 8upx;
|
margin-bottom: 8upx;
|
||||||
}
|
}
|
||||||
.driverReg>image{
|
|
||||||
|
.driverReg>image {
|
||||||
width: 46upx;
|
width: 46upx;
|
||||||
height: 46upx;
|
height: 46upx;
|
||||||
margin: 16upx;
|
margin: 16upx;
|
||||||
|
|
|
@ -46,9 +46,15 @@
|
||||||
<text class="title-text">我的打卡记录</text>
|
<text class="title-text">我的打卡记录</text>
|
||||||
<uni-icons size="13" color="#b9b9b9" class="right-icon" type="right"></uni-icons>
|
<uni-icons size="13" color="#b9b9b9" class="right-icon" type="right"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="enter-item">
|
||||||
|
<image style="width: 34rpx;height: 30rpx;" class="left-icon" src="../../static/my/wodeziliao.png"
|
||||||
|
mode=""></image>
|
||||||
|
<text class="title-text">我的访客库</text>
|
||||||
|
<uni-icons size="13" color="#b9b9b9" class="right-icon" type="right"></uni-icons>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="sign-out">
|
<view class="sign-out">
|
||||||
<button type="default" @click="signoutFn" class="sign-out-btn">退出</button>
|
<button type="default" @click="signoutFn" class="sign-out-btn">退出账号</button>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -175,7 +181,7 @@
|
||||||
// error
|
// error
|
||||||
}
|
}
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url:'/pages/login/login_'
|
url:'/pages/login/login_?autoLoading=no'
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -249,7 +249,7 @@
|
||||||
this.getOplcates();
|
this.getOplcates();
|
||||||
this.getdept();
|
this.getdept();
|
||||||
this.getRange();
|
this.getRange();
|
||||||
this.getUserRange();
|
// this.getUserRange();
|
||||||
this.getHeader();
|
this.getHeader();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -241,7 +241,7 @@
|
||||||
this.getOplcates();
|
this.getOplcates();
|
||||||
this.getdept();
|
this.getdept();
|
||||||
this.getRange();
|
this.getRange();
|
||||||
this.getUserRange();
|
// this.getUserRange();
|
||||||
this.getHeader();
|
this.getHeader();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -244,7 +244,7 @@
|
||||||
this.getOplcates();
|
this.getOplcates();
|
||||||
this.getdept();
|
this.getdept();
|
||||||
this.getRange();
|
this.getRange();
|
||||||
this.getUserRange();
|
// this.getUserRange();
|
||||||
this.getHeader();
|
this.getHeader();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -351,7 +351,7 @@
|
||||||
this.getOplcates();
|
this.getOplcates();
|
||||||
this.getdept();
|
this.getdept();
|
||||||
this.getRange();
|
this.getRange();
|
||||||
this.getUserRange();
|
// this.getUserRange();
|
||||||
this.getHeader();
|
this.getHeader();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -63,7 +63,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="form-right">
|
<view class="form-right">
|
||||||
<ba-tree-picker ref="dcoordinator_Picker" :multiple='false' @select-change="select_coordinator_Change" title="选择接待人"
|
<ba-tree-picker ref="dcoordinator_Picker" :multiple='false' @select-change="select_coordinator_Change" title="选择接待人"
|
||||||
:localdata="vuex_userRange" valueKey="id" textKey="name" childrenKey="children" :selectParent='false'/>
|
:localdata="vuex_userRange2" valueKey="id" textKey="name" childrenKey="children" :selectParent='false'/>
|
||||||
<view @click="showDcoordinatorPicker" style="position: relative;display: flex;">
|
<view @click="showDcoordinatorPicker" style="position: relative;display: flex;">
|
||||||
<text type="text" >{{receptionist_name}}</text>
|
<text type="text" >{{receptionist_name}}</text>
|
||||||
<uni-icons style="position: absolute; right: 0;" type="arrowright" color="#999999"/>
|
<uni-icons style="position: absolute; right: 0;" type="arrowright" color="#999999"/>
|
||||||
|
@ -122,7 +122,7 @@
|
||||||
return {
|
return {
|
||||||
formData: {
|
formData: {
|
||||||
name: '', //来访概述
|
name: '', //来访概述
|
||||||
purpose: 50, //来访事由
|
purpose: 10, //来访事由
|
||||||
receptionist: '', //接待人
|
receptionist: '', //接待人
|
||||||
visit_time: '', //来访时间
|
visit_time: '', //来访时间
|
||||||
leave_time: '', //离开时间
|
leave_time: '', //离开时间
|
||||||
|
|
|
@ -143,7 +143,7 @@
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.getHeader();
|
this.getHeader();
|
||||||
this.getUserRange();
|
// this.getUserRange();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getHeader() {
|
getHeader() {
|
||||||
|
|
|
@ -107,8 +107,8 @@
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
// debugger;
|
// debugger;
|
||||||
console.log('vuex_userRange'+this.vuex_perm);
|
|
||||||
console.log(this.vuex_user);
|
console.log(this.vuex_user);
|
||||||
|
console.log(this.vuex_perm);
|
||||||
this.limitedRpj = this.vuex_perm.includes('rpj.create')||this.vuex_perm.includes('superuser');
|
this.limitedRpj = this.vuex_perm.includes('rpj.create')||this.vuex_perm.includes('superuser');
|
||||||
this.limitedOperation = this.vuex_perm.includes('operation.create')||this.vuex_perm.includes('superuser');
|
this.limitedOperation = this.vuex_perm.includes('operation.create')||this.vuex_perm.includes('superuser');
|
||||||
},
|
},
|
||||||
|
|
|
@ -12,7 +12,7 @@ try{
|
||||||
}
|
}
|
||||||
|
|
||||||
// 需要永久存储,且下次APP启动需要取出的,在state中的变量名
|
// 需要永久存储,且下次APP启动需要取出的,在state中的变量名
|
||||||
let saveStateKeys = ['vuex_user', 'vuex_token', 'vuex_appid','vuex_perm','vuex_employee','vuex_userRange'];
|
let saveStateKeys = ['vuex_user', 'vuex_token', 'vuex_appid', 'vuex_perm', 'vuex_employee'];
|
||||||
|
|
||||||
// 保存变量到本地存储中
|
// 保存变量到本地存储中
|
||||||
const saveLifeData = function(key, value){
|
const saveLifeData = function(key, value){
|
||||||
|
@ -32,9 +32,11 @@ const store = new Vuex.Store({
|
||||||
// 如果上面从本地获取的lifeData对象下有对应的属性,就赋值给state中对应的变量
|
// 如果上面从本地获取的lifeData对象下有对应的属性,就赋值给state中对应的变量
|
||||||
// 加上vuex_前缀,是防止变量名冲突,也让人一目了然
|
// 加上vuex_前缀,是防止变量名冲突,也让人一目了然
|
||||||
vuex_user: lifeData.vuex_user ? lifeData.vuex_user : {},
|
vuex_user: lifeData.vuex_user ? lifeData.vuex_user : {},
|
||||||
|
vuex_employee: lifeData.vuex_employee ? lifeData.vuex_employee : {},
|
||||||
vuex_token: lifeData.vuex_token ? lifeData.vuex_token : '',
|
vuex_token: lifeData.vuex_token ? lifeData.vuex_token : '',
|
||||||
vuex_perm: lifeData.vuex_perm ? lifeData.vuex_perm : [],
|
vuex_perm: lifeData.vuex_perm ? lifeData.vuex_perm : [],
|
||||||
vuex_userRange: lifeData.vuex_userRange ? lifeData.vuex_userRange : [],
|
vuex_userRange: lifeData.vuex_userRange ? lifeData.vuex_userRange : {},
|
||||||
|
vuex_userRange2: lifeData.vuex_userRange2 ? lifeData.vuex_userRange2 : {},
|
||||||
vuex_appid: 'wxf7d6140f507466be',
|
vuex_appid: 'wxf7d6140f507466be',
|
||||||
vuex_login: 'http://qyjy.ctc-zc.com/h5/',
|
vuex_login: 'http://qyjy.ctc-zc.com/h5/',
|
||||||
vuex_version: '1.00.08',
|
vuex_version: '1.00.08',
|
||||||
|
|
Loading…
Reference in New Issue