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
4ce2940a
authored
Sep 09, 2019
by
朱继来
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'zjl_order_list_20190902'
parents
5f850404
6cc311f7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
187 additions
and
114 deletions
app/Http/Controllers/ApiController.php
app/Http/Controllers/OrderController.php
public/css/order.css
public/js/order.js
resources/views/detail/content.blade.php
resources/views/orderlist/content.blade.php
resources/views/selfOrder/content.blade.php
app/Http/Controllers/ApiController.php
View file @
4ce2940a
...
...
@@ -12,6 +12,7 @@ use App\Model\Pcb\PcbPurchaseModel;
use
App\Model\Pcb\PcbServerModel
;
use
App\Model\KefuModel
;
use
App\Model\CmsModel
;
use
App\Model\OrderItemsTrackModel
;
class
ApiController
extends
Controller
{
...
...
@@ -127,4 +128,36 @@ class ApiController extends Controller
$this
->
Export
(
$KefuModel
->
top
(
$request
));
}
// 获取订单明细
public
function
getOrderItems
(
$request
)
{
$order_id
=
$request
->
input
(
'order_id'
);
$url
=
Config
(
'website.api_domain'
)
.
'order/getOrderDetails'
;
$data
[
'k1'
]
=
time
();
$data
[
'k2'
]
=
md5
(
md5
(
$data
[
'k1'
])
.
'fh6y5t4rr351d2c3bryi'
);
$userData
=
array
(
"order_id"
=>
$order_id
,
"type"
=>
3
,
"k1"
=>
$data
[
'k1'
],
"k2"
=>
$data
[
'k2'
]);
$resp
=
json_decode
(
curlApi
(
$url
,
$userData
,
"POST"
),
true
);
$this
->
Export
(
0
,
''
,
$resp
[
'data'
][
'order_items_info'
]);
}
// 获取订单跟踪
public
function
getOrderItemsTrack
(
$request
)
{
$rec_id
=
$request
->
input
(
'rec_id'
);
$OrderItemsTrackModel
=
new
OrderItemsTrackModel
;
$track
=
$OrderItemsTrackModel
->
getLastItemTrack
(
$rec_id
);
if
(
!
$track
)
$this
->
Export
(
1
,
'无跟踪明细'
);
$data
=
$track
[
'track_content'
]
.
',数量:'
.
$track
[
'track_num'
];
$this
->
Export
(
0
,
''
,
$data
);
}
}
app/Http/Controllers/OrderController.php
View file @
4ce2940a
...
...
@@ -89,13 +89,14 @@ function getInvoiceStatus($order_id)
return
$invoice
->
invoice_status
;
}
function
getCompanyName
(
$user_id
)
// 发票抬头 -> 公司
function
getCompanyName
(
$order_id
,
$user_id
)
{
$
company
=
DB
::
connection
(
'order'
)
->
table
(
'lie_user_company'
)
->
where
([
'user_id'
=>
$user_id
])
->
select
(
'com_name'
)
->
first
();
$
order_invoice
=
DB
::
connection
(
'order'
)
->
table
(
'lie_order_invoice'
)
->
where
([
'order_id'
=>
$order_id
])
->
select
(
'tax_title'
,
'inv_type'
)
->
first
();
if
(
$order_invoice
->
inv_type
!=
1
)
return
$order_invoice
->
tax_title
;
$company
=
DB
::
connection
(
'order'
)
->
table
(
'lie_user_company'
)
->
where
([
'user_id'
=>
$user_id
])
->
select
(
'com_name'
)
->
first
();
if
(
!
$company
)
return
false
;
...
...
public/css/order.css
View file @
4ce2940a
...
...
@@ -317,4 +317,6 @@ input[type="color"],
.bs-select-all
{
float
:
left
;
width
:
42%
!important
;}
.bs-deselect-all
{
float
:
right
;
width
:
50%
!important
;}
.bootstrap-select
.btn
{
padding
:
4px
12px
;}
\ No newline at end of file
.bootstrap-select
.btn
{
padding
:
4px
12px
;}
.list-item-table
.caption
th
{
background
:
#fff
;
}
\ No newline at end of file
public/js/order.js
View file @
4ce2940a
...
...
@@ -4,6 +4,8 @@
$
.
extend
(
$
.
lie
,
{
order
:{
index
:
function
(){
var
self
=
this
;
$
.
lie
.
droplist
(
$
(
'.droplist'
));
$
(
'#search'
).
on
(
'submit'
,
function
(
e
){
e
.
stopPropagation
();
...
...
@@ -14,6 +16,8 @@
return
true
;
});
self
.
orderTrack
();
// 明细跟踪
// 特殊字符编码
function
specialCode
(
chr
)
{
...
...
@@ -276,10 +280,80 @@
// 展示列表下的内容
$
(
'.show-list'
).
click
(
function
(){
var
nextTr
=
$
(
this
).
parent
(
'tr'
).
next
(
'.show-other-content'
);
var
self
=
$
(
this
);
var
nextTr
=
self
.
parent
(
'tr'
).
next
(
'.show-other-content'
);
var
order_id
=
self
.
parent
(
'tr'
).
data
(
'oid'
);
var
order_goods_type
=
self
.
parent
(
'tr'
).
data
(
'type'
);
if
(
nextTr
.
css
(
'display'
)
==
'none'
)
{
$
(
this
)
.
parent
(
'tr'
).
siblings
(
'.show-other-content'
).
hide
();
self
.
parent
(
'tr'
).
siblings
(
'.show-other-content'
).
hide
();
nextTr
.
show
();
// 请求api接口,获取明细
$
.
ajax
({
url
:
'/api/getOrderItems'
,
type
:
'post'
,
data
:
{
order_id
:
order_id
},
dataType
:
'json'
,
success
:
function
(
resp
)
{
if
(
resp
.
errcode
==
0
)
{
var
data
=
resp
.
data
;
var
len
=
data
.
length
;
var
html
=
''
;
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
if
(
i
<
2
)
{
html
+=
'<tr>\
<td>'
+
data
[
i
].
goods_name
+
'</td>\
<td>'
+
data
[
i
].
brand_name
+
'</td>\
<td>'
+
data
[
i
].
goods_number
+
'</td>\
<td>'
+
data
[
i
].
goods_price_format
+
'</td>\
<td>'
+
data
[
i
].
single_pre_price_format
+
'</td>\
<td>'
+
data
[
i
].
single_pre_price_amount
+
'</td>\
<td>'
+
data
[
i
].
supplier_name
+
'</td>\
<td>'
+
data
[
i
].
delivery_time
+
'</td>'
;
if
(
order_goods_type
==
1
)
{
var
rec_id
=
data
[
i
].
rec_id
;
$
.
ajax
({
url
:
'/api/getOrderItemsTrack'
,
type
:
'post'
,
data
:
{
rec_id
:
rec_id
},
dataType
:
'json'
,
async
:
false
,
success
:
function
(
relt
)
{
if
(
relt
.
errcode
==
0
)
{
html
+=
'<td colspan="5"><a class="order-track" data-rid="'
+
rec_id
+
'">'
+
relt
.
data
+
'</a></td>'
;
}
else
{
html
+=
'<td colspan="5"></td>'
;
}
}
})
}
html
+=
'</tr>'
;
}
else
{
var
details_url
=
order_goods_type
==
1
?
'/details/'
+
order_id
:
'/details/'
+
order_id
+
'?tags=self'
;
html
+=
'<tr>\
<td colspan="14" style="text-align: center;"><a href="'
+
details_url
+
'" target="_blank">查看更多明细...</a></td>\
</tr>'
;
}
}
// 插入到tbody
self
.
parent
(
'tr'
).
next
(
'.show-other-content'
).
find
(
'.list-item-table>tbody'
).
empty
().
append
(
html
);
return
false
;
}
layer
.
msg
(
resp
.
msg
);
},
error
:
function
(
err
)
{
console
.
log
(
err
)
}
})
}
else
{
nextTr
.
hide
();
}
...
...
@@ -534,6 +608,48 @@
})
},
orderTrack
:
function
()
{
// 查看订单明细跟踪
$
(
'.list-item-table'
).
off
().
delegate
(
'.order-track'
,
'click'
,
function
()
{
var
rid
=
$
(
this
).
data
(
'rid'
);
$
.
ajax
({
url
:
'/ajax/getOrderItemsTrack'
,
type
:
'post'
,
data
:
{
rec_id
:
rid
},
success
:
function
(
resp
)
{
if
(
resp
.
errcode
==
0
)
{
var
data
=
resp
.
data
;
var
content
=
'<table class="table">\
<tr>\
<th width="30%">时间</th>\
<th>说明</th>\
<th width="13%">负责人</th>\
</tr>'
;
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
content
+=
'<tr><td>'
+
data
[
i
].
create_time
+
'</td><td>'
+
data
[
i
].
track_content
+
',数量:'
+
data
[
i
].
track_num
+
'</td><td>'
+
data
[
i
].
create_name
+
'</td></tr>'
;
}
content
+=
'</table>'
;
layer
.
open
({
title
:
'订单明细跟踪'
,
area
:
[
'600px'
,
'400px'
],
content
:
content
,
btn
:
[],
})
}
else
{
layer
.
alert
(
resp
.
errmsg
||
'网络异常'
);
}
},
error
:
function
(
err
)
{
console
.
log
(
err
);
}
})
})
},
details
:
function
(){
var
self
=
this
;
var
action_type
=
$
(
'.action_type'
).
val
();
...
...
@@ -564,6 +680,7 @@
self
.
selfOrder
();
self
.
cancelorder
();
self
.
orderTrack
();
$
.
lie
.
droplist
(
$
(
'.droplist'
));
var
order_sn
=
$
(
'.order-save'
).
attr
(
'ordersn'
);
...
...
@@ -756,46 +873,6 @@
})
})
// 查看订单明细跟踪
$
(
'.order-track'
).
click
(
function
()
{
var
rid
=
$
(
this
).
data
(
'rid'
);
$
.
ajax
({
url
:
'/ajax/getOrderItemsTrack'
,
type
:
'post'
,
data
:
{
rec_id
:
rid
},
success
:
function
(
resp
)
{
if
(
resp
.
errcode
==
0
)
{
var
data
=
resp
.
data
;
var
content
=
'<table class="table">\
<tr>\
<th width="30%">时间</th>\
<th>说明</th>\
<th width="13%">负责人</th>\
</tr>'
;
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
content
+=
'<tr><td>'
+
data
[
i
].
create_time
+
'</td><td>'
+
data
[
i
].
track_content
+
',数量:'
+
data
[
i
].
track_num
+
'</td><td>'
+
data
[
i
].
create_name
+
'</td></tr>'
;
}
content
+=
'</table>'
;
layer
.
open
({
title
:
'订单明细跟踪'
,
area
:
[
'600px'
,
'400px'
],
content
:
content
,
btn
:
[],
})
}
else
{
layer
.
alert
(
resp
.
errmsg
||
'网络异常'
);
}
},
error
:
function
(
err
)
{
console
.
log
(
err
);
}
})
})
// 点击物流展开
$
(
'.click-down'
).
click
(
function
()
{
$
(
this
).
parents
(
'tbody'
).
find
(
'.other-infos'
).
show
();
...
...
resources/views/detail/content.blade.php
View file @
4ce2940a
...
...
@@ -521,7 +521,7 @@
@endif
@if ($order_info['order_goods_type'] == 1)
<t
h><a
class=
"order-track"
data-rid=
"{{$v['rec_id']}}"
>
{{ App\Http\Controllers\getLastTrack($v['rec_id']) }}
</a></th
>
<t
d><a
class=
"order-track"
data-rid=
"{{$v['rec_id']}}"
>
{{ App\Http\Controllers\getLastTrack($v['rec_id']) }}
</a></td
>
@endif
@if ($action_name == 'changeOrder'
&&
count($order_items_info) > 1
&&
in_array($order_info['status'], [1, 2]))
...
...
resources/views/orderlist/content.blade.php
View file @
4ce2940a
This diff is collapsed.
Click to expand it.
resources/views/selfOrder/content.blade.php
View file @
4ce2940a
...
...
@@ -214,6 +214,7 @@
<thead>
<tr>
<th
class=
"pl30"
>
会员账号
</th>
<th
class=
"pl30"
>
公司
</th>
<th
class=
"pl30"
>
订单编号
</th>
<th
class=
"pl30"
>
应付金额
</th>
<th
class=
"pl30"
>
订单状态
</th>
...
...
@@ -230,18 +231,21 @@
@if (empty($list))
<tr>
<td
class=
"text-center"
colspan=
"1
2
"
>
没有查询到相关记录~
</td>
<td
class=
"text-center"
colspan=
"1
3
"
>
没有查询到相关记录~
</td>
</tr>
@else
<tbody>
@foreach ($list as $v)
<tr>
<tr
data-oid=
"{{ $v['order_id'] }}"
data-type=
"2"
>
<td
class=
"show-list"
>
<?php
print_r
(
App\Http\Controllers\getAccountName
(
$v
[
'user_id'
]));
?>
@if (isset($credit[$v['user_id']])
&&
$credit[$v['user_id']])
<span>
(账期)
</span>
@endif
</td>
<td
class=
"show-list"
>
<p
class=
"show-title"
title=
"{{App\Http\Controllers\getCompanyName($v['order_id'], $v['user_id'])}}"
style=
"width: 200px;"
>
{{App\Http\Controllers\getCompanyName($v['order_id'], $v['user_id'])}}
</p>
</td>
<td
class=
"show-list"
>
{{$v['order_sn']}}
</td>
<td
class=
"show-list"
>
<?php
...
...
@@ -328,67 +332,23 @@
<!-- 点击展示内容 -->
<tr
class=
"show-other-content"
>
<td
colspan=
"12"
>
<table
class=
"table table-hover table-bordered"
>
<tr>
<td
class=
"table-list-title"
>
公司名称
</td>
<td
class=
"table-list-content"
>
<p
class=
"show-title"
title=
"{{App\Http\Controllers\getCompanyName($v['user_id'])}}"
>
{{App\Http\Controllers\getCompanyName($v['user_id'])}}
</p>
</td>
<td
class=
"table-list-title"
>
支付时间
</td>
<td
class=
"table-list-content"
>
<?php
if
(
$v
[
'order_pay_time'
]
!=
0
)
{
if
(
$username
!=
'vpadmin@ichunt.com'
)
{
echo
date
(
'Y-m-d H:i:s'
,
$v
[
'order_pay_time'
]);
}
else
{
echo
date
(
'Y-m-d'
,
$v
[
'order_pay_time'
]);
}
}
else
{
if
(
$v
[
'advance_pay_time'
]
!=
0
)
{
if
(
$username
!=
'vpadmin@ichunt.com'
)
{
echo
date
(
'Y-m-d H:i:s'
,
$v
[
'advance_pay_time'
]);
}
else
{
echo
date
(
'Y-m-d'
,
$v
[
'advance_pay_time'
]);
}
}
else
{
echo
''
;
}
}
?>
</td>
</tr>
<tr>
<td
class=
"table-list-title"
>
发票状态
</td>
<td
class=
"table-list-content"
>
<?php
$invoice_status
=
App\Http\Controllers\getInvoiceStatus
(
$v
[
'order_id'
]);
if
(
$invoice_status
)
{
switch
(
$invoice_status
)
{
case
-
1
:
echo
"待确认"
;
break
;
case
1
:
echo
"已开票"
;
break
;
case
2
:
echo
"已发货"
;
break
;
case
3
:
echo
"已签收"
;
break
;
}
}
else
{
echo
''
;
}
?>
</td>
<td
class=
"table-list-title"
>
优惠金额
</td>
<td
class=
"table-list-content"
>
<?php
echo
App\Http\Controllers\getCoupon
(
$v
[
'order_id'
]);
?>
</td>
</tr>
<tr>
<td
class=
"table-list-title"
>
快递单号
</td>
<td
class=
"table-list-content"
>
{{$shippingNo ? substr($shippingNo, 0, -2) : ''}}
</td>
<td
class=
"table-list-title"
>
Adtag或其它
</td>
<td
class=
"table-list-content"
>
<p
class=
"show-title"
title=
"
<?php
echo
App\Http\Controllers\handleOrderSource
(
$v
[
'order_source'
]);
?>
"
>
<?php
echo
App\Http\Controllers\handleOrderSource
(
$v
[
'order_source'
]);
?>
</p>
</td>
</tr>
<td
colspan=
"13"
>
<table
class=
"table table-hover table-bordered list-item-table"
>
<thead>
<tr
class=
"caption"
>
<th>
型号
</th>
<th>
制造商
</th>
<th>
购买数量
</th>
<th>
购买时单价
</th>
<th>
均摊后单价
</th>
<th>
小计
</th>
<th>
供应商
</th>
<th
colspan=
"5"
>
交期
</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</td>
</tr>
...
...
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