zhangjie 3 gadi atpakaļ
vecāks
revīzija
272cea932a

+ 12 - 0
src/constants/navs.js

@@ -90,6 +90,18 @@ const navs = [
             isRouter: true
           }
         ]
+      },
+      {
+        name: "命题计划统计",
+        url: "statistics",
+        icon: "el-icon-set-up",
+        children: [
+          {
+            name: "命题计划统计表",
+            url: "StatisticsManage",
+            isRouter: true
+          }
+        ]
       }
     ]
   },

+ 8 - 0
src/modules/base/components/SelectOrgs.vue

@@ -68,6 +68,14 @@ export default {
   methods: {
     async getList() {
       this.orgs = await organizationList();
+      if (this.orgs.length) {
+        this.orgs[0].children.sort((a, b) => {
+          if (a.type === "PRINTING_HOUSE") return 1;
+          if (b.type === "PRINTING_HOUSE") return -1;
+
+          return 0;
+        });
+      }
 
       this.$nextTick(() => {
         this.setCheckedNode(this.value);

+ 8 - 0
src/modules/base/views/OrganizationManage.vue

@@ -97,6 +97,14 @@ export default {
       if (!this.checkPrivilege("list", "LIST")) return;
       const orgs = await organizationList();
       this.orgs = orgs || [];
+      if (this.orgs.length) {
+        this.orgs[0].children.sort((a, b) => {
+          if (a.type === "PRINTING_HOUSE") return 1;
+          if (b.type === "PRINTING_HOUSE") return -1;
+
+          return 0;
+        });
+      }
     },
     toAdd(data) {
       this.orgTypes = [

+ 6 - 1
src/modules/exam/api.js

@@ -204,5 +204,10 @@ export const taskResetPdf = id => {
 };
 export const removeDataTask = ({ ids, type }) => {
   // TODO:
-  return $post("/api/admin/data/task/query", { ids, type });
+  return $post("/api/admin/data/task/query11", { ids, type });
+};
+
+// statistics-manage
+export const statisticsList = datas => {
+  return $postParam("/api/admin/statistics/list", datas);
 };

+ 1 - 3
src/modules/exam/components/ModifyTaskApply.vue

@@ -77,9 +77,7 @@
         <tr v-for="(item, index) in examRoomInfoList" :key="index">
           <td>{{ item.clazzNames }}</td>
           <td>{{ item.studentCount }}</td>
-          <td v-if="index === 0" :rowspan="examRoomInfoList.length">
-            {{ printTotalCount }}
-          </td>
+          <td>{{ item.printCount }}</td>
         </tr>
       </table>
     </div>

+ 1 - 1
src/modules/exam/components/createExamAndPrintTask/InfoExamTask.vue

@@ -163,7 +163,7 @@
           </el-form-item>
         </el-form>
 
-        <h4 class="mb-2">附件<span>(最多4张)</span></h4>
+        <h4 class="mb-2">附件<span>(最多4张)</span></h4>
         <div class="image-list">
           <div
             class="image-item"

+ 2 - 3
src/modules/exam/components/createExamAndPrintTask/InfoPrintTask.vue

@@ -252,15 +252,14 @@ export default {
     },
     buildTableData() {
       this.tableData = this.classList.map(clazz => {
-        const printRoom = this.printHouses[0] || {};
         let data = {
           examPlace: "",
           examRoom: "",
           classId: clazz.id,
           className: clazz.name,
           studentCount: clazz.studentCount,
-          printHouseId: printRoom["houseId"],
-          printHouseName: printRoom["houseName"],
+          printHouseId: clazz.printHouseId,
+          printHouseName: clazz.printHouseName,
           extendFields: "",
           ...this.modalForm
         };

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

@@ -6,6 +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";
 
 export default [
   {
@@ -43,4 +44,9 @@ export default [
     name: "DataTaskManage",
     component: DataTaskManage
   }
+  // {
+  //   path: "/exam/statistics-manage",
+  //   name: "StatisticsManage",
+  //   component: StatisticsManage
+  // }
 ];

+ 4 - 0
src/modules/exam/views/ExamTaskManage.vue

@@ -213,6 +213,10 @@
               >{{ scope.row.enable ? "禁用" : "启用" }}</el-button
             >
             <el-button
+              v-if="
+                scope.row.approveFormStatus &&
+                  checkPrivilege('link', 'SelectForm')
+              "
               class="btn-primary"
               type="text"
               @click="toDownloadForm(scope.row)"

+ 175 - 0
src/modules/exam/views/StatisticsManage.vue

@@ -0,0 +1,175 @@
+<template>
+  <div class="exam-statistics">
+    <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"
+            placeholder="开课学院"
+            clearable
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="开课部门:">
+          <teaching-room-select
+            v-model="filter.teachingRoomName"
+            placeholder="开课部门"
+            clearable
+          ></teaching-room-select>
+        </el-form-item>
+        <el-form-item label="完成状态:">
+          <el-select
+            v-model="filter.status"
+            style="width: 142px;"
+            placeholder="完成状态"
+            clearable
+          >
+            <el-option
+              v-for="(val, key) in FINISH_STATUS"
+              :key="key"
+              :value="key"
+              :label="val"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="课程名称:">
+          <el-input
+            v-model.trim="filter.courseName"
+            placeholder="课程名称"
+            clearable
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="任课老师:">
+          <el-input
+            v-model.trim="filter.teacherName"
+            placeholder="任课老师"
+            clearable
+          ></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button
+            v-if="checkPrivilege('button', 'select')"
+            type="primary"
+            @click="toPage(1)"
+            >查询</el-button
+          >
+        </el-form-item>
+      </el-form>
+      <div class="part-box-action">
+        <el-button
+          type="success"
+          icon="el-icon-download"
+          v-if="checkPrivilege('button', 'import')"
+          ><a :href="downloadUrl" :download="dfilename">模板下载</a></el-button
+        >
+        <upload-button
+          v-if="checkPrivilege('button', 'import')"
+          btn-icon="el-icon-circle-plus-outline"
+          btn-content="导入"
+          btn-type="success"
+          :upload-url="uploadUrl"
+          :format="['xls', 'xlsx']"
+          @upload-error="uplaodError"
+          @upload-success="uploadSuccess"
+        >
+        </upload-button>
+      </div>
+    </div>
+    <div class="part-box part-box-pad">
+      <el-table ref="TableList" :data="dataList">
+        <el-table-column
+          type="index"
+          label="序号"
+          width="70"
+          :index="indexMethod"
+        ></el-table-column>
+        <el-table-column prop="courseCode" label="课程代码"></el-table-column>
+        <el-table-column prop="courseName" label="课程名称"></el-table-column>
+        <el-table-column prop="teacherName" label="任课老师"></el-table-column>
+        <el-table-column prop="clazzName" label="班级名称"></el-table-column>
+        <el-table-column prop="paperNumber" label="试卷编号"></el-table-column>
+        <el-table-column
+          prop="printPlanName"
+          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>
+      <div class="part-page">
+        <el-pagination
+          background
+          layout="total,prev, pager, next"
+          :current-page="current"
+          :total="total"
+          :page-size="size"
+          @current-change="toPage"
+        >
+        </el-pagination>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { statisticsList } from "../api";
+import UploadButton from "../../../components/UploadButton";
+
+export default {
+  name: "exam-statistics",
+  components: { UploadButton },
+  data() {
+    return {
+      filter: {
+        courseName: "",
+        teacherName: "",
+        collegeName: "",
+        teachingRoomName: "",
+        status: ""
+      },
+      current: 1,
+      size: this.GLOBAL.pageSize,
+      total: 0,
+      dataList: [],
+      curRow: {},
+      FINISH_STATUS: { UN_FINISH: "未完成", FINISH: "已完成" },
+      // import
+      uploadUrl: "/api/admin/statistics/import",
+      downloadUrl: "/temps/studentTemplate.xlsx",
+      dfilename: "学生导入模板.xlsx"
+    };
+  },
+  mounted() {
+    this.getList();
+  },
+  methods: {
+    async getList() {
+      if (!this.checkPrivilege("list", "list")) return;
+
+      const datas = {
+        ...this.filter,
+        pageNumber: this.current,
+        pageSize: this.size
+      };
+      const data = await statisticsList(datas);
+      this.dataList = data.records;
+      this.total = data.total;
+    },
+    toPage(page) {
+      this.current = page;
+      this.getList();
+    },
+    campusChange() {
+      this.filter.clazzId = "";
+    },
+    // import
+    uplaodError(errorData) {
+      this.$notify.error({ title: "错误提示", message: errorData.message });
+    },
+    uploadSuccess() {
+      this.$message.success("文件上传成功,后台正在导入!");
+      this.getList();
+    }
+  }
+};
+</script>

+ 1 - 1
src/views/Home.vue

@@ -188,7 +188,7 @@ export default {
 
     return {
       menus: [],
-      curMenu: { url: "" },
+      curMenu: { url: "", children: [] },
       curActNav: "",
       breadcrumbs: [],
       validRoutes: [],