resale.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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.tradeNo }}</text>
  8. </view>
  9. <view class="item">
  10. <text class="label">商品名称</text>
  11. <text class="desc omit">{{ item.goodsNames }}</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.netWt }}</text>
  20. </view>
  21. <view class="item">
  22. <text class="label">毛重</text>
  23. <text class="desc">{{ item.grossWt }}</text>
  24. </view>
  25. <view class="item">
  26. <text class="label">商品单位</text>
  27. <text class="desc">{{ item.goodsUnit }}</text>
  28. </view>
  29. <view class="item">
  30. <text class="label">订单金额</text>
  31. <text class="desc">¥ {{ item.totalPrice }}</text>
  32. </view>
  33. <view class="item">
  34. <text class="label">上架金额(元)</text>
  35. <text class="desc">
  36. <input type="number" v-model="resalePrice" placeholder="请输入" />
  37. </text>
  38. </view>
  39. <!-- <view class="item">
  40. <text class="label">利润</text>
  41. <text class="desc">50元</text>
  42. </view> -->
  43. <!-- <view class="item">
  44. <text class="label">计算总金额</text>
  45. <text class="desc">
  46. <input type="number" v-model="resalePrice" :disabled="true"/>
  47. </text>
  48. </view> -->
  49. </view>
  50. <u-divider text="费项明细"></u-divider>
  51. <view>总费用:{{fee.totalFee}}<span style="color: coral;margin-left: 5px;font-size: 16px;">元</span></view>
  52. <view class="box">
  53. <u-collapse v-for="(item,index) in fee.feeList" :key="index">
  54. <u-collapse-item :title="item.name" class="cell_title" >
  55. <view class="itm">1、名称:{{ item.name }}</view>
  56. <view class="itm" v-if="item.feeType ==1">2、收费类型:按交易额收取</view>
  57. <view class="itm" v-if="item.feeType ==2">2、收费类型:按次收取</view>
  58. <view class="itm" v-if="item.feeType ==3">2、收费类型:按吨收取</view>
  59. <view class="itm" v-if="item.feeType ==1">3、收费%(按交易额收):<span style="color: coral;">{{ item.percent }} %</span></view>
  60. <view class="itm" v-if="item.feeType ==2">3、收费金额(按次收):<span style="color: coral;">{{ item.feeMoney }} 元</span></view>
  61. <view class="itm" v-if="item.feeType ==3">3、收费%(按吨收):<span style="color: coral;">{{ item.percent }} %</span></view>
  62. <view class="itm">4、当前订单收取金额:<span style="color: coral;">{{ item.feeMoney }} 元</span></view>
  63. </u-collapse-item>
  64. </u-collapse>
  65. </view>
  66. </view>
  67. <view class="mfooter" v-if="item.upStatus != 2">
  68. <view class="flex">
  69. <view class="f">
  70. <button class="btn" @click="ok()">上架</button>
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. </template>
  76. <script>
  77. export default {
  78. data() {
  79. return {
  80. item: {},
  81. resalePrice: '',
  82. weight: '',
  83. price: '',
  84. newRuleList: [],
  85. fee:{
  86. totalFee:0,
  87. feeList:[]
  88. }
  89. };
  90. },
  91. onLoad(e) {
  92. if (e.item) {
  93. this.item = JSON.parse(e.item);
  94. this.price = this.item.totalPrice;
  95. this.weight = this.item.totalWeight;
  96. this.countPrice();
  97. }
  98. },
  99. methods: {
  100. fetchItemList(){
  101. this.http.request({
  102. url: '/level-two-server/app/TbOrders/fetchItemList',
  103. data: {id: this.item.id},
  104. success: res => {
  105. this.resalePrice = (res.data.data.sumPrice + 50).toFixed(2)
  106. this.newRuleList = res.data.data.newRuleList
  107. }
  108. });
  109. },
  110. //费项合计
  111. countPrice(){
  112. this.http.request({
  113. url: '/level-two-server/app/TbOrders/countPrice',
  114. data: {id: this.item.id},
  115. success: res => {
  116. // this.resalePrice = (res.data.data.sumPrice + 50).toFixed(2)
  117. // this.newRuleList = res.data.data.newRuleList
  118. this.fee=res.data.data;
  119. }
  120. });
  121. },
  122. ok() {
  123. let resalePrice=this.resalePrice;
  124. if(!resalePrice){
  125. uni.showToast({title: '请填写上架金额',icon:'error'});
  126. return;
  127. }
  128. if(resalePrice<this.item.totalPrice){
  129. uni.showToast({title: '上架金额不能小于订单金额',icon:'error'});
  130. return;
  131. }
  132. uni.showModal({
  133. title: '提示',
  134. content: '确定上架?',
  135. success: res => {
  136. if (res.confirm) {
  137. this.http.request({
  138. url: '/level-one-server/app/TbOrder/up',
  139. data: {id: this.item.id, upPrice: this.resalePrice},
  140. success: res => {
  141. uni.showToast({title: '提交成功'});
  142. uni.navigateBack();
  143. }
  144. });
  145. }
  146. }
  147. });
  148. }
  149. }
  150. };
  151. </script>
  152. <style lang="scss">
  153. page {
  154. background-color: $pg;
  155. }
  156. .item {
  157. input{
  158. margin-top: 0px!important;
  159. }
  160. }
  161. </style>