Commit 2296a2de authored by 赵茹林's avatar 赵茹林

回访信息 修复 因接口并发导致接口返回503的问题

教师绑定用户 修复 弹窗分页不能点击的问题
parent 7a059540
......@@ -5,10 +5,10 @@
<el-card shadow="never" class="callback-info callback-item" style="margin-bottom: 15px;">
ID:{{user.user_id}} &emsp;
用户昵称:{{user.nickname}} &emsp;
宝宝名称:{{user.baby_name || '-'}} &emsp;
宝宝生日:{{(user.birthday == '0000-00-00') ? '-' : user.birthday}} &emsp;
手机号:{{user.mobile || '-'}} &emsp;
用户昵称:{{user.info.nickname || '-'}} &emsp;
宝宝名称:{{user.info.baby_name || '-'}} &emsp;
宝宝生日:{{(user.info.birthday == '0000-00-00') ? '-' : user.info.birthday}} &emsp;
手机号:{{user.info.mobile || '-'}} &emsp;
<div style="display: inline-block; white-space: nowrap">
关联手机号:
<span class="callback-edit">
......@@ -47,7 +47,7 @@
: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">最后更新:{{user.updated_at || '-'}}</span>
<span style="font-size: 12px; color: #999999; white-space: nowrap">最后更新:{{user.info.updated_at || '-'}}</span>
</el-card>
<el-card shadow="never" class="callback-item" style="display: flex; align-items: flex-start; margin-bottom: 15px; line-height: 32px;">
......@@ -59,7 +59,7 @@
</el-card>
<!--添加回访信息-->
<el-card shadow="never" v-if="callbackObj.teacher_id && callbackAdd && !$store.state.readonly" class="callback-item callback-input">
<el-card shadow="never" v-if="callbackObj.teacher_id && !$store.state.readonly" class="callback-item callback-input">
<el-form size="small" inline>
<el-form-item required>
<el-select v-model="add.method" placeholder="回访方式" style="width: 140px;">
......@@ -184,25 +184,21 @@
name: "CallBack",
components: {page},
props: {
callbackObj: {
callbackObj: { // user_id、teacher_id、timestamp
type: Object,
default: () => {}
},
callbackAdd: {
hasUserInfo: { // 是否传过来用户信息,传来用户信息就不调接口请求用户新,否则请求(防止同时请求用户信息接口报错)
type: Boolean,
default: false
}
},
},
data() {
return {
loading: true,
user: {
user_id: '',
nickname: '',
baby_name: '',
birthday: '',
mobile: '',
updated_at: ''
info: {}
},
CALLBACK_METHOD: CALLBACK_METHOD,
CALLBACK_TYPE: CALLBACK_TYPE,
......@@ -262,11 +258,14 @@
created() {
},
watch: {
'user'() {
this.callbackEdit.mobile.value = this.user.relation_mobile;
this.callbackEdit.mobile.origin = this.user.relation_mobile;
this.callbackEdit.wechat.value = this.user.wx_number;
this.callbackEdit.wechat.origin = this.user.wx_number;
'callbackObj.info'() {
this.user.info = this.callbackObj.info || {};
},
'user.info'() {
this.callbackEdit.mobile.value = this.user.info.relation_mobile;
this.callbackEdit.mobile.origin = this.user.info.relation_mobile;
this.callbackEdit.wechat.value = this.user.info.wx_number;
this.callbackEdit.wechat.origin = this.user.info.wx_number;
},
'callbackObj.timestamp'() {
this.user.user_id = this.callbackObj.user_id;
......@@ -276,8 +275,26 @@
},
mounted() {
this.user.user_id = this.callbackObj.user_id;
if (!this.hasUserInfo) {
this.getUser();
} else {
this.user.info = this.callbackObj.info;
}
this.getTag();
this.getData();
if (this.callbackObj.teacher_id) {
let json = {
user_id: this.callbackObj.user_id
}
getCallBackPrevApi(json).then(res => {
if (res && res[0] && res[0].next_visit_at && res[0].intention) {
this.add.intention = res[0].intention;
this.add.next_visit_at = res[0].next_visit_at;
}
})
}
},
methods: {
filterName(string, type) {
......@@ -300,7 +317,9 @@
putUserInfoApi(this.user.user_id, json).then(res => {
this.$message({type: 'success', message: '用户信息更新成功'});
this.getUser();
// this.$emit('updateUser');
if (this.hasUserInfo) {
this.$emit('updateUser');
}
})
},
......@@ -388,20 +407,7 @@
getUser() {
getUserDetailApi(this.user.user_id).then(res => {
// console.log(res, 999)
this.user = res;
this.getData();
if (this.callbackObj.teacher_id) {
let json = {
user_id: this.callbackObj.user_id
}
getCallBackPrevApi(json).then(res => {
if (res && res[0] && res[0].next_visit_at && res[0].intention) {
this.add.intention = res[0].intention;
this.add.next_visit_at = res[0].next_visit_at;
}
})
}
this.loading = false;
this.user.info = res;
})
},
getTag() {
......@@ -420,6 +426,7 @@
this.list = res.page_data;
this.total = res.total
// this.total = res.total_page
this.loading = false;
})
},
callbackReset() {
......
......@@ -331,13 +331,6 @@ export default {
</script>
<style scoped lang="less">
.searchFrom{
/*position: absolute;
top: 20px;*/
}
.el-table{
/*margin-top: 130px;*/
}
/deep/.el-table--enable-row-hover .el-table__body tr:hover > td {
background-color: #fff;
}
......@@ -347,7 +340,4 @@ export default {
/deep/.el-progress-bar__inner {
max-width: 100% !important;
}
.el-main .content .router-block .child-view {
/*height: 100vh;*/
}
</style>
......@@ -40,7 +40,7 @@
}
</script>
<style scoped lang="less">
<style lang="less">
@import "../../util/public";
.el-header{
background: #333333;
......
......@@ -16,7 +16,7 @@
<el-dialog append-to-body :visible.sync="descDialog.show" title="沟通情况列表" width="75%">
<!--TODO @updateUser-->
<call-back :callbackAdd="true" :callbackObj="callbackObj"></call-back>
<call-back :callbackObj="callbackObj"></call-back>
<!--<el-form label-width="90px">
<el-form-item>
......
......@@ -471,7 +471,7 @@
</el-table-column>
<el-table-column prop="mobile" label="手机号"></el-table-column>
</el-table>
<page :total="userObj.total" :limit="userObj.limit" :small="true" @pageChange="onPageChange3" @sizeChange="onSizeChange3"/>
<page :total="userObj.total" :limit="userObj.limit" :small="true" @pageChange="onPageChange4" @sizeChange="onSizeChange4"/>
<span slot="footer" class="dialog-footer">
<el-button @click="addShow = false">取 消</el-button>
<el-button type="primary" @click="onAdd">确 定</el-button>
......@@ -821,15 +821,15 @@
type: data.type
}
},
/*onPageChange3(val) {
onPageChange4(val) {
this.userObj.nowPage = val;
this.getUser()
},*/
/*onSizeChange3(val) {
},
onSizeChange4(val) {
this.userObj.limit = val;
this.userObj.nowPage = 1;
this.getUser();
},*/
},
onPageChange(val) {
this.nowPage = val;
this.getTeacherDetail();
......
......@@ -58,7 +58,7 @@
<!--<el-tabs type="border-card" v-model="tabs">-->
<el-tabs type="border-card" v-model="tabs">
<el-tab-pane label="回访信息" name="callback">
<call-back :callbackObj="callbackObj" :callbackAdd="true" @updateUser="getDetail"></call-back>
<call-back :hasUserInfo="true" :callbackObj="callbackObj" @updateUser="getDetail"></call-back>
</el-tab-pane>
<el-tab-pane label="期数列表" name="periods">
<el-table @expand-change="changeRow" :data="periodList">
......@@ -550,7 +550,8 @@
callbackObj: {
user_id: '',
teacher_id: '',
timestamp: ''
timestamp: '',
info: {}
},
userList: [],
yunjiList: [],
......@@ -875,11 +876,10 @@
if (!this.id) return;
getUserDetailApi(this.id).then(res => {
this.detail = res;
// this.callbackObj.detail = res; // 用户的所有数据
if (res.periods_list) {
this.periodList = res.periods_list
}
// console.log(res)
this.callbackObj.info = res; // 用户的所有数据
})
getSubAccountInfoApi(this.id).then(res => {
if (res.family_user == 1) {
......
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