Commit 1e371191 by 杨树贤

权限

parent 3d6cbdcf
......@@ -104,7 +104,7 @@ class SupplierReceiptApiController extends Controller
];
//如果有忽略审核的权限并且不需要复审,那么状态就是不需要审核直接通过
$canIgnoreAudit = (new SupplierAuditService())->checkCanIgnoreSupplierAudit($oldReceipt['supplier_id']);
$canIgnoreAudit = (new SupplierAuditService())->checkCanIgnoreSupplierAudit($newReceipt['supplier_id']);
if ($canIgnoreAudit) {
return false;
}
......
......@@ -235,8 +235,7 @@ class SupplierAuditService
'sku_tag',
'sku_tag',
'sku_upload_ruler',
'sku_audit_ruler',
'need_review'
'sku_audit_ruler'
];
//先找出目前数据库里面的数据
$selectField = array_keys($channel);
......@@ -250,10 +249,10 @@ class SupplierAuditService
$supplier = $model->select($selectField)->where('supplier_id', $supplierId)->first()->toArray();
//如果有忽略审核的权限并且不需要复审,那么状态就是不需要审核直接通过
if (checkPerm('IgnoreUpdateAudit') && !$supplier['need_review']) {
$canIgnoreAudit = $this->checkCanIgnoreSupplierAudit($supplierId);
if ($canIgnoreAudit) {
return false;
}
$changeField = [];
foreach ($supplier as $key => $value) {
if ($value != $channel[$key]) {
......@@ -276,7 +275,7 @@ class SupplierAuditService
//如果有忽略审核的权限并且不需要复审,那么状态就是不需要审核直接通过
if (!checkPerm('IgnoreUpdateAudit') && !$needReview) {
return true;
}else{
} else {
return false;
}
......
......@@ -133,7 +133,7 @@ class SupplierContactService
];
//如果有忽略审核的权限并且不需要复审,那么状态就是不需要审核直接通过
$canIgnoreAudit = (new SupplierAuditService())->checkCanIgnoreSupplierAudit($oldContact['supplier_id']);
$canIgnoreAudit = (new SupplierAuditService())->checkCanIgnoreSupplierAudit($newContact['supplier_id']);
if ($canIgnoreAudit) {
return false;
}
......
......@@ -188,7 +188,8 @@ class SupplierService
$supplier = SupplierChannelModel::where('supplier_id', $supplierId)->first()->toArray();
//要做进一步判断,部分字段修改不需要审核
$auditService = new SupplierAuditService();
$needAudit = $auditService->checkNeedAudit($supplierId, $channel, $attachment);
$needAudit = $auditService->checkNeedAudit($supplierId, $channel);
if ($needAudit) {
$channel['status'] = SupplierChannelModel::STATUS_PENDING;
}
......
......@@ -5,6 +5,7 @@ namespace App\Http\Transformers;
use App\Http\Services\AdminUserService;
use App\Http\Services\DepartmentService;
use App\Http\Services\SupplierPayTypeService;
use App\Http\Services\SupplierService;
use App\Http\Services\SupplierSkuAuditRulerService;
......@@ -54,6 +55,11 @@ class SupplierTransformer
$supplier['create_name'] = array_get($userInfo, 'name');
}
//获取最新修改人以及下级审核员
$logModel = new LogModel();
$log = $logModel->where('supplier_id', $supplier['supplier_id'])
->where('type', LogModel::UPDATE_OPERATE)->orderBy('id', 'desc')->first();
$supplier['last_update_name'] = $log ? $log['admin_name']: '';
//黑名单
if (!empty($supplier['blacklist'])) {
$supplier['blacklist_name'] = $supplier['blacklist']['blacklist_name'];
......@@ -274,7 +280,7 @@ class SupplierTransformer
}
//国内才有税号
if ($channel['region']!=SupplierChannelModel::REGION_CN) {
if ($channel['region'] != SupplierChannelModel::REGION_CN) {
$channel['tax_number'] = '';
}
......
......@@ -104,7 +104,6 @@
let cols = [
{type: 'checkbox', fixed: true},
{field: 'supplier_id', title: '供应商ID', align: 'center', width: 80},
{
field: 'supplier_code', title: '供应商编码', align: 'center', width: 90, templet: function (data) {
......@@ -147,13 +146,6 @@
"' class='list-href' ew-title='供应商详情 - " + data.supplier_code + "' title='点击跳转查看联系人列表'>" + data.contact_num + "</a>"
}
},
{field: 'has_sku', title: 'SKU上传', align: 'center', width: 80},
{
field: 'uploaded_sku', title: 'SKU合作', align: 'center', width: 80, templet: function (data) {
return data.uploaded_sku > 0 ? '是' : '否';
}
},
{
field: 'status_name', title: '状态', align: 'center', width: 80, templet: function (data) {
if (data.status === 3) {
......@@ -167,6 +159,13 @@
},
{field: 'channel_username', title: '采购员', align: 'center', width: 130},
{field: 'purchase_username', title: '渠道开发员', align: 'center', width: 110},
{field: 'last_update_name', title: '最新修改人', align: 'center', width: 110},
{field: 'has_sku', title: 'SKU上传', align: 'center', width: 80},
{
field: 'uploaded_sku', title: 'SKU合作', align: 'center', width: 80, templet: function (data) {
return data.uploaded_sku > 0 ? '是' : '否';
}
},
{field: 'create_name', title: '创建人', align: 'center', width: 70},
{field: 'update_time', title: '最近修改时间', align: 'center', width: 145},
{field: 'supplier_type_name', title: '供应商类别', align: 'center', width: 110},
......
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