dialog.stateChange.vue 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <van-dialog @confirm="onConfirm" v-model="show" show-cancel-button>
  3. <div style="margin: 10px">
  4. <div>
  5. <div>是否登记{{ stateText }}时间?</div>
  6. </div>
  7. <time-cell
  8. v-if="show"
  9. required
  10. is-row
  11. title="时间"
  12. v-model="time"
  13. dateType="datetime"
  14. textFormatter="YYYY年M月D日H时m分"
  15. :max-date="new Date()"
  16. />
  17. </div>
  18. </van-dialog>
  19. </template>
  20. <script>
  21. import dayjs from 'dayjs'
  22. import TimeCell from '@/components/timeCell'
  23. export default {
  24. components: { TimeCell },
  25. data() {
  26. return {
  27. show: false,
  28. subSystem: {},
  29. stateText: '',
  30. time: new Date()
  31. }
  32. },
  33. props: {},
  34. methods: {
  35. dayjs,
  36. onConfirm() {
  37. this.$emit('success', this.subSystem, this.state, this.time)
  38. },
  39. open(subSystem, state, stateText) {
  40. this.subSystem = subSystem
  41. this.state = state
  42. this.stateText = stateText
  43. this.time = new Date()
  44. this.show = true
  45. }
  46. }
  47. }
  48. </script>