提交 08d41c5c 作者: wk

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

工作台的应用根据切换岗位刷新
父级 20c05fcc
......@@ -3,7 +3,8 @@
globalData: {
userInfo: {},
isReject: false,
authMenus: []
authMenus: [],
isInit: false
},
onLaunch: function() {
console.log('App Launch')
......
<template>
<view style="padding: 10rpx 20rpx;background-color: #FFFFFF;">
<gi-title title="签到二维码"></gi-title>
<image src="../../static/qrcode-ic.png" style="width: 96rpx;height: 96rpx;margin-top: 10px;"
<view style="padding: 10rpx 0;background-color: #FFFFFF;">
<view class="gi-title" style="margin-left: 20rpx;">
<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">
</image>
<view style="display: flex;flex-direction: column;" v-if="record_id!=''">
<view style="margin-top: 10px;">签到人员</view>
<view style="display: flex;flex-direction: row;flex-wrap: wrap;">
<view style="margin-top: 10px;margin-left: 20rpx">签到人员</view>
<view style="display: flex;flex-direction: row;flex-wrap: wrap;margin-left: 20rpx">
<view v-for="(item,index) in users" :key="index">
<view class="sign-user-style">
{{item.value}}
......
......@@ -140,6 +140,7 @@
},
orgCode(res) {
try {
var role = getApp().globalData.userInfo.identity.code
let result = JSON.parse(res.result)
if (result && typeof result == 'object') {
let type = result.type
......@@ -150,9 +151,16 @@
})
} else if (type == "project") {
this.code = result.text
uni.navigateTo({
url: `/pages/login/joinDepartment/joinDepartment?code=${this.code}&type=project&projectId=${result.ext.id}`
})
if (role == 'VISITOR') {
uni.navigateTo({
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") {
this.code = result.text
uni.navigateTo({
......
......@@ -105,11 +105,11 @@
const info = uni.getSystemInfoSync()
this.statusBarHeight = info.statusBarHeight
this.role = getApp().globalData.userInfo.identity.code
this.getAppGroup()
},
onShow() {
this.getMessages()
this.getNeedDo()
this.getAppGroup()
uni.$once("refreshOrg", res => {
this.orgName = uni.getStorageSync("org_name")
})
......@@ -234,6 +234,10 @@
url: "/pages/gallery/outPage/gdtPage/gdtPage?url=" +
`${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 {
this.toOutPage(result.data.tpl_config[0])
}
......
......@@ -160,6 +160,7 @@
}
},
onLoad() {
getApp().globalData.isInit = true
const info = uni.getSystemInfoSync()
console.log("系统", info);
if (info.platform == 'windows') {
......@@ -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() {
let orgNo = uni.getStorageSync("org_no")
if (orgNo == '001') {
......@@ -567,22 +595,29 @@
//如果是项目端 获取当前岗位
//如果是工人 获取工人当前项目
if (this.role == 'PM') {
if (jobs) {
let currentJob = jobs[0]
uni.setStorageSync("org_no", currentJob.org_no)
uni.setStorageSync("org_id", currentJob.org_id)
//当前岗位 判断当前岗位是项目部还是其他
if (this.userInfo.user.dept_type == '2') { //项目级
uni.setStorageSync("org_name", currentJob.dept_name)
if (getApp().globalData.isInit) {
if (jobs) {
let currentJob = jobs[0]
uni.setStorageSync("org_no", currentJob.org_no)
uni.setStorageSync("org_id", currentJob.org_id)
//当前岗位 判断当前岗位是项目部还是其他
if (this.userInfo.user.dept_type == '2') { //项目级
uni.setStorageSync("org_name", currentJob.dept_name)
this.getDeptProject()
} else {
uni.setStorageSync("org_name", currentJob.org_name)
this.initData()
}
} else {
uni.setStorageSync("org_name", currentJob.org_name)
uni.setStorageSync("org_no", "")
uni.setStorageSync("org_id", "")
uni.setStorageSync("org_name", "")
this.initData()
}
this.initData()
getApp().globalData.isInit = false
}
} else {
this.project_id = uni.getStorageSync("project_id")
console.log("当前组织", this.project_id);
if (!this.project_id) {
this.loadProject()
} else {
......
......@@ -85,7 +85,9 @@
})
},
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) {
return job.job_id == this.currentJob.job_id
......@@ -145,6 +147,9 @@
uni.setStorageSync("user_info", result.data)
uni.setStorageSync("company_id", result.data.comp_id)
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({
url: "/pages/index/index"
})
......
......@@ -92,7 +92,6 @@
},
filterNode(value, data) {
if (!value) return true;
// if (!data.label) return false
return data.name.indexOf(value) != -1;
},
toSwitch() {
......@@ -224,66 +223,6 @@
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>
......
......@@ -33,7 +33,7 @@
<view class="line"></view>
<view class="item">
<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 class="line"></view>
<view class="item">
......@@ -79,12 +79,17 @@
markers: []
}
},
onLoad() {
this.role = getApp().globalData.userInfo.identity.code
if (this.role == 'WORKER') {
this.projectId = getApp().globalData.userInfo.worker.projectId
onLoad(options) {
var from = options.from
if (from && from == 'qrcode') {
this.projectId = options.projectId
} else {
this.projectId = uni.getStorageSync("project_id")
this.role = getApp().globalData.userInfo.identity.code
if (this.role == 'WORKER') {
this.projectId = getApp().globalData.userInfo.worker.projectId
} else {
this.projectId = uni.getStorageSync("project_id")
}
}
this.getProjectInfo()
},
......@@ -242,6 +247,7 @@
.item-value {
font-weight: 400;
font-size: 28rpx;
text-align: right;
color: #333;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
Please register or to comment