Commit 549edfed authored by Mac's avatar Mac

1

parent 189d7c84
import request from '../../utils/request' import request from '../../utils/request'
/** /**
* 获取部门分页列表 * 获取学员出勤情况
*/ */
export function getDeptPage(data) { export function getStudentAttendanceDayStatistics(data) {
return request({ return request({
url: '/User/GetDeptPageList', url: '/stu/GetStudentAttendanceDayStatistics',
method: 'post', method: 'post',
data data
}); });
......
<style>
.studentManage .el-input {
width: 100%;
border: none;
background-color: transparent;
}
.studentManage .el-input__inner {
width: 100%;
border: none;
background-color: transparent;
}
</style>
<template> <template>
<div class="page-body"> <div class="page-body studentManage">
<div class="page-search row items-center"> <div class="page-search row items-center " >
<div class="col row wrap q-mr-lg q-col-gutter-md"> <div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3"> <div class="col-3">
<q-input @input="resetSearch" clearable standout="bg-primary text-white" v-model="msg.CourseName" label="课程名称" <q-select @input="getClass" standout="bg-primary text-white" option-value="SId" option-label="SName"
@clear="resetSearch" maxlength="20" /> v-model="msg.School_Id" :options="schoolList" emit-value map-options label="关联校区" />
</div> </div>
<div class="col-3"> <div class="col-3">
<select-tree :treeData="TreeCategoryList" :defaultArray="returnString" nodeKey="CateId" :multiple="true" <q-select @input="getClass" standout="bg-primary text-white" option-value="CourseId"
labelKey="CateName" childrenKey="ChildList" tipText="课程系列" @getChild="getChild"></select-tree> option-label="CourseName" v-model="msg.CouseId" :options="CourseList" emit-value map-options label="课程" @change=""
use-input @filter="filterCourse">
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
未找到相关数据
</q-item-section>
</q-item>
</template>
</q-select>
</div>
<div class="col-3">
<q-select @input="refreshPage" standout="bg-primary text-white" option-value="ClassId"
option-label="ClassName" v-model="msg.ClassId" :options="ClassList" emit-value map-options label="班级"
use-input @filter="filterClass" />
</div>
<div class="col-3 Sysuser_Date">
<q-field filled>
 <template v-slot:control>
<el-date-picker v-model="msg.StartDate" type="date" placeholder="开始日期" value-format="yyyy-MM-dd" :picker-options="option" :clearable ='false'
@change="resetSearch">
</el-date-picker>    
</template>
</q-field>
</div> </div>
<div class="col-3"> <div class="col-3">
<q-input @input="resetSearch" clearable standout="bg-primary text-white" v-model="msg.GuestName" label="学生名称" <q-input @input="resetSearch" clearable standout="bg-primary text-white" v-model="msg.GuestName" label="学生名称"
...@@ -25,131 +62,59 @@ ...@@ -25,131 +62,59 @@
<q-space /> <q-space />
</template> </template>
<template v-slot:body-cell-CoverImg="props"> <template v-slot:body-cell-GuestName="props">
<q-td :props="props">
<q-img :src="props.value" spinner-color="white" style="height: 54px; max-width: 100px"
class="rounded-borders">
</q-img>
</q-td>
</template>
<template v-slot:body-cell-CourseIntro="props">
<q-td :props="props">
<span v-html="props.value"></span>
</q-td>
</template>
<template v-slot:body-cell-PreferentialList="props">
<q-td :props="props" style="padding-right:0px"> <q-td :props="props" style="padding-right:0px">
<div v-for="x in props.value"> <div v-for="x in props.row.GuestList">
<div class="border-bottom" v-if="x.PriceDiscountType == 1"> <div class="border-bottom" >
{{ x.BuyNum }}{{ x.SendNum }} {{ x.GuestName }}
</div>
<div class="border-bottom" v-if="x.PriceDiscountType == 2">
单人报名享优惠{{x.PriceMoney }}%
</div>
<div class="border-bottom" v-if="x.PriceDiscountType == 3">
双人报名优惠{{x.PriceMoney }}%
</div>
<div class="border-bottom" v-if="x.PriceDiscountType == 4">
续费享优惠{{x.PriceMoney }}%
</div> </div>
<div class="remark-font" v-if="x.PriceDiscountType == 0">
暂无优惠政策
</div> </div>
</div> <div v-if="!props.row.GuestList || props.row.GuestList.length == 0">
<div v-if="!props.value || props.value.length == 0"> <div class="remark-font">暂无</div>
<div class="remark-font">暂无优惠政策</div>
</div> </div>
</q-td> </q-td>
</template> </template>
<template v-slot:body-cell-PreferentialListSellCommission="props"> <template v-slot:body-cell-CurrentDeductionHours="props">
<q-td :props="props" style="padding-right:0px;padding-left:0px"> <q-td :props="props" >
<div v-for="x in props.value"> <div v-for="x in props.row.GuestList">
<div class="border-bottom" style="padding-left: 16px;padding-right: 16px" <div class="border-bottom" >
:class="{ 'text-red': x.SaleCommissionType == 1 }" v-if="x.PriceDiscountType != 0"> {{ x.CurrentDeductionHours }}
{{ x.SaleCommissionType == 1 ? "¥" : ""
}}{{ x.SaleCommissionMoney
}}{{ x.SaleCommissionType == 0 ? "%" : "" }}
</div>
<div v-if="x.PriceDiscountType == 0">
<div class="remark-font">暂无佣金信息</div>
</div> </div>
</div> </div>
<div v-if="!props.value || props.value.length == 0"> <div v-if="!props.row.GuestList || props.row.GuestList.length == 0">
<div class="remark-font">暂无佣金信息</div> <div class="remark-font">暂无</div>
</div> </div>
</q-td> </q-td>
</template> </template>
<template v-slot:body-cell-PreferentialListB2BCommission="props"> <template v-slot:body-cell-CheckStatus="props">
<q-td :props="props" style="padding-left:0px"> <q-td :props="props" >
<div v-for="x in props.value"> <div v-for="x in props.row.GuestList">
<div class="border-bottom" style="padding-left: 16px" :class="{ 'text-red': x.B2BCommissionType == 1 }" <div class="border-bottom" >
v-if="x.PriceDiscountType != 0"> <span v-if="x.CheckStatus == 0">正常</span>
{{ x.B2BCommissionType == 1 ? "¥" : "" <span v-if="x.CheckStatus == 1">缺席</span>
}}{{ x.B2BCommissionMoney <span v-if="x.CheckStatus == 2">请假</span>
}}{{ x.B2BCommissionType == 0 ? "%" : "" }}
</div>
<div v-if="x.PriceDiscountType == 0">
<div class="remark-font">暂无佣金信息</div>
</div> </div>
</div> </div>
<div v-if="!props.value || props.value.length == 0"> <div v-if="!props.row.GuestList || props.row.GuestList.length == 0">
<div class="remark-font">暂无佣金信息</div> <div class="remark-font">暂无</div>
</div> </div>
</q-td> </q-td>
</template> </template>
<template v-slot:body-cell-EducationCommission="props">
<q-td :props="props" style="padding-left:0px">
<div v-for="x in props.value">
<div class="border-bottom" style="padding-left: 16px" :class="{ 'text-red': x.EduCommissionType == 1 }"
v-if="x.PriceDiscountType != 0">
{{ x.EduCommissionType == 1 ? "¥" : ""
}}{{ x.EduCommissionMoney
}}{{ x.EduCommissionType == 0 ? "%" : "" }}
</div>
<div v-if="x.PriceDiscountType == 0">
<div class="remark-font">暂无佣金信息</div>
</div>
</div>
<div v-if="!props.value || props.value.length == 0">
<div class="remark-font">暂无佣金信息</div>
</div>
</q-td>
</template>
<template v-slot:body-cell-Status="props">
<q-td :props="props">
<q-badge :color="props.value == 1 ? 'negative' : 'primary'" :label="props.value == 0 ? '正常' : '删除'" />
</q-td>
</template>
<template v-slot:bottom> <template v-slot:bottom>
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount" <!-- <q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount"
:input="true" @input="changePage" /> :input="true" @input="changePage" /> -->
</template> </template>
<template v-slot:body-cell-optioned="props"> <template v-slot:body-cell-optioned="props">
<q-td :props="props"> <q-td :props="props" >
<div v-for="x in props.row.GuestList">
<div class="border-bottom" >
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑" <q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑"
@click="EditCourse(props.row, 1)" /> @click="EditCourse(props.row, 1)" />
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="价格设置" </div>
@click="EditCourse(props.row, 2)" v-if="isHavePriceAction" /> </div>
<q-btn-dropdown flat size="xs" color="dark" label="更多" style="margin-left:10px;">
<q-list>
<q-item clickable v-close-popup @click="DeleteCourse(props.row,1)" v-if="props.row.Status==0">
<q-item-section>
<q-item-label>删除</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="DeleteCourse(props.row,0)" v-if="props.row.Status==1">
<q-item-section>
<q-item-label>恢复</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="goMycourse(props.row)">
<q-item-section>
<q-item-label>课程详情</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</q-td> </q-td>
</template> </template>
</q-table> </q-table>
...@@ -162,7 +127,18 @@ ...@@ -162,7 +127,18 @@
queryCourseCategoryTree, queryCourseCategoryTree,
deleteCourseInfo deleteCourseInfo
} from "../../api/course/index"; } from "../../api/course/index";
import {
queryCourseDropdownList,
} from '../../api/course/index' //课程下拉
//获取校区列表
import {
getSchoolDropdown,
deleteClass,
getClassDropDownList
} from '../../api/school/index';
import{
getStudentAttendanceDayStatistics
} from "../../api/stuMan/index"
import selectTree from "../../components/common/select-tree"; import selectTree from "../../components/common/select-tree";
import { openURL } from "quasar"; import { openURL } from "quasar";
...@@ -175,99 +151,70 @@ ...@@ -175,99 +151,70 @@
}, },
data() { data() {
return { return {
currentUrl: "", columns: [
columns: [{
name: "CoverImg",
label: "课程封面",
field: "CoverImg",
align: "left"
},
{ {
name: "CourseName", name: "ClassName",
required: true, required: true,
label: "课程名称", label: "班级",
align: "left", align: "left",
field: row => row.CourseName field: row => row.ClassName
}, },
{ {
name: "CateName", name: "CourseName",
required: true, required: true,
label: "系列", label: "课程",
align: "left", align: "left",
field: row => row.CateName field: row => row.CourseName
}, },
{ {
name: "OriginalPrice", name: "TeacherName",
required: true, required: true,
label: "原价", label: "老师",
align: "left", align: "left",
field: row => row.OriginalPrice.toFixed(2) field: row => row.TeacherName
}, },
{ {
name: "SellPrice", name: "ClassDate",
required: true, required: true,
label: "售价", label: "上课日期",
align: "left", align: "left",
field: row => row.SellPrice.toFixed(2) field: row => row.ClassDate
}, },
{ {
name: "PreferentialList", name: "TimeBucket",
required: true, required: true,
label: "优惠政策", label: "上课时间段",
align: "left", align: "left",
field: row => row.PreferentialList field: row => row.TimeBucket
}, },
{ {
name: "PreferentialListSellCommission", name: "GuestName",
required: true, required: true,
label: "销售佣金", label: "学生",
align: "left", align: "left",
field: row => row.PreferentialList field: row => row.GuestName
}, },
{ {
name: "PreferentialListB2BCommission", name: "CurrentDeductionHours",
required: true, required: true,
label: "同行佣金", label: "课时",
align: "left", align: "left",
field: row => row.PreferentialList field: row => row.CurrentDeductionHours
}, },
{ {
name: "EducationCommission", name: "CheckStatus",
required: true, required: true,
label: "教育同行佣金",
align: "left",
field: row => row.PreferentialList
},
{
name: "ClassHours",
label: "课时长度",
field: "ClassHours",
align: "left",
format: (val, row) => `${val}课时`
},
{
name: "CreateByName",
label: "创建人",
field: "CreateByName",
align: "left"
},
{
name: "UpdateTimeStr",
label: "更新时间",
field: "UpdateTimeStr",
align: "left"
},
{
name: "Status",
label: "状态", label: "状态",
align: "left", align: "left",
field: "Status" field: row => row.CheckStatus
}, },
{ {
name: "optioned", name: "optioned",
label: "操作", label: "操作",
field: "CourseId" align: "left",
field: row => row.optioned
} }
], ],
data: [], data: [],
...@@ -286,91 +233,127 @@ ...@@ -286,91 +233,127 @@
} }
], ],
msg: { msg: {
StartDate:'', StartDate:'2021-07-20',
School_Id:-1, School_Id:-1,
CouseId:'', CouseId:0,
ClassId:'', ClassId:0,
OrderGuestId:'', OrderGuestId:'',
GuestName:'', GuestName:'',
}, },
//课程分类树形列表 //课程分类树形列表
TreeCategoryList: [], TreeCategoryList: [],
returnString: [], //默认值 returnString: [], //默认值
pageCount: 0, CourseList: [], //关联课程下拉数据
isShowCourseForm: false, //是否显示课程表单 AllCourseList: [],
isShowCoursePriceForm: false, //是否显示课程价格表单 ClassList: [], //班级下拉
courseObjOption: null, //课程对象 allClassList: [],
isShowPriceEditBtn: 1 //是否显示价格设置
option:{
disabledDate:(time)=> {
return time.getTime() > Date.now()
}
},
schoolList: [],
}; };
}, },
mounted() { mounted() {
if(this.$route.query && this.$route.query.Name){//从订单完成统计跳转过来的带的参数 let d = new Date();
this.msg.CourseName = decodeURI(this.$route.query.Name) let year = d.getFullYear();
} let month = d.getMonth() + 1;
this.getCategorytree(); month = month < 10 ? '0' + month : month;
this.currentUrl = this.$route.path; let day = d.getDate();
this.getcourselist(); day = day < 10 ? '0' + day : day;
let today = year + '-' + month + '-' + day;
this.msg.StartDate = today;
this.getlist();
this.getSchool()
this.getClass()
this.getCourseList()
}, },
methods: { methods: {
//删除课程 //获取校区列表
DeleteCourse(item, status) { getSchool() {
let delMsg = { getSchoolDropdown({}).then(res => {
CourseId: item.CourseId, if (res.Code == 1) {
Status: status var tempArray = res.Data;
}; if (!tempArray) {
var message = "是否要删除该课程?"; tempArray = [];
if (status == 0) { }
message = "是否要恢复该课程?"; tempArray.unshift({
SId: -1,
SName: "不限"
})
this.schoolList = tempArray;
} }
this.$q.dialog({ })
title: '提示信息', },
message: message, //获取课程
cancel: true, getCourseList() {
persistent: true, queryCourseDropdownList({
ok: "确定", IsQPrice: 1
cancel: "取消", }).then(res => {
}).onOk(() => {
deleteCourseInfo(delMsg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.$q.notify({ this.CourseList = res.Data;
icon: 'iconfont icon-chenggong', var obj = {
color: 'accent', CourseName: '不限',
timeout: 2000, CourseId: 0
message: '删除成功!', }
position: 'top' this.CourseList.unshift(obj);
this.AllCourseList = JSON.parse(JSON.stringify(this.CourseList));
}
}) })
this.getcourselist(); },
//筛选课程
filterCourse(val, update) {
update(() => {
if (val === '') {
this.CourseList = JSON.parse(JSON.stringify(this.AllCourseList))
} else { } else {
this.$q.notify({ const needle = val.toLowerCase();
icon: 'iconfont icon-chenggong', this.CourseList = this.AllCourseList.filter(v => v.CourseName.toLowerCase().indexOf(needle) > -1);
color: 'accent',
timeout: 2000,
message: res.Message,
position: 'top'
})
} }
}) })
}).onCancel(() => {
});
}, },
gotoSub(obj, routeStr) { //获取班级下拉
var tempStr = "/course/" + routeStr + "?CourseId=" + obj.CourseId; getClass() {
this.$router.push({
path: tempStr getClassDropDownList({
CourseId: this.msg.CouseId,
SchoolId:this.msg.School_Id,
IsAddDefault: 0, //添加默认选项
}).then(res => {
if (res.Code == 1) {
var jsonData = res.Data;
jsonData.unshift({
ClassId: 0,
ClassName: "不限"
})
if (jsonData && jsonData.length > 0) {
this.ClassList = JSON.parse(JSON.stringify(jsonData));
this.allClassList = JSON.parse(JSON.stringify(jsonData));;
}
this.msg.ClassId = 0
this.refreshPage()
}
}); });
}, },
//分类改变 //筛选班级
getChild(cateObj) { filterClass(val, update) {
var tempStr = ""; update(() => {
if (cateObj && cateObj != "") { if (val === '') {
tempStr = cateObj; this.ClassList = JSON.parse(JSON.stringify(this.allClassList))
} else {
const needle = val.toLowerCase()
this.ClassList = this.allClassList.filter(v => v.ClassName.toLowerCase().indexOf(needle) > -1)
} }
this.msg.QCateIds = tempStr; })
this.msg.pageIndex = 1; },
this.getcourselist(); schoolChange(){
}, },
getCategorytree() { getCategorytree() {
this.TreeCategoryList = []; this.TreeCategoryList = [];
var qMsg = {}; var qMsg = {};
...@@ -380,21 +363,16 @@ ...@@ -380,21 +363,16 @@
}, },
//重新查询 //重新查询
resetSearch() { resetSearch() {
this.getcourselist(); this.getlist();
},
//翻页
changePage(val) {
this.msg.pageIndex = val;
this.getcourselist();
}, },
//获取菜单分页列表 //获取菜单分页列表
getcourselist() { getlist() {
this.loading = true; this.loading = true;
queryCoursePage(this.msg) getStudentAttendanceDayStatistics(this.msg)
.then(res => { .then(res => {
this.loading = false; this.loading = false;
this.data = res.Data.PageData; this.data = res.Data;
this.pageCount = res.Data.PageCount;
}) })
.catch(() => { .catch(() => {
this.loading = false; this.loading = false;
...@@ -402,34 +380,15 @@ ...@@ -402,34 +380,15 @@
}, },
//刷新页面 //刷新页面
refreshPage() { refreshPage() {
this.isShowCourseForm = false; this.getlist();
this.isShowCoursePriceForm = false;
this.getcourselist();
},
//新增修改课程及价格
EditCourse(obj, type) {
if (obj) {
this.courseObjOption = obj;
} else {
this.courseObjOption = null;
}
if (type == 1) {
this.isShowCourseForm = true;
} else {
this.isShowCoursePriceForm = true;
}
}, },
//关闭弹窗 EditCourse(){
closeMenuSaveForm() {
this.isShowCourseForm = false;
this.isShowCoursePriceForm = false;
}, },
//跳转至我的课程 //跳转至我的课程
goMycourse(obj) { goMycourse(obj) {
var tempStr = window.location.origin +"/#/course/courseinfo?CourseId=" + obj.CourseId; var tempStr = window.location.origin +"/#/course/courseinfo?CourseId=" + obj.CourseId;
// this.$router.push({
// path: tempStr
// });
openURL(tempStr) openURL(tempStr)
} }
} }
...@@ -446,6 +405,5 @@ ...@@ -446,6 +405,5 @@
</style> </style>
<style lang="sass"> <style lang="sass">
@import url('~assets/css/table.sass') @import url('~assets/css/table.sass')
</style> </style>
\ 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