zhangjie 3 лет назад
Родитель
Сommit
a593a908cc

+ 1 - 1
src/assets/styles/iview-custom.less

@@ -249,7 +249,7 @@
       text-align: center;
       text-align: center;
 
 
       .ivu-btn {
       .ivu-btn {
-        border-radius: @box-border-radius;
+        // border-radius: @box-border-radius;
         margin: 0 10px;
         margin: 0 10px;
         width: 80px;
         width: 80px;
       }
       }

+ 45 - 1
src/assets/styles/marker.less

@@ -299,6 +299,19 @@
       color: @color-text-act;
       color: @color-text-act;
     }
     }
   }
   }
+  .image-action {
+    .ivu-btn {
+      width: 26px;
+      height: 26px;
+      padding: 0;
+      font-size: 12px;
+      border-radius: 50%;
+      border: 0;
+      .ivu-icon {
+        color: @color-text-act;
+      }
+    }
+  }
 }
 }
 .marker-image-none {
 .marker-image-none {
   padding-top: 150px;
   padding-top: 150px;
@@ -510,6 +523,37 @@
     color: @color-text;
     color: @color-text;
   }
   }
 }
 }
+.change-standard {
+  .level-list {
+    margin-bottom: 50px;
+  }
+  .level-item {
+    display: inline-block;
+    vertical-align: top;
+    margin: 5px;
+    height: 30px;
+    line-height: 30px;
+    width: 40px;
+    text-align: center;
+    border-radius: 5px;
+    color: @color-text;
+    background-color: @color-background-light;
+    border-color: @color-background-light;
+    cursor: pointer;
+
+    &:hover,
+    &-act {
+      background-color: @color-act1;
+      border-color: @color-act1;
+    }
+
+    &-disabled {
+      cursor: not-allowed;
+      color: @color-text;
+      background-color: shade(@color-background-light, 20%) !important;
+    }
+  }
+}
 // marker-statistics
 // marker-statistics
 .marker-statistics {
 .marker-statistics {
   color: @color-text;
   color: @color-text;
@@ -662,7 +706,7 @@
 .marker-modal {
 .marker-modal {
   color: @color-text;
   color: @color-text;
   .ivu-modal-mask {
   .ivu-modal-mask {
-    background-color: rgba(55, 55, 55, 0.9);
+    background-color: rgba(55, 55, 55, 0.7);
   }
   }
 
 
   .ivu-modal-content {
   .ivu-modal-content {

+ 10 - 10
src/components/EchartRender.vue

@@ -189,34 +189,34 @@ export default {
       const labels = datas[0].data.map(item => item.name);
       const labels = datas[0].data.map(item => item.name);
       const colors = [
       const colors = [
         {
         {
-          color: "rgba(204, 70, 53,1)",
-          lineColor: "rgba(204, 70, 53,0.6)",
+          color: "rgba(21, 91, 146,1)",
+          lineColor: "rgba(21, 91, 146,0.6)",
           linearColor: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
           linearColor: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
             {
             {
               offset: 1,
               offset: 1,
-              color: "rgba(204, 70, 53,1)"
+              color: "rgba(21, 91, 146,1)"
             },
             },
             {
             {
               offset: 0,
               offset: 0,
-              color: "rgba(204, 70, 53,0)"
+              color: "rgba(21, 91, 146,0.2)"
             }
             }
           ]),
           ]),
-          z: 3
+          z: 4
         },
         },
         {
         {
-          color: "rgba(21, 91, 146,1)",
-          lineColor: "rgba(21, 91, 146,0.6)",
+          color: "rgba(204, 70, 53,1)",
+          lineColor: "rgba(204, 70, 53,0.6)",
           linearColor: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
           linearColor: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
             {
             {
               offset: 1,
               offset: 1,
-              color: "rgba(21, 91, 146,1)"
+              color: "rgba(204, 70, 53,1)"
             },
             },
             {
             {
               offset: 0,
               offset: 0,
-              color: "rgba(21, 91, 146,0)"
+              color: "rgba(204, 70, 53,0)"
             }
             }
           ]),
           ]),
-          z: 4
+          z: 3
         }
         }
       ];
       ];
 
 

