|
|
@@ -286,6 +286,7 @@
|
|
|
@click="handleBindMember(scope.row)"
|
|
|
v-hasPermi="['company:user:bindUser']"
|
|
|
>绑定会员</el-button>
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-share" @click="handleGenInviteCode(scope.row)" v-hasPermi="['company:user:addCodeUrl']">招新邀请码</el-button>
|
|
|
<el-button v-if="scope.row.userType !== '00'" size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['company:user:edit']">修改</el-button>
|
|
|
<el-button v-if="scope.row.userType !== '00'" size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['company:user:remove']">删除</el-button>
|
|
|
<el-button size="mini" type="text" icon="el-icon-key" @click="handleResetPwd(scope.row)" v-hasPermi="['company:user:resetPwd']">重置密码</el-button>
|
|
|
@@ -725,6 +726,17 @@
|
|
|
|
|
|
<ai-sip-call-user ref="aiSipCallUser" v-show="false" @refreshParentData="getList" />
|
|
|
|
|
|
+ <!-- 邀请二维码对话框 -->
|
|
|
+ <el-dialog title="邀请二维码" :visible.sync="inviteQrOpen" width="450px" append-to-body>
|
|
|
+ <div style="text-align:center;">
|
|
|
+ <img :src="inviteQrUrl" style="width:240px;height:240px;margin-bottom:15px;"/>
|
|
|
+ </div>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" icon="el-icon-download" @click="downloadInviteQR">下载二维码</el-button>
|
|
|
+ <el-button @click="inviteQrOpen = false">关闭</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<el-dialog title="配置获客链接" :visible.sync="customerLinkOpen" width="500px" append-to-body>
|
|
|
<el-form ref="customerLinkForm" :model="customerLinkForm" :rules="customerLinkRules" label-width="100px">
|
|
|
<el-form-item label="获客链接" prop="customerAcquisitionLink">
|
|
|
@@ -773,7 +785,7 @@ import { getMyQwUserList,getMyQwCompanyList } from "@/api/qw/user";
|
|
|
import selectUser from "@/views/company/components/selectQwUser.vue";
|
|
|
import { getConfigByKey } from "@/api/company/companyConfig";
|
|
|
import axios from "axios";
|
|
|
-import {addCodeUrl} from "@/api/company/companyUser";
|
|
|
+import {addCodeUrl, addInviteCodeUrl} from "@/api/company/companyUser";
|
|
|
import selectDoctor from "@/views/qw/user/selectDoctor.vue";
|
|
|
import AiSipCallUser from "../../aiSipCall/aiSipCallUser.vue";
|
|
|
import { bindCidServer, unbindCidServer } from '@/api/company/companyAiWorkflowServer'
|
|
|
@@ -991,6 +1003,8 @@ export default {
|
|
|
},
|
|
|
bindCidServerLoading:false,
|
|
|
customerLinkOpen: false,
|
|
|
+ inviteQrOpen: false,
|
|
|
+ inviteQrUrl: '',
|
|
|
customerLinkForm: {
|
|
|
userId: null,
|
|
|
customerAcquisitionLink: ''
|
|
|
@@ -1440,6 +1454,18 @@ export default {
|
|
|
this.customerLinkOpen = true;
|
|
|
},
|
|
|
|
|
|
+ handleGenInviteCode(row) {
|
|
|
+ const data = { companyUserId: row.userId };
|
|
|
+ addInviteCodeUrl(data).then(response => {
|
|
|
+ if (response.code === 200) {
|
|
|
+ this.inviteQrUrl = response.data;
|
|
|
+ this.inviteQrOpen = true;
|
|
|
+ } else {
|
|
|
+ this.$message.error(response.msg || '生成失败');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
submitCustomerLink() {
|
|
|
this.$refs['customerLinkForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
@@ -1456,6 +1482,26 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+ downloadInviteQR() {
|
|
|
+ const token = getToken();
|
|
|
+ axios.get(process.env.VUE_APP_BASE_API + '/company/user/downloadInviteQR', {
|
|
|
+ params: { url: this.inviteQrUrl },
|
|
|
+ responseType: 'blob',
|
|
|
+ headers: { Authorization: 'Bearer ' + token }
|
|
|
+ }).then(res => {
|
|
|
+ const url = URL.createObjectURL(res.data);
|
|
|
+ const a = document.createElement('a');
|
|
|
+ a.href = url;
|
|
|
+ a.download = '招新邀请码.png';
|
|
|
+ document.body.appendChild(a);
|
|
|
+ a.click();
|
|
|
+ document.body.removeChild(a);
|
|
|
+ URL.revokeObjectURL(url);
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message.error('下载失败');
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
this.reset();
|