<template>
|
<div class="notice">
|
<el-dialog
|
v-model="dialogVisible"
|
:title="state.title"
|
width="50%"
|
:before-close="handleClose"
|
>
|
<el-table v-loading="state.loading" :data="state.dataList" :border="true">
|
<el-table-column label="创建时间" prop="createTime" align="center" width="180" />
|
<el-table-column label="变动来源" prop="origin" align="center" />
|
<el-table-column label="变动情况" prop="modifyPeriodMin" align="center" />
|
<el-table-column label="变动后剩余" prop="remainPeriodMin" align="center" />
|
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180">-->
|
<!-- <template #default="scope">-->
|
<!-- <el-button link type="danger" @click="handleDelete(scope.row)">删除</el-button>-->
|
<!-- </template>-->
|
<!-- </el-table-column>-->
|
</el-table>
|
<pagination
|
v-show="state.total > 0"
|
:total="state.total"
|
v-model:page="state.queryParams.pageNum"
|
v-model:limit="state.queryParams.pageSize"
|
@pagination="getList"
|
/>
|
</el-dialog>
|
</div>
|
</template>
|
<script setup>
|
import {reactive, ref, toRefs} from 'vue'
|
import {ElMessage} from "element-plus";
|
|
import {
|
getClassification
|
} from "@/api/onlineEducation/courseClass";
|
import {addCourse, checkCourseName, editCourse, getCourseById} from "@/api/onlineEducation/courseManage";
|
import {getToken} from "@/utils/auth";
|
import {delPic, getBannerById} from "@/api/onlineEducation/banner";
|
import Cookies from "js-cookie";
|
import {addQuestionBank, checkQuestionBankName, editQuestionBank} from "@/api/onlineEducation/questionBank";
|
import {getBatch, getCompanyPeriod} from "@/api/onlineEducation/batch";
|
|
const dialogVisible = ref(false);
|
const title = ref("");
|
const busRef = ref();
|
const length = ref()
|
const emit = defineEmits(["getList"]);
|
const startUsername = ref('');
|
const classifyRef = ref(null)
|
|
const state = reactive({
|
loading: false,
|
dataList: [],
|
queryParams: {
|
pageNum: 1,
|
pageSize: 10,
|
companyId: null
|
},
|
total: 0,
|
title: ''
|
})
|
|
const openDialog = async (value) => {
|
state.title = '课时余量变动明细'
|
dialogVisible.value = true;
|
state.queryParams.companyId = value
|
await getList()
|
}
|
const getList = async () => {
|
state.loading = true
|
const res = await getCompanyPeriod(state.queryParams)
|
if(res.code == 200){
|
state.dataList = res.data.list.map(item => {
|
return {
|
...item,
|
modifyPeriodMin: item.modifyPeriod ? (item.modifyPeriod /60).toFixed(2).replace(/\.00$/, '')+'分钟' : '',
|
remainPeriodMin: item.remainPeriod ? (item.remainPeriod /60).toFixed(2).replace(/\.00$/, '')+'分钟' : ''
|
}
|
})
|
state.total = res.data.total
|
}else{
|
ElMessage.warning(res.message)
|
}
|
state.loading = false
|
}
|
|
const handleClose = () => {
|
dialogVisible.value = false;
|
emit("getList")
|
|
}
|
|
defineExpose({
|
openDialog
|
});
|
|
</script>
|
|
<style scoped lang="scss">
|
.notice{
|
:deep(.el-form .el-form-item__label) {
|
font-size: 15px;
|
}
|
.file {
|
display: flex;
|
flex-direction: column;
|
align-items: flex-start;
|
}
|
}
|
</style>
|