e40c995b by simon

#10美国税务文件处理

用户体系三语
1 parent c078a97e
...@@ -240,7 +240,6 @@ module.exports = { ...@@ -240,7 +240,6 @@ module.exports = {
240 oe3: "Please enter the picture verification code", 240 oe3: "Please enter the picture verification code",
241 oe4: "Your verify code is not correct. Please try again", 241 oe4: "Your verify code is not correct. Please try again",
242 }, 242 },
243 accountPlaceholder:"Please setup user name ",
244 }, 243 },
245 session: { 244 session: {
246 sidExpire: "It has not been operated for a long time. For the sake of your account security, please restart", 245 sidExpire: "It has not been operated for a long time. For the sake of your account security, please restart",
...@@ -288,7 +287,7 @@ module.exports = { ...@@ -288,7 +287,7 @@ module.exports = {
288 e14: "Please enter your name" 287 e14: "Please enter your name"
289 }, 288 },
290 account:"Account", 289 account:"Account",
291 accountPlaceholder:"please enter user name", 290 accountPlaceholder:"Please setup user name",
292 }, 291 },
293 passwordCheck: { 292 passwordCheck: {
294 error1: "Password length cannot be less than 8 bits", 293 error1: "Password length cannot be less than 8 bits",
......
...@@ -288,7 +288,7 @@ module.exports = { ...@@ -288,7 +288,7 @@ module.exports = {
288 e14: "請輸入您的姓名" 288 e14: "請輸入您的姓名"
289 }, 289 },
290 account:"賬號", 290 account:"賬號",
291 accountPlaceholder:"請設置用戶名", 291 accountPlaceholder:"請設置用戶名",
292 }, 292 },
293 session: { 293 session: {
294 sidExpire: "長時間未操作,為了您賬戶的安全,請登入後再操作" 294 sidExpire: "長時間未操作,為了您賬戶的安全,請登入後再操作"
......
...@@ -214,7 +214,7 @@ module.exports = { ...@@ -214,7 +214,7 @@ module.exports = {
214 loginType1: "动态密码登录", 214 loginType1: "动态密码登录",
215 loginType2: "动态密码登入", 215 loginType2: "动态密码登入",
216 account: "账号", 216 account: "账号",
217 accountPlaceholder: "请输入用户名", 217 accountPlaceholder: "请输入用户名",
218 password: "密码", 218 password: "密码",
219 passwordPlaceholder: "输入登入密码", 219 passwordPlaceholder: "输入登入密码",
220 verifyPlaceholder: "请输入验证码", 220 verifyPlaceholder: "请输入验证码",
......
1 import api from "@/api/api"; 1 import api from "@/api/api";
2 import { httpGet, httpPost } from "@/api/fetch-api.js"; 2 import {
3 httpGet,
4 httpPost
5 } from "@/api/fetch-api.js";
3 6
4 import { contactMethodCheck } from "@utils/utils.js"; 7 import {
5 import { setTitle, ascSort } from "@/utils/utils.js"; 8 contactMethodCheck
9 } from "@utils/utils.js";
10 import {
11 setTitle,
12 ascSort
13 } from "@/utils/utils.js";
6 import { 14 import {
7 getNationsList, 15 getNationsList,
8 getNationsPhoneCodeList, 16 getNationsPhoneCodeList,
...@@ -16,7 +24,9 @@ import PolicyHeadList from "./policy-head-list.vue"; ...@@ -16,7 +24,9 @@ import PolicyHeadList from "./policy-head-list.vue";
16 import modalComp from "@/components/modal-comp/modal-comp.vue"; 24 import modalComp from "@/components/modal-comp/modal-comp.vue";
17 import Modal2Comp from "@/components/modal2-comp/modal2-comp.vue"; 25 import Modal2Comp from "@/components/modal2-comp/modal2-comp.vue";
18 import Vue from "vue"; 26 import Vue from "vue";
19 import { Loading } from "vant"; 27 import {
28 Loading
29 } from "vant";
20 Vue.use(Loading); 30 Vue.use(Loading);
21 31
22 export default { 32 export default {
...@@ -94,16 +104,14 @@ export default { ...@@ -94,16 +104,14 @@ export default {
94 return this.$i18n.locale || "tc"; 104 return this.$i18n.locale || "tc";
95 }, 105 },
96 i18n() { 106 i18n() {
97 return this.$i18n.messages && this.$i18n.locale 107 return this.$i18n.messages && this.$i18n.locale ?
98 ? this.$i18n.messages[this.$i18n.locale] 108 this.$i18n.messages[this.$i18n.locale] : {};
99 : {};
100 }, 109 },
101 submitBtnDisabled() { 110 submitBtnDisabled() {
102 // let b1 = !this.selectedPolicies || this.selectedPolicies.length == 0; 111 // let b1 = !this.selectedPolicies || this.selectedPolicies.length == 0;
103 // let b2 = !this.data.address && !this.data.email && !this.data.mobile; 112 // let b2 = !this.data.address && !this.data.email && !this.data.mobile;
104 let b1 = !this.selectedPolicies || this.selectedPolicies.length == 0; 113 let b1 = !this.selectedPolicies || this.selectedPolicies.length == 0;
105 let b2 = 114 let b2 = !this.data.address ||
106 !this.data.address ||
107 !this.data.email || 115 !this.data.email ||
108 !this.data.mobile || 116 !this.data.mobile ||
109 !this.data.mobileAreaCode || 117 !this.data.mobileAreaCode ||
...@@ -141,11 +149,21 @@ export default { ...@@ -141,11 +149,21 @@ export default {
141 this.showModal(this.i18n.policyChangeContact.success); 149 this.showModal(this.i18n.policyChangeContact.success);
142 }, 150 },
143 showUploadSuccess() { 151 showUploadSuccess() {
152 this.usTaxFormUploadCompVisible = false;
144 this.showModal(this.i18n.policyChangeContact.uploadSuccess); 153 this.showModal(this.i18n.policyChangeContact.uploadSuccess);
145 this.modalVisiableTimeoutIndex = setTimeout(() => { 154 this.modalVisiableTimeoutIndex = setTimeout(() => {
146 this.modalVisiable = false; 155 this.modalVisiable = false;
147 }, 3000); 156 }, 3000);
148 }, 157 },
158 // 判断 美国地区需要上传文件
159 checkShowUSATax() {
160 let result = this.isUSA && !this.data.iobsKey;
161 if (result){
162 this.usTaxFormUploadCompVisible = true;
163 this.$refs.usTax.initData();
164 }
165 return result;
166 },
149 // 提交前准备 167 // 提交前准备
150 updateContactsHandler() { 168 updateContactsHandler() {
151 if (this.submitBtnDisabled) { 169 if (this.submitBtnDisabled) {
...@@ -172,9 +190,7 @@ export default { ...@@ -172,9 +190,7 @@ export default {
172 190
173 if (b) { 191 if (b) {
174 // 判断是否美国 出 192 // 判断是否美国 出
175 if (this.isUSA) { 193 if (!this.checkShowUSATax()) {
176 this.usTaxFormUploadCompVisible = true;
177 } else {
178 this.doSubmit(); 194 this.doSubmit();
179 } 195 }
180 } 196 }
...@@ -183,13 +199,15 @@ export default { ...@@ -183,13 +199,15 @@ export default {
183 * 提交表单 199 * 提交表单
184 */ 200 */
185 doSubmit(val = {}) { 201 doSubmit(val = {}) {
186 // this.usTaxFormUploadCompVisible = false;
187 if (this.loading) { 202 if (this.loading) {
188 return; 203 return;
189 } 204 }
190 let policies = []; 205 let policies = [];
191 this.selectedPolicies.forEach(element => { 206 this.selectedPolicies.forEach(element => {
192 policies.push({ policyId: element.id, policyCode: element.code }); 207 policies.push({
208 policyId: element.id,
209 policyCode: element.code
210 });
193 }); 211 });
194 212
195 let data = Object.assign(this.data, val); 213 let data = Object.assign(this.data, val);
...@@ -203,6 +221,7 @@ export default { ...@@ -203,6 +221,7 @@ export default {
203 data.policyCode = ""; 221 data.policyCode = "";
204 222
205 this.loading = true; 223 this.loading = true;
224 console.log("data:",data);
206 httpPost({ 225 httpPost({
207 url: api.policyContactApi, 226 url: api.policyContactApi,
208 data: data, 227 data: data,
...@@ -225,7 +244,9 @@ export default { ...@@ -225,7 +244,9 @@ export default {
225 * 从美国税务表单组件提交 244 * 从美国税务表单组件提交
226 */ 245 */
227 onUsTaxSubmit(val) { 246 onUsTaxSubmit(val) {
228 this.doSubmit(val); 247 console.log("val:",val);
248 this.data.iobsKey = val;
249 // this.doSubmit(val);
229 }, 250 },
230 251
231 checkMobile() { 252 checkMobile() {
...@@ -290,6 +311,9 @@ export default { ...@@ -290,6 +311,9 @@ export default {
290 * 选择国家 311 * 选择国家
291 */ 312 */
292 onChangeNations() { 313 onChangeNations() {
314 if (!this.isUSA) {
315 this.data.iobsKey = "";
316 }
293 // this.checkProvince(); 317 // this.checkProvince();
294 }, 318 },
295 /** 319 /**
...@@ -360,7 +384,6 @@ export default { ...@@ -360,7 +384,6 @@ export default {
360 }) 384 })
361 .then(response => { 385 .then(response => {
362 this.loading = false; 386 this.loading = false;
363 this.dataInit = true;
364 if (response) { 387 if (response) {
365 this.data = Object.assign(this.data, response); 388 this.data = Object.assign(this.data, response);
366 if (response.provinceId) { 389 if (response.provinceId) {
...@@ -370,6 +393,10 @@ export default { ...@@ -370,6 +393,10 @@ export default {
370 ); 393 );
371 } 394 }
372 } 395 }
396 // 最后执行,确保data不被watch
397 setTimeout(() => {
398 this.dataInit = true;
399 }, 0);
373 }) 400 })
374 .catch(res => { 401 .catch(res => {
375 this.loading = false; 402 this.loading = false;
...@@ -418,6 +445,17 @@ export default { ...@@ -418,6 +445,17 @@ export default {
418 }, 445 },
419 "data.cityId": function () { 446 "data.cityId": function () {
420 this.errorTips.e7 = ""; 447 this.errorTips.e7 = "";
448 },
449 /**
450 * 那就客户进行下一步任意操作的时候弹
451 */
452 data: {
453 deep: true,
454 handler: function (newVal, oldVal) {
455 if (this.dataInit) {
456 this.checkShowUSATax();
457 }
458 }
421 } 459 }
422 }, 460 },
423 mounted() { 461 mounted() {
...@@ -427,8 +465,7 @@ export default { ...@@ -427,8 +465,7 @@ export default {
427 this.$root.eventBus.$on("langChange", () => { 465 this.$root.eventBus.$on("langChange", () => {
428 try { 466 try {
429 this.initData(); 467 this.initData();
430 } catch (e) { } 468 } catch (e) {}
431 }); 469 });
432 } 470 }
433 }; 471 };
434
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
6 <auth @onLogin="userLogin" @onLogout="userLogout" :checkProfile="true" ref="auth" :tipModel="'m2'"></auth> 6 <auth @onLogin="userLogin" @onLogout="userLogout" :checkProfile="true" ref="auth" :tipModel="'m2'"></auth>
7 <modal-comp :visible="modalVisiable" :show-confirm="false" :icon="modalIcon" :content="modalContent" :confirm="modalCallback" :overlay="modalCallback"></modal-comp> 7 <modal-comp :visible="modalVisiable" :show-confirm="false" :icon="modalIcon" :content="modalContent" :confirm="modalCallback" :overlay="modalCallback"></modal-comp>
8 <modal2-comp :visible="uploadErrorVisible" :close="()=>{uploadErrorVisible = false}" :content="$t('glbalTips.sysError')"></modal2-comp> 8 <modal2-comp :visible="uploadErrorVisible" :close="()=>{uploadErrorVisible = false}" :content="$t('glbalTips.sysError')"></modal2-comp>
9 <us-tax-form-upload-comp :visible="usTaxFormUploadCompVisible" @close="usTaxFormUploadCompVisible = false" @submit="onUsTaxSubmit" @uploadsuccess="showUploadSuccess" @uploaderr="uploadErrorVisible = true"></us-tax-form-upload-comp> 9 <us-tax-form-upload-comp ref="usTax" :visible="usTaxFormUploadCompVisible" @close="usTaxFormUploadCompVisible = false" @submit="onUsTaxSubmit" @uploadsuccess="showUploadSuccess" @uploaderr="uploadErrorVisible = true"></us-tax-form-upload-comp>
10 <template v-if="showForm"> 10 <template v-if="showForm">
11 <policy-head-list :multiSelectable="true" @onSelect="handlePolicySelect" :type="2"></policy-head-list> 11 <policy-head-list :multiSelectable="true" @onSelect="handlePolicySelect" :type="2"></policy-head-list>
12 12
......
...@@ -5,7 +5,9 @@ import api from "@/api/api"; ...@@ -5,7 +5,9 @@ import api from "@/api/api";
5 import { 5 import {
6 formdata 6 formdata
7 } from '@/api/fetch-api.js' 7 } from '@/api/fetch-api.js'
8 import { Loading } from 'vant'; 8 import {
9 Loading
10 } from 'vant';
9 11
10 export default { 12 export default {
11 props: { 13 props: {
...@@ -20,8 +22,10 @@ export default { ...@@ -20,8 +22,10 @@ export default {
20 data() { 22 data() {
21 return { 23 return {
22 fileName: "", 24 fileName: "",
25 file: null,
23 iobsKey: "", 26 iobsKey: "",
24 loading: false 27 loading: false,
28 selected: false
25 }; 29 };
26 }, 30 },
27 components: {}, 31 components: {},
...@@ -31,7 +35,12 @@ export default { ...@@ -31,7 +35,12 @@ export default {
31 } 35 }
32 }, 36 },
33 methods: { 37 methods: {
34 initData() {}, 38 initData() {
39 this.file = null;
40 this.iobsKey = "";
41 this.loading = false;
42 this.selected = false;
43 },
35 44
36 onOverLayHandler() { 45 onOverLayHandler() {
37 console.log("onOverLayHandler"); 46 console.log("onOverLayHandler");
...@@ -40,37 +49,41 @@ export default { ...@@ -40,37 +49,41 @@ export default {
40 toDownLoadTaxForm() { 49 toDownLoadTaxForm() {
41 window.open("https://www.irs.gov/"); 50 window.open("https://www.irs.gov/");
42 }, 51 },
43 onUploadHandler() {}, 52 onUploadHandler() {
44 onSubmitHandler() { 53
45 if(!this.iobsKey) return; 54 let file = this.file;
46 this.$emit("submit", { 55 if (!file) return;
47 iobsKey: this.iobsKey 56 if (this.loading) return;
48 });
49 },
50 selectImgs() {
51 let _this = this;
52 this.iobsKey = "";
53 let file = this.$refs.file.files[0];
54 let item = {
55 name: file.name,
56 size: file.size,
57 file: file
58 };
59 // 转base64
60 this.loading = true; 57 this.loading = true;
61 let myFormData = new FormData(); 58 let myFormData = new FormData();
62 myFormData.append("file", file); 59 myFormData.append("file", file);
63 formdata({ url: api.uploadFileIobs, myFormData: myFormData, sid: true }) 60 formdata({
61 url: api.uploadFileIobs,
62 myFormData: myFormData,
63 sid: true
64 })
64 .then(res => { 65 .then(res => {
66 if (res && res.content) {
65 this.loading = false; 67 this.loading = false;
66 this.iobsKey = res; 68 this.iobsKey = res.content;
67 this.$emit("uploadsuccess"); 69 this.$emit("uploadsuccess");
70 this.$emit("submit", this.iobsKey);
71 } else {
72 this.loading = false;
73 this.$emit("uploaderr");
74 }
68 }) 75 })
69 .catch(err => { 76 .catch(err => {
70 this.loading = false; 77 this.loading = false;
71 this.$emit("uploaderr"); 78 this.$emit("uploaderr");
72 }); 79 });
73 } 80 },
81 selectImgs() {
82 let _this = this;
83 let file = this.$refs.file.files[0];
84 this.file = file;
85 this.selected = true;
86 },
74 }, 87 },
75 mounted() {}, 88 mounted() {},
76 created() { 89 created() {
......
...@@ -91,6 +91,7 @@ ...@@ -91,6 +91,7 @@
91 display: flex; 91 display: flex;
92 justify-content: center; 92 justify-content: center;
93 .btn { 93 .btn {
94 @extend .fcc;
94 position: relative; 95 position: relative;
95 @include btc4(144px, 42px, 16px); 96 @include btc4(144px, 42px, 16px);
96 margin: 20px 24px 0; 97 margin: 20px 24px 0;
......
...@@ -22,8 +22,9 @@ ...@@ -22,8 +22,9 @@
22 <div class="modal-btn-wrap"> 22 <div class="modal-btn-wrap">
23 <div class="btn"> 23 <div class="btn">
24 <input type="file" @change="selectImgs" ref="file"> 24 <input type="file" @change="selectImgs" ref="file">
25 <van-loading v-if="loading" />{{$t('policyChangeContact.tax.Upload')}}</div> 25 {{$t('policyChangeContact.tax.Upload')}}</div>
26 <div @click="onSubmitHandler" class="btn" :class="{'disable':iobsKey ==''}">{{$t('policyChangeContact.tax.Submit')}}</div> 26 <div @click="onUploadHandler" class="btn" :class="{'disable':!file}">
27 <van-loading v-if="loading" />{{$t('policyChangeContact.tax.Submit')}}</div>
27 </div> 28 </div>
28 29
29 </div> 30 </div>
......
...@@ -3939,7 +3939,6 @@ export function getCnProvinceList(lan) { ...@@ -3939,7 +3939,6 @@ export function getCnProvinceList(lan) {
3939 // 获取根据省ID中国大陆城市 3939 // 获取根据省ID中国大陆城市
3940 export function getCityList(lan, PROVINCE_ID) { 3940 export function getCityList(lan, PROVINCE_ID) {
3941 let result = []; 3941 let result = [];
3942 console.log("lan:", lan);
3943 cnCityList.forEach(element => { 3942 cnCityList.forEach(element => {
3944 if (element.PROVINCE_ID == PROVINCE_ID) { 3943 if (element.PROVINCE_ID == PROVINCE_ID) {
3945 let data = { 3944 let data = {
......