pagereceivecenter.vue 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163
  1. <script>
  2. import filterQuery from "../order/components/orderCenter/filterQuery.vue";
  3. import commissionFilterQuery from "../order/components/commission/filterQuery.vue";
  4. import dayjs from "dayjs";
  5. // status 状态 1 发单(刚发出来) 2 接单(处理中) 3 收单(入库了) 4 未收(没有收到)
  6. export default {
  7. components: {
  8. filterQuery,
  9. commissionFilterQuery,
  10. },
  11. data() {
  12. return {
  13. orderList: [],
  14. page: {
  15. pageSize: 10,
  16. pageNum: 1,
  17. total: 0
  18. },
  19. tagModalVisible: false,
  20. tagList: [],
  21. currentTags: [],
  22. currentOrder: {},
  23. followUpModelShow: false,
  24. followUpNotes: '',
  25. countdown: 300,
  26. countdownIntervals: null,
  27. //筛选条件
  28. filterList: [
  29. { name: '全部列表', type: 1 },
  30. { name: '我的接发单', type: 2 },
  31. { name: '我的分成', type: 3 }
  32. ],
  33. statisticsSendStatus: [],//中间统计数据
  34. activeType: 1,//当前选择的筛选类型,顶部tab的类型
  35. activeStatus: '',//当前选择的状态,统计数据的类型
  36. currentFollowUp: [],//当前订单的跟进记录
  37. showMoreFollowUp: false,
  38. // 查询参数
  39. queryParams: {
  40. sendDateStart: '',
  41. sendDateEnd: '',
  42. type: '1',
  43. item: undefined,
  44. phone: undefined,
  45. deptId: undefined,
  46. state: undefined,
  47. status: undefined,
  48. allTagList: [],
  49. identification: undefined,
  50. createBy: undefined,
  51. pageNum: 1,
  52. pageSize: 10,
  53. },
  54. // 字典数据
  55. dicts: {
  56. crmFormStatusDict: [],
  57. crmFormCategoryDict: [],
  58. crmFormStateDict: [],
  59. crmFormTacticDict: [],
  60. },
  61. mapHeight: "0px",
  62. // 我的分成的查询参数
  63. commissionQueryParams: {
  64. receiptDateEnd: dayjs().format("YYYY-MM-DD"),
  65. receiptDateStart: dayjs().startOf('month').format("YYYY-MM-DD"),
  66. item: undefined,
  67. phone: undefined,
  68. receiptUserId: undefined,
  69. pageNum: 1,
  70. pageSize: 10,
  71. },
  72. }
  73. },
  74. computed: {
  75. // 根据当前选择的类型返回对应的查询参数
  76. currentQueryParams() {
  77. return this.activeType === 3 ? this.commissionQueryParams : this.queryParams;
  78. },
  79. },
  80. onLoad() {
  81. // 初始化字典数据
  82. this.$getDicts('crm_form_status').then(res => {
  83. this.dicts.crmFormStatusDict = res;
  84. });
  85. this.$getDicts('crm_form_category').then(res => {
  86. this.dicts.crmFormCategoryDict = res;
  87. });
  88. this.$getDicts('crm_form_state').then(res => {
  89. this.dicts.crmFormStateDict = res;
  90. });
  91. this.$getDicts('crm_form_tactic').then(res => {
  92. this.dicts.crmFormTacticDict = res;
  93. });
  94. // 设置 mapHeight
  95. uni.getSystemInfo({
  96. success: (e) => {
  97. const {
  98. windowHeight
  99. } = e;
  100. this.mapHeight = (windowHeight - 70) + 'px';
  101. }
  102. });
  103. //初始调用
  104. this.getOrderList();
  105. this.getStatisticsSendStatus();
  106. // 初始化获取全部标签
  107. this.getAllTags();
  108. this.countdownInterval()
  109. },
  110. onUnload() {
  111. clearInterval(this.countdownInterval);
  112. },
  113. // 下拉刷新
  114. async onPullDownRefresh() {
  115. try {
  116. // 重置页码和列表
  117. this.page.pageNum = 1;
  118. this.queryParams.pageNum = 1;
  119. this.commissionQueryParams.pageNum = 1;
  120. this.orderList = [];
  121. // 重新获取数据
  122. await this.getOrderList();
  123. // 重新获取统计数据
  124. await this.getStatisticsSendStatus();
  125. } catch (error) {
  126. console.error('下拉刷新失败:', error);
  127. } finally {
  128. // 停止下拉刷新动画
  129. uni.stopPullDownRefresh();
  130. }
  131. },
  132. // 滑动到底部加载更多
  133. onReachBottom() {
  134. if (this.orderList.length >= this.page.total) {
  135. //到底了,没有更多
  136. return;
  137. }
  138. const params = this.activeType === 3 ? this.commissionQueryParams : this.queryParams;
  139. params.pageNum++;
  140. this.page.pageNum++;
  141. this.getOrderList();
  142. },
  143. watch: {
  144. countdown: {
  145. handler(newVal, oldVal) {
  146. if (newVal <= 0) {
  147. this.orderList.forEach(order => {
  148. if (order.status == 1) {
  149. this.handleBtnClick('isBusy', order)
  150. }
  151. })
  152. clearInterval(this.countdownInterval);
  153. }
  154. },
  155. immediate: true
  156. }
  157. },
  158. methods: {
  159. countdownInterval() {
  160. this.countdownInterval = setInterval(() => {
  161. this.countdown--
  162. }, 1000);
  163. },
  164. //获取列表数据
  165. async getOrderList() {
  166. try {
  167. let result;
  168. // 如果是"我的分成",调用分成接口
  169. if (this.activeType === 3) {
  170. result = await uni.$u.api.selectCommissionList({
  171. pageSize: this.commissionQueryParams.pageSize,
  172. pageNum: this.commissionQueryParams.pageNum,
  173. }, {
  174. ...this.commissionQueryParams
  175. });
  176. console.log('分成列表', result);
  177. } else {
  178. // 否则调用订单列表接口
  179. // 合并查询参数和筛选参数
  180. const params = {
  181. ...this.queryParams,
  182. type: this.activeType,
  183. status: this.activeStatus || this.queryParams.status,
  184. };
  185. // 移除分页参数,因为已经在第一个参数中传递
  186. delete params.pageNum;
  187. delete params.pageSize;
  188. result = await uni.$u.api.selectClueOrderFormList({
  189. pageSize: this.queryParams.pageSize,
  190. pageNum: this.queryParams.pageNum,
  191. }, params);
  192. console.log('接单列表', result);
  193. // 把数组按照status的大小排序,从小到大
  194. result.rows.sort((a, b) => {
  195. return a.status - b.status;
  196. // return b.status - a.status;
  197. })
  198. }
  199. // 获取当前使用的查询参数
  200. const params = this.activeType === 3 ? this.commissionQueryParams : this.queryParams;
  201. // 如果是第一页(下拉刷新或初始加载),直接替换列表
  202. if (params.pageNum === 1) {
  203. this.orderList = result.rows;
  204. } else {
  205. // 否则追加数据(上拉加载更多)
  206. this.orderList.push(...result.rows);
  207. }
  208. this.page.total = result.total;
  209. this.page.pageNum = params.pageNum;
  210. this.page.pageSize = params.pageSize;
  211. } catch (error) {
  212. console.error('列表接口调用失败:', error);
  213. // 添加用户友好的错误提示
  214. const errorMsg = this.activeType === 3 ? '获取分成列表失败,请稍后重试' : '获取订单列表失败,请稍后重试';
  215. uni.$u.toast(errorMsg);
  216. }
  217. },
  218. //获取统计数据
  219. async getStatisticsSendStatus() {
  220. // 如果是"我的分成",不需要统计数据
  221. if (this.activeType === 3) {
  222. this.statisticsSendStatus = [];
  223. return;
  224. }
  225. const { data } = await uni.$u.api.statisticsSendStatus({ type: this.activeType });
  226. // console.log('统计数据是', data)
  227. this.statisticsSendStatus = data;
  228. },
  229. // 处理按钮点击事件
  230. async handleBtnClick(btnType, order) {
  231. if (btnType == 'acceptOrder') {
  232. //去接单
  233. console.log('去接单', order)
  234. //打开模态窗二次确认,确认后跳转接单form
  235. uni.showModal({
  236. title: '确认接单',
  237. content: `是否确认接单订单:${order.item}?`,
  238. success: async (res) => {
  239. if (res.confirm) {
  240. await uni.$u.api.oderForm({
  241. status: "2",
  242. id: order.id,
  243. });
  244. uni.navigateTo({
  245. url: `/pages/orderDetailRefactored/index?orderId=${order.id}&item=${order.item}&type=${this.type}&clueId=${order.clueId}`,
  246. })
  247. } else if (res.cancel) {
  248. // 用户点击了取消,不执行任何操作
  249. uni.$u.toast('已取消接单');
  250. }
  251. }
  252. })
  253. } else if (btnType == 'isBusy') {
  254. //在忙
  255. console.log('在忙', order)
  256. //当前订单移动到末尾
  257. this.orderList.push(this.orderList.splice(this.orderList.indexOf(order), 1)[0]);
  258. } else if (btnType == 'willFollow') {
  259. //待跟进
  260. console.log('待跟进', order)
  261. //打开模态窗
  262. this.followUpModelShow = true;
  263. this.currentOrder = order
  264. } else if (btnType == 'tag') {
  265. //打标签
  266. console.log('打标签', order)
  267. // 如果标签列表为空,重新获取一次
  268. if (!this.tagList || this.tagList.length === 0) {
  269. await this.getAllTags();
  270. }
  271. //打开模态窗
  272. this.tagModalVisible = true;
  273. // 确保 order.tags 存在且是数组
  274. if (order && order.tags && Array.isArray(order.tags) && order.tags.length > 0) {
  275. this.currentTags = order.tags.map(tag => tag && tag.id ? tag.id : null).filter(id => id !== null);
  276. } else {
  277. this.currentTags = [];
  278. }
  279. this.currentOrder = order
  280. } else if (btnType == 'share') {
  281. //一键分享
  282. console.log('一键分享', order)
  283. } else if (btnType == 'oneFollow') {
  284. //待跟进
  285. console.log('待跟进', order)
  286. this.followUpModelShow = true;
  287. this.currentOrder = order
  288. }
  289. },
  290. // 格式化金额
  291. formatAmount(amount) {
  292. if (!amount) return '-';
  293. return parseFloat(amount).toLocaleString();
  294. },
  295. // 格式化金额
  296. formatAmount(amount) {
  297. if (!amount) return '-';
  298. return parseFloat(amount).toLocaleString();
  299. },
  300. // 跳转订单详情
  301. toOrderDetail(order) {
  302. //点卡片看详情
  303. // if (order.status == '1' || order.status == '2') {
  304. uni.navigateTo({
  305. url: `/pages/orderDetailRefactored/index?orderId=${order.id}&item=${order.item}&type=${this.type}&clueId=${order.clueId}`,
  306. })
  307. // } else {
  308. // uni.$u.toast('当前订单无法查看详情');
  309. // return;
  310. // }
  311. },
  312. //获取全部标签
  313. async getAllTags() {
  314. try {
  315. const res = await uni.$u.api.getClueTagGroupVoList({ tagGroupApplication: '2' })
  316. console.log('全部标签', res)
  317. // 确保数据结构正确
  318. if (res && res.data && res.data.length > 0 && res.data[0].clueTagDataList) {
  319. this.tagList = res.data[0].clueTagDataList || [];
  320. } else {
  321. this.tagList = [];
  322. console.warn('标签数据格式不正确', res);
  323. }
  324. } catch (error) {
  325. console.error('获取标签列表失败:', error);
  326. this.tagList = [];
  327. uni.$u.toast('获取标签列表失败');
  328. }
  329. },
  330. cancelTag() {
  331. this.tagModalVisible = false;
  332. // 重置状态
  333. this.currentTags = [];
  334. this.currentOrder = {};
  335. },
  336. async confirmTag() {
  337. try {
  338. console.log('确认打标签', this.currentTags)
  339. // 确保 currentTags 是数组且不为空
  340. if (!Array.isArray(this.currentTags)) {
  341. this.currentTags = [];
  342. }
  343. // 过滤掉无效值
  344. const validTags = this.currentTags.filter(tag => tag !== null && tag !== undefined && tag !== '');
  345. const allTags = validTags.join(',');
  346. console.log('allTags', allTags)
  347. if (!this.currentOrder || !this.currentOrder.id) {
  348. uni.$u.toast('订单信息错误');
  349. return;
  350. }
  351. await uni.$u.api.updateTags({
  352. id: this.currentOrder.id,
  353. allTags: allTags,
  354. })
  355. this.tagModalVisible = false;
  356. uni.$u.toast('标签更新成功');
  357. //更新当前订单的标签
  358. if (this.currentOrder && Array.isArray(this.tagList)) {
  359. this.currentOrder.tags = this.tagList.filter(tag => tag && tag.id && validTags.includes(tag.id));
  360. }
  361. // 更新列表中的订单标签
  362. const orderIndex = this.orderList.findIndex(item =>
  363. item.id === this.currentOrder.id ||
  364. (item.receiptId && this.currentOrder.receiptId && item.receiptId === this.currentOrder.receiptId)
  365. );
  366. if (orderIndex !== -1 && this.currentOrder.tags) {
  367. this.$set(this.orderList, orderIndex, {
  368. ...this.orderList[orderIndex],
  369. tags: this.currentOrder.tags
  370. });
  371. }
  372. } catch (error) {
  373. console.error('更新标签失败:', error);
  374. uni.$u.toast('标签更新失败');
  375. }
  376. },
  377. // 确认跟进细节按钮点击事件
  378. async confirmFollowUp() {
  379. console.log('确认跟进细节:', this.followUpNotes);
  380. this.followUpModelShow = false;
  381. // 可以在这里添加提交跟进细节的逻辑
  382. // 未收的时候,提交一个跟进记录 待跟进_内容
  383. const res = await uni.$u.api.addOrderFollow({
  384. orderId: this.currentOrder.id,
  385. content: `待跟进_${this.followUpNotes}`,
  386. })
  387. if (res.code == 200) {
  388. uni.$u.toast('提交待跟进记录成功');
  389. }
  390. this.followUpNotes = '';
  391. },
  392. // 切换筛选条件
  393. async changeFilter(param) {
  394. this.activeType = param.type;
  395. // 切换筛选条件时,重置状态筛选
  396. this.activeStatus = '';
  397. this.queryParams.status = undefined;
  398. this.page.pageNum = 1;
  399. this.queryParams.pageNum = 1;
  400. this.commissionQueryParams.pageNum = 1;
  401. this.orderList = [];
  402. this.getOrderList();
  403. this.getStatisticsSendStatus()
  404. },
  405. // 处理关键词搜索
  406. handleKeyword() {
  407. const params = this.activeType === 3 ? this.commissionQueryParams : this.queryParams;
  408. params.pageNum = 1;
  409. this.page.pageNum = 1;
  410. this.orderList = [];
  411. this.getOrderList();
  412. },
  413. // 处理关键词清空
  414. handleKeywordClear() {
  415. const params = this.activeType === 3 ? this.commissionQueryParams : this.queryParams;
  416. params.phone = "";
  417. params.pageNum = 1;
  418. this.page.pageNum = 1;
  419. this.orderList = [];
  420. this.getOrderList();
  421. },
  422. // 显示筛选弹窗
  423. handleshowFilter() {
  424. const refName = this.activeType === 3 ? 'commissionFilter' : 'filter';
  425. this.$refs[refName].show();
  426. },
  427. // 处理筛选查询
  428. handleFilterQuery() {
  429. const params = this.activeType === 3 ? this.commissionQueryParams : this.queryParams;
  430. params.pageNum = 1;
  431. this.page.pageNum = 1;
  432. this.orderList = [];
  433. this.getOrderList();
  434. },
  435. //切换统计数据的类型
  436. changeStatus(param) {
  437. if (param == this.activeStatus) {
  438. //如果当前点击的状态和当前选中的状态相同,则取消选中
  439. this.activeStatus = '';
  440. this.queryParams.status = undefined;
  441. this.queryParams.pageNum = 1;
  442. this.page.pageNum = 1;
  443. this.orderList = [];
  444. this.getOrderList();
  445. } else {
  446. //如果当前点击的状态和当前选中的状态不同,则切换选中状态
  447. this.activeStatus = param;
  448. this.queryParams.status = param;
  449. this.queryParams.pageNum = 1;
  450. this.page.pageNum = 1;
  451. this.orderList = [];
  452. this.getOrderList();
  453. }
  454. },
  455. //点击查看更多的跟进
  456. async handleShowMoreFollowUp() {
  457. //当前的order是
  458. console.log()
  459. const { data } = await uni.$u.api.getDuplicateOrderFollowListByClueId({
  460. clueId: this.currentOrder.clueId
  461. });
  462. console.log('这里是跟进', data)
  463. const allData = []
  464. for (const key in data) {
  465. allData.push(...data[key])
  466. }
  467. const filterData = allData.filter(item => {
  468. console.log('过滤', item)
  469. //过滤出来tem.content不包括联系师傅、师傅拍图技巧、到达客户面对面、未收评分、待跟进_
  470. return item.content.indexOf('联系师傅') == -1 && item.content.indexOf('师傅拍图技巧') == -1 && item.content.indexOf('到达客户面对面') == -1 && item.content.indexOf('未收评分') == -1 && item.content.indexOf('待跟进_') == -1
  471. })
  472. console.log('筛选后的跟进', filterData)
  473. this.currentFollowUp = filterData || [];
  474. this.showMoreFollowUp = true
  475. }
  476. }
  477. }
  478. </script>
  479. <template>
  480. <view class="container">
  481. <u-navbar title="接单中心" :autoBack="true" :placeholder="true" v-hideNav></u-navbar>
  482. <!-- 筛选条件 -->
  483. <u-tabs :list="filterList" @click="changeFilter"></u-tabs>
  484. <!-- 查询参数区域 -->
  485. <view class="queryParams_wrap">
  486. <view class="search">
  487. <u--input clearable prefixIcon="search" v-model="currentQueryParams.phone" shape="circle" @blur="handleKeyword"
  488. @clear="handleKeywordClear" placeholder="请输入电话"></u--input>
  489. </view>
  490. <view class="query">
  491. <view style="margin-right: 10rpx;" @click="handleshowFilter">筛选</view>
  492. <u-icon name="arrow-down-fill" color="#aaa" size="10"></u-icon>
  493. </view>
  494. </view>
  495. <!-- 统计数据 -->
  496. <view v-if="activeType !== 3" class="send_status_wrap">
  497. <scroll-view scroll-x>
  498. <view class="statisticsContainer">
  499. <view v-for="item in statisticsSendStatus" :key="item.status" @click="changeStatus(item.status)"
  500. class="statisticsItem" :class="{ 'activeStatusClass': item.status == activeStatus }">
  501. <view>{{ item.statusName }}</view>
  502. <view>({{ item.count || 0 }})</view>
  503. </view>
  504. </view>
  505. </scroll-view>
  506. </view>
  507. <!-- 订单列表容器 -->
  508. <view class="order_list_wrap">
  509. <transition-group name="order-move" tag="div">
  510. <!-- 我的分成 - 使用专门的分成卡片 -->
  511. <view class="commission_item" v-for="item in orderList" :key="activeType === 3 ? item.id : (item.receiptId + item.id)" v-if="activeType === 3">
  512. <view class="commission_top">
  513. <view class="top_left">{{ item.receiptItem || '-' }}</view>
  514. <view class="top_right">
  515. <text class="account_type">{{ item.accountType === '1' ? '前端' : '后端' }}</text>
  516. </view>
  517. </view>
  518. <view class="commission_info">
  519. <view class="info_row">
  520. <view class="info_item">
  521. <text class="label">电话: </text>
  522. <text class="value">{{ item.phone || '-' }}</text>
  523. </view>
  524. </view>
  525. <view class="info_row">
  526. <view class="info_item">
  527. <text class="label">收单时间: </text>
  528. <text class="value">{{ item.receiptDate || '-' }}</text>
  529. </view>
  530. </view>
  531. <view class="info_row">
  532. <view class="info_item">
  533. <text class="label">收单人: </text>
  534. <text class="value">{{ item.receiptNickName || '-' }}</text>
  535. </view>
  536. <view class="info_item">
  537. <text class="label">公司: </text>
  538. <text class="value">{{ item.orgName || '-' }}</text>
  539. </view>
  540. </view>
  541. <view class="info_row">
  542. <view class="info_item">
  543. <text class="label">分成所属人: </text>
  544. <text class="value">{{ item.userName || '-' }}</text>
  545. </view>
  546. <view class="info_item">
  547. <text class="label">分成比例: </text>
  548. <text class="value">{{ item.commissionRate || '-' }}%</text>
  549. </view>
  550. </view>
  551. </view>
  552. <view class="commission_amount">
  553. <view class="amount_item">
  554. <view class="amount_label">业绩</view>
  555. <view class="amount_value primary">{{ formatAmount(item.commissionAmount) }}</view>
  556. </view>
  557. <view class="amount_item">
  558. <view class="amount_label">毛业绩</view>
  559. <view class="amount_value">{{ formatAmount(item.grossAmount) }}</view>
  560. </view>
  561. </view>
  562. </view>
  563. <!-- 全部列表和我的接发单 - 使用订单卡片 -->
  564. <view class="orderCard" v-for="item in orderList"
  565. :key="activeType === 3 ? item.id : (item.receiptId + item.id)"
  566. v-if="activeType !== 3"
  567. @click.stop="toOrderDetail(item)">
  568. <view class="bandAndPrice">
  569. <view class="bandName">{{ item.itemBrand || '暂无品牌' }}</view>
  570. <view class="price">¥{{ item.priceRange || '?' }}</view>
  571. </view>
  572. <view class="mainLind">
  573. <view class="itemName">{{ item.item || '暂无项目' }}</view>
  574. <view class="mainLindInfo">
  575. <view class="infoItem">
  576. <view class="infoItemTitle">发单人:</view>
  577. <view>{{ item.createNickName || '未知' }}</view>
  578. </view>
  579. <view class="infoItem">
  580. <view class="infoItemTitle">机构:</view>
  581. <view>{{ item.orgName || '暂无机构' }}</view>
  582. </view>
  583. <view class="infoItem">
  584. <view class="infoItemTitle">电话:</view>
  585. <view>{{ item.phone || '暂无电话' }}</view>
  586. </view>
  587. <view class="infoItem">
  588. <view class="infoItemTitle">接单人:</view>
  589. <view>{{ item.identificationName || '暂无所属人' }}</view>
  590. </view>
  591. <view class="infoItem">
  592. <view class="infoItemTitle">运营人:</view>
  593. <view>{{ item.clueOperationName || '暂无运营人' }}</view>
  594. </view>
  595. <view class="infoItem">
  596. <view class="infoItemTitle">发单日期:</view>
  597. <view>{{ item.sendDate || '暂无时间' }}</view>
  598. </view>
  599. </view>
  600. </view>
  601. <view class="tags">
  602. <view class="tag" v-for="(tag, index) in item.tags" :key="index"
  603. :style="{ backgroundColor: tag.color, opacity: 0.8 }">
  604. {{ tag.name }}
  605. </view>
  606. </view>
  607. <view class="Btns">
  608. <!-- status 状态 1 发单(刚发出来) 2 接单(处理中) 3 收单(入库了) 4 未收(没有收到) -->
  609. <view class="btnGroup" v-if="item && (item.status == '1')">
  610. <view class="card-button" @click.stop="handleBtnClick('acceptOrder', item)">立即接单</view>
  611. <view class="card-button isBusy" @click.stop="handleBtnClick('isBusy', item)">
  612. <view>在忙</view>
  613. <view v-if="countdown > 0">({{ countdown }} s)</view>
  614. </view>
  615. </view>
  616. <view class="btnGroup" v-if="item && (item.status == '2')">
  617. <view class="card-button willFollow" @click.stop="handleBtnClick('willFollow', item)">
  618. 待跟进
  619. </view>
  620. <view class="card-button isBusy" @click.stop="handleBtnClick('tag', item)">打标签</view>
  621. </view>
  622. <view class="btnGroup" v-if="item && (item.status == '4')">
  623. <view class="card-button oneFollow" @click.stop="handleBtnClick('oneFollow', item)">待跟进</view>
  624. </view>
  625. </view>
  626. </view>
  627. </transition-group>
  628. <view class="hasMore">
  629. {{ orderList.length >= page.total ? '没有更多了~' : '向下滑动加载更多~' }}
  630. </view>
  631. </view>
  632. <!-- 打标签模态窗 -->
  633. <u-modal showCancelButton :show="tagModalVisible" title="选择标签" @confirm="confirmTag" @cancel="cancelTag">
  634. <view class="slot-content">
  635. <u-checkbox-group class="tagCheckboxGroup" v-model="currentTags" placement="column">
  636. <u-checkbox
  637. v-for="(item, index) in tagList"
  638. :key="item && item.id ? item.id : index"
  639. :customStyle="{ marginBottom: '8px' }"
  640. :label="item && item.name ? item.name : '未知标签'"
  641. :name="item && item.id ? item.id : ''">
  642. </u-checkbox>
  643. </u-checkbox-group>
  644. <view v-if="tagList.length === 0" style="text-align: center; padding: 40rpx 0; color: #999;">
  645. 暂无可用标签
  646. </view>
  647. </view>
  648. </u-modal>
  649. <u-modal showCancelButton :show="followUpModelShow" :title="'填写跟进细节'" @confirm="confirmFollowUp"
  650. @cancel="followUpModelShow = false">
  651. <view class="modal-content">
  652. <u--textarea v-model="followUpNotes" placeholder="请输入情况" confirm-type="done"
  653. style="width: 400rpx;margin-bottom: 10rpx; "></u--textarea>
  654. <u-button type="primary" @click="handleShowMoreFollowUp">点击查看更多跟进</u-button>
  655. </view>
  656. </u-modal>
  657. <!-- 更多跟进 -->
  658. <u-modal :show="showMoreFollowUp" title="详细跟进记录" @confirm="showMoreFollowUp = false">
  659. <!-- <view class="followUpBox"> -->
  660. <scroll-view class="followUpBox" scroll-y>
  661. <view v-for="value in currentFollowUp" :key="value.id" class="followUpItem">
  662. <view class="followUpInfo">
  663. <view class="followUpNickname">
  664. 账号:{{ value.createNickname }}
  665. </view>
  666. <view class="followUpOrgName">{{ value.orgName }}</view>
  667. </view>
  668. <view class="followUpContent">{{ value.content }}</view>
  669. </view>
  670. </scroll-view>
  671. <!-- </view> -->
  672. </u-modal>
  673. <!-- 筛选组件 - 订单列表 -->
  674. <filter-query v-if="activeType !== 3" ref="filter" v-model="queryParams" @getList="handleFilterQuery" :mapHeight="mapHeight"
  675. :dicts="dicts"></filter-query>
  676. <!-- 筛选组件 - 我的分成 -->
  677. <commission-filter-query v-if="activeType === 3" ref="commissionFilter" v-model="commissionQueryParams" @getList="handleFilterQuery" :mapHeight="mapHeight"></commission-filter-query>
  678. </view>
  679. </template>
  680. <style scoped lang="scss">
  681. .container {
  682. box-sizing: border-box;
  683. min-height: 100vh;
  684. background-color: #f5f5f5;
  685. }
  686. .hasMore {
  687. text-align: center;
  688. padding: 20rpx 0;
  689. font-size: 24rpx;
  690. color: #999;
  691. }
  692. .queryParams_wrap {
  693. display: flex;
  694. background: #fff;
  695. padding: 14px 0;
  696. border-bottom: 1px solid #f0f0f0;
  697. .query,
  698. .search {
  699. display: flex;
  700. align-items: center;
  701. justify-content: center;
  702. font-size: 16px;
  703. font-weight: 700;
  704. color: #202020;
  705. }
  706. .query {
  707. flex: 1;
  708. cursor: pointer;
  709. }
  710. .search {
  711. flex: 2;
  712. padding-left: 20px;
  713. padding-right: 10px;
  714. }
  715. }
  716. .send_status_wrap {
  717. width: 690rpx;
  718. padding: 0 30rpx;
  719. margin-top: 20rpx;
  720. display: flex;
  721. .statisticsContainer {
  722. display: flex;
  723. align-items: center;
  724. flex-wrap: nowrap;
  725. white-space: nowrap;
  726. }
  727. }
  728. .order_list_wrap {
  729. padding: 10px 0;
  730. }
  731. /* 分成卡片样式 */
  732. .commission_item {
  733. background: #fff;
  734. border-radius: 20rpx;
  735. padding: 20rpx;
  736. margin: 20rpx 20rpx;
  737. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.06);
  738. .commission_top {
  739. display: flex;
  740. justify-content: space-between;
  741. margin-bottom: 15rpx;
  742. .top_left {
  743. font-size: 36rpx;
  744. font-weight: bold;
  745. color: #202020;
  746. }
  747. .top_right {
  748. .account_type {
  749. background: #108cff;
  750. color: #fff;
  751. padding: 8rpx 16rpx;
  752. border-radius: 20rpx;
  753. font-size: 24rpx;
  754. }
  755. }
  756. }
  757. .commission_info {
  758. margin-bottom: 15rpx;
  759. .info_row {
  760. display: flex;
  761. margin-bottom: 16rpx;
  762. &:last-child {
  763. margin-bottom: 0;
  764. }
  765. .info_item {
  766. flex: 1;
  767. display: flex;
  768. align-items: center;
  769. font-size: 28rpx;
  770. .label {
  771. color: #9b9aa2;
  772. margin-right: 16rpx;
  773. min-width: 120rpx;
  774. }
  775. .value {
  776. color: #202020;
  777. }
  778. }
  779. }
  780. }
  781. .commission_amount {
  782. display: flex;
  783. justify-content: space-around;
  784. padding: 30rpx 0;
  785. border-top: 1rpx solid #f0f0f0;
  786. background: #f8f9fb;
  787. border-radius: 20rpx;
  788. .amount_item {
  789. text-align: center;
  790. .amount_label {
  791. font-size: 24rpx;
  792. color: #9b9aa2;
  793. margin-bottom: 10rpx;
  794. }
  795. .amount_value {
  796. font-size: 32rpx;
  797. font-weight: bold;
  798. color: #202020;
  799. &.primary {
  800. color: #108cff;
  801. }
  802. }
  803. }
  804. }
  805. }
  806. /* 订单卡片主容器 */
  807. .orderCard {
  808. box-sizing: border-box;
  809. width: 95%;
  810. background-color: #fff;
  811. margin: 20rpx auto;
  812. border-radius: 20rpx;
  813. padding: 20rpx;
  814. }
  815. /* 品牌和价格区域 */
  816. .orderCard .bandAndPrice {
  817. display: flex;
  818. justify-content: space-between;
  819. align-items: center;
  820. }
  821. /* 品牌名称 */
  822. .orderCard .bandAndPrice .bandName {
  823. font-size: 20rpx;
  824. font-weight: 700;
  825. border: 2px solid #2563EB;
  826. padding: 6rpx 12rpx;
  827. border-radius: 15rpx;
  828. background-color: #EFF6FF;
  829. color: #2563EB;
  830. }
  831. /* 价格 */
  832. .orderCard .bandAndPrice .price {
  833. font-size: 30rpx;
  834. font-weight: 700;
  835. }
  836. /* 主要内容行 */
  837. .orderCard .mainLind {
  838. margin-top: 10rpx;
  839. display: flex;
  840. justify-content: space-between;
  841. align-items: center;
  842. gap: 20rpx;
  843. flex-direction: column;
  844. }
  845. /* 主要内容行信息容器 */
  846. .orderCard .mainLind .mainLindInfo {
  847. display: grid;
  848. grid-template-columns: 1fr 1fr;
  849. flex-direction: column;
  850. gap: 10rpx;
  851. font-size: 24rpx;
  852. color: #6b7280;
  853. text-wrap: nowrap;
  854. width: 100%;
  855. .infoItem {
  856. display: flex;
  857. .infoItemTitle {
  858. font-weight: 700;
  859. }
  860. }
  861. }
  862. /* 商品名称 */
  863. .orderCard .mainLind .itemName {
  864. font-size: 30rpx;
  865. font-weight: 700;
  866. color: #374751;
  867. width: 100%;
  868. text-align: left;
  869. }
  870. /* 标签区域 */
  871. .orderCard .tags {
  872. display: flex;
  873. gap: 10rpx;
  874. }
  875. /* 单个标签 */
  876. .orderCard .tags .tag {
  877. font-size: 20rpx;
  878. font-weight: 700;
  879. padding: 6rpx 12rpx;
  880. border-radius: 15rpx;
  881. background-color: #EFF6FF;
  882. color: #fff;
  883. }
  884. /* 按钮区域 */
  885. .orderCard .Btns {
  886. margin-top: 10rpx;
  887. }
  888. /* 按钮组 */
  889. .orderCard .Btns .btnGroup {
  890. display: flex;
  891. justify-content: space-between;
  892. align-items: center;
  893. gap: 20rpx;
  894. }
  895. /* 卡片按钮基础样式 */
  896. .orderCard .Btns .btnGroup .card-button {
  897. font-size: 24rpx;
  898. font-weight: 700;
  899. border: 2rpx solid #2563EB;
  900. padding: 6rpx 12rpx;
  901. border-radius: 15rpx;
  902. background-color: #2563EB;
  903. color: #fff;
  904. width: 45%;
  905. text-align: center;
  906. cursor: pointer;
  907. height: 60rpx;
  908. line-height: 60rpx;
  909. display: flex;
  910. justify-content: center;
  911. align-items: center;
  912. }
  913. /* 忙碌状态按钮 */
  914. .orderCard .Btns .btnGroup .card-button.isBusy {
  915. background-color: #fff;
  916. color: #6B7280;
  917. border-color: #6B7280;
  918. }
  919. /* 待跟进状态按钮 */
  920. .orderCard .Btns .btnGroup .card-button.willFollow {
  921. background-color: #EFF6FF;
  922. color: #2563EB;
  923. }
  924. /* 单独跟进按钮 */
  925. .orderCard .Btns .btnGroup .card-button.oneFollow {
  926. width: 100%;
  927. background-color: #EFF6FF;
  928. color: #2563EB;
  929. }
  930. .followUpScroll {
  931. height: 600rpx;
  932. }
  933. /* 订单移动动画 */
  934. .order-move-enter-active,
  935. .order-move-leave-active {
  936. transition: all 0.5s ease;
  937. }
  938. .order-move-enter-from,
  939. .order-move-leave-to {
  940. opacity: 0;
  941. transform: translateY(30px);
  942. }
  943. .order-move-move {
  944. transition: transform 0.5s ease;
  945. }
  946. .cancelBtn {
  947. margin-top: 20rpx;
  948. }
  949. .tagCheckboxGroup {
  950. display: grid;
  951. grid-template-columns: repeat(2, 1fr);
  952. }
  953. .statisticsItem {
  954. font-size: 30rpx;
  955. display: inline-flex;
  956. align-items: center;
  957. background: #fff;
  958. margin-right: 30rpx;
  959. padding: 8rpx 16rpx;
  960. white-space: nowrap;
  961. border-radius: 6rpx;
  962. color: #333;
  963. &.activeStatusClass {
  964. color: #fff;
  965. background: #4c8afe;
  966. }
  967. }
  968. .activeStatusClass {
  969. background-color: #2563EB;
  970. color: #fff;
  971. }
  972. ::v-deep .u-tabs__wrapper__nav__line {
  973. top: 7px;
  974. }
  975. .followUpItem {
  976. background-color: #F7FBFE;
  977. width: 540rpx;
  978. margin: 20rpx;
  979. padding: 20rpx;
  980. box-sizing: border-box;
  981. .followUpInfo {
  982. display: flex;
  983. justify-content: space-between;
  984. align-items: center;
  985. gap: 10rpx;
  986. margin-bottom: 10rpx;
  987. }
  988. .followUpNickname {
  989. font-size: 24rpx;
  990. font-weight: 700;
  991. color: #2563EB;
  992. }
  993. .followUpOrgName {
  994. font-size: 24rpx;
  995. font-weight: 700;
  996. color: #6B7280;
  997. }
  998. .followUpContent {
  999. font-size: 24rpx;
  1000. font-weight: 700;
  1001. color: #374751;
  1002. }
  1003. }
  1004. .followUpBox {
  1005. height: 600rpx;
  1006. }
  1007. .u-tabs{
  1008. background-color: #fff;
  1009. }
  1010. ::v-deep .u-navbar {
  1011. flex-shrink: 0;
  1012. }
  1013. </style>