index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  1. <template>
  2. <div class="app-container" v-loading="loading">
  3. <div class="conPanel">
  4. <el-row class="ht50p" :gutter="20">
  5. <el-col class="ht100p" :span="7">
  6. <div class="cardDiv">
  7. <div class="cardTitle">客户年龄段性别分布</div>
  8. <bar-two-way-chart
  9. id="barTwoWayChart"
  10. :width="width"
  11. :height="height"
  12. :data="barTwoWayChartData" />
  13. </div>
  14. </el-col>
  15. <el-col class="ht100p" :span="17">
  16. <div class="cardDiv">
  17. <div class="cardTitle">查询条件</div>
  18. <div class="lunboDiv">
  19. <img class="lineImg" src="../assets/image/line.png" alt="">
  20. <div class="wrapper horizontal demo1">
  21. <ul class="container" style=" transform-style: preserve-3d;transform: rotateX(-5deg) rotateY(0deg);">
  22. <li class="cards-list" v-for="(item,index) in lunboData" :key="index">
  23. <div class="img">
  24. <img class="iconImg" :src="item.iconSrc" alt="">
  25. <img class="shadowImg" src="../assets/image/shadow.png" alt="">
  26. </div>
  27. <div class="main-con">
  28. <div class="name">{{item.name}}</div>
  29. <img src="../assets/image/ItalicsLine.png" alt="">
  30. </div>
  31. </li>
  32. </ul>
  33. </div>
  34. </div>
  35. <div class="infoLeft">
  36. <!-- <img class="lineImg" src="../assets/image/line.png" alt="">-->
  37. <!-- <el-button class="lunboSearchBtn" icon="el-icon-search" circle @click="toUserInfoList"></el-button>-->
  38. <el-button class="lunboSearchBtn" circle @click="toUserInfoList">
  39. <img src="../assets/image/searchBtn.png" alt=""/>
  40. </el-button>
  41. <el-form v-if="lunboActiveIndex == 0" ref="conditionData" :model="conditionData" label-width="96px">
  42. <el-form-item class="formItemFull" label="业绩归属:" size="mini">
  43. <el-select v-model="conditionData.policybelong">
  44. <el-option v-for="(item,index) in policybelongArr" :key="index" :label="item.label" :value="item.value"></el-option>
  45. </el-select>
  46. </el-form-item>
  47. <el-form-item class="formItemFull" label="年缴费区间:" size="mini">
  48. <el-input v-model="conditionData.payS" style="width: 43%;"></el-input>
  49. &nbsp;-&nbsp;
  50. <el-input v-model="conditionData.payE" style="width: 43%;"></el-input>
  51. </el-form-item>
  52. <el-form-item class="formItemFull" label="投保年份:" size="mini">
  53. <el-date-picker
  54. v-model="conditionData.fadate"
  55. type="year"
  56. clearable
  57. value-format="yyyy"
  58. placeholder="选择年">
  59. </el-date-picker>
  60. </el-form-item>
  61. <el-form-item class="formItemFull" label="险种类别:" size="mini">
  62. <el-select v-model="conditionData.productname">
  63. <el-option label="人寿保险" value="L"></el-option>
  64. <el-option label="年金保险" value="R"></el-option>
  65. <el-option label="万能保险" value="U"></el-option>
  66. <el-option label="意外伤害险" value="A"></el-option>
  67. <el-option label="重疾保险" value="S"></el-option>
  68. <el-option label="健康险" value="H"></el-option>
  69. </el-select>
  70. </el-form-item>
  71. <el-form-item class="formItemFull" label="保额区间:" size="mini">
  72. <el-input v-model="conditionData.insuredAmountS" style="width: 43%;"></el-input>
  73. &nbsp;-&nbsp;
  74. <el-input v-model="conditionData.insuredAmountE" style="width: 43%;"></el-input>
  75. </el-form-item>
  76. </el-form>
  77. <el-form v-if="lunboActiveIndex == 1" :inline="true" ref="conditionData" :model="conditionData" label-width="96px">
  78. <el-form-item class="formItem" label="年龄:" size="mini">
  79. <el-input class="age" oninput="value=value.replace(/[^\d]/g,'')" v-model="conditionData.ageS"></el-input>
  80. -
  81. <el-input class="age" oninput="value=value.replace(/[^\d]/g,'')" v-model="conditionData.ageE"></el-input>
  82. </el-form-item>
  83. <el-form-item class="formItem" label="性别:" size="mini">
  84. <el-select v-model="conditionData.gender">
  85. <el-option label="男" value="0"></el-option>
  86. <el-option label="女" value="1"></el-option>
  87. </el-select>
  88. </el-form-item>
  89. <el-form-item class="formItem" label="省份:" size="mini">
  90. <el-input v-model="conditionData.sobirth"></el-input>
  91. </el-form-item>
  92. <el-form-item class="formItem" label="保单件数:" size="mini">
  93. <el-select v-model="conditionData.NOVPolicy">
  94. <el-option label="无保单" value="无保单"></el-option>
  95. <el-option label="1件" value="1件"></el-option>
  96. <el-option label="2件" value="2件"></el-option>
  97. <el-option label="3-5件" value="3-5件"></el-option>
  98. <el-option label="6-10件" value="6-10件"></el-option>
  99. <el-option label="11-20件" value="11-20件"></el-option>
  100. <el-option label="21-50件" value="21-50件"></el-option>
  101. <el-option label="50件以上" value="50件以上"></el-option>
  102. </el-select>
  103. </el-form-item>
  104. <el-form-item class="formItem" label="客户类型:" size="mini">
  105. <el-select v-model="conditionData.custtype">
  106. <el-option label="投保人" value="投保人"></el-option>
  107. <el-option label="被保人" value="被保人"></el-option>
  108. <el-option label="受益人" value="受益人"></el-option>
  109. </el-select>
  110. </el-form-item>
  111. <el-form-item class="formItem" label="核心客户号:" size="mini">
  112. <el-input v-model="conditionData.SCustID"></el-input>
  113. </el-form-item>
  114. <el-form-item :class="{'formItemFull2 education':isFull,'formItem':!isFull}" label="客户等级:" size="mini">
  115. <el-select v-model="conditionData.custclass">
  116. <el-option label="钻石" value="1"></el-option>
  117. <el-option label="白金" value="2"></el-option>
  118. <el-option label="黄金" value="3"></el-option>
  119. <el-option label="普通" value="4"></el-option>
  120. <el-option label="无" value="0"></el-option>
  121. </el-select>
  122. </el-form-item>
  123. <el-form-item :class="{'formItemFull2 education':isFull,'formItem':!isFull}" label="学历:" size="mini">
  124. <el-select v-model="conditionData.education" multiple collapse-tags>
  125. <el-option v-for="(item,index) in educationArr" :key="index" :label="item.label" :value="item.value"></el-option>
  126. </el-select>
  127. </el-form-item>
  128. <el-form-item class="formItemFull2 labelM dateQj" label="参与方进入时间:" size="mini" style="margin-top: 5px;">
  129. <el-date-picker
  130. v-model="conditionData.participantsDateS"
  131. type="date"
  132. clearable
  133. style="width: 44%;"
  134. value-format="yyyy-MM-dd"
  135. placeholder="选择日期"
  136. :picker-options="pickerOptionsS">
  137. </el-date-picker>
  138. -
  139. <el-date-picker
  140. v-model="conditionData.participantsDateE"
  141. type="date"
  142. clearable
  143. value-format="yyyy-MM-dd"
  144. style="width: 44%;"
  145. placeholder="选择日期"
  146. :picker-options="pickerOptionsE">
  147. </el-date-picker>
  148. </el-form-item>
  149. </el-form>
  150. <el-form v-if="lunboActiveIndex == 2" ref="conditionData" :model="conditionData" label-width="96px">
  151. <el-form-item class="formItemFull" label="年收入:" size="mini">
  152. <el-input v-model="conditionData.PIncomeS" style="width: 43%;"></el-input>
  153. &nbsp;-&nbsp;
  154. <el-input v-model="conditionData.PIncomeE" style="width: 43%;"></el-input>
  155. </el-form-item>
  156. </el-form>
  157. <el-form v-if="lunboActiveIndex == 3" ref="conditionData" :model="conditionData" label-width="96px">
  158. <el-form-item class="formItemFull" label="投保对象:" size="mini">
  159. <el-input v-model="conditionData.Insured"></el-input>
  160. </el-form-item>
  161. </el-form>
  162. <el-form v-if="lunboActiveIndex == 4" ref="conditionData" :model="conditionData" label-width="196px">
  163. <el-form-item class="formItemFull" label="理赔:" size="mini">
  164. <el-radio v-model="conditionData.lp" label="0">是</el-radio>
  165. <el-radio v-model="conditionData.lp" label="1">否</el-radio>
  166. </el-form-item>
  167. <el-form-item class="formItemFull" label="有效:" size="mini">
  168. <el-radio v-model="conditionData.yx" label="0">是</el-radio>
  169. <el-radio v-model="conditionData.yx" label="1">否</el-radio>
  170. </el-form-item>
  171. <el-form-item class="formItemFull" label="关注官微:" size="mini">
  172. <el-radio v-model="conditionData.gzgw" label="0">是</el-radio>
  173. <el-radio v-model="conditionData.gzgw" label="1">否</el-radio>
  174. </el-form-item>
  175. <el-form-item class="formItemFull" label="注册官微:" size="mini">
  176. <el-radio v-model="conditionData.zcgw" label="0">是</el-radio>
  177. <el-radio v-model="conditionData.zcgw" label="1">否</el-radio>
  178. </el-form-item>
  179. </el-form>
  180. </div>
  181. </div>
  182. </el-col>
  183. </el-row>
  184. <el-row class="ht50p" :gutter="20">
  185. <el-col class="ht100p" :span="7">
  186. <div class="cardDiv">
  187. <div class="cardTitle">险种类别</div>
  188. <bar-chart3
  189. id="barChart"
  190. :width="width"
  191. :height="height"
  192. :data="barChartData" />
  193. </div>
  194. </el-col>
  195. <el-col class="ht100p" :span="10">
  196. <div class="cardDiv">
  197. <div class="cardTitle">近10年有效客户数</div>
  198. <bar-chart
  199. id="barChartVistors"
  200. :width="width"
  201. :height="height"
  202. :data="barChartVistorsData" />
  203. </div>
  204. </el-col>
  205. <el-col class="ht100p" :span="7">
  206. <div class="cardDiv">
  207. <div class="cardTitle">拥有保单件数分布</div>
  208. <pie-chart
  209. id="pieChart"
  210. :width="width"
  211. :height="height"
  212. :data="pieChartData" />
  213. </div>
  214. </el-col>
  215. </el-row>
  216. </div>
  217. </div>
  218. </template>
  219. <script>
  220. import '../assets/styles/lunbo.css'
  221. import '../assets/js/empile.js'
  222. import BarTwoWayChart from './dashboard/BarTwoWayChart'
  223. import BarChart from './dashboard/BarChart2'
  224. import BarChart3 from './dashboard/BarChart3'
  225. import PieChart from './dashboard/PieChart2'
  226. import { ageSexDis, riskcode, bdNumDis } from "@/api/index";
  227. export default {
  228. name: "Index",
  229. components: {
  230. BarTwoWayChart,
  231. BarChart,
  232. BarChart3,
  233. PieChart
  234. },
  235. data() {
  236. return {
  237. loading: true,
  238. // 客户年龄段性别分布
  239. barTwoWayChartData:{
  240. yAxisName:'单位:万',
  241. legendData:[],
  242. xAxisData:[],
  243. seriesData:[]
  244. },
  245. // 险种类别
  246. barChartData:{
  247. yAxisNameL:'单位:万',
  248. yAxisNameR:'单位:元',
  249. color:['#028FF3','#F29700'],
  250. xAxisData:[],
  251. seriesData:[]
  252. },
  253. // 拥有保单件数分布
  254. pieChartData:{
  255. color:['#0084F1','#ED475B','#F39801','#00C7FF','rgb(242,158,194)','rgb(250,216,137)','rgb(127,229,154)','rgb(33,201,205)'],
  256. seriesData:[]
  257. },
  258. // 近10年有效客户数
  259. barChartVistorsData:{
  260. yAxisName:'数量:万个',
  261. color:['#048EF3','#7FE59A','#FAD889','#F29EC2'],
  262. xAxisData:['2011', '2012', '2013', '2014', '2015', '2016', '2017'],
  263. seriesData:[
  264. {
  265. name:'白银',
  266. stack: 'vistors',
  267. data: [79, 52, 200, 334, 390, 330, 220]
  268. },
  269. {
  270. name:'黄金',
  271. stack: 'vistors',
  272. data: [80, 52, 200, 334, 390, 330, 220]
  273. },
  274. {
  275. name:'白金',
  276. stack: 'vistors',
  277. data: [30, 52, 200, 334, 390, 330, 220]
  278. },
  279. {
  280. name:'钻石',
  281. stack: 'vistors',
  282. data: [30, 52, 200, 334, 390, 330, 220]
  283. },
  284. ]
  285. },
  286. width:'100%',
  287. height:'80%',
  288. lunboActiveIndex:'0',
  289. lunboData:[
  290. {
  291. iconSrc:require('../assets/image/productInfo.png'),
  292. name:'产品信息',
  293. },
  294. {
  295. iconSrc:require('../assets/image/baseInfo.png'),
  296. name:'基本信息',
  297. },
  298. {
  299. iconSrc:require('../assets/image/money.png'),
  300. name:'资产信息',
  301. },
  302. {
  303. iconSrc:require('../assets/image/guanlian.png'),
  304. name:'关联信息',
  305. },
  306. {
  307. iconSrc:require('../assets/image/tag.png'),
  308. name:'客户标签',
  309. },
  310. ],
  311. // 学历选项
  312. educationArr:[
  313. {
  314. value: '幼儿园',
  315. label: '幼儿园'
  316. },{
  317. value: '小学',
  318. label: '小学'
  319. },{
  320. value: '中专',
  321. label: '中专'
  322. },{
  323. value: '职高',
  324. label: '职高'
  325. },{
  326. value: '技校',
  327. label: '技校'
  328. },{
  329. value: '初中',
  330. label: '初中'
  331. },{
  332. value: '高中',
  333. label: '高中'
  334. },{
  335. value: '大专',
  336. label: '大专'
  337. },{
  338. value: '本科',
  339. label: '本科'
  340. },{
  341. value: '硕士及以上',
  342. label: '硕士及以上'
  343. },{
  344. value: '其他',
  345. label: '其他'
  346. }
  347. ],
  348. // 业绩归属选项
  349. policybelongArr:[
  350. {
  351. value: '00',
  352. label: '总部团险个单业务'
  353. },{
  354. value: '01',
  355. label: '上分团险个单业务'
  356. },{
  357. value: '02',
  358. label: '个险渠道'
  359. },{
  360. value: '03',
  361. label: '银保渠道'
  362. },{
  363. value: '05',
  364. label: '网销渠道'
  365. },{
  366. value: '06',
  367. label: '健康险事业部'
  368. }
  369. ],
  370. conditionData:{
  371. education:'',
  372. },
  373. pickerOptionsS: {
  374. disabledDate:(time)=> {
  375. if (this.conditionData.participantsDateE) {
  376. return time.getTime() > new Date(this.conditionData.participantsDateE).getTime()
  377. }
  378. }
  379. },
  380. pickerOptionsE: {
  381. disabledDate:(time)=> {
  382. if (this.conditionData.participantsDateS) {
  383. return time.getTime() < new Date(this.conditionData.participantsDateS).getTime() - 86400000
  384. }
  385. }
  386. },
  387. isFull:false,
  388. }
  389. },
  390. created() {
  391. },
  392. mounted() {
  393. var screenWidth = document.body.clientWidth;
  394. screenWidth > 1400 ? this.isFull = false : this.isFull = true;
  395. this.lunboFn();
  396. this.getRiskcode();
  397. this.getAgeSexDis();
  398. this.getBdNumDis();
  399. },
  400. methods: {
  401. _$ (el) {
  402. try {
  403. var item = document.querySelectorAll(el);
  404. return item.length == 1 ? item[0] : item;
  405. } catch (err) {
  406. console.log(err)
  407. }
  408. },
  409. lunboFn(){
  410. var that = this;
  411. var empile1 = new Empile(that._$('.demo1>.container'), {
  412. waitForTransition: true,
  413. isClickSlide: true,
  414. on: {
  415. // 卡片切换时执行
  416. slideChange: function () {
  417. //设置'当前显示的是第[xxx]张'元素的文本内容
  418. // activeIndexEle.textContent = this.activeIndex + 1;
  419. that.lunboActiveIndex = this.activeIndex;
  420. }
  421. },
  422. css: function (coord, absCoord) {
  423. var zIndex = 100 - absCoord,
  424. opacity = Math.pow(.92, absCoord).toFixed(3),
  425. scale = 'scale(' + Math.pow(.9, absCoord).toFixed(2) + ')',
  426. translateX = 'translateX(' + 30 * coord + 'px)',
  427. translateZ = 'translateZ(' + '105px)',
  428. rotateY= 'rotateY('+ coord * 30 +'deg)';
  429. var transform = [translateX,rotateY,translateZ].join(' ');
  430. return {
  431. zIndex: zIndex,
  432. opacity: opacity,
  433. transform: transform,
  434. }
  435. },
  436. });
  437. },
  438. toUserInfoList(){
  439. var that = this;
  440. console.log(that.conditionData)
  441. // this.$router.push({ path:'/userInfoList',query:that.conditionData})
  442. this.$router.push({ name:'UserInfoList',params:that.conditionData},)
  443. },
  444. // 客户年龄段性别分布
  445. getAgeSexDis(){
  446. let that = this;
  447. ageSexDis().then(response => {
  448. console.log(response);
  449. response.data.seriesData.forEach((item,index) => {
  450. item.forEach((num,i) => {
  451. item[i] = ((num-0)/10000).toFixed(2);
  452. })
  453. })
  454. that.barTwoWayChartData.xAxisData = response.data.xaxisData;
  455. that.barTwoWayChartData.seriesData = response.data.seriesData;
  456. that.barTwoWayChartData.legendData = response.data.legendData;
  457. that.loading = false;
  458. }
  459. );
  460. },
  461. // 险种类别
  462. getRiskcode(){
  463. let that = this;
  464. riskcode().then(response => {
  465. console.log(response);
  466. response.data.seriesData.forEach((item,index) => {
  467. if(item.name == '客户数量'){
  468. item.data.forEach((num,i) => {
  469. item.data[i] = ((num-0)/10000).toFixed(2);
  470. })
  471. }
  472. })
  473. that.barChartData.xAxisData = response.data.xaxisData;
  474. that.barChartData.seriesData = response.data.seriesData;
  475. that.loading = false;
  476. }
  477. );
  478. },
  479. // 拥有保单件数分布
  480. getBdNumDis(){
  481. let that = this;
  482. bdNumDis().then(response => {
  483. console.log(response);
  484. that.pieChartData.seriesData = response.data.seriesData;
  485. this.loading = false;
  486. }
  487. );
  488. },
  489. }
  490. };
  491. </script>
  492. <style lang="scss" scoped>
  493. .conPanel{
  494. width: 97%;
  495. height: 96%;
  496. position: absolute;
  497. .cardDiv {
  498. height: 95%;
  499. position: relative;
  500. margin-top: 5px;
  501. background:#FFF;
  502. border-radius:3px;
  503. /*border: 1px solid #122E83;*/
  504. box-sizing: border-box;
  505. /*position:relative;*/
  506. /*&.cardBg{*/
  507. /* background: url("../assets/image/cardBg.png") no-repeat;*/
  508. /* background-size: 100% 100%;*/
  509. /* }*/
  510. /* &.cardBg2{*/
  511. /* background: url("../assets/image/cardBg2.png") no-repeat;*/
  512. /* background-size: 100% 100%;*/
  513. /* }*/
  514. /* &.cardBg3{*/
  515. /* background: url("../assets/image/cardBg3.png") no-repeat;*/
  516. /* background-size: 100% 100%;*/
  517. /* }*/
  518. .cardTitle {
  519. height: 32px;
  520. line-height: 32px;
  521. font-size: 14px;
  522. color: #164993;
  523. font-weight: bold;
  524. padding: 0 15px;
  525. box-sizing: border-box;
  526. background: #DCE4F7;
  527. }
  528. }
  529. }
  530. .ht100p{
  531. height: 100%;
  532. }
  533. .ht50p{
  534. height: 50%;
  535. }
  536. </style>
  537. <style lang="scss">
  538. .age{
  539. .el-input__inner{
  540. padding: 0 6px !important;
  541. }
  542. }
  543. </style>