orderCenter.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <template>
  2. <view class="order_center_wrap">
  3. <view class="order_item" v-for="item in listData" :key="item.id" @click="handleToDetail(item)">
  4. <view class="order_top">
  5. <view class="top_left">{{item.item}}</view>
  6. <view class="top_right">
  7. <text :class="getStatusClass(item.status)">{{getStatusText(item.status)}}</text>
  8. </view>
  9. </view>
  10. <view class="order_info">
  11. <view class="telPhone">
  12. <view class="phone">
  13. <text>电话: </text>
  14. <show-real-text :real="item.phone" :type='type'
  15. :style="{ color : item.repetitionOperationName ? 'red' : 'black' }"></show-real-text>
  16. </view>
  17. <view class="copy_btn" @click.stop="handleCopy(item)" v-if="type != '1'">复制</view>
  18. </view>
  19. <view class="info">
  20. <view class="createUser" style="margin-right: 20px;">发单人:
  21. {{ item.createNickName ? item.createNickName : "-" }}</view>
  22. <view class="orgName">机构: {{ item.orgName ? item.orgName : "-" }}</view>
  23. </view>
  24. <view class="info">
  25. <view class="sendDate" style="margin-right: 20px;">发单日期: {{ item.sendDate ? item.sendDate : "-" }}
  26. </view>
  27. </view>
  28. <view class="info">
  29. <view class="owner">所属人 {{ item.clueOwnerName ? item.clueOwnerName : "-" }}</view>
  30. <view class="operation" style="margin-right: 20px;">运营人
  31. {{ item.clueOperationName ? item.clueOperationName : "-" }}</view>
  32. </view>
  33. </view>
  34. <view class="clue_state_wrap">
  35. <view class="clue_state">
  36. <view class="state_wrap">
  37. <view class="label">阶段:</view>{{crm_form_state(item.state)}}
  38. </view>
  39. <view class="clueTag">
  40. <view class="label">标签:</view>
  41. <u-tag :text="tag.name" plain plainFill borderColor="#fff" size="mini"
  42. v-for="(tag) in item.tags" :key="tag.id" style="margin-right: 10px;"
  43. :bgColor="tag.color" color="#fff"></u-tag>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. <!-- 加载更多 -->
  49. <u-loadmore :status="loadStatus" v-if="listData.length > 0" />
  50. <!-- 空状态 -->
  51. <show-emtry v-if="listData.length === 0"></show-emtry>
  52. </view>
  53. </template>
  54. <script>
  55. import pullUpRefresh from "@/utils/pullUpRefresh";
  56. import { selectDictLabel } from "@/utils/util";
  57. export default {
  58. mixins: [pullUpRefresh],
  59. props: {
  60. type: {
  61. type: String,
  62. default: '2'
  63. },
  64. dicts: {
  65. type: Object,
  66. required: true
  67. }
  68. },
  69. data() {
  70. return {
  71. // 可以添加特定于接单中心的参数
  72. queryParams: {
  73. pageNum: 1,
  74. pageSize: 10,
  75. },
  76. }
  77. },
  78. methods: {
  79. // 字典翻译
  80. crm_form_state(state) {
  81. return selectDictLabel(this.dicts.crmFormStateDicts, state);
  82. },
  83. getStatusText(status) {
  84. const statusMap = {
  85. '1': '发单',
  86. '2': '接单',
  87. '3': '收单',
  88. '4': '未收'
  89. };
  90. return statusMap[status] || status;
  91. },
  92. getStatusClass(status) {
  93. const classMap = {
  94. '1': 'status_pending',
  95. '2': 'status_received',
  96. '3': 'status_confirmed',
  97. '4': 'status_rejected'
  98. };
  99. return classMap[status] || 'status_default';
  100. },
  101. handleCopy(item) {
  102. uni.setClipboardData({
  103. data: item.phone,
  104. success: function() {
  105. uni.$u.toast("复制成功");
  106. }
  107. });
  108. },
  109. handleToDetail(item) {
  110. // 跳转到详情页面
  111. uni.navigateTo({
  112. url: `/pages/orderDetail/index?id=${item.id}`
  113. });
  114. },
  115. async getList() {
  116. const {
  117. pageNum,
  118. pageSize,
  119. } = this.queryParams;
  120. this.queryParams.type = this.type;
  121. // 调用接单中心的接口
  122. const {
  123. rows,
  124. total
  125. } = await uni.$u.api.selectClueOrderFormList({
  126. pageSize,
  127. pageNum
  128. },
  129. this.queryParams
  130. );
  131. return rows;
  132. },
  133. handleOnReachBottom() {
  134. this.handleReachBottom();
  135. }
  136. },
  137. mounted() {
  138. this.resetData();
  139. }
  140. }
  141. </script>
  142. <style lang="scss" scoped>
  143. .order_center_wrap {
  144. padding: 20px;
  145. box-sizing: border-box;
  146. min-height: 100vh;
  147. }
  148. .order_item {
  149. background: #fff;
  150. border-radius: 20px;
  151. padding: 20px;
  152. margin-bottom: 20px;
  153. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  154. .order_top {
  155. display: flex;
  156. justify-content: space-between;
  157. margin-bottom: 15px;
  158. .top_left {
  159. font-size: 18px;
  160. font-weight: bold;
  161. color: #202020;
  162. }
  163. .top_right {
  164. .status_pending {
  165. color: #e65d6f;
  166. }
  167. .status_received {
  168. color: #ff9900;
  169. }
  170. .status_confirmed {
  171. color: #67c23a;
  172. }
  173. .status_rejected {
  174. color: #909399;
  175. }
  176. }
  177. }
  178. .order_info {
  179. font-size: 14px;
  180. color: #666;
  181. .telPhone {
  182. display: flex;
  183. margin-bottom: 10px;
  184. .copy_btn {
  185. color: #4fa5fe;
  186. margin-left: 10px;
  187. }
  188. }
  189. .info {
  190. display: flex;
  191. margin-bottom: 8px;
  192. view {
  193. flex: 1;
  194. }
  195. }
  196. }
  197. }
  198. .empty_wrap {
  199. margin-top: 100px;
  200. }
  201. .clue_state_wrap {
  202. font-size: 14px;
  203. background: #f8f9fb;
  204. padding: 10px;
  205. color: #9b9aa2;
  206. overflow: hidden;
  207. .state_wrap{
  208. display: flex;
  209. margin-bottom: 10px;
  210. }
  211. .label{
  212. flex: 0 0 40px !important;
  213. }
  214. .clueTag {
  215. display: flex;
  216. }
  217. }
  218. </style>