预算和指标填报
This commit is contained in:
@@ -316,6 +316,24 @@ export function updateTargetYearData(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) {
|
||||
return request({
|
||||
|
||||
@@ -85,8 +85,8 @@ export const DICT_TYPE = {
|
||||
// ========== 模块 ==========
|
||||
LB_DW: 'lb_dw',
|
||||
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-form-item>
|
||||
</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-form>
|
||||
</template>
|
||||
@@ -46,7 +53,8 @@ export default {
|
||||
importantWork: '',
|
||||
unit: '',
|
||||
time:'',
|
||||
calculateMethod:''
|
||||
calculateMethod:'',
|
||||
targetProperty:'',
|
||||
},
|
||||
isEdit: false, //是否是编辑
|
||||
rules: {
|
||||
@@ -54,9 +62,11 @@ export default {
|
||||
unit: [{ required: true, message: '请选择单位', trigger: 'change' }],
|
||||
time: [{ required: true, message: '请选择所属年份', trigger: 'change' }],
|
||||
calculateMethod: [{ required: true, message: '请选择累计值计算方式', trigger: 'change' }],
|
||||
targetProperty: [{ required: true, message: '请选择数值目标属性', trigger: 'change' }],
|
||||
},
|
||||
unitList:getDictDatas('lb_dw'),
|
||||
calculateMethodList:getDictDatas('important_work_method')
|
||||
calculateMethodList:getDictDatas('important_work_method'),
|
||||
targetPropertyList:getDictDatas('target_property')
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -44,6 +44,22 @@ export default {
|
||||
data () {
|
||||
return {
|
||||
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',
|
||||
label: '客户名称',
|
||||
@@ -74,6 +90,7 @@ export default {
|
||||
}
|
||||
],
|
||||
listQuery:{
|
||||
factory:'',
|
||||
name:'',
|
||||
code:'',
|
||||
pageSize:20,
|
||||
@@ -106,6 +123,7 @@ export default {
|
||||
case 'search':
|
||||
this.listQuery.name = val.name
|
||||
this.listQuery.code = val.code
|
||||
this.listQuery.factory = val.factory
|
||||
this.listQuery.pageNo = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
|
||||
@@ -45,6 +45,11 @@ const tableProps = [
|
||||
label: '累计值计算方式',
|
||||
filter: publicFormatter('important_work_method')
|
||||
},
|
||||
{
|
||||
prop: 'targetProperty',
|
||||
label: '数值目标属性',
|
||||
filter: publicFormatter('target_property')
|
||||
},
|
||||
];
|
||||
export default {
|
||||
name: 'GroupKeyTaskConfiguration',
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<div class="top-three" style="
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
grid-template-columns:416px 1192px;
|
||||
grid-template-columns:186px 1422px;
|
||||
">
|
||||
<indicatorCalendar :timeType="timeType" :calendarObj='calendarObj'/>
|
||||
<indicatorDetails :timeType="timeType" @updateLeft='getData' @updateLevel='getLevel'/>
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
<template>
|
||||
<div style="flex: 1">
|
||||
<Container name="预算填报日历" icon="cockpitItemIcon" size="calendarBg" topSize="calendarTitleBg">
|
||||
<Container name="填报总览" icon="cockpitItemIcon" size="calendarBg" topSize="calendarTitleBg">
|
||||
<!-- 1. 移除 .kpi-content 的固定高度,改为自适应 -->
|
||||
<div class="kpi-content" style="padding: 14px 14px; display: flex;flex-direction: column; width: 100%;">
|
||||
<!-- 2. .top 保持 flex,无需固定高度,自动跟随子元素拉伸 -->
|
||||
<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布局,缩小行间距 -->
|
||||
<div class="month-list"
|
||||
style="display: flex; gap: 16px; flex-wrap: wrap; align-content: flex-start; row-gap: 8px;">
|
||||
<div class="month-list">
|
||||
<!-- 循环生成12个月:通过判断当前月份索引,添加current类 -->
|
||||
<div class="monthItem" :class="{
|
||||
'has-data': calendar.haveData,
|
||||
@@ -91,19 +90,19 @@ export default {
|
||||
|
||||
// 基础月份样式
|
||||
.monthItem {
|
||||
width: 164px;
|
||||
height: 42px;
|
||||
width: 100px;
|
||||
height: 57px;
|
||||
border-radius: 4px;
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 20px;
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
line-height: 42px;
|
||||
line-height: 57px;
|
||||
text-align: center;
|
||||
font-style: normal;
|
||||
transition: all 0.2s ease; // 过渡效果,样式切换更平滑
|
||||
border: 2px solid transparent; // 透明边框,避免选中时布局偏移
|
||||
margin: 0; // 清除默认外边距,进一步缩小缝隙
|
||||
margin: 0 auto 10px; // 清除默认外边距,进一步缩小缝隙
|
||||
}
|
||||
|
||||
// 有数据的样式(背景色#D1E8FF)
|
||||
|
||||
@@ -22,7 +22,9 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<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='exportExcel'>导出</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
@@ -99,7 +101,7 @@
|
||||
|
||||
<script>
|
||||
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 { publicFormatter } from '@/utils/dict';
|
||||
import {getAccessToken, getTenantId} from '@/utils/auth'
|
||||
@@ -460,6 +462,41 @@ export default {
|
||||
importExcel() {
|
||||
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) {
|
||||
console.log('文件上传中:',file, fileList)
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
<template>
|
||||
<div style="flex: 1">
|
||||
<Container name="指标填报日历" icon="cockpitItemIcon" size="calendarBg" topSize="calendarTitleBg">
|
||||
<Container name="填报总览" icon="cockpitItemIcon" size="calendarBg" topSize="calendarTitleBg">
|
||||
<!-- 1. 移除 .kpi-content 的固定高度,改为自适应 -->
|
||||
<div class="kpi-content" style="padding: 14px 14px; display: flex;flex-direction: column; width: 100%;">
|
||||
<!-- 2. .top 保持 flex,无需固定高度,自动跟随子元素拉伸 -->
|
||||
<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布局,缩小行间距 -->
|
||||
<div class="month-list"
|
||||
style="display: flex; gap: 16px; flex-wrap: wrap; align-content: flex-start; row-gap: 8px;">
|
||||
<div class="month-list">
|
||||
<!-- 循环生成12个月:通过判断当前月份索引,添加current类 -->
|
||||
<div class="monthItem" :class="{
|
||||
'has-data': month.haveData,
|
||||
@@ -91,20 +90,20 @@ export default {
|
||||
|
||||
// 基础月份样式
|
||||
.monthItem {
|
||||
width: 164px;
|
||||
height: 42px;
|
||||
width: 100px;
|
||||
height: 57px;
|
||||
border-radius: 4px;
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 20px;
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
line-height: 42px;
|
||||
line-height: 57px;
|
||||
text-align: center;
|
||||
font-style: normal;
|
||||
cursor: pointer; // 鼠标悬浮手型
|
||||
transition: all 0.2s ease; // 过渡效果,样式切换更平滑
|
||||
border: 2px solid transparent; // 透明边框,避免选中时布局偏移
|
||||
margin: 0; // 清除默认外边距,进一步缩小缝隙
|
||||
margin: 0 auto 10px; // 清除默认外边距,进一步缩小缝隙
|
||||
}
|
||||
|
||||
// 有数据的样式(背景色#D1E8FF)
|
||||
|
||||
@@ -15,12 +15,14 @@
|
||||
</el-form-item>
|
||||
|
||||
<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-form-item>
|
||||
<el-form-item>
|
||||
<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='exportExcel'>导出</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
@@ -86,10 +88,11 @@ font-style: normal;">指标详情</div>
|
||||
|
||||
<script>
|
||||
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 {getAccessToken, getTenantId} from '@/utils/auth'
|
||||
import axios from 'axios';
|
||||
import moment from 'moment'
|
||||
export default {
|
||||
name: 'ProductionStatus',
|
||||
components: {
|
||||
@@ -338,6 +341,33 @@ export default {
|
||||
importExcel() {
|
||||
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) {
|
||||
console.log('文件上传中:',file, fileList)
|
||||
|
||||
@@ -104,14 +104,14 @@ export default {
|
||||
/**
|
||||
* 核心方法:按levelId匹配地名生成locations
|
||||
*/
|
||||
getRateFlag(rate, real, target) {
|
||||
getRateFlag(rate, real, budget) {
|
||||
if (isNaN(rate) || rate === null || rate === undefined) return 0;
|
||||
|
||||
// 1. 完成率 >= 100 => 达标
|
||||
if (rate >= 100) return 1;
|
||||
|
||||
// 2. 完成率 = 0 且 (目标值=0 或 实际值=目标值=0) => 达标
|
||||
// if (rate === 0 && target === 0) return 1;
|
||||
// if (rate === 0 && budget === 0) return 1;
|
||||
|
||||
// 其他情况 => 未达标
|
||||
return 0;
|
||||
@@ -143,10 +143,10 @@ export default {
|
||||
validOtherData.forEach(item => {
|
||||
barData.locations.push(item.title); // locations=levelId对应的地名(如levelId=7→宜兴)
|
||||
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.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
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<div class="top-three" style="
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
grid-template-columns:416px 1192px;
|
||||
grid-template-columns:186px 1422px;
|
||||
">
|
||||
<indicatorCalendar :calendarList="calendarList" />
|
||||
<indicatorDetails @updateLeft='getData' @updateLevel='getLevel'/>
|
||||
|
||||
@@ -36,7 +36,7 @@ export default {
|
||||
relatedMon: {
|
||||
type: Object,
|
||||
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 },
|
||||
})
|
||||
},
|
||||
@@ -61,7 +61,7 @@ export default {
|
||||
computed: {
|
||||
indicatorDefs() {
|
||||
return [
|
||||
{ key: 'production', name: '产量', unit: '㎡'},
|
||||
{ key: 'production', name: '加工产量', unit: '㎡'},
|
||||
{ key: 'financialCost', name: '销量', unit: '万㎡'},
|
||||
]
|
||||
},
|
||||
|
||||
@@ -36,7 +36,7 @@ export default {
|
||||
relatedTotal: {
|
||||
type: Object,
|
||||
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 },
|
||||
})
|
||||
},
|
||||
@@ -61,7 +61,7 @@ export default {
|
||||
computed: {
|
||||
indicatorDefs() {
|
||||
return [
|
||||
{ key: 'production', name: '产量', unit: '㎡'},
|
||||
{ key: 'production', name: '加工产量', unit: '㎡'},
|
||||
{ key: 'financialCost', name: '销量', unit: '万㎡'},
|
||||
]
|
||||
},
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
gap: 12px;
|
||||
grid-template-columns: 1624px;
|
||||
">
|
||||
<dataTrend :cusProData="cusProData" :title="'数据趋势'" />
|
||||
<dataTrend :cusProData="cusProData" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -139,7 +139,7 @@ export default {
|
||||
top: 30,
|
||||
bottom: 5,
|
||||
right: 20,
|
||||
left: 25,
|
||||
left: 30,
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [
|
||||
|
||||
@@ -124,7 +124,7 @@ export default {
|
||||
}
|
||||
const nameWrapped = wrapMixedText(params.name, 6, 1)
|
||||
return [
|
||||
`{b|${Number(params.value || 0).toLocaleString()}}`,
|
||||
`{b|${Number(params.value || 0).toLocaleString()}(${item.rate}%)}`,
|
||||
// 第2行放色块 + 名称第1行;如果名称有第2行,会自然变成第3行
|
||||
`{hr|■}{c|${nameWrapped}}`
|
||||
].join('\n')
|
||||
@@ -137,7 +137,7 @@ export default {
|
||||
},
|
||||
b: {
|
||||
color: 'rgba(0, 0, 0, 0.75)',
|
||||
fontSize: 18,
|
||||
fontSize: 13,
|
||||
padding: [0, 0, 0, 0]
|
||||
},
|
||||
c: {
|
||||
@@ -161,6 +161,13 @@ export default {
|
||||
|
||||
// 图表配置项
|
||||
const option = {
|
||||
tooltip:{
|
||||
confine:true,
|
||||
formatter:params => {
|
||||
const {name,value,percent} = params;
|
||||
return `${name}:${value} (${percent}%)`;
|
||||
}
|
||||
},
|
||||
// 动态标题(支持父组件传递)
|
||||
title: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user