sureIn.vue 1.8 KB

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