06e347c5 by joe

客户服务信息更新

1 parent 08eea576
Showing 40 changed files with 220 additions and 61 deletions
...@@ -8,8 +8,11 @@ ...@@ -8,8 +8,11 @@
8 <link rel="icon" href="favicon.ico"> 8 <link rel="icon" href="favicon.ico">
9 <link rel="stylesheet" href="./css/pure-min.css"> 9 <link rel="stylesheet" href="./css/pure-min.css">
10 <link rel="stylesheet" href="./css/grids-responsive-min.css"> 10 <link rel="stylesheet" href="./css/grids-responsive-min.css">
11 <!--[if gt IE 6]>
12
13 <![endif]-->
11 <title>平安人寿保险官网</title> 14 <title>平安人寿保险官网</title>
12 <link href="static/js/0.1575514351062.js" rel="prefetch"><link href="static/js/1.1575514351062.js" rel="prefetch"><link href="static/js/10.1575514351062.js" rel="prefetch"><link href="static/js/11.1575514351062.js" rel="prefetch"><link href="static/js/12.1575514351062.js" rel="prefetch"><link href="static/js/13.1575514351062.js" rel="prefetch"><link href="static/js/14.1575514351062.js" rel="prefetch"><link href="static/js/15.1575514351062.js" rel="prefetch"><link href="static/js/16.1575514351062.js" rel="prefetch"><link href="static/js/17.1575514351062.js" rel="prefetch"><link href="static/js/18.1575514351062.js" rel="prefetch"><link href="static/js/2.1575514351062.js" rel="prefetch"><link href="static/js/3.1575514351062.js" rel="prefetch"><link href="static/js/4.1575514351062.js" rel="prefetch"><link href="static/js/5.1575514351062.js" rel="prefetch"><link href="static/js/6.1575514351062.js" rel="prefetch"><link href="static/js/7.1575514351062.js" rel="prefetch"><link href="static/js/8.1575514351062.js" rel="prefetch"><link href="static/js/9.1575514351062.js" rel="prefetch"><link href="static/js/app.1575514351062.js" rel="preload" as="script"></head> 15 <link href="static/js/0.1575886985498.js" rel="prefetch"><link href="static/js/1.1575886985498.js" rel="prefetch"><link href="static/js/10.1575886985498.js" rel="prefetch"><link href="static/js/11.1575886985498.js" rel="prefetch"><link href="static/js/12.1575886985498.js" rel="prefetch"><link href="static/js/13.1575886985498.js" rel="prefetch"><link href="static/js/14.1575886985498.js" rel="prefetch"><link href="static/js/15.1575886985498.js" rel="prefetch"><link href="static/js/16.1575886985498.js" rel="prefetch"><link href="static/js/17.1575886985498.js" rel="prefetch"><link href="static/js/18.1575886985498.js" rel="prefetch"><link href="static/js/19.1575886985498.js" rel="prefetch"><link href="static/js/2.1575886985498.js" rel="prefetch"><link href="static/js/20.1575886985498.js" rel="prefetch"><link href="static/js/21.1575886985498.js" rel="prefetch"><link href="static/js/3.1575886985498.js" rel="prefetch"><link href="static/js/4.1575886985498.js" rel="prefetch"><link href="static/js/5.1575886985498.js" rel="prefetch"><link href="static/js/6.1575886985498.js" rel="prefetch"><link href="static/js/7.1575886985498.js" rel="prefetch"><link href="static/js/8.1575886985498.js" rel="prefetch"><link href="static/js/9.1575886985498.js" rel="prefetch"><link href="static/js/app.1575886985498.js" rel="preload" as="script"></head>
13 16
14 <body> 17 <body>
15 <noscript> 18 <noscript>
...@@ -19,6 +22,6 @@ ...@@ -19,6 +22,6 @@
19 <div id="app"></div> 22 <div id="app"></div>
20 <!-- built files will be auto injected --> 23 <!-- built files will be auto injected -->
21 <script src="./js/unionrsa.js"></script> 24 <script src="./js/unionrsa.js"></script>
22 <script type="text/javascript" src="static/js/app.1575514351062.js"></script></body> 25 <script type="text/javascript" src="static/js/app.1575886985498.js"></script></body>
23 26
24 </html> 27 </html>
......
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
...@@ -52,4 +52,6 @@ module.exports = { ...@@ -52,4 +52,6 @@ module.exports = {
52 updatePolicyContanct : "/pingan_hklife_webapi/policy/updateContacts", 52 updatePolicyContanct : "/pingan_hklife_webapi/policy/updateContacts",
53 // 保单客戶資料變更 53 // 保单客戶資料變更
54 updatePolicyInfo : "/pingan_hklife_webapi/policy/updateInfo", 54 updatePolicyInfo : "/pingan_hklife_webapi/policy/updateInfo",
55 // 证件上传
56 idPicUpload : "/pingan_hklife_webapi/policy/idPicUpload",
55 } 57 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -181,7 +181,21 @@ export const httpPost = params => { ...@@ -181,7 +181,21 @@ export const httpPost = params => {
181 export const formdata = params => { 181 export const formdata = params => {
182 let { 182 let {
183 url, 183 url,
184 data 184 data,
185 sid,
185 } = params; 186 } = params;
186 return axios.post(`${base}${url}`, data, formDataHeaders).then(res => res.data); 187 let headers = {
188 headers : {
189 "Content-Type": "multipart/form-data"
190 }
191 }
192 let formData = new FormData(); //使用formData对象
193 for (let key in data) {
194 formData.append(key, data[key]);
195 }
196 if (sid) {
197 let sessionId = state.userInfo && state.userInfo.sid ? state.userInfo.sid : "";
198 headers.headers.sid = sessionId;
199 }
200 return axios.post(`${base}${url}`, formData, headers).then(res => res.data);
187 } 201 }
......
...@@ -3,6 +3,7 @@ import { ...@@ -3,6 +3,7 @@ import {
3 httpGet, 3 httpGet,
4 httpPost 4 httpPost
5 } from '@/api/fetch-api.js' 5 } from '@/api/fetch-api.js'
6 import { read } from 'fs';
6 7
7 8
8 export default { 9 export default {
...@@ -76,37 +77,72 @@ export default { ...@@ -76,37 +77,72 @@ export default {
76 }, 77 },
77 data() { 78 data() {
78 return { 79 return {
79 key: 'value' 80 key: 'value',
81 frontPicSrc: null,
82 backPicSrc: null,
83 frontPicFile: null,
84 backPicFile: null
80 } 85 }
81 }, 86 },
82 components: {}, 87 components: {},
88 computed: {
89 submitBtnDisabled() {
90 let b1 = this.frontPicFile ? false : true;
91 let b2 = this.backPicFile ? false : true;
92 return b1 || b2;
93 }
94 },
83 methods: { 95 methods: {
84 // 点击确认 96 // 点击确认
85 onConfirmHandler() { 97 onConfirmHandler() {
86 if (this.confirm) { 98 if (this.submitBtnDisabled) {
87 this.confirm(); 99 return;
88 } 100 }
101 this.$emit("onSubmit", { front: this.frontPicFile, back: this.backPicFile });
102 },
103 handlePicSelect(type) {
104 let _this = this;
105 let input = document.createElement("input");
106 input.setAttribute("type", "file");
107 input.setAttribute("accept", "image/*");
108 input.onchange = function (val) {
109 var reader = new FileReader();
110 reader.onload = function (e) {
111 if (type == 'front') {
112 _this.$set(_this, 'frontPicSrc', reader.result);
113 } else {
114 _this.$set(_this, 'backPicSrc', reader.result);
115 }
116 }
117 let file = input.files[0];
118 if (type == 'front') {
119 _this.$set(_this, 'frontPicFile', file);
120 } else {
121 _this.$set(_this, 'backPicFile', file);
122 }
123 reader.readAsDataURL(file);
124 };
125 input.click();
89 }, 126 },
90 // 点击取消 127 // 点击取消
91 onCancelHandler() { 128 onCancelHandler() {
92 if (this.cancel) { 129 this.$emit("close");
93 this.cancel();
94 }
95 }, 130 },
96 // 点击关闭 131 // 点击关闭
97 onCloseHandler() { 132 onCloseHandler() {
98 if (this.close) { 133 this.$emit("close");
99 this.close();
100 }
101 }, 134 },
102 // 点击蒙层 135 // 点击蒙层
103 onOverLayHandler() { 136 onOverLayHandler() {
104 if (this.overlay) { 137 this.$emit("close");
105 this.overlay();
106 }
107 }, 138 },
108 initData() {} 139 init() {
140 this.frontPicFile = null;
141 this.backPicFile = null;
142 this.frontPicSrc = null;
143 this.backPicSrc = null;
144 }
109 }, 145 },
110 mounted() {}, 146 mounted() { },
111 created() {} 147 created() { }
112 } 148 }
......
...@@ -70,6 +70,11 @@ ...@@ -70,6 +70,11 @@
70 70
71 &-item { 71 &-item {
72 padding: 0 $marginSmallHalf; 72 padding: 0 $marginSmallHalf;
73 max-width: 15.583333rem ;
74
75 img {
76 width: 100%;
77 }
73 } 78 }
74 } 79 }
75 } 80 }
......
...@@ -11,17 +11,17 @@ ...@@ -11,17 +11,17 @@
11 <div class="gird-g upload"> 11 <div class="gird-g upload">
12 <div class="pure-u-1 pure-u-md-1-2 upload-item"> 12 <div class="pure-u-1 pure-u-md-1-2 upload-item">
13 <div class="tit"> {{$t('form.modalUploadCard.front')}}</div> 13 <div class="tit"> {{$t('form.modalUploadCard.front')}}</div>
14 <img class="poster pointer" :src="require('@assets/images/common/card-front.png')" alt=""> 14 <img class="poster pointer" :src="frontPicSrc || require('@assets/images/common/card-front.png')" alt="" @click="handlePicSelect('front')">
15 </div> 15 </div>
16 <div class="pure-u-1 pure-u-md-1-2 upload-item"> 16 <div class="pure-u-1 pure-u-md-1-2 upload-item">
17 <div class="tit"> {{$t('form.modalUploadCard.back')}}</div> 17 <div class="tit"> {{$t('form.modalUploadCard.back')}}</div>
18 <img class="poster pointer" :src="require('@assets/images/common/card-back.png')" alt=""> 18 <img class="poster pointer" :src="backPicSrc || require('@assets/images/common/card-back.png')" alt="" @click="handlePicSelect('back')">
19 </div> 19 </div>
20 </div> 20 </div>
21 </div> 21 </div>
22 <div class="modal-btn-wrap"> 22 <div class="modal-btn-wrap">
23 <div @click="onCancelHandler()" v-if="showCancel" class="btn">{{cancelText}}</div> 23 <div @click="onCancelHandler()" v-if="showCancel" class="btn">{{cancelText}}</div>
24 <div @click="onConfirmHandler()" v-if="showConfirm" class="btn">{{confirmText}}</div> 24 <div @click="onConfirmHandler()" v-if="showConfirm" class="btn" :class="{disabled: submitBtnDisabled}">{{confirmText}}</div>
25 </div> 25 </div>
26 </div> 26 </div>
27 </div> 27 </div>
......
1 import api from '@/api/api' 1 import api from '@/api/api'
2 import { 2 import {
3 httpGet, 3 formdata,
4 httpPost 4 httpPost
5 } from '@/api/fetch-api.js' 5 } from '@/api/fetch-api.js'
6 6
...@@ -23,6 +23,9 @@ export default { ...@@ -23,6 +23,9 @@ export default {
23 data: null, 23 data: null,
24 // 保单信息 24 // 保单信息
25 policy: null, 25 policy: null,
26 // ID证件照引用
27 idFront: null,
28 idBack: null,
26 29
27 // 模态窗 30 // 模态窗
28 modalSimpleVisiable: false, 31 modalSimpleVisiable: false,
...@@ -79,49 +82,77 @@ export default { ...@@ -79,49 +82,77 @@ export default {
79 url: api.policyDetail, 82 url: api.policyDetail,
80 data: param, 83 data: param,
81 sid: true 84 sid: true
82 }).then(response => { 85 }).then(res => {
83 this.loading = false; 86 this.loading = false;
84 if (response) { 87 if (res) {
85 this.policy = response; 88 this.policy = res;
89 let clientName = res.clientNameCn ? res.clientNameCn : res.clientNameEn;
90 let insuredName = res.insuredNameCn ? res.insuredNameCn : res.insuredNameEn;
91 this.policy.clientName = clientName;
92 this.policy.insuredName = insuredName;
93 // 证件类型、证件号要备份,用于比较
94 this.policy.clientIdTypeBak = this.policy.clientIdType;
95 this.policy.clientIdNumberBak = this.policy.clientIdNumber;
96
97 this.policy.insuredIdTypeBak = this.policy.insuredIdType;
98 this.policy.insuredIdNumberBak = this.policy.insuredIdNumber;
86 this.initData(); 99 this.initData();
87 } 100 }
88 }).catch(res => { 101 }).catch(err => {
89 this.loading = false; 102 this.loading = false;
90 if (res.code == "404") { 103 this.handleErrResponse(err);
91 this.$refs.auth.noAuth();
92 }
93 }); 104 });
94 }, 105 },
95 initData() { 106 initData() {
107 this.idFront = null;
108 this.idBack = null;
96 let res = this.policy; 109 let res = this.policy;
97 let name = ""; 110 if (res) {
98 let isOwner = this.isOwner; 111 let isOwner = this.isOwner;
99 if (isOwner) { 112 let data = {
100 name = res.clientNameCn ? res.clientNameCn : res.clientNameEn; 113 name: isOwner ? res.clientName : res.insuredName,
101 } else { 114 idType: isOwner ? res.clientIdType : res.insuredIdType,
102 name = res.insuredNameCn ? res.insuredNameCn : res.insuredNameEn; 115 idNumber: isOwner ? res.clientIdNumber : res.insuredIdNumber,
116 idExpireAt: isOwner ? res.clientExpireAt : res.insuredExpireAt,
117 nature: isOwner ? res.clientNationality : res.insuredNationality,
118 company: isOwner ? res.clientCompany : res.insuredCompany,
119 marriage: isOwner ? res.clientMarriage : res.insuredMarriage,
120 sex: isOwner ? res.clientSex : res.insuredSex,
121 birthday: isOwner ? res.clientBirthday : res.insuredBirthday
122 };
123 data.sex = data.sex ? data.sex : "M";
124 this.$set(this, 'data', data);
103 } 125 }
104 let data = {
105 name: name,
106 idType: isOwner ? res.clientIdType : res.insuredIdType,
107 idNumber: isOwner ? res.clientIdNumber : res.insuredIdNumber,
108 idExpireAt: isOwner ? res.clientExpireAt : res.insurantExpireAt,
109 nature: isOwner ? res.clientNationality : res.insurantNationality,
110 company: isOwner ? res.clientCompany : res.insurantCompany,
111 marriage: isOwner ? res.clientMarriage : res.insurantMarriage,
112 sex: isOwner ? res.clientSex : res.insuredSex,
113 birthday: isOwner ? res.clientBirthday : res.insuredBirthday
114 };
115 data.sex = data.sex ? data.sex : "M";
116 console.log("data ===", data);
117 this.$set(this, 'data', data);
118 }, 126 },
119 handlePolicySelect(data) { 127 handlePolicySelect(data) {
120 this.selectedPolicies = data; 128 this.selectedPolicies = data;
121 this.loadData(); 129 this.loadData();
122 }, 130 },
131 handleUpdatePolicy() {
132 let showUploadPicDialog = false;
133 if (this.isOwner) {
134 showUploadPicDialog = (this.policy.clientIdType != this.data.idType || this.policy.clientIdNumber != this.data.idNumber);
135 } else {
136 showUploadPicDialog = (this.policy.insuredIdType != this.data.idType || this.policy.insuredIdNumber != this.data.idNumber);
137 }
138 if (showUploadPicDialog) {
139 this.modalUploadCardVisiable = true;
140 } else {
141 this.updatePolicyInfo();
142 }
143 },
144 handleUpdatePolicyWithFile(data) {
145 console.log("handleUpdatePolicyWithFile");
146 this.idFront = data.front;
147 this.idBack = data.back;
148 console.log(data)
149 console.log(this.idFront)
150 console.log(this.idBack)
151 this.updatePolicyIdPic().then(() => {
152 this.updatePolicyInfo();
153 });
154 },
123 updatePolicyInfo() { 155 updatePolicyInfo() {
124 console.log(1, this.loading);
125 if (this.loading) { 156 if (this.loading) {
126 return; 157 return;
127 } 158 }
...@@ -133,18 +164,81 @@ export default { ...@@ -133,18 +164,81 @@ export default {
133 param.policyId = this.selectedPolicies[0].id; 164 param.policyId = this.selectedPolicies[0].id;
134 param.policyCode = this.selectedPolicies[0].code; 165 param.policyCode = this.selectedPolicies[0].code;
135 166
136 console.log("2,", param);
137 httpPost({ url: api.updatePolicyInfo, data: param, sid: true }).then(res => { 167 httpPost({ url: api.updatePolicyInfo, data: param, sid: true }).then(res => {
138 console.log("3,", res);
139 this.loading = false; 168 this.loading = false;
140 this.showModal(this.i18n.policyChangeInformation.success); 169 this.showModal(this.i18n.policyChangeInformation.success);
141 }).catch(err => { 170 }).catch(err => {
142 this.loading = false; 171 this.loading = false;
172 this.handleErrResponse(err);
173 });
174 },
175 updatePolicyIdPic() {
176 return new Promise((resolve, reject) => {
177 if (this.loading) {
178 return;
179 }
180 this.loading = true;
181 let param = {
182 policyId: this.selectedPolicies[0].id,
183 policyCode: this.selectedPolicies[0].code,
184 modifyObj: this.isOwner ? 1 : 2,
185 front: this.idFront,
186 back: this.idBack
187 };
188 this.modalUploadCardVisiable = false;
189 formdata({ url: api.idPicUpload, data: param, sid: true }).then(res => {
190 this.loading = false;
191 resolve();
192 }).catch(err => {
193 this.loading = false;
194 this.handleErrResponse(err);
195 });
196 });
197 },
198 switchPolicyRole(role) {
199 if (this.isOwner && role == 1) {
200 return;
201 }
202 if (!this.isOwner && role == 2) {
203 return;
204 }
205 if (this.policy) {
206 if (role == 1) {
207 // 需要缓存结果,注意取反,此处存在受保人信息
208 this.policy.insuredName = this.data.name;
209 this.policy.insuredIdType = this.data.idType;
210 this.policy.insuredIdNumber = this.data.idNumber;
211 this.policy.insuredExpireAt = this.data.idExpireAt;
212 this.policy.insuredNationality = this.data.nature;
213 this.policy.insuredCompany = this.data.company;
214 this.policy.insuredMarriage = this.data.marriage;
215 this.policy.insuredSex = this.data.sex;
216 this.policy.insuredBirthday = this.data.birthday;
217 } else {
218 // 需要缓存结果,注意取反,此处存在投保人信息
219 this.policy.clientName = this.data.name;
220 this.policy.clientIdType = this.data.idType;
221 this.policy.clientIdNumber = this.data.idNumber;
222 this.policy.clientExpireAt = this.data.idExpireAt;
223 this.policy.clientNationality = this.data.nature;
224 this.policy.clientCompany = this.data.company;
225 this.policy.clientMarriage = this.data.marriage;
226 this.policy.clientSex = this.data.sex;
227 this.policy.clientBirthday = this.data.birthday;
228 }
229 }
230 this.isOwner = role == 1 ? true : false;
231 this.initData();
232 },
233 handleErrResponse(err) {
234 if (err) {
143 if (err.code == 404) { 235 if (err.code == 404) {
144 this.$refs.auth.noAuth(); 236 this.$refs.auth.noAuth();
145 } 237 }
146 }); 238 if (err.errMsg) {
147 239 this.showModal(errMsg, 'info');
240 }
241 }
148 }, 242 },
149 userLogout() { 243 userLogout() {
150 this.showForm = false; 244 this.showForm = false;
...@@ -154,7 +248,7 @@ export default { ...@@ -154,7 +248,7 @@ export default {
154 } 248 }
155 }, 249 },
156 mounted() { 250 mounted() {
157 this.isOwner = this.$route.query.u == 1 ? true : false; 251 this.isOwner = this.$route.query.u == 2 ? false : true;
158 }, 252 },
159 created() { } 253 created() { }
160 } 254 }
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
2 <template> 2 <template>
3 <div> 3 <div>
4 <auth @onLogin="userLogin" @onLogout="userLogout" :checkProfile="true" ref="auth"></auth> 4 <auth @onLogin="userLogin" @onLogout="userLogout" :checkProfile="true" ref="auth"></auth>
5 <modal-upload-card-comp :visible="modalUploadCardVisiable" :show-confirm="true" @close="modalUploadCardVisiable=false" @onSubmit="handleUpdatePolicyWithFile" ></modal-upload-card-comp>
6 <modal-comp :visible="modalVisiable" :show-confirm="false" :icon="modalIcon" :content="modalContent" :confirm="modalCallback" :overlay="modalCallback"></modal-comp>
5 <template v-if="showForm"> 7 <template v-if="showForm">
6 8
7 <div class="pure-u-1 form-item form-item2"> 9 <div class="pure-u-1 form-item form-item2">
...@@ -9,13 +11,12 @@ ...@@ -9,13 +11,12 @@
9 {{$t('policyChangeInformation.obj')}} 11 {{$t('policyChangeInformation.obj')}}
10 </div> 12 </div>
11 <div class="cont"> 13 <div class="cont">
12 <div class="boo-btn pointer" :class="{active:isOwner}" @click="isOwner=true">{{$t('policyChangeInformation.owner')}}</div> 14 <div class="boo-btn pointer" :class="{active:isOwner}" @click="switchPolicyRole(1)">{{$t('policyChangeInformation.owner')}}</div>
13 <div class="boo-btn pointer" :class="{active:!isOwner}" @click="isOwner=false">{{$t('policyChangeInformation.insured')}}</div> 15 <div class="boo-btn pointer" :class="{active:!isOwner}" @click="switchPolicyRole(2)">{{$t('policyChangeInformation.insured')}}</div>
14 </div> 16 </div>
15 </div> 17 </div>
16 18
17 <policy-head-list :multiSelectable="false" @onSelect="handlePolicySelect" :model="'checkbox'"></policy-head-list> 19 <policy-head-list :multiSelectable="false" @onSelect="handlePolicySelect" :model="'checkbox'"></policy-head-list>
18 <modal-upload-card-comp :visible="modalUploadCardVisiable" :show-confirm="true" ></modal-upload-card-comp>
19 <div class="container border" v-if="selectedPolicies.length > 0 && data"> 20 <div class="container border" v-if="selectedPolicies.length > 0 && data">
20 <div class="table"> 21 <div class="table">
21 <div class="table-header orange"> 22 <div class="table-header orange">
...@@ -144,7 +145,7 @@ ...@@ -144,7 +145,7 @@
144 145
145 </div> 146 </div>
146 147
147 <div class="submit-btn" @click="updatePolicyInfo"> 148 <div class="submit-btn" @click="handleUpdatePolicy">
148 {{$t("policyChangeInformation.submit")}} 149 {{$t("policyChangeInformation.submit")}}
149 </div> 150 </div>
150 </div> 151 </div>
......
...@@ -216,7 +216,9 @@ export default { ...@@ -216,7 +216,9 @@ export default {
216 }).then(response => { 216 }).then(response => {
217 this.loading = false; 217 this.loading = false;
218 this._handlerLoginResponse(response); 218 this._handlerLoginResponse(response);
219 }) 219 }).catch(err=>{
220 this.loading = false;
221 });
220 }); 222 });
221 }, 223 },
222 // 处理登录结果 224 // 处理登录结果
...@@ -291,6 +293,8 @@ export default { ...@@ -291,6 +293,8 @@ export default {
291 }).then(response => { 293 }).then(response => {
292 this.loading = false; 294 this.loading = false;
293 this._handlerLoginResponse(response); 295 this._handlerLoginResponse(response);
296 }).catch(err=>{
297 this.loading = false;
294 }); 298 });
295 }); 299 });
296 }, 300 },
......