|
@@ -4,6 +4,7 @@
|
|
|
<FormItem>
|
|
|
<Select
|
|
|
v-model="filter.workId"
|
|
|
+ @on-change="workChange"
|
|
|
placeholder="请选择工作文件夹"
|
|
|
style="width: 150px"
|
|
|
>
|
|
@@ -16,13 +17,27 @@
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
<FormItem>
|
|
|
- <Select v-model="filter.areaCode" placeholder="请选择考区">
|
|
|
- <Option value=""></Option>
|
|
|
+ <Select
|
|
|
+ v-model="filter.subject"
|
|
|
+ @on-change="subjectChange"
|
|
|
+ placeholder="请选择科目"
|
|
|
+ >
|
|
|
+ <Option
|
|
|
+ v-for="subject in subjects"
|
|
|
+ :key="subject.id"
|
|
|
+ :value="subject.subject"
|
|
|
+ :label="subject.name"
|
|
|
+ ></Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
<FormItem>
|
|
|
- <Select v-model="filter.subject" placeholder="请选择科目">
|
|
|
- <Option value=""></Option>
|
|
|
+ <Select v-model="filter.questionId" placeholder="请选择考区">
|
|
|
+ <Option
|
|
|
+ v-for="area in areas"
|
|
|
+ :key="area.id"
|
|
|
+ :value="area.id"
|
|
|
+ :label="area.areaName"
|
|
|
+ ></Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
<FormItem>
|
|
@@ -33,9 +48,9 @@
|
|
|
style="width: 120px"
|
|
|
>
|
|
|
<Option
|
|
|
- v-for="(val, key) in STATUS_TYPE"
|
|
|
+ v-for="(val, key) in CHANGE_LEVEL_STATUS"
|
|
|
:key="key"
|
|
|
- :value="key"
|
|
|
+ :value="key * 1"
|
|
|
:label="val"
|
|
|
></Option>
|
|
|
</Select>
|
|
@@ -60,7 +75,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="part-page">
|
|
|
+ <div class="part-page" v-if="total > size">
|
|
|
<Page
|
|
|
:current="current"
|
|
|
:total="total"
|
|
@@ -70,23 +85,19 @@
|
|
|
@on-change="toPage"
|
|
|
></Page>
|
|
|
</div>
|
|
|
- <div class="check-grade-action">
|
|
|
- <div class="paper-info" v-if="curPaper.id">
|
|
|
+ <div class="check-grade-action" v-if="curPaper.id">
|
|
|
+ <div class="paper-info">
|
|
|
<p>{{ curPaper.examNumber }}</p>
|
|
|
<p>NO.{{ curPaper.sn }}</p>
|
|
|
- <p>原档位:{{ curPaper.orgGrade }}</p>
|
|
|
- <p>申请档位:{{ curPaper.applyGrade }}</p>
|
|
|
+ <p>原档位:{{ curPaper.originLevel }}</p>
|
|
|
+ <p>申请档位:{{ curPaper.redoLevel }}</p>
|
|
|
</div>
|
|
|
- <div class="check-grade-result" v-if="curPaper.id">
|
|
|
- <p>{{ curPaper.status ? "已同意" : "未同意" }}</p>
|
|
|
+ <div class="check-grade-result" v-if="curPaper.auditStatus">
|
|
|
+ <p>{{ curPaper.auditStatus === 1 ? "已同意" : "未同意" }}</p>
|
|
|
</div>
|
|
|
- <div class="check-grade-btn" v-if="curPaper.id">
|
|
|
- <Button type="primary" @click="confirm(1)" :disabled="curPaper.status"
|
|
|
- >同意改档</Button
|
|
|
- >
|
|
|
- <Button type="error" @click="confirm(0)" :disabled="curPaper.status"
|
|
|
- >不同意改档</Button
|
|
|
- >
|
|
|
+ <div class="check-grade-btn" v-else>
|
|
|
+ <Button type="primary" @click="confirm(1)">同意改档</Button>
|
|
|
+ <Button type="error" @click="confirm(0)">不同意改档</Button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -96,8 +107,7 @@
|
|
|
class="check-grade-image-preview"
|
|
|
:image-list="papers"
|
|
|
:init-index="curPaperIndex"
|
|
|
- @on-prev="paperPrev"
|
|
|
- @on-next="paperNext"
|
|
|
+ @on-paper-change="selectPaper"
|
|
|
@on-page-prev="prevPage"
|
|
|
@on-page-next="nextPage"
|
|
|
header-hide
|
|
@@ -108,14 +118,14 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { papers } from "@/constants/apiTempData";
|
|
|
-
|
|
|
import {
|
|
|
- inspectionCheckGradePageList,
|
|
|
+ changeLevelPaperAllList,
|
|
|
inspectionConfirmCheckGrade,
|
|
|
- workList
|
|
|
+ workList,
|
|
|
+ areaList
|
|
|
} from "@/api";
|
|
|
import ImagePreview from "@/components/common/ImagePreview";
|
|
|
+import { CHANGE_LEVEL_STATUS } from "@/constants/enumerate";
|
|
|
|
|
|
export default {
|
|
|
name: "inspection-grading",
|
|
@@ -124,15 +134,14 @@ export default {
|
|
|
return {
|
|
|
filter: {
|
|
|
workId: "",
|
|
|
- areaCode: "",
|
|
|
subject: "",
|
|
|
- status: ""
|
|
|
- },
|
|
|
- STATUS_TYPE: {
|
|
|
- 0: "未处理",
|
|
|
- 1: "已处理"
|
|
|
+ questionId: "",
|
|
|
+ status: 0
|
|
|
},
|
|
|
+ CHANGE_LEVEL_STATUS,
|
|
|
works: [],
|
|
|
+ subjects: [],
|
|
|
+ areas: [],
|
|
|
current: 1,
|
|
|
size: 8,
|
|
|
total: 0,
|
|
@@ -146,24 +155,27 @@ export default {
|
|
|
this.initData();
|
|
|
},
|
|
|
methods: {
|
|
|
- initData() {
|
|
|
- this.papers = papers.map((item, index) => {
|
|
|
- return {
|
|
|
- ...item,
|
|
|
- orgGrade: "A",
|
|
|
- applyGrade: "B",
|
|
|
- status: Math.random() < 0.3
|
|
|
- };
|
|
|
- });
|
|
|
- this.curPaper = { ...this.papers[0] };
|
|
|
- this.curPaperIndex = 0;
|
|
|
+ async initData() {
|
|
|
+ await this.getWorkList();
|
|
|
+ this.filter.workId = this.works[0].id;
|
|
|
+ this.workChange();
|
|
|
+ await this.getAreaList();
|
|
|
+ this.filter.questionId = this.areas[0].id;
|
|
|
+ this.getList();
|
|
|
},
|
|
|
async getWorkList() {
|
|
|
- const data = await workList();
|
|
|
- this.works = data.map(item => {
|
|
|
+ this.works = await workList();
|
|
|
+ },
|
|
|
+ async getAreaList() {
|
|
|
+ const data = await areaList({
|
|
|
+ workId: this.filter.workId,
|
|
|
+ subject: this.filter.subject
|
|
|
+ });
|
|
|
+ this.areas = data.map(item => {
|
|
|
return {
|
|
|
id: item.id,
|
|
|
- name: item.name
|
|
|
+ areaName: item.areaName,
|
|
|
+ areaCode: item.areaCode
|
|
|
};
|
|
|
});
|
|
|
},
|
|
@@ -173,7 +185,7 @@ export default {
|
|
|
current: this.current,
|
|
|
size: this.size
|
|
|
};
|
|
|
- const data = await inspectionCheckGradePageList(datas);
|
|
|
+ const data = await changeLevelPaperAllList(datas);
|
|
|
this.papers = data.data;
|
|
|
this.total = data.totalCount;
|
|
|
},
|
|
@@ -181,9 +193,20 @@ export default {
|
|
|
this.current = page;
|
|
|
this.getList();
|
|
|
},
|
|
|
+ workChange() {
|
|
|
+ this.filter.subject = null;
|
|
|
+ this.filter.questionId = null;
|
|
|
+ const curWork = this.works.find(item => item.id === this.filter.workId);
|
|
|
+ this.subjects = curWork.subjects;
|
|
|
+ this.filter.subject = this.subjects[0].subject;
|
|
|
+ },
|
|
|
+ subjectChange() {
|
|
|
+ this.filter.questionId = null;
|
|
|
+ this.getAreaList();
|
|
|
+ },
|
|
|
async confirm(isAgree) {
|
|
|
if (isAgree) {
|
|
|
- this.updateCheckGradeState(status);
|
|
|
+ this.updateCheckGradeState(isAgree);
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -191,18 +214,23 @@ export default {
|
|
|
title: "操作警告",
|
|
|
content: "确定不同意当前改档吗?",
|
|
|
onOk: () => {
|
|
|
- this.updateCheckGradeState(status);
|
|
|
+ this.updateCheckGradeState(isAgree);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- async updateCheckGradeState(status) {
|
|
|
- // TODO:
|
|
|
- await inspectionConfirmCheckGrade(this.curPaper.id);
|
|
|
+ async updateCheckGradeState(auditStatus) {
|
|
|
+ await inspectionConfirmCheckGrade({
|
|
|
+ id: this.curPaper.id,
|
|
|
+ auditStatus
|
|
|
+ });
|
|
|
this.$refs.ImagePreview.showNext();
|
|
|
},
|
|
|
- toReview(index) {
|
|
|
- this.curPaper = { ...this.papers[index] };
|
|
|
+ selectPaper(index) {
|
|
|
this.curPaperIndex = index;
|
|
|
+ this.curPaper = { ...this.papers[index] };
|
|
|
+ },
|
|
|
+ toReview(index) {
|
|
|
+ this.selectPaper(index);
|
|
|
this.$refs.ImagePreview.open();
|
|
|
},
|
|
|
paperPrev(index) {
|
|
@@ -213,21 +241,25 @@ export default {
|
|
|
this.curPaper = { ...this.papers[index] };
|
|
|
this.curPaperIndex = index;
|
|
|
},
|
|
|
- prevPage() {
|
|
|
+ async prevPage() {
|
|
|
if (this.current === 1) {
|
|
|
this.$Message.warning("当前已经是第一条数据了");
|
|
|
return;
|
|
|
}
|
|
|
this.current--;
|
|
|
- this.getList();
|
|
|
+ await this.getList();
|
|
|
+ this.selectPaper(this.papers.length - 1);
|
|
|
+ this.$refs.ImagePreview.initData();
|
|
|
},
|
|
|
- nextPage() {
|
|
|
+ async nextPage() {
|
|
|
if (this.current === this.totalPage) {
|
|
|
this.$Message.warning("当前已经是最后一条数据了");
|
|
|
return;
|
|
|
}
|
|
|
- this.current++;
|
|
|
- this.getList();
|
|
|
+ // 下一页时,继续获取当前页数据。
|
|
|
+ await this.getList();
|
|
|
+ this.selectPaper(0);
|
|
|
+ this.$refs.ImagePreview.initData();
|
|
|
}
|
|
|
}
|
|
|
};
|