Commit e0732e37 authored by 赵茹林's avatar 赵茹林

回访信息 新增 更新用户信息(微信号,关联手机号)、展示最后更新时间

parent ebd108cb
...@@ -2,12 +2,35 @@ ...@@ -2,12 +2,35 @@
<template> <template>
<div class="callback-container"> <div class="callback-container">
<div class="callback-item" style="margin-bottom: 15px;"> <div class="callback-info callback-item" style="margin-bottom: 15px;">
ID:{{callbackObj.user_id}} &emsp; ID:{{callbackObj.user_id}} &emsp;
用户昵称:{{callbackObj.detail.nickname}} &emsp; 用户昵称:{{callbackObj.detail.nickname}} &emsp;
宝宝名称:{{callbackObj.detail.baby_name ? callbackObj.detail.baby_name : '-'}} &emsp; 宝宝名称:{{callbackObj.detail.baby_name ? callbackObj.detail.baby_name : '-'}} &emsp;
宝宝生日:{{(callbackObj.detail.birthday == '0000-00-00') ? '-' : callbackObj.detail.birthday}} &emsp; 宝宝生日:{{(callbackObj.detail.birthday == '0000-00-00') ? '-' : callbackObj.detail.birthday}} &emsp;
手机号:{{callbackObj.detail.mobile ? callbackObj.detail.mobile : '-'}} &emsp; 手机号:{{callbackObj.detail.mobile ? callbackObj.detail.mobile : '--'}} &emsp;
关联手机号:
<span class="callback-edit">
<!--<i v-if="!callbackEdit.mobile.show" @click="editCallback('mobile')">{{callbackObj.detail.relation_mobile ? callbackObj.detail.relation_mobile : '&#45;&#45;'}}</i>-->
<el-input
ref="mobileEdit"
v-model="callbackEdit.mobile.value"
style="width: 130px;" size="small"></el-input>
<!--v-else @blur="callbackEdit.mobile.show = !callbackEdit.mobile.show"-->
</span> &emsp;
微信号:
<span class="callback-edit">
<!--<i v-if="!callbackEdit.wechat.show" @click="editCallback('wechat')">{{callbackObj.detail.wx_number ? callbackObj.detail.wx_number : '&#45;&#45;'}}</i>-->
<el-input
ref="wechatEdit"
v-model="callbackEdit.wechat.value"
style="width: 100px;" size="small"></el-input>
<!--v-else @blur="callbackEdit.wechat.show = !callbackEdit.wechat.show"-->
</span> &emsp;
<el-button
@click="editCallbackSave"
:disabled="(callbackEdit.wechat.value == callbackEdit.wechat.origin) && (callbackEdit.mobile.value == callbackEdit.mobile.origin)"
type="primary" plain size="small">更新用户信息</el-button>&emsp;
<span style="font-size: 12px; color: #999999; white-space: nowrap">最后更新:{{callbackObj.detail.updated_at}}</span>
</div> </div>
<div class="callback-item" style="display: flex; margin-bottom: 15px; line-height: 32px;"> <div class="callback-item" style="display: flex; margin-bottom: 15px; line-height: 32px;">
...@@ -124,7 +147,7 @@ ...@@ -124,7 +147,7 @@
<script> <script>
import {CALLBACK_METHOD, CALLBACK_TYPE, CALLBACK_INTENTION} from "@/util/wordbook"; import {CALLBACK_METHOD, CALLBACK_TYPE, CALLBACK_INTENTION} from "@/util/wordbook";
import {getUserTagApi, getTagApi, getCallBackApi, postCallBackApi, postUserTagApi, delUserTagApi} from "@/service/api"; import {getUserTagApi, getTagApi, getCallBackApi, postCallBackApi, postUserTagApi, delUserTagApi, putUserInfoApi} from "@/service/api";
import page from '@/components/framework/page' import page from '@/components/framework/page'
export default { export default {
...@@ -182,10 +205,31 @@ ...@@ -182,10 +205,31 @@
}, },
} }
}, },
callbackEdit: {
mobile: {
show: false,
origin: '', // 初始值
value: ''
},
wechat: {
show: false,
origin: '', // 初始值
value: ''
},
}
} }
}, },
created() { created() {
}, },
watch: {
'callbackObj.detail'() {
this.callbackEdit.mobile.value = this.callbackObj.detail.relation_mobile;
this.callbackEdit.mobile.origin = this.callbackObj.detail.relation_mobile;
this.callbackEdit.wechat.value = this.callbackObj.detail.wx_number;
this.callbackEdit.wechat.origin = this.callbackObj.detail.wx_number;
}
},
mounted() { mounted() {
this.getTag(); this.getTag();
this.getData(); this.getData();
...@@ -195,6 +239,23 @@ ...@@ -195,6 +239,23 @@
return this[type].find(i => {return i.value == string}).label return this[type].find(i => {return i.value == string}).label
}, },
editCallback(type) {
this.callbackEdit[type].show = !this.callbackEdit[type].show;
this.$nextTick(() => {
this.$refs[`${type}Edit`].focus();
})
},
editCallbackSave() {
let json = {
relation_mobile: this.callbackEdit.mobile.value,
wx_number: this.callbackEdit.wechat.value
}
putUserInfoApi(this.callbackObj.user_id, json).then(res => {
this.$message({type: 'success', message: '用户信息更新成功'});
// this.$emit('updateUser');
})
},
tagDel(item) { tagDel(item) {
this.$confirm(`是否删除标签 <br> ${item.label_name}`, '提示', { this.$confirm(`是否删除标签 <br> ${item.label_name}`, '提示', {
dangerouslyUseHTMLString: true, dangerouslyUseHTMLString: true,
...@@ -358,11 +419,35 @@ ...@@ -358,11 +419,35 @@
background-color: rgba(245, 247, 250, 0.65); background-color: rgba(245, 247, 250, 0.65);
border: solid 1px rgba(220, 223, 230, 0.5); border: solid 1px rgba(220, 223, 230, 0.5);
border-radius: 2px; border-radius: 2px;
font-size: 14px;
&:last-child { &:last-child {
margin-bottom: 0; margin-bottom: 0;
} }
} }
.callback-info {
/*display: flex;*/
padding: 10px 15px;
line-height: 32px;
.callback-edit {
display: inline-block;
.el-input__inner {
vertical-align: top;
}
i {
margin: 0 -4px;
padding: 0 4px;
font-style: normal;
cursor: pointer;
transition: 240ms background-color;
&:hover {
background-color: #dde4ee;
border-radius: 3px;
}
}
}
}
.callback-tag-wrapper { .callback-tag-wrapper {
.el-tag { .el-tag {
margin-right: 10px; margin-right: 10px;
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
<el-dialog append-to-body :visible.sync="descDialog.show" title="沟通情况列表" width="75%"> <el-dialog append-to-body :visible.sync="descDialog.show" title="沟通情况列表" width="75%">
<!--TODO @updateUser-->
<call-back :callbackAdd="true" :callbackObj="callbackObj"></call-back> <call-back :callbackAdd="true" :callbackObj="callbackObj"></call-back>
<!--<el-form label-width="90px"> <!--<el-form label-width="90px">
......
<!--该文件已废弃-->
<template> <template>
<div class="user-detail"> <div class="user-detail">
...@@ -889,7 +890,7 @@ ...@@ -889,7 +890,7 @@
if (res.periods_list) { if (res.periods_list) {
this.periodList = res.periods_list this.periodList = res.periods_list
} }
console.log(res) // console.log(res)
}) })
getSubAccountInfoApi(this.id).then(res => { getSubAccountInfoApi(this.id).then(res => {
if (res.family_user == 1) { if (res.family_user == 1) {
...@@ -1023,11 +1024,6 @@ ...@@ -1023,11 +1024,6 @@
}, },
filters: { filters: {
payMentFilter(val) { payMentFilter(val) {
arr.forEach(function(value, index, array) {
value.forEach(function (value2, index2, array2) {
})
})
return val == '1' ? '已付款' : '未付款' return val == '1' ? '已付款' : '未付款'
}, },
courseTypeFilter(val) { courseTypeFilter(val) {
......
<template> <template>
<div> <div class="user-detail">
<el-row :gutter="20" style="margin-bottom: 20px;"> <el-row :gutter="20" style="margin-bottom: 20px;">
<el-col :span="12"> <el-col :span="12">
<el-card class="user-card"> <el-card class="user-card">
...@@ -57,7 +58,7 @@ ...@@ -57,7 +58,7 @@
<!--<el-tabs type="border-card" v-model="tabs">--> <!--<el-tabs type="border-card" v-model="tabs">-->
<el-tabs type="border-card" v-model="tabs"> <el-tabs type="border-card" v-model="tabs">
<el-tab-pane label="回访信息" name="callback"> <el-tab-pane label="回访信息" name="callback">
<call-back :callbackObj="callbackObj" :callbackAdd="true"></call-back> <call-back :callbackObj="callbackObj" :callbackAdd="true" @updateUser="getDetail"></call-back>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="期数列表" name="periods"> <el-tab-pane label="期数列表" name="periods">
<el-table @expand-change="changeRow" :data="periodList"> <el-table @expand-change="changeRow" :data="periodList">
...@@ -645,9 +646,11 @@ ...@@ -645,9 +646,11 @@
} }
}, },
created() { created() {
this.id = this.parentDetail ? this.parentDetail.id : this.$route.params.id; // this.id = this.parentDetail ? this.parentDetail.id : this.$route.params.id;
this.id = this.parentDetail ? this.parentDetail.id : (this.$route.query.userid ? this.$route.query.userid : '');
this.callbackObj.user_id = this.id; this.callbackObj.user_id = this.id;
this.callbackObj.teacher_id = this.parentDetail.teacher_id ? this.parentDetail.teacher_id : ''; // this.callbackObj.teacher_id = this.parentDetail.teacher_id ? this.parentDetail.teacher_id : '';
this.callbackObj.teacher_id = this.parentDetail && this.parentDetail.teacher_id ? this.parentDetail.teacher_id : (this.$route.query.teacherid ? this.$route.query.teacherid : '');
}, },
mounted() { mounted() {
this.getDetail(); this.getDetail();
...@@ -874,7 +877,7 @@ ...@@ -874,7 +877,7 @@
if (res.periods_list) { if (res.periods_list) {
this.periodList = res.periods_list this.periodList = res.periods_list
} }
console.log(res) // console.log(res)
}) })
getSubAccountInfoApi(this.id).then(res => { getSubAccountInfoApi(this.id).then(res => {
if (res.family_user == 1) { if (res.family_user == 1) {
...@@ -1136,10 +1139,8 @@ ...@@ -1136,10 +1139,8 @@
</style> </style>
<style> <style>
.f-c > div { .user-detail {
display: flex !important; padding: 20px;
flex-flow: row;
justify-content: flex-start;
align-items: center;
} }
</style> </style>
...@@ -62,6 +62,10 @@ const postUserTransferUrl = `${_baseUrl}api/admin/user/data/transfer`; ...@@ -62,6 +62,10 @@ const postUserTransferUrl = `${_baseUrl}api/admin/user/data/transfer`;
export const postUserTransferApi = function (json) { export const postUserTransferApi = function (json) {
return Vue.prototype.$post(postUserTransferUrl, json) return Vue.prototype.$post(postUserTransferUrl, json)
}; };
// 修改用户关联信息
export const putUserInfoApi = function (id, json) {
return Vue.prototype.$put(`${_baseUrl}api/admin/user/extra/info/${id}`, json)
};
// 获取回访信息 // 获取回访信息
export const getCallBackApi = function (json) { export const getCallBackApi = function (json) {
// console.log(json, 9001) // console.log(json, 9001)
......
...@@ -189,7 +189,7 @@ export default [{ ...@@ -189,7 +189,7 @@ export default [{
router: { router: {
path: '/userDetail', path: '/userDetail',
name: 'userDetail', name: 'userDetail',
component: e => require(['@/components/userDetail/detail'], e), component: e => require(['@/components/userDetail/index'], e),
} }
}, },
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment