|
@@ -232,11 +232,32 @@ export default {
|
|
pickerOptions
|
|
pickerOptions
|
|
};
|
|
};
|
|
},
|
|
},
|
|
- created() {
|
|
|
|
- this.getList();
|
|
|
|
|
|
+ mounted() {
|
|
|
|
+ this.initData();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
...mapActions("exam", ["updateWaitTaskCount"]),
|
|
...mapActions("exam", ["updateWaitTaskCount"]),
|
|
|
|
+ async initData() {
|
|
|
|
+ const cachePageInfo = this.$ls.get("cachePageInfo");
|
|
|
|
+ if (cachePageInfo) {
|
|
|
|
+ this.filter = this.$objAssign(this.filter, cachePageInfo.filter);
|
|
|
|
+ if (this.filter.startTime && this.filter.endTime)
|
|
|
|
+ this.createTime = [this.filter.startTime, this.filter.endTime];
|
|
|
|
+ this.current = cachePageInfo.page;
|
|
|
|
+ await this.getList();
|
|
|
|
+
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ const curRow = this.examTasks.find(
|
|
|
|
+ item => item.id === cachePageInfo.curRowId
|
|
|
|
+ );
|
|
|
|
+ if (!curRow) return;
|
|
|
|
+ this.toEdit(curRow);
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ this.toPage(1);
|
|
|
|
+ }
|
|
|
|
+ this.$ls.remove("cachePageInfo");
|
|
|
|
+ },
|
|
async getList() {
|
|
async getList() {
|
|
const datas = {
|
|
const datas = {
|
|
...this.filter,
|
|
...this.filter,
|
|
@@ -273,7 +294,6 @@ export default {
|
|
.catch(() => {});
|
|
.catch(() => {});
|
|
},
|
|
},
|
|
toEdit(row) {
|
|
toEdit(row) {
|
|
- console.log(row);
|
|
|
|
this.curExamTask = row;
|
|
this.curExamTask = row;
|
|
this.editType = "APPLY";
|
|
this.editType = "APPLY";
|
|
this.$refs.ModifyTaskApply.open();
|
|
this.$refs.ModifyTaskApply.open();
|
|
@@ -287,6 +307,18 @@ export default {
|
|
this.getList();
|
|
this.getList();
|
|
this.updateWaitTaskCount(this.userRoles);
|
|
this.updateWaitTaskCount(this.userRoles);
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ beforeRouteLeave(to, from, next) {
|
|
|
|
+ if (to.name === "CardDesign") {
|
|
|
|
+ this.$ls.set("cachePageInfo", {
|
|
|
|
+ page: this.current,
|
|
|
|
+ filter: this.filter,
|
|
|
|
+ curRowId: this.curExamTask.id
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ this.$ls.remove("cachePageInfo");
|
|
|
|
+ }
|
|
|
|
+ next();
|
|
}
|
|
}
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|