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
3a27b127
authored
Jul 29, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修改bug
parent
cfdd2850
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
10 deletions
app/Http/Controllers/Api/SupplierApiController.php
app/Http/Services/SupplierAuditService.php
resources/views/script/SupplierListScript.blade.php
resources/views/web/SupplierDetail.blade.php
resources/views/web/supplier/SupplierBase.blade.php
app/Http/Controllers/Api/SupplierApiController.php
View file @
3a27b127
...
@@ -12,6 +12,7 @@ use App\Http\Services\SyncSupplierService;
...
@@ -12,6 +12,7 @@ use App\Http\Services\SyncSupplierService;
use
App\Http\Transformers\SupplierTransformer
;
use
App\Http\Transformers\SupplierTransformer
;
use
App\Http\Validators\SupplierValidator
;
use
App\Http\Validators\SupplierValidator
;
use
App\Model\LogModel
;
use
App\Model\LogModel
;
use
App\Model\RedisModel
;
use
App\Model\SupplierChannelModel
;
use
App\Model\SupplierChannelModel
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
...
@@ -157,6 +158,10 @@ class SupplierApiController extends Controller
...
@@ -157,6 +158,10 @@ class SupplierApiController extends Controller
//禁用不是直接修改为无法交易,而是改为审核中,然后审核通过后,变成无法交易
//禁用不是直接修改为无法交易,而是改为审核中,然后审核通过后,变成无法交易
$supplierId
=
$request
->
get
(
'supplier_id'
);
$supplierId
=
$request
->
get
(
'supplier_id'
);
$model
=
new
SupplierChannelModel
();
$model
=
new
SupplierChannelModel
();
//先保存原来的状态
$supplier
=
$model
->
where
(
'supplier_id'
,
$supplierId
)
->
first
()
->
toArray
();
$redis
=
new
RedisModel
();
$redis
->
hset
(
'supplier_status_before_disable'
,
$supplierId
,
$supplier
[
'status'
]);
$result
=
$model
->
where
(
'supplier_id'
,
$supplierId
)
->
update
([
$result
=
$model
->
where
(
'supplier_id'
,
$supplierId
)
->
update
([
'update_time'
=>
time
(),
'update_time'
=>
time
(),
'status'
=>
$model
::
STATUS_DISABLE
,
'status'
=>
$model
::
STATUS_DISABLE
,
...
@@ -418,13 +423,13 @@ class SupplierApiController extends Controller
...
@@ -418,13 +423,13 @@ class SupplierApiController extends Controller
if
(
empty
(
$blockReason
))
{
if
(
empty
(
$blockReason
))
{
$this
->
response
(
-
1
,
'必须填写拉黑原因'
);
$this
->
response
(
-
1
,
'必须填写拉黑原因'
);
}
}
if
(
mb_strlen
(
$blockReason
)
>
200
)
{
if
(
mb_strlen
(
$blockReason
)
>
200
)
{
$this
->
response
(
-
1
,
'拉黑原因不能超过200字'
);
$this
->
response
(
-
1
,
'拉黑原因不能超过200字'
);
}
}
$channelModel
=
new
SupplierChannelModel
();
$channelModel
=
new
SupplierChannelModel
();
$result
=
$channelModel
->
where
(
'supplier_id'
,
$supplierId
)
->
update
([
$result
=
$channelModel
->
where
(
'supplier_id'
,
$supplierId
)
->
update
([
'block_reason'
=>
$request
->
get
(
'block_reason'
),
'block_reason'
=>
$request
->
get
(
'block_reason'
),
'status'
=>
-
3
,
'status'
=>
$channelModel
::
STATUS_BLOCK
,
'update_time'
=>
time
(),
'update_time'
=>
time
(),
]);
]);
...
@@ -460,11 +465,16 @@ class SupplierApiController extends Controller
...
@@ -460,11 +465,16 @@ class SupplierApiController extends Controller
{
{
$supplierId
=
$request
->
get
(
'supplier_id'
);
$supplierId
=
$request
->
get
(
'supplier_id'
);
$channelModel
=
new
SupplierChannelModel
();
$channelModel
=
new
SupplierChannelModel
();
//先找出原来的状态
$redis
=
new
RedisModel
();
$previousStatus
=
$redis
->
hget
(
'supplier_status_before_disable'
,
$supplierId
);
$result
=
$channelModel
->
where
(
'supplier_id'
,
$supplierId
)
->
update
([
$result
=
$channelModel
->
where
(
'supplier_id'
,
$supplierId
)
->
update
([
'status'
=>
2
,
'status'
=>
$previousStatus
,
'update_time'
=>
time
(),
'update_time'
=>
time
(),
]);
]);
if
(
$result
)
{
if
(
$result
)
{
//删除redis状态
$redis
->
hdel
(
'supplier_status_before_disable'
,
$supplierId
);
$logService
=
new
LogService
();
$logService
=
new
LogService
();
$logService
->
AddLog
(
$supplierId
,
LogModel
::
UPDATE_OPERATE
,
'取消禁用'
,
'取消禁用供应商'
);
$logService
->
AddLog
(
$supplierId
,
LogModel
::
UPDATE_OPERATE
,
'取消禁用'
,
'取消禁用供应商'
);
$this
->
response
(
0
,
'取消禁用成功'
);
$this
->
response
(
0
,
'取消禁用成功'
);
...
...
app/Http/Services/SupplierAuditService.php
View file @
3a27b127
...
@@ -178,7 +178,9 @@ class SupplierAuditService
...
@@ -178,7 +178,9 @@ class SupplierAuditService
'province_id'
,
'province_id'
,
'city_id'
,
'city_id'
,
'established_time'
,
'established_time'
,
'credit_investigation'
'credit_investigation'
,
'system_tags'
,
'customer_tags'
,
];
];
//先找出目前数据库里面的数据
//先找出目前数据库里面的数据
$selectField
=
array_keys
(
$channel
);
$selectField
=
array_keys
(
$channel
);
...
@@ -205,7 +207,6 @@ class SupplierAuditService
...
@@ -205,7 +207,6 @@ class SupplierAuditService
$changeField
[]
=
$key
;
$changeField
[]
=
$key
;
}
}
}
}
foreach
(
$changeField
as
$filed
)
{
foreach
(
$changeField
as
$filed
)
{
//只要有一个不存在于不需要审核的字段,就返回需要审核
//只要有一个不存在于不需要审核的字段,就返回需要审核
if
(
!
in_array
(
$filed
,
$notNeedAuditField
))
{
if
(
!
in_array
(
$filed
,
$notNeedAuditField
))
{
...
...
resources/views/script/SupplierListScript.blade.php
View file @
3a27b127
...
@@ -82,7 +82,11 @@
...
@@ -82,7 +82,11 @@
}
}
},
},
{
{
field
:
'quality_assurance_agreement'
,
title
:
'品质协议'
,
align
:
'center'
,
width
:
80
,
templet
:
function
(
data
)
{
field
:
'quality_assurance_agreement'
,
title
:
'品质协议'
,
align
:
'center'
,
width
:
80
,
templet
:
function
(
data
)
{
if
(
data
.
attachment
)
{
if
(
data
.
attachment
)
{
return
data
.
attachment
.
quality_assurance_agreement
?
'有'
:
'无'
;
return
data
.
attachment
.
quality_assurance_agreement
?
'有'
:
'无'
;
}
}
...
@@ -407,7 +411,7 @@
...
@@ -407,7 +411,7 @@
const
status
=
data
[
0
].
status
;
const
status
=
data
[
0
].
status
;
const
hasSku
=
data
[
0
].
sku_num
;
const
hasSku
=
data
[
0
].
sku_num
;
const
needReview
=
data
[
0
].
need_review
;
const
needReview
=
data
[
0
].
need_review
;
if
(
needReview
===
1
)
{
if
(
needReview
===
1
&&
status
!==
0
)
{
layer
.
msg
(
"该供应商还没有进行复审,不能直接禁用;"
,
{
icon
:
5
})
layer
.
msg
(
"该供应商还没有进行复审,不能直接禁用;"
,
{
icon
:
5
})
return
;
return
;
}
}
...
...
resources/views/web/SupplierDetail.blade.php
View file @
3a27b127
...
@@ -87,8 +87,14 @@
...
@@ -87,8 +87,14 @@
</button>
</button>
@endif
@endif
@endif
@endif
<a
href=
"/supplier/PrintSupplier?view=iframe&supplier_id={{$supplier['supplier_id']}}"
@if (checkPerm('PrintSupplier'))
target=
"_blank"
style=
"margin-bottom: 25px;margin-top: 5px"
class=
"layui-btn layui-btn"
>
打印
</a>
{{--禁用和黑名单不显示打印按钮--}}
@if($supplier['status']== \App\Model\SupplierChannelModel::STATUS_DISABLE || $supplier['status']== \App\Model\SupplierChannelModel::STATUS_BLOCK)
@else
<a
href=
"/supplier/PrintSupplier?view=iframe&supplier_id={{$supplier['supplier_id']}}"
target=
"_blank"
style=
"margin-bottom: 25px;margin-top: 5px"
class=
"layui-btn layui-btn"
>
打印
</a>
@endif
@endif
</div>
</div>
</div>
</div>
<div
class=
"layui-card-body"
style=
"margin-top: 140px"
>
<div
class=
"layui-card-body"
style=
"margin-top: 140px"
>
...
...
resources/views/web/supplier/SupplierBase.blade.php
View file @
3a27b127
...
@@ -196,7 +196,7 @@
...
@@ -196,7 +196,7 @@
@include('web.supplier.SupplierFile')
@include('web.supplier.SupplierFile')
@if($operate!='add')
@if($operate!='add'
&&
checkPerm('UpdateSupplierTags')
)
<blockquote
class=
"layui-elem-quote layui-text"
>
<blockquote
class=
"layui-elem-quote layui-text"
>
<b>
供应商标签 :
</b>
<b>
供应商标签 :
</b>
</blockquote>
</blockquote>
...
...
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