This commit is contained in:
熊成强 2020-11-06 15:33:50 +08:00
parent 01f538f722
commit 349cd5e4e9
21 changed files with 130 additions and 41 deletions

View File

@ -1,20 +1,13 @@
<template> <template>
<div id="app"> <div id="app">
<router-view class="main"/> <router-view class="main"/>
<!-- <Loading :active.sync="active"
:can-cancel="true"
:on-cancel="onCancel"
:is-full-page="fullPage"></Loading> -->
</div> </div>
</template> </template>
<script> <script>
import { mapState, mapActions } from 'vuex' import { mapState, mapActions } from 'vuex'
import * as dd from 'dingtalk-jsapi' import * as dd from 'dingtalk-jsapi'
import { apiDingtalkLogin } from '@/api/login' import { apiDingtalkLogin, apiUserInfo } from '@/api/login'
// import Loading from 'vue-loading-overlay'
// Import stylesheet
// import 'vue-loading-overlay/dist/vue-loading.css'
export default { export default {
name: 'App', name: 'App',
data () { data () {
@ -24,7 +17,6 @@ export default {
} }
}, },
components: { components: {
// Loading
}, },
computed: { computed: {
...mapState(['user']) ...mapState(['user'])
@ -36,7 +28,7 @@ export default {
onCancel () { onCancel () {
}, },
...mapActions(['GET_DEPLIST']), ...mapActions(['GET_DEPLIST', 'SET_USER_INFO']),
// //
handleGetDingtalkCode () { handleGetDingtalkCode () {
let _this = this let _this = this
@ -58,6 +50,7 @@ export default {
apiDingtalkLogin(val).then(res => { apiDingtalkLogin(val).then(res => {
if (res && res.code === 0) { if (res && res.code === 0) {
this.$cookies.set('token', res.token) this.$cookies.set('token', res.token)
this.handleInfo()
this.dataForm.verify = '登录成功,跳转中...' this.dataForm.verify = '登录成功,跳转中...'
window.open(window.location.protocol + '//' + window.location.host + '/digitization/kpi/workbench/home?code=' + this.dingCode.code) window.open(window.location.protocol + '//' + window.location.host + '/digitization/kpi/workbench/home?code=' + this.dingCode.code)
} else { } else {
@ -66,6 +59,13 @@ export default {
this.$router.replace({ name: 'dingTalkLogin' }) this.$router.replace({ name: 'dingTalkLogin' })
} }
}) })
},
//
async handleInfo () {
let res = await apiUserInfo()
if (res.code === 200) {
this.SET_USER_INFO(res.user)
}
} }
} }
} }

View File

@ -34,3 +34,12 @@ export function apiSendSMS (query = {}) {
data: query data: query
}) })
} }
// 获取用户信息
export function apiUserInfo (query = {}) {
return request({
url: '/lz_management/sys/user/info',
method: 'get',
query: query
})
}

View File

@ -8,3 +8,12 @@ export function apiDingtalkLogin (query) {
data: query data: query
}) })
} }
// 获取用户信息
export function apiUserInfo (query = {}) {
return request({
url: '/lz_management/sys/user/info',
method: 'get',
query: query
})
}

View File

