From 1aa6aec8be8351a9bfe2d7629c4a30128eccde44 Mon Sep 17 00:00:00 2001 From: zhouwx <1175765986@qq.com> Date: 星期五, 19 七月 2024 17:27:57 +0800 Subject: [PATCH] 提交 --- src/views/onlineEducation/systemManage/company/index.vue | 71 +++++++++++++++++++++++++++-------- 1 files changed, 55 insertions(+), 16 deletions(-) diff --git a/src/views/onlineEducation/systemManage/company/index.vue b/src/views/onlineEducation/systemManage/company/index.vue index c21e81c..b3ef373 100644 --- a/src/views/onlineEducation/systemManage/company/index.vue +++ b/src/views/onlineEducation/systemManage/company/index.vue @@ -1,12 +1,30 @@ <template> <div class="app-container"> - <div style="margin-bottom: 10px"> - <el-button - type="primary" - plain - icon="Plus" - @click="openDialog('add',{})" - >新增</el-button> + <div style="display: flex;justify-content: space-between"> + <el-form :inline="true" style="display: flex;align-items: center;flex-wrap: wrap;" > + <el-form-item> + <el-button + type="primary" + plain + icon="Plus" + @click="openDialog('add',{})" + >新增</el-button> + </el-form-item> + <el-form-item label="企业名称:" > + <el-input v-model="data.queryParams.name" placeholder="请输入企业名称"></el-input> + </el-form-item> + <el-form-item > + <el-button + type="primary" + @click="getList" + >查询</el-button> + <el-button + type="primary" + plain + @click="reset" + >重置</el-button> + </el-form-item> + </el-form> </div> <!-- 表格数据 --> <el-table v-loading="loading" :data="dataList" :border="true"> @@ -15,15 +33,19 @@ <el-table-column label="企业名称" prop="name" align="center" /> <el-table-column label="负责人" prop="major" align="center" /> <el-table-column label="联系电话" prop="phone" align="center"/> - <el-table-column label="当前剩余课时(分)" prop="remainPeriod" align="center" width="150"/> - <el-table-column label="累计已用课时(分)" prop="spendPeriod" align="center" width="150"/> - <el-table-column label="总课时(分)" prop="totalPeriod" align="center"/> - <el-table-column label="课时变动详情" align="center" class-name="small-padding fixed-width" > + <el-table-column label="当前剩余课时(分)" prop="remainPeriodMin" align="center" width="150" /> + <el-table-column label="累计已用课时(分)" prop="spendPeriodMin" align="center" width="150"> <template #default="scope"> - <el-button link type="primary">查看详情</el-button> + <span>{{((scope.row.totalPeriod -scope.row.remainPeriod)/60).toFixed(2).replace(/\.00$/, '') + '分钟' }}</span> </template> </el-table-column> - <el-table-column label="操作" align="center" class-name="small-padding fixed-width" > + <el-table-column label="总课时(分)" prop="totalPeriodMin" align="center"/> + <el-table-column label="课时变动详情" align="center" class-name="small-padding fixed-width" > + <template #default="scope"> + <el-button link type="primary" @click="openDetail(scope.row)">查看详情</el-button> + </template> + </el-table-column> + <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200" > <template #default="scope"> <el-button link type="primary" @click="openDialog('distribute',scope.row)">分配课时</el-button> <el-button link type="primary" @click="openDialog('edit',scope.row)">编辑</el-button> @@ -41,6 +63,7 @@ /> <company-dialog ref="dialogRef" @getList=getList></company-dialog> + <class-hour-change ref="classHourRef" @getList=getList></class-hour-change> </div> </template> @@ -49,6 +72,7 @@ import {ElMessage, ElMessageBox} from "element-plus"; import {delCompany, getCompany} from "@/api/onlineEducation/company"; import companyDialog from "./components/companyDialog.vue"; +import classHourChange from '@/views/onlineEducation/classHourBatch/components/classHourChange.vue' const { proxy } = getCurrentInstance(); const loading = ref(false); @@ -57,13 +81,14 @@ queryParams: { pageNum: 1, pageSize: 10, + name: '' }, total: 0, dataList: [] }); const { queryParams, total, dataList } = toRefs(data); - +const classHourRef = ref(); onMounted(()=>{ getList() }) @@ -76,7 +101,13 @@ loading.value = true const res = await getCompany(data.queryParams) if(res.code == 200){ - data.dataList = res.data.list + data.dataList = res.data.list.map(item => { + return{ + ...item, + remainPeriodMin: item.remainPeriod ?(item.remainPeriod /60).toFixed(2).replace(/\.00$/, '') + '分钟':'', + totalPeriodMin:item.totalPeriod ?(item.totalPeriod /60).toFixed(2).replace(/\.00$/, '') + '分钟':'', + } + }) data.total = res.data.total }else{ ElMessage.warning(res.message) @@ -90,7 +121,12 @@ /** 重置新增的表单以及其他数据 */ function reset() { - proxy.resetForm("roleRef"); + data.queryParams = { + pageNum: 1, + pageSize: 10, + name: '' + } + getList() } const handleDelete = (val) => { ElMessageBox.confirm( @@ -112,4 +148,7 @@ }) } +const openDetail = (val) => { + classHourRef.value.openDialog(val.id) +} </script> -- Gitblit v1.9.2