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
3463e1c6
authored
Jul 23, 2025
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'ysx-供应商需求-20250717' into ysx-供应商需求-20250723
parents
e8b06c67
1f582cde
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
765 additions
and
274 deletions
.env
app/Http/Controllers/Api/SkuApiController.php
app/Http/Controllers/Api/SupplierApiController.php
app/Http/Controllers/Filter/SupplierFilter.php
app/Http/Controllers/SkuController.php
app/Http/Controllers/SupplierController.php
app/Http/Controllers/Sync/SupplierSyncController.php
app/Http/Services/SupplierService.php
app/Http/Services/SupplierTagService.php
app/Http/Services/SyncSupplierService.php
app/Http/Transformers/SupplierTransformer.php
app/Http/Validators/SupplierValidator.php
app/Presenters/MultiSelectorPresenter.php
config/field.php
config/validate.php
resources/views/script/BatchAddSkuTagScript.blade.php
resources/views/script/BatchAllocateYunxinChannelUserScript.blade.php
resources/views/script/SkuListScript.blade.php
resources/views/web/BatchAddSkuTag.blade.php
resources/views/web/BatchAllocateYunxinChannelUser.blade.php
resources/views/web/SupplierDetail.blade.php
resources/views/web/supplier/SkuRuler.blade.php
.env
View file @
3463e1c6
...
...
@@ -160,7 +160,7 @@ MENU_ID=16
MENU_URL=http://data.liexin.net/api/config/
FOOTSTONE_URL=http://footstone.liexindev.net
#标签系统的地址
TAG_URL=http://tag.liexinlocal.com
TAG_URL=http://tag.liexinlocal.com
:32581
SKIP_SEND_EMAIL=true
...
...
app/Http/Controllers/Api/SkuApiController.php
View file @
3463e1c6
...
...
@@ -2,12 +2,13 @@
namespace
App\Http\Controllers\Api
;
use
App\Http\Controllers\Controller
;
use
App\Http\Services\SkuService
;
use
Illuminate\Http\Request
;
use
App\Model\SkuUploadLogModel
;
use
App\Http\Services\SkuService
;
use
App\Model\SupplierChannelModel
;
use
Illuminate\Http\Request
;
use
App\Http\Controllers\Controller
;
use
function
GuzzleHttp
\Promise\all
;
use
App\Http\Services\SupplierTagService
;
//通用API,比如获取品牌列表,分类列表等
class
SkuApiController
extends
Controller
...
...
@@ -173,19 +174,39 @@ class SkuApiController extends Controller
//批量新增标签
public
function
BatchAddSkuTag
(
$request
)
{
$type
=
$request
->
input
(
'type'
);
$supplierCode
=
$request
->
input
(
'supplier_code'
);
$skuIds
=
$request
->
get
(
'sku_ids'
);
$skuTags
=
$request
->
get
(
'sku_tags'
);
if
(
$type
==
1
&&
empty
(
$skuIds
))
{
$this
->
response
(
-
1
,
'按型号设置标签,必须先选择型号'
);
$currentTab
=
$request
->
input
(
'current_tab'
);
switch
(
$currentTab
)
{
case
'tag_setting'
:
$type
=
$request
->
input
(
'type'
);
$supplierCode
=
$request
->
input
(
'supplier_code'
);
$skuIds
=
$request
->
get
(
'sku_ids'
);
$skuTags
=
$request
->
get
(
'sku_tags'
);
if
(
$type
==
1
&&
empty
(
$skuIds
))
{
$this
->
response
(
-
1
,
'按型号设置标签,必须先选择型号'
);
}
if
(
$type
==
2
&&
empty
(
$supplierCode
))
{
$this
->
response
(
-
1
,
'按供应商设置标签,必须先选择供应商'
);
}
(
new
SkuService
())
->
batchAddSkuTags
(
$type
,
$supplierCode
,
$skuIds
,
$skuTags
);
$text
=
$type
==
1
?
'设置标签成功'
:
'批量设置供应商SKU标签任务已开始,请等待任务完成'
;
break
;
case
'goods_label'
:
$goodsLabel
=
$request
->
get
(
'goods_label'
);
$goodsLabelSystemTags
=
$request
->
get
(
'goods_label_system_tags'
);
(
new
SupplierTagService
())
->
batchSaveGoodsLabelTags
(
$goodsLabel
,
$goodsLabelSystemTags
);
$text
=
'设置显示类型标签成功'
;
break
;
case
'goods_source'
:
$goodsSource
=
$request
->
get
(
'goods_source'
);
$goodsSourceSystemTags
=
$request
->
get
(
'goods_source_system_tags'
);
(
new
SupplierTagService
())
->
batchSaveGoodsSourceTags
(
$goodsSource
,
$goodsSourceSystemTags
);
$text
=
'设置接入方式标签成功'
;
break
;
default
:
$this
->
response
(
-
1
,
'请选择操作类型'
);
}
if
(
$type
==
2
&&
empty
(
$supplierCode
))
{
$this
->
response
(
-
1
,
'按供应商设置标签,必须先选择供应商'
);
}
(
new
SkuService
())
->
batchAddSkuTags
(
$type
,
$supplierCode
,
$skuIds
,
$skuTags
);
$text
=
$type
==
1
?
'设置标签成功'
:
'批量设置供应商SKU标签任务已开始,请等待任务完成'
;
$this
->
response
(
0
,
$text
);
}
...
...
app/Http/Controllers/Api/SupplierApiController.php
View file @
3463e1c6
...
...
@@ -101,6 +101,8 @@ class SupplierApiController extends Controller
'agency_brands'
,
'purchase_type'
,
'sign_com_id'
,
'sku_optional_batch'
,
];
public
function
Entrance
(
Request
$request
,
$id
)
...
...
@@ -257,7 +259,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 +272,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 +812,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/Controllers/Filter/SupplierFilter.php
View file @
3463e1c6
...
...
@@ -197,17 +197,18 @@ class SupplierFilter
//搜索创建部门的数据
if
(
!
empty
(
$map
[
'create_user_department'
]))
{
$map
[
'create_user_department'
]
=
explode
(
','
,
$map
[
'create_user_department'
]);
$parentDepartmentIds
=
DepartmentModel
::
whereIn
(
'department_id'
,
$map
[
'create_user_department'
])
$parentDepartmentIds
=
DepartmentModel
::
whereIn
(
'department_id'
,
$map
[
'create_user_department'
])
->
pluck
(
'parent_id'
)
->
toArray
();
$parentDepartmentIds
=
array_unique
(
$parentDepartmentIds
);
$departmentIds
=
array_merge
(
$parentDepartmentIds
,
$map
[
'create_user_department'
]);
//先去找出所有的创建人uid
$userIds
=
UserInfoModel
::
whereIn
(
'department_id'
,
$departmentIds
)
->
pluck
(
'userId'
)
->
toArray
();
$query
->
whereIn
(
'create_uid'
,
$userIds
);
$userIds
=
UserInfoModel
::
whereIn
(
'department_id'
,
$departmentIds
)
->
pluck
(
'userId'
)
->
toArray
();
$query
->
whereIn
(
'create_uid'
,
$userIds
);
}
//默认过滤带有-1字符串的供应商名称的数据
$query
->
whereRaw
(
'supplier_name NOT LIKE "%-1"'
);
return
$query
;
}
...
...
@@ -218,59 +219,61 @@ class SupplierFilter
$canViewAllSupplier
=
checkPerm
(
'ViewAllSupplier'
);
$canViewSubordinateSupplier
=
checkPerm
(
'ViewSubordinateSupplier'
);
$canViewFakeSupplier
=
checkPerm
(
'ViewFakeSupplier'
);
//现在普通采购也能看到竞调供应商了(与他有关的)
if
(
!
$canViewFakeSupplier
)
{
$query
->
where
(
'is_type'
,
0
);
}
$query
->
with
([
'contact'
,
'attachment'
]);
$query
->
whereRaw
(
'supplier_name NOT LIKE "%-1"'
);
$canViewBlockSupplier
=
checkPerm
(
'ViewBlockSupplier'
);
$canViewDisableSupplier
=
checkPerm
(
'ViewDisableSupplier'
);
// 构建复合查询条件:基础条件 OR 特殊状态
$query
->
where
(
function
(
$mainQuery
)
use
(
$canViewFakeSupplier
,
$canViewBlockSupplier
,
$canViewDisableSupplier
,
$userId
,
$codeId
,
$canViewAllSupplier
,
$canViewSubordinateSupplier
)
{
// 主要条件组:基础业务条件
$mainQuery
->
where
(
function
(
$baseQuery
)
use
(
$canViewFakeSupplier
,
$userId
,
$codeId
,
$canViewAllSupplier
,
$canViewSubordinateSupplier
)
{
// 基础类型限制
if
(
!
$canViewFakeSupplier
)
{
$baseQuery
->
where
(
'is_type'
,
0
);
}
//默认展示的数据查询
//看全部的权限,优先级最高
if
(
$canViewAllSupplier
)
{
//能查看所有的话,限制基本没有
}
else
{
//如果能看部下的,那需要判断的地方就多了不少
if
(
$canViewSubordinateSupplier
)
{
$departmentService
=
new
DepartmentService
();
//下属用户id(结果包括自己的id)
$subordinateUserIds
=
$departmentService
->
getSubordinateUserIds
(
$userId
);
$adminUserService
=
new
AdminUserService
();
$subordinateCodeIds
=
$adminUserService
->
getCodeIdsByUserIds
(
$subordinateUserIds
);
$subordinateCodeIds
=
$subordinateCodeIds
->
toArray
();
//因为可以查看自己部下相关的采购员,开发员的供应商,所以要构建复杂likeIn语句需要的数据
//注意下面三个条件最外层要用()包围起来,要不然mysql数据会有问题,具体自己查询mysql的and和or的语法注意事项
$likeSqlRaw
=
implode
(
'|'
,
$subordinateCodeIds
);
$inCodeIdSql
=
implode
(
','
,
$subordinateCodeIds
);
$inUserIdSql
=
implode
(
','
,
$subordinateUserIds
);
$inCodeIdSql
=
"("
.
$inCodeIdSql
.
")"
;
$inUserIdSql
=
"("
.
$inUserIdSql
.
")"
;
if
(
$subordinateCodeIds
)
{
if
(
$canViewFakeSupplier
)
{
$query
->
whereRaw
(
DB
::
raw
(
"(create_uid in
$inUserIdSql
or purchase_uid in
$inCodeIdSql
or channel_uid REGEXP '
$likeSqlRaw
' or is_type = 1) "
));
}
else
{
$query
->
whereRaw
(
DB
::
raw
(
"(create_uid in
$inUserIdSql
or purchase_uid in
$inCodeIdSql
or channel_uid REGEXP '
$likeSqlRaw
') "
));
}
}
else
{
if
(
$canViewFakeSupplier
)
{
$query
->
whereRaw
(
DB
::
raw
(
"(create_uid in
$inUserIdSql
or is_type = 1)"
));
// 权限相关的条件
if
(
!
$canViewAllSupplier
)
{
if
(
$canViewSubordinateSupplier
)
{
$departmentService
=
new
DepartmentService
();
$subordinateUserIds
=
$departmentService
->
getSubordinateUserIds
(
$userId
);
$adminUserService
=
new
AdminUserService
();
$subordinateCodeIds
=
$adminUserService
->
getCodeIdsByUserIds
(
$subordinateUserIds
);
$subordinateCodeIds
=
$subordinateCodeIds
->
toArray
();
$likeSqlRaw
=
implode
(
'|'
,
$subordinateCodeIds
);
$inCodeIdSql
=
implode
(
','
,
$subordinateCodeIds
);
$inUserIdSql
=
implode
(
','
,
$subordinateUserIds
);
$inCodeIdSql
=
"("
.
$inCodeIdSql
.
")"
;
$inUserIdSql
=
"("
.
$inUserIdSql
.
")"
;
if
(
$subordinateCodeIds
)
{
$baseQuery
->
whereRaw
(
"(create_uid in
$inUserIdSql
or purchase_uid in
$inCodeIdSql
or channel_uid REGEXP '
$likeSqlRaw
')"
);
}
else
{
$baseQuery
->
whereRaw
(
"(create_uid in
$inUserIdSql
)"
);
}
}
else
{
$query
->
whereRaw
(
DB
::
raw
(
"(create_uid in
$inUserIdSql
)"
));
// 只能看自己的
$baseQuery
->
where
(
function
(
$selfQuery
)
use
(
$userId
,
$codeId
)
{
$selfQuery
->
where
(
'create_uid'
,
$userId
)
->
orWhere
(
'purchase_uid'
,
$codeId
)
->
orWhere
(
'channel_uid'
,
'like'
,
'%'
.
$codeId
.
'%'
);
});
}
}
});
}
else
{
if
(
$codeId
)
{
//剩下的就只是看自己相关的
$query
->
whereRaw
(
DB
::
raw
(
"(create_uid =
$userId
or purchase_uid =
$codeId
or channel_uid like '%${codeId}%') "
));
}
else
{
$query
->
whereRaw
(
DB
::
raw
(
"(create_uid =
$userId
)"
));
}
// 额外显示的特殊状态(如果有权限)
if
(
$canViewBlockSupplier
)
{
$mainQuery
->
orWhere
(
'status'
,
SupplierChannelModel
::
STATUS_BLOCK
);
}
}
if
(
$canViewDisableSupplier
)
{
$mainQuery
->
orWhere
(
'status'
,
SupplierChannelModel
::
STATUS_DISABLE
);
}
});
$query
->
with
([
'contact'
,
'attachment'
]);
$query
->
whereRaw
(
'supplier_name NOT LIKE "%-1"'
);
// 权限逻辑已经移到上面的复合查询条件中
//先判断获取类型
switch
(
$sourceType
)
{
case
"all"
:
...
...
@@ -349,17 +352,21 @@ class SupplierFilter
});
break
;
//附件里面缺少品质协议的,而且是现货类型供应商
// case "no_quality_assurance_agreement":
// $query->whereDoesntHave('attachment', function ($query) {
// $query->whereNotIn('status',
// [SupplierChannelModel::STATUS_DISABLE, SupplierChannelModel::STATUS_BLOCK])
// ->where('field_name', 'quality_assurance_agreement');
// })->where('supplier_group', 2);
// break;
// case "no_quality_assurance_agreement":
// $query->whereDoesntHave('attachment', function ($query) {
// $query->whereNotIn('status',
// [SupplierChannelModel::STATUS_DISABLE, SupplierChannelModel::STATUS_BLOCK])
// ->where('field_name', 'quality_assurance_agreement');
// })->where('supplier_group', 2);
// break;
//联系人待完善
case
"contact_no_complete"
:
$query
->
rightjoin
(
'supplier_contact'
,
'supplier_channel.supplier_id'
,
'='
,
'supplier_contact.supplier_id'
)
$query
->
rightjoin
(
'supplier_contact'
,
'supplier_channel.supplier_id'
,
'='
,
'supplier_contact.supplier_id'
)
->
selectRaw
(
'lie_supplier_channel.*'
)
->
where
(
function
(
$q
)
{
$q
->
where
(
'supplier_consignee'
,
''
)
...
...
app/Http/Controllers/SkuController.php
View file @
3463e1c6
...
...
@@ -11,6 +11,7 @@ use Illuminate\Http\Request;
use
App\Model\IntracodeModel
;
use
App\Model\SupplierLogModel
;
use
App\Http\Services\LogService
;
use
App\Http\Services\SkuService
;
use
App\Model\SupplierChannelModel
;
use
App\Http\Services\SupplierService
;
use
App\Http\Services\DepartmentService
;
...
...
@@ -110,7 +111,7 @@ class SkuController extends Controller
//批量打标签
public
function
BatchAddSkuTag
(
$request
)
{
$systemTags
=
(
new
SkuService
())
->
getSystemTags
();
$this
->
data
[
'title'
]
=
'批量修改Sku标签'
;
$suppliers
=
SupplierChannelModel
::
where
(
'is_type'
,
0
)
->
where
(
'status'
,
2
)
->
select
([
'supplier_name'
,
'supplier_code'
])
->
get
();
...
...
@@ -124,8 +125,26 @@ class SkuController extends Controller
$skuIds
=
explode
(
','
,
$skuIds
);
$this
->
data
[
'skuIds'
]
=
$skuIds
;
}
$supplierCodesForXmSelect
=
$supplierCodes
;
foreach
(
$supplierCodesForXmSelect
as
$key
=>
$value
)
{
$supplierCodesForXmSelect
[
$key
]
=
[
'name'
=>
$value
,
'value'
=>
$key
];
}
$this
->
data
[
'supplierCodes'
]
=
$supplierCodes
;
$supplierCodesForXmSelect
=
array_values
(
$supplierCodesForXmSelect
);
$this
->
data
[
'supplierCodesForXmSelect'
]
=
$supplierCodesForXmSelect
;
$systemTagsForXmSelect
=
$systemTags
;
foreach
(
$systemTagsForXmSelect
as
$key
=>
$value
)
{
$systemTagsForXmSelect
[
$key
]
=
[
'name'
=>
$value
[
'tag_name'
],
'value'
=>
$value
[
'tag_id'
]];
}
$systemTagsForXmSelect
=
array_values
(
$systemTagsForXmSelect
);
$this
->
data
[
'systemTagsForXmSelect'
]
=
$systemTagsForXmSelect
;
//获取已经设置的标签
$goodsLabelSystemTagList
=
(
new
SupplierTagService
())
->
getGoodsLabelSystemTagList
();
$this
->
data
[
'goodsLabelSystemTagList'
]
=
$goodsLabelSystemTagList
;
$goodsSourceSystemTagList
=
(
new
SupplierTagService
())
->
getGoodsSourceSystemTagList
();
$this
->
data
[
'goodsSourceSystemTagList'
]
=
$goodsSourceSystemTagList
;
return
$this
->
view
(
'批量修改Sku标签'
);
}
...
...
app/Http/Controllers/SupplierController.php
View file @
3463e1c6
...
...
@@ -149,6 +149,15 @@ class SupplierController extends Controller
$this
->
data
[
'sku_upload_log_count'
]
=
(
new
SkuUploadLogService
())
->
getSkuUploadLogCount
(
$supplierId
);
$ruleService
=
new
RuleService
();
$this
->
data
[
'rule'
]
=
$ruleService
->
getSupplierRule
(
$supplier
[
'supplier_code'
]);
$skuOptionalBatch
=
config
(
'field.SkuOptionalBatch'
);
foreach
(
$skuOptionalBatch
as
$key
=>
$value
)
{
$skuOptionalBatchXmSelect
[]
=
[
'name'
=>
$value
,
'value'
=>
$key
,
];
}
$this
->
data
[
'sku_optional_batch_for_xm_select'
]
=
$skuOptionalBatchXmSelect
;
return
$this
->
view
(
'供应商详情'
);
}
...
...
@@ -254,6 +263,14 @@ class SupplierController extends Controller
$ruleService
=
new
RuleService
();
$this
->
data
[
'rule'
]
=
$ruleService
->
getSupplierRule
(
$supplier
[
'supplier_code'
]);
$skuOptionalBatchForXmSelect
=
[];
foreach
(
config
(
'field.SkuOptionalBatch'
)
as
$key
=>
$value
)
{
$skuOptionalBatchForXmSelect
[]
=
[
'value'
=>
$key
,
'name'
=>
$value
,
];
}
$this
->
data
[
'sku_optional_batch_for_xm_select'
]
=
$skuOptionalBatchForXmSelect
;
return
$this
->
view
(
'编辑供应商'
);
}
...
...
app/Http/Controllers/Sync/SupplierSyncController.php
View file @
3463e1c6
...
...
@@ -55,7 +55,6 @@ class SupplierSyncController extends BaseSyncController
{
$resultData
=
$request
->
all
();
Log
::
error
(
json_encode
(
$resultData
));
//$resultData['result_map'] = !empty($resultData['result_map']) ? json_decode($resultData['result_map'], true) : [];
//$resultData['tag_list'] = !empty($resultData['tag_list']) ? json_decode($resultData['tag_list'], true) : [];
if
(
is_array
(
$resultData
[
'result_map'
]))
{
...
...
app/Http/Services/SupplierService.php
View file @
3463e1c6
...
...
@@ -26,14 +26,19 @@ class SupplierService
//获取供应商列表
public
function
getSupplierList
(
$map
)
{
$model
=
new
SupplierChannelModel
();
$query
=
$model
->
orderBy
(
'update_time'
,
'desc'
);
$filter
=
new
SupplierFilter
();
$query
=
$filter
->
listFilter
(
$map
,
$query
);
$limit
=
array_get
(
$map
,
'limit'
,
10
);
if
(
!
empty
(
$map
[
'is_export'
]))
{
$list
=
$query
->
get
()
->
toArray
();
}
else
{
$sql
=
$query
->
toSql
();
$bindings
=
$query
->
getBindings
();
// dd($sql, $bindings);
$list
=
$query
->
paginate
(
$limit
)
->
toArray
();
$transformer
=
new
SupplierTransformer
();
$list
[
'data'
]
=
$transformer
->
transformList
(
$list
[
'data'
]);
...
...
@@ -983,4 +988,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/SupplierTagService.php
View file @
3463e1c6
...
...
@@ -4,10 +4,11 @@
namespace
App\Http\Services
;
//后台用户相关信息服务
use
App\Model\SupplierChannelModel
;
use
GuzzleHttp\Client
;
use
App\Model\RedisModel
;
use
GuzzleHttp\RequestOptions
;
use
Illuminate\Support\Facades\DB
;
use
App\Model\SupplierChannelModel
;
use
Illuminate\Support\Facades\Log
;
class
SupplierTagService
...
...
@@ -162,4 +163,64 @@ class SupplierTagService
]);
}
}
//获取供应商的系统标签
public
function
getGoodsLabelSystemTagList
()
{
$redis
=
new
RedisModel
();
$data
=
$redis
->
hgetall
(
'goods_label_tags'
);
$data
=
array_map
(
function
(
$item
)
{
return
json_decode
(
$item
,
true
);
},
$data
);
$result
=
[];
foreach
(
$data
as
$key
=>
$value
)
{
$result
[]
=
[
'goods_label'
=>
config
(
'field.SkuGoodsLabel'
)[
$key
],
'system_tags'
=>
implode
(
','
,
$value
[
'system_tags'
]),
];
}
return
$result
;
}
//获取供应商的接入方式标签
public
function
getGoodsSourceSystemTagList
()
{
$redis
=
new
RedisModel
();
$data
=
$redis
->
hgetall
(
'goods_source_tags'
);
$data
=
array_map
(
function
(
$item
)
{
return
json_decode
(
$item
,
true
);
},
$data
);
$result
=
[];
foreach
(
$data
as
$key
=>
$value
)
{
$result
[]
=
[
'goods_source'
=>
config
(
'field.SkuGoodsLabel'
)[
$key
],
'system_tags'
=>
implode
(
','
,
$value
[
'system_tags'
]),
];
}
return
$result
;
}
//批量更新供应商的SKU显示类型
public
function
batchSaveGoodsLabelTags
(
$goodsLabel
,
$goodsLabelSystemTags
)
{
$goodsLabelSystemTags
=
explode
(
','
,
$goodsLabelSystemTags
);
$data
=
[
'system_tags'
=>
$goodsLabelSystemTags
,
];
//存到redis中
$redis
=
new
RedisModel
();
$redis
->
hset
(
'goods_label_tags'
,
$goodsLabel
,
json_encode
(
$data
));
}
//批量更新供应商的SKU接入方式
public
function
batchSaveGoodsSourceTags
(
$goodsSource
,
$goodsSourceSystemTags
)
{
$goodsSourceSystemTags
=
explode
(
','
,
$goodsSourceSystemTags
);
$data
=
[
'system_tags'
=>
$goodsSourceSystemTags
,
];
//存到redis中
$redis
=
new
RedisModel
();
$redis
->
hset
(
'goods_source_tags'
,
$goodsSource
,
json_encode
(
$data
));
}
}
app/Http/Services/SyncSupplierService.php
View file @
3463e1c6
...
...
@@ -124,20 +124,23 @@ class SyncSupplierService
}
$message
[
'reviewProcess'
]
=
$reviewProcess
;
if
(
$conn
)
{
}
else
{
$conn
=
new
AMQPStreamConnection
(
config
(
'database.connections.rabbitmq.host'
),
$conn
=
new
AMQPStreamConnection
(
config
(
'database.connections.rabbitmq.host'
),
config
(
'database.connections.rabbitmq.port'
),
config
(
'database.connections.rabbitmq.login'
),
config
(
'database.connections.rabbitmq.password'
));
config
(
'database.connections.rabbitmq.password'
)
);
}
$channel
=
$conn
->
channel
();
$channel
->
queue_declare
(
'supplier_sync'
,
false
,
true
,
false
,
false
);
Log
::
warning
(
json_encode
(
$message
));
$msg
=
new
AMQPMessage
(
json_encode
(
$message
),
array
(
'content_type'
=>
'text/plain'
));
$msg
=
new
AMQPMessage
(
json_encode
(
$message
),
array
(
'content_type'
=>
'text/plain'
)
);
$result
=
$channel
->
basic_publish
(
$msg
,
''
,
'supplier_sync'
);
// $result = $channel->basic_publish($msg);
// $result = $channel->basic_publish($msg);
}
//获取采购人员列表
...
...
@@ -167,7 +170,7 @@ class SyncSupplierService
//同步供应商信息到一体化中心
public
function
syncSupplierToUnited
(
$supplierId
)
{
Log
::
error
(
'同步供应商给一体化 : '
.
$supplierId
);
Log
::
error
(
'同步供应商给一体化 : '
.
$supplierId
);
$supplier
=
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
first
()
->
toArray
();
$fileUrl
=
SupplierAttachmentsModel
::
where
(
'supplier_id'
,
$supplierId
)
->
where
(
'field_name'
,
'registration_certificate'
)
...
...
@@ -183,8 +186,11 @@ class SyncSupplierService
'region'
=>
$supplier
[
'region'
]
==
SupplierChannelModel
::
REGION_CN
?
1
:
2
,
'pi_file_url'
=>
$fileUrl
?:
''
,
];
(
new
QueueDeliveryService
())
->
push
(
QueueDeliveryService
::
PUSH_TYPE_SYNC_HTTP
,
'/sync/Company/syncCompany'
,
$syncData
);
(
new
QueueDeliveryService
())
->
push
(
QueueDeliveryService
::
PUSH_TYPE_SYNC_HTTP
,
'/sync/Company/syncCompany'
,
$syncData
);
}
/**
...
...
@@ -292,16 +298,20 @@ class SyncSupplierService
Log
::
error
(
'供应商不存在'
);
return
true
;
}
foreach
(
$suppliers
as
$supplier
)
{
//判断是否是同名多供应商,如果是的话,如果是之前已经禁用的,则直接跳过
if
(
count
(
$suppliers
)
>
1
)
{
if
(
$supplier
[
'status'
]
==
SupplierChannelModel
::
STATUS_DISABLE
&&
$supplier
[
'is_entity'
]
!=
SupplierChannelModel
::
IS_ENTITY_NEED_CONFIRM
)
{
Log
::
warning
(
"检测到同名供应商并且属于禁用(实体名单不为待处理)状态,跳过,供应商id为 : "
.
$supplier
[
'supplier_id'
]);
if
(
$supplier
[
'status'
]
==
SupplierChannelModel
::
STATUS_DISABLE
&&
(
$supplier
[
'is_entity'
]
!=
SupplierChannelModel
::
IS_ENTITY_NEED_CONFIRM
&&
$supplier
[
'is_entity'
]
!=
SupplierChannelModel
::
IS_ENTITY_TRUE
)
)
{
Log
::
warning
(
"检测到同名供应商并且属于禁用(实体名单不为待处理
并且也不为实体名单
)状态,跳过,供应商id为 : "
.
$supplier
[
'supplier_id'
]);
continue
;
}
}
//判断是否是人工禁用的,是的话,也跳过
//线上数据,实体名单状态为普通,且供应商状态为禁止交易的,全部为手动禁用;
if
((
strpos
(
$supplier
[
'disable_reason'
],
'人工禁用'
)
!==
false
&&
$supplier
[
'status'
]
==
SupplierChannelModel
::
STATUS_DISABLE
)
||
(
$supplier
[
'status'
]
==
SupplierChannelModel
::
STATUS_DISABLE
&&
$supplier
[
'is_entity'
]
==
SupplierChannelModel
::
IS_ENTITY_FALSE
))
{
Log
::
warning
(
"检测到供应商并且属于禁用(人工禁用)状态,跳过,供应商id为 : "
.
$supplier
[
'supplier_id'
]);
continue
;
}
$originIsEntity
=
$supplier
[
'is_entity'
];
//$supplier = $supplier->toArray();
$supplierId
=
$supplier
[
'supplier_id'
];
...
...
app/Http/Transformers/SupplierTransformer.php
View file @
3463e1c6
...
...
@@ -262,6 +262,7 @@ class SupplierTransformer
$supplier
[
'purchase_type_name'
]
=
array_get
(
config
(
'field.PurchaseType'
),
$supplier
[
'purchase_type'
],
'无'
);
$supplier
[
'cp_time_format'
]
=
(
'现货 : '
.
(
$supplier
[
'cp_time_day'
]
==
-
1
?
'无限制'
:
$supplier
[
'cp_time_day'
]
.
'天'
))
.
' | '
.
(
'期货 : '
.
(
$supplier
[
'futures_cp_time_day'
]
==
-
1
?
'无限制'
:
$supplier
[
'futures_cp_time_day'
]
.
'天'
));
$supplier
[
'sku_optional_batch_text'
]
=
$this
->
getSkuOptionalBatchText
(
$supplier
[
'sku_optional_batch'
]);
return
$supplier
;
}
...
...
@@ -421,4 +422,14 @@ class SupplierTransformer
return
$supplier
;
}
public
function
getSkuOptionalBatchText
(
$skuOptionalBatch
)
{
$skuOptionalBatch
=
explode
(
','
,
$skuOptionalBatch
);
$skuOptionalBatchText
=
[];
foreach
(
$skuOptionalBatch
as
$batch
)
{
$skuOptionalBatchText
[]
=
array_get
(
config
(
'field.SkuOptionalBatch'
),
$batch
);
}
return
implode
(
','
,
$skuOptionalBatchText
);
}
}
app/Http/Validators/SupplierValidator.php
View file @
3463e1c6
...
...
@@ -335,6 +335,11 @@ class SupplierValidator
if
(
$notCompleteContacts
)
{
$errorMessageList
[]
=
"存在和你相关的联系人没有完善,请先去完善相关联系人"
;
}
//还要校验sku可选批次
if
(
!
$validateData
[
'sku_optional_batch'
])
{
$errorMessageList
[]
=
"请设置SKU可选批次,在SKU概况栏"
;
}
}
return
implode
(
'|'
,
$errorMessageList
);
...
...
app/Presenters/MultiSelectorPresenter.php
View file @
3463e1c6
...
...
@@ -13,6 +13,8 @@ class MultiSelectorPresenter
$width
=
array_get
(
$option
,
'width'
,
'157px'
);
$radio
=
array_get
(
$option
,
'radio'
,
'false'
);
$requiredHtml
=
$isRequired
?
'<span style="color: red">*</span>'
:
""
;
$disable
=
array_get
(
$option
,
'disable'
,
false
);
$disable
=
$disable
?
"true"
:
"false"
;
$elemId
=
$name
.
"Selector"
;
$data
=
json_encode
(
$data
);
$html
=
<<<EOF
...
...
@@ -39,6 +41,7 @@ class MultiSelectorPresenter
value: 'value'
},
radio: $radio,
disabled: $disable,
size: 'mini',
direction: 'down',
data : $data,
...
...
config/field.php
View file @
3463e1c6
...
...
@@ -363,4 +363,14 @@ return [
2
=>
'京东采购'
,
3
=>
'华云采购'
,
],
'SkuOptionalBatch'
=>
[
-
1
=>
'无法指定'
,
1
=>
'任意批次'
,
2
=>
'1年内'
,
3
=>
'2年内'
,
4
=>
'3年内'
,
5
=>
'4年内'
,
6
=>
'5年内'
,
],
];
config/validate.php
View file @
3463e1c6
...
...
@@ -59,5 +59,6 @@ return [
'purchase_type_name'
=>
'代购类型'
,
'sign_com_id'
=>
'签约公司id'
,
'sign_com_name'
=>
'签约公司名称'
,
'sku_optional_batch_text'
=>
'SKU可选批次'
,
]
];
resources/views/script/BatchAddSkuTagScript.blade.php
View file @
3463e1c6
<script>
layui
.
use
([
'table'
,
'form'
,
'element'
,
'table'
,
'xmSelect'
,
'tagsInput'
,
'layer'
,
'admin'
],
function
()
{
layui
.
use
([
'table'
,
'form'
,
'element'
,
'table'
,
'xmSelect'
,
'tagsInput'
,
'layer'
,
'admin'
],
function
()
{
let
admin
=
layui
.
admin
;
let
form
=
layui
.
form
;
let
table
=
layui
.
table
let
table
=
layui
.
table
;
let
element
=
layui
.
element
;
let
xmSelect
=
layui
.
xmSelect
;
let
tagsInput
=
layui
.
tagsInput
;
form
.
on
(
'submit(addSkuTag)'
,
function
(
data
)
{
if
(
data
.
field
.
sku_tags
===
''
)
{
layer
.
confirm
(
'如果没有选择任何标签点击确认将把原标签全部删除,确定要删除吗?'
,
function
(
index
)
{
addSkuTag
(
data
);
// 获取当前激活的tab索引
function
getCurrentTabIndex
()
{
let
activeTab
=
$
(
'.layui-tab-title .layui-this'
);
return
activeTab
.
index
();
}
// 获取当前激活的tab名称
function
getCurrentTabName
()
{
let
tabIndex
=
getCurrentTabIndex
();
switch
(
tabIndex
)
{
case
0
:
return
'tag_setting'
;
case
1
:
return
'goods_label'
;
case
2
:
return
'goods_source'
;
default
:
return
'tag_setting'
;
}
}
// 标签设置tab的校验规则
function
validateTagSettingTab
(
data
)
{
// 检查SKU是否已选择
let
skuIds
=
data
.
field
.
sku_ids
;
if
(
!
skuIds
||
skuIds
.
trim
()
===
''
)
{
layer
.
msg
(
'请先选择SKU'
,
{
icon
:
5
});
}
else
{
addSkuTag
(
data
);
return
false
;
}
// 检查设置方式
if
(
!
data
.
field
.
type
)
{
layer
.
msg
(
'请选择设置方式'
,
{
icon
:
5
});
return
false
;
}
// 如果选择按型号,检查型号不能为空
if
(
data
.
field
.
type
===
'1'
)
{
// 这里需要根据实际的型号字段名进行校验
// 假设型号字段名为 model_number 或者从SKU中提取
if
(
!
skuIds
||
skuIds
.
trim
()
===
''
)
{
layer
.
msg
(
'请选择型号'
,
{
icon
:
5
});
return
false
;
}
}
// 如果选择按供应商,检查是否选择了供应商
if
(
data
.
field
.
type
===
'2'
)
{
if
(
!
data
.
field
.
supplier_code
||
data
.
field
.
supplier_code
===
''
)
{
layer
.
msg
(
'请选择供应商'
,
{
icon
:
5
});
return
false
;
}
}
return
true
;
}
// 按SKU显示类型tab的校验规则
function
validateGoodsLabelTab
(
data
)
{
// 检查是否选择了显示类型
if
(
!
data
.
field
.
goods_label
||
data
.
field
.
goods_label
===
''
)
{
layer
.
msg
(
'请选择SKU显示类型'
,
{
icon
:
5
});
return
false
;
}
// 检查是否选择了系统标签
if
(
!
data
.
field
.
goods_label_system_tags
||
data
.
field
.
goods_label_system_tags
===
''
)
{
layer
.
msg
(
'请选择系统标签'
,
{
icon
:
5
});
return
false
;
}
return
true
;
}
// 按SKU接入方式tab的校验规则
function
validateGoodsSourceTab
(
data
)
{
// 检查是否选择了接入方式
if
(
!
data
.
field
.
goods_source
||
data
.
field
.
goods_source
===
''
)
{
layer
.
msg
(
'请选择SKU接入方式'
,
{
icon
:
5
});
return
false
;
}
// 检查是否选择了系统标签
if
(
!
data
.
field
.
goods_source_system_tags
||
data
.
field
.
goods_source_system_tags
===
''
)
{
layer
.
msg
(
'请选择系统标签'
,
{
icon
:
5
});
return
false
;
}
return
true
;
}
form
.
on
(
'submit(addSkuTag)'
,
function
(
data
)
{
let
currentTab
=
getCurrentTabName
();
data
.
field
.
current_tab
=
currentTab
;
// 根据当前tab进行不同的校验
switch
(
currentTab
)
{
case
'tag_setting'
:
//判断radio为type的是否选择了sku,如果没有选择,则不进行提交,直接返回
if
(
data
.
field
.
sku_ids
||
data
.
field
.
sku_ids
!=
''
)
{
if
(
!
validateTagSettingTab
(
data
))
{
return
false
;
}
}
// 标签设置tab的提交逻辑
if
(
data
.
field
.
sku_tags
===
''
)
{
layer
.
confirm
(
'如果没有选择任何标签点击确认将把原标签全部删除,确定要删除吗?'
,
function
(
index
)
{
addSkuTag
(
data
);
layer
.
close
(
index
);
});
}
else
{
addSkuTag
(
data
);
}
break
;
case
'goods_label'
:
if
(
!
validateGoodsLabelTab
(
data
))
{
return
false
;
}
// 按SKU显示类型的提交逻辑
if
(
data
.
field
.
goods_label_system_tags
===
''
)
{
layer
.
confirm
(
'如果没有选择任何标签点击确认将把原标签全部删除,确定要删除吗?'
,
function
(
index
)
{
addSkuTag
(
data
);
layer
.
close
(
index
);
});
}
else
{
addSkuTag
(
data
);
}
break
;
case
'goods_source'
:
if
(
!
validateGoodsSourceTab
(
data
))
{
return
false
;
}
// 按SKU接入方式的提交逻辑
if
(
data
.
field
.
goods_source_system_tags
===
''
)
{
layer
.
confirm
(
'如果没有选择任何标签点击确认将把原标签全部删除,确定要删除吗?'
,
function
(
index
)
{
addSkuTag
(
data
);
layer
.
close
(
index
);
});
}
else
{
addSkuTag
(
data
);
}
break
;
default
:
layer
.
msg
(
'未知的tab类型'
,
{
icon
:
5
});
return
false
;
}
});
...
...
@@ -24,36 +184,42 @@
let
sku_ids
=
getQueryVariable
(
'sku_ids'
);
let
url
=
'/api/sku/BatchAddSkuTag'
;
$
.
ajax
({
url
:
url
,
type
:
'POST'
,
async
:
true
,
data
:
data
.
field
,
dataType
:
'json'
,
timeout
:
20000
,
success
:
function
(
res
)
{
url
:
url
,
type
:
'POST'
,
async
:
true
,
data
:
data
.
field
,
dataType
:
'json'
,
timeout
:
20000
,
success
:
function
(
res
)
{
admin
.
removeLoading
();
if
(
res
.
err_code
===
0
)
{
layer
.
msg
(
res
.
err_msg
,
{
icon
:
6
});
setTimeout
(
function
()
{
layer
.
msg
(
res
.
err_msg
,
{
icon
:
6
});
setTimeout
(
function
()
{
admin
.
closeThisDialog
();
},
1000
);
}
else
{
layer
.
msg
(
res
.
err_msg
,
{
icon
:
5
});
layer
.
msg
(
res
.
err_msg
,
{
icon
:
5
});
}
}
,
error
:
function
()
{
}
,
error
:
function
()
{
admin
.
removeLoading
();
layer
.
msg
(
'网络错误'
,
{
icon
:
5
});
layer
.
msg
(
'网络错误'
,
{
icon
:
5
});
}
});
}
form
.
on
(
'submit(cancel)'
,
function
(
data
)
{
form
.
on
(
'submit(cancel)'
,
function
(
data
)
{
admin
.
closeThisDialog
();
});
form
.
on
(
'radio(type)'
,
function
(
data
)
{
form
.
on
(
'radio(type)'
,
function
(
data
)
{
if
(
data
.
value
===
'1'
)
{
$
(
'#supplier_select_div'
).
hide
();
$
(
'#selected_sku_id'
).
show
();
...
...
@@ -70,20 +236,20 @@
let
tagResult
=
ajax
(
url
);
let
tagList
=
tagResult
.
data
;
return
{
el
:
'#'
+
element
,
filterable
:
true
,
paging
:
true
,
height
:
'250px'
,
size
:
'small'
,
direction
:
'auto'
,
autoRow
:
true
,
prop
:
{
name
:
'tag_name'
,
value
:
'tag_id'
,
},
pageSize
:
30
,
data
:
tagList
,
on
:
function
(
tagList
)
{
el
:
'#'
+
element
,
filterable
:
true
,
paging
:
true
,
height
:
'250px'
,
size
:
'small'
,
direction
:
'auto'
,
autoRow
:
true
,
prop
:
{
name
:
'tag_name'
,
value
:
'tag_id'
,
}
,
pageSize
:
30
,
data
:
tagList
,
on
:
function
(
tagList
)
{
let
arr
=
tagList
.
arr
;
let
tagIds
=
''
;
for
(
let
i
in
arr
)
{
...
...
@@ -91,11 +257,12 @@
}
let
idName
=
'sku_tags'
;
$
(
'#'
+
idName
).
val
(
tagIds
);
}
,
};
}
,
};
}
let
systemTagOption
=
getTagOption
(
'sku_tags_selector'
,
2
);
let
tagSelector
=
xmSelect
.
render
(
systemTagOption
);
});
</script>
resources/views/script/BatchAllocateYunxinChannelUserScript.blade.php
View file @
3463e1c6
...
...
@@ -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/script/SkuListScript.blade.php
View file @
3463e1c6
...
...
@@ -522,7 +522,7 @@
layer
.
open
({
type
:
2
,
content
:
'/sku/BatchAddSkuTag?view=iframe&sku_ids='
+
skuIds
,
area
:
[
'80%'
,
'
8
0%'
],
area
:
[
'80%'
,
'
9
0%'
],
title
:
'批量设置SKU标签'
,
end
:
function
()
{
table
.
reload
(
'skuList'
);
...
...
resources/views/web/BatchAddSkuTag.blade.php
View file @
3463e1c6
...
...
@@ -2,82 +2,178 @@
.layui-form-item
{
margin-bottom
:
5px
;
}
.layui-tab-content
{
padding
:
20px
;
}
</style>
<form
class=
"layui-form"
action=
""
>
<div
class=
"layui-card"
>
<div
class=
"layui-card-header"
style=
"height: 100%"
>
@if(request()->get('sku_ids'))
<div
id=
"selected_sku_id"
>
<blockquote
class=
"layui-elem-quote layui-text"
>
<b>
选择的sku
</b>
</blockquote>
<div
class=
"layui-form-item"
>
<table
class=
"layui-table"
>
<tbody>
@foreach($skuIds as $skuId)
<tr>
<td>
{{$skuId}}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div
class=
"layui-card-body"
>
<div
class=
"layui-tab layui-tab-brief"
lay-filter=
"batchSkuTab"
>
<ul
class=
"layui-tab-title"
>
<li
class=
"layui-this"
>
标签设置
</li>
<li>
按SKU显示类型
</li>
<li>
按SKU接入方式
</li>
</ul>
<div
class=
"layui-tab-content"
>
<!-- 标签设置选项卡 -->
<div
class=
"layui-tab-item layui-show"
>
<input
type=
"hidden"
name=
"sku_ids"
id=
"sku_ids"
value=
"{{request()->get('sku_ids')}}"
>
@if(request()->get('sku_ids'))
<div
id=
"selected_sku_id"
>
<blockquote
class=
"layui-elem-quote layui-text"
>
<b>
已选择的SKU列表
</b>
</blockquote>
<div
class=
"layui-form-item"
>
<table
class=
"layui-table"
>
<thead>
<tr>
<th>
SKU ID
</th>
</tr>
</thead>
<tbody>
@foreach(explode(',',request()->get('sku_ids')) as $sku_id)
<tr>
<td>
{{$sku_id}}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@else
<div
class=
"layui-empty"
>
<p
class=
"layui-empty-text"
>
暂无选择的SKU
</p>
<br
/>
</div>
@endif
<blockquote
class=
"layui-elem-quote layui-text"
>
<b>
设置标签
</b>
</blockquote>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
设置方式
</label>
<div
class=
"layui-input-block"
>
<input
type=
"radio"
lay-filter=
"type"
name=
"type"
value=
"1"
title=
"按型号"
checked
>
<input
type=
"radio"
lay-filter=
"type"
name=
"type"
value=
"2"
title=
"按供应商"
>
</div>
</div>
@endif
<blockquote
class=
"layui-elem-quote layui-text"
>
<b>
设置标签
</b>
</blockquote>
<input
type=
"hidden"
name=
"sku_ids"
id=
"sku_ids"
value=
"{{request()->get('sku_ids')}}"
>
<div
class=
"layui-form-item"
id=
"supplier_select_div"
style=
"display: none"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('supplier_code','供应商选择',null,
$supplierCodes,['required'=>true,'width'=>'400px']) !!}
</div
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-input-block"
style=
"margin-left: -30px"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
设置方式 :
</label>
<div
class=
"layui-input-block"
style=
"margin-top: 10px"
>
<input
type=
"radio"
lay-filter=
"type"
name=
"type"
value=
"1"
title=
"按型号"
checked
>
<input
type=
"radio"
lay-filter=
"type"
name=
"type"
value=
"2"
title=
"按供应商"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
系统标签
</label>
<div
class=
"layui-input-block"
>
<div
id=
"sku_tags_selector"
class=
"layui-input-inline"
style=
"width: 100%;"
>
</div>
<input
type=
"hidden"
name=
"sku_tags"
id=
"sku_tags"
>
<div
class=
"layui-form-mid layui-word-aux"
style=
"color: red; margin-top: 10px;"
>
选择标签会覆盖原有标签。如果没有选择任何标签点击确认将把原标签全部删除
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"layui-form-item"
id=
"supplier_select_div"
style=
"display: none"
>
<div
class=
"layui-inline"
style=
"margin-left: -30px"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('supplier_code','供应商选择 : ',null,
$supplierCodes,['required'=>true,'width'=>'400px']) !!}
</div>
</div>
<!-- 按SKU显示类型选项卡 -->
<div
class=
"layui-tab-item"
>
<blockquote
class=
"layui-elem-quote layui-text"
>
<b>
设置显示类型
</b>
</blockquote>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('goods_label','SKU显示类型 : ',null,
config('field.SkuGoodsLabel'),['required'=>true,'label_width'=>'100px']) !!}
</div>
</div>
<div
class=
"layui-form-item"
style=
"margin-left: 20px;"
>
<div
class=
"layui-inline"
>
@inject('multiSelectorPresenter','App\Presenters\MultiSelectorPresenter')
{!! $multiSelectorPresenter->render('goods_label_system_tags','系统标签 :','',$systemTagsForXmSelect,['width'=>'400px']) !!}
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-input-block"
style=
"margin-left: -30px"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
系统标签 :
</label>
<div
class=
"layui-input-block"
style=
"margin-top: 15px"
>
<div
id=
"sku_tags_selector"
class=
"layui-input-inline"
style=
"width: 100%;"
>
<blockquote
class=
"layui-elem-quote layui-text"
>
<b>
已经设置的数据
</b>
</blockquote>
<div
class=
"layui-form-item"
>
<table
class=
"layui-table"
>
<thead>
<tr>
<th>
显示类型
</th>
<th>
系统标签
</th>
</tr>
</thead>
<tbody>
@foreach($goodsLabelSystemTagList as $item)
<tr>
<td>
{{$item['goods_label']}}
</td>
<td>
{{$item['system_tags']}}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<!-- 按SKU接入方式选项卡 -->
<div
class=
"layui-tab-item"
>
<blockquote
class=
"layui-elem-quote layui-text"
>
<b>
设置显示类型
</b>
</blockquote>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('goods_source','SKU接入方式 : ',null,
config('field.SkuSource'),['required'=>true,'label_width'=>'100px']) !!}
</div>
</div>
<div
class=
"layui-form-item"
style=
"margin-left: 20px;"
>
<div
class=
"layui-inline"
>
@inject('multiSelectorPresenter','App\Presenters\MultiSelectorPresenter')
{!! $multiSelectorPresenter->render('goods_source_system_tags','系统标签 :','',$systemTagsForXmSelect,['width'=>'400px']) !!}
</div>
<input
type=
"hidden"
name=
"sku_tags"
id=
"sku_tags"
>
</div>
<span
style=
"margin-left: 110px;color: red"
>
选择标签会覆盖原有标签.如果没有选择任何标签点击确认将把原标签全部删除
</span>
<blockquote
class=
"layui-elem-quote layui-text"
>
<b>
已经设置的数据
</b>
</blockquote>
<div
class=
"layui-form-item"
>
<table
class=
"layui-table"
>
<thead>
<tr>
<th>
显示类型
</th>
<th>
系统标签
</th>
</tr>
</thead>
<tbody>
@foreach($goodsSourceSystemTagList as $item)
<tr>
<td>
{{$item['goods_source']}}
</td>
<td>
{{$item['system_tags']}}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
<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=
"addSkuTag"
>
确认
<div
class=
"layui-form-item"
style=
"text-align: right; margin-top: 30px;
"
>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn-
normal submit-loading"
lay-submit
lay-filter=
"addSkuTag"
>
<i
class=
"layui-icon layui-icon-ok"
></i>
确认
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn-primary"
lay-submit
lay-filter=
"cancel"
>
取消
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn-primary"
lay-submit
lay-filter=
"cancel"
>
<i
class=
"layui-icon layui-icon-close"
></i>
取消
</button>
</div>
</div>
</div>
</div>
</form>
resources/views/web/BatchAllocateYunxinChannelUser.blade.php
View file @
3463e1c6
...
...
@@ -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']}}
</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>
...
...
resources/views/web/SupplierDetail.blade.php
View file @
3463e1c6
...
...
@@ -509,6 +509,12 @@
</div>
</div>
</div>
<div
class=
"layui-inline"
>
@inject('multiSelectorPresenter','App\Presenters\MultiSelectorPresenter')
{!! $multiSelectorPresenter->render('sku_optional_batch','SKU可选批次 : ',!empty($supplier)?$supplier['sku_optional_batch']:'',$sku_optional_batch_for_xm_select,['width'=>'350px','required'=>true,'disable'=>true]) !!}
</div>
<br>
@include('web.supplier.SkuUploadStatus');
<hr>
</div>
...
...
resources/views/web/supplier/SkuRuler.blade.php
View file @
3463e1c6
...
...
@@ -21,65 +21,51 @@
<label
class=
"layui-form-label"
>
数据新增规则 :
</label>
<div
class=
"layui-input-inline"
style=
"width: 420px"
>
@if(!empty($supplier['sku_upload_ruler']))
<div
class=
"layui-row"
>
现货 :
@foreach($supplier['sku_upload_ruler'] as $key=>$flag)
@php
$ruler = array_get(config('fixed.SkuUploadRuler'),$key);
@endphp
@if(!empty($ruler)
&&
strpos($key,'futures')===false)
<input
type=
"checkbox"
name=
"sku_upload_ruler[{{$key}}]"
lay-skin=
"primary"
@
if
($
flag
)
checked
@
endif
title=
"{{array_get(config('fixed.SkuUploadRuler'),$key)}}"
>
@endif
@endforeach
</div>
<div
class=
"layui-row"
>
期货 :
@foreach($supplier['sku_upload_ruler'] as $key=>$flag)
@php
$ruler = array_get(config('fixed.SkuUploadRuler'),$key);
@endphp
@if(!empty($ruler)
&&
strpos($key,'futures')!==false)
<input
type=
"checkbox"
name=
"sku_upload_ruler[{{$key}}]"
lay-skin=
"primary"
@
if
($
flag
)
checked
@
endif
title=
"{{array_get(config('fixed.SkuUploadRuler'),$key)}}"
>
@endif
@endforeach
</div>
<div
class=
"layui-row"
>
现货 :
@foreach($supplier['sku_upload_ruler'] as $key=>$flag)
@php
$ruler = array_get(config('fixed.SkuUploadRuler'),$key);
@endphp
@if(!empty($ruler)
&&
strpos($key,'futures')===false)
<input
type=
"checkbox"
name=
"sku_upload_ruler[{{$key}}]"
lay-skin=
"primary"
@
if
($
flag
)
checked
@
endif
title=
"{{array_get(config('fixed.SkuUploadRuler'),$key)}}"
>
@endif
@endforeach
</div>
<div
class=
"layui-row"
>
期货 :
@foreach($supplier['sku_upload_ruler'] as $key=>$flag)
@php
$ruler = array_get(config('fixed.SkuUploadRuler'),$key);
@endphp
@if(!empty($ruler)
&&
strpos($key,'futures')!==false)
<input
type=
"checkbox"
name=
"sku_upload_ruler[{{$key}}]"
lay-skin=
"primary"
@
if
($
flag
)
checked
@
endif
title=
"{{array_get(config('fixed.SkuUploadRuler'),$key)}}"
>
@endif
@endforeach
</div>
@else
<div
class=
"layui-row"
>
现货 :
@foreach(config('fixed.SkuUploadRuler') as $key=>$flag)
@php
$ruler = array_get(config('fixed.SkuUploadRuler'),$key);
@endphp
@if(!empty($ruler)
&&
strpos($key,'futures')===false)
<input
type=
"checkbox"
name=
"sku_upload_ruler[{{$key}}]"
lay-skin=
"primary"
title=
"{{$flag}}"
>
@endif
@endforeach
</div>
<div
class=
"layui-row"
>
期货 :
@foreach(config('fixed.SkuUploadRuler') as $key=>$flag)
@php
$ruler = array_get(config('fixed.SkuUploadRuler'),$key);
@endphp
@if(!empty($ruler)
&&
strpos($key,'futures')!==false)
<input
type=
"checkbox"
name=
"sku_upload_ruler[{{$key}}]"
lay-skin=
"primary"
title=
"{{$flag}}"
>
@endif
@endforeach
</div>
<div
class=
"layui-row"
>
现货 :
@foreach(config('fixed.SkuUploadRuler') as $key=>$flag)
@php
$ruler = array_get(config('fixed.SkuUploadRuler'),$key);
@endphp
@if(!empty($ruler)
&&
strpos($key,'futures')===false)
<input
type=
"checkbox"
name=
"sku_upload_ruler[{{$key}}]"
lay-skin=
"primary"
title=
"{{$flag}}"
>
@endif
@endforeach
</div>
<div
class=
"layui-row"
>
期货 :
@foreach(config('fixed.SkuUploadRuler') as $key=>$flag)
@php
$ruler = array_get(config('fixed.SkuUploadRuler'),$key);
@endphp
@if(!empty($ruler)
&&
strpos($key,'futures')!==false)
<input
type=
"checkbox"
name=
"sku_upload_ruler[{{$key}}]"
lay-skin=
"primary"
title=
"{{$flag}}"
>
@endif
@endforeach
</div>
@endif
</div>
<div
class=
"layui-form-mid layui-word-aux"
>
...
...
@@ -92,33 +78,27 @@
<div
class=
"layui-inline"
style=
"width: 100%"
>
<label
class=
"layui-form-label"
>
审核内容配置 :
</label>
<div
class=
"layui-input-inline"
style=
"width: 205px"
>
<input
type=
"radio"
name=
"sku_audit_ruler[skip]"
lay-filter=
"is_skip"
@
if
($
supplier
['
sku_audit_ruler
']['
skip
']==
1
)
checked
@
endif
value=
"1"
title=
"无需审核"
>
<input
type=
"radio"
name=
"sku_audit_ruler[skip]"
lay-filter=
"is_skip"
@
if
($
supplier
['
sku_audit_ruler
']['
skip
']==
0
)
checked
@
endif
value=
"0"
title=
"需要审核内容"
>
<input
type=
"radio"
name=
"sku_audit_ruler[skip]"
lay-filter=
"is_skip"
@
if
($
supplier
['
sku_audit_ruler
']['
skip
']==
1
)
checked
@
endif
value=
"1"
title=
"无需审核"
>
<input
type=
"radio"
name=
"sku_audit_ruler[skip]"
lay-filter=
"is_skip"
@
if
($
supplier
['
sku_audit_ruler
']['
skip
']==
0
)
checked
@
endif
value=
"0"
title=
"需要审核内容"
>
</div>
<div
class=
"layui-input-inline"
style=
"width: 700px"
>
@if(!empty($supplier['sku_audit_ruler']))
@foreach($supplier['sku_audit_ruler']['audit_ruler'] as $key=>$flag)
@if(!empty(array_get(config('fixed.SkuAuditRuler.audit_ruler'),$key)))
<input
type=
"checkbox"
name=
"sku_audit_ruler[{{$key}}]"
lay-skin=
"primary"
class=
"audit_ruler_item"
@
if
($
flag
)
checked
@
endif
title=
"{{array_get(config('fixed.SkuAuditRuler.name_map'),$key)}}"
>
@endif
@endforeach
@foreach($supplier['sku_audit_ruler']['audit_ruler'] as $key=>$flag)
@if(!empty(array_get(config('fixed.SkuAuditRuler.audit_ruler'),$key)))
<input
type=
"checkbox"
name=
"sku_audit_ruler[{{$key}}]"
lay-skin=
"primary"
class=
"audit_ruler_item"
@
if
($
flag
)
checked
@
endif
title=
"{{array_get(config('fixed.SkuAuditRuler.name_map'),$key)}}"
>
@endif
@endforeach
@else
@foreach(config('fixed.SkuAuditRuler.audit_ruler') as $key=>$flag)
<input
type=
"checkbox"
name=
"sku_audit_ruler[{{$key}}]"
lay-skin=
"primary"
checked
class=
"audit_ruler_item"
title=
"{{array_get(config('fixed.SkuAuditRuler.name_map'),$key)}}"
>
@endforeach
@foreach(config('fixed.SkuAuditRuler.audit_ruler') as $key=>$flag)
<input
type=
"checkbox"
name=
"sku_audit_ruler[{{$key}}]"
lay-skin=
"primary"
checked
class=
"audit_ruler_item"
title=
"{{array_get(config('fixed.SkuAuditRuler.name_map'),$key)}}"
>
@endforeach
@endif
</div>
</div>
<div
class=
"layui-inline"
>
@inject('multiSelectorPresenter','App\Presenters\MultiSelectorPresenter')
{!! $multiSelectorPresenter->render('sku_optional_batch','SKU可选批次 : ',!empty($supplier)?$supplier['sku_optional_batch']:'',$sku_optional_batch_for_xm_select,['width'=>'350px','required'=>true]) !!}
</div>
@include('web.supplier.SkuUploadStatus');
</div>
...
...
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