diff --git a/src/assets/css/main.css b/src/assets/css/main.css index 4ed5e05..d5f8164 100644 --- a/src/assets/css/main.css +++ b/src/assets/css/main.css @@ -428,4 +428,10 @@ li { } .el-switch__label span { font-size: 12px; +} +@media (max-width: 720px) { + .el-message { + min-width: auto !important; + width: 85%; + } } \ No newline at end of file diff --git a/src/assets/img/house.png b/src/assets/img/house.png new file mode 100644 index 0000000..ac85480 Binary files /dev/null and b/src/assets/img/house.png differ diff --git a/src/components/Header.vue b/src/components/Header.vue index 9b853c6..0a82600 100644 --- a/src/components/Header.vue +++ b/src/components/Header.vue @@ -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(){ diff --git a/src/libs/util.js b/src/libs/util.js index 75b5864..c20b25a 100644 --- a/src/libs/util.js +++ b/src/libs/util.js @@ -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 \ No newline at end of file diff --git a/src/setting.js b/src/setting.js index 4a9750d..70e8e90 100644 --- a/src/setting.js +++ b/src/setting.js @@ -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域名 diff --git a/src/store/index.js b/src/store/index.js index 7186e2b..6b8530e 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -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 diff --git a/src/utils/api.js b/src/utils/api.js index 0da3504..a470b61 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -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 `, }; \ No newline at end of file diff --git a/src/views/customer/AddCustomer.vue b/src/views/customer/AddCustomer.vue index d741086..21fcf0c 100644 --- a/src/views/customer/AddCustomer.vue +++ b/src/views/customer/AddCustomer.vue @@ -225,24 +225,27 @@
或然科技城市合伙人计划
+加入并自动为你创建一个团队群组
+城市合伙人 邀请二维码
加盟商、合作伙伴可以通过这个二维码加入 城市合伙人计划
- + @@ -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('请添加分类!') }