订单合伙人等

dev_2022-05-11
yujialong 3 years ago
parent 27adac2ec4
commit b332158556
  1. 6
      src/assets/css/main.css
  2. BIN
      src/assets/img/house.png
  3. 7
      src/components/Header.vue
  4. 9
      src/libs/util.js
  5. 6
      src/setting.js
  6. 8
      src/store/index.js
  7. 20
      src/utils/api.js
  8. 57
      src/views/customer/AddCustomer.vue
  9. 269
      src/views/join/index.vue
  10. 193
      src/views/join1/index.vue
  11. 19
      src/views/order/AddOrder.vue
  12. 16
      src/views/parner/index.vue
  13. 273
      src/views/parner/mobileRole.vue
  14. 8
      src/views/parner/pcRole.vue
  15. 49
      src/views/parner/staff.vue

@ -429,3 +429,9 @@ li {
.el-switch__label span {
font-size: 12px;
}
@media (max-width: 720px) {
.el-message {
min-width: auto !important;
width: 85%;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 B

@ -27,10 +27,13 @@ export default {
},
methods: {
getUserInfo(){
this.$get(this.api.queryUserInfoDetails).then(res => {
let userInfo = res.result.hrUserInfo
this.$get(this.api.queryUserInfoDetails).then(({ result }) => {
let userInfo = result.hrUserInfo
if(userInfo.userAvatars) this.$store.commit('userAvatar',{avatar: userInfo.userAvatars})
this.userName = userInfo.userName
const { id } = result.userAccount
id && this.$store.commit('SET_ACCOUNTID', id)
this.$store.commit('SET_USERNAME', this.userName)
}).catch(err => {})
},
toPerson(){

@ -131,6 +131,15 @@ const util = {
errorMsg(message,duration = 1500) {
return Message.error({message,showClose: true,offset: (document.documentElement.clientHeight - 40) / 2,duration})
},
// 判断是否是移动端
isMobile() {
if(window.navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)) return true
return false
},
// 前置加0
preZero(num) {
return num > 9 ? num : `0${num}`
},
}
export default util

@ -9,8 +9,8 @@ let jumpPath = `${location.origin}/judgmentPoint`
let host = `${location.origin}:9000/`
if (isDev) {
jumpPath = "http://192.168.31.125:8087/"; // 本地调试-需要启动本地判分点系统
host = 'http://39.108.250.202:9000/'
// host = 'http://192.168.31.151:9000/'// 榕
// host = 'http://39.108.250.202:9000/'
host = 'http://192.168.31.151:9000/'// 榕
// host = 'http://192.168.31.137:9000/'// 赓
} else if (isPro) {
jumpPath = "http://www.huorantech.cn/judgmentPoint/";
@ -21,7 +21,7 @@ const Setting = {
/**
* 基础配置
* */
platformId: 3, // 平台标识,1职站,2数据平台,3中台
platformId: 3, // 平台标识,1职站,2数据平台,3中台,4合伙人
jumpPath, // 判分点系统跳转路径前缀
apiBaseURL: host, // 请求路径前缀
uploadURL: 'http://39.108.250.202:9000/', // 阿里云oss域名

@ -7,6 +7,7 @@ const store = new Vuex.Store({
courseId:'',
userId: '',
roleId: '',
accountId: '',
manager:{},
provinceList: [],
configId: '',
@ -39,8 +40,11 @@ const store = new Vuex.Store({
userAvatar(state,payload){
state.avatar = payload.avatar
},
userData (state, payload) {
state.userId = payload.user_id
SET_ACCOUNTID (state, id) {
state.accountId = id
},
SET_USERNAME (state, userName) {
state.userName = userName
},
courseData (state, payload) {
state.courseId = payload.course_id

@ -9,7 +9,7 @@ export default {
logins: `users/users/user/login`, //登录
verification: `${host}users/users/user/captcha`,// 验证码图片 保留host
bindPhoneOrEmail: `users/users/userAccount/bindPhoneOrEmail`,// 绑定手机
sendPhoneOrEmailCode: `users/users/userAccount/sendPhoneOrEmailCode`,// 手机验证码
sendPhoneOrEmailCode: `${host1}users/users/userAccount/sendPhoneOrEmailCode`,// 手机验证码
getUserRolesPermissionMenu: `users/user-role/getUserRolesPermissionMenu`,
staffTemplate: `http://www.huorantech.cn/template/%E6%89%B9%E9%87%8F%E5%AF%BC%E5%85%A5%E5%91%98%E5%B7%A5%E6%A8%A1%E6%9D%BF.xlsx`, // 后台账号模板
@ -35,7 +35,7 @@ export default {
addCustomer: `nakadai/nakadai/customer/addCustomer`,
queryCustomer: `nakadai/nakadai/customer/queryCustomer`,
queryCustomerDetails: `nakadai/nakadai/customer/queryCustomerDetails`,
saveOrUpdate: `data/data/role/saveOrUpdate`,
saveOrUpdate: `${host1}data/data/role/saveOrUpdate`,
doAssign: `data/data/permission/doAssign`,
updateCustomerByRoleId: `nakadai/nakadai/customer/updateCustomerByRoleId`,
checkEmailOrPhone: `nakadai/nakadai/customer/checkEmailOrPhone`, // 新增客户前:校验手机号或者邮箱
@ -51,6 +51,7 @@ export default {
querySchoolData: `nakadai/nakadai/school/querySchool`,
queryPhone: `liuwanr/user/queryPhone`,
queryPlatform: `liuwanr/userInfo/queryPlatform`,
getAListOfClientBusinessManagers: `nakadai/nakadai/customer/getAListOfClientBusinessManagers`,
// 用户管理
delUserAccounts: `users/users/userAccount/delUserAccounts`,
@ -238,13 +239,13 @@ export default {
exportFailure: `${host}nakadai/backstageStaff/exportFailure`,
// 角色管理
batchRemove: `users/role/batchRemove`, //批量删除角色
checkRoleIsExist: `users/role/checkRoleIsExist`, //判断该角色是否存在
delRoleByAccountId: `users/role/delRoleByAccountId`, //删除某用户下的某个角色
roleList: `users/role/list`, //角色分页列表查询
obtainDetails: `users/role/obtainDetails`, //获取角色详情
saveOrUpdate: `users/role/saveOrUpdate`, //新增或更新角色
queryAllMenus: `users/users/permission/queryAllMenus`, //查询所有菜单
batchRemove: `${host1}users/role/batchRemove`, //批量删除角色
checkRoleIsExist: `${host1}users/role/checkRoleIsExist`, //判断该角色是否存在
delRoleByAccountId: `${host1}users/role/delRoleByAccountId`, //删除某用户下的某个角色
roleList: `${host1}users/role/list`, //角色分页列表查询
obtainDetails: `${host1}users/role/obtainDetails`, //获取角色详情
saveOrUpdate: `${host1}users/role/saveOrUpdate`, //新增或更新角色
queryAllMenus: `${host1}users/users/permission/queryAllMenus`, //查询所有菜单
// 日志管理
logAdd: `nakadai/log/add`,
@ -267,4 +268,5 @@ export default {
partnerAccountList: `${host1}nakadai/partnerAccount/partnerAccountList`,
savePartnerAccount: `${host1}nakadai/partnerAccount/savePartnerAccount`,
generateInvitationCode: `${host1}nakadai/partnerAccount/generateInvitationCode`,
generationQrCode: `${host1}nakadai/partnerAccount/generationQrCode `,
};

@ -225,24 +225,27 @@
<div v-show="curTab === 'tab5'">
<div class="tool">
<div>
<el-input style="width: 300px;" placeholder="请输入商务经理、手机号" prefix-icon="el-icon-search" clearable></el-input>
<el-input style="width: 300px;" placeholder="请输入商务经理、手机号" prefix-icon="el-icon-search" clearable v-model="bmsKeyword"></el-input>
</div>
</div>
<el-table :data="contractInformations" class="table" stripe header-align="center">
<el-table :data="bms" class="table" stripe header-align="center">
<el-table-column type="index" width="100" label="序号" align="center">
</el-table-column>
<el-table-column prop="contractNumber" label="姓名" align="center"></el-table-column>
<el-table-column prop="contractNumber" label="手机号" align="center"></el-table-column>
<el-table-column prop="contractName" label="所属团队" align="center"></el-table-column>
<el-table-column prop="contractName" label="订单数量" align="center"></el-table-column>
<el-table-column prop="contractName" label="最近下单时间" align="center"></el-table-column>
<el-table-column prop="contractName" label="产品" align="center"></el-table-column>
<el-table-column prop="userName" label="姓名" align="center"></el-table-column>
<el-table-column prop="phone" label="手机号" align="center"></el-table-column>
<el-table-column prop="partnerClassificationName" label="所属团队" align="center"></el-table-column>
<el-table-column prop="quantityOfOrder" label="订单数量" align="center"></el-table-column>
<el-table-column prop="latestTime" label="最近下单时间" align="center"></el-table-column>
<el-table-column prop="productName" label="产品" align="center"></el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" @click="showContract(scope.row)">查看</el-button>
<el-button type="text" @click="toOrder(scope.row)">查看</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" @current-change="handleCurrentChangeBm" :current-page="pageBm" :page-size="pageSizeBm" :total="totalBm"></el-pagination>
</div>
</div>
</el-card>
@ -442,6 +445,12 @@ export default {
orders: [],
orderAll: [],
bmsKeyword: '',
bms: [],
pageBm: 1,
pageSizeBm: 10,
totalBm: 0,
countryList: [{
name:'中国'
}],
@ -473,11 +482,18 @@ export default {
this.filterOrder()
},500)
},
bmsKeyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.getBm()
},500)
},
},
mounted() {
this.getIndustryClass()
this.getProduct()
this.getBm()
if(this.customerId){
this.getProduct()
this.$get(this.api.queryCustomerDetails,{
customerId: this.customerId
}).then((res) => {
@ -675,6 +691,27 @@ export default {
//
toOrderDetail(row) {
this.$router.push(`/AddOrder?val=watch&orderId=${row.orderId}&orderStatus=${row.orderStatus === '已完成' ? 1 : 0}`)
},
//
getBm() {
this.$post(this.api.getAListOfClientBusinessManagers, {
keywords: this.bmsKeyword,
customerId: this.customerId,
pageNum: this.pageBm,
pageSize: this.pageSizeBm
}).then(({ data }) => {
this.bms = data.records
this.totalBm = data.total
}).catch(res => {})
},
handleCurrentChangeBm(val) {
this.pageBm = val
this.getBm()
},
//
toOrder(row) {
},
tabChange(index) {

@ -1,23 +1,39 @@
<template>
<div class="wrap">
<el-form ref="form" :model="form" :rules="rules">
<el-form-item prop="userName" label="姓名">
<el-input v-model.trim="form.userName" placeholder="请输入姓名"></el-input>
</el-form-item>
<el-form-item prop="account" label="账号">
<el-input v-model.trim="form.account" placeholder="请输入账号"></el-input>
</el-form-item>
<el-form-item prop="phone" label="手机号">
<el-input v-model.trim="form.phone" placeholder="请输入手机号" maxlength="11"></el-input>
</el-form-item>
<el-form-item prop="email" label="邮箱">
<el-input v-model.trim="form.email" placeholder="请输入邮箱"></el-input>
</el-form-item>
</el-form>
<div class="btn-wrap">
<el-button type="primary" @click="submit">确定</el-button>
<div class="wrap">
<div class="join">
<h6>{{ userName }} 邀请你加入</h6>
<div class="wel">
<div class="icon">
<img src="@/assets/img/house.png" alt="">
</div>
<p class="text">或然科技城市合伙人计划</p>
<p class="text">加入并自动为你创建一个团队群组</p>
</div>
<div class="inner">
<el-form class="form" ref="form" :model="form" :rules="rules">
<el-form-item prop="userName">
<el-input v-model.trim="form.userName" placeholder="请输入姓名"></el-input>
</el-form-item>
<el-form-item prop="account">
<el-input v-model.trim="form.account" placeholder="请输入账号"></el-input>
</el-form-item>
<el-form-item prop="phone">
<el-input v-model.trim="form.phone" placeholder="请输入手机号" maxlength="11"></el-input>
</el-form-item>
<el-form-item prop="code">
<div class="ver-code">
<el-input v-model="form.code" placeholder="请输入验证码" maxlength="6"></el-input>
<el-button class="send" type="text" @click="sendPhoneCode" :disabled="phoneDisabled">{{ phoneBtnText }}</el-button>
</div>
</el-form-item>
<el-form-item prop="email">
<el-input v-model.trim="form.email" placeholder="请输入邮箱"></el-input>
</el-form-item>
</el-form>
<el-button class="submit" type="primary" @click="submit">立即加入</el-button>
</div>
</div>
</div>
</template>
<script>
@ -25,118 +41,91 @@ import util from "@/libs/util"
import Setting from "@/setting"
export default {
data() {
const accountPass = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入账号'))
} else {
const pattern = /^[A-Za-z0-9]*$/
if(pattern.test(value)){
this.accountChange()
callback()
}else{
callback(new Error('请输入正确账号格式'))
}
}
}
const phonePass = (rule, value, callback) => {
if (value) {
const pattern = /^1[3456789]\d{9}$/
if(pattern.test(value)){
this.phoneChange()
callback()
}else{
callback(new Error('请输入正确手机号格式'))
}
} else {
callback(new Error('请输入手机号'))
}
}
const emailPass = (rule, value, callback) => {
if (value) {
const pattern = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/
if(pattern.test(value)){
// this.emailChange()
callback()
}else{
callback(new Error('请输入正确邮箱格式'))
}
} else {
callback()
}
}
return {
token: window.atob(decodeURI(this.$route.query.token)),
isMobile: util.isMobile(),
userName: this.$route.query.userName,
form: {
id: this.$route.query.accountId,
partnerClassificationId: this.$route.query.id,
isTeam: 0,
account: '',
email: '',
phone: '',
code: '',
userName: ''
},
rules: {
account: [
{ required: true, validator: accountPass, trigger: 'blur' }
{ required: true, message: '请输入账号', trigger: 'blur' }
],
userName: [
{ required: true, message: "请输入姓名", trigger: "blur" }
{ required: true, message: '请输入用户名', trigger: "blur" }
],
phone: [
{ required: true, validator: phonePass, trigger: 'blur' }
{ required: true, message: '请输入手机号', trigger: 'blur' }
],
email: [
{ validator: emailPass, trigger: 'blur' }
code: [
{ required: util.isMobile(), message: "请输入验证码", trigger: 'blur' }
]
},
phoneDisabled: false,
phoneTimer: null,
phoneOpener: '',
phoneBtnText: '发送验证码',
submiting: false //
};
},
mounted() {
sessionStorage.setItem('token', this.token)
this.form.token = this.token
},
methods: {
//
accountChange() {
const form = this.form
const { account } = form
if (account === this.originAccount) {
this.accountReapeat = false
} else {
const { accountId } = form
this.$post(`${this.api.checkWorkNumOrAccount}?platformId=${Setting.platformId}&type=2&account=${account}${accountId ? `&accountId=${accountId}` : ''}`).then(res => {
this.accountReapeat = false
}).catch(err => {
this.accountReapeat = true
})
//
verifyPhone(phone) {
if (!phone) {
util.warningMsg("请输入手机号")
return false
}
},
//
phoneChange() {
const form = this.form
const { phone } = form
if (phone) {
const { accountId } = form
this.$post(`${this.api.checkEmailOrPhone}?phone=${phone}${accountId ? `&accountId=${accountId}` : ''}`).then(res => {
this.phoneRepeat = false
}).catch(err => {
this.phoneRepeat = true
})
if (!/^1[3456789]\d{9}$/.test(phone) && !/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(phone)) {
util.warningMsg("请输入正确的手机号")
return false
}
return true
},
//
emailChange() {
const form = this.form
const { email } = form
if (email) {
const { accountId } = form
this.$post(`${this.api.checkEmailOrPhone}?email=${email}${accountId ? `&accountId=${accountId}` : ''}`).then(res => {
this.emailRepeat = false
}).catch(err => {
this.emailRepeat = true
})
//
phoneCountdown() {
let count = 60
if (!this.phoneTimer) {
this.phoneDisabled = true
this.phoneTimer = setInterval(() => {
if (count > 0) {
count--
this.phoneBtnText = `${count}秒后重试`
} else {
this.phoneDisabled = false
clearInterval(this.phoneTimer)
this.phoneTimer = null
this.phoneBtnText = `发送验证码`
}
}, 1000)
}
},
//
sendPhoneCode() {
const { phone } = this.form
if (!this.verifyPhone(phone)) return false
this.$post(this.api.sendPhoneOrEmailCode, {
platform: Setting.platformId,
phone,
types: 2
}).then(({ message }) => {
if (message.opener) {
this.phoneCountdown()
this.phoneOpener = message.opener
} else {
util.errorMsg(message)
}
}).catch(res => {})
},
//
submit() {
this.$refs.form.validate((valid) => {
@ -147,10 +136,13 @@ export default {
if (this.emailRepeat) return util.warningMsg("该邮箱已存在")
const { form } = this
form.uniqueIdentification = Date.now()
form.isTeam = +this.isMobile // (1)pc(0)
this.submiting = true
this.$post(this.api.savePartnerAccount, form).then(res => {
util.successMsg('加入成功!')
setTimeout(location.reload, 1000)
setTimeout(() => {
location.reload()
}, 1000)
}).catch(res => {
this.submiting = false
})
@ -163,10 +155,79 @@ export default {
<style lang="scss" scoped>
.wrap {
width: 500px;
margin: 40px auto;
height: 100%;
background-color: #f3f6fa;
}
.ver-code {
position: relative;
.el-button {
position: absolute;
top: 11px;
right: 10px;
color: #319bf7;
}
}
.btn-wrap {
.join {
width: 436px;
margin: 100px auto 0;
text-align: center;
border-radius: 6px;
background-color: #fff;
border-radius: 6px;
overflow: hidden;
h6 {
padding: 0 15px;
font-size: 18px;
line-height: 48px;
color: #fff;
background-color: #319bf7;
}
.icon {
display: flex;
justify-content: center;
align-items: center;
width: 70px;
height: 70px;
margin: 20px auto;
border-radius: 4px;
background-color: #007eff;
}
.text {
margin-bottom: 10px;
color: #565656;
}
.inner {
padding: 20px;
}
/deep/.el-form-item{
margin-bottom: 25px;
}
/deep/.el-input__inner{
position: relative;
height: 52px;
line-height: 50px;
background-color: #FBFBFB;
border: 1px solid #E1E6F2;
border-radius: 4px !important;
}
.submit {
width: 100%;
padding: 0;
margin-top: 20px;
font-size: 18px;
line-height: 44px;
background-color: #007eff;
border-color: #007eff;
border-radius: 30px;
}
}
@media (max-width: 720px) {
.join {
width: 90%;
margin: 20px auto 0;
.submit {
margin-top: 0;
}
}
}
</style>

@ -0,0 +1,193 @@
<template>
<div class="join">
<el-form class="form" ref="form" :model="form" :rules="rules">
<el-form-item prop="userName" label="姓名">
<el-input v-model.trim="form.userName" placeholder="请输入姓名"></el-input>
</el-form-item>
<el-form-item prop="account" label="账号">
<el-input v-model.trim="form.account" placeholder="请输入账号"></el-input>
</el-form-item>
<el-form-item prop="phone" label="手机号">
<el-input v-model.trim="form.phone" placeholder="请输入手机号" maxlength="11"></el-input>
</el-form-item>
<el-form-item prop="email" label="邮箱">
<el-input v-model.trim="form.email" placeholder="请输入邮箱"></el-input>
</el-form-item>
</el-form>
<div class="btn-wrap">
<el-button type="primary" @click="submit">提交</el-button>
</div>
</div>
</template>
<script>
import util from "@/libs/util"
import Setting from "@/setting"
export default {
data() {
const accountPass = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入账号'))
} else {
const pattern = /^[A-Za-z0-9]*$/
if(pattern.test(value)){
this.accountChange()
callback()
}else{
callback(new Error('请输入正确账号格式'))
}
}
}
const phonePass = (rule, value, callback) => {
if (value) {
const pattern = /^1[3456789]\d{9}$/
if(pattern.test(value)){
this.phoneChange()
callback()
}else{
callback(new Error('请输入正确手机号格式'))
}
} else {
callback(new Error('请输入手机号'))
}
}
const emailPass = (rule, value, callback) => {
if (value) {
const pattern = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/
if(pattern.test(value)){
// this.emailChange()
callback()
}else{
callback(new Error('请输入正确邮箱格式'))
}
} else {
callback()
}
}
return {
token: window.atob(decodeURI(this.$route.query.token)),
form: {
partnerClassificationId: this.$route.query.id,
isTeam: 0,
account: '',
email: '',
phone: '',
userName: ''
},
rules: {
account: [
{ required: true, validator: accountPass, trigger: 'blur' }
],
userName: [
{ required: true, message: "请输入姓名", trigger: "blur" }
],
phone: [
{ required: true, validator: phonePass, trigger: 'blur' }
],
email: [
{ validator: emailPass, trigger: 'blur' }
]
},
submiting: false //
};
},
mounted() {
sessionStorage.setItem('token', this.token)
this.form.token = this.token
},
methods: {
//
accountChange() {
const form = this.form
const { account } = form
if (account === this.originAccount) {
this.accountReapeat = false
} else {
const { accountId } = form
this.$post(`${this.api.checkWorkNumOrAccount}?platformId=${Setting.platformId}&type=2&account=${account}${accountId ? `&accountId=${accountId}` : ''}`).then(res => {
this.accountReapeat = false
}).catch(err => {
this.accountReapeat = true
})
}
},
//
phoneChange() {
const form = this.form
const { phone } = form
if (phone) {
const { accountId } = form
this.$post(`${this.api.checkEmailOrPhone}?phone=${phone}${accountId ? `&accountId=${accountId}` : ''}`).then(res => {
this.phoneRepeat = false
}).catch(err => {
this.phoneRepeat = true
})
}
},
//
emailChange() {
const form = this.form
const { email } = form
if (email) {
const { accountId } = form
this.$post(`${this.api.checkEmailOrPhone}?email=${email}${accountId ? `&accountId=${accountId}` : ''}`).then(res => {
this.emailRepeat = false
}).catch(err => {
this.emailRepeat = true
})
}
},
//
submit() {
this.$refs.form.validate((valid) => {
if (valid) {
if (this.submiting) return false
if (this.accountReapeat) return util.warningMsg("该账号已存在")
if (this.phoneRepeat) return util.warningMsg("该手机号已存在")
if (this.emailRepeat) return util.warningMsg("该邮箱已存在")
const { form } = this
form.uniqueIdentification = Date.now()
this.submiting = true
this.$post(this.api.savePartnerAccount, form).then(res => {
util.successMsg('加入成功!')
setTimeout(location.reload, 1000)
}).catch(res => {
this.submiting = false
})
}
})
},
}
};
</script>
<style lang="scss" scoped>
.join {
.form{
width: 436px;
padding: 38px 38px 60px;
margin: 0 auto 0;
border-radius: 6px;
background-color: #fff;
.title{
margin-bottom: 25px;
font-size: 26px;
color: #0B1D30;
letter-spacing: 4px;
}
}
/deep/.el-form-item{
margin-bottom: 20px;
}
/deep/.el-input__inner{
position: relative;
height: 52px;
padding: 0 20px 0 34px;
line-height: 50px;
background-color: #FBFBFB;
border: 1px solid #E1E6F2;
border-radius: 4px !important;
}
}
</style>

@ -54,7 +54,9 @@
<el-input disabled v-model="form.email" placeholder="请输入邮箱地址"></el-input>
</el-form-item>
<el-form-item label="商务经理">
<el-input v-model="form.businessManager" placeholder="请输入商务经理"></el-input>
<el-select v-model="form.businessManagerId" clearable filterable placeholder="请选择商务经理">
<el-option v-for="(item, i) in bmList" :key="i" :label="item.userName" :value="item.partnerId"></el-option>
</el-select>
</el-form-item>
</el-col>
@ -660,7 +662,7 @@ export default {
orderAmount: 0,
// orderId: this.$store.state.orderId,
customerName: "",//
businessManager: ''
businessManagerId: ''
},
coursePermissions: [],//
dataPlatformPermissions: [],//
@ -725,6 +727,7 @@ export default {
provinceList: this.$store.state.provinceList,
cityList: [],
schoolList: [],
bmList: [],
yearList: [
{ name: "1个月", value: 30 },
{ name: "2个月", value: 60 },
@ -797,6 +800,7 @@ export default {
}
},
async created() {
this.getBm()
this.token = sessionStorage.getItem("token");
//
if (this.$route.query.val == 'isAdd') {
@ -1506,6 +1510,17 @@ export default {
}).catch(res => {
});
},
//
getBm() {
this.$post(this.api.partnerAccountList, {
partnerClassificationId: '',
keyWord: '',
pageNum: 1,
pageSize: 100000
}).then(({ pageList }) => {
this.bmList = pageList.records
}).catch(err => {})
},
clearcustomer() {
this.form.orderContact = "";
this.form.phone = "";

@ -5,30 +5,30 @@
</div>
<staff v-if="active == 'staff'"></staff>
<role v-if="active == 'role'"></role>
<pc-role v-if="active == 'pcRole'"></pc-role>
<mobile-role v-if="active == 'mobileRole'"></mobile-role>
</div>
</template>
<script>
import Setting from "@/setting";
import staff from "./staff";
import role from "./role";
import pcRole from "./pcRole";
import mobileRole from "./mobileRole";
export default {
data() {
return {
active: this.$route.query.type || 'staff',
tabs: {
staff: "账号管理",
role: "角色权限"
pcRole: "pc角色权限",
mobileRole: "小程序角色权限"
}
};
},
computed: {
},
components: {
staff,
role
pcRole,
mobileRole
},
created() {
// Setting.dynamicRoute && this.initTabs();

@ -0,0 +1,273 @@
<template>
<div class="page">
<h6 class="p-title">筛选</h6>
<div class="tool">
<ul class="filter">
<li>
<el-input placeholder="请输入角色名称" prefix-icon="el-icon-search" v-model.trim="keyword" clearable></el-input>
</li>
</ul>
<div>
<el-button type="primary" round @click="addRole" v-auth="'/system:角色权限:新增角色'">新增角色</el-button>
<el-button type="primary" round @click="delAllSelection" v-auth="'/system:角色权限:批量删除'">批量删除</el-button>
</div>
</div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" :row-key="getRowKeys">
<el-table-column type="selection" width="55" align="center" :selectable="practiceSelectable" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="roleName" label="角色名称" align="center" min-width="250" show-overflow-tooltip></el-table-column>
<el-table-column label="角色描述" min-width="400" align="center">
<template slot-scope="scope">
<el-input placeholder="该角色用于管理全部功能权限" v-model="scope.row.remark" disabled></el-input>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="200">
<template slot-scope="scope">
<el-button type="text" @click="showRole(scope.row)" v-auth="'/system:角色权限:查看'">查看</el-button>
<el-button v-if="scope.row.roleName !== '超级管理员'" type="text" @click="editRole(scope.row)" v-auth="'/system:角色权限:编辑'">编辑</el-button>
<el-button v-if="scope.row.roleName !== '超级管理员' && scope.row.roleName !== '管理员'" type="text" @click="handleDelete(scope.row)" v-auth="'/system:角色权限:删除'">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination>
</div>
<el-dialog :title="isDetail ? '查看角色' : (isAdd ? '新增角色' : '编辑角色')" :visible.sync="roleVisible" width="30%" @close="closeRole" class="dialog" :close-on-click-modal="false">
<el-form ref="form" label-width="80px" :disabled="isDetail">
<el-form-item label="角色名称">
<el-input v-model="form.roleName" placeholder="请输入角色名称"></el-input>
</el-form-item>
<el-form-item label="角色描述">
<el-input v-model="form.remark" placeholder="请输入角色描述" type="textarea" rows="5"></el-input>
</el-form-item>
<el-form-item prop="role" label="角色权限">
<div style="max-height: 300px; overflow: auto">
<el-tree
ref="per"
:data="permissions"
show-checkbox
default-expand-all
node-key="id"
:default-expanded-keys="checkedIds"
:default-checked-keys="checkedIds"
:props="defaultProps">
</el-tree>
</div>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer" v-if="!isDetail">
<el-button @click="roleVisible = false"> </el-button>
<el-button type="primary" @click="saveData"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import Setting from "@/setting";
export default {
data() {
return {
platformId: 4,
keyword: "",
searchTimer: null,
isDetail: false,
form: {
id: "",
roleName: "",
remark: ""
},
listData: [],
defaultProps: {
children: "children",
label: "name"
},
page: 1,
pageSize: 10,
total: 0,
multipleSelection: [],
isAdd: true,
roleVisible: false,
permissions: [],
checkedIds: [],
roleNameReapeat: false //
};
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.getData();
}, 500);
}
},
mounted() {
this.getData()
},
methods: {
getData() {
// platformId 4setting.jsport: pc01
this.$get(`${this.api.roleList}?page=${this.page}&size=${this.pageSize}&name=${this.keyword}&platformId=${this.platformId}&port=1`).then(res => {
this.listData = res.rolePage.records;
this.total = res.rolePage.total;
}).catch(res => {});
},
currentChange(val) {
this.page = val;
this.getData();
},
handleDelete(row) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.batchRemove}?roleIds=${row.id}`).then(res => {
this.$message.success("删除成功");
this.getData();
}).catch(res => {});
}).catch(() => {});
},
getRowKeys(row) {
return row.id;
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
delAllSelection() {
if (this.multipleSelection.length) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
let ids = this.multipleSelection.map(item => {
return item.id;
});
this.$post(`${this.api.batchRemove}?roleIds=${ids.toString()}`).then(res => {
this.$refs.table.clearSelection();
this.$message.success("删除成功");
this.getData();
}).catch(res => {});
if(this.multipleSelection.length === this.listData.length && this.page>1) {
this.handleCurrentChange(this.page - 1)
}
}).catch(() => {});
} else {
this.$message.error("请先选择数据!");
}
},
practiceSelectable(row, index){
let boolean = true;
if(row.roleName == '超级管理员'){
boolean = false
}else{
boolean = true
}
return boolean;
},
closeRole() {
this.isDetail = false;
this.form = {
id: "",
roleName: "",
remark: ""
};
this.checkedIds = [];
this.permissions = [];
},
//
getPer(row) {
if (!this.permissions.length) {
this.$get(`${this.api.queryAllMenus}?platformId=${this.platformId}&port=1`).then(res => {
let data = res.children;
//
let yw = data.findIndex(n => n.name == "业务后台");
yw != -1 && data.splice(yw, 1);
try {
let system = data.findIndex(n => n.name == "系统设置");
if (system != -1) {
data[system].children[1].children.splice(4, 1);
data[system].children[1].children.splice(1, 1);
data[system].children[1].children.splice(0, 1);
}
} catch (error) {
}
this.permissions = data;
if (row) {
this.getDetail(row);
}
}).catch(res => {
});
}
},
addRole() {
this.isAdd = true;
this.getPer();
this.checkedIds = [];
this.permissions.length && this.$refs.per.setCheckedNodes([]);
this.roleVisible = true;
},
//
handleRolePer(data, permissions) {
let result = data;
if (permissions.length) {
permissions.map(e => {
if (result.includes(e.id) && e.children) {
// ,idid,,,
e.children.every(n => result.includes(n)) || result.splice(result.indexOf(e.id), 1);
}
e.children && e.children.length && this.handleRolePer(data, e.children);
});
}
return result;
},
async getDetail(row) { //
let res = await this.$get(`${this.api.obtainDetails}?id=${row.id}`);
this.form = res.role;
this.form.id = row.id;
this.checkedIds = this.handleRolePer(res.permissionList, this.permissions);
this.$refs.per.setCheckedNodes(this.checkedIds);
},
showRole(row) {
this.isDetail = true;
this.isAdd = false;
this.getPer(row);
this.roleVisible = true;
},
editRole(row) {
this.isAdd = false;
this.getPer(row);
this.roleVisible = true;
},
async saveData() {
if (!this.form.roleName) return this.$message.warning("请填写角色名称");
if (!this.form.remark) return this.$message.warning("请填写角色描述");
if (!this.$refs.per.getCheckedKeys().length) return this.$message.warning("请选择角色权限");
// ,(),
let permissionId = [...this.$refs.per.getHalfCheckedKeys(), ...this.$refs.per.getCheckedKeys()];
let data = {
...this.form,
permissionId,
platformId: this.platformId,
port: 1
};
if (this.form.id) {
this.$post(this.api.saveOrUpdate, data).then(res => {
this.$message.success("修改成功");
this.getData();
this.roleVisible = false;
}).catch(res => {});
} else {
this.$post(this.api.saveOrUpdate, data).then(res => {
this.$message.success("新增成功");
this.getData();
this.roleVisible = false;
}).catch(res => {});
}
}
}
};
</script>
<style lang="scss" scoped>
</style>

@ -70,6 +70,7 @@ import Setting from "@/setting";
export default {
data() {
return {
platformId: 4,
keyword: "",
searchTimer: null,
isDetail: false,
@ -107,7 +108,8 @@ export default {
},
methods: {
getData() {
this.$get(`${this.api.roleList}?page=${this.page}&size=${this.pageSize}&name=${this.keyword}&platformId=${Setting.platformId}`).then(res => {
// platformId 4setting.js
this.$get(`${this.api.roleList}?page=${this.page}&size=${this.pageSize}&name=${this.keyword}&platformId=${this.platformId}`).then(res => {
this.listData = res.rolePage.records;
this.total = res.rolePage.total;
}).catch(res => {});
@ -175,7 +177,7 @@ export default {
//
getPer(row) {
if (!this.permissions.length) {
this.$get(`${this.api.queryAllMenus}?platformId=${Setting.platformId}`).then(res => {
this.$get(`${this.api.queryAllMenus}?platformId=${this.platformId}`).then(res => {
let data = res.children;
//
let yw = data.findIndex(n => n.name == "业务后台");
@ -246,7 +248,7 @@ export default {
let data = {
...this.form,
permissionId,
platformId: Setting.platformId,
platformId: this.platformId,
};
if (this.form.id) {
this.$post(this.api.saveOrUpdate, data).then(res => {

@ -95,8 +95,9 @@
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="userName" label="姓名" align="center" min-width="100"></el-table-column>
<el-table-column prop="account" label="账号" align="center" min-width="100"></el-table-column>
<el-table-column prop="phone" label="手机号" align="center" width="120"></el-table-column>
<el-table-column prop="staffArchitectureName" label="团队名称" align="center" min-width="200" show-overflow-tooltip></el-table-column>
<el-table-column prop="partnerClassificationName" label="团队名称" align="center" min-width="200" show-overflow-tooltip></el-table-column>
<el-table-column prop="roleName" label="授权角色" align="center" min-width="200" show-overflow-tooltip></el-table-column>
</el-table>
<div class="pagination">
@ -113,7 +114,7 @@
</div>
<p class="title">城市合伙人 <em>邀请二维码</em></p>
<p class="des">加盟商合作伙伴可以通过这个二维码加入 <em>城市合伙人计划</em></p>
<img width="200" src="https://pic.baike.soso.com/p/20130307/20130307133645-1010261466.jpg" alt="">
<img width="250" :src="qrcode" alt="">
</el-dialog>
</div>
</div>
@ -124,6 +125,7 @@ import util from "@/libs/util";
import Setting from "@/setting";
import OrgTree from "@/components/org-tree/src/tree";
import clipboard from '@/libs/clipboard'
import axios from 'axios'
export default {
components: { OrgTree },
data() {
@ -167,7 +169,8 @@ export default {
}
}
return {
token: sessionStorage.getItem('token'),
accountId: this.$store.state.accountId,
userName: this.$store.state.userName,
orgList: [],
orgListDia: [],
orgVisible: false, //
@ -226,6 +229,7 @@ export default {
isLeaf: 'leaf'
},
link: '',
qrcode: '',
expireTime: '',
curTeamId: '',
submiting: false //
@ -257,6 +261,7 @@ export default {
}
handleLeaf(list)
this.orgList = list
this.getList()
},
//
addOrg(node, data) {
@ -347,7 +352,7 @@ export default {
},
//
handleNodeClick(data) {
this.curTeamId = ''
this.curTeamId = data.id
if (data.isTeam) {
this.curTeamId = data.id
} else {
@ -372,9 +377,9 @@ export default {
keyWord: this.keyWord,
pageNum: this.page,
pageSize: this.pageSize
}).then(res => {
this.listData = res.page.records
this.total = res.page.total
}).then(({ pageList }) => {
this.listData = pageList.records
this.total = pageList.total
}).catch(err => {})
},
//
@ -394,15 +399,27 @@ export default {
add() {
const { orgList } = this
if (orgList.length) {
const token = this.token
//
this.$post(`${this.api.generateInvitationCode}?token=${token}`).then(({ expireTime, invitationCode }) => {
const date = new Date(Date.now() + expireTime)
this.expireTime = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getMinutes()}`
this.parnerVisible = true
const cur = this.$refs.orgTree.getCurrentKey()
this.link = `${location.origin}${Setting.isDev || Setting.isPro ? '' : 'nakadai'}/#/join?token=${encodeURI(window.btoa(token))}&id=${cur ? cur: this.orgList[0].id}&invitationCode=${invitationCode}`
}).catch(res => {})
const curNode = this.$refs.orgTree.getCurrentNode()
if (curNode && curNode.isTeam) {
util.warningMsg('请选择分类添加城市合伙人!')
} else {
const { accountId } = this
//
this.$post(`${this.api.generateInvitationCode}?accountId=${accountId}`).then(({ expireTime, invitationCode }) => {
const date = new Date(Date.now() + expireTime)
this.expireTime = `${date.getFullYear()}-${util.preZero(date.getMonth() + 1)}-${util.preZero(date.getDate())} ${util.preZero(date.getHours())}:${util.preZero(date.getMinutes())}:${util.preZero(date.getMinutes())}`
this.parnerVisible = true
const cur = this.$refs.orgTree.getCurrentKey()
this.link = `${location.origin}${Setting.isDev || Setting.isPro ? '' : 'nakadai'}/#/join?accountId=${accountId}&id=${cur ? cur: this.orgList[0].id}&userName=${this.userName}`
//
axios.get(`${this.api.generationQrCode}?url=${this.link}`, {
responseType: 'blob'
}).then(({ data }) => {
this.qrcode = window.URL.createObjectURL(data)
}).catch(res => {})
}).catch(res => {})
}
} else {
util.errorMsg('请添加分类!')
}

Loading…
Cancel
Save