shilipojs 2 лет назад
Родитель
Сommit
7741703ad7

+ 0 - 4
src/views/elective/dispatch/components/dispatch-table.vue

@@ -66,10 +66,6 @@ export default {
   },
   mixins: [MxClassTreeTranslateMixin, MxSelectTranslateMixin, MxTransferMixin],
   props: {
-    loading: {
-      type: Boolean,
-      default: false
-    },
     round: {
       type: Object,
       default: {}

+ 9 - 2
src/views/elective/dispatch/index.vue

@@ -5,8 +5,9 @@
                     @invalid="handleInvalidQuery"
       ></mx-condition>
     </el-card>
-    <p class="text-right mb10"><el-button @click="lockDispatch" type="primary">发布分班</el-button></p>
-    <dispatch-table :loading="loading" :round="round" :settings="settings"></dispatch-table>
+    <p v-if="round.allowDispatch" class="text-right mb10"><el-button @click="lockDispatch" type="primary">发布分班</el-button></p>
+    <dispatch-table v-if="round.allowDispatch" :loading="loading" :round="round" :settings="settings"></dispatch-table>
+    <evaluation-empty v-else-if="!round.allowDispatch" shadow :title="emptyTitle"></evaluation-empty>
   </div>
 </template>
 <script>
@@ -31,6 +32,12 @@ export default {
       round: { },
     };
   },
+  computed: {
+    emptyTitle() {
+      if(Object.keys(this.round).length == 0 && !this.round.allowDispatch) return '当前学年没有选班数据'
+      return '当前选科分班未开启'
+    }
+  },
   provide() {
     return {
       refreshData: this.handleQuery,

+ 14 - 4
src/views/elective/master/components/choose-class.vue

@@ -11,7 +11,7 @@
     </div>
     <span slot="footer" class="dialog-footer">
       <el-button @click="dialogVisible = false">取 消</el-button>
-      <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
+      <el-button type="primary" @click="confirm">确 定</el-button>
     </span>
   </el-dialog>
 </template>
@@ -26,7 +26,9 @@ export default{
   data() {
     return {
       dialogVisible: false,
-      value:''
+      value:'',
+      activeClass:'' // 当前选中的
+      // dispatch               // 分班数据
     }
   },
   computed: {
@@ -36,10 +38,18 @@ export default{
     }
   },
   methods: {
+    confirm() {
+      this.activeClass.newClassId =  this.value
+      this.activeClass.newClassName =  this.getClassName(this.value)
+      this.activeClass.newMasterId =  this.activeClass.prevMasterId
+      this.activeClass.newMasterName =  this.activeClass.prevMasterName
+      this.dialogVisible = false
+    },
     init(row){
       this.dialogVisible = true
-      console.log(row)
-      this.value = row.prevClassId
+      this.activeClass= row
+      // console.log(row)
+      this.value = row.newClassId || row.prevClassId
     }
   }
 }

+ 4 - 4
src/views/elective/master/index.vue

@@ -70,8 +70,8 @@ export default  {
       },
       rows:[{
         year: 2021,
-        prevClassName: '203班',
-        prevClassId: 394,
+        prevClassName: '100',
+        prevClassId: 402,
         prevMasterName: '莫文',
         prevMasterId: 3764,
         newClassName: '',
@@ -80,8 +80,8 @@ export default  {
         newMasterName: '',
       },{
         year: 2021,
-        prevClassName: '202班',
-        prevClassId: 393,
+        prevClassName: '101',
+        prevClassId: 403,
         prevMasterName: '莫名',
         prevMasterId: 3763,
         newClassName: '',