Merge pull request 'de' (#798) from de into master
Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/798
This commit is contained in:
@@ -212,3 +212,17 @@ export const checkMatrix = (userId) => {
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
export const getAgentInfo=(userId)=>{
|
||||
return request({
|
||||
url: `/admin/mosr/user/approval/agent/${userId}`,
|
||||
method:'get'
|
||||
})
|
||||
}
|
||||
|
||||
export const editAgentInfo=(data)=>{
|
||||
return request({
|
||||
url:'/admin/mosr/user/approval/agent',
|
||||
method:'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -3,12 +3,16 @@
|
||||
<slot name="pre"></slot>
|
||||
<div class="user-audit">
|
||||
<div class="circle-user">
|
||||
<Tooltip :content="user.name" placement="bottom-start" width="45px"/>
|
||||
<Tooltip v-if="userName" :content="userName" placement="bottom-start" width="45px"/>
|
||||
<Tooltip v-else :content="user.name" placement="bottom-start" width="45px"/>
|
||||
<!-- :style="{-->
|
||||
<!-- backgroundColor: '#fff'-->
|
||||
<!-- }">-->
|
||||
<div v-if="user.icon"
|
||||
class="el-timeline-item__node" :style="{
|
||||
backgroundColor: '#fff'
|
||||
}">
|
||||
<el-icon v-if="user.icon" size="15" :color="user.color" :class="user.class">
|
||||
class="el-timeline-item__node">
|
||||
<div v-if="user.isAgent&&!showIcon">
|
||||
</div>
|
||||
<el-icon v-else size="15" :color="user.color" :class="user.class">
|
||||
<component :is="user.icon"/>
|
||||
</el-icon>
|
||||
</div>
|
||||
@@ -28,10 +32,18 @@ const props = defineProps({
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
showIcon: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
user: {
|
||||
type: Object,
|
||||
default: {}
|
||||
},
|
||||
userName: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
mode: {
|
||||
type: String,
|
||||
default: 'design'
|
||||
@@ -71,20 +83,22 @@ const initUser = (user) => {
|
||||
user["class"] = 'is-loading'
|
||||
}
|
||||
//拒绝后评论
|
||||
if (state === 'REFUSE') {
|
||||
user["icon"] = 'Close'
|
||||
if (state === 'REFUSE' || state === 'ROLLBACK') {
|
||||
// user["icon"] = 'Close'
|
||||
// user["color"] = "#f56c6c"
|
||||
user["icon"] = 'CircleCloseFilled'
|
||||
user["color"] = "#f56c6c"
|
||||
}
|
||||
if (state === 'PASS') {
|
||||
user["icon"] = 'MoreFilled'
|
||||
user["color"] = "#c0c4cc"
|
||||
}
|
||||
if (state === 'ROLLBACK') {
|
||||
// user["icon"] = 'RefreshLeft'
|
||||
// user["color"] = "#f78f5f"
|
||||
user["icon"] = 'CircleCloseFilled'
|
||||
user["color"] = "#f56c6c"
|
||||
}
|
||||
// if (state === 'ROLLBACK') {
|
||||
// // user["icon"] = 'RefreshLeft'
|
||||
// // user["color"] = "#f78f5f"
|
||||
// user["icon"] = 'CircleCloseFilled'
|
||||
// user["color"] = "#f56c6c"
|
||||
// }
|
||||
return user;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div class="my">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="10" :xs="24">
|
||||
<el-card class="box-card1">
|
||||
<el-col :span="12" :xs="24">
|
||||
<el-card>
|
||||
<!-- 标题 -->
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
@@ -28,24 +28,24 @@
|
||||
</div>
|
||||
<div>{{ userParams.nickName }}</div>
|
||||
</div>
|
||||
<div class="userInfo_item">
|
||||
<div style="display: flex;align-items: center">
|
||||
<el-icon size="18" style="margin-right: 5px">
|
||||
<Notification/>
|
||||
</el-icon>
|
||||
工号:
|
||||
</div>
|
||||
<div>{{ userParams.workCode }}</div>
|
||||
</div>
|
||||
<div class="userInfo_item">
|
||||
<div style="display: flex;align-items: center">
|
||||
<el-icon size="18" style="margin-right: 5px">
|
||||
<Phone/>
|
||||
</el-icon>
|
||||
电话号码:
|
||||
</div>
|
||||
<div>{{ userParams.mobile }}</div>
|
||||
</div>
|
||||
<!-- <div class="userInfo_item">-->
|
||||
<!-- <div style="display: flex;align-items: center">-->
|
||||
<!-- <el-icon size="18" style="margin-right: 5px">-->
|
||||
<!-- <Notification/>-->
|
||||
<!-- </el-icon>-->
|
||||
<!-- 工号:-->
|
||||
<!-- </div>-->
|
||||
<!-- <div>{{ userParams.workCode }}</div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="userInfo_item">-->
|
||||
<!-- <div style="display: flex;align-items: center">-->
|
||||
<!-- <el-icon size="18" style="margin-right: 5px">-->
|
||||
<!-- <Phone/>-->
|
||||
<!-- </el-icon>-->
|
||||
<!-- 电话号码:-->
|
||||
<!-- </div>-->
|
||||
<!-- <div>{{ userParams.mobile }}</div>-->
|
||||
<!-- </div>-->
|
||||
<div class="userInfo_item">
|
||||
<div style="display: flex;align-items: center">
|
||||
<el-icon size="18" style="margin-right: 5px">
|
||||
@@ -94,7 +94,70 @@
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="14" :xs="24">
|
||||
<el-col :span="12" :xs="24">
|
||||
<el-card>
|
||||
<baseTitle title="设置代理" ></baseTitle>
|
||||
<el-form ref="userForm" :model="agentInfoForm" label-width="85px">
|
||||
<el-row gutter="30">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="被代理人" prop="nickName">
|
||||
<span>{{ agentInfoForm.nickName }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="代理人" prop="" required >
|
||||
<el-button style="margin-right: 10px" color="#DED0B2" @click="handleShowAgentDialog">
|
||||
{{ agentUserList?.length !== 0 ? '更改' : '请选择' }}
|
||||
</el-button>
|
||||
<div v-for="item in agentUserList" :key="item.id" style="margin-right: 5px">
|
||||
{{ item.name }}
|
||||
</div>
|
||||
<user-picker :multiple="false" ref="agentUserPickerRef" title="请选择代理人"
|
||||
v-model:value="agentUserList" @ok="agentUserPickerOk"
|
||||
@cancelOrClear="agentUserPickerOk"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="代理状态" prop="agentState">
|
||||
<Tag dictType="agent_state" :value="agentInfoForm.agentState"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="开始时间" prop="agentStartTime">
|
||||
<el-config-provider>
|
||||
<el-date-picker
|
||||
v-model="agentInfoForm.agentStartTime"
|
||||
type="datetime"
|
||||
placeholder="请选择开始时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
/>
|
||||
</el-config-provider>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="结束时间" prop="agentEndTime" :title="!agentInfoForm.agentStartTime?'请先选择开始时间!':''">
|
||||
<el-config-provider>
|
||||
<el-date-picker
|
||||
v-model="agentInfoForm.agentEndTime"
|
||||
type="datetime"
|
||||
placeholder="请选择结束时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
:disabled="!agentInfoForm.agentStartTime"
|
||||
:disabled-date="disabledAgentEndTime"
|
||||
/>
|
||||
</el-config-provider>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-form-item>
|
||||
<el-button color="#DED0B2" @click="handleSubmitAgent" style="margin-left: 16px">提交</el-button>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :xs="24">
|
||||
<el-card class="box-card">
|
||||
<!-- 标题 -->
|
||||
<template #header>
|
||||
@@ -113,8 +176,8 @@
|
||||
<el-input placeholder="请确认新密码" v-model="userPassword.confirmPassword" type="password"/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button color="#DED0B2" @click="handleSubmit">提交</el-button>
|
||||
<el-button @click="close">关闭</el-button>
|
||||
<el-button color="#DED0B2" @click="handleSubmitPassword">提交</el-button>
|
||||
<el-button @click="closeIndividualCenter">关闭</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
@@ -126,18 +189,23 @@
|
||||
import {ElNotification} from 'element-plus'
|
||||
import {useTagsView} from '@/stores/tagsview.js'
|
||||
import {getAuthInfo} from "@/api/login";
|
||||
import {editPassword, initPassword} from "@/api/auth/auth";
|
||||
import {editPassword, initPassword,getAgentInfo,editAgentInfo} from "@/api/auth/auth";
|
||||
import UserPicker from "@/views/workflow/process/common/UserPicker.vue";
|
||||
|
||||
const router = useRouter()
|
||||
const tagsViewStore = useTagsView()
|
||||
const isInitPassword = ref(false);
|
||||
const agentUserList = ref([])
|
||||
const agentUserPickerRef = ref()
|
||||
const userParams = ref({});
|
||||
const passwordRef = ref();
|
||||
const router = useRouter()
|
||||
const agentInfoForm = ref({});
|
||||
const userPassword = ref({
|
||||
oldPassword: '',
|
||||
newPassword: '',
|
||||
confirmPassword: ''
|
||||
});
|
||||
const tagsViewStore = useTagsView()
|
||||
|
||||
const validatePasswordComplexity = (rule, value, callback) => {
|
||||
const reg = /^(?=.*[a-zA-Z])(?=.*\d).{1,9}$/; //密码必须是至少包含字母、数字,1-9位
|
||||
if (!reg.test(value)) {
|
||||
@@ -176,21 +244,90 @@ const rules = reactive({
|
||||
}
|
||||
],
|
||||
})
|
||||
const disabledAgentEndTime = (time) => {
|
||||
return time.getTime() <= new Date(agentInfoForm.value.agentStartTime)-1 * 24 * 3600 * 1000
|
||||
}
|
||||
|
||||
const getInfo = async () => {
|
||||
const handleShowAgentDialog = () => {
|
||||
agentUserPickerRef.value.showUserPicker()
|
||||
}
|
||||
|
||||
const agentUserPickerOk = (userList) => {
|
||||
console.info("🚀 ~method:userList -----", userList)
|
||||
agentUserList.value = userList
|
||||
}
|
||||
const getUserInfo = async () => {
|
||||
await getAuthInfo().then(res => {
|
||||
userParams.value = res.data.user
|
||||
isInitPassword.value = res.data.initPassword
|
||||
if(res.code===1000){
|
||||
userParams.value = res.data.user
|
||||
isInitPassword.value = res.data.initPassword
|
||||
}else {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: res.msg,
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getUserAgentInfo = async () => {
|
||||
await getAgentInfo().then(res => {
|
||||
if(res.code===1000){
|
||||
agentInfoForm.value=res.data
|
||||
agentUserList.value=[
|
||||
{
|
||||
id:res.data.agentUserId,
|
||||
name:res.data.agentNickName,
|
||||
companyName:res.data.agentCompanyName,
|
||||
}
|
||||
]
|
||||
}else {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: res.msg,
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
localStorage.removeItem('originallySelectedList')
|
||||
|
||||
const belongToRole = (roles) => {
|
||||
if (!roles) return;
|
||||
return roles.map(item => item.roleName).join(',')
|
||||
}
|
||||
|
||||
const handleSubmitAgent=()=>{
|
||||
let agentUserId=''
|
||||
if(agentUserList.value&&agentUserList.value.length>0){
|
||||
agentUserId=agentUserList.value[0]?.id
|
||||
}else {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: '请选择代理人!',
|
||||
type: 'error'
|
||||
})
|
||||
return;
|
||||
}
|
||||
let agentParams={
|
||||
agentUserId:agentUserId,
|
||||
agentStartTime:agentInfoForm.value.agentStartTime,
|
||||
agentEndTime:agentInfoForm.value.agentEndTime
|
||||
}
|
||||
console.info("🚀 ~method:agentParams -----", agentParams)
|
||||
editAgentInfo(agentParams).then(res => {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: res.msg,
|
||||
type: res.code === 1000 ? 'success' : 'error'
|
||||
})
|
||||
if (res.code === 1000) {
|
||||
getUserAgentInfo()
|
||||
}
|
||||
})
|
||||
}
|
||||
// 修改密码
|
||||
const handleSubmit = async () => {
|
||||
const handleSubmitPassword = async () => {
|
||||
if (isInitPassword.value) {
|
||||
editPassword({
|
||||
...userPassword.value
|
||||
@@ -221,23 +358,28 @@ const handleSubmit = async () => {
|
||||
}
|
||||
}
|
||||
// 关闭
|
||||
const close = () => {
|
||||
const closeIndividualCenter = () => {
|
||||
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
|
||||
router.push('/')
|
||||
}
|
||||
onMounted(() => {
|
||||
getInfo()
|
||||
getUserInfo()
|
||||
getUserAgentInfo()
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.box-card {
|
||||
//margin-left: 10px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
body, div {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.my {
|
||||
margin: 0 auto;
|
||||
margin-top: 20px;
|
||||
margin: 20px auto 0;
|
||||
|
||||
.userDetail {
|
||||
.userImg {
|
||||
@@ -256,21 +398,14 @@ body, div {
|
||||
}
|
||||
|
||||
.userInfo_item {
|
||||
display: flex;align-items: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 40px;
|
||||
border-bottom-style: solid;
|
||||
border-color: #daddd2;
|
||||
border-width: 1px;
|
||||
//text-align: left;
|
||||
//line-height: 40px;
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
//.userInfo_item > div {
|
||||
// float: right;
|
||||
//}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
<span>提交时间:</span>
|
||||
</div>
|
||||
<div class="time"> {{ item.submitTime }}</div>
|
||||
<div class="time">时间要求 {{ item.totalTime }}天</div>
|
||||
<!-- <div class="time">时间要求 {{ item.totalTime }}天</div>-->
|
||||
</div>
|
||||
<div class="view" @click="handleView(item)">查看</div>
|
||||
</div>
|
||||
@@ -114,7 +114,7 @@
|
||||
<span>提交时间:</span>
|
||||
</div>
|
||||
<div class="time"> {{ item.submitTime }}</div>
|
||||
<div class="time">时间要求 {{ item.totalTime }}天</div>
|
||||
<!-- <div class="time">时间要求 {{ item.totalTime }}天</div>-->
|
||||
</div>
|
||||
<div class="view" @click="handleView(item)">查看</div>
|
||||
</div>
|
||||
@@ -627,7 +627,7 @@ const moneyPieOption = ref({
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
// getTodoList()
|
||||
getTodoList()
|
||||
await getResearchChart()
|
||||
// nextTick(() => {
|
||||
// let topLeft=document.getElementById('topLeft')
|
||||
@@ -664,7 +664,7 @@ const goToSpecialFund = () => {
|
||||
})
|
||||
}
|
||||
const refreshTodoOrDoneList = () => {
|
||||
// getTodoList()
|
||||
getTodoList()
|
||||
}
|
||||
const initFundCharts = () => {
|
||||
data.fundPieCharts = echarts.init(document.getElementById('fundPie')).setOption(fundPieOption.value)
|
||||
@@ -675,8 +675,8 @@ const initMoneyCharts = () => {
|
||||
const getTodoList = () => {
|
||||
getHomeTaskInfo().then(res => {
|
||||
if (res.code === 1000) {
|
||||
// todoList.value=res.data.rows
|
||||
// todoNum.value=res.data.total
|
||||
todoList.value=res.data.rows
|
||||
todoNum.value=res.data.total
|
||||
} else {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
@@ -1267,9 +1267,9 @@ const handleView = (row) => {
|
||||
width: 80px;
|
||||
margin-left: 23px;
|
||||
|
||||
&:last-child {
|
||||
white-space: nowrap;
|
||||
}
|
||||
//&:last-child {
|
||||
// white-space: nowrap;
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
147
src/views/system/user/agentSetting.vue
Normal file
147
src/views/system/user/agentSetting.vue
Normal file
@@ -0,0 +1,147 @@
|
||||
<template>
|
||||
<div style="padding: 0 30px">
|
||||
<baseTitle title="设置代理"></baseTitle>
|
||||
<el-form ref="userForm" :model="agentInfoForm" label-width="85px">
|
||||
<el-row gutter="30">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="被代理人" prop="nickName">
|
||||
<span>{{ agentInfoForm.nickName }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="代理人" prop="" required>
|
||||
<el-button style="margin-right: 10px" color="#DED0B2" @click="handleShowAgentDialog">
|
||||
{{ agentUserList?.length !== 0 ? '更改' : '请选择' }}
|
||||
</el-button>
|
||||
<div v-for="item in agentUserList" :key="item.id" style="margin-right: 5px">
|
||||
{{ item.name }}
|
||||
</div>
|
||||
<user-picker :multiple="false" ref="agentSettingUserPickerRef" title="请选择代理人"
|
||||
v-model:value="agentUserList" @ok="agentUserPickerOk"
|
||||
@cancelOrClear="agentUserPickerOk"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="代理状态" prop="agentState">
|
||||
<Tag dictType="agent_state" :value="agentInfoForm.agentState"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="开始时间" prop="agentStartTime">
|
||||
<el-config-provider>
|
||||
<el-date-picker
|
||||
v-model="agentInfoForm.agentStartTime"
|
||||
type="datetime"
|
||||
placeholder="请选择开始时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
/>
|
||||
</el-config-provider>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="结束时间" prop="agentEndTime" :title="!agentInfoForm.agentStartTime?'请先选择开始时间!':''">
|
||||
<el-config-provider>
|
||||
<el-date-picker
|
||||
v-model="agentInfoForm.agentEndTime"
|
||||
type="datetime"
|
||||
placeholder="请选择结束时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
:disabled="!agentInfoForm.agentStartTime"
|
||||
:disabled-date="disabledAgentEndTime"
|
||||
/>
|
||||
</el-config-provider>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-form-item>
|
||||
<el-button color="#DED0B2" @click="handleSubmitAgent" style="margin-left: 16px">提交</el-button>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {ElNotification} from "element-plus";
|
||||
import UserPicker from "@/views/workflow/process/common/UserPicker.vue";
|
||||
|
||||
import {editAgentInfo, getAgentInfo} from "@/api/user/user";
|
||||
|
||||
const agentUserList = ref([])
|
||||
const agentInfoForm = ref({});
|
||||
const agentSettingUserPickerRef = ref()
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
localStorage.removeItem('originallySelectedList')
|
||||
const userId = ref(route.query.userId)
|
||||
|
||||
const getUserAgentInfo = async () => {
|
||||
await getAgentInfo(userId.value).then(res => {
|
||||
if (res.code === 1000) {
|
||||
agentInfoForm.value = res.data
|
||||
agentUserList.value = [
|
||||
{
|
||||
id: res.data.agentUserId,
|
||||
name: res.data.agentNickName,
|
||||
companyName: res.data.agentCompanyName,
|
||||
}
|
||||
]
|
||||
} else {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: res.msg,
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
const disabledAgentEndTime = (time) => {
|
||||
return time.getTime() <= new Date(agentInfoForm.value.agentStartTime) - 1 * 24 * 3600 * 1000
|
||||
}
|
||||
|
||||
const handleShowAgentDialog = () => {
|
||||
agentSettingUserPickerRef.value.showUserPicker()
|
||||
}
|
||||
|
||||
const agentUserPickerOk = (userList) => {
|
||||
agentUserList.value = userList
|
||||
}
|
||||
|
||||
const handleSubmitAgent = () => {
|
||||
let agentUserId = ''
|
||||
if (agentUserList.value && agentUserList.value.length > 0) {
|
||||
agentUserId = agentUserList.value[0]?.id
|
||||
} else {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: '请选择代理人!',
|
||||
type: 'error'
|
||||
})
|
||||
return;
|
||||
}
|
||||
let agentParams = {
|
||||
userId: userId.value,
|
||||
agentUserId: agentUserId,
|
||||
agentStartTime: agentInfoForm.value.agentStartTime,
|
||||
agentEndTime: agentInfoForm.value.agentEndTime
|
||||
}
|
||||
console.info("🚀 ~method:agentParams -----", agentParams)
|
||||
editAgentInfo(agentParams).then(res => {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: res.msg,
|
||||
type: res.code === 1000 ? 'success' : 'error'
|
||||
})
|
||||
if (res.code === 1000) {
|
||||
router.push({name: 'User'})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getUserAgentInfo()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -8,8 +8,8 @@
|
||||
import Tag from '@/components/Tag.vue'
|
||||
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
|
||||
import UserPicker from "@/views/workflow/process/common/UserPicker.vue";
|
||||
import { useAuthStore } from '@/stores/userstore.js'
|
||||
import { getDeptOpt, getSubCompOpt,bindAccount,getBindAccount } from '@/api/user/user.js';
|
||||
import {useAuthStore} from '@/stores/userstore.js'
|
||||
import {getDeptOpt, getSubCompOpt, bindAccount, getBindAccount} from '@/api/user/user.js';
|
||||
import {ElMessageBox, ElNotification} from 'element-plus';
|
||||
|
||||
const authStore = useAuthStore()
|
||||
@@ -29,9 +29,9 @@ const searchConfig = ref([
|
||||
remote: true
|
||||
},
|
||||
on: {
|
||||
change: async (val) =>{
|
||||
const { data } = await getDeptOpt({subCompanyId: val})
|
||||
searchConfig.value.find(item=>item.prop == 'departmentId').props.data = data
|
||||
change: async (val) => {
|
||||
const {data} = await getDeptOpt({subCompanyId: val})
|
||||
searchConfig.value.find(item => item.prop == 'departmentId').props.data = data
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -75,7 +75,7 @@ const searchConfig = ref([
|
||||
cacheKey: 'normal_disable',
|
||||
clearable: true,
|
||||
remote: true,
|
||||
filterable:true
|
||||
filterable: true
|
||||
}
|
||||
},
|
||||
])
|
||||
@@ -89,6 +89,7 @@ const auths = {
|
||||
del: ['admin:user:del'],
|
||||
add: ['admin:user:add'],
|
||||
bindUser: ['admin:bind:account'],
|
||||
agentSetting: ['admin:user:agentSetting'],
|
||||
}
|
||||
|
||||
const tableConfig = reactive({
|
||||
@@ -98,7 +99,7 @@ const tableConfig = reactive({
|
||||
type: 'index',
|
||||
label: '序号',
|
||||
align: 'center',
|
||||
width:85,
|
||||
width: 85,
|
||||
index: index => {
|
||||
return (tableIns.value.getQuery().pageNum - 1) * tableIns.value.getQuery().pageSize + index + 1
|
||||
}
|
||||
@@ -139,7 +140,7 @@ const tableConfig = reactive({
|
||||
align: 'center',
|
||||
width: 100,
|
||||
showOverflowTooltip: false,
|
||||
currentRender: ({row, index}) => (<Tag dictType={'account_type'} value={row.accountType} />)
|
||||
currentRender: ({row, index}) => (<Tag dictType={'account_type'} value={row.accountType}/>)
|
||||
},
|
||||
{
|
||||
prop: 'state',
|
||||
@@ -147,7 +148,7 @@ const tableConfig = reactive({
|
||||
width: 80,
|
||||
align: 'center',
|
||||
showOverflowTooltip: false,
|
||||
currentRender: ({row, index}) => (<Tag dictType={'normal_disable'} value={row.state} />)
|
||||
currentRender: ({row, index}) => (<Tag dictType={'normal_disable'} value={row.state}/>)
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
@@ -163,19 +164,22 @@ const tableConfig = reactive({
|
||||
showOverflowTooltip: false,
|
||||
currentRender: ({row, index}) => {
|
||||
return (
|
||||
<div>
|
||||
<el-button type="primary" v-perm={auths.edit} link onClick={()=>handleEdit(row)}>编辑</el-button>
|
||||
{
|
||||
row.userType != 0 ?
|
||||
<el-button type="danger" v-perm={auths.del} link onClick={()=>handleDel(row)}>删除</el-button> :
|
||||
null
|
||||
}
|
||||
{
|
||||
row.accountType == 0 ?
|
||||
<el-button type="primary" v-perm={auths.bindUser} link onClick={()=>handleBindAccount(row)}>绑定账号</el-button> :
|
||||
null
|
||||
}
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" v-perm={auths.edit} link onClick={() => handleEdit(row)}>编辑</el-button>
|
||||
<el-button type="primary" v-perm={auths.agentSetting} link onClick={() => handleAgentSetting(row)}>设置代理
|
||||
</el-button>
|
||||
{
|
||||
row.userType != 0 ?
|
||||
<el-button type="danger" v-perm={auths.del} link onClick={() => handleDel(row)}>删除</el-button> :
|
||||
null
|
||||
}
|
||||
{
|
||||
row.accountType == 0 ?
|
||||
<el-button type="primary" v-perm={auths.bindUser} link
|
||||
onClick={() => handleBindAccount(row)}>绑定账号</el-button> :
|
||||
null
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -183,20 +187,27 @@ const tableConfig = reactive({
|
||||
api: '/admin/mosr/user',
|
||||
params: {},
|
||||
btns: [
|
||||
{name: '新增', color:"#DED0B2", auth: ['admin:user:add'], key: 'add'}
|
||||
{name: '新增', color: "#DED0B2", auth: ['admin:user:add'], key: 'add'}
|
||||
]
|
||||
})
|
||||
|
||||
const handleAgentSetting = (row) => {
|
||||
router.push({
|
||||
name: 'AgentSetting',
|
||||
query: {
|
||||
userId: row.userId,
|
||||
}
|
||||
})
|
||||
}
|
||||
const init = async () => {
|
||||
// console.log(authStore.roles,'userinfo');
|
||||
if(!authStore.roles.includes('superAdmin')) {
|
||||
if (!authStore.roles.includes('superAdmin')) {
|
||||
searchConfig.value = searchConfig.value.slice(1)
|
||||
}
|
||||
searchConfig.value = searchConfig.value
|
||||
const { data } = await getDeptOpt()
|
||||
searchConfig.value.find(item=>item.prop == 'departmentId').props.data = data
|
||||
const {data} = await getDeptOpt()
|
||||
searchConfig.value.find(item => item.prop == 'departmentId').props.data = data
|
||||
const res = await getSubCompOpt()
|
||||
searchConfig.value.find(item=>item.prop == 'subCompanyId').props.data = res.data
|
||||
searchConfig.value.find(item => item.prop == 'subCompanyId').props.data = res.data
|
||||
// console.log("🚀 ~ init ~ searchConfig.value:", searchConfig.value)
|
||||
}
|
||||
|
||||
@@ -233,20 +244,21 @@ const handleDel = (row) => {
|
||||
cancelButtonText: '取消'
|
||||
}).then(async res => {
|
||||
// const { code } = await
|
||||
}).catch(()=>{})
|
||||
}).catch(() => {
|
||||
})
|
||||
}
|
||||
const handleBindAccount=(row)=>{
|
||||
const handleBindAccount = (row) => {
|
||||
currentId.value = row.userId
|
||||
getBindAccount(row.userId).then(res=>{
|
||||
if(res.code != 1000){
|
||||
getBindAccount(row.userId).then(res => {
|
||||
if (res.code != 1000) {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: res.msg,
|
||||
type: 'error'
|
||||
})
|
||||
}else {
|
||||
} else {
|
||||
userList.value = res.data
|
||||
nextTick(()=>{
|
||||
nextTick(() => {
|
||||
userPicker.value.showUserPicker()
|
||||
})
|
||||
}
|
||||
@@ -262,12 +274,12 @@ const selected = (select) => {
|
||||
userInfoList.push(userInfo)
|
||||
}
|
||||
userList.value = userInfoList
|
||||
let ids=userList.value.map(item=>item.id)
|
||||
let params={
|
||||
id:currentId.value,
|
||||
ids:ids
|
||||
let ids = userList.value.map(item => item.id)
|
||||
let params = {
|
||||
id: currentId.value,
|
||||
ids: ids
|
||||
}
|
||||
bindAccount(params).then(res=>{
|
||||
bindAccount(params).then(res => {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: res.msg,
|
||||
@@ -276,8 +288,9 @@ const selected = (select) => {
|
||||
})
|
||||
}
|
||||
const headBtnClick = (key) => {
|
||||
switch(key) {
|
||||
case 'add': handleAdd()
|
||||
switch (key) {
|
||||
case 'add':
|
||||
handleAdd()
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -298,7 +311,8 @@ const headBtnClick = (key) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
:deep(.el-col-5:nth-child(4).el-col-offset-1){
|
||||
|
||||
:deep(.el-col-5:nth-child(4).el-col-offset-1) {
|
||||
margin-left: 35px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<!-- <div>-->
|
||||
<!-- <el-button v-print="print" color="#ded0b2" icon="Printer"> 打印</el-button> id="printBox"-->
|
||||
<!-- </div>-->
|
||||
<div style="margin: 10px" >
|
||||
<!-- <div>-->
|
||||
<!-- <el-button v-print="print" color="#ded0b2" icon="Printer"> 打印</el-button> id="printBox"-->
|
||||
<!-- </div>-->
|
||||
<div style="margin: 10px">
|
||||
<el-timeline>
|
||||
<el-timeline-item v-for="(operation,index) in operationList"
|
||||
:key="index" :timestamp="operation.startTime"
|
||||
@@ -11,7 +11,7 @@
|
||||
size="large"
|
||||
placement="top">
|
||||
<template #dot>
|
||||
<!-- :style="{backgroundColor:operation.color}"-->
|
||||
<!-- :style="{backgroundColor:operation.color}"-->
|
||||
<div style="background-color:#fff;width: 16px; height: 16px">
|
||||
<el-icon :color="operation.color" size="16px">
|
||||
<component :is="operation.icon"></component>
|
||||
@@ -25,10 +25,10 @@
|
||||
<div class="card">
|
||||
<div v-for="(user,index) in operation.userInfo" :key="index" class="avatar_name"
|
||||
:style="{'flex-direction': isColumn?'column':'row'}">
|
||||
<div class="avatar-block" :style="{'margin-bottom': isColumn?'10px':'0'}">
|
||||
<div class="avatar-block" :style="{'margin': isColumn?'0 0 10px 18px':'0'}">
|
||||
<name-circle :user="user" :type="operation.operation"/>
|
||||
<div class="name">
|
||||
<div style="display: flex;align-items: center">
|
||||
<div class="name-block" :style="{'margin': isColumn?'0 0 0 30px':'0 20px 0 10px'}">
|
||||
<div style="display: flex;align-items: center" >
|
||||
<el-icon :color="user.accountType==='0'?'#95d475':user.accountType==null?'#95d475':'#409eff'"
|
||||
style="margin-right: 5px;">
|
||||
<UserFilled/>
|
||||
@@ -38,14 +38,25 @@
|
||||
<span>{{ user.jobActivityDesc }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<!-- <div class="remark">{{ operation.remark }}</div>-->
|
||||
<!-- <div>-->
|
||||
<!-- <div>审批人:</div>-->
|
||||
<!-- <div>{{ user.name }}</div>-->
|
||||
<!-- </div>-->
|
||||
<div v-if="user.isAgent" style="display: flex;" :style="{'margin': isColumn?'10px 0':'0'}">
|
||||
<div>
|
||||
<name-circle :user="user" :showIcon="true" :user-name="user.agentUserName" :type="operation.operation"/>
|
||||
<span style="color: #909399;font-size: 14px">(代理审批)</span>
|
||||
</div>
|
||||
<div class="name-block">
|
||||
<div style="display: flex;align-items: center">
|
||||
<el-icon :color="user.accountType==='0'?'#95d475':user.accountType==null?'#95d475':'#409eff'"
|
||||
style="margin-right: 5px;">
|
||||
<UserFilled/>
|
||||
</el-icon>
|
||||
<span class="name-style">{{ user.agentUserName }}</span>
|
||||
</div>
|
||||
<span>{{ user.agentCompanyName }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="auditOpinion">
|
||||
<div v-if="user.auditOpinion">
|
||||
<div style="margin-bottom: 10px;color: #909399">{{ user.operationTime }}</div>
|
||||
<div style="margin-bottom: 10px;color: #909399">{{ user.operationTime||'2024-09-22 12:16:29' }}</div>
|
||||
<div class="username">
|
||||
<span style="font-weight: bold">审批意见:</span>
|
||||
<el-text v-text="user.auditOpinion" style="word-break: break-all">
|
||||
@@ -200,15 +211,15 @@ const initOperationFun = (operation) => {
|
||||
operation["remark"] = " 处理中"
|
||||
}
|
||||
//回退
|
||||
if (state === 'ROLLBACK') {
|
||||
// operation["icon"] = "RefreshLeft"
|
||||
// operation["color"] = "#f78f5f"
|
||||
operation["icon"] = "CircleCloseFilled"
|
||||
operation["color"] = "#f56c6c"
|
||||
operation["remark"] = " 回退成功"
|
||||
}
|
||||
// if (state === 'ROLLBACK') {
|
||||
// // operation["icon"] = "RefreshLeft"
|
||||
// // operation["color"] = "#f78f5f"
|
||||
// operation["icon"] = "CircleCloseFilled"
|
||||
// operation["color"] = "#f56c6c"
|
||||
// operation["remark"] = " 回退成功"
|
||||
// }
|
||||
//拒绝操作
|
||||
if (state === 'REFUSE' || state === 'AUTO_REFUSE') {
|
||||
if (state === 'REFUSE' || state === 'AUTO_REFUSE' ||state === 'ROLLBACK') {
|
||||
operation["icon"] = "CircleCloseFilled"
|
||||
operation["color"] = "#f56c6c"
|
||||
operation["remark"] = " 拒绝"
|
||||
@@ -267,6 +278,7 @@ init()
|
||||
:deep(.el-timeline-item__dot) {
|
||||
margin-left: -3px;
|
||||
}
|
||||
|
||||
:deep .el-card__body, .el-main {
|
||||
padding: 10px;
|
||||
}
|
||||
@@ -290,29 +302,33 @@ init()
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.name-block {
|
||||
width: 130px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-left: 10px;
|
||||
margin-right: 20px;
|
||||
|
||||
.name-style {
|
||||
color: #2a99ff;
|
||||
}
|
||||
|
||||
> span:last-child {
|
||||
margin-top: 5px;
|
||||
color: #909399;
|
||||
}
|
||||
}
|
||||
.avatar-block {
|
||||
display: flex;
|
||||
|
||||
.name {
|
||||
width: 130px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-left: 10px;
|
||||
margin-right: 20px;
|
||||
|
||||
.name-style {
|
||||
color: #2a99ff;
|
||||
}
|
||||
|
||||
> span:last-child {
|
||||
margin-top: 5px;
|
||||
color: #909399;
|
||||
}
|
||||
.agent-style {
|
||||
color: #909399;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
> div:nth-child(2) {
|
||||
.auditOpinion {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
color: #8a8a8a;
|
||||
|
||||
Reference in New Issue
Block a user