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
...
@@ -159,12 +159,12 @@ Class AddOrderController extends Controller
}
}
}
}
$address
=
DB
::
connection
(
'order'
)
->
table
(
'lie_user_address'
)
->
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
)
->
get
();
// 发票信息
// $invoice = DB::connection('order')->table('lie_taxinfo')->where('user_id', $user->user_id)->select('tax_id', 'tax_title'
)->get(); // 发票信息
$info
[
'user'
]
=
$user
;
$info
[
'user'
]
=
$user
;
$info
[
'address'
]
=
$address
;
$info
[
'address'
]
=
$address
;
$info
[
'invoice'
]
=
$invoice
;
//
$info['invoice'] = $invoice;
return
[
'errcode'
=>
0
,
'errmsg'
=>
''
,
'data'
=>
$info
];
return
[
'errcode'
=>
0
,
'errmsg'
=>
''
,
'data'
=>
$info
];
}
}
...
@@ -236,11 +236,7 @@ Class AddOrderController extends Controller
...
@@ -236,11 +236,7 @@ Class AddOrderController extends Controller
$user_id
=
$request
->
input
(
'user_id'
);
$user_id
=
$request
->
input
(
'user_id'
);
$inv_type
=
$request
->
input
(
'inv_type'
);
$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
])
->
select
(
'tax_id'
,
'tax_title'
)
->
get
();
$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
();
}
return
[
'errcode'
=>
0
,
'errmsg'
=>
''
,
'data'
=>
$invoice
];
return
[
'errcode'
=>
0
,
'errmsg'
=>
''
,
'data'
=>
$invoice
];
}
}
...
...
public/js/add_order.js
View file @
4899f55d
...
@@ -84,16 +84,16 @@
...
@@ -84,16 +84,16 @@
}
}
// 发票信息
// 发票信息
if
(
data
.
invoice
!=
null
)
{
//
if (data.invoice != null) {
var
inv_len
=
data
.
invoice
.
length
;
//
var inv_len = data.invoice.length;
var
inv_str
=
'<option value="">请选择</option>'
;
//
var inv_str = '<option value="">请选择</option>';
for
(
var
i
=
0
;
i
<
inv_len
;
i
++
)
{
//
for (var i = 0; i < inv_len; i++) {
inv_str
+=
'<option value="'
+
data
.
invoice
[
i
][
'tax_id'
]
+
'">'
+
data
.
invoice
[
i
][
'tax_title'
]
+
'</option>'
;
//
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
);
// 加载该用户购物车
loading
.
lists
(
data
.
user
.
user_id
,
goods_type
,
is_online
);
// 加载该用户购物车
...
@@ -171,6 +171,11 @@
...
@@ -171,6 +171,11 @@
$
(
'.invoice-content'
).
hide
();
$
(
'.invoice-content'
).
hide
();
$
(
'.tax_id'
).
val
(
''
);
$
(
'.tax_id'
).
val
(
''
);
// 提示
if
(
inv_type
==
2
||
inv_type
==
''
)
{
layer
.
alert
(
'个人和不开票只能为个人形式,后续不能更改为公司进行开票,请确认风险'
);
}
if
(
inv_type
)
{
if
(
inv_type
)
{
$
.
ajax
({
$
.
ajax
({
url
:
'/ajax/selectInvType'
,
url
:
'/ajax/selectInvType'
,
...
@@ -746,15 +751,20 @@
...
@@ -746,15 +751,20 @@
return
false
;
return
false
;
}
}
if
((
typeof
(
inv_type
)
==
'undefined'
||
inv_type
!=
''
)
&&
!
tax_id
)
{
layer
.
msg
(
'请选择发票信息'
);
return
false
;
}
if
(
type
==
4
)
{
// 自营其他业务
if
(
type
==
4
)
{
// 自营其他业务
var
business_type
=
$
(
'#business_type'
).
val
();
var
business_type
=
$
(
'#business_type'
).
val
();
datax
.
business_type
=
business_type
;
datax
.
business_type
=
business_type
;
datax
.
role
=
role
;
// 自营线上下单添加角色
datax
.
role
=
role
;
// 自营线上下单添加角色
}
else
{
}
else
{
if
((
inv_type
&&
!
tax_id
)
||
(
!
tax_id
&&
goods_type
==
2
))
{
//
if ((inv_type && !tax_id) || (!tax_id && goods_type == 2)) {
layer
.
msg
(
'请选择发票信息'
);
//
layer.msg('请选择发票信息');
return
false
;
//
return false;
}
//
}
}
}
if
(
type
==
1
&&
is_dgk
)
{
// 联营包含digikey商品,则填写终端资料
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>
<form>
<div
class=
"ibox-title"
style=
"border-top:0;"
>
<div
class=
"ibox-title"
style=
"border-top:0;"
>
<h3>
客户信息
</h3>
<h3>
客户信息
</h3>
...
@@ -124,6 +128,9 @@
...
@@ -124,6 +128,9 @@
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<span>
发票类型:
</span>
<span>
发票类型:
</span>
<label
class=
"radio-inline"
>
<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"
>
增值税专用发票
<input
type=
"radio"
name=
"inv_type"
class=
"radio-inv-type"
value=
"3"
>
增值税专用发票
</label>
</label>
<label
class=
"radio-inline"
>
<label
class=
"radio-inline"
>
...
@@ -139,6 +146,7 @@
...
@@ -139,6 +146,7 @@
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<span>
选择发票信息:
</span>
<span>
选择发票信息:
</span>
<select
name=
"invoice"
id=
"invoice"
>
<select
name=
"invoice"
id=
"invoice"
>
<option
value=
""
>
请选择
</option>
</select>
</select>
</div>
</div>
</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