Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
dev
/
pingan-life-index-pro
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
e40c995b
authored
2020-05-21 16:38:13 +0800
by
simon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
#10美国税务文件处理
用户体系三语
1 parent
c078a97e
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
99 additions
and
49 deletions
src/common/lang/en.js
src/common/lang/tc.js
src/common/lang/zh.js
src/pages/custom-service/components/policy-change-contact.js
src/pages/custom-service/components/policy-change-contact.vue
src/pages/custom-service/components/us-tax-form-upload-comp.js
src/pages/custom-service/components/us-tax-form-upload-comp.scss
src/pages/custom-service/components/us-tax-form-upload-comp.vue
src/utils/biz.js
src/common/lang/en.js
View file @
e40c995
...
...
@@ -240,7 +240,6 @@ module.exports = {
oe3
:
"Please enter the picture verification code"
,
oe4
:
"Your verify code is not correct. Please try again"
,
},
accountPlaceholder
:
"Please setup user name "
,
},
session
:
{
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 = {
e14
:
"Please enter your name"
},
account
:
"Account"
,
accountPlaceholder
:
"
please enter
user name"
,
accountPlaceholder
:
"
Please setup
user name"
,
},
passwordCheck
:
{
error1
:
"Password length cannot be less than 8 bits"
,
...
...
src/common/lang/tc.js
View file @
e40c995
...
...
@@ -288,7 +288,7 @@ module.exports = {
e14
:
"請輸入您的姓名"
},
account
:
"賬號"
,
accountPlaceholder
:
"請設置用戶名"
,
accountPlaceholder
:
"請設置用戶名
稱
"
,
},
session
:
{
sidExpire
:
"長時間未操作,為了您賬戶的安全,請登入後再操作"
...
...
src/common/lang/zh.js
View file @
e40c995
...
...
@@ -214,7 +214,7 @@ module.exports = {
loginType1
:
"动态密码登录"
,
loginType2
:
"动态密码登入"
,
account
:
"账号"
,
accountPlaceholder
:
"请输入用户名
称
"
,
accountPlaceholder
:
"请输入用户名"
,
password
:
"密码"
,
passwordPlaceholder
:
"输入登入密码"
,
verifyPlaceholder
:
"请输入验证码"
,
...
...
src/pages/custom-service/components/policy-change-contact.js
View file @
e40c995
import
api
from
"@/api/api"
;
import
{
httpGet
,
httpPost
}
from
"@/api/fetch-api.js"
;
import
{
httpGet
,
httpPost
}
from
"@/api/fetch-api.js"
;
import
{
contactMethodCheck
}
from
"@utils/utils.js"
;
import
{
setTitle
,
ascSort
}
from
"@/utils/utils.js"
;
import
{
contactMethodCheck
}
from
"@utils/utils.js"
;
import
{
setTitle
,
ascSort
}
from
"@/utils/utils.js"
;
import
{
getNationsList
,
getNationsPhoneCodeList
,
...
...
@@ -16,7 +24,9 @@ import PolicyHeadList from "./policy-head-list.vue";
import
modalComp
from
"@/components/modal-comp/modal-comp.vue"
;
import
Modal2Comp
from
"@/components/modal2-comp/modal2-comp.vue"
;
import
Vue
from
"vue"
;
import
{
Loading
}
from
"vant"
;
import
{
Loading
}
from
"vant"
;
Vue
.
use
(
Loading
);
export
default
{
...
...
@@ -94,16 +104,14 @@ export default {
return
this
.
$i18n
.
locale
||
"tc"
;
},
i18n
()
{
return
this
.
$i18n
.
messages
&&
this
.
$i18n
.
locale
?
this
.
$i18n
.
messages
[
this
.
$i18n
.
locale
]
:
{};
return
this
.
$i18n
.
messages
&&
this
.
$i18n
.
locale
?
this
.
$i18n
.
messages
[
this
.
$i18n
.
locale
]
:
{};
},
submitBtnDisabled
()
{
// let b1 = !this.selectedPolicies || this.selectedPolicies.length == 0;
// let b2 = !this.data.address && !this.data.email && !this.data.mobile;
let
b1
=
!
this
.
selectedPolicies
||
this
.
selectedPolicies
.
length
==
0
;
let
b2
=
!
this
.
data
.
address
||
let
b2
=
!
this
.
data
.
address
||
!
this
.
data
.
email
||
!
this
.
data
.
mobile
||
!
this
.
data
.
mobileAreaCode
||
...
...
@@ -141,11 +149,21 @@ export default {
this
.
showModal
(
this
.
i18n
.
policyChangeContact
.
success
);
},
showUploadSuccess
()
{
this
.
usTaxFormUploadCompVisible
=
false
;
this
.
showModal
(
this
.
i18n
.
policyChangeContact
.
uploadSuccess
);
this
.
modalVisiableTimeoutIndex
=
setTimeout
(()
=>
{
this
.
modalVisiable
=
false
;
},
3000
);
},
// 判断 美国地区需要上传文件
checkShowUSATax
()
{
let
result
=
this
.
isUSA
&&
!
this
.
data
.
iobsKey
;
if
(
result
){
this
.
usTaxFormUploadCompVisible
=
true
;
this
.
$refs
.
usTax
.
initData
();
}
return
result
;
},
// 提交前准备
updateContactsHandler
()
{
if
(
this
.
submitBtnDisabled
)
{
...
...
@@ -172,9 +190,7 @@ export default {
if
(
b
)
{
// 判断是否美国 出
if
(
this
.
isUSA
)
{
this
.
usTaxFormUploadCompVisible
=
true
;
}
else
{
if
(
!
this
.
checkShowUSATax
())
{
this
.
doSubmit
();
}
}
...
...
@@ -183,13 +199,15 @@ export default {
* 提交表单
*/
doSubmit
(
val
=
{})
{
// this.usTaxFormUploadCompVisible = false;
if
(
this
.
loading
)
{
return
;
}
let
policies
=
[];
this
.
selectedPolicies
.
forEach
(
element
=>
{
policies
.
push
({
policyId
:
element
.
id
,
policyCode
:
element
.
code
});
policies
.
push
({
policyId
:
element
.
id
,
policyCode
:
element
.
code
});
});
let
data
=
Object
.
assign
(
this
.
data
,
val
);
...
...
@@ -203,6 +221,7 @@ export default {
data
.
policyCode
=
""
;
this
.
loading
=
true
;
console
.
log
(
"data:"
,
data
);
httpPost
({
url
:
api
.
policyContactApi
,
data
:
data
,
...
...
@@ -225,7 +244,9 @@ export default {
* 从美国税务表单组件提交
*/
onUsTaxSubmit
(
val
)
{
this
.
doSubmit
(
val
);
console
.
log
(
"val:"
,
val
);
this
.
data
.
iobsKey
=
val
;
// this.doSubmit(val);
},
checkMobile
()
{
...
...
@@ -290,6 +311,9 @@ export default {
* 选择国家
*/
onChangeNations
()
{
if
(
!
this
.
isUSA
)
{
this
.
data
.
iobsKey
=
""
;
}
// this.checkProvince();
},
/**
...
...
@@ -360,7 +384,6 @@ export default {
})
.
then
(
response
=>
{
this
.
loading
=
false
;
this
.
dataInit
=
true
;
if
(
response
)
{
this
.
data
=
Object
.
assign
(
this
.
data
,
response
);
if
(
response
.
provinceId
)
{
...
...
@@ -370,6 +393,10 @@ export default {
);
}
}
// 最后执行,确保data不被watch
setTimeout
(()
=>
{
this
.
dataInit
=
true
;
},
0
);
})
.
catch
(
res
=>
{
this
.
loading
=
false
;
...
...
@@ -418,6 +445,17 @@ export default {
},
"data.cityId"
:
function
()
{
this
.
errorTips
.
e7
=
""
;
},
/**
* 那就客户进行下一步任意操作的时候弹
*/
data
:
{
deep
:
true
,
handler
:
function
(
newVal
,
oldVal
)
{
if
(
this
.
dataInit
)
{
this
.
checkShowUSATax
();
}
}
}
},
mounted
()
{
...
...
@@ -427,8 +465,7 @@ export default {
this
.
$root
.
eventBus
.
$on
(
"langChange"
,
()
=>
{
try
{
this
.
initData
();
}
catch
(
e
)
{
}
}
catch
(
e
)
{}
});
}
};
...
...
src/pages/custom-service/components/policy-change-contact.vue
View file @
e40c995
...
...
@@ -6,7 +6,7 @@
<auth
@
onLogin=
"userLogin"
@
onLogout=
"userLogout"
:checkProfile=
"true"
ref=
"auth"
:tipModel=
"'m2'"
></auth>
<modal-comp
:visible=
"modalVisiable"
:show-confirm=
"false"
:icon=
"modalIcon"
:content=
"modalContent"
:confirm=
"modalCallback"
:overlay=
"modalCallback"
></modal-comp>
<modal2-comp
:visible=
"uploadErrorVisible"
:close=
"()=>
{uploadErrorVisible = false}" :content="$t('glbalTips.sysError')">
</modal2-comp>
<us-tax-form-upload-comp
:visible=
"usTaxFormUploadCompVisible"
@
close=
"usTaxFormUploadCompVisible = false"
@
submit=
"onUsTaxSubmit"
@
uploadsuccess=
"showUploadSuccess"
@
uploaderr=
"uploadErrorVisible = true"
></us-tax-form-upload-comp>
<us-tax-form-upload-comp
ref=
"usTax"
:visible=
"usTaxFormUploadCompVisible"
@
close=
"usTaxFormUploadCompVisible = false"
@
submit=
"onUsTaxSubmit"
@
uploadsuccess=
"showUploadSuccess"
@
uploaderr=
"uploadErrorVisible = true"
></us-tax-form-upload-comp>
<template
v-if=
"showForm"
>
<policy-head-list
:multiSelectable=
"true"
@
onSelect=
"handlePolicySelect"
:type=
"2"
></policy-head-list>
...
...
src/pages/custom-service/components/us-tax-form-upload-comp.js
View file @
e40c995
...
...
@@ -5,7 +5,9 @@ import api from "@/api/api";
import
{
formdata
}
from
'@/api/fetch-api.js'
import
{
Loading
}
from
'vant'
;
import
{
Loading
}
from
'vant'
;
export
default
{
props
:
{
...
...
@@ -20,8 +22,10 @@ export default {
data
()
{
return
{
fileName
:
""
,
file
:
null
,
iobsKey
:
""
,
loading
:
false
loading
:
false
,
selected
:
false
};
},
components
:
{},
...
...
@@ -31,7 +35,12 @@ export default {
}
},
methods
:
{
initData
()
{},
initData
()
{
this
.
file
=
null
;
this
.
iobsKey
=
""
;
this
.
loading
=
false
;
this
.
selected
=
false
;
},
onOverLayHandler
()
{
console
.
log
(
"onOverLayHandler"
);
...
...
@@ -40,37 +49,41 @@ export default {
toDownLoadTaxForm
()
{
window
.
open
(
"https://www.irs.gov/"
);
},
onUploadHandler
()
{},
onSubmitHandler
()
{
if
(
!
this
.
iobsKey
)
return
;
this
.
$emit
(
"submit"
,
{
iobsKey
:
this
.
iobsKey
});
},
selectImgs
()
{
let
_this
=
this
;
this
.
iobsKey
=
""
;
let
file
=
this
.
$refs
.
file
.
files
[
0
];
let
item
=
{
name
:
file
.
name
,
size
:
file
.
size
,
file
:
file
};
// 转base64
onUploadHandler
()
{
let
file
=
this
.
file
;
if
(
!
file
)
return
;
if
(
this
.
loading
)
return
;
this
.
loading
=
true
;
let
myFormData
=
new
FormData
();
myFormData
.
append
(
"file"
,
file
);
formdata
({
url
:
api
.
uploadFileIobs
,
myFormData
:
myFormData
,
sid
:
true
})
formdata
({
url
:
api
.
uploadFileIobs
,
myFormData
:
myFormData
,
sid
:
true
})
.
then
(
res
=>
{
if
(
res
&&
res
.
content
)
{
this
.
loading
=
false
;
this
.
iobsKey
=
res
;
this
.
iobsKey
=
res
.
content
;
this
.
$emit
(
"uploadsuccess"
);
this
.
$emit
(
"submit"
,
this
.
iobsKey
);
}
else
{
this
.
loading
=
false
;
this
.
$emit
(
"uploaderr"
);
}
})
.
catch
(
err
=>
{
this
.
loading
=
false
;
this
.
$emit
(
"uploaderr"
);
});
}
},
selectImgs
()
{
let
_this
=
this
;
let
file
=
this
.
$refs
.
file
.
files
[
0
];
this
.
file
=
file
;
this
.
selected
=
true
;
},
},
mounted
()
{},
created
()
{
...
...
src/pages/custom-service/components/us-tax-form-upload-comp.scss
View file @
e40c995
...
...
@@ -91,6 +91,7 @@
display
:
flex
;
justify-content
:
center
;
.btn
{
@extend
.fcc
;
position
:
relative
;
@include
btc4
(
144px
,
42px
,
16px
);
margin
:
20px
24px
0
;
...
...
src/pages/custom-service/components/us-tax-form-upload-comp.vue
View file @
e40c995
...
...
@@ -22,8 +22,9 @@
<div
class=
"modal-btn-wrap"
>
<div
class=
"btn"
>
<input
type=
"file"
@
change=
"selectImgs"
ref=
"file"
>
<van-loading
v-if=
"loading"
/>
{{
$t
(
'policyChangeContact.tax.Upload'
)
}}
</div>
<div
@
click=
"onSubmitHandler"
class=
"btn"
:class=
"
{'disable':iobsKey ==''}">
{{
$t
(
'policyChangeContact.tax.Submit'
)
}}
</div>
{{
$t
(
'policyChangeContact.tax.Upload'
)
}}
</div>
<div
@
click=
"onUploadHandler"
class=
"btn"
:class=
"
{'disable':!file}">
<van-loading
v-if=
"loading"
/>
{{
$t
(
'policyChangeContact.tax.Submit'
)
}}
</div>
</div>
</div>
...
...
src/utils/biz.js
View file @
e40c995
...
...
@@ -3939,7 +3939,6 @@ export function getCnProvinceList(lan) {
// 获取根据省ID中国大陆城市
export
function
getCityList
(
lan
,
PROVINCE_ID
)
{
let
result
=
[];
console
.
log
(
"lan:"
,
lan
);
cnCityList
.
forEach
(
element
=>
{
if
(
element
.
PROVINCE_ID
==
PROVINCE_ID
)
{
let
data
=
{
...
...
Please
register
or
sign in
to post a comment