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
37c35394
authored
Apr 09, 2020
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
temp
parent
6b5fe483
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
17 deletions
app/Http/Controllers/ApiController.php
public/js/order.js
resources/views/detail/content.blade.php
app/Http/Controllers/ApiController.php
View file @
37c35394
...
@@ -188,28 +188,44 @@ class ApiController extends Controller
...
@@ -188,28 +188,44 @@ class ApiController extends Controller
/*
/*
修改订单详情
修改订单详情
*/
*/
public
function
update_order_items
(
$request
){
public
function
update_order_items
(
$request
)
{
$OrderItemsModel
=
new
OrderItemsModel
();
//
$OrderItemsModel = new OrderItemsModel();
$data
[
'id'
]
=
$request
->
input
(
'id'
);
$data
[
'order_id'
]
=
$request
->
input
(
'order_id'
);
$data
[
'remarks'
]
=
$request
->
input
(
'remarks'
);
$data
[
'operator_id'
]
=
$request
->
user
->
userId
;
$data
[
'buyer_id'
]
=
$request
->
input
(
'buyer_id'
);
//采购id
$data
[
'id'
]
=
$request
->
input
(
'id'
);
$data
[
'batch'
]
=
$request
->
input
(
'batch'
);
//采购id
$data
[
'remarks'
]
=
$request
->
input
(
'remarks'
);
$data
[
'buyer_id'
]
=
$request
->
input
(
'buyer_id'
);
//采购id
$data
[
'batch'
]
=
$request
->
input
(
'batch'
);
//批次
if
(
$data
[
'buyer_id'
]
==
-
1
){
//
if($data['buyer_id'] == -1){
unset
(
$data
[
'buyer_id'
]);
//
unset($data['buyer_id']);
}
//
}
$result
=
$OrderItemsModel
->
updateData
(
$data
);
//
$result = $OrderItemsModel->updateData($data);
if
(
$result
!==
false
){
// if($result !== false){
$this
->
Export
(
0
,
'编辑明细成功'
);
// $this->Export(0, '编辑明细成功');
}
else
{
// }else{
$this
->
Export
(
1
,
'编辑明细失败'
);
// $this->Export(1, '编辑明细失败');
// }
$url
=
Config
(
'website.api_domain'
)
.
'order/updateorderitems'
;
$data
[
'k1'
]
=
time
();
$data
[
'k2'
]
=
md5
(
md5
(
$data
[
'k1'
])
.
'fh6y5t4rr351d2c3bryi'
);
dd
(
curlApi
(
$url
,
$data
,
"POST"
));
$temp
=
json_decode
(
curlApi
(
$url
,
$data
,
"POST"
),
true
);
// 连接API
if
(
$temp
[
'err_code'
]
!=
0
)
{
return
[
'errcode'
=>
$temp
[
'err_code'
],
'errmsg'
=>
$temp
[
'err_msg'
]];
}
}
return
[
'errcode'
=>
$temp
[
'err_code'
],
'errmsg'
=>
$temp
[
'err_msg'
]];
}
}
/*
/*
...
...
public/js/order.js
View file @
37c35394
...
@@ -1164,6 +1164,7 @@
...
@@ -1164,6 +1164,7 @@
// 编辑商品明细
// 编辑商品明细
$
(
'.edit-item'
).
click
(
function
()
{
$
(
'.edit-item'
).
click
(
function
()
{
var
order_id
=
$
(
'#order_id'
).
val
();
var
order_goods_type
=
$
(
'#order_goods_type'
).
val
();
var
order_goods_type
=
$
(
'#order_goods_type'
).
val
();
var
rec_id
=
$
(
this
).
data
(
'id'
);
var
rec_id
=
$
(
this
).
data
(
'id'
);
var
item_batch
=
$
(
this
).
data
(
'batch'
);
var
item_batch
=
$
(
this
).
data
(
'batch'
);
...
@@ -1238,7 +1239,7 @@
...
@@ -1238,7 +1239,7 @@
$
.
ajax
({
$
.
ajax
({
url
:
'/api/update_order_items'
,
url
:
'/api/update_order_items'
,
data
:
{
id
:
rec_id
,
batch
:
batch
,
buyer_id
:
buyer_id
,
remarks
:
remarks
},
data
:
{
order_id
:
order_id
,
id
:
rec_id
,
batch
:
batch
,
buyer_id
:
buyer_id
,
remarks
:
remarks
},
type
:
'post'
,
type
:
'post'
,
dataType
:
'json'
,
dataType
:
'json'
,
success
:
function
(
resp
){
success
:
function
(
resp
){
...
...
resources/views/detail/content.blade.php
View file @
37c35394
...
@@ -594,8 +594,8 @@
...
@@ -594,8 +594,8 @@
<td>
<td>
<!-- <button type="button" class="btn btn-success btn-xs remarks">编辑</button> -->
<!-- <button type="button" class="btn btn-success btn-xs remarks">编辑</button> -->
@if ($order_info['status']
!= -1
)
@if ($order_info['status']
<
4
)
<button
type=
"button"
class=
"btn btn-success btn-xs edit-item"
data-id=
"{{$v['rec_id']}}"
data-batch=
"{{$v['batch']}}"
data-bid=
"{{$v['buyer_id']}}"
data-remarks=
"{{$v['remarks']}}"
>
编辑
</button>
<
button
type=
"button"
class=
"btn btn-success btn-xs edit-item"
data-id=
"{{$v['rec_id']}}"
data-batch=
"{{$v['batch']}}"
data-bid=
"{{$v['buyer_id']}}"
data-remarks=
"{{$v['remarks']}}"
>
编辑
</button>
@endif
@endif
</td>
</td>
...
...
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