index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. <template>
  2. <div class="app-container">
  3. <div class="conPanel" v-loading="loading">
  4. <div class="userInfoPanel">
  5. <div class="title">{{custInfo.name}}<span class="num">({{custInfo.custid}})</span>
  6. <!-- <span class="tag">2孩儿</span>-->
  7. <span class="tag" v-if="custInfo.label10 && custInfo.label10 !='' " v-text="custInfo.label10"></span>
  8. <span class="tag" v-if="custInfo.label25 && custInfo.label25 !='' " v-text="custInfo.label25"></span>
  9. <span class="tag" v-if="custInfo.label73 && custInfo.label73 !='' " v-text="custInfo.label73"></span>
  10. <span class="tag" v-if="custInfo.label74 && custInfo.label74 !='' " v-text="custInfo.label74"></span>
  11. <span class="tag" v-if="custInfo.label100 && custInfo.label100 !='' " v-text="custInfo.label100"></span>
  12. </div>
  13. <el-row class="userInfo">
  14. <el-col :span="12">
  15. <span class="name">性别</span>
  16. <span class="value" v-if="custInfo.gender == 0">男</span>
  17. <span class="value" v-else>女</span>
  18. </el-col>
  19. <el-col :span="12">
  20. <span class="name">民族</span>
  21. <span class="value">{{custInfo.ethnic}}</span>
  22. </el-col>
  23. <el-col :span="12">
  24. <span class="name">出生日期</span>
  25. <span class="value">{{parseTime(custInfo.birthday,'{yy}-{mm}-{dd}')}}</span>
  26. <el-tag type="warning" effect="dark" size="mini" v-if="custInfo.label3 && custInfo.label3 !='' ">{{custInfo.label3}}</el-tag>
  27. <el-tag type="warning" effect="dark" size="mini" v-if="custInfo.label96 && custInfo.label96 !='' ">{{custInfo.label96}}</el-tag>
  28. <el-tag type="warning" effect="dark" size="mini" v-if="custInfo.label97 && custInfo.label97 !='' ">{{custInfo.label97}}</el-tag>
  29. </el-col>
  30. <el-col :span="12">
  31. <span class="name">国籍</span>
  32. <span class="value">{{custInfo.nation}}</span>
  33. </el-col>
  34. <el-col :span="12">
  35. <span class="name">婚姻状况</span>
  36. <span class="value" v-if="custInfo.maritalstat == 1">未婚</span>
  37. <span class="value" v-else-if="custInfo.maritalstat == 2">已婚</span>
  38. <span class="value" v-else-if="custInfo.maritalstat == 3">丧偶</span>
  39. <span class="value" v-else-if="custInfo.maritalstat == 4">离异</span>
  40. </el-col>
  41. <el-col :span="12">
  42. <span class="name">职业</span>
  43. <span class="value">{{custInfo.occupation}}</span>
  44. <el-tag type="warning" effect="dark" size="mini" v-if="custInfo.label98 && custInfo.label98 !='' ">{{custInfo.label98}}</el-tag>
  45. </el-col>
  46. <el-col :span="12">
  47. <span class="name">工作单位</span>
  48. <span class="value">{{custInfo.employer}}</span>
  49. </el-col>
  50. <el-col :span="12">
  51. <span class="name">最高学历</span>
  52. <span class="value">{{custInfo.education}}</span>
  53. </el-col>
  54. <el-col :span="12">
  55. <span class="name">客户类型</span>
  56. <span class="value">{{custInfo.custtype}}</span>
  57. </el-col>
  58. <el-col :span="12">
  59. <span class="name">客户等级</span>
  60. <span class="value" v-text="levelText(custInfo.custclass)"></span>
  61. </el-col>
  62. <el-col :span="12">
  63. <span class="name">社保情况</span>
  64. <span class="value">{{custInfo.sistatus}}</span>
  65. </el-col>
  66. <el-col :span="12">
  67. <span class="name">官微积分</span>
  68. <span class="value"></span>
  69. </el-col>
  70. <el-col :span="12">
  71. <span class="name">户籍类型</span>
  72. <span class="value">{{custInfo.regtype}}</span>
  73. </el-col>
  74. <el-col :span="12">
  75. <span class="name">个人年收入</span>
  76. <span class="value">{{custInfo.pincome}}万</span>
  77. <el-tag type="warning" effect="dark" size="mini" v-if="custInfo.label21 && custInfo.label21 !='' ">{{custInfo.label21}}</el-tag>
  78. </el-col>
  79. <!-- <el-col :span="12">-->
  80. <!-- <span class="name">家庭年收入</span>-->
  81. <!-- <span class="value">20w-30w</span>-->
  82. <!-- </el-col>-->
  83. <el-col :span="12">
  84. <span class="name">收入来源</span>
  85. <span class="value">{{custInfo.incomesource}}</span>
  86. </el-col>
  87. <el-col :span="12">
  88. <span class="name">户籍所在地</span>
  89. <span class="value">{{custInfo.homeaddress}}</span>
  90. </el-col>
  91. </el-row>
  92. </div>
  93. <div>
  94. <el-tabs class="userInfoTab" v-model="tabActive" @tab-click="tabChange">
  95. <el-tab-pane label="联系信息" name="lxxx">
  96. <contact :data="contactData"></contact>
  97. </el-tab-pane>
  98. <el-tab-pane label="习惯偏好" name="pzgl">
  99. <habit :data="habitData" v-if="hasHabitData()"></habit>
  100. <nodata v-else></nodata>
  101. </el-tab-pane>
  102. <el-tab-pane label="健康状况" name="jsgl">
  103. <health :data="healthData" v-if="hasHealthData()"></health>
  104. <nodata v-else></nodata>
  105. </el-tab-pane>
  106. <el-tab-pane label="关系信息" name="gxxx">
  107. <relationship :data="relationshipData"></relationship>
  108. </el-tab-pane>
  109. <el-tab-pane label="合约信息" name="hyxx">
  110. <contract-information :data="contractInformationData" :tagsData="tagsDataHY"></contract-information>
  111. </el-tab-pane>
  112. <el-tab-pane label="理赔信息" name="lpxx">
  113. <claim :data="claimData"></claim>
  114. </el-tab-pane>
  115. <el-tab-pane label="接触信息" name="jcxx">
  116. <touched :data="touchedData"></touched>
  117. </el-tab-pane>
  118. <el-tab-pane label="标签信息" name="bqxx">
  119. <tags :data="tagsData" v-if="tagsData && tagsData.length > 0"></tags>
  120. <nodata v-else></nodata>
  121. </el-tab-pane>
  122. </el-tabs>
  123. </div>
  124. </div>
  125. </div>
  126. </template>
  127. <script>
  128. import { getCustomerById } from "@/api/customerInformation/customerInformation.js";
  129. import habit from './components/habit'
  130. import health from './components/health'
  131. import contractInformation from './components/contractInformation'
  132. import claim from './components/claim'
  133. import contact from './components/contact'
  134. import relationship from './components/relationship'
  135. import touched from './components/touched'
  136. import tags from './components/tags'
  137. import nodata from './components/nodata'
  138. export default {
  139. name: "UserInfo",
  140. components: {
  141. habit,
  142. health,
  143. contractInformation,
  144. claim,
  145. contact,
  146. relationship,
  147. touched,
  148. tags,
  149. nodata
  150. },
  151. data() {
  152. return {
  153. loading: true,
  154. custInfo:{},
  155. tabActive:'hyxx',
  156. habitData:{},
  157. healthData:{},
  158. contractInformationData:[],
  159. tagsDataHY:[],
  160. labelHyNum:[24,28,31,35,37,43,44,46,65,88,89,107,116,120],
  161. claimData:[],
  162. contactData:[
  163. {
  164. des:'户籍地址',
  165. country:'中国',
  166. province:'河南',
  167. city:'洛阳',
  168. area:'洛龙区',
  169. street:'开元大道厚载门街300号',
  170. postalCode:'47100',
  171. WeChat:'weixin123',
  172. email:'mail163.com',
  173. QQ:'974171632',
  174. phone:'180***121',
  175. },
  176. {
  177. des:'公司地址',
  178. country:'中国',
  179. province:'河南',
  180. city:'洛阳',
  181. area:'洛龙区',
  182. street:'开元大道厚载门街300号',
  183. postalCode:'47100',
  184. WeChat:'weixin123',
  185. email:'mail163.com',
  186. QQ:'974171632',
  187. phone:'180***121',
  188. },
  189. {
  190. des:'户籍地址',
  191. country:'中国',
  192. province:'河南',
  193. city:'洛阳',
  194. area:'洛龙区',
  195. street:'开元大道厚载门街300号',
  196. postalCode:'47100',
  197. WeChat:'weixin123',
  198. email:'mail163.com',
  199. QQ:'974171632',
  200. phone:'180***121',
  201. },
  202. ],
  203. relationshipData:[],
  204. touchedData: {
  205. data:[
  206. {
  207. label:'保险单号:BX12312313<br>接触类型:投保<br>接触角色:投保人<br>接触原因:需要保险服务',
  208. date:'2018.03.21',
  209. backgroundColor:'#DCE4F7',
  210. },
  211. {
  212. label:'保险单号:BX12312313<br>接触类型:投保<br>接触角色:投保人<br>接触原因:需要保险服务',
  213. date:'2018.03.21',
  214. backgroundColor:'#DCE4F7',
  215. },
  216. {
  217. label:'保险单号:BX12312313<br>接触类型:投保<br>接触角色:投保人<br>接触原因:需要保险服务',
  218. date:'2018.03.21',
  219. backgroundColor:'#DCE4F7',
  220. },
  221. {
  222. label:'保险单号:BX12312313<br>接触类型:投保<br>接触角色:投保人<br>接触原因:需要保险服务',
  223. date:'2018.03.21',
  224. backgroundColor:'#FEE2B0',
  225. },
  226. {
  227. label:'保险单号:BX12312313<br>接触类型:投保<br>接触角色:投保人<br>接触原因:需要保险服务',
  228. date:'2018.03.21',
  229. backgroundColor:'#FEE2B0',
  230. },
  231. {
  232. label:'保险单号:BX12312313<br>接触类型:投保<br>接触角色:投保人<br>接触原因:需要保险服务',
  233. date:'2018.03.21',
  234. backgroundColor:'#FEE2B0',
  235. },
  236. {
  237. label:'保险单号:BX12312313<br>接触类型:投保<br>接触角色:投保人<br>接触原因:需要保险服务',
  238. date:'2018.03.21',
  239. backgroundColor:'#FEE2B0',
  240. },
  241. {
  242. label:'保险单号:BX12312313<br>接触类型:投保<br>接触角色:投保人<br>接触原因:需要保险服务',
  243. date:'2018.03.21',
  244. backgroundColor:'#FEE2B0',
  245. },
  246. ],
  247. // color:"chocolate",
  248. dowload:false,
  249. },
  250. tagsData:[],
  251. }
  252. },
  253. created() {
  254. },
  255. mounted() {
  256. this.getCustomerByIdData();
  257. },
  258. methods: {
  259. getCustomerByIdData(){
  260. this.loading = true;
  261. let that = this;
  262. let id = that.$route.query.id;
  263. getCustomerById({id:id}).then(response => {
  264. console.log(response);
  265. that.custInfo = response.data.custInfo;
  266. that.relationshipData = response.data.relationship;
  267. that.habitData.ctype = response.data.custInfo.ctype;
  268. response.data.custInfo.hobby1 ? response.data.custInfo.hobby1 = response.data.custInfo.hobby1+'、' : response.data.custInfo.hobby1 ='';
  269. response.data.custInfo.hobby2 ? response.data.custInfo.hobby2 = response.data.custInfo.hobby2+'、' : response.data.custInfo.hobby2 ='';
  270. response.data.custInfo.hobby3 ? response.data.custInfo.hobby3 = response.data.custInfo.hobby3 : response.data.custInfo.hobby3 ='';
  271. that.habitData.hobby = response.data.custInfo.hobby1 + response.data.custInfo.hobby2 +response.data.custInfo.hobby3;
  272. response.data.custInfo.evadate ? that.healthData.evadate = response.data.custInfo.evadate : that.healthData.evadate = '';
  273. response.data.custInfo.height ? that.healthData.height = response.data.custInfo.height : that.healthData.height = '';
  274. response.data.custInfo.weight ? that.healthData.weight = response.data.custInfo.weight : that.healthData.weight = '';
  275. response.data.custInfo.bmi ? that.healthData.bmi = response.data.custInfo.bmi : that.healthData.bmi = '';
  276. that.labelAll();
  277. that.labelHy();
  278. response.data.insuranceclaimthread?that.claimData = response.data.insuranceclaimthread:that.claimData = [];
  279. response.data.insurancearrangement?that.contractInformationData = response.data.insurancearrangement:that.contractInformationData = [];
  280. that.loading = false;
  281. }
  282. );
  283. },
  284. labelAll(){
  285. var that = this;
  286. that.tagsData = [];
  287. for(var i=0;i<120;i++){
  288. var label = 'label'+i;
  289. if(that.custInfo[label] && that.custInfo[label] != ""){
  290. that.tagsData.push(that.custInfo[label]);
  291. }
  292. }
  293. },
  294. labelHy(){
  295. var that = this;
  296. that.tagsDataHY = [];
  297. that.labelHyNum.forEach((item,index) => {
  298. var label = 'label'+item;
  299. if(that.custInfo[label] && that.custInfo[label] != ""){
  300. that.tagsDataHY.push(that.custInfo[label]);
  301. }
  302. } )
  303. },
  304. hasHealthData(){
  305. if(this.healthData.evadate ){
  306. return true;
  307. }else if(this.healthData.height){
  308. return true;
  309. }else if(this.healthData.weight){
  310. return true;
  311. }else if(this.healthData.bmi){
  312. return true;
  313. }
  314. },
  315. hasHabitData(){
  316. if(this.habitData.ctype ){
  317. return true;
  318. }else if(this.habitData.hobby){
  319. return true;
  320. }
  321. },
  322. tabChange(tab, event){
  323. console.log(tab, event);
  324. },
  325. }
  326. };
  327. </script>
  328. <style lang="scss">
  329. .conPanel{
  330. width: 97%;
  331. /*height: 92%;*/
  332. /*position: absolute;*/
  333. .userInfoPanel{
  334. border-radius: 5px;
  335. background:#FFF;
  336. .title{
  337. height: 46px;
  338. line-height: 46px;
  339. font-size: 16px;
  340. color: #1E4F97;
  341. font-weight: bold;
  342. padding: 0 10px;
  343. border-bottom: 1px solid #F0F0F0;
  344. overflow: hidden;
  345. .num{
  346. font-size: 14px;
  347. }
  348. .tag{
  349. font-size: 12px;
  350. color: #FFF;
  351. padding: 4px;
  352. background: #00398B;
  353. margin: 0 4px;
  354. border-radius: 4px;
  355. }
  356. }
  357. }
  358. .userInfoTab{
  359. margin-top: 16px;
  360. .tagDiv{
  361. padding: 10px 30px 20px;
  362. border-radius: 5px;
  363. background: #FFF;
  364. box-sizing: border-box;
  365. .tag{
  366. margin-right: 16px;
  367. margin-top: 10px;
  368. }
  369. }
  370. }
  371. .userInfo{
  372. padding: 10px;
  373. box-sizing: border-box;
  374. line-height:26px;
  375. .name{
  376. font-size: 14px;
  377. font-weight: bold;
  378. color: #333;
  379. width: 130px;
  380. text-align: right;
  381. display: inline-block;
  382. }
  383. .value{
  384. font-size: 14px;
  385. color: #333;
  386. display: inline-block;
  387. padding-left: 20px;
  388. margin-right: 6px;
  389. }
  390. }
  391. }
  392. </style>
  393. <style>
  394. .userInfoTab .el-tabs__header .el-tabs__nav-wrap::after {
  395. background-color: rgba(255,255,255,0);
  396. }
  397. .userInfoTab .el-tabs__item.is-active{
  398. color: #00388B;
  399. }
  400. .userInfoTab .el-tabs__active-bar{
  401. background-color: #00388B;
  402. }
  403. .userInfoTab .el-tabs__item:hover {
  404. color: #00388B;
  405. }
  406. .userInfoTab .el-tabs__header{
  407. padding: 0 30px;
  408. box-sizing: border-box;
  409. }
  410. </style>