|
@@ -617,6 +617,11 @@ export default {
|
|
|
this.courseList = [];
|
|
|
let url = CORE_API + "/course/query?enable=true";
|
|
|
|
|
|
+ let orgId = this.formSearch.orgId;
|
|
|
+ if (!checkEmptyNumber(orgId)) {
|
|
|
+ url += "&rootOrgId=" + orgId;
|
|
|
+ }
|
|
|
+
|
|
|
if (!checkEmptyStr(query)) {
|
|
|
url += "&name=" + query;
|
|
|
}
|
|
@@ -626,56 +631,67 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
refreshStatistic() {
|
|
|
- /* 刷新当前统计信息 */
|
|
|
- this.$confirm("刷新当前统计信息?", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- if (this.selectElements.length == 0) {
|
|
|
- this.$notify({
|
|
|
- title: "提示",
|
|
|
- message: "请选择要刷新的项!",
|
|
|
- type: "warning"
|
|
|
- });
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- let params = {};
|
|
|
- params.orgId = this.selectElements[0].orgId;
|
|
|
- params.examId = this.selectElements[0].examId;
|
|
|
- params.couses = [];
|
|
|
- this.selectElements.forEach(element => {
|
|
|
- params.couses.push({
|
|
|
- courseId: element.courseId,
|
|
|
- paperType: element.paperType
|
|
|
- });
|
|
|
+ let checkUrl = PRINT_API + "/course/statistic/refresh/check";
|
|
|
+ this.$http.get(checkUrl).then(response => {
|
|
|
+ if (response.data.data) {
|
|
|
+ this.$notify({
|
|
|
+ title: "提示",
|
|
|
+ message: "尚有课程统计任务正在刷新中,请稍后再刷新!",
|
|
|
+ type: "warning"
|
|
|
});
|
|
|
-
|
|
|
- let url = PRINT_API + "/course/statistic/refresh";
|
|
|
- this.$http.post(url, params).then(
|
|
|
- () => {
|
|
|
- this.$notify({
|
|
|
- title: "提示",
|
|
|
- type: "success",
|
|
|
- message: "刷新成功!"
|
|
|
- });
|
|
|
- this.searchRecords(this.formSearch.pageNo);
|
|
|
- },
|
|
|
- error => {
|
|
|
- console.log(error.response);
|
|
|
- this.$notify({
|
|
|
- title: "错误",
|
|
|
- type: "error",
|
|
|
- message: error.response.data.desc
|
|
|
+ } else {
|
|
|
+ /* 刷新当前统计信息 */
|
|
|
+ this.$confirm("刷新当前统计信息?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ if (this.selectElements.length == 0) {
|
|
|
+ this.$notify({
|
|
|
+ title: "提示",
|
|
|
+ message: "请选择要刷新的项!",
|
|
|
+ type: "warning"
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ let params = {};
|
|
|
+ params.orgId = this.selectElements[0].orgId;
|
|
|
+ params.examId = this.selectElements[0].examId;
|
|
|
+ params.couses = [];
|
|
|
+ this.selectElements.forEach(element => {
|
|
|
+ params.couses.push({
|
|
|
+ courseId: element.courseId,
|
|
|
+ paperType: element.paperType
|
|
|
+ });
|
|
|
});
|
|
|
- }
|
|
|
- );
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- //ignore
|
|
|
- });
|
|
|
+
|
|
|
+ let url = PRINT_API + "/course/statistic/refresh";
|
|
|
+ this.$http.post(url, params).then(
|
|
|
+ () => {
|
|
|
+ this.$notify({
|
|
|
+ title: "提示",
|
|
|
+ type: "success",
|
|
|
+ message: "刷新成功!"
|
|
|
+ });
|
|
|
+ this.searchRecords(this.formSearch.pageNo);
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ console.log(error.response);
|
|
|
+ this.$notify({
|
|
|
+ title: "错误",
|
|
|
+ type: "error",
|
|
|
+ message: error.response.data.desc
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ //ignore
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
preview(row) {
|
|
|
/* 预览试卷PDF */
|