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
40f91cc1
authored
Jul 11, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
SKU采购员字眼替换
parent
8cd2d589
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
30 additions
and
30 deletions
app/Http/Controllers/Api/SupplierApiController.php
app/Http/Controllers/SupplierController.php
app/Http/Services/DataService.php
app/Http/Services/SupplierService.php
resources/views/script/SupplierListScript.blade.php
resources/views/script/supplier/SupplierContactScript.blade.php
resources/views/web/BatchAllocateYunxinChannelUser.blade.php
resources/views/web/SupplierDetail.blade.php
resources/views/web/UpdateSupplier.blade.php
resources/views/web/supplier/SupplierListFilter.blade.php
app/Http/Controllers/Api/SupplierApiController.php
View file @
40f91cc1
...
...
@@ -534,7 +534,7 @@ class SupplierApiController extends Controller
$adminService
=
new
AdminUserService
();
$user
=
$adminService
->
getAdminUserInfoByCodeId
(
$channelUid
);
$logService
=
new
LogService
();
$logService
->
AddLog
(
$supplierId
,
LogModel
::
UPDATE_OPERATE
,
'设置
SKU采购员'
,
'设置SKU
采购员为 : '
.
$user
[
'name'
]);
$logService
->
AddLog
(
$supplierId
,
LogModel
::
UPDATE_OPERATE
,
'设置
线上采购员'
,
'设置线上
采购员为 : '
.
$user
[
'name'
]);
$this
->
response
(
0
,
'设置SKU采购成功'
);
}
else
{
$this
->
response
(
-
1
,
'设置SKU采购失败'
);
...
...
@@ -549,13 +549,13 @@ class SupplierApiController extends Controller
$supplierIds
=
explode
(
','
,
$supplierIds
);
$supplierService
=
new
SupplierService
();
if
(
empty
(
$channelUid
))
{
$this
->
response
(
-
1
,
'请选择
SKU
采购员'
);
$this
->
response
(
-
1
,
'请选择
线上
采购员'
);
}
if
(
!
$supplierService
->
checkCanAllocatYunxinChannelUid
(
$supplierIds
,
$channelUid
))
{
$this
->
response
(
-
1
,
'选择的供应商里面不存在对应的
SKU
采购员'
);
$this
->
response
(
-
1
,
'选择的供应商里面不存在对应的
线上
采购员'
);
}
$supplierService
->
batchAllocateYunxinChannelUser
(
$supplierIds
,
$channelUid
);
$this
->
response
(
0
,
'批量分配
SKU
采购员成功'
);
$this
->
response
(
0
,
'批量分配
线上
采购员成功'
);
}
//检查能否能申请审核
...
...
app/Http/Controllers/SupplierController.php
View file @
40f91cc1
...
...
@@ -316,7 +316,7 @@ class SupplierController extends Controller
return
view
(
'web'
,
$data
);
}
//分配
SKU
采购员
//分配
线上
采购员
public
function
SetYunxinChannelUser
(
$request
)
{
$supplierId
=
$request
->
get
(
'supplier_id'
);
...
...
@@ -326,7 +326,7 @@ class SupplierController extends Controller
$this
->
data
[
'supplier'
]
=
$supplier
;
$intraCodeModel
=
new
IntracodeModel
();
$userCodes
=
$intraCodeModel
->
getSampleEncode
();
//去除非当前供应商所拥有的采购的人员,只能从当前供应商设置的采购里面选择
SKU
采购员
//去除非当前供应商所拥有的采购的人员,只能从当前供应商设置的采购里面选择
线上
采购员
$channelUids
=
explode
(
','
,
$supplier
[
'channel_uid'
]);
foreach
(
$userCodes
as
$codeId
=>
$value
)
{
if
(
!
in_array
(
$codeId
,
$channelUids
))
{
...
...
@@ -337,7 +337,7 @@ class SupplierController extends Controller
return
$this
->
view
(
'审核供应商'
);
}
//批量分配
SKU
采购员
//批量分配
线上
采购员
public
function
BatchAllocateYunxinChannelUser
(
$request
)
{
$supplierIds
=
$request
->
get
(
'supplier_ids'
);
...
...
app/Http/Services/DataService.php
View file @
40f91cc1
...
...
@@ -484,7 +484,7 @@ class DataService
'是否平台供应商'
,
'是否芯链商家'
,
'是否SKU上架中'
,
'现有
SKU
采购员或者意向分配采购员'
,
'现有
线上
采购员或者意向分配采购员'
,
'采购所在采购部门'
,
];
$intraCodeModel
=
new
IntracodeModel
();
...
...
@@ -806,7 +806,7 @@ class DataService
}
}
//同步基石的sku上传内部编码到供应商的
SKU
采购员
//同步基石的sku上传内部编码到供应商的
线上
采购员
public
function
syncFootstoneSkuUploadEncoded
(
$isUpdate
=
false
)
{
$suppliers
=
SupplierChannelModel
::
select
([
'supplier_code'
,
'yunxin_channel_uid'
])
->
where
(
'is_type'
,
...
...
@@ -818,14 +818,14 @@ class DataService
if
(
!
$lastEncoded
)
{
continue
;
}
//判断是否已经有
SKU
采购员了,有的话跳过
//判断是否已经有
线上
采购员了,有的话跳过
$hasSkuChannelUid
=
SupplierChannelModel
::
where
(
'supplier_code'
,
$supplier
[
'supplier_code'
])
->
where
(
'yunxin_channel_uid'
,
'!='
,
0
)
->
exists
();
if
(
$hasSkuChannelUid
)
{
echo
"已经有
SKU
采购员,供应商编码为 : ${supplier['supplier_code']} , 跳过"
.
PHP_EOL
;
echo
"已经有
线上
采购员,供应商编码为 : ${supplier['supplier_code']} , 跳过"
.
PHP_EOL
;
continue
;
}
echo
"修改
SKU
采购员 : ${supplier['supplier_code']} => ${lastEncoded}"
.
PHP_EOL
;
echo
"修改
线上
采购员 : ${supplier['supplier_code']} => ${lastEncoded}"
.
PHP_EOL
;
if
(
$isUpdate
)
{
SupplierChannelModel
::
where
(
'supplier_code'
,
$supplier
[
'supplier_code'
])
->
update
([
'yunxin_channel_uid'
=>
$lastEncoded
]);
...
...
@@ -933,7 +933,7 @@ class DataService
'供应商名称'
,
'供应商性质'
,
'采购员'
,
'
sku
采购员'
,
'
线上
采购员'
,
'最新修改人'
,
'创建人'
,
'创建时间'
,
...
...
@@ -1066,7 +1066,7 @@ class DataService
// }
$intraCodeModel
=
new
IntracodeModel
();
$users
=
$intraCodeModel
->
getSampleName
(
true
);
$header
=
[
'供应商编码'
,
'供应商名称'
,
'
sku
采购员'
,
'采购组别'
];
$header
=
[
'供应商编码'
,
'供应商名称'
,
'
线上
采购员'
,
'采购组别'
];
//
// //导出sku接入方式为专营API
// $excelData = [];
...
...
@@ -1168,7 +1168,7 @@ class DataService
'供应商编码'
,
'供应商名称'
,
'供应商性质'
,
'
sku
采购员'
,
'
线上
采购员'
,
'组别'
,
];
$intraCodeModel
=
new
IntracodeModel
();
...
...
@@ -1348,7 +1348,7 @@ class DataService
{
$header
=
[
'采购部门'
,
'
sku
采购员'
,
'
线上
采购员'
,
'供应商性质'
,
'供应商编码'
,
'供应商名称'
,
...
...
@@ -1453,7 +1453,7 @@ class DataService
{
ini_set
(
'memory_limit'
,
-
1
);
$isUpdate
=
false
;
$filePath
=
public_path
(
'data'
)
.
DIRECTORY_SEPARATOR
.
'没有
SKU
采购员供应商清单.xlsx'
;
$filePath
=
public_path
(
'data'
)
.
DIRECTORY_SEPARATOR
.
'没有
线上
采购员供应商清单.xlsx'
;
$supplierCodeList
=
[];
Excel
::
selectSheetsByIndex
(
0
)
->
load
(
$filePath
,
function
(
$reader
)
use
(
$isUpdate
,
&
$supplierCodeList
)
{
$reader
->
sheet
(
'Sheet1'
,
function
()
use
(
$reader
,
$isUpdate
,
&
$supplierCodeList
)
{
...
...
@@ -1478,7 +1478,7 @@ class DataService
$header
=
[
'供应商名称'
,
'最大金额采购员'
,
'
sku
采购员'
,
'
线上
采购员'
,
'采购员'
,
'创建人'
,
];
...
...
app/Http/Services/SupplierService.php
View file @
40f91cc1
...
...
@@ -486,7 +486,7 @@ class SupplierService
return
true
;
}
//批量分配
SKU
采购员
//批量分配
线上
采购员
public
function
batchAllocateYunxinChannelUser
(
$supplierIds
,
$yunxinChannelUid
)
{
$yunxinChannelUserName
=
(
new
AdminUserService
())
->
getAdminUserNameByCodeId
(
$yunxinChannelUid
);
...
...
@@ -511,13 +511,13 @@ class SupplierService
$redis
->
expire
(
$redisKey
,
60
*
60
*
3
);
}
$preYunxinChannelUserName
=
(
new
AdminUserService
())
->
getAdminUserNameByCodeId
(
$preYunxinChannelUid
);
$content
=
"将
SKU
采购员由 [${preYunxinChannelUserName}] 改为 [${yunxinChannelUserName}]"
;
$content
=
"将
线上
采购员由 [${preYunxinChannelUserName}] 改为 [${yunxinChannelUserName}]"
;
$logService
->
AddIgnoreAuditCheckLog
(
$supplierId
,
LogModel
::
UPDATE_OPERATE
,
'分配渠道开发员'
,
$content
);
}
return
true
;
}
//检测是否可以批量分配
SKU
采购员(分配的采购员必须供应商要有的)
//检测是否可以批量分配
线上
采购员(分配的采购员必须供应商要有的)
//$filterChannelUid筛选出来的采购员ID
public
function
checkCanAllocatYunxinChannelUid
(
$supplierIds
,
$skuChannelUid
)
{
...
...
resources/views/script/SupplierListScript.blade.php
View file @
40f91cc1
...
...
@@ -168,7 +168,7 @@
},
{
field
:
'purchase_username'
,
title
:
'渠道开发员'
,
align
:
'center'
,
width
:
110
},
{
field
:
'last_update_name'
,
title
:
'最新修改人'
,
align
:
'center'
,
width
:
110
},
{
field
:
'yunxin_channel_username'
,
title
:
'
SKU
采购员'
,
align
:
'center'
,
width
:
110
},
{
field
:
'yunxin_channel_username'
,
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
)
{
...
...
@@ -638,7 +638,7 @@
type
:
2
,
content
:
'/supplier/BatchAllocateYunxinChannelUser?view=iframe&supplier_ids='
+
supplierIds
,
area
:
[
'80%'
,
'80%'
],
title
:
'批量配置
SKU
采购员'
,
title
:
'批量配置
线上
采购员'
,
end
:
function
()
{
table
.
reload
(
'list'
);
}
...
...
resources/views/script/supplier/SupplierContactScript.blade.php
View file @
40f91cc1
...
...
@@ -89,7 +89,7 @@
type
:
2
,
content
:
'/supplier/SetYunxinChannelUser?view=iframe&supplier_id='
+
supplierId
,
area
:
[
'600px'
,
'525px'
],
title
:
'配置
SKU
采购员'
,
title
:
'配置
线上
采购员'
,
end
:
function
()
{
// 监听弹窗关闭
table
.
reload
(
'contactList'
);
}
...
...
resources/views/web/BatchAllocateYunxinChannelUser.blade.php
View file @
40f91cc1
...
...
@@ -13,7 +13,7 @@
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
style=
"margin-left: -30px"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('channel_uid','
SKU
采购员',null,
{!! $statusPresenter->render('channel_uid','
线上
采购员',null,
$userCodes,['required'=>true,'width'=>'150px']) !!}
</div>
</div>
...
...
@@ -31,7 +31,7 @@
</div>
<div
class=
"layui-card-body"
>
<blockquote
class=
"layui-elem-quote layui-text"
>
<b>
当前选中需要批量修改
SKU采购员的供应商列表
<span
style=
"color: red"
>
(注意需要分配的SKU
采购员必须是下列供应商都有的采购才行)
</span></b>
<b>
当前选中需要批量修改
线上采购员的供应商列表
<span
style=
"color: red"
>
(注意需要分配的线上
采购员必须是下列供应商都有的采购才行)
</span></b>
</blockquote>
<table
class=
"layui-table"
>
<colgroup>
...
...
@@ -44,7 +44,7 @@
<tr>
<th>
供应商名称
</th>
<th>
当前采购员
</th>
<th>
当前
SKU
采购员
</th>
<th>
当前
线上
采购员
</th>
</tr>
</thead>
<tbody>
...
...
resources/views/web/SupplierDetail.blade.php
View file @
40f91cc1
...
...
@@ -51,7 +51,7 @@
</div>
<div
class=
"layui-col-md2"
>
SKU
采购员 : {{$supplier['yunxin_channel_username']}}
线上
采购员 : {{$supplier['yunxin_channel_username']}}
</div>
<div
class=
"layui-col-md3"
>
<span
title=
"{{$supplier['channel_username']}}"
>
...
...
resources/views/web/UpdateSupplier.blade.php
View file @
40f91cc1
...
...
@@ -59,7 +59,7 @@
@endif
</div>
<div
class=
"layui-col-md2"
>
SKU
采购员 : {{$supplier['yunxin_channel_username']}}
线上
采购员 : {{$supplier['yunxin_channel_username']}}
</div>
<div
class=
"layui-col-md3"
>
<span
title=
"{{$supplier['channel_username']}}"
>
...
...
resources/views/web/supplier/SupplierListFilter.blade.php
View file @
40f91cc1
...
...
@@ -241,7 +241,7 @@
<div
class=
"layui-row"
>
<div
class=
"layui-inline"
>
@inject('multiTransformableSelectPresenter','App\Presenters\Filter\MultiTransformableSelectPresenter')
{!! $multiTransformableSelectPresenter->render(['has_sku'=>'SKU上传','sku_tag'=>'SKU标准','sku_mode'=>'SKU模式','uploaded_sku' => '历史SKU合作','outside_contact_type' => 'SKU上传方式','yunxin_channel_uid' => '
SKU
采购员'],
{!! $multiTransformableSelectPresenter->render(['has_sku'=>'SKU上传','sku_tag'=>'SKU标准','sku_mode'=>'SKU模式','uploaded_sku' => '历史SKU合作','outside_contact_type' => 'SKU上传方式','yunxin_channel_uid' => '
线上
采购员'],
['has_sku'=>[1=>'是',-1=>'否'], 'sku_tag'=>config('field.SkuTag'),'sku_mode'=>config('field.SkuMode'),'uploaded_sku'=>[1=>'是',-1=>'否'],'outside_contact_type'=>config('field.OutsideContactType'),'yunxin_channel_uid' => $userCodes]) !!}
</div>
<div
class=
"layui-inline"
>
...
...
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