ReviewSchedule.vue 1019 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template>
  2. <schema-table :schema="schema">
  3. <schedule-dialog ref="scheduleDialog" />
  4. </schema-table>
  5. </template>
  6. <script>
  7. import { State } from '@/constant'
  8. import mixin from './mixin'
  9. export default {
  10. name: 'WorkflowReviewSchedule',
  11. mixins: [mixin],
  12. data () {
  13. return {
  14. type: 'program'
  15. }
  16. },
  17. computed: {
  18. schema () {
  19. return {
  20. condition: { pageSize: this.list.length },
  21. list: this.getList,
  22. cols: [
  23. { prop: 'name', label: '排期名称' },
  24. ...this.reviewCol
  25. ]
  26. }
  27. }
  28. },
  29. created () {
  30. this.list = this.transform([this.workflow.programCalendar])
  31. if (!this.list.some(({ pass }) => !pass)) {
  32. this.$emit('next')
  33. }
  34. },
  35. methods: {
  36. transform (arr) {
  37. return arr.map(this.transformItem)
  38. },
  39. transformItem ({ id, status, name }) {
  40. return { pass: status !== State.SUBMITTED, id, status, name }
  41. },
  42. onView ({ id }) {
  43. this.$refs.scheduleDialog.show(id)
  44. }
  45. }
  46. }
  47. </script>