dataOverview.js 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. options: {
  4. addGlobalClass: true,
  5. },
  6. properties: {
  7. update: {
  8. type: Function
  9. }
  10. },
  11. lifetimes: {
  12. attached: function () {
  13. getApp().globalData.Language.getLanguagePackage(this)
  14. this.setData({
  15. dates: this.data.dates.map(v => {
  16. v.name = getApp().globalData.Language.getMapText(v.value);
  17. v.color = v.value == this.data.content.dateType ? "#3874F6" : "";
  18. return v
  19. })
  20. })
  21. }
  22. },
  23. data: {
  24. "content": {
  25. dateType: "本年",
  26. dataid: wx.getStorageSync('userMsg').userid,
  27. type: 0,
  28. username: wx.getStorageSync('userMsg').name,
  29. "where": {
  30. isleave: "1"
  31. }
  32. },
  33. detaShow: false,
  34. dates: [{
  35. value: "全部"
  36. }, {
  37. value: "本年"
  38. }, {
  39. value: "本季"
  40. }, {
  41. value: "本月"
  42. }, {
  43. value: "去年"
  44. }, ],
  45. },
  46. methods: {
  47. getList() {
  48. let content = this.data.content;
  49. _Http.basic({
  50. "id": 20231014114204,
  51. content
  52. }).then(res => {
  53. console.log("线索数据概况", res)
  54. if (res.code != '1') return wx.showToast({
  55. title: res.msg,
  56. icon: "none"
  57. })
  58. const getMapText = getApp().globalData.Language.getMapText;
  59. let list = [{
  60. title: '线索总数',
  61. value: res.data.total,
  62. tips: getMapText('线索总数:包含待分配、已分配线索数。'),
  63. link: true
  64. },
  65. {
  66. title: '待分配未过期线索数',
  67. value: res.data.dfp,
  68. tips: getMapText('待分配未过期线索数:所有线索中,待分配未过期的线索数量。'),
  69. link: true
  70. },
  71. {
  72. title: '待跟进线索数',
  73. value: res.data.dgj,
  74. tips: getMapText('待跟进线索数:销售线索应用中,已分配给业务员,待跟进状态的线索数量。'),
  75. link: true
  76. },
  77. {
  78. title: '跟进中线索数',
  79. value: res.data.gjz,
  80. tips: getMapText('跟进中线索数:销售线索应用中,已分配给业务员,跟进中状态的线索数量。'),
  81. link: true
  82. },
  83. {
  84. title: '已转化线索数',
  85. value: res.data.yzh,
  86. tips: getMapText("①已转化线索数:销售线索应用中,已分配给业务员,已转化状态的线索数量。") + '\n\n' + getMapText('②一条线索可进行两次转化:转化客户、转化项目,因此,已转化线索数≠转化客户线索数+转化项目线索数。'),
  87. link: true
  88. },
  89. {
  90. title: '已无效线索数',
  91. value: res.data.ywx,
  92. tips: getMapText("已无效线索数:销售线索应用中,已分配给业务员,已无效状态的线索数量。"),
  93. link: true
  94. },
  95. {
  96. title: '待分配已过期线索数',
  97. value: res.data.ygq,
  98. tips: getMapText('待分配已过期线索数:所有线索中,待分配已过期的线索数量。'),
  99. link: true
  100. },
  101. {
  102. title: '过期比例',
  103. value: Math.round(((res.data.gqbl * 100) * 100) / 100) + '%',
  104. tips: getMapText('过期比例=已过期线索数÷待分配线索数×100%'),
  105. link: false
  106. },
  107. {
  108. title: '转化客户线索数',
  109. value: res.data.covercusomers,
  110. tips: getMapText('转化客户线索数:统计有转化客户操作的线索数'),
  111. link: true
  112. },
  113. {
  114. title: '转化项目线索数',
  115. value: res.data.coverproject,
  116. tips: getMapText('转化客户线索数:统计有转化项目操作的线索数'),
  117. link: true
  118. },
  119. {
  120. title: '线索转化率',
  121. value: Math.round(((res.data.zhl * 100) * 100) / 100) + '%',
  122. tips: getMapText('线索转化率=已转化线索数÷线索总数×100%'),
  123. link: false
  124. },
  125. {
  126. title: '线索成交数',
  127. value: res.data.dealqty,
  128. tips: getMapText('线索成交数:转化后有下订单的线索数量'),
  129. link: true
  130. },
  131. {
  132. title: '线索成交率',
  133. value: Math.round(((res.data.cjl * 100) * 100) / 100) + '%',
  134. tips: getMapText('线索成交率=转化后有下订单的线索数÷线索总数×100%'),
  135. link: false
  136. },
  137. {
  138. title: '参与线索数',
  139. value: res.data.joinordercluesize,
  140. tips: getMapText('参与线索数:参与的并且至少有一次跟进的线索数量'),
  141. link: true
  142. },
  143. {
  144. title: '参与线索转化数',
  145. value: res.data.joincoverorderclue,
  146. tips: getMapText('参与线索转化数:参与的并且至少有一次跟进的有发生转化的线索数量'),
  147. link: true
  148. },
  149. {
  150. title: '参与线索转化率',
  151. value: Math.round(((res.data.joinordercluezhl * 100) * 100) / 100) + '%',
  152. tips: getMapText('参与线索转化率=参与线索转化数 ÷ 参与线索数 ×100%'),
  153. link: false
  154. },
  155. {
  156. title: '参与线索成交数',
  157. value: res.data.joindealorderclue,
  158. tips: getMapText('参与线索成交数:参与的并且至少有一次跟进的转化后有下订单的线索数量'),
  159. link: true
  160. },
  161. {
  162. title: '参与线索成交率',
  163. value: Math.round(((res.data.joinordercluecjl * 100) * 100) / 100) + '%',
  164. tips: getMapText('参与线索成交率=参与线索成交率 ÷ 参与线索数 ×100%'),
  165. link: false
  166. },
  167. ]
  168. this.setData({
  169. list,
  170. content
  171. })
  172. this.onCancel()
  173. })
  174. },
  175. showTips(e) {
  176. const {
  177. tips
  178. } = e.currentTarget.dataset;
  179. wx.showModal({
  180. content: tips,
  181. showCancel: false,
  182. confirmText: getApp().globalData.Language.getMapText('确定'),
  183. })
  184. },
  185. toDetail(e) {
  186. const {
  187. item
  188. } = e.currentTarget.dataset;
  189. },
  190. openDateType() {
  191. this.setData({
  192. detaShow: true
  193. })
  194. },
  195. dateOnSelect(event) {
  196. const {
  197. value
  198. } = event.detail;
  199. if (this.data.content.dateType == value) return this.onCancel();
  200. this.setData({
  201. "content.dateType": value,
  202. dates: this.data.dates.map(item => {
  203. item.color = item.value == value ? "#3874F6" : "";
  204. item.loading = item.value == value ? true : false;
  205. return item
  206. }),
  207. })
  208. this.getList(true)
  209. },
  210. onCancel() {
  211. this.setData({
  212. actionShow: false,
  213. detaShow: false,
  214. list: this.data.list.map(item => {
  215. item.loading = false;
  216. return item
  217. }),
  218. dates: this.data.dates.map(item => {
  219. item.loading = false;
  220. return item
  221. })
  222. })
  223. },
  224. }
  225. })