Ver código fonte

评卷工作中加入状态,结束评卷

xiatian 5 anos atrás
pai
commit
5b8e4a9f43

+ 0 - 8
src/modules/marking/views/MarkSettingWork.vue

@@ -49,7 +49,6 @@
               <template slot-scope="scope">
                 <div class="pull-left">
                   <el-button
-                    :disabled="markingBtnDisable(scope.row)"
                     @click="marking(scope.row)"
                     type="primary"
                     size="mini"
@@ -99,13 +98,6 @@ export default {
     };
   },
   methods: {
-    markingBtnDisable(row) {
-      if (row.progress == 100) {
-        return true;
-      } else {
-        return false;
-      }
-    },
     initMarkWork() {
       this.loading = true;
       this.$http

+ 86 - 0
src/modules/marking/views/MarkWork.vue

@@ -79,6 +79,13 @@
                 </div>
               </template>
             </el-table-column>
+            <el-table-column label="评卷是否结束" width="130">
+              <template slot-scope="scope">
+                <div>
+                  <span>{{ getIsEndText(scope.row.isEnd) }}</span>
+                </div>
+              </template>
+            </el-table-column>
             <el-table-column label="操作">
               <template slot-scope="scope">
                 <div class="pull-left">
@@ -133,6 +140,28 @@
                           >成绩发布</el-button
                         >
                       </el-dropdown-item>
+                      <el-dropdown-item
+                        v-if="!scope.row.isEnd && scope.row.status == 1"
+                      >
+                        <el-button
+                          @click="endMarkWork(scope.row)"
+                          type="primary"
+                          size="mini"
+                          plain
+                          >结束评卷</el-button
+                        >
+                      </el-dropdown-item>
+                      <el-dropdown-item
+                        v-if="scope.row.isEnd && scope.row.status == 1"
+                      >
+                        <el-button
+                          @click="disendMarkWork(scope.row)"
+                          type="primary"
+                          size="mini"
+                          plain
+                          >开启评卷</el-button
+                        >
+                      </el-dropdown-item>
                     </el-dropdown-menu>
                   </el-dropdown>
                 </div>
@@ -297,6 +326,13 @@ export default {
         }
       }
     },
+    getIsEndText(isEnd) {
+      if (isEnd) {
+        return "已结束";
+      } else {
+        return "未结束";
+      }
+    },
     recreate(row) {
       this.loading = true;
       this.$http.put(DATA_PROCESS_API + "/markWorks/" + row.id).then(() => {
@@ -462,6 +498,56 @@ export default {
         this.loading = false;
       });
     },
+    endMarkWork(row) {
+      this.$confirm("确认结束评卷工作?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.loading = true;
+        this.$http
+          .put(MARKING_API + "/markWorks/end/" + row.id)
+          .then(() => {
+            this.$notify({
+              message: "操作成功",
+              type: "success"
+            });
+            this.initMarkWorkData();
+          })
+          .catch(e => {
+            this.$notify({
+              message: e.response.data.desc,
+              type: "error"
+            });
+          });
+        this.loading = false;
+      });
+    },
+    disendMarkWork(row) {
+      this.$confirm("确认开启评卷工作?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.loading = true;
+        this.$http
+          .put(MARKING_API + "/markWorks/disend/" + row.id)
+          .then(() => {
+            this.$notify({
+              message: "操作成功",
+              type: "success"
+            });
+            this.initMarkWorkData();
+          })
+          .catch(e => {
+            this.$notify({
+              message: e.response.data.desc,
+              type: "error"
+            });
+          });
+        this.loading = false;
+      });
+    },
     pubGrade(row) {
       if (!(Number.parseInt(row.progress) == 100)) {
         this.$notify({