|
@@ -23,7 +23,7 @@
|
|
|
<img src="@assets/haveSomething.png" alt="?????" class="haveSomethingImg" />
|
|
|
<p>
|
|
|
我的待办
|
|
|
- <a-badge class="numTips"> {{ todoList.length }} </a-badge>
|
|
|
+ <a-badge class="numTips">{{ todoList.length }}</a-badge>
|
|
|
</p>
|
|
|
</div>
|
|
|
</span>
|
|
@@ -34,7 +34,12 @@
|
|
|
<div class="oaContain">
|
|
|
<a-card title="OA工作台" style="width: 100%" class="oaTitle">
|
|
|
<div class="oaButton">
|
|
|
- <a class="oaItem" v-for="(item, index) in activeKeyAll" :key="index.id" @click.prevent="aClick(item)">
|
|
|
+ <a
|
|
|
+ class="oaItem"
|
|
|
+ v-for="(item, index) in activeKeyAll"
|
|
|
+ :key="index.id"
|
|
|
+ @click.prevent="aClick(item)"
|
|
|
+ >
|
|
|
<span>
|
|
|
<img :src="item.iconAddress" />
|
|
|
</span>
|
|
@@ -46,7 +51,12 @@
|
|
|
|
|
|
<!-- 其他弹框 -->
|
|
|
|
|
|
- <a-modal v-model="lcModal.visible" :title="lcModal.Title" :footer="null" :maskClosable="false">
|
|
|
+ <a-modal
|
|
|
+ v-model="lcModal.visible"
|
|
|
+ :title="lcModal.Title"
|
|
|
+ :footer="null"
|
|
|
+ :maskClosable="false"
|
|
|
+ >
|
|
|
<component
|
|
|
:disabled="lcModal.disabled"
|
|
|
v-if="lcModal.visible"
|
|
@@ -55,14 +65,69 @@
|
|
|
:isNew="lcModal.isNew"
|
|
|
@afterSubmit="afterSub"
|
|
|
@close=";(lcModal.visible = false), (lcModal.disabled = false)"
|
|
|
- >
|
|
|
- </component>
|
|
|
+ ></component>
|
|
|
</a-modal>
|
|
|
</div>
|
|
|
+
|
|
|
+ <a-modal
|
|
|
+ title="登录公司选择"
|
|
|
+ :width="450"
|
|
|
+ :visible="departVisible"
|
|
|
+ :closable="false"
|
|
|
+ :maskClosable="false"
|
|
|
+ >
|
|
|
+ <template slot="footer">
|
|
|
+ <a-button type="primary" @click="departOk">确认</a-button>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <a-form>
|
|
|
+ <!-- <a-form-item
|
|
|
+ :labelCol="{span:4}"
|
|
|
+ :wrapperCol="{span:20}"
|
|
|
+ style="margin-bottom:10px"
|
|
|
+ :validate-status="validate_status">
|
|
|
+ <a-tooltip placement="topLeft" >
|
|
|
+ <template slot="title">
|
|
|
+ <span>您隶属于多部门,请选择登录部门</span>
|
|
|
+ </template>
|
|
|
+ <a-avatar style="backgroundColor:#87d068" icon="gold" />
|
|
|
+ </a-tooltip>
|
|
|
+ <a-select @change="departChange" :class="{'valid-error':validate_status=='error'}" placeholder="请选择登录部门" style="margin-left:10px;width: 80%">
|
|
|
+ <a-icon slot="suffixIcon" type="gold" />
|
|
|
+ <a-select-option
|
|
|
+ v-for="d in departList"
|
|
|
+ :key="d.id"
|
|
|
+ :value="d.orgCode">
|
|
|
+ {{ d.departName }}
|
|
|
+ </a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>-->
|
|
|
+ <a-form-item
|
|
|
+ :labelCol="{span:4}"
|
|
|
+ :wrapperCol="{span:20}"
|
|
|
+ style="margin-bottom:10px"
|
|
|
+ :validate-status="validate_status"
|
|
|
+ >
|
|
|
+ <a-tooltip placement="topLeft">
|
|
|
+ <template slot="title">
|
|
|
+ <span>您隶属于多公司,请选择登录公司</span>
|
|
|
+ </template>
|
|
|
+ <a-avatar style="backgroundColor:#87d068" icon="gold" />
|
|
|
+ </a-tooltip>
|
|
|
+ <a-select
|
|
|
+ @change="departChange"
|
|
|
+ :class="{'valid-error':validate_status=='error'}"
|
|
|
+ placeholder="请选择登录公司"
|
|
|
+ style="margin-left:10px;width: 80%"
|
|
|
+ >
|
|
|
+ <a-icon slot="suffixIcon" type="gold" />
|
|
|
+ <a-select-option v-for="d in orgList" :key="d.id" :value="d.id">{{ d.departName }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-form>
|
|
|
+ </a-modal>
|
|
|
<!-- 底部 -->
|
|
|
- <a-layout-footer class="footer">
|
|
|
- 上海萃颠信息科技有限公司出品
|
|
|
- </a-layout-footer>
|
|
|
+ <a-layout-footer class="footer">上海萃颠信息科技有限公司出品</a-layout-footer>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -76,6 +141,8 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
|
import { activitiMixin } from '@/views/activiti/mixins/activitiMixin'
|
|
|
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
|
|
import { getCode } from '../../utils/dingding'
|
|
|
+import { putAction, postAction, getAction } from '@/api/manage'
|
|
|
+import store from '@/store/'
|
|
|
|
|
|
export default {
|
|
|
loading: true,
|
|
@@ -83,6 +150,9 @@ export default {
|
|
|
components: {},
|
|
|
data() {
|
|
|
return {
|
|
|
+ orgList: [],
|
|
|
+ validate_status: '',
|
|
|
+ departVisible: false,
|
|
|
todoList: [],
|
|
|
activeKeyAll: [],
|
|
|
url: {
|
|
@@ -105,26 +175,31 @@ export default {
|
|
|
Vue.ls.remove(ACCESS_TOKEN)
|
|
|
//钉钉免登录
|
|
|
//获取临时授权码
|
|
|
- // getCode(code=>{
|
|
|
- // //登录
|
|
|
- // // 异步操作
|
|
|
- // this.dingLogin({code:code})
|
|
|
- // .then(res => {
|
|
|
- // this.getDataList() // 待办、已办 列表
|
|
|
- // this.getActiveKeyAll() // OA 4个按钮
|
|
|
- // })
|
|
|
- // .catch(err => {
|
|
|
- // console.log(err)
|
|
|
- // })
|
|
|
- // })
|
|
|
+ getCode(code => {
|
|
|
+ //登录
|
|
|
+ // 异步操作
|
|
|
+ this.dingLogin({ code: code })
|
|
|
+ .then(res => {
|
|
|
+ const userInfo = res.result.userInfo
|
|
|
+ Vue.ls.set(USER_INFO, userInfo, 7 * 24 * 60 * 60 * 1000)
|
|
|
+ store.commit('SET_INFO', userInfo)
|
|
|
+ if (userInfo) {
|
|
|
+ this.getDataList() // 待办、已办 列表
|
|
|
+ this.getActiveKeyAll() // OA 4个按钮
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ })
|
|
|
// 进入页面自动登录
|
|
|
- this.autoLogin()
|
|
|
- .then(res => {
|
|
|
- this.getDataList() // 待办、已办 列表
|
|
|
- })
|
|
|
- .then(res => {
|
|
|
- this.getActiveKeyAll() // OA 4个按钮
|
|
|
- })
|
|
|
+ // this.autoLogin()
|
|
|
+ // .then(res => {
|
|
|
+ // this.getDataList() // 待办、已办 列表
|
|
|
+ // })
|
|
|
+ // .then(res => {
|
|
|
+ // this.getActiveKeyAll() // OA 4个按钮
|
|
|
+ // })
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
@@ -145,6 +220,7 @@ export default {
|
|
|
await that
|
|
|
.Login(loginParams)
|
|
|
.then(res => {
|
|
|
+ // this.departConfirm(res)
|
|
|
console.log('Login拿到token | 登录上啦!')
|
|
|
})
|
|
|
.catch(err => {
|
|
@@ -223,6 +299,86 @@ export default {
|
|
|
//提交后
|
|
|
afterSub(formData) {
|
|
|
this.lcModal.visible = false
|
|
|
+ },
|
|
|
+ departConfirm(res) {
|
|
|
+ if (res.success) {
|
|
|
+ console.log('用户信息', res)
|
|
|
+ let multi_depart = res.result.multi_depart
|
|
|
+ //0:无部门 1:一个部门 2:多个部门
|
|
|
+ if (multi_depart == 0) {
|
|
|
+ this.loginSuccess()
|
|
|
+ this.$notification.warn({
|
|
|
+ message: '提示',
|
|
|
+ // description: `您尚未归属部门,请确认账号信息`,
|
|
|
+ description: `您尚未归属公司,请确认账号信息`,
|
|
|
+ duration: 3
|
|
|
+ })
|
|
|
+ } else if (multi_depart == 2) {
|
|
|
+ this.departVisible = true
|
|
|
+ // this.currentUsername = this.form.getFieldValue('username')
|
|
|
+ this.currentUsername = res.result.userInfo.username
|
|
|
+ this.departList = res.result.departs
|
|
|
+ this.orgList = res.result.orgList
|
|
|
+ console.log('公司', this.orgList)
|
|
|
+ } else {
|
|
|
+ console.log('登录')
|
|
|
+ const userInfo = res.result.userInfo
|
|
|
+ Vue.ls.set(USER_INFO, userInfo, 7 * 24 * 60 * 60 * 1000)
|
|
|
+ store.commit('SET_INFO', userInfo)
|
|
|
+ this.loginSuccess()
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.requestFailed(res)
|
|
|
+ this.Logout()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ requestFailed(err) {
|
|
|
+ this.$notification['error']({
|
|
|
+ message: '登录失败',
|
|
|
+ description: ((err.response || {}).data || {}).message || err.message || '请求出现错误,请稍后再试',
|
|
|
+ duration: 4
|
|
|
+ })
|
|
|
+ this.loginBtn = false
|
|
|
+ },
|
|
|
+
|
|
|
+ departOk() {
|
|
|
+ if (!this.departSelected) {
|
|
|
+ this.validate_status = 'error'
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ let obj = {
|
|
|
+ orgCode: this.departSelected,
|
|
|
+ // username: this.form.getFieldValue('username')
|
|
|
+ username: this.currentUsername
|
|
|
+ }
|
|
|
+ putAction('/sys/selectDepart', obj).then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ const userInfo = res.result.userInfo
|
|
|
+ Vue.ls.set(USER_INFO, userInfo, 7 * 24 * 60 * 60 * 1000)
|
|
|
+ store.commit('SET_INFO', userInfo)
|
|
|
+ //console.log("---切换组织机构---userInfo-------",store.getters.userInfo.orgCode);
|
|
|
+ this.departClear()
|
|
|
+ // this.loginSuccess()
|
|
|
+ } else {
|
|
|
+ this.requestFailed(res)
|
|
|
+ this.Logout().then(() => {
|
|
|
+ this.departClear()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ departChange(value) {
|
|
|
+ this.validate_status = 'success'
|
|
|
+ this.departSelected = value
|
|
|
+ },
|
|
|
+ departClear() {
|
|
|
+ this.departList = []
|
|
|
+ this.departSelected = ''
|
|
|
+ this.currentUsername = ''
|
|
|
+ this.departVisible = false
|
|
|
+ this.validate_status = ''
|
|
|
+ this.orgList = []
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -263,7 +419,7 @@ export default {
|
|
|
padding: 10px 20px;
|
|
|
border-radius: 999em;
|
|
|
border: transparent;
|
|
|
- background-color: rgba(37, 104, 239,.8);
|
|
|
+ background-color: rgba(37, 104, 239, 0.8);
|
|
|
box-shadow: 10px 1px 10px rgba(0, 0, 0, 0.8);
|
|
|
-webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
|
|
|
-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
|