From b36acbf1e6309f838608fb407eca6bfb9ba4d5f4 Mon Sep 17 00:00:00 2001 From: juzi <819872918@qq.com> Date: Fri, 13 Mar 2026 09:44:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=B6=E9=80=A0=E6=88=90=E6=9C=AC=E5=88=86?= =?UTF-8?q?=E6=9E=90=E4=B8=8B=E6=89=80=E6=9C=89=E5=8D=95=E9=A1=B9=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.dev | 4 +- src/views/home/components/budgetDetails.vue | 4 +- .../SIMFRMCostAnalysis.vue | 11 ++- .../mfgOverheadSingleCostAnalysis.vue | 73 ++++++------------- .../singleCombustible.vue | 63 ++++++---------- .../singleProcAuxMatCost.vue | 61 ++++++---------- .../singleProcMfgOverheadCost.vue | 34 +++++---- .../singleProcessingFuel.vue | 48 +++++++++--- .../noRouterHeader.vue | 28 +++---- .../relateSingleFuelCostAnalysis.vue | 2 +- .../totalOverview.vue | 2 +- src/views/login.vue | 8 +- 12 files changed, 148 insertions(+), 190 deletions(-) diff --git a/.env.dev b/.env.dev index 1a3e9c4f..7c7b6af3 100644 --- a/.env.dev +++ b/.env.dev @@ -10,11 +10,11 @@ VUE_APP_TITLE = 洛玻集团驾驶舱 # VUE_APP_BASE_API = 'http://172.16.33.83:7070' # 杨姗姗 -VUE_APP_BASE_API = 'http://172.16.20.218:7070' +# VUE_APP_BASE_API = 'http://172.16.20.218:7070' # 小田 # VUE_APP_BASE_API = 'http://172.16.19.232:7070' # 测试 -# VUE_APP_BASE_API = 'http://192.168.0.35:8080' +VUE_APP_BASE_API = 'http://192.168.0.35:8080' # 路由懒加载 diff --git a/src/views/home/components/budgetDetails.vue b/src/views/home/components/budgetDetails.vue index 12695e42..66f031e3 100644 --- a/src/views/home/components/budgetDetails.vue +++ b/src/views/home/components/budgetDetails.vue @@ -391,10 +391,10 @@ export default { { prop: 'type', label: '指标类型', align: 'center' }, { prop: 'name', label: '指标名称', align: 'center' }, { prop: 'unit', label: '单位', align: 'center', filter: publicFormatter('lb_dw') }, - { prop: 'target', label: '预估值', align: 'center' }, + { prop: 'target', label: '预算值', align: 'center' }, ]; if (isEdit) { - // 编辑模式:仅给「预估值」列添加inputArea(精准挂载,避免无效配置) + // 编辑模式:仅给「预算值」列添加inputArea(精准挂载,避免无效配置) this.tableProps = baseTableProps.map(item => { if (item.prop === 'target') { // 只给需要编辑的列添加子组件 return { diff --git a/src/views/home/productionCostAnalysis/SIMFRMCostAnalysis.vue b/src/views/home/productionCostAnalysis/SIMFRMCostAnalysis.vue index 43a4b14b..81ee86a6 100644 --- a/src/views/home/productionCostAnalysis/SIMFRMCostAnalysis.vue +++ b/src/views/home/productionCostAnalysis/SIMFRMCostAnalysis.vue @@ -2,7 +2,9 @@
-
-
-->
diff --git a/src/views/home/productionCostAnalysis/singleCombustible.vue b/src/views/home/productionCostAnalysis/singleCombustible.vue index 4f8825fc..f7a76e7f 100644 --- a/src/views/home/productionCostAnalysis/singleCombustible.vue +++ b/src/views/home/productionCostAnalysis/singleCombustible.vue @@ -2,7 +2,9 @@
-
0 && this.$store.getters.levelList[0].id !== 1) { @@ -205,9 +213,7 @@ export default { // index: this.index, // sort: 1, trendName: this.trendName, - analysisObject: [ - this.$route.query.name ? this.$route.query.name + '成本' : '天然气成本' - ], + analysisObject: [this.fuelName + '成本'], // paramList: ['制造成本', '财务费用', '销售费用', '管理费用', '运费'], levelId: this.factory, // baseId: Number(this.factory), @@ -215,53 +221,22 @@ export default { // 调用接口 getSingleMaterialAnalysis(requestParams).then((res) => { this.monData = res.data.currentMonthData.find(item => { - if (this.$route.query.name) { - // 如果有查询参数,查找 "原料" + 查询参数 的项 - return item.name === this.$route.query.name + '成本'; - } else { - // 如果没有查询参数,查找 name 为 "原料硅砂" 的项 - return item.name === '天然气成本'; - } + return item.name === this.fuelName + '成本'; }); - console.log('this.monData', this.monData); - this.totalData = res.data.totalMonthData.find(item => { - if (this.$route.query.name) { - // 如果有查询参数,查找 "原料" + 查询参数 的项 - return item.name === this.$route.query.name + '成本'; - } else { - // 如果没有查询参数,查找 name 为 "原料硅砂" 的项 - return item.name === '天然气成本'; - } + return item.name === this.fuelName + '成本'; }); - // this.relatedMon = res.data.relatedMon this.relatedData = { relatedMon: res.data.currentMonthData.filter(item => { - if (this.$route.query.name) { - // 如果有查询参数,查找 "原料" + 查询参数 的项 - return item.name !== this.$route.query.name + '成本'; - } else { - // 如果没有查询参数,查找 name 为 "原料硅砂" 的项 - return item.name !== '天然气成本'; - } + return item.name !== this.fuelName + '成本'; }), // 兜底月度数据 relatedTotal: res.data.totalMonthData.filter(item => { - if (this.$route.query.name) { - // 如果有查询参数,查找 "原料" + 查询参数 的项 - return item.name !== this.$route.query.name + '成本'; - } else { - // 如果没有查询参数,查找 name 为 "原料硅砂" 的项 - return item.name !== '天然气成本'; - } + return item.name !== this.fuelName + '成本'; }) // 兜底累计数据 } - - ; - this.trend = res.data.dataTrend }); }, - handleTimeChange(obj) { this.month = obj.targetMonth this.dateData = { @@ -272,6 +247,10 @@ export default { this.getData() }, + handlefuelChange(val) { + this.fuelName = val + this.getData() + }, selectChange(data) { console.log('选中的数据:', data); this.factory = data diff --git a/src/views/home/productionCostAnalysis/singleProcAuxMatCost.vue b/src/views/home/productionCostAnalysis/singleProcAuxMatCost.vue index 24bae2d2..2c28b3cf 100644 --- a/src/views/home/productionCostAnalysis/singleProcAuxMatCost.vue +++ b/src/views/home/productionCostAnalysis/singleProcAuxMatCost.vue @@ -2,7 +2,9 @@
-
0 && this.$store.getters.levelList[0].id !== 1) { @@ -204,10 +211,8 @@ export default { endTime: this.dateData.endTime, // index: this.index, // sort: 1, - trendName: this.$route.query.name ? this.$route.query.name + '成本' + this.trendName : '镀膜液成本' + this.trendName, - analysisObject: [ - this.$route.query.name ? this.$route.query.name + '成本' : '镀膜液成本' - ], + trendName: this.auxMatName + '成本' + this.trendName, + analysisObject: [this.auxMatName + '成本'], // paramList: ['制造成本', '财务费用', '销售费用', '管理费用', '运费'], levelId: this.factory, // baseId: Number(this.factory), @@ -215,49 +220,21 @@ export default { // 调用接口 getSingleMaterialAnalysis(requestParams).then((res) => { this.monData = res.data.currentMonthData.find(item => { - if (this.$route.query.name) { - // 如果有查询参数,查找 "原料" + 查询参数 的项 - return item.name === this.$route.query.name + '成本' - } else { - // 如果没有查询参数,查找 name 为 "原料硅砂" 的项 - return item.name === '镀膜液成本'; - } + return item.name === this.auxMatName + '成本' }); - console.log('this.monData', this.monData); this.totalData = res.data.totalMonthData.find(item => { - if (this.$route.query.name) { - // 如果有查询参数,查找 "原料" + 查询参数 的项 - return item.name === this.$route.query.name + '成本' - } else { - // 如果没有查询参数,查找 name 为 "原料硅砂" 的项 - return item.name === '镀膜液成本'; - } + return item.name === this.auxMatName + '成本' }); // this.relatedMon = res.data.relatedMon this.relatedData = { relatedMon: res.data.currentMonthData.filter(item => { - if (this.$route.query.name) { - // 如果有查询参数,查找 "原料" + 查询参数 的项 - return item.name !== this.$route.query.name + '成本' - } else { - // 如果没有查询参数,查找 name 为 "原料硅砂" 的项 - return item.name === '镀膜液成本'; - } + return item.name !== this.auxMatName + '成本' }), // 兜底月度数据 relatedTotal: res.data.totalMonthData.filter(item => { - if (this.$route.query.name) { - // 如果有查询参数,查找 "原料" + 查询参数 的项 - return item.name !== this.$route.query.name + '成本' - } else { - // 如果没有查询参数,查找 name 为 "原料硅砂" 的项 - return item.name !== '镀膜液成本'; - } + return item.name !== this.auxMatName + '成本' }) // 兜底累计数据 } - - ; - this.trend = res.data.dataTrend }); }, @@ -272,6 +249,10 @@ export default { this.getData() }, + handleAuxMatChange(val) { + this.auxMatName = val + this.getData() + }, selectChange(data) { console.log('选中的数据:', data); this.factory = data diff --git a/src/views/home/productionCostAnalysis/singleProcMfgOverheadCost.vue b/src/views/home/productionCostAnalysis/singleProcMfgOverheadCost.vue index 792b03c7..b3ff9ee8 100644 --- a/src/views/home/productionCostAnalysis/singleProcMfgOverheadCost.vue +++ b/src/views/home/productionCostAnalysis/singleProcMfgOverheadCost.vue @@ -2,7 +2,9 @@
-
0 && this.$store.getters.levelList[0].id !== 1) { @@ -170,22 +179,14 @@ export default { this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined }, methods: { - changeItem(item) { - console.log('item', item); - - this.trendName = item - this.getData() - }, getData() { const requestParams = { startTime: this.dateData.startTime, endTime: this.dateData.endTime, // index: this.index, // sort: 1, - trendName: this.trendName, - analysisObject: [ - '加工制造费用成本' - ], + trendName: this.overheadName+'成本', + analysisObject: ['加工制造费用成本'], // paramList: ['制造成本', '财务费用', '销售费用', '管理费用', '运费'], levelId: this.factory, // baseId: Number(this.factory), @@ -195,13 +196,10 @@ export default { this.monData = res.data.currentMonthData.find(item => { return item.name === "加工制造费用成本"; }); - console.log('this.monData', this.monData); this.totalData = res.data.totalMonthData.find(item => { return item.name === "加工制造费用成本"; }); - // this.relatedMon = res.data.relatedMon - ; this.trend = res.data.dataTrend }); }, @@ -216,6 +214,10 @@ export default { this.getData() }, + handleOverheadChange(val) { + this.overheadName = val + this.getData() + }, selectChange(data) { console.log('选中的数据:', data); this.factory = data diff --git a/src/views/home/productionCostAnalysis/singleProcessingFuel.vue b/src/views/home/productionCostAnalysis/singleProcessingFuel.vue index 072ffa31..d19edb67 100644 --- a/src/views/home/productionCostAnalysis/singleProcessingFuel.vue +++ b/src/views/home/productionCostAnalysis/singleProcessingFuel.vue @@ -2,7 +2,9 @@
-
0 && this.$store.getters.levelList[0].id !== 1) { @@ -205,9 +211,7 @@ export default { // index: this.index, // sort: 1, trendName: this.trendName, - analysisObject: [ - this.$route.query.name ? this.$route.query.name + '成本' : '电成本' - ], + analysisObject: [this.fuelName + '成本'], // paramList: ['制造成本', '财务费用', '销售费用', '管理费用', '运费'], levelId: this.factory, // baseId: Number(this.factory), @@ -215,20 +219,36 @@ export default { // 调用接口 getSingleMaterialAnalysis(requestParams).then((res) => { this.monData = res.data.currentMonthData.find(item => { - return item.name === "原片电成本"; + if (this.fuelName === '电') { + return item.name === '原片' + this.fuelName + '成本'; + }else{ + return item.name === this.fuelName + '成本'; + } + }); - console.log('this.monData', this.monData); this.totalData = res.data.totalMonthData.find(item => { - return item.name === "原片电成本"; + if (this.fuelName === '电') { + return item.name === '原片' + this.fuelName + '成本'; + }else{ + return item.name === this.fuelName + '成本'; + } }); // this.relatedMon = res.data.relatedMon this.relatedData = { relatedMon: res.data.currentMonthData.filter(item => { - return item.name !== "原片电成本"; + if (this.fuelName === '电') { + return item.name !== '原片' + this.fuelName + '成本'; + }else{ + return item.name !== this.fuelName + '成本'; + } }), // 兜底月度数据 relatedTotal: res.data.totalMonthData.filter(item => { - return item.name !== "原片电成本"; + if (this.fuelName === '电') { + return item.name !== '原片' + this.fuelName + '成本'; + }else{ + return item.name !== this.fuelName + '成本'; + } }) // 兜底累计数据 } @@ -248,6 +268,10 @@ export default { this.getData() }, + handleFuelChange(val) { + this.fuelName = val + this.getData() + }, selectChange(data) { console.log('选中的数据:', data); this.factory = data diff --git a/src/views/home/productionCostAnalysisComponents/noRouterHeader.vue b/src/views/home/productionCostAnalysisComponents/noRouterHeader.vue index 9cc7aaaa..316e557c 100644 --- a/src/views/home/productionCostAnalysisComponents/noRouterHeader.vue +++ b/src/views/home/productionCostAnalysisComponents/noRouterHeader.vue @@ -27,9 +27,9 @@
- + @@ -67,9 +67,13 @@ export default { type: Object, default: () => ({}) }, - meterialName:{ + selectName:{ type: String, - default: '硅砂' + default: '' + }, + selectOptions: { + type: Array, + default: () => [] } }, data() { @@ -78,14 +82,7 @@ export default { timeTimer: null, date: Date.now(), // 使用当前时间戳作为初始值 activeTime: 1, // 默认月维度(0=日,1=月,2=年) - materialValue:'硅砂', - materialOptions: [ - {value:'硅砂',label:'硅砂'}, - {value:'海砂',label:'海砂'}, - {value:'纯碱',label:'纯碱'}, - {value:'白云石',label:'白云石'}, - {value:'石灰石',label:'石灰石'} - ] + selectValue:'', } }, watch: { @@ -109,11 +106,11 @@ export default { } } }, - meterialName:{ + selectName:{ immediate: true, // 初始化时立即执行 handler(newVal) { if (newVal) { - this.materialValue = newVal; + this.selectValue = newVal; } } } @@ -223,7 +220,7 @@ export default { this.$emit('timeRangeChange', timeRange); }, selectMeterial(val){ - this.$emit('meterialChange', val); + this.$emit('selectChange', val); } } } @@ -299,7 +296,6 @@ export default { ::v-deep .label-text { display: inline-block; transform: skew(25deg); - padding-left: 10px; .el-input__inner { border: none; font-size: 16px; diff --git a/src/views/home/productionCostAnalysisComponents/relateSingleFuelCostAnalysis.vue b/src/views/home/productionCostAnalysisComponents/relateSingleFuelCostAnalysis.vue index 8a062529..446c3b71 100644 --- a/src/views/home/productionCostAnalysisComponents/relateSingleFuelCostAnalysis.vue +++ b/src/views/home/productionCostAnalysisComponents/relateSingleFuelCostAnalysis.vue @@ -24,7 +24,7 @@
- 单耗·吨/吨 + 单耗·吨
diff --git a/src/views/home/productionCostAnalysisComponents/totalOverview.vue b/src/views/home/productionCostAnalysisComponents/totalOverview.vue index 7d659b99..ec3e1005 100644 --- a/src/views/home/productionCostAnalysisComponents/totalOverview.vue +++ b/src/views/home/productionCostAnalysisComponents/totalOverview.vue @@ -69,7 +69,7 @@ export default { */ factoryData() { // 整合原始数据 + 计算flag return { - completeRate: Number(this.totalData.proportion).toFixed(2), + completeRate: this.totalData.proportion ? Number(this.totalData.proportion) : 0, diff: this.totalData.diffValue, real: this.totalData.value, target: this.totalData.targetValue, diff --git a/src/views/login.vue b/src/views/login.vue index 2a03cf2e..44f6f332 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -68,14 +68,10 @@