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
0ca7b31c
authored
Jul 16, 2025
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
区分
parent
8d60a8e8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
84 additions
and
6 deletions
app/Http/Controllers/Api/SupplierApiController.php
app/Http/Services/SupplierService.php
app/Http/Services/SyncSupplierService.php
resources/views/script/BatchAllocateYunxinChannelUserScript.blade.php
resources/views/web/BatchAllocateYunxinChannelUser.blade.php
app/Http/Controllers/Api/SupplierApiController.php
View file @
0ca7b31c
...
...
@@ -257,7 +257,6 @@ class SupplierApiController extends Controller
public
function
DisableSupplier
(
$request
)
{
//禁用不是直接修改为无法交易,而是改为审核中,然后审核通过后,变成无法交易
$supplierId
=
$request
->
get
(
'supplier_id'
);
$disableReason
=
trim
(
$request
->
get
(
'disable_reason'
));
if
(
empty
(
$disableReason
))
{
...
...
@@ -271,7 +270,7 @@ class SupplierApiController extends Controller
$result
=
$model
->
where
(
'supplier_id'
,
$supplierId
)
->
update
([
'update_time'
=>
time
(),
'status'
=>
$model
::
STATUS_DISABLE
,
'disable_reason'
=>
$disableReason
,
'disable_reason'
=>
'人工禁用:'
.
$disableReason
,
]);
if
(
$result
)
{
//写日志
...
...
@@ -811,4 +810,17 @@ class SupplierApiController extends Controller
}
$this
->
response
(
0
,
'修改供应商名称成功,请等待一体化再次审核'
);
}
//清空线上采购员
public
function
resetYunxinChannelUser
(
$request
)
{
$supplierId
=
$request
->
get
(
'supplier_id'
);
$supplierService
=
new
SupplierService
();
$result
=
$supplierService
->
resetYunxinChannelUser
(
$supplierId
);
if
(
$result
)
{
$this
->
response
(
0
,
'清空线上采购员成功'
);
}
else
{
$this
->
response
(
-
1
,
'清空线上采购员失败'
);
}
}
}
app/Http/Services/SupplierService.php
View file @
0ca7b31c
...
...
@@ -983,4 +983,17 @@ class SupplierService
}
return
$data
;
}
//清空线上采购员
public
function
resetYunxinChannelUser
(
$supplierId
)
{
$result
=
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
update
([
'yunxin_channel_uid'
=>
''
,
'update_time'
=>
time
(),
]);
//还要记录日志
$logService
=
new
LogService
();
$logService
->
AddLog
(
$supplierId
,
LogModel
::
UPDATE_OPERATE
,
'清空线上采购员'
,
'清空线上采购员'
);
return
$result
;
}
}
app/Http/Services/SyncSupplierService.php
View file @
0ca7b31c
...
...
@@ -296,6 +296,13 @@ class SyncSupplierService
foreach
(
$suppliers
as
$supplier
)
{
//判断是否是同名多供应商,如果是的话,如果是之前已经禁用的,则直接跳过
if
(
count
(
$suppliers
)
>
1
)
{
//判断是否是人工禁用的,是的话,也跳过
//线上数据,实体名单状态为普通,且供应商状态为禁止交易的,全部为手动禁用;
if
(
strpos
(
$supplier
[
'disable_reason'
],
'人工禁用:'
)
!==
false
||
(
$supplier
[
'status'
]
==
SupplierChannelModel
::
STATUS_DISABLE
&&
$supplier
[
'is_entity'
]
!=
SupplierChannelModel
::
IS_ENTITY_FALSE
))
{
Log
::
warning
(
"检测到同名供应商并且属于禁用(人工禁用)状态,跳过,供应商id为 : "
.
$supplier
[
'supplier_id'
]);
continue
;
}
if
(
$supplier
[
'status'
]
==
SupplierChannelModel
::
STATUS_DISABLE
&&
$supplier
[
'is_entity'
]
!=
SupplierChannelModel
::
IS_ENTITY_NEED_CONFIRM
)
{
Log
::
warning
(
"检测到同名供应商并且属于禁用(实体名单不为待处理)状态,跳过,供应商id为 : "
.
$supplier
[
'supplier_id'
]);
continue
;
...
...
resources/views/script/BatchAllocateYunxinChannelUserScript.blade.php
View file @
0ca7b31c
...
...
@@ -4,6 +4,49 @@
let
form
=
layui
.
form
;
let
table
=
layui
.
table
let
element
=
layui
.
element
;
$
(
document
).
on
(
'click'
,
'.reset-yunxin-channel-user'
,
function
()
{
var
that
=
$
(
this
);
var
index
=
layer
.
confirm
(
'确定要清空该供应商的线上采购员吗?'
,
{
btn
:
[
'确定'
,
'取消'
]
//按钮
},
function
()
{
admin
.
showLoading
({
type
:
3
});
let
supplierId
=
that
.
attr
(
'data-id'
);
let
url
=
'/api/supplier/ResetYunxinChannelUser?supplier_id='
+
supplierId
;
$
.
ajax
({
url
:
url
,
type
:
'GET'
,
async
:
true
,
dataType
:
'json'
,
timeout
:
20000
,
success
:
function
(
res
)
{
admin
.
removeLoading
();
if
(
res
.
err_code
===
0
)
{
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
6
});
window
.
location
.
reload
();
}
else
{
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
5
});
}
}
,
error
:
function
()
{
admin
.
removeLoading
();
parent
.
layer
.
msg
(
'网络错误'
,
{
icon
:
5
});
}
});
return
false
;
});
});
form
.
on
(
'submit(allocate)'
,
function
(
data
)
{
admin
.
showLoading
({
type
:
3
...
...
@@ -37,4 +80,4 @@
admin
.
closeThisDialog
();
});
});
</script>
\ No newline at end of file
</script>
resources/views/web/BatchAllocateYunxinChannelUser.blade.php
View file @
0ca7b31c
...
...
@@ -37,7 +37,7 @@
<colgroup>
<col
width=
"300"
>
<col
width=
"500"
>
<col
width=
"1
0
0"
>
<col
width=
"1
2
0"
>
<col>
</colgroup>
<thead>
...
...
@@ -52,7 +52,11 @@
<tr>
<td>
{{$supplier['supplier_name']}}
</td>
<td>
{{$supplier['channel_username']}}
</td>
<td>
{{$supplier['yunxin_channel_username']}}
<button
class=
"layui-btn layui-btn-xs"
lay-submit
lay-filter=
"delete"
>
清空
</button></td>
<td>
{{$supplier['yunxin_channel_username']}}
@if($supplier['yunxin_channel_username'] != '')
<button
class=
"layui-btn layui-btn-xs reset-yunxin-channel-user"
data-id=
"{{$supplier['supplier_id']}}"
style=
"float: right;"
>
清空
</button>
@endif
</td>
</tr>
@endforeach
</tbody>
...
...
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