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
72560f46
authored
Mar 17, 2026
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
商品型号支持多选
parent
b848949b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
3 deletions
app/Http/Controllers/Api/SkuApiController.php
app/Http/Services/SkuService.php
resources/views/script/SkuListScript.blade.php
resources/views/web/sku/SkuListFilter.blade.php
app/Http/Controllers/Api/SkuApiController.php
View file @
72560f46
...
...
@@ -8,7 +8,6 @@ use App\Http\Services\SkuService;
use
App\Model\SupplierChannelModel
;
use
Illuminate\Support\Facades\Log
;
use
App\Http\Controllers\Controller
;
use
function
GuzzleHttp
\Promise\all
;
use
App\Http\Services\SupplierTagService
;
//通用API,比如获取品牌列表,分类列表等
...
...
app/Http/Services/SkuService.php
View file @
72560f46
...
...
@@ -43,6 +43,7 @@ class SkuService extends BaseService
print_r
(
"<br/>"
);
die
();
}
dd
(
$map
);
try
{
// $return = curl($url, $map, 1);
$url
=
base64_encode
(
$url
.
'?'
.
http_build_query
(
$map
));
...
...
resources/views/script/SkuListScript.blade.php
View file @
72560f46
...
...
@@ -581,6 +581,57 @@
});
//批量搜索商品型号
$
(
document
).
on
(
'click'
,
'#batchGoodsNameSearch'
,
function
()
{
layer
.
open
({
type
:
1
,
title
:
'批量搜索商品型号'
,
area
:
[
'500px'
,
'450px'
],
content
:
'
<
div
style
=
"padding: 20px;"
>
' +
'
<
div
class
=
"layui-form-item"
>
' +
'
<
textarea
id
=
"batchModelInput"
placeholder
=
"请输入型号列表,只支持换行和逗号分隔,最多支持300个型号"
class
=
"layui-textarea"
style
=
"height: 300px;"
><
/textarea>'
+
'
<
/div>'
+
'
<
div
class
=
"layui-form-item"
>
' +
'
<
button
class
=
"layui-btn layui-btn-sm"
id
=
"submitBatchSearch"
>
确认
<
/button>'
+
'
<
/div>'
+
'
<
/div>'
,
success
:
function
(
layero
,
index
)
{
$
(
layero
).
find
(
'#submitBatchSearch'
).
on
(
'click'
,
function
()
{
let
inputText
=
$
(
'#batchModelInput'
).
val
().
trim
();
if
(
!
inputText
)
{
layer
.
msg
(
'请输入型号列表'
);
return
;
}
// 处理输入,只支持换行和逗号分隔
let
models
=
inputText
.
replace
(
/
[\n
,
]
+/g
,
','
).
split
(
','
).
filter
(
item
=>
item
);
if
(
models
.
length
===
0
)
{
layer
.
msg
(
'请输入有效的型号列表'
);
return
;
}
// 去除空白字符
models
=
models
.
map
(
item
=>
item
.
trim
()).
filter
(
item
=>
item
);
// 去重并将处理后的型号用逗号连接
let
uniqueModels
=
[...
new
Set
(
models
)];
// 限制最多300个型号
if
(
uniqueModels
.
length
>
300
)
{
layer
.
msg
(
'最多支持300个型号,已自动截取前300个'
);
uniqueModels
=
uniqueModels
.
slice
(
0
,
300
);
}
let
searchModels
=
uniqueModels
.
join
(
','
);
// 执行搜索操作
// 设置表单值
$
(
'input[name="goods_name_origin/eqs"]'
).
val
(
searchModels
);
// 关闭弹窗
layer
.
close
(
index
);
});
}
});
});
//划过显示成本价格
let
ladderPriceTipsVal
=
''
;
$
(
document
).
on
(
'mouseenter'
,
'.view_ladder_price_cn'
,
function
()
{
...
...
resources/views/web/sku/SkuListFilter.blade.php
View file @
72560f46
...
...
@@ -44,10 +44,12 @@
<div
class=
"layui-row"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
商品型号
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
value=
""
name=
"goods_name
/condition"
placeholder=
"请输入型号
"
autocomplete=
"off"
<div
class=
"layui-input-inline"
style=
"width: 120px"
>
<input
type=
"text"
value=
""
name=
"goods_name
_origin/eqs"
placeholder=
"商品型号,逗号分隔支持多个
"
autocomplete=
"off"
class=
"layui-input"
>
</div>
<button
class=
"layui-btn layui-btn-xs"
style=
"margin-top: 5px;"
type=
"button"
id=
"batchGoodsNameSearch"
>
批量
</button>
</div>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
品牌
</label>
...
...
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