Commit a8757b11 by 朱继来

调整下单、审单时查询标准品牌

parent f9aeb4c4
......@@ -334,13 +334,14 @@ class ApiController extends Controller
// 绑定品牌
public function apiBindStandardBrand($request)
{
$type = $request->input('type', 1);
$cart_id = $request->input('cart_id', 0);
$curr_brand_id = $request->input('curr_brand_id', 0);
$scm_brand_id = $request->input('scm_brand_id', 0);
$scm_brand_name = $request->input('scm_brand_name', 0);
$type = $request->input('type', 1);
$cart_id = $request->input('cart_id', 0);
$curr_brand_id = $request->input('curr_brand_id', 0);
$curr_brand_name = $request->input('curr_brand_name', '');
$scm_brand_id = $request->input('scm_brand_id', 0);
$scm_brand_name = $request->input('scm_brand_name', '');
if (!$curr_brand_id || !$scm_brand_id) $this->Export(1, '参数缺失');
if (!$scm_brand_id) $this->Export(1, '参数缺失');
if ($type == 1 && !$cart_id) $this->Export(1, '当前行购物车ID缺失');
......@@ -350,6 +351,7 @@ class ApiController extends Controller
$map['time'] = time();
$map['scm_brand_id'] = $scm_brand_id;
$map['brand_id'] = [$curr_brand_id];
$map['brand_name'] = [$curr_brand_name];
$map['admin_id'] = $request->user->userId;
$map['admin_name'] = $request->user->name;
$map['AuthSign'] = MD5(MD5(http_build_query($map)) . $key);
......
......@@ -879,7 +879,7 @@
// list = list.reverse();
// 购物车列表
for (var i = len - 1 ; i >= 0; i--) {
html += '<tr data-cid="'+list[i].cart_id+'" data-type="'+list[i].type+'" min_buy="'+list[i].min_buy+'" data-sup_name="'+list[i].supplier_name+'" data-sup_id="'+list[i].supplier_id+'" data-brand_id="'+list[i].brand_id+'">'+
html += '<tr data-cid="'+list[i].cart_id+'" data-type="'+list[i].type+'" min_buy="'+list[i].min_buy+'" data-sup_name="'+list[i].supplier_name+'" data-sup_id="'+list[i].supplier_id+'" data-brand_id="'+list[i].brand_id+'" data-brand_name="'+list[i].brand_name+'">'+
'<td>'+(len - i)+'</td>'+
'<td class="goods_id">'+list[i].goods_id+'</td>'+
'<td>'+list[i].goods_name+'</td>'+
......
......@@ -46,7 +46,8 @@ layui.use(['table', 'form'], function() {
// 选择标准品牌
$('.shop-table').delegate('.select-standard-brand', 'click', function() {
var type = $(this).data('type'); // 1-后台购物车,2-后台审单
var self = $(this);
var type = self.data('type'); // 1-后台购物车,2-后台审单
$('.standard_brand_name').val('');
scm_brand_id = 0;
......@@ -54,15 +55,17 @@ layui.use(['table', 'form'], function() {
renderTable(); // 重载表格
var curr_brand_id = $(this).parents('tr').data('brand_id');
var curr_brand_id = self.parents('tr').data('brand_id'); // 当前品牌ID
var curr_brand_name = self.parents('tr').data('brand_name'); // 当前品牌名称
var datax = {
type: type,
curr_brand_id : curr_brand_id
curr_brand_id : curr_brand_id,
curr_brand_name: curr_brand_name,
};
if (type == 1) {
var cart_id = $(this).parents('tr').data('cid') || 0;
var cart_id = self.parents('tr').data('cid') || 0;
datax.cart_id = cart_id;
}
......@@ -96,8 +99,8 @@ layui.use(['table', 'form'], function() {
$.lie.add_order.lists(user_id, 1, 1, delivery_place);
} else {
$('.standard_brand_id').val(scm_brand_id);
$('.standard_brand_name').val(scm_brand_name);
self.parents('tr').find('.standard_brand_id').val(scm_brand_id);
self.parents('tr').find('.standard_brand_name').val(scm_brand_name);
}
return false;
......@@ -115,6 +118,8 @@ layui.use(['table', 'form'], function() {
layer.close(index);
}
})
$('.curr-brand').text(curr_brand_name)
})
})
\ No newline at end of file
......@@ -152,7 +152,7 @@
<tbody>
@foreach ($order_items_info as $k=>$v)
<tr class="change_item_{{$v['rec_id']}}" data-sup="{{$v['canal'] ? $v['supplier_id'].'.'.$v['canal'] : $v['supplier_id']}}" data-brand_id="{{ $v['brand_id'] }}">
<tr class="change_item_{{$v['rec_id']}}" data-sup="{{$v['canal'] ? $v['supplier_id'].'.'.$v['canal'] : $v['supplier_id']}}" data-brand_id="{{ $v['brand_id'] }}" data-brand_name="{{ $v['brand_name'] }}">
<input class="change_rec_id" type="hidden" name="change_rec_id" value="{{ $v['rec_id'] }}">
<td>{{ $k+1 }}</td>
<td>
......
......@@ -4,16 +4,17 @@
.confirm-standard-brand{ float: right; }
.brand-search{ margin-top: -3px; }
#select-brand-pop .label-prompt{ padding: 6px !important; }
.show-right{ float: right; }
</style>
<div id="select-brand-pop" class="select-content">
<form class="layui-form layui-box" method="post">
<div class="layui-input-inline">
<input type="text" class="standard_brand_name" name="standard_brand_name" placeholder="输入品牌名称" autocomplete="off">
<span>当前品牌:<strong class="layui-btn-sm curr-brand"></strong></span>
<div class="layui-input-inline show-right">
<input type="text" class="standard_brand_name" name="standard_brand_name" placeholder="输入标准品牌名称" autocomplete="off">
<button lay-submit lay-filter="load" class="layui-btn layui-btn-sm brand-search">搜索</button>
</div>
<!-- <a class="layui-btn layui-btn-normal layui-btn-sm confirm-standard-brand">确认带回</a> -->
</form>
<table id="brandList" lay-filter="brandList"></table>
......
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