sureIn.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <view>
  3. <view class="box">
  4. <view class="item">
  5. <view class="l">订单号:</view>
  6. <view class="r">
  7. {{ form.no }}
  8. </view>
  9. </view>
  10. <view class="item">
  11. <view class="l" style="flex: 7;">
  12. <text style="color: red;">*</text>
  13. 境外车入场时间:
  14. </view>
  15. <view class="r">
  16. <uni-datetime-picker placeholder="入场时间" type="datetime" v-model="form.realInTime"/>
  17. </view>
  18. </view>
  19. <view class="item">
  20. <view class="l" style="flex: 7;">
  21. <text style="color: red;">*</text>
  22. 中国车入场时间:
  23. </view>
  24. <view class="r">
  25. <uni-datetime-picker placeholder="入场时间" type="datetime" v-model="form.chinaCarInTime"/>
  26. </view>
  27. </view>
  28. </view>
  29. <u-button type="primary" @click="confirmFn">确认</u-button>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. data() {
  35. return {
  36. id: '',
  37. form: {
  38. realInTime: new Date(),
  39. chinaCarInTime: new Date()
  40. },
  41. }
  42. },
  43. onLoad(options) {
  44. this.id = options.id;
  45. },
  46. onShow() {
  47. this.getBusinessById();
  48. },
  49. methods: {
  50. getBusinessById() {
  51. this.$api.getBusinessById({
  52. id: this.id
  53. }).then(resp => {
  54. this.form = resp.data;
  55. })
  56. },
  57. confirmFn() {
  58. let realInTime = this.form.realInTime;
  59. let chinaCarInTime = this.form.chinaCarInTime;
  60. if (!realInTime || realInTime.length <= 12) {
  61. this.$common.toast('境外车入场时间不正确')
  62. return;
  63. }
  64. if (!chinaCarInTime || chinaCarInTime.length <= 12) {
  65. this.$common.toast('中国车入场时间不正确')
  66. return;
  67. }
  68. this.$api.adminSetIn(this.form).then(Resp => {
  69. this.$common.toast('操作成功');
  70. setTimeout(() => {
  71. this.$common.back()
  72. }, 500)
  73. })
  74. }
  75. }
  76. }
  77. </script>
  78. <style lang="scss">
  79. page {
  80. background-color: #fff;
  81. }
  82. @import '@/common/common.scss'
  83. </style>