Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
a781c844
Commit
a781c844
authored
Apr 01, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dd
parent
a116d058
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
18 deletions
+25
-18
xgg-admin/app/base/controller/impl/invoice/invoiceCtl.js
+15
-1
xgg-admin/app/base/service/impl/invoice/invoiceSve.js
+10
-17
No files found.
xgg-admin/app/base/controller/impl/invoice/invoiceCtl.js
View file @
a781c844
...
@@ -21,7 +21,7 @@ class InvoiceCtl extends CtlBase {
...
@@ -21,7 +21,7 @@ class InvoiceCtl extends CtlBase {
}
}
/**
/**
* 发票申请列表-平台
* 发票申请列表-平台
(管理员)
* @param {*} pobj
* @param {*} pobj
*/
*/
async
invoicePage
(
pobj
,
pobj2
,
req
)
{
async
invoicePage
(
pobj
,
pobj2
,
req
)
{
...
@@ -105,6 +105,20 @@ class InvoiceCtl extends CtlBase {
...
@@ -105,6 +105,20 @@ class InvoiceCtl extends CtlBase {
}
}
}
}
/**
* 发票推送
* @param {*} pobj
* @param {*} pobj2
* @param {*} req
*/
async
uploadDetailSve
(
pobj
,
pobj2
,
req
){
if
(
!
pobj
.
invoice_id
){
return
system
.
getResult
(
null
,
`参数错误 发票ID 不能为空`
);
}
let
res
=
await
this
.
invoiceSve
.
uploadDetailSve
(
pobj
.
invoice_id
);
return
res
;
}
// /**
// /**
// * 申请发票校验
// * 申请发票校验
// * @param {*} pobj
// * @param {*} pobj
...
...
xgg-admin/app/base/service/impl/invoice/invoiceSve.js
View file @
a781c844
...
@@ -45,22 +45,7 @@ class InvoiceService extends ServiceBase {
...
@@ -45,22 +45,7 @@ class InvoiceService extends ServiceBase {
}
}
async
handleStatus
(
params
)
{
async
handleStatus
(
params
)
{
var
rs
=
await
this
.
callms
(
"invoice"
,
"handleStatus"
,
params
);
return
await
this
.
callms
(
"invoice"
,
"handleStatus"
,
params
);
if
(
params
.
stataus
==
"1120"
){
try
{
if
(
res
.
status
===
0
){
await
uploadDetailSve
(
params
.
invoice_id
);
return
rs
;
}
else
{
return
system
.
getResult
(
null
,
`提交发票失败 非法的发票ID`
);
}
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResult
(
"提交财税系统失败,请联系管理员"
);
}
}
else
{
return
rs
;
}
}
}
async
invoice
(
params
)
{
async
invoice
(
params
)
{
...
@@ -185,6 +170,12 @@ class InvoiceService extends ServiceBase {
...
@@ -185,6 +170,12 @@ class InvoiceService extends ServiceBase {
return
system
.
getResult
(
`交付商不存在`
);
return
system
.
getResult
(
`交付商不存在`
);
}
}
var
deliver
=
await
this
.
callms
(
"common"
,
"deliverInfo"
,
{
id
:
invoice
.
data
.
invoicedeliver
[
0
].
deliver_id
});
var
deliver
=
await
this
.
callms
(
"common"
,
"deliverInfo"
,
{
id
:
invoice
.
data
.
invoicedeliver
[
0
].
deliver_id
});
if
(
!
deliver
.
data
){
return
system
.
getResult
(
null
,
`交付商不存在`
);
}
if
(
!
deliver
.
data
.
nt_company_id
){
return
system
.
getResult
(
null
,
`个体户还未建账,请先建账`
);
}
let
_params
=
await
this
.
buildParams
(
businessmen
.
data
,
invoice
.
data
,
deliver
.
data
)
||
{};
let
_params
=
await
this
.
buildParams
(
businessmen
.
data
,
invoice
.
data
,
deliver
.
data
)
||
{};
try
{
try
{
if
(
!
_params
){
if
(
!
_params
){
...
@@ -197,6 +188,8 @@ class InvoiceService extends ServiceBase {
...
@@ -197,6 +188,8 @@ class InvoiceService extends ServiceBase {
if
(
!
res
||
!
res
.
data
)
{
if
(
!
res
||
!
res
.
data
)
{
return
system
.
getResult
(
null
,
"提交发票失败"
);
return
system
.
getResult
(
null
,
"提交发票失败"
);
}
}
//更新发票建账
await
this
.
callms
(
"invoice"
,
"updateAccountCreation"
,
{
id
:
invoice_id
});
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
error
);
console
.
log
(
error
);
...
@@ -213,7 +206,7 @@ class InvoiceService extends ServiceBase {
...
@@ -213,7 +206,7 @@ class InvoiceService extends ServiceBase {
return
system
.
getResult
(
null
,
`系统错误 发票信息错误`
);
return
system
.
getResult
(
null
,
`系统错误 发票信息错误`
);
}
}
let
params
=
{
let
params
=
{
companyId
:
deliver
.
nt_company_id
,
//公司ID
companyId
:
deliver
.
nt_company_id
,
//公司ID
customerId
:
businessmen
.
customer_id
,
//客户ID
customerId
:
businessmen
.
customer_id
,
//客户ID
uploadPeriod
:
moment
(
businessmen
.
create_account_time
).
format
(
'YYYYMM'
),
//上传账期
uploadPeriod
:
moment
(
businessmen
.
create_account_time
).
format
(
'YYYYMM'
),
//上传账期
imageName
:
invoice
[
'invoice_img'
].
slice
(
str
.
lastIndexOf
(
"/"
)
+
1
,
-
1
)
||
""
,
//图片名称
imageName
:
invoice
[
'invoice_img'
].
slice
(
str
.
lastIndexOf
(
"/"
)
+
1
,
-
1
)
||
""
,
//图片名称
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment