Compare commits

..

2 Commits

Author SHA1 Message Date
沈昭朝 ef6e2e395f fix: 成本下拉框允许手动修改 2024-07-25 19:14:17 +08:00
yangbin 79f27be41d 添加callback 2024-07-25 18:04:38 +08:00
3 changed files with 111 additions and 5 deletions

View File

@ -14,6 +14,13 @@ export const constantRoutes = [
title: '登录', title: '登录',
hidden: true hidden: true
}, },
{
path: '/callback',
name: 'Callback',
component: () => import('@/views/callback/index'),
title: '回调',
hidden: true
},
{ {
path: '/404', path: '/404',
name: '404', name: '404',

View File

@ -0,0 +1,59 @@
<template>
<div class="main-box" />
</template>
<script>
import { mapGetters } from 'vuex'
import { getOneIdToken } from '@/api/user'
export default {
name: 'CallBack',
computed: {
...mapGetters([
'name'
])
},
async mounted() {
debugger
// URL code
// const urlParams = new URLSearchParams(window.location.hash.substring(1))
// const code = urlParams.get('code')
// alert('callback page')
// this.$router.push({ path: '/nav' })
const urlParams = new URLSearchParams(window.location.search)
const code = urlParams.get('code')
// code
if (code) {
// code
const response = await getOneIdToken(code)
console.log(response)
if (response) {
// console.log('response.Token:' + response.Token)
// token
this.$store.dispatch('user/commitToken', response)
//
// resetRouter()
// console.log(this.$store.state.user, this.$store.state.token)
this.$router.push({ path: '/nav' })
} else {
console.log('No token found with code')
// window.location.href = 'https://api.oneid.siemens.com.cn/api/bff/v1.2/developer/ciam/oauth/authorize?client_id=1b867769c8cb221fb7fdb0f8beba6138TwXkI4mX8um&response_type=code&redirect_uri=http://csdc.siemens.com.cn:8001/#/callback&scope=openid phone email profile user:ciam:commonapi'
}
} else {
// code,
console.error('No code found in URL parameters.')
// window.location.href = 'https://api.oneid.siemens.com.cn/api/bff/v1.2/developer/ciam/oauth/authorize?client_id=1b867769c8cb221fb7fdb0f8beba6138TwXkI4mX8um&response_type=code&redirect_uri=http://csdc.siemens.com.cn:8001/#/callback&scope=openid phone email profile user:ciam:commonapi'
// window.location.href = 'https://oneid.siemens.com.cn/frontend/login?idaasAppId=siemens_ciam2'
}
}
}
</script>
<style lang="scss" scoped>
.main-box {
background-image: url("../../assets/dashboard-background.png");
background-size: 100% 100%;
background-repeat: no-repeat;
height: 100vh;
}
</style>

View File

@ -478,7 +478,14 @@
:trigger-on-focus="false" :trigger-on-focus="false"
@select="handleSelect" @select="handleSelect"
/> --> /> -->
<el-select v-model="addStatusForm.costCenter" placeholder="请选择成本号"> <el-select
v-model="addStatusForm.costCenter"
placeholder="请选择成本号"
clearable
filterable
allow-create
@blur="InsertCostCenterSelect"
>
<el-option <el-option
v-for="(item, index) in costList" v-for="(item, index) in costList"
:key="index" :key="index"
@ -620,7 +627,14 @@
:trigger-on-focus="false" :trigger-on-focus="false"
@select="handleSelect" @select="handleSelect"
/> --> /> -->
<el-select v-model="editStatusForm.workRecordsList[0].costCenter" placeholder="请选择成本号"> <el-select
v-model="editStatusForm.workRecordsList[0].costCenter"
placeholder="请选择成本号"
clearable
filterable
allow-create
@blur="EditCostCenterSelect"
>
<el-option <el-option
v-for="(item, index) in costList" v-for="(item, index) in costList"
:key="index" :key="index"
@ -731,7 +745,14 @@
:trigger-on-focus="false" :trigger-on-focus="false"
@select="handleSelect" @select="handleSelect"
/> --> /> -->
<el-select v-model="editStatusForm.costCenterOfNewOrder" placeholder="请选择成本号"> <el-select
v-model="editStatusForm.costCenterOfNewOrder"
placeholder="请选择成本号"
clearable
filterable
allow-create
@blur="EditNewCostCenterSelect"
>
<el-option <el-option
v-for="(item, index) in costList" v-for="(item, index) in costList"
:key="index" :key="index"
@ -1251,7 +1272,6 @@ export default {
this.handleMonthLastDay() this.handleMonthLastDay()
this.dayScreen() this.dayScreen()
const { page, limit, departmentId } = this const { page, limit, departmentId } = this
console.log(this.departmentId + '++++++')
var queryInfo = { var queryInfo = {
page: this.page, page: this.page,
limit: this.limit, limit: this.limit,
@ -1260,6 +1280,7 @@ export default {
reign: this.region.trim(), reign: this.region.trim(),
city: this.city.trim() city: this.city.trim()
} }
console.log(this.departmentId)
const resultOfSelectEngisByDept = const resultOfSelectEngisByDept =
await this.$API.user.reqGetUserPageWithSkills(queryInfo)// select.reqSelectEngisByDept(page, limit, departmentId) await this.$API.user.reqGetUserPageWithSkills(queryInfo)// select.reqSelectEngisByDept(page, limit, departmentId)
if (resultOfSelectEngisByDept.code === 0) { if (resultOfSelectEngisByDept.code === 0) {
@ -1282,7 +1303,7 @@ export default {
page, page,
limit limit
) )
console.log(this.engiArray, resOfSelectEngiStatusByMap)
if (resOfSelectEngiStatusByMap.code === 0) { if (resOfSelectEngiStatusByMap.code === 0) {
var EngiStatusMap = resOfSelectEngiStatusByMap.data var EngiStatusMap = resOfSelectEngiStatusByMap.data
for (const i in EngiStatusMap) { for (const i in EngiStatusMap) {
@ -2138,6 +2159,25 @@ export default {
} }
return dropdownData return dropdownData
},
InsertCostCenterSelect(e) {
const value = e.target.value //
if (value) { //
this.addStatusForm.costCenter = value
}
},
// cost center
EditCostCenterSelect(e) {
const value = e.target.value //
if (value) { //
this.editStatusForm.workRecordsList[0].costCenter = value
}
},
EditNewCostCenterSelect(e) {
const value = e.target.value //
if (value) { //
this.editStatusForm.costCenterOfNewOrder = value
}
} }
}, },
watch: { watch: {