Commit 6f0a6329 authored by zhengke's avatar zhengke
parents 96bed70e dbf06a39
......@@ -8,18 +8,62 @@
right: -5px;
top: -5px;
}
.activityStuForm .selectClass {
width: 1026px;
border: 1px dashed #E1E1E5;
padding-top: 12px;
border-radius: 4px;
padding: 12px 4px 0 4px;
margin-top: 5px;
}
.activityStuForm .selectClass span {
display: inline-block;
background: #F2F5FA;
padding: 0 10px;
height: 26px;
line-height: 26px;
border-radius: 14px;
color: #181E33;
margin-left: 10px;
margin-bottom: 12px;
position: relative;
font-size: 12px;
cursor: pointer;
}
.activityStuForm .selectClass span i {
position: absolute;
right: -8px;
top: -10px;
display: none;
color: gray;
cursor: pointer;
}
.activityStuForm .selectClass span:hover i {
display: block;
}
</style>
<template>
<q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale" transition-hide="scale">
<q-card style="width: 500px;max-width:500px;">
<q-card style="width: 500px;max-width:500px;" class="activityStuForm">
<q-card-section>
<div class="text-h6">{{addMsg.ID==0?'选择学员':'修改学员'}}</div>
<div class="text-h6">{{addMsg.Id==0?'选择学员':'修改学员'}}</div>
</q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<div class="row wrap">
<q-select filled stack-label clearable use-input option-value="Id" option-label="AccountName"
v-model="addMsg.GuestId" :options="filterstudentList" @filter="filterStudentFn" label="学员编号" ref="GuestId"
:rules="[val => !!val || '请选择学员']" class="col-12 q-pb-lg" emit-value map-options />
<q-btn color="accent" size="sm" @click="showClassStu" class="q-mr-md" label="选择学员" v-if="addMsg.Id==0"   />
<br />
<div class="selectClass" v-if="addMsg.GuestIdList&&addMsg.GuestIdList.length>0">
<span v-for="(item,index) in addMsg.GuestIdList" :key="index" style="padding-left:5px;">{{item.GuestName}}
<i class="iconfont icon-shanchu1" @click="delStudentName(index)" v-if="addMsg.Id==0" ></i>
</span>
</div>
</div>
<div class="row wrap" style="margin-top:10px;">
<div class="col-12 q-pb-lg">
<q-input filled v-model="addMsg.StartTime" mask="####-##-## ##:##:##" ref="StartTime" label="开始时间"
:rules="[val => !!val || '请选择开始时间']">
......@@ -61,6 +105,9 @@
@click="saveActive" />
</q-card-actions>
</q-card>
<classstutreeForm v-if="isShowClassStu" :sendStudent="sendStudent"  @close="closeClassStuForm"
 @success="getClassStuList">
