127 lines
3.5 KiB
Vue
127 lines
3.5 KiB
Vue
<template>
|
|
<div style="flex: 1">
|
|
<Container name="重点工作/三大攻坚战" icon="cockpitItemIcon" size="bottomBasic" topSize="basic">
|
|
<div class="kpi-content"
|
|
style="padding: 14px 16px; display: flex;flex-direction: column; width: 100%;height: 280px;">
|
|
<div class="bottom"
|
|
style="display: flex;padding: 14px 16px;flex-direction: column; background-color: rgba(249, 252, 255, 1);">
|
|
<div class="legend-group" style="justify-content: end;">
|
|
<div class="legend-item">
|
|
<span class="legend-dot done"></span>
|
|
<span class="legend-text">已完成</span>
|
|
</div>
|
|
<div class="legend-item">
|
|
<span class="legend-dot pending"></span>
|
|
<span class="legend-text">未完成</span>
|
|
</div>
|
|
</div>
|
|
<base-table style="height: 180px;" :page="1" :limit="10" :show-index="true" :beilv="1"
|
|
:tableConfig="tableProps" :table-data="tableData" />
|
|
</div>
|
|
</div>
|
|
</Container>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import Container from './container.vue'
|
|
import baseTable from './baseTable.vue'
|
|
import finishDiv from './finishDiv.vue'
|
|
|
|
export default {
|
|
name: 'ProductionStatus',
|
|
components: { Container, baseTable },
|
|
props: {
|
|
importantWork: {
|
|
type: Object,
|
|
default: () => ({})
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
tableData: [],
|
|
tableProps: [
|
|
{ prop: 'name', label: '攻坚指标', align: 'center' },
|
|
{ prop: 'target', label: '攻坚预算', align: 'center' },
|
|
{ prop: 'monthlyActual', label: '当月实际', align: 'center' },
|
|
{ prop: 'accumulated', label: '累计', align: 'center', subcomponent: finishDiv },
|
|
]
|
|
}
|
|
},
|
|
watch: {
|
|
importantWork: {
|
|
handler(newVal) {
|
|
this.tableData = this.transformData(newVal);
|
|
},
|
|
immediate: true,
|
|
deep: true
|
|
}
|
|
},
|
|
methods: {
|
|
transformData(rawData) {
|
|
if (!rawData || typeof rawData !== 'object') return [];
|
|
|
|
const mapping = [
|
|
{ key: 'jyxxjl', name: '经营现金流', unit: '万元' },
|
|
{ key: 'yszk', name: '应收账款', unit: '万元' },
|
|
{ key: 'ch', name: '存货', unit: '万元' },
|
|
{ key: 'yysr', name: '营业收入', unit: '万元' },
|
|
{ key: 'snysysk', name: '三年以上应收款', unit: '万元' },
|
|
{ key: 'dzje', name: '非经营性资产处置到账金额', unit: '万元' },
|
|
{ key: 'yfjftr', name: '研发经费投入', unit: '万元' },
|
|
{ key: 'yfjftrqd', name: '研发经费投入强度', unit: '%' }
|
|
];
|
|
|
|
return mapping.map((item, index) => {
|
|
const data = rawData[item.key] || { monValue: 0, real: 0, target: 0 };
|
|
const accumulated = data.real || 0;
|
|
const target = data.target || 0;
|
|
|
|
return {
|
|
id: index + 1,
|
|
name: item.name + '/' + item.unit,
|
|
target: target,
|
|
monthlyActual: data.monValue,
|
|
accumulated: accumulated,
|
|
status: accumulated > 0 && target > 0 && accumulated / target >= 1 ? 'done' : 'pending'
|
|
};
|
|
});
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang='scss' scoped>
|
|
.legend-group {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
}
|
|
|
|
.legend-item {
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.legend-dot {
|
|
display: inline-block;
|
|
width: 12px;
|
|
height: 12px;
|
|
margin-right: 5px;
|
|
border-radius: 2px;
|
|
}
|
|
|
|
.legend-dot.done {
|
|
background-color: #4CAF50;
|
|
}
|
|
|
|
.legend-dot.pending {
|
|
background-color: #FF9800;
|
|
}
|
|
|
|
.legend-text {
|
|
font-size: 14px;
|
|
color: #333;
|
|
}
|
|
</style>
|