提交 08d41c5c 作者: wk

应用详情页查看二维码 左侧有白边修复

工作台的应用根据切换岗位刷新
父级 20c05fcc
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
globalData: { globalData: {
userInfo: {}, userInfo: {},
isReject: false, isReject: false,
authMenus: [] authMenus: [],
isInit: false
}, },
onLaunch: function() { onLaunch: function() {
console.log('App Launch') console.log('App Launch')
......
<template> <template>
<view style="padding: 10rpx 20rpx;background-color: #FFFFFF;"> <view style="padding: 10rpx 0;background-color: #FFFFFF;">
<gi-title title="签到二维码"></gi-title> <view class="gi-title" style="margin-left: 20rpx;">
<image src="../../static/qrcode-ic.png" style="width: 96rpx;height: 96rpx;margin-top: 10px;" <text class="star" v-if="isMust">*</text>
<text class="text-black-normal" style="margin-left: 10rpx;flex: 1;">签到二维码</text>
</view>
<image src="../../static/qrcode-ic.png" style="width: 96rpx;height: 96rpx;margin-top: 10px;margin-left: 20rpx;"
@click="showQrcode"> @click="showQrcode">
</image> </image>
<view style="display: flex;flex-direction: column;" v-if="record_id!=''"> <view style="display: flex;flex-direction: column;" v-if="record_id!=''">
<view style="margin-top: 10px;">签到人员</view> <view style="margin-top: 10px;margin-left: 20rpx">签到人员</view>
<view style="display: flex;flex-direction: row;flex-wrap: wrap;"> <view style="display: flex;flex-direction: row;flex-wrap: wrap;margin-left: 20rpx">
<view v-for="(item,index) in users" :key="index"> <view v-for="(item,index) in users" :key="index">
<view class="sign-user-style"> <view class="sign-user-style">
{{item.value}} {{item.value}}
......
...@@ -140,6 +140,7 @@ ...@@ -140,6 +140,7 @@
}, },
orgCode(res) { orgCode(res) {
try { try {
var role = getApp().globalData.userInfo.identity.code
let result = JSON.parse(res.result) let result = JSON.parse(res.result)
if (result && typeof result == 'object') { if (result && typeof result == 'object') {
let type = result.type let type = result.type
...@@ -150,9 +151,16 @@ ...@@ -150,9 +151,16 @@
}) })
} else if (type == "project") { } else if (type == "project") {
this.code = result.text this.code = result.text
if (role == 'VISITOR') {
uni.navigateTo({ uni.navigateTo({
url: `/pages/login/joinDepartment/joinDepartment?code=${this.code}&type=project&projectId=${result.ext.id}` url: `/pages/login/joinDepartment/joinDepartment?code=${this.code}&type=project&projectId=${result.ext.id}`
}) })
} else {
uni.navigateTo({
url: `/pagesSub/mine/projectInfo/projectInfo?projectId=${result.ext.id}&from=qrcode`
})
}
} else if (type == "department") { } else if (type == "department") {
this.code = result.text this.code = result.text
uni.navigateTo({ uni.navigateTo({
......
...@@ -105,11 +105,11 @@ ...@@ -105,11 +105,11 @@
const info = uni.getSystemInfoSync() const info = uni.getSystemInfoSync()
this.statusBarHeight = info.statusBarHeight this.statusBarHeight = info.statusBarHeight
this.role = getApp().globalData.userInfo.identity.code this.role = getApp().globalData.userInfo.identity.code
this.getAppGroup()
}, },
onShow() { onShow() {
this.getMessages() this.getMessages()
this.getNeedDo() this.getNeedDo()
this.getAppGroup()
uni.$once("refreshOrg", res => { uni.$once("refreshOrg", res => {
this.orgName = uni.getStorageSync("org_name") this.orgName = uni.getStorageSync("org_name")
}) })
...@@ -234,6 +234,10 @@ ...@@ -234,6 +234,10 @@
url: "/pages/gallery/outPage/gdtPage/gdtPage?url=" + url: "/pages/gallery/outPage/gdtPage/gdtPage?url=" +
`${this.$config.jyxyBase}/dologin/workSite&workSiteToken=${uni.getStorageSync("token")}&to=jypx` `${this.$config.jyxyBase}/dologin/workSite&workSiteToken=${uni.getStorageSync("token")}&to=jypx`
}) })
} else if ("63f05e5dc9d53f743030fa92" == result.data.check_tpl_id) {
uni.navigateTo({
url: "/pagesSub/mine/myScore/myScore"
})
} else { } else {
this.toOutPage(result.data.tpl_config[0]) this.toOutPage(result.data.tpl_config[0])
} }
......
...@@ -160,6 +160,7 @@ ...@@ -160,6 +160,7 @@
} }
}, },
onLoad() { onLoad() {
getApp().globalData.isInit = true
const info = uni.getSystemInfoSync() const info = uni.getSystemInfoSync()
console.log("系统", info); console.log("系统", info);
if (info.platform == 'windows') { if (info.platform == 'windows') {
...@@ -228,6 +229,33 @@ ...@@ -228,6 +229,33 @@
} }
}) })
}, },
getDeptProject() {
this.$http.get({
url: "/api/v1/project/project_list",
data: {
is_all: 1,
org_no: uni.getStorageSync("org_no")
},
header: {
"access_token": this.getToken()
}
}).then(res => {
let result = res.data
console.log("项目列表:", result);
if (result.code === 0) {
if (result.data.list.length > 0) {
this.project = result.data.list[0]
this.project_id = this.project.project_id
uni.setStorageSync("org_no", this.project.org_no)
uni.setStorageSync("org_name", this.project.project_name)
uni.setStorageSync("project_id", this.project.project_id)
}
this.initData()
}
}, (err) => {
this.$toast.showToast(err.msg)
})
},
loadProject: function() { loadProject: function() {
let orgNo = uni.getStorageSync("org_no") let orgNo = uni.getStorageSync("org_no")
if (orgNo == '001') { if (orgNo == '001') {
...@@ -567,6 +595,7 @@ ...@@ -567,6 +595,7 @@
//如果是项目端 获取当前岗位 //如果是项目端 获取当前岗位
//如果是工人 获取工人当前项目 //如果是工人 获取工人当前项目
if (this.role == 'PM') { if (this.role == 'PM') {
if (getApp().globalData.isInit) {
if (jobs) { if (jobs) {
let currentJob = jobs[0] let currentJob = jobs[0]
uni.setStorageSync("org_no", currentJob.org_no) uni.setStorageSync("org_no", currentJob.org_no)
...@@ -574,15 +603,21 @@ ...@@ -574,15 +603,21 @@
//当前岗位 判断当前岗位是项目部还是其他 //当前岗位 判断当前岗位是项目部还是其他
if (this.userInfo.user.dept_type == '2') { //项目级 if (this.userInfo.user.dept_type == '2') { //项目级
uni.setStorageSync("org_name", currentJob.dept_name) uni.setStorageSync("org_name", currentJob.dept_name)
this.getDeptProject()
} else { } else {
uni.setStorageSync("org_name", currentJob.org_name) uni.setStorageSync("org_name", currentJob.org_name)
this.initData() this.initData()
} }
} else {
uni.setStorageSync("org_no", "")
uni.setStorageSync("org_id", "")
uni.setStorageSync("org_name", "")
this.initData() this.initData()
} }
getApp().globalData.isInit = false
}
} else { } else {
this.project_id = uni.getStorageSync("project_id") this.project_id = uni.getStorageSync("project_id")
console.log("当前组织", this.project_id);
if (!this.project_id) { if (!this.project_id) {
this.loadProject() this.loadProject()
} else { } else {
......
...@@ -85,7 +85,9 @@ ...@@ -85,7 +85,9 @@
}) })
}, },
isCurrent(item) { isCurrent(item) {
return item.company_id == uni.getStorageSync("company_id") var orgId = uni.getStorageSync("org_id")
console.log("当前org_id:" + orgId, "条目的org_id:" + item.org_id);
return item.org_id == orgId && item.company_id == this.currentCompany.company_id
}, },
isCurrentJob(job) { isCurrentJob(job) {
return job.job_id == this.currentJob.job_id return job.job_id == this.currentJob.job_id
...@@ -145,6 +147,9 @@ ...@@ -145,6 +147,9 @@
uni.setStorageSync("user_info", result.data) uni.setStorageSync("user_info", result.data)
uni.setStorageSync("company_id", result.data.comp_id) uni.setStorageSync("company_id", result.data.comp_id)
uni.setStorageSync("org_no", result.data.org_no) uni.setStorageSync("org_no", result.data.org_no)
uni.setStorageSync("org_id", result.data.org_id)
console.log("当前组织id", uni.getStorageSync("org_id"));
getApp().globalData.isInit = true
uni.switchTab({ uni.switchTab({
url: "/pages/index/index" url: "/pages/index/index"
}) })
......
...@@ -92,7 +92,6 @@ ...@@ -92,7 +92,6 @@
}, },
filterNode(value, data) { filterNode(value, data) {
if (!value) return true; if (!value) return true;
// if (!data.label) return false
return data.name.indexOf(value) != -1; return data.name.indexOf(value) != -1;
}, },
toSwitch() { toSwitch() {
...@@ -224,66 +223,6 @@ ...@@ -224,66 +223,6 @@
delta: 1 delta: 1
}) })
}, },
search(e) {
// var key = e.detail.value
// this.$refs.tree.filter(key, null)
// if (key) {
// var list = []
// var sourceData = this.temp
// console.log("数据源", sourceData);
// sourceData.forEach((item) => {
// if (item.name.indexOf(key) != -1) {
// item.isOpen = true
// list.push(item)
// } else {
// var children = item.children_list
// var childrens = []
// if (children) {
// children.forEach((child) => {
// if (child.name.indexOf(key) != -1) {
// child.isOpen = true
// var childs = child.children_list
// var childList = []
// if (childs) {
// childs.forEach((childItem) => {
// if (childItem.name.indexOf(key) != -1) {
// childList.push(childItem)
// }
// })
// }
// child.children_list = childList
// childrens.push(child)
// } else {
// var childs = child.children_list
// var childList = []
// if (childs) {
// childs.forEach((childItem) => {
// if (childItem.name.indexOf(key) != -1) {
// childList.push(childItem)
// }
// })
// }
// if (childList.length > 0) {
// child.children_list = childList
// child.isOpen = true
// childrens.push(child)
// }
// }
// })
// }
// if (childrens.length > 0) {
// item.isOpen = true
// item.children_list = childrens
// list.push(item)
// }
// }
// })
// this.trees = list
// } else {
// this.getOrgTree()
// }
}
} }
} }
</script> </script>
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<view class="line"></view> <view class="line"></view>
<view class="item"> <view class="item">
<view class="item-name">详细地址:</view> <view class="item-name">详细地址:</view>
<view class="item-value" style="width: 488rpx;">{{project.address||""}}</view> <text class="item-value" style="width: 488rpx;">{{project.address||""}}</text>
</view> </view>
<view class="line"></view> <view class="line"></view>
<view class="item"> <view class="item">
...@@ -79,13 +79,18 @@ ...@@ -79,13 +79,18 @@
markers: [] markers: []
} }
}, },
onLoad() { onLoad(options) {
var from = options.from
if (from && from == 'qrcode') {
this.projectId = options.projectId
} else {
this.role = getApp().globalData.userInfo.identity.code this.role = getApp().globalData.userInfo.identity.code
if (this.role == 'WORKER') { if (this.role == 'WORKER') {
this.projectId = getApp().globalData.userInfo.worker.projectId this.projectId = getApp().globalData.userInfo.worker.projectId
} else { } else {
this.projectId = uni.getStorageSync("project_id") this.projectId = uni.getStorageSync("project_id")
} }
}
this.getProjectInfo() this.getProjectInfo()
}, },
methods: { methods: {
...@@ -242,6 +247,7 @@ ...@@ -242,6 +247,7 @@
.item-value { .item-value {
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
text-align: right;
color: #333; color: #333;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
Please register or to comment