|
@@ -52,6 +52,12 @@
|
|
|
<p class="import-info" v-show="$store.state.config.srvAdr == 'China'">
|
|
|
{{$t('stuAccount.sit16')}}
|
|
|
</p>
|
|
|
+ <p class="import-info" style="margin-top: 10px;">
|
|
|
+ <Checkbox v-model="rewriteList">
|
|
|
+ <span>{{ $t('stuAccount.rewriteList1') }}</span>
|
|
|
+ <span>{{ $t('stuAccount.rewriteList2') }}</span>
|
|
|
+ </Checkbox>
|
|
|
+ </p>
|
|
|
</div>
|
|
|
<Upload multiple type="drag" action="" :before-upload="customUpload" style="margin-top:20px">
|
|
|
<div class="file-area">
|
|
@@ -175,7 +181,12 @@
|
|
|
<p v-show="excelValid.imeiErr.includes(row.id)" class="account-error-tips">{{$t('stuAccount.sit20') }}</p>
|
|
|
<p v-show="excelValid.genderErr.includes(row.id)" class="account-error-tips">{{$t('stuAccount.sit21') }}</p>
|
|
|
<!-- 与已有账号对比 -->
|
|
|
- <p v-show="dataValid.noRep.includes(row.id)" class="account-error-tips">{{$t('stuAccount.setNoErr')}}</p>
|
|
|
+ <p v-show="dataValid.noRep.includes(row.id)" class="account-error-tips" :style="{'text-decoration': rewriteList ? 'line-through' : 'none'}">
|
|
|
+ {{ $t('stuAccount.setNoErr') }}
|
|
|
+ <Tooltip :content="$t('stuAccount.rewriteList3')" placement="left" v-show="rewriteList">
|
|
|
+ <Icon type="md-alert" />
|
|
|
+ </Tooltip>
|
|
|
+ </p>
|
|
|
<p v-show="dataValid.idRep.includes(row.id)" class="account-warning-tips">{{$t('stuAccount.idRepErr') }}</p>
|
|
|
</template>
|
|
|
</Table>
|
|
@@ -195,6 +206,13 @@
|
|
|
</Button>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <Modal v-model="importing" :title="$t('schoolBaseInfo.warmTips')" width="680" class="point-modal tree-upload-modal">
|
|
|
+ <div>{{ $t('stuAccount.sit27') }}</div>
|
|
|
+ <div slot="footer">
|
|
|
+ <Button type="text" @click="importAgain()">{{ $t('teachermgmt.impText4') }}</Button>
|
|
|
+ <Button type="primary" @click="doConfirm()">{{ $t('teachermgmt.impText7') }}</Button>
|
|
|
+ </div>
|
|
|
+ </Modal>
|
|
|
</vuescroll>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -244,11 +262,14 @@ export default {
|
|
|
dataValid: {
|
|
|
idRep: [], // id已存在
|
|
|
noRep: [], // 座号重复
|
|
|
+ noStu: [], // 座号重复的原学生信息
|
|
|
},
|
|
|
tableData: [],
|
|
|
tableTitle: [],
|
|
|
tableLoading: false,
|
|
|
- isTableCrt: false
|
|
|
+ isTableCrt: false,
|
|
|
+ rewriteList: false,
|
|
|
+ importing: false,
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -296,27 +317,27 @@ export default {
|
|
|
this.$Message.error(this.$t('stuAccount.importTips12'))
|
|
|
return
|
|
|
}
|
|
|
- if (this.dataValid?.noRep.length) {
|
|
|
+ if (this.dataValid?.noRep.length && !this.rewriteList) {
|
|
|
this.$Message.error(this.$t('stuAccount.importTips12'))
|
|
|
return
|
|
|
}
|
|
|
- console.log(this.tableData)
|
|
|
- let hasNoGenderData = this.tableData.some(i => !i.gender)
|
|
|
- if (hasNoGenderData) {
|
|
|
+ if(this.rewriteList) {
|
|
|
this.$Modal.confirm({
|
|
|
title: this.$t('schoolBaseInfo.warmTips'),
|
|
|
- content: this.$t('stuAccount.sit27'),
|
|
|
+ content: this.$t('stuAccount.rewriteList4'),
|
|
|
okText: this.$t('teachermgmt.impText7'),
|
|
|
cancelText: this.$t('teachermgmt.impText4'),
|
|
|
onOk: () => {
|
|
|
- this.doConfirm()
|
|
|
+ let hasNoGenderData = this.tableData.some(i => !i.gender)
|
|
|
+ hasNoGenderData ? (this.importing = true) : this.doConfirm()
|
|
|
},
|
|
|
onCancel: () => {
|
|
|
this.importAgain()
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
- this.doConfirm()
|
|
|
+ let hasNoGenderData = this.tableData.some(i => !i.gender)
|
|
|
+ hasNoGenderData ? (this.importing = true) : this.doConfirm()
|
|
|
}
|
|
|
},
|
|
|
doConfirm() {
|
|
@@ -334,19 +355,32 @@ export default {
|
|
|
delete item.classroom
|
|
|
return item
|
|
|
})
|
|
|
+ if(this.rewriteList) {
|
|
|
+ this.dataValid.noStu.forEach(item => {
|
|
|
+ item.no = null
|
|
|
+ item.pw = item.id
|
|
|
+ })
|
|
|
+ }
|
|
|
let schoolCode = this.$store.state.userInfo.schoolCode
|
|
|
- this.$api.stuAccount.ImportStudent(schoolCode, temp).then(
|
|
|
+ this.$api.stuAccount.ImportStudent(schoolCode, this.dataValid.noStu).then(
|
|
|
(res) => {
|
|
|
if (!res.error) {
|
|
|
- this.$Message.info(this.$t('stuAccount.importOk'))
|
|
|
- this.$store.commit('student/importStudents', temp)
|
|
|
- this.checkUpdateClass(temp)
|
|
|
- this.viewStatus = 'finish'
|
|
|
+ this.$api.stuAccount.ImportStudent(schoolCode, temp).then((resolve) => {
|
|
|
+ if (!resolve.error) {
|
|
|
+ this.$Message.info(this.$t('stuAccount.importOk'))
|
|
|
+ this.$store.commit('student/importStudents', temp)
|
|
|
+ this.checkUpdateClass(temp)
|
|
|
+ this.viewStatus = 'finish'
|
|
|
+ } else {
|
|
|
+ this.$Message.info(this.$t('stuAccount.importErr'))
|
|
|
+ }
|
|
|
+ }, (err) => {
|
|
|
+
|
|
|
+ })
|
|
|
} else {
|
|
|
this.$Message.info(this.$t('stuAccount.importErr'))
|
|
|
}
|
|
|
- },
|
|
|
- (err) => {
|
|
|
+ }, (err) => {
|
|
|
|
|
|
}
|
|
|
).finally(() => {
|
|
@@ -355,6 +389,7 @@ export default {
|
|
|
},
|
|
|
async importAgain() {
|
|
|
this.viewStatus = 'tips'
|
|
|
+ this.importing = false
|
|
|
this.initData()
|
|
|
},
|
|
|
initData() {
|
|
@@ -551,7 +586,10 @@ export default {
|
|
|
let res = originStu.periodId == this.periodId && originStu.id != item.id && originStu.classNo == item.classId && originStu.classYear?.toString() == item.classYear && (item.no && originStu.no == item.no)
|
|
|
return res
|
|
|
})
|
|
|
- if (s) this.dataValid.noRep.push(item.id)
|
|
|
+ if (s) {
|
|
|
+ this.dataValid.noRep.push(item.id)
|
|
|
+ this.dataValid.noStu.push(JSON.parse(JSON.stringify(s)))
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
//筛选已存在的账号
|
|
@@ -682,6 +720,7 @@ export default {
|
|
|
this.dataValid = {
|
|
|
idRep: [], // id已存在
|
|
|
noRep: [], // 座号重复
|
|
|
+ noStu: [], // 座号重复的原学生信息
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -858,4 +897,7 @@ export default {
|
|
|
.excel-data-wrap .ivu-table td {
|
|
|
background: none;
|
|
|
}
|
|
|
+.account-error-tips .ivu-tooltip-inner {
|
|
|
+ max-width: none;
|
|
|
+}
|
|
|
</style>
|