AccountDialog.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <confirm-dialog
  3. ref="dialog"
  4. size="lg fixed"
  5. title="部门账号报表"
  6. confirm-text="下载"
  7. @confirm="onConfirm"
  8. >
  9. <template #default>
  10. <div class="l-flex__fill l-flex">
  11. <department-tree
  12. class="c-sibling-item c-sidebar u-width--xl"
  13. @change="onGroupChanged"
  14. />
  15. <div class="c-sibling-item far">
  16. <el-checkbox v-model="recursive">
  17. 级联
  18. </el-checkbox>
  19. </div>
  20. </div>
  21. </template>
  22. </confirm-dialog>
  23. </template>
  24. <script>
  25. import { getAccountExcel } from '../api.js'
  26. export default {
  27. name: 'AccountDialog',
  28. data () {
  29. return {
  30. recursive: false
  31. }
  32. },
  33. methods: {
  34. show () {
  35. this.recursive = false
  36. this.$refs.dialog.show()
  37. },
  38. onGroupChanged (group) {
  39. this.$group = group
  40. },
  41. onConfirm (done) {
  42. getAccountExcel({
  43. departmentId: this.$group.id,
  44. recursive: this.recursive ? 1 : 0
  45. }, this.recursive
  46. ? `${this.$group.name}_全量`
  47. : `${this.$group.name}`).then(done)
  48. }
  49. }
  50. }
  51. </script>