Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
C
chinafrica
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
chinafrica
Commits
35847f22
提交
35847f22
authored
4月 10, 2020
作者:
潘鹏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
4-10
上级
54027a52
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
225 行增加
和
22 行删除
+225
-22
tbcfstationitem.html
...min/src/main/webapp/WEB-INF/page/sys/tbcfstationitem.html
+128
-14
tbcfstationitem.js
platform-admin/src/main/webapp/js/sys/tbcfstationitem.js
+97
-8
没有找到文件。
platform-admin/src/main/webapp/WEB-INF/page/sys/tbcfstationitem.html
浏览文件 @
35847f22
差异被折叠。
点击展开。
platform-admin/src/main/webapp/js/sys/tbcfstationitem.js
浏览文件 @
35847f22
...
@@ -81,9 +81,90 @@ let vm = new Vue({
...
@@ -81,9 +81,90 @@ let vm = new Vue({
showAttributeImg
:
false
,
//显示属性图片模态框
showAttributeImg
:
false
,
//显示属性图片模态框
AttributeImgArr
:[],
AttributeImgArr
:[],
skuListsIndex
:
null
,
//sku选中索引
skuListsIndex
:
null
,
//sku选中索引
disabledChangeAttribute
:
false
,
//禁止改变商品属性
showBatch
:
false
,
//显示批量操作模态框
selectBtnArr
:[
{
isSelected
:
false
,
title
:
'全选'
},
{
isSelected
:
false
,
title
:
'反选'
},
{
isSelected
:
false
,
title
:
'取消选择'
}
],
allAttributes
:[],
//所有具体属性
batchAmount
:
0
,
batchCount
:
0
},
},
methods
:
{
methods
:
{
changeBatch
(
e
,
flag
){
if
(
flag
===
'amount'
){
this
.
batchAmount
=
e
.
target
.
value
;
}
else
{
this
.
batchCount
=
e
.
target
.
value
;
}
},
saveBatchData
(){
let
activeImgPath
=
''
;
this
.
AttributeImgArr
.
map
(
item
=>
{
item
.
isSelected
?
activeImgPath
=
item
.
img_path
:
null
;
});
this
.
allAttributes
.
forEach
(
item
=>
{
if
(
item
.
isSelected
){
item
.
amount
=
this
.
batchAmount
;
item
.
count
=
this
.
batchCount
;
item
.
skuImg
=
activeImgPath
;
return
false
;
}
})
// console.log(this.allAttributes);
let
prevItemIndex
=
null
;
this
.
prevItem
.
map
(
item
=>
{
this
.
allAttributes
.
map
(
_item
=>
{
if
(
item
.
skuDesc
.
includes
(
_item
.
text
)){
item
.
skuImg
=
_item
.
skuImg
;
item
.
skuPrice
=
_item
.
amount
;
item
.
skuCount
=
_item
.
count
;
return
false
;
}
})
})
console
.
log
(
this
.
prevItem
);
this
.
showBatch
=
false
;
},
//批处理图片选择
BatchSelectImg
(
item
,
index
){
this
.
AttributeImgArr
.
map
(
(
_item
,
_index
)
=>
_item
.
isSelected
=
false
);
this
.
AttributeImgArr
[
index
].
isSelected
=
!
this
.
AttributeImgArr
[
index
].
isSelected
;
},
//批量处理单选属性
selectAttr
(
e
,
index
){
this
.
allAttributes
[
index
].
isSelected
=
!
this
.
allAttributes
[
index
].
isSelected
;
},
//显示批量处理模态框
showBatchModel
(){
this
.
showBatch
=
true
;
//获取所有具体属性
this
.
allAttributes
=
[];
this
.
attrItem
.
map
(
item
=>
item
.
categoryDesc
.
split
(
','
).
map
(
_item
=>
this
.
allAttributes
.
push
({
text
:
_item
,
isSelected
:
false
,
amount
:
null
,
count
:
null
,
skuImg
:
null
}))
);
},
//切换批量选择按钮
changeSelectBtnArr
(
item
,
index
){
this
.
selectBtnArr
.
map
(
(
_item
,
_index
)
=>
_index
!==
index
?
_item
.
isSelected
=
false
:
null
);
this
.
selectBtnArr
[
index
].
isSelected
=
!
this
.
selectBtnArr
[
index
].
isSelected
;
if
(
index
===
0
){
this
.
allAttributes
.
map
(
item
=>
item
.
isSelected
=
true
);
}
else
if
(
index
===
1
){
this
.
allAttributes
.
map
(
item
=>
item
.
isSelected
=
!
item
.
isSelected
);
}
else
{
this
.
allAttributes
.
map
(
item
=>
item
.
isSelected
=
false
);
}
},
selectImg
(
url
){
selectImg
(
url
){
// console.log(this.prevItem[this.skuListsIndex]);
// console.log(this.prevItem[this.skuListsIndex]);
this
.
prevItem
[
this
.
skuListsIndex
].
skuImg
=
url
;
this
.
prevItem
[
this
.
skuListsIndex
].
skuImg
=
url
;
...
@@ -92,8 +173,12 @@ let vm = new Vue({
...
@@ -92,8 +173,12 @@ let vm = new Vue({
},
},
//单条sku选择图片
//单条sku选择图片
HandleSelectAttributeImg
(
e
,
i
){
HandleSelectAttributeImg
(
e
,
i
){
this
.
showAttributeImg
=
true
;
if
(
!
this
.
disabledChangeAttribute
){
this
.
skuListsIndex
=
i
;
window
.
alert
(
'请先确认商品规格后再操作。(确认商品规格后将不可再次编辑规格数据)'
);
}
else
{
this
.
showAttributeImg
=
true
;
this
.
skuListsIndex
=
i
;
}
},
},
//删除属性图片
//删除属性图片
removeAttributeImg
(
e
,
i
){
removeAttributeImg
(
e
,
i
){
...
@@ -115,7 +200,10 @@ let vm = new Vue({
...
@@ -115,7 +200,10 @@ let vm = new Vue({
},
},
//处理属性图片上传成功回调
//处理属性图片上传成功回调
handleAttributeImgSuccess
(
e
){
handleAttributeImgSuccess
(
e
){
this
.
AttributeImgArr
.
push
(
e
);
this
.
AttributeImgArr
.
push
({
img_path
:
e
,
isSelected
:
false
});
console
.
log
(
e
);
console
.
log
(
e
);
// this.delAttributeImg(e);
// this.delAttributeImg(e);
},
},
...
@@ -331,7 +419,8 @@ let vm = new Vue({
...
@@ -331,7 +419,8 @@ let vm = new Vue({
reload
:
function
(
event
)
{
reload
:
function
(
event
)
{
this
.
prevItem
=
[]
this
.
prevItem
=
[]
this
.
attrItem
=
[]
this
.
attrItem
=
[]
this
.
isDisabled
=
false
// this.isDisabled = false
this
.
disabledChangeAttribute
=
false
vm
.
showList
=
true
;
vm
.
showList
=
true
;
let
page
=
$
(
"#jqGrid"
).
jqGrid
(
'getGridParam'
,
'page'
);
let
page
=
$
(
"#jqGrid"
).
jqGrid
(
'getGridParam'
,
'page'
);
$
(
"#jqGrid"
).
jqGrid
(
'setGridParam'
,
{
$
(
"#jqGrid"
).
jqGrid
(
'setGridParam'
,
{
...
@@ -531,7 +620,7 @@ let vm = new Vue({
...
@@ -531,7 +620,7 @@ let vm = new Vue({
return
result
.
map
(
arr
=>
arr
.
join
(
'/'
))
return
result
.
map
(
arr
=>
arr
.
join
(
'/'
))
}
}
//
this.prevItem = [];
this
.
prevItem
=
[];
let
contentArr
=
[]
// 属性通过','分割后的数组
let
contentArr
=
[]
// 属性通过','分割后的数组
this
.
attrItem
.
map
(
item
=>
{
this
.
attrItem
.
map
(
item
=>
{
let
formatter
=
[]
let
formatter
=
[]
...
@@ -544,8 +633,8 @@ let vm = new Vue({
...
@@ -544,8 +633,8 @@ let vm = new Vue({
let
skuName
=
''
//sku组合名
let
skuName
=
''
//sku组合名
let
skuArr
=
[]
let
skuArr
=
[]
contentArr
.
forEach
((
item_a
,
index_a
)
=>
{
contentArr
.
forEach
((
item_a
,
index_a
)
=>
{
skuName
+=
item_a
.
name
+
'/'
skuName
+=
item_a
.
name
+
'/'
;
skuArr
.
push
(
item_a
.
size
)
skuArr
.
push
(
item_a
.
size
)
;
})
})
skuName
=
skuName
.
slice
(
0
,
skuName
.
length
-
1
);
skuName
=
skuName
.
slice
(
0
,
skuName
.
length
-
1
);
...
@@ -600,8 +689,8 @@ let vm = new Vue({
...
@@ -600,8 +689,8 @@ let vm = new Vue({
},
},
/* 保存 */
/* 保存 */
save
()
{
save
()
{
console
.
log
(
this
.
attrItem
);
console
.
log
(
this
.
prevItem
)
//sku组合数组
console
.
log
(
this
.
prevItem
)
//sku组合数组
console
.
log
(
this
.
putaway
)
//是否立即上架
},
},
/* 获取标签数据*/
/* 获取标签数据*/
getTagsData
()
{
getTagsData
()
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论