Commit 5839a541 authored by 黄奎's avatar 黄奎

页面修改

parent ad0f605f
<style> <style>
.delAssist { .delAssist {
position: absolute; position: absolute;
right: -16px; right: -16px;
top: -12px; top: -12px;
display: inline-block; display: inline-block;
background: red; background: red;
border-radius: 50%; border-radius: 50%;
color: #fff; color: #fff;
width: 20px; width: 20px;
height: 20px; height: 20px;
text-align: center; text-align: center;
line-height: 20px; line-height: 20px;
cursor: pointer; cursor: pointer;
} }
.studentAssitTable { .studentAssitTable {
width: 100%; width: 100%;
text-align: center; text-align: center;
} }
.studentAssitTable td { .studentAssitTable td {
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
border: 1px solid #f2f2f2; border: 1px solid #f2f2f2;
} }
.studentAssitTable th { .studentAssitTable th {
height: 40px; height: 40px;
background-color: #f2f2f2; background-color: #f2f2f2;
} }
</style> </style>
<template> <template>
<div> <div>
<q-btn <q-btn label="新增" color="accent q-mb-lg" size="sm" v-if="userInfo.IsCourseConsultant == 1"
label="新增" @click="isShowAdd = true" />
color="accent q-mb-lg"
size="sm"
v-if="userInfo.IsCourseConsultant == 1"
@click="isShowAdd = true"
/>
<span class="text-grey-4" v-else>抱歉,你没有权限邀请其他服务人员</span> <span class="text-grey-4" v-else>抱歉,你没有权限邀请其他服务人员</span>
<q-btn <q-btn label="取消" style="margin-left:20px;" v-if="isShowAdd" flat color="grey-10 q-mb-lg" size="sm"
label="取消" @click="isShowAdd = false" />
style="margin-left:20px;"
v-if="isShowAdd"
flat
color="grey-10 q-mb-lg"
size="sm"
@click="isShowAdd = false"
/>
<template v-if="isShowAdd"> <template v-if="isShowAdd">
<div class="row wrap"> <div class="row wrap">
<q-select <q-select filled stack-label option-label="Name" @input="getRole" v-model="AssitMsg.AssistType"
filled option-value="Id" :options="AssistDropList" label="角色" dense class="col-6 q-pb-lg q-pr-lg" emit-value
stack-label map-options />
option-label="Name" <q-select filled dense v-if="AssitMsg.AssistType == 2" v-model="AssitMsg.AssistId" :options="RoleListData"
@input="getRole" option-label="EmployeeName" class="col-6 q-pb-lg" option-value="Id" emit-value map-options />
v-model="AssitMsg.AssistType" <q-select filled dense v-else v-model="AssitMsg.AssistId" @filter="filterEmployee" use-input
option-value="Id" :options="myEmployeeList" option-label="EmployeeName" class="col-6 q-pb-lg" option-value="Id" emit-value
:options="AssistDropList" map-options />
label="角色"
dense
class="col-6 q-pb-lg q-pr-lg"
emit-value
map-options
/>
<q-select
filled
dense
v-if="AssitMsg.AssistType == 2"
v-model="AssitMsg.AssistId"
:options="RoleListData"
option-label="EmployeeName"
class="col-6 q-pb-lg"
option-value="Id"
emit-value
map-options
/>
<q-select
filled
dense
v-else
v-model="AssitMsg.AssistId"
@filter="filterEmployee"
use-input
:options="myEmployeeList"
option-label="EmployeeName"
class="col-6 q-pb-lg"
option-value="Id"
emit-value
map-options
/>
<i class="iconfont icon-close delAssist"></i> <i class="iconfont icon-close delAssist"></i>
</div> </div>
<div class="row wrap" style="margin-bottom:10px;float:right;"> <div class="row wrap" style="margin-bottom:10px;float:right;">
<q-btn <q-btn label="保存" color="accent q-mb-lg" size="md" @click="saveAssit()" />
label="保存"
color="accent q-mb-lg"
size="md"
@click="saveAssit()"
/>
</div> </div>
</template> </template>
<div v-if="dataList.length > 0"> <div v-if="dataList.length > 0">
<table <table class="studentAssitTable" style="border:1px solid #f2f2f2;border-collapse:collapse;" cellspacing="0"
class="studentAssitTable" cellpadding="0">
style="border:1px solid #f2f2f2;border-collapse:collapse;"
cellspacing="0"
cellpadding="0"
>
<tr> <tr>
<th style="width:180px;">角色</th> <th style="width:180px;">角色</th>
<th style="width:180px;">人员</th> <th style="width:180px;">人员</th>
...@@ -120,35 +67,14 @@ ...@@ -120,35 +67,14 @@
<td>{{ item.AssistName }}</td> <td>{{ item.AssistName }}</td>
<td v-if="userInfo.IsCourseConsultant == 1"> <td v-if="userInfo.IsCourseConsultant == 1">
<div v-if="item.AssistType != 2 && item.AssistType != 4"> <div v-if="item.AssistType != 2 && item.AssistType != 4">
<q-btn <q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="修改"
flat @click="getEditInfo(item)"></q-btn>
size="xs" <q-btn flat size="xs" icon="delete" color="negative" style="font-weight:400" label="删除"
icon="edit" @click="deleteAssits(item.Id)" />
color="accent"
style="font-weight:400"
label="修改"
@click="getEditInfo(item)"
></q-btn>
<q-btn
flat
size="xs"
icon="delete"
color="negative"
style="font-weight:400"
label="删除"
@click="deleteAssits(item.Id)"
/>
</div> </div>
<div v-if="isShowBian(item)"> <div v-if="isShowBian(item)">
<q-btn <q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="修改"
flat @click="getGuwenEditInfo(item)"></q-btn>
size="xs"
icon="edit"
color="accent"
style="font-weight:400"
label="修改"
@click="getGuwenEditInfo(item)"
></q-btn>
</div> </div>
</td> </td>
</tr> </tr>
...@@ -157,191 +83,193 @@ ...@@ -157,191 +83,193 @@
</div> </div>
</template> </template>
<script> <script>
import { import {
GetAssistTypeList, GetAssistTypeList,
SetStudentAssist, SetStudentAssist,
GetStudentAssistList, GetStudentAssistList,
RemoveStudentAssist RemoveStudentAssist
} from "../../../api/sale/sale"; } from "../../../api/sale/sale";
import { queryEmployee } from "../../../api/users/user"; import {
queryEmployee
} from "../../../api/users/user";
export default { export default {
meta: { meta: {
title: "" title: ""
},
components: {},
props: {
saveObj: {
type: Object,
default: null
}, },
BelongType: { components: {},
type: Number, props: {
default: null saveObj: {
} type: Object,
}, default: null
data() {
return {
isShowAdd: false,
AssitMsg: {
StuId: 1, //学员编号
Id: 0, //编号
AssistId: "", //员工编号
AssistType: "" //类型
}, },
msg: { BelongType: {
StuId: 1 type: Number,
}, default: null
isShowEdit: false, }
dataList: [],
page_Count: 0,
AssistDropList: [], //下拉数据
RoleListData: [], //课程顾问下拉数据
employeeList: [],
myEmployeeList: [],
userInfo: {}
};
},
created() {
this.userInfo = this.getLocalStorage();
if (this.saveObj && this.saveObj.StuId) {
this.AssitMsg.StuId = this.saveObj.StuId;
this.msg.StuId = this.saveObj.StuId;
}
},
mounted() {
this.getList();
this.GetAssistTypeList();
this.getEmployeeList();
},
methods: {
//获取协助人员
GetAssistTypeList() {
this.AssistDropList = [];
GetAssistTypeList({}).then(res => {
if (res.Code == 1) {
let template = res.Data;
template.forEach(x => {
if (x.Id != 1 && x.Id != 4) {
this.AssistDropList.push(x);
}
});
}
});
}, },
//获取员工列表 data() {
getEmployeeList() { return {
queryEmployee({ isShowAdd: false,
IsLeave: 1, AssitMsg: {
UserRole: 0 StuId: 1, //学员编号
}).then(res => { Id: 0, //编号
this.employeeList = res.Data; AssistId: "", //员工编号
this.myEmployeeList = res.Data; AssistType: "" //类型
}); },
msg: {
StuId: 1
},
isShowEdit: false,
dataList: [],
page_Count: 0,
AssistDropList: [], //下拉数据
RoleListData: [], //课程顾问下拉数据
employeeList: [],
myEmployeeList: [],
userInfo: {}
};
}, },
//切换课程顾问 created() {
getRole() { this.userInfo = this.getLocalStorage();
queryEmployee({ if (this.saveObj && this.saveObj.StuId) {
IsLeave: 1, this.AssitMsg.StuId = this.saveObj.StuId;
UserRole: 2 this.msg.StuId = this.saveObj.StuId;
}).then(res => { }
this.RoleListData = res.Data;
});
}, },
mounted() {
//筛选员工 this.getList();
filterEmployee(val, update, abort) { this.GetAssistTypeList();
update(() => { this.getEmployeeList();
this.myEmployeeList = this.employeeList.filter(
v => v.EmployeeName.indexOf(val) > -1
);
});
}, },
//保存协同人员 methods: {
saveAssit() { //获取协助人员
SetStudentAssist(this.AssitMsg) GetAssistTypeList() {
.then(res => { this.AssistDropList = [];
GetAssistTypeList({}).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.$q.notify({ let template = res.Data;
icon: "iconfont icon-chenggong", template.forEach(x => {
color: "accent", if (x.Id != 1) {
timeout: 2000, this.AssistDropList.push(x);
message: "数据保存成功!", }
position: "top"
}); });
this.getList();
this.isShowAdd = false;
this.clearMsg();
} }
}) });
.catch(() => {}); },
}, //获取员工列表
clearMsg() { getEmployeeList() {
this.AssitMsg.Id = 0; queryEmployee({
this.AssitMsg.AssistId = 1; IsLeave: 1,
this.AssitMsg.AssistType = 1; UserRole: 0
}, }).then(res => {
//获取数据 this.employeeList = res.Data;
getList() { this.myEmployeeList = res.Data;
GetStudentAssistList(this.msg) });
.then(res => { },
if (res.Code == 1) { //切换课程顾问
this.dataList = res.Data; getRole() {
queryEmployee({
IsLeave: 1,
UserRole: 2
}).then(res => {
this.RoleListData = res.Data;
});
},
//筛选员工
filterEmployee(val, update, abort) {
update(() => {
this.myEmployeeList = this.employeeList.filter(
v => v.EmployeeName.indexOf(val) > -1
);
});
},
//保存协同人员
saveAssit() {
SetStudentAssist(this.AssitMsg)
.then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: "iconfont icon-chenggong",
color: "accent",
timeout: 2000,
message: "数据保存成功!",
position: "top"
});
this.getList();
this.isShowAdd = false;
this.clearMsg();
}
})
.catch(() => {});
},
clearMsg() {
this.AssitMsg.Id = 0;
this.AssitMsg.AssistId = 1;
this.AssitMsg.AssistType = 1;
},
//获取数据
getList() {
GetStudentAssistList(this.msg)
.then(res => {
if (res.Code == 1) {
this.dataList = res.Data;
}
})
.catch(() => {});
},
//课程顾问是本人 显示编辑按钮
isShowBian(item) {
let isShow = false;
if (item.AssistTypeName == '课程顾问') {
if (this.userInfo.AccountName == item.AssistName) {
isShow = true
} }
})
.catch(() => {});
},
//课程顾问是本人 显示编辑按钮
isShowBian(item){
let isShow=false;
if(item.AssistTypeName=='课程顾问'){
if(this.userInfo.AccountName==item.AssistName){
isShow=true
} }
} return isShow;
return isShow; },
}, //删除协同
//删除协同 deleteAssits(Id) {
deleteAssits(Id) { let that = this;
let that = this; this.$q
this.$q .dialog({
.dialog({ title: "提示信息",
title: "提示信息", message: "是否确定删除?",
message: "是否确定删除?", cancel: true,
cancel: true, persistent: true,
persistent: true, ok: "确定",
ok: "确定", cancel: "取消"
cancel: "取消" })
}) .onOk(() => {
.onOk(() => { RemoveStudentAssist({
RemoveStudentAssist({ Id: Id
Id: Id }).then(res => {
}).then(res => { that.$q.notify({
that.$q.notify({ icon: "iconfont icon-chenggong",
icon: "iconfont icon-chenggong", timeout: 2000,
timeout: 2000, message: res.Message,
message: res.Message, position: "top"
position: "top" });
that.getList();
}); });
that.getList(); })
}); .onCancel(() => {});
}) },
.onCancel(() => {}); //获取修改数据
}, getEditInfo(obj) {
//获取修改数据 this.AssitMsg.Id = obj.Id;
getEditInfo(obj) { this.AssitMsg.AssistId = obj.AssistId;
this.AssitMsg.Id = obj.Id; this.AssitMsg.AssistType = obj.AssistType;
this.AssitMsg.AssistId = obj.AssistId; this.isShowAdd = true;
this.AssitMsg.AssistType = obj.AssistType; },
this.isShowAdd = true; getGuwenEditInfo(obj) {
}, this.getRole();
getGuwenEditInfo(obj){ this.AssitMsg.Id = obj.Id;
this.getRole(); this.AssitMsg.AssistId = obj.AssistId;
this.AssitMsg.Id = obj.Id; this.AssitMsg.AssistType = obj.AssistType;
this.AssitMsg.AssistId = obj.AssistId; this.isShowAdd = true;
this.AssitMsg.AssistType = obj.AssistType; }
this.isShowAdd = true;
} }
} };
}; </script>
</script> \ No newline at end of file
...@@ -263,19 +263,22 @@ ...@@ -263,19 +263,22 @@
methods: { methods: {
//跳转到客户列表 //跳转到客户列表
showDetail(row) { showDetail(row) {
var url = "/sale/mystu";
if (this.CurrentUserInfo && (this.CurrentUserInfo.IsMarket == 1 || this.CurrentUserInfo.IsCourseConsultant == if (this.CurrentUserInfo && (this.CurrentUserInfo.IsMarket == 1 || this.CurrentUserInfo.IsCourseConsultant ==
1)) { 1)) {
url = "/sale/mystu"; var url = "/sale/mystu";
this.OpenNewUrl(url, {
startTime: this.msg.startTime,
endTime: this.msg.endTime,
createBy: row.Id,
})
} else { } else {
url = '/school/student'; var url = '/school/student';
this.OpenNewUrl(url, {
startTime: this.msg.startTime,
endTime: this.msg.endTime,
createBy: row.Id,
})
} }
this.OpenNewUrl(url, {
ChannelId: 0,
startTime: this.msg.startTime,
endTime: this.msg.endTime,
createBy: row.Id,
})
}, },
//下载渠道总表 //下载渠道总表
downloadMarketChannelStudentStatic() { downloadMarketChannelStudentStatic() {
......
...@@ -195,10 +195,12 @@ ...@@ -195,10 +195,12 @@
customFromList: [], //客户来源 customFromList: [], //客户来源
StuChannelList: [], //收客渠道 StuChannelList: [], //收客渠道
allStuChannelList: [], //所有收客渠道 allStuChannelList: [], //所有收客渠道
consultList: [] consultList: [],
CurrentUserInfo: {},
}; };
}, },
created() { created() {
this.CurrentUserInfo = this.getLocalStorage();
this.getSchool(); this.getSchool();
this.getStuStageList(); this.getStuStageList();
this.getCustomTypeList(); this.getCustomTypeList();
...@@ -217,6 +219,12 @@ ...@@ -217,6 +219,12 @@
if (this.$route.query.ChannelId) { if (this.$route.query.ChannelId) {
this.msg.StuChannel = this.$route.query.ChannelId; this.msg.StuChannel = this.$route.query.ChannelId;
} }
if (this.$route.query.createBy) {
if (this.CurrentUserInfo.IsManager == 1 && this.CurrentUserInfo.IsMarket == 1) {
this.msg.BelongType = 4;
this.msg.CreateIds.push(Number(this.$route.query.createBy));
}
}
this.getCustomerList(); this.getCustomerList();
this.getCustomFrom(); this.getCustomFrom();
this.GetStuChannelList(); this.GetStuChannelList();
...@@ -329,7 +337,7 @@ ...@@ -329,7 +337,7 @@
this.msg.StartTime = ""; this.msg.StartTime = "";
this.msg.EndTime = ""; this.msg.EndTime = "";
} }
this.loading = true; this.loading = true;
getStudentPage(this.msg) getStudentPage(this.msg)
.then(res => { .then(res => {
......
...@@ -69,7 +69,6 @@ ...@@ -69,7 +69,6 @@
</a> </a>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column>
<el-table-column prop="OrderCount" label="合同数" sortable> <el-table-column prop="OrderCount" label="合同数" sortable>
<template slot-scope="scope"> <template slot-scope="scope">
<a @click="showDetail(scope.row)" style="color:#67C23A;cursor:pointer;text-decoration:underline;"> <a @click="showDetail(scope.row)" style="color:#67C23A;cursor:pointer;text-decoration:underline;">
......
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