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
70ffba76
authored
Dec 25, 2018
by
PRY5YKGJ82EZEPX\Administrator
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
更新pcb后台
parent
824cf469
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
14 deletions
.idea/workspace.xml
app/Model/Pcb/PcbPublicModel.php
public/js/PcbOrderList.js
resources/views/Pcb/PcbOrderList.blade.php
.idea/workspace.xml
View file @
70ffba76
This diff is collapsed.
Click to expand it.
app/Model/Pcb/PcbPublicModel.php
View file @
70ffba76
...
...
@@ -2,6 +2,7 @@
namespace
App\Model\Pcb
;
use
League\Flysystem\Exception
;
use
Request
;
use
DB
;
...
...
@@ -43,7 +44,7 @@ class PcbPublicModel
* 插入后台客服审核结果
*/
public
function
orderShipping
(
$user_id
,
$data
){
$con
=
DB
::
connection
(
'pcb'
);
$datas
=
[
'shipping_type'
=>
1
,
'relevance_id'
=>
$data
[
'order_id'
],
...
...
@@ -53,21 +54,34 @@ class PcbPublicModel
'shipping_id'
=>
$data
[
'shipping_id'
],
'status'
=>
1
,
'update_time'
=>
time
(),
'create_time'
=>
time
(),
];
$shippingCon
=
$con
->
table
(
"shipping"
);
$checkHave
=
$shippingCon
->
where
([
'relevance_id'
=>
$data
[
'order_id'
],
'shipping_type'
=>
1
])
->
first
();
if
(
$checkHave
){
$in
=
$shippingCon
->
where
([
'relevance_id'
=>
$data
[
'order_id'
],
'shipping_type'
=>
1
])
->
update
(
$datas
);
}
else
{
$data
[
'create_time'
]
=
time
();
try
{
$con
=
DB
::
connection
(
'pcb'
);
$con
->
beginTransaction
();
//插入物流信息
$shippingCon
=
$con
->
table
(
"shipping"
);
$in
=
$shippingCon
->
insert
(
$datas
);
}
if
(
$in
){
if
(
!
$in
){
throw
new
Exception
(
"插入发货信息失败"
);
}
//修改发货时间
$updete
=
(
new
PcbOrderModel
())
->
where
(
"order_id"
,
$data
[
'order_id'
])
->
update
([
'shipping_time'
=>
time
()]);
if
(
!
$updete
){
throw
new
Exception
(
"更新订单发货时间失败"
);
}
//日志
PcbActionLogModel
::
log
(
1
,
'admin_add_shipping'
,
"后台填写发货信息"
,
""
,
$data
[
'order_id'
],
$user_id
);
return
[
0
,
'成功'
];
}
else
{
return
[
1001
,
'失败'
];
$con
->
commit
();
return
[
0
,
'成功'
];
}
catch
(
\Exception
$e
)
{
$con
->
rollBack
();
return
[
10002
,
'失败'
.
$e
->
getMessage
()];
}
}
...
...
public/js/PcbOrderList.js
View file @
70ffba76
...
...
@@ -156,6 +156,10 @@ layui.use(['table','form','element','layer', 'laydate'], function() {
//确定发货
function
SendStock
()
{
layer
.
msg
(
'加载中'
,
{
icon
:
16
,
shade
:
0.01
});
$
.
ajax
({
url
:
'/api/ApiSendStock'
,
type
:
'post'
,
...
...
@@ -171,12 +175,19 @@ function SendStock() {
}
else
{
alert_err
(
res
.
errmsg
)
}
},
done
:
function
()
{
layer
.
closeAll
();
}
})
}
//转采购
function
AddPurchase
(
order_id
)
{
alert_confirm
(
"确定填写此订单转采购?"
,
function
()
{
layer
.
msg
(
'加载中'
,
{
icon
:
16
,
shade
:
0.01
});
$
.
ajax
({
url
:
'/api/ApiAddPurchase'
,
type
:
'post'
,
...
...
@@ -190,8 +201,11 @@ function AddPurchase(order_id) {
window
.
location
.
href
=
"/web/PcbPurchaseList"
})
}
else
{
alert_err
(
res
.
errmsg
)
alert_err
(
res
.
err
_
msg
)
}
},
done
:
function
()
{
layer
.
closeAll
();
}
})
})
...
...
resources/views/Pcb/PcbOrderList.blade.php
View file @
70ffba76
...
...
@@ -91,7 +91,7 @@
@{{
#
if
(
d
.
status
==
1
){
}}
<
button
class
=
"btn btn-xs btn-outline btn-danger"
lay
-
submit
=
""
order_id
=
"@{{ d.order_id }}"
order_sn
=
"@{{ d.order_sn }}"
onclick
=
"AddPurchase(@{{ d.order_id }})"
>
发起采购
<
/button
>
@{{
#
}
}}
@{{
#
if
(
d
.
status
==
14
){
}}
@{{
#
if
(
d
.
status
==
14
&&
d
.
shipping_time
==
0
){
}}
<
button
class
=
"btn btn-xs btn-outline btn-danger"
lay
-
submit
=
""
order_id
=
"@{{ d.order_id }}"
order_sn
=
"@{{ d.order_sn }}"
lay
-
filter
=
"SendPurchase"
>
发货
<
/button
>
@{{
#
}
}}
</script>
...
...
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