deason 6 lat temu
rodzic
commit
80d5ab1ad3

+ 0 - 7
src/modules/print/constants/constants.js

@@ -83,13 +83,6 @@ export const questionTypeList = [
   { value: "MULTIPLE_ANSWER_QUESTION", label: "多选" },
   { value: "BOOL_ANSWER_QUESTION", label: "判断" }
 ];
-Vue.filter("questionTypeFilter", function(value) {
-  for (let questionType of questionTypeList) {
-    if (questionType.value === value) {
-      return questionType.label;
-    }
-  }
-});
 
 Vue.prototype.loadPmInfo = function(loginUser) {
   this.pmList = [];

+ 76 - 3
src/modules/print/view/CourseStatistic.vue

@@ -79,8 +79,8 @@
               <el-option
                 v-for="item in courseList"
                 :label="item.name"
-                :value="item.code"
-                :key="item.code"
+                :value="item.id"
+                :key="item.id"
               ></el-option>
             </el-select>
           </el-form-item>
@@ -97,6 +97,38 @@
               @click="searchRecords"
               >查询
             </el-button>
+
+            <el-button
+              size="small"
+              type="primary"
+              icon="el-icon-setting"
+              @click="openAllotPaperModel"
+              >分配待指定试卷
+            </el-button>
+
+            <el-button
+              size="small"
+              type="primary"
+              icon="el-icon-download"
+              @click="openExportAllModel"
+              >整体导出
+            </el-button>
+
+            <el-button
+              size="small"
+              type="primary"
+              icon="el-icon-download"
+              @click="openExportBatchModel"
+              >批量导出
+            </el-button>
+
+            <el-button
+              size="small"
+              type="primary"
+              icon="el-icon-refresh"
+              @click="refreshStatistic"
+              >刷新
+            </el-button>
           </el-form-item>
         </el-form>
 
@@ -108,10 +140,15 @@
           style="width:100%;"
           border
         >
+          <el-table-column type="selection" width="55"> </el-table-column>
           <el-table-column label="课程名称" prop="courseName" />
           <el-table-column width="150" label="课程代码" prop="courseCode" />
           <el-table-column width="80" label="试卷类型" prop="paperType" />
-          <el-table-column width="80" label="试卷状态" prop="paperStatusName" />
+          <el-table-column width="80" label="试卷状态">
+            <template slot-scope="scope">
+              {{ scope.row.paperStatusName }}
+            </template>
+          </el-table-column>
           <el-table-column width="200" label="试卷名称" prop="paperName" />
           <el-table-column width="80" label="试卷P数" prop="paperP" />
           <el-table-column width="100" label="考生人数" prop="totalStudent" />
@@ -252,13 +289,49 @@ export default {
         this.courseList = response.data;
       });
     },
