index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
  1. <template>
  2. <div class="app-container" v-loading="loading">
  3. <div class="conPanel">
  4. <el-row class="ht100p" :gutter="20">
  5. <el-col class="ht100p" :span="7">
  6. <div class="topDiv">
  7. <div class="cardDiv">
  8. <!--标题-->
  9. <div class="cardTitle">客户标签</div>
  10. <word-cloud-chart
  11. id="wordCloud"
  12. :title="chartsTitle"
  13. :data="wordCloudChartData"
  14. :width="width"
  15. :height="height"
  16. />
  17. <!--角边-->
  18. <!--<div class="borderLB"></div>-->
  19. <!--<div class="borderRB"></div>-->
  20. </div>
  21. </div>
  22. <div class="bottomDiv">
  23. <div class="cardDiv">
  24. <div class="cardTitle">客户保单信息</div>
  25. <div class="chart">
  26. <div class="topNumDiv">
  27. <div class="numTitle">保单总数</div>
  28. <div class="num cursor" @click="toDetail">{{custInfo.bdTotalNum}}张</div>
  29. </div>
  30. <!-- <div class="dashedLine"></div>-->
  31. <div class="bottomNumDiv">
  32. <div class="leftNumDiv">
  33. <div class="numTitle">有效保单</div>
  34. <div class="num cursor" @click="toDetail">{{custInfo.novpolicy}}张</div>
  35. </div>
  36. <div class="rightNumDiv">
  37. <div class="numTitle">失效保单</div>
  38. <div class="num cursor" @click="toDetail">{{custInfo.noivpolicy}}张</div>
  39. </div>
  40. </div>
  41. </div>
  42. <!--<div class="borderLB"></div>-->
  43. <!--<div class="borderRB"></div>-->
  44. </div>
  45. </div>
  46. </el-col>
  47. <el-col class="ht100p" :span="10">
  48. <div class="cardDiv">
  49. <div class="cardTitle">客户信息</div>
  50. <div class="infoDiv">
  51. <div class="chartDiv">
  52. <pie-chart-half
  53. id="pieChartHalf"
  54. :title="chartsTitle"
  55. :data="pieChartHalfData"
  56. :width="width"
  57. :height="height"
  58. />
  59. </div>
  60. <div class="imgDiv">
  61. <!-- <div style="width: 240px;">-->
  62. <!-- <img style="width: 100%;" src="../../../assets/image/levelBg.png" alt=""/>-->
  63. <!-- </div>-->
  64. <div :class="{'levelImgDiv':true,'levelImg':isShowlevelText(levelText(custInfo.custclass)),'levelImgNull':!isShowlevelText(levelText(custInfo.custclass))}">
  65. <div class="level" v-if="isShowlevelText(levelText(custInfo.custclass))">{{levelText(custInfo.custclass)}}客户</div>
  66. <div class="isPay">已交保费</div>
  67. <div class="payNum">{{custInfo.prem}}</div>
  68. </div>
  69. </div>
  70. <el-row class="bottomInfoDiv" :gutter="10">
  71. <el-col :span="24">
  72. <div class="bxDetail" style="padding: 10px 10px 6px;">
  73. <div class="numTitleB">险种信息</div>
  74. <el-row :gutter="10">
  75. <el-col :span="8">
  76. <div class="bxInfo">享受保障:<span>{{custInfo.guaranteeDay}}</span><span class="unit">天</span></div>
  77. </el-col>
  78. <el-col :span="8">
  79. <div class="bxInfo">年缴保费:<span>{{custInfo.prem}}</span><span class="unit">元</span></div>
  80. </el-col>
  81. <el-col :span="8" v-for="(value, key, index) in majorCategorie">
  82. <div class="bxInfo">{{key}}:<span>{{value/10000}}</span><span class="unit">万</span></div>
  83. </el-col>
  84. </el-row>
  85. </div>
  86. </el-col>
  87. <!-- <el-col :span="6">-->
  88. <!-- <div class="bxDetail">-->
  89. <!-- <div class="numTitle">享受保障</div>-->
  90. <!-- <div class="num">{{custInfo.guaranteeDay}}<span class="unit">天</span></div>-->
  91. <!-- </div>-->
  92. <!-- </el-col>-->
  93. <!-- <el-col :span="6" v-for="(value, key, index) in majorCategorie">-->
  94. <!-- <div class="bxDetail">-->
  95. <!-- <div class="numTitle">{{key}}</div>-->
  96. <!-- <div class="num">{{value/10000}}<span class="unit">万</span></div>-->
  97. <!-- </div>-->
  98. <!-- </el-col>-->
  99. <!-- <el-col :span="6">-->
  100. <!-- <div class="bxDetail">-->
  101. <!-- <div class="numTitle">标准保费</div>-->
  102. <!-- <div class="num">{{custInfo.prem}}<span class="unit">元</span></div>-->
  103. <!-- </div>-->
  104. <!-- </el-col>-->
  105. </el-row>
  106. <el-row class="bottomInfoDiv" :gutter="10">
  107. <el-col :span="12">
  108. <div class="bxDetail bxDetailHt">
  109. <div class="numTitleB">续期信息</div>
  110. <div class="bxInfo">应交日期:{{custInfo.null}}</div><!--未接数据-->
  111. <div class="bxInfo">应交保费:{{custInfo.null}}元</div><!--未接数据-->
  112. <div class="bxInfo">已交保费:{{custInfo.null}}元</div><!--未接数据-->
  113. <div class="bxInfo">交费年期:{{custInfo.null}}年</div><!--未接数据-->
  114. </div>
  115. </el-col>
  116. <el-col :span="12">
  117. <div class="bxDetail bxDetailHt">
  118. <div class="numTitleB">理赔信息</div>
  119. <div class="bxInfo">是否理赔:{{insuranceclaimthread.isClaim}}</div>
  120. <div class="bxInfo">理赔类别:{{insuranceclaimthread.claimType}}</div>
  121. <div class="bxInfo">理赔金额:{{insuranceclaimthread.claimAmount}}元</div>
  122. </div>
  123. </el-col>
  124. </el-row>
  125. </div>
  126. <!--<div class="borderLB"></div>-->
  127. <!--<div class="borderRB"></div>-->
  128. </div>
  129. </el-col>
  130. <el-col class="ht100p" :span="7">
  131. <div class="topDiv">
  132. <div class="cardDiv">
  133. <div class="cardTitle">基本信息</div>
  134. <div class="userInfo">
  135. <el-row class="mt20" :gutter="10">
  136. <el-col :span="12">
  137. <div>姓名:{{custInfo.name}}</div>
  138. </el-col>
  139. <el-col :span="12">
  140. <div>手机:{{custInfo.pmphone}}</div>
  141. </el-col>
  142. </el-row>
  143. <el-row :gutter="10">
  144. <el-col :span="12">
  145. <div>年龄:{{custInfo.age}}岁</div>
  146. </el-col>
  147. </el-row>
  148. <div class="dayDiv">
  149. <div class="dayTitle">投保时长</div>
  150. <div class="dayNum">{{custInfo.insureDay}}<span class="unit">天</span></div>
  151. </div>
  152. </div>
  153. <!--<div class="borderLB"></div>-->
  154. <!--<div class="borderRB"></div>-->
  155. </div>
  156. </div>
  157. <div class="bottomDiv">
  158. <div class="cardDiv">
  159. <div class="cardTitle">投保时间节点及保费</div>
  160. <line-bar-chart
  161. id="lineBarChart"
  162. :width="width"
  163. :height="height"
  164. :data="lineBarChartData" />
  165. <!--<div class="borderLB"></div>-->
  166. <!--<div class="borderRB"></div>-->
  167. </div>
  168. </div>
  169. </el-col>
  170. </el-row>
  171. </div>
  172. </div>
  173. </template>
  174. <script>
  175. import { getCustomerById,getCustomerOverViewById } from "@/api/customerInformation/customerInformation.js";
  176. import WordCloudChart from '../../dashboard/WordCloudChart'
  177. import LineBarChart from '../../dashboard/LineBarChart'
  178. import PieChartHalf from '../../dashboard/PieChartHalf'
  179. export default {
  180. name: "UserInfoOverview",
  181. components: {
  182. WordCloudChart,
  183. LineBarChart,
  184. PieChartHalf
  185. },
  186. data() {
  187. return {
  188. loading:true,
  189. chartsTitle:'',
  190. custInfo : {},
  191. wordCloudChartData:[],
  192. lineBarChartData:{
  193. lineData:{
  194. name:'',
  195. xAxisName:'单位:月',
  196. yAxisName:'单位:元',
  197. data:[]
  198. },
  199. // barData:{
  200. // name:'',
  201. // data:[]
  202. // },
  203. xAxisData:[]
  204. },
  205. pieChartHalfData:[],
  206. width:'100%',
  207. height:'80%',
  208. insuranceclaimthread:{
  209. claimType: "", //理赔类型
  210. claimAmount: '', //理赔金额
  211. isClaim: "" //是否理赔
  212. },
  213. majorCategorie:{},
  214. }
  215. },
  216. created() {
  217. this.getCustomerOverViewByIdData();
  218. },
  219. mounted() {
  220. },
  221. methods: {
  222. getCustomerOverViewByIdData(){
  223. this.loading = true;
  224. var that = this;
  225. let id = this.$route.query.id;
  226. // let id = this.$route.params.id;
  227. getCustomerOverViewById({id:id}).then(response => {
  228. console.log(response);
  229. // 客户标签
  230. for(var i =0 ;i< 120;i++){
  231. var label = 'label'+i;
  232. if(response.data.custInfo[label] && response.data.custInfo[label] != ""){
  233. var data = {
  234. name:response.data.custInfo[label],
  235. value:i,
  236. }
  237. that.wordCloudChartData.push(data)
  238. }
  239. }
  240. // 客户保单信息
  241. that.custInfo = response.data.custInfo;
  242. if(!that.custInfo.noivpolicy || that.custInfo.noivpolicy <= 0){
  243. that.custInfo.noivpolicy = 0;
  244. }
  245. if(!that.custInfo.novpolicy || that.custInfo.novpolicy <= 0){
  246. that.custInfo.novpolicy = 0;
  247. }
  248. that.custInfo.bdTotalNum = that.custInfo.noivpolicy + that.custInfo.novpolicy;
  249. // 理赔信息
  250. response.data.insuranceclaimthread != undefined ?that.insuranceclaimthread = response.data.insuranceclaimthread:{};
  251. response.data.majorCategorie != undefined ?that.majorCategorie = response.data.majorCategorie:{};
  252. // 投保时间节点及保费
  253. that.lineBarChartData.xAxisData = response.data.lineBarChartData.xaxisData;
  254. that.lineBarChartData.lineData.data = response.data.lineBarChartData.actaulData.data;
  255. that.lineBarChartData.lineData.name = response.data.lineBarChartData.actaulData.name;
  256. // that.lineBarChartData.barData.data = response.data.lineBarChartData.expectedData.data;
  257. // that.lineBarChartData.barData.name = response.data.lineBarChartData.expectedData.name;
  258. that.loading = false;
  259. }
  260. );
  261. },
  262. toDetail(){
  263. let id = this.$route.query.id;
  264. this.$router.push({ path:'/userInfoDetails', query: {id: id} })
  265. },
  266. isShowlevelText(text){
  267. if(text == '无'){
  268. return false;
  269. }else{
  270. return true;
  271. }
  272. },
  273. }
  274. };
  275. </script>
  276. <style lang="scss" scoped>
  277. .conPanel{
  278. width: 97%;
  279. height: 92%;
  280. position: absolute;
  281. .topDiv{
  282. height: 50%;
  283. padding-bottom: 10px;
  284. box-sizing: border-box;
  285. }
  286. .bottomDiv{
  287. height: 50%;
  288. padding-top: 10px;
  289. box-sizing: border-box;
  290. }
  291. .cardDiv{
  292. height: 100%;
  293. position: relative;
  294. /*border: 1px solid #122E83;*/
  295. box-sizing: border-box;
  296. /*background:url("../../../assets/image/cardBg.png") no-repeat;*/
  297. /*background-size:100% 100%;*/
  298. background:#FFF;
  299. border-radius:3px;
  300. .cardTitle{
  301. height: 32px;
  302. line-height: 32px;
  303. font-size: 14px;
  304. color: #164993;
  305. font-weight: bold;
  306. padding: 0 15px;
  307. box-sizing: border-box;
  308. background: #DCE4F7;
  309. /*background: linear-gradient( to right,rgba(6,34,128,0.7), rgba(18,107,209,0));*/
  310. }
  311. .chart{
  312. height: 80%;
  313. width: 100%;
  314. margin-top: 10px;
  315. }
  316. .numTitle{
  317. font-size: 14px;
  318. color: #333;
  319. /*font-weight: bold;*/
  320. line-height: 30px;
  321. }
  322. .num{
  323. font-size: 20px;
  324. color: #F39801;
  325. font-weight: bold;
  326. line-height: 20px;
  327. }
  328. .topNumDiv{
  329. width: 50%;
  330. height: 40%;
  331. text-align: center;
  332. margin-top: 8%;
  333. margin-left: 25%;
  334. padding-top: 10px;
  335. border-bottom: 1px dashed #F39801;
  336. box-sizing: border-box;
  337. }
  338. .dashedLine{
  339. width: 40%;
  340. height: 1px;
  341. border-bottom: 1px dashed #F39801;
  342. margin-top:25%;
  343. margin-left: 30%;
  344. }
  345. .bottomNumDiv{
  346. width: 60%;
  347. height: 50%;
  348. text-align: center;
  349. margin-left: 20%;
  350. .leftNumDiv{
  351. width: 50%;
  352. border-right: 1px dashed #F39801;
  353. box-sizing: border-box;
  354. float: left;
  355. padding-top: 10px;
  356. padding-right: 20px;
  357. }
  358. .rightNumDiv{
  359. width: 50%;
  360. float: left;
  361. padding-top: 10px;
  362. box-sizing: border-box;
  363. padding-left: 20px;
  364. }
  365. }
  366. .userInfo{
  367. font-size: 14px;
  368. color: #333;
  369. height: 24px;
  370. line-height: 24px;
  371. padding: 0 15px;
  372. box-sizing: border-box;
  373. height: 80%;
  374. }
  375. .infoDiv{
  376. height: 85%;
  377. padding: 15px;
  378. box-sizing:border-box;
  379. .chartDiv{
  380. height: 80%;
  381. width: 100%;
  382. position: absolute;
  383. top: 10px;
  384. left: 0;
  385. z-index: 0;
  386. }
  387. .imgDiv{
  388. height: 60%;
  389. position:relative;
  390. .levelImg{
  391. background: url("../../../assets/image/levelBg.png") no-repeat;
  392. }
  393. .levelImgNull{
  394. background: url("../../../assets/image/levelBg2.png") no-repeat;
  395. }
  396. .levelImgDiv{
  397. width: 240px;
  398. height: 204px;
  399. background-size: 100% 100%;
  400. position: absolute;
  401. bottom: 10px;
  402. left: 50%;
  403. margin-left: -125px;
  404. .level{
  405. width: 80px;
  406. padding: 4px 0;
  407. font-size: 14px;
  408. font-weight: bold;
  409. color: #FFF;
  410. background: #003B88;
  411. border-radius: 8px;
  412. text-align: center;
  413. position: absolute;
  414. top: 46px;
  415. left: 52%;
  416. margin-left: -40px;
  417. }
  418. .isPay{
  419. width: 100px;
  420. height: 40px;
  421. line-height: 40px;
  422. font-size: 14px;
  423. color: #333;
  424. text-align: center;
  425. position: absolute;
  426. bottom: 28px;
  427. left: 50%;
  428. margin-left: -50px;
  429. }
  430. .payNum{
  431. width: 100%;
  432. font-size: 20px;
  433. font-weight: bolder;
  434. color: #333;
  435. line-height: 50px;
  436. text-align: center;
  437. position: absolute;
  438. bottom: 0;
  439. left: 4px;
  440. }
  441. }
  442. }
  443. .bottomInfoDiv{
  444. /*height: 10%;*/
  445. margin-top:10px;
  446. .bxDetailHt{
  447. height: 110px;
  448. margin-top: 10px;
  449. padding: 10px 10px 6px !important;
  450. }
  451. .bxDetail{
  452. width: 100%;
  453. text-align: center;
  454. border: 1px solid #F39801;
  455. line-height: 24px;
  456. padding: 4px 10px;
  457. box-sizing:border-box;
  458. position:relative;
  459. .numTitle{
  460. font-size: 14px;
  461. color: #333;
  462. }
  463. .numTitleB{
  464. position: absolute;
  465. top: -12px;
  466. left: 50%;
  467. /*padding: 4px 0;*/
  468. width: 70px;
  469. margin-left: -35px;
  470. background: #FFF;
  471. font-size: 14px;
  472. color: #F39700;
  473. }
  474. .bxInfo{
  475. font-size: 12px;
  476. color: #333;
  477. line-height: 22px;
  478. text-align: left;
  479. span{
  480. color: #F39700;
  481. }
  482. }
  483. .num{
  484. font-size: 16px;
  485. color: #F39801;
  486. .unit{
  487. font-size: 12px;
  488. color: #333;
  489. margin-left: 6px;
  490. }
  491. }
  492. }
  493. }
  494. }
  495. .dayDiv{
  496. height: 50%;
  497. width:100%;
  498. background: #FEEBDC;
  499. border-radius: 5px;
  500. margin-top: 20px;
  501. padding: 15px 20px;
  502. box-sizing: border-box;
  503. .dayTitle{
  504. color: #333;
  505. }
  506. .dayNum{
  507. font-size: 24px;
  508. color: #F59801;
  509. text-align: center;
  510. padding-top: 10px;
  511. .unit{
  512. font-size: 14px;
  513. color: #333;
  514. margin-left: 6px;
  515. }
  516. }
  517. }
  518. }
  519. .borderLB{
  520. height: 20px;
  521. width: 20px;
  522. position: absolute;
  523. bottom: 0;
  524. left: 0;
  525. border-bottom: 1px solid #076DB9;
  526. border-left: 1px solid #076DB9;
  527. }
  528. .borderRB{
  529. height: 20px;
  530. width: 20px;
  531. position: absolute;
  532. bottom: 0;
  533. right: 0;
  534. border-bottom: 1px solid #076DB9;
  535. border-right: 1px solid #076DB9;
  536. }
  537. }
  538. .ht100p{
  539. height: 100%;
  540. }
  541. .cursor{
  542. cursor: pointer;
  543. }
  544. @media (min-width: 1400px) {
  545. .conPanel .cardDiv .topNumDiv{
  546. height: 28%;
  547. margin-top: 15%;
  548. }
  549. .conPanel .cardDiv .infoDiv .imgDiv .levelImgDiv{
  550. bottom: 15%;
  551. }
  552. .conPanel .cardDiv .infoDiv .bottomInfoDiv .bxDetail{
  553. padding: 20px;
  554. }
  555. .conPanel .cardDiv .infoDiv .bottomInfoDiv .bxDetailHt{
  556. height: 130px;
  557. padding: 20px !important;
  558. }
  559. .conPanel .cardDiv .dayDiv .dayNum{
  560. font-size: 28px;
  561. font-weight: bold;
  562. margin-top: 22px;
  563. }
  564. }
  565. </style>