提交 a3ab1107 作者: 毛细亚

合并分支 'release' 到 'master'

Release

查看合并请求 !31
...@@ -284,3 +284,19 @@ export function getUserQrCode(data) { ...@@ -284,3 +284,19 @@ export function getUserQrCode(data) {
data, data,
}); });
} }
// 打开会话绑定任务
export function clientSessionBindTaskApi(data) {
return request({
url: returnApi('/client_session/bindTask'),
method: 'post',
data,
});
}
// 根据w账号获取上一次交互时间
export function getMemberInfoApi(data) {
return request({
url: returnApi('/corp_zyou_bind/getMemberInfo'),
method: 'post',
data,
});
}
...@@ -27,62 +27,42 @@ ...@@ -27,62 +27,42 @@
class="rowFlex" class="rowFlex"
> >
<div class="label">{{ item.label }}</div> <div class="label">{{ item.label }}</div>
<div <div v-if="item.type == 'money'" class="value">
v-if="item.type == 'money'"
class="value"
>
<p> <p>
<span></span><span>{{ assionInfo[item.value] || 0 }}</span> <span></span><span>{{ assionInfo[item.value] || 0 }}</span>
</p> </p>
</div> </div>
<div <div v-else class="value">
v-else
class="value"
>
<span v-if="assionInfo[item.value]">{{ <span v-if="assionInfo[item.value]">{{
assionInfo[item.value] || "" assionInfo[item.value] || ''
}}</span> }}</span>
</div> </div>
</div> </div>
<div <div v-else-if="item.value == 'plan_type'" class="rowFlex">
v-else-if="item.value == 'plan_type'"
class="rowFlex"
>
<div class="label">{{ item.label }}</div> <div class="label">{{ item.label }}</div>
<div class="value"> <div class="value">
<span style="color: #0787f2">{{ <span style="color: #0787f2">{{
taskTypeList.find((k) => k.value == assionInfo[item.value]) taskTypeList.find((k) => k.value == assionInfo[item.value])
? taskTypeList.find((k) => k.value == assionInfo[item.value]) ? taskTypeList.find(
.label (k) => k.value == assionInfo[item.value]
: "" ).label
: ''
}}</span> }}</span>
</div> </div>
</div> </div>
<div <div v-else-if="item.value == 'target'" class="rowFlex">
v-else-if="item.value == 'target'"
class="rowFlex"
>
<div class="label">{{ item.label }}</div> <div class="label">{{ item.label }}</div>
<div class="value"> <div class="value">
<span <span v-if="assionInfo.target" style="color: #0787f2">{{
v-if="assionInfo.target"
style="color: #0787f2"
>{{
assionInfo.target.first && assionInfo.target.first.is_finished assionInfo.target.first && assionInfo.target.first.is_finished
? "已完成" ? '已完成'
: "未完成" : '未完成'
}}</span> }}</span>
</div> </div>
</div> </div>
<div <div v-else-if="item.value == 'finished_event'" class="rowFlex">
v-else-if="item.value == 'finished_event'"
class="rowFlex"
>
<div class="label">{{ item.label }}</div> <div class="label">{{ item.label }}</div>
<div <div v-if="assionInfo.finished_event" class="value">
v-if="assionInfo.finished_event"
class="value"
>
<span <span
v-for="(item, index) in assionInfo.finished_event" v-for="(item, index) in assionInfo.finished_event"
:key="index" :key="index"
...@@ -92,20 +72,14 @@ ...@@ -92,20 +72,14 @@
</div> </div>
</div> </div>
<!-- w 账号 --> <!-- w 账号 -->
<div <div v-else-if="item.value == 'username'" class="rowFlex">
v-else-if="item.value == 'username'"
class="rowFlex"
>
<div class="label">{{ item.label }}</div> <div class="label">{{ item.label }}</div>
<div <div
v-if="assionInfo.username && assionInfo.username.length > 0" v-if="assionInfo.username && assionInfo.username.length > 0"
class="value" class="value"
> >
<div <div v-if="assionInfo.username.length <= 1" class="rowFlex">
v-if="assionInfo.username.length <= 1"
class="rowFlex"
>
<div <div
v-for="(items, indexs) in assionInfo.username" v-for="(items, indexs) in assionInfo.username"
:key="indexs" :key="indexs"
...@@ -113,15 +87,13 @@ ...@@ -113,15 +87,13 @@
> >
<p <p
class="textHidden rowFlex userAlias" class="textHidden rowFlex userAlias"
style="max-width:150px;" style="max-width: 150px"
>{{ items }}</p> >
{{ items }}
</p>
</div> </div>
</div> </div>
<el-popover <el-popover v-else placement="top" trigger="click">
v-else
placement="top"
trigger="click"
>
<div style="max-width: 400px"> <div style="max-width: 400px">
<p <p
v-for="(items, indexs) in assionInfo.username" v-for="(items, indexs) in assionInfo.username"
...@@ -129,10 +101,9 @@ ...@@ -129,10 +101,9 @@
class="rowFlex columnCenter userInfoStyle" class="rowFlex columnCenter userInfoStyle"
style="margin-bottom: 10px" style="margin-bottom: 10px"
> >
<span <span class="textHidden" style="max-width: 150px">{{
class="textHidden" items
style="max-width:150px;" }}</span>
>{{ items }}</span>
</p> </p>
</div> </div>
<el-button <el-button
...@@ -140,7 +111,8 @@ ...@@ -140,7 +111,8 @@
type="text" type="text"
size="medium" size="medium"
style="margin-top: -10px" style="margin-top: -10px"
>{{ assionInfo.username.length }}</el-button> >{{ assionInfo.username.length }}</el-button
>
</el-popover> </el-popover>
</div> </div>
</div> </div>
...@@ -149,24 +121,12 @@ ...@@ -149,24 +121,12 @@
<div class="contentInfo"> <div class="contentInfo">
<div class="contentInfoItem rowFlex"> <div class="contentInfoItem rowFlex">
<div class="label">跟进状态</div> <div class="label">跟进状态</div>
<div <div v-if="assionInfo.status == 1" class="noSend">待跟进</div>
v-if="assionInfo.status == 1" <div v-else-if="assionInfo.status == 2" class="noSend">跟进中</div>
class="noSend" <div v-else-if="assionInfo.status == 3" class="sended">已跟进</div>
>待跟进</div>
<div
v-else-if="assionInfo.status == 2"
class="noSend"
>跟进中</div>
<div
v-else-if="assionInfo.status == 3"
class="sended"
>已跟进</div>
</div> </div>
<div v-if="remarks.remarks" class="remarks rowFlex flexWarp"> <div v-if="remarks.remarks" class="remarks rowFlex flexWarp">
<div <div v-for="(item, index) in remarks.remarks" :key="index">
v-for="(item, index) in remarks.remarks"
:key="index"
>
<div class="contentInfoItem rowFlex"> <div class="contentInfoItem rowFlex">
<div class="label">跟进时间</div> <div class="label">跟进时间</div>
<div class="value">{{ item.update_time }}</div> <div class="value">{{ item.update_time }}</div>
...@@ -174,10 +134,7 @@ ...@@ -174,10 +134,7 @@
<div class="contentInfoItem rowFlex"> <div class="contentInfoItem rowFlex">
<div class="label">备注</div> <div class="label">备注</div>
<div class="value"> <div class="value">
<div <div class="remarkContent" v-html="item.remark"></div>
class="remarkContent"
v-html="item.remark"
></div>
</div> </div>
</div> </div>
</div> </div>
...@@ -185,41 +142,40 @@ ...@@ -185,41 +142,40 @@
<!-- 发起会话 --> <!-- 发起会话 -->
<!-- 新增判断逻辑 根据 taskDetails 中的is_bind 判断 1:显示发起会话按钮 0:不显示发起会话按钮 --> <!-- 新增判断逻辑 根据 taskDetails 中的is_bind 判断 1:显示发起会话按钮 0:不显示发起会话按钮 -->
<div <div
v-if="kfhList && kfhList.length > 0 && assionInfo.status_name !== '已完成'" v-if="
kfhList &&
kfhList.length > 0 &&
assionInfo.status_name !== '已完成'
"
class="kfhList rowFlex columnCenter flexWarp" class="kfhList rowFlex columnCenter flexWarp"
> >
<div <div
v-for="(item, index) in kfhList" v-for="(item, index) in kfhList"
:key="index" :key="index"
class="sessionUserList " class="sessionUserList"
> >
<div style="margin-bottom: 10px" class="sessionUser"> <div style="margin-bottom: 10px" class="sessionUser">
<div class="kfhItem rowFlex spaceBetween"> <div class="kfhItem rowFlex spaceBetween">
<div class="left rowFlex columnCenter"> <div class="left rowFlex columnCenter">
<el-image <el-image :src="item.user.avatar" class="image"></el-image>
:src="item.user.avatar"
class="image"
></el-image>
<div class="name">{{ item.user.alias }}</div> <div class="name">{{ item.user.alias }}</div>
</div> </div>
<el-button <el-button
v-if="item.userid == userid " v-if="item.userid == userid"
class="right" class="right"
type="primary" type="primary"
size="small" size="small"
@click="requestSession(item)" @click="requestSession(item)"
>发起会话</el-button> >发起会话</el-button
>
<div v-else> <div v-else>
<svg-icon <svg-icon icon-class="chat" style="font-size: 26px" />
icon-class="chat"
style="font-size:26px;"
/>
</div> </div>
</div> </div>
<div class="wxUserInfo columnFlex"> <div class="wxUserInfo columnFlex">
<p> <p>
<span>用户备注:</span> <span>用户备注:</span>
<label style="word-break: break-all;">{{ <label style="word-break: break-all">{{
item.external_user.remark || item.external_user.name item.external_user.remark || item.external_user.name
}}</label> }}</label>
</p> </p>
...@@ -229,12 +185,15 @@ ...@@ -229,12 +185,15 @@
</div> </div>
</div> </div>
<el-button <el-button
v-if="kfhList.length == 0 && taskDetails.status != 3 && !is_finished" v-if="
kfhList.length == 0 && taskDetails.status != 3 && !is_finished
"
type="primary" type="primary"
size="small" size="small"
style="margin-top: 20px" style="margin-top: 20px"
@click="showLayer = true" @click="showLayer = true"
>完成任务</el-button> >完成任务</el-button
>
</div> </div>
</div> </div>
</el-drawer> </el-drawer>
...@@ -255,7 +214,7 @@ ...@@ -255,7 +214,7 @@
> >
<!-- 新增异常原因筛选 当 plan_type==5 5:为大R异跟进异常时 新增异常原因筛选 --> <!-- 新增异常原因筛选 当 plan_type==5 5:为大R异跟进异常时 新增异常原因筛选 -->
<el-form-item <el-form-item
v-if="taskDetails.plan_type==5" v-if="taskDetails.plan_type == 5"
label="异常原因" label="异常原因"
prop="abnormal_types" prop="abnormal_types"
> >
...@@ -275,10 +234,7 @@ ...@@ -275,10 +234,7 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="跟进结果:" prop="trace_result">
label="跟进结果:"
prop="trace_result"
>
<el-select <el-select
v-model="webForm.trace_result" v-model="webForm.trace_result"
style="width: 100%" style="width: 100%"
...@@ -293,10 +249,7 @@ ...@@ -293,10 +249,7 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="备注:" prop="remark">
label="备注:"
prop="remark"
>
<el-input <el-input
v-model="webForm.remark" v-model="webForm.remark"
type="textarea" type="textarea"
...@@ -304,31 +257,30 @@ ...@@ -304,31 +257,30 @@
placeholder="备注请填写异常原因和异常类型,并列举后续维护策略/难以维护的原因" placeholder="备注请填写异常原因和异常类型,并列举后续维护策略/难以维护的原因"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
</layer> </layer>
</div> </div>
</template> </template>
<script> <script>
import { mapState, mapMutations } from 'vuex' import { mapState, mapMutations } from 'vuex';
import { import {
taskRecord, taskRecord,
searchcondition, searchcondition,
memberOrder, memberOrder,
RoleTodayOrder, RoleTodayOrder,
taskDetails, taskDetails,
taskTrack, taskTrack,
} from '@/api/game' } from '@/api/game';
import { memberBindExternalUser } from '@/api/works' import { memberBindExternalUser, clientSessionBindTaskApi } from '@/api/works';
import layer from '@/components/dialog.vue' import layer from '@/components/dialog.vue';
export default { export default {
computed: { computed: {
...mapState('game', ['taskDetails']), ...mapState('game', ['taskDetails']),
...mapState('user', ['userInfo','userid']) ...mapState('user', ['userInfo', 'userid']),
}, },
components: { components: {
layer layer,
}, },
props: ['show'], props: ['show'],
data() { data() {
...@@ -348,16 +300,16 @@ ...@@ -348,16 +300,16 @@
webForm: { webForm: {
trace_result: '', trace_result: '',
remark: '', remark: '',
abnormal_types: [] abnormal_types: [],
}, },
webFormRule: { webFormRule: {
remark: [{ required: true, message: '请输入备注', trigger: 'blur' }], remark: [{ required: true, message: '请输入备注', trigger: 'blur' }],
trace_result: [ trace_result: [
{ required: true, message: '请选择跟进结果', trigger: 'change' } { required: true, message: '请选择跟进结果', trigger: 'change' },
], ],
abnormal_types: [ abnormal_types: [
{ required: true, message: '请选择异常原因', trigger: 'change' } { required: true, message: '请选择异常原因', trigger: 'change' },
] ],
}, },
detailsList: [ detailsList: [
{ label: '游戏名称', value: 'main_game_name' }, { label: '游戏名称', value: 'main_game_name' },
...@@ -386,70 +338,70 @@ ...@@ -386,70 +338,70 @@
{ label: '目标客服号', value: 'target_service_name' }, { label: '目标客服号', value: 'target_service_name' },
{ label: '实名累充金额', value: 'recharge_total', type: 'money' }, { label: '实名累充金额', value: 'recharge_total', type: 'money' },
], ],
} };
}, },
watch: { watch: {
taskDetails(newVal, oldVal) { taskDetails(newVal, oldVal) {
if (newVal.member_id) { if (newVal.member_id) {
this.requestInit() this.requestInit();
}
} }
}, },
},
created() { created() {
this.assionInfo = this.taskDetails this.assionInfo = this.taskDetails;
}, },
mounted() { mounted() {
if (this.taskDetails.id) { if (this.taskDetails.id) {
this.requestInit() this.requestInit();
} }
}, },
methods: { methods: {
...mapMutations('game', ['set_taskDetails', 'set_task_session_member_id']), ...mapMutations('game', ['set_taskDetails', 'set_task_session_member_id']),
requestInit() { requestInit() {
this.current = 0 this.current = 0;
this.is_finished = false this.is_finished = false;
this.assionInfo = this.taskDetails this.assionInfo = this.taskDetails;
this.taskRecord() this.taskRecord();
this.memberOrder() this.memberOrder();
this.requestTaskDetails() this.requestTaskDetails();
this.searchTrackList() this.searchTrackList();
// 只有状态是 5 的时候 才请求 // 只有状态是 5 的时候 才请求
if (this.taskDetails.plan_type == 5) { if (this.taskDetails.plan_type == 5) {
this.searchconditionError() this.searchconditionError();
} }
}, },
close() { close() {
this.$emit('update:show', false) this.$emit('update:show', false);
}, },
searchconditionError() { searchconditionError() {
const data = { const data = {
type: 'dictionaries', type: 'dictionaries',
table_name: 'zs_operator_task', table_name: 'zs_operator_task',
field_name: 'abnormal_type' field_name: 'abnormal_type',
} };
searchcondition(data).then((res) => { searchcondition(data).then((res) => {
this.errorTypeList = res.data.data this.errorTypeList = res.data.data;
}) });
}, },
searchcondition() { searchcondition() {
const data = { const data = {
type: 'dictionaries', type: 'dictionaries',
table_name: 'zs_operator_plan', table_name: 'zs_operator_plan',
field_name: 'plan_type' field_name: 'plan_type',
} };
searchcondition(data).then((res) => { searchcondition(data).then((res) => {
this.taskTypeList = res.data.data this.taskTypeList = res.data.data;
}) });
}, },
searchTrackList() { searchTrackList() {
const data = { const data = {
type: 'dictionaries', type: 'dictionaries',
table_name: 'zs_operator_task', table_name: 'zs_operator_task',
field_name: 'trace_result' field_name: 'trace_result',
} };
searchcondition(data).then((res) => { searchcondition(data).then((res) => {
this.traceList = res.data.data this.traceList = res.data.data;
}) });
}, },
// 完成任务 // 完成任务
submitForm() { submitForm() {
...@@ -459,101 +411,117 @@ ...@@ -459,101 +411,117 @@
create_user: this.userInfo.username, create_user: this.userInfo.username,
remark: this.webForm.remark, remark: this.webForm.remark,
abnormal_types: this.webForm.abnormal_types, abnormal_types: this.webForm.abnormal_types,
create_department: this.userInfo.department_name create_department: this.userInfo.department_name,
} };
taskTrack(data).then((res) => { taskTrack(data).then((res) => {
if (res.status_code == 1) { if (res.status_code == 1) {
this.$message.success(res.msg) this.$message.success(res.msg);
this.webForm = { this.webForm = {
trace_result: '', trace_result: '',
remark: '', remark: '',
abnormal_types: [] abnormal_types: [],
} };
this.is_finished = true this.is_finished = true;
this.showLayer = false this.showLayer = false;
} }
}) });
}, },
onConfirm() { onConfirm() {
this.$refs.ruleForm.validate((valid) => { this.$refs.ruleForm.validate((valid) => {
if (valid) { if (valid) {
this.submitForm() this.submitForm();
} else { } else {
console.log('error submit!!') console.log('error submit!!');
} }
}) });
}, },
requestTaskDetails() { requestTaskDetails() {
const data = { const data = {
id: this.taskDetails.id id: this.taskDetails.id,
} };
taskDetails(data).then((res) => { taskDetails(data).then((res) => {
res.data && res.data.id ? this.assionInfo = { ...this.assionInfo, ...res.data } : '' res.data && res.data.id
this.memberBindExternalUser() ? (this.assionInfo = { ...this.assionInfo, ...res.data })
if (this.assionInfo && this.assionInfo.username && this.assionInfo.username.indexOf('\n') !== -1) { : '';
this.assionInfo.username = this.assionInfo.username.split('\n') this.memberBindExternalUser();
if (
this.assionInfo &&
this.assionInfo.username &&
this.assionInfo.username.indexOf('\n') !== -1
) {
this.assionInfo.username = this.assionInfo.username.split('\n');
} else { } else {
this.assionInfo.username = [this.assionInfo.username] this.assionInfo.username = [this.assionInfo.username];
} }
}) });
}, },
requestSession(item) { requestSession(item) {
clientSessionBindTaskApi({
userid: item.userid,
external_userid: item.external_userid,
task_id: this.assionInfo.id,
member_id: item.member_id,
username: item.username,
});
this.$ww.openEnterpriseChat({ this.$ww.openEnterpriseChat({
externalUserIds:item.external_userid, externalUserIds: item.external_userid,
success: (res) => { success: (res) => {
console.log(res, '打开会话窗口成功') console.log(res, '打开会话窗口成功');
}, },
fail: (err) => { fail: (err) => {
console.log(err, '打开会话窗口失败') console.log(err, '打开会话窗口失败');
} },
}) });
}, },
async memberOrder() { async memberOrder() {
let res = {} let res = {};
if (!this.taskDetails.cp_role_id || this.taskDetails.cp_role_id == '') { if (!this.taskDetails.cp_role_id || this.taskDetails.cp_role_id == '') {
res = await memberOrder({ member_id: this.taskDetails.member_id }) res = await memberOrder({ member_id: this.taskDetails.member_id });
} else { } else {
res = await RoleTodayOrder({ role_id: this.taskDetails.role_id }) res = await RoleTodayOrder({ role_id: this.taskDetails.role_id });
} }
this.todayOrder = res.data[0] this.todayOrder = res.data[0];
this.assionInfo = { ...this.assionInfo, ...this.todayOrder } this.assionInfo = { ...this.assionInfo, ...this.todayOrder };
}, },
async taskRecord() { async taskRecord() {
const res = await taskRecord({ task_id: this.taskDetails.id,user_type:'' }) const res = await taskRecord({
console.log(res.data.data, 'res.data.data') task_id: this.taskDetails.id,
if(res.data.data.length > 0){ user_type: '',
this.remarks = res.data.data[0].remarks });
}else{ console.log(res.data.data, 'res.data.data');
this.remarks = [{remark:''}] if (res.data.data.length > 0) {
this.remarks = res.data.data[0].remarks;
} else {
this.remarks = [{ remark: '' }];
} }
}, },
async memberBindExternalUser() { async memberBindExternalUser() {
let member_list = [] let member_list = [];
if (this.assionInfo.members?.length > 0) { if (this.assionInfo.members?.length > 0) {
member_list = this.assionInfo.members.map((item) => item.member_id) member_list = this.assionInfo.members.map((item) => item.member_id);
} else { } else {
member_list = [this.assionInfo.member_id] member_list = [this.assionInfo.member_id];
} }
this.loading = true this.loading = true;
if (member_list.length === 0) { if (member_list.length === 0) {
return false return false;
} }
try { try {
const res = await memberBindExternalUser({ const res = await memberBindExternalUser({
member_id: member_list.toString(), member_id: member_list.toString(),
is_bind: this.assionInfo.is_bind is_bind: this.assionInfo.is_bind,
}) });
this.kfhList = res.data this.kfhList = res.data;
this.loading = false this.loading = false;
} catch (error) { } catch (error) {
this.loading = false this.loading = false;
} }
} },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.contet { .contet {
height: 100%; height: 100%;
background: #fff; background: #fff;
padding: 10px; padding: 10px;
...@@ -655,23 +623,23 @@ ...@@ -655,23 +623,23 @@
height: auto; height: auto;
margin-top: 22px; margin-top: 22px;
margin-bottom: 60px; margin-bottom: 60px;
.sessionUserList{ .sessionUser {
margin-right: 10px;
}
.sessionUser{
width: 100%; width: 100%;
height: auto; height: auto;
background: #F8F8F8; background: #f8f8f8;
border-radius: 4px; border-radius: 4px;
padding: 10px; padding: 10px;
} }
.sessionUserList {
margin-right: 10px;
}
.wxUserInfo { .wxUserInfo {
span{ span {
font-family: PingFangSC, PingFang SC; font-family: PingFangSC, PingFang SC;
font-weight: 400; font-weight: 400;
font-size: 14px; font-size: 14px;
color: #949FB0; color: #949fb0;
} }
} }
...@@ -964,14 +932,13 @@ ...@@ -964,14 +932,13 @@
width: 440px; width: 440px;
} }
} }
} }
.editLayer { .editLayer {
padding: 20px; padding: 20px;
padding-right: 0; padding-right: 0;
::v-deep .el-textarea__inner { ::v-deep .el-textarea__inner {
height: 150px; height: 150px;
} }
} }
</style> </style>
\ No newline at end of file
...@@ -4,11 +4,13 @@ ...@@ -4,11 +4,13 @@
<div class="content" v-loading="viewLoading"> <div class="content" v-loading="viewLoading">
<div v-if="chatUserDetails.is_phishing_account == 1" class="warnText"> <div v-if="chatUserDetails.is_phishing_account == 1" class="warnText">
<p>高风险玩家,请立即通知组长!!!!</p> <p>高风险玩家,请立即通知组长!!!!</p>
<p>①千万不能推转游!!不要发送违禁词汇!!不要发送礼包和告知任何礼包信息!!</p> <p>
①千万不能推转游!!不要发送违禁词汇!!不要发送礼包和告知任何礼包信息!!
</p>
<p>②不能以任何形式推送APP/网页链接,也不可承认有APP/网页端口!!</p> <p>②不能以任何形式推送APP/网页链接,也不可承认有APP/网页端口!!</p>
</div> </div>
<div v-if="change_appraisal" class="warnText"> <div v-if="change_appraisal" class="warnText">
<p> 钓鱼号 禁止转端通知组长!</p> <p>钓鱼号 禁止转端通知组长!</p>
</div> </div>
<div v-else-if="gameUserInfo.exp_ip" class="warnText"> <div v-else-if="gameUserInfo.exp_ip" class="warnText">
<p>高风险用户,禁止转端 !!!</p> <p>高风险用户,禁止转端 !!!</p>
...@@ -20,66 +22,138 @@ ...@@ -20,66 +22,138 @@
<!-- 添加客服状态显示及按钮 --> <!-- 添加客服状态显示及按钮 -->
<div class="cser_status"> <div class="cser_status">
<div class="status-actions"> <div class="status-actions">
<el-button type="danger" v-if="clientStatus !== 'offline'" style="margin-left: 0px;" size="mini" <el-button
@click="logout">下线</el-button> type="danger"
v-if="clientStatus !== 'offline'"
style="margin-left: 0px"
size="mini"
@click="logout"
>下线</el-button
>
<!-- 休息中状态显示结束休息按钮 --> <!-- 休息中状态显示结束休息按钮 -->
<el-button v-if="clientStatus === 'rest'" type="primary" size="mini" <el-button
@click="handleFinishRest">结束休息</el-button> v-if="clientStatus === 'rest'"
type="primary"
size="mini"
@click="handleFinishRest"
>结束休息</el-button
>
<!-- 在线状态显示开始休息按钮 --> <!-- 在线状态显示开始休息按钮 -->
<el-tooltip v-if="clientStatus === 'online'" content="午休或者临时有事可点击休息" placement="top"> <el-tooltip
<el-button type="warning" size="mini" @click="handleStartRest">开始休息</el-button> v-if="clientStatus === 'online'"
content="午休或者临时有事可点击休息"
placement="top"
>
<el-button type="warning" size="mini" @click="handleStartRest"
>开始休息</el-button
>
</el-tooltip> </el-tooltip>
<!-- 发送评价按钮 --> <!-- 发送评价按钮 -->
<el-button type="primary" style="margin-left: 0px;" size="mini" <el-button
@click="handleSendComment">发送评价</el-button> type="primary"
style="margin-left: 0px"
size="mini"
@click="handleSendComment"
>发送评价</el-button
>
</div> </div>
</div> </div>
</div> </div>
<!-- 会话内容存档状态 --> <!-- 会话内容存档状态 -->
<div class="archive-status" v-if="agreeStatus !== 'Agree' || !hasPermit"> <div
class="archive-status"
v-if="agreeStatus !== 'Agree' || !hasPermit"
>
<p v-if="agreeStatus !== 'Agree'">当前微信用户未开启会话内容存档</p> <p v-if="agreeStatus !== 'Agree'">当前微信用户未开启会话内容存档</p>
<p v-if="!hasPermit">当前客服号未授权开启会话内容存档</p> <p v-if="!hasPermit">当前客服号未授权开启会话内容存档</p>
</div> </div>
<div class="item rowFlex"> <div class="item rowFlex">
<!-- 公共的信息 --> <!-- 公共的信息 -->
<el-image fit="fill" draggable="false" style="-webkit-user-drag: none" :src="chatUserDetails.avatar" <el-image
class="tableImage"></el-image> fit="fill"
draggable="false"
style="-webkit-user-drag: none"
:src="chatUserDetails.avatar"
class="tableImage"
></el-image>
<div class="columnFlex"> <div class="columnFlex">
<div class="rowFlex" style="margin-bottom: 3px"> <div class="rowFlex" style="margin-bottom: 3px">
<p class="text" style="font-weight: 600"> <p class="text" style="font-weight: 600">
{{ chatUserDetails.name }} {{ chatUserDetails.name }}
</p> </p>
<span v-if="chatUserDetails.add_way_text" style="color: #09b159; margin-left: 10px">@{{ <span
chatUserDetails.add_way_text }}</span> v-if="chatUserDetails.add_way_text"
style="color: #09b159; margin-left: 10px"
>@{{ chatUserDetails.add_way_text }}</span
>
</div> </div>
<!-- 游戏模块特有 --> <!-- 游戏模块特有 -->
<div v-if="accountSelect && accountSelect !== ''" class="rowFlex columnCenter" style="margin-top: 3px"> <div
v-if="accountSelect && accountSelect !== ''"
class="rowFlex columnCenter"
style="margin-top: 3px"
>
<vipLevel :gameUserInfo="gameUserInfo" /> <vipLevel :gameUserInfo="gameUserInfo" />
<el-button-group> <el-button-group>
<el-button type="text" @click="zyouUnBindConfirm">解绑</el-button> <el-button type="text" @click="zyouUnBindConfirm"
>解绑</el-button
>
<!-- <el-button type="text" size="mini" @click="autoResetPassword">修改密码</el-button> <!-- <el-button type="text" size="mini" @click="autoResetPassword">修改密码</el-button>
<el-button type="text" size="mini" @click="changePhoneClick">修改手机号</el-button> --> <el-button type="text" size="mini" @click="changePhoneClick">修改手机号</el-button> -->
<el-button v-if="!chatUserDetails.bind_cser" type="text" @click="relationKfh">关联客服</el-button> <el-button
<el-button type="text" v-if="false" @click="errorHandle">误操作</el-button> v-if="!chatUserDetails.bind_cser"
type="text"
@click="relationKfh"
>关联客服</el-button
>
<el-button type="text" v-if="false" @click="errorHandle"
>误操作</el-button
>
</el-button-group> </el-button-group>
</div> </div>
</div> </div>
</div> </div>
<div class="item rowFlex columnCenter"> <div class="item rowFlex columnCenter">
<div class="rowFlex columnCenter"> <div class="rowFlex columnCenter">
<span class="label" style="min-width: 45px;">备注:</span> <span class="label" style="min-width: 45px">备注:</span>
<p v-if="!showInputRemark" class="text" style="max-width: 170px;"> <p v-if="!showInputRemark" class="text" style="max-width: 170px">
{{ {{
chatUserDetails.remark && chatUserDetails.remark != "" chatUserDetails.remark && chatUserDetails.remark != ''
? chatUserDetails.remark ? chatUserDetails.remark
: chatUserDetails.name : chatUserDetails.name
}} }}
</p> </p>
</div> </div>
<el-input v-if="showInputRemark" v-model="showInputRemarkValue" class="showInputRemarkInput" type="textarea" <el-input
@change="handleInputRemark" @blur="showInputRemark = false"></el-input> v-if="showInputRemark"
<i class="el-icon-edit icon" style="font-size: 14px" @click="editRemark"></i> v-model="showInputRemarkValue"
class="showInputRemarkInput"
type="textarea"
@change="handleInputRemark"
@blur="showInputRemark = false"
></el-input>
<i
class="el-icon-edit icon"
style="font-size: 14px"
@click="editRemark"
></i>
</div>
<div class="item rowFlex columnCenter" v-if="lastTime">
<div class="rowFlex columnCenter">
<span class="label">最后交互日期:</span>
<span>
<span>({{ getDaysDifference }})</span>
{{ lastTime }}
</span>
<el-popover
placement="top-start"
width="200"
trigger="hover"
content="最后交互时间为VIP客服号与客户的最近一次会话发起时间"
>
<i class="el-icon-question ml-[4px]" slot="reference"></i>
</el-popover>
</div>
</div> </div>
<div> <div>
<!-- 自定义列 --> <!-- 自定义列 -->
...@@ -110,35 +184,66 @@ ...@@ -110,35 +184,66 @@
</div> </div>
</div> --> </div> -->
<!-- 游戏业务的账号信息 --> <!-- 游戏业务的账号信息 -->
<gameDetails v-if="gameUserInfo.username && !viewLoading" :chat-user-details="chatUserDetails" <gameDetails
:game-user-info="gameUserInfo" @changeAppraisal="changeAppraisal" /> v-if="gameUserInfo.username && !viewLoading"
:chat-user-details="chatUserDetails"
:game-user-info="gameUserInfo"
@changeAppraisal="changeAppraisal"
/>
<!-- 游戏标签 --> <!-- 游戏标签 -->
<div class="item rowFlex columnCenter spaceBetween tagsLost"> <div class="item rowFlex columnCenter spaceBetween tagsLost">
<div class="rowFlex"> <div class="rowFlex">
<span class="label">关联标签:</span> <span class="label">关联标签:</span>
<div v-if=" <div
v-if="
chatUserDetails.tag_group && chatUserDetails.tag_group &&
chatUserDetails.tag_group.length > 0 chatUserDetails.tag_group.length > 0
"> "
>
<!-- 第一个标签组的所有标签 --> <!-- 第一个标签组的所有标签 -->
<el-tag v-for="(items, indexs) in chatUserDetails.tag_group[0].tag" :key="indexs">{{ items.name <el-tag
}}</el-tag> v-for="(items, indexs) in chatUserDetails.tag_group[0].tag"
:key="indexs"
>{{ items.name }}</el-tag
>
<!-- 如果有多个标签组,显示+n --> <!-- 如果有多个标签组,显示+n -->
<el-popover v-if="chatUserDetails.tag_group.length > 1" placement="top" trigger="hover" <el-popover
popper-class="tag-popover"> v-if="chatUserDetails.tag_group.length > 1"
<div class="groups-popover-content" style="max-height: 600px;overflow-y: auto;"> placement="top"
<div v-for="(group, groupIndex) in chatUserDetails.tag_group.slice(1)" :key="groupIndex" trigger="hover"
class="group-item"> popper-class="tag-popover"
<el-tag v-for="(tagItem, tagIndex) in group.tag" :key="tagIndex" style="margin-right: 10px;">{{ >
tagItem.name }}</el-tag> <div
class="groups-popover-content"
style="max-height: 600px; overflow-y: auto"
>
<div
v-for="(
group, groupIndex
) in chatUserDetails.tag_group.slice(1)"
:key="groupIndex"
class="group-item"
>
<el-tag
v-for="(tagItem, tagIndex) in group.tag"
:key="tagIndex"
style="margin-right: 10px"
>{{ tagItem.name }}</el-tag
>
</div> </div>
</div> </div>
<span slot="reference" class="tag-more">+{{ chatUserDetails.tag_group.length - 1 }}</span> <span slot="reference" class="tag-more"
>+{{ chatUserDetails.tag_group.length - 1 }}</span
>
</el-popover> </el-popover>
</div> </div>
</div> </div>
<i class="el-icon-edit icon" style="font-size: 14px;margin-right: 10px;" @click="editTags"></i> <i
class="el-icon-edit icon"
style="font-size: 14px; margin-right: 10px"
@click="editTags"
></i>
</div> </div>
<!-- 共享信息 --> <!-- 共享信息 -->
<shareInfo :chat-user-details="chatUserDetails" /> <shareInfo :chat-user-details="chatUserDetails" />
...@@ -146,26 +251,50 @@ ...@@ -146,26 +251,50 @@
</div> </div>
</div> </div>
<!-- 修改手机号 --> <!-- 修改手机号 -->
<changePhone :show.sync="changePhone" :phone.sync="gameUserInfo.mobile" title="修改手机号" width="350px" /> <changePhone
:show.sync="changePhone"
:phone.sync="gameUserInfo.mobile"
title="修改手机号"
width="350px"
/>
<!-- 修改标签 --> <!-- 修改标签 -->
<selectTag v-if="showTag" :show.sync="showTag" :checkbox="true" :check-list="chatUserDetails.tag_group || []" <selectTag
@submit="selectTags" /> v-if="showTag"
:show.sync="showTag"
:checkbox="true"
:check-list="chatUserDetails.tag_group || []"
@submit="selectTags"
/>
</div> </div>
</template> </template>
<script> <script>
import { mapState, mapMutations, mapActions } from 'vuex' import { mapState, mapMutations, mapActions } from 'vuex';
import gameDetails from './gameInfo/gameUserInfo.vue' import gameDetails from './gameInfo/gameUserInfo.vue';
import shareInfo from './shareInfo.vue' import shareInfo from './shareInfo.vue';
import changePhone from './changePhone.vue' import changePhone from './changePhone.vue';
import watchMember from '@/mixins/watchMember' import watchMember from '@/mixins/watchMember';
import { autoResetPassword, bindUserSelfAdd } from '@/api/game' import { autoResetPassword, bindUserSelfAdd } from '@/api/game';
import { memberBindCser, editUser, zyouUnBind } from '@/api/works' import {
import selectTag from '@/components/selectTag.vue' memberBindCser,
import { getClientStatus, remarkSessionIntelTag, finishRest, client_session_rest, checkSingleAgree, checkUserPermit, sendComment, logout } from '@/api/user.js' editUser,
import { sendChatMessage } from '@/utils/index.js' zyouUnBind,
import { getToken, removeToken } from '@/utils/auth' getMemberInfoApi,
import vipLevel from './gameInfo/vipLevel.vue' } from '@/api/works';
import Cookies from 'js-cookie' import selectTag from '@/components/selectTag.vue';
import {
getClientStatus,
remarkSessionIntelTag,
finishRest,
client_session_rest,
checkSingleAgree,
checkUserPermit,
sendComment,
logout,
} from '@/api/user.js';
import { sendChatMessage } from '@/utils/index.js';
import { getToken, removeToken } from '@/utils/auth';
import vipLevel from './gameInfo/vipLevel.vue';
import Cookies from 'js-cookie';
export default { export default {
name: 'info', name: 'info',
components: { components: {
...@@ -173,13 +302,13 @@ export default { ...@@ -173,13 +302,13 @@ export default {
changePhone, changePhone,
shareInfo, shareInfo,
selectTag, selectTag,
vipLevel vipLevel,
}, },
props: { props: {
// 用户详情 // 用户详情
chatUserDetails: { chatUserDetails: {
type: Object, type: Object,
default: () => ({}) default: () => ({}),
}, },
}, },
data() { data() {
...@@ -197,121 +326,159 @@ export default { ...@@ -197,121 +326,159 @@ export default {
// 新增状态数据 // 新增状态数据
agreeStatus: '', // 用户是否同意聊天内容存档:Agreen同意 Disagree不同意 agreeStatus: '', // 用户是否同意聊天内容存档:Agreen同意 Disagree不同意
hasPermit: false, // 客服号是否开启会话内容存档权限 hasPermit: false, // 客服号是否开启会话内容存档权限
} lastTime: '', //上一次交互时间
};
}, },
computed: { computed: {
...mapState('game', [ ...mapState('game', [
'accountSelect', 'accountSelect',
'gameUserInfo', 'gameUserInfo',
'bindGameUserList', 'bindGameUserList',
'viewLoading' 'viewLoading',
]),
...mapState('user', [
'cser_info',
'cser_id',
'cser_name',
'corp_id',
'external_userid',
'userid',
'client_online_status',
'token',
]), ]),
...mapState('user', ['cser_info', 'cser_id', 'cser_name', 'corp_id', 'external_userid', 'userid', 'client_online_status', 'token']),
// 客服状态文本 // 客服状态文本
clientStatusText() { clientStatusText() {
const statusMap = { const statusMap = {
'online': '在线', online: '在线',
'offline': '离线', offline: '离线',
'rest': '休息中' rest: '休息中',
} };
return statusMap[this.client_online_status] || '未知' return statusMap[this.client_online_status] || '未知';
}, },
// 客服休息状态:online上线 offline下线 rest休息中 // 客服休息状态:online上线 offline下线 rest休息中
clientStatus() { clientStatus() {
return this.client_online_status return this.client_online_status;
},
getDaysDifference() {
// 解析目标日期字符串
const targetDate = new Date(this.lastTime);
// 获取当前日期(去除时间部分,只保留日期)
const currentDate = new Date();
currentDate.setHours(0, 0, 0, 0);
// 计算时间戳差值(毫秒)
const timeDiff = targetDate.getTime() - currentDate.getTime();
// 将毫秒转换为天数(24小时 × 60分钟 × 60秒 × 1000毫秒)
const daysDiff = Math.abs(Math.floor(timeDiff / (1000 * 60 * 60 * 24)));
return daysDiff;
}, },
}, },
mixins: [watchMember], mixins: [watchMember],
mounted() { mounted() {
// 初始化企业微信SDK // 初始化企业微信SDK
this.initializeWecom() this.initializeWecom();
// 获取客服状态和相关信息 // 获取客服状态和相关信息
if (this.cser_id && this.token) { if (this.cser_id && this.token) {
this.getInitialData() this.getInitialData();
} }
//获取最后交互时间
this.getLastTime();
}, },
methods: { methods: {
...mapMutations('game', ['set_accountSelect']), ...mapMutations('game', ['set_accountSelect', 'accountSelect']),
...mapActions('user', ['initWecom']), ...mapActions('user', ['initWecom']),
// 初始化企业微信SDK // 初始化企业微信SDK
async initializeWecom() { async initializeWecom() {
try { try {
console.log('🚀 开始初始化企业微信 SDK') console.log('🚀 开始初始化企业微信 SDK');
const result = await this.initWecom() const result = await this.initWecom();
console.log('✅ 企业微信 SDK 初始化成功', result) console.log('✅ 企业微信 SDK 初始化成功', result);
} catch (error) { } catch (error) {
console.error('❌ 企业微信 SDK 初始化失败:', error) console.error('❌ 企业微信 SDK 初始化失败:', error);
} }
}, },
logout() { logout() {
if (this.client_online_status === 'rest') { if (this.client_online_status === 'rest') {
this.$message({ this.$message({
type: 'error', type: 'error',
message: '当前客服号处于休息状态,不能下线' message: '当前客服号处于休息状态,不能下线',
}) });
return return;
} }
this.$confirm('确定下线吗?', '提示', { this.$confirm('确定下线吗?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning',
}).then(() => {
this.userLogout()
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
}) })
.then(() => {
this.userLogout();
}) })
.catch(() => {
this.$message({
type: 'info',
message: '已取消',
});
});
}, },
async userLogout() { async userLogout() {
const data = { const data = {
userid: this.userid, userid: this.userid,
} };
const res = await logout(data) const res = await logout(data);
if (res.status_code === 1) { if (res.status_code === 1) {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '下线成功' message: '下线成功',
}) });
removeToken() removeToken();
Cookies.remove('external_userid') Cookies.remove('external_userid');
Cookies.remove('userid') Cookies.remove('userid');
window.location.href = window.location.origin + '/company_app/index.html?corp_id=' + this.corp_id window.location.href =
window.location.origin +
'/company_app/index.html?corp_id=' +
this.corp_id;
} else { } else {
this.$message({ this.$message({
type: 'error', type: 'error',
message: '下线失败' message: '下线失败',
}) });
} }
}, },
// 获取初始数据 // 获取初始数据
async getInitialData() { async getInitialData() {
try { try {
// 1. 获取客服休息状态 // 1. 获取客服休息状态
const statusRes = await getClientStatus() const statusRes = await getClientStatus();
if (statusRes.status_code === 1) { if (statusRes.status_code === 1) {
if (statusRes.data.client_online_status === 'offline') { if (statusRes.data.client_online_status === 'offline') {
removeToken() removeToken();
window.location.href = window.location.origin + '/company_app/index.html?corp_id=' + this.corp_id window.location.href =
window.location.origin +
'/company_app/index.html?corp_id=' +
this.corp_id;
} }
this.$store.commit('user/set_client_online_status', statusRes.data.client_online_status) this.$store.commit(
'user/set_client_online_status',
statusRes.data.client_online_status
);
} }
// 2. 同步智能标签 // 2. 同步智能标签
this.syncIntelligentTags() this.syncIntelligentTags();
// 3. 检查用户是否同意聊天内容存档 // 3. 检查用户是否同意聊天内容存档
this.checkAgreeStatus() this.checkAgreeStatus();
// 4. 检查客服号是否开启会话内容存档 // 4. 检查客服号是否开启会话内容存档
this.checkPermitStatus() this.checkPermitStatus();
} catch (error) { } catch (error) {
console.error('获取初始数据失败:', error) console.error('获取初始数据失败:', error);
} }
}, },
...@@ -321,11 +488,11 @@ export default { ...@@ -321,11 +488,11 @@ export default {
await remarkSessionIntelTag({ await remarkSessionIntelTag({
corp_id: this.corp_id, corp_id: this.corp_id,
external_userid: this.external_userid, external_userid: this.external_userid,
userid: this.userid userid: this.userid,
}) });
console.log('智能标签同步成功') console.log('智能标签同步成功');
} catch (error) { } catch (error) {
console.error('智能标签同步失败:', error) console.error('智能标签同步失败:', error);
} }
}, },
...@@ -334,13 +501,13 @@ export default { ...@@ -334,13 +501,13 @@ export default {
try { try {
const res = await checkSingleAgree({ const res = await checkSingleAgree({
external_userid: this.external_userid, external_userid: this.external_userid,
userid: this.userid userid: this.userid,
}) });
if (res.status_code === 1) { if (res.status_code === 1) {
this.agreeStatus = res.data.agree_status this.agreeStatus = res.data.agree_status;
} }
} catch (error) { } catch (error) {
console.error('检查用户同意状态失败:', error) console.error('检查用户同意状态失败:', error);
} }
}, },
...@@ -348,45 +515,45 @@ export default { ...@@ -348,45 +515,45 @@ export default {
async checkPermitStatus() { async checkPermitStatus() {
try { try {
const res = await checkUserPermit({ const res = await checkUserPermit({
userid: this.userid userid: this.userid,
}) });
if (res.status_code === 1) { if (res.status_code === 1) {
this.hasPermit = res.data.has_permit this.hasPermit = res.data.has_permit;
} }
} catch (error) { } catch (error) {
console.error('检查客服权限失败:', error) console.error('检查客服权限失败:', error);
} }
}, },
// 开始休息 // 开始休息
async handleStartRest() { async handleStartRest() {
try { try {
const res = await client_session_rest() const res = await client_session_rest();
if (res.status_code === 1) { if (res.status_code === 1) {
this.$store.commit('user/set_client_online_status', 'rest') this.$store.commit('user/set_client_online_status', 'rest');
this.$message.success('已开始休息') this.$message.success('已开始休息');
} else { } else {
this.$message.error(res.msg || '开始休息失败') this.$message.error(res.msg || '开始休息失败');
} }
} catch (error) { } catch (error) {
console.error('开始休息失败:', error) console.error('开始休息失败:', error);
this.$message.error('开始休息失败') this.$message.error('开始休息失败');
} }
}, },
// 结束休息 // 结束休息
async handleFinishRest() { async handleFinishRest() {
try { try {
const res = await finishRest() const res = await finishRest();
if (res.status_code === 1) { if (res.status_code === 1) {
this.$store.commit('user/set_client_online_status', 'online') this.$store.commit('user/set_client_online_status', 'online');
this.$message.success('已结束休息') this.$message.success('已结束休息');
} else { } else {
this.$message.error(res.msg || '结束休息失败') this.$message.error(res.msg || '结束休息失败');
} }
} catch (error) { } catch (error) {
console.error('结束休息失败:', error) console.error('结束休息失败:', error);
this.$message.error('结束休息失败') this.$message.error('结束休息失败');
} }
}, },
...@@ -396,195 +563,213 @@ export default { ...@@ -396,195 +563,213 @@ export default {
const res = await sendComment({ const res = await sendComment({
corp_id: this.corp_id, corp_id: this.corp_id,
external_userid: this.external_userid, external_userid: this.external_userid,
userid: this.userid userid: this.userid,
}) });
if (res.status_code === 1 && res.data.news) { if (res.status_code === 1 && res.data.news) {
// 使用企业微信JSSDK发送评价 // 使用企业微信JSSDK发送评价
const result = await sendChatMessage(res.data.news, 'link') const result = await sendChatMessage(res.data.news, 'link');
if (result.success) { if (result.success) {
this.$message.success('评价已发送') this.$message.success('评价已发送');
} else { } else {
this.$message.error('评价发送失败') this.$message.error('评价发送失败');
} }
} else { } else {
this.$message.error(res.msg || '获取评价内容失败') this.$message.error(res.msg || '获取评价内容失败');
} }
} catch (error) { } catch (error) {
console.error('发送评价失败:', error) console.error('发送评价失败:', error);
this.$message.error('发送评价失败') this.$message.error('发送评价失败');
} }
}, },
memberChange() { memberChange() {
this.requestBindUser() this.requestBindUser();
//获取最后一次交互时间
this.getLastTime();
}, },
// 解绑确认 // 解绑确认
zyouUnBindConfirm() { zyouUnBindConfirm() {
this.$confirm('确定要解绑当前账号么?', '确认提示', { this.$confirm('确定要解绑当前账号么?', '确认提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning',
}) })
.then(() => { .then(() => {
this.zyouUnBind() this.zyouUnBind();
}) })
.catch(() => { .catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '已取消' message: '已取消',
}) });
}) });
}, },
requestBindUser() { requestBindUser() {
const data = { const data = {
member_id: this.accountSelect member_id: this.accountSelect,
} };
memberBindCser(data).then((res) => { memberBindCser(data).then((res) => {
console.log(res.data.cser_name, 'cser_namecser_namecser_namecser_name') console.log(res.data.cser_name, 'cser_namecser_namecser_namecser_name');
if (res.data.cser_name) { if (res.data.cser_name) {
this.$set(this.chatUserDetails, 'bind_cser', res.data.cser_name) this.$set(this.chatUserDetails, 'bind_cser', res.data.cser_name);
} else { } else {
this.$set(this.chatUserDetails, 'bind_cser', '') this.$set(this.chatUserDetails, 'bind_cser', '');
} }
}) });
}, },
zyouUnBind() { zyouUnBind() {
const data = { const data = {
userid: this.chatUserDetails.userid, userid: this.chatUserDetails.userid,
external_userid: this.chatUserDetails.external_userid, external_userid: this.chatUserDetails.external_userid,
member_id: this.accountSelect member_id: this.accountSelect,
} };
zyouUnBind(data).then((res) => { zyouUnBind(data).then((res) => {
if (res.status_code == 1) { if (res.status_code == 1) {
this.$message.success(res.msg) this.$message.success(res.msg);
const index = this.bindGameUserList.findIndex(item => item.member_id == this.accountSelect) const index = this.bindGameUserList.findIndex(
this.bindGameUserList.splice(index, 1) (item) => item.member_id == this.accountSelect
this.set_accountSelect(this.bindGameUserList[0].member_id) );
this.bindGameUserList.splice(index, 1);
this.set_accountSelect(this.bindGameUserList[0].member_id);
} }
}) });
}, },
// 修改密码 之前是客服手动设置密码 现在改成系统自动设置密码 // 修改密码 之前是客服手动设置密码 现在改成系统自动设置密码
autoResetPassword() { autoResetPassword() {
this.$confirm('确认重置密码吗?密码重置后玩家将无法登录,请谨慎操作!', '重置密码', { this.$confirm(
'确认重置密码吗?密码重置后玩家将无法登录,请谨慎操作!',
'重置密码',
{
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning',
}).then(res => { }
)
.then((res) => {
const data = { const data = {
member_id: this.accountSelect, member_id: this.accountSelect,
zq_user_name: this.cser_name zq_user_name: this.cser_name,
} };
autoResetPassword(data).then((res) => { autoResetPassword(data).then((res) => {
if (res.status_code == 1) { if (res.status_code == 1) {
this.$message.success('密码重置成功') this.$message.success('密码重置成功');
} }
});
}) })
}).catch(() => { .catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '已取消' message: '已取消',
}) });
}) });
}, },
// 修改手机号 // 修改手机号
changePhoneClick() { changePhoneClick() {
this.changePhone = true this.changePhone = true;
}, },
// 关联客服 // 关联客服
relationKfh() { relationKfh() {
const username = this.bindGameUserList.find( const username = this.bindGameUserList.find(
(item) => item.value == this.accountSelect (item) => item.value == this.accountSelect
) );
const params = { const params = {
member_id: this.accountSelect, member_id: this.accountSelect,
user_id: this.cser_id, user_id: this.cser_id,
user_name: this.cser_name, user_name: this.cser_name,
username: username.username username: username.username,
} };
bindUserSelfAdd(params).then((res) => { bindUserSelfAdd(params).then((res) => {
if (res.status_code == 1) { if (res.status_code == 1) {
this.$set(this.chatUserDetails, 'bind_cser', 1) this.$set(this.chatUserDetails, 'bind_cser', 1);
this.$message.success(res.msg) this.$message.success(res.msg);
} }
}) });
}, },
// 误操作处理 // 误操作处理
errorHandle() { errorHandle() {
this.$emit('error-handle') this.$emit('error-handle');
}, },
// 编辑备注 // 编辑备注
editRemark() { editRemark() {
this.showInputRemark = true this.showInputRemark = true;
this.showInputRemarkValue = this.chatUserDetails.remark || this.chatUserDetails.name this.showInputRemarkValue =
this.chatUserDetails.remark || this.chatUserDetails.name;
this.$nextTick(() => { this.$nextTick(() => {
// document.querySelector('.showInputRemarkInput input').focus() // document.querySelector('.showInputRemarkInput input').focus()
}) });
}, },
// 处理备注输入 // 处理备注输入
handleInputRemark(val) { handleInputRemark(val) {
this.showInputRemark = false this.showInputRemark = false;
this.chatUserDetails.remark = this.showInputRemarkValue this.chatUserDetails.remark = this.showInputRemarkValue;
const data = { const data = {
userid: this.chatUserDetails.userid, userid: this.chatUserDetails.userid,
external_userid: this.chatUserDetails.external_userid, external_userid: this.chatUserDetails.external_userid,
remark: this.chatUserDetails.remark, remark: this.chatUserDetails.remark,
self_defined_columns: this.chatUserDetails.self_defined_columns, self_defined_columns: this.chatUserDetails.self_defined_columns,
tag_group: this.chatUserDetails.tag_group tag_group: this.chatUserDetails.tag_group,
} };
this.editUserInfo(data) this.editUserInfo(data);
}, },
editUserInfo(data) { editUserInfo(data) {
editUser(data).then((res) => { editUser(data).then((res) => {
if (res.status_code == 1) { if (res.status_code == 1) {
this.$message({ this.$message({
type: 'success', type: 'success',
message: res.msg message: res.msg,
}) });
} }
}) });
}, },
// 显示自定义列输入 // 显示自定义列输入
inputShow(item, index) { inputShow(item, index) {
this.showInput = true this.showInput = true;
this.inputIndex = index this.inputIndex = index;
this.showInputValue = item.value this.showInputValue = item.value;
this.$nextTick(() => { this.$nextTick(() => {
document.querySelectorAll('input')[0].focus() document.querySelectorAll('input')[0].focus();
}) });
}, },
// 处理自定义列输入 // 处理自定义列输入
handleInput(item, index) { handleInput(item, index) {
this.$emit('update-custom-column', { this.$emit('update-custom-column', {
item, item,
index, index,
value: this.showInputValue value: this.showInputValue,
}) });
this.showInput = false this.showInput = false;
}, },
// 编辑标签 // 编辑标签
editTags() { editTags() {
this.showTag = true this.showTag = true;
}, },
// 处理评估变更 // 处理评估变更
changeAppraisal(val) { changeAppraisal(val) {
this.change_appraisal = val this.change_appraisal = val;
}, },
// 选择的标签 // 选择的标签
selectTags(data, is_tag_sync) { selectTags(data, is_tag_sync) {
this.chatUserDetails.tag_group = data this.chatUserDetails.tag_group = data;
const params = { const params = {
userid: this.chatUserDetails.userid, userid: this.chatUserDetails.userid,
external_userid: this.chatUserDetails.external_userid, external_userid: this.chatUserDetails.external_userid,
remark: this.chatUserDetails.remark, remark: this.chatUserDetails.remark,
is_tag_sync: is_tag_sync, is_tag_sync: is_tag_sync,
self_defined_columns: this.chatUserDetails.self_defined_columns, self_defined_columns: this.chatUserDetails.self_defined_columns,
tag_group: this.chatUserDetails.tag_group tag_group: this.chatUserDetails.tag_group,
} };
this.editUserInfo(params) this.editUserInfo(params);
}, },
} async getLastTime() {
} if (!this.accountSelect) return;
const { data } = await getMemberInfoApi({
member_id: this.accountSelect,
});
this.lastTime = data.last_chat_time;
},
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.info-tab-content { .info-tab-content {
...@@ -607,7 +792,7 @@ export default { ...@@ -607,7 +792,7 @@ export default {
font-size: 18px; font-size: 18px;
p { p {
color: #F56C6C; color: #f56c6c;
line-height: 25px; line-height: 25px;
} }
} }
...@@ -639,7 +824,7 @@ export default { ...@@ -639,7 +824,7 @@ export default {
p { p {
margin: 5px 0; margin: 5px 0;
color: #F56C6C; color: #f56c6c;
font-weight: 600; font-weight: 600;
} }
} }
...@@ -663,7 +848,7 @@ export default { ...@@ -663,7 +848,7 @@ export default {
margin-bottom: 10px; margin-bottom: 10px;
p { p {
color: #F56C6C; color: #f56c6c;
line-height: 25px; line-height: 25px;
} }
} }
...@@ -697,7 +882,7 @@ export default { ...@@ -697,7 +882,7 @@ export default {
} }
.noBind { .noBind {
color: #3491FA; color: #3491fa;
cursor: pointer; cursor: pointer;
margin-right: 10px; margin-right: 10px;
} }
...@@ -772,7 +957,7 @@ export default { ...@@ -772,7 +957,7 @@ export default {
.tag-more { .tag-more {
display: inline-block; display: inline-block;
color: #3491FA; color: #3491fa;
margin-left: 5px; margin-left: 5px;
cursor: pointer; cursor: pointer;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论