|
@@ -47,7 +47,7 @@
|
|
|
<Icon type="md-create" :color="selections.length > 0 ? 'white':'#606060'" size="18" />
|
|
|
<span>{{ $t('stuAccount.editInfo') }}</span>
|
|
|
</li>
|
|
|
- <li @click="resetPW()" :class=" selections.length > 0 ? '':'sc-disable-cursor' ">
|
|
|
+ <li @click="resetPW(-1)" :class=" selections.length > 0 ? '':'sc-disable-cursor' ">
|
|
|
<Icon custom="iconfont icon-reset" :color="selections.length > 0 ? 'white':'#606060'" size="18" />
|
|
|
<span>重置密码</span>
|
|
|
</li>
|
|
@@ -86,10 +86,7 @@
|
|
|
</template>
|
|
|
</Table>
|
|
|
</Scroll>
|
|
|
- <!-- <div class="page-box dark-iview-page">
|
|
|
- <Page :total="totalNum" show-sizer :page-size="pageSize" show-total :current.sync="currentPage" @on-change="getPageData" @on-page-size-change="setPageSize"/>
|
|
|
- </div>
|
|
|
- <authorization :isShow="authorizationStatus" @closeAuth="closeAuth" :selected="selections"></authorization> -->
|
|
|
+ <authorization :isShow="authorizationStatus" @closeAuth="closeAuth" :selected="selections"></authorization>
|
|
|
</div>
|
|
|
|
|
|
<Modal v-model="addStudentStatus" width="520" class-name="add-student dark-iview-modal" :mask-closable="false">
|
|
@@ -100,8 +97,12 @@
|
|
|
<Modal v-model="importStudentStatus" width="70%" class="import-student" :mask-closable="false">
|
|
|
<div slot="header">
|
|
|
<span class="import-model-title">{{$t('stuAccount.importTitle')}}</span>
|
|
|
+ <div class="importAcademicYear">
|
|
|
+ <span class="label">學年度:</span>
|
|
|
+ <InputNumber v-model="academicYear" :editable="false"></InputNumber>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <import-student v-if="importStudentStatus" :schoolCode="$store.state.user.schoolCode" :isShow="importStudentStatus" @importStudentInfo="closeImportStudent"></import-student>
|
|
|
+ <import-student v-if="importStudentStatus" :schoolCode="$store.state.user.schoolCode" :isShow="importStudentStatus" @importStudentInfo="closeImportStudent" :academicYear="academicYear"></import-student>
|
|
|
<div slot="footer"></div>
|
|
|
</Modal>
|
|
|
</div>
|
|
@@ -147,12 +148,68 @@
|
|
|
tableColumns: [],
|
|
|
queryToken:'',
|
|
|
basicCount: 99,
|
|
|
- pointNum: 0
|
|
|
+ pointNum: 0,
|
|
|
+ academicYear: new Date().getFullYear()
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- resetPW() {
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 重置密碼
|
|
|
+ * @param row
|
|
|
+ */
|
|
|
+ resetPW(row) {
|
|
|
+ //重置单个学生
|
|
|
+ if (row != -1) {
|
|
|
+ this.$Modal.confirm({
|
|
|
+ title: this.$t('重置密碼'),
|
|
|
+ content: '<p>' + this.$t('確定要重置') + " <strong style='color:red;'>" + row.name + '</strong>的密碼</p>',
|
|
|
+ onOk: () => {
|
|
|
+ let ids = []
|
|
|
+ ids.push(
|
|
|
+ {
|
|
|
+ id: row.id,
|
|
|
+ pw: row.id
|
|
|
+ }
|
|
|
+ )
|
|
|
+ this.tableLoading = true
|
|
|
+ this.$api.stuAccount.saveAllStudent(this.$store.state.user.schoolCode , ids).then(
|
|
|
+ (res) => {
|
|
|
+ this.$Message.success('重置成功!')
|
|
|
+ this.tableLoading = false
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ this.$Message.error('API error!')
|
|
|
+ this.tableLoading = false
|
|
|
+ }
|
|
|
+ )
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ //批量重置
|
|
|
+ if (this.selections.length > 0) {
|
|
|
+ this.$Modal.confirm({
|
|
|
+ title: this.$t('重置密碼'),
|
|
|
+ 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, ids).then(
|
|
|
+ (res) => {
|
|
|
+ this.selections.length = 0
|
|
|
+ this.$Message.success('重置成功!')
|
|
|
+ this.tableLoading = false
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ this.$Message.error('API ERROR!')
|
|
|
+ this.tableLoading = false
|
|
|
+ }
|
|
|
+ )
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
getFirstChart(name) {
|
|
|
if (name) {
|
|
@@ -205,7 +262,7 @@
|
|
|
temp.year = parseInt(temp.year)
|
|
|
return temp
|
|
|
})
|
|
|
- let storePath = (data.action == 1 ? 'schoolBaseInfo/setStudentsToState' : 'schoolBaseInfo/uptStudentsToState')
|
|
|
+ let storePath = (data.action == 1 ? 'schoolBaseInfo/addStudentsToState' : 'schoolBaseInfo/uptStudentsToState')
|
|
|
this.$store.dispatch(storePath, newStudents)
|
|
|
this.addStudentStatus = false
|
|
|
this.filterData()
|
|
@@ -256,7 +313,6 @@
|
|
|
},
|
|
|
/**
|
|
|
* 删除学生
|
|
|
- * @param index
|
|
|
* @param row
|
|
|
*/
|
|
|
delStudent(row) {
|
|
@@ -292,20 +348,16 @@
|
|
|
content: '<p>确认批量删除' + " <strong style='color:red;'>" + this.selections.length + '</strong>个学生</p>',
|
|
|
onOk: () => {
|
|
|
this.tableLoading = true
|
|
|
- let delIds = this.selections.map((item, index) => {
|
|
|
+ let delIds = this.selections.map((item) => {
|
|
|
return {id: item.id}
|
|
|
})
|
|
|
this.$api.stuAccount.deleteStudent(this.$store.state.user.schoolCode, delIds).then(
|
|
|
(res) => {
|
|
|
- if (res.error == null) {
|
|
|
- //分页查询后,直接重新访问API
|
|
|
- this.selections.length = 0
|
|
|
- this.$store.dispatch('schoolBaseInfo/delStudentsToState', res.ids)
|
|
|
- this.filterData()
|
|
|
- this.$Message.success('删除成功!')
|
|
|
- } else {
|
|
|
- this.$Message.error('API ERROR!')
|
|
|
- }
|
|
|
+ //分页查询后,直接重新访问API
|
|
|
+ this.selections.length = 0
|
|
|
+ this.$store.dispatch('schoolBaseInfo/delStudentsToState', res.ids)
|
|
|
+ this.filterData()
|
|
|
+ this.$Message.success('删除成功!')
|
|
|
this.tableLoading = false
|
|
|
},
|
|
|
(err) => {
|
|
@@ -318,22 +370,6 @@
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- getSchoolData() {
|
|
|
- this.$store.dispatch('schoolBaseInfo/getClassroom').then(
|
|
|
- (res) => {
|
|
|
- if (res.code == 2) {
|
|
|
- this.$Message.warning('数据为空!')
|
|
|
- } else {
|
|
|
- this.schoolData = this.$store.state.schoolBaseInfo.schoolBaseInfo
|
|
|
- this.classroomList = this.$store.state.schoolBaseInfo.classroomList
|
|
|
- this.findStudentInfo()
|
|
|
- }
|
|
|
- },
|
|
|
- (err) => {
|
|
|
- this.$Message.error('API error!')
|
|
|
- }
|
|
|
- )
|
|
|
- },
|
|
|
initData() {
|
|
|
this.tableColumns = [
|
|
|
{
|
|
@@ -400,16 +436,6 @@
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
- /**查询当前Page学生信息 */
|
|
|
- findStudentInfo() {
|
|
|
- // this.tableLoading = true
|
|
|
- // let params = {
|
|
|
- // '@CURRPAGE': this.currentPage,
|
|
|
- // '@PAGESIZE': this.pageSize,
|
|
|
- // 'code': this.$store.state.user.schoolCode,
|
|
|
- // }
|
|
|
- // this.baseFindStudent(params)
|
|
|
- },
|
|
|
/**基础查询数据 */
|
|
|
baseFindStudent(params) {
|
|
|
this.$api.stuAccount.findStudent(this.$store.state.user.schoolCode).then(
|
|
@@ -423,41 +449,12 @@
|
|
|
})
|
|
|
this.$store.dispatch('schoolBaseInfo/setStudentsToState', newStudents)
|
|
|
this.filterData()
|
|
|
-
|
|
|
- // if (res.error == null) {
|
|
|
- // this.tableData = res.result.data
|
|
|
- // for (let index in this.tableData) {
|
|
|
- // let currentClassroomlInfo = this.$JSONPath.query(this.$store.state.schoolBaseInfo.classroomList, "$..[?(@.classId=='" + this.tableData[index].classId + "')]")
|
|
|
- // if (currentClassroomlInfo.length > 0) {
|
|
|
- // let currentSchoolInfo = this.$JSONPath.query(this.$store.state.schoolBaseInfo.schoolBaseInfo, "$..period[?(@.periodCode=='" + currentClassroomlInfo[0].periodCode + "')]")
|
|
|
- // if (currentSchoolInfo.length > 0) {
|
|
|
- // this.tableData[index].periodName = currentSchoolInfo[0].periodName
|
|
|
- // this.tableData[index].periodCode = currentSchoolInfo[0].periodCode
|
|
|
- // this.tableData[index].gradeName = this.$JSONPath.query(currentSchoolInfo, "$..grades[?(@.gradeCode=='" + currentClassroomlInfo[0].gradeCode + "')]")[0].gradeName
|
|
|
- // this.tableData[index].gradeCode = this.$JSONPath.query(currentSchoolInfo, "$..grades[?(@.gradeCode=='" + currentClassroomlInfo[0].gradeCode + "')]")[0].gradeCode
|
|
|
- // this.tableData[index].classroomName = currentClassroomlInfo[0].classroomName
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // [...this.tableShowData] = this.tableData
|
|
|
- // this.tableLoading = false
|
|
|
- // } else {
|
|
|
- // this.$Message.error('API error!')
|
|
|
- // this.tableLoading = false
|
|
|
- // }
|
|
|
},
|
|
|
(err) => {
|
|
|
this.tableLoading = false
|
|
|
}
|
|
|
)
|
|
|
},
|
|
|
- /**查询学生总共人数 */
|
|
|
- getResultCount(params) {
|
|
|
-
|
|
|
- // this.$api.newEvaluation.FindCount(params).then(res => {
|
|
|
- // this.totalNum = res.result.data[0]
|
|
|
- // })
|
|
|
- },
|
|
|
/** 取得年級Name */
|
|
|
getGradeName: function(periodId, gradeId){
|
|
|
if(periodId != null && gradeId != null){
|
|
@@ -535,15 +532,6 @@
|
|
|
created() {
|
|
|
this.initData()
|
|
|
this.baseFindStudent()
|
|
|
-
|
|
|
- // this.getSchoolData()
|
|
|
- // let findCountParams = {
|
|
|
- // "collectionName": "Student",
|
|
|
- // "queryDict": {
|
|
|
- // 'code': this.$store.state.user.schoolCode
|
|
|
- // }
|
|
|
- // }
|
|
|
- // this.getResultCount(findCountParams)
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters({
|
|
@@ -574,7 +562,6 @@
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
</script>
|