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 436ef39a
authored
May 27, 2024
by
zhangquan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
bug修复
1 parent
ab8fbac4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
src/util/gradeData.js
src/views/serviceConfig/components/ServicesTable/index.vue
src/util/gradeData.js
View file @
436ef39
...
@@ -80,12 +80,22 @@ export const handleGradeData = (dataFromApi, salePeriodList = []) => {
...
@@ -80,12 +80,22 @@ export const handleGradeData = (dataFromApi, salePeriodList = []) => {
serviceGrade
,
serviceGrade
,
gradeConfigList
:
[]
gradeConfigList
:
[]
}
}
gradeConfigList
.
forEach
(
item
=>
{
let
_priceGradeNum
=
NP
.
divide
(
gradeConfigList
?.
length
||
0
,
salePeriodList
?.
length
||
0
)
let
{
id
,
servicePeriod
,
maxPrice
,
minPrice
,
priceCoefficient
}
=
item
||
{}
let
_salePeriodNum
=
0
while
(
_salePeriodNum
<
_priceGradeNum
)
{
const
_target
=
gradeConfigList
.
find
(
o
=>
o
.
priceGrade
==
_salePeriodNum
)
let
{
id
,
servicePeriod
,
maxPrice
,
minPrice
,
priceCoefficient
}
=
_target
||
{}
maxPrice
=
NP
.
divide
(
maxPrice
||
0
,
1000000
)
maxPrice
=
NP
.
divide
(
maxPrice
||
0
,
1000000
)
minPrice
=
NP
.
divide
(
minPrice
||
0
,
1000000
)
minPrice
=
NP
.
divide
(
minPrice
||
0
,
1000000
)
_gradeObj
.
gradeConfigList
.
push
({
servicePeriod
,
maxPrice
,
minPrice
,
priceCoefficient
,
id
})
_gradeObj
.
gradeConfigList
.
push
({
servicePeriod
,
priceGrade
:
_salePeriodNum
,
maxPrice
,
minPrice
,
priceCoefficient
,
id
})
})
_salePeriodNum
++
}
// gradeConfigList.forEach(item => {
// let { id, servicePeriod, maxPrice, minPrice, priceCoefficient } = item || {}
// maxPrice = NP.divide(maxPrice || 0, 1000000)
// minPrice = NP.divide(minPrice || 0, 1000000)
// _gradeObj.gradeConfigList.push({ servicePeriod, maxPrice, minPrice, priceCoefficient, id })
// })
salePeriodList
=
salePeriodList
.
sort
(
function
(
a
,
b
)
{
salePeriodList
=
salePeriodList
.
sort
(
function
(
a
,
b
)
{
return
a
-
b
return
a
-
b
})
})
...
...
src/views/serviceConfig/components/ServicesTable/index.vue
View file @
436ef39
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<th
rowspan=
"2"
>
价格区间(万元)
</th>
<th
rowspan=
"2"
>
价格区间(万元)
</th>
<th
rowspan=
"2"
>
价格系数
</th>
<th
rowspan=
"2"
>
价格系数
</th>
<th
colspan=
"2"
v-for=
"(item, index) in tableData.salePeriodData"
:key=
"index"
>
{{
item
.
servicePeriod
}}
年版
</th>
<th
colspan=
"2"
v-for=
"(item, index) in tableData.salePeriodData"
:key=
"index"
>
{{
item
.
servicePeriod
}}
年版
</th>
<th
rowspan=
"2"
>
操作
</th>
<th
rowspan=
"2"
style=
"white-space: nowrap;"
>
操作
</th>
</tr>
</tr>
<tr>
<tr>
<template
v-for=
"(item, index) in tableData.salePeriodData"
>
<template
v-for=
"(item, index) in tableData.salePeriodData"
>
...
@@ -45,10 +45,10 @@
...
@@ -45,10 +45,10 @@
<td
:key=
"eIdx"
>
{{
calcPrice
(
ele
.
standardShelfCost
,
item
.
priceCoefficient
)
}}
</td>
<td
:key=
"eIdx"
>
{{
calcPrice
(
ele
.
standardShelfCost
,
item
.
priceCoefficient
)
}}
</td>
<td
:key=
"eIdx"
>
{{
calcPrice
(
ele
.
standardSalesCost
,
item
.
priceCoefficient
)
}}
</td>
<td
:key=
"eIdx"
>
{{
calcPrice
(
ele
.
standardSalesCost
,
item
.
priceCoefficient
)
}}
</td>
</
template
>
</
template
>
<td
class=
"del-btn"
><span
v-if=
"index > 2"
class=
"btn"
@
click=
"delSection(index)"
>
删除
</span></td>
<td
class=
"del-btn"
><span
v-if=
"index > 2
&& !disabled
"
class=
"btn"
@
click=
"delSection(index)"
>
删除
</span></td>
</tr>
</tr>
<tr>
<tr>
<td
class=
"add-btn"
:colspan=
"tableData.salePeriodData.length * 2 + 3"
><span
class=
"btn"
@
click=
"addSection"
>
新增价格区间
</span></td>
<td
class=
"add-btn"
:colspan=
"tableData.salePeriodData.length * 2 + 3"
><span
v-if=
"!disabled"
class=
"btn"
@
click=
"addSection"
>
新增价格区间
</span></td>
</tr>
</tr>
<tr
class=
"desc-wrap"
>
<tr
class=
"desc-wrap"
>
<td
class=
"desc-td"
:colspan=
"tableData.salePeriodData.length * 2 + 4"
>
<td
class=
"desc-td"
:colspan=
"tableData.salePeriodData.length * 2 + 4"
>
...
...
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