+    refreshStatistic() {
+      /* 刷新当前统计信息 */
+      this.$notify({
+        message: "Todo...",
+        type: "warning"
+      });
+    },
+    openAllotPaperModel() {
+      /* 分配待指定试卷 */
+      this.$notify({
+        message: "Todo...",
+        type: "warning"
+      });
+    },
+    openExportBatchModel() {
+      /* 批量导出 */
+      this.$notify({
+        message: "Todo...",
+        type: "warning"
+      });
+    },
+    openExportAllModel() {
+      /* 整体导出 */
+      this.$notify({
+        message: "Todo...",
+        type: "warning"
+      });
+    },
     preview(row) {
       /* 预览试卷PDF */
       console.log(row);
+      this.$notify({
+        message: "Todo...",
+        type: "warning"
+      });
     },
     download(row) {
       /* 下载试卷结构 */
       console.log(row);
+      this.$notify({
+        message: "Todo...",
+        type: "warning"
+      });
     }
   },
   computed: {

+ 46 - 97
src/modules/print/view/ExamStructure.vue

@@ -50,44 +50,6 @@
             </el-select>
           </el-form-item>
 
-          <el-form-item label="项目经理" class="pull-left">
-            <el-select
-              v-model="formSearch.pmId"
-              placeholder="请选择"
-              filterable
-              clearable
-              remote
-              :remote-method="searchPmList"
-            >
-              <el-option label="请选择" value=""></el-option>
-              <el-option
-                v-for="item in pmList"
-                :label="item.name"
-                :value="item.id"
-                :key="item.id"
-              ></el-option>
-            </el-select>
-          </el-form-item>
-
-          <el-form-item label="印刷供应商" class="pull-left">
-            <el-select
-              v-model="formSearch.supplierId"
-              placeholder="请选择"
-              filterable
-              clearable
-              remote
-              :remote-method="searchSupplierList"
-            >
-              <el-option label="请选择" value=""></el-option>
-              <el-option
-                v-for="item in supplierList"
-                :label="item.name"
-                :value="item.id"
-                :key="item.id"
-              ></el-option>
-            </el-select>
-          </el-form-item>
-
           <el-form-item class="pull-right">
             <el-button
               size="small"
@@ -96,6 +58,15 @@
               @click="searchRecords"
               >查询
             </el-button>
+
+            <el-button
+              size="small"
+              type="primary"
+              icon="el-icon-plus"
+              :disabled="!hasPermit"
+              @click="addStructure"
+              >新增
+            </el-button>
           </el-form-item>
         </el-form>
 
@@ -107,30 +78,34 @@
           style="width:100%;"
           border
         >
-          <el-table-column width="220" label="学校名称" prop="orgName" />
+          <el-table-column label="学校名称" prop="orgName" />
           <el-table-column label="考试名称" prop="examName" />
-          <el-table-column width="200" label="印刷供应商" prop="supplierName" />
-          <el-table-column width="150" label="项目经理" prop="pmName" />
-
-          <el-table-column width="120" label="项目统计">
+          <el-table-column width="220" label="题数">
             <template slot-scope="scope">
-              <a
-                href="javascript:void(0)"
-                @click="gotoProjectStatistic(scope.row);"
-                >查看
-              </a>
+              单选:{{ scope.row.questionStructure.singleChoiceTotal }}<br />
+              多选:{{ scope.row.questionStructure.multipleChoiceTotal }}<br />
+              判断:{{ scope.row.questionStructure.boolQuestionTotal }}
             </template>
           </el-table-column>
 
-          <el-table-column width="120" label="操作" :context="_self">
+          <el-table-column width="200" label="操作" :context="_self">
             <template slot-scope="scope">
               <el-button
                 size="mini"
                 type="primary"
                 icon="el-icon-setting"
-                @click="editProjectSetting(scope.row);"
+                @click="cloneStructure(scope.row);"
                 :disabled="!hasPermit"
-                >项目设置
+                >复用
+              </el-button>
+
+              <el-button
+                size="mini"
+                type="danger"
+                icon="el-icon-delete"
+                @click="removeStructure(scope.row);"
+                :disabled="!hasPermit"
+                >删除
               </el-button>
             </template>
           </el-table-column>
@@ -152,7 +127,7 @@
 </template>
 
 <script>
-import { print_api, core_api, userRole } from "../constants/constants.js";
+import { print_api, userRole } from "../constants/constants.js";
 import { mapState } from "vuex";
 
 export default {
@@ -161,8 +136,6 @@ export default {
       formSearch: {
         orgId: "",
         examId: "",
-        pmId: "",
-        supplierId: "",
         pageNo: 1,
         pageSize: 10
       },
@@ -173,8 +146,6 @@ export default {
       tableData: [],
       orgList: [],
       examList: [],
-      pmList: [],
-      supplierList: [],
       rules: {}
     };
   },
@@ -205,7 +176,7 @@ export default {
       }
 
       this.loading = true;
-      let url = print_api + "/printing/project/list";
+      let url = print_api + "/examStructure/list";
       this.$http.post(url, this.formSearch).then(
         response => {
           this.tableData = response.data.content;
@@ -230,42 +201,28 @@ export default {
         });
       }
     },
-    searchPmList(query) {
-      /* 查询项目经理列表 */
-      this.pmList = [];
-      let url =
-        core_api + "/user/query?rootOrgCode=qmth&roleCode=PRINT_PROJECT_LEADER";
-
-      if (!this.isEmptyStr(query)) {
-        url += "&name=" + query;
-      }
-
-      this.$http.get(url).then(response => {
-        this.pmList = response.data;
+    addStructure() {
+      /* 新增考试结构 */
+      this.$notify({
+        message: "Todo...",
+        type: "warning"
       });
     },
-    searchSupplierList(query) {
-      /* 查询印刷供应商列表 */
-      this.supplierList = [];
-      let url =
-        core_api + "/user/query?rootOrgCode=qmth-print&roleCode=PRINT_SUPPLIER";
-
-      if (!this.isEmptyStr(query)) {
-        url += "&name=" + query;
-      }
-
-      this.$http.get(url).then(response => {
-        this.supplierList = response.data;
+    cloneStructure(row) {
+      /* 复用考试结构 */
+      console.log(row);
+      this.$notify({
+        message: "Todo...",
+        type: "warning"
       });
     },
-    gotoProjectStatistic(row) {
-      /* 查看项目统计 */
-      let url = "/print/project/statistic/" + row.orgId + "/" + row.examId;
-      this.$router.push({ path: url });
-    },
-    editProjectSetting(row) {
-      /* 项目设置 */
+    removeStructure(row) {
+      /* 删除考试结构 */
       console.log(row);
+      this.$notify({
+        message: "Todo...",
+        type: "warning"
+      });
     }
   },
   computed: {
@@ -276,16 +233,8 @@ export default {
 
     this.loadUserRole(this.user);
 
-    if (this.curUserRole.isSuperLeader) {
+    if (this.curUserRole.isSuperLeader || this.curUserRole.isPM) {
       this.hasPermit = true;
-      // this.searchPmList();
-      // this.searchSupplierList();
-    } else if (this.curUserRole.isPM) {
-      this.hasPermit = true;
-      //this.loadPmInfo(this.user);
-    } else if (this.curUserRole.isSupplier) {
-      this.hasPermit = false;
-      //this.loadSupplierInfo(this.user);
     } else {
       this.hasPermit = false;
     }

+ 4 - 0
src/modules/print/view/Project.vue

@@ -266,6 +266,10 @@ export default {
     editProjectSetting(row) {
       /* 项目设置 */
       console.log(row);
+      this.$notify({
+        message: "Todo...",
+        type: "warning"
+      });
     }
   },
   computed: {

+ 20 - 0
src/modules/print/view/ProjectStatistic.vue

@@ -261,10 +261,18 @@ export default {
     refreshStatistic() {
       /* 刷新当前统计信息 */
       console.log(this.projectId);
+      this.$notify({
+        message: "Todo...",
+        type: "warning"
+      });
     },
     editBackupSetting(row) {
       /* 备份设置 */
       console.log(row);
+      this.$notify({
+        message: "Todo...",
+        type: "warning"
+      });
     },
     loadOtherSetting(projectId) {
       /* 查询其它事项列表 */
@@ -291,14 +299,26 @@ export default {
     },
     addOtherSetting() {
       /* 新增其它事项 */
+      this.$notify({
+        message: "Todo...",
+        type: "warning"
+      });
     },
     editOtherSetting(row) {
       /* 修改某个其它事项 */
       console.log(row);
+      this.$notify({
+        message: "Todo...",
+        type: "warning"
+      });
     },
     removeOtherSetting(row) {
       /* 删除某个其它事项 */
       console.log(row);
+      this.$notify({
+        message: "Todo...",
+        type: "warning"
+      });
     },
     goBack() {
       /* 返回上级界面 */

+ 49 - 124
src/modules/print/view/ProjectTemplate.vue

@@ -50,44 +50,6 @@
             </el-select>
           </el-form-item>
 
-          <el-form-item label="项目经理" class="pull-left">
-            <el-select
-              v-model="formSearch.pmId"
-              placeholder="请选择"
-              filterable
-              clearable
-              remote
-              :remote-method="searchPmList"
-            >
-              <el-option label="请选择" value=""></el-option>
-              <el-option
-                v-for="item in pmList"
-                :label="item.name"
-                :value="item.id"
-                :key="item.id"
-              ></el-option>
-            </el-select>
-          </el-form-item>
-
-          <el-form-item label="印刷供应商" class="pull-left">
-            <el-select
-              v-model="formSearch.supplierId"
-              placeholder="请选择"
-              filterable
-              clearable
-              remote
-              :remote-method="searchSupplierList"
-            >
-              <el-option label="请选择" value=""></el-option>
-              <el-option
-                v-for="item in supplierList"
-                :label="item.name"
-                :value="item.id"
-                :key="item.id"
-              ></el-option>
-            </el-select>
-          </el-form-item>
-
           <el-form-item class="pull-right">
             <el-button
               size="small"
@@ -107,52 +69,49 @@
           style="width:100%;"
           border
         >
-          <el-table-column width="220" label="学校名称" prop="orgName" />
-          <el-table-column label="考试名称" prop="examName" />
-          <el-table-column width="200" label="印刷供应商" prop="supplierName" />
-          <el-table-column width="150" label="项目经理" prop="pmName" />
-
-          <el-table-column width="120" label="项目统计">
+          <el-table-column type="selection" width="55"></el-table-column>
+          <el-table-column label="类别" prop="typeName" />
+          <el-table-column label="上传">
+            <template slot-scope="scope">
+              <el-button
+                size="mini"
+                type="default"
+                icon="el-icon-upload"
+                @click="upload(scope.row);"
+                >上传
+              </el-button>
+            </template>
+          </el-table-column>
+          <el-table-column label="下载">
             <template slot-scope="scope">
-              <a
-                href="javascript:void(0)"
-                @click="gotoProjectStatistic(scope.row);"
-                >查看
-              </a>
+              <el-button
+                size="mini"
+                type="default"
+                icon="el-icon-download"
+                @click="download(scope.row);"
+                >下载
+              </el-button>
             </template>
           </el-table-column>
-
-          <el-table-column width="120" label="操作" :context="_self">
+          <el-table-column label="预览">
             <template slot-scope="scope">
               <el-button
                 size="mini"
-                type="primary"
-                icon="el-icon-setting"
-                @click="editProjectSetting(scope.row);"
-                :disabled="!hasPermit"
-                >项目设置
+                type="default"
+                icon="el-icon-document"
+                @click="preview(scope.row);"
+                >预览
               </el-button>
             </template>
           </el-table-column>
         </el-table>
-
-        <!-- 分页 -->
-        <div class="page pull-left">
-          <el-pagination
-            @current-change="handlePager"
-            :current-page="formSearch.pageNo"
-            :page-size="formSearch.pageSize"
-            :total="totalElements"
-            layout="total, prev, pager, next, jumper"
-          ></el-pagination>
-        </div>
       </div>
     </div>
   </section>
 </template>
 
 <script>
-import { print_api, core_api, userRole } from "../constants/constants.js";
+import { print_api, userRole } from "../constants/constants.js";
 import { mapState } from "vuex";
 
 export default {
@@ -160,30 +119,18 @@ export default {
     return {
       formSearch: {
         orgId: "",
-        examId: "",
-        pmId: "",
-        supplierId: "",
-        pageNo: 1,
-        pageSize: 10
+        examId: ""
       },
       curUserRole: userRole,
       hasPermit: false,
-      totalElements: 0,
       loading: false,
       tableData: [],
       orgList: [],
       examList: [],
-      pmList: [],
-      supplierList: [],
       rules: {}
     };
   },
   methods: {
-    handlePager(current) {
-      /* 处理分页 */
-      this.formSearch.pageNo = current;
-      this.searchRecords();
-    },
     searchRecords() {
       /* 查询记录列表 */
       let orgId = this.formSearch.orgId;
@@ -205,11 +152,10 @@ export default {
       }
 
       this.loading = true;
-      let url = print_api + "/printing/project/list";
+      let url = print_api + "/project/template/" + orgId + "/" + examId;
       this.$http.post(url, this.formSearch).then(
         response => {
-          this.tableData = response.data.content;
-          this.totalElements = response.data.totalElements;
+          this.tableData = response.data;
           this.loading = false;
         },
         error => {
@@ -230,42 +176,29 @@ export default {
         });
       }
     },
-    searchPmList(query) {
-      /* 查询项目经理列表 */
-      this.pmList = [];
-      let url =
-        core_api + "/user/query?rootOrgCode=qmth&roleCode=PRINT_PROJECT_LEADER";
-
-      if (!this.isEmptyStr(query)) {
-        url += "&name=" + query;
-      }
-
-      this.$http.get(url).then(response => {
-        this.pmList = response.data;
+    upload(row) {
+      /* 上传模板 */
+      console.log(row);
+      this.$notify({
+        message: "Todo...",
+        type: "warning"
       });
     },
-    searchSupplierList(query) {
-      /* 查询印刷供应商列表 */
-      this.supplierList = [];
-      let url =
-        core_api + "/user/query?rootOrgCode=qmth-print&roleCode=PRINT_SUPPLIER";
-
-      if (!this.isEmptyStr(query)) {
-        url += "&name=" + query;
-      }
-
-      this.$http.get(url).then(response => {
-        this.supplierList = response.data;
+    preview(row) {
+      /* 预览模板 */
+      console.log(row);
+      this.$notify({
+        message: "Todo...",
+        type: "warning"
       });
     },
-    gotoProjectStatistic(row) {
-      /* 查看项目统计 */
-      let url = "/print/project/statistic/" + row.orgId + "/" + row.examId;
-      this.$router.push({ path: url });
-    },
-    editProjectSetting(row) {
-      /* 项目设置 */
+    download(row) {
+      /* 下载模板 */
       console.log(row);
+      this.$notify({
+        message: "Todo...",
+        type: "warning"
+      });
     }
   },
   computed: {
@@ -276,16 +209,8 @@ export default {
 
     this.loadUserRole(this.user);
 
-    if (this.curUserRole.isSuperLeader) {
+    if (this.curUserRole.isSuperLeader || this.curUserRole.isPM) {
       this.hasPermit = true;
-      // this.searchPmList();
-      // this.searchSupplierList();
-    } else if (this.curUserRole.isPM) {
-      this.hasPermit = true;
-      //this.loadPmInfo(this.user);
-    } else if (this.curUserRole.isSupplier) {
-      this.hasPermit = false;
-      //this.loadSupplierInfo(this.user);
     } else {
       this.hasPermit = false;
     }