createOrder.vue 4.3 KB

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