From c1acba71964f188d27b19c6f58a7699f8b1ccaff Mon Sep 17 00:00:00 2001 From: juzi <819872918@qq.com> Date: Thu, 30 Apr 2026 10:25:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.prod | 2 +- src/views/home/components/budgetDetails.vue | 10 +- src/views/home/components/productBar.vue | 48 +- .../electricityCostAnalysisBase.vue | 2 +- .../operatingLineBarSale.vue | 12 +- .../relatedIndicatorsAnalysis.vue | 6 +- .../inputOutputRatio/inputOutputRatioBase.vue | 2 +- .../netPriceAnalysis/netPriceAnalysisBase.vue | 4 +- .../mfgOverheadSingleCostAnalysis.vue | 2 +- .../originalSheetLabor.vue | 4 +- .../osElectricityCostAnalysis.vue | 2 +- .../singleCombustible.vue | 1 + .../singleProcMfgOverheadCost.vue | 2 +- .../singleProcessingFuel.vue | 3 +- .../dataTrendBarProcessingFuel.vue | 2 +- .../dataTrendBarSingleCombustible.vue | 27 +- .../dataTrendBarSingleFuelDian.vue | 37 +- .../dataTrendBarSingleFuelDian2.vue | 500 ++++++++++++++++++ .../dataTrendSingleFuelDian2.vue | 254 +++++++++ .../relateCombustibleCostAnalysis.vue | 2 +- .../relateSingleCombustible.vue | 7 + .../relatedIndicatorsAnalysis.vue | 15 +- 22 files changed, 868 insertions(+), 76 deletions(-) create mode 100644 src/views/home/productionCostAnalysisComponents/dataTrendBarSingleFuelDian2.vue create mode 100644 src/views/home/productionCostAnalysisComponents/dataTrendSingleFuelDian2.vue diff --git a/.env.prod b/.env.prod index 465fe796..37fed7ac 100644 --- a/.env.prod +++ b/.env.prod @@ -15,7 +15,7 @@ VUE_APP_BASE_API = '' PUBLIC_PATH = '' # 二级部署路径 -VUE_APP_APP_NAME ='yudao-admin' +# VUE_APP_APP_NAME ='yudao-admin' # 多租户的开关 VUE_APP_TENANT_ENABLE = true diff --git a/src/views/home/components/budgetDetails.vue b/src/views/home/components/budgetDetails.vue index 566fc0d5..1efccd3f 100644 --- a/src/views/home/components/budgetDetails.vue +++ b/src/views/home/components/budgetDetails.vue @@ -81,13 +81,9 @@
将文件拖到此处,或点击上传
- 仅允许导入xls、xlsx格式文件。 + 仅允许导入{{timeType==='month'?'月':'年'}}预算!仅允许导入xls、xlsx格式文件!
- - 月预算 - 年预算 -
@@ -143,7 +139,6 @@ export default { title: "预算填报导入", fileList:[], currentFile:null, - timeDim: 2, // HTTP 上传中(点击确定后 axios 上传,展示不确定进度条) httpUploading: false }, @@ -530,7 +525,7 @@ export default { try { const formData = new FormData() formData.append('file', this.upload.currentFile) // 文件字段 - formData.append('timeDim', this.upload.timeDim) // 年月维度字段 + formData.append('timeDim', this.timeType === 'month'?2:3) // 年月维度字段 formData.append('reportDate', this.form.endTime) // 时间维度字段 formData.append('levelId', this.form.levelId) // 层级维度字段 const response = await axios({ @@ -549,7 +544,6 @@ export default { this.$message.success('文件上传成功!') // 重置表单 this.upload.fileList = [] - this.upload.timeDim = 2 this.upload.currentFile = null this.upload.open = false this.$refs.upload.clearFiles(); diff --git a/src/views/home/components/productBar.vue b/src/views/home/components/productBar.vue index ac41fa9c..7a0f10ca 100644 --- a/src/views/home/components/productBar.vue +++ b/src/views/home/components/productBar.vue @@ -156,30 +156,6 @@ export default { } }, series: [ - { - name: '实际', - type: 'line', - // stack: 'Total', // 趋势图通常不需要堆叠 - symbol: 'circle', - symbolSize: 8, - lineStyle: { - color: 'rgba(255, 132, 0, 1)', // 加深颜色 - width: 2, - }, - itemStyle: { - color: 'rgba(255, 132, 0, 1)', - borderColor: '#fff', - borderWidth: 2, - }, - areaStyle: { - opacity: 0.3, - color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ - { offset: 0, color: 'rgba(255, 132, 0, .5)' }, - { offset: 1, color: 'rgba(255, 132, 0, 0)' }, - ]), - }, - data: realData // 使用提取出的 "实际" 数据 - }, { name: '预算', type: 'line', @@ -205,6 +181,30 @@ export default { }, data: targetData // 使用提取出的 "目标" 数据 }, + { + name: '实际', + type: 'line', + // stack: 'Total', // 趋势图通常不需要堆叠 + symbol: 'circle', + symbolSize: 8, + lineStyle: { + color: 'rgba(255, 132, 0, 1)', // 加深颜色 + width: 2, + }, + itemStyle: { + color: 'rgba(255, 132, 0, 1)', + borderColor: '#fff', + borderWidth: 2, + }, + areaStyle: { + opacity: 0.3, + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + { offset: 0, color: 'rgba(255, 132, 0, .5)' }, + { offset: 1, color: 'rgba(255, 132, 0, 0)' }, + ]), + }, + data: realData // 使用提取出的 "实际" 数据 + } ] }; diff --git a/src/views/home/electricityCostAnalysis/electricityCostAnalysisBase.vue b/src/views/home/electricityCostAnalysis/electricityCostAnalysisBase.vue index 0c1b4ea7..d0740d41 100644 --- a/src/views/home/electricityCostAnalysis/electricityCostAnalysisBase.vue +++ b/src/views/home/electricityCostAnalysis/electricityCostAnalysisBase.vue @@ -91,7 +91,7 @@ export default { totalData: {}, trend: [], relatedData: {}, - trendName: '原片电费' + trendName: '总电费' }; }, diff --git a/src/views/home/expenseAnalysisComponents/operatingLineBarSale.vue b/src/views/home/expenseAnalysisComponents/operatingLineBarSale.vue index 6f7f68f9..91385780 100644 --- a/src/views/home/expenseAnalysisComponents/operatingLineBarSale.vue +++ b/src/views/home/expenseAnalysisComponents/operatingLineBarSale.vue @@ -11,7 +11,17 @@ export default { return { myChart: null, // 存储图表实例 resizeHandler: null, // 存储resize事件处理函数 - isMounted: false // 图表挂载标志,避免过早执行 + isMounted: false, // 图表挂载标志,避免过早执行 + baseNameToIndexMap: { + '宜兴': 7, + '漳州': 8, + '自贡': 3, + '桐城': 2, + '洛阳': 9, + '合肥': 5, + '宿迁': 6, + '秦皇岛': 10 + } }; }, props: { diff --git a/src/views/home/fullCostAnalysisComponents/relatedIndicatorsAnalysis.vue b/src/views/home/fullCostAnalysisComponents/relatedIndicatorsAnalysis.vue index 6e38b81d..87ad39a4 100644 --- a/src/views/home/fullCostAnalysisComponents/relatedIndicatorsAnalysis.vue +++ b/src/views/home/fullCostAnalysisComponents/relatedIndicatorsAnalysis.vue @@ -75,9 +75,9 @@ export default { indicatorDefs() { return [ { key: 'productionCost', name: '制造成本', unit: '元/㎡', route:'/productionCostAnalysis/productionCostAnalysisBase'}, - { key: 'financialCost', name: '财务费用', unit: '万元',route:'/expenseAnalysis/expenseAnalysisBase' }, - { key: 'saleCost', name: '销售费用', unit: '万元',route:'/expenseAnalysis/expenseAnalysisBase'}, - { key: 'manageCost', name: '管理费用', unit: '万元',route:'/expenseAnalysis/expenseAnalysisBase' }, + { key: 'financialCost', name: '财务费用', unit: '万元',route:null }, + { key: 'saleCost', name: '销售费用', unit: '万元',route:null}, + { key: 'manageCost', name: '管理费用', unit: '万元',route:null}, { key: 'freight', name: '运费', unit: '元/㎡',route:null }, ] }, diff --git a/src/views/home/inputOutputRatio/inputOutputRatioBase.vue b/src/views/home/inputOutputRatio/inputOutputRatioBase.vue index c1815289..367cf46f 100644 --- a/src/views/home/inputOutputRatio/inputOutputRatioBase.vue +++ b/src/views/home/inputOutputRatio/inputOutputRatioBase.vue @@ -89,7 +89,7 @@ export default { value: 100, factory: null, dateData: {}, - index: '加工成品率', + index: '投入产出率', monthData: undefined, ytdData: undefined, monthAnalysis: [], diff --git a/src/views/home/netPriceAnalysis/netPriceAnalysisBase.vue b/src/views/home/netPriceAnalysis/netPriceAnalysisBase.vue index 2a7ff90b..70f886d7 100644 --- a/src/views/home/netPriceAnalysis/netPriceAnalysisBase.vue +++ b/src/views/home/netPriceAnalysis/netPriceAnalysisBase.vue @@ -37,8 +37,8 @@ gap: 12px; grid-template-columns: 804px 804px; "> - - + +
diff --git a/src/views/home/productionCostAnalysis/mfgOverheadSingleCostAnalysis.vue b/src/views/home/productionCostAnalysis/mfgOverheadSingleCostAnalysis.vue index cffb4c51..61425461 100644 --- a/src/views/home/productionCostAnalysis/mfgOverheadSingleCostAnalysis.vue +++ b/src/views/home/productionCostAnalysis/mfgOverheadSingleCostAnalysis.vue @@ -179,7 +179,7 @@ export default { const requestParams = { startTime: this.dateData.startTime, endTime: this.dateData.endTime, - trendName: this.trendName, + trendName: '原片'+this.overheadName+'成本', analysisObject: ['原片'+this.overheadName], levelId: this.factory, isOriginal:0,//0:原片 1:加工 diff --git a/src/views/home/productionCostAnalysis/originalSheetLabor.vue b/src/views/home/productionCostAnalysis/originalSheetLabor.vue index 1c95ecad..a2bf92cc 100644 --- a/src/views/home/productionCostAnalysis/originalSheetLabor.vue +++ b/src/views/home/productionCostAnalysis/originalSheetLabor.vue @@ -179,12 +179,12 @@ export default { // 调用接口 getSingleMaterialCostAnalysis(requestParams).then((res) => { this.monData = res.data.currentMonthData.find(item => { - return item.name === "人工成本"; + return item.name === "原片人工成本"; }); console.log('this.monData', this.monData); this.totalData = res.data.totalMonthData.find(item => { - return item.name === "人工成本"; + return item.name === "原片人工成本"; }); this.trend = res.data.dataTrend }); diff --git a/src/views/home/productionCostAnalysis/osElectricityCostAnalysis.vue b/src/views/home/productionCostAnalysis/osElectricityCostAnalysis.vue index 47e7de2c..01682641 100644 --- a/src/views/home/productionCostAnalysis/osElectricityCostAnalysis.vue +++ b/src/views/home/productionCostAnalysis/osElectricityCostAnalysis.vue @@ -60,7 +60,7 @@ import changeBase from "../components/changeBase.vue"; import monthlyOverview from "../productionCostAnalysisComponents/monthlyOverview.vue"; import totalOverview from "../productionCostAnalysisComponents/totalOverview.vue"; import relateSingleFuelCostAnalysis from "../productionCostAnalysisComponents/relateSingleFuelCostAnalysisDian.vue"; -import dataTrend from "../productionCostAnalysisComponents/dataTrendSingleFuelDian.vue"; +import dataTrend from "../productionCostAnalysisComponents/dataTrendSingleFuelDian2.vue"; import { mapState } from "vuex"; import { getCostAnalysisData } from '@/api/cockpit' import moment from "moment"; diff --git a/src/views/home/productionCostAnalysis/singleCombustible.vue b/src/views/home/productionCostAnalysis/singleCombustible.vue index 1d6229bf..e770a5d8 100644 --- a/src/views/home/productionCostAnalysis/singleCombustible.vue +++ b/src/views/home/productionCostAnalysis/singleCombustible.vue @@ -275,6 +275,7 @@ export default { }, handlefuelChange(val) { this.fuelName = val + if(this.fuelName === '水' && this.trendName === '热耗') return this.getData() }, selectChange(data) { diff --git a/src/views/home/productionCostAnalysis/singleProcMfgOverheadCost.vue b/src/views/home/productionCostAnalysis/singleProcMfgOverheadCost.vue index 5d2b4247..90859067 100644 --- a/src/views/home/productionCostAnalysis/singleProcMfgOverheadCost.vue +++ b/src/views/home/productionCostAnalysis/singleProcMfgOverheadCost.vue @@ -167,7 +167,7 @@ export default { startTime: this.dateData.startTime, endTime: this.dateData.endTime, trendName: '加工'+this.overheadName+'成本', - analysisObject: ['加工制造费用成本'], + analysisObject: ['加工'+this.overheadName+'成本'], levelId: this.factory, isOriginal:1,//0:原片 1:加工 }; diff --git a/src/views/home/productionCostAnalysis/singleProcessingFuel.vue b/src/views/home/productionCostAnalysis/singleProcessingFuel.vue index 71525927..c70ad6e2 100644 --- a/src/views/home/productionCostAnalysis/singleProcessingFuel.vue +++ b/src/views/home/productionCostAnalysis/singleProcessingFuel.vue @@ -90,7 +90,7 @@ export default { totalData: {}, trend: [], relatedData: {}, - trendName: '采购单价', + trendName: '加工电成本', fuelName:'', fuelOptions: [ {value:'电',label:'电'}, @@ -227,6 +227,7 @@ export default { }, handleFuelChange(val) { this.fuelName = val + if(this.fuelName === '水' && this.trendName === '加工电成本') return this.getData() }, selectChange(data) { diff --git a/src/views/home/productionCostAnalysisComponents/dataTrendBarProcessingFuel.vue b/src/views/home/productionCostAnalysisComponents/dataTrendBarProcessingFuel.vue index 8931edde..c2ba430a 100644 --- a/src/views/home/productionCostAnalysisComponents/dataTrendBarProcessingFuel.vue +++ b/src/views/home/productionCostAnalysisComponents/dataTrendBarProcessingFuel.vue @@ -60,7 +60,7 @@ export default { data() { return { isDropdownShow: false, - selectedProfit: '电', // 选中的名称,初始为null + selectedProfit: '加工燃料成本', // 选中的名称,初始为null profitOptions: [ '加工燃料成本', '电', diff --git a/src/views/home/productionCostAnalysisComponents/dataTrendBarSingleCombustible.vue b/src/views/home/productionCostAnalysisComponents/dataTrendBarSingleCombustible.vue index 6faa6851..089080f4 100644 --- a/src/views/home/productionCostAnalysisComponents/dataTrendBarSingleCombustible.vue +++ b/src/views/home/productionCostAnalysisComponents/dataTrendBarSingleCombustible.vue @@ -67,11 +67,21 @@ export default { watch: { fuelName: { handler(newVal) { - this.profitOptions.forEach(item => { - if (item.name === this.selectedProfit) { - this.unit = item.unit - } - }) + // 检查当前选中的项是否在新的选项列表中 + const currentExists = this.profitOptions.some(item => item.name === this.selectedProfit); + + if (currentExists) { + // 存在则更新单位 + const currentItem = this.profitOptions.find(item => item.name === this.selectedProfit); + this.unit = currentItem.unit; + } else { + // 不存在则重置为第一个选项(采购单价) + const firstOption = this.profitOptions[0]; + this.selectedProfit = firstOption.name; + this.unit = firstOption.unit; + // 同时通知父组件更新 + this.$emit('handleGetItemData', firstOption.name); + } } } }, @@ -85,6 +95,13 @@ export default { { name: '消耗量', unit: '吨'}, { name: '热耗', unit: '千卡/千克'} ] + }else if(this.fuelName === '水'){ + return [ + { name: '采购单价', unit: '元/m³'}, + { name: '产量', unit: '㎡'}, + { name: '单耗', unit: 'm³/㎡'}, + { name: '消耗量', unit: 'm³'} + ] }else{ return [ { name: '采购单价', unit: '元/m³'}, diff --git a/src/views/home/productionCostAnalysisComponents/dataTrendBarSingleFuelDian.vue b/src/views/home/productionCostAnalysisComponents/dataTrendBarSingleFuelDian.vue index 61784400..85228087 100644 --- a/src/views/home/productionCostAnalysisComponents/dataTrendBarSingleFuelDian.vue +++ b/src/views/home/productionCostAnalysisComponents/dataTrendBarSingleFuelDian.vue @@ -60,36 +60,36 @@ export default { data() { return { isDropdownShow: false, - selectedProfit: '', // 初始化为空,由 watch 填充 - unit: '' // 初始化为空,由 watch 填充 + selectedProfit: '', + unit: '' }; }, watch: { - // 监听 fuelName 变化,动态设置默认选中项和单位 fuelName: { - handler(newVal) { - if (newVal === '电') { - this.selectedProfit = '原片电成本'; - this.unit = '元/㎡'; + handler() { + // 检查当前选中的项是否在新的选项列表中 + const currentExists = this.profitOptions.some(item => item.name === this.selectedProfit); + + if (currentExists) { + // 存在则更新单位 + const currentItem = this.profitOptions.find(item => item.name === this.selectedProfit); + this.unit = currentItem.unit; } else { - this.selectedProfit = '采购单价'; - this.unit = '元/m³'; // 注意:原代码非电情况下单位逻辑可能需要确认,这里暂定为 m³ 或根据 profitOptions 动态获取 - - // 更严谨的做法是根据 profitOptions 查找默认项的单位 - const defaultOption = this.profitOptions.find(item => item.name === this.selectedProfit); - if (defaultOption) { - this.unit = defaultOption.unit; - } + // 不存在则重置为第一个选项 + const firstOption = this.profitOptions[0]; + this.selectedProfit = firstOption.name; + this.unit = firstOption.unit; + // 通知父组件更新数据 + this.$emit('handleGetItemData', firstOption.name); } - }, - immediate: true // 组件创建时立即执行一次,解决初始化取值问题 + } } }, computed: { profitOptions() { if (this.fuelName === '电') { return [ - { name: '原片电成本', unit: '元/㎡' }, + // { name: '加工电成本', unit: '元/㎡' }, { name: '采购单价', unit: '元/度' }, { name: '产量', unit: '㎡' }, { name: '单耗', unit: '度/㎡' }, @@ -97,6 +97,7 @@ export default { ] } else { return [ + // { name: '加工水成本', unit: '元/㎡' }, { name: '采购单价', unit: '元/m³' }, { name: '产量', unit: '㎡' }, { name: '单耗', unit: 'm³/㎡' }, diff --git a/src/views/home/productionCostAnalysisComponents/dataTrendBarSingleFuelDian2.vue b/src/views/home/productionCostAnalysisComponents/dataTrendBarSingleFuelDian2.vue new file mode 100644 index 00000000..1be3b815 --- /dev/null +++ b/src/views/home/productionCostAnalysisComponents/dataTrendBarSingleFuelDian2.vue @@ -0,0 +1,500 @@ + + + + + diff --git a/src/views/home/productionCostAnalysisComponents/dataTrendSingleFuelDian2.vue b/src/views/home/productionCostAnalysisComponents/dataTrendSingleFuelDian2.vue new file mode 100644 index 00000000..020672f6 --- /dev/null +++ b/src/views/home/productionCostAnalysisComponents/dataTrendSingleFuelDian2.vue @@ -0,0 +1,254 @@ + + + + + + + diff --git a/src/views/home/productionCostAnalysisComponents/relateCombustibleCostAnalysis.vue b/src/views/home/productionCostAnalysisComponents/relateCombustibleCostAnalysis.vue index f4dff1e4..96468c8d 100644 --- a/src/views/home/productionCostAnalysisComponents/relateCombustibleCostAnalysis.vue +++ b/src/views/home/productionCostAnalysisComponents/relateCombustibleCostAnalysis.vue @@ -71,7 +71,7 @@ export default { { key: 'naturalGas', name: '天然气', label:'天然气成本',unit: '元/㎡',route:'singleCombustible'}, { key: 'lng', name: 'LNG液化天然气', label:'LNG液化天然气成本', unit: '元/㎡',route:'singleCombustible'}, { key: 'heavyOil', name: '重油', label:'重油成本', unit: '元/㎡',route:'singleCombustible'}, - { key: 'water', name: '水', label:'水成本', unit: '元/m³',route:'singleCombustible'} + { key: 'water', name: '水', label:'原片水成本', unit: '元/m³',route:'singleCombustible'} ] }, indicators() { diff --git a/src/views/home/productionCostAnalysisComponents/relateSingleCombustible.vue b/src/views/home/productionCostAnalysisComponents/relateSingleCombustible.vue index 6099944d..c4eb47f4 100644 --- a/src/views/home/productionCostAnalysisComponents/relateSingleCombustible.vue +++ b/src/views/home/productionCostAnalysisComponents/relateSingleCombustible.vue @@ -94,6 +94,13 @@ export default { { key: 'haoNum', name: '消耗量', unit: '吨'}, { key: 'heatConsumption', name: '热耗', unit: '千卡/千克'}, ] + }else if(this.fuelName === '水'){ + return [ + { key: 'unitPrice', name: '采购单价', unit: '元/m³'}, + { key: 'product', name: '产量', unit: '㎡'}, + { key: 'unitHao', name: '单耗', unit: 'm³/㎡'}, + { key: 'haoNum', name: '消耗量', unit: 'm³'} + ] }else{ return [ { key: 'unitPrice', name: '采购单价', unit: '元/m³'}, diff --git a/src/views/home/salesVolumeAnalysisComponents/relatedIndicatorsAnalysis.vue b/src/views/home/salesVolumeAnalysisComponents/relatedIndicatorsAnalysis.vue index 360449ad..892b0ae8 100644 --- a/src/views/home/salesVolumeAnalysisComponents/relatedIndicatorsAnalysis.vue +++ b/src/views/home/salesVolumeAnalysisComponents/relatedIndicatorsAnalysis.vue @@ -63,7 +63,8 @@ export default { real: 0, target: 0, thb: 0 - } + }, + currentTab: 'month' } }, computed: { @@ -123,8 +124,13 @@ export default { // 监听 relatedData 变化(异步加载场景),同步更新月度数据 relatedData: { handler(newVal) { - this.relatedDetailData = newVal.relatedMon || {}; + if (this.currentTab === 'month') { + this.relatedDetailData = this.relatedData.relatedMon || {}; + } else { + this.relatedDetailData = this.relatedData.relatedTotal || {}; + } }, + immediate: true, deep: true }, @@ -139,17 +145,18 @@ export default { // 无需额外操作,初始化数据已赋值 }, methods: { - handleRoute(path) { + handleDashboardClick(path) { this.$router.push({ path: path, query: { - factory: this.$route.query.factory ? Number(this.$route.query.factory) : 5, + factory: this.$route.query.factory ? this.$route.query.factory : 5, dateData: this.dateData } }) }, handleChange(value) { console.log('value', value, this.relatedData); + this.currentTab = value; if (value === 'month') { this.relatedDetailData = this.relatedData.relatedMon || {}; } else {