Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录
切换导航
S
shop-new
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
王天霸
shop-new
Commits
0061122d
提交
0061122d
authored
5月 13, 2022
作者:
huaxinzhu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化
上级
c7255ddf
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
43 行增加
和
29 行删除
+43
-29
goodsparameter.vue
src/views/system/goods/add/components/goodsparameter.vue
+25
-11
goodsspecifications.vue
...views/system/goods/add/components/goodsspecifications.vue
+18
-18
没有找到文件。
src/views/system/goods/add/components/goodsparameter.vue
浏览文件 @
0061122d
...
...
@@ -318,7 +318,7 @@
<!-- </template>-->
<
template
slot-scope=
"scope"
>
<el-input
size=
"mini"
v-for=
"(iten,inde) in scope.row.ladder"
:key=
"inde"
style=
"width:90%"
v-model=
"scope.row.ladder[inde].quantity"
placeholder=
"请输入"
@
input=
"upChange"
v-model=
"scope.row.ladder[inde].quantity"
placeholder=
"请输入"
class=
"custom-el-input-con"
></el-input>
</
template
>
</el-table-column>
...
...
@@ -333,7 +333,7 @@
<!-- </template>-->
<
template
slot-scope=
"scope"
>
<el-input
size=
"mini"
v-for=
"(iten,inde) in scope.row.ladder"
:key=
"inde"
style=
"width:90%"
v-model=
"scope.row.ladder[inde].money"
placeholder=
"请输入"
@
input=
"upChange"
v-model=
"scope.row.ladder[inde].money"
placeholder=
"请输入"
class=
"custom-el-input-con"
></el-input>
</
template
>
</el-table-column>
...
...
@@ -342,7 +342,7 @@
<
template
slot-scope=
"scope"
>
<div
class=
"options-price-con"
>
<div>
<div
v-for=
"(iten,inde) in scope.row.ladder"
>
<div
v-for=
"(iten,inde) in scope.row.ladder"
:key=
"inde"
>
<el-button
@
click=
"delTieredPrice1(scope.$index,inde)"
v-if=
"scope.row.ladder.length > 1"
size=
"mini"
type=
"text"
class=
"custom-button-danger"
>
删除
</el-button>
<el-divider
v-if=
"scope.row.ladder.length > 1"
direction=
"vertical"
></el-divider>
</div>
...
...
@@ -427,43 +427,57 @@ export default {
this
.
singleSpecTable
=
this
.
parameterdata
.
singleSpecTable
}
// console.log(439,this.parameterdata)
// 接受 多规格是否启用阶梯定价
this
.
$bus
.
$on
(
"customPriceSpec"
,(
data
)
=>
{
this
.
parameterdata
.
is_ladder_spec
=
data
// 兼容数据处理,如果规格中ladder字段没默认值,则给他拼好
if
(
this
.
parameterdata
.
is_ladder_spec
&&
Array
.
isArray
(
this
.
parameterdata
.
specs_group
)
&&
this
.
parameterdata
.
specs_group
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
this
.
parameterdata
.
specs_group
.
length
;
i
++
)
{
let
ladderItem
=
{
quantity
:
1
,
money
:
0
}
let
specItem
=
this
.
parameterdata
.
specs_group
[
i
]
if
(
specItem
.
ladder
.
length
===
0
)
{
specItem
.
ladder
.
push
(
ladderItem
)
}
}
}
this
.
keyvalue
++
console
.
log
(
"完整数据"
,
this
.
parameterdata
)
})
// 编辑时候/初始化,如果已经开启了阶梯定价,则把值传过去
if
(
this
.
parameterdata
.
is_ladder_spec
)
{
this
.
$bus
.
$emit
(
"initSpecIsLadderVal"
,
this
.
parameterdata
.
is_ladder_spec
)
}
console
.
log
(
"编辑刚加载:"
,
this
.
parameterdata
)
},
beforeDestroy
()
{
this
.
$bus
.
$off
(
'customPriceSpec'
)
},
methods
:
{
upChange
()
{
this
.
keyvalue
++
// this.$forceUpdate()
},
/** 初始化 商品售价 数据 */
initInfo
()
{
this
.
orgGoodsPam
=
{};
},
// 添加阶梯 -- 多规格
addTieredPrice1
(
index
){
let
priceItem
=
{
quantity
:
1
,
money
:
0
}
// this.parameterdata.specs_group[index].ladder.push(priceItem)
this
.
$set
(
this
.
parameterdata
.
specs_group
[
index
].
ladder
,
this
.
parameterdata
.
specs_group
[
index
].
ladder
.
length
,
priceItem
);
this
.
keyvalue
++
},
// 删除阶梯 -- 多规格
delTieredPrice1
(
index
,
inde
)
{
this
.
parameterdata
.
specs_group
[
index
].
ladder
.
splice
(
inde
,
1
)
this
.
keyvalue
++
},
// 添加阶梯
// 添加阶梯
-- 单规格
addTieredPrice
()
{
let
ladderItem
=
{
quantity
:
1
,
money
:
0
}
this
.
parameterdata
.
ladder
.
push
(
ladderItem
)
},
// 删除阶梯
// 删除阶梯
-- 但规格
delTieredPrice
(
index
)
{
this
.
parameterdata
.
ladder
.
splice
(
index
,
1
);
},
...
...
src/views/system/goods/add/components/goodsspecifications.vue
浏览文件 @
0061122d
...
...
@@ -125,6 +125,13 @@ export default {
this
.
speData
=
this
.
specificationsdata
;
this
.
$forceUpdate
()
}
this
.
$bus
.
$on
(
"initSpecIsLadderVal"
,(
data
)
=>
{
this
.
isCustomPriceSpec
=
data
})
},
beforeDestroy
()
{
this
.
$bus
.
$off
(
'initSpecIsLadderVal'
)
},
watch
:{
// 'specificationsdata': {
...
...
@@ -137,9 +144,6 @@ export default {
methods
:
{
switchCustomPriceSpec
()
{
this
.
$bus
.
$emit
(
"customPriceSpec"
,
this
.
isCustomPriceSpec
)
if
(
!
this
.
isCustomPriceSpec
)
{
console
.
log
(
151
,
this
.
specificationsdata
)
}
},
/** 初始化 商品规格数据 */
initInfo
()
{
...
...
@@ -327,6 +331,7 @@ export default {
/** 规格参数 变化时,对数据进行处理后,再进行笛卡尔积算法,最终计算出商品售价的数据 */
specCalcResult
()
{
debugger
// 商品规格原始数据
let
specs_group
=
[]
let
orgSpeData
=
this
.
deepClone
(
this
.
speData
);
...
...
@@ -370,7 +375,7 @@ export default {
// debugger
for
(
let
index
=
0
;
index
<
goodsParametersList
.
length
;
index
++
)
{
var
listobj
=
{};
let
listobj
=
{};
listobj
[
"sc_price"
]
=
""
;
listobj
[
"price"
]
=
""
;
listobj
[
"js_price"
]
=
""
;
...
...
@@ -400,22 +405,17 @@ export default {
this
.
tableData7
[
'specs'
]
=
this
.
speData
this
.
tableData7
[
'shopTypes'
]
=
this
.
cartesian
(
proSpeData
)
this
.
tableData7
[
'isradioguide'
]
=
2
if
(
this
.
isCustomPriceSpec
)
{
this
.
tableData7
.
specs_group
.
forEach
((
item
,
index
)
=>
{
item
[
'ladder'
]
=
[]
let
obj
=
{
quantity
:
1
,
money
:
0
}
item
[
'ladder'
].
push
(
obj
)
})
}
this
.
tableData7
.
specs_group
.
forEach
((
item
,
index
)
=>
{
item
[
'ladder'
]
=
[]
let
obj
=
{
quantity
:
1
,
money
:
0
}
item
[
'ladder'
].
push
(
obj
)
})
this
.
$emit
(
'calcSpeTable'
,
this
.
tableData7
);
// this.switchCustomPriceSpec()
// if (this.tableData7.is_ladder_spec !== undefined) {
// this.tableData7.is_ladder_spec = this.isCustomPriceSpec
// }
console
.
log
(
399
,
this
.
tableData7
)
console
.
log
(
"新生成多数据:"
,
this
.
tableData7
)
}
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论