index.vue 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799
  1. <template>
  2. <div style="background: #f8f8f8;">
  3. <normal-layout>
  4. <template #refresh>
  5. <el-button size="mini" type="text" style="margin-right: 15px;color: #3874f6;font-size: 14px" @click="toTop">{{ $t('返回顶部') }}</el-button>
  6. </template>
  7. <template #content>
  8. <div style="overflow: auto;height: calc(100vh - 220px)" ref="rollRef" @scroll="handleScroll">
  9. <div style="display: flex;justify-content: space-between;margin: 10px 24px 20px 24px;">
  10. <depStatus ref="allDepRef" @depData="depData" @personData="depData" @leaveData="depData"></depStatus>
  11. <div>
  12. <btnSelect :btn-title="['全部','本年','本季','本月','上月','去年']" :date-type="dateType" @btnClick="btnClick"></btnSelect>
  13. </div>
  14. </div>
  15. <!-- 数据概况 -->
  16. <dataBoard title="联系人数据概况" :mainData="maninInfo" heightNew="145px" @goDetail="goDetail"></dataBoard>
  17. <dataDetail ref="detailRef" :param="paramDetail" :person="person" :departmentid="depment" :layout="tablecols" :title="detailTitle" :titleHeader="titleHeader" height="calc(100vh - 225px)" tableType="联系人数据概况">
  18. <template slot="custom">
  19. <div class="mt-10 inline-16">
  20. <p class="search__label">{{$t('状态')}}:</p>
  21. <el-select v-model="isleave" clearable style="margin-right:10px" size="small" :placeholder="$t('请选择状态')" @change="leaveChange" disabled>
  22. <el-option :label="$t('在职')" value="1"></el-option>
  23. <el-option :label="$t('离职')" value="2"></el-option>
  24. </el-select>
  25. </div>
  26. <div class="inline-16 mt-10" v-if="titleHeader == '关联客户数'">
  27. <label class="search__label">{{ $t("客户类型") }}:</label>
  28. <el-select
  29. class="inline-16"
  30. v-model="paramDetail.content.where.type"
  31. size="small"
  32. :placeholder="$t('请选择')"
  33. @change="selectChange"
  34. clearable
  35. >
  36. <el-option
  37. v-for="item in option.typeData"
  38. :key="item.value"
  39. :label="$t(item.value)"
  40. :value="item.value"
  41. >
  42. </el-option>
  43. </el-select>
  44. </div>
  45. <div class="mt-10 inline-16" v-if="titleHeader == '关联客户数'">
  46. <label class="search__label">{{ $t("合作状态") }}:</label>
  47. <el-select
  48. class="inline-16"
  49. v-model="paramDetail.content.where.status"
  50. size="small"
  51. :placeholder="$t('请选择')"
  52. @change="selectChange"
  53. clearable
  54. >
  55. <el-option
  56. v-for="item in option.status"
  57. :key="item.value"
  58. :label="$t(item.value)"
  59. :value="item.value"
  60. >
  61. </el-option>
  62. </el-select>
  63. </div>
  64. <div class="mt-10 inline-16" v-if="titleHeader == '关联客户数'">
  65. <label class="search__label">{{ $t("成交状态") }}:</label>
  66. <el-select
  67. class="inline-16"
  68. v-model="paramDetail.content.where.tradingstatus"
  69. size="small"
  70. :placeholder="$t('请选择')"
  71. @change="selectChange"
  72. clearable
  73. >
  74. <el-option
  75. v-for="item in option.tradingstatus"
  76. :key="item.value"
  77. :label="$t(item.value)"
  78. :value="item.value"
  79. >
  80. </el-option>
  81. </el-select>
  82. </div>
  83. <div class="mt-10 inline-16" v-if="titleHeader == '关联项目数'">
  84. <label class="search__label">{{$t(`项目阶段`)}}:</label>
  85. <el-select class="inline-16" v-model="paramDetail.content.where.stagename" :placeholder="$t(`请选择项目阶段`)" @change="selectChange" size="small" clearable>
  86. <el-option
  87. v-for="item in option.stageList"
  88. :key="item.stagename"
  89. :label="$t(item.stagename)"
  90. :value="item.stagename">
  91. </el-option>
  92. </el-select>
  93. </div>
  94. <div class="mt-10 inline-16" v-if="titleHeader == '关联项目数'">
  95. <label class="search__label">{{$t(`报备进度`)}}:</label>
  96. <el-select class="inline-16" v-model="paramDetail.content.where.reportstatus" :placeholder="$t(`请选择报备进度`)" @change="selectChange" size="small" clearable>
  97. <el-option
  98. v-for="item in option.reportstatus"
  99. :key="item.value"
  100. :label="$t(item.label)"
  101. :value="item.value">
  102. </el-option>
  103. </el-select>
  104. </div>
  105. <div class="mt-10 inline-16" v-if="titleHeader == '关联项目数'">
  106. <label class="search__label">{{$t(`项目类型`)}}:</label>
  107. <el-select class="inline-16" v-model="paramDetail.content.where.projecttype" :placeholder="$t('请选择项目类型')" @change="selectChange" size="small" clearable>
  108. <el-option
  109. v-for="item in projectType"
  110. :key="item.value"
  111. :label="$t(item.value)"
  112. :value="item.value">
  113. <span style="float: left">{{ $t(item.value) }}</span>
  114. <span style="float: right; color: #8492a6; font-size: 12px">{{ item.remarks?$t(item.remarks):$t('暂无描述') }}</span>
  115. </el-option>
  116. </el-select>
  117. </div>
  118. <div class="mt-10 inline-16" v-if="titleHeader == '关联项目数' || titleHeader == '关联客户成交金额'">
  119. <label class="search__label">{{$t('领域')}}:</label>
  120. <el-select class="inline-16" v-model="paramDetail.content.where.tradefield" :placeholder="$t('请选择领域')" @change="selectChange" size="small" clearable>
  121. <el-option
  122. v-for="item in tradefieldSelect"
  123. :key="item.value"
  124. :label="$t(item.value)"
  125. :value="item.value">
  126. <span style="float: left">{{ $t(item.value) }}</span>
  127. <span style="float: right; color: #8492a6; font-size: 12px">{{ item.remarks?$t(item.remarks):$t('暂无描述') }}</span>
  128. </el-option>
  129. </el-select>
  130. </div>
  131. <div class="inline-16 mt-10" v-if="titleHeader == '联系人总数' || titleHeader == '关联项目数' || titleHeader == '关联客户数'">
  132. <span class="search__label">{{$t('标签')}}:</span>
  133. <el-select v-model="tags" :placeholder="$t('请选择标签')" size="small" @change="selectChange" clearable @clear="selectChange" filterable class="inline-16" multiple>
  134. <el-option
  135. v-for="item in tagList"
  136. :key="item.index"
  137. :label="$t(item.tag)"
  138. :value="item.tag"
  139. :disabled="hasDisabledTag(item)">
  140. </el-option>
  141. </el-select>
  142. </div>
  143. <div class="mt-10 inline-16" v-if="titleHeader == '关联项目数'">
  144. <label class="search__label">{{$t(`项目状态`)}}:</label>
  145. <el-select class="inline-24" v-model="paramDetail.content.where.status" :placeholder="$t(`请选择项目状态`)" @change="selectChange" size="small" clearable>
  146. <el-option
  147. v-for="item in option.statusTab"
  148. :key="item.value"
  149. :label="$t(item.label)"
  150. :value="item.value">
  151. </el-option>
  152. </el-select>
  153. </div>
  154. <div class="inline-16" v-if="titleHeader == '联系人总数'">
  155. <label class="search__label">{{ $t('关联') }}:</label>
  156. <el-select v-model="paramDetail.content.where.contactstype" :placeholder="$t('请选择关联')" size="small" @change="selectChange" clearable @clear="selectChange" class="inline-16">
  157. <el-option :label="$t(`关联线索`)" value="关联线索"></el-option>
  158. <el-option :label="$t(`关联客户`)" value="关联客户"></el-option>
  159. <el-option :label="$t(`关联项目`)" value="关联项目"></el-option>
  160. </el-select>
  161. </div>
  162. </template>
  163. </dataDetail>
  164. <!-- 联系人销售贡献度排行 -->
  165. <salesContribution class="mt-10" ref="salesContributionRef"></salesContribution>
  166. <!-- 近12月联系人新增分析 -->
  167. <contactsAddAnalysis class="mt-10" ref="contactsAddAnalysisRef"></contactsAddAnalysis>
  168. <!-- 联系人关联线索情况统计 -->
  169. <statisticsOfClues class="mt-10" ref="statisticsOfCluesRef" :windowWidth="windowWidth"></statisticsOfClues>
  170. <!-- 联系人关联客户情况统计 -->
  171. <statisticsOfCustomer class="mt-10" ref="statisticsOfCustomerRef" :windowWidth="windowWidth"></statisticsOfCustomer>
  172. <!-- 联系人关联项目情况统计 -->
  173. <statisticsOfProject class="mt-10" ref="statisticsOfProjectRef" :windowWidth="windowWidth"></statisticsOfProject>
  174. <!-- 联系人跟进情况统计 -->
  175. <statisticsOfFollow class="mt-10" ref="statisticsOfFollowRef" :windowWidth="windowWidth"></statisticsOfFollow>
  176. <!-- 近12月联系人跟进分析 -->
  177. <contactsFollowAnalysis class="mt-10" ref="contactsFollowAnalysisRef"></contactsFollowAnalysis>
  178. <!-- 联系人未跟进天数分析 -->
  179. <statisticsOfUnFollow class="mt-10" ref="statisticsOfUnFollowRef"></statisticsOfUnFollow>
  180. </div>
  181. </template>
  182. </normal-layout>
  183. </div>
  184. </template>
  185. <script>
  186. import normalLayout from '@/components/normal-basic-layout/normalNew'
  187. import btnSelect from "@/components/btn_select/btnSelect";
  188. import dataBoard from '@/components/dataBoard/index'
  189. import dataDetail from '@/template/dataDetail/index'
  190. import salesContribution from './components/salesContribution'
  191. import depStatus from './components/depStatus'
  192. import contactsAddAnalysis from './components/contactsAddAnalysis'
  193. import contactsFollowAnalysis from './components/contactsFollowAnalysis'
  194. import statisticsOfClues from './components/statisticsOfClues'
  195. import statisticsOfCustomer from './components/statisticsOfCustomer'
  196. import statisticsOfProject from './components/statisticsOfProject'
  197. import statisticsOfFollow from './components/statisticsOfFollow'
  198. import statisticsOfUnFollow from './components/statisticsOfUnFollow'
  199. export default {
  200. name: "index",
  201. components:{normalLayout,btnSelect,dataBoard,dataDetail,salesContribution,depStatus,contactsAddAnalysis,contactsFollowAnalysis,statisticsOfClues,statisticsOfCustomer,statisticsOfProject,
  202. statisticsOfFollow,statisticsOfUnFollow},
  203. data(){
  204. return {
  205. scrollData:'',
  206. depment:'',
  207. person:'',
  208. isleave:'1',
  209. deplist:[],
  210. personnelList:[],
  211. depmentParam:{
  212. "id": 20230620102004,
  213. "content": {
  214. "isleave":1
  215. }
  216. },
  217. dateType:'本年',
  218. windowWidth: document.documentElement.clientWidth, //实时屏幕宽度
  219. userName:JSON.parse(window.sessionStorage.getItem('active_account')).name,
  220. mainData:'',
  221. paramMain:{
  222. "id": 2025072114302202,
  223. "content": {
  224. "type": 1,
  225. "dataid": 58,
  226. "dateType": "全部",
  227. "where": {
  228. "isleave": "1"
  229. }
  230. },
  231. },
  232. maninInfo:'',
  233. paramDetail:{
  234. "id": 2025072213574102,
  235. "content": {
  236. "type": 1,
  237. "dataid": 58,
  238. "dateType": "本年",
  239. "pageNumber":1,
  240. "pageSize":100,
  241. "where": {
  242. "isleave": "",
  243. "condition": "",
  244. "tag": [],
  245. "contactstype": "", //关联线索,关联客户,关联项目
  246. "type":"",
  247. "status":"",
  248. "tradingstatus":"",
  249. "stagename":'',
  250. "projecttype":'',
  251. "tradefield":'',
  252. "reportstatus":''
  253. }
  254. },
  255. },
  256. tablecols:'',
  257. detailTitle:'',
  258. tagList:[],
  259. tags:[],
  260. titleHeader:'',
  261. projectType:[],
  262. tradefieldSelect:[],
  263. option: {
  264. typeData: [],
  265. customerClassification: [],
  266. customerGrade: [],
  267. industryData: [],
  268. tagData: [],
  269. stageList:[],
  270. status: [
  271. {
  272. value: "潜在",
  273. },
  274. {
  275. value: "合作中",
  276. },
  277. {
  278. value: "暂缓",
  279. },
  280. {
  281. value: "已终止",
  282. },
  283. ],
  284. tradingstatus: [
  285. {
  286. value: "未成交",
  287. },
  288. {
  289. value: "已成交",
  290. },
  291. {
  292. value: "多次成交",
  293. },
  294. ],
  295. reportstatus:[
  296. {
  297. value:"未报备",
  298. label:"未报备"
  299. },
  300. {
  301. value:"报备中",
  302. label:"报备中"
  303. },
  304. {
  305. value:"已报备",
  306. label:"已报备"
  307. },
  308. ],
  309. statusTab:[
  310. {
  311. value:"跟进中",
  312. label:"跟进中"
  313. },
  314. {
  315. value:"已成交",
  316. label:"已成交"
  317. },
  318. {
  319. value:"已失败",
  320. label:"已失败"
  321. },
  322. {
  323. value:"已结案",
  324. label:"已结案"
  325. }
  326. ],
  327. },
  328. }
  329. },
  330. watch: {
  331. windowWidth (val) {
  332. console.log("实时屏幕宽度:",val );
  333. }
  334. },
  335. methods:{
  336. /*返回顶部*/
  337. toTop(){
  338. this.$refs.rollRef.scrollTop = 0
  339. },
  340. /*滚动条*/
  341. handleScroll(){
  342. this.scrollData = this.$refs.rollRef.scrollTop
  343. },
  344. /*部门人员列表*/
  345. async departmentrtment() {
  346. const res = await this.$api.requested(this.depmentParam)
  347. this.deplist = this.createMenu(res.data.dep)
  348. this.$refs.allDepRef.deplist = this.deplist
  349. this.$refs.salesContributionRef.$refs.depStatusCusRef.deplist = this.deplist
  350. this.$refs.salesContributionRef.$refs.depStatusProRef.deplist = this.deplist
  351. this.$refs.contactsAddAnalysisRef.$refs.dataTemPlateRef.$refs.depStatusRef.deplist = this.deplist
  352. this.$refs.contactsFollowAnalysisRef.$refs.dataTemPlateRef.$refs.depStatusRef.deplist = this.deplist
  353. this.$refs.statisticsOfCluesRef.$refs.dataTemPlateRef.$refs.depStatusRef.deplist = this.deplist
  354. this.$refs.statisticsOfCustomerRef.$refs.dataTemPlateRef.$refs.depStatusRef.deplist = this.deplist
  355. this.$refs.statisticsOfProjectRef.$refs.dataTemPlateRef.$refs.depStatusRef.deplist = this.deplist
  356. this.$refs.statisticsOfFollowRef.$refs.dataTemPlateRef.$refs.depStatusRef.deplist = this.deplist
  357. this.$refs.statisticsOfUnFollowRef.$refs.dataTemPlateRef.$refs.depStatusRef.deplist = this.deplist
  358. this.personnelList = res.data.hr
  359. this.$refs.allDepRef.personnelList = this.personnelList
  360. this.$refs.salesContributionRef.$refs.depStatusCusRef.personnelList = this.personnelList
  361. this.$refs.salesContributionRef.$refs.depStatusProRef.personnelList = this.personnelList
  362. this.$refs.contactsAddAnalysisRef.$refs.dataTemPlateRef.$refs.depStatusRef.personnelList = this.personnelList
  363. this.$refs.contactsFollowAnalysisRef.$refs.dataTemPlateRef.$refs.depStatusRef.personnelList = this.personnelList
  364. this.$refs.statisticsOfCluesRef.$refs.dataTemPlateRef.$refs.depStatusRef.personnelList = this.personnelList
  365. this.$refs.statisticsOfCustomerRef.$refs.dataTemPlateRef.$refs.depStatusRef.personnelList = this.personnelList
  366. this.$refs.statisticsOfProjectRef.$refs.dataTemPlateRef.$refs.depStatusRef.personnelList = this.personnelList
  367. this.$refs.statisticsOfFollowRef.$refs.dataTemPlateRef.$refs.depStatusRef.personnelList = this.personnelList
  368. this.$refs.statisticsOfUnFollowRef.$refs.dataTemPlateRef.$refs.depStatusRef.personnelList = this.personnelList
  369. this.depment = ''
  370. this.$refs.allDepRef.depment = this.depment
  371. this.$refs.salesContributionRef.$refs.depStatusCusRef.depment = this.depment
  372. this.$refs.salesContributionRef.$refs.depStatusProRef.depment = this.depment
  373. this.$refs.contactsAddAnalysisRef.$refs.dataTemPlateRef.$refs.depStatusRef.depment = this.depment
  374. this.$refs.contactsFollowAnalysisRef.$refs.dataTemPlateRef.$refs.depStatusRef.depment = this.depment
  375. this.$refs.statisticsOfCluesRef.$refs.dataTemPlateRef.$refs.depStatusRef.depment = this.depment
  376. this.$refs.statisticsOfCustomerRef.$refs.dataTemPlateRef.$refs.depStatusRef.depment = this.depment
  377. this.$refs.statisticsOfProjectRef.$refs.dataTemPlateRef.$refs.depStatusRef.depment = this.depment
  378. this.$refs.statisticsOfFollowRef.$refs.dataTemPlateRef.$refs.depStatusRef.depment = this.depment
  379. this.$refs.statisticsOfUnFollowRef.$refs.dataTemPlateRef.$refs.depStatusRef.depment = this.depment
  380. this.person = JSON.parse(window.sessionStorage.getItem('active_account')).name
  381. this.$refs.allDepRef.person = this.person
  382. this.$refs.salesContributionRef.$refs.depStatusCusRef.person = this.person
  383. this.$refs.salesContributionRef.$refs.depStatusProRef.person = this.person
  384. this.$refs.contactsAddAnalysisRef.$refs.dataTemPlateRef.$refs.depStatusRef.person = this.person
  385. this.$refs.contactsFollowAnalysisRef.$refs.dataTemPlateRef.$refs.depStatusRef.person = this.person
  386. this.$refs.statisticsOfCluesRef.$refs.dataTemPlateRef.$refs.depStatusRef.person = this.person
  387. this.$refs.statisticsOfCustomerRef.$refs.dataTemPlateRef.$refs.depStatusRef.person = this.person
  388. this.$refs.statisticsOfProjectRef.$refs.dataTemPlateRef.$refs.depStatusRef.person = this.person
  389. this.$refs.statisticsOfFollowRef.$refs.dataTemPlateRef.$refs.depStatusRef.person = this.person
  390. this.$refs.statisticsOfUnFollowRef.$refs.dataTemPlateRef.$refs.depStatusRef.person = this.person
  391. const userid = JSON.parse(sessionStorage.getItem('active_account')).userid
  392. this.otherMethod(userid)
  393. },
  394. /*部门结构处理*/
  395. createMenu (array) {
  396. var that = this
  397. let arr = []
  398. function convertToElementTree(node) {
  399. // 新节点
  400. if (node.subdep.length === 0){
  401. var elNode = {
  402. label: node["depname"],
  403. parentid:node['parentid'],
  404. parentname:node['parentname'],
  405. departmentid:node["departmentid"],
  406. value:node["departmentid"],
  407. remarks:node["remarks"],
  408. isused:node["isused"],
  409. changedate:node['changedate'],
  410. changeby:node['changeby'],
  411. createdate:node['createdate'],
  412. createby:node['createby'],
  413. depno:node['depno'],
  414. disabled:that.pageOnlyRead,
  415. }
  416. }else {
  417. var elNode = {
  418. label: node["depname"],
  419. parentid:node['parentid'],
  420. parentname:node['parentname'],
  421. departmentid:node["departmentid"],
  422. value:node["departmentid"],
  423. remarks:node["remarks"],
  424. isused:node["isused"],
  425. changedate:node['changedate'],
  426. changeby:node['changeby'],
  427. createdate:node['createdate'],
  428. createby:node['createby'],
  429. depno:node['depno'],
  430. disabled:that.pageOnlyRead,
  431. children: []
  432. }
  433. }
  434. if (node.subdep && node.subdep.length > 0) {
  435. // 如果存在子节点
  436. for (var index = 0; index < node.subdep.length; index++) {
  437. // 遍历子节点, 把每个子节点看做一颗独立的树, 传入递归构造子树, 并把结果放回到新node的children中
  438. elNode.children.push(convertToElementTree(node.subdep[index]));
  439. }
  440. }
  441. return elNode;
  442. }
  443. array.forEach((element) => {
  444. arr.push(convertToElementTree(element))
  445. });
  446. return arr
  447. },
  448. /*选择部门*/
  449. selectDep(val) {
  450. if (val.length === 0){
  451. const userid = JSON.parse(sessionStorage.getItem('active_account')).userid
  452. this.otherModel(userid,'0')
  453. }else {
  454. this.person = ''
  455. this.departmentid = val[val.length -1]
  456. this.otherModel(this.departmentid,'1',this.isleave)
  457. }
  458. },
  459. /*选择人员*/
  460. selectPerson(val){
  461. this.depment = ''
  462. this.departmentid = ''
  463. this.dataid = val
  464. this.otherModel(val,'0',this.isleave)
  465. },
  466. /*选择在职状态*/
  467. leaveChange(){
  468. this.person = ''
  469. const type = this.depment?'1':'0'
  470. const dataid = type == 0?-1:this.departmentid
  471. this.otherModel(dataid,type,this.isleave,'状态')
  472. this.personData()
  473. },
  474. /*获取新的业务员列表*/
  475. async personData(){
  476. let param = {
  477. id: 20230620102004,
  478. content: {
  479. isleave:this.isleave
  480. },
  481. }
  482. const res = await this.$api.requested(param)
  483. this.personnelList = res.data.hr
  484. },
  485. /*切换时间*/
  486. btnClick(data){
  487. this.dateType = data
  488. this.queryMainData(this.paramMain.content.dataid,data)
  489. },
  490. /*选择部门*/
  491. depData(id,type,isleave,state){
  492. this.otherModel(id,type,isleave,state)
  493. },
  494. /*其他页面首次调用*/
  495. otherMethod(dataid){
  496. const userName = JSON.parse(sessionStorage.getItem('active_account')).name
  497. /*联系人数据概况*/
  498. this.paramMain.content.type = '0'
  499. this.queryMainData(dataid,this.dateType)
  500. this.$refs.salesContributionRef.paramCus.content.dateType = '本年'
  501. this.$refs.salesContributionRef.paramPro.content.dateType = '本年'
  502. this.$refs.salesContributionRef.listData(dataid,0,1)
  503. this.$refs.contactsAddAnalysisRef.listData(0,dataid,1,null,true)
  504. this.$refs.contactsFollowAnalysisRef.listData(0,dataid,1,null,true)
  505. this.$refs.statisticsOfCluesRef.paramTable.content.pageNumber = 1
  506. this.$refs.statisticsOfCluesRef.listData(dataid,0,1,null,true)
  507. this.$refs.statisticsOfCustomerRef.listData(dataid,0,1,null,true)
  508. this.$refs.statisticsOfProjectRef.listData(dataid,0,1,null,true)
  509. this.$refs.statisticsOfFollowRef.listData(dataid,0,1,null,true)
  510. this.$refs.statisticsOfUnFollowRef.listData(dataid,0,1,null,true)
  511. },
  512. /*其他页面再次调用*/
  513. otherModel(dataid,type,isleave,state){
  514. this.paramMain.content.type = type
  515. this.paramMain.content.where.isleave = isleave
  516. this.paramMain.content.dataid = dataid
  517. this.person = state == '状态' ? '' : type == 0 ? dataid : ''
  518. this.depment = type == 0 ? '' : dataid
  519. this.isleave = isleave
  520. this.queryMainData(dataid,this.dateType)
  521. /*联系人销售贡献度排行*/
  522. this.$refs.salesContributionRef.$refs.depStatusProRef.person = state == '状态' ? '' : type == 0 ? dataid : ''
  523. this.$refs.salesContributionRef.$refs.depStatusCusRef.person = state == '状态' ? '' : type == 0 ? dataid : ''
  524. this.$refs.salesContributionRef.$refs.depStatusCusRef.depment = type == 0 ? '' : dataid
  525. this.$refs.salesContributionRef.$refs.depStatusProRef.depment = type == 0 ? '' : dataid
  526. this.$refs.salesContributionRef.$refs.depStatusProRef.isleave = isleave
  527. this.$refs.salesContributionRef.$refs.depStatusCusRef.isleave = isleave
  528. this.$refs.salesContributionRef.listData(dataid,type,isleave,state)
  529. /*近12月联系人新增分析*/
  530. this.$refs.contactsAddAnalysisRef.$refs.dataTemPlateRef.$refs.depStatusRef.person = state == '状态' ? '' : type == 0 ? dataid : ''
  531. this.$refs.contactsAddAnalysisRef.$refs.dataTemPlateRef.$refs.depStatusRef.depment = type == 0 ? '' : dataid
  532. this.$refs.contactsAddAnalysisRef.$refs.dataTemPlateRef.$refs.depStatusRef.isleave = isleave
  533. this.$refs.contactsAddAnalysisRef.listData(dataid,type,1,state,null)
  534. /*联系人关联线索情况统计*/
  535. this.$refs.statisticsOfCluesRef.$refs.dataTemPlateRef.$refs.depStatusRef.person = state == '状态' ? '' : type == 0 ? dataid : ''
  536. this.$refs.statisticsOfCluesRef.$refs.dataTemPlateRef.$refs.depStatusRef.depment = type == 0 ? '' : dataid
  537. this.$refs.statisticsOfCluesRef.$refs.dataTemPlateRef.$refs.depStatusRef.isleave = isleave
  538. this.$refs.statisticsOfCluesRef.paramTable.content.pageNumber = 1
  539. this.$refs.statisticsOfCluesRef.listData(dataid,type,1,state,null)
  540. /*联系人关联客户情况统计*/
  541. this.$refs.statisticsOfCustomerRef.$refs.dataTemPlateRef.$refs.depStatusRef.person = state == '状态' ? '' : type == 0 ? dataid : ''
  542. this.$refs.statisticsOfCustomerRef.$refs.dataTemPlateRef.$refs.depStatusRef.depment = type == 0 ? '' : dataid
  543. this.$refs.statisticsOfCustomerRef.$refs.dataTemPlateRef.$refs.depStatusRef.isleave = isleave
  544. this.$refs.statisticsOfCustomerRef.paramTable.content.pageNumber = 1
  545. this.$refs.statisticsOfCustomerRef.listData(dataid,type,1,state,null)
  546. /*联系人关联项目情况统计*/
  547. this.$refs.statisticsOfProjectRef.$refs.dataTemPlateRef.$refs.depStatusRef.person = state == '状态' ? '' : type == 0 ? dataid : ''
  548. this.$refs.statisticsOfProjectRef.$refs.dataTemPlateRef.$refs.depStatusRef.depment = type == 0 ? '' : dataid
  549. this.$refs.statisticsOfProjectRef.$refs.dataTemPlateRef.$refs.depStatusRef.isleave = isleave
  550. this.$refs.statisticsOfProjectRef.paramTable.content.pageNumber = 1
  551. this.$refs.statisticsOfProjectRef.listData(dataid,type,1,state,null)
  552. /*联系人跟进情况统计*/
  553. this.$refs.statisticsOfFollowRef.$refs.dataTemPlateRef.$refs.depStatusRef.person = state == '状态' ? '' : type == 0 ? dataid : ''
  554. this.$refs.statisticsOfFollowRef.$refs.dataTemPlateRef.$refs.depStatusRef.depment = type == 0 ? '' : dataid
  555. this.$refs.statisticsOfFollowRef.$refs.dataTemPlateRef.$refs.depStatusRef.isleave = isleave
  556. this.$refs.statisticsOfFollowRef.paramTable.content.pageNumber = 1
  557. this.$refs.statisticsOfFollowRef.listData(dataid,type,1,state,null)
  558. /*近12月联系人跟进分析*/
  559. this.$refs.contactsFollowAnalysisRef.$refs.dataTemPlateRef.$refs.depStatusRef.person = state == '状态' ? '' : type == 0 ? dataid : ''
  560. this.$refs.contactsFollowAnalysisRef.$refs.dataTemPlateRef.$refs.depStatusRef.depment = type == 0 ? '' : dataid
  561. this.$refs.contactsFollowAnalysisRef.$refs.dataTemPlateRef.$refs.depStatusRef.isleave = isleave
  562. this.$refs.contactsFollowAnalysisRef.listData(dataid,type,1,state,null)
  563. /*联系人未跟进天数分析*/
  564. this.$refs.statisticsOfUnFollowRef.$refs.dataTemPlateRef.$refs.depStatusRef.person = state == '状态' ? '' : type == 0 ? dataid : ''
  565. this.$refs.statisticsOfUnFollowRef.$refs.dataTemPlateRef.$refs.depStatusRef.depment = type == 0 ? '' : dataid
  566. this.$refs.statisticsOfUnFollowRef.$refs.dataTemPlateRef.$refs.depStatusRef.isleave = isleave
  567. this.$refs.statisticsOfUnFollowRef.paramTable.content.pageNumber = 1
  568. this.$refs.statisticsOfUnFollowRef.listData(dataid,type,1,state,null)
  569. },
  570. /*联系人数据概况*/
  571. async queryMainData(dataid,dateType){
  572. this.paramMain.content.dataid = dataid
  573. this.paramMain.content.dateType = dateType
  574. const res = await this.$api.requested(this.paramMain)
  575. if (res.code == 0){
  576. this.tool.showMessage(res,()=>{})
  577. }else {
  578. this.mainData = res.data
  579. this.changeDataStructure()
  580. }
  581. },
  582. changeDataStructure(){
  583. let that = this
  584. this.maninInfo = [
  585. {
  586. label:'联系人总数',
  587. value:this.tool.qtyShow(this.mainData.count_phonebook),
  588. isTooltip:true,
  589. tooltip:'统计跟进联系人总数量。'
  590. },
  591. {
  592. label:'联系人跟进次数',
  593. value:this.tool.qtyShow(this.mainData.count_follow),
  594. isTooltip:true,
  595. tooltip:'统计在【联系人】应用,跟进联系人次数。'
  596. },
  597. {
  598. label:'关联客户数',
  599. value:this.tool.qtyShow(this.mainData.count_customer),
  600. isTooltip:true,
  601. tooltip:'统计联系人关联的客户数量。'
  602. },
  603. {
  604. label:'关联项目数',
  605. value:this.tool.qtyShow(this.mainData.count_project),
  606. isTooltip:true,
  607. tooltip:'统计联系人关联的项目数量。'
  608. },
  609. {
  610. label:'关联客户成交金额',
  611. // value:this.tool.formatAmount(this.mainData.amount_customer,2,'¥'),
  612. value:this.mainData.amount_customer < 10000 ? this.tool.formatAmount(this.mainData.amount_customer,2,'¥'):
  613. this.tool.formatAmount(this.tool.unitConversion(this.mainData.amount_customer,10000),2,'¥'),
  614. isTooltip:true,
  615. isTitle:this.mainData.amount_customer < 10000?false:true,
  616. tooltip:'统计联系人关联的客户标准、特殊订单下单金额。'
  617. },
  618. {
  619. label:'关联项目成交金额',
  620. value:this.mainData.amount_project < 10000 ? this.tool.formatAmount(this.mainData.amount_project,2,'¥'):
  621. this.tool.formatAmount(this.tool.unitConversion(this.mainData.amount_project,10000),2,'¥'),
  622. isTooltip:true,
  623. isTitle:this.mainData.amount_project < 10000?false:true,
  624. tooltip:'统计联系人关联的项目订单下单金额。'
  625. }
  626. ]
  627. },
  628. goDetail(data){
  629. this.titleHeader = data
  630. if (data == '联系人总数'){
  631. this.paramDetail.id =2025072213574102
  632. this.tablecols = this.tool.tabelCol(this.$route.name).contactsTotalTable.tablecols
  633. this.getTagList()
  634. }else if (data == '联系人跟进次数'){
  635. this.paramDetail.id = 2025072213575402
  636. this.tablecols = this.tool.tabelCol(this.$route.name).contactsFollowTable.tablecols
  637. }else if (data == '关联客户数'){
  638. this.paramDetail.id = 2025072213580402
  639. this.tablecols = this.tool.tabelCol(this.$route.name).associatedCustomersTable.tablecols
  640. this.getSelectData()
  641. this.getTagList()
  642. }else if (data == '关联项目数'){
  643. this.paramDetail.id = 2025072213581302
  644. this.tablecols = this.tool.tabelCol(this.$route.name).associatedProjectsTable.tablecols
  645. this.stageData()
  646. this.getSelectData()
  647. this.getTagList()
  648. }else if (data == '关联客户成交金额'){
  649. this.paramDetail.id = 2025072213582002
  650. this.tablecols = this.tool.tabelCol(this.$route.name).associatedAmountTable.tablecols
  651. this.getSelectData()
  652. }else if (data == '关联项目成交金额'){
  653. this.paramDetail.id = 2025072213582602
  654. this.tablecols = this.tool.tabelCol(this.$route.name).associatedAmountTable.tablecols
  655. this.getSelectData()
  656. }
  657. this.detailTitle = this.$t(this.dateType) + '_' + this.$t(data)
  658. this.paramDetail.content.dataid = this.paramMain.content.dataid
  659. this.paramDetail.content.type = this.paramMain.content.type
  660. this.paramDetail.content.dateType = this.paramMain.content.dateType
  661. this.paramDetail.content.where.isleave = this.paramMain.content.where.isleave
  662. this.$refs.detailRef.onShow()
  663. },
  664. /*获取联系人标签*/
  665. async getTagList () {
  666. if (this.titleHeader == '联系人总数'){
  667. let res = await this.$api.requested({
  668. "id": 20220929085401,
  669. "content": {
  670. "ownertable":"sys_phonebook",
  671. "ownerid":102
  672. }
  673. })
  674. this.tagList = res.data.option
  675. }else if (this.titleHeader == '关联客户数'){
  676. const res = await this.$api.requested({
  677. id: 20221013104401,
  678. content: {
  679. isExport: 1,
  680. pageNumber: 1,
  681. pageSize: 100,
  682. sys_systemtagid: 2,
  683. where: {
  684. condition: "",
  685. },
  686. },
  687. });
  688. this.tagList = this.unique(res.data)
  689. }else if (this.titleHeader == '关联项目数'){
  690. const res = await this.$api.requested({
  691. "id":20221013104401,
  692. "content":{
  693. "isExport":1,
  694. "pageNumber":1,
  695. "pageSize":100,
  696. "sys_systemtagid":1,
  697. "where":{
  698. "condition":""
  699. }
  700. }
  701. })
  702. this.tagList = this.unique(res.data)
  703. }
  704. },
  705. /*去重*/
  706. unique(arr) {
  707. const res = new Map();
  708. return arr.filter((arr) => !res.has(arr.tag) && res.set(arr.tag, 1));
  709. },
  710. selectChange(){
  711. this.paramDetail.content.where.tag = this.tags
  712. this.$refs.detailRef.listData()
  713. },
  714. hasDisabledTag (item) {
  715. let arr = []
  716. let arr2 = []
  717. arr = this.tagList.filter(item=>{
  718. return this.tags.includes(item.tag)
  719. })
  720. arr.forEach(e=>{
  721. arr2 = arr2.concat(e.mutextag)
  722. })
  723. arr2 = this.tags.length === 0?[]:arr2
  724. let _isSame = arr2.some(tag=>item.tag === tag)
  725. return _isSame
  726. },
  727. clearSearchValue () {
  728. this.$store.dispatch('clearSearchValue')
  729. this.$refs.detailRef.listData(this.paramDetail.content.pageNumber = 1)
  730. },
  731. /*获取自定义选项数据*/
  732. async getSelectData(){
  733. if (this.titleHeader == '关联客户数'){
  734. const res = await this.$store.dispatch("optiontypeselect", "customertypemx")
  735. this.option.typeData = res.data
  736. }else if (this.titleHeader == '关联项目数'){
  737. const res = await this.$store.dispatch("optiontypeselect", "projecttype")
  738. this.projectType = res.data
  739. const res1 = await this.$store.dispatch("optiontypeselect", "tradefield")
  740. this.tradefieldSelect = res1.data
  741. }else {
  742. const res1 = await this.$store.dispatch("optiontypeselect", "tradefield")
  743. this.tradefieldSelect = res1.data
  744. }
  745. },
  746. /*获取阶段*/
  747. async stageData(){
  748. const res = await this.$api.requested({
  749. "id": 20221128143604,
  750. "content": {
  751. "pageNumber": 1,
  752. "pageSize": 99,
  753. "where": {
  754. "condition": "",
  755. "allprojecttype":"",
  756. "projecttype":""
  757. }
  758. }
  759. })
  760. this.option.stageList = res.data
  761. },
  762. },
  763. mounted() {
  764. this.departmentrtment()
  765. var that = this;
  766. // <!--把window.onresize事件挂在到mounted函数上-->
  767. window.onresize = () => {
  768. return (() => {
  769. window.fullWidth = document.documentElement.clientWidth;
  770. that.windowWidth = window.fullWidth; // 宽
  771. })()
  772. };
  773. },
  774. created() {
  775. // this.tablecols = this.tool.tabelCol(this.$route.name).contactsTotalTable.tablecols
  776. }
  777. }
  778. </script>
  779. <style scoped>
  780. </style>