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

回访信息 修复 权限问题

parent 369f6a74
......@@ -5,13 +5,17 @@
<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.baby_name || '-'}} &emsp;
宝宝生日:{{(callbackObj.detail.birthday == '0000-00-00') ? '-' : callbackObj.detail.birthday}} &emsp;
手机号:{{callbackObj.detail.mobile ? callbackObj.detail.mobile : '--'}} &emsp;
手机号:{{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>-->
<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>
......@@ -20,17 +24,22 @@
微信号:
<span class="callback-edit">
<!--<i v-if="!callbackEdit.wechat.show" @click="editCallback('wechat')">{{callbackObj.detail.wx_number ? callbackObj.detail.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;
<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>
<span style="font-size: 12px; color: #999999; white-space: nowrap">最后更新:{{callbackObj.detail.updated_at || '-'}}</span>
</div>
<div class="callback-item" style="display: flex; align-items: flex-start; margin-bottom: 15px; line-height: 32px;">
......@@ -38,10 +47,11 @@
<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>
<el-button v-if="!$store.state.readonly" type="warning" size="small" plain @click="dialogToggle">编辑标签</el-button>
</div>
<div class="callback-item callback-input" v-if="callbackObj.teacher_id && callbackAdd">
<!--添加回访信息-->
<div 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;">
......
<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