|
@@ -31,8 +31,17 @@
|
|
|
/>
|
|
/>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
+ <el-form-item label="所属公司" prop="companyId">
|
|
|
|
|
+ <el-select v-model="queryParams.companyId" placeholder="请选择公司" filterable clearable size="small" @change="handleCompanyChange">
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in companyList"
|
|
|
|
|
+ :key="item.companyId"
|
|
|
|
|
+ :label="item.companyName"
|
|
|
|
|
+ :value="item.companyId"/>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="销售" prop="nickName">
|
|
<el-form-item label="销售" prop="nickName">
|
|
|
- <el-select v-model="queryParams.companyUserId" remote placeholder="请选择" filterable clearable style="width: 100%;" @keyup.enter.native="handleQuery">
|
|
|
|
|
|
|
+ <el-select v-model="queryParams.companyUserId" placeholder="请选择" filterable clearable size="small">
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="dict in companyUserList"
|
|
v-for="dict in companyUserList"
|
|
|
:key="`${dict.nickName} - ${dict.userName}`"
|
|
:key="`${dict.nickName} - ${dict.userName}`"
|
|
@@ -42,7 +51,7 @@
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<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="结束日期" :clearable="false" @change="change"></el-date-picker>
|
|
|
</el-form-item>
|
|
</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>
|
|
@@ -487,7 +496,8 @@
|
|
|
<script>
|
|
<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 } from "@/api/course/courseWatchLog";
|
|
|
import { courseList,videoList } from '@/api/course/courseRedPacketLog'
|
|
import { courseList,videoList } from '@/api/course/courseRedPacketLog'
|
|
|
-import {getUserList} from "@/api/company/companyUser";
|
|
|
|
|
|
|
+import {getUserList, getCompanyList} from "@/api/company/companyUser";
|
|
|
|
|
+import {getDicts} from "@/api/system/dict/data";
|
|
|
export default {
|
|
export default {
|
|
|
name: "CourseWatchLog",
|
|
name: "CourseWatchLog",
|
|
|
data() {
|
|
data() {
|
|
@@ -518,6 +528,7 @@ export default {
|
|
|
// 是否显示弹出层
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
open: false,
|
|
|
companyUserList: [],
|
|
companyUserList: [],
|
|
|
|
|
+ companyList: [],
|
|
|
projectLists: [],
|
|
projectLists: [],
|
|
|
// 查询参数
|
|
// 查询参数
|
|
|
queryParams: {
|
|
queryParams: {
|
|
@@ -547,14 +558,27 @@ export default {
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
|
|
+ const today = new Date();
|
|
|
|
|
+ const tomorrow = new Date(today);
|
|
|
|
|
+ tomorrow.setDate(tomorrow.getDate() + 1);
|
|
|
|
|
+ const formatDate = d => d.toISOString().split('T')[0];
|
|
|
|
|
+ this.createTime = [formatDate(today), formatDate(tomorrow)];
|
|
|
|
|
+ this.queryParams.sTime = this.createTime[0];
|
|
|
|
|
+ this.queryParams.eTime = this.createTime[1];
|
|
|
|
|
+
|
|
|
courseList().then(response => {
|
|
courseList().then(response => {
|
|
|
this.courseLists = response.list;
|
|
this.courseLists = response.list;
|
|
|
});
|
|
});
|
|
|
|
|
+ getCompanyList().then(res => {
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
|
+ this.companyList = res.data;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
this.getList();
|
|
this.getList();
|
|
|
- this.getDicts("sys_course_watch_log_type").then(response => {
|
|
|
|
|
|
|
+ getDicts("sys_course_watch_log_type").then(response => {
|
|
|
this.logTypeOptions = response.data;
|
|
this.logTypeOptions = response.data;
|
|
|
});
|
|
});
|
|
|
- this.getDicts("sys_course_project").then(response => {
|
|
|
|
|
|
|
+ getDicts("sys_course_project").then(response => {
|
|
|
this.projectLists = response.data;
|
|
this.projectLists = response.data;
|
|
|
})
|
|
})
|
|
|
if (this.queryParams.companyId != null) {
|
|
if (this.queryParams.companyId != null) {
|
|
@@ -576,8 +600,31 @@ export default {
|
|
|
this.videoList=response.list
|
|
this.videoList=response.list
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ handleCompanyChange(val) {
|
|
|
|
|
+ this.queryParams.companyUserId = null;
|
|
|
|
|
+ if (val) {
|
|
|
|
|
+ getUserList(val).then(res => {
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
|
+ this.companyUserList = res.data;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.companyUserList = [];
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
change() {
|
|
change() {
|
|
|
if (this.createTime != null) {
|
|
if (this.createTime != null) {
|
|
|
|
|
+ if (this.createTime[0] === this.createTime[1]) {
|
|
|
|
|
+ const today = new Date();
|
|
|
|
|
+ const tomorrow = new Date(today);
|
|
|
|
|
+ tomorrow.setDate(tomorrow.getDate() + 1);
|
|
|
|
|
+ const formatDate = d => d.toISOString().split('T')[0];
|
|
|
|
|
+ this.createTime = [formatDate(today), formatDate(tomorrow)];
|
|
|
|
|
+ this.queryParams.sTime = this.createTime[0];
|
|
|
|
|
+ this.queryParams.eTime = this.createTime[1];
|
|
|
|
|
+ this.$message.warning("开始时间和结束时间不能是同一天");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
this.queryParams.sTime = this.createTime[0];
|
|
this.queryParams.sTime = this.createTime[0];
|
|
|
this.queryParams.eTime = this.createTime[1];
|
|
this.queryParams.eTime = this.createTime[1];
|
|
|
} else {
|
|
} else {
|
|
@@ -628,20 +675,20 @@ export default {
|
|
|
},
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
handleQuery() {
|
|
|
- if (!this.queryParams.sTime || !this.queryParams.eTime) {
|
|
|
|
|
- this.$message.warning("请选择添加时间");
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
this.queryParams.pageNum = 1;
|
|
this.queryParams.pageNum = 1;
|
|
|
this.getList();
|
|
this.getList();
|
|
|
},
|
|
},
|
|
|
/** 重置按钮操作 */
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
resetQuery() {
|
|
|
this.resetForm("queryForm");
|
|
this.resetForm("queryForm");
|
|
|
- this.createTime = null;
|
|
|
|
|
|
|
+ const today = new Date();
|
|
|
|
|
+ const tomorrow = new Date(today);
|
|
|
|
|
+ tomorrow.setDate(tomorrow.getDate() + 1);
|
|
|
|
|
+ const formatDate = d => d.toISOString().split('T')[0];
|
|
|
|
|
+ this.createTime = [formatDate(today), formatDate(tomorrow)];
|
|
|
|
|
+ this.queryParams.sTime = this.createTime[0];
|
|
|
|
|
+ this.queryParams.eTime = this.createTime[1];
|
|
|
this.scheduleTime = null;
|
|
this.scheduleTime = null;
|
|
|
- this.queryParams.sTime = null;
|
|
|
|
|
- this.queryParams.eTime = null;
|
|
|
|
|
this.queryParams.scheduleStartTime = null;
|
|
this.queryParams.scheduleStartTime = null;
|
|
|
this.queryParams.scheduleEndTime = null;
|
|
this.queryParams.scheduleEndTime = null;
|
|
|
this.handleQuery();
|
|
this.handleQuery();
|