Compare commits
No commits in common. "395a6e296721f5008e5000a4270ae95d2f3b422a" and "c339e5c2de7e8bfae9ef090f0cecade7fac47c43" have entirely different histories.
395a6e2967
...
c339e5c2de
@ -4,23 +4,38 @@
|
|||||||
<el-col :span='12'>
|
<el-col :span='12'>
|
||||||
<el-form-item label="能源类型" prop="energyTypeId">
|
<el-form-item label="能源类型" prop="energyTypeId">
|
||||||
<el-select v-model="form.energyTypeId" placeholder="请选择" style="width: 100%;" filterable>
|
<el-select v-model="form.energyTypeId" placeholder="请选择" style="width: 100%;" filterable>
|
||||||
<el-option v-for="item in this.energyTypeList" :key="item.id" :label="item.name" :value="item.id">
|
<el-option
|
||||||
|
v-for="item in this.energyTypeList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span='12'>
|
<el-col :span='12'>
|
||||||
<el-form-item label="抄表日期" prop="recordTime">
|
<el-form-item label="抄表日期" prop="recordTime">
|
||||||
<el-date-picker v-model="form.recordTime" type="date" format="yyyy-MM-dd" value-format="timestamp"
|
<el-date-picker
|
||||||
placeholder="选择日期" style="width: 100%;">
|
v-model="form.recordTime"
|
||||||
|
type="date"
|
||||||
|
format="yyyy-MM-dd"
|
||||||
|
value-format="timestamp"
|
||||||
|
placeholder="选择日期"
|
||||||
|
style="width: 100%;">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span='24'>
|
<el-col :span='24'>
|
||||||
<base-table border :table-props="tableProps" :table-data="tableData" :add-button-show="addButtonShow"
|
<base-table
|
||||||
@emitFun="inputChange" @emitButtonClick="emitButtonClick" />
|
border
|
||||||
|
:table-props="tableProps"
|
||||||
|
:table-data="tableData"
|
||||||
|
:add-button-show="addButtonShow"
|
||||||
|
@emitFun="inputChange"
|
||||||
|
@emitButtonClick="emitButtonClick"
|
||||||
|
/>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
@ -31,17 +46,17 @@ import moment from 'moment'
|
|||||||
import InputArea from './InputArea'
|
import InputArea from './InputArea'
|
||||||
import SelectArea from './SelectArea'
|
import SelectArea from './SelectArea'
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
{
|
{
|
||||||
prop: 'tableName',
|
prop: 'tableName',
|
||||||
label: '表名*',
|
label: '表名',
|
||||||
subcomponent: SelectArea
|
subcomponent: SelectArea
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'readingQuantity',
|
prop: 'readingQuantity',
|
||||||
label: '抄表数*',
|
label: '抄表数',
|
||||||
subcomponent: InputArea
|
subcomponent: InputArea
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
export default {
|
export default {
|
||||||
name: 'EnergyQuantityManualAdd',
|
name: 'EnergyQuantityManualAdd',
|
||||||
props: {
|
props: {
|
||||||
@ -57,7 +72,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
tableProps,
|
tableProps,
|
||||||
tableData: [],
|
tableData: [],
|
||||||
addButtonShow: '新增',
|
addButtonShow:'新增',
|
||||||
form: {
|
form: {
|
||||||
id: '',
|
id: '',
|
||||||
energyTypeId: '',
|
energyTypeId: '',
|
||||||
@ -83,16 +98,16 @@ export default {
|
|||||||
obj.tableName = params.tableName + ''
|
obj.tableName = params.tableName + ''
|
||||||
obj.readingQuantity = 0
|
obj.readingQuantity = 0
|
||||||
this.tableData.push(obj)
|
this.tableData.push(obj)
|
||||||
} else {
|
}else {
|
||||||
this.isEdit = true
|
this.isEdit = true
|
||||||
this.form.id = params.id
|
this.form.id = params.id
|
||||||
this.addButtonShow = ''
|
this.addButtonShow = ''
|
||||||
energyQuantityManualGet({ id: this.form.id }).then(res => {
|
energyQuantityManualGet({id: this.form.id}).then(res => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.form.energyTypeId = res.data.energyTypeId
|
this.form.energyTypeId = res.data.energyTypeId
|
||||||
this.form.recordTime = res.data.recordTime ? res.data.recordTime : null
|
this.form.recordTime = res.data.recordTime ? res.data.recordTime : null
|
||||||
let obj = {}
|
let obj = {}
|
||||||
obj.tableName = res.data.tableName ? res.data.tableName + '' : ''
|
obj.tableName = res.data.tableName ? res.data.tableName+'' : ''
|
||||||
obj.readingQuantity = res.data.readingQuantity
|
obj.readingQuantity = res.data.readingQuantity
|
||||||
this.tableData.push(obj)
|
this.tableData.push(obj)
|
||||||
}
|
}
|
||||||
@ -115,10 +130,10 @@ export default {
|
|||||||
if (this.tableData.length === 0) {
|
if (this.tableData.length === 0) {
|
||||||
this.$modal.msgError("抄表数据不能为空");
|
this.$modal.msgError("抄表数据不能为空");
|
||||||
return false
|
return false
|
||||||
} else {
|
}else{
|
||||||
for (let item of this.tableData) {
|
for (let item of this.tableData) {
|
||||||
console.log(item)
|
console.log(item)
|
||||||
if (!item.tableName || (!item.readingQuantity && item.readingQuantity !== 0)) {
|
if (!item.tableName || (!item.readingQuantity && item.readingQuantity!==0)) {
|
||||||
this.$modal.msgError("抄表数据有空值,请检查");
|
this.$modal.msgError("抄表数据有空值,请检查");
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -127,11 +142,11 @@ export default {
|
|||||||
if (this.isEdit) {
|
if (this.isEdit) {
|
||||||
// 编辑
|
// 编辑
|
||||||
energyQuantityManualUpdate({
|
energyQuantityManualUpdate({
|
||||||
id: this.form.id,
|
id:this.form.id,
|
||||||
energyTypeId: this.form.energyTypeId,
|
energyTypeId:this.form.energyTypeId,
|
||||||
recordTime: this.form.recordTime,
|
recordTime:this.form.recordTime,
|
||||||
tableName: this.tableData[0].tableName,
|
tableName:this.tableData[0].tableName,
|
||||||
readingQuantity: this.tableData[0].readingQuantity
|
readingQuantity:this.tableData[0].readingQuantity
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.$modal.msgSuccess("操作成功");
|
this.$modal.msgSuccess("操作成功");
|
||||||
@ -140,9 +155,9 @@ export default {
|
|||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
energyQuantityManualCreate({
|
energyQuantityManualCreate({
|
||||||
energyTypeId: this.form.energyTypeId,
|
energyTypeId:this.form.energyTypeId,
|
||||||
recordTime: this.form.recordTime,
|
recordTime:this.form.recordTime,
|
||||||
data: this.tableData
|
data:this.tableData
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.$modal.msgSuccess("操作成功");
|
this.$modal.msgSuccess("操作成功");
|
||||||
|
@ -185,7 +185,7 @@ export default {
|
|||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
this.$modal.confirm('是否确认导出').then(() => {
|
this.$modal.confirm('是否确认导出').then(() => {
|
||||||
return energyQuantityManualExport({ energyTypeId: this.queryParams.energyTypeId, recordTime: this.queryParams.recordTime });
|
return energyQuantityManualExport({ ...this.queryParams });
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
this.$download.excel(response, '能源报表.xls');
|
this.$download.excel(response, '能源报表.xls');
|
||||||
}).catch(() => { })
|
}).catch(() => { })
|
||||||
|
@ -2,12 +2,27 @@
|
|||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
|
|
||||||
<!-- 搜索工作栏 -->
|
<!-- 搜索工作栏 -->
|
||||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
<search-bar
|
||||||
|
:formConfigs="formConfig"
|
||||||
|
ref="searchBarForm"
|
||||||
|
@headBtnClick="buttonClick"
|
||||||
|
/>
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
|
<base-table
|
||||||
:selectWidth="55" :max-height="tableH" @selection-change="selectChange" />
|
:page="queryParams.pageNo"
|
||||||
<pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
|
:limit="queryParams.pageSize"
|
||||||
@pagination="getList" />
|
:table-props="tableProps"
|
||||||
|
:table-data="list"
|
||||||
|
:selectWidth="55"
|
||||||
|
:max-height="tableH"
|
||||||
|
@selection-change="selectChange"
|
||||||
|
/>
|
||||||
|
<pagination
|
||||||
|
:page.sync="queryParams.pageNo"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
:total="total"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -56,8 +71,7 @@ export default {
|
|||||||
type: 'select',
|
type: 'select',
|
||||||
label: '能源类型',
|
label: '能源类型',
|
||||||
selectOptions: [],
|
selectOptions: [],
|
||||||
param: 'energyTypeId',
|
param: 'energyTypeId'
|
||||||
filterable: true
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'datePicker',
|
type: 'datePicker',
|
||||||
@ -115,7 +129,7 @@ export default {
|
|||||||
let arr = location.href.split('?')[1].split('&')
|
let arr = location.href.split('?')[1].split('&')
|
||||||
this.formConfig[1].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
|
this.formConfig[1].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
|
||||||
} else {
|
} 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.startTime = this.formConfig[1].defaultSelect[0]
|
||||||
this.queryParams.endTime = this.formConfig[1].defaultSelect[1]
|
this.queryParams.endTime = this.formConfig[1].defaultSelect[1]
|
||||||
@ -132,7 +146,7 @@ export default {
|
|||||||
let arr = location.href.split('?')[1].split('&')
|
let arr = location.href.split('?')[1].split('&')
|
||||||
this.formConfig[1].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
|
this.formConfig[1].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
|
||||||
} else {
|
} 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.startTime = this.formConfig[1].defaultSelect[0]
|
||||||
this.queryParams.endTime = this.formConfig[1].defaultSelect[1]
|
this.queryParams.endTime = this.formConfig[1].defaultSelect[1]
|
||||||
|
@ -127,11 +127,9 @@ export default {
|
|||||||
name: '',
|
name: '',
|
||||||
code: '',
|
code: '',
|
||||||
unit: '',
|
unit: '',
|
||||||
singlePrice: 0,
|
|
||||||
pricingMethod: 2,
|
pricingMethod: 2,
|
||||||
dim: '',
|
leaderName: '',
|
||||||
push: false,
|
push: false
|
||||||
description: ''
|
|
||||||
},
|
},
|
||||||
isEdit: false, //是否是编辑
|
isEdit: false, //是否是编辑
|
||||||
rules: {
|
rules: {
|
||||||
@ -164,15 +162,14 @@ export default {
|
|||||||
this.form.code = res.data.code
|
this.form.code = res.data.code
|
||||||
this.form.unit = res.data.unit
|
this.form.unit = res.data.unit
|
||||||
this.form.pricingMethod = res.data.pricingMethod
|
this.form.pricingMethod = res.data.pricingMethod
|
||||||
|
this.form.leaderName = res.data.leaderName
|
||||||
this.form.push = res.data.push ? true : false
|
this.form.push = res.data.push ? true : false
|
||||||
this.form.description = res.data.description
|
|
||||||
switch (this.form.pricingMethod) {
|
switch (this.form.pricingMethod) {
|
||||||
case 0:
|
case 0:
|
||||||
this.tableData1 = res.data.segPriceList || []
|
this.tableData1 = res.data.segPriceList || []
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
this.tableData2 = res.data.usedPriceList || []
|
this.tableData2 = res.data.usedPriceList || []
|
||||||
this.form.dim = res.data.dim
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
this.form.singlePrice = res.data.singlePrice || 0
|
this.form.singlePrice = res.data.singlePrice || 0
|
||||||
|
Loading…
Reference in New Issue
Block a user