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
cf85ed34
authored
May 26, 2026
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' into Dev
parents
98aee61f
775542e7
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
243 additions
and
1 deletions
app/Http/Controllers/Api/CommonApiController.php
app/Http/Controllers/SupplierController.php
app/Http/routes.php
config/perm.php
resources/views/script/SupplierListScript.blade.php
resources/views/web/SupplierList.blade.php
storage/framework/views/5238497145456f693cc29f1fe0a7ff8fb43fd269.php
storage/framework/views/d4d13e9bcdea7366e4952031431aae4b22f055c1.php
app/Http/Controllers/Api/CommonApiController.php
View file @
cf85ed34
...
@@ -7,6 +7,7 @@ use App\Http\Services\AdminUserService;
...
@@ -7,6 +7,7 @@ use App\Http\Services\AdminUserService;
use
App\Http\Services\CompanyService
;
use
App\Http\Services\CompanyService
;
use
App\Http\Services\StandardBrandService
;
use
App\Http\Services\StandardBrandService
;
use
App\Model\BrandModel
;
use
App\Model\BrandModel
;
use
App\Model\RedisModel
;
use
App\Model\StandardBrandModel
;
use
App\Model\StandardBrandModel
;
use
App\Model\SupplierChannelModel
;
use
App\Model\SupplierChannelModel
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
...
@@ -120,4 +121,33 @@ class CommonApiController extends Controller
...
@@ -120,4 +121,33 @@ class CommonApiController extends Controller
$this
->
response
(
0
,
'ok'
,
$result
);
$this
->
response
(
0
,
'ok'
,
$result
);
}
}
//保存列表列显示设置
public
function
SaveColSettings
(
Request
$request
)
{
$userId
=
$request
->
input
(
'user_id'
,
0
);
$pageKey
=
$request
->
input
(
'page_key'
,
''
);
$settings
=
$request
->
input
(
'settings'
,
''
);
if
(
empty
(
$userId
)
||
empty
(
$pageKey
)
||
empty
(
$settings
))
{
$this
->
response
(
-
1
,
'参数错误'
);
}
$redis
=
new
RedisModel
();
$hashKey
=
'col_settings:'
.
$pageKey
;
$redis
->
hset
(
$hashKey
,
$userId
,
$settings
);
$this
->
response
(
0
,
'ok'
);
}
//获取列表列显示设置
public
function
GetColSettings
(
Request
$request
)
{
$userId
=
$request
->
input
(
'user_id'
,
0
);
$pageKey
=
$request
->
input
(
'page_key'
,
''
);
if
(
empty
(
$userId
)
||
empty
(
$pageKey
))
{
$this
->
response
(
-
1
,
'参数错误'
);
}
$redis
=
new
RedisModel
();
$hashKey
=
'col_settings:'
.
$pageKey
;
$settings
=
$redis
->
hget
(
$hashKey
,
$userId
);
$this
->
response
(
0
,
'ok'
,
$settings
?
json_decode
(
$settings
,
true
)
:
new
\stdClass
());
}
}
}
app/Http/Controllers/SupplierController.php
View file @
cf85ed34
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
namespace
App\Http\Controllers
;
namespace
App\Http\Controllers
;
use
function
foo
\func
;
use
App\Model\LogModel
;
use
App\Model\LogModel
;
use
App\Model\NationModel
;
use
App\Model\NationModel
;
use
App\Model\RedisModel
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
use
App\Model\IntracodeModel
;
use
App\Model\IntracodeModel
;
use
App\Http\Services\LogService
;
use
App\Http\Services\LogService
;
...
@@ -119,6 +119,12 @@ class SupplierController extends Controller
...
@@ -119,6 +119,12 @@ class SupplierController extends Controller
//获取创建人部门树
//获取创建人部门树
$this
->
data
[
'createUserDepartmentList'
]
=
(
new
DepartmentService
())
->
getCreateUserDepartmentListForXmSelect
();
$this
->
data
[
'createUserDepartmentList'
]
=
(
new
DepartmentService
())
->
getCreateUserDepartmentListForXmSelect
();
//获取列显示设置
$redis
=
new
RedisModel
();
$hashKey
=
'col_settings:supplier_list'
;
$colSettings
=
$redis
->
hget
(
$hashKey
,
$request
->
user
->
userId
);
$this
->
data
[
'colSettings'
]
=
$colSettings
?
$colSettings
:
'{}'
;
return
$this
->
view
(
'供应商列表'
);
return
$this
->
view
(
'供应商列表'
);
}
}
...
...
app/Http/routes.php
View file @
cf85ed34
...
@@ -85,6 +85,8 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Api'], function () {
...
@@ -85,6 +85,8 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Api'], function () {
Route
::
match
([
'get'
,
'post'
],
'/api/external/checkSupplierApply'
,
'ExternalApiController@checkSupplierApply'
);
Route
::
match
([
'get'
,
'post'
],
'/api/external/checkSupplierApply'
,
'ExternalApiController@checkSupplierApply'
);
Route
::
match
([
'get'
,
'post'
],
'/api/external/applySupplier'
,
'ExternalApiController@applySupplier'
);
Route
::
match
([
'get'
,
'post'
],
'/api/external/applySupplier'
,
'ExternalApiController@applySupplier'
);
Route
::
match
([
'get'
,
'post'
],
'/api/external/checkSupplierAccountExist'
,
'ExternalApiController@checkSupplierAccountExist'
);
Route
::
match
([
'get'
,
'post'
],
'/api/external/checkSupplierAccountExist'
,
'ExternalApiController@checkSupplierAccountExist'
);
Route
::
match
([
'get'
,
'post'
],
'/api/external/SaveColSettings'
,
'CommonApiController@SaveColSettings'
);
Route
::
match
([
'get'
,
'post'
],
'/api/external/GetColSettings'
,
'CommonApiController@GetColSettings'
);
});
});
//同步相关的接口
//同步相关的接口
...
...
config/perm.php
View file @
cf85ed34
...
@@ -17,6 +17,8 @@ return [
...
@@ -17,6 +17,8 @@ return [
'BatchUpdateSkuStatus'
,
'BatchUpdateSkuStatus'
,
'GetAuditFlow'
,
'GetAuditFlow'
,
'ViewAccountLog'
,
'ViewAccountLog'
,
'SaveColSettings'
,
'GetColSettings'
,
'TempTemp'
'TempTemp'
]
//不用验证权限的方法
]
//不用验证权限的方法
],
],
...
...
resources/views/script/SupplierListScript.blade.php
View file @
cf85ed34
...
@@ -374,6 +374,24 @@
...
@@ -374,6 +374,24 @@
];
];
cols
.
push
(
cols
.
push
(
);
);
// 列显示设置 - 从后端Redis hash渲染
let
colSettingsData
=
{
!!
$colSettings
!!
};
let
colSettingsUserId
=
'{{request()->user->userId}}'
;
let
colSettingsPageKey
=
'supplier_list'
;
function
applyColSettings
()
{
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
];
}
}
}
}
applyColSettings
();
table
.
render
({
table
.
render
({
elem
:
'#list'
elem
:
'#list'
,
url
:
'/api/supplier/GetSupplierList'
,
url
:
'/api/supplier/GetSupplierList'
...
@@ -462,6 +480,88 @@
...
@@ -462,6 +480,88 @@
admin
.
putTempData
(
"needFreshDetail_supplier_id="
+
supplierId
,
1
);
admin
.
putTempData
(
"needFreshDetail_supplier_id="
+
supplierId
,
1
);
}
}
//列设置
$
(
"#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
;
});
//保存到后端Redis
$
.
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
(
'list'
,
{
cols
:
[
cols
],
page
:
{
curr
:
currentPage
},
where
:
whereCondition
});
layer
.
close
(
index
);
}
});
});
//新增供应商弹窗
//新增供应商弹窗
$
(
"#add_supplier"
).
click
(
function
()
{
$
(
"#add_supplier"
).
click
(
function
()
{
index
.
openTab
({
index
.
openTab
({
...
...
resources/views/web/SupplierList.blade.php
View file @
cf85ed34
...
@@ -82,6 +82,7 @@
...
@@ -82,6 +82,7 @@
@if(checkPerm('ConfirmCrmSupplier') && checkPerm('ViewConfirmSupplier'))
@if(checkPerm('ConfirmCrmSupplier') && checkPerm('ViewConfirmSupplier'))
<button type="
button
" class="
layui
-
btn
layui
-
btn
-
sm
" id="
confirm_crm_supplier
">确认客户转化供应商</button>
<button type="
button
" class="
layui
-
btn
layui
-
btn
-
sm
" id="
confirm_crm_supplier
">确认客户转化供应商</button>
@endif
@endif
<button type="
button
" class="
layui
-
btn
layui
-
btn
-
sm
layui
-
btn
-
normal
" id="
col_setting
">展示列设置</button>
</div>
</div>
<button type="
button
" id="
refreshWindow
" style="
display
:
none
">刷新页面</button>
<button type="
button
" id="
refreshWindow
" style="
display
:
none
">刷新页面</button>
<table class="
layui
-
table
" id="
list
" lay-filter="
list
"></table>
<table class="
layui
-
table
" id="
list
" lay-filter="
list
"></table>
...
...
storage/framework/views/5238497145456f693cc29f1fe0a7ff8fb43fd269.php
View file @
cf85ed34
...
@@ -82,6 +82,7 @@
...
@@ -82,6 +82,7 @@
<?php
if
(
checkPerm
(
'ConfirmCrmSupplier'
)
&&
checkPerm
(
'ViewConfirmSupplier'
))
:
?>
<?php
if
(
checkPerm
(
'ConfirmCrmSupplier'
)
&&
checkPerm
(
'ViewConfirmSupplier'
))
:
?>
<button
type=
"button"
class=
"layui-btn layui-btn-sm"
id=
"confirm_crm_supplier"
>
确认客户转化供应商
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-sm"
id=
"confirm_crm_supplier"
>
确认客户转化供应商
</button>
<?php
endif
;
?>
<?php
endif
;
?>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn-normal"
id=
"col_setting"
>
展示列设置
</button>
</div>
</div>
<button
type=
"button"
id=
"refreshWindow"
style=
"display: none"
>
刷新页面
</button>
<button
type=
"button"
id=
"refreshWindow"
style=
"display: none"
>
刷新页面
</button>
<table
class=
"layui-table"
id=
"list"
lay-filter=
"list"
></table>
<table
class=
"layui-table"
id=
"list"
lay-filter=
"list"
></table>
...
...
storage/framework/views/d4d13e9bcdea7366e4952031431aae4b22f055c1.php
View file @
cf85ed34
...
@@ -374,6 +374,24 @@
...
@@ -374,6 +374,24 @@
];
];
cols
.
push
(
cols
.
push
(
);
);
// 列显示设置 - 从后端Redis hash渲染
let
colSettingsData
=
<?php
echo
$colSettings
;
?>
;
let
colSettingsUserId
=
'
<?php
echo
e
(
request
()
->
user
->
userId
);
?>
';
let colSettingsPageKey = '
supplier_list
'
;
function
applyColSettings
()
{
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
];
}
}
}
}
applyColSettings
();
table
.
render
({
table
.
render
({
elem
:
'#list'
elem
:
'#list'
,
url
:
'/api/supplier/GetSupplierList'
,
url
:
'/api/supplier/GetSupplierList'
...
@@ -462,6 +480,88 @@
...
@@ -462,6 +480,88 @@
admin
.
putTempData
(
"needFreshDetail_supplier_id="
+
supplierId
,
1
);
admin
.
putTempData
(
"needFreshDetail_supplier_id="
+
supplierId
,
1
);
}
}
//列设置
$
(
"#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
;
});
//保存到后端Redis
$
.
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
(
'list'
,
{
cols
:
[
cols
],
page
:
{
curr
:
currentPage
},
where
:
whereCondition
});
layer
.
close
(
index
);
}
});
});
//新增供应商弹窗
//新增供应商弹窗
$
(
"#add_supplier"
).
click
(
function
()
{
$
(
"#add_supplier"
).
click
(
function
()
{
index
.
openTab
({
index
.
openTab
({
...
...
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