Commit dbf06a39 authored by 黄奎's avatar 黄奎

页面修改

parent 5c52308a
<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>
<!--课程顾问 或有教师权限--> <!--课程顾问 或有教师权限-->
<template <template v-if="
v-if="
userInfo.IsCourseConsultant == 1 || userInfo.IsCourseConsultant == 1 ||
isHaveTeacherEdit || isHaveTeacherEdit ||
isHaveXueManager 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>
<template v-else> <template v-else>
<span class="text-grey-4">抱歉,你没有权限邀请其他服务人员</span> <span class="text-grey-4">抱歉,你没有权限邀请其他服务人员</span>
</template> </template>
<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="changeData" v-model="AssitMsg.AssistType"
filled option-value="Id" :options="AssistDropList" label="角色" dense use-input class="col-6 q-pb-lg q-pr-lg"
stack-label emit-value map-options />
option-label="Name" <q-select filled dense v-if="AssitMsg.AssistType == 2" v-model="AssitMsg.AssistId" :options="RoleListData"
@input="changeData" option-label="EmployeeName" class="col-6 q-pb-lg" option-value="Id" emit-value use-input map-options />
v-model="AssitMsg.AssistType" <q-select filled dense v-else-if="AssitMsg.AssistType == 4" v-model="AssitMsg.AssistId" :options="TeacherList"
option-value="Id" option-label="EmployeeName" class="col-6 q-pb-lg" option-value="Id" emit-value use-input map-options />
:options="AssistDropList" <q-select filled dense v-else v-model="AssitMsg.AssistId" @filter="filterEmployee" use-input
label="角色" :options="myEmployeeList" option-label="EmployeeName" class="col-6 q-pb-lg" option-value="Id" emit-value
dense map-options />
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> <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>
...@@ -144,57 +76,25 @@ ...@@ -144,57 +76,25 @@
<td>{{ item.AssistTypeName }}</td> <td>{{ item.AssistTypeName }}</td>
<td>{{ item.AssistName }}</td> <td>{{ item.AssistName }}</td>
<td> <td>
<template <template v-if="
v-if="
userInfo.IsCourseConsultant == 1 || userInfo.IsCourseConsultant == 1 ||
isHaveTeacherEdit || isHaveTeacherEdit ||
isHaveXueManager isHaveXueManager
" ">
> <div v-if="
<div
v-if="
userInfo.IsCourseConsultant == 1 && userInfo.IsCourseConsultant == 1 &&
(item.AssistType == 2 || item.AssistType == 3) (item.AssistType == 2 || item.AssistType == 3 || item.AssistType == 5)
" ">
> <q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="修改"
<q-btn @click="getEditInfo(item)"></q-btn>
flat <q-btn flat size="xs" icon="delete" color="negative" style="font-weight:400" label="删除"
size="xs" @click="deleteAssits(item.Id)" />
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>
<div v-if="isHaveTeacherEdit && item.AssistType == 4"> <div v-if="isHaveTeacherEdit && 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>
</template> </template>
</td> </td>
...@@ -204,219 +104,227 @@ ...@@ -204,219 +104,227 @@
</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 {
import { mapState } from "vuex"; queryEmployee
} from "../../../api/users/user";
import {
mapState
} from "vuex";
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: {
StuId: 1
}, },
isShowEdit: false, BelongType: {
dataList: [], type: Number,
page_Count: 0, default: null
AssistDropList: [], //下拉数据 }
RoleListData: [], //课程顾问下拉数据 },
TeacherList: [], //教师列表 data() {
employeeList: [], return {
myEmployeeList: [], isShowAdd: false,
userInfo: {} AssitMsg: {
}; StuId: 1, //学员编号
}, Id: 0, //编号
created() { AssistId: "", //员工编号
this.userInfo = this.getLocalStorage(); AssistType: "" //类型
if (this.saveObj && this.saveObj.StuId) { },
this.AssitMsg.StuId = this.saveObj.StuId; msg: {
this.msg.StuId = this.saveObj.StuId; StuId: 1
} },
}, isShowEdit: false,
computed: mapState({ dataList: [],
isHaveTeacherEdit(state) { page_Count: 0,
if ( AssistDropList: [], //下拉数据
state.user.userInfo && RoleListData: [], //课程顾问下拉数据
state.user.userInfo.ActionMenuList && TeacherList: [], //教师列表
state.user.userInfo.ActionMenuList.length > 0 employeeList: [],
) { myEmployeeList: [],
let action = state.user.userInfo.ActionMenuList.find(x => { userInfo: {}
if (x.FunctionCode == "Query_TeacherAssist") { };
return x; },
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();
mounted() { this.GetAssistTypeList();
this.getList(); },
this.GetAssistTypeList(); methods: {
}, //获取协助人员
methods: { GetAssistTypeList() {
//获取协助人员 this.AssistDropList = [];
GetAssistTypeList() { GetAssistTypeList({}).then(res => {
this.AssistDropList = []; if (res.Code == 1) {
GetAssistTypeList({}).then(res => { let tempData = res.Data;
if (res.Code == 1) {
let template = res.Data;
template.forEach(x => {
if (this.userInfo.IsCourseConsultant == 1) { if (this.userInfo.IsCourseConsultant == 1) {
if (x.Id != 1) { tempData.forEach(x => {
this.AssistDropList.push(x); if (x.Id == 2 || x.Id == 3 || x.Id == 5) {
}
if (x.Id == 4 && this.isHaveTeacherEdit) {
this.AssistDropList.push(x);
}
} else if (this.userInfo.IsCourseConsultant == 0) {
if (this.isHaveTeacherEdit) {
if (x.Id == 4) {
this.AssistDropList.push(x); 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;
}); });
} }
}); if (this.AssitMsg.AssistType == 4) {
}, queryObj.AccountTypeStr = "2";
changeData() { queryEmployee(queryObj).then(res => {
var queryObj = { this.TeacherList = res.Data;
IsLeave: 1, });
UserRole: 0, } else {
AccountTypeStr: "" queryObj.UserRole = 0;
}; queryEmployee(queryObj).then(res => {
if (this.AssitMsg.AssistType == 2) { this.employeeList = res.Data;
queryObj.UserRole = 2; this.myEmployeeList = res.Data;
queryEmployee(queryObj).then(res => { });
this.RoleListData = res.Data; }
}); },
} //筛选员工
if (this.AssitMsg.AssistType == 4) { filterEmployee(val, update, abort) {
queryObj.AccountTypeStr = "2"; update(() => {
queryEmployee(queryObj).then(res => { this.myEmployeeList = this.employeeList.filter(
this.TeacherList = res.Data; v => v.EmployeeName.indexOf(val) > -1
}); );
} else {
queryObj.UserRole = 0;
queryEmployee(queryObj).then(res => {
this.employeeList = res.Data;
this.myEmployeeList = res.Data;
}); });
} },
}, //保存协同人员
//筛选员工 saveAssit() {
filterEmployee(val, update, abort) { SetStudentAssist(this.AssitMsg)
update(() => { .then(res => {
this.myEmployeeList = this.employeeList.filter( if (res.Code == 1) {
v => v.EmployeeName.indexOf(val) > -1 this.$q.notify({
); icon: "iconfont icon-chenggong",
}); color: "accent",
}, timeout: 2000,
//保存协同人员 message: "数据保存成功!",
saveAssit() { position: "top"
SetStudentAssist(this.AssitMsg) });
.then(res => { this.$emit("success");
if (res.Code == 1) { this.getList();
this.$q.notify({ this.isShowAdd = false;
icon: "iconfont icon-chenggong", this.clearMsg();
color: "accent", }
timeout: 2000, })
message: "数据保存成功!", .catch(() => {});
position: "top" },
}); clearMsg() {
this.$emit("success"); this.AssitMsg.Id = 0;
this.getList(); this.AssitMsg.AssistId = 0;
this.isShowAdd = false; this.AssitMsg.AssistType = 0;
this.clearMsg(); },
} //获取数据
}) getList() {
.catch(() => {}); GetStudentAssistList(this.msg)
}, .then(res => {
clearMsg() { if (res.Code == 1) {
this.AssitMsg.Id = 0; this.dataList = res.Data;
this.AssitMsg.AssistId = 1; }
this.AssitMsg.AssistType = 1; })
}, .catch(() => {});
//获取数据 },
getList() { //删除协同
GetStudentAssistList(this.msg) deleteAssits(Id) {
.then(res => { let that = this;
if (res.Code == 1) { this.$q
this.dataList = res.Data; .dialog({
} title: "提示信息",
}) message: "是否确定删除?",
.catch(() => {}); cancel: true,
}, persistent: true,
//删除协同 ok: "确定",
deleteAssits(Id) { cancel: "取消"
let that = this; })
this.$q .onOk(() => {
.dialog({ RemoveStudentAssist({
title: "提示信息", Id: Id
message: "是否确定删除?", }).then(res => {
cancel: true, that.$q.notify({
persistent: true, icon: "iconfont icon-chenggong",
ok: "确定", timeout: 2000,
cancel: "取消" message: res.Message,
}) position: "top"
.onOk(() => { });
RemoveStudentAssist({ that.getList();
Id: Id
}).then(res => {
that.$q.notify({
icon: "iconfont icon-chenggong",
timeout: 2000,
message: res.Message,
position: "top"
}); });
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.changeData();
this.isShowAdd = true; },
this.changeData(); 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
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