Compare commits

...

4 Commits

Author SHA1 Message Date
d3ff23f764 菜单搜索bug 2026-09-20 10:38:46 +08:00
467eb48cd6 首页费用跳转&页面值绑定问题 2026-09-15 13:33:27 +08:00
8f586cfb23 修改字段 2026-09-04 16:10:02 +08:00
85870cb528 修改部分字段 2026-08-28 15:42:53 +08:00
16 changed files with 50 additions and 40 deletions

View File

@@ -60,7 +60,7 @@ export default {
{name:'单价',unit:'元/㎡'},
{name:'净价',unit:'元/㎡'},
{name:'销量',unit:'万㎡'},
{name:'双镀销量',unit:'万㎡'}
{name:'销量_双镀面板',unit:'万㎡'}
]
};
},

View File

@@ -100,14 +100,14 @@ export default {
const costMapping = [
{
key: 'totalCost', name: '总费用·万元',
path:"/expenseAnalysis/expenseAnalysisBase"
path:"/expenseAnalysis/expenseAnalysis"
},
{
key: 'manageCost', name: '管理费用·万元',
path: "/expenseAnalysis/expenseAnalysisBase"
path: ""
},
{ key: 'saleCost', name: '销售费用·万元', path: "/expenseAnalysis/expenseAnalysisBase" },
{ key: 'financeCost', name: '财务费用·万元', path: "/expenseAnalysis/expenseAnalysisBase" }
{ key: 'saleCost', name: '销售费用·万元', path: "" },
{ key: 'financeCost', name: '财务费用·万元', path: "" }
];
// 遍历映射关系,转换数据

View File

@@ -77,7 +77,7 @@ export default {
completed: 1 // 销量超额达标
},
{
name: "双镀销量",
name: "销量_双镀面板",
targetValue: 0,
value: 0,
proportion: 0,
@@ -113,7 +113,7 @@ export default {
"单价": "unitPrice",
"净价": "netPrice",
"销量": "sales",
"双镀销量": "panel",
"销量_双镀面板": "panel",
"溢价产品销量": "premiumProduct"
};

View File

@@ -164,7 +164,7 @@ export default {
itemStyle: { color: 'rgba(39, 96, 255, 1)' }
},
{
value: 735, name: '双镀销量',
value: 735, name: '销量_双镀面板',
label: {
normal: {
align: 'left',

View File

@@ -53,7 +53,7 @@ export default {
{ unit: "利润总额·万元", targetValue: 16, currentValue: 15.2, progress: 85 },
{ unit: "毛利率·%", targetValue: 16, currentValue: 15.2, progress: 85 },
{ unit: "销量·万㎡", targetValue: 20, currentValue: 16, progress: 80 },
{ unit: "双镀销量·万㎡", targetValue: 15, currentValue: 13.8, progress: 92 }
{ unit: "销量_双镀面板·万㎡", targetValue: 15, currentValue: 13.8, progress: 92 }
],
// 拖拽相关状态
isDragging: false, // 是否正在拖拽

View File

@@ -56,7 +56,7 @@ export default {
progress: 80
},
{
unit: "双镀销量·万㎡",
unit: "销量_双镀面板·万㎡",
targetValue: 15,
currentValue: 13.8,
progress: 92

View File

@@ -114,16 +114,18 @@ export default {
},
updateChart(data) {
// 修复核心:正确获取默认值(调用 factory 函数)
// 错误写法:this.$props.ytdAnalysis.default()
// 正确写法:this.ytdAnalysis 默认值已通过 factory 函数定义,直接兜底
// 数据兜底:确保是数组且长度≥2,否则取 props 默认值
const validData = Array.isArray(data) && data.length >= 2
? data
: this.$props.monthAnalysis; // 直接取 props 默认值
// 提取累计收入(第0项)、累计全成本(第1项)数据
const incomeItem = validData[0] || { title: "营业收入", budget: 0, real: 0, rate: 0, diff: 0 };
const costItem = validData[1] || { title: "全成本", budget: 0, real: 0, rate: 0, diff: 0 };
// 按 title 匹配目标项(不依赖数组顺序,兼容后端数据结构顺序变化)
const list = Array.isArray(validData) ? validData : []
// 营业收入:精确匹配
const incomeItem = list.find(item => item && item.title === '营业收入')
|| { title: "营业收入", budget: 0, real: 0, rate: 0, diff: 0 };
const costItem = list.find(item => item && item.title === '全成本')
|| { title: "全成本", budget: 0, real: 0, rate: 0, diff: 0 };
// 整合flag字段
this.ytdIncomeData = {
@@ -135,9 +137,6 @@ export default {
...costItem,
flag: costItem.rate > 100 ? 1 : 0
};
console.log('累计收入数据:', this.ytdIncomeData);
console.log('累计全成本数据:', this.ytdCostData);
}
}
}

View File

@@ -123,14 +123,18 @@ export default {
},
updateChart(data) {
// 数据兜底:确保是数组且长度≥2
// 数据兜底:确保是数组且长度≥2,否则取 props 默认值
const validData = Array.isArray(data) && data.length >= 2
? data
: this.$props.ytdAnalysis;
// 提取收入(第0项)、全成本(第1项)数据
const incomeItem = validData[0] || { title: "营业收入", budget: 0, real: 0, rate: 0, diff: 0 };
const totalCostItem = validData[1] || { title: "全成本", budget: 0, real: 0, rate: 0, diff: 0 };
// 按 title 匹配目标项(不依赖数组顺序,兼容后端数据结构顺序变化)
const list = Array.isArray(validData) ? validData : []
// 营业收入:精确匹配
const incomeItem = list.find(item => item && item.title === '营业收入')
|| { title: "营业收入", budget: 0, real: 0, rate: 0, diff: 0 };
const totalCostItem = list.find(item => item && item.title === '全成本')
|| { title: "全成本", budget: 0, real: 0, rate: 0, diff: 0 };
// 整合flag字段到收入/全成本数据中
this.incomeData = {
@@ -142,10 +146,6 @@ export default {
...totalCostItem,
flag: totalCostItem.rate >= 100 ? 1 : 0
};
// 调试:确认数据赋值正确
console.log('整合flag后的收入数据:', this.incomeData);
console.log('整合flag后的全成本数据:', this.totalCostData);
}
}
}

View File

@@ -177,8 +177,8 @@ export default {
const requestParams = {
startTime: this.dateData.startTime,
endTime: this.dateData.endTime,
paramName: '双镀销量',
paramList: ['双镀成本', '双镀均价','双镀毛利率'],
paramName: '销量_双镀面板',
paramList: ['双镀成本', '单价_双镀面板','双镀毛利率'],
baseId: this.factory,
};
// 调用接口

View File

@@ -173,7 +173,7 @@ export default {
startTime: this.dateData.startTime,
endTime: this.dateData.endTime,
paramName: '销量',
paramList: ['净价', '单价', '产销率', '双镀销量', '双镀占比', '溢价产品销量', '溢价产品毛利'],
paramList: ['净价', '单价', '产销率', '销量_双镀面板', '双镀占比', '溢价产品销量', '溢价产品毛利'],
baseId: this.factory,
};
// 调用接口

View File

@@ -69,7 +69,7 @@ export default {
{name:'净价',unit:'元/㎡'},
{name:'单价',unit:'元/㎡'},
{name:'产销率',unit:'%'},
{name:'双镀销量',unit:'万㎡'},
{name:'销量_双镀面板',unit:'万㎡'},
{name:'双镀占比',unit:'%'},
{name:'溢价产品销量',unit:'万㎡'},
{name:'溢价产品毛利',unit:'元'},

View File

@@ -63,11 +63,11 @@ export default {
return {
activeButton: 0,
isDropdownShow: false,
selectedProfit: '双镀销量',
selectedProfit: '销量_双镀面板',
profitOptions:[
{name:'双镀销量',unit:'万㎡'},
{name:'销量_双镀面板',unit:'万㎡'},
{name:'双镀成本',unit:'元/㎡'},
{name:'双镀均价',unit:'元/㎡'},
{name:'单价_双镀面板',unit:'元/㎡'},
{name:'双镀毛利率',unit:'元'},
],
unit:'万㎡'

View File

@@ -34,7 +34,7 @@ export default {
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 },
双镀毛利率: { completeRate: 0, diff: 0, real: 0, target: 0, thb: 0 },
})
},
@@ -60,7 +60,7 @@ export default {
indicatorDefs() {
return [
{ key: 'financialCost', name: '双镀成本', unit: '元/㎡'},
{ key: 'financialPrice', name: '双镀均价', unit: '元/㎡'},
{ key: 'financialPrice', name: '单价_双镀面板', unit: '元/㎡'},
{ key: 'financialProfit', name: '双镀毛利率', unit: '%'},
]
},

View File

@@ -78,7 +78,7 @@ export default {
{ key: 'netPrice', name: '净价', unit: '元/㎡', route:'/netPriceAnalysis/netPriceAnalysisBase'},
{ key: 'unitPrice', name: '单价', unit: '元/㎡',route:'/unitPriceAnalysis/unitPriceAnalysisBase' },
{ key: 'productionSales', name: '产销率', unit: '%',route:'/salesVolumeAnalysis/productionSalesBase'},
{ key: 'sdxl', name: '双镀销量', unit: '万㎡',route:'/salesVolumeAnalysis/doublePlatedBase' },
{ key: 'sdxl', name: '销量_双镀面板', unit: '万㎡',route:'/salesVolumeAnalysis/doublePlatedBase' },
{ key: 'freight', name: '双镀占比', unit: '%',route:'/salesVolumeAnalysis/doublePlatedBase' },
{ key: 'cpxl', name: '溢价产品销量', unit: '万㎡',route:null },
{ key: 'premiumProducts', name: '溢价产品毛利', unit: '元',route:null },

View File

@@ -35,7 +35,7 @@ export default {
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 },
双镀毛利率: { completeRate: 0, diff: 0, real: 0, target: 0, thb: 0 },
})
},
@@ -61,7 +61,7 @@ export default {
indicatorDefs() {
return [
{ key: 'financialCost', name: '双镀成本', unit: '元/㎡'},
{ key: 'financialPrice', name: '双镀均价', unit: '元/㎡'},
{ key: 'financialPrice', name: '单价_双镀面板', unit: '元/㎡'},
{ key: 'financialProfit', name: '双镀毛利率', unit: '%'},
]
},

View File

@@ -246,6 +246,7 @@ export default {
// 查询参数
queryParams: {
name: undefined,
status: undefined,
visible: undefined
},
// 表单参数
@@ -286,10 +287,20 @@ export default {
getList() {
this.loading = true;
listMenu(this.queryParams).then(response => {
this.menuList = this.handleTree(response.data, "id");
const data = response.data || [];
// 无搜索条件:后端返回全量菜单,可构建成完整树形展示
// 有搜索条件:后端只返回匹配到的局部数据,父节点可能不在结果集中,
// 此时再走 handleTree 会因父级缺失导致大量数据不显示,故直接平铺展示
this.menuList = this.isSearching() ? data : this.handleTree(data, "id");
this.loading = false;
});
},
/** 是否存在搜索条件 */
isSearching() {
const { name, status } = this.queryParams;
const isEmpty = (val) => val === undefined || val === null || val === '';
return !isEmpty(name) || !isEmpty(status);
},
/** 转换菜单数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {