|
@@ -104,13 +104,46 @@
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div>
|
|
<el-button
|
|
<el-button
|
|
- v-if="checkPrivilege('button', 'ExamTaskStudentObject') && editable"
|
|
|
|
|
|
+ v-if="
|
|
|
|
+ checkPrivilege(
|
|
|
|
+ 'button',
|
|
|
|
+ 'ExamTaskStudentObject',
|
|
|
|
+ 'TaskApplyManage'
|
|
|
|
+ ) && editable
|
|
|
|
+ "
|
|
type="primary"
|
|
type="primary"
|
|
@click="toAdd"
|
|
@click="toAdd"
|
|
>新增考试对象</el-button
|
|
>新增考试对象</el-button
|
|
>
|
|
>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <el-form label-width="90px">
|
|
|
|
+ <el-form-item label="考试时间:">
|
|
|
|
+ <one-date-time-range
|
|
|
|
+ :start-date-time.sync="taskModel.examStartTime"
|
|
|
|
+ :end-date-time.sync="taskModel.examEndTime"
|
|
|
|
+ :disabled="!editable"
|
|
|
|
+ @change="timeChange"
|
|
|
|
+ >
|
|
|
|
+ </one-date-time-range>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="印刷室:">
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="taskModel.printHouseId"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ filterable
|
|
|
|
+ :disabled="!editable"
|
|
|
|
+ @change="printHouseChange"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="room in printHouses"
|
|
|
|
+ :key="room.printHouseId"
|
|
|
|
+ :value="room.printHouseId"
|
|
|
|
+ :label="room.printHouseName"
|
|
|
|
+ ></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
<el-table ref="TableList" :data="tableData" border>
|
|
<el-table ref="TableList" :data="tableData" border>
|
|
<el-table-column type="index" width="80" label="卷袋序号">
|
|
<el-table-column type="index" width="80" label="卷袋序号">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -133,20 +166,11 @@
|
|
></el-input-number>
|
|
></el-input-number>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="考试时间" width="300">
|
|
|
|
|
|
+ <el-table-column label="考试时间" width="180">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <template v-if="!scope.row.canEditTime">
|
|
|
|
|
|
+ <template>
|
|
{{ scope.row.examDate }} {{ scope.row.examTime }}
|
|
{{ scope.row.examDate }} {{ scope.row.examTime }}
|
|
</template>
|
|
</template>
|
|
- <template v-else>
|
|
|
|
- <one-date-time-range
|
|
|
|
- :start-date-time.sync="scope.row.examStartTime"
|
|
|
|
- :end-date-time.sync="scope.row.examEndTime"
|
|
|
|
- :disabled="!editable"
|
|
|
|
- @change="timeChange(scope.row)"
|
|
|
|
- >
|
|
|
|
- </one-date-time-range>
|
|
|
|
- </template>
|
|
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column prop="examPlace" label="校区(考点)" width="140">
|
|
<el-table-column prop="examPlace" label="校区(考点)" width="140">
|
|
@@ -170,22 +194,6 @@
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column prop="printHouseName" label="印刷室" width="140">
|
|
<el-table-column prop="printHouseName" label="印刷室" width="140">
|
|
- <template slot-scope="scope">
|
|
|
|
- <el-select
|
|
|
|
- v-model="scope.row.printHouseId"
|
|
|
|
- placeholder="请选择"
|
|
|
|
- filterable
|
|
|
|
- :disabled="!editable"
|
|
|
|
- @change="() => printHouseChange(scope.row)"
|
|
|
|
- >
|
|
|
|
- <el-option
|
|
|
|
- v-for="room in printHouses"
|
|
|
|
- :key="room.printHouseId"
|
|
|
|
- :value="room.printHouseId"
|
|
|
|
- :label="room.printHouseName"
|
|
|
|
- ></el-option>
|
|
|
|
- </el-select>
|
|
|
|
- </template>
|
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column
|
|
<el-table-column
|
|
label="操作"
|
|
label="操作"
|
|
@@ -284,6 +292,8 @@ export default {
|
|
showStudent: false,
|
|
showStudent: false,
|
|
curCreateTime: [],
|
|
curCreateTime: [],
|
|
defaultTime: "",
|
|
defaultTime: "",
|
|
|
|
+ taskModel: { examStartTime: null, examEndTime: null, printHouseId: "" },
|
|
|
|
+ curHouse: null,
|
|
// exam task content
|
|
// exam task content
|
|
infoExamTask: {},
|
|
infoExamTask: {},
|
|
infoExamTaskDetail: [],
|
|
infoExamTaskDetail: [],
|
|
@@ -314,6 +324,10 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
async getPrintHouses() {
|
|
async getPrintHouses() {
|
|
this.printHouses = await listTaskPrintHouse();
|
|
this.printHouses = await listTaskPrintHouse();
|
|
|
|
+ if (this.printHouses.length === 1) {
|
|
|
|
+ this.curHouse = this.printHouses[0];
|
|
|
|
+ this.taskModel.printHouseId = this.curHouse.printHouseId;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
async getInfoPrintTask() {
|
|
async getInfoPrintTask() {
|
|
const orgInfo = this.$ls.get("user", { orgInfo: {} }).orgInfo;
|
|
const orgInfo = this.$ls.get("user", { orgInfo: {} }).orgInfo;
|
|
@@ -345,6 +359,17 @@ export default {
|
|
|
|
|
|
this.tableData = this.infoPrintTask.list;
|
|
this.tableData = this.infoPrintTask.list;
|
|
this.updatePackageInfos();
|
|
this.updatePackageInfos();
|
|
|
|
+
|
|
|
|
+ // 数据复现
|
|
|
|
+ if (this.tableData.length) {
|
|
|
|
+ const row = this.tableData[0];
|
|
|
|
+ this.taskModel.printHouseId = row.printHouseId;
|
|
|
|
+ this.taskModel.examStartTime = row.examStartTime;
|
|
|
|
+ this.taskModel.examEndTime = row.examEndTime;
|
|
|
|
+ this.curHouse = this.printHouses.find(
|
|
|
|
+ (item) => item.printHouseId === this.taskModel.printHouseId
|
|
|
|
+ );
|
|
|
|
+ }
|
|
},
|
|
},
|
|
updatePackageInfos() {
|
|
updatePackageInfos() {
|
|
this.packageInfos.packageCount = this.tableData.length;
|
|
this.packageInfos.packageCount = this.tableData.length;
|
|
@@ -367,25 +392,34 @@ export default {
|
|
}
|
|
}
|
|
return { backupCount, minBackupCount: backupCount };
|
|
return { backupCount, minBackupCount: backupCount };
|
|
},
|
|
},
|
|
- timeChange(row) {
|
|
|
|
- if (!row.examStartTime || !row.examEndTime) {
|
|
|
|
- row.examDate = "";
|
|
|
|
- row.examTime = "";
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
|
|
+ timeChange() {
|
|
|
|
+ this.tableData.forEach((row) => {
|
|
|
|
+ if (!this.taskModel.examStartTime || !this.taskModel.examEndTime) {
|
|
|
|
+ row.examDate = "";
|
|
|
|
+ row.examTime = "";
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
|
|
- Object.assign(row, getExamDateTime(row.examStartTime, row.examEndTime));
|
|
|
|
|
|
+ Object.assign(
|
|
|
|
+ row,
|
|
|
|
+ getExamDateTime(
|
|
|
|
+ this.taskModel.examStartTime,
|
|
|
|
+ this.taskModel.examEndTime
|
|
|
|
+ )
|
|
|
|
+ );
|
|
|
|
+ });
|
|
},
|
|
},
|
|
backupCountChange() {
|
|
backupCountChange() {
|
|
this.updatePackageInfos();
|
|
this.updatePackageInfos();
|
|
},
|
|
},
|
|
- printHouseChange(row) {
|
|
|
|
- const curHouse = this.printHouses.find(
|
|
|
|
- (item) => item.printHouseId === row.printHouseId
|
|
|
|
|
|
+ printHouseChange() {
|
|
|
|
+ this.curHouse = this.printHouses.find(
|
|
|
|
+ (item) => item.printHouseId === this.taskModel.printHouseId
|
|
);
|
|
);
|
|
- if (curHouse) {
|
|
|
|
- row.printHouseName = curHouse.printHouseName;
|
|
|
|
- }
|
|
|
|
|
|
+ this.tableData.forEach((row) => {
|
|
|
|
+ row.printHouseId = this.curHouse?.printHouseId;
|
|
|
|
+ row.printHouseName = this.curHouse?.printHouseName;
|
|
|
|
+ });
|
|
},
|
|
},
|
|
toAdd() {
|
|
toAdd() {
|
|
if (!this.infoExamTask.courseId) {
|
|
if (!this.infoExamTask.courseId) {
|
|
@@ -428,7 +462,6 @@ export default {
|
|
isSelectStudent: true,
|
|
isSelectStudent: true,
|
|
examTaskStudentObjectParamList: [],
|
|
examTaskStudentObjectParamList: [],
|
|
classNames: [],
|
|
classNames: [],
|
|
- canEditTime: false,
|
|
|
|
...modalFormData,
|
|
...modalFormData,
|
|
};
|
|
};
|
|
return data;
|
|
return data;
|
|
@@ -519,10 +552,12 @@ export default {
|
|
...this.getBackupCount(data.examTaskStudentObjectParamList.length),
|
|
...this.getBackupCount(data.examTaskStudentObjectParamList.length),
|
|
className: data.classNames.join(),
|
|
className: data.classNames.join(),
|
|
studentCount: data.examTaskStudentObjectParamList.length,
|
|
studentCount: data.examTaskStudentObjectParamList.length,
|
|
- canEditTime: !data.examStartTime || !data.examEndTime,
|
|
|
|
});
|
|
});
|
|
this.tableData.push(tableRow);
|
|
this.tableData.push(tableRow);
|
|
});
|
|
});
|
|
|
|
+ // 更新考试时间和印刷室
|
|
|
|
+ this.printHouseChange();
|
|
|
|
+ this.timeChange();
|
|
},
|
|
},
|
|
toDelete(index) {
|
|
toDelete(index) {
|
|
this.tableData.splice(index, 1);
|
|
this.tableData.splice(index, 1);
|