Commit 7abb7542 authored by 赵茹林's avatar 赵茹林

回访信息 修复更新手机号、微信号后界面没有更新显示的问题,最后更新时间不显示/不更新显示的问题

parent a6b45465
<!-- 回访信息 --> <!-- 回访信息 -->
<template> <template>
<div class="callback-container">
<el-card shadow="never" class="callback-container" v-loading="loading">
<div class="callback-info callback-item" style="margin-bottom: 15px;">
ID:{{callbackObj.user_id}} &emsp; <el-card shadow="never" class="callback-info callback-item" style="margin-bottom: 15px;">
用户昵称:{{callbackObj.detail.nickname}} &emsp; ID:{{user.user_id}} &emsp;
宝宝名称:{{callbackObj.detail.baby_name || '-'}} &emsp; 用户昵称:{{user.nickname}} &emsp;
宝宝生日:{{(callbackObj.detail.birthday == '0000-00-00') ? '-' : callbackObj.detail.birthday}} &emsp; 宝宝名称:{{user.baby_name || '-'}} &emsp;
手机号:{{callbackObj.detail.mobile || '-'}} &emsp; 宝宝生日:{{(user.birthday == '0000-00-00') ? '-' : user.birthday}} &emsp;
手机号:{{user.mobile || '-'}} &emsp;
<div style="display: inline-block; white-space: nowrap">
关联手机号: 关联手机号:
<span class="callback-edit"> <span class="callback-edit">
<!--<i v-if="!callbackEdit.mobile.show" @click="editCallback('mobile')">{{callbackObj.detail.relation_mobile ? callbackObj.detail.relation_mobile : '&#45;&#45;'}}</i>--> <!--<i v-if="!callbackEdit.mobile.show" @click="editCallback('mobile')">{{user.relation_mobile || '&#45;&#45;'}}</i>-->
<template v-if="$store.state.readonly"> <template v-if="$store.state.readonly">
{{callbackEdit.mobile.value || '-'}} {{callbackEdit.mobile.value || '-'}}
</template> </template>
...@@ -21,9 +23,12 @@ ...@@ -21,9 +23,12 @@
style="width: 130px;" size="small"></el-input> style="width: 130px;" size="small"></el-input>
<!--v-else @blur="callbackEdit.mobile.show = !callbackEdit.mobile.show"--> <!--v-else @blur="callbackEdit.mobile.show = !callbackEdit.mobile.show"-->
</span> &emsp; </span> &emsp;
</div>
<div style="display: inline-block; white-space: nowrap">
微信号: 微信号:
<span class="callback-edit"> <span class="callback-edit">
<!--<i v-if="!callbackEdit.wechat.show" @click="editCallback('wechat')">{{callbackObj.detail.wx_number ? callbackObj.detail.wx_number : '&#45;&#45;'}}</i>--> <!--<i v-if="!callbackEdit.wechat.show" @click="editCallback('wechat')">{{user.wx_number || '&#45;&#45;'}}</i>-->
<template v-if="$store.state.readonly"> <template v-if="$store.state.readonly">
{{callbackEdit.wechat.value || '-'}} {{callbackEdit.wechat.value || '-'}}
</template> </template>
...@@ -34,24 +39,27 @@ ...@@ -34,24 +39,27 @@
style="width: 100px;" size="small"></el-input> style="width: 100px;" size="small"></el-input>
<!--v-else @blur="callbackEdit.wechat.show = !callbackEdit.wechat.show"--> <!--v-else @blur="callbackEdit.wechat.show = !callbackEdit.wechat.show"-->
</span> &emsp; </span> &emsp;
</div>
<el-button <el-button
v-if="!$store.state.readonly" v-if="!$store.state.readonly"
@click="editCallbackSave" @click="editCallbackSave"
:disabled="(callbackEdit.wechat.value == callbackEdit.wechat.origin) && (callbackEdit.mobile.value == callbackEdit.mobile.origin)" :disabled="(callbackEdit.wechat.value == callbackEdit.wechat.origin) && (callbackEdit.mobile.value == callbackEdit.mobile.origin)"
type="primary" plain size="small">更新用户信息</el-button>&emsp; type="primary" plain size="small">更新用户信息
<span style="font-size: 12px; color: #999999; white-space: nowrap">最后更新:{{callbackObj.detail.updated_at || '-'}}</span> </el-button>&emsp;
</div> <span style="font-size: 12px; color: #999999; white-space: nowrap">最后更新:{{user.updated_at || '-'}}</span>
</el-card>
<div class="callback-item" style="display: flex; align-items: flex-start; margin-bottom: 15px; line-height: 32px;"> <el-card shadow="never" class="callback-item" style="display: flex; align-items: flex-start; margin-bottom: 15px; line-height: 32px;">
标签: 标签:
<span class="callback-tag-wrapper" v-if="tag.length"> <span class="callback-tag-wrapper" v-if="tag.length">
<el-tag :key="item.id" :type="item.type==1 ? 'info' : ''" v-for="item in tag">{{item.label_name}}</el-tag> <el-tag :key="item.id" :type="item.type==1 ? 'info' : ''" v-for="item in tag">{{item.label_name}}</el-tag>
</span> </span>
<el-button v-if="!$store.state.readonly" type="warning" size="small" plain @click="dialogToggle">编辑标签</el-button> <el-button v-if="!$store.state.readonly" type="warning" size="small" plain @click="dialogToggle">编辑标签</el-button>
</div> </el-card>
<!--添加回访信息--> <!--添加回访信息-->
<div v-if="callbackObj.teacher_id && callbackAdd && !$store.state.readonly" class="callback-item callback-input"> <el-card shadow="never" v-if="callbackObj.teacher_id && callbackAdd && !$store.state.readonly" class="callback-item callback-input">
<el-form size="small" inline> <el-form size="small" inline>
<el-form-item required> <el-form-item required>
<el-select v-model="add.method" placeholder="回访方式" style="width: 140px;"> <el-select v-model="add.method" placeholder="回访方式" style="width: 140px;">
...@@ -83,9 +91,9 @@ ...@@ -83,9 +91,9 @@
<el-input <el-input
type="textarea" :rows="3" type="textarea" :rows="3"
placeholder="请输入回访内容" v-model="add.desc"></el-input> placeholder="请输入回访内容" v-model="add.desc"></el-input>
</div> </el-card>
<div class="callback-list callback-item"> <el-card shadow="never" class="callback-list callback-item">
<ol v-if="list.length"> <ol v-if="list.length">
<li :key="item.id" v-for="item in list"> <li :key="item.id" v-for="item in list">
<!--系统--> <!--系统-->
...@@ -108,7 +116,7 @@ ...@@ -108,7 +116,7 @@
</ol> </ol>
<p class="callback-list-text" v-else>暂无回访数据</p> <p class="callback-list-text" v-else>暂无回访数据</p>
<page :total="total" :limit="limit" @pageChange="onPageChange" @sizeChange="onSizeChange"/> <page :total="total" :limit="limit" @pageChange="onPageChange" @sizeChange="onSizeChange"/>
</div> </el-card>
<el-dialog :title="dialog.title" append-to-body :visible.sync="dialog.show" width="800px"> <el-dialog :title="dialog.title" append-to-body :visible.sync="dialog.show" width="800px">
...@@ -126,7 +134,8 @@ ...@@ -126,7 +134,8 @@
slot="reference" slot="reference"
@close="tagDel(item)" @close="tagDel(item)"
:closable="item.type==1 ? false : true" :closable="item.type==1 ? false : true"
:type="item.type==1 ? 'info' : ''">{{item.label_name}}</el-tag> :type="item.type==1 ? 'info' : ''">{{item.label_name}}
</el-tag>
</el-popover> </el-popover>
</template> </template>
...@@ -152,21 +161,32 @@ ...@@ -152,21 +161,32 @@
</span> </span>
</el-dialog> </el-dialog>
</div> </el-card>
</template> </template>
<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, putUserInfoApi} from "@/service/api"; import {
getUserDetailApi,
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 {
name: "CallBack", name: "CallBack",
components: { page }, components: {page},
props: { props: {
callbackObj: { callbackObj: {
type: Object, type: Object,
default: () => {} default: () => {
}
}, },
callbackAdd: { callbackAdd: {
type: Boolean, type: Boolean,
...@@ -175,6 +195,15 @@ ...@@ -175,6 +195,15 @@
}, },
data() { data() {
return { return {
loading: true,
user: {
user_id: '',
nickname: '',
baby_name: '',
birthday: '',
mobile: '',
updated_at: ''
},
CALLBACK_METHOD: CALLBACK_METHOD, CALLBACK_METHOD: CALLBACK_METHOD,
CALLBACK_TYPE: CALLBACK_TYPE, CALLBACK_TYPE: CALLBACK_TYPE,
CALLBACK_INTENTION: CALLBACK_INTENTION, CALLBACK_INTENTION: CALLBACK_INTENTION,
...@@ -233,20 +262,23 @@ ...@@ -233,20 +262,23 @@
created() { created() {
}, },
watch: { watch: {
'callbackObj.detail'() { 'user'() {
this.callbackEdit.mobile.value = this.callbackObj.detail.relation_mobile; this.callbackEdit.mobile.value = this.user.relation_mobile;
this.callbackEdit.mobile.origin = this.callbackObj.detail.relation_mobile; this.callbackEdit.mobile.origin = this.user.relation_mobile;
this.callbackEdit.wechat.value = this.callbackObj.detail.wx_number; this.callbackEdit.wechat.value = this.user.wx_number;
this.callbackEdit.wechat.origin = this.callbackObj.detail.wx_number; this.callbackEdit.wechat.origin = this.user.wx_number;
} }
}, },
mounted() { mounted() {
this.user.user_id = this.callbackObj.user_id;
this.getUser();
this.getTag(); this.getTag();
this.getData();
}, },
methods: { methods: {
filterName(string, type) { filterName(string, type) {
return this[type].find(i => {return i.value == string}).label return this[type].find(i => {
return i.value == string
}).label
}, },
editCallback(type) { editCallback(type) {
...@@ -260,8 +292,9 @@ ...@@ -260,8 +292,9 @@
relation_mobile: this.callbackEdit.mobile.value, relation_mobile: this.callbackEdit.mobile.value,
wx_number: this.callbackEdit.wechat.value wx_number: this.callbackEdit.wechat.value
} }
putUserInfoApi(this.callbackObj.user_id, json).then(res => { putUserInfoApi(this.user.user_id, json).then(res => {
this.$message({type: 'success', message: '用户信息更新成功'}); this.$message({type: 'success', message: '用户信息更新成功'});
this.getUser();
// this.$emit('updateUser'); // this.$emit('updateUser');
}) })
}, },
...@@ -274,7 +307,7 @@ ...@@ -274,7 +307,7 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delUserTagApi(item.id).then(res => { delUserTagApi(item.id).then(res => {
this.$message({ type: 'success', message: '标签删除成功!' }); this.$message({type: 'success', message: '标签删除成功!'});
this.getTag(); this.getTag();
}) })
}) })
...@@ -295,18 +328,18 @@ ...@@ -295,18 +328,18 @@
}, },
dialogSave() { dialogSave() {
if (!this.tagSelected.length) { if (!this.tagSelected.length) {
this.$message({ type: 'error', message: '请选择标签!' }); this.$message({type: 'error', message: '请选择标签!'});
return return
} }
var json = { var json = {
user_id: this.callbackObj.user_id, user_id: this.user.user_id,
type: 0, type: 0,
first_label_id: this.tagSelected[0] first_label_id: this.tagSelected[0]
}; };
this.tagSelected[1] ? json.second_label_id = this.tagSelected[1] : ''; this.tagSelected[1] ? json.second_label_id = this.tagSelected[1] : '';
this.tagSelected[2] ? json.third_label_id = this.tagSelected[2] : ''; this.tagSelected[2] ? json.third_label_id = this.tagSelected[2] : '';
postUserTagApi(json).then(res => { postUserTagApi(json).then(res => {
this.$message({ type: 'success', message: '添加成功!' }); this.$message({type: 'success', message: '添加成功!'});
this.getTag(); this.getTag();
this.dialogReset(); this.dialogReset();
}) })
...@@ -341,17 +374,24 @@ ...@@ -341,17 +374,24 @@
}) })
} }
} }
getTagApi().then(res => { getTagApi().then(res => {
recursion(res); recursion(res);
this.treeDataOrigin = res; this.treeDataOrigin = res;
}); });
}, },
getUser() {
getUserDetailApi(this.user.user_id).then(res => {
// console.log(res, 999)
this.user = res;
this.getData();
this.loading = false;
})
},
getTag() { getTag() {
if (this.callbackObj.user_id) { getUserTagApi(this.user.user_id).then(res => {
getUserTagApi(this.callbackObj.user_id).then(res => {
this.tag = res; this.tag = res;
}) })
}
}, },
getData() { getData() {
let json = { let json = {
...@@ -359,7 +399,7 @@ ...@@ -359,7 +399,7 @@
page: this.nowPage page: this.nowPage
}; };
this.teacher_num ? json.teacher_num = this.teacher_num : ''; this.teacher_num ? json.teacher_num = this.teacher_num : '';
this.callbackObj.user_id ? json.user_id = this.callbackObj.user_id : ''; this.user.user_id ? json.user_id = this.user.user_id : '';
// console.log(json, 9000) // console.log(json, 9000)
getCallBackApi(json).then(res => { getCallBackApi(json).then(res => {
this.list = res.page_data; this.list = res.page_data;
...@@ -388,7 +428,7 @@ ...@@ -388,7 +428,7 @@
return return
} }
let json = { let json = {
user_id: this.callbackObj.user_id, user_id: this.user.user_id,
teacher_id: this.callbackObj.teacher_id, // TODO teacher_id: this.callbackObj.teacher_id, // TODO
// teacher_id: 84, // TODO // teacher_id: 84, // TODO
method: this.add.method, method: this.add.method,
...@@ -418,9 +458,14 @@ ...@@ -418,9 +458,14 @@
<style lang="less"> <style lang="less">
.callback-container { .callback-container {
border: none;
.el-divider--horizontal { .el-divider--horizontal {
margin: 20px 0; margin: 20px 0;
} }
.el-card__body {
padding: 0;
}
} }
.callback-item { .callback-item {
...@@ -430,26 +475,32 @@ ...@@ -430,26 +475,32 @@
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; font-size: 14px;
&:last-child { &:last-child {
margin-bottom: 0; margin-bottom: 0;
} }
} }
.callback-info { .callback-info {
/*display: flex;*/ /*display: flex;*/
padding: 10px 15px; padding: 10px 15px;
line-height: 32px; line-height: 32px;
.callback-edit { .callback-edit {
display: inline-block; display: inline-block;
.el-input__inner { .el-input__inner {
vertical-align: top; vertical-align: top;
} }
i { i {
margin: 0 -4px; margin: 0 -4px;
padding: 0 4px; padding: 0 4px;
font-style: normal; font-style: normal;
cursor: pointer; cursor: pointer;
transition: 240ms background-color; transition: 240ms background-color;
&:hover { &:hover {
background-color: #dde4ee; background-color: #dde4ee;
border-radius: 3px; border-radius: 3px;
...@@ -481,29 +532,37 @@ ...@@ -481,29 +532,37 @@
padding: 2px 0; padding: 2px 0;
line-height: 24px; line-height: 24px;
font-size: 14px; font-size: 14px;
span { span {
/*display: inline-block;*/ /*display: inline-block;*/
margin-right: 12px; margin-right: 12px;
&.time { &.time {
font-family: monospace; font-family: monospace;
font-size: 13px; font-size: 13px;
} }
&.grey { &.grey {
color: #555; color: #555;
} }
&.dark { &.dark {
color: #333; color: #333;
} }
&.bold { &.bold {
font-weight: bold; font-weight: bold;
} }
&.info { &.info {
font-size: 13px; font-size: 13px;
color: #888; color: #888;
} }
&.green { &.green {
color: #33CC66; color: #33CC66;
} }
&.red { &.red {
color: red; color: red;
} }
...@@ -513,12 +572,15 @@ ...@@ -513,12 +572,15 @@
.callback-input { .callback-input {
font-size: 0; font-size: 0;
.el-form-item { .el-form-item {
margin-right: 10px; margin-right: 10px;
margin-bottom: 10px; margin-bottom: 10px;
} }
.is-required .el-select { .is-required .el-select {
display: flex; display: flex;
&:before { &:before {
content: '*'; content: '*';
color: #F56C6C; color: #F56C6C;
......
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