Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
C
chinafrica
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
chinafrica
Commits
3ae861da
提交
3ae861da
authored
8月 07, 2020
作者:
吴德鹏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改sku bug
上级
dd176d68
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
65 行增加
和
58 行删除
+65
-58
tbcfstationitem.js
platform-admin/src/main/webapp/js/sys/tbcfstationitem.js
+65
-58
没有找到文件。
platform-admin/src/main/webapp/js/sys/tbcfstationitem.js
浏览文件 @
3ae861da
...
...
@@ -95,43 +95,44 @@ let vm = new Vue({
//2020年5月20日 商品参数
paramster
:
[],
show_paste_btn
:
false
,
// 粘贴按钮
paste_modal
:
false
,
showQuitHint
:
false
,
show_paste_btn
:
false
,
// 粘贴按钮
paste_modal
:
false
,
showQuitHint
:
false
,
// 细粒度价格控制,
handleProductAttr_Batch
:[],
handleProductAttr_Batch
:
[],
},
methods
:
{
//保存批量操作价格的数据
saveBatchDataPrice
(
e
)
{
if
(
this
.
batchAmount
&&
this
.
batchCount
)
{
if
(
this
.
batchAmount
&&
this
.
batchCount
)
{
let
_this
=
this
;
function
handlePrice
(){
let
arr
=
[],
combinationArr
=
[],
attr_first
=
''
;
_this
.
handleProductAttr_Batch
.
map
(
item
=>
{
item
.
categoryDescArr
.
map
(
_item
=>
{
_item
.
isSelected
?
arr
.
push
(
_item
.
name
):
void
(
0
);
function
handlePrice
()
{
let
arr
=
[],
combinationArr
=
[],
attr_first
=
''
;
_this
.
handleProductAttr_Batch
.
map
(
item
=>
{
item
.
categoryDescArr
.
map
(
_item
=>
{
_item
.
isSelected
?
arr
.
push
(
_item
.
name
)
:
void
(
0
);
})
})
if
(
_this
.
handleProductAttr_Batch
.
length
===
2
)
{
if
(
_this
.
handleProductAttr_Batch
.
length
===
2
)
{
attr_first
=
arr
.
shift
();
}
arr
.
forEach
(
item
=>
{
if
(
_this
.
handleProductAttr_Batch
.
length
===
2
)
{
arr
.
forEach
(
item
=>
{
if
(
_this
.
handleProductAttr_Batch
.
length
===
2
)
{
combinationArr
.
push
(
attr_first
+
'/'
+
item
);
}
else
{
}
else
{
combinationArr
.
push
(
item
);
}
});
let
str
=
combinationArr
.
join
(
'/'
);
if
(
_this
.
handleProductAttr_Batch
.
length
===
3
)
{
if
(
_this
.
handleProductAttr_Batch
.
length
===
3
)
{
combinationArr
=
[];
combinationArr
.
push
(
str
);
}
_this
.
prevItem
.
map
(
item
=>
{
combinationArr
.
map
(
_item
=>
{
if
(
item
.
skuDesc
===
_item
)
{
_this
.
prevItem
.
map
(
item
=>
{
combinationArr
.
map
(
_item
=>
{
if
(
item
.
skuDesc
===
_item
)
{
item
.
skuCount
=
_this
.
batchCount
;
item
.
skuPrice
=
_this
.
batchAmount
;
_this
.
$forceUpdate
();
...
...
@@ -140,37 +141,38 @@ let vm = new Vue({
})
_this
.
$Message
.
info
(
'应用成功'
);
}
if
(
e
===
'use'
){
if
(
e
===
'use'
)
{
handlePrice
();
}
else
{
}
else
{
handlePrice
();
this
.
showBatch
=
false
;
}
}
else
{
}
else
{
alert
(
'请先设置价格和库存'
);
}
},
handleClickProductAttr_Batch
(
e
,
index
,
parent_index
)
{
if
(
this
.
handleProductAttr_Batch
.
length
===
2
)
{
if
(
parent_index
===
0
)
{
this
.
handleProductAttr_Batch
[
parent_index
].
categoryDescArr
.
map
(
item
=>
item
.
isSelected
=
false
)
handleClickProductAttr_Batch
(
e
,
index
,
parent_index
)
{
if
(
this
.
handleProductAttr_Batch
.
length
===
2
)
{
if
(
parent_index
===
0
)
{
this
.
handleProductAttr_Batch
[
parent_index
].
categoryDescArr
.
map
(
item
=>
item
.
isSelected
=
false
)
this
.
handleProductAttr_Batch
[
parent_index
].
categoryDescArr
[
index
].
isSelected
=
true
;
this
.
$forceUpdate
();
}
else
{
}
else
{
this
.
handleProductAttr_Batch
[
parent_index
].
categoryDescArr
[
index
].
isSelected
=
!
this
.
handleProductAttr_Batch
[
parent_index
].
categoryDescArr
[
index
].
isSelected
;
this
.
$forceUpdate
();
}
}
else
{
this
.
handleProductAttr_Batch
[
parent_index
].
categoryDescArr
.
map
(
item
=>
item
.
isSelected
=
false
)
}
else
{
this
.
handleProductAttr_Batch
[
parent_index
].
categoryDescArr
.
map
(
item
=>
item
.
isSelected
=
false
)
this
.
handleProductAttr_Batch
[
parent_index
].
categoryDescArr
[
index
].
isSelected
=
true
;
this
.
$forceUpdate
();
}
},
//预览
preview
(
e
,
to
)
{
if
(
to
===
'pc'
)
{
preview
(
e
,
to
)
{
if
(
to
===
'pc'
)
{
window
.
open
(
`https://www.afrieshop.com/product_detail?pid=
${
e
}
&from=backstage management system&from_fullPath=
${
window
.
location
.
herf
}
`
,
'_blank'
);
}
else
{
}
else
{
window
.
open
(
`https://m.afrieshop.com/#/home/product?id=
${
e
}
`
,
'_blank'
);
}
},
...
...
@@ -192,6 +194,9 @@ let vm = new Vue({
item
.
isSelected
?
activeImgPath
=
item
.
img_path
:
null
;
});
this
.
allAttributes
.
forEach
(
item
=>
{
console
.
log
(
'456789'
,
item
.
isSelected
)
console
.
log
(
'amount'
,
this
.
batchAmount
)
console
.
log
(
'count'
,
this
.
batchCount
)
if
(
item
.
isSelected
)
{
item
.
amount
=
this
.
batchAmount
;
item
.
count
=
this
.
batchCount
;
...
...
@@ -228,8 +233,8 @@ let vm = new Vue({
},
//显示批量处理模态框
showBatchModel
()
{
this
.
$refs
.
amount
.
$el
.
children
[
1
].
value
=
this
.
batchAmount
=
null
;
this
.
$refs
.
count
.
$el
.
children
[
1
].
value
=
this
.
batchCount
=
null
;
//
this.$refs.amount.$el.children[1].value = this.batchAmount = null;
//
this.$refs.count.$el.children[1].value = this.batchCount = null;
this
.
showBatch
=
true
;
//获取所有具体属性
this
.
allAttributes
=
[];
...
...
@@ -241,18 +246,18 @@ let vm = new Vue({
skuImg
:
null
}));
this
.
handleProductAttr_Batch
=
[];
this
.
attrItem
.
forEach
(
item
=>
{
this
.
attrItem
.
forEach
(
item
=>
{
this
.
handleProductAttr_Batch
.
push
({
categoryDesc
:
item
.
categoryDesc
,
categoryName
:
item
.
categoryName
categoryDesc
:
item
.
categoryDesc
,
categoryName
:
item
.
categoryName
});
})
this
.
handleProductAttr_Batch
.
forEach
(
item
=>
{
this
.
handleProductAttr_Batch
.
forEach
(
item
=>
{
item
.
categoryDesc
=
item
.
categoryDesc
.
split
(
','
);
item
.
categoryDescArr
=
[];
item
.
categoryDesc
.
forEach
(
_item
=>
{
item
.
categoryDesc
.
forEach
(
_item
=>
{
item
.
categoryDescArr
.
push
({
name
:
_item
,
name
:
_item
,
isSelected
:
false
})
})
...
...
@@ -329,7 +334,9 @@ let vm = new Vue({
successCallback
:
function
(
r
)
{
if
(
r
.
code
===
0
)
{
that
.
Goodstype2
=
r
.
list
e
?
setTimeout
(()
=>
{
that
.
changeGoodstype2
()},
0
):
void
(
0
);
e
?
setTimeout
(()
=>
{
that
.
changeGoodstype2
()
},
0
)
:
void
(
0
);
if
(
r
.
list
.
length
===
0
)
{
that
.
tbCfStationItem
.
itemCategorytwo
=
null
}
...
...
@@ -358,7 +365,7 @@ let vm = new Vue({
vm
.
reload
();
},
add
:
function
()
{
window
.
sessionStorage
.
getItem
(
'_copy_product_info'
)
?
this
.
show_paste_btn
=
true
:
void
(
0
);
window
.
sessionStorage
.
getItem
(
'_copy_product_info'
)
?
this
.
show_paste_btn
=
true
:
void
(
0
);
this
.
AttributeImgArr
.
length
=
0
;
this
.
paramster
.
length
=
0
;
this
.
paramster
.
push
(
...
...
@@ -385,7 +392,7 @@ let vm = new Vue({
UE
.
getEditor
(
'itemDesc'
).
setContent
(
""
);
},
update
:
function
(
event
)
{
window
.
sessionStorage
.
getItem
(
'_copy_product_info'
)
?
this
.
show_paste_btn
=
true
:
void
(
0
);
window
.
sessionStorage
.
getItem
(
'_copy_product_info'
)
?
this
.
show_paste_btn
=
true
:
void
(
0
);
this
.
disabledChangeAttribute
=
true
;
this
.
prevItem
=
[];
let
itemId
=
getSelectedRow
(
"#jqGrid"
);
...
...
@@ -424,7 +431,7 @@ let vm = new Vue({
this
.
$set
(
vm
.
tbCfStationItem
,
'tree'
,
this
.
attrItem
)
let
_this
=
this
;
let
_temArr
=
[];
$
(
'#imgWrapper'
).
children
().
each
((
item
,
element
)
=>
{
$
(
'#imgWrapper'
).
children
().
each
((
item
,
element
)
=>
{
_temArr
.
push
(
$
(
element
).
attr
(
'data-img-path'
))
})
vm
.
uploadList
=
_temArr
;
...
...
@@ -932,27 +939,27 @@ let vm = new Vue({
this
.
paramster
=
arr
;
},
//复制
copy
(){
copy
()
{
window
.
sessionStorage
.
setItem
(
'_copy_product_info'
,
JSON
.
stringify
({
search_keyword
:
this
.
tbCfStationItem
.
itemTags
,
tags
:
this
.
isSelectedArr
,
spe
:
this
.
tbCfStationItem
.
supplier
,
catagory
:{
level_one
:
this
.
tbCfStationItem
.
itemCategory
,
level_two
:
this
.
tbCfStationItem
.
itemCategorytwo
,
level_three
:
this
.
tbCfStationItem
.
itemDescritionId
,
search_keyword
:
this
.
tbCfStationItem
.
itemTags
,
tags
:
this
.
isSelectedArr
,
spe
:
this
.
tbCfStationItem
.
supplier
,
catagory
:
{
level_one
:
this
.
tbCfStationItem
.
itemCategory
,
level_two
:
this
.
tbCfStationItem
.
itemCategorytwo
,
level_three
:
this
.
tbCfStationItem
.
itemDescritionId
,
},
product_paramster
:
this
.
paramster
product_paramster
:
this
.
paramster
})
)
this
.
$Message
.
success
(
'复制成功 0.0'
);
},
paste
(){
paste
()
{
this
.
paste_modal
=
true
;
},
comfirmPaste
(){
comfirmPaste
()
{
this
.
paste_modal
=
false
;
this
.
$Message
.
success
(
'粘贴成功 0.0'
);
let
_paste_data
=
null
;
...
...
@@ -966,7 +973,7 @@ let vm = new Vue({
this
.
tbCfStationItem
.
itemDescritionId
=
_paste_data
.
catagory
.
level_three
||
null
;
this
.
paramster
=
_paste_data
.
product_paramster
;
},
quit
(){
quit
()
{
//清除未保存商品的图片
if
(
!
vm
.
tbCfStationItem
.
itemId
)
{
this
.
AttributeImgArr
.
map
((
item
,
index
)
=>
{
...
...
@@ -1004,8 +1011,8 @@ let vm = new Vue({
})
})
},
mounted
(){
this
.
$nextTick
(()
=>
{
mounted
()
{
this
.
$nextTick
(()
=>
{
new
Sortable
(
imgWrapper
,
{
swapThreshold
:
1
,
animation
:
150
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论