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
4cef2975
authored
Jun 15, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
优化新增批量主营品牌
parent
01477aa9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
resources/views/script/supplier/SupplierBaseScript.blade.php
resources/views/script/supplier/SupplierBaseScript.blade.php
View file @
4cef2975
...
@@ -275,6 +275,7 @@
...
@@ -275,6 +275,7 @@
let
brandInitValue
=
{
!!
json_encode
(
$brand_init_value
?:[])
!!
};
let
brandInitValue
=
{
!!
json_encode
(
$brand_init_value
?:[])
!!
};
brandSelector
.
setValue
(
brandInitValue
);
brandSelector
.
setValue
(
brandInitValue
);
//批量新增主营品牌
//批量新增主营品牌
$
(
'#batchAddMainBrands'
).
click
(
function
()
{
$
(
'#batchAddMainBrands'
).
click
(
function
()
{
layer
.
open
({
layer
.
open
({
...
@@ -286,6 +287,8 @@
...
@@ -286,6 +287,8 @@
});
});
$
(
'#confirmBatchAddMainBrands'
).
click
(
function
()
{
$
(
'#confirmBatchAddMainBrands'
).
click
(
function
()
{
let
brandValue
=
brandSelector
.
getValue
();
console
.
log
(
brandValue
);
let
standardBrandNames
=
$
(
'#batchAddMainBrandsTextarea'
).
val
();
let
standardBrandNames
=
$
(
'#batchAddMainBrandsTextarea'
).
val
();
//请求接口获取返回的数据,并且合并目前选择的主营品牌,重新渲染xm-select
//请求接口获取返回的数据,并且合并目前选择的主营品牌,重新渲染xm-select
let
res
=
ajax
(
'/api/supplier/getBatchAddMainBrandsData'
,
{
standard_brand_names
:
standardBrandNames
});
let
res
=
ajax
(
'/api/supplier/getBatchAddMainBrandsData'
,
{
standard_brand_names
:
standardBrandNames
});
...
@@ -293,16 +296,16 @@
...
@@ -293,16 +296,16 @@
let
brandNames
=
arrayColumn
(
data
,
'brand_name'
).
join
(
','
)
let
brandNames
=
arrayColumn
(
data
,
'brand_name'
).
join
(
','
)
$
(
'#batchAddMainBrandsBlockQuote'
).
text
(
brandNames
);
$
(
'#batchAddMainBrandsBlockQuote'
).
text
(
brandNames
);
if
(
data
.
length
===
0
)
{
if
(
data
.
length
===
0
)
{
layer
.
msg
(
'没有匹配到有效的标准品牌'
,
{
icon
:
5
});
layer
.
msg
(
'没有匹配到有效的标准品牌'
,
{
icon
:
5
});
return
false
;
return
false
;
}
else
{
}
else
{
brand
InitValue
=
brandInit
Value
.
concat
(
data
);
brand
Value
=
brand
Value
.
concat
(
data
);
brand
InitValue
=
multiArrayUnique
(
brandInit
Value
);
brand
Value
=
multiArrayUnique
(
brand
Value
);
brandSelector
.
setValue
(
brand
Init
Value
);
brandSelector
.
setValue
(
brandValue
);
$
(
'#main_brands'
).
val
(
arrayColumn
(
brand
Init
Value
,
'brand_id'
).
join
(
','
));
$
(
'#main_brands'
).
val
(
arrayColumn
(
brandValue
,
'brand_id'
).
join
(
','
));
$
(
'#batchAddMainBrandsTextarea'
).
val
(
''
);
$
(
'#batchAddMainBrandsTextarea'
).
val
(
''
);
$
(
'#batchAddMainBrandsBlockQuote'
).
text
(
''
);
$
(
'#batchAddMainBrandsBlockQuote'
).
text
(
''
);
layer
.
msg
(
'批量添加主营品牌成功'
,
{
icon
:
6
});
layer
.
msg
(
'批量添加主营品牌成功'
,
{
icon
:
6
});
}
}
});
});
...
...
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