Compare commits

..

No commits in common. "ebcf3d4d78f6735990418eab0869490894737c8b" and "5a314982249f7293fa1a7addd7fd861f161ec81e" have entirely different histories.

9 changed files with 21 additions and 118 deletions

View File

@ -19,10 +19,9 @@ export function createOrUpdateList(data) {
}
// 自动排班,填充上月已有的排班
export function autoSet(query) {
export function autoSet() {
return request({
url: '/base/group-team-scheduling/autoSet',
method: 'get',
params: query
method: 'get'
})
}

View File

@ -443,7 +443,7 @@ export default {
background-color: #0B58FF;
border-radius: 1px;
margin-right: 8px;
margin-top: 12px;
margin-top: 10px;
}
}
</style>

View File

@ -407,7 +407,7 @@ export default {
background-color: #0B58FF;
border-radius: 1px;
margin-right: 8px;
margin-top: 12px;
margin-top: 10px;
}
}
</style>

View File

@ -13,9 +13,7 @@
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:selectWidth="55"
:max-height="tableH"
@selection-change="selectChange"
/>
<pagination
:page.sync="queryParams.pageNo"
@ -27,11 +25,9 @@
</template>
<script>
import { getEnergyQuantityRealtimePage, exportEnergyQuantityRealtimeExcel } from "@/api/base/energyQuantityRealtime"
import { getEnergyTypeListAll } from "@/api/base/energyType"
import { getEnergyQuantityRealtimePage, exportEnergyQuantityRealtimeExcel } from "@/api/base/energyQuantityRealtime";
import { getEnergyTypeListAll } from "@/api/base/energyType";
// import { publicFormatter } from '@/utils/dict'
import FileSaver from "file-saver"
import * as XLSX from 'xlsx/xlsx.mjs'
const tableProps = [
{
prop: 'objName',
@ -117,8 +113,7 @@ export default {
startTime: null,
endTime: null
},
energyTypeList: [],
exportList: []
energyTypeList: []
};
},
created() {
@ -139,13 +134,12 @@ export default {
this.getList()
break
default:
this.exportTable()
// this.$modal.confirm('').then(() => {
// return exportEnergyQuantityRealtimeExcel({...this.queryParams});
// }).then(response => {
// console.log(response)
// this.$download.excel(response, '.xls');
// }).catch(() => {})
this.$modal.confirm('是否确认导出').then(() => {
return exportEnergyQuantityRealtimeExcel({...this.queryParams});
}).then(response => {
console.log(response)
this.$download.excel(response, '能源抄表.xls');
}).catch(() => {})
}
},
/** 查询列表 */
@ -153,7 +147,6 @@ export default {
getEnergyQuantityRealtimePage(this.queryParams).then(response => {
this.list = response.data.list || []
this.total = response.data.total;
this.exportList = []
});
},
getTypeList() {
@ -161,48 +154,6 @@ export default {
this.formConfig[0].selectOptions = res.data || []
this.energyTypeList = res.data || []
})
},
selectChange(val) {
console.log(val)
this.exportList = val
},
//
exportTable() {
if (this.exportList.length > 0) {
let body = this.exportList.map((x) => [
x.objName,
x.objRemark,
x.energyTypeName,
x.startValue,
x.endValue,
x.diffValue,
x.amount
])
let header = []
this.tableProps.map((y) => {
header.push(y.label)
})
body.unshift(header)
console.log(body)
const filename = '能源抄表.xlsx'
const ws_name = 'Sheet1'
const wb = XLSX.utils.book_new()
const ws = XLSX.utils.aoa_to_sheet(body)
XLSX.utils.book_append_sheet(wb, ws, ws_name)
let wbout = XLSX.write(wb, {
bookType: 'xlsx',
bookSST: false,
type: 'array'
})
FileSaver.saveAs(
new Blob([wbout], {
type: 'application/octet-stream'
}),
filename
)
} else {
this.$modal.msgWarning('请勾选需要导出的数据')
}
}
}
};

View File

