detail.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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()" 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. uni.showModal({
  89. title: '提示',
  90. content: '确定同意接单并支付?',
  91. success: res => {
  92. if (res.confirm) {
  93. this.http.request({
  94. url: '/level-two-server/app/TbOrders/add',
  95. data: this.item,
  96. success: res => {
  97. console.log('asd:');
  98. uni.showModal({
  99. title: '提示',
  100. content: '处理成功,等待组长发货',
  101. showCancel: false,
  102. success: res => {
  103. uni.navigateBack();
  104. uni.$emit('purchaser_buy_list');
  105. }
  106. });
  107. }
  108. });
  109. }
  110. }
  111. });
  112. },
  113. refuse() {
  114. uni.showModal({
  115. title: '提示',
  116. content: '确定取消该接单?',
  117. success: res => {
  118. if (res.confirm) {
  119. this.http.request({
  120. url: '/level-two-server/app/TbGoodsDemand/refuse',
  121. data: { id: this.item.goodsDemandId, goodsName: this.item.goodsName },
  122. success: res => {
  123. uni.showModal({
  124. title: '提示',
  125. content: '取消成功',
  126. showCancel: false,
  127. success: res => {
  128. uni.navigateBack();
  129. uni.$emit('purchaser_buy_list');
  130. }
  131. });
  132. }
  133. });
  134. }
  135. }
  136. });
  137. }
  138. }
  139. };
  140. </script>
  141. <style lang="scss">
  142. page {
  143. background-color: $pg;
  144. }
  145. .btn {
  146. margin-top: 20px;
  147. width: 70%;
  148. }
  149. </style>