+ 28 - 7
src/modules/grading/GradingDetail.vue

@@ -124,6 +124,15 @@
           <div class="action-paper-state">
           <div class="action-paper-state">
             <p class="paper-state-cont">批量操作</p>
             <p class="paper-state-cont">批量操作</p>
           </div>
           </div>
+          <div class="action-paper-info">
+            <p><span>任务密号:</span><span>--</span></p>
+          </div>
+          <h3
+            class="action-grade-info-title"
+            v-if="IS_MARK_LEADER && markLeaderOnlyRight"
+          >
+            当前操作:{{ markLeaderOnlyRight.name }}
+          </h3>
           <div class="action-grade-list">
           <div class="action-grade-list">
             <div
             <div
               class="action-grade-item"
               class="action-grade-item"
@@ -256,7 +265,9 @@ export default {
       isFullscreenMarking: false,
       isFullscreenMarking: false,
       // multiple grading
       // multiple grading
       multiplebtnClicked: false,
       multiplebtnClicked: false,
-      multipleGradingList: []
+      multipleGradingList: [],
+      // 科组长权限
+      markLeaderOnlyRight: null
     };
     };
   },
   },
   computed: {
   computed: {
@@ -308,6 +319,11 @@ export default {
       subject: this.subject
       subject: this.subject
     };
     };
     this.curUserRoleType = this.$ls.get("user", { role: "" }).role;
     this.curUserRoleType = this.$ls.get("user", { role: "" }).role;
+
+    this.markLeaderOnlyRight = this.$ls.get("user", {
+      markLeaderOnlyRight: null
+    }).markLeaderOnlyRight;
+
     this.initData();
     this.initData();
   },
   },
   methods: {
   methods: {
@@ -434,22 +450,27 @@ export default {
       const data = await markHistoryList(
       const data = await markHistoryList(
         this.multipleGradingList[0].id,
         this.multipleGradingList[0].id,
         "LEVEL"
         "LEVEL"
-      ).catch(() => {});
-      this.multiplebtnClicked = false;
+      ).catch(() => {
+        this.multiplebtnClicked = false;
+      });
+
       if (!data) return;
       if (!data) return;
 
 
-      this.markers = data.map(item => {
+      const markers = data.map(item => {
         return {
         return {
           id: item.markerId,
           id: item.markerId,
           name: item.marker
           name: item.marker
         };
         };
       });
       });
-      this.levelInfo = {
+      const levelInfo = {
         paperIds: this.multipleGradingList.map(item => item.id).join(),
         paperIds: this.multipleGradingList.map(item => item.id).join(),
         curLevel: this.curStep.name,
         curLevel: this.curStep.name,
-        selectedLevel: level.name
+        selectedLevel: level.name,
+        markLeaderOnlyRight: this.markLeaderOnlyRight
       };
       };
-      this.$refs.ModifyLeaderGrading.open();
+
+      await this.leaderSelectLevel(levelInfo, markers).catch(() => {});
+      this.multiplebtnClicked = false;
     },
     },
     // to review
     // to review
     toReview(index) {
     toReview(index) {

+ 25 - 8
src/modules/grading/leader/LeaderGrading.vue

@@ -37,6 +37,9 @@
         <div class="action-paper-info">
         <div class="action-paper-info">
           <p><span>任务密号:</span><span>--</span></p>
           <p><span>任务密号:</span><span>--</span></p>
         </div>
         </div>
+        <h3 class="action-grade-info-title" v-if="markLeaderOnlyRight">
+          当前操作:{{ markLeaderOnlyRight.name }}
+        </h3>
         <div class="action-grade-list">
         <div class="action-grade-list">
           <div
           <div
             class="action-grade-item"
             class="action-grade-item"
@@ -210,7 +213,9 @@ export default {
       isFullscreenMarking: false,
       isFullscreenMarking: false,
       // multiple grading
       // multiple grading
       multiplebtnClicked: false,
       multiplebtnClicked: false,
-      multipleGradingList: []
+      multipleGradingList: [],
+      // 科组长权限
+      markLeaderOnlyRight: null
     };
     };
   },
   },
   computed: {
   computed: {
@@ -233,6 +238,12 @@ export default {
     }
     }
   },
   },
   created() {
   created() {
+    this.markLeaderOnlyRight = this.$ls.get("user", {
+      markLeaderOnlyRight: null
+    }).markLeaderOnlyRight;
+
+    const curUserRoleType = this.$ls.get("user", { role: "" }).role;
+    this.setCurUserRoleType(curUserRoleType);
     this.initData();
     this.initData();
   },
   },
   methods: {
   methods: {
@@ -243,6 +254,7 @@ export default {
       "setCurStep",
       "setCurStep",
       "setCurArea",
       "setCurArea",
       "setCurSubject",
       "setCurSubject",
+      "setCurUserRoleType",
       "clearState"
       "clearState"
     ]),
     ]),
     initData() {
     initData() {
@@ -301,7 +313,7 @@ export default {
         data.splice(undoIndex, 1);
         data.splice(undoIndex, 1);
       }
       }
 
 
-      if (this.IS_MARK_LEADER && this.IS_TEST) {
+      if (this.IS_TEST) {
         otherStep.push({
         otherStep.push({
           name: "待评",
           name: "待评",
           count: undo.count,
           count: undo.count,
@@ -388,22 +400,27 @@ export default {
       const data = await markHistoryList(
       const data = await markHistoryList(
         this.multipleGradingList[0].id,
         this.multipleGradingList[0].id,
         "LEVEL"
         "LEVEL"
-      ).catch(() => {});
-      this.multiplebtnClicked = false;
+      ).catch(() => {
+        this.multiplebtnClicked = false;
+      });
+
       if (!data) return;
       if (!data) return;
 
 
-      this.markers = data.map(item => {
+      const markers = data.map(item => {
         return {
         return {
           id: item.markerId,
           id: item.markerId,
           name: item.marker
           name: item.marker
         };
         };
       });
       });
-      this.levelInfo = {
+      const levelInfo = {
         paperIds: this.multipleGradingList.map(item => item.id).join(),
         paperIds: this.multipleGradingList.map(item => item.id).join(),
         curLevel: this.curStep.name,
         curLevel: this.curStep.name,
-        selectedLevel: level.name
+        selectedLevel: level.name,
+        markLeaderOnlyRight: this.markLeaderOnlyRight
       };
       };
-      this.$refs.ModifyLeaderGrading.open();
+
+      await this.leaderSelectLevel(levelInfo, markers).catch(() => {});
+      this.multiplebtnClicked = false;
     },
     },
     // paper view action
     // paper view action
     toReview(index) {
     toReview(index) {

+ 3 - 0
src/modules/grading/marker/MarkerGrading.vue

@@ -205,6 +205,8 @@ export default {
       workId: this.workId,
       workId: this.workId,
       subject: this.subject
       subject: this.subject
     };
     };
+    const curUserRoleType = this.$ls.get("user", { role: "" }).role;
+    this.setCurUserRoleType(curUserRoleType);
     this.initData();
     this.initData();
   },
   },
   methods: {
   methods: {
@@ -214,6 +216,7 @@ export default {
       "setSteps",
       "setSteps",
       "setCurArea",
       "setCurArea",
       "setCurStep",
       "setCurStep",
+      "setCurUserRoleType",
       "clearState"
       "clearState"
     ]),
     ]),
     async initData() {
     async initData() {

+ 2 - 6
src/modules/grading/marker/MarkerHeader.vue

@@ -197,7 +197,6 @@ export default {
         workId: "",
         workId: "",
         subject: ""
         subject: ""
       },
       },
-      curUserRoleType: "",
       username: this.$ls.get("user", { loginName: "" }).loginName,
       username: this.$ls.get("user", { loginName: "" }).loginName,
       pageVisible: false,
       pageVisible: false,
       pageSizeList: [2, 3, 4, 6, 8, 9, 10, 12, 15, 16, 20, 24],
       pageSizeList: [2, 3, 4, 6, 8, 9, 10, 12, 15, 16, 20, 24],
@@ -212,11 +211,9 @@ export default {
       "steps",
       "steps",
       "curArea",
       "curArea",
       "curSubject",
       "curSubject",
-      "areas"
+      "areas",
+      "IS_MARK_LEADER"
     ]),
     ]),
-    IS_MARK_LEADER() {
-      return this.curUserRoleType === "MARK_LEADER";
-    },
     stageName() {
     stageName() {
       return this.curSubject.stage === "LEVEL" ? "分档" : "打分";
       return this.curSubject.stage === "LEVEL" ? "分档" : "打分";
     },
     },
@@ -228,7 +225,6 @@ export default {
     const subjectId = this.$route.params.subjectId.split("-");
     const subjectId = this.$route.params.subjectId.split("-");
     this.filter.workId = subjectId[0];
     this.filter.workId = subjectId[0];
     this.filter.subject = subjectId[1];
     this.filter.subject = subjectId[1];
-    this.curUserRoleType = this.$ls.get("user", { role: "" }).role;
     this.getAreaList();
     this.getAreaList();
   },
   },
   methods: {
   methods: {

+ 4 - 4
src/modules/grading/marker/MarkerHistory.vue

@@ -31,6 +31,8 @@
 </template>
 </template>
 
 
 <script>
 <script>
+import { mapState } from "vuex";
+
 import { actionHistory, actionLeaderHistory } from "@/api";
 import { actionHistory, actionLeaderHistory } from "@/api";
 import MarkerImageView from "./MarkerImageView";
 import MarkerImageView from "./MarkerImageView";
 
 
@@ -54,19 +56,17 @@ export default {
       subjectId: this.$route.params.subjectId,
       subjectId: this.$route.params.subjectId,
       userId: "",
       userId: "",
       curPaper: {},
       curPaper: {},
-      papers: [],
-      IS_MARK_LEADER: false
+      papers: []
     };
     };
   },
   },
   computed: {
   computed: {
+    ...mapState("marker", ["IS_MARK_LEADER"]),
     actionName() {
     actionName() {
       return this.IS_MARK_LEADER ? "一键定档" : "已评";
       return this.IS_MARK_LEADER ? "一键定档" : "已评";
     }
     }
   },
   },
   mounted() {
   mounted() {
     this.userId = this.$ls.get("user", { id: "" }).id;
     this.userId = this.$ls.get("user", { id: "" }).id;
-    const curUserRoleType = this.$ls.get("user", { role: "" }).role;
-    this.IS_MARK_LEADER = curUserRoleType === "MARK_LEADER";
     const subjectId = this.subjectId.split("-");
     const subjectId = this.subjectId.split("-");
     this.workId = subjectId[0];
     this.workId = subjectId[0];
     this.subject = subjectId[1];
     this.subject = subjectId[1];

+ 118 - 7
src/modules/grading/marker/MarkerStandard.vue

@@ -30,8 +30,23 @@
               <div class="image-level">
               <div class="image-level">
                 {{ curLevel }}
                 {{ curLevel }}
               </div>
               </div>
+              <div class="image-title">{{ paper.title }}</div>
+            </div>
+            <div v-if="IS_MARK_LEADER" class="image-action">
+              <Button
+                type="error"
+                size="small"
+                icon="md-trash"
+                :disabled="paper.loading"
+                @click="cancelPaper(paper)"
+              ></Button>
+              <Button
+                type="primary"
+                size="small"
+                icon="md-create"
+                @click="toChangePaper(paper)"
+              ></Button>
             </div>
             </div>
-            <div class="image-sn">NO.{{ paper.sn }}</div>
           </marker-image-view>
           </marker-image-view>
         </div>
         </div>
       </div>
       </div>
@@ -39,11 +54,49 @@
     <div v-else class="standard-image-none">
     <div v-else class="standard-image-none">
       <p>暂无数据</p>
       <p>暂无数据</p>
     </div>
     </div>
+
+    <!-- change-standard -->
+    <Modal
+      class="change-standard marker-modal"
+      v-model="levelModalIsShow"
+      title="修改标准卷"
+      width="400px"
+      :mask-closable="false"
+    >
+      <div class="level-list">
+        <p
+          v-for="level in levels"
+          :key="level.name"
+          :class="[
+            'level-item',
+            {
+              'level-item-act': level.name === curSelectLevel,
+              'level-item-disabled': level.name === curChangePaper.level
+            }
+          ]"
+          @click="selectLevel(level)"
+        >
+          {{ level.name }}
+        </p>
+      </div>
+
+      <div slot="footer">
+        <Button
+          type="primary"
+          size="small"
+          :disabled="isSubmit || !curSelectLevel"
+          @click="confirmChange"
+          >确认</Button
+        >
+        <Button size="small" @click="cancelChange">取消</Button>
+      </div>
+    </Modal>
   </Modal>
   </Modal>
 </template>
 </template>
 
 
 <script>
 <script>
-import { paperList } from "@/api";
+import { mapState } from "vuex";
+import { paperList, cancelStandardPaper, leaderGradingPaper } from "@/api";
 import MarkerImageView from "./MarkerImageView";
 import MarkerImageView from "./MarkerImageView";
 
 
 export default {
 export default {
@@ -67,13 +120,16 @@ export default {
       curLevelIndex: 0,
       curLevelIndex: 0,
       papers: [],
       papers: [],
       paperMap: {},
       paperMap: {},
-      isLoading: false
+      isLoading: false,
+      // change standard
+      levelModalIsShow: false,
+      curChangePaper: {},
+      curSelectLevel: null,
+      isSubmit: false
     };
     };
   },
   },
   computed: {
   computed: {
-    actionName() {
-      return this.IS_MARK_LEADER ? "一键定档" : "已评";
-    }
+    ...mapState("marker", ["IS_MARK_LEADER"])
   },
   },
   methods: {
   methods: {
     visibleChange(visible) {
     visibleChange(visible) {
@@ -99,7 +155,11 @@ export default {
       const data = await paperList(datas).catch(() => {});
       const data = await paperList(datas).catch(() => {});
       this.isLoading = false;
       this.isLoading = false;
       if (!data) return;
       if (!data) return;
-      this.papers = data.data;
+      this.papers = data.data.map(item => {
+        item.title = `NO.${item.sn}`;
+        item.loading = false;
+        return item;
+      });
       this.paperMap[this.curLevel] = data.data;
       this.paperMap[this.curLevel] = data.data;
     },
     },
     async updateLevelPapers(level) {
     async updateLevelPapers(level) {
@@ -132,6 +192,57 @@ export default {
     },
     },
     toReview(index) {
     toReview(index) {
       this.$emit("on-paper-click", index, this.papers);
       this.$emit("on-paper-click", index, this.papers);
+    },
+    cancelPaper(paper) {
+      if (paper.loading) return;
+      this.$Modal.confirm({
+        content: "确定要取消当前标准卷吗?",
+        onOk: async () => {
+          paper.loading = true;
+          const res = await cancelStandardPaper(paper.id).catch(() => {});
+          paper.loading = false;
+          if (!res) return;
+          this.updateLevelPapers(this.curLevel);
+        }
+      });
+    },
+    // change standard paper
+    toChangePaper(paper) {
+      this.curChangePaper = paper;
+      this.levelModalIsShow = true;
+    },
+    selectLevel(level) {
+      if (level.name === this.curChangePaper.level) return;
+      this.curSelectLevel = level.name;
+    },
+    async confirmChange() {
+      if (!this.curSelectLevel) return;
+      if (this.isSubmit) return;
+
+      this.isSubmit = true;
+      const datas = {
+        action: "sampling",
+        level: this.curSelectLevel,
+        originLevel: this.curChangePaper.level,
+        paperIds: this.curChangePaper.id
+      };
+      let result = true;
+      await leaderGradingPaper(datas).catch(() => {
+        result = false;
+      });
+      this.isSubmit = false;
+
+      if (!result) return;
+
+      this.$Message.success("操作成功!");
+      this.paperMap[datas.level] = [];
+      this.paperMap[this.curLevel] = [];
+      this.cancelChange();
+      this.updatePapers();
+    },
+    cancelChange() {
+      this.curSelectLevel = null;
+      this.levelModalIsShow = false;
     }
     }
   }
   }
 };
 };

