|
|
@@ -50,6 +50,21 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ plain
|
|
|
+ icon="el-icon-download"
|
|
|
+ size="mini"
|
|
|
+ :loading="exportLoading"
|
|
|
+ @click="handleStatisExport"
|
|
|
+ v-hasPermi="['course:courseWatchLog:statisticsExport']"
|
|
|
+ >导出</el-button>
|
|
|
+ </el-col>
|
|
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
<el-table v-if="'济南联志健康' == this.signProjectName" border v-loading="loading" :data="courseWatchLogList" @selection-change="handleSelectionChange" show-summary :summary-method="getSummaries">
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
<el-table-column label="企微员工名称" align="center" prop="qwUserName" />
|
|
|
@@ -96,7 +111,18 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listCourseWatchLog, getCourseWatchLog, delCourseWatchLog, addCourseWatchLog, updateCourseWatchLog, exportCourseWatchLog,statisticsList,getSignProjectName } from "@/api/course/qw/courseWatchLog";
|
|
|
+import {
|
|
|
+ listCourseWatchLog,
|
|
|
+ getCourseWatchLog,
|
|
|
+ delCourseWatchLog,
|
|
|
+ addCourseWatchLog,
|
|
|
+ updateCourseWatchLog,
|
|
|
+ exportCourseWatchLog,
|
|
|
+ statisticsList,
|
|
|
+ getSignProjectName,
|
|
|
+ exportCourseWatchLogStatisticsExport,
|
|
|
+ exportCourseWatchLogStatisticsExportQw
|
|
|
+} from '@/api/course/qw/courseWatchLog'
|
|
|
import { courseList,videoList } from '@/api/course/courseRedPacketLog'
|
|
|
import {getCompanyList} from "@/api/company/company";
|
|
|
export default {
|
|
|
@@ -179,20 +205,35 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
- getSummaries(param) {
|
|
|
+
|
|
|
+ handleStatisExport(){
|
|
|
+ const queryParams = this.queryParams;
|
|
|
+ this.$confirm('是否确认导出所有会员看课统计数据项?', "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ this.exportLoading = true;
|
|
|
+ return exportCourseWatchLogStatisticsExportQw(queryParams);
|
|
|
+ }).then(response => {
|
|
|
+ this.download(response.msg);
|
|
|
+ this.exportLoading = false;
|
|
|
+ }).catch(() => {});
|
|
|
+ },
|
|
|
+ getSummaries(param) {
|
|
|
const { columns, data } = param;
|
|
|
const sums = [];
|
|
|
// 关键改动:创建一个不包含最后一行的新数据数组
|
|
|
// 如果数据长度大于1,则截取掉最后一行;否则,使用空数组避免错误
|
|
|
const dataToSum = data.length > 1 ? data.slice(0, -1) : [];
|
|
|
columns.forEach((column, index) => {
|
|
|
-
|
|
|
+
|
|
|
if (index === 0) {
|
|
|
sums[index] = '页总计';
|
|
|
return;
|
|
|
}
|
|
|
const values = dataToSum.map(item => Number(item[column.property]));
|
|
|
-
|
|
|
+
|
|
|
if (!values.every(value => isNaN(value))) {
|
|
|
sums[index] = values.reduce((prev, curr) => {
|
|
|
const value = Number(curr);
|