</classstutreeForm>
</q-dialog>
</template>
<script>
......@@ -69,6 +116,7 @@
getActivitySurveyGuestModule,
getAccountStudentList
} from '../../api/studentmsg/index'
import classstutreeForm from '../exam/classstutree-form'
export default {
props: {
saveObj: {
......@@ -80,17 +128,23 @@
default: null
}
},
components: {
classstutreeForm,
},
data() {
return {
persistent: true,
addMsg: {
Id: 0, //新增传0
GuestType: 2, //客户类型(1-小程序用户,2-学员用户)
GuestIdList: [], //学员编号
GuestId: '', //学员编号
StartTime: "", //开始时间
EndTime: "", //结束时间
SurveyId: 0 //意见调查表编号
},
isShowClassStu: false, //是否显示学员弹窗
sendStudent: [], //已选择的学员信息
saveLoading: false,
studentAccountList: [],
filterstudentList: [],
......@@ -101,6 +155,31 @@
this.initObj();
},
methods: {
//选择学员
showClassStu() {
this.isShowClassStu = true;
},
//刷新页面
getClassStuList(array) {
this.addMsg.GuestIdList = [];
if (array && array.length > 0) {
array.forEach(item => {
this.addMsg.GuestIdList.push({
GuestId: item.Account_Id,
GuestName: item.Name,
});
})
}
this.isShowClassStu = false;
},
//删除学员
delStudentName(index) {
this.addMsg.GuestIdList.splice(index, 1);
},
//关闭选择学员弹窗
closeClassStuForm() {
this.isShowClassStu = false;
},
//初始化表单
initObj() {
this.addMsg.SurveyId = this.ID
......@@ -113,12 +192,14 @@
this.addMsg.GuestId = tempData.GuestId;
this.addMsg.StartTime = tempData.StartTime;
this.addMsg.EndTime = tempData.EndTime;
this.addMsg.GuestIdList = tempData.GuestIdList;
})
} else {
this.addMsg.Id = 0;
this.addMsg.GuestId = '';
this.addMsg.StartTime = '';
this.addMsg.EndTime = '';
this.addMsg.GuestIdList = [];
}
},
//意见调查开始时间
......@@ -142,31 +223,28 @@
},
//保存数据
saveActive() {
this.$refs.GuestId.validate();
this.$refs.StartTime.validate();
this.$refs.EndTime.validate();
//&& !this.$refs.StartTime.hasError && !this.$refs.EndTime.hasError
if (!this.$refs.GuestId.hasError ) {
setActivitySurveyGuest(this.addMsg).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
this.$emit('close');
this.$emit('success');
} else {
this.$q.notify({
type: 'negative',
position: "top",
message: res.Data.message
})
}
})
}
setActivitySurveyGuest(this.addMsg).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
this.$emit('close');
this.$emit('success');
} else {
this.$q.notify({
type: 'negative',
position: "top",
message: res.Data.message
})
}
})
},
// 学生编号
studentAccount() {
......
<style>
.delAssist {
position: absolute;
right: -16px;
top: -12px;
display: inline-block;
background: red;
border-radius: 50%;
color: #fff;
width: 20px;
height: 20px;
text-align: center;
line-height: 20px;
cursor: pointer;
}
.delAssist {
position: absolute;
right: -16px;
top: -12px;
display: inline-block;
background: red;
border-radius: 50%;
color: #fff;
width: 20px;
height: 20px;
text-align: center;
line-height: 20px;
cursor: pointer;
}
.studentAssitTable {
width: 100%;
text-align: center;
}
.studentAssitTable {
width: 100%;
text-align: center;
}
.studentAssitTable td {
height: 40px;
line-height: 40px;
border: 1px solid #f2f2f2;
}
.studentAssitTable td {
height: 40px;
line-height: 40px;
border: 1px solid #f2f2f2;
}
.studentAssitTable th {
height: 40px;
background-color: #f2f2f2;
}
.studentAssitTable th {
height: 40px;
background-color: #f2f2f2;
}
</style>
<template>
<div>
<!--课程顾问 或有教师权限-->
<template
v-if="
<template v-if="
userInfo.IsCourseConsultant == 1 ||
isHaveTeacherEdit ||
isHaveXueManager
"
>
<q-btn
label="新增"
color="accent q-mb-lg"
size="sm"
@click="isShowAdd = true"
/>
">
<q-btn label="新增" color="accent q-mb-lg" size="sm" @click="isShowAdd = true" />
</template>
<template v-else>
<span class="text-grey-4">抱歉,你没有权限邀请其他服务人员</span>
</template>
<q-btn
label="取消"
style="margin-left:20px;"
v-if="isShowAdd"
flat
color="grey-10 q-mb-lg"
size="sm"
@click="isShowAdd = false"
/>
<q-btn label="取消" style="margin-left:20px;" v-if="isShowAdd" flat color="grey-10 q-mb-lg" size="sm"
@click="isShowAdd = false" />
<template v-if="isShowAdd">
<div class="row wrap">
<q-select
filled
stack-label
option-label="Name"
@input="changeData"
v-model="AssitMsg.AssistType"
option-value="Id"
:options="AssistDropList"
label="角色"
dense
use-input
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
use-input
map-options
/>
<q-select
filled
dense
v-else-if="AssitMsg.AssistType == 4"
v-model="AssitMsg.AssistId"
:options="TeacherList"
option-label="EmployeeName"
class="col-6 q-pb-lg"
option-value="Id"
emit-value
use-input
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
/>
<q-select filled stack-label option-label="Name" @input="changeData" v-model="AssitMsg.AssistType"
option-value="Id" :options="AssistDropList" label="角色" dense use-input 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 use-input map-options />
<q-select filled dense v-else-if="AssitMsg.AssistType == 4" v-model="AssitMsg.AssistId" :options="TeacherList"
option-label="EmployeeName" class="col-6 q-pb-lg" option-value="Id" emit-value use-input 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>
</div>
<div class="row wrap" style="margin-bottom:10px;float:right;">
<q-btn
label="保存"
color="accent q-mb-lg"
size="md"
@click="saveAssit()"
/>
<q-btn label="保存" color="accent q-mb-lg" size="md" @click="saveAssit()" />
</div>
</template>
<div v-if="dataList.length > 0">
<table
class="studentAssitTable"
style="border:1px solid #f2f2f2;border-collapse:collapse;"
cellspacing="0"
cellpadding="0"
>
<table class="studentAssitTable" style="border:1px solid #f2f2f2;border-collapse:collapse;" cellspacing="0"
cellpadding="0">
<tr>
<th style="width:180px;">角色</th>
<th style="width:180px;">人员</th>
......@@ -144,57 +76,25 @@
<td>{{ item.AssistTypeName }}</td>
<td>{{ item.AssistName }}</td>
<td>
<template
v-if="
<template v-if="
userInfo.IsCourseConsultant == 1 ||
isHaveTeacherEdit ||
isHaveXueManager
"
>
<div
v-if="
">
<div v-if="
userInfo.IsCourseConsultant == 1 &&
(item.AssistType == 2 || item.AssistType == 3)
"
>
<q-btn
flat
size="xs"
icon="edit"
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)"
/>
(item.AssistType == 2 || item.AssistType == 3 || item.AssistType == 5)
">
<q-btn flat size="xs" icon="edit" 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 v-if="isHaveTeacherEdit && item.AssistType == 4">
<q-btn
flat
size="xs"
icon="edit"
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)"
/>
<q-btn flat size="xs" icon="edit" 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>
</template>
</td>
......@@ -204,219 +104,227 @@
</div>
</template>
<script>
import {
GetAssistTypeList,
SetStudentAssist,
GetStudentAssistList,
RemoveStudentAssist
} from "../../../api/sale/sale";
import { queryEmployee } from "../../../api/users/user";
import { mapState } from "vuex";
import {
GetAssistTypeList,
SetStudentAssist,
GetStudentAssistList,
RemoveStudentAssist
} from "../../../api/sale/sale";
import {
queryEmployee
} from "../../../api/users/user";
import {
mapState
} from "vuex";
export default {
meta: {
title: ""
},
components: {},
props: {
saveObj: {
type: Object,
default: null
export default {
meta: {
title: ""
},
BelongType: {
type: Number,
default: null
}
},
data() {
return {
isShowAdd: false,
AssitMsg: {
StuId: 1, //学员编号
Id: 0, //编号
AssistId: "", //员工编号
AssistType: "" //类型
},
msg: {
StuId: 1
components: {},
props: {
saveObj: {
type: Object,
default: null
},
isShowEdit: false,
dataList: [],
page_Count: 0,
AssistDropList: [], //下拉数据
RoleListData: [], //课程顾问下拉数据
TeacherList: [], //教师列表
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;
}
},
computed: mapState({
isHaveTeacherEdit(state) {
if (
state.user.userInfo &&
state.user.userInfo.ActionMenuList &&
state.user.userInfo.ActionMenuList.length > 0
) {
let action = state.user.userInfo.ActionMenuList.find(x => {
if (x.FunctionCode == "Query_TeacherAssist") {
return x;
BelongType: {
type: Number,
default: null
}
},
data() {
return {
isShowAdd: false,
AssitMsg: {
StuId: 1, //学员编号
Id: 0, //编号
AssistId: "", //员工编号
AssistType: "" //类型
},
msg: {
StuId: 1
},
isShowEdit: false,
dataList: [],
page_Count: 0,
AssistDropList: [], //下拉数据
RoleListData: [], //课程顾问下拉数据
TeacherList: [], //教师列表
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;
}
},
computed: mapState({
isHaveTeacherEdit(state) {
if (
state.user.userInfo &&
state.user.userInfo.ActionMenuList &&
state.user.userInfo.ActionMenuList.length > 0
) {
let action = state.user.userInfo.ActionMenuList.find(x => {
if (x.FunctionCode == "Query_TeacherAssist") {
return x;
}
});
if (action) {
return true;
}
});
if (action) {
return true;
}
return false;
}
return false;
}
}),
mounted() {
this.getList();
this.GetAssistTypeList();
},
methods: {
//获取协助人员
GetAssistTypeList() {
this.AssistDropList = [];
GetAssistTypeList({}).then(res => {
if (res.Code == 1) {
let template = res.Data;
template.forEach(x => {
}),
mounted() {
this.getList();
this.GetAssistTypeList();
},
methods: {
//获取协助人员
GetAssistTypeList() {
this.AssistDropList = [];
GetAssistTypeList({}).then(res => {
if (res.Code == 1) {
let tempData = res.Data;
if (this.userInfo.IsCourseConsultant == 1) {
if (x.Id != 1) {
this.AssistDropList.push(x);
}
if (x.Id == 4 && this.isHaveTeacherEdit) {
this.AssistDropList.push(x);
}
} else if (this.userInfo.IsCourseConsultant == 0) {
if (this.isHaveTeacherEdit) {
if (x.Id == 4) {
tempData.forEach(x => {
if (x.Id == 2 || x.Id == 3 || x.Id == 5) {
this.AssistDropList.push(x);
}
}
if (x.Id == 4) {
if (this.isHaveTeacherEdit) {
this.AssistDropList.push(x);
}
}
});
} else {
tempData.forEach(x => {
if (this.isHaveTeacherEdit) {
if (x.Id == 4) {
this.AssistDropList.push(x);
}
}
});
}
}
});
},
changeData() {
var queryObj = {
IsLeave: 1,
UserRole: 0,
AccountTypeStr: ""
};
if (this.AssitMsg.AssistType == 2) {
queryObj.UserRole = 2;
queryEmployee(queryObj).then(res => {
this.RoleListData = res.Data;
});
}
});
},
changeData() {
var queryObj = {
IsLeave: 1,
UserRole: 0,
AccountTypeStr: ""
};
if (this.AssitMsg.AssistType == 2) {
queryObj.UserRole = 2;
queryEmployee(queryObj).then(res => {
this.RoleListData = res.Data;
});
}
if (this.AssitMsg.AssistType == 4) {
queryObj.AccountTypeStr = "2";
queryEmployee(queryObj).then(res => {
this.TeacherList = res.Data;
});
} else {
queryObj.UserRole = 0;
queryEmployee(queryObj).then(res => {
this.employeeList = res.Data;
this.myEmployeeList = res.Data;
if (this.AssitMsg.AssistType == 4) {
queryObj.AccountTypeStr = "2";
queryEmployee(queryObj).then(res => {
this.TeacherList = res.Data;
});
} else {
queryObj.UserRole = 0;
queryEmployee(queryObj).then(res => {
this.employeeList = res.Data;
this.myEmployeeList = res.Data;
});
}
},
//筛选员工
filterEmployee(val, update, abort) {
update(() => {
this.myEmployeeList = this.employeeList.filter(
v => v.EmployeeName.indexOf(val) > -1
);
});
}
},
//筛选员工
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.$emit("success");
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(() => {});
},
//删除协同
deleteAssits(Id) {
let that = this;
this.$q
.dialog({
title: "提示信息",
message: "是否确定删除?",
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消"
})
.onOk(() => {
RemoveStudentAssist({
Id: Id
}).then(res => {
that.$q.notify({
icon: "iconfont icon-chenggong",
timeout: 2000,
message: res.Message,
position: "top"
},
//保存协同人员
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.$emit("success");
this.getList();
this.isShowAdd = false;
this.clearMsg();
}
})
.catch(() => {});
},
clearMsg() {
this.AssitMsg.Id = 0;
this.AssitMsg.AssistId = 0;
this.AssitMsg.AssistType = 0;
},
//获取数据
getList() {
GetStudentAssistList(this.msg)
.then(res => {
if (res.Code == 1) {
this.dataList = res.Data;
}
})
.catch(() => {});
},
//删除协同
deleteAssits(Id) {
let that = this;
this.$q
.dialog({
title: "提示信息",
message: "是否确定删除?",
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消"
})
.onOk(() => {
RemoveStudentAssist({
Id: Id
}).then(res => {
that.$q.notify({
icon: "iconfont icon-chenggong",
timeout: 2000,
message: res.Message,
position: "top"
});
that.getList();
});
that.getList();
});
})
.onCancel(() => {});
},
//获取修改数据
getEditInfo(obj) {
this.AssitMsg.Id = obj.Id;
this.AssitMsg.AssistId = obj.AssistId;
this.AssitMsg.AssistType = obj.AssistType;
this.isShowAdd = true;
this.changeData();
},
getGuwenEditInfo(obj) {
this.getRole();
this.AssitMsg.Id = obj.Id;
this.AssitMsg.AssistId = obj.AssistId;
this.AssitMsg.AssistType = obj.AssistType;
this.isShowAdd = true;
})
.onCancel(() => {});
},
//获取修改数据
getEditInfo(obj) {
this.AssitMsg.Id = obj.Id;
this.AssitMsg.AssistId = obj.AssistId;
this.AssitMsg.AssistType = obj.AssistType;
this.isShowAdd = true;
this.changeData();
},
getGuwenEditInfo(obj) {
this.getRole();
this.AssitMsg.Id = obj.Id;
this.AssitMsg.AssistId = obj.AssistId;
this.AssitMsg.AssistType = obj.AssistType;
this.isShowAdd = true;
}
}
}
};
</script>
};
</script>
\ No newline at end of file
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