OrderInfo.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <template>
  2. <view class="order-info bg-white">
  3. <view class="info-item flex">
  4. <text class="label">订单编号</text>
  5. <text style="color:#22ac38" class="flex-1 text-center content" @click="copyToClipboard(detail.orderId)">{{
  6. detail.orderId }}</text>
  7. </view>
  8. <view class="info-item">
  9. <text class="label">预估金额</text>
  10. <text class="content">{{ detail.expectMoney }}</text>
  11. <text class="label border-left">审核金额</text>
  12. <text class="content">{{ detail.finalMoney }}</text>
  13. </view>
  14. <view class="info-item">
  15. <text class="label">用户备注</text>
  16. <text class="content">{{ detail.userRemark}}</text>
  17. </view>
  18. <view class="info-item" @click="handleRemark">
  19. <text class="label">内部备注</text>
  20. <text class="content">{{ detail?.manageRemark ? detail?.manageRemark.length > 0 ?
  21. detail?.manageRemark[0]?.remark: ' ' : ' ' }}</text>
  22. </view>
  23. <view class="info-item">
  24. <text class="label">订单状态</text>
  25. <text class="content" style="color: #c5493e;">[{{ statusText }}]</text>
  26. </view>
  27. <view class="info-item">
  28. <text class="label">快递</text>
  29. <text class="content">{{ finalExpressText }}<text style="color: #409eef;" @click="copyToClipboard(detail.waybillCode)">(单号:{{ detail.waybillCode }})</text></text>
  30. </view>
  31. <view class="info-item">
  32. <text class="label">发件人<text style="color: #e99d42;">(所有单)</text></text>
  33. <view class="content flex flex-a-c flex-j-c">
  34. <text class="content-text" @click="copyToClipboard(detail.sendMobile)">复制</text>
  35. <text class="content-text ml-10 mr-10">{{ maskedSendMobile }}</text>
  36. <u-icon v-if="detail.orderFrom == 1" name="weixin-circle-fill" size="18" color="#22ac38"></u-icon>
  37. <u-icon v-if="detail.orderFrom == 2" name="zhifubao-circle-fill" size="18" color="#999"></u-icon>
  38. </view>
  39. </view>
  40. <view class="info-item">
  41. <text class="label">发货地址</text>
  42. <text class="content">{{ detail.sendAddress }}</text>
  43. </view>
  44. <view class="info-item">
  45. <text class="label">收货仓库</text>
  46. <text class="content">{{ detail.recipientAddress }}-{{ detail.recipientGodown }}-{{ detail.recipientName
  47. }}</text>
  48. </view>
  49. </view>
  50. <u-modal :show="showModal" title="编辑内部备注" :showCancelButton="true" @confirm="confirmRemark"
  51. @cancel="showModal = false">
  52. <view class="modal-content w100">
  53. <u-textarea v-model="internalRemark" placeholder="编辑内部备注" autoHeight
  54. style="min-height: 100px;"></u-textarea>
  55. <view class="mt-20 common-title">快速填入</view>
  56. <view class="quick-fill mt-16">
  57. <u-tag class="mr-10 mb-10" @click="fillRemark('少书给客服')" text="少书给客服"></u-tag>
  58. <u-tag class="mr-10 mb-10" @click="fillRemark('多书给客服')" text="多书给客服"></u-tag>
  59. <u-tag class="mr-10 mb-10" @click="fillRemark('子母件')" text="子母件"></u-tag>
  60. <u-tag class="mr-10 mb-10" @click="fillRemark('书单不符给客服')" text="书单不符给客服"></u-tag>
  61. <u-tag class="mr-10 mb-10" @click="fillRemark('需理赔给客服')" text="需理赔给客服"></u-tag>
  62. </view>
  63. </view>
  64. </u-modal>
  65. </template>
  66. <script setup>
  67. import { defineProps, computed, ref, watch } from 'vue';
  68. const props = defineProps({
  69. orderId: String,
  70. estimatedAmount: Number,
  71. userNote: String,
  72. detail: Object,
  73. // Add more props as needed
  74. });
  75. let finalExpressList = { '1': '顺丰快递', '2': '京东快递', '3': '德邦快递' }
  76. let finalExpressText = computed(() => {
  77. return props.detail.finalExpress ? finalExpressList[props.detail.finalExpress] : ''
  78. });
  79. const statusEnum = {
  80. 0: '创建',
  81. 1: '用户删除',
  82. 2: '下单(待初审)',
  83. 3: '初审(待取书)',
  84. 4: '初审未通过',
  85. 5: '快递取书(待签收)',
  86. 6: '快递签收(待收货)',
  87. 7: '物流签收(路由异常)',
  88. 8: '仓库收货(待审核)',
  89. 9: '审核中(审核未提交)',
  90. 10: '已审核(待付款)',
  91. 11: '已完成'
  92. };
  93. let statusText = computed(() => {
  94. return statusEnum[props.detail.status] || '未知状态';
  95. });
  96. const maskedSendMobile = computed(() => {
  97. if (props.detail.sendMobile && props.detail.sendMobile.length === 11) {
  98. return props.detail.sendMobile.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
  99. }
  100. return props.detail.sendMobile;
  101. });
  102. function copyToClipboard(text) {
  103. uni.setClipboardData({
  104. data: text,
  105. success: function () {
  106. uni.showToast({
  107. title: '复制成功',
  108. icon: 'success'
  109. });
  110. },
  111. fail: function (err) {
  112. console.error('Could not copy text: ', err);
  113. }
  114. });
  115. }
  116. const showModal = ref(false);
  117. const internalRemark = ref('');
  118. function fillRemark(text) {
  119. internalRemark.value = text;
  120. }
  121. const remarkInfo = ref({});
  122. function handleRemark() {
  123. showModal.value = true;
  124. remarkInfo.value = props.detail.manageRemark?.[0] || {};
  125. internalRemark.value = remarkInfo.value.remark || '';
  126. }
  127. const emit = defineEmits(['refresh']);
  128. function confirmRemark() {
  129. // Logic to save the remark
  130. uni.$u.http.post('/app/orderinfo/setManageRemark', {
  131. orderId: props.detail.orderId,
  132. remark: internalRemark.value,
  133. id: remarkInfo.value.id
  134. }).then(res => {
  135. if (res.code == 200) {
  136. uni.$u.toast('保存成功')
  137. uni.$u.ttsModule.speak('保存成功')
  138. showModal.value = false;
  139. emit('refresh')
  140. } else {
  141. uni.$u.toast(res.msg)
  142. }
  143. })
  144. }
  145. </script>
  146. <style lang="scss" scoped>
  147. .order-info {
  148. .info-item {
  149. display: flex;
  150. align-items: center;
  151. line-height: 42rpx;
  152. border-bottom: 1rpx solid #e5e5e5;
  153. font-size: 28rpx;
  154. }
  155. .label {
  156. width: 120px;
  157. text-align: center;
  158. padding: 20rpx 0;
  159. height: 100%;
  160. }
  161. .content {
  162. text-align: center;
  163. padding: 20rpx 20rpx;
  164. flex: 1;
  165. border-left: 1rpx solid #e5e5e5;
  166. min-height: 42px;
  167. box-sizing: border-box;
  168. }
  169. .border-left {
  170. border-left: 1rpx solid #e5e5e5;
  171. }
  172. .quick-fill {
  173. display: flex;
  174. flex-wrap: wrap;
  175. gap: 20rpx;
  176. .u-tag {
  177. margin: 0 10rpx 10rpx 0;
  178. }
  179. }
  180. }
  181. </style>