resale.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <view>
  3. <view class="cmain" style="padding-bottom: 80px;">
  4. <view class="box order_detail">
  5. <view class="item">
  6. <text class="label">商品名称</text>
  7. <text class="desc omit">{{ item.goodsNames }}</text>
  8. </view>
  9. <view class="item">
  10. <text class="label">订单编号</text>
  11. <text class="desc omit">{{ item.tradeNo }}</text>
  12. </view>
  13. <view class="item">
  14. <text class="label">商品重量</text>
  15. <text class="desc">{{ item.totalWeight }}</text>
  16. </view>
  17. <view class="item">
  18. <text class="label">商品单位</text>
  19. <text class="desc">{{ item.goodsUnit }}</text>
  20. </view>
  21. <view class="item">
  22. <text class="label">订单金额</text>
  23. <text class="desc">¥ {{ item.totalPrice }}</text>
  24. </view>
  25. <view class="item">
  26. <text class="label">转售金额</text>
  27. <text class="desc">
  28. <input type="number" v-model="resalePrice" placeholder="请输入(元)" />
  29. </text>
  30. </view>
  31. <view class="item">
  32. <text class="label">利润</text>
  33. <text class="desc">50元</text>
  34. </view>
  35. <view class="item">
  36. <text class="label">总金额(系统计算)</text>
  37. <text class="desc">
  38. <input type="number" v-model="sumPrice" :disabled="true"/>
  39. </text>
  40. </view>
  41. </view>
  42. <u-divider text="费项明细"></u-divider>
  43. <view class="box">
  44. <u-collapse v-for="(item,index) in feeItemLIst" :key="index">
  45. <u-collapse-item :title="item.name" class="cell_title" >
  46. <view class="itm">1、收费企业:{{ item.companyName }}</view>
  47. <view class="itm" v-if="item.feeType ==1">2、收费类型:按交易额收取</view>
  48. <view class="itm" v-if="item.feeType ==2">2、收费类型:按次收取</view>
  49. <view class="itm" v-if="item.feeType ==3">2、收费类型:按吨收取</view>
  50. <view class="itm" v-if="item.feeType ==1">3、收费%(按交易额):<span style="color: coral;">{{ item.percent }} %</span></view>
  51. <view class="itm" v-if="item.feeType ==1">4、当前订单收取金额:<span style="color: coral;">{{ (item.percent * resalePrice)/100}} 元</span></view>
  52. <view class="itm" v-if="item.feeType ==2">3、收费金额(按次收):<span style="color: coral;">{{ item.feeMoney }} 元</span></view>
  53. <view class="itm" v-if="item.feeType ==2">4、当前订单收取金额:<span style="color: coral;">{{ item.feeMoney }} 元</span></view>
  54. <view class="itm" v-if="item.feeType ==3">3、收费%(按吨):<span style="color: coral;">{{ item.percent }} %</span></view>
  55. <view class="itm" v-if="item.feeType ==3">4、当前订单收取金额:<span style="color: coral;">{{ (item.percent * resalePrice)/100}} 元</span></view>
  56. </br>
  57. <view class="itm">当前费项收取金额以最后结算时为准</view>
  58. </u-collapse-item>
  59. </u-collapse>
  60. </view>
  61. </view>
  62. <view class="mfooter" v-if="item.resaleStatus != 1">
  63. <view class="flex">
  64. <view class="f">
  65. <button class="btn" @click="ok()">确定</button>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </template>
  71. <script>
  72. export default {
  73. data() {
  74. return {
  75. item: {},
  76. resalePrice: '',
  77. feeItemLIst: [],
  78. sumPrice: ''
  79. };
  80. },
  81. onLoad(e) {
  82. if (e.item) {
  83. this.item = JSON.parse(e.item);
  84. this.countPrice();
  85. }
  86. this.getFeeItem();
  87. },
  88. methods: {
  89. //费项明细
  90. getFeeItem(){
  91. this.http.request({
  92. url: '/level-two-server/app/TbItemRules/getAllList',
  93. success: res => {
  94. this.feeItemLIst = res.data.data
  95. }
  96. });
  97. },
  98. //费项合计
  99. countPrice(){
  100. this.http.request({
  101. url: '/level-two-server/app/TbOrders/countPrice',
  102. data: {id: this.item.id},
  103. success: res => {
  104. this.sumPrice = (res.data.data).toFixed(2)
  105. }
  106. });
  107. },
  108. ok() {
  109. let rule = { name: 'resalePrice', checkType: 'notnull', errorMsg: '请输入转售金额' };
  110. if (!this.verify.check(this.resalePrice, rule)) {
  111. uni.showModal({ content: this.verify.error, showCancel: false });
  112. return false;
  113. }
  114. uni.showModal({
  115. title: '提示',
  116. content: '我已核对转售信息',
  117. success: res => {
  118. if (res.confirm) {
  119. this.http.request({
  120. url: '/level-two-server/app/TbOrders/addOrderByResale',
  121. data: {id: this.item.id, resalePrice: this.resalePrice},
  122. success: res => {
  123. uni.showToast({title: '提交成功'});
  124. this.item.resaleStatus = 1;
  125. }
  126. });
  127. }
  128. }
  129. });
  130. }
  131. }
  132. };
  133. </script>
  134. <style lang="scss">
  135. page {
  136. background-color: $pg;
  137. }
  138. .item {
  139. input{
  140. margin-top: 0px!important;
  141. }
  142. }
  143. </style>