|
@@ -94,7 +94,7 @@
|
|
<el-option label="卷库来源" value="GENERATE"></el-option>
|
|
<el-option label="卷库来源" value="GENERATE"></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
<span
|
|
<span
|
|
- v-if="checked && !multipleSelection.length"
|
|
|
|
|
|
+ v-if="checked && !tempPapers.length"
|
|
class="red"
|
|
class="red"
|
|
style="font-size: 12px; font-weight: bold; margin-left: 10px"
|
|
style="font-size: 12px; font-weight: bold; margin-left: 10px"
|
|
>请选择数据</span
|
|
>请选择数据</span
|
|
@@ -281,6 +281,7 @@ export default {
|
|
tableLoading2: false,
|
|
tableLoading2: false,
|
|
checked: false,
|
|
checked: false,
|
|
initSelectedRows: [],
|
|
initSelectedRows: [],
|
|
|
|
+ isEditInitPage: false,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -324,7 +325,7 @@ export default {
|
|
let res = await this.getTplData();
|
|
let res = await this.getTplData();
|
|
if (res) {
|
|
if (res) {
|
|
this.getStruct();
|
|
this.getStruct();
|
|
- this.getTable2(true);
|
|
|
|
|
|
+ // this.getTable2(true);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -353,10 +354,14 @@ export default {
|
|
}
|
|
}
|
|
);
|
|
);
|
|
const tplData = data.data;
|
|
const tplData = data.data;
|
|
- this.paperIdsArr = tplData.paperIds || [];
|
|
|
|
|
|
+ this.tempPaperIds = tplData.paperIds || [];
|
|
|
|
+ this.tempPapers = tplData.papers || [];
|
|
|
|
+ this.isEditInitPage = true;
|
|
Object.assign(this.form, tplData || {}, {
|
|
Object.assign(this.form, tplData || {}, {
|
|
paperIds: (tplData.paperIds || []).join(","),
|
|
paperIds: (tplData.paperIds || []).join(","),
|
|
});
|
|
});
|
|
|
|
+ this.getTable2();
|
|
|
|
+ this.getTable3();
|
|
return true;
|
|
return true;
|
|
} catch (e) {
|
|
} catch (e) {
|
|
return false;
|
|
return false;
|
|
@@ -374,13 +379,15 @@ export default {
|
|
},
|
|
},
|
|
save() {
|
|
save() {
|
|
this.checked = true;
|
|
this.checked = true;
|
|
|
|
+ let paperIds = this.tempPaperIds.join(",");
|
|
this.$refs.form.validate((valid) => {
|
|
this.$refs.form.validate((valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- if (this.multipleSelection.length && !this.hasError) {
|
|
|
|
|
|
+ if (this.tempPaperIds.length && !this.hasError) {
|
|
let params = {
|
|
let params = {
|
|
courseId: this.$route.query.courseId,
|
|
courseId: this.$route.query.courseId,
|
|
...this.form,
|
|
...this.form,
|
|
rootOrgId: this.user.rootOrgId,
|
|
rootOrgId: this.user.rootOrgId,
|
|
|
|
+ paperIds,
|
|
};
|
|
};
|
|
if (this.$route.params.id) {
|
|
if (this.$route.params.id) {
|
|
params.id = this.$route.params.id;
|
|
params.id = this.$route.params.id;
|
|
@@ -441,7 +448,7 @@ export default {
|
|
this.loading = false;
|
|
this.loading = false;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- getTable2(bool) {
|
|
|
|
|
|
+ getTable2() {
|
|
this.tableLoading2 = true;
|
|
this.tableLoading2 = true;
|
|
let apiUrl =
|
|
let apiUrl =
|
|
this.form.paperType === "IMPORT"
|
|
this.form.paperType === "IMPORT"
|
|
@@ -462,18 +469,18 @@ export default {
|
|
this.tableData2 = res.data.content || [];
|
|
this.tableData2 = res.data.content || [];
|
|
this.totalSelect = res.data.totalElements;
|
|
this.totalSelect = res.data.totalElements;
|
|
// this.curSelect = res.data.number + 1;
|
|
// this.curSelect = res.data.number + 1;
|
|
- if (bool) {
|
|
|
|
- this.tableData2.forEach((item) => {
|
|
|
|
- if (this.paperIdsArr.includes(item.id)) {
|
|
|
|
- this.initSelectedRows.push(item);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- setTimeout(() => {
|
|
|
|
- this.initSelectedRows.forEach((item) => {
|
|
|
|
- this.$refs.table2.toggleRowSelection(item, true);
|
|
|
|
- });
|
|
|
|
- }, 0);
|
|
|
|
- }
|
|
|
|
|
|
+ // if (bool) {
|
|
|
|
+ // this.tableData2.forEach((item) => {
|
|
|
|
+ // if (this.paperIdsArr.includes(item.id)) {
|
|
|
|
+ // this.initSelectedRows.push(item);
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ // setTimeout(() => {
|
|
|
|
+ // this.initSelectedRows.forEach((item) => {
|
|
|
|
+ // this.$refs.table2.toggleRowSelection(item, true);
|
|
|
|
+ // });
|
|
|
|
+ // }, 0);
|
|
|
|
+ // }
|
|
this.tableLoading2 = false;
|
|
this.tableLoading2 = false;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -492,15 +499,22 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.getTable2();
|
|
this.getTable2();
|
|
|
|
+ this.getTable3();
|
|
},
|
|
},
|
|
changePaperType() {
|
|
changePaperType() {
|
|
- this.tempPapers = [];
|
|
|
|
- this.tempPaperIds = [];
|
|
|
|
- this.tableData2 = [];
|
|
|
|
- this.tableData3 = [];
|
|
|
|
- this.multipleSelection = [];
|
|
|
|
- this.curSelect = 1;
|
|
|
|
- this.getTable2();
|
|
|
|
|
|
+ console.log("changePaperType");
|
|
|
|
+ if (!this.isEditInitPage) {
|
|
|
|
+ this.tempPapers = [];
|
|
|
|
+ this.tempPaperIds = [];
|
|
|
|
+ this.tableData2 = [];
|
|
|
|
+ this.tableData3 = [];
|
|
|
|
+ this.multipleSelection = [];
|
|
|
|
+ this.curSelect = 1;
|
|
|
|
+ this.getTable2();
|
|
|
|
+ } else {
|
|
|
|
+ this.isEditInitPage = false;
|
|
|
|
+ }
|
|
|
|
+
|
|
// if (bool === true) {
|
|
// if (bool === true) {
|
|
// // this.handleSelectionChange([]);
|
|
// // this.handleSelectionChange([]);
|
|
// this.tempPapers = [];
|
|
// this.tempPapers = [];
|
|
@@ -548,12 +562,14 @@ export default {
|
|
},
|
|
},
|
|
handleSelectionChange(val) {
|
|
handleSelectionChange(val) {
|
|
// this.multipleSelection = val;
|
|
// this.multipleSelection = val;
|
|
- val.forEach((element) => {
|
|
|
|
- this.tempPapers.push(cloneDeep(element));
|
|
|
|
- this.tempPaperIds.push(element.id);
|
|
|
|
- });
|
|
|
|
- this.getTable2();
|
|
|
|
- this.getTable3();
|
|
|
|
|
|
+ if (val.length) {
|
|
|
|
+ val.forEach((element) => {
|
|
|
|
+ this.tempPapers.push(cloneDeep(element));
|
|
|
|
+ this.tempPaperIds.push(element.id);
|
|
|
|
+ });
|
|
|
|
+ this.getTable2();
|
|
|
|
+ this.getTable3();
|
|
|
|
+ }
|
|
},
|
|
},
|
|
hasNumError(row) {
|
|
hasNumError(row) {
|
|
return (
|
|
return (
|