|
@@ -6,7 +6,7 @@
|
|
|
width="550px"
|
|
|
:close-on-click-modal="false"
|
|
|
:close-on-press-escape="false"
|
|
|
- :show-close="false"
|
|
|
+ :show-close="true"
|
|
|
append-to-body
|
|
|
@open="visibleChange"
|
|
|
>
|
|
@@ -14,10 +14,10 @@
|
|
|
ref="modalFormComp"
|
|
|
:model="modalForm"
|
|
|
:rules="rules"
|
|
|
- label-width="120"
|
|
|
+ label-width="120px"
|
|
|
>
|
|
|
<el-form-item label="课程名称:">
|
|
|
- {{ task.courseName }}({{ task.courseCode }})
|
|
|
+ {{ task.courseName }}
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="preScanCount" label="预扫张数:">
|
|
|
<el-input-number
|
|
@@ -80,6 +80,7 @@ export default {
|
|
|
return {
|
|
|
modalIsShow: false,
|
|
|
loading: false,
|
|
|
+ user: this.$ls.get("user", {}),
|
|
|
scanStatus: "INIT", // INIT:初始状态,START:已开始,PAUSE:已暂停
|
|
|
modalForm: {
|
|
|
preScanCount: undefined
|
|
@@ -98,8 +99,8 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
- user() {
|
|
|
- return this.$store.state.user;
|
|
|
+ taskBound() {
|
|
|
+ return this.user.id === this.task.scanUserId;
|
|
|
}
|
|
|
},
|
|
|
beforeDestroy() {
|
|
@@ -130,10 +131,12 @@ export default {
|
|
|
if (this.loading) return;
|
|
|
this.loading = true;
|
|
|
|
|
|
- await bingScanUser({
|
|
|
- paperScanTaskId: this.task.id,
|
|
|
- userId: this.user.id
|
|
|
- });
|
|
|
+ if (!this.taskBound) {
|
|
|
+ await bingScanUser({
|
|
|
+ paperScanTaskId: this.task.id,
|
|
|
+ userId: this.user.id
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
this.scaningImageList = [];
|
|
|
this.scanStatus = "START";
|
|
@@ -153,7 +156,7 @@ export default {
|
|
|
setTimeout(() => {
|
|
|
this.scanStatus = "PAUSE";
|
|
|
console.log("扫描仪停止");
|
|
|
- }, 5 * 1000);
|
|
|
+ }, 1 * 1000);
|
|
|
},
|
|
|
async confirm() {
|
|
|
this.scaningImageList = getPreUploadFilesAutoSerial(this.GLOBAL.input);
|
|
@@ -200,19 +203,21 @@ export default {
|
|
|
async saveScanImage() {
|
|
|
for (let i = 0, len = this.scaningImageList.length; i < len; i++) {
|
|
|
const files = this.scaningImageList[i];
|
|
|
- const ouputImageList = saveOutputImage([
|
|
|
- files.frontFile,
|
|
|
- files.versoFile
|
|
|
- ]);
|
|
|
+ const ouputImageList = saveOutputImage(
|
|
|
+ [files.frontFile, files.versoFile],
|
|
|
+ {
|
|
|
+ taskId: this.task.id
|
|
|
+ }
|
|
|
+ );
|
|
|
const fileInfo = {
|
|
|
taskId: this.task.id,
|
|
|
- taskName: this.task.name,
|
|
|
- courseCode: this.task.courseCode,
|
|
|
+ taskName: this.task.scanTaskName,
|
|
|
+ courseCode: "",
|
|
|
courseName: this.task.courseName,
|
|
|
- teachingClassName: this.task.teachingClassName,
|
|
|
+ teachingClassName: this.task.teachClazzName,
|
|
|
frontOriginImgPath: ouputImageList[0],
|
|
|
versoOriginImgPath: ouputImageList[1],
|
|
|
- clientUserId: this.user.userId,
|
|
|
+ clientUserId: this.user.id,
|
|
|
clientUsername: this.user.name,
|
|
|
clientUserLoginTime: this.user.loginTime
|
|
|
};
|