ExceptionItem.vue 3.4 KB

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