Commit 436ef39a by zhangquan

bug修复

1 parent ab8fbac4
...@@ -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
}) })
......
...@@ -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">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!