orderCenter.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. <template>
  2. <view class="order_center_wrap">
  3. <view class="queryParams_wrap">
  4. <view class="search">
  5. <u--input clearable prefixIcon="search" v-model="queryParams.phone" shape="circle" clearable
  6. @blur="handleKeyword" @clear="handleKeywordClear" placeholder="请输入电话"></u--input>
  7. </view>
  8. <view class="query">
  9. <view style="margin-right: 10rpx;" @click="handleshowFilter">筛选</view>
  10. <u-icon name="arrow-down-fill" color="#aaa" size="10"></u-icon>
  11. </view>
  12. </view>
  13. <view class="order_item_wrap">
  14. <view class="order_item" v-for="item in listData" :key="item.id" @click="handleToDetail(item)">
  15. <view class="order_top">
  16. <view class="top_left">{{item.item}}</view>
  17. <view class="top_right">
  18. <text :class="getStatusClass(item.status)">{{getStatusText(item.status)}}</text>
  19. </view>
  20. </view>
  21. <view class="order_info">
  22. <view class="telPhone">
  23. <view class="phone">
  24. <text>电话: </text>
  25. <show-real-text :real="item.phone" :type='type'
  26. :style="{ color : item.repetitionOperationName ? 'red' : 'black' }"></show-real-text>
  27. </view>
  28. <view class="copy_btn" @click.stop="handleCopy(item)" v-if="type != '1'">复制</view>
  29. </view>
  30. <view class="info">
  31. <view class="createUser" style="margin-right: 20px;">发单人:
  32. {{ item.createNickName ? item.createNickName : "-" }}
  33. </view>
  34. <view class="orgName">机构: {{ item.orgName ? item.orgName : "-" }}</view>
  35. </view>
  36. <view class="info">
  37. <view class="sendDate" style="margin-right: 20px;">发单日期:
  38. {{ item.sendDate ? item.sendDate : "-" }}
  39. </view>
  40. </view>
  41. <view class="info">
  42. <view class="owner">所属人 {{ item.clueOwnerName ? item.clueOwnerName : "-" }}</view>
  43. <view class="operation" style="margin-right: 20px;">运营人
  44. {{ item.clueOperationName ? item.clueOperationName : "-" }}
  45. </view>
  46. </view>
  47. </view>
  48. <view class="clue_state_wrap">
  49. <view class="clue_state">
  50. <view class="state_wrap">
  51. <view class="label">阶段:</view>{{crm_form_state(item.state)}}
  52. </view>
  53. <view class="clueTag">
  54. <view class="label">标签:</view>
  55. <u-tag :text="tag.name" plain plainFill borderColor="#fff" size="mini"
  56. v-for="(tag) in item.tags" :key="tag.id" style="margin-right: 10px;"
  57. :bgColor="tag.color" color="#fff"></u-tag>
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. <!-- 加载更多 -->
  64. <u-loadmore :status="loadStatus" v-if="listData.length > 0" />
  65. <!-- 空状态 -->
  66. <show-emtry v-if="listData.length === 0"></show-emtry>
  67. <filter-query ref="filter" v-model="queryParams" @getList="resetData" :mapHeight="mapHeight"
  68. :dicts="dicts"></filter-query>
  69. </view>
  70. </template>
  71. <script>
  72. import pullUpRefresh from "@/utils/pullUpRefresh";
  73. import {
  74. selectDictLabel
  75. } from "@/utils/util";
  76. import filterQuery from "./filterQuery.vue";
  77. export default {
  78. mixins: [pullUpRefresh],
  79. props: {
  80. type: {
  81. type: String,
  82. default: '2'
  83. },
  84. dicts: {
  85. type: Object,
  86. required: true
  87. }
  88. },
  89. components: {
  90. filterQuery,
  91. },
  92. data() {
  93. return {
  94. // 可以添加特定于接单中心的参数
  95. queryParams: {
  96. sendDateStart: '',
  97. sendDateEnd: '',
  98. type: '2',
  99. item: undefined,
  100. phone: undefined,
  101. deptId: undefined,
  102. state: undefined,
  103. status: undefined,
  104. allTagList: [],
  105. identification: undefined,
  106. createBy: undefined,
  107. pageNum: 1,
  108. pageSize: 10,
  109. },
  110. mapHeight: "0px"
  111. }
  112. },
  113. methods: {
  114. handleKeyword() {
  115. this.resetData();
  116. },
  117. handleKeywordClear() {
  118. // 组件有bug 清空后的值还是存在
  119. this.queryParams.phone = "";
  120. this.resetData();
  121. },
  122. handleshowFilter() {
  123. this.$refs.filter.show();
  124. },
  125. // 字典翻译
  126. crm_form_state(state) {
  127. return selectDictLabel(this.dicts.crmFormStateDict, state);
  128. },
  129. getStatusText(status) {
  130. const statusMap = {
  131. '1': '发单',
  132. '2': '接单',
  133. '3': '收单',
  134. '4': '未收'
  135. };
  136. return statusMap[status] || status;
  137. },
  138. getStatusClass(status) {
  139. const classMap = {
  140. '1': 'status_pending',
  141. '2': 'status_received',
  142. '3': 'status_confirmed',
  143. '4': 'status_rejected'
  144. };
  145. return classMap[status] || 'status_default';
  146. },
  147. handleCopy(item) {
  148. uni.setClipboardData({
  149. data: item.phone,
  150. success: function() {
  151. uni.$u.toast("复制成功");
  152. }
  153. });
  154. },
  155. handleToDetail(item) {
  156. // 跳转到详情页面
  157. uni.navigateTo({
  158. url: `/pages/orderDetail/index?id=${item.id}`
  159. });
  160. },
  161. async getList() {
  162. const {
  163. pageNum,
  164. pageSize,
  165. } = this.queryParams;
  166. this.queryParams.type = this.type;
  167. // 调用接单中心的接口
  168. const {
  169. rows,
  170. total
  171. } = await uni.$u.api.selectClueOrderFormList({
  172. pageSize,
  173. pageNum
  174. },
  175. this.queryParams
  176. );
  177. return rows;
  178. },
  179. handleOnReachBottom() {
  180. this.handleReachBottom();
  181. }
  182. },
  183. mounted() {
  184. this.resetData();
  185. // 根据路由名称设置类型
  186. this.queryParams.type = this.type;
  187. uni.getSystemInfo({
  188. success: (e) => {
  189. const {
  190. windowTop,
  191. windowBottom,
  192. windowHeight
  193. } = e;
  194. this.mapHeight = windowHeight + 'px';
  195. }
  196. });
  197. },
  198. }
  199. </script>
  200. <style lang="scss" scoped>
  201. .order_center_wrap {
  202. box-sizing: border-box;
  203. min-height: 100vh;
  204. .queryParams_wrap {
  205. display: flex;
  206. background: #fff;
  207. padding: 14px 0;
  208. .query,
  209. .search {
  210. display: flex;
  211. align-items: center;
  212. justify-content: center;
  213. font-size: 16px;
  214. font-weight: 700;
  215. color: #202020;
  216. }
  217. .query {
  218. flex: 1;
  219. }
  220. .search {
  221. flex: 2;
  222. padding-left: 20px;
  223. }
  224. }
  225. }
  226. .order_item_wrap {
  227. padding: 20px 20px;
  228. }
  229. .order_item {
  230. background: #fff;
  231. border-radius: 20px;
  232. padding: 20px;
  233. margin-bottom: 20px;
  234. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  235. .order_top {
  236. display: flex;
  237. justify-content: space-between;
  238. margin-bottom: 15px;
  239. .top_left {
  240. font-size: 18px;
  241. font-weight: bold;
  242. color: #202020;
  243. }
  244. .top_right {
  245. .status_pending {
  246. color: #e65d6f;
  247. }
  248. .status_received {
  249. color: #ff9900;
  250. }
  251. .status_confirmed {
  252. color: #67c23a;
  253. }
  254. .status_rejected {
  255. color: #909399;
  256. }
  257. }
  258. }
  259. .order_info {
  260. font-size: 14px;
  261. color: #666;
  262. .telPhone {
  263. display: flex;
  264. margin-bottom: 10px;
  265. .copy_btn {
  266. color: #4fa5fe;
  267. margin-left: 10px;
  268. }
  269. }
  270. .info {
  271. display: flex;
  272. margin-bottom: 8px;
  273. view {
  274. flex: 1;
  275. }
  276. }
  277. }
  278. }
  279. .empty_wrap {
  280. margin-top: 100px;
  281. }
  282. .clue_state_wrap {
  283. font-size: 14px;
  284. background: #f8f9fb;
  285. padding: 10px;
  286. color: #9b9aa2;
  287. overflow: hidden;
  288. .state_wrap {
  289. display: flex;
  290. margin-bottom: 10px;
  291. }
  292. .label {
  293. flex: 0 0 40px !important;
  294. }
  295. .clueTag {
  296. display: flex;
  297. }
  298. }
  299. </style>