|
@@ -175,7 +175,6 @@ export default {
|
|
|
*/
|
|
|
resetPW(row) {
|
|
|
//重置单个学生
|
|
|
- console.log(row)
|
|
|
if (row != -1) {
|
|
|
this.$Modal.confirm({
|
|
|
title: this.$t('重置密碼'),
|
|
@@ -206,20 +205,23 @@ export default {
|
|
|
content: '<p>确认批量重置' + " <strong style='color:red;'>" + this.selections.length + '</strong>个学生密碼</p>',
|
|
|
onOk: () => {
|
|
|
this.tableLoading = true
|
|
|
- // let ids = this.selections.map(item => {
|
|
|
- // return { id: item.id, pw: item.id }
|
|
|
- // })
|
|
|
- this.$api.stuAccount.saveAllStudent(this.$store.state.user.schoolCode, this.selections).then(
|
|
|
+ let apiData = this.selections.map( (item) =>{
|
|
|
+ let d = item
|
|
|
+ d.pw = d.id
|
|
|
+ return d
|
|
|
+ })
|
|
|
+
|
|
|
+ this.$api.stuAccount.saveAllStudent(this.$store.state.user.schoolCode, apiData).then(
|
|
|
res => {
|
|
|
this.selections.length = 0
|
|
|
this.$Message.success('重置成功!')
|
|
|
- this.tableLoading = false
|
|
|
},
|
|
|
err => {
|
|
|
this.$Message.error('API ERROR!')
|
|
|
- this.tableLoading = false
|
|
|
}
|
|
|
- )
|
|
|
+ ).finally(() => {
|
|
|
+ this.tableLoading = false
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
}
|