orderItem.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <view class="order_item" @click="handleToDetail">
  3. <view class="order_top">
  4. <view class="top_left">{{item.item}}</view>
  5. <view class="top_right">
  6. <text :class="getStatusClass(item.status)">{{getStatusText(item.status)}}</text>
  7. </view>
  8. </view>
  9. <view class="order_info">
  10. <view class="telPhone">
  11. <view class="phone">
  12. <text>电话: </text>
  13. <show-real-text :real="item.phone" :type='type'
  14. :style="{ color : item.repetitionOperationName ? 'red' : 'black' }"></show-real-text>
  15. </view>
  16. <view class="copy_btn" @click.stop="handleCopy" v-if="type != '1'">复制</view>
  17. </view>
  18. <view class="info">
  19. <view class="createUser" style="margin-right: 20px;">发单人:
  20. {{ item.createNickName ? item.createNickName : "-" }}
  21. </view>
  22. <view class="orgName">机构: {{ item.orgName ? item.orgName : "-" }}</view>
  23. </view>
  24. <view class="info">
  25. <view class="sendDate" style="margin-right: 20px;">发单日期:
  26. {{ item.sendDate ? item.sendDate : "-" }}
  27. </view>
  28. </view>
  29. <view class="info">
  30. <view class="owner">所属人 {{ item.clueOwnerName ? item.clueOwnerName : "-" }}</view>
  31. <view class="operation" style="margin-right: 20px;">运营人
  32. {{ item.clueOperationName ? item.clueOperationName : "-" }}
  33. </view>
  34. </view>
  35. </view>
  36. <view class="clue_state_wrap">
  37. <view class="clue_state">
  38. <view class="state_wrap">
  39. <view class="label">阶段:</view>{{crm_form_state(item.state)}}
  40. </view>
  41. <view class="clueTag">
  42. <view class="label">标签:</view>
  43. <u-tag :text="tag.name" plain plainFill borderColor="#fff" size="mini"
  44. v-for="(tag) in item.tags" :key="tag.id" style="margin-right: 10px;"
  45. :bgColor="tag.color" color="#fff"></u-tag>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. </template>
  51. <script>
  52. import { selectDictLabel } from "@/utils/util";
  53. export default {
  54. props: {
  55. item: {
  56. type: Object,
  57. required: true
  58. },
  59. type: {
  60. type: String,
  61. default: '2'
  62. },
  63. dicts: {
  64. type: Object,
  65. required: true
  66. }
  67. },
  68. methods: {
  69. handleToDetail() {
  70. const { id, item: itemType, clueId } = this.item;
  71. uni.navigateTo({
  72. url: `/pages/orderDetail/index?orderId=${id}&item=${itemType}&type=${this.type}&clueId=${clueId}`,
  73. });
  74. },
  75. // 字典翻译
  76. crm_form_state(state) {
  77. return selectDictLabel(this.dicts.crmFormStateDict, state);
  78. },
  79. getStatusText(status) {
  80. const statusMap = {
  81. '1': '发单',
  82. '2': '接单',
  83. '3': '收单',
  84. '4': '未收'
  85. };
  86. return statusMap[status] || status;
  87. },
  88. getStatusClass(status) {
  89. const classMap = {
  90. '1': 'status_pending',
  91. '2': 'status_received',
  92. '3': 'status_confirmed',
  93. '4': 'status_rejected'
  94. };
  95. return classMap[status] || 'status_default';
  96. },
  97. handleCopy() {
  98. uni.setClipboardData({
  99. data: this.item.phone,
  100. success: function() {
  101. uni.$u.toast("复制成功");
  102. }
  103. });
  104. }
  105. }
  106. }
  107. </script>
  108. <style lang="scss" scoped>
  109. .order_item {
  110. background: #fff;
  111. border-radius: 20px;
  112. padding: 20px;
  113. margin-bottom: 20px;
  114. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  115. .order_top {
  116. display: flex;
  117. justify-content: space-between;
  118. margin-bottom: 15px;
  119. .top_left {
  120. font-size: 18px;
  121. font-weight: bold;
  122. color: #202020;
  123. }
  124. .top_right {
  125. .status_pending {
  126. color: #e65d6f;
  127. }
  128. .status_received {
  129. color: #ff9900;
  130. }
  131. .status_confirmed {
  132. color: #67c23a;
  133. }
  134. .status_rejected {
  135. color: #909399;
  136. }
  137. }
  138. }
  139. .order_info {
  140. font-size: 14px;
  141. color: #666;
  142. .telPhone {
  143. display: flex;
  144. margin-bottom: 10px;
  145. .copy_btn {
  146. color: #4fa5fe;
  147. margin-left: 10px;
  148. }
  149. }
  150. .info {
  151. display: flex;
  152. margin-bottom: 8px;
  153. view {
  154. flex: 1;
  155. }
  156. }
  157. }
  158. .clue_state_wrap {
  159. font-size: 14px;
  160. background: #f8f9fb;
  161. padding: 10px;
  162. color: #9b9aa2;
  163. overflow: hidden;
  164. .state_wrap {
  165. display: flex;
  166. margin-bottom: 10px;
  167. }
  168. .label {
  169. flex: 0 0 40px !important;
  170. }
  171. .clueTag {
  172. display: flex;
  173. }
  174. }
  175. }
  176. </style>