@ -1,5 +1,5 @@
<template>
<el-form ref="form" :rules="rules" label-width="110px" :model="form">
<el-form ref="form" :rules="rules" label-width="100px" :model="form">
<el-form-item label="监控对象" prop="objectId">
<el-cascader
style='width: 100%;'
@ -11,7 +11,7 @@
clearable></el-cascader>
</el-form-item>
<el-form-item label="能源类型" prop="energyTypeId">
<el-select v-model="form.energyTypeId" placeholder="请选择" style="width: 100%;" @change="toggleType">
<el-select v-model="form.energyTypeId" placeholder="请选择" style="width: 100%;">
<el-option
v-for="item in this.energyTypeList"
:key="item.id"
@ -26,7 +26,7 @@
<el-option label="详细" :value= "2" ></el-option>
</el-select>
</el-form-item>
<el-form-item label="监控详细参数" prop="type" v-if="form.type === 2">
<el-form-item label="监控详细参数" prop="plcParamId" v-if="form.type === 2">
<el-select v-model="form.plcParamId" placeholder="请选择" style="width: 100%;" @change="selectDetail">
<el-option
v-for="item in detailList"
@ -128,15 +128,7 @@ export default {
console.log(this.form)
this.form.plcParamId = ''
if (val === 2) {
if (this.form.objectId && this.form.energyTypeId) {
this.getDetailList()
}
}
},
toggleType() {
if (this.form.energyTypeId && this.form.type) {
this.getDetailList()
this.form.plcParamId = ''
}
},
//
@ -166,10 +158,6 @@ export default {
selectObj(val) {
this.form.objectId = val[val.length-1]
this.form.objectType = val.length-1
if (this.form.energyTypeId && this.form.type) {
this.getDetailList()
this.form.plcParamId = ''
}
},
selectDetail() {
this.$forceUpdate()

View File

@ -65,8 +65,7 @@ const tableProps = [
},
{
prop: 'type',
label: '监控模式',
filter: (val) => (val != null ? ['合并', '详细'][val-1] : '-'),
label: '监控模式'
},
{
prop: 'plcParamName',

View File

@ -116,7 +116,7 @@ export default {
energyTypeList: []
};
},
mounted() {
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
this.isFold = this.searchBarWidth('energyReportSearchBox', 1180)
@ -130,24 +130,11 @@ export default {
this.queryParams.endTime = this.formConfig[2].defaultSelect[1]
this.getList()
this.getTypeList()
},
mounted() {
this.isFold = this.searchBarWidth('energyReportSearchBox', 1180)
},
watch: {
$route: 'initData'
},
methods: {
initData(to) {
if (to.name === 'EnergyReportSearch') {
if (this.$route.params.startTime && this.$route.params.endTime) {
this.formConfig[2].defaultSelect = [this.$route.params.startTime, this.$route.params.endTime]
} else {
this.formConfig[2].defaultSelect = [Date.now() - 7*24*3600000, Date.now()]
}
this.queryParams.startTime = this.formConfig[2].defaultSelect[0]
this.queryParams.endTime = this.formConfig[2].defaultSelect[1]
this.getList()
}
},
getTypeList() {
getEnergyTypeListAll().then((res) => {
this.formConfig[1].selectOptions = res.data || []

View File

@ -243,11 +243,7 @@ export default {
this.list = tempData
} else {
// 1,
// console.log(moment(this.startDay).format("YYYY-MM-DD"))
autoSet({
year: this.year,
month: moment(this.startDay).month() + 1
}).then(res => {
autoSet().then(res => {
this.list = res.data || {}
})
}

View File

@ -223,24 +223,7 @@ export default {
}
this.getList();
},
watch: {
$route: 'initData'
},
methods: {
initData(to) {
// console.log(to)
if (to.name === 'QualityStatistics') {
if (this.$route.params.startTime && this.$route.params.endTime) {
this.searchBarFormConfig[0].defaultSelect = [this.$route.params.startTime, this.$route.params.endTime]
this.queryParams.param = {};
this.$set(this.queryParams.param, 'startTime', this.$route.params.startTime);
this.$set(this.queryParams.param, 'endTime', this.$route.params.endTime);
} else {
this.searchBarFormConfig[0].defaultSelect = []
}
this.getList();
}
},
getList() {
this.getSummaryList();
this.getDetailedList();