Commit c7421a87 authored by IvyXia123's avatar IvyXia123

Merge branch 'dev' of http://git.singsingenglish.com/new-sing/admin into dev

parents 64fa0a4a 83b530ea
......@@ -37,7 +37,9 @@
<template slot-scope="scope">
<el-input
type="number"
v-model.number="scope.row.scale"></el-input>
v-model.number="scope.row.scale">
<template slot="append">%</template>
</el-input>
</template>
</el-table-column>
......
<!-- 回访信息 -->
<template>
<div class="callback-container">
<div class="callback-info callback-item" style="margin-bottom: 15px;">
ID:{{callbackObj.user_id}} &emsp;
用户昵称:{{callbackObj.detail.nickname}} &emsp;
宝宝名称:{{callbackObj.detail.baby_name ? callbackObj.detail.baby_name : '-'}} &emsp;
宝宝生日:{{(callbackObj.detail.birthday == '0000-00-00') ? '-' : callbackObj.detail.birthday}} &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-card shadow="never" class="callback-container" v-loading="loading">
<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;
<div style="display: inline-block; white-space: nowrap">
关联手机号:
<span class="callback-edit">
<!--<i v-if="!callbackEdit.mobile.show" @click="editCallback('mobile')">{{user.relation_mobile || '&#45;&#45;'}}</i>-->
<template v-if="$store.state.readonly">
{{callbackEdit.mobile.value || '-'}}
</template>
<el-input
v-else
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>-->
</span> &emsp;
</div>
<div style="display: inline-block; white-space: nowrap">
微信号:
<span class="callback-edit">
<!--<i v-if="!callbackEdit.wechat.show" @click="editCallback('wechat')">{{user.wx_number || '&#45;&#45;'}}</i>-->
<template v-if="$store.state.readonly">
{{callbackEdit.wechat.value || '-'}}
</template>
<el-input
v-else
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;
</span> &emsp;
</div>
<el-button
v-if="!$store.state.readonly"
@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>
type="primary" plain size="small">更新用户信息
</el-button>&emsp;
<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">
<el-tag :key="item.id" :type="item.type==1 ? 'info' : ''" v-for="item in tag">{{item.label_name}}</el-tag>
</span>
<el-button type="warning" size="small" plain @click="dialogToggle">编辑标签</el-button>
</div>
<el-button v-if="!$store.state.readonly" type="warning" size="small" plain @click="dialogToggle">编辑标签</el-button>
</el-card>
<div class="callback-item callback-input" v-if="callbackObj.teacher_id && callbackAdd">
<!--添加回访信息-->
<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-item required>
<el-select v-model="add.method" placeholder="回访方式" style="width: 140px;">
......@@ -73,9 +91,9 @@
<el-input
type="textarea" :rows="3"
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">
<li :key="item.id" v-for="item in list">
<!--系统-->
......@@ -98,7 +116,7 @@
</ol>
<p class="callback-list-text" v-else>暂无回访数据</p>
<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">
......@@ -116,7 +134,8 @@
slot="reference"
@close="tagDel(item)"
: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>
</template>
......@@ -131,8 +150,8 @@
:options="treeDataOrigin" :props="{ value: 'objString', label: 'name', multiple: false, checkStrictly: false }"></el-cascader>
</el-form-item>
<el-form-item label="已选标签备注:">
<div v-if="!tagSelectedText" style="color: #999;">未选择标签</div>
<div v-else v-html="tagSelectedText"></div>
<div v-if="!tagSelectedText" style="color: #999;">未选择标签</div>
<div v-else v-html="tagSelectedText"></div>
</el-form-item>
</el-form>
......@@ -142,21 +161,32 @@
</span>
</el-dialog>
</div>
</el-card>
</template>
<script>
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'
export default {
name: "CallBack",
components: { page },
components: {page},
props: {
callbackObj: {
type: Object,
default: () => {}
default: () => {
}
},
callbackAdd: {
type: Boolean,
......@@ -165,6 +195,15 @@
},
data() {
return {
loading: true,
user: {
user_id: '',
nickname: '',
baby_name: '',
birthday: '',
mobile: '',
updated_at: ''
},
CALLBACK_METHOD: CALLBACK_METHOD,
CALLBACK_TYPE: CALLBACK_TYPE,
CALLBACK_INTENTION: CALLBACK_INTENTION,
......@@ -223,20 +262,23 @@
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;
'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;
}
},
mounted() {
this.user.user_id = this.callbackObj.user_id;
this.getUser();
this.getTag();
this.getData();
},
methods: {
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) {
......@@ -250,8 +292,9 @@
relation_mobile: this.callbackEdit.mobile.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.getUser();
// this.$emit('updateUser');
})
},
......@@ -264,7 +307,7 @@
type: 'warning'
}).then(() => {
delUserTagApi(item.id).then(res => {
this.$message({ type: 'success', message: '标签删除成功!' });
this.$message({type: 'success', message: '标签删除成功!'});
this.getTag();
})
})
......@@ -285,18 +328,18 @@
},
dialogSave() {
if (!this.tagSelected.length) {
this.$message({ type: 'error', message: '请选择标签!' });
this.$message({type: 'error', message: '请选择标签!'});
return
}
var json = {
user_id: this.callbackObj.user_id,
user_id: this.user.user_id,
type: 0,
first_label_id: this.tagSelected[0]
};
this.tagSelected[1] ? json.second_label_id = this.tagSelected[1] : '';
this.tagSelected[2] ? json.third_label_id = this.tagSelected[2] : '';
postUserTagApi(json).then(res => {
this.$message({ type: 'success', message: '添加成功!' });
this.$message({type: 'success', message: '添加成功!'});
this.getTag();
this.dialogReset();
})
......@@ -331,17 +374,24 @@
})
}
}
getTagApi().then(res => {
recursion(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() {
if (this.callbackObj.user_id) {
getUserTagApi(this.callbackObj.user_id).then(res => {
this.tag = res;
})
}
getUserTagApi(this.user.user_id).then(res => {
this.tag = res;
})
},
getData() {
let json = {
......@@ -349,7 +399,7 @@
page: this.nowPage
};
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)
getCallBackApi(json).then(res => {
this.list = res.page_data;
......@@ -378,7 +428,7 @@
return
}
let json = {
user_id: this.callbackObj.user_id,
user_id: this.user.user_id,
teacher_id: this.callbackObj.teacher_id, // TODO
// teacher_id: 84, // TODO
method: this.add.method,
......@@ -408,9 +458,14 @@
<style lang="less">
.callback-container {
border: none;
.el-divider--horizontal {
margin: 20px 0;
}
.el-card__body {
padding: 0;
}
}
.callback-item {
......@@ -420,26 +475,32 @@
border: solid 1px rgba(220, 223, 230, 0.5);
border-radius: 2px;
font-size: 14px;
&:last-child {
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;
......@@ -471,29 +532,37 @@
padding: 2px 0;
line-height: 24px;
font-size: 14px;
span {
/*display: inline-block;*/
margin-right: 12px;
&.time {
font-family: monospace;
font-size: 13px;
}
&.grey {
color: #555;
}
&.dark {
color: #333;
}
&.bold {
font-weight: bold;
}
&.info {
font-size: 13px;
color: #888;
}
&.green {
color: #33CC66;
}
&.red {
color: red;
}
......@@ -503,12 +572,15 @@
.callback-input {
font-size: 0;
.el-form-item {
margin-right: 10px;
margin-bottom: 10px;
}
.is-required .el-select {
display: flex;
&:before {
content: '*';
color: #F56C6C;
......
......@@ -19,15 +19,17 @@
<div class="tag-tree">
<el-tree
:indent="40"
:data="treeData"
node-key="id" ref="tagTree"
:props="{children: 'children', label: 'name'}"
:indent="40"
@node-expand="tagExpand"
@node-collapse="tagCollapse"
:filter-node-method="filterNode"
:default-expanded-keys="tagExpanded"
:expand-on-click-node="true">
<!--:check-on-click-node="true"
:check-strictly="true"-->
<div class="custom-tree-node" slot-scope="{ node, data }">
<el-tag class="tag-tree-item" effect="plain" size="medium">{{node.label}}</el-tag>
<div style="display: flex">
......
<template>
<div class="admin-refresh" v-loading="loading">
<div class="section-search">
<el-form ref="searchFrom" :model="searchFrom" label-width="80px" inline>
<el-form-item>
<el-input v-model="searchFrom.userId" placeholder="ID" clearable @change="getUser"></el-input>
</el-form-item>
<el-form-item>
<el-input v-model="searchFrom.nickName" placeholder="昵称" clearable @change="getUser"></el-input>
</el-form-item>
<el-form-item>
<el-input v-model="searchFrom.mobile" placeholder="电话" clearable @change="getUser"></el-input>
</el-form-item>
<el-form-item>
<el-input v-model="searchFrom.level" placeholder="等级" clearable @change="getUser"></el-input>
</el-form-item>
<!--<el-form-item label="标签">
<el-cascader
style="width: 320px" placeholder="选择标签" clearable @change="tagChange"
:options="options" :props="{ multiple: true, checkStrictly: true }"></el-cascader>
</el-form-item>-->
<el-form-item>
<div class="flexRow">
<el-button type="primary" plain @click="getUser">搜索</el-button>
<!--<el-button type="success" plain @click="syncUser">同步最新数据</el-button>-->
</div>
</el-form-item>
</el-form>
</div>
<el-table
:data="userList"
style="width: 100%">
<el-table-column className="f-c" label="用户">
<template slot-scope="scope">
<img class="avatar" :src="scope.row.avatar">{{scope.row.nickname}}<br>(ID:{{scope.row.user_id}})
</template>
</el-table-column>
<el-table-column prop="mobile" label="手机号" width="110px"></el-table-column>
<el-table-column prop="created_at" label="注册时间" sortable></el-table-column>
<el-table-column prop="last_login_at" label="最后登录" sortable></el-table-column>
<!--<el-table-column prop="last_login_at" label="最后登录时间" width="120px" sortable></el-table-column>-->
<el-table-column prop="baby_name" label="宝宝名称"></el-table-column>
<el-table-column prop="birthday" label="宝宝生日" width="110px"></el-table-column>
<el-table-column prop="sex" label="宝宝性别" width="80px" :formatter="sexFormatter"></el-table-column>
<el-table-column label="操作" width="200px">
<template slot-scope="scope">
<!--<el-button size="mini" plain type="primary" @click="goToDetail(scope.row.user_id)">查看详情</el-button>-->
<router-link :to="{path:'/userDetail', query:{userid: scope.row.user_id}}" target="_blank"><el-button size="mini" plain type="primary">查看详情</el-button></router-link>
<el-button size="mini" v-if="!$store.state.readonly" plain type="warning" @click="userTransfer(scope.row)">用户转移</el-button>
</template>
</el-table-column>
</el-table>
<page :total="total" :limit="limit" @pageChange="onPageChange" @sizeChange="onSizeChange"/>
<detail-dialog :dialogObj="dialogDetailObj" @changeShow="changeShow"/>
<teacher-dialog :dialogObj="dialogObj" @reflash="getUser"></teacher-dialog>
<el-dialog width="90%" top="5vh" :visible.sync="dialogDetail.show">
<div v-if="dialogDetail.show">
<user-detail :parentDetail="dialogDetail"></user-detail>
<!--为了共享user权限-->
<user-detail v-if="inDetail"></user-detail>
<div v-else>
<div class="section-search">
<el-form ref="searchFrom" :model="searchFrom" label-width="80px" inline>
<el-form-item>
<el-input v-model="searchFrom.userId" placeholder="ID" clearable @change="getUser"></el-input>
</el-form-item>
<el-form-item>
<el-input v-model="searchFrom.nickName" placeholder="昵称" clearable @change="getUser"></el-input>
</el-form-item>
<el-form-item>
<el-input v-model="searchFrom.mobile" placeholder="电话" clearable @change="getUser"></el-input>
</el-form-item>
<el-form-item>
<el-input v-model="searchFrom.level" placeholder="等级" clearable @change="getUser"></el-input>
</el-form-item>
<!--<el-form-item label="标签">
<el-cascader
style="width: 320px" placeholder="选择标签" clearable @change="tagChange"
:options="options" :props="{ multiple: true, checkStrictly: true }"></el-cascader>
</el-form-item>-->
<el-form-item>
<div class="flexRow">
<el-button type="primary" plain @click="getUser">搜索</el-button>
<!--<el-button type="success" plain @click="syncUser">同步最新数据</el-button>-->
</div>
</el-form-item>
</el-form>
</div>
</el-dialog>
<!--用户移交-->
<el-dialog append-to-body :visible.sync="addShow" top="5vh" :title="`把 ${userObj.transfer_user_name} 转移为`">
<el-form label-width="90px" inline>
<el-form-item>
<el-input style="width: 160px;" placeholder="ID" @change="getTransferUser" v-model="userObj.searchFrom.userId"></el-input>
</el-form-item>
<el-form-item>
<el-input style="width: 160px;" placeholder="昵称" @change="getTransferUser" v-model="userObj.searchFrom.nickName"></el-input>
</el-form-item>
<el-form-item>
<el-input style="width: 160px;" placeholder="电话" @change="getTransferUser" v-model="userObj.searchFrom.mobile"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" plain @click="getTransferUser">搜索</el-button>
</el-form-item>
</el-form>
<el-table border size="small" :data="userTransferList" ref="multipleTable" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55"></el-table-column>
<el-table
:data="userList"
style="width: 100%">
<el-table-column className="f-c" label="用户">
<template slot-scope="scope">
<img style="margin-right:8px;width: 50px;height: 50px;border-radius: 50px" :src="scope.row.avatar">{{scope.row.nickname}}(ID:{{scope.row.user_id}})
<img class="avatar" :src="scope.row.avatar">{{scope.row.nickname}}<br>(ID:{{scope.row.user_id}})
</template>
</el-table-column>
<el-table-column prop="mobile" label="手机号" width="110px"></el-table-column>
<el-table-column prop="created_at" label="注册时间" sortable></el-table-column>
<el-table-column prop="last_login_at" label="最后登录" sortable></el-table-column>
<!--<el-table-column prop="last_login_at" label="最后登录时间" width="120px" sortable></el-table-column>-->
<el-table-column prop="baby_name" label="宝宝名称"></el-table-column>
<el-table-column prop="birthday" label="宝宝生日" width="110px"></el-table-column>
<el-table-column prop="sex" label="宝宝性别" width="80px" :formatter="sexFormatter"></el-table-column>
<el-table-column label="操作" width="200px">
<template slot-scope="scope">
<!--<el-button size="mini" plain type="primary" @click="goToDetail(scope.row.user_id)">查看详情</el-button>-->
<router-link :to="{path:'/user', query:{type: 'detail', userid: scope.row.user_id}}" target="_blank"><el-button size="mini" plain type="primary">查看详情</el-button></router-link>
<el-button size="mini" v-if="!$store.state.readonly" plain type="warning" @click="userTransfer(scope.row)">用户转移</el-button>
</template>
</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"/>
<span slot="footer" class="dialog-footer">
<page :total="total" :limit="limit" @pageChange="onPageChange" @sizeChange="onSizeChange"/>
<detail-dialog :dialogObj="dialogDetailObj" @changeShow="changeShow"/>
<teacher-dialog :dialogObj="dialogObj" @reflash="getUser"></teacher-dialog>
<el-dialog width="90%" top="5vh" :visible.sync="dialogDetail.show">
<div v-if="dialogDetail.show">
<user-detail :parentDetail="dialogDetail"></user-detail>
</div>
</el-dialog>
<!--用户移交-->
<el-dialog append-to-body :visible.sync="addShow" top="5vh" :title="`把 ${userObj.transfer_user_name} 转移为`">
<el-form label-width="90px" inline>
<el-form-item>
<el-input style="width: 160px;" placeholder="ID" @change="getTransferUser" v-model="userObj.searchFrom.userId"></el-input>
</el-form-item>
<el-form-item>
<el-input style="width: 160px;" placeholder="昵称" @change="getTransferUser" v-model="userObj.searchFrom.nickName"></el-input>
</el-form-item>
<el-form-item>
<el-input style="width: 160px;" placeholder="电话" @change="getTransferUser" v-model="userObj.searchFrom.mobile"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" plain @click="getTransferUser">搜索</el-button>
</el-form-item>
</el-form>
<el-table border size="small" :data="userTransferList" ref="multipleTable" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column className="f-c" label="用户">
<template slot-scope="scope">
<img style="margin-right:8px;width: 50px;height: 50px;border-radius: 50px" :src="scope.row.avatar">{{scope.row.nickname}}(ID:{{scope.row.user_id}})
</template>
</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"/>
<span slot="footer" class="dialog-footer">
<el-button @click="addShow = false">取 消</el-button>
<el-button type="primary" @click="transferSave">确 定</el-button>
</span>
</el-dialog>
</el-dialog>
</div>
</div>
</template>
......@@ -104,6 +110,7 @@
name: "index",
data() {
return {
inDetail: false,
addShow: false,
userTransferList: [],
userObj: {
......@@ -161,8 +168,13 @@
teacherDialog
},
mounted() {
if (this.$route.query.type && this.$route.query.type == 'detail') { // 详情页
this.inDetail = true
} else { // 列表页
this.inDetail = false;
this.getUser();
}
this.$route.query.id ? this.searchFrom.userId = this.$route.query.id : '';
this.getUser();
},
methods: {
userTransfer(row) {
......
......@@ -71,6 +71,10 @@ export const getCallBackApi = function (json) {
// console.log(json, 9001)
return Vue.prototype.$fetch(`${_baseUrl}api/admin/user/visit/${json.user_id}`, json)
};
// 获取上次回访信息
export const getCallBackPrevApi = function (json) {
return Vue.prototype.$fetch(`${_baseUrl}user/last/visit/${json.user_id}`, json)
};
// 添加回访信息
export const postCallBackApi = function (json) {
return Vue.prototype.$post(`${_baseUrl}api/admin/user/visit/${json.user_id}/${json.teacher_id}`, json)
......
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