createOrder.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <template>
  2. <view>
  3. <view class="box">
  4. <view class="item">
  5. <view class="l">客户名称:</view>
  6. <view class="r">
  7. {{form.customerName}}
  8. </view>
  9. </view>
  10. <view class="item">
  11. <view class="l">订单号:</view>
  12. <view class="r">
  13. {{form.no}}
  14. </view>
  15. </view>
  16. <view class="item">
  17. <view class="l">业务费用:</view>
  18. <view class="r">
  19. {{form.itemPrice}}元
  20. </view>
  21. </view>
  22. <view class="item">
  23. <view class="l" style="flex: 7;">境外车入场:</view>
  24. <view class="r">
  25. {{form.realInTime}}
  26. </view>
  27. </view>
  28. <view class="item">
  29. <view class="l" style="flex: 7;"><text style="color: red;">*</text>境外车预计离场:</view>
  30. <view class="r">
  31. <uni-datetime-picker placeholder="离场时间" :start="new Date().getTime()" type="datetime" @change="jwCaroTimeChange"
  32. v-model="form.outDayTime" />
  33. </view>
  34. </view>
  35. <view class="item">
  36. <view class="l">停车费用:</view>
  37. <view class="r">
  38. {{form.partMoney}}
  39. <text v-if="form.partMoney">元</text>
  40. </view>
  41. </view>
  42. <view class="item">
  43. <view class="l" style="flex: 7;">中国车入场:</view>
  44. <view class="r">
  45. {{form.chinaCarInTime}}
  46. </view>
  47. </view>
  48. <view class="item">
  49. <view class="l" style="flex: 7;"><text style="color: red;">*</text>中国车预计离场:</view>
  50. <view class="r">
  51. <uni-datetime-picker placeholder="离场时间" :start="new Date().getTime()" type="datetime" @change="chinaCaroTimeChange"
  52. v-model="form.chinaCarOutTime" />
  53. </view>
  54. </view>
  55. <view class="item">
  56. <view class="l">停车费用:</view>
  57. <view class="r">
  58. {{form.chinaPartMoney}}
  59. <text v-if="form.chinaPartMoney">元</text>
  60. </view>
  61. </view>
  62. <view class="item">
  63. <view class="l">总计费用:</view>
  64. <view class="r">
  65. {{form.totalMoney}}
  66. </view>
  67. </view>
  68. </view>
  69. <u-button type="primary" @click="confirmFn">确认生成</u-button>
  70. </view>
  71. </template>
  72. <script>
  73. export default {
  74. data() {
  75. return {
  76. id: '',
  77. form: {
  78. partMoney: 0,
  79. outDayTime: '',
  80. chinaCarOutTime: ''
  81. },
  82. }
  83. },
  84. onLoad(options) {
  85. this.id = options.id;
  86. },
  87. onShow() {
  88. this.getBusinessById();
  89. },
  90. methods: {
  91. jwCaroTimeChange(date) {
  92. if (!date || date.length <= 12) {
  93. this.form.outDayTime = '';
  94. this.form.partMoney = 0;
  95. this.$common.toast('境外车离场时间不正确');
  96. return;
  97. }
  98. this.form.outDayTime = date;
  99. let o = Object.assign(this.form);
  100. o.items = null;
  101. o.outDayTime = date;
  102. this.$api.calJwPartMoney(this.$common.removeNull(o)).then(resp => {
  103. this.form = resp.data;
  104. })
  105. },
  106. chinaCaroTimeChange(date) {
  107. if (!date) {
  108. this.form.chinaCarOutTime = '';
  109. this.form.chinaPartMoney = 0;
  110. this.$common.toast('请选择离场时间');
  111. return;
  112. }
  113. if (date.length <= 12) {
  114. this.$common.toast('请选择时间');
  115. return;
  116. }
  117. this.form.chinaCarOutTime = date;
  118. let o = Object.assign(this.form);
  119. o.items = null;
  120. this.$api.calChinaPartMoney(this.$common.removeNull(o)).then(resp => {
  121. this.form = resp.data;
  122. })
  123. },
  124. getBusinessById() {
  125. this.$api.getBusinessById({
  126. id: this.id
  127. }).then(resp => {
  128. this.form = resp.data;
  129. })
  130. },
  131. confirmFn() {
  132. if (!this.form.chinaCarOutTime || !this.form.outDayTime) {
  133. this.$common.toast('请选择时间')
  134. return;
  135. }
  136. this.form.items = null;
  137. this.$api.completeOrder(this.$common.removeNull(this.form)).then(Resp => {
  138. this.$common.toast('操作成功');
  139. setTimeout(() => {
  140. this.$common.back()
  141. }, 500)
  142. })
  143. }
  144. }
  145. }
  146. </script>
  147. <style lang="scss">
  148. page {
  149. background-color: #fff;
  150. }
  151. @import '@/common/common.scss';
  152. </style>