orderCenter.vue 7.0 KB

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