Commit 93c9f266 by 朱继来

Merge branch 'zjl_check_20200818'

parents 81316f88 46e2142d
...@@ -903,6 +903,47 @@ Class OrderController extends Controller ...@@ -903,6 +903,47 @@ Class OrderController extends Controller
// $resData['is_manager'] = $auditor_role == 3 ? 0 : 1; // 角色为‘查看自己’时,is_manager = 0 // $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) {
$pingtai_id = Config('config.pingtai_id');
foreach ($resData['change_info'] as &$v) {
if ($v['status'] == -1) continue;
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']];
}
$v['goods_id'] = $goods_info['goods_id']; // 回写自营商品ID
}
}
}
$url = Config('website.api_domain').'order/changeOrder'; $url = Config('website.api_domain').'order/changeOrder';
} }
// dd(curlApi($url, $resData, "POST")); // dd(curlApi($url, $resData, "POST"));
...@@ -1615,7 +1656,7 @@ Class OrderController extends Controller ...@@ -1615,7 +1656,7 @@ Class OrderController extends Controller
$response['is_dgk_exists'] = $is_dgk_exists; $response['is_dgk_exists'] = $is_dgk_exists;
// 获取数组中的采购人id的名字 // 获取数组中的采购人id的名字
$this->getBuyerName($response); // $this->getBuyerName($response);
return $response; return $response;
} }
......
...@@ -172,39 +172,39 @@ return [ ...@@ -172,39 +172,39 @@ return [
'aliases' => [ 'aliases' => [
'App' => Illuminate\Support\Facades\App::class, 'App' => Illuminate\Support\Facades\App::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class, 'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class, 'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class, 'Blade' => Illuminate\Support\Facades\Blade::class,
'Cache' => Illuminate\Support\Facades\Cache::class, 'Cache' => Illuminate\Support\Facades\Cache::class,
'Config' => Illuminate\Support\Facades\Config::class, 'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class, 'Cookie' => Illuminate\Support\Facades\Cookie::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class, 'Crypt' => Illuminate\Support\Facades\Crypt::class,
'DB' => Illuminate\Support\Facades\DB::class, 'DB' => Illuminate\Support\Facades\DB::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class, 'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class, 'Event' => Illuminate\Support\Facades\Event::class,
'File' => Illuminate\Support\Facades\File::class, 'File' => Illuminate\Support\Facades\File::class,
'Gate' => Illuminate\Support\Facades\Gate::class, 'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class, 'Hash' => Illuminate\Support\Facades\Hash::class,
'Lang' => Illuminate\Support\Facades\Lang::class, 'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class, 'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class, 'Mail' => Illuminate\Support\Facades\Mail::class,
'Password' => Illuminate\Support\Facades\Password::class, 'Password' => Illuminate\Support\Facades\Password::class,
'Queue' => Illuminate\Support\Facades\Queue::class, 'Queue' => Illuminate\Support\Facades\Queue::class,
'Redirect' => Illuminate\Support\Facades\Redirect::class, 'Redirect' => Illuminate\Support\Facades\Redirect::class,
'Redis' => Illuminate\Support\Facades\Redis::class, 'Redis' => Illuminate\Support\Facades\Redis::class,
'Request' => Illuminate\Support\Facades\Request::class, 'Request' => Illuminate\Support\Facades\Request::class,
'Response' => Illuminate\Support\Facades\Response::class, 'Response' => Illuminate\Support\Facades\Response::class,
'Route' => Illuminate\Support\Facades\Route::class, 'Route' => Illuminate\Support\Facades\Route::class,
'Schema' => Illuminate\Support\Facades\Schema::class, 'Schema' => Illuminate\Support\Facades\Schema::class,
'Session' => Illuminate\Support\Facades\Session::class, 'Session' => Illuminate\Support\Facades\Session::class,
'Storage' => Illuminate\Support\Facades\Storage::class, 'Storage' => Illuminate\Support\Facades\Storage::class,
'URL' => Illuminate\Support\Facades\URL::class, 'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class, 'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class, 'View' => Illuminate\Support\Facades\View::class,
'Excel' => Maatwebsite\Excel\Facades\Excel::class, 'Excel' => Maatwebsite\Excel\Facades\Excel::class,
'MonitorDing' => Redgo\MonitorDing\Facades\MonitorDing::class, 'MonitorDing' => Redgo\MonitorDing\Facades\MonitorDing::class,
'Debugbar' => Barryvdh\Debugbar\Facade::class, 'Debugbar' => Barryvdh\Debugbar\Facade::class,
], ],
......
...@@ -40,4 +40,8 @@ return [ ...@@ -40,4 +40,8 @@ return [
's_standard_brand' => 'StandardBrand', // 缓存key 's_standard_brand' => 'StandardBrand', // 缓存key
's_standard_brand_expire' => 7200, // 缓存两小时 's_standard_brand_expire' => 7200, // 缓存两小时
// 平台邮箱后台ID (pingtai@ichunt.com)
'pingtai_id' => 1605,
]; ];
...@@ -101,5 +101,7 @@ return [ ...@@ -101,5 +101,7 @@ return [
'export_self_source_id' => 17, 'export_self_source_id' => 17,
'pur_url' => 'http://pur.ichunt.net', 'pur_url' => 'http://pur.ichunt.net',
'footstone_url' => 'http://footstone.liexin.net',
]; ];
...@@ -111,6 +111,15 @@ input[type="color"], ...@@ -111,6 +111,15 @@ input[type="color"],
padding-left: 5px; padding-left: 5px;
} }
@media screen and (max-width: 1550px) {
.order-change-table input[type="text"] {
width: 100px;
}
.select-standard-brand {
width: 25px;
}
}
/*按钮样式*/ /*按钮样式*/
.nbtn{ .nbtn{
border: none; border: none;
......
...@@ -431,13 +431,18 @@ ...@@ -431,13 +431,18 @@
// 正常订单校验数量、单价 // 正常订单校验数量、单价
if (business_type == 0) { if (business_type == 0) {
var change_price = false; var change_price = false;
var change_goods_number = false; var change_goods_number = false;
var change_str = ''; var change_buyer_id = false;
var change_batch = false;
var change_str = '';
$('.order-change-table').find('tbody tr').each(function(){ $('.order-change-table').find('tbody tr').each(function(){
var goods_number = $(this).find('.change_goods_number').val(); var goods_number = $(this).find('.change_goods_number').val();
var price = $(this).find('.price').val(); var price = $(this).find('.price').val();
var goods_name = $(this).find('.change_goods_name').val(); var goods_name = $(this).find('.change_goods_name').val();
var buyer_id = $(this).find('.change_buyer_id').selectpicker('val');
var batch = $(this).find('.change_batch').val();
if (goods_number == '' || goods_number == 0) { if (goods_number == '' || goods_number == 0) {
change_goods_number = true; change_goods_number = true;
...@@ -448,9 +453,19 @@ ...@@ -448,9 +453,19 @@
change_price = true; change_price = true;
change_str += goods_name+'单价不能为0或空 '; change_str += goods_name+'单价不能为0或空 ';
} }
if (order_goods_type == 1 && buyer_id == null) {
change_buyer_id = true;
change_str += goods_name+'采购员不能为空 ';
}
if (order_goods_type == 1 && batch == '') {
change_batch = true;
change_str += goods_name+'批次不能为空 ';
}
}) })
if (change_price || change_goods_number) { if (change_price || change_goods_number || change_buyer_id || change_batch) {
layer.alert(change_str) layer.alert(change_str)
return false; return false;
} }
...@@ -587,7 +602,7 @@ ...@@ -587,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){ btn2: function(index, layero){
layer.close(index); layer.close(index);
...@@ -684,6 +699,9 @@ ...@@ -684,6 +699,9 @@
if (!items[i].is_add) { if (!items[i].is_add) {
$('.change_item_'+i).find('.change_goods_price').val(items[i].goods_price); $('.change_item_'+i).find('.change_goods_price').val(items[i].goods_price);
$('.change_item_'+i).find('.change_goods_number').val(items[i].goods_number); $('.change_item_'+i).find('.change_goods_number').val(items[i].goods_number);
// $('.change_item_'+i).find('.change_buyer_id').val(items[i].buyer_id);
$('.change_item_'+i).find('.change_buyer_id').selectpicker('val', items[i].buyer_id);
$('.change_item_'+i).find('.change_batch').click().val(items[i].batch);
$('.change_item_'+i).find('.change_standard_brand_id').val(items[i].standard_brand_id); $('.change_item_'+i).find('.change_standard_brand_id').val(items[i].standard_brand_id);
$('.change_item_'+i).find('.change_standard_brand_name').val(items[i].standard_brand_name); $('.change_item_'+i).find('.change_standard_brand_name').val(items[i].standard_brand_name);
......
...@@ -140,7 +140,7 @@ ...@@ -140,7 +140,7 @@
</div> </div>
<!-- 调价 --> <!-- 调价 -->
<table class="table table-bordered table-hover order-change-table shop-table"> <table class="table table-bordered table-hover text-nowrap order-change-table shop-table">
<thead> <thead>
<th width="5%">序号</th> <th width="5%">序号</th>
<th width="10%">供应商</th> <th width="10%">供应商</th>
...@@ -149,16 +149,21 @@ ...@@ -149,16 +149,21 @@
@if ($order_info['order_goods_type'] == 1) @if ($order_info['order_goods_type'] == 1)
<th width="11%">标准品牌</th> <th width="11%">标准品牌</th>
@endif @endif
<th width="10%">调整数量</th> <th width="5%">调整数量</th>
<th width="10%">调整单价</th> <th width="5%">调整单价</th>
<!-- 销售类型为预售时展示 --> <!-- 销售类型为预售时展示 -->
@if ($order_info['sale_type'] == 2) @if ($order_info['sale_type'] == 2)
<th width="10%">交期时间/天</th> <th width="10%">交期时间/天</th>
<th width="10%">锁定库存</th> <th width="10%">锁定库存</th>
@endif @endif
@if ($order_info['order_goods_type'] == 1)
<th width="5%">采购员</th>
<th width="5%">批次</th>
@endif
<td width="5%">状态</td> <th width="3%">状态</th>
<th width="5%">操作</th> <th width="3%">操作</th>
</thead> </thead>
<tbody> <tbody>
...@@ -193,10 +198,10 @@ ...@@ -193,10 +198,10 @@
</td> </td>
@endif @endif
<td> <td>
<input class="only_number num change_goods_number" name="change_info[{{$v['rec_id']}}][goods_number]" value="{{$v['goods_number']}}" <?= $v['status'] == -1 ? 'readonly' : '' ?>> <input type="text" class="only_number num change_goods_number" name="change_info[{{$v['rec_id']}}][goods_number]" value="{{$v['goods_number']}}" <?= $v['status'] == -1 ? 'readonly' : '' ?>>
</td> </td>
<td> <td>
<input class="price only_number change_goods_price" name="change_info[{{$v['rec_id']}}][goods_price]" data-origin="{{$v['original_price']}}" data-price="{{$v['goods_price']}}" value="{{$v['goods_price']}}" <?= $v['status'] == -1 ? 'readonly' : '' ?>> <input type="text" class="price only_number change_goods_price" name="change_info[{{$v['rec_id']}}][goods_price]" data-origin="{{$v['original_price']}}" data-price="{{$v['goods_price']}}" value="{{$v['goods_price']}}" <?= $v['status'] == -1 ? 'readonly' : '' ?>>
</td> </td>
<!-- 销售类型为预售时展示 --> <!-- 销售类型为预售时展示 -->
@if ($order_info['sale_type'] == 2) @if ($order_info['sale_type'] == 2)
...@@ -213,6 +218,27 @@ ...@@ -213,6 +218,27 @@
@endif @endif
</td> </td>
@endif @endif
@if ($order_info['order_goods_type'] == 1)
<td>
<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)
<option value="{{ $val->userId }}">{{ $val->name }}</option>
@endforeach
@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="{{ $v['batch'] }}">
</td>
@endif
<td> <td>
<input class="change_status" type="hidden" name="change_info[{{$v['rec_id']}}][status]" value="{{$v['status']}}"> <input class="change_status" type="hidden" name="change_info[{{$v['rec_id']}}][status]" value="{{$v['status']}}">
......
...@@ -32,7 +32,9 @@ ...@@ -32,7 +32,9 @@
<th width="20%">标准品牌</th> <th width="20%">标准品牌</th>
<th>调整数量</th> <th>调整数量</th>
<th>调整单价</th> <th>调整单价</th>
<th width="20%">状态</th> <th>采购员</th>
<th>批次</th>
<th>状态</th>
</tr> </tr>
</thead> </thead>
...@@ -44,6 +46,8 @@ ...@@ -44,6 +46,8 @@
<td>{{ isset($v['standard_brand_name']) ? $v['standard_brand_name'] : '' }}</td> <td>{{ isset($v['standard_brand_name']) ? $v['standard_brand_name'] : '' }}</td>
<td>{{$v['goods_number']}}</td> <td>{{$v['goods_number']}}</td>
<td>{{$v['goods_price']}}</td> <td>{{$v['goods_price']}}</td>
<td>{{ App\Http\Controllers\getSalesName($v['buyer_id']) }}</td>
<td>{{$v['batch']}}</td>
<td> <td>
<?= $v['status'] == 1 ? '正常' : '<i style="color: red;">已取消</i>' ?> <?= $v['status'] == 1 ? '正常' : '<i style="color: red;">已取消</i>' ?>
......
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