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
5e8e8eee
authored
Aug 18, 2020
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
审单添加校验
parent
2ffe417c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
4 deletions
app/Http/Controllers/OrderController.php
config/app.php
config/website.php
public/js/change_order.js
resources/views/changeOrder/content.blade.php
app/Http/Controllers/OrderController.php
View file @
5e8e8eee
...
...
@@ -902,7 +902,7 @@ Class OrderController extends Controller
// $resData['is_manager'] = $auditor_role == 3 ? 0 : 1; // 角色为‘查看自己’时,is_manager = 0
// }
// 若采购员选择‘平台’,校验自营库存
// 若采购员选择‘平台’,校验自营库存
、倍数
$order_goods_type
=
$request
->
input
(
'order_goods_type'
,
1
);
if
(
$order_goods_type
==
1
)
{
...
...
@@ -910,7 +910,31 @@ Class OrderController extends Controller
foreach
(
$resData
[
'change_info'
]
as
$v
)
{
if
(
$v
[
'buyer_id'
]
==
$pingtai_id
)
{
$client
=
new
\Hprose\Http\Client
(
Config
(
'website.footstone_url'
)
.
'/service'
,
false
);
$data
=
array
(
'goods_name'
=>
$v
[
'goods_name'
],
'num'
=>
$v
[
'goods_number'
],
'brand_name'
=>
$v
[
'brand_name'
],
);
$res
=
$client
->
SelfGoodsInfo
(
json_encode
(
$data
));
if
(
!
$res
)
return
[
'errcode'
=>-
1
,
'errmsg'
=>
'请求基石库存接口失败'
];
$res
=
json_decode
(
$res
,
true
);
if
(
$res
[
'errcode'
]
!=
0
)
return
[
'errcode'
=>-
1
,
'errmsg'
=>
'请求基石库存接口,'
.
$v
[
'goods_name'
]
.
'型号'
.
$res
[
'errmsg'
]];
$goods_info
=
$res
[
'data'
][
'goods_info'
];
// 判断库存
if
(
!
$goods_info
[
'stock'
]
||
$goods_info
[
'stock'
]
<
$v
[
'goods_number'
])
{
return
[
'errcode'
=>-
1
,
'errmsg'
=>
'请求基石库存接口,'
.
$v
[
'goods_name'
]
.
'型号库存不足,当前库存为'
.
$goods_info
[
'stock'
]];
}
// 判断倍数
if
(
$v
[
'goods_number'
]
%
$goods_info
[
'mpl'
]
!=
0
)
{
return
[
'errcode'
=>-
1
,
'errmsg'
=>
'请求基石库存接口,'
.
$v
[
'goods_name'
]
.
'型号倍数不满足下单条件,当前倍数为'
.
$goods_info
[
'mpl'
]];
}
}
}
}
...
...
config/app.php
View file @
5e8e8eee
config/website.php
View file @
5e8e8eee
...
...
@@ -102,4 +102,6 @@ return [
'pur_url'
=>
'http://pur.ichunt.net'
,
'footstone_url'
=>
'http://footstone.liexin.net'
,
];
public/js/change_order.js
View file @
5e8e8eee
...
...
@@ -602,7 +602,7 @@
}
})
layer
.
msg
(
'审核提交中...'
,
{
icon
:
16
,
time
:
0
,
shade
:
0.3
});
// 阻止重复提交
//
layer.msg('审核提交中...', {icon: 16, time: 0, shade: 0.3}); // 阻止重复提交
},
btn2
:
function
(
index
,
layero
){
layer
.
close
(
index
);
...
...
resources/views/changeOrder/content.blade.php
View file @
5e8e8eee
...
...
@@ -212,7 +212,7 @@
@if ($order_info['order_goods_type'] == 1)
<td>
<select
class=
"form-control change_buyer_id selectpicker"
name=
"change_info[{{ $v['rec_id'] }}][buyer_id]"
data-live-search=
"true"
data-size=
"5"
title=
"请选择采购员"
>
<select
id=
"buyer_id_{{$v['rec_id']}}"
class=
"form-control change_buyer_id selectpicker"
name=
"change_info[{{ $v['rec_id'] }}][buyer_id]"
data-live-search=
"true"
data-size=
"5"
title=
"请选择采购员"
>
<option
value=
""
>
请选择采购员
</option>
@if (!empty($buyers))
@foreach ($buyers as $val)
...
...
@@ -221,8 +221,13 @@
@endif
</select>
</td>
<script>
var
rec_id
=
"{{ $v['rec_id'] }}"
;
var
buyer_id
=
"{{ $v['buyer_id'] }}"
;
$
(
'#buyer_id_'
+
rec_id
).
selectpicker
(
'val'
,
buyer_id
);
</script>
<td>
<input
type=
"text"
class=
"form-control change_batch"
name=
"change_info[{{ $v['rec_id'] }}][batch]"
value=
""
>
<input
type=
"text"
class=
"form-control change_batch"
name=
"change_info[{{ $v['rec_id'] }}][batch]"
value=
"
{{ $v['batch'] }}
"
>
</td>
@endif
...
...
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