Commit 549edfed authored by Mac's avatar Mac

1

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