customer-reception.js 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. /*******************************************************************************
  2. * Copyright(c) 2022 dongke All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:
  5. * 2.新增接待
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * yjb 2022-0-12 1.00
  9. *******************************************************************************/
  10. const Constants = require('@/utils/Constants.js');
  11. const util = require('@/utils/util.js')
  12. const mixins = require('@/mixins/index.js')
  13. const app = getApp()
  14. Page({
  15. mixins: [mixins],
  16. /**
  17. * 页面的初始数据
  18. */
  19. data: {
  20. tagList: [{ title:mixins.$t('allReceptions'), code: 'all' }, { title: mixins.$t('followUpTasks'), code: mixins.$t('followStatusFollowUp') }, { title: mixins.$t('followStatusInvitationName'), code:mixins.$t('followStatusInvitation') }, { title: mixins.$t('followStatusFootName'), code: mixins.$t('followStatusFoot') }],
  21. buttonSaveList: [{ code: 'add', title: mixins.$t('add'), width: '120rpx', color: '#1B365D' }],
  22. contentSaveList: [{ code: 'need', title: mixins.$t('together'), type: 'count', color: '#1B365D', tail: mixins.$t('receptionInformation'), bill: 1, fontSize: '15px' }],
  23. // 查询条件
  24. searchContent: [
  25. { code: 'createtime', title: mixins.$t('pastThirthtyDays'), defaultValue: 5, searchType: Constants.searchType.date },
  26. { code: 'staff', title: mixins.$t('staffId'), dropType: 'staff' },
  27. { code: 'choose', title: mixins.$t('choose'), searchType: Constants.searchType.pick }
  28. ],
  29. // 查询条件-筛选
  30. pullMenuList: [
  31. { code: 'followStatus', pullType: 'mSelect', typeName: 'followStatus' },
  32. { code: 'followCount', dataType: 'number' },
  33. { code: 'nextFollowTime', dataType: 'date' }
  34. ],
  35. // 列表区(内容)
  36. contentList: [
  37. { name: 'cusPhone', title: mixins.$t('cusPhone'), phone: true },
  38. { name: 'addressFull', title: mixins.$t('addressFull')},
  39. { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: '' }], title: mixins.$t('storeInformation') },
  40. { name: 'followTime', title: mixins.$t('followTime') }
  41. ],
  42. contentObj: {
  43. '跟进状态-跟进': [{ name: 'cusPhone', title: mixins.$t('cusPhone'), phone: true },
  44. { name: 'addressFull', title: mixins.$t('addressFull') },
  45. { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: mixins.$t('staffId') }], title: mixins.$t('storeInformation') },
  46. { name: 'followTime', title: mixins.$t('followTime') }],
  47. '跟进状态-报备': [{ name: 'cusPhone', title: mixins.$t('cusPhone'), phone: true },
  48. { name: 'addressFull', title: mixins.$t('addressFull') },
  49. { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: mixins.$t('staffId') }], title: mixins.$t('storeInformation') },
  50. { name: 'followTime', title: mixins.$t('followTime') }],
  51. '跟进状态-邀约': [{ name: 'cusPhone', title: mixins.$t('cusPhone'), phone: true },
  52. { name: 'addressFull', title: mixins.$t('addressFull') },
  53. { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: mixins.$t('staffId') }], title: mixins.$t('storeInformation') },
  54. { name: 'followTime', title: mixins.$t('followTime') }],
  55. '跟进状态-约尺': [{ name: 'cusPhone', title: mixins.$t('cusPhone'), phone: true },
  56. { name: 'addressFull', title: mixins.$t('addressFull') },
  57. { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: mixins.$t('staffId') }], title: mixins.$t('storeInformation') },
  58. { name: 'followTime', title: mixins.$t('followTime') }],
  59. '跟进状态-接待': [
  60. { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: mixins.$t('staffId') }], title: mixins.$t('storeInformation') },
  61. { name: 'followTime', title: mixins.$t('followTime') }],
  62. '跟进状态-成交': [{ name: 'cusPhone', title: mixins.$t('cusPhone'), phone: true },
  63. { name: 'addressFull', title: mixins.$t('addressFull') },
  64. { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: mixins.$t('staffId') }], title: mixins.$t('storeInformation') },
  65. { name: 'followTime', title: mixins.$t('followTime') }],
  66. '跟进状态-报价': [{ name: 'cusPhone', title: mixins.$t('cusPhone'), phone: true },
  67. { name: 'addressFull', title: mixins.$t('addressFull') },
  68. { name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: mixins.$t('staffId') }], title: mixins.$t('storeInformation') },
  69. { name: 'followTime', title: mixins.$t('followTime') }],
  70. },
  71. // 列表区(脚部信息)
  72. footerInfo: [{
  73. prefix: mixins.$t('followedUp'),
  74. name: 'followCount',
  75. title: mixins.$t('next')
  76. },],
  77. // 弹出按钮
  78. buttonList: [
  79. { name: 'followUp', title: mixins.$t('follow') },
  80. { name: 'followUpTasks', title: mixins.$t('followUpTasks') },
  81. { name: 'customerRefundList', title: mixins.$t('saleOrder' )},
  82. { name: 'customerRefundList', title: mixins.$t('cusCollection') },
  83. ],
  84. totallength: 0, //视图下方提醒数量
  85. // 路由
  86. routeObjName: 'cusFollow',
  87. followStatus: 'all',
  88. active: 0
  89. },
  90. /**
  91. * @desc : 点击三个点事件
  92. * @date : 2024/2/1 15:49
  93. * @author : 于继渤
  94. */
  95. toPoint(e) {
  96. let item = e.detail.item
  97. let buttonList = this.data.buttonList
  98. if (item.followStatus == mixins.$t('followStatusFoot') && item.measureStatus == mixins.$t('scaleStatusMeasured') ) {
  99. buttonList = [
  100. { name: 'followUp', title: mixins.$t('follow') },
  101. { name: 'followUpTasks', title: mixins.$t('followUpTasks') },
  102. { name: 'customerRefundList', title: mixins.$t('saleOrder' )},
  103. { name: 'customerRefundList', title: mixins.$t('cusCollection') },
  104. { name: 'measureTo', title: mixins.$t('measuringScaleReceipt') }
  105. ]
  106. } else {
  107. buttonList = [
  108. { name: 'followUp', title: mixins.$t('follow') },
  109. { name: 'followUpTasks', title: mixins.$t('followUpTasks') },
  110. { name: 'customerRefundList', title: mixins.$t('saleOrder' )},
  111. { name: 'customerRefundList', title: mixins.$t('cusCollection') },
  112. ]
  113. }
  114. this.setData({
  115. buttonList: buttonList
  116. })
  117. },
  118. /**
  119. * @desc : 切换
  120. * @date : 2024/2/1 15:49
  121. * @author : 于继渤
  122. */
  123. onChangeTabs(e) {
  124. let code = e.detail.detail.code
  125. this.setData({
  126. followStatus: code,
  127. })
  128. this.searchData()
  129. },
  130. /**
  131. * @desc : 设置查询参数
  132. * @date : 2024/2/1 15:49
  133. * @author : 于继渤
  134. */
  135. setSearchParams(params) {
  136. //销售状态
  137. params.followStatus = this.data.followStatus == 'all' ? '' : this.data.followStatus
  138. return params
  139. },
  140. /**
  141. * @desc : 处理接口返回数据
  142. * @date : 2024/2/1 15:49
  143. * @author : 于继渤
  144. */
  145. handleSearchData(tableData) {
  146. let contentSaveList = this.data.contentSaveList
  147. contentSaveList[0].bill = tableData.length
  148. this.setData({
  149. contentSaveList: contentSaveList
  150. })
  151. },
  152. /**
  153. * @desc : 查询
  154. * @date : 2024/2/1 15:49
  155. * @author : 于继渤
  156. */
  157. getData(params) {
  158. return this.excute(this.data.service, this.data.service.selectByCond, params);
  159. },
  160. })