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
0dad2b95
authored
Mar 31, 2025
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
完成京东采购员需求
parent
1e6380d8
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
173 additions
and
68 deletions
.augmentignore
app/Http/Controllers/Api/SupplierApiController.php
app/Http/Controllers/Api/SupplierContactApiController.php
app/Http/Controllers/SupplierController.php
app/Http/Services/SupplierContactService.php
app/Http/Services/SupplierService.php
app/Http/Transformers/SupplierContactTransformer.php
app/Http/Transformers/SupplierTransformer.php
app/Model/SupplierContactModel.php
config/field.php
config/fixed.php
resources/views/script/SupplierListScript.blade.php
resources/views/script/supplier/SupplierContactScript.blade.php
resources/views/web/AddSupplierContact.blade.php
resources/views/web/AllocateChannelUser.blade.php
resources/views/web/UpdateSupplierContact.blade.php
storage/framework/views/5238497145456f693cc29f1fe0a7ff8fb43fd269.php
storage/framework/views/d4d13e9bcdea7366e4952031431aae4b22f055c1.php
.augmentignore
0 → 100644
View file @
0dad2b95
# Add directories or file patterns to ignore during indexing (e.g. foo/ or *.csv)
vendor/
app/Http/Controllers/Api/SupplierApiController.php
View file @
0dad2b95
...
...
@@ -10,6 +10,7 @@ use Illuminate\Http\Response;
use
App\Http\Services\CrmService
;
use
App\Http\Services\LogService
;
use
App\Model\SupplierChannelModel
;
use
App\Model\SupplierContactModel
;
use
App\Http\Controllers\Controller
;
use
Illuminate\Support\Facades\Auth
;
use
App\Http\Services\CompanyService
;
...
...
@@ -183,7 +184,6 @@ class SupplierApiController extends Controller
//待确认要透传到数据库里面去
if
(
$checkCompanyEntity
==
0
)
{
$channel
[
'is_entity'
]
=
0
;
}
if
(
$checkCompanyEntity
==
-
1
)
{
$this
->
response
(
-
1
,
'该供应商为实体名单,不允许建档'
);
...
...
@@ -450,57 +450,56 @@ class SupplierApiController extends Controller
}
//分配采购员(支持批量操作)
public
function
AllocateChannelUser
(
$request
)
public
function
Batch
AllocateChannelUser
(
$request
)
{
$channelUid
=
$request
->
get
(
'channel_uid'
);
$supplierId
=
$request
->
get
(
'supplier_id'
);
$channelUserType
=
$request
->
get
(
'channel_user_type'
);
$supplierIds
=
$request
->
get
(
'supplier_ids'
);
$supplierIds
=
explode
(
','
,
$supplierIds
);
if
(
empty
(
$channelUid
))
{
$this
->
response
(
-
1
,
'采购员不能为空'
);
}
if
(
empty
(
$channelUserType
))
{
$this
->
response
(
-
1
,
'采购员类型不能为空'
);
}
$channelUserTypeList
=
explode
(
','
,
$channelUserType
);
$adminService
=
new
AdminUserService
();
foreach
(
$supplierIds
as
$supplierId
)
{
foreach
(
$channelUserTypeList
as
$channelUserType
)
{
if
(
$channelUserType
==
SupplierContactModel
::
CHANNEL_USER_TYPE_LIEXIN
)
{
$check
=
$adminService
->
checkIsResignedByCodeId
(
$channelUid
);
if
(
$check
)
{
$this
->
response
(
-
1
,
'该采购员已经离职,请选择其他人员'
);
}
$model
=
new
SupplierChannelModel
();
$supplier
=
$model
->
where
(
'supplier_id'
,
$supplierId
)
->
first
();
$supplier
=
$supplier
?
$supplier
->
toArray
()
:
[];
$preChannelUid
=
$supplier
[
'channel_uid'
];
$preChannelUid
=
explode
(
','
,
$preChannelUid
);
//如果之前已经存在对应的采购,直接返回错误
if
(
in_array
(
$channelUid
,
$preChannelUid
))
{
$this
->
response
(
-
1
,
'此采购员已经存在,请重新选择'
);
//判断联系人里面是否存在对应类型的采购员
$contactModel
=
new
SupplierContactModel
();
$contact
=
$contactModel
->
where
(
'supplier_id'
,
$supplierId
)
->
where
(
'channel_user_type'
,
$channelUserType
)
->
where
(
'can_check_uids'
,
$channelUid
)
->
first
();
if
(
$contact
)
{
$this
->
response
(
-
1
,
'该供应商已经存在同名的猎芯采购员,请选择其他人员'
);
}
$service
=
new
SupplierService
();
$result
=
$service
->
allocateChannelUser
(
$supplierId
,
$channelUid
);
if
(
!
$result
)
{
$this
->
response
(
-
1
,
'添加采购员失败'
);
}
$this
->
response
(
0
,
'添加采购员成功'
);
}
//分配采购员(支持批量操作)
public
function
BatchAllocateChannelUser
(
$request
)
{
$channelUid
=
$request
->
get
(
'channel_uid'
);
$supplierIds
=
$request
->
get
(
'supplier_ids'
);
if
(
empty
(
$channelUid
))
{
$this
->
response
(
-
1
,
'采购员不能为空'
);
}
$adminService
=
new
AdminUserService
();
$result
=
$service
->
allocateChannelUser
(
$supplierId
,
$channelUid
,
$channelUserType
);
}
else
{
$check
=
$adminService
->
checkIsResignedByCodeId
(
$channelUid
);
if
(
$check
)
{
$this
->
response
(
-
1
,
'该采购员已经离职,请选择其他人员'
);
}
$supplierIds
=
explode
(
','
,
$supplierIds
);
foreach
(
$supplierIds
as
$supplierId
)
{
$contactModel
=
new
SupplierContactModel
();
$contact
=
$contactModel
->
where
(
'supplier_id'
,
$supplierId
)
->
where
(
'channel_user_type'
,
$channelUserType
)
->
where
(
'can_check_uids'
,
$channelUid
)
->
first
();
if
(
$contact
)
{
$this
->
response
(
-
1
,
'该供应商已经存在同名的京东采购员,请选择其他人员'
);
}
$service
=
new
SupplierService
();
$result
=
$service
->
allocateChannelUser
(
$supplierId
,
$channelUid
);
if
(
!
$result
)
{
$this
->
response
(
-
1
,
'添加采购员失败'
);
$result
=
$service
->
allocateChannelUser
(
$supplierId
,
$channelUid
,
$channelUserType
);
}
}
}
if
(
!
$result
)
{
$this
->
response
(
-
1
,
'添加采购员失败'
);
}
$this
->
response
(
0
,
'添加采购员成功'
);
}
...
...
app/Http/Controllers/Api/SupplierContactApiController.php
View file @
0dad2b95
...
...
@@ -39,12 +39,11 @@ class SupplierContactApiController extends Controller
//大家都可以查看离职的采购员的联系人
$allCanCheckUids
=
SupplierContactModel
::
where
(
'supplier_id'
,
$supplierId
)
->
pluck
(
'can_check_uids'
)
->
toArray
();
$resignedUsers
=
(
new
AdminUserService
())
->
getResignedUsers
();
// $resignedUserCodes = array_column($resignedUsers, 'code_id');
// $resignedUserCodes = array_column($resignedUsers, 'code_id');
$resignedUserCodes
=
[];
$resignedCanCheckUids
=
array_intersect
(
$allCanCheckUids
,
$resignedUserCodes
);
//不能查看所有的,就是说只能看绑定的采购的
if
(
$canViewAllSupplierContact
)
{
}
elseif
(
$canViewSubordinateSupplierContact
)
{
//查看下级
$departmentService
=
new
DepartmentService
();
...
...
@@ -92,6 +91,7 @@ class SupplierContactApiController extends Controller
'supplier_mobile'
,
'supplier_email'
,
'supplier_position'
,
'channel_user_type'
,
'can_check_uids'
]);
$data
=
BatchTrim
(
$data
);
...
...
@@ -103,7 +103,7 @@ class SupplierContactApiController extends Controller
$this
->
response
(
-
1
,
$validateResult
);
}
$service
=
new
SupplierContactService
();
$hasNeedReplaceContact
=
$service
->
getNeedReplaceContact
(
$data
[
'supplier_id'
],
$data
[
'can_check_uids'
]);
$hasNeedReplaceContact
=
$service
->
getNeedReplaceContact
(
$data
[
'supplier_id'
],
$data
[
'can_check_uids'
]
,
$data
[
'channel_user_type'
]
);
$result
=
$service
->
saveContact
(
$data
);
if
(
!
$result
)
{
$this
->
response
(
-
1
,
'操作失败'
);
...
...
@@ -111,7 +111,8 @@ class SupplierContactApiController extends Controller
//有需要自动替换补全数据操作后的提示
if
(
$hasNeedReplaceContact
)
{
$this
->
response
(
0
,
'系统检测到当前采购有默认的空联系人,直接更新对应数据'
);
$channelUserTypeName
=
array_get
(
config
(
'field.ChannelUserType'
),
$data
[
'channel_user_type'
]);
$this
->
response
(
0
,
'系统检测到当前采购('
.
$channelUserTypeName
.
')有默认的空联系人,直接更新对应数据'
);
}
else
{
$this
->
response
(
0
,
'保存成功'
);
}
...
...
@@ -130,8 +131,10 @@ class SupplierContactApiController extends Controller
//从主表里面删除对应的采购
//先去判断这个采购是不是唯一的
$canCheckUids
=
$contact
[
'can_check_uids'
];
$userNum
=
$model
->
where
(
'supplier_id'
,
$contact
[
'supplier_id'
])
->
where
(
'can_check_uids'
,
$canCheckUids
)
->
count
();
$userNum
=
$model
->
where
(
'supplier_id'
,
$contact
[
'supplier_id'
])
->
where
(
'can_check_uids'
,
$canCheckUids
)
->
count
();
if
(
$userNum
===
1
)
{
//如果只有一个,那就可以去主表删除对应的采购员了
$supplierModel
=
new
SupplierChannelModel
();
...
...
@@ -168,8 +171,10 @@ class SupplierContactApiController extends Controller
$type
=
$request
->
input
(
'type'
);
$contact
=
SupplierContactModel
::
select
([
$type
,
'supplier_consignee'
,
'contact_id'
,
'supplier_id'
])
->
where
(
'contact_id'
,
$contactId
)
->
first
()
->
toArray
();
$logService
=
new
LogService
();
$content
=
$request
->
user
->
name
.
' 查看了联系人 '
.
$contact
[
'supplier_consignee'
]
.
' 的'
.
array_get
(
config
(
'field.SupplierContactFieldMap'
),
$type
);
$content
=
$request
->
user
->
name
.
' 查看了联系人 '
.
$contact
[
'supplier_consignee'
]
.
' 的'
.
array_get
(
config
(
'field.SupplierContactFieldMap'
),
$type
);
$logService
->
AddLog
(
$contact
[
'supplier_id'
],
LogModel
::
VIEW_OPERATE
,
'查看供应商基本资料'
,
$content
);
$this
->
response
(
0
,
'ok'
,
$contact
);
}
...
...
@@ -206,7 +211,8 @@ class SupplierContactApiController extends Controller
DB
::
connection
(
'web'
)
->
transaction
(
function
()
use
(
$supplierId
,
$channelUid
,
$originCanCheckUids
,
$newCanCheckUids
)
{
//还要判断是否是芯链采购员
if
(
SupplierChannelModel
::
where
(
'yunxin_channel_uid'
,
$originCanCheckUids
)
->
where
(
'supplier_id'
,
$supplierId
)
->
exists
())
{
->
exists
()
)
{
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
update
([
'yunxin_channel_uid'
=>
$newCanCheckUids
]);
}
...
...
@@ -226,7 +232,6 @@ class SupplierContactApiController extends Controller
return
SupplierContactModel
::
where
(
'supplier_id'
,
$supplierId
)
->
where
(
'can_check_uids'
,
$originCanCheckUids
)
->
update
([
'can_check_uids'
=>
$newCanCheckUids
]);
});
});
$this
->
response
(
0
,
'转移供应商联系人成功'
);
...
...
app/Http/Controllers/SupplierController.php
View file @
0dad2b95
...
...
@@ -26,8 +26,7 @@ use function foo\func;
class
SupplierController
extends
Controller
{
public
function
info
(
Request
$request
,
$id
=
''
)
{
{
{
{
if
(
$request
->
path
()
==
'/'
)
{
$path
=
'web/index'
;
}
else
{
...
...
@@ -81,13 +80,16 @@ class SupplierController extends Controller
}
$this
->
data
[
'statusData'
]
=
$statusData
;
$stockupTypeData
=
[];
foreach
(
config
(
'fixed.StockupType'
)
as
$key
=>
$value
)
{
$stockupTypeList
=
config
(
'fixed.StockupType'
);
sort
(
$stockupTypeList
,
SORT_ASC
);
foreach
(
$stockupTypeList
as
$key
=>
$value
)
{
$stockupTypeData
[]
=
[
'name'
=>
$value
,
'value'
=>
$key
,
];
}
$this
->
data
[
'stockupTypeData'
]
=
$stockupTypeData
;
$levelData
=
[];
foreach
(
config
(
'field.LevelMap'
)
as
$key
=>
$value
)
{
$levelData
[]
=
[
...
...
@@ -173,7 +175,7 @@ class SupplierController extends Controller
//省市区数据放到script模板
$regionService
=
new
RegionService
();
$this
->
data
[
'region_data'
]
=
$regionService
->
getCityRegionData
();
$this
->
data
[
'nationList'
]
=
NationModel
::
pluck
(
'name_cn'
,
'nation_id'
)
->
toArray
();
$this
->
data
[
'nationList'
]
=
NationModel
::
pluck
(
'name_cn'
,
'nation_id'
)
->
toArray
();
$this
->
data
[
'brand_init_value'
]
=
[];
$this
->
data
[
'agency_brand_init_value'
]
=
[];
//编辑
...
...
@@ -181,8 +183,11 @@ class SupplierController extends Controller
$this
->
data
[
'title'
]
=
'编辑供应商'
;
$this
->
data
[
'supplierInfo'
]
=
$supplierService
->
getSupplier
(
$supplierId
);
$DB
=
DB
::
connection
(
'yunxin'
);
$supplierAccountInfo
=
$DB
->
table
(
'supplier_account'
)
->
where
(
"supplier_com_id"
,
"="
,
$supplierId
)
->
select
(
'mobile'
,
"password_raw"
)
->
first
();
$supplierAccountInfo
=
$DB
->
table
(
'supplier_account'
)
->
where
(
"supplier_com_id"
,
"="
,
$supplierId
)
->
select
(
'mobile'
,
"password_raw"
)
->
first
();
$this
->
data
[
'supplier_account_info'
]
=
$supplierAccountInfo
;
$this
->
data
[
'address'
]
=
$supplierService
->
getAddress
(
$supplierId
);
}
else
{
...
...
@@ -237,8 +242,10 @@ class SupplierController extends Controller
]);
$this
->
data
[
'supplier'
]
=
$supplier
;
$this
->
data
[
'address'
]
=
$supplierService
->
getAddress
(
$supplierId
);
$this
->
data
[
'ignore_supplier_type_change_tips'
]
=
in_array
(
$supplier
[
'supplier_name'
],
config
(
'field.SkipChangeSupplierTypeNames'
));
$this
->
data
[
'ignore_supplier_type_change_tips'
]
=
in_array
(
$supplier
[
'supplier_name'
],
config
(
'field.SkipChangeSupplierTypeNames'
)
);
$this
->
data
[
'sku_upload_log_count'
]
=
(
new
SkuUploadLogService
())
->
getSkuUploadLogCount
(
$supplierId
);
$this
->
data
[
'brand_init_value'
]
=
(
new
StandardBrandService
())
->
getBrandInitValue
(
$supplier
[
'main_brands'
]);
$this
->
data
[
'exclude_brand_init_value'
]
=
(
new
StandardBrandService
())
->
getBrandInitValue
(
$supplier
[
'main_brands'
]);
...
...
@@ -317,6 +324,14 @@ class SupplierController extends Controller
$this
->
data
[
'suppliers'
]
=
$suppliers
;
$intraCodeModel
=
new
IntracodeModel
();
$this
->
data
[
'userCodes'
]
=
$intraCodeModel
->
getChannelUsersEncode
(
false
);
$channelUserTypeForXmSelect
=
[];
foreach
(
config
(
'field.ChannelUserType'
)
as
$key
=>
$value
)
{
$channelUserTypeForXmSelect
[]
=
[
'value'
=>
$key
,
'name'
=>
$value
,
];
}
$this
->
data
[
'channelUserTypeForXmSelect'
]
=
$channelUserTypeForXmSelect
;
return
$this
->
view
(
'添加采购员'
);
}
...
...
@@ -435,5 +450,4 @@ class SupplierController extends Controller
$this
->
data
[
'userCodes'
]
=
(
new
IntracodeModel
())
->
getSampleEncode
();
return
$this
->
view
(
'供应商交接'
);
}
}
app/Http/Services/SupplierContactService.php
View file @
0dad2b95
...
...
@@ -49,7 +49,7 @@ class SupplierContactService
$supplierId
=
$contact
[
'supplier_id'
];
$supplierModel
=
new
SupplierChannelModel
();
//去判断该供应商是否已经有相同的can_check_uids并且是空联系人
$needReplaceContact
=
$this
->
getNeedReplaceContact
(
$supplierId
,
$contact
[
'can_check_uids'
]);
$needReplaceContact
=
$this
->
getNeedReplaceContact
(
$supplierId
,
$contact
[
'can_check_uids'
]
,
$contact
[
'channel_user_type'
]
);
if
(
!
empty
(
$contact
[
'contact_id'
]))
{
$contact
[
'update_time'
]
=
time
();
$contactId
=
$contact
[
'contact_id'
];
...
...
@@ -103,7 +103,7 @@ class SupplierContactService
//判断是否需要替换掉空的联系方式而不是新增,因为新增的时候,可能添加的采购已经在数据库有了(之前从金蝶导过来的)
//有的话,就把这次新增的联系方式更新到这个采购里面去
public
function
getNeedReplaceContact
(
$supplierId
,
$canCheckUids
)
public
function
getNeedReplaceContact
(
$supplierId
,
$canCheckUids
,
$channelUserType
)
{
$contactModel
=
new
SupplierContactModel
();
$contact
=
$contactModel
->
where
(
'supplier_id'
,
$supplierId
)
->
where
(
'can_check_uids'
,
$canCheckUids
)
...
...
@@ -111,7 +111,9 @@ class SupplierContactService
->
where
(
'supplier_position'
,
''
)
->
where
(
'supplier_email'
,
''
)
->
where
(
'supplier_mobile'
,
''
)
->
where
(
'supplier_telephone'
,
''
)
->
first
();
->
where
(
'supplier_telephone'
,
''
)
->
where
(
'channel_user_type'
,
$channelUserType
)
->
first
();
return
!
empty
(
$contact
)
?
$contact
->
toArray
()
:
[];
}
...
...
app/Http/Services/SupplierService.php
View file @
0dad2b95
...
...
@@ -629,19 +629,18 @@ class SupplierService
}
//分配采购员
public
function
allocateChannelUser
(
$supplierId
,
$channelUid
,
$needLog
=
true
)
public
function
allocateChannelUser
(
$supplierId
,
$channelUid
,
$
channelUserType
,
$
needLog
=
true
)
{
$supplier
=
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
first
();
if
(
empty
(
$supplier
))
{
return
true
;
}
$supplier
=
$supplier
->
toArray
();
$preChannelUid
=
explode
(
','
,
$supplier
[
'channel_uid'
]);
//如果之前已经存在对应的采购,直接返回
if
(
in_array
(
$channelUid
,
$preChannelUid
))
{
$exists
=
SupplierContactModel
::
where
(
'supplier_id'
,
$supplierId
)
->
where
(
'channel_user_type'
,
$channelUserType
)
->
where
(
'can_check_uids'
,
$channelUid
)
->
exists
();
if
(
$exists
)
{
return
true
;
}
$result
=
DB
::
connection
(
'web'
)
->
transaction
(
function
()
use
(
$supplierId
,
$channelUid
,
$needLog
)
{
$result
=
DB
::
connection
(
'web'
)
->
transaction
(
function
()
use
(
$supplierId
,
$channelUid
,
$needLog
,
$channelUserType
)
{
$supplier
=
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
first
();
$supplier
=
$supplier
?
$supplier
->
toArray
()
:
[];
$preChannelUid
=
$supplier
[
'channel_uid'
];
...
...
@@ -659,16 +658,18 @@ class SupplierService
}
else
{
$result
=
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
update
([
'channel_uid'
=>
$preChannelUid
,
'update_time'
=>
time
(),
]);
}
$contactResult
=
false
;
if
(
$result
)
{
if
(
$result
!==
false
)
{
$contactModel
=
new
SupplierContactModel
();
$contact
=
[
'supplier_id'
=>
$supplierId
,
'can_check_uids'
=>
$channelUid
,
'channel_user_type'
=>
$channelUserType
,
'add_time'
=>
time
(),
'admin_id'
=>
!
empty
(
request
()
->
user
->
userId
)
?
request
()
->
user
->
userId
:
1000
,
];
...
...
@@ -682,7 +683,8 @@ class SupplierService
$channelUser
=
$adminUserService
->
getAdminUserInfoByCodeId
(
$channelUid
);
$channelUserName
=
array_get
(
$channelUser
,
'name'
,
' '
);
$logService
=
new
LogService
();
$content
=
"添加采购员 : "
.
$channelUserName
;
$channelUserTypeName
=
array_get
(
config
(
'field.ChannelUserType'
),
$channelUserType
,
'未知类型'
);
$content
=
"添加
{
$channelUserTypeName
}
采购员 : "
.
$channelUserName
;
$logService
->
AddIgnoreAuditCheckLog
(
$supplierId
,
LogModel
::
UPDATE_OPERATE
,
'添加采购员'
,
$content
);
}
return
$contactResult
;
...
...
app/Http/Transformers/SupplierContactTransformer.php
View file @
0dad2b95
...
...
@@ -46,6 +46,7 @@ class SupplierContactTransformer
}
}
$item
[
'channel_user_type_name'
]
=
array_get
(
config
(
'field.ChannelUserType'
),
$item
[
'channel_user_type'
]);
}
unset
(
$item
);
...
...
app/Http/Transformers/SupplierTransformer.php
View file @
0dad2b95
...
...
@@ -35,10 +35,25 @@ class SupplierTransformer
$lastUploadSkuTimes
=
SkuService
::
getUploadTimeBySupplierCodes
(
array_column
(
$list
,
'supplier_code'
),
'last'
);
//创建人部门map
$createUserDepartmentNameMap
=
(
new
DepartmentService
())
->
getDepartmentNameMapByUserIds
(
array_column
(
$list
,
'create_uid'
));
$createUserDepartmentNameMap
=
(
new
DepartmentService
())
->
getDepartmentNameMapByUserIds
(
array_column
(
$list
,
'create_uid'
));
//获取所有供应商id
$supplierIds
=
array_column
(
$list
,
'supplier_id'
);
//然后获取所有采购员类型为2的联系人
$contactModel
=
new
SupplierContactModel
();
$contacts
=
$contactModel
->
select
([
'supplier_id'
,
'can_check_uids'
])
->
whereIn
(
'supplier_id'
,
$supplierIds
)
->
where
(
'channel_user_type'
,
2
)
->
get
()
->
groupBy
(
'supplier_id'
);
$contacts
=
$contacts
->
toArray
();
foreach
(
$contacts
as
$key
=>
$value
)
{
$contacts
[
$key
]
=
array_map
(
function
(
$item
)
use
(
$users
)
{
$item
[
'name'
]
=
array_get
(
$users
,
$item
[
'can_check_uids'
]);
return
$item
;
},
$value
);
}
foreach
(
$list
as
&
$supplier
)
{
$supplier
[
'viewed'
]
=
array_get
(
$viewData
,
$supplier
[
'supplier_id'
],
false
);
$supplier
[
'jd_channel_user'
]
=
trim
(
implode
(
','
,
array_column
(
array_get
(
$contacts
,
$supplier
[
'supplier_id'
],
[]),
'name'
)),
','
);
$supplier
[
'jd_channel_user_id'
]
=
trim
(
implode
(
','
,
array_column
(
array_get
(
$contacts
,
$supplier
[
'supplier_id'
],
[]),
'can_check_uids'
)),
','
);
$supplier
=
$this
->
getStockupType
(
$supplier
);
$supplier
[
'supplier_group'
]
=
array_get
(
config
(
'fixed.SupplierGroup'
),
$supplier
[
'supplier_group'
],
'未设置'
);
$supplier
[
'purchase_type_name'
]
=
array_get
(
config
(
'field.PurchaseType'
),
$supplier
[
'purchase_type'
],
'无'
);
...
...
@@ -103,23 +118,35 @@ class SupplierTransformer
$onJobUserNameList
=
array_values
(
$onJobChannelUsers
);
$channelUserNameList
=
!
empty
(
$supplier
[
'channel_username'
])
?
explode
(
','
,
$supplier
[
'channel_username'
])
:
[];
$jdChannelUserNameList
=
!
empty
(
$supplier
[
'jd_channel_user'
])
?
explode
(
','
,
$supplier
[
'jd_channel_user'
])
:
[];
if
(
empty
(
$supplier
[
'channel_uid'
]))
{
$supplier
[
'resign_channel_username'
]
=
$supplier
[
'on_job_channel_username'
]
=
''
;
continue
;
}
$resignChannelUserNameList
=
$onJobChannelUserNameList
=
[];
$jdResignChannelUserNameList
=
$jdOnJobChannelUserNameList
=
[];
if
(
!
empty
(
$supplier
[
'jd_channel_user_id'
]))
{
//然后判断哪些是离职,哪些是在职的
foreach
(
$c
hannelUserNameList
as
$username
)
{
foreach
(
$jdC
hannelUserNameList
as
$username
)
{
if
(
!
in_array
(
$username
,
$onJobUserNameList
))
{
$resignChannelUserNameList
[]
=
$username
;
}
else
{
$onJobChannelUserNameList
[]
=
$username
;
}
}
}
$supplier
[
'resign_channel_username'
]
=
$resignChannelUserNameList
?
implode
(
','
,
$resignChannelUserNameList
)
:
''
;
$supplier
[
'on_job_channel_username'
]
=
$onJobChannelUserNameList
?
implode
(
','
,
$onJobChannelUserNameList
)
:
''
;
$supplier
[
'jd_resign_channel_username'
]
=
$jdResignChannelUserNameList
?
implode
(
','
,
$resignChannelUserNameList
)
:
''
;
$supplier
[
'jd_on_job_channel_username'
]
=
$jdOnJobChannelUserNameList
?
implode
(
','
,
$onJobChannelUserNameList
)
:
''
;
}
unset
(
$supplier
);
return
$suppliers
;
...
...
app/Model/SupplierContactModel.php
View file @
0dad2b95
...
...
@@ -11,6 +11,9 @@ class SupplierContactModel extends Model
protected
$table
=
'supplier_contact'
;
public
$timestamps
=
false
;
const
CHANNEL_USER_TYPE_LIEXIN
=
1
;
const
CHANNEL_USER_TYPE_JD
=
2
;
public
function
AddInfo
(
$SupplierID
=
''
,
$data
=
''
)
{
if
(
empty
(
$SupplierID
)
||
empty
(
$data
)
||
!
is_array
(
$data
))
{
...
...
config/field.php
View file @
0dad2b95
...
...
@@ -355,5 +355,10 @@ return [
2
=>
'高'
,
1
=>
'中'
,
0
=>
'低'
,
]
],
'ChannelUserType'
=>
[
1
=>
'猎芯采购'
,
2
=>
'京东采购'
,
],
];
config/fixed.php
View file @
0dad2b95
...
...
@@ -87,6 +87,7 @@ return [
2
=>
'猎芯仓库'
,
4
=>
'现货寄售'
,
5
=>
'芯链商家'
,
6
=>
'京东商家'
,
],
'SupplierPayType'
=>
[
...
...
resources/views/script/SupplierListScript.blade.php
View file @
0dad2b95
...
...
@@ -233,6 +233,19 @@
{
field
:
'purchase_username'
,
title
:
'渠道开发员'
,
align
:
'center'
,
width
:
110
},
{
field
:
'yunxin_channel_username'
,
title
:
'线上采购员'
,
align
:
'center'
,
width
:
110
},
{
field
:
'jd_channel_username'
,
title
:
'京东采购员'
,
align
:
'center'
,
width
:
130
,
templet
:
function
(
data
)
{
if
(
data
.
jd_resign_channel_username
)
{
if
(
data
.
jd_on_job_channel_username
)
{
return
`<span>
${
data
.
jd_on_job_channel_username
}
</span>`
+
`,<span style="color: #D7D7D7">
${
data
.
jd_resign_channel_username
}
</span>`
;
}
else
{
return
`<span style="color: #D7D7D7">
${
data
.
jd_resign_channel_username
}
</span>`
}
}
else
{
return
`<span>
${
data
.
on_job_channel_username
}
</span>`
;
}
}
},
{
field
:
'has_sku'
,
title
:
'SKU上传'
,
align
:
'center'
,
width
:
80
},
{
field
:
'uploaded_sku'
,
title
:
'SKU合作'
,
align
:
'center'
,
width
:
80
,
templet
:
function
(
data
)
{
...
...
resources/views/script/supplier/SupplierContactScript.blade.php
View file @
0dad2b95
...
...
@@ -61,7 +61,7 @@
},
{field: '
supplier_fax
', title: '
传真
', align: '
center
', width: 140},
{field: '
channel_name
', title: '
<
span
class
=
"require"
>*
<
/span>采购员', align: 'center', width: 110}
,
{
field
:
'working_status'
,
title
:
'采购员状态'
,
align
:
'center'
,
width
:
120
},
{
field
:
'
channel_user_type_name'
,
title
:
'
<
span
class
=
"require"
>*
<
/span>采购员类型', align: 'center', width: 110}, {field: '
working_status', title: '采购员状态', align: 'center', width: 120}
,
]],
id
:
'contactList'
,
page
:
{},
...
...
@@ -73,7 +73,7 @@
layer
.
open
({
type
:
2
,
content
:
'/supplier_contact/AddSupplierContact?view=iframe&supplier_id='
+
supplierId
,
area
:
[
'600px'
,
'
5
25px'
],
area
:
[
'600px'
,
'
6
25px'
],
title
:
'新增联系人'
,
end
:
function
()
{
// 监听弹窗关闭
// location.href = '/supplier/UpdateSupplier?view=iframe&tab=contact&supplier_id='+supplierId;
...
...
resources/views/web/AddSupplierContact.blade.php
View file @
0dad2b95
...
...
@@ -68,6 +68,11 @@
$userCodes,['required'=>true]) !!}
</div>
<div
class=
"layui-form-item"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('channel_user_type','采购员类型','',
config('field.ChannelUserType'),['required'=>true]) !!}
</div>
<div
class=
"layui-form-item"
>
<div
align=
"center"
style=
"margin-top: 20px"
>
<button
type=
"button"
class=
"layui-btn layui-btn-info submit-loading"
lay-submit
lay-filter=
"load"
>
确认
</button>
</div>
...
...
resources/views/web/AllocateChannelUser.blade.php
View file @
0dad2b95
...
...
@@ -4,7 +4,7 @@
}
</style>
<div
class=
"layui-card"
>
<div
class=
"layui-card-header"
style=
"height:
1
70px"
>
<div
class=
"layui-card-header"
style=
"height:
2
70px"
>
<blockquote
class=
"layui-elem-quote layui-text"
>
<b>
采购员设置
</b>
</blockquote>
...
...
@@ -18,6 +18,13 @@
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
style=
"margin-left: -30px"
>
@inject('multiSelectPresenter','App\Presenters\MultiSelectorPresenter')
{!! $multiSelectPresenter->render('channel_user_type','采购员类型',1,
$channelUserTypeForXmSelect,['required'=>true,'width'=>'150px']) !!}
</div>
</div>
<div
class=
"layui-form-item"
>
<div
align=
"center"
style=
"margin-top: 10px;text-align: right"
>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn-info submit-loading"
lay-submit
lay-filter=
"auditSupplier"
>
确认
...
...
resources/views/web/UpdateSupplierContact.blade.php
View file @
0dad2b95
...
...
@@ -70,6 +70,11 @@
$userCodes,['required'=>true]) !!}
</div>
<div
class=
"layui-form-item"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('channel_user_type','采购员类型',$contact['channel_user_type'],
config('field.ChannelUserType'),['required'=>true]) !!}
</div>
<div
class=
"layui-form-item"
>
<div
align=
"center"
style=
"margin-top: 20px"
>
<button
type=
"button"
class=
"layui-btn layui-btn-info submit-loading"
lay-submit
lay-filter=
"load"
>
确认
</button>
</div>
...
...
storage/framework/views/5238497145456f693cc29f1fe0a7ff8fb43fd269.php
View file @
0dad2b95
...
...
@@ -35,11 +35,12 @@
<?php
/* 拉黑*/
?>
<?php
/* </button>*/
?>
<?php
endif
;
?>
<?php
if
(
request
()
->
user
->
userId
==
1000
||
request
()
->
user
->
userId
==
2082
)
:
?>
<button
type=
"button"
class=
"layui-btn layui-btn-sm"
title=
"该操作可以将供应商同步到供应商"
id=
"sync_supplier_to_erp"
>
金蝶同步
</button>
<?php
if
(
request
()
->
user
->
userId
==
1000
||
request
()
->
user
->
userId
==
2082
)
:
?>
<button
type=
"button"
class=
"layui-btn layui-btn-sm"
title=
"该操作可以将供应商同步到一体化"
id=
"sync_supplier_to_united"
>
一体化同步
...
...
storage/framework/views/d4d13e9bcdea7366e4952031431aae4b22f055c1.php
View file @
0dad2b95
...
...
@@ -233,6 +233,19 @@
{
field
:
'purchase_username'
,
title
:
'渠道开发员'
,
align
:
'center'
,
width
:
110
},
{
field
:
'yunxin_channel_username'
,
title
:
'线上采购员'
,
align
:
'center'
,
width
:
110
},
{
field
:
'jd_channel_username'
,
title
:
'京东采购员'
,
align
:
'center'
,
width
:
130
,
templet
:
function
(
data
)
{
if
(
data
.
jd_resign_channel_username
)
{
if
(
data
.
jd_on_job_channel_username
)
{
return
`<span>
${
data
.
jd_on_job_channel_username
}
</span>`
+
`,<span style="color: #D7D7D7">
${
data
.
jd_resign_channel_username
}
</span>`
;
}
else
{
return
`<span style="color: #D7D7D7">
${
data
.
jd_resign_channel_username
}
</span>`
}
}
else
{
return
`<span>
${
data
.
on_job_channel_username
}
</span>`
;
}
}
},
{
field
:
'has_sku'
,
title
:
'SKU上传'
,
align
:
'center'
,
width
:
80
},
{
field
:
'uploaded_sku'
,
title
:
'SKU合作'
,
align
:
'center'
,
width
:
80
,
templet
:
function
(
data
)
{
...
...
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