orderCenter.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  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. handleToDetail(row) {
  115. const {
  116. id,
  117. item
  118. } = row;
  119. uni.navigateTo({
  120. url: `/pages/orderDetail/index?orderId=${id}&item=${item}&type=${this.queryParams.type}`,
  121. });
  122. },
  123. handleKeyword() {
  124. this.resetData();
  125. },
  126. handleKeywordClear() {
  127. // 组件有bug 清空后的值还是存在
  128. this.queryParams.phone = "";
  129. this.resetData();
  130. },
  131. handleshowFilter() {
  132. this.$refs.filter.show();
  133. },
  134. // 字典翻译
  135. crm_form_state(state) {
  136. return selectDictLabel(this.dicts.crmFormStateDict, state);
  137. },
  138. getStatusText(status) {
  139. const statusMap = {
  140. '1': '发单',
  141. '2': '接单',
  142. '3': '收单',
  143. '4': '未收'
  144. };
  145. return statusMap[status] || status;
  146. },
  147. getStatusClass(status) {
  148. const classMap = {
  149. '1': 'status_pending',
  150. '2': 'status_received',
  151. '3': 'status_confirmed',
  152. '4': 'status_rejected'
  153. };
  154. return classMap[status] || 'status_default';
  155. },
  156. handleCopy(item) {
  157. uni.setClipboardData({
  158. data: item.phone,
  159. success: function() {
  160. uni.$u.toast("复制成功");
  161. }
  162. });
  163. },
  164. async getList() {
  165. const {
  166. pageNum,
  167. pageSize,
  168. } = this.queryParams;
  169. this.queryParams.type = this.type;
  170. // 调用接单中心的接口
  171. const {
  172. rows,
  173. total
  174. } = await uni.$u.api.selectClueOrderFormList({
  175. pageSize,
  176. pageNum
  177. },
  178. this.queryParams
  179. );
  180. return rows;
  181. },
  182. handleOnReachBottom() {
  183. this.handleReachBottom();
  184. }
  185. },
  186. mounted() {
  187. this.resetData();
  188. // 根据路由名称设置类型
  189. this.queryParams.type = this.type;
  190. uni.getSystemInfo({
  191. success: (e) => {
  192. const {
  193. windowTop,
  194. windowBottom,
  195. windowHeight
  196. } = e;
  197. this.mapHeight = windowHeight + 'px';
  198. }
  199. });
  200. },
  201. }
  202. </script>
  203. <style lang="scss" scoped>
  204. .order_center_wrap {
  205. box-sizing: border-box;
  206. min-height: 100vh;
  207. .queryParams_wrap {
  208. display: flex;
  209. background: #fff;
  210. padding: 14px 0;
  211. .query,
  212. .search {
  213. display: flex;
  214. align-items: center;
  215. justify-content: center;
  216. font-size: 16px;
  217. font-weight: 700;
  218. color: #202020;
  219. }
  220. .query {
  221. flex: 1;
  222. }
  223. .search {
  224. flex: 2;
  225. padding-left: 20px;
  226. }
  227. }
  228. }
  229. .order_item_wrap {
  230. padding: 20px 20px;
  231. }
  232. .order_item {
  233. background: #fff;
  234. border-radius: 20px;
  235. padding: 20px;
  236. margin-bottom: 20px;
  237. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  238. .order_top {
  239. display: flex;
  240. justify-content: space-between;
  241. margin-bottom: 15px;
  242. .top_left {
  243. font-size: 18px;
  244. font-weight: bold;
  245. color: #202020;
  246. }
  247. .top_right {
  248. .status_pending {
  249. color: #e65d6f;
  250. }
  251. .status_received {
  252. color: #ff9900;
  253. }
  254. .status_confirmed {
  255. color: #67c23a;
  256. }
  257. .status_rejected {
  258. color: #909399;
  259. }
  260. }
  261. }
  262. .order_info {
  263. font-size: 14px;
  264. color: #666;
  265. .telPhone {
  266. display: flex;
  267. margin-bottom: 10px;
  268. .copy_btn {
  269. color: #4fa5fe;
  270. margin-left: 10px;
  271. }
  272. }
  273. .info {
  274. display: flex;
  275. margin-bottom: 8px;
  276. view {
  277. flex: 1;
  278. }
  279. }
  280. }
  281. }
  282. .empty_wrap {
  283. margin-top: 100px;
  284. }
  285. .clue_state_wrap {
  286. font-size: 14px;
  287. background: #f8f9fb;
  288. padding: 10px;
  289. color: #9b9aa2;
  290. overflow: hidden;
  291. .state_wrap {
  292. display: flex;
  293. margin-bottom: 10px;
  294. }
  295. .label {
  296. flex: 0 0 40px !important;
  297. }
  298. .clueTag {
  299. display: flex;
  300. }
  301. }
  302. </style>