detail.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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.goodsName }}</text>
  8. </view>
  9. <view class="item">
  10. <text class="label">商品编号</text>
  11. <text class="desc">{{ item.goodsNo }}</text>
  12. </view>
  13. <view class="item">
  14. <text class="label">计价单位</text>
  15. <text class="desc">{{ item.goodsUnit }}</text>
  16. </view>
  17. <view class="item">
  18. <text class="label">数量</text>
  19. <text class="desc">{{ item.goodsQuantity }}</text>
  20. </view>
  21. <view class="item">
  22. <text class="label">到货日期</text>
  23. <text class="desc">{{ item.arrivalTime }}</text>
  24. </view>
  25. <view class="item">
  26. <text class="label">创建时间</text>
  27. <text class="desc">{{ item.goodsDemandTime }}</text>
  28. </view>
  29. <view class="item">
  30. <text class="label">状态</text>
  31. <text class="desc" v-if="item.isRelease == 0">未发布</text>
  32. <text class="desc" v-if="item.isRelease == 1 && item.isOrders == 0">未接单</text>
  33. <text class="desc" v-if="item.isOrders == 1 && item.isConfirm == 0">已接单</text>
  34. <text class="desc" v-if="item.isConfirm == 1">已确认</text>
  35. </view>
  36. <view class="item" v-if="item.createName">
  37. <text class="label">接单人</text>
  38. <text class="desc">{{ item.createName }}</text>
  39. </view>
  40. <view class="item" v-if="item.quotation">
  41. <text class="label">出价金额</text>
  42. <text class="desc" style="color: #f44336; font-weight: bold">¥ {{ item.quotation }}</text>
  43. </view>
  44. <view class="item" v-if="item.createTime">
  45. <text class="label">接单时间</text>
  46. <text class="desc">{{ item.createTime }}</text>
  47. </view>
  48. </view>
  49. <u-divider text="收货地址"></u-divider>
  50. <view class="box order_detail">
  51. <view class="item">
  52. <text class="label">收件人</text>
  53. <text class="desc omit">{{ item.name }}</text>
  54. </view>
  55. <view class="item">
  56. <text class="label">联系电话</text>
  57. <text class="desc">{{ item.phone }}</text>
  58. </view>
  59. <view class="item">
  60. <text class="label">收件地址</text>
  61. <text class="desc">{{ item.addressName }}</text>
  62. </view>
  63. </view>
  64. <button class="btn" @click.stop="confirm()" v-if="item.isRelease == 1 && item.isOrders == 1 && item.isConfirm == 0">同意接单并支付</button>
  65. <button class="btn" @click.stop="refuse(item.goodsDemandId)" style="background-color: #f44336" v-if="item.isRelease == 1 && item.isOrders == 1 && item.isConfirm == 0">拒绝接单</button>
  66. </view>
  67. </view>
  68. </template>
  69. <script>
  70. export default {
  71. data() {
  72. return {
  73. item: {}
  74. };
  75. },
  76. onLoad(e) {
  77. if (e.id) {
  78. this.http.request({
  79. url: '/level-two-server/app/TbGoodsDemand/goodsDemandDetail?id=' + e.id,
  80. success: res => {
  81. this.item = res.data.data;
  82. }
  83. });
  84. }
  85. },
  86. methods: {
  87. confirm() {
  88. this.http.request({
  89. url: '/level-two-server/app/TbOrders/add',
  90. data: this.item,
  91. success: res => {
  92. uni.showToast({ title: '操作成功' });
  93. // 收购商已确认
  94. this.item.isConfirm = 1;
  95. uni.$emit('purchaser_buy_list');
  96. }
  97. });
  98. },
  99. refuse(goodsDemandId) {
  100. this.http.request({
  101. url: '/level-two-server/app/TbGoodsDemand/refuse',
  102. data: {id: goodsDemandId},
  103. success: res => {
  104. uni.showToast({ title: '操作成功' });
  105. }
  106. });
  107. }
  108. }
  109. };
  110. </script>
  111. <style lang="scss">
  112. page {
  113. background-color: $pg;
  114. }
  115. .btn {
  116. margin-top: 20px;
  117. width: 70%;
  118. }
  119. </style>