resale.vue 4.4 KB

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