DispatchMaster.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <el-dialog
  3. title="班主任分班"
  4. :visible.sync="show"
  5. width="30%"
  6. >
  7. <div class="block">
  8. <p class="mb10">请设置班主任分配的生效日期</p>
  9. <el-date-picker
  10. v-model="settings.activeDate"
  11. type="date"
  12. value-format="yyyy-MM-dd"
  13. placeholder="选择日期">
  14. </el-date-picker>
  15. </div>
  16. <span slot="footer" class="dialog-footer">
  17. <el-button @click="show = false">取 消</el-button>
  18. <el-button type="primary" @click="onConfirm">确 定</el-button>
  19. </span>
  20. </el-dialog>
  21. </template>
  22. <script>
  23. import { lockPublishTeachers } from '@/api/webApi/elective/dispatch'
  24. export default {
  25. data(){
  26. return {
  27. show:false,
  28. value: '',
  29. settings: {}
  30. }
  31. },
  32. methods: {
  33. init() {
  34. console.log('dialog---init', this)
  35. },
  36. onConfirm() {
  37. if(!this.settings.activeDate){
  38. this.$message.warning('生效日期不能为空')
  39. return
  40. }
  41. this.lock()
  42. },
  43. lock() {
  44. lockPublishTeachers({
  45. ...this.settings
  46. }).then(res => {
  47. this.show = false
  48. this.success()
  49. }).finally(_ => {
  50. this.show = false
  51. })
  52. }
  53. }
  54. }
  55. </script>
  56. <style>
  57. </style>