customer-list.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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: mixins.$t('potentialCus'), code: mixins.$t('salePotentialCus') }, { title: mixins.$t('seasCus'), code: mixins.$t('saleSeasCus') }, { title: mixins.$t('dealCus'), code: mixins.$t('saleDealCus') }, { title: mixins.$t('allCus'), code: 'all' }],
  20. // 查询条件
  21. searchContent: [
  22. { code: 'createtime', title: mixins.$t('pastThirthtyDays'), defaultValue: 5, searchType: Constants.searchType.date },
  23. { code: 'staff', title: mixins.$t("staffId"), dropType: 'staff' },
  24. { code: 'org', title: mixins.$t("orgId"), dropType: 'org' },
  25. { code: 'choose', title: mixins.$t('choose'), searchType: Constants.searchType.pick }
  26. ],
  27. buttonSaveList: [{ code: 'add', title: mixins.$t('add') }],
  28. contentSaveList: [{ code: 'need', title: mixins.$t('together'), type: 'count', color: '#1B365D', tail: mixins.$t('customers'), bill: 1, fontSize: '15px' }],
  29. // 查询条件-筛选
  30. pullMenuList: [
  31. { code: 'cusFrom', pullType: 'mSelect', typeName: 'cusFrom' },
  32. { code: 'followCount', dataType: 'number' },
  33. { code: 'nextFollowTime', dataType: 'date' }
  34. ],
  35. // 列表区(脚部信息)
  36. footerInfo: [{
  37. prefix: mixins.$t('followedUp'),
  38. name: 'followCount',
  39. title: mixins.$t('next'),
  40. different: mixins.$t('notFollowedUp'),
  41. color: 'red'
  42. },],
  43. // 列表区(内容)
  44. contentList: [
  45. { name: 'cusPhone', title: mixins.$t('cusPhone'), phone: true },
  46. { name: 'addressFull', title: mixins.$t('addressFull') },
  47. {
  48. name: [{ name: 'orgName', title: '' },
  49. { name: 'staffName', title: '' }], title: mixins.$t('storeInformation')
  50. },
  51. { name: 'nextFollowTime', title: mixins.$t('nextFollowTime') }
  52. ],
  53. // 弹出按钮
  54. buttonList: [
  55. { name: 'followUp', title: mixins.$t('followUp') },
  56. { name: 'followUpTasks', title: mixins.$t('followUpTasks') },
  57. { name: 'collection', title: mixins.$t("cusCollection"), idKey: 'cusId' },//跳转客户收款
  58. ],
  59. totallength: 0, //视图下方提醒数量
  60. // 路由
  61. routeObjName: 'customer',
  62. active: 0,
  63. saleStatus: mixins.$t('salePotentialCus'),
  64. },
  65. /**
  66. * @desc : 切换
  67. * @date : 2024/2/1 15:49
  68. * @author : 于继渤
  69. */
  70. onChangeTabs(e) {
  71. let code = e.detail.detail.code
  72. this.setData({
  73. saleStatus: code,
  74. })
  75. this.searchData()
  76. },
  77. /**
  78. * @desc : 详细页面
  79. * @date : 2024/2/1 15:49
  80. * @author : 于继渤
  81. */
  82. toDetail(e) {
  83. let cusId = e.detail.item.cusId
  84. this.setData({
  85. selectflag: true
  86. })
  87. wx.navigateTo({
  88. url: this.data.route.detail.url,
  89. success: function (res) {
  90. // 通过eventChannel向被打开页面传送数据 TODO 测试例子url是写死的,实际中,需要从route中读取
  91. res.eventChannel.emit('params', { id: cusId, formMode: Constants.formMode.edit })
  92. }
  93. })
  94. },
  95. /**
  96. * @desc : 设置查询参数
  97. * @date : 2024/2/1 15:49
  98. * @author : 于继渤
  99. */
  100. setSearchParams(params) {
  101. //销售状态
  102. params.saleStatus = this.data.saleStatus == 'all' ? '' : this.data.saleStatus
  103. return params
  104. },
  105. /**
  106. * @desc : 处理接口返回数据
  107. * @date : 2024/2/1 15:49
  108. * @author : 于继渤
  109. */
  110. handleSearchData(tableData) {
  111. let contentSaveList = this.data.contentSaveList
  112. contentSaveList[0].bill = tableData.length
  113. this.setData({
  114. contentSaveList: contentSaveList
  115. })
  116. },
  117. /**
  118. * @desc : 查询
  119. * @date : 2024/2/1 15:49
  120. * @author : 于继渤
  121. */
  122. getData(params) {
  123. return this.excute(this.data.service, this.data.service.selectByCond, params);
  124. },
  125. /**
  126. * 生命周期函数--监听页面加载
  127. */
  128. onLoad: function (options) {
  129. },
  130. /**
  131. * 生命周期函数--监听页面显示
  132. */
  133. onShow: function () {
  134. if (this.data.refreshDataFlag) {
  135. this.searchData()
  136. }
  137. },
  138. })