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
08be84de
authored
Nov 03, 2020
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
手动同步到ERP
parent
574f1f63
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
4 deletions
app/Http/Controllers/ApiController.php
public/js/list.js
resources/views/orderlist/content.blade.php
app/Http/Controllers/ApiController.php
View file @
08be84de
...
...
@@ -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\OrderModel
;
use
App\Model\OrderExtendModel
;
use
App\Model\OrderItemsModel
;
use
App\Model\OrderItemsTrackModel
;
...
...
@@ -394,11 +395,24 @@ class ApiController extends Controller
if
(
$res
===
false
)
{
$this
->
Export
(
-
1
,
'编辑ERP单号失败'
);
}
}
$this
->
Export
(
0
,
'编辑ERP单号成功'
);
}
// 手动推送到ERP,标记erp_syn=1
public
function
syn_erp
(
$request
)
{
$order_id
=
$request
->
input
(
'order_id'
);
$OrderModel
=
new
OrderModel
;
$res
=
$OrderModel
->
where
(
'order_id'
,
$order_id
)
->
update
([
'erp_syn'
=>
1
]);
if
(
$res
===
false
)
$this
->
Export
(
-
1
,
'更新失败'
);
$this
->
Export
(
0
,
'成功'
);
}
}
public/js/list.js
View file @
08be84de
...
...
@@ -576,7 +576,7 @@ console.log(listUrl)
dataType
:
'json'
,
success
:
function
(
resp
)
{
if
(
resp
.
errcode
!=
0
)
{
layer
.
msg
(
resp
.
msg
);
layer
.
msg
(
resp
.
err
msg
);
return
false
;
}
...
...
@@ -592,6 +592,39 @@ console.log(listUrl)
})
})
// 手动同步到ERP --- admin
$
(
'.syn_erp'
).
click
(
function
()
{
var
order_id
=
$
(
this
).
data
(
'oid'
);
layer
.
open
({
area
:
[
'300px'
],
title
:
'同步ERP'
,
content
:
'确定同步到ERP吗?'
,
btn
:[
'确认'
,
'取消'
],
btn1
:
function
(
index
)
{
$
.
ajax
({
url
:
'/api/syn_erp'
,
type
:
'post'
,
data
:
{
order_id
:
order_id
},
dataType
:
'json'
,
success
:
function
(
resp
)
{
if
(
resp
.
errcode
!=
0
)
{
layer
.
msg
(
resp
.
errmsg
);
return
false
;
}
layer
.
msg
(
resp
.
errmsg
);
}
})
layer
.
msg
(
'提交中...'
,
{
icon
:
16
,
time
:
0
,
shade
:
0.3
});
},
btn2
:
function
(
index
)
{
layer
.
close
(
index
)
}
})
})
},
}
...
...
resources/views/orderlist/content.blade.php
View file @
08be84de
...
...
@@ -415,6 +415,10 @@
@if ($username == 'vpadmin@ichunt.com')
<a
class=
"btn btn-info edit_erp_sn"
data-oid=
"{{$v['order_id']}}"
data-erp_sn=
"{{ $order_extend ? $order_extend->erp_sn : '' }}"
>
编辑ERP单号
</a>
@endif
@if ($username == 'admin@ichunt.com'
&&
empty($order_extend->erp_sn)
&&
$order_extend->is_manager_audit == 3)
<a
class=
"btn btn-info syn_erp"
data-oid=
"{{$v['order_id']}}"
>
同步ERP
</a>
@endif
</div>
</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