diff --git a/.env.dev b/.env.dev index c4e944c2..61c7d5a2 100644 --- a/.env.dev +++ b/.env.dev @@ -9,7 +9,9 @@ VUE_APP_TITLE = 洛玻集团驾驶舱 # VUE_APP_BASE_API = 'http://172.16.32.95:7070' # VUE_APP_BASE_API = 'http://172.16.33.83:7070' -VUE_APP_BASE_API = 'http://192.168.0.35:7070' +# 杨姗姗 +VUE_APP_BASE_API = 'http://172.16.20.218:7070' +# VUE_APP_BASE_API = 'http://172.16.19.232:7070' # 路由懒加载 diff --git a/.gitignore b/.gitignore index 004766c9..c81d28b1 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ selenium-debug.log *.local package-lock.json +sync_luobo.bat \ No newline at end of file diff --git a/src/api/cockpit.js b/src/api/cockpit.js index 83d68d76..0cbb0f5c 100644 --- a/src/api/cockpit.js +++ b/src/api/cockpit.js @@ -117,6 +117,22 @@ export function updateDataBackUpDetail(data) { }); } +export function copyLastMonthData(data) { + return request({ + url: "/lb/index-target-month/copyLastMonth", + method: "post", + data: data, + }); +} + +export function copyLastYearData(data) { + return request({ + url: "/lb/index-target-year/copyLastYear", + method: "post", + data: data, + }); +} + export function getSalesRevenueGroupData(data) { return request({ @@ -254,6 +270,13 @@ export function getCalendar(data) { data: data, }); } +export function getCalendarYear(data) { + return request({ + url: "lb/index-target-year/getCalendarYear", + method: "post", + data: data, + }); +} export function getLevelStruc(data) { return request({ url: "/lb/index-target-month/getLevelStruc", diff --git a/src/utils/dict.js b/src/utils/dict.js index 29b05f78..4f29c620 100644 --- a/src/utils/dict.js +++ b/src/utils/dict.js @@ -81,6 +81,9 @@ export const DICT_TYPE = { PROMOTION_COUPON_TAKE_TYPE: 'promotion_coupon_take_type', // 优惠劵的领取方式 PROMOTION_ACTIVITY_STATUS: 'promotion_activity_status', // 优惠活动的状态 PROMOTION_CONDITION_TYPE: 'promotion_condition_type', // 营销的条件类型枚举 + + // ========== 模块 ========== + LB_DW: 'lb_dw' } /** @@ -139,3 +142,15 @@ export function getDictDataLabel(dictType, value) { const dict = getDictData(dictType, value); return dict ? dict.label : ''; } + +// table中用来过滤字典 +export function publicFormatter(dictTable) { + const dictDatas = getDictDatas(dictTable) + return function (val) { + const arr = {} + dictDatas.map((item) => { + arr[item.value] = item.label + }) + return arr?.[val] + } +} diff --git a/src/views/home/budgetSubmissionDetails.vue b/src/views/home/budgetSubmissionDetails.vue index 85567e31..f1126d30 100644 --- a/src/views/home/budgetSubmissionDetails.vue +++ b/src/views/home/budgetSubmissionDetails.vue @@ -16,8 +16,8 @@ gap: 12px; grid-template-columns:416px 1192px; "> - - + +
- {{ month.name }} + 'has-data': calendar.haveData, + 'current': calendar.isActive // 本月匹配current样式 + }" v-for="(calendar, index) in calendarList" :key="index"> + {{ calendar.name }}
@@ -25,49 +25,35 @@ @@ -119,7 +101,6 @@ export default { line-height: 42px; text-align: center; font-style: normal; - cursor: pointer; // 鼠标悬浮手型 transition: all 0.2s ease; // 过渡效果,样式切换更平滑 border: 2px solid transparent; // 透明边框,避免选中时布局偏移 margin: 0; // 清除默认外边距,进一步缩小缝隙 @@ -140,5 +121,3 @@ export default { border: 2px solid #0B58FF !important; } - - diff --git a/src/views/home/components/budgetDetails.vue b/src/views/home/components/budgetDetails.vue index c63e763c..13b3109b 100644 --- a/src/views/home/components/budgetDetails.vue +++ b/src/views/home/components/budgetDetails.vue @@ -22,7 +22,7 @@ 查询 - + 导入 @@ -35,14 +35,14 @@
指标详情
+ height: 16px; + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 14px; + color: rgba(0,0,0,0.85); + line-height: 16px; + text-align: right; + font-style: normal;">指标详情
编辑 @@ -53,12 +53,12 @@ font-style: normal;">指标详情
快捷操作
- + @click="allUp">全部上调5% + 全部下调5% 清空配置 指标详情 + :table-props="tableProps" :page="form.pageNo" :limit="form.pageSize" :table-data="tableData" ref="baseTable" id='calendarTable' + :key="tableKey"> - +
将文件拖到此处,或点击上传
-
- 是否更新已经存在的用户数据 -
仅允许导入xls、xlsx格式文件。 - 下载模板
+
+ + 月预算 + 年预算 + +
diff --git a/src/views/home/components/indicatorCalendar.vue b/src/views/home/components/indicatorCalendar.vue index 1ea083f7..f8892536 100644 --- a/src/views/home/components/indicatorCalendar.vue +++ b/src/views/home/components/indicatorCalendar.vue @@ -13,7 +13,7 @@
+ }" v-for="(month, index) in list" :key="index"> {{ month.name }}
@@ -41,21 +41,7 @@ export default { data() { return { chart: null, - // 初始化12个月的列表,可根据实际需求修改haveData默认值 - monthList: [ - { name: '1月', haveData: false, isActive: false }, - { name: '2月', haveData: false, isActive: false }, - { name: '3月', haveData: false, isActive: false }, - { name: '4月', haveData: false, isActive: false }, - { name: '5月', haveData: false, isActive: false }, - { name: '6月', haveData: false, isActive: false }, - { name: '7月', haveData: false, isActive: false }, - { name: '8月', haveData: false, isActive: false }, - { name: '9月', haveData: false, isActive: false }, - { name: '10月', haveData: false, isActive: false }, - { name: '11月', haveData: false, isActive: false }, - { name: '12月', haveData: false, isActive: false } - ], + list:[] } }, computed: { @@ -83,19 +69,15 @@ export default { // 根据calendarList更新monthList的haveData状态 updateMonthHaveData(calendarObj) { if (!calendarObj || typeof calendarObj !== 'object') return; - - // 遍历12个月,匹配对应年月 - this.monthList.forEach((month, index) => { - // 获取月份数字(索引+1,补两位,如1→01,10→10) - const monthNum = (index + 1).toString().padStart(2, '0'); - // 拼接成calendarList中的键格式(如2025-01) - const yearMonthKey = `2025-${monthNum}`; // 若年份不固定,可改为props传递年份 - - // 判断calendarObj中该键对应的值:1→true,0→false,无该键则保持默认false - if (calendarObj.hasOwnProperty(yearMonthKey)) { - month.haveData = calendarObj[yearMonthKey] === 1; - } - }); + const keys = Object.keys(calendarObj); + if(keys.length == 0){ + return + } + console.log('calendarObj',calendarObj) + this.list = [] + for(let i = 0; i < keys.length; i++) { + this.list.push({name:i+1+'月',haveData:calendarObj[keys[i]],isActive:i==new Date().getMonth()}) + } }, } } diff --git a/src/views/home/components/indicatorDetails.vue b/src/views/home/components/indicatorDetails.vue index 6131a402..1762087d 100644 --- a/src/views/home/components/indicatorDetails.vue +++ b/src/views/home/components/indicatorDetails.vue @@ -20,7 +20,7 @@ 查询 - + 导入 @@ -64,6 +64,22 @@ font-style: normal;">指标详情 > + + + +
将文件拖到此处,或点击上传
+
+ 仅允许导入xls、xlsx格式文件。 +
+
+
+
+ +
@@ -72,7 +88,8 @@ font-style: normal;">指标详情 import Container from './container.vue' import { getLevelStruc, getRealMonthPage, updateRealMonthData, getDictListData, } from '@/api/cockpit' import inputArea from './inputArea.vue' // 导入输入组件 - +import {getAccessToken, getTenantId} from '@/utils/auth' +import axios from 'axios'; export default { name: 'ProductionStatus', components: { @@ -85,7 +102,7 @@ export default { data() { return { form: { - levelId: 1, + levelId: undefined, pageNo: 1, pageSize: 100, month: undefined, @@ -96,7 +113,17 @@ export default { isDetail: false, // 编辑状态标识:false=只读,true=编辑 tableData: [], // 表格数据 levelLList: [], // 所属层级下拉数据 - tableProps: [] // 表格列配置 + tableProps: [], // 表格列配置 + upload: { + // 是否显示弹出层 + open: false, + // 弹出层标题 + title: "指标填报导入", + // 是否禁用上传 + isUploading: false, + fileList:[], + currentFile:null + } } }, watch: { @@ -261,13 +288,16 @@ export default { getData() { // 1. 请求所属层级下拉数据 getLevelStruc().then((res) => { - console.log('所属层级数据:', res); this.levelLList = res.data || []; + this.form.levelId = this.levelLList[0].id; + this.getDataPage() }).catch(err => { console.error('获取所属层级失败:', err); this.levelLList = []; }); - + this.$emit('updateLeft') + }, + getDataPage() { // 2. 请求表格分页数据 getRealMonthPage({ levelId: this.form.levelId, @@ -288,6 +318,7 @@ export default { console.error('获取表格数据失败:', err); this.tableData = []; }); + }, // 查询按钮点击事件(可根据需求扩展逻辑) @@ -295,8 +326,61 @@ export default { // 清空原有表格数据,重新请求 this.tableData = []; this.$nextTick(() => { - this.getData(); + this.getDataPage(); }); + }, + // 导入 + importExcel() { + this.upload.open = true + }, + // 文件上传中处理 + handleFileUploadProgress(file, fileList) { + console.log('文件上传中:',file, fileList) + this.upload.isUploading = true; + this.upload.fileList = fileList; + this.upload.currentFile = file.raw; + }, + handleFileSuccess() {}, + importTemplate() {}, + // 提交上传文件 + async submitFileForm() { + try { + if (!this.upload.currentFile) { + return this.$message.error('请先选择要上传的文件!') + } + const formData = new FormData() + formData.append('file', this.upload.currentFile) // 文件字段 + formData.append('reportDate', this.form.endTime) // 时间维度字段 + formData.append('levelId', this.form.levelId) // 层级维度字段 + const response = await axios({ + url: process.env.VUE_APP_BASE_API + '/admin-api/lb/index-real-month/actualIndicatorImport', + method: 'post', + data: formData, + headers: { + 'Content-Type': 'multipart/form-data', + 'Authorization': "Bearer " + getAccessToken(), + 'tenant-id': getTenantId(), + }, + timeout: 30000 + }) + // 4. 处理响应结果 + if (response.data.code === 0) { + this.$message.success('文件上传成功!') + // 重置表单 + this.upload.fileList = [] + this.upload.currentFile = null + this.upload.open = false + this.upload.isUploading = false + this.$refs.upload.clearFiles(); + this.getData() + } else { + this.$message.error(`上传失败:${response.data.msg || '未知错误'}`) + } + } catch (error) { + // 5. 异常处理 + console.error('文件上传出错:', error) + this.$message.error('上传失败!') + } } } } diff --git a/src/views/home/components/productBar.vue b/src/views/home/components/productBar.vue index 27034d67..c890afed 100644 --- a/src/views/home/components/productBar.vue +++ b/src/views/home/components/productBar.vue @@ -99,7 +99,7 @@ export default { grid: { top: 35, bottom: 20, - right: 25, + right: 13, }, xAxis: [ { @@ -222,11 +222,11 @@ export default { /* (你的样式代码保持不变) */ .legend { position: absolute; - right: 10px; - top: -5px; + right: 12px; + top: 0px; display: flex; /* 使用 flex 布局让两个图例项并排且对齐 */ - gap: 20px; + gap: 5px; } .legend-item-line { @@ -237,7 +237,7 @@ export default { text-align: left; font-style: normal; position: relative; - padding-left: 20px; + padding-left: 24px; /* 为圆点和线条留出空间 */ display: flex; align-items: center; diff --git a/src/views/home/components/productBottomBar.vue b/src/views/home/components/productBottomBar.vue index a6afb5c5..733cc921 100644 --- a/src/views/home/components/productBottomBar.vue +++ b/src/views/home/components/productBottomBar.vue @@ -121,7 +121,7 @@ export default { .lineFour { top: 5px; - left: 268px; + left: 252px; } .item-button { diff --git a/src/views/home/components/top-product-item.vue b/src/views/home/components/top-product-item.vue index d586362f..f0806b70 100644 --- a/src/views/home/components/top-product-item.vue +++ b/src/views/home/components/top-product-item.vue @@ -71,7 +71,7 @@ export default { // 定义一个映射关系,将后端字段名与前端显示信息关联起来 const dataMap = [ { - key: 'processCost', + key: 'totalCost', unit: '制造成本·元/㎡', route: '/productionCostAnalysis/productionCostAnalysis' }, diff --git a/src/views/home/indicatorSubmissionDetails.vue b/src/views/home/indicatorSubmissionDetails.vue index d526dfc8..f1e699fb 100644 --- a/src/views/home/indicatorSubmissionDetails.vue +++ b/src/views/home/indicatorSubmissionDetails.vue @@ -17,7 +17,7 @@ grid-template-columns:416px 1192px; "> - +