装备率提交
This commit is contained in:
parent
27174ef1bf
commit
8840f294e8
|
|
@ -23,12 +23,12 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="总得分" >
|
||||
<!-- <el-table-column label="总得分" >
|
||||
<template #default="{ row }">
|
||||
{{ (Number(row.valueA || 0) + Number(row.valueB || 0) + Number(row.valueC || 0)).toFixed(2) }}
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column prop="valueA" label="线路设备配置率">
|
||||
<template #default="{ row }">
|
||||
<span class="link" @click="handleDrill(row, 0)">{{ row.valueA }}</span>
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
{{ scope.$index + 1 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="process" label="工序" width="80" /> -->
|
||||
<el-table-column prop="combinedName" label="装备类目" width="120" />
|
||||
<el-table-column prop="name" label="装备名称" width="120" />
|
||||
<el-table-column label="基本配置标准(台/套)" min-width="120" align="center">
|
||||
<el-table-column prop="standard" label="标准" />
|
||||
|
|
@ -33,9 +33,12 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="rent" label="租赁装备数量" width="120">
|
||||
<template #default="{ row }">
|
||||
<span class="cell-yellow">{{ row.rent }}</span>
|
||||
</template>
|
||||
<template #default="{ row }">
|
||||
<span class="cell-yellow">
|
||||
{{ (Number(row.rent) || 0) + (Number(row.orderCount) || 0) || '' }}
|
||||
</span>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column prop="ifExist" label="装备实际配置率" width="130" >
|
||||
<template #default="{ row }">
|
||||
|
|
@ -66,25 +69,38 @@ const headerCellStyle = {
|
|||
color: '#fff',
|
||||
textAlign: 'center'
|
||||
}
|
||||
function calculateActual(row) {
|
||||
const standard = parseFloat(row.standard);
|
||||
const own = parseFloat(row.own || 0);
|
||||
const rent = parseFloat(row.rent || 0);
|
||||
const value = parseFloat(row.value);
|
||||
const orderCount = parseFloat(row.orderCount);
|
||||
const ifExist = row.ifExist;
|
||||
function calculateActual(row) {
|
||||
const standard = parseFloat(row.standard);
|
||||
const own = parseFloat(row.own || 0);
|
||||
let rent = parseFloat(row.rent || 0);
|
||||
const value = parseFloat(row.value); // 配置率满分值
|
||||
const orderCount = parseFloat(row.orderCount || 0);
|
||||
const ifExist = row.ifExist;
|
||||
|
||||
rent = rent + orderCount;
|
||||
|
||||
if (!standard || standard === 0 || isNaN(value)) return '0';
|
||||
|
||||
const ratio = (own + rent * 0.6 + orderCount * 0.9) / standard;
|
||||
let actual = ratio > 1 ? value : ratio * value;
|
||||
|
||||
// 限制得分最大为 20(仅当 ifExist === 1)
|
||||
if (ifExist === 1 && actual > 20) {
|
||||
actual = 20;
|
||||
}
|
||||
|
||||
/* console.log({
|
||||
own,
|
||||
rent,
|
||||
orderCount,
|
||||
standard,
|
||||
value,
|
||||
ratio: ratio.toFixed(4),
|
||||
actual: actual.toFixed(2)
|
||||
}); */
|
||||
|
||||
return actual.toFixed(2);
|
||||
|
||||
if (!standard || standard === 0 || isNaN(value)) return '0';
|
||||
|
||||
const ratio = (own + rent * 0.6 + orderCount*0.9) / standard;
|
||||
let actual = ratio > 1 ? value : ratio * value;
|
||||
|
||||
// 额外限制条件
|
||||
if (ifExist === 1 && actual > 20) {
|
||||
actual = 20;
|
||||
}
|
||||
|
||||
return actual.toFixed(2);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@ const onReset = () => {
|
|||
|
||||
// 新增装备
|
||||
const addContract = () => {
|
||||
settleinTitle.value = '自有装备新建'
|
||||
settleinTitle.value = '外租装备新建'
|
||||
dialogVisibleSettlein.value = true
|
||||
addAndEditForm.value.id = null
|
||||
addAndEditForm.value.maNameId = ''
|
||||
|
|
@ -283,7 +283,7 @@ const onContract = (row: any) => {
|
|||
addAndEditForm.value.maType = row.maType
|
||||
addAndEditForm.value.maModel = row.maModel
|
||||
addAndEditForm.value.maNum = row.maNum
|
||||
settleinTitle.value = '自有装备修改'
|
||||
settleinTitle.value = '外租装备修改'
|
||||
dialogVisibleSettlein.value = true
|
||||
|
||||
// 检查是否能找到对应的选项
|
||||
|
|
|
|||
Loading…
Reference in New Issue