dbsd_kczx/src/views/site/yuYueKeCheng/index.vue

202 lines
5.4 KiB
Vue
Raw Normal View History

<template>
2023-05-22 20:37:15 +08:00
<a-card class="rowGutter" id="yykcDom">
<template #title>
2023-04-06 00:45:01 +08:00
<span class="titleName">预约课程</span>
2023-04-09 12:39:01 +08:00
<span class="titleDownload"><a @click="downloadByUrl({url:'/downPath/tkpjb.docx',target: '_self',fileName:'线上教学听课评价表-新.docx'})">线上课堂评价表</a></span>
2023-05-19 21:31:41 +08:00
<span class="titleDownload"><a @click="downloadByUrl({url:'/downPath/tkjlb.docx',target: '_self',fileName:'东北师范大学听课记录表.docx'})">听课记录表</a></span>
2023-04-09 12:39:01 +08:00
<span class="titleDownload"><a @click="downloadByUrl({url:'/downPath/jxzlpjb.docx',target: '_self',fileName:'东北师范大学本科课堂教学质量评价表(同行专家用)'})">同行评价表</a></span>
</template>
2023-04-09 16:09:29 +08:00
<template #extra><RouterLink target='_blank' to="/site/yuyuekechengMore">查看更多</RouterLink></template>
<a-row class="rowGutter" :gutter="[16,16]">
2023-04-06 00:45:01 +08:00
<a-col :xs="{ span: 24 }" :sm="{ span: 8 }" :lg="{ span: 6 }" v-for="(item,index) in list" :key="index" class="itemBigBox">
<div class="itemDate">
{{ item.skrq }} {{ formatTime(item.hhks) }}-{{ formatTime(item.hhjs) }}
</div>
2023-04-06 00:45:01 +08:00
<div class="itemBox">
<div>
2023-04-06 00:45:01 +08:00
<div class="itemTitle"></div>
<div class="itemTtleName">{{ item.kcmc }}</div>
</div>
2023-04-06 00:45:01 +08:00
<a-divider class="itemDivider"/>
<div class="itemInteriorBox">
<a-row>
<a-col :span="16">
2023-04-06 00:45:01 +08:00
<div class="itemSkSj">{{ item.skjs }}</div>
<div class="itemKkDw">{{ item.kkdw }}</div>
</a-col>
2023-04-06 00:45:01 +08:00
<a-col :span="8" class="itemInteriorRow">
<div class="itemXkrsNum">{{ item.xkrs }}</div>
<div class="itemXkrs">选课人数</div>
</a-col>
<a-col :span="24">
2023-06-08 16:34:10 +08:00
<div class="itemSkdd">
2023-04-06 00:45:01 +08:00
{{ item.skdd }}
</div>
</a-col>
<a-col :span="24">
2023-05-31 16:21:12 +08:00
<div style="margin-top:20px;text-align:center;">
2023-04-15 09:45:50 +08:00
<a-button type="primary" class="itemYyButton" @click="tingKeZuJiAddModal.view({ ketangbiaoid: item.id })">评价</a-button>
2023-04-09 12:39:01 +08:00
<a-button type="primary" class="itemBaoCuoButton" @click="funQxyy(item)">取消预约</a-button>
</div>
</a-col>
</a-row>
</div>
</div>
</a-col>
</a-row>
</a-card>
2023-04-15 09:45:50 +08:00
<addModalPage ref="tingKeZuJiAddModal"/>
</template>
<script setup lang="ts">
2023-04-06 00:45:01 +08:00
import { ref, reactive, computed, onMounted } from 'vue';
import { TeamOutlined } from '@ant-design/icons-vue';
// import { dateUtil, formatToDate } from '/@/utils/dateUtil';
import { getUserId } from '/@/views/site/utils/index';
2023-04-09 12:39:01 +08:00
import { downloadByUrl } from '/@/utils/file/download';
import { useMessage } from '/@/hooks/web/useMessage';
2023-04-06 00:45:01 +08:00
import { defHttp } from '/@/utils/http/axios';
2023-04-15 09:45:50 +08:00
import addModalPage from '/@/views/site/tingKeZuJi/components/addModal.vue';
2023-04-09 12:39:01 +08:00
const { createMessage } = useMessage();
2023-04-06 00:45:01 +08:00
enum Api {
list = '/kcYuyue/kcYuyue/findTingkeZuJiByPage',
2023-04-09 12:39:01 +08:00
deleteOne = '/kcYuyue/kcYuyue/delete',
2023-04-09 16:09:29 +08:00
edit='/kcYuyue/kcYuyue/edit',
2023-04-06 00:45:01 +08:00
}
2023-04-15 09:45:50 +08:00
const tingKeZuJiAddModal = ref();
2023-04-09 16:09:29 +08:00
const emit = defineEmits(['ortherLoad']);
2023-04-06 00:45:01 +08:00
/**
* 列表接口
* @param params
*/
const listApi = (params) => defHttp.get({ url: Api.list, params });
const list = ref<any>([]);
onMounted(() => {
2023-04-09 16:09:29 +08:00
newFunction();
2023-04-06 00:45:01 +08:00
});
/**
* 转换时间由0012转成00:12
* @param time 四个字符时分无分隔
*/
function formatTime(time: string) {
if(!time) return '';
let t_i_m_e = time.split('');
return [t_i_m_e[0],t_i_m_e[1],':',t_i_m_e[2],t_i_m_e[3]].join('');
}
2023-04-09 12:39:01 +08:00
/**
* 取消预约
* @param record 主要获取课程id
*/
function funQxyy(record){
2023-04-09 16:09:29 +08:00
var params = {id:record.yyid,isdeleted:1}
defHttp.post({ url: Api.edit, params }, { isTransformResponse: false });
newFunction();
emit('ortherLoad');
// defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
// newFunction();
// emit('ortherLoad');
// });
2023-04-09 12:39:01 +08:00
}
2023-04-09 16:09:29 +08:00
function newFunction() {
2023-04-09 12:39:01 +08:00
listApi({ pageSize: 4, isdeleted: 0, userid: getUserId(), isOrderByNow: true }).then(res => {
list.value = (res?.records) ?? [];
});
}
2023-04-09 16:09:29 +08:00
defineExpose({
newFunction
});
</script>
<style lang="less" scoped>
2023-04-06 00:45:01 +08:00
.titleName {
font-size: 24px;
font-weight: bold;
}
.titleDownload {
padding: 15px;
}
.itemBigBox {
margin-bottom: 40px;
}
.itemDate {
border-radius: 25px;
background: #cccccc8c;
2023-06-09 08:31:51 +08:00
width: 90%;
2023-04-06 00:45:01 +08:00
margin-bottom: 0.5rem;
text-align: center;
margin: 0 auto .5rem;
padding: 0.5rem;
2023-06-09 08:31:51 +08:00
font-weight: 700;
font-size: 16px;
2023-04-06 00:45:01 +08:00
}
.itemBox {
border: 2px #eef1f2 solid;
}
.itemTitle {
width: 100%;
height: 20px;
background-color: #1c84c6;
}
.itemTtleName {
width:100%;
white-space:normal;
word-break:break-all;
overflow:hidden;
padding: 10px;
height: 70px;
font-weight: 600;
font-size: 16px;
}
.itemDivider {
margin: 0px;
color: #eef1f2;
}
.itemInteriorBox {
padding: 20px;
font-weight: 600;
}
.itemSkSj {
2023-06-08 16:34:10 +08:00
height: 38px;
2023-04-06 00:45:01 +08:00
font-size: 16px;
}
.itemKkDw {
2023-06-28 21:21:18 +08:00
height: 45px;
2023-04-06 00:45:01 +08:00
font-size: 14px;
}
.itemInteriorRow {
text-align: center;
height: 70px;
}
.itemXkrsNum {
color: #1c84c6;
font-size: 24px;
font-weight: 600;
}
.itemXkrs {
font-size: 14px;
2023-06-08 16:34:10 +08:00
font-weight: 600;
2023-04-06 00:45:01 +08:00
}
.itemSkdd {
height: 60px;
}
.itemYyButton {
background-color: #1c84c6;
font-weight: 600;
2023-04-09 12:39:01 +08:00
border-radius: 5px;
2023-04-06 00:45:01 +08:00
}
.itemBaoCuoButton {
background-color: #1c84c6;
font-weight: 600;
2023-04-09 12:39:01 +08:00
border-radius: 5px;
2023-05-31 16:21:12 +08:00
margin-left: 15px;
2023-04-06 00:45:01 +08:00
}
</style>