驾驶舱报表&指标填报&接口添加loading

This commit is contained in:
2026-03-11 09:54:39 +08:00
parent 1d5af53e1a
commit 4d3b2b13b8
12 changed files with 629 additions and 294 deletions

View File

@@ -8,7 +8,7 @@
<div style="width: 4px;height: 16px;background: #0B58FF;border-radius: 1px;margin-top: 10px;"></div>
<el-form :inline="true" :model="form" class="demo-form-inline">
<el-form-item label="所属层级">
<el-select v-model="form.levelId" placeholder="请选择">
<el-select v-model="form.levelId" placeholder="请选择" @change='handleLevelChange'>
<el-option v-for="item in levelLList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
@@ -358,6 +358,9 @@ export default {
this.tableData = [];
});
},
handleLevelChange(id) {
this.$emit('updateLevel', id)
},
// 表格单元格数据变更回调
inputChange(val) {
// 安全修改:判断索引是否存在,避免数组越界
@@ -377,7 +380,7 @@ export default {
// 清空并重新请求数据,恢复原始状态
this.$nextTick(() => {
this.tableData = [];
this.getData();
this.getDataPage();
});
},
// 初始化表格列配置核心精准控制inputArea挂载
@@ -498,7 +501,8 @@ export default {
this.upload.open = false
this.upload.isUploading = false
this.$refs.upload.clearFiles();
this.getData()
this.getDataPage();
this.$emit('updateLeft')
} else {
this.$message.error(`上传失败:${response.data.msg || '未知错误'}`)
}

View File

@@ -8,7 +8,7 @@
<div style="width: 4px;height: 16px;background: #0B58FF;border-radius: 1px;margin-top: 10px;"></div>
<el-form :inline="true" :model="form" class="demo-form-inline">
<el-form-item label="所属层级">
<el-select v-model="form.levelId" placeholder="请选择">
<el-select v-model="form.levelId" placeholder="请选择" @change='handleLevelChange'>
<el-option v-for="item in levelLList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
@@ -214,9 +214,10 @@ export default {
// 清空并重新请求数据,恢复原始状态
this.$nextTick(() => {
this.tableData = [];
this.getData();
this.getDataPage();
});
this.$modal.msgSuccess("保存成功");
this.$emit('updateLeft')
}).catch(() => { });
},
// 取消编辑,恢复只读模式
@@ -227,7 +228,7 @@ export default {
// 清空并重新请求数据,恢复原始状态
this.$nextTick(() => {
this.tableData = [];
this.getData();
this.getDataPage();
});
console.log('已取消编辑,恢复原始数据');
},
@@ -238,7 +239,7 @@ export default {
// 清空并重新请求数据,恢复原始状态
this.$nextTick(() => {
this.tableData = [];
this.getData();
this.getDataPage();
});
},
@@ -290,6 +291,7 @@ export default {
getLevelStruc().then((res) => {
this.levelLList = res.data || [];
this.form.levelId = this.levelLList[0].id;
this.$emit('updateLevel', this.levelLList[0].id)
this.getDataPage()
}).catch(err => {
console.error('获取所属层级失败:', err);
@@ -320,6 +322,9 @@ export default {
});
},
handleLevelChange(id) {
this.$emit('updateLevel', id)
},
// 查询按钮点击事件(可根据需求扩展逻辑)
onSubmit() {
@@ -372,7 +377,8 @@ export default {
this.upload.open = false
this.upload.isUploading = false
this.$refs.upload.clearFiles();
this.getData()
this.getDataPage();
this.$emit('updateLeft')
} else {
this.$message.error(`上传失败:${response.data.msg || '未知错误'}`)
}

View File

@@ -27,7 +27,7 @@ export default {
chart: null,
// 固定3条默认数据作为展示模板
parentItemList: [
{ name: "制造成本", targetValue: 0, value: 0, proportion: 0, flag: 0 },
{ name: "制造成本", targetValue: 0, value: 0, proportion: 0, flag: 0 },
{ name: "原片成本", targetValue: 0, value: 0, proportion: 0, flag: 0 },
{ name: "加工成本", targetValue: 0, value: 0, proportion: 0, flag: 0 },
]

View File

@@ -17,7 +17,7 @@
grid-template-columns:416px 1192px;
">
<indicatorCalendar :calendarList="calendarList" />
<indicatorDetails @updateLeft='getData'/>
<indicatorDetails @updateLeft='getData' @updateLevel='getLevel'/>
</div>
</div>
<!-- <div class="top" style="margin-top: -20px; display: flex; gap: 16px">
@@ -78,6 +78,7 @@ export default {
monthData: {},
ytdData: {},
calendarList:{},
levelId:null
};
},
@@ -143,20 +144,21 @@ export default {
this.beilv = _this.clientWidth / 1920;
})();
};
this.getData()
},
methods: {
// 层级变动
getLevel(id) {
this.levelId = id
this.getData()
},
getData() {
getRealMonthCalendar().then((res) => {
getRealMonthCalendar({
levelId: this.levelId
}).then((res) => {
console.log(res, 'res');
this.calendarList = res.data
})
},
handleTimeChange(obj) {
console.log(obj, 'obj');
this.dateData= obj
this.getData()
},
handleClickOutside() {
this.$store.dispatch("app/closeSideBar", { withoutAnimation: false });
},

View File

@@ -207,7 +207,7 @@ export default {
// sort: 1,
trendName: this.trendName,
analysisObject: [
"制造成本",
"制造成本",
],
// paramList: ['制造成本', '财务费用', '销售费用', '管理费用', '运费'],
levelId: this.factory,

View File

@@ -94,7 +94,7 @@ export default {
totalData: {},
trend: [],
relatedData: {},
trendName: '备丶机物料',
trendName: '备丶机物料成本',
};
},

View File

@@ -60,9 +60,9 @@ export default {
data() {
return {
isDropdownShow: false,
selectedProfit: '制造成本', // 选中的名称初始为null
selectedProfit: '制造成本', // 选中的名称初始为null
profitOptions: [
'制造成本',
'制造成本',
'原片成本',
'加工成本',
]