ExceptionItem.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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-permission="'app:express:exception:approve'" v-if="order.checkStatus == 1" @approve="handleButtonClick(2)" />
  30. <reject-button v-permission="'app:express:exception:reject'" 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. }).catch(() => {
  79. uni.$u.toast('操作失败');
  80. })
  81. }
  82. </script>
  83. <style lang="scss" scoped>
  84. .exception-item {
  85. background-color: #fff;
  86. border-radius: 8px;
  87. padding: 24rpx;
  88. margin-bottom: 12px;
  89. display: flex;
  90. justify-content: space-between;
  91. }
  92. .info-row {
  93. display: flex;
  94. margin-bottom: 8px;
  95. font-size: 30rpx;
  96. .label {
  97. color: #666;
  98. width: 140rpx;
  99. }
  100. .value{
  101. color: #333;
  102. flex: 1;
  103. }
  104. }
  105. .action-section {
  106. display: flex;
  107. flex-direction: column;
  108. gap: 12px;
  109. :deep(.u-button) {
  110. min-width: 80px;
  111. }
  112. }
  113. </style>