提交修改
This commit is contained in:
commit
88b63352c4
159
src/views/modules/equipment/main.vue
Normal file
159
src/views/modules/equipment/main.vue
Normal file
@ -0,0 +1,159 @@
|
|||||||
|
<template>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24"><div class="grid-content bg-purple-dark"></div></el-col>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { apiDingtalkLogin } from '@/api/api_staff'
|
||||||
|
import {apiDingtalkJump } from '@/api/api_staff'
|
||||||
|
import * as dd from 'dingtalk-jsapi'
|
||||||
|
var dingCode = null
|
||||||
|
export default {
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
isloading: false,
|
||||||
|
dataForm: {
|
||||||
|
userName: '',
|
||||||
|
password: '',
|
||||||
|
uuid: '',
|
||||||
|
// captcha: ''
|
||||||
|
verify: '身份验证中...'
|
||||||
|
},
|
||||||
|
req: {
|
||||||
|
code: ''
|
||||||
|
},
|
||||||
|
// captchaPath: '' // 图像验证码请求地址
|
||||||
|
time: 0,
|
||||||
|
timer: true,
|
||||||
|
hasSendCode: true,
|
||||||
|
tick: 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created () {
|
||||||
|
// this.handleGetImgCaptcha()
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
if(this.isDingtalk()){
|
||||||
|
if(typeof this.$route.query.code == 'undefined'){
|
||||||
|
console.log('走钉钉免登流程')
|
||||||
|
this.dingtalkLogin()
|
||||||
|
this.checkDingTalkLogin()
|
||||||
|
} else {
|
||||||
|
this.loginJump()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.loginJump()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
loginJump () {
|
||||||
|
this.dataForm.verify = '验证中'
|
||||||
|
console.log(this.$route.query)
|
||||||
|
this.req.code = this.$route.query.code
|
||||||
|
apiDingtalkJump(this.req).then(res => {
|
||||||
|
|
||||||
|
console.log(res)
|
||||||
|
if (res && res.code === 0) {
|
||||||
|
console.log('获取token')
|
||||||
|
this.$cookie.set('token', res.token)
|
||||||
|
window.location.href=this.$route.query.url
|
||||||
|
|
||||||
|
//window.open(window.location.href + '&code=' + dingCode.code, "_blank")
|
||||||
|
console.log('跳转')
|
||||||
|
} else {
|
||||||
|
this.dataForm.verify='身份验证失败' + res.msg
|
||||||
|
this.$message.error(this.dataForm.verify)
|
||||||
|
this.$router.replace({ name: 'login' })
|
||||||
|
}
|
||||||
|
this.hasSendCode = false;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
checkDingTalkLogin () {
|
||||||
|
if(dingCode === null){
|
||||||
|
if(this.tick < 30){
|
||||||
|
this.isTick++
|
||||||
|
setTimeout(() =>{
|
||||||
|
this.checkDingTalkLogin()
|
||||||
|
}, 300)
|
||||||
|
}else{
|
||||||
|
this.$message.error('登录失败,请用账户和密码登录')
|
||||||
|
this.$router.replace({ name: 'login' })
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.loginWtihCode(dingCode)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
isDingtalk () {
|
||||||
|
if (/(DingTalk)/i.test(navigator.userAgent)) {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dingtalkLogin () {
|
||||||
|
dd.runtime.permission.requestAuthCode({
|
||||||
|
corpId: 'ding267474e759bbca1c35c2f4657eb6378f',
|
||||||
|
onSuccess(result){
|
||||||
|
|
||||||
|
dingCode = result
|
||||||
|
|
||||||
|
},
|
||||||
|
onFail(err) {
|
||||||
|
|
||||||
|
console.log(err)
|
||||||
|
dingCode = err
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
loginWtihCode (result) {
|
||||||
|
console.log('免登流程')
|
||||||
|
console.log(result)
|
||||||
|
apiDingtalkLogin(result).then(res => {
|
||||||
|
console.log('获取登录结果')
|
||||||
|
console.log(res)
|
||||||
|
this.hasSendCode = false
|
||||||
|
if (res && res.code === 0) {
|
||||||
|
console.log('获取token')
|
||||||
|
this.$cookie.set('token', res.token)
|
||||||
|
this.dataForm.verify='登录成功,跳转中...'
|
||||||
|
window.open(window.location.href + '&code=' + dingCode.code, "_blank")
|
||||||
|
console.log('跳转')
|
||||||
|
} else {
|
||||||
|
this.dataForm.verify='身份验证失败' + res.msg
|
||||||
|
this.$message.error(this.dataForm.verify)
|
||||||
|
this.$router.replace({ name: 'login' })
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.el-row {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.el-col {
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
.bg-purple-dark {
|
||||||
|
background: #99a9bf;
|
||||||
|
}
|
||||||
|
.bg-purple {
|
||||||
|
background: #d3dce6;
|
||||||
|
}
|
||||||
|
.bg-purple-light {
|
||||||
|
background: #e5e9f2;
|
||||||
|
}
|
||||||
|
.grid-content {
|
||||||
|
border-radius: 4px;
|
||||||
|
min-height: 36px;
|
||||||
|
}
|
||||||
|
.row-bg {
|
||||||
|
padding: 10px 0;
|
||||||
|
background-color: #f9fafc;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -210,10 +210,10 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.keyResultEditorElem3_5 !== null) {
|
if (this.keyResultEditorElem3_5 !== null) {
|
||||||
this.keyResultEditorElem3_5.txt.html('无')
|
this.keyResultEditorElem3_5.txt.html('<p>无</p>')
|
||||||
}
|
}
|
||||||
if (this.keyResultEditorElem3_7 !== null) {
|
if (this.keyResultEditorElem3_7 !== null) {
|
||||||
this.keyResultEditorElem3_7.txt.html('无')
|
this.keyResultEditorElem3_7.txt.html('<p>无</p>')
|
||||||
}
|
}
|
||||||
this.visible = true
|
this.visible = true
|
||||||
this.$nextTick(async () => {
|
this.$nextTick(async () => {
|
||||||
@ -273,10 +273,12 @@ export default {
|
|||||||
this.keyResultEditorElem3_7.$textElem.attr('contenteditable', false)
|
this.keyResultEditorElem3_7.$textElem.attr('contenteditable', false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.dataForm.id && this.dataForm.id > 0) {
|
if (this.dataForm.id && this.dataForm.id > 0) {
|
||||||
const data = await apiDetailInfo(this.dataForm.id)
|
const data = await apiDetailInfo(this.dataForm.id)
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataForm = data.detailInfo
|
this.dataForm = data.detailInfo
|
||||||
|
console.log(this.dataForm.keyResult37)
|
||||||
if (this.keyResultEditor !== null) {
|
if (this.keyResultEditor !== null) {
|
||||||
this.keyResultEditor.txt.html(this.dataForm.keyResult || '')
|
this.keyResultEditor.txt.html(this.dataForm.keyResult || '')
|
||||||
}
|
}
|
||||||
@ -287,10 +289,18 @@ export default {
|
|||||||
this.scoreCommentEditor.txt.html(this.dataForm.scoreComment || '')
|
this.scoreCommentEditor.txt.html(this.dataForm.scoreComment || '')
|
||||||
}
|
}
|
||||||
if (this.keyResultEditorElem3_5 !== null) {
|
if (this.keyResultEditorElem3_5 !== null) {
|
||||||
this.keyResultEditorElem3_5.txt.html(this.dataForm.keyResult35 || '无')
|
if (this.dataForm.keyResult35 !== null) {
|
||||||
|
this.keyResultEditorElem3_5.txt.html(this.dataForm.keyResult35 || '')
|
||||||
|
} else {
|
||||||
|
this.keyResultEditorElem3_5.txt.html('<p>无</p>')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (this.keyResultEditorElem3_7 !== null) {
|
if (this.keyResultEditorElem3_7 !== null) {
|
||||||
this.keyResultEditorElem3_7.txt.html(this.dataForm.keyResult37 || '无')
|
if (this.dataForm.keyResult37 !== null) {
|
||||||
|
this.keyResultEditorElem3_7.txt.html(this.dataForm.keyResult35 || '')
|
||||||
|
} else {
|
||||||
|
this.keyResultEditorElem3_7.txt.html('<p>无</p>')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -309,7 +319,8 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
stringIsNull (str) {
|
stringIsNull (str) {
|
||||||
if (typeof str === 'undefined' || str === null || str === '') {
|
console.log('比较' + str)
|
||||||
|
if (typeof str === 'undefined' || str === null || str === '' || str === '<p><br></p>') {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
@ -327,6 +338,18 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (this.auth.keyResult35 === 2 && this.type === 1) {
|
||||||
|
if (this.stringIsNull(this.keyResultEditorElem3_5.txt.html())) {
|
||||||
|
this.alertInfo('3.5考核标准不能为空')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.auth.keyResult37 === 2 && this.type === 1) {
|
||||||
|
if (this.stringIsNull(this.keyResultEditorElem3_7.txt.html())) {
|
||||||
|
this.alertInfo('3.7考核标准不能为空')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
if (this.auth.checkWeight === 2) {
|
if (this.auth.checkWeight === 2) {
|
||||||
if (this.stringIsNull(this.dataForm.checkWeight)) {
|
if (this.stringIsNull(this.dataForm.checkWeight)) {
|
||||||
this.alertInfo('权重不能为空')
|
this.alertInfo('权重不能为空')
|
||||||
|
|||||||
@ -36,6 +36,7 @@
|
|||||||
<el-button type="primary" @click="commitApprovalAddOrUpdate(1)">
|
<el-button type="primary" @click="commitApprovalAddOrUpdate(1)">
|
||||||
<label >审批</label>
|
<label >审批</label>
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user