ExceptionItem.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <template>
  2. <view class="exception-item">
  3. <!-- 订单信息 -->
  4. <view class="info-section flex-1">
  5. <view class="info-row">
  6. <text class="label">订单编号:</text>
  7. <text class="value">{{ order.orderId }}</text>
  8. </view>
  9. <view class="info-row">
  10. <text class="label">快递单号:</text>
  11. <text class="value">{{ order.waybillCode }}</text>
  12. </view>
  13. <view class="info-row">
  14. <text class="label">预估单价:</text>
  15. <text class="value">{{ order.expectMoney }}元</text>
  16. </view>
  17. <view class="info-row">
  18. <text class="label">推送人:</text>
  19. <text class="value">{{ order.createName }}</text>
  20. </view>
  21. <view class="info-row" style="margin-bottom: 0;">
  22. <text class="label">推送时间:</text>
  23. <text class="value">{{ order.createTime }}</text>
  24. </view>
  25. </view>
  26. <!-- 操作按钮 -->
  27. <view class="action-section">
  28. <u-button type="primary" text="查看物流" size="small" @click="handleCheckLogistics" />
  29. <approve-button v-if="order.checkStatus == 1" @approve="handleButtonClick(2)" />
  30. <reject-button v-if="order.checkStatus == 1" @reject="(reason) => handleButtonClick(3, reason)" />
  31. <view v-if="order.checkStatus == 2" style="color: #19be6b;">[已签收]</view>
  32. <view v-if="order.checkStatus == 3" style="color: #f00;">[已驳回]</view>
  33. </view>
  34. </view>
  35. </template>
  36. <script setup>
  37. import {
  38. ref
  39. } from 'vue';
  40. import ApproveButton from './ApproveButton.vue';
  41. import RejectButton from './RejectButton.vue';
  42. const props = defineProps({
  43. order: {
  44. type: Object,
  45. default: () => ({
  46. orderNo: '',
  47. expressNo: '',
  48. estimatedPrice: '',
  49. pusher: '',
  50. pushTime: ''
  51. })
  52. }
  53. });
  54. const emit = defineEmits(['refresh']);
  55. // 查看物流
  56. const handleCheckLogistics = () => {
  57. uni.navigateTo({
  58. url: `/pages/index/express/logistics-detail?orderId=${props.order.orderId}&status=${props.order.checkStatus}&id=${props.order.id}`
  59. });
  60. };
  61. // 操作按钮
  62. function handleButtonClick(checkStatus, reason) {
  63. uni.$u.http.post('/app/orderexception/update', {
  64. id: props.order.id,
  65. checkStatus: checkStatus,
  66. refusalReason: reason
  67. }).then(res => {
  68. if (res.code == 200) {
  69. if (checkStatus == 2) {
  70. let text = props.order.waybillCode + '签收成功'
  71. uni.$u.ttsModule.speak(text)
  72. }
  73. uni.$u.toast('操作成功');
  74. emit('refresh');
  75. } else {
  76. uni.$u.toast(res.msg);
  77. }
  78. })
  79. }
  80. </script>
  81. <style lang="scss" scoped>
  82. .exception-item {
  83. background-color: #fff;
  84. border-radius: 8px;
  85. padding: 24rpx;
  86. margin-bottom: 12px;
  87. display: flex;
  88. justify-content: space-between;
  89. }
  90. .info-row {
  91. display: flex;
  92. margin-bottom: 8px;
  93. font-size: 30rpx;
  94. .label {
  95. color: #666;
  96. width: 140rpx;
  97. }
  98. .value{
  99. color: #333;
  100. flex: 1;
  101. }
  102. }
  103. .action-section {
  104. display: flex;
  105. flex-direction: column;
  106. gap: 12px;
  107. :deep(.u-button) {
  108. min-width: 80px;
  109. }
  110. }
  111. </style>