|
@@ -1,6 +1,8 @@
|
|
|
<template>
|
|
|
<div class="cus-student-contianer">
|
|
|
<div class="stu-action-wrap common-save-btn">
|
|
|
+ <Button style="color: red;" @click="isBatchIRS = false" v-if="isBatchIRS">{{ $t('newCusMgt.irs.batchText') }}</Button>
|
|
|
+ <Button style="margin: 0 20px;" @click="confirmBatchIRS" v-if="isBatchIRS">{{ $t('newCusMgt.irs.cancel') }}</Button>
|
|
|
<Dropdown style="margin-top:5px;margin-right:8px">
|
|
|
<a href="javascript:void(0)">
|
|
|
{{$t('cusMgt.moreFn')}}
|
|
@@ -31,6 +33,12 @@
|
|
|
{{$t('cusMgt.editStu')}}
|
|
|
</span>
|
|
|
</DropdownItem>
|
|
|
+ <DropdownItem @click.native="clickBatchIRS" v-if="basicStuList && basicStuList.scope == 'private'" class="action-item">
|
|
|
+ <span>
|
|
|
+ <Icon type="md-settings" size="16" />
|
|
|
+ {{ $t('newCusMgt.irs.batchSetting') }}
|
|
|
+ </span>
|
|
|
+ </DropdownItem>
|
|
|
<DropdownItem @click.native="addStuStatus = true" v-if="basicStuList && basicStuList.scope == 'private'" v-show="$store.state.userInfo.hasSchool">
|
|
|
<span class="action-item">
|
|
|
<Icon type="md-add" size="16" />
|
|
@@ -76,8 +84,9 @@
|
|
|
<span>{{row.type === 2 ? $t('cusMgt.schoolType') : $t('cusMgt.tmIDType')}}</span>
|
|
|
</template>
|
|
|
<template slot-scope="{ row,index }" slot="irs">
|
|
|
- <span v-show="editIndex !== index" :style="{color:row.irs ? '#303030':'red'}">{{row.irs || $t('cusMgt.notSet')}}</span>
|
|
|
+ <span v-show="editIndex !== index && !isBatchIRS" :style="{color:row.irs ? '#303030':'red'}">{{row.irs || $t('cusMgt.notSet')}}</span>
|
|
|
<InputNumber :min="1" v-model="editIrs" v-show="editIndex == index" style="width: 60px;"></InputNumber>
|
|
|
+ <InputNumber :min="1" v-model="oldIRSArr[index]" v-if="isBatchIRS" style="width: 60px;"></InputNumber>
|
|
|
<Icon type="md-checkmark" v-show="editIndex == index" @click="confirmSetNo(row,index)" class="reset-no-btn" />
|
|
|
<Icon type="md-close" v-show="editIndex == index" @click="cancelSetInfo()" class="reset-no-btn" />
|
|
|
</template>
|
|
@@ -183,6 +192,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ isBatchIRS:false,
|
|
|
btnLoading: false,
|
|
|
pdfLoading: false,
|
|
|
setIrsStatus: false,
|
|
@@ -350,6 +360,7 @@ export default {
|
|
|
processList: [],
|
|
|
agreeList: [],
|
|
|
processListSel: [],
|
|
|
+ oldIRSArr:[]
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -371,6 +382,49 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ clickBatchIRS(){
|
|
|
+ this.isBatchIRS = true
|
|
|
+ this.oldIRSArr = this.basicStuList.members.map(item=>+item.irs)
|
|
|
+ },
|
|
|
+ confirmBatchIRS(){
|
|
|
+ console.error(this.oldIRSArr)
|
|
|
+ console.error(this.basicStuList)
|
|
|
+ let repeatArr = []
|
|
|
+ this.oldIRSArr.forEach((item,index)=>{
|
|
|
+ // 判断oldIRSArr数组里面是否存在除自身以外的重复元素
|
|
|
+ if(this.oldIRSArr.filter(i => i === item).length > 1){
|
|
|
+ repeatArr.push(item)
|
|
|
+ }else{
|
|
|
+ this.basicStuList.members[index].irs = item
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if(repeatArr.length){
|
|
|
+ this.$Message.warning(`${this.$t('newCusMgt.irs.repeatTip')}: ${[...new Set(repeatArr)].join(',')}`)
|
|
|
+ }else{
|
|
|
+ this.basicStuList.members.forEach((i,index) => {
|
|
|
+ i.irs = this.oldIRSArr[index] + ''
|
|
|
+ })
|
|
|
+ this.$api.common.upsertGroupInfo(this.basicStuList).then(
|
|
|
+ res => {
|
|
|
+ this.$Message.success(this.$t('cusMgt.listSaveOk'))
|
|
|
+ //TODO 更新父组件数据
|
|
|
+ this.$emit('on-update-students', {
|
|
|
+ stuListId: this.basicStuList.id,
|
|
|
+ students: this._.cloneDeep(this.basicStuList.members)
|
|
|
+ })
|
|
|
+ this.setIrsStatus = false
|
|
|
+ this.isBatchIRS = false
|
|
|
+ },
|
|
|
+ err => {
|
|
|
+ this.$Message.error(this.$t('cusMgt.listSaveErr'))
|
|
|
+ }
|
|
|
+ ).finally(() => {
|
|
|
+ this.btnLoading = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ console.error(repeatArr)
|
|
|
+ console.error(this.basicStuList.members.map(i => +i.irs))
|
|
|
+ },
|
|
|
setStuInfo(row, index) {
|
|
|
this.editIrs = parseInt(row.irs || 1)
|
|
|
this.editIndex = index
|
|
@@ -770,6 +824,7 @@ export default {
|
|
|
immediate: true,
|
|
|
handler(n, o) {
|
|
|
console.log('班级信息:', n)
|
|
|
+ this.isBatchIRS = false
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -780,7 +835,7 @@ export default {
|
|
|
</style>
|
|
|
<style lang="less">
|
|
|
.cus-student-contianer .common-save-btn .ivu-btn {
|
|
|
- color: #515a6e !important;
|
|
|
+ // color: #515a6e !important;
|
|
|
padding: 0px 5px !important;
|
|
|
}
|
|
|
</style>
|