|
|
@@ -193,7 +193,7 @@
|
|
|
<div @click="closeAllClaAddStu" class="kbtn">{{ lang.Cancel }}</div>
|
|
|
|
|
|
<div @click="addStu" class="kbtn" style="background: #3681FC; color: #E6FFFFFF;">{{ lang.Confirm }}</div>
|
|
|
-
|
|
|
+
|
|
|
<!-- <el-button size="small" type="primary" @click="addStu"
|
|
|
>确认</el-button
|
|
|
> -->
|
|
|
@@ -479,10 +479,10 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
console.log(arr);
|
|
|
- if (arr.length > 70) {
|
|
|
- _this.$message.error(_this.lang.Limitmore);
|
|
|
- return;
|
|
|
- }
|
|
|
+ // if (arr.length > 70) {
|
|
|
+ // _this.$message.error(_this.lang.Limitmore);
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
|
|
|
if (this.boxType == 2 && arr.filter(e => e.class) != arr.length) {
|
|
|
_this.$message.error(_this.lang.ssCheckClassCol);
|
|
|
@@ -560,56 +560,91 @@ export default {
|
|
|
|
|
|
this.accUpdate(box);
|
|
|
},
|
|
|
- accUpdate(box) {
|
|
|
+ async accUpdate(box) {
|
|
|
console.log(box, "box");
|
|
|
+ this.uploadfileLoading = true;
|
|
|
this.impbox = box;
|
|
|
- let z = 2;
|
|
|
- let newArr = JSON.stringify(box);
|
|
|
- let params = [
|
|
|
- {
|
|
|
- arr: newArr,
|
|
|
- userpassword: "Coco1234",
|
|
|
- oid: this.oid,
|
|
|
- },
|
|
|
- ];
|
|
|
+ const batchSize = 3;
|
|
|
+ if (box.length > batchSize) {
|
|
|
+ // 计算总批次数
|
|
|
+ const totalBatches = Math.ceil(box.length / batchSize);
|
|
|
+ for (let i = 0; i < totalBatches; i++) {
|
|
|
+ const batch = box.slice(i * batchSize, (i + 1) * batchSize);
|
|
|
+ await this.uploadBatch(batch); // 假设 uploadBatch 返回 Promise
|
|
|
+ console.log(`第 ${i + 1} 批上传完成`, batch);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 长度不超过 10,直接上传整个数组
|
|
|
+ await this.uploadBatch(box);
|
|
|
+ }
|
|
|
+ this.$message({
|
|
|
+ message: this.lang.ssAddOk,
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ this.uploadfileLoading = false;
|
|
|
+
|
|
|
+ this.deltypy = 0;
|
|
|
+ this.popBoxdia= true;
|
|
|
+ // this.addStuVisible = false;
|
|
|
+ console.log('this.selectedStuData',this.selectedStuData);
|
|
|
+
|
|
|
+ // this.selectedStuData = [];
|
|
|
+ this.$emit("getCascaderData");
|
|
|
+ this.addOp3('1', "", { type: "student_add" }, "success")
|
|
|
+ },
|
|
|
+ async uploadBatch(box){
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ // this.impbox = box;
|
|
|
+ let z = 2;
|
|
|
+ let newArr = JSON.stringify(box);
|
|
|
+ let params = [
|
|
|
+ {
|
|
|
+ arr: newArr,
|
|
|
+ userpassword: "Coco1234",
|
|
|
+ oid: this.oid,
|
|
|
+ },
|
|
|
+ ];
|
|
|
console.log(params, "batchRegistrationMoreCopy");
|
|
|
// batchRegistrationMoreCopy
|
|
|
- this.ajax
|
|
|
- .post(this.$store.state.api + "batchRegistrationMoreCopy", params)
|
|
|
- .then((res) => {
|
|
|
- console.log(res, "res");
|
|
|
- if (res.data.type == 1) {
|
|
|
- this.$message.error(this.lang.stunumberregistered);
|
|
|
- z = 1;
|
|
|
- }
|
|
|
- if (res.data.type == 2) {
|
|
|
- this.$message.error(this.lang.stuaccregistered);
|
|
|
- z = 1;
|
|
|
- }
|
|
|
- if (res.data.type == 3) {
|
|
|
- this.$message.error(this.lang.studuplicateIDs);
|
|
|
- z = 1;
|
|
|
- }
|
|
|
- if (z == 2) {
|
|
|
- console.log("添加成功");
|
|
|
- this.$message({
|
|
|
- message: this.lang.ssAddOk,
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- this.deltypy = 0;
|
|
|
- this.popBoxdia= true;
|
|
|
- // this.addStuVisible = false;
|
|
|
- console.log('this.selectedStuData',this.selectedStuData);
|
|
|
-
|
|
|
- // this.selectedStuData = [];
|
|
|
- this.$emit("getCascaderData");
|
|
|
- this.addOp3('1', "", { type: "student_add" }, "success")
|
|
|
- }
|
|
|
- this.uploadfileLoading = false;
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- console.error(err);
|
|
|
- this.addOp3('1', "", { type: "student_add" }, err)
|
|
|
+ this.ajax
|
|
|
+ .post(this.$store.state.api + "batchRegistrationMoreCopy", params)
|
|
|
+ .then((res) => {
|
|
|
+ console.log(res, "res");
|
|
|
+ if (res.data.type == 1) {
|
|
|
+ this.$message.error(this.lang.stunumberregistered);
|
|
|
+ z = 1;
|
|
|
+ }
|
|
|
+ if (res.data.type == 2) {
|
|
|
+ this.$message.error(this.lang.stuaccregistered);
|
|
|
+ z = 1;
|
|
|
+ }
|
|
|
+ if (res.data.type == 3) {
|
|
|
+ this.$message.error(this.lang.studuplicateIDs);
|
|
|
+ z = 1;
|
|
|
+ }
|
|
|
+ if (z == 2) {
|
|
|
+ console.log("添加成功");
|
|
|
+ // this.$message({
|
|
|
+ // message: this.lang.ssAddOk,
|
|
|
+ // type: "success",
|
|
|
+ // });
|
|
|
+ // this.deltypy = 0;
|
|
|
+ // this.popBoxdia= true;
|
|
|
+ // // this.addStuVisible = false;
|
|
|
+ // console.log('this.selectedStuData',this.selectedStuData);
|
|
|
+
|
|
|
+ // // this.selectedStuData = [];
|
|
|
+ // this.$emit("getCascaderData");
|
|
|
+ // this.addOp3('1', "", { type: "student_add" }, "success")
|
|
|
+ }
|
|
|
+ resolve(res);
|
|
|
+ // this.uploadfileLoading = false;
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.error(err);
|
|
|
+ this.addOp3('1', "", { type: "student_add" }, err)
|
|
|
+ reject(err);
|
|
|
+ });
|
|
|
});
|
|
|
},
|
|
|
confirmDelStu(){
|