+ 12 - 1
src/modules/grading/marker/store.js

@@ -10,7 +10,10 @@ const state = {
   curStep: { name: "", count: 0 },
   curStep: { name: "", count: 0 },
   areas: [],
   areas: [],
   curArea: {},
   curArea: {},
-  curSubject: {}
+  curSubject: {},
+  curUserRoleType: "",
+  IS_MARKER: false,
+  IS_MARK_LEADER: false
 };
 };
 const mutations = {
 const mutations = {
   setParamSet(state, paramsSet) {
   setParamSet(state, paramsSet) {
@@ -34,6 +37,11 @@ const mutations = {
   setCurSubject(state, curSubject) {
   setCurSubject(state, curSubject) {
     state.curSubject = curSubject;
     state.curSubject = curSubject;
   },
   },
+  setCurUserRoleType(state, curUserRoleType) {
+    state.curUserRoleType = curUserRoleType;
+    state.IS_MARKER = curUserRoleType === "MARKER";
+    state.IS_MARK_LEADER = curUserRoleType === "MARK_LEADER";
+  },
   clearState(state) {
   clearState(state) {
     state.paramsSet = {};
     state.paramsSet = {};
     state.page = {
     state.page = {
@@ -46,6 +54,9 @@ const mutations = {
     state.curStep = { name: "", count: 0 };
     state.curStep = { name: "", count: 0 };
     state.curArea = {};
     state.curArea = {};
     state.curSubject = {};
     state.curSubject = {};
+    state.curUserRoleType = "";
+    state.IS_MARKER = false;
+    state.IS_MARK_LEADER = false;
   }
   }
 };
 };
 
 

+ 3 - 2
src/modules/mark/leader/LeaderMarking.vue

@@ -129,7 +129,6 @@ export default {
       subjectId: this.$route.params.subjectId,
       subjectId: this.$route.params.subjectId,
       subject: "",
       subject: "",
       workSubject: {},
       workSubject: {},
-      curUserRoleType: "",
       applyChangeLevelStatus: 1, // 改档申请处理状态
       applyChangeLevelStatus: 1, // 改档申请处理状态
       levels: [],
       levels: [],
       papers: [],
       papers: [],
@@ -156,7 +155,8 @@ export default {
       workId: this.workId,
       workId: this.workId,
       subject: this.subject
       subject: this.subject
     };
     };
-    this.curUserRoleType = this.$ls.get("user", { role: "" }).role;
+    const curUserRoleType = this.$ls.get("user", { role: "" }).role;
+    this.setCurUserRoleType(curUserRoleType);
     this.initData();
     this.initData();
   },
   },
   methods: {
   methods: {
@@ -167,6 +167,7 @@ export default {
       "setCurArea",
       "setCurArea",
       "setCurStep",
       "setCurStep",
       "setCurSubject",
       "setCurSubject",
+      "setCurUserRoleType",
       "clearState"
       "clearState"
     ]),
     ]),
     initData() {
     initData() {

+ 3 - 1
src/modules/mark/marker/MarkerMarking.vue

@@ -146,7 +146,6 @@ export default {
       subject: "",
       subject: "",
       workSubject: {},
       workSubject: {},
       curSubject: {},
       curSubject: {},
-      curUserRoleType: "MARKER",
       changeStage: 0, // 是否显示改档及改档打分
       changeStage: 0, // 是否显示改档及改档打分
       curStandardGradeId: "",
       curStandardGradeId: "",
       levels: [],
       levels: [],
@@ -175,6 +174,8 @@ export default {
       workId: this.workId,
       workId: this.workId,
       subject: this.subject
       subject: this.subject
     };
     };
+    const curUserRoleType = this.$ls.get("user", { role: "" }).role;
+    this.setCurUserRoleType(curUserRoleType);
     this.initData();
     this.initData();
   },
   },
   methods: {
   methods: {
@@ -184,6 +185,7 @@ export default {
       "setSteps",
       "setSteps",
       "setCurArea",
       "setCurArea",
       "setCurStep",
       "setCurStep",
+      "setCurUserRoleType",
       "clearState"
       "clearState"
     ]),
     ]),
     initData() {
     initData() {