Commit 151b0a48 by 杨树贤

修改主营品牌限制权限逻辑

parent d2800004
......@@ -70,9 +70,7 @@ Route::match(['get', 'post'], '/test', function () {
(new \App\Http\Services\DataService())->statisticsSkuNumber();
// (new \App\Http\Services\DataService())->initialMainBrandsLimit();
// (new \App\Http\Services\DataService())->initialMainBrandsToSkuRuler();
\App\Model\LogModel::where('action','批量配置供应商sku上架有效期')->update([
'ignore_audit_check' => 1
]);
// \App\Model\SupplierChannelModel::where('supplier_name', '厦门市三安集成电路有限公司')->update([
// 'status' => 2,
// 'update_time' => time(),
......
......@@ -176,8 +176,17 @@
}
}
let mainBrandsLimitObj = $('#main_brands_limit');
//修改主营品牌数量限制权限校验
let canModifyBrandLimit = {{checkPerm('ModifyMainBrandsLimit')?1:0}};
let supplierGroupMap = {!! json_encode(config('fixed.SupplierGroup')) !!};
let limitMap = {!!json_encode(config('field.SupplierGroupMainBrandsLimitMap'))!!};
if(!canModifyBrandLimit){
mainBrandsLimitObj.attr('disabled', true);
mainBrandsLimitObj.addClass('layui-disabled');
mainBrandsLimitTypeObj.attr('disabled', true);
mainBrandsLimitTypeObj.addClass('layui-disabled');
}
//监听主营品牌限制的数字,不同供应商性质的数量限制不一样
$(document).on('change', '#main_brands_limit', function () {
let supplierGroup = $('#supplier_group').val();
......@@ -200,12 +209,10 @@
} else {
$('#agency_brands_div').hide();
}
// 这里还要去判断主营品牌数量限制的切换
// 原厂,代理商,分销平台,品牌数量不做限制;默认为“无限制”;
// 混合分销商,现货商,代工厂,品牌数量默认为10;
// 方案商,其他,品牌数量默认为5;
let mainBrandsLimitObj = $('#main_brands_limit');
let limit = limitMap[data.value];
console.log(limit)
if (limit === -1) {
......@@ -213,8 +220,10 @@
mainBrandsLimitObj.addClass('layui-disabled');
mainBrandsLimitTypeObj.val(2);
} else {
if (canModifyBrandLimit) {
mainBrandsLimitObj.attr('disabled', false);
mainBrandsLimitObj.removeClass('layui-disabled');
}
mainBrandsLimitTypeObj.val(1);
}
form.render('select');
......
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