From 8fcf6516a3c599f2753ee961c918f83a348a38f7 Mon Sep 17 00:00:00 2001
From: juzi <819872918@qq.com>
Date: Tue, 19 Mar 2024 14:08:34 +0800
Subject: [PATCH] =?UTF-8?q?=E8=83=BD=E6=BA=90bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/energyQuantityManualAdd.vue | 75 ++++++++-----------
.../base/energyQuantityManual/index.vue | 2 +-
.../base/energyQuantityRealtime/index.vue | 32 +++-----
.../energyType/components/energyTypeAdd.vue | 9 ++-
4 files changed, 46 insertions(+), 72 deletions(-)
diff --git a/src/views/energy/base/energyQuantityManual/components/energyQuantityManualAdd.vue b/src/views/energy/base/energyQuantityManual/components/energyQuantityManualAdd.vue
index d211ed01..7956cb8b 100644
--- a/src/views/energy/base/energyQuantityManual/components/energyQuantityManualAdd.vue
+++ b/src/views/energy/base/energyQuantityManual/components/energyQuantityManualAdd.vue
@@ -4,38 +4,23 @@
-
+
-
+
-
+
@@ -46,17 +31,17 @@ import moment from 'moment'
import InputArea from './InputArea'
import SelectArea from './SelectArea'
const tableProps = [
- {
- prop: 'tableName',
- label: '表名',
- subcomponent: SelectArea
- },
- {
- prop: 'readingQuantity',
- label: '抄表数',
- subcomponent: InputArea
- }
- ]
+ {
+ prop: 'tableName',
+ label: '表名*',
+ subcomponent: SelectArea
+ },
+ {
+ prop: 'readingQuantity',
+ label: '抄表数*',
+ subcomponent: InputArea
+ }
+]
export default {
name: 'EnergyQuantityManualAdd',
props: {
@@ -72,7 +57,7 @@ export default {
return {
tableProps,
tableData: [],
- addButtonShow:'新增',
+ addButtonShow: '新增',
form: {
id: '',
energyTypeId: '',
@@ -98,16 +83,16 @@ export default {
obj.tableName = params.tableName + ''
obj.readingQuantity = 0
this.tableData.push(obj)
- }else {
+ } else {
this.isEdit = true
this.form.id = params.id
this.addButtonShow = ''
- energyQuantityManualGet({id: this.form.id}).then(res => {
+ energyQuantityManualGet({ id: this.form.id }).then(res => {
if (res.code === 0) {
this.form.energyTypeId = res.data.energyTypeId
this.form.recordTime = res.data.recordTime ? res.data.recordTime : null
let obj = {}
- obj.tableName = res.data.tableName ? res.data.tableName+'' : ''
+ obj.tableName = res.data.tableName ? res.data.tableName + '' : ''
obj.readingQuantity = res.data.readingQuantity
this.tableData.push(obj)
}
@@ -130,10 +115,10 @@ export default {
if (this.tableData.length === 0) {
this.$modal.msgError("抄表数据不能为空");
return false
- }else{
+ } else {
for (let item of this.tableData) {
console.log(item)
- if (!item.tableName || (!item.readingQuantity && item.readingQuantity!==0)) {
+ if (!item.tableName || (!item.readingQuantity && item.readingQuantity !== 0)) {
this.$modal.msgError("抄表数据有空值,请检查");
return false
}
@@ -142,11 +127,11 @@ export default {
if (this.isEdit) {
// 编辑
energyQuantityManualUpdate({
- id:this.form.id,
- energyTypeId:this.form.energyTypeId,
- recordTime:this.form.recordTime,
- tableName:this.tableData[0].tableName,
- readingQuantity:this.tableData[0].readingQuantity
+ id: this.form.id,
+ energyTypeId: this.form.energyTypeId,
+ recordTime: this.form.recordTime,
+ tableName: this.tableData[0].tableName,
+ readingQuantity: this.tableData[0].readingQuantity
}).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
@@ -155,9 +140,9 @@ export default {
})
} else {
energyQuantityManualCreate({
- energyTypeId:this.form.energyTypeId,
- recordTime:this.form.recordTime,
- data:this.tableData
+ energyTypeId: this.form.energyTypeId,
+ recordTime: this.form.recordTime,
+ data: this.tableData
}).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
diff --git a/src/views/energy/base/energyQuantityManual/index.vue b/src/views/energy/base/energyQuantityManual/index.vue
index 14dd96e6..26a19624 100644
--- a/src/views/energy/base/energyQuantityManual/index.vue
+++ b/src/views/energy/base/energyQuantityManual/index.vue
@@ -185,7 +185,7 @@ export default {
break
default:
this.$modal.confirm('是否确认导出').then(() => {
- return energyQuantityManualExport({ ...this.queryParams });
+ return energyQuantityManualExport({ energyTypeId: this.queryParams.energyTypeId, recordTime: this.queryParams.recordTime });
}).then(response => {
this.$download.excel(response, '能源报表.xls');
}).catch(() => { })
diff --git a/src/views/energy/base/energyQuantityRealtime/index.vue b/src/views/energy/base/energyQuantityRealtime/index.vue
index 956c4077..a8b9e6ed 100644
--- a/src/views/energy/base/energyQuantityRealtime/index.vue
+++ b/src/views/energy/base/energyQuantityRealtime/index.vue
@@ -2,27 +2,12 @@
@@ -71,7 +56,8 @@ export default {
type: 'select',
label: '能源类型',
selectOptions: [],
- param: 'energyTypeId'
+ param: 'energyTypeId',
+ filterable: true
},
{
type: 'datePicker',
@@ -129,7 +115,7 @@ export default {
let arr = location.href.split('?')[1].split('&')
this.formConfig[1].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
} else {
- this.formConfig[1].defaultSelect = [Date.now() - 7*24*3600000, Date.now()]
+ this.formConfig[1].defaultSelect = [Date.now() - 7 * 24 * 3600000, Date.now()]
}
this.queryParams.startTime = this.formConfig[1].defaultSelect[0]
this.queryParams.endTime = this.formConfig[1].defaultSelect[1]
@@ -146,7 +132,7 @@ export default {
let arr = location.href.split('?')[1].split('&')
this.formConfig[1].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
} else {
- this.formConfig[1].defaultSelect = [Date.now() - 7*24*3600000, Date.now()]
+ this.formConfig[1].defaultSelect = [Date.now() - 7 * 24 * 3600000, Date.now()]
}
this.queryParams.startTime = this.formConfig[1].defaultSelect[0]
this.queryParams.endTime = this.formConfig[1].defaultSelect[1]
diff --git a/src/views/energy/base/energyType/components/energyTypeAdd.vue b/src/views/energy/base/energyType/components/energyTypeAdd.vue
index efe5b35a..01ddcee0 100644
--- a/src/views/energy/base/energyType/components/energyTypeAdd.vue
+++ b/src/views/energy/base/energyType/components/energyTypeAdd.vue
@@ -127,9 +127,11 @@ export default {
name: '',
code: '',
unit: '',
+ singlePrice: 0,
pricingMethod: 2,
- leaderName: '',
- push: false
+ dim: '',
+ push: false,
+ description: ''
},
isEdit: false, //是否是编辑
rules: {
@@ -162,14 +164,15 @@ export default {
this.form.code = res.data.code
this.form.unit = res.data.unit
this.form.pricingMethod = res.data.pricingMethod
- this.form.leaderName = res.data.leaderName
this.form.push = res.data.push ? true : false
+ this.form.description = res.data.description
switch (this.form.pricingMethod) {
case 0:
this.tableData1 = res.data.segPriceList || []
break;
case 1:
this.tableData2 = res.data.usedPriceList || []
+ this.form.dim = res.data.dim
break;
default:
this.form.singlePrice = res.data.singlePrice || 0