Browse Source

命题计划统计表新增

zhangjie 3 years ago
parent
commit
2cba6fc5d0

BIN
public/temps/examStatisticsTemplate.xlsx


+ 65 - 0
src/components/base/CollegeSelect.vue

@@ -0,0 +1,65 @@
+<template>
+  <el-select
+    v-model="selected"
+    class="college-select"
+    :placeholder="placeholder"
+    :style="styles"
+    filterable
+    :clearable="clearable"
+    :disabled="disabled"
+    @change="select"
+  >
+    <el-option
+      v-for="item in optionList"
+      :key="item.id"
+      :value="item.id"
+      :label="item.name"
+    >
+    </el-option>
+  </el-select>
+</template>
+
+<script>
+import { organizationFindByTypeList } from "../../modules/base/api";
+
+export default {
+  name: "college-select",
+  props: {
+    disabled: { type: Boolean, default: false },
+    placeholder: { type: String, default: "请选择" },
+    value: { type: [Number, String], default: "" },
+    styles: { type: String, default: "" },
+    clearable: { type: Boolean, default: true }
+  },
+  data() {
+    return {
+      optionList: [],
+      selected: ""
+    };
+  },
+  watch: {
+    value: {
+      immediate: true,
+      handler(val) {
+        this.selected = val;
+      }
+    }
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    async search() {
+      const res = await organizationFindByTypeList({ orgType: "COLLEGE" });
+      this.optionList = res;
+    },
+    select() {
+      this.$emit("input", this.selected);
+      this.$emit(
+        "change",
+        this.optionList.find(item => item.id === this.selected)
+      );
+    }
+  }
+};
+</script>

+ 65 - 0
src/components/base/FacultySelect.vue

@@ -0,0 +1,65 @@
+<template>
+  <el-select
+    v-model="selected"
+    class="faculty-select"
+    :placeholder="placeholder"
+    :style="styles"
+    filterable
+    :clearable="clearable"
+    :disabled="disabled"
+    @change="select"
+  >
+    <el-option
+      v-for="item in optionList"
+      :key="item.id"
+      :value="item.id"
+      :label="item.name"
+    >
+    </el-option>
+  </el-select>
+</template>
+
+<script>
+import { organizationFindByTypeList } from "../../modules/base/api";
+
+export default {
+  name: "faculty-select",
+  props: {
+    disabled: { type: Boolean, default: false },
+    placeholder: { type: String, default: "请选择" },
+    value: { type: [Number, String], default: "" },
+    styles: { type: String, default: "" },
+    clearable: { type: Boolean, default: true }
+  },
+  data() {
+    return {
+      optionList: [],
+      selected: ""
+    };
+  },
+  watch: {
+    value: {
+      immediate: true,
+      handler(val) {
+        this.selected = val;
+      }
+    }
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    async search() {
+      const res = await organizationFindByTypeList({ orgType: "FACULTY" });
+      this.optionList = res;
+    },
+    select() {
+      this.$emit("input", this.selected);
+      this.$emit(
+        "change",
+        this.optionList.find(item => item.id === this.selected)
+      );
+    }
+  }
+};
+</script>

+ 3 - 1
src/components/base/PrintRoomSelect.vue

