Commit f39a0325 authored by 罗超's avatar 罗超

1

parent a99e2d9d
......@@ -403,4 +403,11 @@ export function GetAssistTypeList(data) {
});
}
// 获取学生是否续费
export function getOrderGuestRenewState(data) {
return request({
url: '/order/GetOrderGuestRenewState',
method: 'post',
data
});
}
......@@ -442,14 +442,15 @@
this.OrderMsg.CourseId = '';
}
if(this.saveObj.B2CRatio){
this.OrderMsg.B2CRatio = this.saveObj.B2CRatio;
this.OrderMsg.B2CRatio = this.saveObj.B2CRatio>1?this.saveObj.B2CRatio/100:this.saveObj.B2CRatio;
}
if(this.saveObj.B2CReNewRatio){
this.OrderMsg.B2CReNewRatio = this.saveObj.B2CReNewRatio;
this.OrderMsg.B2CReNewRatio = this.saveObj.B2CReNewRatio>1?this.saveObj.B2CReNewRatio/100:this.saveObj.B2CReNewRatio;
}
}
this.IsShowEditOrder = true;
this.calcPrice();
console.log("this.saveObj",this.saveObj)
}
},
//筛选员工
......@@ -463,7 +464,7 @@
}
})
},
//筛选市场专员
//筛选同行
cusfilterFn(val, update) {
update(() => {
if (val === '') {
......@@ -601,6 +602,10 @@
getMyCustomerList({}).then(res=>{
this.myCustomerList=res.Data
this.allCustomerList=res.Data
this.myCustomerList.unshift({
CustomerId:0,
CustomerName:"不限"
})
})
}
}
......
<style lang="scss">
.stuList .q-table__bottom {
.stuList .q-table__bottom {
min-height: 0;
}
}
</style>
<template>
<div class="stuList">
<q-table :pagination="pageMsg" :loading="loading" no-data-label="暂无相关数据" flat
class="sticky-right-column-table sticky-tow-column-table" separator="none" :data="dataList"
:columns="columns" row-key="name" hide-bottom>
<q-table
:pagination="pageMsg"
:loading="loading"
no-data-label="暂无相关数据"
flat
selection="multiple"
: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="props">
<div class="col-2 q-table__title">我的客户</div>
<q-space />
<div class="page-option">
<q-btn color="accent" class="q-mr-md" size="md" icon="add" label="新增客户" @click="EditStudent(null)" />
<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>
</template>
<template v-slot:body-cell-StuIcon="props">
......@@ -20,120 +47,165 @@
<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">
<q-td :props="props">
<div class="text-blue cursor-pointer" @click="getStuRight(props.row)">{{props.value}}</div>
<div class="text-blue cursor-pointer" @click="getStuRight(props.row)">
{{ props.value }}
</div>
</q-td>
</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-Status="props">
<q-td :props="props">
<q-toggle size="md" color="primary" :false-value="1" :true-value="0" v-model="props.row.Status"
title="注意:关闭后,学员将无法正常使用." @input="deleteStudentInfo(props.row)" />
<q-toggle
size="md"
color="primary"
:false-value="1"
:true-value="0"
v-model="props.row.Status"
title="注意:关闭后,学员将无法正常使用."
@input="deleteStudentInfo(props.row)"
/>
</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" :save-obj="stuOption" @close="closeStuForm" @success="refreshStuList">
<studentRight-form
v-if="isShowStuRight"
:save-obj="stuOption"
@close="closeStuForm"
@success="refreshStuList"
>
</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>
</div>
</template>
<script>
import studentForm from './student-form'
import studentRightForm from './studentRight-form'
import studentAddForm from './studentAdd-form'
export default {
import studentForm from "./student-form";
import studentRightForm from "./studentRight-form";
import studentAddForm from "./studentAdd-form";
import transferOrder from "./transfer-order"
export default {
props: {
dataList: {
type: Array,
default: null
},
}
},
components: {
studentForm,
studentRightForm,
studentAddForm
studentAddForm,
transferOrder
},
data() {
return {
columns: [{
name: 'StuIcon',
label: '',
field: 'StuIcon',
align: 'left',
columns: [
{
name: "StuIcon",
label: "",
field: "StuIcon",
align: "left"
},
{
name: 'StuName',
name: "StuName",
required: true,
label: '昵称',
align: 'left',
label: "昵称",
align: "left",
field: row => row.StuName
},
{
name: 'StuSex',
label: '性别',
field: 'StuSex',
align: 'left'
name: "StuSex",
label: "性别",
field: "StuSex",
align: "left"
},
{
name: 'StuBirth',
label: '出生日期',
field: 'StuBirth',
align: 'left'
name: "StuBirth",
label: "出生日期",
field: "StuBirth",
align: "left"
},
{
name: 'StuTel',
label: '手机号码',
field: 'StuTel',
align: 'left'
name: "StuTel",
label: "手机号码",
field: "StuTel",
align: "left"
},
{
name: 'CreateTypeStr',
label: '客户来源',
field: 'CreateTypeStr',
align: 'left',
name: "CreateTypeStr",
label: "客户来源",
field: "CreateTypeStr",
align: "left"
},
{
name: 'StuStageName',
label: '客户阶段',
field: 'StuStageName',
align: 'left',
name: "StuStageName",
label: "客户阶段",
field: "StuStageName",
align: "left"
},
{
name: 'CreateTimeStr',
label: '创建时间',
field: 'CreateTimeStr',
align: 'left',
name: "CreateTimeStr",
label: "创建时间",
field: "CreateTimeStr",
align: "left"
},
{
name: 'CreateByName',
label: '负责人',
align: 'left',
field: 'CreateByName'
name: "CreateByName",
label: "负责人",
align: "left",
field: "CreateByName"
}
],
pageMsg: {
rowsPerPage: 12,
rowsPerPage: 12
},
loading: false,
isShowStuForm: false,
resetLoading: false,
isShowStuRight: false,
stuOption: null,
isShowAdd:false
}
isShowAdd: false,
selection: [],
isShowTransfer:false,
};
},
created() {
this.initAuth();
......@@ -141,16 +213,15 @@
mounted() {},
methods: {
//初始化权限
initAuth() {
},
initAuth() {},
//创建账号
createAccount(id) {
let that = this
let that = this;
createStudentAccount({
StuId: id,
StuId: id
}).then(res => {
that.$q.dialog({
that.$q
.dialog({
title: "创建账号",
message: res.Message,
persistent: true,
......@@ -159,16 +230,19 @@
flat: true,
focus: true
}
}).onOk(() => {
that.getStudent();
}).onCancel(() => {
that.getStudent();
})
.onOk(() => {
that.getStudent();
})
.onCancel(() => {
that.getStudent();
});
});
},
resetPw(id) {
let that = this
this.$q.dialog({
let that = this;
this.$q
.dialog({
title: "重置密码",
message: "你正在进行重置密码行为,是否确认执行",
persistent: true,
......@@ -181,13 +255,15 @@
flat: true,
focus: true
}
}).onOk(() => {
that.resetLoading = true
})
.onOk(() => {
that.resetLoading = true;
resetPassword({
AccountType: 4,
AccountId: id
}).then(res => {
that.resetLoading = false
})
.then(res => {
that.resetLoading = false;
that.$q.dialog({
title: "密码重置成功",
message: res.Message,
......@@ -197,19 +273,22 @@
flat: true,
focus: true
}
});
})
}).catch(() => {
that.resetLoading = false
.catch(() => {
that.resetLoading = false;
});
});
},
//删除客户资料
deleteStudentInfo(obj) {
let that = this;
var str = (obj.Status == 1 ? "【禁用】" : "【启用】");
this.$q.dialog({
var str = obj.Status == 1 ? "【禁用】" : "【启用】";
this.$q
.dialog({
title: str + "学员",
message: "你正在进行" + str + "学员行为,一旦执行无法找回,是否确认执行?",
message:
"你正在进行" + str + "学员行为,一旦执行无法找回,是否确认执行?",
persistent: true,
cancel: {
label: "取消",
......@@ -220,27 +299,29 @@
flat: true,
focus: true
}
}).onOk(() => {
that.resetLoading = true
})
.onOk(() => {
that.resetLoading = true;
deleteStudent({
StuId: obj.StuId,
Status: obj.Status
}).then(res => {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
icon: "iconfont icon-chenggong",
color: "accent",
timeout: 2000,
message: '数据操作成功!',
position: 'top'
})
this.getStudent()
message: "数据操作成功!",
position: "top"
});
this.getStudent();
});
})
}).onCancel(() => {
.onCancel(() => {
obj.Status = obj.Status == 1 ? 0 : 1;
});
},
refreshStuList() {
this.$emit('success');
this.$emit("success");
},
EditStudent(obj) {
if (obj) {
......@@ -254,6 +335,7 @@
this.isShowStuForm = false;
this.isShowStuRight = false;
this.isShowAdd = false;
this.isShowTransfer=false;
},
//点击学生姓名弹出
getStuRight(obj) {
......@@ -263,7 +345,22 @@
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
}
}
};
</script>
......@@ -564,6 +564,8 @@
this.orderObj.ClassId = item.ClassId;
this.orderObj.Unit_Price = item.SellPrice;
this.orderObj.CourseId = item.CouseId;
this.orderObj.B2CRatio=item.B2CRatio;
this.orderObj.B2CReNewRatio=item.B2CReNewRatio;
this.isShowEditOrderForm = true;
},
//跳转到课程大纲
......
......@@ -3,56 +3,112 @@
<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 @input="resetSearch" clearable filled v-model="msg.StuName" label="昵称" maxlength="20" />
<q-input
@input="resetSearch"
clearable
filled
v-model="msg.StuName"
label="昵称"
maxlength="20"
/>
</div>
<div class="col-3">
<q-input @input="resetSearch" clearable filled v-model="msg.StuTel" label="电话" maxlength="20" />
<q-input
@input="resetSearch"
clearable
filled
v-model="msg.StuTel"
label="电话"
maxlength="20"
/>
</div>
<div class="col-3">
<q-select @input="resetSearch" filled v-model="msg.StuStage" :options="customState" option-label="Name"
option-value="Id" emit-value map-options label="客户状态" clearable />
<q-select
@input="resetSearch"
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-field filled>
 <template v-slot:control>
<el-date-picker v-model="dateArray" @change="resetSearch" value-format="yyyy-MM-dd" type="daterange" style="border:none;"
 range-separator="至"  start-placeholder="开始时间"  end-placeholder="结束时间" />    
<template v-slot:control>
<el-date-picker
v-model="dateArray"
@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"
v-model="msg.CustomerId"
:options="myCustomerList"
filled
use-input
label="同行"
option-label="CustomerName"
option-value="CustomerId"
ref="CustomerName"
class="col-6 q-pb-lg"
emit-value
map-options
@filter="cusfilterFn"
>
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
未找到相关数据
</q-item-section>
</q-item>
</template>
</q-select>
</div>
<div class="page-option">
<q-btn color="accent" class="q-mr-md" icon="add" label="新增客户" @click="EditStudent(null)" />
</div>
</div>
<div class="page-content">
<stulist :dataList="data" @success="refreshPage" ref="stuList">
</stulist>
<stulist :dataList="data" @success="refreshPage" 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"
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 {
import {
getStudentPage,
getSchoolDropdown,
deleteStudent,
createStudentAccount,
queryStuStageList
} from '../../api/school/index'
import {
queryEmployee
} from '../../api/users/user'
import {
resetPassword
} from '../../api/users/user.js'
} from "../../api/school/index";
import { queryEmployee } from "../../api/users/user";
import { resetPassword } from "../../api/users/user.js";
import stulist from '../../components/school/student/stulist'
export default {
import stulist from "../../components/school/student/stulist";
import { getMyCustomerList } from "../../api/sale/sale";
export default {
meta: {
title: "客户管理"
},
......@@ -76,31 +132,35 @@
StuStage: "", //客户阶段
StartTime: "", //开始时间
EndTime: "", //结束时间
CustomerId: 0
},
dateArray: [], //日期数组
pageCount: 0,
//客户阶段状态列表
customState: [],
}
myCustomerList: [], //同行列表
allCustomerList: [] //所有同行列表
};
},
created() {
this.getSchool();
this.getStuStageList();
},
mounted() {
this.currentUrl = this.$route.path
this.getStudent()
this.currentUrl = this.$route.path;
this.getStudent();
this.getCustomerList();
},
methods: {
//获取客户阶段列表
getStuStageList() {
queryStuStageList().then(res => {
this.customState = res.Data;
})
});
},
resetSearch() {
this.msg.pageIndex = 1;
this.getStudent()
this.getStudent();
},
changePage(val) {
this.msg.pageIndex = val;
......@@ -109,31 +169,57 @@
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 {
this.msg.StartTime = '';
this.msg.EndTime = '';
this.msg.StartTime = "";
this.msg.EndTime = "";
}
this.loading = true;
getStudentPage(this.msg).then(res => {
getStudentPage(this.msg)
.then(res => {
this.loading = false;
this.data = res.Data.PageData
this.pageCount = res.Data.PageCount
}).catch(() => {
this.loading = false
this.data = res.Data.PageData;
this.pageCount = res.Data.PageCount;
})
.catch(() => {
this.loading = false;
});
},
refreshPage() {
this.getStudent()
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>
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