|
@@ -7,23 +7,23 @@
|
|
|
|
|
|
<el-card>
|
|
|
<div class="fx-row jc-between mb10" >
|
|
|
- <el-button type="primary">一键维持原班级</el-button>
|
|
|
- <el-button type="primary">发送名单</el-button>
|
|
|
+ <el-button type="primary" @click="keepAll">一键维持原班级</el-button>
|
|
|
+ <el-button type="primary" @click="send">发送名单</el-button>
|
|
|
</div>
|
|
|
|
|
|
<mx-table :propDefines="propDefines" :rows="rows">
|
|
|
- <template #temp="row">
|
|
|
+ <template #temp="{row}">
|
|
|
<el-popover
|
|
|
placement="bottom"
|
|
|
trigger="click">
|
|
|
<span class="btn-green mr5" @click="changeMaster">班主任</span>
|
|
|
- <span class="btn-green" @click="changeClass">班级</span>
|
|
|
+ <span class="btn-green" @click="changeClass(row)">班级</span>
|
|
|
|
|
|
<el-button type="primary" slot="reference" size="mini">更换</el-button>
|
|
|
</el-popover>
|
|
|
</template>
|
|
|
- <template #cancel="row">
|
|
|
- <el-button type="danger" size="mini">取消</el-button>
|
|
|
+ <template #cancel="{row}">
|
|
|
+ <el-button type="danger" size="mini" @click="cancel(row)">取消</el-button>
|
|
|
</template>
|
|
|
</mx-table>
|
|
|
</el-card>
|
|
@@ -70,17 +70,23 @@ export default {
|
|
|
},
|
|
|
rows:[{
|
|
|
year: 2021,
|
|
|
- prevClassName: '201班',
|
|
|
- prevMasterName: '李某',
|
|
|
- prevMasterId: 1,
|
|
|
+ prevClassName: '203班',
|
|
|
+ prevClassId: 394,
|
|
|
+ prevMasterName: '莫文',
|
|
|
+ prevMasterId: 3764,
|
|
|
newClassName: '',
|
|
|
+ nextClassId: '',
|
|
|
+ newMasterId: 0,
|
|
|
newMasterName: '',
|
|
|
},{
|
|
|
year: 2021,
|
|
|
prevClassName: '202班',
|
|
|
- prevMasterName: '王某',
|
|
|
- prevMasterId: 2,
|
|
|
+ prevClassId: 393,
|
|
|
+ prevMasterName: '莫名',
|
|
|
+ prevMasterId: 3763,
|
|
|
newClassName: '',
|
|
|
+ newClassId: '',
|
|
|
+ newMasterId: 0,
|
|
|
newMasterName: '',
|
|
|
}
|
|
|
],
|
|
@@ -93,6 +99,32 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ keepAll() {
|
|
|
+ this.rows = this.rows.map(item => {
|
|
|
+ item.newClassName = item.prevClassName
|
|
|
+ item.newClassId = item.prevClassId
|
|
|
+ item.newMasterId = item.prevMasterId
|
|
|
+ item.newMasterName = item.prevMasterName
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ },
|
|
|
+ send() {
|
|
|
+ const isSend = this.rows.filter(item => {
|
|
|
+ return item.newMasterId != 0
|
|
|
+ }).length == this.rows.length
|
|
|
+ console.log(isSend)
|
|
|
+ if(!isSend) {
|
|
|
+ this.$message.warning('还有班级未分配')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ cancel(row){
|
|
|
+ row.newClassName =''
|
|
|
+ row.newClassId =''
|
|
|
+ row.newMasterId =0
|
|
|
+ row.newMasterName =''
|
|
|
+ },
|
|
|
handleQuery() {
|
|
|
console.log(1111111)
|
|
|
},
|
|
@@ -100,8 +132,8 @@ export default {
|
|
|
console.log(11111111)
|
|
|
this.$refs.chooseMasterTeacher.dialogVisible = true
|
|
|
},
|
|
|
- changeClass() {
|
|
|
- this.$refs.chooseClass.dialogVisible = true
|
|
|
+ changeClass(row) {
|
|
|
+ this.$refs.chooseClass.init(row)
|
|
|
},
|
|
|
handleInvalidQuery() {
|
|
|
this.dataList = []
|