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
57bfa062
authored
Jul 30, 2025
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' into ysx-供应商需求-20250723
parents
14861efa
51cdff1d
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
34 additions
and
29 deletions
app/Http/Services/SkuService.php
app/Http/Services/SupplierService.php
app/Http/Services/SupplierTagService.php
app/Http/Validators/SupplierValidator.php
config/website.php
resources/views/script/AddSupplierScript.blade.php
resources/views/script/BatchAddSkuTagScript.blade.php
resources/views/script/SkuListScript.blade.php
resources/views/script/UpdateSupplierScript.blade.php
app/Http/Services/SkuService.php
View file @
57bfa062
...
...
@@ -44,9 +44,16 @@ class SkuService extends BaseService
$data
=
json_decode
(
$return
,
true
);
$list
=
[];
if
(
isset
(
$data
[
'error_code'
])
&&
$data
[
'error_code'
]
==
0
)
{
$url
=
config
(
'website.GoodsServerUrl'
)
.
'/synchronization?goods_id='
.
implode
(
','
,
$data
[
'data'
][
'goods_id'
]);
$return
=
curl
(
$url
,
$map
,
1
);
$skuListData
=
json_decode
(
$return
,
true
);
if
(
isset
(
$skuListData
[
'errcode'
])
&&
$skuListData
[
'errcode'
]
==
0
)
{
$skuListData
=
collect
(
$skuListData
[
'data'
])
->
keyBy
(
'goods_id'
)
->
toArray
();
}
$redis
=
new
RedisModel
;
//处理供应商
$spuRedis
=
Redis
::
connection
(
'spu'
);
//商品服务获取数据
foreach
(
$data
[
'data'
][
'goods_id'
]
as
$k
=>
$goodsId
)
{
$uploadItemService
=
new
SkuUploadItemService
();
$auditData
=
$uploadItemService
->
getSkuAuditData
(
$data
[
'data'
][
'goods_id'
]);
...
...
@@ -97,7 +104,11 @@ class SkuService extends BaseService
$standardBrand
=
json_decode
(
$standardBrand
,
true
);
$sku
[
'standard_brand_name'
]
=
$standardBrand
[
'brand_name'
];
}
$skuData
=
array_get
(
$skuListData
,
$sku
[
'goods_id'
],
[]);
$sku
[
'goods_tag_names'
]
=
''
;
if
(
!
empty
(
$skuData
[
'goods_tag'
][
'goods_tag_names'
]))
{
$sku
[
'goods_tag_names'
]
=
implode
(
','
,
$skuData
[
'goods_tag'
][
'goods_tag_names'
]);
}
//获取价格
$moqPrice
=
[];
if
(
!
empty
(
$sku
[
'ladder_price'
]))
{
...
...
app/Http/Services/SupplierService.php
View file @
57bfa062
...
...
@@ -196,7 +196,7 @@ class SupplierService
$channel
[
'channel_uid'
]
=
$contact
[
'can_check_uids'
];
$channel
[
'sku_upload_ruler'
]
=
$this
->
getInitSkuUploadRuler
();
$channel
[
'sku_optional_batch'
]
=
1
;
//插入供应商返回供应商id
$supplierId
=
$this
->
newSupplierId
=
$model
->
insertGetId
(
$channel
);
...
...
app/Http/Services/SupplierTagService.php
View file @
57bfa062
...
...
@@ -175,7 +175,7 @@ class SupplierTagService
$result
=
[];
foreach
(
$data
as
$key
=>
$value
)
{
$result
[]
=
[
'goods_label'
=>
config
(
'field.SkuGoodsLabel'
)[
$key
]
,
'goods_label'
=>
isset
(
config
(
'field.SkuGoodsLabel'
)[
$key
])
?
config
(
'field.SkuGoodsLabel'
)[
$key
]
:
''
,
'system_tags'
=>
implode
(
','
,
$value
[
'system_tags'
]),
];
}
...
...
@@ -193,7 +193,7 @@ class SupplierTagService
$result
=
[];
foreach
(
$data
as
$key
=>
$value
)
{
$result
[]
=
[
'goods_source'
=>
config
(
'field.SkuGoodsLabel'
)[
$key
]
,
'goods_source'
=>
isset
(
config
(
'field.SkuSource'
)[
$key
])
?
config
(
'field.SkuSource'
)[
$key
]
:
''
,
'system_tags'
=>
implode
(
','
,
$value
[
'system_tags'
]),
];
}
...
...
@@ -203,7 +203,7 @@ class SupplierTagService
//批量更新供应商的SKU显示类型
public
function
batchSaveGoodsLabelTags
(
$goodsLabel
,
$goodsLabelSystemTags
)
{
$goodsLabelSystemTags
=
explode
(
','
,
$goodsLabelSystemTags
)
;
$goodsLabelSystemTags
=
$goodsLabelSystemTags
?
explode
(
','
,
$goodsLabelSystemTags
)
:
[]
;
$data
=
[
'system_tags'
=>
$goodsLabelSystemTags
,
];
...
...
@@ -215,7 +215,7 @@ class SupplierTagService
//批量更新供应商的SKU接入方式
public
function
batchSaveGoodsSourceTags
(
$goodsSource
,
$goodsSourceSystemTags
)
{
$goodsSourceSystemTags
=
explode
(
','
,
$goodsSourceSystemTags
)
;
$goodsSourceSystemTags
=
$goodsSourceSystemTags
?
explode
(
','
,
$goodsSourceSystemTags
)
:
[]
;
$data
=
[
'system_tags'
=>
$goodsSourceSystemTags
,
];
...
...
app/Http/Validators/SupplierValidator.php
View file @
57bfa062
...
...
@@ -336,10 +336,10 @@ class SupplierValidator
$errorMessageList
[]
=
"存在和你相关的联系人没有完善,请先去完善相关联系人"
;
}
//还要校验sku可选批次
if
(
!
$validateData
[
'sku_optional_batch'
])
{
$errorMessageList
[]
=
"请设置SKU可选批次,在SKU概况栏"
;
}
//
//
还要校验sku可选批次
//
if (!$validateData['sku_optional_batch']) {
//
$errorMessageList[] = "请设置SKU可选批次,在SKU概况栏";
//
}
}
return
implode
(
'|'
,
$errorMessageList
);
...
...
config/website.php
View file @
57bfa062
...
...
@@ -45,5 +45,6 @@ return [
'CrmUrl'
=>
env
(
'CRM_URL'
),
'SkipSendEmail'
=>
env
(
'skip_send_email'
),
'CubeUrl'
=>
env
(
'CUBE_URL'
),
'FootstoneCurlUrl'
=>
'http://footstone.liexindev.net/open/curl?url='
'FootstoneCurlUrl'
=>
'http://footstone.liexindev.net/open/curl?url='
,
'GoodsServerUrl'
=>
'http://192.168.1.237:60014'
];
resources/views/script/AddSupplierScript.blade.php
View file @
57bfa062
...
...
@@ -223,7 +223,9 @@
}
else
{
let
msg
=
'确定直接申请审核吗?确定后会直接进入审核中的状态,审核完成前无法进行二次修改'
;
//未上传品质保证协议(代理商则提示为“未上传代理证”),是否需要切换为临时供应商?
layer
.
confirm
(
msg
,
function
(
index
)
{
layer
.
confirm
(
msg
,
{
offset
:
[
'100px'
]
// 第一个参数是距离页面顶部距离
},
function
(
index
)
{
addSupplier
(
data
);
});
}
...
...
resources/views/script/BatchAddSkuTagScript.blade.php
View file @
57bfa062
...
...
@@ -85,10 +85,7 @@
// 检查是否选择了系统标签
if
(
!
data
.
field
.
goods_label_system_tags
||
data
.
field
.
goods_label_system_tags
===
''
)
{
layer
.
msg
(
'请选择系统标签'
,
{
icon
:
5
});
return
false
;
}
return
true
;
...
...
@@ -107,10 +104,7 @@
// 检查是否选择了系统标签
if
(
!
data
.
field
.
goods_source_system_tags
||
data
.
field
.
goods_source_system_tags
===
''
)
{
layer
.
msg
(
'请选择系统标签'
,
{
icon
:
5
});
return
false
;
}
return
true
;
...
...
resources/views/script/SkuListScript.blade.php
View file @
57bfa062
...
...
@@ -156,12 +156,8 @@
}
},
{
field
:
'sku_tags'
,
title
:
'标签'
,
align
:
'center'
,
width
:
150
,
templet
:
function
(
data
)
{
if
(
data
.
invalid_sku_tags
)
{
return
`<span>
${
data
.
valid_sku_tags
}
</span>`
+
` <span style="color: #D7D7D7">
${
data
.
invalid_sku_tags
}
</span>`
;
}
else
{
return
`<span>
${
data
.
valid_sku_tags
}
</span>`
}
field
:
'goods_tag_names'
,
title
:
'标签'
,
align
:
'center'
,
width
:
150
,
templet
:
function
(
data
)
{
return
data
.
goods_tag_names
;
}
},
{
field
:
'ability_level_name'
,
title
:
'履约程度'
,
align
:
'center'
,
width
:
80
,
templet
:
function
(
data
)
{
...
...
resources/views/script/UpdateSupplierScript.blade.php
View file @
57bfa062
...
...
@@ -148,7 +148,9 @@
},
});
}
else
{
layer
.
confirm
(
'确定直接申请审核吗?确定后会直接进入审核中的状态,审核完成前无法进行二次修改'
,
function
(
index
)
{
layer
.
confirm
(
'确定直接申请审核吗?确定后会直接进入审核中的状态,审核完成前无法进行二次修改'
,{
offset
:
[
'100px'
]
// 第一个参数是距离页面顶部距离
},
function
(
index
)
{
updateSupplier
(
data
);
});
}
...
...
@@ -190,4 +192,4 @@
}
});
</script>
\ No newline at end of file
</script>
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