Commit 5e8e8eee by 朱继来

审单添加校验

parent 2ffe417c
......@@ -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']];
}
}
}
}
......
......@@ -172,39 +172,39 @@ return [
'aliases' => [
'App' => Illuminate\Support\Facades\App::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class,
'Cache' => Illuminate\Support\Facades\Cache::class,
'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class,
'DB' => Illuminate\Support\Facades\DB::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class,
'File' => Illuminate\Support\Facades\File::class,
'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class,
'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class,
'Password' => Illuminate\Support\Facades\Password::class,
'Queue' => Illuminate\Support\Facades\Queue::class,
'Redirect' => Illuminate\Support\Facades\Redirect::class,
'Redis' => Illuminate\Support\Facades\Redis::class,
'Request' => Illuminate\Support\Facades\Request::class,
'Response' => Illuminate\Support\Facades\Response::class,
'Route' => Illuminate\Support\Facades\Route::class,
'Schema' => Illuminate\Support\Facades\Schema::class,
'Session' => Illuminate\Support\Facades\Session::class,
'Storage' => Illuminate\Support\Facades\Storage::class,
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
'Excel' => Maatwebsite\Excel\Facades\Excel::class,
'App' => Illuminate\Support\Facades\App::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class,
'Cache' => Illuminate\Support\Facades\Cache::class,
'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class,
'DB' => Illuminate\Support\Facades\DB::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class,
'File' => Illuminate\Support\Facades\File::class,
'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class,
'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class,
'Password' => Illuminate\Support\Facades\Password::class,
'Queue' => Illuminate\Support\Facades\Queue::class,
'Redirect' => Illuminate\Support\Facades\Redirect::class,
'Redis' => Illuminate\Support\Facades\Redis::class,
'Request' => Illuminate\Support\Facades\Request::class,
'Response' => Illuminate\Support\Facades\Response::class,
'Route' => Illuminate\Support\Facades\Route::class,
'Schema' => Illuminate\Support\Facades\Schema::class,
'Session' => Illuminate\Support\Facades\Session::class,
'Storage' => Illuminate\Support\Facades\Storage::class,
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
'Excel' => Maatwebsite\Excel\Facades\Excel::class,
'MonitorDing' => Redgo\MonitorDing\Facades\MonitorDing::class,
'Debugbar' => Barryvdh\Debugbar\Facade::class,
'Debugbar' => Barryvdh\Debugbar\Facade::class,
],
......
......@@ -101,5 +101,7 @@ return [
'export_self_source_id' => 17,
'pur_url' => 'http://pur.ichunt.net',
'footstone_url' => 'http://footstone.liexin.net',
];
......@@ -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);
......
......@@ -152,7 +152,7 @@
<th width="5%">采购员</th>
<th width="5%">批次</th>
@endif
<th width="3%">状态</th>
<th width="3%">操作</th>
</thead>
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment