Compare commits
No commits in common. "ebcf3d4d78f6735990418eab0869490894737c8b" and "5a314982249f7293fa1a7addd7fd861f161ec81e" have entirely different histories.
ebcf3d4d78
...
5a31498224
@ -19,10 +19,9 @@ export function createOrUpdateList(data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 自动排班,填充上月已有的排班
|
// 自动排班,填充上月已有的排班
|
||||||
export function autoSet(query) {
|
export function autoSet() {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/group-team-scheduling/autoSet',
|
url: '/base/group-team-scheduling/autoSet',
|
||||||
method: 'get',
|
method: 'get'
|
||||||
params: query
|
|
||||||
})
|
})
|
||||||
}
|
}
|
@ -443,7 +443,7 @@ export default {
|
|||||||
background-color: #0B58FF;
|
background-color: #0B58FF;
|
||||||
border-radius: 1px;
|
border-radius: 1px;
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
margin-top: 12px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -407,7 +407,7 @@ export default {
|
|||||||
background-color: #0B58FF;
|
background-color: #0B58FF;
|
||||||
border-radius: 1px;
|
border-radius: 1px;
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
margin-top: 12px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -13,9 +13,7 @@
|
|||||||
:limit="queryParams.pageSize"
|
:limit="queryParams.pageSize"
|
||||||
:table-props="tableProps"
|
:table-props="tableProps"
|
||||||
:table-data="list"
|
:table-data="list"
|
||||||
:selectWidth="55"
|
|
||||||
:max-height="tableH"
|
:max-height="tableH"
|
||||||
@selection-change="selectChange"
|
|
||||||
/>
|
/>
|
||||||
<pagination
|
<pagination
|
||||||
:page.sync="queryParams.pageNo"
|
:page.sync="queryParams.pageNo"
|
||||||
@ -27,11 +25,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getEnergyQuantityRealtimePage, exportEnergyQuantityRealtimeExcel } from "@/api/base/energyQuantityRealtime"
|
import { getEnergyQuantityRealtimePage, exportEnergyQuantityRealtimeExcel } from "@/api/base/energyQuantityRealtime";
|
||||||
import { getEnergyTypeListAll } from "@/api/base/energyType"
|
import { getEnergyTypeListAll } from "@/api/base/energyType";
|
||||||
// import { publicFormatter } from '@/utils/dict'
|
// import { publicFormatter } from '@/utils/dict'
|
||||||
import FileSaver from "file-saver"
|
|
||||||
import * as XLSX from 'xlsx/xlsx.mjs'
|
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
{
|
{
|
||||||
prop: 'objName',
|
prop: 'objName',
|
||||||
@ -117,8 +113,7 @@ export default {
|
|||||||
startTime: null,
|
startTime: null,
|
||||||
endTime: null
|
endTime: null
|
||||||
},
|
},
|
||||||
energyTypeList: [],
|
energyTypeList: []
|
||||||
exportList: []
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -139,13 +134,12 @@ export default {
|
|||||||
this.getList()
|
this.getList()
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
this.exportTable()
|
this.$modal.confirm('是否确认导出').then(() => {
|
||||||
// this.$modal.confirm('是否确认导出').then(() => {
|
return exportEnergyQuantityRealtimeExcel({...this.queryParams});
|
||||||
// return exportEnergyQuantityRealtimeExcel({...this.queryParams});
|
}).then(response => {
|
||||||
// }).then(response => {
|
console.log(response)
|
||||||
// console.log(response)
|
this.$download.excel(response, '能源抄表.xls');
|
||||||
// this.$download.excel(response, '能源抄表.xls');
|
}).catch(() => {})
|
||||||
// }).catch(() => {})
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/** 查询列表 */
|
/** 查询列表 */
|
||||||
@ -153,7 +147,6 @@ export default {
|
|||||||
getEnergyQuantityRealtimePage(this.queryParams).then(response => {
|
getEnergyQuantityRealtimePage(this.queryParams).then(response => {
|
||||||
this.list = response.data.list || []
|
this.list = response.data.list || []
|
||||||
this.total = response.data.total;
|
this.total = response.data.total;
|
||||||
this.exportList = []
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getTypeList() {
|
getTypeList() {
|
||||||
@ -161,48 +154,6 @@ export default {
|
|||||||
this.formConfig[0].selectOptions = res.data || []
|
this.formConfig[0].selectOptions = res.data || []
|
||||||
this.energyTypeList = 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('请勾选需要导出的数据')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<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-form-item label="监控对象" prop="objectId">
|
||||||
<el-cascader
|
<el-cascader
|
||||||
style='width: 100%;'
|
style='width: 100%;'
|
||||||
@ -11,7 +11,7 @@
|
|||||||
clearable></el-cascader>
|
clearable></el-cascader>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="能源类型" prop="energyTypeId">
|
<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
|
<el-option
|
||||||
v-for="item in this.energyTypeList"
|
v-for="item in this.energyTypeList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
@ -26,7 +26,7 @@
|
|||||||
<el-option label="详细" :value= "2" ></el-option>
|
<el-option label="详细" :value= "2" ></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</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-select v-model="form.plcParamId" placeholder="请选择" style="width: 100%;" @change="selectDetail">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in detailList"
|
v-for="item in detailList"
|
||||||
@ -128,15 +128,7 @@ export default {
|
|||||||
console.log(this.form)
|
console.log(this.form)
|
||||||
this.form.plcParamId = ''
|
this.form.plcParamId = ''
|
||||||
if (val === 2) {
|
if (val === 2) {
|
||||||
if (this.form.objectId && this.form.energyTypeId) {
|
|
||||||
this.getDetailList()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
toggleType() {
|
|
||||||
if (this.form.energyTypeId && this.form.type) {
|
|
||||||
this.getDetailList()
|
this.getDetailList()
|
||||||
this.form.plcParamId = ''
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 递归处理分类回显问题
|
// 递归处理分类回显问题
|
||||||
@ -166,10 +158,6 @@ export default {
|
|||||||
selectObj(val) {
|
selectObj(val) {
|
||||||
this.form.objectId = val[val.length-1]
|
this.form.objectId = val[val.length-1]
|
||||||
this.form.objectType = val.length-1
|
this.form.objectType = val.length-1
|
||||||
if (this.form.energyTypeId && this.form.type) {
|
|
||||||
this.getDetailList()
|
|
||||||
this.form.plcParamId = ''
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
selectDetail() {
|
selectDetail() {
|
||||||
this.$forceUpdate()
|
this.$forceUpdate()
|
||||||
|
@ -65,8 +65,7 @@ const tableProps = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'type',
|
prop: 'type',
|
||||||
label: '监控模式',
|
label: '监控模式'
|
||||||
filter: (val) => (val != null ? ['合并', '详细'][val-1] : '-'),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'plcParamName',
|
prop: 'plcParamName',
|
||||||
|
@ -116,7 +116,7 @@ export default {
|
|||||||
energyTypeList: []
|
energyTypeList: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
created() {
|
||||||
window.addEventListener('resize', () => {
|
window.addEventListener('resize', () => {
|
||||||
this.tableH = this.tableHeight(260)
|
this.tableH = this.tableHeight(260)
|
||||||
this.isFold = this.searchBarWidth('energyReportSearchBox', 1180)
|
this.isFold = this.searchBarWidth('energyReportSearchBox', 1180)
|
||||||
@ -130,24 +130,11 @@ export default {
|
|||||||
this.queryParams.endTime = this.formConfig[2].defaultSelect[1]
|
this.queryParams.endTime = this.formConfig[2].defaultSelect[1]
|
||||||
this.getList()
|
this.getList()
|
||||||
this.getTypeList()
|
this.getTypeList()
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
this.isFold = this.searchBarWidth('energyReportSearchBox', 1180)
|
this.isFold = this.searchBarWidth('energyReportSearchBox', 1180)
|
||||||
},
|
},
|
||||||
watch: {
|
|
||||||
$route: 'initData'
|
|
||||||
},
|
|
||||||
methods: {
|
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() {
|
getTypeList() {
|
||||||
getEnergyTypeListAll().then((res) => {
|
getEnergyTypeListAll().then((res) => {
|
||||||
this.formConfig[1].selectOptions = res.data || []
|
this.formConfig[1].selectOptions = res.data || []
|
||||||
|
@ -243,11 +243,7 @@ export default {
|
|||||||
this.list = tempData
|
this.list = tempData
|
||||||
} else {
|
} else {
|
||||||
// 次月1号没有值,接口排班
|
// 次月1号没有值,接口排班
|
||||||
// console.log(moment(this.startDay).format("YYYY-MM-DD"))
|
autoSet().then(res => {
|
||||||
autoSet({
|
|
||||||
year: this.year,
|
|
||||||
month: moment(this.startDay).month() + 1
|
|
||||||
}).then(res => {
|
|
||||||
this.list = res.data || {}
|
this.list = res.data || {}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -223,24 +223,7 @@ export default {
|
|||||||
}
|
}
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
watch: {
|
|
||||||
$route: 'initData'
|
|
||||||
},
|
|
||||||
methods: {
|
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() {
|
getList() {
|
||||||
this.getSummaryList();
|
this.getSummaryList();
|
||||||
this.getDetailedList();
|
this.getDetailedList();
|
||||||
|
Loading…
Reference in New Issue
Block a user