|
|
@@ -61,7 +61,21 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
|
|
|
- <el-table border v-loading="loading" :data="courseWatchLogList" @selection-change="handleSelectionChange" show-summary height="600">
|
|
|
+ <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="handleExport"
|
|
|
+ >导出</el-button>
|
|
|
+ </el-col>
|
|
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-table border v-loading="loading" :data="courseWatchLogList" @selection-change="handleSelectionChange" show-summary :summary-method="getSummaries" height="600">
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
<!-- <el-table-column label="会员名称" align="center" prop="fsUserName" />-->
|
|
|
<el-table-column label="销售名称" align="center" prop="qwUserName" />
|
|
|
@@ -496,7 +510,18 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listCourseWatchLog, getCourseWatchLog, delCourseWatchLog, addCourseWatchLog, updateCourseWatchLog, exportCourseWatchLog,statisticsList,qwWatchLogStatisticsList,qwWatchLogAllStatisticsList } from "@/api/course/courseWatchLog";
|
|
|
+import {
|
|
|
+ listCourseWatchLog,
|
|
|
+ getCourseWatchLog,
|
|
|
+ delCourseWatchLog,
|
|
|
+ addCourseWatchLog,
|
|
|
+ updateCourseWatchLog,
|
|
|
+ exportCourseWatchLog,
|
|
|
+ statisticsList,
|
|
|
+ qwWatchLogStatisticsList,
|
|
|
+ qwWatchLogAllStatisticsList,
|
|
|
+ watchLogExport
|
|
|
+} from "@/api/course/courseWatchLog";
|
|
|
import { courseList,videoList } from '@/api/course/courseRedPacketLog'
|
|
|
import {getUserList} from "@/api/company/companyUser";
|
|
|
import {getCompanyList} from "@/api/company/company";
|
|
|
@@ -577,6 +602,55 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
+ getSummaries(param) {
|
|
|
+ const { columns, data } = param;
|
|
|
+ const sums = [];
|
|
|
+
|
|
|
+ columns.forEach((column, index) => {
|
|
|
+ if (index === 0) {
|
|
|
+ sums[index] = '合计';
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ const values = data.map(item => Number(item[column.property]));
|
|
|
+ if (
|
|
|
+ column.property &&
|
|
|
+ [
|
|
|
+ 'line', 'firstOnline', 'firstOver',
|
|
|
+ 'd1Online', 'd1Over', 'd2Online', 'd2Over',
|
|
|
+ 'd3Online', 'd3Over', 'd4Online', 'd4Over',
|
|
|
+ 'd5Online', 'd5Over', 'd6Online', 'd6Over',
|
|
|
+ 'd7Online', 'd7Over', 'd8Online', 'd8Over',
|
|
|
+ 'd9Online', 'd9Over', 'd10Online', 'd10Over',
|
|
|
+ 'd11Online', 'd11Over', 'd12Online', 'd12Over',
|
|
|
+ 'd13Online', 'd13Over', 'd14Online', 'd14Over',
|
|
|
+ 'd15Online', 'd15Over', 'd16Online', 'd16Over',
|
|
|
+ 'd17Online', 'd17Over', 'd18Online', 'd18Over',
|
|
|
+ 'd19Online', 'd19Over', 'd20Online', 'd20Over',
|
|
|
+ 'd21Online', 'd21Over', 'd22Online', 'd22Over',
|
|
|
+ 'd23Online', 'd23Over', 'd24Online', 'd24Over',
|
|
|
+ 'd25Online', 'd25Over', 'd26Online', 'd26Over',
|
|
|
+ 'd27Online', 'd27Over', 'd28Online', 'd28Over',
|
|
|
+ 'd29Online', 'd29Over', 'd30Online', 'd30Over'
|
|
|
+ ].includes(column.property)
|
|
|
+ ) {
|
|
|
+ const sum = values.reduce((prev, curr) => {
|
|
|
+ const value = Number(curr);
|
|
|
+ if (!isNaN(value)) {
|
|
|
+ return prev + value;
|
|
|
+ } else {
|
|
|
+ return prev;
|
|
|
+ }
|
|
|
+ }, 0);
|
|
|
+
|
|
|
+ sums[index] = sum;
|
|
|
+ } else {
|
|
|
+ sums[index] = '';
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ return sums;
|
|
|
+ },
|
|
|
handleSeller(){
|
|
|
if(this.queryParams.companyId != null) {
|
|
|
getUserList(this.queryParams.companyId).then(res=>{
|
|
|
@@ -732,7 +806,7 @@ export default {
|
|
|
type: "warning"
|
|
|
}).then(() => {
|
|
|
this.exportLoading = true;
|
|
|
- return exportCourseWatchLog(queryParams);
|
|
|
+ return watchLogExport(queryParams);
|
|
|
}).then(response => {
|
|
|
this.download(response.msg);
|
|
|
this.exportLoading = false;
|