Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ElectricitySheep
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄媛媛
ElectricitySheep
Commits
a414c8c0
Commit
a414c8c0
authored
Aug 07, 2020
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
fe367803
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1007 additions
and
1 deletion
+1007
-1
pintuanActive.vue
src/components/pintuan/pintuanActive.vue
+193
-0
pintuanList.vue
src/components/pintuan/pintuanList.vue
+204
-0
goodsSpecifica.vue
src/components/pintuan/pintuanPlugin/goodsSpecifica.vue
+597
-0
pintuanMain.vue
src/components/pintuanMain.vue
+1
-1
index.js
src/router/index.js
+12
-0
No files found.
src/components/pintuan/pintuanActive.vue
0 → 100644
View file @
a414c8c0
<
template
>
<div
class=
"goodsListEdit"
>
<div
class=
"head-title"
>
<span
@
click=
"CommonJump('pintuanList')"
class=
"blue point"
>
拼团活动
</span>
/ 新建活动
</div>
<div
style=
"background:#fff;margin-top:10px;padding:10px 20px 20px"
>
<el-form
class=
"app-batch"
:model=
"addMsg"
:rules=
"rules"
ref=
"addMsg"
label-width=
"180px"
>
<el-row
:gutter=
"24"
>
<el-tabs
v-model=
"activeName"
>
<el-tab-pane
label=
"商品设置"
name=
"first"
>
<el-card
shadow=
"never"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
活动设置
</span>
</div>
<el-row>
<el-col
:span=
"24"
>
<el-form-item
label=
"开始时间"
>
<el-date-picker
v-model=
"addMsg.start_time"
size=
"small"
type=
"datetime"
placeholder=
"选择日期时间"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col
:span=
"24"
>
<el-form-item
label=
"结束时间"
>
<el-date-picker
v-model=
"addMsg.end_time"
size=
"small"
type=
"datetime"
placeholder=
"选择日期时间"
>
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-card>
<el-card
style=
"margin-top:20px"
shadow=
"never"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
商品设置
</span>
</div>
<el-row>
<el-col
:span=
"12"
>
<el-form-item>
<template
slot=
"label"
>
<span>
商品信息获取
</span>
<el-tooltip
class=
"item"
effect=
"dark"
content=
"只能从商城中获取商品信息,且基本信息与商城商品保持一致"
placement=
"top"
>
<i
class=
"el-tooltip el-icon-info"
></i>
</el-tooltip>
</
template
>
<el-button
type=
"text"
>
文字按钮
</el-button>
</el-form-item>
<el-form-item
label=
"商品名称"
prop=
"Name"
>
<el-input
size=
"small"
v-model=
"addMsg.name"
placeholder=
"请输入内容"
maxlength=
"100"
>
</el-input>
</el-form-item>
<el-form-item
label=
"上架状态"
>
<el-switch
active-color=
"#409EFF"
:active-value=
"1"
:inactive-value=
"2"
>
</el-switch>
</el-form-item>
<el-form-item>
<
template
slot=
"label"
>
<span>
排序
</span>
<el-tooltip
class=
"item"
effect=
"dark"
content=
"排序值越小排序越靠前"
placement=
"top"
>
<i
class=
"el-tooltip el-icon-info"
></i>
</el-tooltip>
</
template
>
<el-input
v-model=
"addMsg.Sort"
type=
"number"
min=
"1"
size=
"small"
placeholder=
"请输入内容"
class=
"input-with-select"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-card>
<el-card
style=
"margin-top:20px"
shadow=
"never"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
价格库存
</span>
</div>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"售价"
prop=
"price"
>
<el-input
v-model=
"addMsg.price"
type=
"number"
min=
"1"
size=
"small"
placeholder=
"请输入内容"
class=
"input-with-select"
>
<el-button
slot=
"append"
>
元
</el-button>
</el-input>
</el-form-item>
<el-form-item>
<
template
slot=
"label"
>
<span>
原价
</span>
<el-tooltip
class=
"item"
effect=
"dark"
content=
"以划线形式显示"
placement=
"top"
>
<i
class=
"el-tooltip el-icon-info"
></i>
</el-tooltip>
</
template
>
<el-input
v-model=
"addMsg.original_price"
type=
"number"
:disabled=
"true"
min=
"1"
size=
"small"
placeholder=
"请输入内容"
class=
"input-with-select"
>
<el-button
slot=
"append"
>
元
</el-button>
</el-input>
</el-form-item>
<el-form-item
label=
"商品总库存"
>
<el-input
v-model=
"addMsg.goods_stock"
size=
"small"
placeholder=
"请输入内容"
class=
"input-with-select"
>
</el-input>
</el-form-item>
<el-form-item
label=
"默认规格名"
>
<el-input
v-model=
"addMsg.attr_default_name"
type=
"text"
size=
"small"
placeholder=
"请输入默认规格名"
class=
"input-with-select"
>
</el-input>
</el-form-item>
<el-form-item
label=
"商品规格"
>
<
template
slot=
"label"
>
<span>
商品规格
</span>
<el-tooltip
class=
"item"
effect=
"dark"
content=
"如有颜色、尺码等多种规格,请添加商品规格"
placement=
"top-start"
>
<i
class=
"elzk el-tooltip el-icon-info"
></i>
</el-tooltip>
</
template
>
<goodsSpe></goodsSpe>
</el-form-item>
<el-form-item
label=
"商品货号"
>
<el-input
v-model=
"addMsg.GoodsNumbers"
size=
"small"
placeholder=
"请输入内容"
class=
"input-with-select"
>
</el-input>
</el-form-item>
<el-form-item
label=
"商品重量"
>
<el-input
v-model=
"addMsg.GoodsWeight"
type=
"number"
min=
"1"
size=
"small"
placeholder=
"请输入内容"
class=
"input-with-select"
>
<el-button
slot=
"append"
>
克
</el-button>
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-tab-pane>
<el-tab-pane
lebel=
"阶梯团设置"
>
</el-tab-pane>
<el-tab-pane
lebel=
"分销价设置"
>
</el-tab-pane>
<el-tab-pane
lebel=
"阶梯团设置"
>
</el-tab-pane>
</el-tabs>
</el-row>
</el-form>
<div
class=
"bottom-div"
style=
"margin-top:20px"
>
<el-button
size=
"small"
type=
"primary"
@
click=
"Save('addMsg')"
>
保存
</el-button>
</div>
</div>
<!-- 选择图片 -->
<!-- <el-dialog title="选择文件" :visible.sync="changeState" width="1240px">
<ChooseImg @SelectId="SelectId" :IsMultiple="true"></ChooseImg>
</el-dialog> -->
</div>
</template>
<
script
>
import
ChooseImg
from
"@/components/global/ChooseImg.vue"
;
import
goodsSpe
from
"@/components/pintuan/pintuanPlugin/goodsSpecifica.vue"
export
default
{
components
:
{
ChooseImg
,
goodsSpe
},
data
()
{
return
{
activeName
:
"first"
,
addMsg
:
{
start_time
:
''
,
//开始时间
end_time
:
''
,
//结束时间
name
:
''
,
//商品名称
Sort
:
0
,
//排序
price
:
0
,
//售价
original_price
:
0
,
//原价
goods_stock
:
0
,
//商品总库存
attr_default_name
:
''
,
//默认规格名
},
rules
:
{
// Name: [{
// required: true,
// message: "请输入商品名称",
// trigger: "blur"
// }]
},
};
},
created
()
{},
mounted
()
{
// if (this.$route.query.GoodsId) {
// this.GoodsId = this.$route.query.GoodsId;
// this.getData();
// }
},
methods
:
{
}
};
</
script
>
<
style
>
</
style
>
src/components/pintuan/pintuanList.vue
0 → 100644
View file @
a414c8c0
<
template
>
<div
class=
"pintuanActive"
>
<div
class=
"head-title"
>
拼团活动
<el-button
style=
"float:right;margin-top: -5px;"
size=
"small"
@
click=
"CommonJump('pintuanActive')"
type=
"primary"
>
新建活动
</el-button>
</div>
<div
class=
"content"
>
<div>
<el-tabs
v-model=
"activeName"
@
tab-click=
"handleClick"
>
<el-tab-pane
:dataId=
"0"
label=
"全部"
name=
"first"
></el-tab-pane>
<el-tab-pane
:dataId=
"1"
label=
"未开始"
name=
"second"
></el-tab-pane>
<el-tab-pane
:dataId=
"2"
label=
"进行中"
name=
"third"
></el-tab-pane>
<el-tab-pane
:dataId=
"3"
label=
"已结束"
name=
"fourth"
></el-tab-pane>
<el-tab-pane
:dataId=
"4"
label=
"下架中"
name=
"fifth"
></el-tab-pane>
</el-tabs>
</div>
<div>
<span>
活动时间:
</span>
<el-date-picker
v-model=
"dateList"
@
change=
"msg.pageIndex=1,getList()"
size=
"small"
type=
"datetimerange"
range-separator=
"至"
value-format=
"yyyy-MM-dd HH:mm:ss"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
>
</el-date-picker>
<div
class=
"searchInput"
style=
"width:250px;margin-right: 0px;"
>
<el-input
@
keyup
.
enter
.
native=
"msg.pageIndex=1,getList()"
style=
"display:inline-block;width:225px;height:30px"
placeholder=
"请输入商品名称搜索"
v-model=
"msg.keyword"
@
clear=
"msg.pageIndex=1,getList()"
size=
"small"
clearable
>
</el-input>
<span
@
click=
"msg.pageIndex=1,getList()"
class=
"el-icon-search"
style=
"color:#979dad;font-size:14px;position:relative;top:1px"
></span>
</div>
<span
@
click=
"Clearconditions"
v-if=
"msg.keyword!='' || (dateList && dateList.length>0)"
class=
'blue point'
>
清空筛选条件
</span>
</div>
<div
style=
"margin-top:15px"
>
<el-button
@
click=
"tableSet(4)"
style=
"margin-left:10px;"
size=
"mini"
>
上架
</el-button>
<el-button
@
click=
"tableSet(5)"
style=
"margin-left:10px;"
size=
"mini"
>
下架
</el-button>
<el-button
@
click=
"tableSet(6)"
style=
"margin-left:10px;"
size=
"mini"
>
删除
</el-button>
</div>
<el-table
:data=
"tableData"
v-loading=
"loading"
border
@
selection-change=
"tableSelect"
style=
"width: 100%;margin:20px 0"
>
<el-table-column
type=
"selection"
width=
"55"
>
</el-table-column>
<el-table-column
prop=
"id"
width=
"120"
sortable
label=
"商品ID"
>
</el-table-column>
<el-table-column
label=
"商品名称"
width=
"320"
>
<template
slot-scope=
"scope"
>
<div
class=
"cell"
>
<div
flex=
"box:first"
>
<div
style=
"padding-right:10px;"
>
<div
class=
"app-image"
:style=
"
{backgroundImage:'url(' + scope.row.goods_cover_pic + ')'}">
</div>
<!--
<div
class=
"app-image"
:style=
"
{backgroundImage:'url(' +domainManager().ImageUrl+ scope.row.goods_cover_pic + ')'}">
</div>
-->
</div>
<div
class=
"app-ellipsis"
>
<div
class=
"vue-line-clamp"
style=
"word-break:break-all;-webkit-line-clamp: 2;"
>
{{
scope
.
row
.
goods_name
}}
</div>
</div>
</div>
</div>
</
template
>
</el-table-column>
<el-table-column
prop=
"goods_stock"
label=
"库存"
>
</el-table-column>
<el-table-column
label=
"活动时间"
>
<
template
slot-scope=
"scope"
>
<div
style=
"width:160px;"
>
<div>
{{
scope
.
row
.
open_date
}}
至
</div>
<div>
{{
scope
.
row
.
end_date
}}
</div>
</div>
</
template
>
</el-table-column>
<el-table-column
prop=
"groups"
width=
"200"
label=
"拼团组/拼团价"
>
<
template
slot-scope=
"scope"
>
<div
class=
"cell"
>
<div
flex=
"dir:top"
>
<div
v-for=
"(SubItem,SubIndex) in scope.row.groups"
:key=
"SubIndex"
>
<el-tag
style=
"margin-bottom:10px;"
>
{{
SubItem
.
people_num
}}
人|¥
{{
SubItem
.
price
}}
</el-tag>
</div>
</div>
</div>
</
template
>
</el-table-column>
<el-table-column
prop=
"status_cn"
width=
"100"
label=
"活动状态"
>
<
template
slot-scope=
"scope"
>
<el-tag>
{{
scope
.
row
.
status_cn
}}
</el-tag>
</
template
>
</el-table-column>
<el-table-column
prop=
"address"
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<el-tooltip
class=
"item"
effect=
"dark"
content=
"编辑"
placement=
"top"
>
<img
style=
"width:32px;height:32px;margin:0 10px"
src=
"../../assets/img/userman/edit.png"
alt=
""
>
</el-tooltip>
<el-tooltip
class=
"item"
effect=
"dark"
content=
"活动数据"
placement=
"top"
>
<img
style=
"width:32px;height:32px;margin:0 10px"
src=
"../../assets/img/userman/order.png"
alt=
""
>
</el-tooltip>
</
template
>
</el-table-column>
</el-table>
<el-pagination
style=
"text-align:right"
background
@
current-change=
"handleCurrentChange"
:page-size=
"msg.pageSize"
layout=
"prev, pager, next"
:current-page
.
sync=
"msg.pageIndex"
:total=
"total"
>
</el-pagination>
</div>
</div>
</template>
<
script
>
export
default
{
name
:
"pintuanActive"
,
data
()
{
return
{
//日期数组
dateList
:
[],
activeName
:
'first'
,
msg
:
{
pageIndex
:
1
,
pageSize
:
15
,
keyword
:
''
,
//商品名称
date_start
:
''
,
//开始日期
date_end
:
''
,
//结束日期
},
total
:
0
,
tableData
:
[{
id
:
178355
,
goods_name
:
'日本珂润(Curel)润浸保湿 滋养乳霜 40g 敏感肌专用 神经酰胺护理 抵抗外部刺激'
,
goods_cover_pic
:
'https://cdnimg.iotweixin.com/uploads/mall1285/20200503/979653726a7bc1df0e24464f94b404bd.jpg'
,
open_date
:
'2020-07-26 00:00:00'
,
end_date
:
'2020-10-31 00:00:00'
,
status_cn
:
'进行中'
,
goods_stock
:
276
,
groups
:
[{
people_num
:
2
,
price
:
"180.00"
},
{
people_num
:
3
,
price
:
"175.00"
}
]
}],
loading
:
false
,
}
},
created
()
{
//this.getList();
},
methods
:
{
//获取数据
getList
()
{
if
(
this
.
dateList
&&
this
.
dateList
.
length
>
0
)
{
this
.
msg
.
date_start
=
this
.
dateList
[
0
];
this
.
msg
.
date_end
=
this
.
dateList
[
1
];
}
else
{
this
.
msg
.
date_start
=
''
;
this
.
msg
.
date_end
=
''
;
}
this
.
loading
=
true
;
this
.
apipost
(
"/api/product/GetProductGoodsPageList"
,
this
.
msg
,
res
=>
{
this
.
loading
=
false
;
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
total
=
res
.
data
.
data
.
count
;
let
pageData
=
res
.
data
.
data
.
pageData
;
this
.
tableData
=
pageData
;
}
})
},
// 上架 下架 删除
tableSet
(
num
)
{},
//切换活动状态
handleClick
(
val
)
{
this
.
msg
.
pageIndex
=
1
this
.
getList
();
},
handleCurrentChange
(
val
)
{
this
.
msg
.
pageIndex
=
val
;
this
.
getList
();
},
//清空筛选条件
Clearconditions
()
{
this
.
msg
.
keyword
=
''
;
this
.
dateList
=
[];
this
.
getList
();
},
//单选 全选返回数据
tableSelect
()
{
}
},
};
</
script
>
<
style
>
.pintuanActive
.content
{
background
:
#fff
;
margin-top
:
10px
;
padding
:
20px
;
box-sizing
:
border-box
;
}
.pintuanActive
.app-image
{
background-size
:
cover
;
background-position
:
center
center
;
width
:
50px
;
height
:
50px
;
}
</
style
>
src/components/pintuan/pintuanPlugin/goodsSpecifica.vue
0 → 100644
View file @
a414c8c0
<
style
>
.goodsSpecifica
.app-attr-group
.del-img
{
height
:
20px
;
width
:
20px
;
cursor
:
pointer
;
}
.goodsSpecifica
.app-attr-group
.bg
{
height
:
44px
;
padding
:
0
10px
;
background
:
#f8f8f8
;
}
.regionDig
.regionChoice
.item_b
{
margin-bottom
:
10px
;
}
.goodsSpecifica
.app-attr-group
.bg
{
height
:
44px
;
padding
:
0
10px
;
background
:
#f8f8f8
;
}
.goodsSpecifica
.app-attr-group
{
border
:
1px
solid
#ebeef5
;
padding
:
10px
;
}
.speciDig
.tpl-box
{
width
:
300px
;
height
:
440px
;
}
.speciDig
.tpl-box
.tpl-head
{
padding
:
0
20px
;
font-size
:
15px
;
color
:
#909399
;
margin-bottom
:
10px
;
line-height
:
44px
;
background
:
#f5f7fa
;
}
.speciDig
.tpl-scrollbar
{
height
:
calc
(
440px
-
44px
-
10px
);
}
.speciDig
.tpl-scrollbar
.el-checkbox
{
display
:
-webkit-box
;
display
:
-ms-flexbox
;
display
:
flex
;
-webkit-box-align
:
center
;
-ms-flex-align
:
center
;
align-items
:
center
;
padding
:
10px
0
;
}
</
style
>
<
template
>
<div>
<div
style=
"width:130%"
class=
"goodsSpecifica"
>
<div
class=
"app-attr-group"
>
<div
v-for=
"(item, index) in SpecificationList"
:key=
"index+'3'"
style=
"margin-bottom:16px;"
>
<div
flex=
"dir:left cross:center"
class=
"bg"
>
<span>
规格名:
</span>
<el-input
@
input=
"ggzChange"
v-model=
"item.Name"
size=
"mini"
style=
"width: 94px;margin: 0px 16px;"
>
</el-input>
<el-checkbox
v-show=
"index == 0"
v-model=
"item.EnabledImage"
:true-label=
"1"
:false-label=
"2"
>
规格图片
</el-checkbox>
<div
style=
"margin-left: auto; line-height: 1;"
>
<div
@
click=
"DeleteggModule(item, index)"
class=
"el-image del-img"
>
<img
src=
"../../../assets/img/userman/del1.png"
class=
"el-image__inner"
/>
</div>
</div>
</div>
<div
flex=
"dir:left"
style=
"padding: 0px 10px;margin-top: 16px;"
>
<div
class=
"box-grow-0"
>
规格值:
</div>
<div
flex=
"dir:left"
style=
"flex-wrap: wrap;"
>
<div
v-for=
"(item2,index2) in item.SpecificationValueList"
:key=
"index2+'4'"
class=
"attr-list"
>
<el-input
@
input=
"ggzChange"
size=
"mini"
v-model=
"item2.Name"
width=
"152px"
></el-input>
<i
@
click=
"Deleteggz(item, index, index2)"
class=
"el-icon-error close"
></i>
<div
v-if=
"index == 0 && item.EnabledImage == 1"
flex=
"cross:center main:center"
class=
"img-box"
>
<div
class=
"attr-jt"
></div>
<div
v-if=
"item2.Image == ''"
@
click=
"
openggImg(item, index, item2, index2)
"
class=
"app-attachment"
>
<div
style=
"line-height: normal; display: inline-block;"
>
<span>
+添加图片
</span>
</div>
</div>
<div
v-if=
"item2.Image != ''"
class=
"el-image"
style=
"height: 88px; width: 88px;"
>
<img
:src=
"item2.Image"
style=
"width:100%;height:100%"
/>
</div>
<span
v-if=
"item2.Image != ''"
@
click=
"
DeleteImageUrl(item, index, item2, index2)
"
class=
"el-icon-error close"
></span>
<div
v-if=
"item2.Image != ''"
style=
"position: absolute;"
>
<div
class=
"app-attachment"
>
<el-button
@
click=
"
openggImg(item, index, item2, index2)
"
type=
"primary"
size=
"small"
>
替换
</el-button>
</div>
</div>
</div>
</div>
<div>
<span
@
click=
"addGgz(item, index)"
class=
"blue f12"
>
添加规格值
</span>
</div>
</div>
</div>
</div>
<div
v-if=
"SpecificationList.length
<
6
"
flex=
"dir:left cross:center"
class=
"bg"
>
<el-button
@
click=
"addggModeule"
size=
"small"
>
添加规格模板
</el-button>
<el-button
@
click=
"addggxm"
size=
"small"
>
添加规格项目
</el-button>
<span
style=
"padding-left: 14px;color: rgb(201, 201, 201)"
>
注:规格名最多添加5个
</span>
</div>
</div>
</div>
<div
v-show=
"SpecificationPriceList.length > 0"
style=
"width: 130%; margin-top: 24px;"
>
<div
class=
"app-attr"
>
<div
class=
"box"
>
<!--
<el-checkbox
v-model=
"val2"
>
全选
</el-checkbox>
-->
<el-form-item
label-width=
"90px"
style=
"display:inline-block"
label=
"批量设置"
>
<el-input
style=
"width:100%"
size=
"small"
v-model=
"valpl"
placeholder=
"请输入内容"
class=
"input-with-select"
>
<el-select
style=
"width:120px"
v-model=
"ggpl"
slot=
"prepend"
placeholder=
"请选择"
>
<el-option
label=
"价格"
:value=
"1"
></el-option>
<el-option
label=
"库存"
:value=
"2"
></el-option>
<el-option
label=
"成本价"
:value=
"5"
></el-option>
<el-option
label=
"重量(g)"
:value=
"3"
></el-option>
<el-option
label=
"货号"
:value=
"4"
></el-option>
<el-option
v-if=
"FxState==1"
label=
"返佣总金额"
:value=
"6"
></el-option>
</el-select>
<el-button
@
click=
"ggPlSet"
slot=
"append"
>
确定
</el-button>
</el-input>
</el-form-item>
</div>
<el-table
ref=
"table"
:data=
"SpecificationPriceList"
border
style=
"width: 100%"
@
selection-change=
"TbaleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
>
</el-table-column>
<template
v-for=
"(item, index) in SpecificationList"
>
<el-table-column
:key=
"index+'5'"
:label=
"item.Name"
>
<template
slot-scope=
"scope"
>
<span
v-if=
"index == index2"
v-for=
"(item2, index2) in scope.row.AttrList"
:key=
"index2+'6'"
>
{{
scope
.
row
.
AttrList
[
index2
].
SVName
}}
</span>
</
template
>
</el-table-column>
</template>
<el-table-column
:render-header=
"renderHeader"
label=
"价格"
>
<
template
slot-scope=
"scope"
>
<el-input
v-model=
"scope.row.SellingPrice"
size=
"small"
></el-input>
</
template
>
</el-table-column>
<el-table-column
:render-header=
"renderHeader"
label=
"库存"
>
<
template
slot-scope=
"scope"
>
<el-input
v-model=
"scope.row.InventoryNum"
size=
"small"
></el-input>
</
template
>
</el-table-column>
<el-table-column
:render-header=
"renderHeader"
label=
"成本价"
width=
"90"
>
<
template
slot-scope=
"scope"
>
<el-input
v-model=
"scope.row.CostMoney"
size=
"small"
></el-input>
</
template
>
</el-table-column>
<el-table-column
:render-header=
"renderHeader"
v-if=
"FxState==1"
width=
"120"
label=
"返佣总金额"
>
<
template
slot-scope=
"scope"
>
<el-input
v-model=
"scope.row.Commission"
size=
"small"
></el-input>
</
template
>
</el-table-column>
<el-table-column
label=
"重量(克)"
width=
"90"
>
<
template
slot-scope=
"scope"
>
<el-input
v-model=
"scope.row.GoodsWeight"
size=
"small"
></el-input>
</
template
>
</el-table-column>
<el-table-column
prop=
"address"
label=
"货号"
>
<
template
slot-scope=
"scope"
>
<el-input
v-model=
"scope.row.GoodsNumbers"
size=
"small"
></el-input>
</
template
>
</el-table-column>
</el-table>
</div>
</div>
<!-- 选择规格模板 -->
<el-dialog
custom-class=
"speciDig"
title=
"选择规格模板"
:visible
.
sync=
"speciDig"
width=
"680px"
>
<div
flex=
"dir:left"
>
<div
class=
"tpl-box"
>
<div
class=
"tpl-head"
>
规格名选择
</div>
<div
class=
"tpl-scrollbar el-scrollbar"
>
<el-checkbox
@
change=
"(speciDigActive = index), changeCheckAll(item, index)"
v-for=
"(item, index) in speciList"
v-model=
"item.checkAll"
:key=
"index"
>
{{ item.Name }}
</el-checkbox>
</div>
</div>
<div
class=
"tpl-box"
style=
"margin-left:10px"
>
<div
class=
"tpl-head"
>
规格值选择
</div>
<div
class=
"tpl-scrollbar el-scrollbar"
>
<el-checkbox-group
v-model=
"item.SpecificationValueList"
@
change=
"changeSpeciList(item, index)"
v-for=
"(item, index) in speciList"
:key=
"index"
>
<span
v-if=
"speciDigActive == index"
>
<el-checkbox
style=
"padding-left:10px"
v-for=
"(item2, index1) in item.NewSpecList"
:label=
"item2"
:key=
"index1"
>
{{ item2.Name }}
</el-checkbox>
</span>
</el-checkbox-group>
</div>
</div>
</div>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
size=
"small"
@
click=
"chooseSpecificationValueList"
>
确定选择
</el-button>
</div>
</el-dialog>
</div>
</template>
<
script
>
export
default
{
data
()
{
return
{
SpecificationList
:
[],
//规格数组
SpecificationPriceList
:
[],
ComTreeList
:
[],
memberList2
:
[],
skuList
:
[],
disList2
:
[],
changeState
:
false
,
imgType
:
1
,
imgListIndex1
:
0
,
imgListIndex2
:
0
,
speciDig
:
false
,
speciDigActive
:
-
1
,
valpl
:
""
,
ggpl
:
""
,
FxState
:
0
,
ggplList
:
[],
speciList
:
[],
DropdownList
:
[],
SeparateDistributionType
:
1
,
//待传递给父组件
EnjoyMember
:
1
,
//待传父组件
};
},
created
()
{
},
methods
:
{
// 添加规格模板
addggxm
()
{
let
that
=
this
;
let
obj
=
{
Name
:
""
,
SpecificationValueList
:
[],
Sort
:
that
.
SpecificationList
.
length
+
1
,
Id
:
0
,
EnabledImage
:
2
};
this
.
SpecificationList
.
push
(
obj
);
},
// 修改规格值
ggzChange
()
{
this
.
$forceUpdate
();
this
.
ComTreeList
=
[];
this
.
memberList2
=
[];
this
.
skuList
=
[];
this
.
getSkuData
([],
0
,
this
.
SpecificationList
);
},
getSkuData
(
skuArr
=
[],
i
,
list
)
{
const
testyunx
=
(
skuArr
=
[],
i
,
list
)
=>
{
if
(
list
[
i
])
{
for
(
let
j
=
0
;
j
<
list
[
i
].
SpecificationValueList
.
length
;
j
++
)
{
skuArr
[
i
]
=
{};
if
(
i
<
list
.
length
-
1
)
{
skuArr
[
i
].
SName
=
list
[
i
].
Name
;
skuArr
[
i
].
SVName
=
list
[
i
].
SpecificationValueList
[
j
].
Name
;
skuArr
[
i
].
SVId
=
list
[
i
].
SpecificationValueList
[
j
].
Sort
;
testyunx
(
skuArr
,
i
+
1
,
list
);
// 递归循环
}
else
{
skuArr
[
i
].
SName
=
list
[
i
].
Name
;
skuArr
[
i
].
SVName
=
list
[
i
].
SpecificationValueList
[
j
].
Name
;
skuArr
[
i
].
SVId
=
list
[
i
].
SpecificationValueList
[
j
].
Sort
;
this
.
skuList
.
push
([...
skuArr
]);
// 扩展运算符,连接两个数组
}
}
}
}
testyunx
(
skuArr
,
i
,
list
)
this
.
calcList
(
this
.
skuList
,
this
.
SpecificationList
);
},
calcList
(
list
,
calist
)
{
let
oldArr
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
SpecificationPriceList
))
this
.
SpecificationPriceList
=
[];
let
arrList
=
[];
list
.
forEach
(
item
=>
{
item
.
AttrList
=
[];
item
.
SpecificationSort
=
""
;
item
.
forEach
((
item2
,
index2
)
=>
{
let
obj
=
{
SName
:
item2
.
SName
,
SVName
:
item2
.
SVName
,
SVId
:
item2
.
SVId
};
let
str
=
":"
;
if
(
index2
==
item
.
length
-
1
)
{
str
=
""
;
}
item
.
SpecificationSort
+=
item2
.
SVId
+
str
;
item
.
GoodsNumbers
=
""
;
item
.
GoodsWeight
=
0
;
item
.
InventoryNum
=
0
;
item
.
SellingPrice
=
0
;
item
.
CostMoney
=
0
;
item
.
Commission
=
0
;
item
.
AttrList
.
push
(
obj
);
});
});
list
.
forEach
((
item
,
i
)
=>
{
let
obj
=
{};
obj
=
{
isNoExite
:
true
,
AttrList
:
item
.
AttrList
,
SpecificationSort
:
item
.
SpecificationSort
,
GoodsNumbers
:
item
.
GoodsNumbers
,
GoodsWeight
:
item
.
GoodsWeight
,
InventoryNum
:
item
.
InventoryNum
,
SellingPrice
:
item
.
SellingPrice
,
CostMoney
:
item
.
CostMoney
,
Commission
:
item
.
Commission
};
oldArr
.
forEach
(
val
=>
{
if
(
val
.
SpecificationSort
==
item
.
SpecificationSort
)
{
obj
=
{
isNoExite
:
false
,
AttrList
:
item
.
AttrList
,
SpecificationSort
:
val
.
SpecificationSort
,
GoodsNumbers
:
val
.
GoodsNumbers
,
GoodsWeight
:
val
.
GoodsWeight
,
InventoryNum
:
val
.
InventoryNum
,
SellingPrice
:
val
.
SellingPrice
,
CostMoney
:
val
.
CostMoney
,
Commission
:
val
.
Commission
};
}
})
this
.
SpecificationPriceList
.
push
(
obj
);
let
obj1
=
{
Id
:
i
,
AttrList
:
item
.
AttrList
,
SpecificationSort
:
item
.
SpecificationSort
,
GradeCommissionList
:
[]
};
arrList
.
push
(
obj1
);
});
this
.
calcdis
(
JSON
.
parse
(
JSON
.
stringify
(
arrList
)));
},
calcdis
(
dislist
)
{
let
memberListarray
=
JSON
.
parse
(
JSON
.
stringify
(
dislist
));
let
ComTreeList
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
ComTreeList
));
// this.ComTreeList=[];//无法添加 报错 暂时注释掉
for
(
let
i
=
0
;
i
<
dislist
.
length
;
i
++
)
{
if
(
this
.
SeparateDistributionType
==
2
&&
this
.
ComTreeList
.
length
>
0
)
{
//this.ComTreeList.length为0 的时候 全部为空
if
(
i
<
ComTreeList
.
length
)
{
ComTreeList
.
forEach
((
val
,
z
)
=>
{
if
(
val
.
SpecificationSort
==
dislist
[
i
].
SpecificationSort
)
{
dislist
[
i
].
GradeCommissionList
=
[];
dislist
[
i
].
GradeCommissionList
=
val
.
GradeCommissionList
;
}
})
}
else
{
for
(
let
j
=
0
;
j
<
this
.
DropdownList
.
length
;
j
++
)
{
let
obj
=
{
SpecificationSort
:
dislist
[
i
].
SpecificationSort
,
DistributorGrade
:
this
.
DropdownList
[
j
].
Id
,
OneCommission
:
0
,
TwoCommission
:
0
,
ThreeCommission
:
0
,
Name
:
dislist
[
i
].
Name
};
dislist
[
i
].
GradeCommissionList
.
push
(
obj
);
}
}
}
else
{
for
(
let
j
=
0
;
j
<
this
.
DropdownList
.
length
;
j
++
)
{
let
obj
=
{
SpecificationSort
:
dislist
[
i
].
SpecificationSort
,
DistributorGrade
:
this
.
DropdownList
[
j
].
Id
,
OneCommission
:
0
,
TwoCommission
:
0
,
ThreeCommission
:
0
,
Name
:
dislist
[
i
].
Name
};
dislist
[
i
].
GradeCommissionList
.
push
(
obj
);
}
}
}
for
(
let
i
=
0
;
i
<
memberListarray
.
length
;
i
++
)
{
memberListarray
[
i
].
GradePriceList
=
[];
if
(
this
.
EnjoyMember
==
1
&&
this
.
memberList2
.
length
>
0
)
{
if
(
i
<
this
.
memberList2
.
length
)
{
this
.
memberList2
.
forEach
(
val
=>
{
if
(
val
.
SpecificationSort
==
memberListarray
[
i
].
SpecificationSort
)
{
memberListarray
[
i
].
GradePriceList
=
[];
memberListarray
[
i
].
GradePriceList
=
val
.
GradePriceList
;
}
})
}
else
{
for
(
let
j
=
0
;
j
<
this
.
huiyList
.
length
;
j
++
)
{
let
obj
=
{
MemberGrade
:
this
.
huiyList
[
j
].
Grade
,
MemberPrice
:
0
};
memberListarray
[
i
].
GradePriceList
.
push
(
obj
);
}
}
}
else
{
for
(
let
j
=
0
;
j
<
this
.
huiyList
.
length
;
j
++
)
{
let
obj
=
{
MemberGrade
:
this
.
huiyList
[
j
].
Grade
,
MemberPrice
:
0
};
memberListarray
[
i
].
GradePriceList
.
push
(
obj
);
}
}
}
this
.
disList2
=
JSON
.
parse
(
JSON
.
stringify
(
dislist
));
this
.
memberList2
=
JSON
.
parse
(
JSON
.
stringify
(
memberListarray
));
},
// 删除规格模板
DeleteggModule
(
item
,
index
)
{
this
.
ComTreeList
=
[];
this
.
memberList2
=
[];
this
.
SpecificationList
.
splice
(
index
,
1
);
if
(
this
.
SpecificationList
.
length
==
0
)
{
this
.
SeparateDistributionType
=
1
;
}
this
.
$forceUpdate
();
this
.
skuList
=
[];
this
.
getSkuData
([],
0
,
this
.
SpecificationList
);
},
// 删除规格值
Deleteggz
(
item
,
index
,
index2
)
{
this
.
SpecificationList
[
index
].
SpecificationValueList
.
splice
(
index2
,
1
);
this
.
$forceUpdate
();
if
(
this
.
SpecificationList
[
index
].
SpecificationValueList
.
length
==
0
)
{
this
.
SpecificationList
.
splice
(
index
,
1
);
}
this
.
skuList
=
[];
this
.
getSkuData
([],
0
,
this
.
SpecificationList
);
},
openggImg
(
item
,
index
,
item2
,
index2
)
{
this
.
changeState
=
true
;
this
.
imgType
=
3
;
this
.
imgListIndex1
=
index
;
this
.
imgListIndex2
=
index2
;
},
DeleteImageUrl
(
item
,
index
,
item2
,
index2
)
{
this
.
SpecificationList
[
index
].
SpecificationValueList
[
index2
].
Image
=
""
;
},
// 添加规格值
addGgz
(
item
,
index
)
{
let
obj
=
{
Id
:
0
,
Image
:
""
,
Name
:
""
,
Sort
:
item
.
SpecificationValueList
.
length
+
1
};
this
.
SpecificationList
[
index
].
SpecificationValueList
.
push
(
obj
);
},
addggModeule
()
{
this
.
speciDig
=
true
;
this
.
speciList
.
forEach
(
item
=>
{
item
.
NewSpecList
=
[];
item
.
checkAll
=
false
;
item
.
SpecificationValueList
=
[];
item
.
SpecList
.
forEach
(
val
=>
{
let
obj
=
{
Id
:
item
.
Id
,
Name
:
val
};
item
.
NewSpecList
.
push
(
obj
);
});
});
},
// 全选
changeCheckAll
(
item
,
index
)
{
if
(
item
.
checkAll
)
{
this
.
speciList
[
index
].
SpecificationValueList
=
item
.
NewSpecList
;
}
else
{
this
.
speciList
[
index
].
SpecificationValueList
=
[];
}
this
.
$forceUpdate
();
},
changeSpeciList
(
val
,
index
)
{
this
.
$forceUpdate
();
},
chooseSpecificationValueList
()
{
if
(
!
this
.
SpecificationList
)
{
this
.
SpecificationList
=
[];
}
let
arr
=
[];
this
.
speciList
.
forEach
(
item
=>
{
if
(
item
.
checkAll
)
{
arr
.
push
(
item
);
}
});
this
.
SpecificationList
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
SpecificationList
.
concat
(
arr
))
);
this
.
SpecificationList
.
forEach
((
item
,
index
)
=>
{
item
.
EnabledImage
=
2
;
item
.
Sort
=
index
;
item
.
SpecificationValueList
.
forEach
((
list
,
index2
)
=>
{
list
.
Image
=
""
;
list
.
Sort
=
index2
;
});
});
this
.
ComTreeList
=
[];
this
.
memberList2
=
[]
this
.
skuList
=
[];
this
.
getSkuData
([],
0
,
this
.
SpecificationList
);
this
.
speciDig
=
false
;
},
ggPlSet
()
{
if
(
this
.
ggplList
.
length
==
0
)
{
this
.
Error
(
"至少选择一项!"
);
return
;
}
this
.
SpecificationPriceList
.
forEach
(
item
=>
{
this
.
ggplList
.
forEach
(
list
=>
{
if
(
item
.
Id
==
list
.
Id
)
{
if
(
this
.
ggpl
==
1
)
{
item
.
SellingPrice
=
this
.
valpl
;
}
if
(
this
.
ggpl
==
2
)
{
item
.
InventoryNum
=
this
.
valpl
;
}
if
(
this
.
ggpl
==
3
)
{
item
.
GoodsWeight
=
this
.
valpl
;
}
if
(
this
.
ggpl
==
4
)
{
item
.
GoodsNumbers
=
this
.
valpl
;
}
if
(
this
.
ggpl
==
5
)
{
item
.
CostMoney
=
this
.
valpl
;
}
if
(
this
.
ggpl
==
6
)
{
item
.
Commission
=
this
.
valpl
;
}
}
});
});
},
TbaleSelectionChange
(
val
)
{
this
.
ggplList
=
val
;
},
renderHeader
(
h
,
{
column
})
{
// h即为cerateElement的简写,具体可看vue官方文档
return
h
(
"div"
,
[
h
(
"span"
,
column
.
label
),
h
(
"i"
,
{
class
:
"iconfont icon-xinghao1"
,
style
:
"color:#F56C6C;float:left"
})
]);
},
getSpeciList
()
{
let
msg
=
{
pageIndex
:
1
,
pageSize
:
999
,
Name
:
""
,
Id
:
0
,
Content
:
""
};
this
.
apipost
(
"/api/product/GetProductSpecificationPageList"
,
msg
,
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
let
pageData
=
res
.
data
.
data
.
pageData
;
this
.
speciList
=
pageData
;
this
.
speciList
.
forEach
(
item
=>
{
item
.
NewSpecList
=
[];
item
.
checkAll
=
false
;
item
.
SpecList
.
forEach
(
val
=>
{
let
obj
=
{
Id
:
item
.
Id
,
Name
:
val
};
item
.
NewSpecList
.
push
(
obj
);
});
});
}
});
},
},
mounted
()
{
this
.
getSpeciList
();
}
};
</
script
>
src/components/pintuanMain.vue
View file @
a414c8c0
...
@@ -172,7 +172,7 @@
...
@@ -172,7 +172,7 @@
<li
class=
"menu_item"
:class=
"
{'Fchecked':isChecked=='/pintuanMsg'}" @click="isChecked='/pintuanMsg',CommonJump('pintuanMsg')">
<li
class=
"menu_item"
:class=
"
{'Fchecked':isChecked=='/pintuanMsg'}" @click="isChecked='/pintuanMsg',CommonJump('pintuanMsg')">
<i
class=
"el-icon-menu"
></i><span>
消息通知
</span>
<i
class=
"el-icon-menu"
></i><span>
消息通知
</span>
</li>
</li>
<li
class=
"menu_item"
:class=
"
{'Fchecked':isChecked=='/
AppletPublishing'}" @click="isChecked='/AppletPublishing',CommonJump('AppletPublishing
')">
<li
class=
"menu_item"
:class=
"
{'Fchecked':isChecked=='/
pintuanList'}" @click="isChecked='/pintuanList',CommonJump('pintuanList
')">
<i
class=
"el-icon-menu"
></i><span>
拼团活动
</span>
<i
class=
"el-icon-menu"
></i><span>
拼团活动
</span>
</li>
</li>
<li
class=
"menu_item"
:class=
"
{'Fchecked':isChecked==4}" @click="isChecked=4">
<li
class=
"menu_item"
:class=
"
{'Fchecked':isChecked==4}" @click="isChecked=4">
...
...
src/router/index.js
View file @
a414c8c0
...
@@ -806,6 +806,18 @@ export default new Router({
...
@@ -806,6 +806,18 @@ export default new Router({
path
:
'/pintuanMsg'
,
path
:
'/pintuanMsg'
,
name
:
'pintuanMsg'
,
name
:
'pintuanMsg'
,
component
:
resolve
=>
require
([
'@/components/pintuan/pintuanMsg'
],
resolve
),
component
:
resolve
=>
require
([
'@/components/pintuan/pintuanMsg'
],
resolve
),
},
//拼团 拼团活动-列表
{
path
:
'/pintuanList'
,
name
:
'pintuanList'
,
component
:
resolve
=>
require
([
'@/components/pintuan/pintuanList'
],
resolve
),
},
//拼团 拼团活动
{
path
:
'/pintuanActive'
,
name
:
'pintuanActive'
,
component
:
resolve
=>
require
([
'@/components/pintuan/pintuanActive'
],
resolve
),
}
}
]
]
}
}
...
...
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