customer-reception.js 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  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. toDetail(e) {
  124. let item = e.detail.item
  125. let url = null
  126. if (item.followStatus == '跟进状态-报备' || item.followStatus == '跟进状态-接待') {
  127. url = this.data.route.toFollowStatus1.url
  128. } else if (item.followStatus == '跟进状态-跟进' || item.followStatus == '跟进状态-邀约') {
  129. url = this.data.route.toFollowStatus2.url
  130. } else if (item.followStatus == '跟进状态-约尺') {
  131. url = this.data.route.toFollowStatus3.url
  132. }
  133. let _this = this;
  134. wx.navigateTo({
  135. url: url,
  136. events: {
  137. // 保存成功后刷新页面
  138. refresh: function (data) {
  139. // 刷新一览界面
  140. _this.searchData();
  141. }
  142. },
  143. success: function (res) {
  144. let data = {}
  145. data.id = item.followId
  146. data.formMode = Constants.formMode.edit
  147. data.formType = Constants.formMode.detail
  148. res.eventChannel.emit('params', data);
  149. }
  150. })
  151. },
  152. /**
  153. * @desc : 切换
  154. * @date : 2024/2/1 15:49
  155. * @author : 于继渤
  156. */
  157. onChangeTabs(e) {
  158. let code = e.detail.detail.code
  159. this.setData({
  160. followStatus: code,
  161. })
  162. this.searchData()
  163. },
  164. /**
  165. * @desc : 设置查询参数
  166. * @date : 2024/2/1 15:49
  167. * @author : 于继渤
  168. */
  169. setSearchParams(params) {
  170. //销售状态
  171. params.followStatus = this.data.followStatus == 'all' ? '' : this.data.followStatus
  172. return params
  173. },
  174. /**
  175. * @desc : 处理接口返回数据
  176. * @date : 2024/2/1 15:49
  177. * @author : 于继渤
  178. */
  179. handleSearchData(tableData) {
  180. let contentSaveList = this.data.contentSaveList
  181. contentSaveList[0].bill = tableData.length
  182. this.setData({
  183. contentSaveList: contentSaveList
  184. })
  185. },
  186. /**
  187. * @desc : 查询
  188. * @date : 2024/2/1 15:49
  189. * @author : 于继渤
  190. */
  191. getData(params) {
  192. return this.excute(this.data.service, this.data.service.selectByCond, params);
  193. },
  194. })