Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-account-show
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-account-show
Commits
faa1d637
提交
faa1d637
authored
4月 20, 2022
作者:
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
7a794983
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
244 行增加
和
50 行删除
+244
-50
api.js
src/modules/payment/api.js
+8
-0
Invoice.vue
src/modules/payment/views/h5/Invoice.vue
+222
-47
List.vue
src/modules/payment/views/h5/List.vue
+14
-3
没有找到文件。
src/modules/payment/api.js
浏览文件 @
faa1d637
...
@@ -12,3 +12,11 @@ export function createInvoice(data) {
...
@@ -12,3 +12,11 @@ export function createInvoice(data) {
export
function
invoiceHistory
(
params
)
{
export
function
invoiceHistory
(
params
)
{
return
httpRequest
.
get
(
'/api/finance/v1/invoices/history'
,
{
params
})
return
httpRequest
.
get
(
'/api/finance/v1/invoices/history'
,
{
params
})
}
}
// 获取云抬头
export
function
getEnterpriseInfo
(
params
)
{
return
httpRequest
.
get
(
'/api/finance/v1/invoices/enterprise-info'
,
{
params
})
}
// 开具发票
export
function
handleDeleteInvoice
(
data
)
{
return
httpRequest
.
post
(
'/api/finance/v1/invoices/cancel'
,
data
)
}
src/modules/payment/views/h5/Invoice.vue
浏览文件 @
faa1d637
...
@@ -7,29 +7,154 @@
...
@@ -7,29 +7,154 @@
</van-tabs>
</van-tabs>
<van-form
:show-error=
"false"
ref=
"vanForm"
@
submit=
"fetchCreateInvoice"
>
<van-form
:show-error=
"false"
ref=
"vanForm"
@
submit=
"fetchCreateInvoice"
>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<div
class=
"search-pop"
v-if=
"searchShow"
>
<div
class=
"scroll"
>
<div
class=
"li"
@
click=
"selectEnterprise(item)"
v-for=
"(item, index) in enterprise"
:key=
"index"
>
{{
item
.
enterpriseName
}}
</div>
</div>
</div>
<h5>
发票信息
</h5>
<h5>
发票信息
</h5>
<van-field
readonly
clickable
name=
"picker"
:value=
"invoice_type_label"
label=
"发票类型"
placeholder=
"请选择发票类型"
@
click=
"showPicker = true"
:rules=
"[
{ required: true, message: '请选择发票类型', trigger: 'onChange' }]" required />
<van-field
<van-field
v-model=
"form.taxpayer_name"
name=
"pattern"
label=
"纳税人名称"
placeholder=
"请输入纳税人名称"
:rules=
"[
{ required: true, message: '请输入纳税人名称' }]" required right-icon="apps-o" @click-right-icon="handleHistory"/>
v-if=
"!isProject"
<van-field
v-if=
"form.taxpayer_type === '2'"
v-model=
"form.taxpayer_identifier"
name=
"pattern"
label=
"纳税人识别号"
placeholder=
"请输入纳税人识别号"
:rules=
"[
{ required: form.taxpayer_type === '2', message: '请输入纳税人识别号' }, { validator: invoiceValidator, message: '输入格式错误' }]" :required="form.taxpayer_type === '2'"/>
readonly
clickable
name=
"picker"
:value=
"invoice_type_label"
label=
"发票类型"
placeholder=
"请选择发票类型"
@
click=
"showPicker = true"
:rules=
"[
{ required: true, message: '请选择发票类型', trigger: 'onChange' }]"
required
/>
<van-field
v-else
:disabled=
"isProject"
readonly
clickable
name=
"picker"
:value=
"invoice_type_label"
label=
"发票类型"
placeholder=
"请选择发票类型"
:rules=
"[
{ required: true, message: '请选择发票类型', trigger: 'onChange' }]"
required
/>
<van-field
@
input=
"getEnterpriseInfo"
v-model=
"form.taxpayer_name"
name=
"pattern"
label=
"纳税人名称"
placeholder=
"请输入纳税人名称"
:rules=
"[
{ required: true, message: '请输入纳税人名称' }]"
required
right-icon="apps-o"
@click-right-icon="handleHistory"
/>
<van-field
v-if=
"form.taxpayer_type === '2'"
v-model=
"form.taxpayer_identifier"
name=
"pattern"
label=
"纳税人识别号"
placeholder=
"请输入纳税人识别号"
:rules=
"[
{ required: form.taxpayer_type === '2', message: '请输入纳税人识别号' },
{ validator: invoiceValidator, message: '输入格式错误' }
]"
:required="form.taxpayer_type === '2'"
/>
<template
v-if=
"form.invoice_type === '3'"
>
<template
v-if=
"form.invoice_type === '3'"
>
<van-field
v-model=
"form.taxpayer_address"
name=
"pattern"
label=
"地址"
placeholder=
"请输入地址"
:rules=
"[
{ required: true, message: '请输入地址' }]" required/>
<van-field
<van-field
v-model=
"form.taxpayer_mobile"
type=
"tel"
name=
"pattern"
label=
"电话"
placeholder=
"请输入电话"
:rules=
"[
{ required: true, message: '请输入电话' }, { validator: phoneValidator, message: '输入格式错误' }]" required/>
v-model=
"form.taxpayer_address"
<van-field
v-model=
"form.taxpayer_bank_name"
name=
"pattern"
label=
"开户行"
placeholder=
"请输入开户行"
:rules=
"[
{ required: true, message: '请输入开户行' }]" required/>
name=
"pattern"
<van-field
v-model=
"form.taxpayer_bank_account"
name=
"pattern"
label=
"银行账号"
placeholder=
"请输入银行账号"
:rules=
"[
{ required: true, message: '请输入银行账号' }]" required/>
label=
"地址"
placeholder=
"请输入地址"
:rules=
"[
{ required: true, message: '请输入地址' }]"
required
/>
<van-field
v-model=
"form.taxpayer_mobile"
type=
"tel"
name=
"pattern"
label=
"电话"
placeholder=
"请输入电话"
:rules=
"[
{ required: true, message: '请输入电话' },
{ validator: phoneValidator, message: '输入格式错误' }
]"
required
/>
<van-field
v-model=
"form.taxpayer_bank_name"
name=
"pattern"
label=
"开户行"
placeholder=
"请输入开户行"
:rules=
"[
{ required: true, message: '请输入开户行' }]"
required
/>
<van-field
v-model=
"form.taxpayer_bank_account"
name=
"pattern"
label=
"银行账号"
placeholder=
"请输入银行账号"
:rules=
"[
{ required: true, message: '请输入银行账号' }]"
required
/>
</
template
>
</
template
>
<van-field
v-model=
"form.invoice_remark"
name=
"pattern"
label=
"备注"
placeholder=
"请输入备注"
disabled
/>
<van-field
v-model=
"form.invoice_remark"
name=
"pattern"
label=
"备注"
placeholder=
"请输入备注"
disabled
/>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<h5>
收票信息
</h5>
<h5>
收票信息
</h5>
<van-field
v-if=
"form.invoice_type === '2'"
v-model=
"form.recipient_email"
name=
"pattern"
label=
"邮箱地址"
placeholder=
"请输入邮箱地址"
:rules=
"[{ required: true, message: '请输入邮箱地址' }, { validator: emailValidator, message: '输入格式错误' }]"
required
/>
<van-field
v-if=
"form.invoice_type === '2'"
v-model=
"form.recipient_email"
name=
"pattern"
label=
"邮箱地址"
placeholder=
"请输入邮箱地址"
:rules=
"[
{ required: true, message: '请输入邮箱地址' },
{ validator: emailValidator, message: '输入格式错误' }
]"
required
/>
<
template
v-else
>
<
template
v-else
>
<van-field
v-model=
"form.recipient_address"
name=
"pattern"
label=
"邮寄地址"
placeholder=
"请输入邮寄地址"
:rules=
"[
{ required: true, message: '请输入邮寄地址' }]" required/>
<van-field
<van-field
v-model=
"form.recipient_name"
name=
"pattern"
label=
"收件人名称"
placeholder=
"请输入收件人名称"
:rules=
"[
{ required: true, message: '请输入收件人名称' }]" required/>
v-model=
"form.recipient_address"
<van-field
v-model=
"form.recipient_mobile"
type=
"tel"
name=
"pattern"
label=
"收件人手机号"
placeholder=
"请输入收件人手机号"
:rules=
"[
{ required: true, message: '请输入收件人手机号' }, { validator: phoneValidator, message: '输入格式错误' }]" required/>
name=
"pattern"
<van-field
v-model=
"form.sales_rep_user_id_name"
name=
"pattern"
label=
"票据跟进人"
placeholder=
"请输入票据跟进人"
disabled
/>
label=
"邮寄地址"
placeholder=
"请输入邮寄地址"
:rules=
"[
{ required: true, message: '请输入邮寄地址' }]"
required
/>
<van-field
v-model=
"form.recipient_name"
name=
"pattern"
label=
"收件人名称"
placeholder=
"请输入收件人名称"
:rules=
"[
{ required: true, message: '请输入收件人名称' }]"
required
/>
<van-field
v-model=
"form.recipient_mobile"
type=
"tel"
name=
"pattern"
label=
"收件人手机号"
placeholder=
"请输入收件人手机号"
:rules=
"[
{ required: true, message: '请输入收件人手机号' },
{ validator: phoneValidator, message: '输入格式错误' }
]"
required
/>
<van-field
v-model=
"form.sales_rep_user_id_name"
name=
"pattern"
label=
"票据跟进人"
placeholder=
"请输入票据跟进人"
disabled
/>
</
template
>
</
template
>
</div>
</div>
<div
style=
"margin: 16px
;
"
>
<div
style=
"margin: 16px"
>
<van-button
round
block
type=
"info"
native-type=
"submit"
size=
"small"
>
确认提交
</van-button>
<van-button
round
block
type=
"info"
native-type=
"submit"
size=
"small"
>
确认提交
</van-button>
</div>
</div>
</van-form>
</van-form>
...
@@ -43,15 +168,17 @@
...
@@ -43,15 +168,17 @@
/>
/>
</van-popup>
</van-popup>
<van-popup
v-model=
"showPopup"
position=
"bottom"
:style=
"{ height: '60%' }"
>
<van-popup
v-model=
"showPopup"
position=
"bottom"
:style=
"{ height: '60%' }"
>
<p
class=
"popup-title van-hairline--bottom"
><span>
选择历史开票信息
</span><van-icon
name=
"cross"
@
click=
"showPopup = false"
/></p>
<p
class=
"popup-title van-hairline--bottom"
>
<history-invoice-list
v-if=
"showPopup"
@
select=
"handleSelect"
/>
<span>
选择历史开票信息
</span><van-icon
name=
"cross"
@
click=
"showPopup = false"
/>
</p>
<history-invoice-list
v-if=
"showPopup"
@
select=
"handleSelect"
/>
</van-popup>
</van-popup>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
HistoryInvoiceList
from
'../../components/HistoryInvoiceList.vue'
import
HistoryInvoiceList
from
'../../components/HistoryInvoiceList.vue'
import
{
createInvoice
}
from
'../../api'
import
{
createInvoice
,
getEnterpriseInfo
}
from
'../../api'
import
{
Toast
}
from
'vant'
import
{
Toast
}
from
'vant'
const
defaultForm
=
{
const
defaultForm
=
{
invoice_type
:
''
,
invoice_type
:
''
,
...
@@ -72,6 +199,7 @@ export default {
...
@@ -72,6 +199,7 @@ export default {
components
:
{
HistoryInvoiceList
},
components
:
{
HistoryInvoiceList
},
data
()
{
data
()
{
return
{
return
{
searchShow
:
false
,
invoice_type_label
:
''
,
invoice_type_label
:
''
,
form
:
{},
form
:
{},
showPicker
:
false
,
showPicker
:
false
,
...
@@ -79,6 +207,9 @@ export default {
...
@@ -79,6 +207,9 @@ export default {
}
}
},
},
computed
:
{
computed
:
{
isProject
()
{
return
this
.
$route
.
query
.
project_id
===
'5005'
&&
this
.
$route
.
query
.
type
===
'60'
},
invoiceTypeList
()
{
invoiceTypeList
()
{
const
list
=
[
const
list
=
[
// { label: '普通发票(纸质)', value: '1' },
// { label: '普通发票(纸质)', value: '1' },
...
@@ -100,9 +231,28 @@ export default {
...
@@ -100,9 +231,28 @@ export default {
created
()
{
created
()
{
defaultForm
.
invoice_remark
=
this
.
query
.
remark
||
''
defaultForm
.
invoice_remark
=
this
.
query
.
remark
||
''
defaultForm
.
sales_rep_user_id_name
=
this
.
query
.
name
||
''
defaultForm
.
sales_rep_user_id_name
=
this
.
query
.
name
||
''
defaultForm
.
invoice_type
=
this
.
isProject
?
'2'
:
''
this
.
invoice_type_label
=
this
.
isProject
?
'普通发票(电子)'
:
''
this
.
form
=
Object
.
assign
({
taxpayer_type
:
'2'
},
defaultForm
)
this
.
form
=
Object
.
assign
({
taxpayer_type
:
'2'
},
defaultForm
)
},
},
methods
:
{
methods
:
{
selectEnterprise
(
item
)
{
this
.
form
.
taxpayer_identifier
=
item
.
enterpriseCode
this
.
form
.
taxpayer_name
=
item
.
enterpriseName
this
.
searchShow
=
false
},
getEnterpriseInfo
()
{
this
.
form
.
taxpayer_identifier
=
''
getEnterpriseInfo
({
name
:
this
.
form
.
taxpayer_name
}).
then
(
res
=>
{
if
(
res
.
data
.
list
.
length
)
{
this
.
enterprise
=
res
.
data
.
list
this
.
searchShow
=
true
}
else
{
this
.
searchShow
=
false
}
})
},
phoneValidator
(
val
)
{
phoneValidator
(
val
)
{
if
(
val
===
''
)
return
true
if
(
val
===
''
)
return
true
return
/^1
(
3
[
0-9
]
|4
[
01456879
]
|5
[
0-35-9
]
|6
[
2567
]
|7
[
0-8
]
|8
[
0-9
]
|9
[
0-35-9
])\d{8}
$/
.
test
(
val
)
return
/^1
(
3
[
0-9
]
|4
[
01456879
]
|5
[
0-35-9
]
|6
[
2567
]
|7
[
0-8
]
|8
[
0-9
]
|9
[
0-35-9
])\d{8}
$/
.
test
(
val
)
...
@@ -127,9 +277,9 @@ export default {
...
@@ -127,9 +277,9 @@ export default {
setInvoiceType
(
val
)
{
setInvoiceType
(
val
)
{
const
item
=
this
.
invoiceTypeList
.
find
(
item
=>
item
.
value
===
val
)
const
item
=
this
.
invoiceTypeList
.
find
(
item
=>
item
.
value
===
val
)
if
(
item
)
{
if
(
item
)
{
this
.
invoice_type_label
=
item
.
label
this
.
invoice_type_label
=
this
.
isProject
?
'普通发票(电子)'
:
item
.
label
}
else
{
}
else
{
this
.
invoice_type_label
=
''
this
.
invoice_type_label
=
this
.
isProject
?
'普通发票(电子)'
:
''
window
.
setTimeout
(()
=>
{
window
.
setTimeout
(()
=>
{
this
.
$refs
.
vanForm
.
resetValidation
()
this
.
$refs
.
vanForm
.
resetValidation
()
},
1
)
},
1
)
...
@@ -152,44 +302,69 @@ export default {
...
@@ -152,44 +302,69 @@ export default {
fetchCreateInvoice
()
{
fetchCreateInvoice
()
{
const
params
=
Object
.
assign
({},
this
.
form
)
const
params
=
Object
.
assign
({},
this
.
form
)
params
.
payment_id
=
this
.
id
params
.
payment_id
=
this
.
id
createInvoice
(
params
).
then
(
res
=>
{
createInvoice
(
params
)
// Toast.success('提交成功')
.
then
(
res
=>
{
const
type
=
this
.
form
.
invoice_type
===
'2'
?
'1'
:
'2'
// Toast.success('提交成功')
this
.
$router
.
push
({
path
:
'/h5/payment/invoice-success'
,
query
:
{
type
}
})
const
type
=
this
.
form
.
invoice_type
===
'2'
?
'1'
:
'2'
}).
catch
(
err
=>
{
this
.
$router
.
push
({
path
:
'/h5/payment/invoice-success'
,
query
:
{
type
}
})
Toast
.
fail
((
err
.
data
&&
err
.
data
.
message
)
||
'提交失败'
)
})
})
.
catch
(
err
=>
{
Toast
.
fail
((
err
.
data
&&
err
.
data
.
message
)
||
'提交失败'
)
})
}
}
}
}
}
}
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
lang=
"scss"
>
.invoice-container
{
.invoice-container
{
padding-top
:
20px
;
padding-top
:
20px
;
position
:
relative
;
}
}
.form-group
{
.search-pop
{
margin
:
10px
15px
0
;
width
:
-
webkit-fill-available
;
position
:
absolute
;
top
:
123px
;
left
:
0
;
padding
:
10px
;
background
:
#fff
;
z-index
:
999
;
box-shadow
:
0px
10px
15px
rgba
(
0
,
0
,
0
,
0
.2
);
border-radius
:
3px
;
.li
{
padding
:
10px
;
font-size
:
14px
;
color
:
#646566
;
border-bottom
:
1px
solid
#ebedf0
;
}
.scroll
{
max-height
:
200px
;
overflow-y
:
scroll
;
}
}
}
.form-group
h5
{
.form-group
{
font-size
:
16px
;
position
:
relative
;
line-height
:
36px
;
margin
:
10px
15px
0
;
font-weight
:
normal
;
color
:
#aaa
;
}
}
.popup-title
{
.form-group
h5
{
font-size
:
16px
;
font-size
:
16px
;
display
:
flex
;
line-height
:
36px
;
font-weight
:
normal
;
color
:
#aaa
;
}
.popup-title
{
font-size
:
16px
;
display
:
flex
;
height
:
44px
;
height
:
44px
;
line-height
:
44px
;
line-height
:
44px
;
}
}
.popup-title
span
{
.popup-title
span
{
flex
:
1
;
flex
:
1
;
text-indent
:
20px
;
text-indent
:
20px
;
}
}
.popup-title
i
{
.popup-title
i
{
height
:
44px
;
height
:
44px
;
line-height
:
44px
;
line-height
:
44px
;
padding
:
0
14px
;
padding
:
0
14px
;
}
}
</
style
>
</
style
>
src/modules/payment/views/h5/List.vue
浏览文件 @
faa1d637
...
@@ -17,7 +17,13 @@
...
@@ -17,7 +17,13 @@
<div
class=
"right"
>
<div
class=
"right"
>
<p><span>
¥
</span>
{{
parseFloat
(
item
.
amount_received
)
+
parseFloat
(
item
.
service_charge
)
|
toFixed
}}
</p>
<p><span>
¥
</span>
{{
parseFloat
(
item
.
amount_received
)
+
parseFloat
(
item
.
service_charge
)
|
toFixed
}}
</p>
</div>
</div>
<van-button
v-if=
"item.real_invoice_status === 1"
class=
"invoice-btn"
plain
round
type=
"primary"
size=
"mini"
color=
"#C01540"
@
click
.
stop=
"handleInvoice(item)"
>
开具发票
</van-button>
<template
v-if=
"item.project_id == '5005' && item.type == '60'"
>
<van-button
v-if=
"item.real_invoice_status === 1"
class=
"invoice-btn"
plain
round
type=
"primary"
size=
"mini"
color=
"#C01540"
@
click
.
stop=
"handleInvoice(item)"
>
{{
item
.
invoice_status
==
6
?
'重开发票'
:
'开具发票'
}}
</van-button>
<van-button
v-if=
"item.invoice_status == 4"
class=
"invoice-btn"
plain
round
type=
"primary"
size=
"mini"
color=
"#C01540"
@
click
.
stop=
"handleDeleteInvoice(item)"
>
重开发票
</van-button>
</
template
>
<
template
v-else
>
<van-button
v-if=
"item.real_invoice_status === 1"
class=
"invoice-btn"
plain
round
type=
"primary"
size=
"mini"
color=
"#C01540"
@
click
.
stop=
"handleInvoice(item)"
>
开具发票
</van-button>
</
template
>
</div>
</div>
<
template
slot=
"finished"
>
{{
list
.
length
>
8
?
'没有更多了'
:
''
}}
</
template
>
<
template
slot=
"finished"
>
{{
list
.
length
>
8
?
'没有更多了'
:
''
}}
</
template
>
</van-list>
</van-list>
...
@@ -27,7 +33,7 @@
...
@@ -27,7 +33,7 @@
</template>
</template>
<
script
>
<
script
>
import
{
getPayList
}
from
'../../api'
import
{
getPayList
,
handleDeleteInvoice
}
from
'../../api'
const
statusMap
=
{
const
statusMap
=
{
1
:
'不可开具'
,
1
:
'不可开具'
,
2
:
'未开具'
,
2
:
'未开具'
,
...
@@ -59,8 +65,13 @@ export default {
...
@@ -59,8 +65,13 @@ export default {
}
}
},
},
methods
:
{
methods
:
{
handleDeleteInvoice
(
row
)
{
handleDeleteInvoice
({
payment_id
:
row
.
id
}).
then
(
res
=>
{
this
.
$router
.
go
(
0
)
})
},
handleInvoice
(
val
)
{
handleInvoice
(
val
)
{
this
.
$router
.
push
({
path
:
'/h5/payment/invoice'
,
query
:
{
id
:
val
.
id
,
name
:
val
.
sales_rep_user_id_name
,
remark
:
val
.
payer_name
}
})
this
.
$router
.
push
({
path
:
'/h5/payment/invoice'
,
query
:
{
id
:
val
.
id
,
name
:
val
.
sales_rep_user_id_name
,
remark
:
val
.
payer_name
,
project_id
:
val
.
project_id
,
type
:
val
.
type
}
})
},
},
handleDetials
(
val
)
{
handleDetials
(
val
)
{
window
.
localStorage
.
setItem
(
'invoiceDetails'
,
JSON
.
stringify
(
val
))
window
.
localStorage
.
setItem
(
'invoiceDetails'
,
JSON
.
stringify
(
val
))
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论