OrderInfo.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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.expectMoney }}</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 }}(单号:{{ detail.waybillCode }})</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 v-model:show="showModal" title="编辑内部备注" :showCancelButton="true" @confirm="confirmRemark">
  51. <view class="modal-content w100">
  52. <u-textarea v-model="internalRemark" placeholder="编辑内部备注" autoHeight
  53. style="min-height: 100px;"></u-textarea>
  54. <view class="mt-20 common-title">快速填入</view>
  55. <view class="quick-fill mt-16">
  56. <u-tag class="mr-10 mb-10" @click="fillRemark('少书给客服')" text="少书给客服"></u-tag>
  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. </view>
  62. </view>
  63. </u-modal>
  64. </template>
  65. <script setup>
  66. import { defineProps, computed, ref, watch } from 'vue';
  67. const props = defineProps({
  68. orderId: String,
  69. estimatedAmount: Number,
  70. userNote: String,
  71. detail: Object,
  72. // Add more props as needed
  73. });
  74. let finalExpressList = { '1': '顺丰快递', '2': '京东快递', '3': '德邦快递' }
  75. let finalExpressText = computed(() => {
  76. return props.detail.finalExpress ? finalExpressList[props.detail.finalExpress] : ''
  77. });
  78. const statusEnum = {
  79. 0: '创建',
  80. 1: '用户删除',
  81. 2: '下单(待初审)',
  82. 3: '初审(待取书)',
  83. 4: '初审未通过',
  84. 5: '快递取书(待签收)',
  85. 6: '快递签收(待收货)',
  86. 7: '物流签收(路由异常)',
  87. 8: '仓库收货(待审核)',
  88. 9: '审核中(审核未提交)',
  89. 10: '已审核(待付款)',
  90. 11: '已完成'
  91. };
  92. let statusText = computed(() => {
  93. return statusEnum[props.detail.status] || '未知状态';
  94. });
  95. const maskedSendMobile = computed(() => {
  96. if (props.detail.sendMobile && props.detail.sendMobile.length === 11) {
  97. return props.detail.sendMobile.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
  98. }
  99. return props.detail.sendMobile;
  100. });
  101. function copyToClipboard(text) {
  102. uni.setClipboardData({
  103. data: text,
  104. success: function () {
  105. uni.showToast({
  106. title: '复制成功',
  107. icon: 'success'
  108. });
  109. },
  110. fail: function (err) {
  111. console.error('Could not copy text: ', err);
  112. }
  113. });
  114. }
  115. const showModal = ref(false);
  116. const internalRemark = ref('');
  117. function fillRemark(text) {
  118. internalRemark.value = text;
  119. }
  120. const remarkInfo = ref({});
  121. function handleRemark() {
  122. showModal.value = true;
  123. remarkInfo.value = props.detail.manageRemark?.[0] || {};
  124. internalRemark.value = remarkInfo.value.remark || '';
  125. }
  126. function confirmRemark() {
  127. // Logic to save the remark
  128. uni.$u.http.post('/app/orderinfo/setManageRemark', {
  129. orderId: props.detail.orderId,
  130. remark: internalRemark.value,
  131. id: remarkInfo.value.id
  132. }).then(res => {
  133. if (res.code == 200) {
  134. uni.$u.toast('保存成功')
  135. uni.$u.ttsModule.speak('保存成功')
  136. showModal.value = false;
  137. } else {
  138. uni.$u.toast(res.msg)
  139. }
  140. })
  141. }
  142. </script>
  143. <style lang="scss" scoped>
  144. .order-info {
  145. .info-item {
  146. display: flex;
  147. align-items: center;
  148. line-height: 42rpx;
  149. border-bottom: 1rpx solid #e5e5e5;
  150. font-size: 28rpx;
  151. }
  152. .label {
  153. width: 120px;
  154. text-align: center;
  155. padding: 20rpx 0;
  156. height: 100%;
  157. }
  158. .content {
  159. text-align: center;
  160. padding: 20rpx 20rpx;
  161. flex: 1;
  162. border-left: 1rpx solid #e5e5e5;
  163. min-height: 42px;
  164. box-sizing: border-box;
  165. }
  166. .border-left {
  167. border-left: 1rpx solid #e5e5e5;
  168. }
  169. .quick-fill {
  170. display: flex;
  171. flex-wrap: wrap;
  172. gap: 20rpx;
  173. .u-tag {
  174. margin: 0 10rpx 10rpx 0;
  175. }
  176. }
  177. }
  178. </style>