@@ -50,7 +50,9 @@ export default {
   },
   methods: {
     async search() {
-      const res = await organizationFindByTypeList("PRINTING_HOUSE");
+      const res = await organizationFindByTypeList({
+        orgType: "PRINTING_HOUSE"
+      });
       this.optionList = res;
     },
     select() {

+ 4 - 1
src/components/base/TeachingRoomSelect.vue

@@ -50,7 +50,10 @@ export default {
   },
   methods: {
     async search() {
-      const res = await organizationFindByTypeList("TEACHING_ROOM");
+      const res = await organizationFindByTypeList({
+        orgType: "TEACHING_ROOM",
+        auth: true
+      });
       this.optionList = res;
     },
     select() {

+ 1 - 1
src/components/base/TypeOrgSelect.vue

@@ -58,7 +58,7 @@ export default {
   },
   methods: {
     async search() {
-      const res = await organizationFindByTypeList(this.type);
+      const res = await organizationFindByTypeList({ orgType: this.type });
       this.optionList = res;
     },
     select() {

+ 1 - 1
src/constants/navs.js

@@ -93,7 +93,7 @@ const navs = [
       },
       {
         name: "命题计划统计",
-        url: "statistics",
+        url: "Statistics",
         icon: "el-icon-set-up",
         children: [
           {

+ 2 - 2
src/modules/base/api.js

@@ -57,8 +57,8 @@ export const roleBoundPrivileges = roleId => {
 export const organizationList = datas => {
   return $postParam("/api/admin/sys/org/list", datas);
 };
-export const organizationFindByTypeList = orgType => {
-  return $postParam("/api/admin/sys/org/find_by_type", { orgType });
+export const organizationFindByTypeList = datas => {
+  return $postParam("/api/admin/sys/org/find_by_type", datas);
 };
 export const updateOrganization = datas => {
   return $post("/api/admin/sys/org/save", datas);

+ 5 - 0
src/modules/exam/api.js

@@ -9,6 +9,11 @@ export const pageNumberQuery = datas => {
 export const questionTeatherQuery = datas => {
   return $postParam("/api/admin/exam/task/user_query", datas);
 };
+// 教研室查询
+export const teachingRoomList = datas => {
+  // TODO:
+  return $postParam("/api/admin/exam/task/room_query", datas);
+};
 
 // 待办任务-------------->
 // 命题任务待办

+ 6 - 6
src/modules/exam/router.js

@@ -6,7 +6,7 @@ import TaskApplyManage from "./views/TaskApplyManage.vue";
 import TaskReviewManage from "./views/TaskReviewManage.vue";
 import TaskPaperManage from "./views/TaskPaperManage.vue";
 import DataTaskManage from "./views/DataTaskManage.vue";
-// import StatisticsManage from "./views/StatisticsManage.vue";
+import StatisticsManage from "./views/StatisticsManage.vue";
 
 export default [
   {
@@ -43,10 +43,10 @@ export default [
     path: "/exam/data-task-manage",
     name: "DataTaskManage",
     component: DataTaskManage
+  },
+  {
+    path: "/exam/statistics-manage",
+    name: "StatisticsManage",
+    component: StatisticsManage
   }
-  // {
-  //   path: "/exam/statistics-manage",
-  //   name: "StatisticsManage",
-  //   component: StatisticsManage
-  // }
 ];

+ 36 - 15
src/modules/exam/views/StatisticsManage.vue

@@ -3,18 +3,28 @@
     <div class="part-box part-box-filter part-box-flex">
       <el-form ref="FilterForm" label-position="left" label-width="90px" inline>
         <el-form-item label="开课学院:">
-          <el-input
-            v-model.trim="filter.collegeName"
+          <college-select
+            v-model.trim="filter.collegeId"
             placeholder="开课学院"
             clearable
-          ></el-input>
+            @change="facultyChange"
+          ></college-select>
         </el-form-item>
         <el-form-item label="开课部门:">
-          <teaching-room-select
-            v-model="filter.teachingRoomName"
+          <el-select
+            v-model="filter.teachingRoomId"
             placeholder="开课部门"
+            filterable
             clearable
-          ></teaching-room-select>
+          >
+            <el-option
+              v-for="item in teachingRooms"
+              :key="item.id"
+              :value="item.id"
+              :label="item.name"
+            >
+            </el-option>
+          </el-select>
         </el-form-item>
         <el-form-item label="完成状态:">
           <el-select
@@ -92,9 +102,7 @@
           label="印刷计划"
         ></el-table-column>
         <el-table-column prop="printSum" label="总印份数"></el-table-column>
-        <el-table-column prop="status" label="状态">
-          <span slot-scope="scope">{{ FINISH_STATUS[scope.row.status] }}</span>
-        </el-table-column>
+        <el-table-column prop="statusStr" label="状态"> </el-table-column>
       </el-table>
       <div class="part-page">
         <el-pagination
@@ -113,6 +121,7 @@
 
 <script>
 import { statisticsList } from "../api";
+import { organizationFindByTypeList } from "../../base/api";
 import UploadButton from "../../../components/UploadButton";
 
 export default {
@@ -121,10 +130,10 @@ export default {
   data() {
     return {
       filter: {
+        collegeId: "",
+        teachingRoomId: "",
         courseName: "",
         teacherName: "",
-        collegeName: "",
-        teachingRoomName: "",
         status: ""
       },
       current: 1,
@@ -132,11 +141,12 @@ export default {
       total: 0,
       dataList: [],
       curRow: {},
+      teachingRooms: [],
       FINISH_STATUS: { UN_FINISH: "未完成", FINISH: "已完成" },
       // import
       uploadUrl: "/api/admin/statistics/import",
-      downloadUrl: "/temps/studentTemplate.xlsx",
-      dfilename: "学生导入模板.xlsx"
+      downloadUrl: "/temps/examStatisticsTemplate.xlsx",
+      dfilename: "命题计划导入模板.xlsx"
     };
   },
   mounted() {
@@ -159,8 +169,19 @@ export default {
       this.current = page;
       this.getList();
     },
-    campusChange() {
-      this.filter.clazzId = "";
+    async getTeachingRooms() {
+      this.teachingRooms = await organizationFindByTypeList({
+        orgType: "TEACHING_ROOM",
+        orgId: this.filter.collegeId,
+        auth: false
+      });
+    },
+    facultyChange(val) {
+      this.filter.teachingRoomId = "";
+      this.teachingRooms = [];
+
+      if (!val) return;
+      this.getTeachingRooms();
     },
     // import
     uplaodError(errorData) {

+ 4 - 0
src/plugins/globalVuePlugins.js

@@ -16,6 +16,8 @@ import SchoolSelect from "../components/base/SchoolSelect.vue";
 import CampusSelect from "../components/base/CampusSelect.vue";
 import PrintRoomSelect from "../components/base/PrintRoomSelect.vue";
 import TeachingRoomSelect from "../components/base/TeachingRoomSelect.vue";
+import FacultySelect from "../components/base/FacultySelect.vue";
+import CollegeSelect from "../components/base/CollegeSelect.vue";
 import ClazzSelect from "../components/base/ClazzSelect.vue";
 
 const components = {
@@ -32,6 +34,8 @@ const components = {
   CampusSelect,
   PrintRoomSelect,
   TeachingRoomSelect,
+  FacultySelect,
+  CollegeSelect,
   ClazzSelect
 };