@ -20,7 +20,8 @@
</div> --> </div> -->
</transition> </transition>
<div class="navBar-right" v-if="isNav"> <div class="navBar-right" v-if="isNav">
<img onerror="javascript:this.src='/static/default.jpg';" :src="this.src" alt=""> <span>{{this.info.realName}}</span>
<img onerror="javascript:this.src='/static/default.jpg';" :src="this.info.avatar || ''" alt="">
</div> </div>
</div> </div>
</template> </template>
@ -42,7 +43,7 @@ export default {
NavHeader NavHeader
}, },
computed: { computed: {
...mapState({src: state => state.user.info.src}), ...mapState({ info: state => state.user.info }),
isNav () { isNav () {
return !!this.$route.meta.isNav return !!this.$route.meta.isNav
}, },
@ -91,6 +92,11 @@ export default {
padding: 0 40px; padding: 0 40px;
box-shadow: 0 1px 6px 0 rgba(0,0,0,.12), 0 1px 6px 0 rgba(0,0,0,.12); box-shadow: 0 1px 6px 0 rgba(0,0,0,.12), 0 1px 6px 0 rgba(0,0,0,.12);
&-right{ &-right{
display: flex;
align-items: center;
span{
margin: 0 10px;
}
img{ img{
width: 40px; width: 40px;
height: 40px; height: 40px;

View File

@ -10,7 +10,7 @@ import './style/index.less'
import '@/icons' import '@/icons'
import VConsole from 'vconsole' import VConsole from 'vconsole'
import VueCookie from 'vue-cookies' import VueCookie from 'vue-cookies'
import { debounce, departGetForm, personlGetForm, handleInput, messageSuccess } from '@/utils/common' import { debounce, departGetForm, personlGetForm, handleInput, messageSuccess, loading, loadingClose } from '@/utils/common'
import { format } from '@/utils/dateFormat' import { format } from '@/utils/dateFormat'
// } // }
@ -23,6 +23,8 @@ var vConsole = new VConsole({
Vue.use(VueCookie) Vue.use(VueCookie)
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.prototype.$loadingStart = loading
Vue.prototype.$loadingEnd = loadingClose
Vue.prototype.$format = format Vue.prototype.$format = format
Vue.prototype.debounce = debounce Vue.prototype.debounce = debounce
Vue.prototype.$personlGetForm = personlGetForm Vue.prototype.$personlGetForm = personlGetForm

View File

@ -2,11 +2,14 @@ import { getDepList } from '@/api/report'
const user = { const user = {
state: { state: {
deplist: [], deplist: [],
info: { info: JSON.parse(localStorage.getItem('info')) || {}
src: ''
}
}, },
mutations: { mutations: {
SET_USER_INFO: (state, info) => {
localStorage.setItem('info', JSON.stringify(info))
state.info = info
},
SET_DEPLIST: (state, list = []) => { SET_DEPLIST: (state, list = []) => {
state.deplist = list state.deplist = list
} }

View File

@ -90,3 +90,19 @@ export function messageSuccess (params) {
type: 'success' type: 'success'
}) })
} }
let id = ''
export function loading (options = {
fullscreen: true,
target: document.querySelector('.appamin'),
background: 'rgba(255, 255, 255, 0.8)',
spinner: 'el-icon-loading',
text: '数据加载中'}) {
id = this.$loading.service(options)
}
export function loadingClose () {
setTimeout(() => {
id.close()
}, 300)
}

View File

@ -23,16 +23,16 @@ const service = axios.create({
timeout: 1500000 timeout: 1500000
}) })
const options = { // const options = {
fullscreen: true, // fullscreen: true,
target: document.querySelector('.appamin'), // target: document.querySelector('.appamin'),
background: 'rgba(255, 255, 255, 0.8)', // background: 'rgba(255, 255, 255, 0.8)',
spinner: 'el-icon-loading', // spinner: 'el-icon-loading',
text: '数据加载中'} // text: '数据加载中'}
// request拦截器 // request拦截器
service.interceptors.request.use(config => { service.interceptors.request.use(config => {
Loading.service(options) // Loading.service(options)
// 是否需要设置 token // 是否需要设置 token
// const isToken = (config.headers || {}).isToken === false // const isToken = (config.headers || {}).isToken === false
// if (getToken() && !isToken) { // if (getToken() && !isToken) {
@ -47,20 +47,20 @@ service.interceptors.request.use(config => {
// 响应拦截器 // 响应拦截器
service.interceptors.response.use(res => { service.interceptors.response.use(res => {
const id = setTimeout(() => { // const id = setTimeout(() => {
Loading.service(options).close() // Loading.service(options).close()
clearTimeout(id) // clearTimeout(id)
}, 300) // }, 300)
if (res.config.responseType === 'blob') { if (res.config.responseType === 'blob') {
return res return res
} }
return res.data return res.data
}, },
error => { error => {
const id = setTimeout(() => { // const id = setTimeout(() => {
Loading.service(options).close() // Loading.service(options).close()
clearTimeout(id) // clearTimeout(id)
}, 300) // }, 300)
console.log('err' + error) console.log('err' + error)
let { message } = error let { message } = error
if (message === 'Network Error') { if (message === 'Network Error') {

View File

@ -153,7 +153,9 @@ export default {
}, },
async handleGetData (parmas = this.params) { async handleGetData (parmas = this.params) {
try { try {
this.$loadingStart()
let res = await apiGetAssessList(parmas) let res = await apiGetAssessList(parmas)
this.$loadingEnd()
res = res.data res = res.data
this.tableData = res.list this.tableData = res.list
this.params.totalCount = res.totalCount this.params.totalCount = res.totalCount

View File

@ -166,7 +166,9 @@ export default {
this.dialogFormVisible = true this.dialogFormVisible = true
}, },
async handleAgree () { async handleAgree () {
this.$loadingStart()
let res = await this.handlApiSaveapproval({status: 1, menuName: '同意了'}) let res = await this.handlApiSaveapproval({status: 1, menuName: '同意了'})
this.$loadingEnd()
this.dialogFormVisible = !!res this.dialogFormVisible = !!res
}, },
// //
@ -186,7 +188,9 @@ export default {
const obj = {status: 3, menuName: '催办了'} const obj = {status: 3, menuName: '催办了'}
if (this.info) obj.flowRecordId = this.info.flowRecordId if (this.info) obj.flowRecordId = this.info.flowRecordId
const params = Object.assign({}, this.form, {resultRecordId: this.$route.query.id || ''}, obj) const params = Object.assign({}, this.form, {resultRecordId: this.$route.query.id || ''}, obj)
this.$loadingStart()
let res = await apiSaveapproval(params) let res = await apiSaveapproval(params)
this.$loadingEnd()
if (res.code !== 200) { if (res.code !== 200) {
this.$message.error(res.msg) this.$message.error(res.msg)
return return
@ -216,7 +220,9 @@ export default {
const obj = {status: 4, menuName: '跳过了'} const obj = {status: 4, menuName: '跳过了'}
if (this.info) obj.flowRecordId = this.info.flowRecordId if (this.info) obj.flowRecordId = this.info.flowRecordId
const params = Object.assign({}, this.form, {resultRecordId: this.$route.query.id || ''}, obj) const params = Object.assign({}, this.form, {resultRecordId: this.$route.query.id || ''}, obj)
this.$loadingStart()
let res = await apiSaveapproval(params) let res = await apiSaveapproval(params)
this.$loadingEnd()
if (res.code !== 200) { if (res.code !== 200) {
this.$message.error(res.msg) this.$message.error(res.msg)
return return
@ -248,7 +254,9 @@ export default {
}) })
}, },
async handleSubmit () { async handleSubmit () {
this.$loadingStart()
let res = await this.handlApiSaveapproval({status: 5, menuName: '驳回了'}) let res = await this.handlApiSaveapproval({status: 5, menuName: '驳回了'})
this.$loadingEnd()
console.log('!!res: ', !!res) console.log('!!res: ', !!res)
this.bohui = !!res this.bohui = !!res
}, },

View File

@ -84,8 +84,8 @@
<div v-if="tableInfo.result || tableInfo.score" class="table-bottom"> <div v-if="tableInfo.result || tableInfo.score" class="table-bottom">
<div class="table-bottom-content"> <div class="table-bottom-content">
<el-button size='small' @click="handleCancelResult" plain>取消</el-button> <el-button size='small' @click="handleCancelResult" plain>取消</el-button>
<el-button size='small' @click="handleSaveDetail()" plain>暂存</el-button> <el-button size='small' :loading='loadingZan' @click="handleSaveDetail()" plain>暂存</el-button>
<el-button size='small' @click="handleGetNext" type="primary" >{{tableInfo.result?'提交结果值':'提交评分'}}</el-button> <el-button size='small' :loading='loadingTi' @click="handleGetNext" type="primary" >{{tableInfo.result?'提交结果值':'提交评分'}}</el-button>
</div> </div>
</div> </div>
<!-- <div v-else class="table-bottoms"> <!-- <div v-else class="table-bottoms">
@ -128,6 +128,8 @@ export default {
}, },
data () { data () {
return { return {
loadingTi: false,
loadingZan: false,
input: '', input: '',
scoreList: [] scoreList: []
} }
@ -138,14 +140,17 @@ export default {
}, },
methods: { methods: {
async handleGetNext () { async handleGetNext () {
this.loadingTi = true
let res1 = await apiSaveDetail(this.obj) let res1 = await apiSaveDetail(this.obj)
if (res1.code !== 200) { if (res1.code !== 200) {
this.$message.error(res1.msg) this.$message.error(res1.msg)
this.loadingTi = false
return return
} }
const obj = {status: 1, menuName: this.tableInfo.result ? '提交了结果值' : '提交了评分'} const obj = {status: 1, menuName: this.tableInfo.result ? '提交了结果值' : '提交了评分'}
const params = Object.assign({}, {resultRecordId: this.$route.query.id || ''}, obj) const params = Object.assign({}, {resultRecordId: this.$route.query.id || ''}, obj)
let res = await apiSaveapproval(params) let res = await apiSaveapproval(params)
this.this.loadingTi = false
if (res.code !== 200) { if (res.code !== 200) {
this.$message.error(res.msg) this.$message.error(res.msg)
return return
@ -166,7 +171,9 @@ export default {
console.log('resssss: ', res) console.log('resssss: ', res)
}, },
async handleSaveDetail (params = this.obj) { async handleSaveDetail (params = this.obj) {
this.loadingZan = true
let res = await apiSaveDetail(params) let res = await apiSaveDetail(params)
this.loadingZan = false
if (res.code !== 200) { if (res.code !== 200) {
this.$message.error(res.msg) this.$message.error(res.msg)
return return

View File

@ -178,13 +178,14 @@ export default {
}, },
computed: {}, computed: {},
beforeMount () { }, beforeMount () { },
mounted () { async mounted () {
this.handleList() await this.handleList()
this.handleGetTbale()
}, },
methods: { methods: {
async handleGetTbale (id = this.$route.query.id) { async handleGetTbale (id = this.$route.query.id) {
this.$loadingStart()
let res = await apiResultGetDetail({ id }) let res = await apiResultGetDetail({ id })
this.$loadingEnd()
if (res.code !== 200) return if (res.code !== 200) return
this.obj = res.data this.obj = res.data
}, },
@ -200,6 +201,7 @@ export default {
}, },
async handleList () { async handleList () {
let res = await apiResultRecordDetail({ resultRecordId: this.$route.query.id }) let res = await apiResultRecordDetail({ resultRecordId: this.$route.query.id })
this.handleGetTbale()
if (res.code !== 200) return if (res.code !== 200) return
const arr = res.data.flowRecordList.concat([]) const arr = res.data.flowRecordList.concat([])
for (let i in res.data.flowRecordList) { for (let i in res.data.flowRecordList) {

View File

@ -19,7 +19,7 @@
<el-button size="small" icon="el-icon-plus" plain @click="handleChoose">选人员</el-button> <el-button size="small" icon="el-icon-plus" plain @click="handleChoose">选人员</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button size="small" type="primary" @click="handleOnSubmit">确定</el-button> <el-button size="small" :loading='isLoading' type="primary" @click="handleOnSubmit">确定</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
@ -34,6 +34,7 @@ import { apiAssessManagerChange} from '@/api/assessment'
export default { export default {
data () { data () {
return { return {
isLoading: false,
isSshow: false, isSshow: false,
list: { list: {
list: [] list: []
@ -59,7 +60,10 @@ export default {
confirm: 0, confirm: 0,
changeType: 0 changeType: 0
} }
this.isLoading = false
this.$loadingStart()
let res = await apiAssessManagerChange(parmas) let res = await apiAssessManagerChange(parmas)
this.isLoading = true
if (res.code === 503) { if (res.code === 503) {
this.$confirm(res.msg, '提示', { this.$confirm(res.msg, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
@ -68,6 +72,7 @@ export default {
}).then(async () => { }).then(async () => {
parmas.confirm = 1 parmas.confirm = 1
let res1 = await apiAssessManagerChange(parmas) let res1 = await apiAssessManagerChange(parmas)
this.$loadingEnd()
if (res1.code !== 200) return this.$message.error(res1.msg) if (res1.code !== 200) return this.$message.error(res1.msg)
history.go(-1) history.go(-1)
}).catch(() => { }).catch(() => {

View File

@ -320,8 +320,9 @@ export default {
this.handleGetListContent() this.handleGetListContent()
}, },
async handleGetListContent (params = this.params) { async handleGetListContent (params = this.params) {
console.log('params: ', params) this.$loadingStart()
let res = await apiManagerDetail(params) let res = await apiManagerDetail(params)
this.$loadingEnd()
if (res.code !== 200) return if (res.code !== 200) return
this.tableData = res.data.list this.tableData = res.data.list
this.params.totalCount = res.data.totalCount this.params.totalCount = res.data.totalCount

View File

@ -282,7 +282,9 @@ export default {
startId: startId startId: startId
} }
try { try {
this.$loadingStart()
const result = await getChartData(params) const result = await getChartData(params)
this.$loadingEnd()
// startIdstartId // startIdstartId
if (typeof startId === 'undefined') { if (typeof startId === 'undefined') {
this.defaultStartId[0] = result.data[0].type this.defaultStartId[0] = result.data[0].type

View File

@ -181,12 +181,14 @@ export default {
}, },
beforeMount () {}, beforeMount () {},
async mounted () { async mounted () {
this.$loadingStart()
this.handleGetGround() this.handleGetGround()
const id = this.$route.query.id || '' const id = this.$route.query.id || ''
this.id = id this.id = id
if (id) { if (id) {
this.handleGetByIdForBasis(id) await this.handleGetByIdForBasis(id)
} }
this.$loadingEnd()
this.form = this.basisForm this.form = this.basisForm
}, },
methods: { methods: {

View File

@ -92,6 +92,7 @@ export default {
} }
this.loadings = true this.loadings = true
try { try {
this.$loadingStart()
let res1 = await apiCheckStaff(Object.assign({}, this.basisForm, {confirm: 1})) let res1 = await apiCheckStaff(Object.assign({}, this.basisForm, {confirm: 1}))
console.log('res1: ', res1) console.log('res1: ', res1)
let res = await saveBaseSet(this.basisForm) let res = await saveBaseSet(this.basisForm)
@ -113,6 +114,7 @@ export default {
console.log('this.templateForm: ', JSON.stringify(this.templateForm)) console.log('this.templateForm: ', JSON.stringify(this.templateForm))
try { try {
let res = await saveTemSet(this.templateForm) let res = await saveTemSet(this.templateForm)
this.$loadingEnd()
res = res.data res = res.data
// this.basisForm = res // this.basisForm = res
console.log('res: ', res) console.log('res: ', res)

View File

@ -158,7 +158,9 @@ export default {
}, },
async handleGetData (parmas = Object.assign({}, this.params)) { async handleGetData (parmas = Object.assign({}, this.params)) {
try { try {
this.$loadingStart()
let res = await getWorkList(parmas) let res = await getWorkList(parmas)
this.$loadingEnd()
if (res.code !== 200) return if (res.code !== 200) return
res = res.data res = res.data
console.log('res: ', res) console.log('res: ', res)

View File

@ -74,7 +74,9 @@ export default {
}, },
methods: { methods: {
handleGetList () { handleGetList () {
this.$loadingStart()
apiGetWaitList(this.pageProcessedInfo).then(res => { apiGetWaitList(this.pageProcessedInfo).then(res => {
this.$loadingEnd()
if (res.code === 200) { if (res.code === 200) {
this.pageProcessedInfo.currPage = res.data.currPage this.pageProcessedInfo.currPage = res.data.currPage
this.pageProcessedInfo.totalCount = res.data.totalCount this.pageProcessedInfo.totalCount = res.data.totalCount

View File

@ -20,7 +20,8 @@
</template> </template>
<script> <script>
import { apiLogin, apiSendSMS } from '@/api/data' import { apiLogin, apiSendSMS, apiUserInfo } from '@/api/data'
import { mapMutations } from 'vuex'
let hostList = 'lzmanagement.ldxinyong.com' let hostList = 'lzmanagement.ldxinyong.com'
let thostList = 'tlzmanagement.ldxinyong.com' let thostList = 'tlzmanagement.ldxinyong.com'
const islzmanagement = window.location.host.indexOf('hostList') > -1 && window.location.host.indexOf('hostList') < 0 const islzmanagement = window.location.host.indexOf('hostList') > -1 && window.location.host.indexOf('hostList') < 0
@ -38,6 +39,7 @@ export default {
beforeMount () {}, beforeMount () {},
mounted () {}, mounted () {},
methods: { methods: {
...mapMutations(['SET_USER_INFO']),
handleClick () { handleClick () {
this.isShow = !this.isShow this.isShow = !this.isShow
}, },
@ -53,6 +55,11 @@ export default {
if (res.code === 200) { if (res.code === 200) {
this.token = res.token this.token = res.token
this.$cookies.set('token', res.token, res.expire) this.$cookies.set('token', res.token, res.expire)
let ress = await apiUserInfo()
if (ress.code === 200) {
this.SET_USER_INFO(ress.user)
}
console.log('ress: ', ress)
location.reload() location.reload()
} }
} }

View File

@ -206,7 +206,9 @@ export default {
para['startTime'] = this.$format(this.formData.rangDate[0], 'yyyy-MM-dd hh:mm:ss') para['startTime'] = this.$format(this.formData.rangDate[0], 'yyyy-MM-dd hh:mm:ss')
para['endTime'] = this.$format(this.formData.rangDate[1], 'yyyy-MM-dd hh:mm:ss') para['endTime'] = this.$format(this.formData.rangDate[1], 'yyyy-MM-dd hh:mm:ss')
} }
this.$loadingStart()
apiInitiateAssessmentInfo(para).then(res => { apiInitiateAssessmentInfo(para).then(res => {
this.$loadingEnd()
this.dialogSendVisible = false this.dialogSendVisible = false
if (res.code !== 200) { if (res.code !== 200) {
this.$message.error(res.msg) this.$message.error(res.msg)