|
@@ -28,8 +28,8 @@
|
|
|
</Dropdown>
|
|
|
<div v-if="!isSearch" style="float:right;">
|
|
|
<Icon class="action-btn-icon" type="ios-search" @click="isSearch = true" />
|
|
|
- <Icon v-if="$access.can('admin.*|classroom-upd')" class="action-btn-icon" type="md-trash" @click.stop="showConfirmDelete()" />
|
|
|
- <Icon v-if="$access.can('admin.*|classroom-upd')" class="action-btn-icon" type="md-add" @click="addClassroom()" />
|
|
|
+ <Icon v-if="$access.can('admin.*|student-upd')" class="action-btn-icon" type="md-trash" @click.stop="showConfirmDelete()" />
|
|
|
+ <Icon v-if="$access.can('admin.*|student-upd')" class="action-btn-icon" type="md-add" @click="addClassroom()" />
|
|
|
</div>
|
|
|
<div v-else class="dark-iview-input" style="float:right;width:calc(100% - 200px);padding-right:10px;">
|
|
|
<Input icon="ios-close" v-model="keyword" :placeholder="$t('schoolBaseInfo.codeSearchHolder')" autofocus style="width:100%" @on-click="closeKeySearch" @on-change="filterClassname" />
|
|
@@ -291,7 +291,7 @@ export default {
|
|
|
{ required: true, message: this.$t('schoolBaseInfo.typeWarning'), trigger: 'change' }
|
|
|
],
|
|
|
year: [
|
|
|
- { required: true, type:'number', message: this.$t('schoolBaseInfo.gradeWarning'), trigger: 'change' }
|
|
|
+ { required: true, type: 'number', message: this.$t('schoolBaseInfo.gradeWarning'), trigger: 'change' }
|
|
|
]
|
|
|
}
|
|
|
}
|
|
@@ -627,57 +627,61 @@ export default {
|
|
|
this.currentTabIndex = index
|
|
|
},
|
|
|
saveClassroom() {
|
|
|
- this.$refs['classInfo'].validate((valid) => {
|
|
|
- if (!valid) {
|
|
|
- this.$Message.error(this.$t('schoolBaseInfo.formWarning'))
|
|
|
- } else {
|
|
|
- let option = this.classListShow[this.curClassIndex].option
|
|
|
- if (!option) {
|
|
|
- option = 'update'
|
|
|
+ if (this.$access.can('admin.*|student-upd')) {
|
|
|
+ this.$refs['classInfo'].validate((valid) => {
|
|
|
+ if (!valid) {
|
|
|
+ this.$Message.error(this.$t('schoolBaseInfo.formWarning'))
|
|
|
} else {
|
|
|
- this.classListShow[this.curClassIndex]['code'] = this.$store.state.userInfo.schoolCode
|
|
|
- }
|
|
|
- delete this.classListShow[this.curClassIndex].option
|
|
|
- this.isSaveLoading = true
|
|
|
- this.isListLoading = true
|
|
|
- if (this.classListShow[this.curClassIndex].openType == '2') {
|
|
|
- this.classListShow[this.curClassIndex].teacher.id = ''
|
|
|
- this.classListShow[this.curClassIndex].teacher.name = ''
|
|
|
- }
|
|
|
- this.$api.schoolSetting.classUpsert({
|
|
|
- classroom: this.classListShow[this.curClassIndex],
|
|
|
- option: option,
|
|
|
- school_code: this.$store.state.userInfo.schoolCode
|
|
|
- }).then(
|
|
|
- res => {
|
|
|
- if (res) {
|
|
|
- if (res.error) {
|
|
|
- this.classListShow[this.curClassIndex].option = option
|
|
|
- this.$Message.error(res.v)
|
|
|
- } else {
|
|
|
- this.$Message.success(this.$t('schoolBaseInfo.csTips3'))
|
|
|
- this.updated = false
|
|
|
- if (option == 'insert') {
|
|
|
- this.classListShow[this.curClassIndex].code = 'Class-' + this.classListShow[this.curClassIndex].code
|
|
|
- this.classList.unshift(this.classListShow[this.curClassIndex])
|
|
|
- this.$store.dispatch('user/addSchoolClasses', this.classListShow[this.curClassIndex]);
|
|
|
+ let option = this.classListShow[this.curClassIndex].option
|
|
|
+ if (!option) {
|
|
|
+ option = 'update'
|
|
|
+ } else {
|
|
|
+ this.classListShow[this.curClassIndex]['code'] = this.$store.state.userInfo.schoolCode
|
|
|
+ }
|
|
|
+ delete this.classListShow[this.curClassIndex].option
|
|
|
+ this.isSaveLoading = true
|
|
|
+ this.isListLoading = true
|
|
|
+ if (this.classListShow[this.curClassIndex].openType == '2') {
|
|
|
+ this.classListShow[this.curClassIndex].teacher.id = ''
|
|
|
+ this.classListShow[this.curClassIndex].teacher.name = ''
|
|
|
+ }
|
|
|
+ this.$api.schoolSetting.classUpsert({
|
|
|
+ classroom: this.classListShow[this.curClassIndex],
|
|
|
+ option: option,
|
|
|
+ school_code: this.$store.state.userInfo.schoolCode
|
|
|
+ }).then(
|
|
|
+ res => {
|
|
|
+ if (res) {
|
|
|
+ if (res.error) {
|
|
|
+ this.classListShow[this.curClassIndex].option = option
|
|
|
+ this.$Message.error(res.v)
|
|
|
+ } else {
|
|
|
+ this.$Message.success(this.$t('schoolBaseInfo.csTips3'))
|
|
|
+ this.updated = false
|
|
|
+ if (option == 'insert') {
|
|
|
+ this.classListShow[this.curClassIndex].code = 'Class-' + this.classListShow[this.curClassIndex].code
|
|
|
+ this.classList.unshift(this.classListShow[this.curClassIndex])
|
|
|
+ this.$store.dispatch('user/addSchoolClasses', this.classListShow[this.curClassIndex]);
|
|
|
+ }
|
|
|
}
|
|
|
+ } else {
|
|
|
+ this.$Message.error('API error!')
|
|
|
}
|
|
|
- } else {
|
|
|
+ },
|
|
|
+ err => {
|
|
|
this.$Message.error('API error!')
|
|
|
}
|
|
|
- },
|
|
|
- err => {
|
|
|
- this.$Message.error('API error!')
|
|
|
- }
|
|
|
- ).finally(
|
|
|
- () => {
|
|
|
- this.isSaveLoading = false
|
|
|
- this.isListLoading = false
|
|
|
- }
|
|
|
- )
|
|
|
- }
|
|
|
- })
|
|
|
+ ).finally(
|
|
|
+ () => {
|
|
|
+ this.isSaveLoading = false
|
|
|
+ this.isListLoading = false
|
|
|
+ }
|
|
|
+ )
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.$Message.error('权限不足!')
|
|
|
+ }
|
|
|
},
|
|
|
/**显示确认删除班级对话框 */
|
|
|
showConfirmDelete() {
|