Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
liexin_supplier
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1e371191
authored
Jul 05, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
权限
parent
3d6cbdcf
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
17 deletions
app/Http/Controllers/Api/SupplierReceiptApiController.php
app/Http/Services/SupplierAuditService.php
app/Http/Services/SupplierContactService.php
app/Http/Services/SupplierService.php
app/Http/Transformers/SupplierTransformer.php
resources/views/script/SupplierListScript.blade.php
app/Http/Controllers/Api/SupplierReceiptApiController.php
View file @
1e371191
...
...
@@ -104,7 +104,7 @@ class SupplierReceiptApiController extends Controller
];
//如果有忽略审核的权限并且不需要复审,那么状态就是不需要审核直接通过
$canIgnoreAudit
=
(
new
SupplierAuditService
())
->
checkCanIgnoreSupplierAudit
(
$
old
Receipt
[
'supplier_id'
]);
$canIgnoreAudit
=
(
new
SupplierAuditService
())
->
checkCanIgnoreSupplierAudit
(
$
new
Receipt
[
'supplier_id'
]);
if
(
$canIgnoreAudit
)
{
return
false
;
}
...
...
app/Http/Services/SupplierAuditService.php
View file @
1e371191
...
...
@@ -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
;
}
...
...
app/Http/Services/SupplierContactService.php
View file @
1e371191
...
...
@@ -133,7 +133,7 @@ class SupplierContactService
];
//如果有忽略审核的权限并且不需要复审,那么状态就是不需要审核直接通过
$canIgnoreAudit
=
(
new
SupplierAuditService
())
->
checkCanIgnoreSupplierAudit
(
$
old
Contact
[
'supplier_id'
]);
$canIgnoreAudit
=
(
new
SupplierAuditService
())
->
checkCanIgnoreSupplierAudit
(
$
new
Contact
[
'supplier_id'
]);
if
(
$canIgnoreAudit
)
{
return
false
;
}
...
...
app/Http/Services/SupplierService.php
View file @
1e371191
...
...
@@ -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
;
}
...
...
app/Http/Transformers/SupplierTransformer.php
View file @
1e371191
...
...
@@ -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'
]
=
''
;
}
...
...
resources/views/script/SupplierListScript.blade.php
View file @
1e371191
...
...
@@ -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
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment