Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
朱继来
/
后台订单管理
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
4899f55d
authored
Sep 24, 2020
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整下单发票
parent
2fc0978f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
20 deletions
app/Http/Controllers/AddOrderController.php
public/js/add_order.js
resources/views/addOrder/content.blade.php
app/Http/Controllers/AddOrderController.php
View file @
4899f55d
...
...
@@ -159,12 +159,12 @@ Class AddOrderController extends Controller
}
}
$address
=
DB
::
connection
(
'order'
)
->
table
(
'lie_user_address'
)
->
where
(
'user_id'
,
$user
->
user_id
)
->
get
();
// 收货地址
$invoice
=
DB
::
connection
(
'order'
)
->
table
(
'lie_taxinfo'
)
->
where
(
'user_id'
,
$user
->
user_id
)
->
get
();
// 发票信息
$address
=
DB
::
connection
(
'order'
)
->
table
(
'lie_user_address'
)
->
where
(
'user_id'
,
$user
->
user_id
)
->
select
(
'address_id'
,
'consignee'
)
->
get
();
// 收货地址
// $invoice = DB::connection('order')->table('lie_taxinfo')->where('user_id', $user->user_id)->select('tax_id', 'tax_title'
)->get(); // 发票信息
$info
[
'user'
]
=
$user
;
$info
[
'address'
]
=
$address
;
$info
[
'invoice'
]
=
$invoice
;
//
$info['invoice'] = $invoice;
return
[
'errcode'
=>
0
,
'errmsg'
=>
''
,
'data'
=>
$info
];
}
...
...
@@ -236,11 +236,7 @@ Class AddOrderController extends Controller
$user_id
=
$request
->
input
(
'user_id'
);
$inv_type
=
$request
->
input
(
'inv_type'
);
if
(
$inv_type
==
3
)
{
$invoice
=
DB
::
connection
(
'order'
)
->
table
(
'lie_taxinfo'
)
->
where
([
'user_id'
=>
$user_id
,
'inv_type'
=>
$inv_type
])
->
get
();
}
else
{
$invoice
=
DB
::
connection
(
'order'
)
->
table
(
'lie_taxinfo'
)
->
where
(
'user_id'
,
$user_id
)
->
whereIn
(
'inv_type'
,
[
2
,
4
])
->
get
();
}
$invoice
=
DB
::
connection
(
'order'
)
->
table
(
'lie_taxinfo'
)
->
where
([
'user_id'
=>
$user_id
,
'inv_type'
=>
$inv_type
])
->
select
(
'tax_id'
,
'tax_title'
)
->
get
();
return
[
'errcode'
=>
0
,
'errmsg'
=>
''
,
'data'
=>
$invoice
];
}
...
...
public/js/add_order.js
View file @
4899f55d
...
...
@@ -84,16 +84,16 @@
}
// 发票信息
if
(
data
.
invoice
!=
null
)
{
var
inv_len
=
data
.
invoice
.
length
;
var
inv_str
=
'<option value="">请选择</option>'
;
//
if (data.invoice != null) {
//
var inv_len = data.invoice.length;
//
var inv_str = '<option value="">请选择</option>';
for
(
var
i
=
0
;
i
<
inv_len
;
i
++
)
{
inv_str
+=
'<option value="'
+
data
.
invoice
[
i
][
'tax_id'
]
+
'">'
+
data
.
invoice
[
i
][
'tax_title'
]
+
'</option>'
;
}
//
for (var i = 0; i < inv_len; i++) {
//
inv_str += '<option value="'+data.invoice[i]['tax_id']+'">'+data.invoice[i]['tax_title']+'</option>';
//
}
$
(
'#invoice'
).
empty
().
append
(
inv_str
);
}
//
$('#invoice').empty().append(inv_str);
//
}
loading
.
lists
(
data
.
user
.
user_id
,
goods_type
,
is_online
);
// 加载该用户购物车
...
...
@@ -171,6 +171,11 @@
$
(
'.invoice-content'
).
hide
();
$
(
'.tax_id'
).
val
(
''
);
// 提示
if
(
inv_type
==
2
||
inv_type
==
''
)
{
layer
.
alert
(
'个人和不开票只能为个人形式,后续不能更改为公司进行开票,请确认风险'
);
}
if
(
inv_type
)
{
$
.
ajax
({
url
:
'/ajax/selectInvType'
,
...
...
@@ -746,15 +751,20 @@
return
false
;
}
if
((
typeof
(
inv_type
)
==
'undefined'
||
inv_type
!=
''
)
&&
!
tax_id
)
{
layer
.
msg
(
'请选择发票信息'
);
return
false
;
}
if
(
type
==
4
)
{
// 自营其他业务
var
business_type
=
$
(
'#business_type'
).
val
();
datax
.
business_type
=
business_type
;
datax
.
role
=
role
;
// 自营线上下单添加角色
}
else
{
if
((
inv_type
&&
!
tax_id
)
||
(
!
tax_id
&&
goods_type
==
2
))
{
layer
.
msg
(
'请选择发票信息'
);
return
false
;
}
//
if ((inv_type && !tax_id) || (!tax_id && goods_type == 2)) {
//
layer.msg('请选择发票信息');
//
return false;
//
}
}
if
(
type
==
1
&&
is_dgk
)
{
// 联营包含digikey商品,则填写终端资料
...
...
resources/views/addOrder/content.blade.php
View file @
4899f55d
<style>
.user-info
h4
{
line-height
:
30px
;
border-bottom
:
1px
dotted
#ccc
;
}
</style>
<form>
<div
class=
"ibox-title"
style=
"border-top:0;"
>
<h3>
客户信息
</h3>
...
...
@@ -124,6 +128,9 @@
<div
class=
"form-group"
>
<span>
发票类型:
</span>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"inv_type"
class=
"radio-inv-type"
value=
"2"
>
个人
</label>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"inv_type"
class=
"radio-inv-type"
value=
"3"
>
增值税专用发票
</label>
<label
class=
"radio-inline"
>
...
...
@@ -139,6 +146,7 @@
<div
class=
"form-group"
>
<span>
选择发票信息:
</span>
<select
name=
"invoice"
id=
"invoice"
>
<option
value=
""
>
请选择
</option>
</select>
</div>
</div>
...
...
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