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
6ea2d53e
authored
May 11, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix
parent
e6fcb2d6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
89 additions
and
35 deletions
app/Http/Controllers/Api/CommonApiController.php
resources/views/script/BatchOffShelfScript.blade.php
resources/views/script/SkuListScript.blade.php
app/Http/Controllers/Api/CommonApiController.php
View file @
6ea2d53e
...
...
@@ -73,7 +73,7 @@ class CommonApiController extends Controller
$table
=
$type
==
1
?
'brand'
:
'brand'
;
$db
=
DB
::
connection
(
$connection
)
->
table
(
$table
)
->
where
(
'status'
,
'1'
);
if
(
$brandName
)
{
$db
=
$db
->
where
(
'brand_name'
,
'like'
,
'%'
.
$brandName
.
'%'
);
$db
=
$db
->
where
(
'brand_name'
,
'like'
,
$brandName
.
'%'
);
}
$count
=
$db
->
count
();
$list
=
$db
->
select
(
'brand_name'
,
'brand_id'
)
->
paginate
(
17
);
...
...
resources/views/script/BatchOffShelfScript.blade.php
View file @
6ea2d53e
...
...
@@ -5,40 +5,94 @@
let
element
=
layui
.
element
;
let
xmSelect
=
layui
.
xmSelect
;
//渲染主营品牌的多选
function
getBrandOption
(
element
,
brandType
)
{
let
brandUrl
=
'/api/common/getBrandList?type='
+
brandType
;
let
brandRes
=
ajax
(
brandUrl
);
let
brandList
=
brandRes
.
data
;
return
{
el
:
'#'
+
element
,
filterable
:
true
,
paging
:
true
,
size
:
'small'
,
radio
:
true
,
height
:
'250px'
,
direction
:
'auto'
,
autoRow
:
true
,
prop
:
{
name
:
'brand_name'
,
value
:
'brand_id'
,
},
pageSize
:
30
,
data
:
brandList
,
on
:
function
(
brandList
)
{
let
arr
=
brandList
.
arr
;
let
brandIds
=
''
;
for
(
let
i
in
arr
)
{
brandIds
+=
arr
[
i
].
brand_id
+
','
;
}
let
idName
=
'brand_ids'
;
$
(
'#'
+
idName
).
val
(
brandIds
);
},
};
}
// //渲染主营品牌的多选
// function getBrandOption(element, brandType) {
// let brandUrl = '/api/common/getBrandList?type=' + brandType;
// let brandRes = ajax(brandUrl);
// let brandList = brandRes.data;
// return {
// el: '#' + element,
// filterable: true,
// paging: true,
// size: 'small',
// radio: true,
// height: '250px',
// direction: 'auto',
// autoRow: true,
// prop: {
// name: 'brand_name',
// value: 'brand_id',
// },
// pageSize: 30,
// data: brandList,
// on: function (brandList) {
// let arr = brandList.arr;
// let brandIds = '';
// for (let i in arr) {
// brandIds += arr[i].brand_id + ',';
// }
// let idName = 'brand_ids';
// $('#' + idName).val(brandIds);
// },
// };
// }
//
// let brandOption = getBrandOption('brand_selector', 2);
// xmSelect.render(brandOption);
let
brandOption
=
getBrandOption
(
'brand_selector'
,
2
);
xmSelect
.
render
(
brandOption
);
//渲染多选
let
brandSelect
=
xmSelect
.
render
({
el
:
'#brand_selector'
,
name
:
'brand_id'
,
size
:
'small'
,
searchTips
:
'请输入要查找的制造商'
,
paging
:
true
,
radio
:
true
,
empty
:
'没有查找到数据'
,
prop
:
{
name
:
'brand_name'
,
value
:
'brand_id'
},
height
:
'250px'
,
remoteSearch
:
true
,
autoRow
:
true
,
pageRemote
:
true
,
filterable
:
true
,
remoteMethod
:
function
(
val
,
cb
,
show
,
pageIndex
)
{
//val: 搜索框的内容, 不开启搜索默认为空, cb: 回调函数, show: 当前下拉框是否展开, pageIndex: 当前第几页
$
.
ajax
({
url
:
'/api/common/SearchBrand'
,
type
:
'post'
,
data
:
{
brand_ids
:
$
(
'#brand_ids'
).
val
(),
brand_name
:
val
,
page
:
pageIndex
},
dataType
:
'json'
,
timeout
:
10000
,
success
:
function
(
res
)
{
if
(
!
res
)
return
layer
.
msg
(
'网络错误,请重试'
,
{
icon
:
5
});
if
(
res
.
errcode
===
0
)
{
cb
(
res
.
data
,
res
.
last_page
);
}
else
{
layer
.
msg
(
res
.
errmsg
,
{
icon
:
6
});
}
},
error
:
function
()
{
return
layer
.
msg
(
'网络错误,请重试'
,
{
icon
:
5
});
}
});
},
on
:
function
(
data
)
{
let
brandIds
=
''
;
for
(
let
x
in
data
.
arr
)
// x 为属性名
{
brandIds
=
brandIds
+
data
.
arr
[
x
].
brand_id
+
','
;
}
$
(
"#brand_ids"
).
val
(
brandIds
);
}
});
// brandSelect.setValue(JSON.parse($('#brand_ids').attr('select_value')));
form
.
on
(
'submit(batchOffShelf)'
,
function
(
data
)
{
...
...
resources/views/script/SkuListScript.blade.php
View file @
6ea2d53e
...
...
@@ -55,7 +55,7 @@
"
<
a
class
=
'layui-btn layui-btn-xs'
>
否
<
/a>"
;
}
},
{
field
:
'encoded_user_name'
,
title
:
'内部
人员
'
,
align
:
'center'
,
width
:
100
},
{
field
:
'encoded_user_name'
,
title
:
'内部
采购
'
,
align
:
'center'
,
width
:
100
},
{
field
:
'update_time'
,
title
:
'更新时间'
,
align
:
'center'
,
width
:
150
},
{
field
:
'mpq'
,
title
:
'标准包装量'
,
align
:
'center'
,
width
:
120
},
{
field
:
'batch_sn'
,
title
:
'批次'
,
align
:
'center'
,
width
:
80
},
...
...
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