Commit 109a6161ea4a0b81f08f94bf0db66756c07c8c5b
1 parent
f2143fa8
班主任汇总选择问题
Showing
4 changed files
with
67 additions
and
38 deletions
src/views/basic/ask/analysis.vue
| ... | ... | @@ -134,9 +134,9 @@ export default { |
| 134 | 134 | this.$store.getters.info.showRole || |
| 135 | 135 | this.$store.getters.info.permissions[0].role; |
| 136 | 136 | this.types = Number(this.$route.query.types); |
| 137 | - this.className = this.$route.query.className; | |
| 137 | + // this.className = this.$route.query.className; | |
| 138 | 138 | const queryData = JSON.parse(this.$route.query.params); |
| 139 | - this.classId = queryData.classId; | |
| 139 | + this.classId = this.$route.query.classId; | |
| 140 | 140 | console.log(this.$route.query); |
| 141 | 141 | this.subjectNames = this.$route.query.subjectNames.split(","); |
| 142 | 142 | if (this.types == 1) { |
| ... | ... | @@ -163,7 +163,8 @@ export default { |
| 163 | 163 | this.status = this.$route.query.status ? this.$route.query.status : 0; |
| 164 | 164 | this._QueryData(); |
| 165 | 165 | this.types != 1 ? this._QueryDataQuestionRank() : ""; |
| 166 | - this.types != 3 ? this.periodDetail() : ""; | |
| 166 | + // this.types != 3 ? this.periodDetail() : ""; | |
| 167 | + this.periodDetail(); | |
| 167 | 168 | }, |
| 168 | 169 | methods: { |
| 169 | 170 | print() { |
| ... | ... | @@ -215,6 +216,7 @@ export default { |
| 215 | 216 | periodIds: this.id, |
| 216 | 217 | }); |
| 217 | 218 | if (status == 0) { |
| 219 | + this.className = data.className || ""; | |
| 218 | 220 | this.detail = { ...data }; |
| 219 | 221 | this.detail.duration = this.detail.duration |
| 220 | 222 | ? (this.detail.duration / 60).toFixed(2) | ... | ... |
src/views/basic/ask/components/detail.vue
src/views/basic/ask/list.vue
| ... | ... | @@ -174,6 +174,7 @@ export default { |
| 174 | 174 | }, |
| 175 | 175 | tableData: [], |
| 176 | 176 | multipleSelection: [], |
| 177 | + multipleSelectionObj: {}, | |
| 177 | 178 | page: 1, |
| 178 | 179 | size: 20, |
| 179 | 180 | total: 0, |
| ... | ... | @@ -196,6 +197,14 @@ export default { |
| 196 | 197 | this.init(); |
| 197 | 198 | } |
| 198 | 199 | }, |
| 200 | + multipleSelection: { | |
| 201 | + handler: function (nVal) { | |
| 202 | + this.multipleSelectionObj[this.page] = this.tableData.filter((item) => | |
| 203 | + nVal.includes(item.id) | |
| 204 | + ); | |
| 205 | + }, | |
| 206 | + deep: true, | |
| 207 | + }, | |
| 199 | 208 | }, |
| 200 | 209 | methods: { |
| 201 | 210 | //初始化 |
| ... | ... | @@ -225,19 +234,17 @@ export default { |
| 225 | 234 | // 班主任教学班不能与行政班汇总 |
| 226 | 235 | checkboxDisabled(obj) { |
| 227 | 236 | if (this.role == "ROLE_BANZHUREN") { |
| 228 | - let id = this.multipleSelection[0] || ""; | |
| 229 | - if (id) { | |
| 230 | - let classId; | |
| 231 | - for (let i = 0; i < this.tableData.length; i++) { | |
| 232 | - if (this.tableData[i].id == id) { | |
| 233 | - classId = this.tableData[i].classId; | |
| 234 | - break; | |
| 235 | - } | |
| 236 | - } | |
| 237 | + let classId = | |
| 238 | + (this.multipleSelectionObj[1] && | |
| 239 | + this.multipleSelectionObj[1][0]?.classId) || | |
| 240 | + ""; | |
| 241 | + if (classId) { | |
| 237 | 242 | return obj.classId == classId ? false : true; |
| 238 | 243 | } else { |
| 239 | 244 | return false; |
| 240 | 245 | } |
| 246 | + } else { | |
| 247 | + return false; | |
| 241 | 248 | } |
| 242 | 249 | }, |
| 243 | 250 | //去详情 |
| ... | ... | @@ -260,28 +267,51 @@ export default { |
| 260 | 267 | return; |
| 261 | 268 | } |
| 262 | 269 | let subjectArr = []; |
| 263 | - this.tableData.map((item) => { | |
| 270 | + let classId = ""; | |
| 271 | + let multipleData = []; | |
| 272 | + let multipleSelectionData = []; | |
| 273 | + Object.keys(this.multipleSelectionObj).map((keys) => { | |
| 274 | + multipleSelectionData = multipleSelectionData.concat( | |
| 275 | + this.multipleSelectionObj[keys] | |
| 276 | + ); | |
| 277 | + }); | |
| 278 | + multipleSelectionData.map((item) => { | |
| 264 | 279 | if (this.multipleSelection.includes(item.id)) { |
| 265 | 280 | subjectArr.push(item.subjectName); |
| 281 | + multipleData.push(item); | |
| 282 | + classId = item.classId; | |
| 266 | 283 | } |
| 267 | 284 | }); |
| 268 | 285 | subjectArr = [...new Set(subjectArr)]; |
| 269 | - this.$router.push({ | |
| 270 | - path: "/askAnalysis", | |
| 271 | - query: { | |
| 272 | - id: JSON.stringify(this.multipleSelection), | |
| 273 | - types: | |
| 274 | - this.multipleSelection.length == 1 | |
| 275 | - ? 1 | |
| 276 | - : subjectArr.length == 1 | |
| 277 | - ? 2 | |
| 278 | - : 3, | |
| 279 | - subjectNames: subjectArr.join(","), | |
| 280 | - params: this.$route.query.params, | |
| 281 | - className: this.$route.query.className, | |
| 282 | - }, | |
| 283 | - }); | |
| 286 | + if (this.multipleSelection.length == 1) { | |
| 287 | + this.$router.push({ | |
| 288 | + path: "/askAnalysis", | |
| 289 | + query: { | |
| 290 | + id: JSON.stringify(this.multipleSelection), | |
| 291 | + types: 1, | |
| 292 | + subjectNames: subjectArr[0], | |
| 293 | + params: this.$route.query.params, | |
| 294 | + }, | |
| 295 | + }); | |
| 296 | + } else { | |
| 297 | + this.$router.push({ | |
| 298 | + path: "/askAnalysis", | |
| 299 | + query: { | |
| 300 | + id: JSON.stringify(this.multipleSelection), | |
| 301 | + types: | |
| 302 | + this.multipleSelection.length == 1 | |
| 303 | + ? 1 | |
| 304 | + : subjectArr.length == 1 | |
| 305 | + ? 2 | |
| 306 | + : 3, | |
| 307 | + subjectNames: subjectArr.join(","), | |
| 308 | + params: this.$route.query.params, | |
| 309 | + classId: classId, | |
| 310 | + }, | |
| 311 | + }); | |
| 312 | + } | |
| 284 | 313 | }, |
| 314 | + | |
| 285 | 315 | //删除 |
| 286 | 316 | async remove(obj) { |
| 287 | 317 | const { data, status, info } = await this.$request.deletePaperReport({ | ... | ... |
src/views/basic/test/list.vue
| ... | ... | @@ -391,15 +391,11 @@ export default { |
| 391 | 391 | checkboxDisabled(obj) { |
| 392 | 392 | if (obj.examStartTime) { |
| 393 | 393 | if (this.role == "ROLE_BANZHUREN") { |
| 394 | - let id = this.multipleSelection[0] || ""; | |
| 395 | - if (id) { | |
| 396 | - let classId; | |
| 397 | - for (let i = 0; i < this.tableData.length; i++) { | |
| 398 | - if (this.tableData[i].id == id) { | |
| 399 | - classId = this.tableData[i].classId; | |
| 400 | - break; | |
| 401 | - } | |
| 402 | - } | |
| 394 | + let classId = | |
| 395 | + (this.multipleSelectionObj[1] && | |
| 396 | + this.multipleSelectionObj[1][0]?.classId) || | |
| 397 | + ""; | |
| 398 | + if (classId) { | |
| 403 | 399 | return obj.classId == classId ? false : true; |
| 404 | 400 | } else { |
| 405 | 401 | return false; |
| ... | ... | @@ -493,6 +489,7 @@ export default { |
| 493 | 489 | if (this.query.classId?.length > 1) { |
| 494 | 490 | pageSize = 9999; |
| 495 | 491 | } |
| 492 | + this.tableData = []; | |
| 496 | 493 | const examReportList = |
| 497 | 494 | this.role == "ROLE_PERSONAL" |
| 498 | 495 | ? this.$request.pExamReportList | ... | ... |