预算和指标填报
This commit is contained in:
4
.env.dev
4
.env.dev
@@ -12,9 +12,9 @@ VUE_APP_TITLE = 洛玻集团驾驶舱
|
|||||||
# 杨姗姗
|
# 杨姗姗
|
||||||
# VUE_APP_BASE_API = 'http://172.16.20.218:7070'
|
# VUE_APP_BASE_API = 'http://172.16.20.218:7070'
|
||||||
# 小田
|
# 小田
|
||||||
# VUE_APP_BASE_API = 'http://172.16.19.232:7070'
|
VUE_APP_BASE_API = 'http://172.16.19.232:7070'
|
||||||
# 测试
|
# 测试
|
||||||
VUE_APP_BASE_API = 'http://192.168.0.35:8080'
|
# VUE_APP_BASE_API = 'http://192.168.0.35:8080'
|
||||||
# 闫阳
|
# 闫阳
|
||||||
# VUE_APP_BASE_API = 'http://172.16.19.131:7070'
|
# VUE_APP_BASE_API = 'http://172.16.19.131:7070'
|
||||||
|
|
||||||
|
|||||||
@@ -316,6 +316,24 @@ export function updateTargetYearData(data) {
|
|||||||
data: data,
|
data: data,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// 预算填报模板下载/导出
|
||||||
|
export function importTemplateYS(data) {
|
||||||
|
return request({
|
||||||
|
url: '/lb/index-target-month/export',
|
||||||
|
method: "post",
|
||||||
|
data: data,
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 指标填报模板下载/导出
|
||||||
|
export function importTemplateZB(data) {
|
||||||
|
return request({
|
||||||
|
url: '/lb/index-real-month/export',
|
||||||
|
method: "post",
|
||||||
|
data: data,
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export function getRealMonthPage(data) {
|
export function getRealMonthPage(data) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -85,8 +85,8 @@ export const DICT_TYPE = {
|
|||||||
// ========== 模块 ==========
|
// ========== 模块 ==========
|
||||||
LB_DW: 'lb_dw',
|
LB_DW: 'lb_dw',
|
||||||
PROCESS:'process',
|
PROCESS:'process',
|
||||||
IMPORTANT_WORK_METHOD:'important_work_method'
|
IMPORTANT_WORK_METHOD:'important_work_method',
|
||||||
|
TARGET_PROPERTY:'target_property'
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -30,6 +30,13 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="数值目标属性" prop="targetProperty">
|
||||||
|
<el-select v-model="form.targetProperty" placeholder="请选择" style="width: 100%;">
|
||||||
|
<el-option v-for='item in targetPropertyList' :key='item.value' :label="item.label" :value= 'item.value' ></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
@@ -46,7 +53,8 @@ export default {
|
|||||||
importantWork: '',
|
importantWork: '',
|
||||||
unit: '',
|
unit: '',
|
||||||
time:'',
|
time:'',
|
||||||
calculateMethod:''
|
calculateMethod:'',
|
||||||
|
targetProperty:'',
|
||||||
},
|
},
|
||||||
isEdit: false, //是否是编辑
|
isEdit: false, //是否是编辑
|
||||||
rules: {
|
rules: {
|
||||||
@@ -54,9 +62,11 @@ export default {
|
|||||||
unit: [{ required: true, message: '请选择单位', trigger: 'change' }],
|
unit: [{ required: true, message: '请选择单位', trigger: 'change' }],
|
||||||
time: [{ required: true, message: '请选择所属年份', trigger: 'change' }],
|
time: [{ required: true, message: '请选择所属年份', trigger: 'change' }],
|
||||||
calculateMethod: [{ required: true, message: '请选择累计值计算方式', trigger: 'change' }],
|
calculateMethod: [{ required: true, message: '请选择累计值计算方式', trigger: 'change' }],
|
||||||
|
targetProperty: [{ required: true, message: '请选择数值目标属性', trigger: 'change' }],
|
||||||
},
|
},
|
||||||
unitList:getDictDatas('lb_dw'),
|
unitList:getDictDatas('lb_dw'),
|
||||||
calculateMethodList:getDictDatas('important_work_method')
|
calculateMethodList:getDictDatas('important_work_method'),
|
||||||
|
targetPropertyList:getDictDatas('target_property')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -44,6 +44,22 @@ export default {
|
|||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
formConfig: [
|
formConfig: [
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: '所属基地',
|
||||||
|
selectOptions: [
|
||||||
|
{ id: 2, name: '桐城' },
|
||||||
|
{ id: 3, name: '自贡' },
|
||||||
|
{ id: 5, name: '合肥' },
|
||||||
|
{ id: 6, name: '宿迁' },
|
||||||
|
{ id: 7, name: '宜兴' },
|
||||||
|
{ id: 8, name: '漳州' },
|
||||||
|
{ id: 9, name: '洛阳' },
|
||||||
|
{ id: 10, name: '秦皇岛' },
|
||||||
|
],
|
||||||
|
param: 'factory',
|
||||||
|
onchange: true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type: 'input',
|
type: 'input',
|
||||||
label: '客户名称',
|
label: '客户名称',
|
||||||
@@ -74,6 +90,7 @@ export default {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
listQuery:{
|
listQuery:{
|
||||||
|
factory:'',
|
||||||
name:'',
|
name:'',
|
||||||
code:'',
|
code:'',
|
||||||
pageSize:20,
|
pageSize:20,
|
||||||
@@ -106,6 +123,7 @@ export default {
|
|||||||
case 'search':
|
case 'search':
|
||||||
this.listQuery.name = val.name
|
this.listQuery.name = val.name
|
||||||
this.listQuery.code = val.code
|
this.listQuery.code = val.code
|
||||||
|
this.listQuery.factory = val.factory
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -45,6 +45,11 @@ const tableProps = [
|
|||||||
label: '累计值计算方式',
|
label: '累计值计算方式',
|
||||||
filter: publicFormatter('important_work_method')
|
filter: publicFormatter('important_work_method')
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
prop: 'targetProperty',
|
||||||
|
label: '数值目标属性',
|
||||||
|
filter: publicFormatter('target_property')
|
||||||
|
},
|
||||||
];
|
];
|
||||||
export default {
|
export default {
|
||||||
name: 'GroupKeyTaskConfiguration',
|
name: 'GroupKeyTaskConfiguration',
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<div class="top-three" style="
|
<div class="top-three" style="
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
grid-template-columns:416px 1192px;
|
grid-template-columns:186px 1422px;
|
||||||
">
|
">
|
||||||
<indicatorCalendar :timeType="timeType" :calendarObj='calendarObj'/>
|
<indicatorCalendar :timeType="timeType" :calendarObj='calendarObj'/>
|
||||||
<indicatorDetails :timeType="timeType" @updateLeft='getData' @updateLevel='getLevel'/>
|
<indicatorDetails :timeType="timeType" @updateLeft='getData' @updateLevel='getLevel'/>
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style="flex: 1">
|
<div style="flex: 1">
|
||||||
<Container name="预算填报日历" icon="cockpitItemIcon" size="calendarBg" topSize="calendarTitleBg">
|
<Container name="填报总览" icon="cockpitItemIcon" size="calendarBg" topSize="calendarTitleBg">
|
||||||
<!-- 1. 移除 .kpi-content 的固定高度,改为自适应 -->
|
<!-- 1. 移除 .kpi-content 的固定高度,改为自适应 -->
|
||||||
<div class="kpi-content" style="padding: 14px 14px; display: flex;flex-direction: column; width: 100%;">
|
<div class="kpi-content" style="padding: 14px 14px; display: flex;flex-direction: column; width: 100%;">
|
||||||
<!-- 2. .top 保持 flex,无需固定高度,自动跟随子元素拉伸 -->
|
<!-- 2. .top 保持 flex,无需固定高度,自动跟随子元素拉伸 -->
|
||||||
<div class="bottom"
|
<div class="bottom"
|
||||||
style="display: flex; width: 100%;margin-top: 8px;background-color: rgba(249, 252, 255, 1);height: 844px;padding: 26px 16px;">
|
style="width: 100%;margin-top: 8px;background-color: rgba(249, 252, 255, 1);height: 844px;padding: 26px 0px;">
|
||||||
<!-- 动态生成12个月的容器:优化flex布局,缩小行间距 -->
|
<!-- 动态生成12个月的容器:优化flex布局,缩小行间距 -->
|
||||||
<div class="month-list"
|
<div class="month-list">
|
||||||
style="display: flex; gap: 16px; flex-wrap: wrap; align-content: flex-start; row-gap: 8px;">
|
|
||||||
<!-- 循环生成12个月:通过判断当前月份索引,添加current类 -->
|
<!-- 循环生成12个月:通过判断当前月份索引,添加current类 -->
|
||||||
<div class="monthItem" :class="{
|
<div class="monthItem" :class="{
|
||||||
'has-data': calendar.haveData,
|
'has-data': calendar.haveData,
|
||||||
@@ -91,19 +90,19 @@ export default {
|
|||||||
|
|
||||||
// 基础月份样式
|
// 基础月份样式
|
||||||
.monthItem {
|
.monthItem {
|
||||||
width: 164px;
|
width: 100px;
|
||||||
height: 42px;
|
height: 57px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
font-family: PingFangSC, PingFang SC;
|
font-family: PingFangSC, PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
color: rgba(0, 0, 0, 0.85);
|
color: rgba(0, 0, 0, 0.85);
|
||||||
line-height: 42px;
|
line-height: 57px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
transition: all 0.2s ease; // 过渡效果,样式切换更平滑
|
transition: all 0.2s ease; // 过渡效果,样式切换更平滑
|
||||||
border: 2px solid transparent; // 透明边框,避免选中时布局偏移
|
border: 2px solid transparent; // 透明边框,避免选中时布局偏移
|
||||||
margin: 0; // 清除默认外边距,进一步缩小缝隙
|
margin: 0 auto 10px; // 清除默认外边距,进一步缩小缝隙
|
||||||
}
|
}
|
||||||
|
|
||||||
// 有数据的样式(背景色#D1E8FF)
|
// 有数据的样式(背景色#D1E8FF)
|
||||||
|
|||||||
@@ -22,7 +22,9 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button style="background-color: #0B58FF;" type="primary" @click="onSubmit">查询</el-button>
|
<el-button style="background-color: #0B58FF;" type="primary" @click="onSubmit">查询</el-button>
|
||||||
|
<el-button type="primary" plain size="medium" @click='downLoadExcel'>模板下载</el-button>
|
||||||
<el-button type="primary" plain size="medium" @click='importExcel'>导入</el-button>
|
<el-button type="primary" plain size="medium" @click='importExcel'>导入</el-button>
|
||||||
|
<el-button type="primary" plain size="medium" @click='exportExcel'>导出</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@@ -99,7 +101,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Container from './container.vue'
|
import Container from './container.vue'
|
||||||
import { getLevelStruc, getTargetMonthPage, updateTargetMonthData, getTargetYearPage, updateTargetYearData,copyLastMonthData, copyLastYearData} from '@/api/cockpit'
|
import { getLevelStruc, getTargetMonthPage, updateTargetMonthData, getTargetYearPage, updateTargetYearData,copyLastMonthData, copyLastYearData,importTemplateYS} from '@/api/cockpit'
|
||||||
import inputArea from './inputArea.vue' // 导入输入组件
|
import inputArea from './inputArea.vue' // 导入输入组件
|
||||||
import { publicFormatter } from '@/utils/dict';
|
import { publicFormatter } from '@/utils/dict';
|
||||||
import {getAccessToken, getTenantId} from '@/utils/auth'
|
import {getAccessToken, getTenantId} from '@/utils/auth'
|
||||||
@@ -460,6 +462,41 @@ export default {
|
|||||||
importExcel() {
|
importExcel() {
|
||||||
this.upload.open = true
|
this.upload.open = true
|
||||||
},
|
},
|
||||||
|
downLoadExcel() {
|
||||||
|
importTemplateYS({
|
||||||
|
levelId:this.form.levelId,
|
||||||
|
startTime: this.form.startTime,
|
||||||
|
endTime: this.form.endTime,
|
||||||
|
pageSize: 1000,
|
||||||
|
template:1,
|
||||||
|
pageNo: this.form.pageNo,
|
||||||
|
timeDim:this.form.timeDim
|
||||||
|
}).then(response => {
|
||||||
|
let fileName = '';
|
||||||
|
if (this.timeType === 'month') {
|
||||||
|
fileName = '月度预算导入模板.xls';
|
||||||
|
}else{
|
||||||
|
fileName = '年度预算导入模板.xls';
|
||||||
|
}
|
||||||
|
this.$download.excel(response, fileName);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
exportExcel() {
|
||||||
|
importTemplateYS({
|
||||||
|
levelId:this.form.levelId,
|
||||||
|
startTime: this.form.startTime,
|
||||||
|
endTime: this.form.endTime,
|
||||||
|
pageSize: 1000,
|
||||||
|
template:0,
|
||||||
|
pageNo: this.form.pageNo,
|
||||||
|
timeDim:this.form.timeDim
|
||||||
|
}).then(response => {
|
||||||
|
let mon = this.timeType=== 'month'?moment(this.form.endTime).format('YYYYMM'):moment(this.form.endTime).format('YYYY');
|
||||||
|
let factoryName = this.levelLList.filter(item => item.id == this.form.levelId)[0].name;
|
||||||
|
let fileName = this.timeType=== 'month'?mon + factoryName + '月度预算表.xls':mon + factoryName + '年度预算表.xls';
|
||||||
|
this.$download.excel(response, fileName);
|
||||||
|
});
|
||||||
|
},
|
||||||
// 文件上传中处理
|
// 文件上传中处理
|
||||||
handleFileUploadProgress(file, fileList) {
|
handleFileUploadProgress(file, fileList) {
|
||||||
console.log('文件上传中:',file, fileList)
|
console.log('文件上传中:',file, fileList)
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style="flex: 1">
|
<div style="flex: 1">
|
||||||
<Container name="指标填报日历" icon="cockpitItemIcon" size="calendarBg" topSize="calendarTitleBg">
|
<Container name="填报总览" icon="cockpitItemIcon" size="calendarBg" topSize="calendarTitleBg">
|
||||||
<!-- 1. 移除 .kpi-content 的固定高度,改为自适应 -->
|
<!-- 1. 移除 .kpi-content 的固定高度,改为自适应 -->
|
||||||
<div class="kpi-content" style="padding: 14px 14px; display: flex;flex-direction: column; width: 100%;">
|
<div class="kpi-content" style="padding: 14px 14px; display: flex;flex-direction: column; width: 100%;">
|
||||||
<!-- 2. .top 保持 flex,无需固定高度,自动跟随子元素拉伸 -->
|
<!-- 2. .top 保持 flex,无需固定高度,自动跟随子元素拉伸 -->
|
||||||
<div class="bottom"
|
<div class="bottom"
|
||||||
style="display: flex; width: 100%;margin-top: 8px;background-color: rgba(249, 252, 255, 1);height: 844px;padding: 26px 16px;">
|
style="width: 100%;margin-top: 8px;background-color: rgba(249, 252, 255, 1);height: 844px;padding: 26px 0px;">
|
||||||
<!-- 动态生成12个月的容器:优化flex布局,缩小行间距 -->
|
<!-- 动态生成12个月的容器:优化flex布局,缩小行间距 -->
|
||||||
<div class="month-list"
|
<div class="month-list">
|
||||||
style="display: flex; gap: 16px; flex-wrap: wrap; align-content: flex-start; row-gap: 8px;">
|
|
||||||
<!-- 循环生成12个月:通过判断当前月份索引,添加current类 -->
|
<!-- 循环生成12个月:通过判断当前月份索引,添加current类 -->
|
||||||
<div class="monthItem" :class="{
|
<div class="monthItem" :class="{
|
||||||
'has-data': month.haveData,
|
'has-data': month.haveData,
|
||||||
@@ -91,20 +90,20 @@ export default {
|
|||||||
|
|
||||||
// 基础月份样式
|
// 基础月份样式
|
||||||
.monthItem {
|
.monthItem {
|
||||||
width: 164px;
|
width: 100px;
|
||||||
height: 42px;
|
height: 57px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
font-family: PingFangSC, PingFang SC;
|
font-family: PingFangSC, PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
color: rgba(0, 0, 0, 0.85);
|
color: rgba(0, 0, 0, 0.85);
|
||||||
line-height: 42px;
|
line-height: 57px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
cursor: pointer; // 鼠标悬浮手型
|
cursor: pointer; // 鼠标悬浮手型
|
||||||
transition: all 0.2s ease; // 过渡效果,样式切换更平滑
|
transition: all 0.2s ease; // 过渡效果,样式切换更平滑
|
||||||
border: 2px solid transparent; // 透明边框,避免选中时布局偏移
|
border: 2px solid transparent; // 透明边框,避免选中时布局偏移
|
||||||
margin: 0; // 清除默认外边距,进一步缩小缝隙
|
margin: 0 auto 10px; // 清除默认外边距,进一步缩小缝隙
|
||||||
}
|
}
|
||||||
|
|
||||||
// 有数据的样式(背景色#D1E8FF)
|
// 有数据的样式(背景色#D1E8FF)
|
||||||
|
|||||||
@@ -15,12 +15,14 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="填报月份">
|
<el-form-item label="填报月份">
|
||||||
<el-date-picker v-model="form.month" type="month" placeholder="选择月" @change="handleMonthChange">
|
<el-date-picker v-model="form.month" type="month" placeholder="选择月" :editable='false' :clearable='false' @change="handleMonthChange">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button style="background-color: #0B58FF;" type="primary" @click="onSubmit">查询</el-button>
|
<el-button style="background-color: #0B58FF;" type="primary" @click="onSubmit">查询</el-button>
|
||||||
|
<el-button type="primary" plain size="medium" @click='downLoadExcel'>模板下载</el-button>
|
||||||
<el-button type="primary" plain size="medium" @click='importExcel'>导入</el-button>
|
<el-button type="primary" plain size="medium" @click='importExcel'>导入</el-button>
|
||||||
|
<el-button type="primary" plain size="medium" @click='exportExcel'>导出</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@@ -86,10 +88,11 @@ font-style: normal;">指标详情</div>
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Container from './container.vue'
|
import Container from './container.vue'
|
||||||
import { getLevelStruc, getRealMonthPage, updateRealMonthData, getDictListData, } from '@/api/cockpit'
|
import { getLevelStruc, getRealMonthPage, updateRealMonthData, getDictListData,importTemplateZB } from '@/api/cockpit'
|
||||||
import inputArea from './inputArea.vue' // 导入输入组件
|
import inputArea from './inputArea.vue' // 导入输入组件
|
||||||
import {getAccessToken, getTenantId} from '@/utils/auth'
|
import {getAccessToken, getTenantId} from '@/utils/auth'
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import moment from 'moment'
|
||||||
export default {
|
export default {
|
||||||
name: 'ProductionStatus',
|
name: 'ProductionStatus',
|
||||||
components: {
|
components: {
|
||||||
@@ -338,6 +341,33 @@ export default {
|
|||||||
importExcel() {
|
importExcel() {
|
||||||
this.upload.open = true
|
this.upload.open = true
|
||||||
},
|
},
|
||||||
|
downLoadExcel() {
|
||||||
|
importTemplateZB({
|
||||||
|
levelId:this.form.levelId,
|
||||||
|
startTime: this.form.startTime,
|
||||||
|
endTime: this.form.endTime,
|
||||||
|
pageSize: 1000,
|
||||||
|
template:1,
|
||||||
|
pageNo: this.form.pageNo
|
||||||
|
}).then(response => {
|
||||||
|
this.$download.excel(response, '指标导入模板.xls');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
exportExcel() {
|
||||||
|
importTemplateZB({
|
||||||
|
levelId:this.form.levelId,
|
||||||
|
startTime: this.form.startTime,
|
||||||
|
endTime: this.form.endTime,
|
||||||
|
pageSize: 1000,
|
||||||
|
template:0,
|
||||||
|
pageNo: this.form.pageNo
|
||||||
|
}).then(response => {
|
||||||
|
let mon = moment(this.form.endTime).format('YYYYMM');
|
||||||
|
let factoryName = this.levelLList.filter(item => item.id == this.form.levelId)[0].name;
|
||||||
|
let fileName = mon + factoryName + '月度指标填报表.xls';
|
||||||
|
this.$download.excel(response, fileName);
|
||||||
|
});
|
||||||
|
},
|
||||||
// 文件上传中处理
|
// 文件上传中处理
|
||||||
handleFileUploadProgress(file, fileList) {
|
handleFileUploadProgress(file, fileList) {
|
||||||
console.log('文件上传中:',file, fileList)
|
console.log('文件上传中:',file, fileList)
|
||||||
|
|||||||
@@ -104,14 +104,14 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 核心方法:按levelId匹配地名生成locations
|
* 核心方法:按levelId匹配地名生成locations
|
||||||
*/
|
*/
|
||||||
getRateFlag(rate, real, target) {
|
getRateFlag(rate, real, budget) {
|
||||||
if (isNaN(rate) || rate === null || rate === undefined) return 0;
|
if (isNaN(rate) || rate === null || rate === undefined) return 0;
|
||||||
|
|
||||||
// 1. 完成率 >= 100 => 达标
|
// 1. 完成率 >= 100 => 达标
|
||||||
if (rate >= 100) return 1;
|
if (rate >= 100) return 1;
|
||||||
|
|
||||||
// 2. 完成率 = 0 且 (目标值=0 或 实际值=目标值=0) => 达标
|
// 2. 完成率 = 0 且 (目标值=0 或 实际值=目标值=0) => 达标
|
||||||
// if (rate === 0 && target === 0) return 1;
|
// if (rate === 0 && budget === 0) return 1;
|
||||||
|
|
||||||
// 其他情况 => 未达标
|
// 其他情况 => 未达标
|
||||||
return 0;
|
return 0;
|
||||||
@@ -143,10 +143,10 @@ export default {
|
|||||||
validOtherData.forEach(item => {
|
validOtherData.forEach(item => {
|
||||||
barData.locations.push(item.title); // locations=levelId对应的地名(如levelId=7→宜兴)
|
barData.locations.push(item.title); // locations=levelId对应的地名(如levelId=7→宜兴)
|
||||||
barData.diff.push(item.diff || 0);
|
barData.diff.push(item.diff || 0);
|
||||||
barData.targets.push(item.target || 0);
|
barData.targets.push(item.budget || 0);
|
||||||
barData.reals.push(item.real || 0);
|
barData.reals.push(item.real || 0);
|
||||||
barData.rate.push(item.rate || 0);
|
barData.rate.push(item.rate || 0);
|
||||||
barData.flags.push(this.getRateFlag(item.rate, item.real, item.target));
|
barData.flags.push(this.getRateFlag(item.rate, item.real, item.budget));
|
||||||
});
|
});
|
||||||
|
|
||||||
// 3. 更新chartData
|
// 3. 更新chartData
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<div class="top-three" style="
|
<div class="top-three" style="
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
grid-template-columns:416px 1192px;
|
grid-template-columns:186px 1422px;
|
||||||
">
|
">
|
||||||
<indicatorCalendar :calendarList="calendarList" />
|
<indicatorCalendar :calendarList="calendarList" />
|
||||||
<indicatorDetails @updateLeft='getData' @updateLevel='getLevel'/>
|
<indicatorDetails @updateLeft='getData' @updateLevel='getLevel'/>
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export default {
|
|||||||
relatedMon: {
|
relatedMon: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({
|
default: () => ({
|
||||||
产量: { completeRate: 0, diff: 0, real: 0, target: 0, thb: 0 },
|
加工产量: { completeRate: 0, diff: 0, real: 0, target: 0, thb: 0 },
|
||||||
销量: { completeRate: 0, diff: 0, real: 0, target: 0, thb: 0 },
|
销量: { completeRate: 0, diff: 0, real: 0, target: 0, thb: 0 },
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -61,7 +61,7 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
indicatorDefs() {
|
indicatorDefs() {
|
||||||
return [
|
return [
|
||||||
{ key: 'production', name: '产量', unit: '㎡'},
|
{ key: 'production', name: '加工产量', unit: '㎡'},
|
||||||
{ key: 'financialCost', name: '销量', unit: '万㎡'},
|
{ key: 'financialCost', name: '销量', unit: '万㎡'},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export default {
|
|||||||
relatedTotal: {
|
relatedTotal: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({
|
default: () => ({
|
||||||
产量: { completeRate: 0, diff: 0, real: 0, target: 0, thb: 0 },
|
加工产量: { completeRate: 0, diff: 0, real: 0, target: 0, thb: 0 },
|
||||||
销量: { completeRate: 0, diff: 0, real: 0, target: 0, thb: 0 },
|
销量: { completeRate: 0, diff: 0, real: 0, target: 0, thb: 0 },
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -61,7 +61,7 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
indicatorDefs() {
|
indicatorDefs() {
|
||||||
return [
|
return [
|
||||||
{ key: 'production', name: '产量', unit: '㎡'},
|
{ key: 'production', name: '加工产量', unit: '㎡'},
|
||||||
{ key: 'financialCost', name: '销量', unit: '万㎡'},
|
{ key: 'financialCost', name: '销量', unit: '万㎡'},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
gap: 12px;
|
gap: 12px;
|
||||||
grid-template-columns: 1624px;
|
grid-template-columns: 1624px;
|
||||||
">
|
">
|
||||||
<dataTrend :cusProData="cusProData" :title="'数据趋势'" />
|
<dataTrend :cusProData="cusProData" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ export default {
|
|||||||
top: 30,
|
top: 30,
|
||||||
bottom: 5,
|
bottom: 5,
|
||||||
right: 20,
|
right: 20,
|
||||||
left: 25,
|
left: 30,
|
||||||
containLabel: true
|
containLabel: true
|
||||||
},
|
},
|
||||||
xAxis: [
|
xAxis: [
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ export default {
|
|||||||
}
|
}
|
||||||
const nameWrapped = wrapMixedText(params.name, 6, 1)
|
const nameWrapped = wrapMixedText(params.name, 6, 1)
|
||||||
return [
|
return [
|
||||||
`{b|${Number(params.value || 0).toLocaleString()}}`,
|
`{b|${Number(params.value || 0).toLocaleString()}(${item.rate}%)}`,
|
||||||
// 第2行放色块 + 名称第1行;如果名称有第2行,会自然变成第3行
|
// 第2行放色块 + 名称第1行;如果名称有第2行,会自然变成第3行
|
||||||
`{hr|■}{c|${nameWrapped}}`
|
`{hr|■}{c|${nameWrapped}}`
|
||||||
].join('\n')
|
].join('\n')
|
||||||
@@ -137,7 +137,7 @@ export default {
|
|||||||
},
|
},
|
||||||
b: {
|
b: {
|
||||||
color: 'rgba(0, 0, 0, 0.75)',
|
color: 'rgba(0, 0, 0, 0.75)',
|
||||||
fontSize: 18,
|
fontSize: 13,
|
||||||
padding: [0, 0, 0, 0]
|
padding: [0, 0, 0, 0]
|
||||||
},
|
},
|
||||||
c: {
|
c: {
|
||||||
@@ -161,6 +161,13 @@ export default {
|
|||||||
|
|
||||||
// 图表配置项
|
// 图表配置项
|
||||||
const option = {
|
const option = {
|
||||||
|
tooltip:{
|
||||||
|
confine:true,
|
||||||
|
formatter:params => {
|
||||||
|
const {name,value,percent} = params;
|
||||||
|
return `${name}:${value} (${percent}%)`;
|
||||||
|
}
|
||||||
|
},
|
||||||
// 动态标题(支持父组件传递)
|
// 动态标题(支持父组件传递)
|
||||||
title: [
|
title: [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user