Commit 151b0a48 by 杨树贤

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

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