Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
C
chinafrica
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
chinafrica
Commits
6a59975a
提交
6a59975a
authored
4月 11, 2020
作者:
潘鹏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
4-11
上级
35847f22
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
69 行增加
和
42 行删除
+69
-42
tbcfstationitem.html
...min/src/main/webapp/WEB-INF/page/sys/tbcfstationitem.html
+20
-10
tbcfstationitem.js
platform-admin/src/main/webapp/js/sys/tbcfstationitem.js
+49
-32
没有找到文件。
platform-admin/src/main/webapp/WEB-INF/page/sys/tbcfstationitem.html
浏览文件 @
6a59975a
...
...
@@ -85,6 +85,11 @@
justify-content
:
start
;
margin-bottom
:
10px
;
}
.container
.prev-li
img
{
cursor
:
pointer
;
object-fit
:
cover
;
border-radius
:
4px
;
}
.ivu-tag
{
padding
:
2px
8px
;
...
...
@@ -330,12 +335,13 @@
justify-content
:
flex-start
;
}
.attribute-img
{
width
:
20
0px
;
height
:
20
0px
;
width
:
15
0px
;
height
:
15
0px
;
position
:
relative
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
cursor
:
pointer
;
}
.attribute-img
>
.attribute-img-remove-icon
{
width
:
40px
;
...
...
@@ -371,8 +377,8 @@
box-shadow
:
2px
2px
2px
#eee
;
}
.attribute-sku-tag-active
{
box-shadow
:
2px
2px
2px
rgba
(
255
,
0
,
0
,
0.3
)
;
border-color
:
rgba
(
255
,
0
,
0
,
0.5
)
;
box-shadow
:
2px
2px
2px
#1ab394
;
border-color
:
#1ab394
;
}
.attr-img
{
width
:
58px
;
...
...
@@ -710,11 +716,15 @@
<div
class=
"attribute-img-lists"
>
<div
class=
"attribute-img"
v-for=
"(element,index) in AttributeImgArr"
>
<div
class=
"attribute-img-remove-icon"
>
<Icon
size=
"20"
type=
"ios-eye-outline"
></Icon>
<!-- <Icon size="20" type="ios-eye-outline" ></Icon>-->
<i></i>
<Icon
size=
"20"
type=
"ios-trash-outline"
@
click=
"removeAttributeImg(element.img_path,index)"
></Icon>
</div>
<img
:src=
"element.img_path"
@
click=
"selectImg(element.img_path)"
>
</div>
<div
class=
"attribute-img"
@
click=
"cancelSelectImg"
>
<img
title=
"取消选择"
src=
"http://ku.90sjimg.com/element_origin_min_pic/01/47/26/835743e2ba5da85.jpg"
width=
"100%"
height=
"100%"
/>
</div>
</div>
<div
class=
"attribute-img-upload"
>
<Upload
...
...
@@ -790,11 +800,11 @@
</div>
<div>
<h3
style=
"margin:20px 0;"
>
属性价格
</h3>
<i-input
type=
"number"
@
on-change=
"changeBatch($event,'amount')"
placeholder=
"属性价格"
/>
<i-input
type=
"number"
ref=
"amount"
@
on-change=
"changeBatch($event,'amount')"
placeholder=
"属性价格"
/>
</div>
<div>
<h3
style=
"margin:20px 0;"
>
属性库存
</h3>
<i-input
type=
"number"
@
on-change=
"changeBatch($event,'count')"
placeholder=
"属性库存"
/>
<i-input
type=
"number"
ref=
"count"
@
on-change=
"changeBatch($event,'count')"
placeholder=
"属性库存"
/>
</div>
<div
class=
"confirm-btn"
>
<i-button
type=
"primary"
@
click=
"saveBatchData()"
>
保存
</i-button>
...
...
@@ -806,7 +816,7 @@
确定商品规格
</i-button>
<!-- 预览 -->
<section
class=
"form-prev"
>
<h4>
预览
</h4>
<transition-group
tag=
"ul"
name=
"slide"
>
...
...
@@ -835,7 +845,7 @@
</li>
</transition-group>
</section>
<i-button
style=
"margin-left:10px;"
type=
"primary"
@
click=
'save'
>
保存
</i-button
>
<!-- <i-button style="margin-left:10px;" type="primary" @click='save'>保存</i-button>--
>
</section>
</Card>
...
...
@@ -855,7 +865,7 @@
</Form-item>
<Form-item>
<i-button
type=
"primary"
@
click=
"handleSubmit('formValidate')"
>
提交
</i-button>
<i-button
type=
"warning"
@
click=
"
reload
"
style=
"margin-left: 8px"
/>
<i-button
type=
"warning"
@
click=
"
back()
"
style=
"margin-left: 8px"
/>
返回
</i-button>
<i-button
type=
"ghost"
@
click=
"handleReset('formValidate')"
style=
"margin-left: 8px"
>
重置
</i-button>
</Form-item>
...
...
platform-admin/src/main/webapp/js/sys/tbcfstationitem.js
浏览文件 @
6a59975a
...
...
@@ -94,6 +94,10 @@ let vm = new Vue({
batchCount
:
0
},
methods
:
{
cancelSelectImg
(){
this
.
prevItem
[
this
.
skuListsIndex
].
skuImg
=
null
;
this
.
showAttributeImg
=
false
;
},
changeBatch
(
e
,
flag
){
if
(
flag
===
'amount'
){
this
.
batchAmount
=
e
.
target
.
value
;
...
...
@@ -101,6 +105,7 @@ let vm = new Vue({
this
.
batchCount
=
e
.
target
.
value
;
}
},
//批量操作
saveBatchData
(){
let
activeImgPath
=
''
;
this
.
AttributeImgArr
.
map
(
item
=>
{
...
...
@@ -114,25 +119,28 @@ let vm = new Vue({
return
false
;
}
})
// console.log(this.allAttributes);
let
prevItemIndex
=
null
;
this
.
prevItem
.
map
(
item
=>
item
.
isSelected
=
false
);
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
;
if
(
_item
.
isSelected
&&
item
.
skuDesc
.
includes
(
_item
.
text
)){
item
.
isSelected
=
true
;
console
.
log
(
item
,
_item
,
'00'
);
}
})
})
console
.
log
(
this
.
prevItem
);
this
.
prevItem
.
map
(
(
item
,
index
)
=>
{
if
(
item
.
isSelected
){
item
.
skuImg
=
activeImgPath
;
item
.
skuPrice
=
this
.
batchAmount
;
item
.
skuCount
=
this
.
batchCount
;
}
})
this
.
prevItem
.
map
(
item
=>
delete
item
.
isSelected
);
this
.
showBatch
=
false
;
},
//批处理图片选择
BatchSelectImg
(
item
,
index
){
this
.
AttributeImgArr
.
map
(
(
_item
,
_index
)
=>
_item
.
isSelected
=
false
);
this
.
AttributeImgArr
.
map
(
(
_item
,
_index
)
=>
index
!==
_index
?
_item
.
isSelected
=
false
:
null
);
this
.
AttributeImgArr
[
index
].
isSelected
=
!
this
.
AttributeImgArr
[
index
].
isSelected
;
},
//批量处理单选属性
...
...
@@ -141,6 +149,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
.
showBatch
=
true
;
//获取所有具体属性
this
.
allAttributes
=
[];
...
...
@@ -181,12 +191,12 @@ let vm = new Vue({
}
},
//删除属性图片
removeAttributeImg
(
e
,
i
){
removeAttributeImg
(
e
,
i
,
notShowMessage
){
this
.
$delete
(
this
.
AttributeImgArr
,
i
);
this
.
delAttributeImg
(
e
);
this
.
delAttributeImg
(
e
,
notShowMessage
);
},
//删除图片
delAttributeImg
(
url
){
delAttributeImg
(
url
,
notShowMessage
){
Ajax
.
request
({
url
:
"../api/upload/delFile?url="
+
url
,
async
:
false
,
...
...
@@ -194,7 +204,7 @@ let vm = new Vue({
contentType
:
"application/json"
,
successCallback
:
function
(
resultData
)
{
// console.log(resultData);
iview
.
Message
.
success
(
resultData
.
success
)
;
!
notShowMessage
?
iview
.
Message
.
success
(
resultData
.
success
):
null
;
}
});
},
...
...
@@ -256,11 +266,13 @@ let vm = new Vue({
vm
.
tbCfStationItem
=
{};
this
.
uploadList
.
length
=
0
;
this
.
uploadList1
.
length
=
0
;
this
.
disabledChangeAttribute
=
false
;
// vm.tbCfStationItem.itemImg = "";
UE
.
getEditor
(
'itemDesc'
).
setContent
(
""
);
},
update
:
function
(
event
)
{
this
.
prevItem
=
[]
this
.
disabledChangeAttribute
=
true
;
this
.
prevItem
=
[];
let
itemId
=
getSelectedRow
(
"#jqGrid"
);
if
(
itemId
==
null
)
{
return
;
...
...
@@ -283,7 +295,7 @@ let vm = new Vue({
vm
.
tbCfStationItem
.
itemImg
=
vm
.
uploadList
.
map
(
res
=>
res
).
join
(
';'
);
vm
.
tbCfStationItem
.
itemDesc
=
encodeURI
(
UE
.
getEditor
(
'itemDesc'
).
getContent
());
// 富文本取值
vm
.
tbCfStationItem
.
itemDesc
=
vm
.
tbCfStationItem
.
itemDesc
.
replace
(
/ /g
,
" "
);
vm
.
tbCfStationItem
.
skuImgs
=
vm
.
AttributeImgArr
.
map
(
item
=>
item
.
img_path
).
join
(
';'
);
let
url
=
vm
.
tbCfStationItem
.
itemId
==
null
?
"../tbcfstationitem/save"
:
"../tbcfstationitem/update"
;
Ajax
.
request
({
url
:
url
,
...
...
@@ -292,7 +304,7 @@ let vm = new Vue({
data
:
{
putaway
:
_this
.
putaway
,
prevItem
:
vm
.
prevItem
,
itemDesc
:
itemDesc
itemDesc
:
itemDesc
,
},
contentType
:
"application/json"
,
successCallback
:
function
(
r
)
{
...
...
@@ -340,6 +352,7 @@ let vm = new Vue({
});
},
getInfo
:
function
(
itemId
)
{
this
.
AttributeImgArr
=
[];
// this.isDisabled = true
let
_this
=
this
Ajax
.
request
({
...
...
@@ -370,6 +383,12 @@ let vm = new Vue({
skuCode
:
item
.
skuCode
})
})
r
.
tbCfStationItem
.
item
.
skuImgs
.
split
(
';'
).
map
(
item
=>
{
vm
.
AttributeImgArr
.
push
({
img_path
:
item
,
isSelected
:
false
})
})
console
.
log
(
r
)
})()
vm
.
tbCfStationItem
=
r
.
tbCfStationItem
.
item
;
...
...
@@ -416,6 +435,18 @@ let vm = new Vue({
});
},
back
(){
//清除未保存商品的图片
if
(
!
vm
.
tbCfStationItem
.
itemId
){
this
.
AttributeImgArr
.
map
(
(
item
,
index
)
=>
{
this
.
delAttributeImg
(
item
.
img_path
,
true
);
})
setTimeout
(()
=>
{
this
.
AttributeImgArr
=
[];
},
0
)
}
this
.
reload
();
},
reload
:
function
(
event
)
{
this
.
prevItem
=
[]
this
.
attrItem
=
[]
...
...
@@ -647,20 +678,6 @@ let vm = new Vue({
skuCount
:
this
.
default_count
})
})
// var temp = [];
// let _this = this;
// function deWeightTwo() {
// _this.prevItem.forEach(function(a) {
// var check = temp.every(function(b) {
// return a.skuDesc !== b.skuDesc;
// })
// check ? temp.push(a) : ''
// })
// return temp;
// }
// var newArr2 = deWeightTwo();
// console.log('%c%s', 'color:red;', '方法二:es5,newArr2', newArr2);
//显示回显数据
if
(
this
.
tmdSkudata
)
{
this
.
prevItem
.
map
(
item
=>
{
...
...
@@ -780,5 +797,5 @@ let vm = new Vue({
this
.
serverSkuAttr
.
push
(
item
.
categoryDesc
)
})
})
}
}
,
});
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论