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
You need to sign in or sign up before continuing.
Commit
cb4d42e1
authored
Jun 02, 2026
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
sku列表也支持设置显示列
parent
c4cbb206
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
95 additions
and
0 deletions
app/Http/Controllers/SkuController.php
resources/views/script/SkuListScript.blade.php
resources/views/web/sku/SkuListFilter.blade.php
app/Http/Controllers/SkuController.php
View file @
cb4d42e1
...
...
@@ -7,6 +7,7 @@ use GuzzleHttp\Client;
use
App\Model\LogModel
;
use
App\Model\TagsModel
;
use
App\Model\BrandModel
;
use
App\Model\RedisModel
;
use
Illuminate\Http\Request
;
use
App\Model\IntracodeModel
;
use
App\Model\SupplierLogModel
;
...
...
@@ -67,6 +68,10 @@ class SkuController extends Controller
$intraCodeModel
=
new
IntracodeModel
();
$this
->
data
[
'userCodes'
]
=
$intraCodeModel
->
getSampleEncode
();
$this
->
data
[
'createUserDepartmentList'
]
=
(
new
DepartmentService
())
->
getCreateUserDepartmentListForXmSelect
();
$redis
=
new
RedisModel
();
$hashKey
=
'col_settings:sku_list'
;
$colSettings
=
$redis
->
hget
(
$hashKey
,
$request
->
user
->
userId
);
$this
->
data
[
'colSettings'
]
=
$colSettings
?
$colSettings
:
'{}'
;
return
$this
->
view
(
'供应商日志'
);
}
...
...
resources/views/script/SkuListScript.blade.php
View file @
cb4d42e1
...
...
@@ -12,6 +12,9 @@
let
initCondition
=
{
source_type
:
'all'
};
let
whereCondition
=
initCondition
;
let
type
=
'all'
;
let
colSettingsData
=
{
!!
$colSettings
!!
};
let
colSettingsUserId
=
'{{request()->user->userId}}'
;
let
colSettingsPageKey
=
'sku_list'
;
//点击罗盘筛选
$
(
'.main_filter'
).
click
(
function
()
{
...
...
@@ -187,6 +190,14 @@
{
field
:
'audit_time'
,
title
:
'上传时间'
,
align
:
'center'
,
width
:
150
},
{
field
:
'cp_time'
,
title
:
'上架有效期'
,
align
:
'center'
,
width
:
180
},
];
if
(
colSettingsData
&&
Object
.
keys
(
colSettingsData
).
length
>
0
)
{
for
(
let
i
=
0
;
i
<
cols
.
length
;
i
++
)
{
let
field
=
cols
[
i
].
field
;
if
(
field
&&
colSettingsData
[
field
]
!==
undefined
)
{
cols
[
i
].
hide
=
!
colSettingsData
[
field
];
}
}
}
let
currentPage
=
0
;
table
.
render
({
elem
:
'#skuList'
...
...
@@ -207,6 +218,84 @@
}
});
$
(
"#col_setting"
).
click
(
function
()
{
let
html
=
'
<
div
style
=
"padding: 15px;"
>
';
html += '
<
div
style
=
"margin-bottom: 10px;"
>
';
html += '
<
button
type
=
"button"
class
=
"layui-btn layui-btn-xs layui-btn-info"
id
=
"col_select_all"
>
全选
<
/button>'
;
html
+=
'
<
button
type
=
"button"
class
=
"layui-btn layui-btn-xs layui-btn-danger"
id
=
"col_invert_select"
>
反选
<
/button>'
;
html
+=
'
<
/div>'
;
html
+=
'
<
div
style
=
"max-height: 600px; overflow-y: auto;"
>
';
html += '
<
form
class
=
"layui-form"
lay
-
filter
=
"colSettingForm"
>
'
;
for
(
let
i
=
0
;
i
<
cols
.
length
;
i
++
)
{
if
(
cols
[
i
].
type
===
'checkbox'
)
continue
;
let
field
=
cols
[
i
].
field
;
let
title
=
cols
[
i
].
title
||
''
;
let
checked
=
cols
[
i
].
hide
?
''
:
'checked'
;
html
+=
'
<
div
class
=
"layui-form-item"
style
=
"display:inline-block;width:33%;margin-bottom:5px;"
>
';
html += '
<
input
type
=
"checkbox"
name
=
"' + field + '"
lay
-
skin
=
"primary"
title
=
"' + title + '"
' + checked + '
>
';
html += '
<
/div>'
;
}
html
+=
'
<
/form></
div
><
/div>'
;
layer
.
open
({
type
:
1
,
title
:
'显示列设置'
,
area
:
[
'600px'
,
'600px'
],
content
:
html
,
btn
:
[
'确定'
,
'取消'
],
success
:
function
(
layero
,
index
)
{
form
.
render
(
'checkbox'
,
'colSettingForm'
);
layero
.
find
(
'#col_select_all'
).
on
(
'click'
,
function
()
{
layero
.
find
(
'input[type="checkbox"]'
).
prop
(
'checked'
,
true
);
form
.
render
(
'checkbox'
,
'colSettingForm'
);
});
layero
.
find
(
'#col_invert_select'
).
on
(
'click'
,
function
()
{
layero
.
find
(
'input[type="checkbox"]'
).
each
(
function
()
{
$
(
this
).
prop
(
'checked'
,
!
$
(
this
).
is
(
':checked'
));
});
form
.
render
(
'checkbox'
,
'colSettingForm'
);
});
},
yes
:
function
(
index
,
layero
)
{
let
settings
=
{};
let
checkboxes
=
layero
.
find
(
'input[type="checkbox"]'
);
checkboxes
.
each
(
function
()
{
let
name
=
$
(
this
).
attr
(
'name'
);
let
checked
=
$
(
this
).
is
(
':checked'
);
settings
[
name
]
=
checked
;
});
$
.
ajax
({
url
:
'/api/external/SaveColSettings'
,
type
:
'post'
,
data
:
{
user_id
:
colSettingsUserId
,
page_key
:
colSettingsPageKey
,
settings
:
JSON
.
stringify
(
settings
)
},
dataType
:
'json'
,
async
:
false
});
colSettingsData
=
settings
;
for
(
let
i
=
0
;
i
<
cols
.
length
;
i
++
)
{
let
field
=
cols
[
i
].
field
;
if
(
field
&&
settings
[
field
]
!==
undefined
)
{
cols
[
i
].
hide
=
!
settings
[
field
];
}
}
table
.
reload
(
'skuList'
,
{
cols
:
[
cols
],
page
:
{
curr
:
currentPage
},
where
:
whereCondition
});
layer
.
close
(
index
);
}
});
});
//渲染多选
let
brandSelect
=
xmSelect
.
render
({
el
:
'#brandSelect'
,
...
...
resources/views/web/sku/SkuListFilter.blade.php
View file @
cb4d42e1
...
...
@@ -179,6 +179,7 @@
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn"
lay-submit=
""
lay-filter=
"reset"
>
重置
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn hide_filter_type"
>
隐藏罗盘
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn-normal"
id=
"col_setting"
>
展示列设置
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn show_filter_type"
style=
"display: none"
>
显示罗盘
</button>
...
...
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