Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-presale
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7bc6fc8b
authored
Aug 27, 2026
by
前端
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'SAAS+V5.8.5' into 'master'
上线合并 See merge request
!97
2 parents
30021037
101f2687
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
35 deletions
src/views/serviceConfig/components/multipleSpecificationForm.vue
src/views/serviceConfig/components/multipleSpecificationForm.vue
View file @
7bc6fc8
...
...
@@ -64,11 +64,11 @@
<td
style=
"white-space: nowrap; text-overflow: ellipsis; overflow: hidden"
v-for=
"(n, idx) in subItem.specsValueList"
:key=
"idx"
:title=
"n"
>
{{
n
}}
</td>
<td>
<!--
@input="handleTypeInput($event, subIndex)"
-->
<!--
使用 subItem.originalIndex 传递原始数组索引,避免索引错位
-->
<el-input
placeholder=
"请输入"
maxlength=
"20"
:disabled=
"routeInfo.type == 2"
size=
"small"
:class=
"
{ 'w-150-per': true, 'border-red': filterEmpty(subItem.insuranceCost)
&&
subItem.insuranceCostEmpty }"
v-model.trim="subItem.insuranceCost" @input="handleKilometersInput($event, subIndex)"
@blur="handleKilometersBlur($event, subIndex)">
v-model.trim="subItem.insuranceCost" @input="handleKilometersInput($event, subI
tem.originalI
ndex)"
@blur="handleKilometersBlur($event, subI
tem.originalI
ndex)">
<el-popover
v-if=
"filterEmpty(subItem.insuranceCost) && subItem.insuranceCostEmpty"
slot=
"suffix"
placement=
"top"
title
width=
"90"
trigger=
"hover"
content=
"投保成本是必填项"
>
<i
class=
"el-icon-warning color-red"
slot=
"reference"
/>
...
...
@@ -79,8 +79,8 @@
<el-input
placeholder=
"请输入"
maxlength=
"20"
:disabled=
"routeInfo.type == 2"
size=
"small"
v-model
.
trim=
"subItem.shelfCost"
:class=
"
{ 'w-150-per': true, 'border-red': filterEmpty(subItem.shelfCost)
&&
subItem.shelfCostEmpty }"
@input="handleWarrantyPeriodInput($event, subIndex)"
@blur="handleWarrantyPeriodBlur($event, subIndex)">
@input="handleWarrantyPeriodInput($event, subI
tem.originalI
ndex)"
@blur="handleWarrantyPeriodBlur($event, subI
tem.originalI
ndex)">
<el-popover
v-if=
"filterEmpty(subItem.shelfCost) && subItem.salesCostEmpty"
slot=
"suffix"
placement=
"top"
title
width=
"90"
trigger=
"hover"
content=
"上架成本是必填项"
>
<i
class=
"el-icon-warning color-red"
slot=
"reference"
/>
...
...
@@ -91,7 +91,7 @@
<el-input
placeholder=
"请输入"
maxlength=
"20"
:disabled=
"routeInfo.type == 2"
size=
"small"
v-model
.
trim=
"subItem.salesCost"
:class=
"
{ 'w-150-per': true, 'border-red': filterEmpty(subItem.salesCost)
&&
subItem.salesCostEmpty }"
@input="handlePurchasePrice($event, subI
ndex)" @blur="handlePurchasePriceBlur($event, sub
Index)">
@input="handlePurchasePrice($event, subI
tem.originalIndex)" @blur="handlePurchasePriceBlur($event, subItem.original
Index)">
<el-popover
v-if=
"filterEmpty(subItem.salesCost) && subItem.salesCostEmpty"
slot=
"suffix"
placement=
"top"
title
width=
"90"
trigger=
"hover"
content=
"嘀加成本是必填项"
>
<i
class=
"el-icon-warning color-red"
slot=
"reference"
/>
...
...
@@ -291,8 +291,21 @@ export default {
...
mapGetters
(
'goodsInfoData'
,
{
goodsInfoData
:
'getGoodsInfoData'
}),
filterStatus
()
{
console
.
log
(
this
.
goodsInfoData
?.
goodsSpecificationList
,
'this.goodsInfoData?.goodsSpecificationList'
)
//过滤禁用状态
return
this
.
goodsInfoData
?
this
.
goodsInfoData
?.
goodsSpecificationList
.
filter
(
item
=>
item
.
useStatus
!=
1
)
:
[]
// 过滤禁用状态,并为每一行添加原始索引(参照 dj-car-life-system 的实现)
if
(
!
this
.
goodsInfoData
?.
goodsSpecificationList
)
return
[]
return
this
.
goodsInfoData
.
goodsSpecificationList
.
map
((
item
,
originalIndex
)
=>
{
// 为每一行添加原始索引,方便模板中使用
if
(
item
.
useStatus
!=
1
)
{
return
{
...
item
,
originalIndex
// 添加原始数组索引
}
}
return
null
})
.
filter
(
item
=>
item
!==
null
)
},
disabledSpecificationName
()
{
return
(
...
...
@@ -561,23 +574,23 @@ export default {
// console.log('changeSpecs')
this
.
computedTableWidth
(
this
.
goodsInfoData
.
goodsType
)
console
.
log
(
this
.
goodsInfoData
,
'goodsInfoData'
)
const
copySpecificationValueList
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
goodsInfoData
.
goodsSpecificationList
)
)
const
copySpecificationValueList
=
deepClone
(
this
.
goodsInfoData
.
goodsSpecificationList
)
const
copyDetailLength
=
this
.
goodsInfoData
.
goodsSpecificationNameList
?.
length
const
copyDetailData
=
this
.
goodsInfoData
.
goodsSpecificationNameList
this
.
goodsInfoData
.
goodsSpecificationList
=
[]
console
.
log
(
copySpecificationValueList
,
'copySpecificationValueList'
)
let
flag
=
true
var
markIdx
=
0
for
(
var
i
=
0
;
i
<
this
.
goodsInfoData
.
specificationDetailList
?.
length
;
i
++
)
{
markIdx
=
0
// 规格名有变化 需清空id
if
(
copyDetailLength
&&
this
.
goodsInfoData
.
specificationDetailList
[
i
]?.
specificationName
!==
copyDetailData
[
i
]?.
specificationName
)
{
console
.
log
(
this
.
goodsInfoData
.
specificationDetailList
[
i
]?.
specificationName
,
copyDetailData
[
i
]?.
specificationName
)
flag
=
false
delete
this
.
goodsInfoData
.
specificationDetailList
[
i
]?.
id
}
for
(
var
j
=
0
;
j
<
this
.
goodsInfoData
.
specificationDetailList
[
i
]?.
specificationValueList
?.
length
;
j
++
)
{
if
(
i
==
0
)
{
// 第一层规格:直接创建新行
this
.
goodsInfoData
.
goodsSpecificationList
.
push
({
id
:
''
,
position
:
[],
...
...
@@ -594,35 +607,50 @@ export default {
shelfCost
:
''
,
// 上架成本,单位元
salesCost
:
''
,
// salesCost
seriesConfigList
:
[],
useStatus
:
0
useStatus
:
0
,
checked
:
false
,
insuranceCostEmpty
:
false
,
shelfCostEmpty
:
false
,
salesCostEmpty
:
false
})
}
else
{
var
targetValLen
=
this
.
goodsInfoData
.
specificationDetailList
[
i
]?.
specificationValueList
?.
length
var
loopNum
=
0
var
tempMarkIdx
=
0
// debugger
if
(
j
==
0
&&
targetValLen
>
1
)
{
var
obj
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
goodsInfoData
.
goodsSpecificationList
))
console
.
log
(
obj
,
'obj'
)
this
.
goodsInfoData
.
goodsSpecificationList
=
[]
obj
.
forEach
(
item
=>
{
for
(
var
k
=
0
;
k
<
targetValLen
;
k
++
)
{
this
.
goodsInfoData
.
goodsSpecificationList
.
push
(
JSON
.
parse
(
JSON
.
stringify
(
item
)))
}
})
// 非第一层规格:需要复制现有行并与新规格值组合
const
targetValLen
=
this
.
goodsInfoData
.
specificationDetailList
[
i
]?.
specificationValueList
?.
length
if
(
j
==
0
)
{
// 第一次进入:复制现有行,为后续规格值做准备
const
currentLength
=
this
.
goodsInfoData
.
goodsSpecificationList
.
length
const
newRows
=
[]
// 复制现有行 targetValLen 次
for
(
let
k
=
0
;
k
<
targetValLen
;
k
++
)
{
this
.
goodsInfoData
.
goodsSpecificationList
.
forEach
(
item
=>
{
newRows
.
push
(
deepClone
({
...
item
,
specsValueList
:
[...
item
.
specsValueList
]
}))
})
}
// 清空并重新赋值
this
.
goodsInfoData
.
goodsSpecificationList
=
newRows
}
loopNum
=
this
.
goodsInfoData
.
goodsSpecificationList
.
length
/
targetValLen
tempMarkIdx
=
markIdx
for
(
var
k
=
0
;
k
<
loopNum
;
k
++
)
{
this
.
goodsInfoData
.
goodsSpecificationList
[
tempMarkIdx
].
specsValueList
.
push
(
this
.
goodsInfoData
.
specificationDetailList
[
i
]?.
specificationValueList
[
j
]?.
specificationValue
)
tempMarkIdx
=
tempMarkIdx
+
targetValLen
// 为当前规格值位置的所有行添加规格值
const
currentLen
=
this
.
goodsInfoData
.
goodsSpecificationList
.
length
const
step
=
Math
.
floor
(
currentLen
/
targetValLen
)
const
startIdx
=
j
*
step
for
(
let
k
=
startIdx
;
k
<
startIdx
+
step
;
k
++
)
{
if
(
this
.
goodsInfoData
.
goodsSpecificationList
[
k
])
{
this
.
goodsInfoData
.
goodsSpecificationList
[
k
].
specsValueList
.
push
(
this
.
goodsInfoData
.
specificationDetailList
[
i
]?.
specificationValueList
[
j
]?.
specificationValue
)
}
}
markIdx
=
markIdx
+
1
}
}
}
this
.
goodsInfoData
.
goodsSpecificationList
.
forEach
(
item
=>
{
for
(
var
i
=
0
;
i
<
copySpecificationValueList
.
length
;
i
++
)
{
var
temp
=
copySpecificationValueList
[
i
]
...
...
@@ -644,6 +672,10 @@ export default {
item
.
useStatus
=
temp
.
useStatus
item
.
seriesConfigList
=
temp
.
seriesConfigList
item
.
specificationData
=
temp
.
specificationData
item
.
checked
=
temp
.
checked
||
false
item
.
insuranceCostEmpty
=
temp
.
insuranceCostEmpty
||
false
item
.
shelfCostEmpty
=
temp
.
shelfCostEmpty
||
false
item
.
salesCostEmpty
=
temp
.
salesCostEmpty
||
false
break
}
}
...
...
@@ -659,7 +691,6 @@ export default {
},
// 校验采购价
handlePurchasePrice
(
newValue
,
index
)
{
// subItem.salesCost) && subItem.salesCostEmpty
newValue
=
newValue
.
replace
(
/
[^\d
.
]
/g
,
''
)
let
oldValue
=
`
${
this
.
goodsInfoData
.
goodsSpecificationList
[
index
][
'oldsalesCost'
]}
`
this
.
$set
(
this
.
goodsInfoData
.
goodsSpecificationList
[
index
],
'salesCost'
,
limitPrice
(
newValue
,
oldValue
,
20
,
2
,
0
))
...
...
@@ -671,7 +702,6 @@ export default {
},
// 质保
handleWarrantyPeriodInput
(
newValue
,
index
)
{
// subItem.shelfCost) && subItem.salesCostEmpty
newValue
=
newValue
.
replace
(
/
[^\d
.
]
/g
,
''
)
let
oldValue
=
`
${
this
.
goodsInfoData
.
goodsSpecificationList
[
index
][
'oldshelfCost'
]}
`
this
.
$set
(
this
.
goodsInfoData
.
goodsSpecificationList
[
index
],
'shelfCost'
,
limitPrice
(
newValue
,
oldValue
,
20
,
2
,
0
))
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment