resale.vue 4.3 KB

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