Commit 22f2ba1e authored by 黄奎's avatar 黄奎

页面修改

parent f5b46909
......@@ -111,6 +111,10 @@
sticky: {
type: String,
default: ""
},
loading: {
type: Boolean,
default: false,
}
},
components: {
......@@ -134,7 +138,7 @@
},
{
name: "CategoryName",
label: "同名称",
label: "同名称",
field: "CategoryName",
align: "left"
},
......@@ -231,9 +235,9 @@
this.getEmployeeList();
},
mounted() {
if(this.dataList&&this.dataList.length>0){
this.dataList.forEach(x=>{
if(x.CustomerType==4){
if (this.dataList && this.dataList.length > 0) {
this.dataList.forEach(x => {
if (x.CustomerType == 4) {
x.CategoryName = x.EnterpriseName
}
})
......
......@@ -10,8 +10,8 @@
</style>
<template>
<div class="b2bcustomlist">
<q-table :pagination="pageMsg" :loading="loading" no-data-label="暂无相关数据" flat
class="sticky-column-table" separator="none" :data="dataList" :columns="columns" row-key="CustomerId">
<q-table :pagination="pageMsg" :loading="loading" no-data-label="暂无相关数据" flat class="sticky-column-table"
separator="none" :data="dataList" :columns="columns" row-key="CustomerId">
<template v-slot:top>
<q-space />
<div class="page-option">
......@@ -41,8 +41,10 @@
</template>
<template v-slot:body-cell-optioned="props">
<q-td :props="props">
<q-btn flat size="xs" icon="edit" color="accent" @click="EditCustom(props.row)" style="font-weight:400" label="修改" />
<q-btn flat size="xs" icon="delete" @click="RemoveCustomer(props.row)" color="negative" style="font-weight:400" label="删除" />
<q-btn flat size="xs" icon="edit" color="accent" @click="EditCustom(props.row)" style="font-weight:400"
label="修改" />
<q-btn flat size="xs" icon="delete" @click="RemoveCustomer(props.row)" color="negative"
style="font-weight:400" label="删除" />
</q-td>
</template>
<template v-slot:bottom>
......@@ -52,7 +54,8 @@
<categoryEdit-form v-if="isShowCategoryForm" :customerObj="customerObj" @close="closeCustomForm"
@success="refreshQuestion">
</categoryEdit-form>
<peerRight v-if="isShowDetailForm" :CategoryId="CategoryId" @close="closeCustomForm" :auth="AuthorityObj" @success="refreshQuestion"></peerRight>
<peerRight v-if="isShowDetailForm" :CategoryId="CategoryId" @close="closeCustomForm" :auth="AuthorityObj"
@success="refreshQuestion"></peerRight>
</div>
</template>
<script>
......@@ -66,6 +69,10 @@
dataList: {
type: Array,
default: null
},
loading: {
type: Boolean,
default: false,
}
},
components: {
......@@ -127,7 +134,7 @@
loading: false,
isShowCategoryForm: false,
customerObj: null, //传入参数
tabId:1,
tabId: 1,
//权限设置
AuthorityObj: {
isShowEdit: false, //是否显示新增修改按钮
......@@ -135,15 +142,14 @@
isShowBankBook: false, //是否显示幸福存折
isShowRebate: false //是否显示返佣
},
isShowDetailForm:false,
CategoryId:0
isShowDetailForm: false,
CategoryId: 0
};
},
created() {
},
mounted() {
},
mounted() {},
methods: {
//新增或者修改客户
EditCustom(obj) {
......
......@@ -139,7 +139,7 @@
:options="customList" class="col-6 q-pr-lg q-pb-lg" v-model="objOption.CategoryId" clearable emit-value map-options />
<template v-if="objOption.CustomerType!=4">
<div class="col-6" v-if="!isShowEdit">
<q-btn label="立即添加" @click="isShowEdit=true" size="sm" color="primary" />
<q-btn label="立即添加同行" @click="isShowEdit=true" size="sm" color="primary" />
</div>
<div class="col-6" v-if="isShowEdit" style="position:relative">
<q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.CategoryName" lazy-rules
......
<style lang="scss">
.stuList .q-table__bottom {
min-height: 0;
}
.stulistNum {
display: inline-block;
width: 25px;
height: 25px;
text-align: center;
line-height: 23px;
border: 1px solid #2961fe;
border-radius: 50%;
cursor: pointer;
color: #2961fe;
}
.stuListTable {
width: 200px;
text-align: center;
}
.stuList .q-table__bottom {
min-height: 0;
}
.stulistNum {
display: inline-block;
width: 25px;
height: 25px;
text-align: center;
line-height: 23px;
border: 1px solid #2961fe;
border-radius: 50%;
cursor: pointer;
color: #2961fe;
}
.stuListTable tr td {
height: 40px;
}
.stuListTable {
width: 200px;
text-align: center;
}
.stuListTable tr td {
height: 40px;
}
.stuListTable tr th {
height: 40px;
background-color: rgb(238, 238, 239);
}
.stuListTable tr th {
height: 40px;
background-color: rgb(238, 238, 239);
}
</style>
<template>
<div class="stuList">
<q-table
:pagination="pageMsg"
:loading="loading"
no-data-label="暂无相关数据"
flat
:selection="pushMode ? 'multiple' : 'single'"
:selected.sync="selection"
class="sticky-right-column-table sticky-tow-column-table"
separator="none"
:data="dataList"
:columns="columns"
row-key="StuId"
hide-bottom
>
<q-table :pagination="pageMsg" :loading="loading" no-data-label="暂无相关数据" flat
:selection="pushMode ? 'multiple' : 'single'" :selected.sync="selection"
class="sticky-right-column-table sticky-tow-column-table" separator="none" :data="dataList" :columns="columns"
row-key="StuId" hide-bottom>
<template v-slot:top>
<div class="col-2 q-table__title">学员信息</div>
<q-space />
<div class="page-option" v-if="!pushMode">
<q-btn
color="accent"
outline
class="q-mr-md"
size="sm"
icon="swap_horiz"
label="推送课程顾问"
v-if="userInfo.IsCourseConsultant == 0"
@click="pushMode = true"
/>
<q-btn
color="accent"
class="q-mr-md"
size="sm"
icon="swap_horiz"
label="转订单"
:disable="selection.length === 0"
@click="transferOrder"
/>
<q-btn
color="accent"
class="q-mr-md"
size="sm"
icon="add"
label="新增学员"
@click="EditStudent(null)"
/>
<q-btn color="accent" outline class="q-mr-md" size="sm" icon="swap_horiz" label="推送课程顾问"
v-if="userInfo.IsCourseConsultant == 0" @click="pushMode = true" />
<q-btn color="accent" class="q-mr-md" size="sm" icon="swap_horiz" label="转订单"
:disable="selection.length === 0" @click="transferOrder" />
<q-btn color="accent" class="q-mr-md" size="sm" icon="add" label="新增学员" @click="EditStudent(null)" />
</div>
<div class="page-option" v-if="pushMode">
<q-btn
color="accent"
unelevated
class="q-mr-md"
size="sm"
icon="swap_horiz"
label="立即推送"
:loading="pushing"
@click="assistBatchHandler"
/>
<q-btn
color="accent"
outline
size="sm"
label="退出"
:disable="pushing"
@click="
<q-btn color="accent" unelevated class="q-mr-md" size="sm" icon="swap_horiz" label="立即推送" :loading="pushing"
@click="assistBatchHandler" />
<q-btn color="accent" outline size="sm" label="退出" :disable="pushing" @click="
pushMode = false;
selection = [];
"
/>
" />
</div>
</template>
<template v-slot:body-cell-StuIcon="props">
......@@ -104,14 +59,8 @@
<q-avatar size="md" v-if="props.value">
<img :src="props.value" />
</q-avatar>
<q-avatar
size="md"
color="teal-10"
text-color="white"
v-if="!props.value"
>
{{ props.row.StuName.substring(0, 1) }}</q-avatar
>
<q-avatar size="md" color="teal-10" text-color="white" v-if="!props.value">
{{ props.row.StuName.substring(0, 1) }}</q-avatar>
</q-td>
</template>
<template v-slot:body-cell-StuName="props">
......@@ -123,37 +72,25 @@
</template>
<template v-slot:body-cell-StuSex="props">
<q-td :props="props">
<q-badge
:color="props.value == 1 ? 'negative' : 'primary'"
:label="props.value == 1 ? '女' : '男'"
/>
<q-badge :color="props.value == 1 ? 'negative' : 'primary'" :label="props.value == 1 ? '女' : '男'" />
</q-td>
</template>
<template v-slot:body-cell-StuSourceIdName="props">
<q-td :props="props">
<div>
<span v-if="props.row.CreateType == 2 && props.row.EnterpriseName">{{props.row.EnterpriseName}}:</span>
{{ props.row.StuSourceIdName }}
</div>
</q-td>
</template>
<template v-slot:body-cell-StuSourceIdName="props">
<q-td :props="props">
<div>
<span v-if="props.row.CreateType == 2 && props.row.EnterpriseName">{{props.row.EnterpriseName}}:</span>
{{ props.row.StuSourceIdName }}
</div>
</q-td>
</template>
<template v-slot:body-cell-CurseManager="props">
<q-td :props="props" v-html="getCurseManager(props.row)"></q-td>
</template>
<template v-slot:body-cell-OrderCount="props">
<q-td
:props="props"
v-if="props.row.OrderCount == 0"
class="text-grey-4"
>未报名</q-td
>
<q-td
:props="props"
v-if="props.row.OrderCount > 0"
class="bg-negative text-white"
>已报名{{ props.row.OrderCount }}</q-td
>
<q-td :props="props" v-if="props.row.OrderCount == 0" class="text-grey-4">未报名</q-td>
<q-td :props="props" v-if="props.row.OrderCount > 0" class="bg-negative text-white">
已报名{{ props.row.OrderCount }}</q-td>
</template>
<template v-slot:body-cell-TeacherManager="props">
<q-td :props="props" v-html="getTeacherManager(props.row)"></q-td>
......@@ -171,21 +108,14 @@
<q-popup-proxy>
<q-banner>
<div style="max-height:600px;overflow-y:auto;">
<table
class="stuListTable"
style="border-collapse:collapse;"
>
<table class="stuListTable" style="border-collapse:collapse;">
<tr>
<th>角色</th>
<th>协同人</th>
</tr>
<tr
v-for="(sItem, sIndex) in assistListFormat[
<tr v-for="(sItem, sIndex) in assistListFormat[
props.pageIndex
]"
style="border-bottom:1px dashed #d1d1d1;"
:key="sIndex"
>
]" style="border-bottom:1px dashed #d1d1d1;" :key="sIndex">
<td>{{ sItem.AssistTypeName }}</td>
<td>{{ sItem.AssistName }}</td>
</tr>
......@@ -207,271 +137,324 @@
</q-td>
</template> -->
</q-table>
<student-form
v-if="isShowStuForm"
:save-obj="stuOption"
@close="closeStuForm"
@success="refreshStuList"
>
<student-form v-if="isShowStuForm" :save-obj="stuOption" @close="closeStuForm" @success="refreshStuList">
</student-form>
<studentRight-form
v-if="isShowStuRight"
:isJudgeTrans="isJudgeTrans"
:BelongType="BelongType"
:save-obj="stuOption"
@close="closeStuForm"
@success="refreshStuList"
@reload="referDataHandler"
>
<studentRight-form v-if="isShowStuRight" :isJudgeTrans="isJudgeTrans" :BelongType="BelongType" :save-obj="stuOption"
@close="closeStuForm" @success="refreshStuList" @reload="referDataHandler">
</studentRight-form>
<studentAdd-form
v-if="isShowAdd"
:save-obj="stuOption"
@close="closeStuForm"
@success="refreshStuList"
>
<studentAdd-form v-if="isShowAdd" :save-obj="stuOption" @close="closeStuForm" @success="refreshStuList">
</studentAdd-form>
<transfer-order
v-if="isShowTransfer"
:select="selection"
@close="closeStuForm"
@success="refreshStuList"
>
<transfer-order v-if="isShowTransfer" :select="selection" @close="closeStuForm" @success="refreshStuList">
</transfer-order>
</div>
</template>
<script>
import studentForm from "./student-form";
import studentRightForm from "./studentRight-form";
import studentAddForm from "./studentAdd-form";
import transferOrder from "./transfer-order";
import { mapGetters } from "vuex";
import { SetStudentAssistBatch } from "../../../api/sale/sale";
export default {
props: {
dataList: {
type: Array,
default: null
import studentForm from "./student-form";
import studentRightForm from "./studentRight-form";
import studentAddForm from "./studentAdd-form";
import transferOrder from "./transfer-order";
import {
mapGetters
} from "vuex";
import {
SetStudentAssistBatch
} from "../../../api/sale/sale";
export default {
props: {
dataList: {
type: Array,
default: null
},
isJudgeTrans: {
type: Number,
default: null
},
loading: {
type: Boolean,
default: false,
}
},
isJudgeTrans: {
type: Number,
default: null
}
},
components: {
studentForm,
studentRightForm,
studentAddForm,
transferOrder
},
data() {
return {
columns: [
{
name: "StuIcon",
label: "",
field: "StuIcon",
align: "left"
},
{
name: "StuName",
required: true,
label: "昵称",
align: "left",
field: row => row.StuName
},
{
name: "CurseManager",
label: "课程顾问",
align: "left"
},
{
name: "TeacherManager",
label: "协助老师",
align: "left"
},
{
name: "OrderCount",
label: "是否报名",
align: "left"
},
{
name: "StuSex",
label: "性别",
field: "StuSex",
align: "left"
},
{
name: "StuTel",
label: "电话",
field: "StuTel",
align: "left"
},
{
name: "QQ",
label: "QQ",
field: "QQ",
align: "left"
},
{
name: "WeChatNo",
label: "微信",
field: "WeChatNo",
align: "left"
},
{
name: "StuTypeName",
label: "客户类型",
field: "StuTypeName",
align: "left"
},
{
name: "StuStageName",
label: "客户阶段",
field: "StuStageName",
align: "left"
},
{
name: "StuNeedsName",
label: "客户需求",
field: "StuNeedsName",
align: "left"
},
{
name: "StuProfession",
label: "职业",
field: "StuProfession",
align: "left"
},
{
name: "StuEducationName",
label: "学历",
field: "StuEducationName",
align: "left"
},
{
name: "StuPurposeName",
label: "目的",
field: "StuPurposeName",
align: "left"
},
{
name: "AssistList",
label: "其他服务人员",
align: "left",
field: "AssistList"
},
{
name: "CreateTypeStr",
label: "客户来源",
field: "CreateTypeStr",
align: "left"
},
{
name: "StuSourceIdName",
label: "来源关联人",
field: "StuSourceIdName",
align: "left"
},
{
name: "StuChannelName",
label: "收客渠道",
field: "StuChannelName",
align: "left"
},
{
name: "VisitCount",
label: "到访次数",
field: "VisitCount",
align: "left"
},
{
name: "TrialLessonCount",
label: "试听次数",
field: "TrialLessonCount",
align: "left"
components: {
studentForm,
studentRightForm,
studentAddForm,
transferOrder
},
data() {
return {
columns: [{
name: "StuIcon",
label: "",
field: "StuIcon",
align: "left"
},
{
name: "StuName",
required: true,
label: "昵称",
align: "left",
field: row => row.StuName
},
{
name: "CurseManager",
label: "课程顾问",
align: "left"
},
{
name: "TeacherManager",
label: "协助老师",
align: "left"
},
{
name: "OrderCount",
label: "是否报名",
align: "left"
},
{
name: "StuSex",
label: "性别",
field: "StuSex",
align: "left"
},
{
name: "StuTel",
label: "电话",
field: "StuTel",
align: "left"
},
{
name: "QQ",
label: "QQ",
field: "QQ",
align: "left"
},
{
name: "WeChatNo",
label: "微信",
field: "WeChatNo",
align: "left"
},
{
name: "StuTypeName",
label: "客户类型",
field: "StuTypeName",
align: "left"
},
{
name: "StuStageName",
label: "客户阶段",
field: "StuStageName",
align: "left"
},
{
name: "StuNeedsName",
label: "客户需求",
field: "StuNeedsName",
align: "left"
},
{
name: "StuProfession",
label: "职业",
field: "StuProfession",
align: "left"
},
{
name: "StuEducationName",
label: "学历",
field: "StuEducationName",
align: "left"
},
{
name: "StuPurposeName",
label: "目的",
field: "StuPurposeName",
align: "left"
},
{
name: "AssistList",
label: "其他服务人员",
align: "left",
field: "AssistList"
},
{
name: "CreateTypeStr",
label: "客户来源",
field: "CreateTypeStr",
align: "left"
},
{
name: "StuSourceIdName",
label: "来源关联人",
field: "StuSourceIdName",
align: "left"
},
{
name: "StuChannelName",
label: "收客渠道",
field: "StuChannelName",
align: "left"
},
{
name: "VisitCount",
label: "到访次数",
field: "VisitCount",
align: "left"
},
{
name: "TrialLessonCount",
label: "试听次数",
field: "TrialLessonCount",
align: "left"
},
{
name: "CreateTimeStr",
label: "创建时间",
field: "CreateTimeStr",
align: "left"
},
{
name: "CreateByName",
label: "负责人",
align: "left",
field: "CreateByName"
}
// {
// name: "CustomerName",
// label: "所属同行",
// field: "CustomerName",
// align: "left"
// }
],
pageMsg: {
rowsPerPage: 12
},
{
name: "CreateTimeStr",
label: "创建时间",
field: "CreateTimeStr",
align: "left"
loading: false,
isShowStuForm: false,
resetLoading: false,
isShowStuRight: false,
stuOption: null,
isShowAdd: false,
selection: [],
isShowTransfer: false,
BelongType: 1,
pushMode: false,
pushing: false,
assistListFormat: []
};
},
watch: {
dataList: {
handler(val) {
this.selection = [];
this.formatAssistList();
},
{
name: "CreateByName",
label: "负责人",
align: "left",
field: "CreateByName"
}
// {
// name: "CustomerName",
// label: "所属同行",
// field: "CustomerName",
// align: "left"
// }
],
pageMsg: {
rowsPerPage: 12
deep: true
}
},
created() {
this.formatAssistList();
this.initAuth();
},
mounted() {},
computed: {
...mapGetters(["userInfo", "logo", "name"])
},
methods: {
//初始化权限
initAuth() {},
formatAssistList() {
this.assistListFormat = [];
this.dataList.forEach(x => {
let tempArr = [];
if (x.AssistList && x.AssistList.length > 0) {
x.AssistList.forEach(y => {
if (y.AssistType != 2 && y.AssistType != 4) {
tempArr.push(y);
}
});
}
this.assistListFormat.push(tempArr);
});
},
loading: false,
isShowStuForm: false,
resetLoading: false,
isShowStuRight: false,
stuOption: null,
isShowAdd: false,
selection: [],
isShowTransfer: false,
BelongType: 1,
pushMode: false,
pushing: false,
assistListFormat: []
};
},
watch: {
dataList: {
handler(val) {
this.selection = [];
this.formatAssistList();
//创建账号
createAccount(id) {
let that = this;
createStudentAccount({
StuId: id
}).then(res => {
that.$q
.dialog({
title: "创建账号",
message: res.Message,
persistent: true,
ok: {
label: "确认",
flat: true,
focus: true
}
})
.onOk(() => {
that.getStudent();
})
.onCancel(() => {
that.getStudent();
});
});
},
deep: true
}
},
created() {
this.formatAssistList();
this.initAuth();
},
mounted() {},
computed: {
...mapGetters(["userInfo", "logo", "name"])
},
methods: {
//初始化权限
initAuth() {},
formatAssistList() {
this.assistListFormat = [];
this.dataList.forEach(x => {
let tempArr = [];
if (x.AssistList && x.AssistList.length > 0) {
x.AssistList.forEach(y => {
if (y.AssistType != 2 && y.AssistType != 4) {
tempArr.push(y);
resetPw(id) {
let that = this;
this.$q
.dialog({
title: "重置密码",
message: "你正在进行重置密码行为,是否确认执行",
persistent: true,
cancel: {
label: "取消",
flat: true
},
ok: {
label: "确认重置",
flat: true,
focus: true
}
})
.onOk(() => {
that.resetLoading = true;
resetPassword({
AccountType: 4,
AccountId: id
})
.then(res => {
that.resetLoading = false;
that.$q.dialog({
title: "密码重置成功",
message: res.Message,
persistent: true,
ok: {
label: "确认",
flat: true,
focus: true
}
});
})
.catch(() => {
that.resetLoading = false;
});
});
}
this.assistListFormat.push(tempArr);
});
},
//创建账号
createAccount(id) {
let that = this;
createStudentAccount({
StuId: id
}).then(res => {
that.$q
},
//删除客户资料
deleteStudentInfo(obj) {
let that = this;
var str = obj.Status == 1 ? "【禁用】" : "【启用】";
this.$q
.dialog({
title: "创建账号",
message: res.Message,
title: str + "学员",
message: "你正在进行" + str + "学员行为,一旦执行无法找回,是否确认执行?",
persistent: true,
cancel: {
label: "取消",
flat: true
},
ok: {
label: "确认",
flat: true,
......@@ -479,202 +462,133 @@ export default {
}
})
.onOk(() => {
that.getStudent();
that.resetLoading = true;
deleteStudent({
StuId: obj.StuId,
Status: obj.Status
}).then(res => {
this.$q.notify({
icon: "iconfont icon-chenggong",
color: "accent",
timeout: 2000,
message: "数据操作成功!",
position: "top"
});
this.getStudent();
});
})
.onCancel(() => {
that.getStudent();
obj.Status = obj.Status == 1 ? 0 : 1;
});
});
},
resetPw(id) {
let that = this;
this.$q
.dialog({
title: "重置密码",
message: "你正在进行重置密码行为,是否确认执行",
persistent: true,
cancel: {
label: "取消",
flat: true
},
ok: {
label: "确认重置",
flat: true,
focus: true
}
})
.onOk(() => {
that.resetLoading = true;
resetPassword({
AccountType: 4,
AccountId: id
})
.then(res => {
that.resetLoading = false;
that.$q.dialog({
title: "密码重置成功",
message: res.Message,
persistent: true,
ok: {
label: "确认",
flat: true,
focus: true
},
refreshStuList() {
this.$emit("success");
this.selection = [];
},
EditStudent(obj) {
if (obj) {
this.stuOption = obj;
} else {
this.stuOption = null;
}
this.isShowAdd = true;
},
closeStuForm() {
this.isShowStuForm = false;
this.isShowStuRight = false;
this.isShowAdd = false;
this.isShowTransfer = false;
},
//点击学生姓名弹出
getStuRight(obj) {
if (obj) {
this.stuOption = obj;
this.BelongType = obj.BelongType;
} else {
this.stuOption = null;
}
this.isShowStuRight = true;
},
transferOrder() {
const firstId = this.selection[0].CustomerId;
const flag = this.selection.every(e => {
return e.CustomerId == firstId;
});
if (!flag) {
this.$q.notify({
type: "negative",
position: "top",
message: `所属同行不一致,请重新选择`
});
return;
}
this.isShowTransfer = true;
},
getCurseManager(row) {
let managerName = "<span class='text-grey-4'>暂未推送</span>";
if (row.AssistList && row.AssistList.length > 0) {
row.AssistList.forEach(y => {
if (y.AssistType == 2) {
managerName = `<span class='text-dark'>${y.AssistName}</span>`;
}
});
}
return managerName;
},
getTeacherManager(row) {
let managerName = "<span class='text-grey-4'>暂无</span>";
if (row.AssistList && row.AssistList.length > 0) {
row.AssistList.forEach(y => {
if (y.AssistType == 4) {
managerName = `<span class='text-dark'>${y.AssistName}</span>`;
}
});
}
return managerName;
},
assistBatchHandler() {
if (this.pushing) return;
this.pushing = true;
if (this.selection.length > 0) {
let msg = "";
let parameter = {
stuIds: ""
};
this.selection.forEach(x => {
parameter.stuIds += "," + x.StuId;
if (x.AssistList && x.AssistList.length > 0) {
x.AssistList.forEach(y => {
if (y.AssistType == 2) {
msg = `客户${x.StuName}:已存在课程顾问:${y.AssistName},无法再次推送。`;
}
});
})
.catch(() => {
that.resetLoading = false;
});
});
},
//删除客户资料
deleteStudentInfo(obj) {
let that = this;
var str = obj.Status == 1 ? "【禁用】" : "【启用】";
this.$q
.dialog({
title: str + "学员",
message:
"你正在进行" + str + "学员行为,一旦执行无法找回,是否确认执行?",
persistent: true,
cancel: {
label: "取消",
flat: true
},
ok: {
label: "确认",
flat: true,
focus: true
}
})
.onOk(() => {
that.resetLoading = true;
deleteStudent({
StuId: obj.StuId,
Status: obj.Status
}).then(res => {
this.$q.notify({
icon: "iconfont icon-chenggong",
color: "accent",
timeout: 2000,
message: "数据操作成功!",
position: "top"
});
this.getStudent();
}
});
})
.onCancel(() => {
obj.Status = obj.Status == 1 ? 0 : 1;
});
},
refreshStuList() {
this.$emit("success");
this.selection = [];
},
EditStudent(obj) {
if (obj) {
this.stuOption = obj;
} else {
this.stuOption = null;
}
this.isShowAdd = true;
},
closeStuForm() {
this.isShowStuForm = false;
this.isShowStuRight = false;
this.isShowAdd = false;
this.isShowTransfer = false;
},
//点击学生姓名弹出
getStuRight(obj) {
if (obj) {
this.stuOption = obj;
this.BelongType = obj.BelongType;
} else {
this.stuOption = null;
}
this.isShowStuRight = true;
},
transferOrder() {
const firstId = this.selection[0].CustomerId;
const flag = this.selection.every(e => {
return e.CustomerId == firstId;
});
if (!flag) {
this.$q.notify({
type: "negative",
position: "top",
message: `所属同行不一致,请重新选择`
});
return;
}
this.isShowTransfer = true;
},
getCurseManager(row) {
let managerName = "<span class='text-grey-4'>暂未推送</span>";
if (row.AssistList && row.AssistList.length > 0) {
row.AssistList.forEach(y => {
if (y.AssistType == 2) {
managerName = `<span class='text-dark'>${y.AssistName}</span>`;
}
});
}
return managerName;
},
getTeacherManager(row) {
let managerName = "<span class='text-grey-4'>暂无</span>";
if (row.AssistList && row.AssistList.length > 0) {
row.AssistList.forEach(y => {
if (y.AssistType == 4) {
managerName = `<span class='text-dark'>${y.AssistName}</span>`;
}
});
}
return managerName;
},
assistBatchHandler() {
if (this.pushing) return;
this.pushing = true;
if (this.selection.length > 0) {
let msg = "";
let parameter = {
stuIds: ""
};
this.selection.forEach(x => {
parameter.stuIds += "," + x.StuId;
if (x.AssistList && x.AssistList.length > 0) {
x.AssistList.forEach(y => {
if (y.AssistType == 2) {
msg = `客户${x.StuName}:已存在课程顾问:${y.AssistName},无法再次推送。`;
}
if (msg == "") {
SetStudentAssistBatch(parameter).then(r => {
this.$emit("reload");
this.selection = [];
this.pushMode = false;
});
} else {
this.pushing = false;
this.errorMsg(msg);
}
});
if (msg == "") {
SetStudentAssistBatch(parameter).then(r => {
this.$emit("reload");
this.selection = [];
this.pushMode = false;
});
} else {
this.pushing = false;
this.errorMsg(msg);
this.errorMsg("请选择要推送的学员");
}
} else {
this.pushing = false;
this.errorMsg("请选择要推送的学员");
},
referDataHandler() {
this.$emit("reload");
},
errorMsg(msg) {
this.$q.notify({
type: "negative",
position: "top",
message: msg
});
}
},
referDataHandler() {
this.$emit("reload");
},
errorMsg(msg) {
this.$q.notify({
type: "negative",
position: "top",
message: msg
});
}
}
};
</script>
};
</script>
\ No newline at end of file
......@@ -28,7 +28,7 @@
<q-input @input="resetSearch" filled clearable v-model="msg.CustomerName" label="联系人" maxlength="20" />
</div>
<div class="col-3">
<q-input @input="resetSearch" filled clearable v-model="msg.CategoryName" label="同名称" maxlength="20" />
<q-input @input="resetSearch" filled clearable v-model="msg.CategoryName" label="同名称" maxlength="20" />
</div>
<div class="col-3">
<q-input @input="resetSearch" filled clearable v-model="msg.ContactNumber" label="电话" maxlength="20" />
......
......@@ -28,7 +28,7 @@
<q-input @input="resetSearch" filled clearable v-model="msg.CustomerName" label="联系人" maxlength="20" />
</div>
<div class="col-3">
<q-input @input="resetSearch" filled clearable v-model="msg.CategoryName" label="同名称" maxlength="20" />
<q-input @input="resetSearch" filled clearable v-model="msg.CategoryName" label="同名称" maxlength="20" />
</div>
<div class="col-3">
<q-input @input="resetSearch" filled clearable v-model="msg.ContactNumber" label="电话" maxlength="20" />
......
......@@ -3,96 +3,33 @@
<div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3">
<q-input
@keyup.enter.native="resetSearch"
dense
clearable
filled
v-model="msg.StuName"
label="昵称"
maxlength="20"
/>
<q-input @keyup.enter.native="resetSearch" dense clearable filled v-model="msg.StuName" label="昵称"
maxlength="20" />
</div>
<div class="col-3">
<q-input
@keyup.enter.native="resetSearch"
dense
clearable
filled
v-model="msg.StuTel"
label="电话"
maxlength="20"
/>
<q-input @keyup.enter.native="resetSearch" dense clearable filled v-model="msg.StuTel" label="电话"
maxlength="20" />
</div>
<div class="col-3">
<q-input
@keyup.enter.native="resetSearch"
dense
clearable
filled
v-model="msg.QQ"
label="QQ"
maxlength="20"
/>
<q-input @keyup.enter.native="resetSearch" dense clearable filled v-model="msg.QQ" label="QQ"
maxlength="20" />
</div>
<div class="col-3">
<q-input
@keyup.enter.native="resetSearch"
dense
clearable
filled
v-model="msg.WechatNo"
label="微信号"
maxlength="20"
/>
<q-input @keyup.enter.native="resetSearch" dense clearable filled v-model="msg.WechatNo" label="微信号"
maxlength="20" />
</div>
<div class="col-3">
<q-select
@input="resetSearch"
filled
v-model="msg.StuType"
dense
clearable
:options="customTypeList"
option-label="Name"
option-value="Id"
emit-value
map-options
label="客户类型"
/>
<q-select @input="resetSearch" filled v-model="msg.StuType" dense clearable :options="customTypeList"
option-label="Name" option-value="Id" emit-value map-options label="客户类型" />
</div>
<div class="col-3">
<q-select
@input="resetSearch"
dense
filled
v-model="msg.StuStage"
:options="customState"
option-label="Name"
option-value="Id"
emit-value
map-options
label="客户状态"
clearable
/>
<q-select @input="resetSearch" dense filled v-model="msg.StuStage" :options="customState" option-label="Name"
option-value="Id" emit-value map-options label="客户状态" clearable />
</div>
<div class="col-3">
<q-select
@input="resetSearch"
dense
v-model="msg.CustomerId"
:options="myCustomerList"
filled
use-input
label="同行"
option-label="CustomerName"
option-value="CustomerId"
ref="CustomerName"
class="col-6"
emit-value
map-options
@filter="cusfilterFn"
>
<q-select @input="resetSearch" dense v-model="msg.CustomerId" :options="myCustomerList" filled use-input
label="同行" option-label="CustomerName" option-value="CustomerId" ref="CustomerName" class="col-6" emit-value
map-options @filter="cusfilterFn">
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
......@@ -103,384 +40,304 @@
</q-select>
</div>
<div class="col-3">
<q-select
@input="resetBelong"
dense
filled
option-value="Id"
option-label="Name"
v-model="msg.BelongType"
:options="BelongTypeList"
emit-value
map-options
label="归属类型"
/>
<q-select @input="resetBelong" dense filled option-value="Id" option-label="Name" v-model="msg.BelongType"
:options="BelongTypeList" emit-value map-options label="归属类型" />
</div>
<div class="col-3">
<q-field filled dense>
<template v-slot:control>
<el-date-picker
v-model="dateArray"
size="mini"
@change="resetSearch"
value-format="yyyy-MM-dd"
type="daterange"
style="border:none;"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
/>
<el-date-picker v-model="dateArray" size="mini" @change="resetSearch" value-format="yyyy-MM-dd"
type="daterange" style="border:none;" range-separator="至" start-placeholder="开始时间"
end-placeholder="结束时间" />
</template>
</q-field>
</div>
<div class="col-3">
<q-select
@input="resetSearch"
dense
filled
clearable
use-input
option-value="Id"
option-label="Name"
v-model="msg.ExistCourseConsultant"
:options="consultantList"
emit-value
map-options
label="是否推送程顾问"
/>
<q-select @input="resetSearch" dense filled clearable use-input option-value="Id" option-label="Name"
v-model="msg.ExistCourseConsultant" :options="consultantList" emit-value map-options label="是否推送程顾问" />
</div>
<div class="col-3" v-if="msg.BelongType == 4">
<q-select
@input="resetSearch"
dense
clearable
@filter="filterSubord"
use-input
filled
option-value="Id"
option-label="EmployeeName"
v-model="msg.CreateIds"
multiple
:options="SubordList"
emit-value
map-options
label="我下属的"
/>
<q-select @input="resetSearch" dense clearable @filter="filterSubord" use-input filled option-value="Id"
option-label="EmployeeName" v-model="msg.CreateIds" multiple :options="SubordList" emit-value map-options
label="我下属的" />
</div>
<!-- <div class="col-3">
<q-select
@input="resetSearch"
dense
clearable
filled
option-value="Id"
option-label="Name"
v-model="msg.CreateType"
:options="customFromList"
emit-value
map-options
label="客户来源"
/>
</div>
<div class="col-3">
<q-select filled v-model="msg.StuChannel" @input="resetSearch" label="收客渠道" dense :options="StuChannelList" option-label="Name" option-value="Id" emit-value map-options use-input clearable
@filter="filterStuChannel">
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
未找到相关数据
</q-item-section>
</q-item>
</template>
</q-select>
</div> -->
</div>
</div>
<div class="page-content">
<stulist
:dataList="data"
@reload="getStudent"
@success="refreshPage"
ref="stuList"
:isJudgeTrans="isJudgeTrans"
>
<stulist :dataList="data" @reload="getStudent" @success="refreshPage" :loading="loading" ref="stuList" :isJudgeTrans="isJudgeTrans">
</stulist>
<div class="row" style="justify-content: flex-end;padding: 5px 20px">
<q-pagination
v-model="msg.pageIndex"
:max="pageCount"
@input="changePage"
class="full-width justify-end"
color="primary"
:input="true"
>
<q-pagination v-model="msg.pageIndex" :max="pageCount" @input="changePage" class="full-width justify-end"
color="primary" :input="true">
</q-pagination>
</div>
</div>
</div>
</template>
<script>
import {
getStudentPage,
getSchoolDropdown,
deleteStudent,
createStudentAccount,
queryStuStageList,
GetStudentTypeList,
GetPersonalDimension
} from "../../api/school/index";
import { queryEmployee } from "../../api/users/user";
import { resetPassword } from "../../api/users/user.js";
import {
getStudentPage,
getSchoolDropdown,
deleteStudent,
createStudentAccount,
queryStuStageList,
GetStudentTypeList,
GetPersonalDimension
} from "../../api/school/index";
import {
queryEmployee
} from "../../api/users/user";
import {
resetPassword
} from "../../api/users/user.js";
import stulist from "../../components/school/student/stulist";
import {
getMyCustomerList,
CreateTypeList,
GetStuChannelList
} from "../../api/sale/sale";
import { mapGetters } from "vuex";
export default {
meta: {
title: "客户管理"
},
components: {
stulist
},
data() {
return {
currentUrl: "",
data: [],
loading: true,
msg: {
pageIndex: 1,
pageSize: 12,
rowsPerPage: 12,
BelongType: 1,
StuName: "",
StuTel: "",
Status: "-1",
CreateBy: "",
IsQueryMyStu: 1,
StuStage: "", //客户阶段
StartTime: "", //开始时间
EndTime: "", //结束时间
CustomerId: 0,
QQ: "",
WechatNo: "",
StuType: "",
CreateIds: [],
ExistCourseConsultant: "", //是否存在课程顾问(1-存在,2=不存在)
// CreateType:'', //客户来源
// StuChannel: "" //收客渠道
},
dateArray: [], //日期数组
pageCount: 0,
//客户阶段状态列表
customState: [],
myCustomerList: [], //同行列表
allCustomerList: [], //所有同行列表
customTypeList: [], //客户类型
//归属类型列表
BelongTypeList: [
{
Id: 1,
Name: "全部"
},
{
Id: 2,
Name: "我负责的"
},
{
Id: 3,
Name: "我协同的"
},
{
Id: 4,
Name: "我下属的"
}
],
//课程顾问
consultantList: [
{
Id: 1,
Name: "是"
},
{
Id: 2,
Name: "否"
}
],
isJudgeTrans: 1, //用于判断转交是否有条件
SubordList: [], //我的下属数据
AllSubordList: [],
customFromList: [], //客户来源
StuChannelList: [], //收客渠道
allStuChannelList: [], //所有收客渠道
};
},
created() {
this.getSchool();
this.getStuStageList();
this.getCustomTypeList();
this.GetSubordList();
},
mounted() {
this.currentUrl = this.$route.path;
this.getStudent();
this.getCustomerList();
this.getCustomFrom();
this.GetStuChannelList();
},
computed: {
...mapGetters(["userInfo"])
},
methods: {
//获取收客渠道
GetStuChannelList() {
GetStuChannelList({}).then(res => {
if (res.Code == 1) {
this.StuChannelList = res.Data;
this.allStuChannelList = res.Data;
}
});
},
//筛选渠道
filterStuChannel(val, update) {
update(() => {
if (val === "") {
this.StuChannelList = JSON.parse(
JSON.stringify(this.allStuChannelList)
);
} else {
const needle = val.toLowerCase();
this.StuChannelList = this.allStuChannelList.filter(
v => v.Name.toLowerCase().indexOf(needle) > -1
);
}
});
},
//获取客户来源
getCustomFrom() {
CreateTypeList({}).then(res => {
if (res.Code == 1) {
this.customFromList = res.Data;
}
});
},
//获取我下属的下拉数据
GetSubordList() {
GetPersonalDimension().then(res => {
if (res.Code == 1) {
this.SubordList = res.Data;
this.AllSubordList = res.Data;
}
});
},
//筛选转介人
filterSubord(val, update, abort) {
update(() => {
this.SubordList = this.AllSubordList.filter(
v => v.EmployeeName.indexOf(val) > -1
);
});
import stulist from "../../components/school/student/stulist";
import {
getMyCustomerList,
CreateTypeList,
GetStuChannelList
} from "../../api/sale/sale";
import {
mapGetters
} from "vuex";
export default {
meta: {
title: "客户管理"
},
//获取客户阶段列表
getStuStageList() {
queryStuStageList().then(res => {
this.customState = res.Data;
});
components: {
stulist
},
//获取客户类型
getCustomTypeList() {
GetStudentTypeList().then(res => {
if (res.Code == 1) {
this.customTypeList = res.Data;
}
});
},
resetSearch() {
this.msg.pageIndex = 1;
this.getStudent();
data() {
return {
currentUrl: "",
data: [],
loading: true,
msg: {
pageIndex: 1,
pageSize: 12,
rowsPerPage: 12,
BelongType: 1,
StuName: "",
StuTel: "",
Status: "-1",
CreateBy: "",
IsQueryMyStu: 1,
StuStage: "", //客户阶段
StartTime: "", //开始时间
EndTime: "", //结束时间
CustomerId: 0,
QQ: "",
WechatNo: "",
StuType: "",
CreateIds: [],
ExistCourseConsultant: "", //是否存在课程顾问(1-存在,2=不存在)
},
dateArray: [], //日期数组
pageCount: 0,
//客户阶段状态列表
customState: [],
myCustomerList: [], //同行列表
allCustomerList: [], //所有同行列表
customTypeList: [], //客户类型
//归属类型列表
BelongTypeList: [{
Id: 1,
Name: "全部"
},
{
Id: 2,
Name: "我负责的"
},
{
Id: 3,
Name: "我协同的"
},
{
Id: 4,
Name: "我下属的"
}
],
//课程顾问
consultantList: [{
Id: 1,
Name: "是"
},
{
Id: 2,
Name: "否"
}
],
isJudgeTrans: 1, //用于判断转交是否有条件
SubordList: [], //我的下属数据
AllSubordList: [],
customFromList: [], //客户来源
StuChannelList: [], //收客渠道
allStuChannelList: [], //所有收客渠道
};
},
resetBelong() {
if (this.msg.BelongType != 4) {
this.msg.pageIndex = 1;
this.getStudent();
}
created() {
this.getSchool();
this.getStuStageList();
this.getCustomTypeList();
this.GetSubordList();
},
changePage(val) {
this.msg.pageIndex = val;
mounted() {
this.currentUrl = this.$route.path;
this.getStudent();
this.getCustomerList();
this.getCustomFrom();
this.GetStuChannelList();
},
getSchool() {
getSchoolDropdown({}).then(res => {
this.schoolList = res.Data;
});
computed: {
...mapGetters(["userInfo"])
},
getStudent() {
if (this.dateArray && this.dateArray.length > 0) {
this.msg.StartTime = this.dateArray[0];
this.msg.EndTime = this.dateArray[1];
} else {
this.msg.StartTime = "";
this.msg.EndTime = "";
}
this.loading = true;
getStudentPage(this.msg)
.then(res => {
this.loading = false;
this.data = res.Data.PageData;
this.pageCount = res.Data.PageCount;
this.data.forEach(x => {
if (x.CreateBy != this.userInfo.Id) {
x.BelongType = 3;
} else {
x.BelongType = 1;
}
});
})
.catch(() => {
this.loading = false;
methods: {
//获取收客渠道
GetStuChannelList() {
GetStuChannelList({}).then(res => {
if (res.Code == 1) {
this.StuChannelList = res.Data;
this.allStuChannelList = res.Data;
}
});
},
refreshPage() {
this.getStudent();
},
getCustomerList() {
getMyCustomerList({}).then(res => {
this.myCustomerList = res.Data;
this.allCustomerList = res.Data;
this.myCustomerList.unshift({
CustomerName: "不限",
CustomerId: 0
},
//筛选渠道
filterStuChannel(val, update) {
update(() => {
if (val === "") {
this.StuChannelList = JSON.parse(
JSON.stringify(this.allStuChannelList)
);
} else {
const needle = val.toLowerCase();
this.StuChannelList = this.allStuChannelList.filter(
v => v.Name.toLowerCase().indexOf(needle) > -1
);
}
});
});
},
cusfilterFn(val, update) {
update(() => {
if (val === "") {
this.myCustomerList = JSON.parse(
JSON.stringify(this.allCustomerList)
},
//获取客户来源
getCustomFrom() {
CreateTypeList({}).then(res => {
if (res.Code == 1) {
this.customFromList = res.Data;
}
});
},
//获取我下属的下拉数据
GetSubordList() {
GetPersonalDimension().then(res => {
if (res.Code == 1) {
this.SubordList = res.Data;
this.AllSubordList = res.Data;
}
});
},
//筛选转介人
filterSubord(val, update, abort) {
update(() => {
this.SubordList = this.AllSubordList.filter(
v => v.EmployeeName.indexOf(val) > -1
);
});
},
//获取客户阶段列表
getStuStageList() {
queryStuStageList().then(res => {
this.customState = res.Data;
});
},
//获取客户类型
getCustomTypeList() {
GetStudentTypeList().then(res => {
if (res.Code == 1) {
this.customTypeList = res.Data;
}
});
},
resetSearch() {
this.msg.pageIndex = 1;
this.getStudent();
},
resetBelong() {
if (this.msg.BelongType != 4) {
this.msg.pageIndex = 1;
this.getStudent();
}
},
changePage(val) {
this.msg.pageIndex = val;
this.getStudent();
},
getSchool() {
getSchoolDropdown({}).then(res => {
this.schoolList = res.Data;
});
},
getStudent() {
if (this.dateArray && this.dateArray.length > 0) {
this.msg.StartTime = this.dateArray[0];
this.msg.EndTime = this.dateArray[1];
} else {
const needle = val.toLowerCase();
this.myCustomerList = this.allCustomerList.filter(
v => v.CustomerName.toLowerCase().indexOf(needle) > -1
);
this.msg.StartTime = "";
this.msg.EndTime = "";
}
});
this.loading = true;
getStudentPage(this.msg)
.then(res => {
this.loading = false;
this.data = res.Data.PageData;
this.pageCount = res.Data.PageCount;
this.data.forEach(x => {
if (x.CreateBy != this.userInfo.Id) {
x.BelongType = 3;
} else {
x.BelongType = 1;
}
});
})
.catch(() => {
this.loading = false;
});
},
refreshPage() {
this.getStudent();
},
getCustomerList() {
getMyCustomerList({}).then(res => {
this.myCustomerList = res.Data;
this.allCustomerList = res.Data;
this.myCustomerList.unshift({
CustomerName: "不限",
CustomerId: 0
});
});
},
cusfilterFn(val, update) {
update(() => {
if (val === "") {
this.myCustomerList = JSON.parse(
JSON.stringify(this.allCustomerList)
);
} else {
const needle = val.toLowerCase();
this.myCustomerList = this.allCustomerList.filter(
v => v.CustomerName.toLowerCase().indexOf(needle) > -1
);
}
});
}
}
}
};
};
</script>
<style lang="sass">
@import url('~assets/css/table.sass')
@import url('~assets/css/table.sass')
</style>
<style scoped>
/deep/.el-input__inner,
/deep/.el-range-input {
background-color: transparent;
border: none;
}
</style>
/deep/.el-input__inner,
/deep/.el-range-input {
background-color: transparent;
border: none;
}
</style>
\ No newline at end of file
......@@ -48,7 +48,7 @@
</div>
</div>
<div class="page-content">
<stulist :dataList="data" @success="refreshPage" ref="stuList">
<stulist :dataList="data" @success="refreshPage" :loading="loading" ref="stuList">
</stulist>
<div class="row" style="justify-content: flex-end;padding: 5px 20px">
<q-pagination v-model="msg.pageIndex" :max="pageCount" @input="changePage" class="full-width justify-end"
......
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