customer-list.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. /*******************************************************************************
  2. * Copyright(c) 2022 dongke All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:
  5. * 编辑履历:
  6. * 作者 日期 版本 修改内容
  7. * 于继渤 2024-1-23 1.00 客户档案新增
  8. *******************************************************************************/
  9. const Constants = require('@/utils/Constants.js');
  10. const util = require('@/utils/util.js')
  11. const mixins = require('@/mixins/index.js')
  12. const app = getApp()
  13. Page({
  14. mixins: [mixins],
  15. /**
  16. * 页面的初始数据
  17. */
  18. data: {
  19. tagList: [{ title: "潜在客户", code: '销售状态-潜客' }, { title: "公海客户", code: '销售状态-公海' }, { title: "成交客户", code: '销售状态-成交' }, { title: "全部客户", code: 'all' }],
  20. // 查询条件
  21. searchContent: [
  22. { code: 'createtime', title: '近30天', defaultValue: 5, searchType: Constants.searchType.date },
  23. { code: 'staff', title: '员工', dropType: 'staff' },
  24. { code: 'org', title: '部门', dropType: 'org' },
  25. { code: 'choose', title: '筛选', searchType: Constants.searchType.pick }
  26. ],
  27. buttonSaveList:[{code:'add',title:'新建',width:'120rpx',color:'#1B365D'}],
  28. contentSaveList:[{code:'need',title:'共 位客户',type:'str',color:'#1B365D'}],
  29. // 查询条件-筛选
  30. pullMenuList: [{
  31. code: 'customerFrom',
  32. pullType: 'mSelect',
  33. typeName: 'customerFrom'
  34. }, {
  35. code: 'fitupType',
  36. pullType: 'mSelect',
  37. typeName: 'fitupType'
  38. }, {
  39. code: 'houseType',
  40. pullType: 'mSelect',
  41. typeName: 'houseType'
  42. }, {
  43. code: 'ageComposition',
  44. pullType: 'mSelect',
  45. typeName: 'ageComposition'
  46. }],
  47. // 列表区(脚部信息)
  48. footerInfo: [{
  49. prefix: '跟进',
  50. name: 'followCount',
  51. title: '次',
  52. different: '从未跟进 | 逾期未跟进',
  53. color: 'red'
  54. },],
  55. // 列表区(内容)
  56. contentList: [
  57. { name: 'cusPhone', title: '客户电话', phone: true },
  58. { name: 'addressFull', title: '客户地址' },
  59. {
  60. name: [{ name: 'orgName', title: '' },
  61. { name: 'staffName', title: '业务员' }], title: '门店信息'
  62. },
  63. { name: 'nextFollowTime', title: '提醒时间' }
  64. ],
  65. contentObj: {
  66. '成交': [
  67. { name: 'orderNo', title: '订单单号' },
  68. {
  69. name: [{ name: 'orgName', title: '' }, { name: 'staffName', title: '业务员' }
  70. ],
  71. title: '客户地址'
  72. }],
  73. '未成交': [{
  74. name: 'orderNo',
  75. title: '订单单号'
  76. }, {
  77. name: 'customerPhone',
  78. title: '客户电话'
  79. }, {
  80. name: [{
  81. name: 'orgName',
  82. title: ''
  83. }, {
  84. name: 'staffName',
  85. title: '业务员'
  86. }],
  87. title: '客户地址'
  88. }]
  89. },
  90. // 弹出按钮
  91. buttonList: [
  92. { name: 'followUp', title: '客户跟进' },
  93. { name: 'followUpTasks', title: '跟进任务' },
  94. { name: 'customerRefundList', title: '客户收款' }
  95. ],
  96. totallength: 0, //视图下方提醒数量
  97. // 路由
  98. routeObjName: 'customer',
  99. active: 0,
  100. saleStatus: '销售状态-潜客',
  101. },
  102. /**
  103. * @desc : 切换
  104. * @date : 2024/2/1 15:49
  105. * @author : 于继渤
  106. */
  107. onChangeTabs(e) {
  108. let code = e.detail.detail.code
  109. this.setData({
  110. saleStatus: code,
  111. })
  112. this.searchData()
  113. },
  114. /**
  115. * @desc : 详细页面
  116. * @date : 2024/2/1 15:49
  117. * @author : 于继渤
  118. */
  119. toDetail(e) {
  120. let cusId = e.detail.item.cusId
  121. this.setData({
  122. selectflag: true
  123. })
  124. wx.navigateTo({
  125. url: this.data.route.detail.url,
  126. success: function (res) {
  127. // 通过eventChannel向被打开页面传送数据 TODO 测试例子url是写死的,实际中,需要从route中读取
  128. res.eventChannel.emit('params', { id: cusId, formMode: Constants.formMode.edit })
  129. }
  130. })
  131. },
  132. /**
  133. * @desc : 设置查询参数
  134. * @date : 2024/2/1 15:49
  135. * @author : 于继渤
  136. */
  137. setSearchParams(params) {
  138. //销售状态
  139. params.saleStatus = this.data.saleStatus == 'all' ? '' : this.data.saleStatus
  140. return params
  141. },
  142. /**
  143. * @desc : 查询
  144. * @date : 2024/2/1 15:49
  145. * @author : 于继渤
  146. */
  147. getData(params) {
  148. return this.excute(this.data.service, this.data.service.selectByCond, params);
  149. },
  150. /**
  151. * 生命周期函数--监听页面加载
  152. */
  153. onLoad: function (options) {
  154. },
  155. /**
  156. * 生命周期函数--监听页面显示
  157. */
  158. onShow: function () {
  159. if (this.data.refreshDataFlag) {
  160. this.searchData()
  161. }
  162. },
  163. })