Commit 436ef39a by zhangquan

bug修复

1 parent ab8fbac4
......@@ -80,12 +80,22 @@ export const handleGradeData = (dataFromApi, salePeriodList = []) => {
serviceGrade,
gradeConfigList: []
}
gradeConfigList.forEach(item => {
let { id, servicePeriod, maxPrice, minPrice, priceCoefficient } = item || {}
let _priceGradeNum = NP.divide(gradeConfigList?.length || 0, salePeriodList?.length || 0)
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)
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) {
return a - b
})
......
......@@ -6,7 +6,7 @@
<th rowspan="2">价格区间(万元)</th>
<th rowspan="2">价格系数</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>
<template v-for="(item, index) in tableData.salePeriodData">
......@@ -45,10 +45,10 @@
<td :key="eIdx">{{ calcPrice(ele.standardShelfCost, item.priceCoefficient) }}</td>
<td :key="eIdx">{{ calcPrice(ele.standardSalesCost, item.priceCoefficient) }}</td>
</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>
<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 class="desc-wrap">
<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!