|
@@ -13,7 +13,9 @@
|
|
|
<el-form-item label="添加时间" prop="createTime">
|
|
<el-form-item label="添加时间" prop="createTime">
|
|
|
<el-date-picker v-model="createTime" size="small" style="width: 220px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="change"></el-date-picker>
|
|
<el-date-picker v-model="createTime" size="small" style="width: 220px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="change"></el-date-picker>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="公司名称" prop="companyId">
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <el-form-item label="公司名称" prop="companyId" v-if="!showCompanyField"
|
|
|
|
|
+ >
|
|
|
<el-select style="width: 220px" filterable v-model="queryParams.companyId" placeholder="请选择公司名" clearable size="small">
|
|
<el-select style="width: 220px" filterable v-model="queryParams.companyId" placeholder="请选择公司名" clearable size="small">
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="item in companys"
|
|
v-for="item in companys"
|
|
@@ -22,7 +24,32 @@
|
|
|
:value="item.companyId"
|
|
:value="item.companyId"
|
|
|
/>
|
|
/>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="公司" prop="companyId" v-else>
|
|
|
|
|
+ <select-tree
|
|
|
|
|
+ v-model="selectedCompanyList"
|
|
|
|
|
+ :raw-data="deptList"
|
|
|
|
|
+ :parentSelectable="true"
|
|
|
|
|
+ placeholder="请选择销售"
|
|
|
|
|
+ :multiple="true"
|
|
|
|
|
+ component-width="300px"
|
|
|
|
|
+ :max-display-tags="3"
|
|
|
|
|
+ :check-strictly="false"
|
|
|
|
|
+ :return-leaf-only="false"
|
|
|
|
|
+ @change="handleMultiChange"
|
|
|
|
|
+ ></select-tree>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
+ <!-- <el-form-item label="公司名称" prop="companyId" v-else
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-select style="width: 220px" filterable v-model="queryParams.companyId" placeholder="请选择公司名" clearable size="small">
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in companys"
|
|
|
|
|
+ :key="item.companyId"
|
|
|
|
|
+ :label="item.companyName"
|
|
|
|
|
+ :value="item.companyId"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item> -->
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
@@ -462,11 +489,14 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+import SelectTree from "@/components/TreeSelect/index.vue";
|
|
|
|
|
+import { getDeptData } from '@/api/system/employeeStats'
|
|
|
import { listCourseWatchLog, getCourseWatchLog, delCourseWatchLog, addCourseWatchLog, updateCourseWatchLog, exportCourseWatchLog,statisticsList,qwWatchLogStatisticsList,qwWatchLogAllStatisticsList } from "@/api/course/courseWatchLog";
|
|
import { listCourseWatchLog, getCourseWatchLog, delCourseWatchLog, addCourseWatchLog, updateCourseWatchLog, exportCourseWatchLog,statisticsList,qwWatchLogStatisticsList,qwWatchLogAllStatisticsList } from "@/api/course/courseWatchLog";
|
|
|
import { courseList,videoList } from '@/api/course/courseRedPacketLog'
|
|
import { courseList,videoList } from '@/api/course/courseRedPacketLog'
|
|
|
import {getCompanyList} from "@/api/company/company";
|
|
import {getCompanyList} from "@/api/company/company";
|
|
|
export default {
|
|
export default {
|
|
|
name: "CourseWatchLog",
|
|
name: "CourseWatchLog",
|
|
|
|
|
+ components: {SelectTree},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
companys: [],
|
|
companys: [],
|
|
@@ -513,6 +543,7 @@ export default {
|
|
|
eTime:null,
|
|
eTime:null,
|
|
|
scheduleStartTime: null,
|
|
scheduleStartTime: null,
|
|
|
scheduleEndTime: null,
|
|
scheduleEndTime: null,
|
|
|
|
|
+ userIds:[],
|
|
|
},
|
|
},
|
|
|
// 表单参数
|
|
// 表单参数
|
|
|
form: {},
|
|
form: {},
|
|
@@ -520,8 +551,18 @@ export default {
|
|
|
rules: {
|
|
rules: {
|
|
|
},
|
|
},
|
|
|
scheduleTime: null,
|
|
scheduleTime: null,
|
|
|
|
|
+ // 选中的公司列表
|
|
|
|
|
+ selectedCompanyList: null,
|
|
|
|
|
+ // 部门/公司树形数据
|
|
|
|
|
+ deptList: [],
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
+computed: {
|
|
|
|
|
+ // 计算属性判断是否显示
|
|
|
|
|
+ showCompanyField() {
|
|
|
|
|
+ return process.env.VUE_APP_TITLE_INDEX === '挑宝网';
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
created() {
|
|
created() {
|
|
|
getCompanyList().then(response => {
|
|
getCompanyList().then(response => {
|
|
|
this.companys = response.data;
|
|
this.companys = response.data;
|
|
@@ -534,6 +575,7 @@ export default {
|
|
|
this.getDicts("sys_course_watch_log_type").then(response => {
|
|
this.getDicts("sys_course_watch_log_type").then(response => {
|
|
|
this.logTypeOptions = response.data;
|
|
this.logTypeOptions = response.data;
|
|
|
});
|
|
});
|
|
|
|
|
+ this.initCompanyData();
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
courseChange(row){
|
|
courseChange(row){
|
|
@@ -566,13 +608,18 @@ export default {
|
|
|
},
|
|
},
|
|
|
/** 查询短链课程看课记录列表 */
|
|
/** 查询短链课程看课记录列表 */
|
|
|
getList() {
|
|
getList() {
|
|
|
|
|
+ if(this.selectedCompanyList != null && this.selectedCompanyList.length > 0) {
|
|
|
|
|
+ this.queryParams.userIds = JSON.stringify(this.selectedCompanyList);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.queryParams.userIds = [];
|
|
|
|
|
+ }
|
|
|
this.loading = true;
|
|
this.loading = true;
|
|
|
- qwWatchLogAllStatisticsList(this.queryParams).then(response => {
|
|
|
|
|
|
|
+ qwWatchLogAllStatisticsList(this.queryParams).then(response => {
|
|
|
this.courseWatchLogList = response.rows;
|
|
this.courseWatchLogList = response.rows;
|
|
|
this.total = response.total;
|
|
this.total = response.total;
|
|
|
}).finally(()=>{
|
|
}).finally(()=>{
|
|
|
this.loading = false;
|
|
this.loading = false;
|
|
|
- })
|
|
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
// 取消按钮
|
|
// 取消按钮
|
|
|
cancel() {
|
|
cancel() {
|
|
@@ -604,6 +651,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
/** 重置按钮操作 */
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
resetQuery() {
|
|
|
|
|
+ this.selectedCompanyList = []; // 清空公司选择
|
|
|
this.resetForm("queryForm");
|
|
this.resetForm("queryForm");
|
|
|
this.createTime = null;
|
|
this.createTime = null;
|
|
|
this.scheduleTime = null;
|
|
this.scheduleTime = null;
|
|
@@ -671,6 +719,11 @@ export default {
|
|
|
},
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|
|
handleExport() {
|
|
|
|
|
+ if(this.selectedCompanyList != null && this.selectedCompanyList.length > 0) {
|
|
|
|
|
+ this.queryParams.userIds = this.selectedCompanyList;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.queryParams.userIds = [];
|
|
|
|
|
+ }
|
|
|
const queryParams = this.queryParams;
|
|
const queryParams = this.queryParams;
|
|
|
this.$confirm('是否确认导出所有短链课程看课记录数据项?', "警告", {
|
|
this.$confirm('是否确认导出所有短链课程看课记录数据项?', "警告", {
|
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
@@ -693,6 +746,17 @@ export default {
|
|
|
this.queryParams.scheduleEndTime = null;
|
|
this.queryParams.scheduleEndTime = null;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ // 公司选择框变化处理
|
|
|
|
|
+ handleMultiChange(e) {
|
|
|
|
|
+ // 处理公司选择变化
|
|
|
|
|
+ // console.log(this.selectedCompanyList)
|
|
|
|
|
+ },
|
|
|
|
|
+ // 初始化获取公司数据
|
|
|
|
|
+ initCompanyData() {
|
|
|
|
|
+ getDeptData().then(response => {
|
|
|
|
|
+ this.deptList = response.data;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|