Compare commits

..

No commits in common. "b5b952e1cc87511efa2d7e04273cb195a6dc17cb" and "30d22b34e10aec8e0c24e752d6a41dd26f039627" have entirely different histories.

25 changed files with 1934 additions and 2059 deletions

View File

@ -187,11 +187,8 @@
@click="resetBtn"> @click="resetBtn">
重置 重置
</el-button> </el-button>
<span <span class="separateStyle"></span>
class="separateStyle"
v-hasPermi="['analysis:contrast-analysis:export']"></span>
<el-button <el-button
v-hasPermi="['analysis:contrast-analysis:export']"
type="primary" type="primary"
size="small" size="small"
plain plain

View File

@ -80,13 +80,10 @@
</el-button> </el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<span <span class="separateStyle"></span>
class="separateStyle"
v-hasPermi="['analysis:qoq-analysis:export']"></span>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button
v-hasPermi="['analysis:qoq-analysis:export']"
type="primary" type="primary"
size="small" size="small"
@click="exportData" @click="exportData"

View File

@ -170,11 +170,8 @@
@click="resetBtn"> @click="resetBtn">
重置 重置
</el-button> </el-button>
<span <span class="separateStyle"></span>
class="separateStyle"
v-hasPermi="['analysis:trend-analysis:export']"></span>
<el-button <el-button
v-hasPermi="['analysis:trend-analysis:export']"
type="primary" type="primary"
size="small" size="small"
plain plain

View File

@ -69,13 +69,10 @@
</el-button> </el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<span <span class="separateStyle"></span>
class="separateStyle"
v-hasPermi="['analysis:yoy-analysis:export']"></span>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button
v-hasPermi="['analysis:yoy-analysis:export']"
type="primary" type="primary"
size="small" size="small"
@click="exportData" @click="exportData"

View File

@ -1,219 +1,197 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 -->
<search-bar <!-- 搜索工作栏 -->
:formConfigs="formConfig" <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
ref="searchBarForm" <!-- 列表 -->
@headBtnClick="buttonClick" /> <base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
<!-- 列表 --> :max-height="tableH">
<base-table <method-btn v-if="tableBtn.length" slot="handleBtn" :width="80" label="操作" :method-list="tableBtn"
:page="queryParams.pageNo" @clickBtn="handleClick" />
:limit="queryParams.pageSize" </base-table>
:table-props="tableProps" <pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
:table-data="list" @pagination="getList" />
:max-height="tableH"> <!-- 新增 -->
<method-btn <base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="centervisible" @cancel="handleCancel"
v-if="tableBtn.length" @confirm="handleConfirm" :before-close="handleCancel">
slot="handleBtn" <energy-plc-add ref="energyPlc" @successSubmit="successSubmit" />
:width="80" </base-dialog>
label="操作" </div>
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
<!-- 新增 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel">
<energy-plc-add
ref="energyPlc"
@successSubmit="successSubmit" />
</base-dialog>
</div>
</template> </template>
<script> <script>
import { getEnergyPlcPage, deleteEnergyPlc } from '@/api/base/energyPlc'; import { getEnergyPlcPage, deleteEnergyPlc } from "@/api/base/energyPlc";
import EnergyPlcAdd from './components/energyPlcAdd.vue'; // import { publicFormatter } from '@/utils/dict'
import tableHeightMixin from '@/mixins/lb/tableHeightMixin'; import EnergyPlcAdd from './components/energyPlcAdd.vue'
const tableProps = [ const tableProps = [
{ {
prop: 'plcTableName', prop: 'plcTableName',
label: '关联表名', label: '关联表名',
showOverflowtooltip: true, showOverflowtooltip: true
}, },
{ {
prop: 'code', prop: 'code',
label: '关联表编码', label: '关联表编码',
minWidth: 150, minWidth: 150,
showOverflowtooltip: true, showOverflowtooltip: true
}, },
{ {
prop: 'name', prop: 'name',
label: '标识名', label: '标识名',
minWidth: 150, minWidth: 150,
showOverflowtooltip: true, showOverflowtooltip: true
}, },
{ {
prop: 'enName', prop: 'enName',
label: '英文标识名', label: '英文标识名'
}, },
{ {
prop: 'collection', prop: 'collection',
label: '是否采集', label: '是否采集'
}, },
{ {
prop: 'description', prop: 'description',
label: '描述', label: '描述',
showOverflowtooltip: true, showOverflowtooltip: true
}, }
]; ]
export default { export default {
name: 'EnergyPlc', name: "EnergyPlc",
components: { EnergyPlcAdd }, components: { EnergyPlcAdd },
mixins: [tableHeightMixin], data() {
data() { return {
return { formConfig: [
formConfig: [ {
{ type: 'input',
type: 'input', label: '标识名',
label: '标识名', placeholder: '标识名',
placeholder: '标识名', param: 'name'
param: 'name', },
}, {
{ type: 'button',
type: 'button', btnName: '查询',
btnName: '查询', name: 'search',
name: 'search', color: 'primary'
color: 'primary', },
}, {
{ type: 'separate'
type: 'separate', },
}, {
{ type: this.$auth.hasPermi('base:energy-plc:create') ? 'button' : '',
type: this.$auth.hasPermi('base:energy-plc:create') ? 'button' : '', btnName: '新增',
btnName: '新增', name: 'add',
name: 'add', color: 'success',
color: 'success', plain: true
plain: true, }
}, ],
], tableProps,
tableProps, tableBtn: [
tableBtn: [ this.$auth.hasPermi('base:energy-plc:update')
this.$auth.hasPermi('base:energy-plc:update') ? {
? { type: 'edit',
type: 'edit', btnName: '编辑'
btnName: '编辑', }
} : undefined,
: undefined, this.$auth.hasPermi('base:energy-plc:delete')
this.$auth.hasPermi('base:energy-plc:delete') ? {
? { type: 'delete',
type: 'delete', btnName: '删除'
btnName: '删除', }
} : undefined
: undefined, ].filter((v) => v),
].filter((v) => v), tableH: this.tableHeight(260),
collectionList: [ collectionList: [
{ value: 0, label: '否' }, { value: 0, label: '否' },
{ value: 1, label: '是' }, { value: 1, label: '是' }
], ],
// //
total: 0, total: 0,
// //
list: [], list: [],
// //
addOrEditTitle: '', addOrEditTitle: "",
// //
centervisible: false, centervisible: false,
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 20, pageSize: 20,
name: null, name: null
}, }
}; };
}, },
created() { created() {
this.getList(); window.addEventListener('resize', () => {
}, this.tableH = this.tableHeight(260)
methods: { })
buttonClick(val) { this.getList();
switch (val.btnName) { },
case 'search': methods: {
this.queryParams.pageNo = 1; buttonClick(val) {
this.queryParams.name = val.name; switch (val.btnName) {
this.getList(); case 'search':
break; this.queryParams.pageNo = 1;
default: this.queryParams.name = val.name
this.addOrEditTitle = '新增'; this.getList()
this.centervisible = true; break
this.$nextTick(() => { default:
this.$refs.energyPlc.init(); this.addOrEditTitle = '新增'
}); this.centervisible = true
} this.$nextTick(() => {
}, this.$refs.energyPlc.init()
/** 查询列表 */ })
getList() { }
getEnergyPlcPage(this.queryParams).then((response) => { },
let arr = response.data.list || []; /** 查询列表 */
arr && getList() {
arr.map((item) => { getEnergyPlcPage(this.queryParams).then(response => {
this.collectionList.map((i) => { let arr = response.data.list || [];
if (item.collection === i.value) { arr && arr.map(item => {
item.collection = i.label; this.collectionList.map(i => {
} if (item.collection === i.value) {
}); item.collection = i.label
}); }
this.list = arr; })
this.total = response.data.total; })
}); this.list = arr
}, this.total = response.data.total;
handleClick(val) { });
switch (val.type) { },
case 'edit': handleClick(val) {
this.addOrEditTitle = '编辑'; switch (val.type) {
this.$nextTick(() => { case 'edit':
this.$refs.energyPlc.init(val.data.id); this.addOrEditTitle = '编辑'
}); this.$nextTick(() => {
this.centervisible = true; this.$refs.energyPlc.init(val.data.id)
break; })
default: this.centervisible = true
this.handleDelete(val.data); break
} default:
}, this.handleDelete(val.data)
handleCancel() { }
this.$refs.energyPlc.formClear(); },
this.centervisible = false; handleCancel() {
this.addOrEditTitle = ''; this.$refs.energyPlc.formClear()
}, this.centervisible = false
handleConfirm() { this.addOrEditTitle = ''
this.$refs.energyPlc.submitForm(); },
}, handleConfirm() {
successSubmit() { this.$refs.energyPlc.submitForm()
this.handleCancel(); },
this.getList(); successSubmit() {
}, this.handleCancel()
/** 删除按钮操作 */ this.getList()
handleDelete(row) { },
this.$modal /** 删除按钮操作 */
.confirm('是否确认删除关联表名为"' + row.name + '"的数据项?') handleDelete(row) {
.then(function () { this.$modal.confirm('是否确认删除关联表名为"' + row.name + '"的数据项?').then(function () {
return deleteEnergyPlc(row.id); return deleteEnergyPlc(row.id);
}) }).then(() => {
.then(() => { this.queryParams.pageNo = 1;
this.queryParams.pageNo = 1; this.getList();
this.getList(); this.$modal.msgSuccess("删除成功");
this.$modal.msgSuccess('删除成功'); }).catch(() => { });
}) }
.catch(() => {}); }
},
},
}; };
</script> </script>

View File

@ -1,258 +1,226 @@
<template> <template>
<div> <div>
<el-drawer <el-drawer :title="drawerTitle" :visible.sync="visible" size="70%" @close='closeD' :show-close='false'>
:title="drawerTitle" <div class="box">
:visible.sync="visible" <el-form :inline="true">
size="70%" <el-form-item label="关联表名">
@close="closeD" <el-input v-model="plcTableName" size='small' readonly></el-input>
:show-close="false"> </el-form-item>
<div class="box"> <el-form-item label="对象">
<el-form :inline="true"> <el-input v-model="objName" size='small' readonly></el-input>
<el-form-item label="关联表名"> </el-form-item>
<el-input <el-form-item v-if="showBtn">
v-model="plcTableName" <el-button type="success" size='small' plain @click="addNew">新增</el-button>
size="small" </el-form-item>
readonly </el-form>
style="width: 250px"></el-input> <base-table
</el-form-item> :page="queryParams.pageNo"
<el-form-item label="对象"> :limit="queryParams.pageSize"
<el-input :table-props="tableProps"
v-model="objName" :table-data="tableData"
size="small" :max-height="tableH"
readonly >
style="width: 250px"></el-input> <method-btn
</el-form-item> v-if="tableBtn.length"
<el-form-item v-if="showBtn"> slot="handleBtn"
<el-button :width="100"
type="success" label="操作"
size="small" :method-list="tableBtn"
plain @clickBtn="handleClick"
@click="addNew"> />
新增 </base-table>
</el-button> <pagination
</el-form-item> :page.sync="queryParams.pageNo"
</el-form> :limit.sync="queryParams.pageSize"
<base-table :total="total"
:page="queryParams.pageNo" @pagination="getList"
:limit="queryParams.pageSize" />
:table-props="tableProps" </div>
:table-data="tableData" </el-drawer>
:max-height="tableH"> <!-- 新增 -->
<method-btn <base-dialog
v-if="tableBtn.length" :dialogTitle="addOrEditTitle"
slot="handleBtn" :dialogVisible="centervisible"
:width="100" @cancel="handleCancel"
label="操作" @confirm="handleConfirm"
:method-list="tableBtn" :before-close="handleCancel"
@clickBtn="handleClick" /> >
</base-table> <energy-plc-param-add ref="energyPlcParam" @successSubmit="successSubmit" />
<pagination </base-dialog>
:page.sync="queryParams.pageNo" </div>
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
</div>
</el-drawer>
<!-- 新增 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel">
<energy-plc-param-add
ref="energyPlcParam"
@successSubmit="successSubmit" />
</base-dialog>
</div>
</template> </template>
<script> <script>
import { import { getEnergyPlcParamPage, deleteEnergyPlcParam } from '@/api/base/energyPlcParam'
getEnergyPlcParamPage, import EnergyPlcParamAdd from './energyPlcParamAdd'
deleteEnergyPlcParam, import { publicFormatter } from '@/utils/dict'
} from '@/api/base/energyPlcParam';
import EnergyPlcParamAdd from './energyPlcParamAdd';
import { publicFormatter } from '@/utils/dict';
const tableProps = [ const tableProps = [
{ {
prop: 'typeId', prop: 'typeId',
label: '能源类型', label: '能源类型'
filter: publicFormatter('energy_type'), },
}, {
{ prop: 'plcParamName',
prop: 'plcParamName', label: '参数列名'
label: '参数列名', },
}, {
{ prop: 'name',
prop: 'name', label: '参数名称'
label: '参数名称', },
}, {
{ prop: 'unit',
prop: 'unit', label: '单位',
label: '单位', filter: publicFormatter('energy_unit')
filter: publicFormatter('unit_dict'), },
}, {
{ prop: 'collection',
prop: 'collection', label: '是否采集'
label: '是否采集', },
}, {
{ prop: 'description',
prop: 'description', label: '描述'
label: '描述', }
}, ]
];
export default { export default {
name: 'EnergyPlcParam', name: 'EnergyPlcParam',
props: { props: {
energyTypeList: { energyTypeList: {
type: Array, type: Array,
required: true, required: true,
default: () => { default: () => {
return []; return []
}, }
}, }
}, },
data() { data() {
return { return {
visible: false, visible: false,
drawerTitle: '', drawerTitle: '',
tableProps, tableProps,
tableData: [], tableData: [],
tableBtn: [], tableBtn: [],
tableH: this.tableHeight(115), tableH: this.tableHeight(115),
total: 0, total: 0,
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 30, pageSize: 30,
connectId: null, connectId: null
}, },
plcTableName: '', plcTableName: '',
objName: '', objName: '',
// //
addOrEditTitle: '', addOrEditTitle: "",
// //
centervisible: false, centervisible: false,
collectionList: [ collectionList: [
{ value: 0, label: '否' }, {value: 0,label: '否'},
{ value: 1, label: '是' }, {value: 1,label: '是'}
], ],
showBtn: true, showBtn: true
}; }
}, },
components: { EnergyPlcParamAdd }, components: { EnergyPlcParamAdd },
created() { created() {
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.tableH = this.tableHeight(115); this.tableH = this.tableHeight(115)
}); })
}, },
methods: { methods: {
init(data, title) { init(data,title) {
this.visible = true; this.visible = true
this.queryParams.connectId = data.id; this.queryParams.connectId = data.id
this.plcTableName = data.plcTableName; this.plcTableName = data.plcTableName
this.objName = data.objName; this.objName = data.objName
this.getList(); this.getList()
if (title === 'detail') { if (title === 'detail') {
this.drawerTitle = '查看参数'; this.drawerTitle = '查看参数'
this.showBtn = false; this.showBtn = false
this.tableBtn = []; this.tableBtn = []
} else { } else {
this.drawerTitle = '参数绑定'; this.drawerTitle = '参数绑定'
this.showBtn = true; this.showBtn = true
this.tableBtn = [ this.tableBtn = [
{ {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑'
}, },
{ {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除'
}, }
]; ]
} }
}, },
getList() { getList() {
getEnergyPlcParamPage({ ...this.queryParams }).then((res) => { getEnergyPlcParamPage({...this.queryParams}).then((res) => {
let arr = res.data.list || []; let arr = res.data.list || []
arr && arr&&arr.map(item => {
arr.map((item) => { this.collectionList.map(i => {
this.collectionList.map((i) => { if (item.collection === i.value) {
if (item.collection === i.value) { item.collection = i.label
item.collection = i.label; }
} })
}); this.energyTypeList.map(j => {
this.energyTypeList.map((j) => { if (item.typeId === j.id) {
if (item.typeId === j.id) { item.typeId = j.name
item.typeId = j.name; }
} })
}); })
}); this.tableData = arr
this.tableData = arr; this.total = res.data.total;
this.total = res.data.total; })
}); },
}, //
// addNew() {
addNew() { this.addOrEditTitle = '新增'
this.addOrEditTitle = '新增'; this.centervisible = true
this.centervisible = true; this.$nextTick(() => {
this.$nextTick(() => { this.$refs.energyPlcParam.init({'connectId': this.queryParams.connectId, id: ''})
this.$refs.energyPlcParam.init({ })
connectId: this.queryParams.connectId, },
id: '', handleCancel() {
}); this.$refs.energyPlcParam.formClear()
}); this.centervisible = false
}, this.addOrEditTitle = ''
handleCancel() { },
this.$refs.energyPlcParam.formClear(); handleConfirm() {
this.centervisible = false; this.$refs.energyPlcParam.submitForm()
this.addOrEditTitle = ''; },
}, successSubmit() {
handleConfirm() { this.handleCancel()
this.$refs.energyPlcParam.submitForm(); this.getList()
}, },
successSubmit() { handleClick(val) {
this.handleCancel(); console.log(val)
this.getList(); switch (val.type) {
}, case 'edit':
handleClick(val) { this.addOrEditTitle = '编辑'
console.log(val); this.centervisible = true
switch (val.type) { this.$nextTick(() => {
case 'edit': this.$refs.energyPlcParam.init({'connectId': this.queryParams.connectId, id: val.data.id})
this.addOrEditTitle = '编辑'; })
this.centervisible = true; break
this.$nextTick(() => { default:
this.$refs.energyPlcParam.init({ this.handleDelete(val.data)
connectId: this.queryParams.connectId, }
id: val.data.id, },
}); /** 删除按钮操作 */
}); handleDelete(row) {
break; this.$modal.confirm('是否确认删除参数列名为"' + row.plcParamName + '"的数据项?').then(function() {
default: return deleteEnergyPlcParam(row.id);
this.handleDelete(val.data); }).then(() => {
} this.queryParams.pageNo = 1;
}, this.getList();
/** 删除按钮操作 */ this.$modal.msgSuccess("删除成功");
handleDelete(row) { }).catch(() => {});
this.$modal },
.confirm('是否确认删除参数列名为"' + row.plcParamName + '"的数据项?') closeD() {
.then(function () { this.$emit('closeDrawer')
return deleteEnergyPlcParam(row.id); }
}) }
.then(() => { }
this.queryParams.pageNo = 1;
this.getList();
this.$modal.msgSuccess('删除成功');
})
.catch(() => {});
},
closeD() {
this.$emit('closeDrawer');
},
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.box { .box {
padding: 0 32px; padding: 0 32px;
} }
</style> </style>

View File

@ -57,18 +57,14 @@ import { getTree } from '@/api/analysis/energyAnalysis';
import { getEnergyTypeListAll } from '@/api/base/energyType'; import { getEnergyTypeListAll } from '@/api/base/energyType';
import EnergyPlcConnectAdd from './components/energyPlcConnectAdd'; import EnergyPlcConnectAdd from './components/energyPlcConnectAdd';
import EnergyPlcParam from './components/energyPlcParam'; import EnergyPlcParam from './components/energyPlcParam';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'objName', prop: 'objName',
label: '对象', label: '对象',
minWidth: 130,
showOverflowtooltip: true,
}, },
{ {
prop: 'objCode', prop: 'objCode',
label: '对象编码', label: '对象编码',
minWidth: 150,
showOverflowtooltip: true, showOverflowtooltip: true,
}, },
{ {
@ -90,13 +86,11 @@ const tableProps = [
{ {
prop: 'varNum', prop: 'varNum',
label: '绑定参数数量', label: '绑定参数数量',
width: 110,
}, },
]; ];
export default { export default {
name: 'EnergyPlcConnect', name: 'EnergyPlcConnect',
components: { EnergyPlcConnectAdd, EnergyPlcParam }, components: { EnergyPlcConnectAdd, EnergyPlcParam },
mixins: [tableHeightMixin],
data() { data() {
return { return {
formConfig: [ formConfig: [
@ -150,6 +144,7 @@ export default {
} }
: undefined, : undefined,
].filter((v) => v), ].filter((v) => v),
tableH: this.tableHeight(260),
// //
total: 0, total: 0,
// //
@ -170,6 +165,9 @@ export default {
}; };
}, },
created() { created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260);
});
this.getList(); this.getList();
}, },
mounted() { mounted() {

View File

@ -20,9 +20,9 @@
@change="changeSelect(scope.row, 'tableName')"> @change="changeSelect(scope.row, 'tableName')">
<el-option <el-option
v-for="item in tableNameList" v-for="item in tableNameList"
:key="item.value" :key="item.id"
:label="item.label" :label="item.label"
:value="item.value"></el-option> :value="item.id"></el-option>
</el-select> </el-select>
</div> </div>
</template> </template>

View File

@ -0,0 +1,38 @@
<template>
<div class="tableInner">
<!-- <el-input v-model="list[itemProp]" @blur="changeInput" /> -->
<el-input-number v-model="list[itemProp]" @change="changeInput" :min="0" :max="999999999" style='width: 100%;' :controls='false' :precision='2'></el-input-number>
</div>
</template>
<script>
export default {
name: 'InputArea',
props: {
injectData: {
type: Object,
default: () => ({})
},
itemProp: {
type: String
}
},
data() {
return {
list: this.injectData
}
},
methods: {
changeInput() {
console.log(this.list)
this.$emit('emitData', this.list)
}
}
}
</script>
<style scoped>
.tableInner .el-input__inner {
border: none;
padding: 0;
height: 33px;
}
</style>

View File

@ -0,0 +1,44 @@
<template>
<div class="tableInner">
<el-select v-model="list[itemProp]" placeholder="请选择" style="width: 100%;" @change="changeSelect">
<el-option
v-for="item in getDictDatas(DICT_TYPE.TABLE_NAME)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
</template>
<script>
export default {
name: 'SelectArea',
props: {
injectData: {
type: Object,
default: () => ({})
},
itemProp: {
type: String
}
},
data() {
return {
list: this.injectData
}
},
methods: {
changeSelect() {
console.log(this.list)
this.$emit('emitData', this.list)
}
}
}
</script>
<style scoped>
.tableInner .el-input__inner {
border: none;
padding: 0;
height: 33px;
}
</style>

View File

@ -40,10 +40,18 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24"> <el-col :span="24">
<add-table <add-table
:table-props="tableProps"
:table-data="tableData" :table-data="tableData"
:table-name-list="tableNameList" :table-name-list="tableNameList"
@emitFun="inputChange" @emitFun="inputChange"
@emitButtonClick="emitButtonClick" /> @emitButtonClick="emitButtonClick" />
<!-- <base-table
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>
@ -56,7 +64,21 @@ import {
} from '@/api/base/energyQuantityManual'; } from '@/api/base/energyQuantityManual';
import moment from 'moment'; import moment from 'moment';
import AddTable from './AddTable'; import AddTable from './AddTable';
import InputArea from './InputArea';
import SelectArea from './SelectArea';
import { energyTableGet } from '@/api/base/energyQuantityManual'; import { energyTableGet } from '@/api/base/energyQuantityManual';
const tableProps = [
{
prop: 'tableName',
label: '表名*',
subcomponent: SelectArea,
},
{
prop: 'readingQuantity',
label: '抄表数*',
subcomponent: InputArea,
},
];
export default { export default {
name: 'EnergyQuantityManualAdd', name: 'EnergyQuantityManualAdd',
props: { props: {
@ -70,6 +92,7 @@ export default {
}, },
data() { data() {
return { return {
tableProps,
tableData: [], tableData: [],
tableNameList: [], //list tableNameList: [], //list
addButtonShow: '新增', addButtonShow: '新增',
@ -99,7 +122,6 @@ export default {
} else if (params.type === 'meterReading') { } else if (params.type === 'meterReading') {
this.isEdit = false; this.isEdit = false;
this.form.energyTypeId = params.energyTypeId; this.form.energyTypeId = params.energyTypeId;
this.selEnergyType(this.form.energyTypeId);
let obj = {}; let obj = {};
obj.tableName = params.tableName + ''; obj.tableName = params.tableName + '';
obj.readingQuantity = 0; obj.readingQuantity = 0;
@ -111,7 +133,6 @@ export default {
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.selEnergyType(this.form.energyTypeId);
this.form.recordTime = res.data.recordTime this.form.recordTime = res.data.recordTime
? res.data.recordTime ? res.data.recordTime
: null; : null;
@ -143,11 +164,6 @@ export default {
this.tableNameList = []; this.tableNameList = [];
energyTableGet({ energyTypeId: id }).then((res) => { energyTableGet({ energyTypeId: id }).then((res) => {
this.tableNameList = res.data.tableObjs || []; this.tableNameList = res.data.tableObjs || [];
if (this.tableNameList.length === 0) {
this.$modal.msgWarning(
'当前能源类型暂无配置表名,请先到《表名配置》页面配置'
);
}
}); });
}, },
submitForm() { submitForm() {

View File

@ -52,18 +52,18 @@ import { publicFormatter } from '@/utils/dict';
import { parseTimeTable } from '@/utils/ruoyi'; import { parseTimeTable } from '@/utils/ruoyi';
import EnergyQuantityManualAdd from './components/energyQuantityManualAdd'; import EnergyQuantityManualAdd from './components/energyQuantityManualAdd';
import moment from 'moment'; import moment from 'moment';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'energyTypeLabel', prop: 'energyType',
label: '能源类型', label: '能源类型',
minWidth: 110, minWidth: 110,
filter: publicFormatter('energy_type'),
showOverflowtooltip: true, showOverflowtooltip: true,
}, },
{ {
prop: 'unit', prop: 'unit',
label: '单位', label: '单位',
filter: publicFormatter('unit_dict'), filter: publicFormatter('energy_unit'),
minWidth: 110, minWidth: 110,
}, },
{ {
@ -142,6 +142,7 @@ export default {
}, },
], ],
tableProps, tableProps,
tableH: this.tableHeight(260),
// //
total: 0, total: 0,
// //
@ -180,8 +181,10 @@ export default {
}; };
}, },
components: { EnergyQuantityManualAdd }, components: { EnergyQuantityManualAdd },
mixins: [tableHeightMixin],
created() { created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260);
});
let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf(); let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf();
let start = moment( let start = moment(
moment().subtract(7, 'days').format('YYYY-MM-DD 00:00:00') moment().subtract(7, 'days').format('YYYY-MM-DD 00:00:00')
@ -241,11 +244,6 @@ export default {
? item.amount.toFixed(2) ? item.amount.toFixed(2)
: '' : ''
: ''; : '';
this.getDictDatas('energy_type').map((subItem) => {
if (item.energyType === subItem.value) {
item.energyTypeLabel = subItem.label;
}
});
}); });
this.list = arr; this.list = arr;
this.total = response.data.total; this.total = response.data.total;
@ -307,7 +305,7 @@ export default {
handleDelete(row) { handleDelete(row) {
console.log(row.id); console.log(row.id);
this.$modal this.$modal
.confirm('是否确认删除能源类型为"' + row.energyTypeLabel + '"的数据项?') .confirm('是否确认删除能源类型为"' + row.energyType + '"的数据项?')
.then(function () { .then(function () {
return energyQuantityManualDelete({ id: row.id }); return energyQuantityManualDelete({ id: row.id });
}) })

View File

@ -1,254 +1,220 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 -->
<search-bar <!-- 搜索工作栏 -->
:formConfigs="formConfig" <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
ref="searchBarForm" <!-- 列表 -->
@headBtnClick="buttonClick" /> <base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
<!-- 列表 --> :selectWidth="55" :max-height="tableH" @selection-change="selectChange" />
<base-table <pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
:page="queryParams.pageNo" @pagination="getList" />
:limit="queryParams.pageSize" </div>
: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>
</template> </template>
<script> <script>
import { getEnergyQuantityRealtimePage } from '@/api/base/energyQuantityRealtime'; import { getEnergyQuantityRealtimePage } 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 FileSaver from "file-saver"
import * as XLSX from 'xlsx/xlsx.mjs'; import * as XLSX from 'xlsx/xlsx.mjs'
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'objName', prop: 'objName',
label: '统计对象', label: '统计对象',
showOverflowtooltip: true, showOverflowtooltip: true
}, },
{ {
prop: 'objCode', prop: 'objCode',
label: '对象编码', label: '对象编码',
showOverflowtooltip: true, showOverflowtooltip: true
}, },
{ {
prop: 'energyTypeLabel', prop: 'energyTypeName',
label: '能源类型', label: '能源类型',
showOverflowtooltip: true, showOverflowtooltip: true
}, },
{ {
prop: 'startValue', prop: 'startValue',
label: '初始值', label: '初始值'
}, },
{ {
prop: 'endValue', prop: 'endValue',
label: '当前值', label: '当前值'
}, },
{ {
prop: 'diffValue', prop: 'diffValue',
label: '差值', label: '差值'
}, },
{ {
prop: 'amount', prop: 'amount',
label: '金额', label: '金额'
}, }
]; ]
export default { export default {
name: 'EnergyQuantityRealtime', name: "EnergyQuantityRealtime",
mixins: [tableHeightMixin], data() {
data() { return {
return { formConfig: [
formConfig: [ {
{ type: 'select',
type: 'select', label: '能源类型',
label: '能源类型', selectOptions: [],
labelField: 'labelName', param: 'energyTypeId',
selectOptions: [], filterable: true
param: 'energyTypeId', },
filterable: true, {
}, type: 'datePicker',
{ label: '时间',
type: 'datePicker', dateType: 'datetimerange',
label: '时间', format: 'yyyy-MM-dd HH:mm:ss',
dateType: 'datetimerange', valueFormat: "timestamp",
format: 'yyyy-MM-dd HH:mm:ss', rangeSeparator: '-',
valueFormat: 'timestamp', startPlaceholder: '开始时间',
rangeSeparator: '-', endPlaceholder: '结束时间',
startPlaceholder: '开始时间', param: 'timeVal',
endPlaceholder: '结束时间', defaultSelect: [],
param: 'timeVal', width: 350
defaultSelect: [], },
width: 350, {
}, type: 'button',
{ btnName: '查询',
type: 'button', name: 'search',
btnName: '查询', color: 'primary'
name: 'search', },
color: 'primary', {
}, type: 'separate'
{ },
type: 'separate', {
}, type: this.$auth.hasPermi('base:energy-quantity-realtime:export') ? 'button' : '',
{ btnName: '导出',
type: this.$auth.hasPermi('base:energy-quantity-realtime:export') name: 'export',
? 'button' color: 'primary',
: '', plain: true
btnName: '导出', }
name: 'export', ],
color: 'primary', tableProps,
plain: true, tableH: this.tableHeight(260),
}, //
], total: 0,
tableProps, //
// list: [],
total: 0, //
// queryParams: {
list: [], pageNo: 1,
// pageSize: 20,
queryParams: { energyTypeId: '',
pageNo: 1, startTime: null,
pageSize: 20, endTime: null
energyTypeId: '', },
startTime: null, energyTypeList: [],
endTime: null, exportList: []
}, };
energyTypeList: [], },
exportList: [], created() {
}; window.addEventListener('resize', () => {
}, this.tableH = this.tableHeight(260)
created() { })
if (location.href.indexOf('?') > 0) { if (location.href.indexOf('?') > 0) {
let arr = location.href.split('?')[1].split('&'); let arr = location.href.split('?')[1].split('&')
this.formConfig[1].defaultSelect = [ this.formConfig[1].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
arr[0].split('=')[1], } else {
arr[1].split('=')[1], this.formConfig[1].defaultSelect = [Date.now() - 7 * 24 * 3600000, Date.now()]
]; }
} else { this.queryParams.startTime = this.formConfig[1].defaultSelect[0]
this.formConfig[1].defaultSelect = [ this.queryParams.endTime = this.formConfig[1].defaultSelect[1]
Date.now() - 7 * 24 * 3600000, this.getList();
Date.now(), this.getTypeList()
]; },
} watch: {
this.queryParams.startTime = this.formConfig[1].defaultSelect[0]; $route: 'initData'
this.queryParams.endTime = this.formConfig[1].defaultSelect[1]; },
this.getList(); methods: {
this.getTypeList(); initData(to) {
}, if (to.name === 'EnergyQuantityRealtime') {
watch: { if (location.href.indexOf('?') > 0) {
$route: 'initData', let arr = location.href.split('?')[1].split('&')
}, this.formConfig[1].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
methods: { } else {
initData(to) { this.formConfig[1].defaultSelect = [Date.now() - 7 * 24 * 3600000, Date.now()]
if (to.name === 'EnergyQuantityRealtime') { }
if (location.href.indexOf('?') > 0) { this.queryParams.startTime = this.formConfig[1].defaultSelect[0]
let arr = location.href.split('?')[1].split('&'); this.queryParams.endTime = this.formConfig[1].defaultSelect[1]
this.formConfig[1].defaultSelect = [ this.getList()
arr[0].split('=')[1], }
arr[1].split('=')[1], },
]; buttonClick(val) {
} else { this.queryParams.pageNo = 1;
this.formConfig[1].defaultSelect = [ this.queryParams.energyTypeId = val.energyTypeId
Date.now() - 7 * 24 * 3600000, this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null
Date.now(), this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null
]; switch (val.btnName) {
} case 'search':
this.queryParams.startTime = this.formConfig[1].defaultSelect[0]; this.getList()
this.queryParams.endTime = this.formConfig[1].defaultSelect[1]; break
this.getList(); default:
} this.exportTable()
}, }
buttonClick(val) { },
this.queryParams.pageNo = 1; /** 查询列表 */
this.queryParams.energyTypeId = val.energyTypeId; getList() {
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null; getEnergyQuantityRealtimePage(this.queryParams).then(response => {
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null; let arr = response.data.list || []
switch (val.btnName) { arr && arr.map(item => {
case 'search': item.amount = item.amount ? (!isNaN(parseFloat(item.amount)) && isFinite(item.amount) ? item.amount.toFixed(2) : '') : ''
this.getList(); })
break; this.list = arr
default: this.total = response.data.total;
this.exportTable(); this.exportList = []
} });
}, },
/** 查询列表 */ getTypeList() {
getList() { getEnergyTypeListAll().then((res) => {
getEnergyQuantityRealtimePage(this.queryParams).then((response) => { this.formConfig[0].selectOptions = res.data || []
let arr = response.data.list || []; this.energyTypeList = res.data || []
arr && })
arr.map((item) => { },
item.amount = item.amount selectChange(val) {
? !isNaN(parseFloat(item.amount)) && isFinite(item.amount) console.log(val)
? item.amount.toFixed(2) this.exportList = val
: '' },
: ''; //
this.getDictDatas('energy_type').map((subItem) => { exportTable() {
if (item.energyTypeName === subItem.value) { if (this.exportList.length > 0) {
item.energyTypeLabel = subItem.label; let body = this.exportList.map((x) => [
} x.objName,
}); x.objCode,
}); x.energyTypeName,
this.list = arr; x.startValue,
this.total = response.data.total; x.endValue,
this.exportList = []; x.diffValue,
}); x.amount
}, ])
getTypeList() { let header = []
getEnergyTypeListAll().then((res) => { this.tableProps.map((y) => {
this.formConfig[0].selectOptions = res.data || []; header.push(y.label)
this.energyTypeList = res.data || []; })
}); body.unshift(header)
}, console.log(body)
selectChange(val) { const filename = '能源抄表.xlsx'
console.log(val); const ws_name = 'Sheet1'
this.exportList = val; const wb = XLSX.utils.book_new()
}, const ws = XLSX.utils.aoa_to_sheet(body)
// XLSX.utils.book_append_sheet(wb, ws, ws_name)
exportTable() { let wbout = XLSX.write(wb, {
if (this.exportList.length > 0) { bookType: 'xlsx',
let body = this.exportList.map((x) => [ bookSST: false,
x.objName, type: 'array'
x.objCode, })
x.energyTypeLabel, FileSaver.saveAs(
x.startValue, new Blob([wbout], {
x.endValue, type: 'application/octet-stream'
x.diffValue, }),
x.amount, filename
]); )
let header = []; } else {
this.tableProps.map((y) => { this.$modal.msgWarning('请勾选需要导出的数据')
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('请勾选需要导出的数据');
}
},
},
}; };
</script> </script>

View File

@ -40,7 +40,6 @@ import { getEnergyTypePage, deleteEnergyType } from '@/api/base/energyType';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
import InnerTable from './components/InnerTable'; import InnerTable from './components/InnerTable';
import EnergyTypeAdd from './components/energyTypeAdd'; import EnergyTypeAdd from './components/energyTypeAdd';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'code', prop: 'code',
@ -49,8 +48,9 @@ const tableProps = [
minWidth: 150, minWidth: 150,
}, },
{ {
prop: 'energyTypeLabel', prop: 'name',
label: '能源类型', label: '能源类型',
filter: publicFormatter('energy_type'),
}, },
{ {
prop: 'unit', prop: 'unit',
@ -70,7 +70,6 @@ const tableProps = [
export default { export default {
name: 'EnergyType', name: 'EnergyType',
components: { EnergyTypeAdd }, components: { EnergyTypeAdd },
mixins: [tableHeightMixin],
data() { data() {
return { return {
formConfig: [ formConfig: [
@ -97,7 +96,7 @@ export default {
} }
: undefined, : undefined,
].filter((v) => v), ].filter((v) => v),
heightNum: 220, tableH: this.tableHeight(220),
pricingMethodList: [ pricingMethodList: [
{ value: 0, label: '分时间段计价' }, { value: 0, label: '分时间段计价' },
{ value: 1, label: '分使用量计价' }, { value: 1, label: '分使用量计价' },
@ -119,6 +118,9 @@ export default {
}; };
}, },
created() { created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(220);
});
this.getList(); this.getList();
}, },
methods: { methods: {
@ -140,11 +142,6 @@ export default {
item.pricingMethod = i.label; item.pricingMethod = i.label;
} }
}); });
this.getDictDatas('energy_type').map((subItem) => {
if (item.name === subItem.value) {
item.energyTypeLabel = subItem.label;
}
});
}); });
this.list = arr; this.list = arr;
this.total = response.data.total; this.total = response.data.total;
@ -177,9 +174,8 @@ export default {
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
console.log(row);
this.$modal this.$modal
.confirm('是否确认删除能源类型为"' + row.energyTypeLabel + '"的数据项?') .confirm('是否确认删除能源类型为"' + row.name + '"的数据项?')
.then(function () { .then(function () {
return deleteEnergyType(row.id); return deleteEnergyType(row.id);
}) })

View File

@ -32,7 +32,6 @@
import { energyTablePage } from '@/api/base/energyQuantityManual'; import { energyTablePage } from '@/api/base/energyQuantityManual';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
import tableNameConfigUpdate from './components/tableNameConfigUpdate.vue'; import tableNameConfigUpdate from './components/tableNameConfigUpdate.vue';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'energyType', prop: 'energyType',
@ -64,11 +63,10 @@ export default {
pageNo: 1, pageNo: 1,
pageSize: 100, pageSize: 100,
}, },
heightNum: 165, tableH: this.tableHeight(165),
centervisible: false, centervisible: false,
}; };
}, },
mixins: [tableHeightMixin],
created() { created() {
this.getList(); this.getList();
}, },

View File

@ -182,7 +182,6 @@ export default {
limitType: '', limitType: '',
minValue: 0, minValue: 0,
maxValue: 0, maxValue: 0,
tableName: '',
}, },
objIds: [], // objIds: [], //
isEdit: false, // isEdit: false, //
@ -215,9 +214,6 @@ export default {
if (res.code === 0) { if (res.code === 0) {
this.form = res.data; this.form = res.data;
this.form.plcParamId = res.data.plcParamId || ''; this.form.plcParamId = res.data.plcParamId || '';
this.form.tableName = this.form.tableName
? this.form.tableName + ''
: '';
this.form.method = this.form.method ? this.form.method + '' : ''; this.form.method = this.form.method ? this.form.method + '' : '';
this.form.limitType = this.form.limitType this.form.limitType = this.form.limitType
? this.form.limitType + '' ? this.form.limitType + ''

View File

@ -51,7 +51,6 @@ import { getEnergyTypeListAll } from '@/api/base/energyType';
import { getTree } from '@/api/analysis/energyAnalysis'; import { getTree } from '@/api/analysis/energyAnalysis';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
import EnergyLimitAdd from './components/energyLimitAdd'; import EnergyLimitAdd from './components/energyLimitAdd';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'method', prop: 'method',
@ -105,7 +104,6 @@ const tableProps = [
export default { export default {
name: 'EnergyLimit', name: 'EnergyLimit',
components: { EnergyLimitAdd }, components: { EnergyLimitAdd },
mixins: [tableHeightMixin],
data() { data() {
return { return {
formConfig: [ formConfig: [
@ -158,6 +156,7 @@ export default {
} }
: undefined, : undefined,
].filter((v) => v), ].filter((v) => v),
tableH: this.tableHeight(260),
// //
total: 0, total: 0,
// //
@ -182,6 +181,9 @@ export default {
}; };
}, },
created() { created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260);
});
this.getList(); this.getList();
this.getTypeList(); this.getTypeList();
// //

View File

@ -45,7 +45,6 @@ import { getEnergyOverlimitLogPage } from '@/api/monitoring/energyOverlimitLog';
import { getEnergyTypeListAll } from '@/api/base/energyType'; import { getEnergyTypeListAll } from '@/api/base/energyType';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
import { parseTime } from '@/utils/ruoyi'; import { parseTime } from '@/utils/ruoyi';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'objName', prop: 'objName',
@ -124,7 +123,6 @@ const tableProps2 = [
]; ];
export default { export default {
name: 'EnergyOverlimitLog', name: 'EnergyOverlimitLog',
mixins: [tableHeightMixin],
data() { data() {
return { return {
formConfig: [ formConfig: [
@ -153,10 +151,10 @@ export default {
activeName: 'auto', activeName: 'auto',
tableProps, tableProps,
tableProps2, tableProps2,
tableH: this.tableHeight(260),
total: 0, total: 0,
list: [], list: [],
list2: [], list2: [],
heightNum: 300,
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
@ -172,6 +170,9 @@ export default {
}; };
}, },
created() { created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260);
});
this.getList(); this.getList();
this.getTypeList(); this.getTypeList();
}, },

View File

@ -72,7 +72,7 @@ const tableProps = [
}, },
]; ];
export default { export default {
name: 'EnergyReport', name: 'EnergyLimit',
data() { data() {
return { return {
isFold: false, isFold: false,
@ -181,7 +181,7 @@ export default {
return energyReportPageExportAuto({ ...this.queryParams }); return energyReportPageExportAuto({ ...this.queryParams });
}) })
.then((response) => { .then((response) => {
this.$download.excel(response, '能统计报表.xls'); this.$download.excel(response, '能统计报表.xls');
}) })
.catch(() => {}); .catch(() => {});
} }

View File

@ -1,171 +1,161 @@
<template> <template>
<div <div class="app-container" id='energyReportSearchBox'>
class="app-container"
id="energyReportSearchBox"> <!-- 搜索工作栏 -->
<!-- 搜索工作栏 --> <search-bar
<search-bar :formConfigs="formConfig"
:formConfigs="formConfig" ref="searchBarForm"
ref="searchBarForm" :isFold="isFold"
:isFold="isFold" @headBtnClick="buttonClick"
@headBtnClick="buttonClick" /> />
<!-- 列表 --> <!-- 列表 -->
<base-table <base-table
:page="queryParams.pageNo" :page="queryParams.pageNo"
:limit="queryParams.pageSize" :limit="queryParams.pageSize"
:table-props="tableProps" :table-props="tableProps"
:table-data="list" :table-data="list"
:max-height="tableH" /> :max-height="tableH"
<pagination />
:page.sync="queryParams.pageNo" <pagination
:limit.sync="queryParams.pageSize" :page.sync="queryParams.pageNo"
:total="total" :limit.sync="queryParams.pageSize"
@pagination="getList" /> :total="total"
</div> @pagination="getList"
/>
</div>
</template> </template>
<script> <script>
import { import { energyReportPage, energyReportPageExport } from "@/api/monitoring/energyReport";
energyReportPage, import { getEnergyTypeListAll } from "@/api/base/energyType"
energyReportPageExport,
} from '@/api/monitoring/energyReport';
import { publicFormatter } from '@/utils/dict';
import { getEnergyTypeListAll } from '@/api/base/energyType';
const tableProps = [ const tableProps = [
{ {
prop: 'statisticName', prop: 'statisticName',
label: '统计方案', label: '统计方案'
}, },
{ {
prop: 'energyType', prop: 'energyType',
label: '能源类型', label: '能源类型'
filter: publicFormatter('energy_type'), },
}, {
{ prop: 'startValue',
prop: 'startValue', label: '抄表数(起始)'
label: '抄表数(起始)', },
}, {
{ prop: 'endValue',
prop: 'endValue', label: '抄表数(结束)'
label: '抄表数(结束)', },
}, {
{ prop: 'diffValue',
prop: 'diffValue', label: '消耗量'
label: '消耗量', }
}, ]
];
export default { export default {
name: 'EnergyReportSearch', name: "EnergyReportSearch",
data() { data() {
return { return {
isFold: false, isFold: false,
formConfig: [ formConfig: [
{ {
type: 'input', type: 'input',
label: '统计方案', label: '统计方案',
param: 'statisticName', param: 'statisticName'
}, },
{ {
type: 'select', type: 'select',
label: '能源类型', label: '能源类型',
labelField: 'labelName', selectOptions: [],
selectOptions: [], param: 'energyTypeId',
param: 'energyTypeId', filterable: true
filterable: true, },
}, {
{ type: 'datePicker',
type: 'datePicker', label: '时间',
label: '时间', dateType: 'datetimerange',
dateType: 'datetimerange', format: 'yyyy-MM-dd HH:mm:ss',
format: 'yyyy-MM-dd HH:mm:ss', valueFormat: "timestamp",
valueFormat: 'timestamp', rangeSeparator: '-',
rangeSeparator: '-', startPlaceholder: '开始时间',
startPlaceholder: '开始时间', endPlaceholder: '结束时间',
endPlaceholder: '结束时间', param: 'timeVal',
param: 'timeVal', defaultSelect: [],
defaultSelect: [], width: 350,
width: 350, clearable: false
clearable: false, },
}, {
{ type: 'button',
type: 'button', btnName: '查询',
btnName: '查询', name: 'search',
name: 'search', color: 'primary'
color: 'primary', },
}, {
{ type: 'separate'
type: 'separate', },
}, {
{ type: this.$auth.hasPermi('monitoring:energy-report-search:export') ? 'button' : '',
type: this.$auth.hasPermi('monitoring:energy-report-search:export') btnName: '导出',
? 'button' name: 'add',
: '', color: 'primary',
btnName: '导出', plain: true
name: 'add', }
color: 'primary', ],
plain: true, tableProps,
}, tableH: this.tableHeight(260),
], //
tableProps, total: 0,
tableH: this.tableHeight(260), //
// list: [],
total: 0, //
// queryParams: {
list: [], pageNo: 1,
// pageSize: 20,
queryParams: { statisticName: null,
pageNo: 1, startTime: null,
pageSize: 20, endTime: null
statisticName: null, },
startTime: null, energyTypeList: []
endTime: null, };
}, },
energyTypeList: [], mounted() {
}; window.addEventListener('resize', () => {
}, this.tableH = this.tableHeight(260)
mounted() { this.isFold = this.searchBarWidth('energyReportSearchBox', 1180)
window.addEventListener('resize', () => { })
this.tableH = this.tableHeight(260); this.getList()
this.isFold = this.searchBarWidth('energyReportSearchBox', 1180); this.getTypeList()
}); this.isFold = this.searchBarWidth('energyReportSearchBox', 1180)
this.getList(); },
this.getTypeList(); methods: {
this.isFold = this.searchBarWidth('energyReportSearchBox', 1180); getTypeList() {
}, getEnergyTypeListAll().then((res) => {
methods: { this.formConfig[1].selectOptions = res.data || []
getTypeList() { })
getEnergyTypeListAll().then((res) => { },
this.formConfig[1].selectOptions = res.data || []; buttonClick(val) {
}); switch (val.btnName) {
}, case 'search':
buttonClick(val) { this.queryParams.pageNo = 1
switch (val.btnName) { this.queryParams.statisticName = val.statisticName
case 'search': this.queryParams.energyTypeId = val.energyTypeId
this.queryParams.pageNo = 1; this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null
this.queryParams.statisticName = val.statisticName; this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null
this.queryParams.energyTypeId = val.energyTypeId; this.getList()
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null; break
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null; default:
this.getList(); this.$modal.confirm('是否确认导出').then(() => {
break; return energyReportPageExport({...this.queryParams});
default: }).then(response => {
this.$modal this.$download.excel(response, '能源统计查询报表.xls');
.confirm('是否确认导出') }).catch(() => {})
.then(() => { }
return energyReportPageExport({ ...this.queryParams }); },
}) /** 查询列表 */
.then((response) => { getList() {
this.$download.excel(response, '能源统计查询报表.xls'); energyReportPage({...this.queryParams}).then(response => {
}) this.list = response.data.list || [];
.catch(() => {}); this.total = response.data.total;
} });
}, }
/** 查询列表 */ }
getList() {
energyReportPage({ ...this.queryParams }).then((response) => {
this.list = response.data.list || [];
this.total = response.data.total;
});
},
},
}; };
</script> </script>

View File

@ -1,271 +1,230 @@
<template> <template>
<div> <div>
<el-drawer <el-drawer :title="drawerTitle" :visible.sync="visible" size="70%" @close='closeD' :show-close='false'>
:title="drawerTitle" <div class="box">
:visible.sync="visible" <el-form :inline="true">
size="70%" <el-form-item label="方案名称">
@close="closeD" <el-input v-model="name" size='small' readonly></el-input>
:show-close="false"> </el-form-item>
<div class="box"> <el-form-item label="能源类型">
<el-form :inline="true"> <el-input v-model="energyType" size='small' readonly></el-input>
<el-form-item label="方案名称"> </el-form-item>
<el-input <el-form-item>
v-model="name" <el-button type="success" size='small' v-if="showBtn" plain @click="addNew">新增</el-button>
size="small" <el-button type="danger" size='small' v-if="showBtn" plain @click="deleteAll">批量删除</el-button>
readonly></el-input> </el-form-item>
</el-form-item> </el-form>
<el-form-item label="能源类型"> <base-table
<el-input :page="queryParams.pageNo"
v-model="energyTypeLabel" :limit="queryParams.pageSize"
size="small" :table-props="tableProps"
readonly></el-input> :table-data="tableData"
</el-form-item> :max-height="tableH"
<el-form-item> :selectWidth="55"
<el-button @selection-change="selectChange"
type="success" >
size="small" <method-btn
v-if="showBtn" v-if="tableBtn.length"
plain slot="handleBtn"
@click="addNew"> :width="80"
新增 label="操作"
</el-button> :method-list="tableBtn"
<el-button @clickBtn="handleClick"
type="danger" />
size="small" </base-table>
v-if="showBtn" <pagination
plain :page.sync="queryParams.pageNo"
@click="deleteAll"> :limit.sync="queryParams.pageSize"
批量删除 :total="total"
</el-button> @pagination="getList"
</el-form-item> />
</el-form> </div>
<base-table </el-drawer>
:page="queryParams.pageNo" <!-- 新增 -->
:limit="queryParams.pageSize" <energy-statistics-det-add ref="energyStatistics" @closeDet="closeDet" />
:table-props="tableProps" </div>
:table-data="tableData"
:max-height="tableH"
:selectWidth="55"
@selection-change="selectChange">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
</div>
</el-drawer>
<!-- 新增 -->
<energy-statistics-det-add
ref="energyStatistics"
@closeDet="closeDet" />
</div>
</template> </template>
<script> <script>
import { import { getEnergyStatisticsDetPage, deleteEnergyStatisticsDet, deleteMany } from '@/api/monitoring/energyStatisticsDet'
getEnergyStatisticsDetPage, import EnergyStatisticsDetAdd from './energyStatisticsDetAdd'
deleteEnergyStatisticsDet, import { publicFormatter } from '@/utils/dict'
deleteMany,
} from '@/api/monitoring/energyStatisticsDet';
import EnergyStatisticsDetAdd from './energyStatisticsDetAdd';
import { publicFormatter } from '@/utils/dict';
const tableProps = [ const tableProps = [
{ {
prop: 'objName', prop: 'objName',
label: '所属对象', label: '所属对象'
}, },
{ {
prop: 'objCode', prop: 'objCode',
label: '对象编码', label: '对象编码'
}, },
{ {
prop: 'paramName', prop: 'paramName',
label: '参数名称', label: '参数名称'
}, },
{ {
prop: 'unit', prop: 'unit',
label: '单位', label: '单位',
filter: publicFormatter('unit_dict'), filter: publicFormatter('energy_unit')
}, },
{ {
prop: 'desc', prop: 'desc',
label: '描述', label: '描述'
}, }
]; ]
export default { export default {
name: 'EnergyStatisticsDet', name: 'EnergyStatisticsDet',
props: { props: {
energyTypeList: { energyTypeList: {
type: Array, type: Array,
required: true, required: true,
default: () => { default: () => {
return []; return []
}, }
}, }
}, },
data() { data() {
return { return {
visible: false, visible: false,
drawerTitle: '', drawerTitle: '',
tableProps, tableProps,
tableData: [], tableData: [],
tableBtn: [], tableBtn: [],
tableH: this.tableHeight(115), tableH: this.tableHeight(115),
total: 0, total: 0,
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 30, pageSize: 30,
statisticsId: null, statisticsId: null
}, },
name: '', name: '',
energyTypeLabel: '', energyType: '',
energyTypeId: '', energyTypeId: '',
// //
addOrEditTitle: '', addOrEditTitle: "",
// //
centervisible: false, centervisible: false,
collectionList: [ collectionList: [
{ value: 0, label: '否' }, {value: 0,label: '否'},
{ value: 1, label: '是' }, {value: 1,label: '是'}
], ],
showBtn: true, showBtn: true,
selectedList: [], selectedList: []
}; }
}, },
components: { EnergyStatisticsDetAdd }, components: { EnergyStatisticsDetAdd },
created() { created() {
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.tableH = this.tableHeight(115); this.tableH = this.tableHeight(115)
}); })
}, },
methods: { methods: {
init(data, title) { init(data,title) {
this.visible = true; this.visible = true
this.queryParams.statisticsId = data.id; this.queryParams.statisticsId = data.id
this.name = data.name; this.name = data.name
this.energyTypeLabel = data.energyTypeLabel; this.energyType = data.energyType
this.energyTypeId = data.energyTypeId; this.energyTypeId = data.energyTypeId
this.getList(); this.getList()
if (title === 'detail') { if (title === 'detail') {
this.drawerTitle = '查看参数'; this.drawerTitle = '查看参数'
this.showBtn = false; this.showBtn = false
this.tableBtn = []; this.tableBtn = []
} else { } else {
this.drawerTitle = '参数绑定'; this.drawerTitle = '参数绑定'
this.showBtn = true; this.showBtn = true
this.tableBtn = [ this.tableBtn = [
{ {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除'
}, }
]; ]
} }
}, },
getList() { getList() {
console.log(this.queryParams); console.log(this.queryParams)
getEnergyStatisticsDetPage({ ...this.queryParams }).then((res) => { getEnergyStatisticsDetPage({...this.queryParams}).then((res) => {
let arr = res.data.list || []; let arr = res.data.list || []
arr && arr&&arr.map(item => {
arr.map((item) => { this.collectionList.map(i => {
this.collectionList.map((i) => { if (item.collection === i.value) {
if (item.collection === i.value) { item.collection = i.label
item.collection = i.label; }
} })
}); this.energyTypeList.map(j => {
this.energyTypeList.map((j) => { if (item.typeId === j.id) {
if (item.typeId === j.id) { item.typeId = j.name
item.typeId = j.name; }
} })
}); })
}); this.tableData = arr
this.tableData = arr; this.total = res.data.total;
this.total = res.data.total; })
}); },
}, //
// addNew() {
addNew() { this.$nextTick(() => {
this.$nextTick(() => { this.$refs.energyStatistics.init({'statisticsId': this.queryParams.statisticsId, energyTypeId:this.energyTypeId})
this.$refs.energyStatistics.init({ })
statisticsId: this.queryParams.statisticsId, },
energyTypeId: this.energyTypeId, selectChange(val) {
}); console.log(val)
}); this.selectedList = val
}, },
selectChange(val) { //
console.log(val); deleteAll() {
this.selectedList = val; let arr = []
}, if (this.selectedList.length === 0) {
// this.$modal.msgWarning("请选勾选数据")
deleteAll() { return false
let arr = []; } else {
if (this.selectedList.length === 0) { this.selectedList.map((item) => {
this.$modal.msgWarning('请选勾选数据'); arr.push(item.id)
return false; })
} else { }
this.selectedList.map((item) => { this.$modal.confirm('是否确认删除所有勾选的数据项?').then(function() {
arr.push(item.id); return deleteMany(arr);
}); }).then(() => {
} this.queryParams.pageNo = 1
this.$modal this.getList()
.confirm('是否确认删除所有勾选的数据项?') this.$modal.msgSuccess("删除成功")
.then(function () { }).catch(() => {})
return deleteMany(arr); },
}) handleCancel() {
.then(() => { this.$refs.energyStatistics.formClear()
this.queryParams.pageNo = 1; this.centervisible = false
this.getList(); this.addOrEditTitle = ''
this.$modal.msgSuccess('删除成功'); },
}) handleConfirm() {
.catch(() => {}); this.$refs.energyStatistics.submitForm()
}, },
handleCancel() { successSubmit() {
this.$refs.energyStatistics.formClear(); this.handleCancel()
this.centervisible = false; this.getList()
this.addOrEditTitle = ''; },
}, handleClick(val) {
handleConfirm() { this.handleDelete(val.data)
this.$refs.energyStatistics.submitForm(); },
}, /** 删除按钮操作 */
successSubmit() { handleDelete(row) {
this.handleCancel(); this.$modal.confirm('是否确认删除参数列名为"' + row.paramName + '"的数据项?').then(function() {
this.getList(); return deleteEnergyStatisticsDet(row.id);
}, }).then(() => {
handleClick(val) { this.queryParams.pageNo = 1
this.handleDelete(val.data); this.getList()
}, this.$modal.msgSuccess("删除成功")
/** 删除按钮操作 */ }).catch(() => {})
handleDelete(row) { },
this.$modal closeD() {
.confirm('是否确认删除参数列名为"' + row.paramName + '"的数据项?') this.$emit('closeDrawer')
.then(function () { },
return deleteEnergyStatisticsDet(row.id); closeDet() { //
}) this.getList()
.then(() => { }
this.queryParams.pageNo = 1; }
this.getList(); }
this.$modal.msgSuccess('删除成功');
})
.catch(() => {});
},
closeD() {
this.$emit('closeDrawer');
},
closeDet() {
//
this.getList();
},
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.box { .box {
padding: 0 32px; padding: 0 32px;
} }
</style> </style>

View File

@ -1,178 +1,179 @@
<template> <template>
<el-drawer <el-drawer
title="新增" title="新增"
:visible.sync="centervisible" :visible.sync="centervisible"
size="60%" size="60%"
@close="closeA" @close='closeA'
:show-close="false"> :show-close='false'>
<div class="box"> <div class="box">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar
:formConfigs="formConfig" :formConfigs="formConfig"
ref="searchBarForm" ref="searchBarForm"
:removeBlue="true" :removeBlue='true'
@headBtnClick="buttonClick" /> @headBtnClick="buttonClick"
<!-- 列表 --> />
<base-table <!-- 列表 -->
:page="queryParams.pageNo" <base-table
:limit="queryParams.pageSize" :page="queryParams.pageNo"
:table-props="tableProps" :limit="queryParams.pageSize"
:table-data="list" :table-props="tableProps"
:max-height="tableH" :table-data="list"
:selectWidth="55" :max-height="tableH"
@selection-change="selectChange"></base-table> :selectWidth="55"
<pagination @selection-change="selectChange"
:page.sync="queryParams.pageNo" >
:limit.sync="queryParams.pageSize" </base-table>
:total="total" <pagination
@pagination="getList" /> :page.sync="queryParams.pageNo"
</div> :limit.sync="queryParams.pageSize"
</el-drawer> :total="total"
@pagination="getList"
/>
</div>
</el-drawer>
</template> </template>
<script> <script>
import { import { addParamPage, createEnergyStatisticsDet } from '@/api/monitoring/energyStatisticsDet'
addParamPage, import { publicFormatter } from '@/utils/dict'
createEnergyStatisticsDet,
} from '@/api/monitoring/energyStatisticsDet';
import { publicFormatter } from '@/utils/dict';
const tableProps = [ const tableProps = [
{ {
prop: 'objName', prop: 'objName',
label: '所属对象', label: '所属对象'
}, },
{ {
prop: 'objCode', prop: 'objCode',
label: '对象编码', label: '对象编码'
}, },
{ {
prop: 'paramName', prop: 'paramName',
label: '参数名称', label: '参数名称'
}, },
{ {
prop: 'unit', prop: 'unit',
label: '单位', label: '单位',
filter: publicFormatter('unit_dict'), filter: publicFormatter('energy_unit')
}, },
{ {
prop: 'desc', prop: 'desc',
label: '描述', label: '描述'
}, }
]; ]
export default { export default {
name: 'EnergyStatisticsDetAdd', name: 'EnergyStatisticsDetAdd',
data() { data() {
return { return {
centervisible: false, centervisible: false,
formConfig: [ formConfig: [
{ {
type: 'select', type: 'select',
label: '对象类型', label: '对象类型',
selectOptions: this.getDictDatas(this.DICT_TYPE.OBJECT_TYPE), selectOptions: this.getDictDatas(this.DICT_TYPE.OBJECT_TYPE),
labelField: 'label', labelField: 'label',
valueField: 'value', valueField: 'value',
param: 'objType', param: 'objType'
}, },
{ {
type: 'input', type: 'input',
label: '参数名称', label: '参数名称',
placeholder: '参数名称', placeholder: '参数名称',
param: 'paramName', param: 'paramName'
}, },
{ {
type: 'button', type: 'button',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary'
}, },
{ {
type: 'separate', type: 'separate'
}, },
{ {
type: 'button', type: 'button',
btnName: '关联', btnName: '关联',
name: 'add', name: 'add',
color: 'primary', color: 'primary',
plain: true, plain: true
}, }
], ],
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 20, pageSize: 20,
energyTypeId: null, energyTypeId: null,
statisticId: null, statisticId: null,
paramName: '', paramName: '',
objType: '', objType: ''
}, },
tableProps, tableProps,
list: [], list: [],
total: 0, total: 0,
tableH: this.tableHeight(260), tableH: this.tableHeight(260),
selectedList: [], selectedList: []
}; }
}, },
methods: { methods: {
init(param) { init(param) {
this.queryParams.statisticId = param.statisticsId; this.queryParams.statisticId = param.statisticsId
this.queryParams.energyTypeId = param.energyTypeId; this.queryParams.energyTypeId = param.energyTypeId
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260); this.tableH = this.tableHeight(260)
}); })
this.centervisible = true; this.centervisible = true
this.getList(); this.getList()
}, },
getList() { getList() {
addParamPage({ ...this.queryParams }).then((res) => { addParamPage({...this.queryParams}).then((res) => {
this.list = res.data.list || []; this.list = res.data.list || []
this.total = res.data.total; this.total = res.data.total
}); })
}, },
buttonClick(val) { buttonClick(val) {
switch (val.btnName) { switch (val.btnName) {
case 'search': case 'search':
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1;
this.queryParams.objType = val.objType; this.queryParams.objType = val.objType
this.queryParams.paramName = val.paramName; this.queryParams.paramName = val.paramName
this.getList(); this.getList()
break; break
default: default:
// //
this.connectParam(); this.connectParam()
} }
}, },
// //
selectChange(val) { selectChange(val) {
this.selectedList = val; this.selectedList = val
}, },
// //
connectParam() { connectParam() {
let param = { let param = {
statisticsId: this.queryParams.statisticId, statisticsId: this.queryParams.statisticId,
plcParamIds: [], plcParamIds: []
}; }
if (this.selectedList.length === 0) { if (this.selectedList.length === 0) {
this.$modal.msgWarning('请选勾选数据'); this.$modal.msgWarning("请选勾选数据")
return false; return false
} else { } else {
this.selectedList.map((item) => { this.selectedList.map((item) => {
param.plcParamIds.push(item.id); param.plcParamIds.push(item.id)
}); })
} }
createEnergyStatisticsDet({ ...param }).then((res) => { createEnergyStatisticsDet({...param}).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.$modal.msgSuccess('操作成功'); this.$modal.msgSuccess("操作成功");
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1;
this.getList(); this.getList()
} }
}); })
}, },
closeA() { closeA() {
this.$emit('closeDet'); this.$emit('closeDet')
}, }
}, }
}; }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.box { .box {
padding: 0 32px; padding: 0 32px;
} }
</style> </style>

View File

@ -53,7 +53,6 @@ import { publicFormatter } from '@/utils/dict';
import { getEnergyTypeListAll } from '@/api/base/energyType'; import { getEnergyTypeListAll } from '@/api/base/energyType';
import EnergyStatisticsAdd from './components/energyStatisticsAdd'; import EnergyStatisticsAdd from './components/energyStatisticsAdd';
import EnergyStatisticsDet from './components/energyStatisticsDet'; import EnergyStatisticsDet from './components/energyStatisticsDet';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'name', prop: 'name',
@ -71,9 +70,9 @@ const tableProps = [
filter: publicFormatter('statistic_type'), filter: publicFormatter('statistic_type'),
}, },
{ {
prop: 'energyTypeLabel', prop: 'energyType',
label: '能源类型', label: '能源类型',
showOverflowtooltip: true, filter: publicFormatter('energy_type'),
}, },
{ {
prop: 'paramNum', prop: 'paramNum',
@ -87,7 +86,6 @@ const tableProps = [
export default { export default {
name: 'EnergyStatistics', name: 'EnergyStatistics',
components: { EnergyStatisticsAdd, EnergyStatisticsDet }, components: { EnergyStatisticsAdd, EnergyStatisticsDet },
mixins: [tableHeightMixin],
data() { data() {
return { return {
formConfig: [ formConfig: [
@ -141,6 +139,7 @@ export default {
} }
: undefined, : undefined,
].filter((v) => v), ].filter((v) => v),
tableH: this.tableHeight(260),
// //
total: 0, total: 0,
// //
@ -159,6 +158,9 @@ export default {
}; };
}, },
created() { created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260);
});
this.getList(); this.getList();
}, },
mounted() { mounted() {
@ -185,13 +187,6 @@ export default {
getList() { getList() {
getEnergyStatisticsPage(this.queryParams).then((response) => { getEnergyStatisticsPage(this.queryParams).then((response) => {
let arr = response.data.list || []; let arr = response.data.list || [];
arr.map((item) => {
this.getDictDatas('energy_type').map((subItem) => {
if (item.energyType === subItem.value) {
item.energyTypeLabel = subItem.label;
}
});
});
this.list = arr; this.list = arr;
this.total = response.data.total; this.total = response.data.total;
}); });

View File

@ -1,289 +1,271 @@
<template> <template>
<div class="orderEnergyContainer"> <div class="orderEnergyContainer">
<div class="box1"> <div class="box1">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar
:formConfigs="formConfig" :formConfigs="formConfig"
ref="searchBarForm" ref="searchBarForm"
@headBtnClick="buttonClick" /> @headBtnClick="buttonClick"
</div> />
<div class="box2"> </div>
<div class="boxTitle"> <div class="box2">
<span class="blueTitle"></span> <div class="boxTitle">
<span>工单信息</span> <span class="blueTitle"></span>
</div> <span>工单信息</span>
<el-row> </div>
<el-col :span="4"> <el-row>
<div class="blodTip">工单名称</div> <el-col :span='4'>
<div class="lightTip">{{ orderMsg.name }}</div> <div class="blodTip">工单名称</div>
</el-col> <div class="lightTip">{{ orderMsg.name }}</div>
<el-col :span="4"> </el-col>
<div class="blodTip">产品名称</div> <el-col :span='4'>
<div class="lightTip">{{ orderMsg.productName }}</div> <div class="blodTip">产品名称</div>
</el-col> <div class="lightTip">{{orderMsg.productName }}</div>
<el-col :span="4"> </el-col>
<div class="blodTip">计划完成数量</div> <el-col :span='4'>
<div class="lightTip">{{ orderMsg.planQuantity }}</div> <div class="blodTip">计划完成数量</div>
</el-col> <div class="lightTip">{{orderMsg.planQuantity }}</div>
<el-col :span="4"> </el-col>
<div class="blodTip">实际开始时间</div> <el-col :span='4'>
<div class="lightTip">{{ parseTime(orderMsg.startProduceTime) }}</div> <div class="blodTip">实际开始时间</div>
</el-col> <div class="lightTip">{{ parseTime(orderMsg.startProduceTime) }}</div>
<el-col :span="4"> </el-col>
<div class="blodTip">实际完成时间</div> <el-col :span='4'>
<div class="lightTip"> <div class="blodTip">实际完成时间</div>
{{ parseTime(orderMsg.finishProduceTime) }} <div class="lightTip">{{ parseTime(orderMsg.finishProduceTime) }}</div>
</div> </el-col>
</el-col> <el-col :span='4'>
<el-col :span="4"> <div class="blodTip">实际加工数量</div>
<div class="blodTip">实际加工数量</div> <div class="lightTip">{{orderMsg.actualQuantity }}</div>
<div class="lightTip">{{ orderMsg.actualQuantity }}</div> </el-col>
</el-col> </el-row>
</el-row> </div>
</div> <div class="box3">
<div class="box3"> <div class="boxTitle">
<div class="boxTitle"> <span class="blueTitle"></span>
<span class="blueTitle"></span> <span>能耗信息</span>
<span>能耗信息</span> </div>
</div> <div class="toggleTabBox">
<div class="toggleTabBox"> <div :class="{ active: activeModule === 'dataList' }" @click="toggleTab('dataList')">数据列表</div>
<div <div :class="{ active: activeModule === 'barChart' }" @click="toggleTab('barChart')">柱状图</div>
:class="{ active: activeModule === 'dataList' }" </div>
@click="toggleTab('dataList')"> <div>
数据列表 <div v-show="activeModule === 'dataList'">
</div> <!-- 表格 -->
<div <base-table
:class="{ active: activeModule === 'barChart' }" :page="queryParams.pageNo"
@click="toggleTab('barChart')"> :limit="queryParams.pageSize"
柱状图 :table-props="tableProps"
</div> :table-data="tableData"
</div> :max-height="tableH"
<div> />
<div v-show="activeModule === 'dataList'"> </div>
<!-- 表格 --> <!-- 图形 -->
<base-table <div v-show="activeModule === 'barChart'">
:page="queryParams.pageNo" <bar-chart ref="orderEnergyChart" :chartData="chartData"/>
:limit="queryParams.pageSize" </div>
:table-props="tableProps" </div>
:table-data="tableData" </div>
:max-height="tableH" /> </div>
</div>
<!-- 图形 -->
<div v-show="activeModule === 'barChart'">
<bar-chart
ref="orderEnergyChart"
:chartData="chartData" />
</div>
</div>
</div>
</div>
</template> </template>
<script> <script>
const tableProps = [ const tableProps = [
{ {
prop: 'objName', prop: 'objName',
label: '对象名称', label: '对象名称'
}, },
{ {
prop: 'objCode', prop: 'objCode',
label: '对象编码', label: '对象编码'
}, },
{ {
prop: 'energyType', prop: 'energyType',
label: '能源类型', label: '能源类型'
}, },
{ {
prop: 'startNum', prop: 'startNum',
label: '工单开始值', label: '工单开始值'
}, },
{ {
prop: 'endNum', prop: 'endNum',
label: '工单结束值/当前值', label: '工单结束值/当前值'
}, },
{ {
prop: 'useNum', prop: 'useNum',
label: '使用量', label: '使用量'
}, }
]; ]
import { getEnergyTypeListAll } from '@/api/base/energyType'; import { getEnergyTypeListAll } from '@/api/base/energyType'
import { workOrderList } from '@/api/base/orderManage'; import { workOrderList } from '@/api/base/orderManage'
import { import { getWorkOrderMsg, getOrderEnergyData } from '@/api/monitoring/orderEnergy'
getWorkOrderMsg, import BarChart from "./components/barChart"
getOrderEnergyData,
} from '@/api/monitoring/orderEnergy';
import BarChart from './components/barChart';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
export default { export default {
name: 'OrderEnergy', name: 'OrderEnergy',
mixins: [tableHeightMixin], data() {
data() { return {
return { formConfig: [
formConfig: [ {
{ type: 'select',
type: 'select', label: '工单',
label: '工单', selectOptions: [],
selectOptions: [], param: 'workOrderId',
param: 'workOrderId', clearable: false
clearable: false, },
}, {
{ type: 'select',
type: 'select', label: '能源类型',
label: '能源类型', selectOptions: [],
selectOptions: [], param: 'energyTypeId',
param: 'energyTypeId', filterable: true,
labelField: 'labelName', width: 120,
filterable: true, clearable: false
width: 120, },
clearable: false, {
}, type: 'select',
{ label: '对象维度',
type: 'select', selectOptions: this.getDictDatas(this.DICT_TYPE.OBJECT_TYPE),
label: '对象维度', labelField: 'label',
selectOptions: this.getDictDatas(this.DICT_TYPE.OBJECT_TYPE), valueField: 'value',
labelField: 'label', param: 'objType',
valueField: 'value', width: 100,
param: 'objType', clearable: false
width: 100, },
clearable: false, {
}, type: 'button',
{ btnName: '查询',
type: 'button', name: 'search',
btnName: '查询', color: 'primary'
name: 'search', }
color: 'primary', ],
}, tableProps,
], tableData: [],
tableProps, tableH: this.tableHeight(400),
tableData: [], //
heightNum: 400, queryParams: {
// workOrderId: '',
queryParams: { objType: '',
workOrderId: '', energyTypeId: ''
objType: '', },
energyTypeId: '', orderMsg: {},
}, chartData: [],
orderMsg: {}, activeModule: 'dataList'
chartData: [], }
activeModule: 'dataList', },
}; components: { BarChart },
}, mounted() {
components: { BarChart }, window.addEventListener('resize', () => {
mounted() { this.tableH = this.tableHeight(400)
this.getListArr(); })
}, this.getListArr()
methods: { },
getListArr() { methods: {
workOrderList().then((res) => { getListArr() {
this.formConfig[0].selectOptions = res.data || []; workOrderList().then(res => {
}); this.formConfig[0].selectOptions = res.data || []
getEnergyTypeListAll().then((res) => { })
this.formConfig[1].selectOptions = res.data || []; getEnergyTypeListAll().then(res => {
}); this.formConfig[1].selectOptions = res.data || []
}, })
buttonClick(val) { },
if (!val.workOrderId) { buttonClick(val) {
this.$modal.msgWarning('工单不能为空'); if (!val.workOrderId) {
return false; this.$modal.msgWarning('工单不能为空')
} return false
if (!val.energyTypeId) { }
this.$modal.msgWarning('能源类型不能为空'); if (!val.energyTypeId) {
return false; this.$modal.msgWarning('能源类型不能为空')
} return false
if (!val.objType) { }
this.$modal.msgWarning('对象维度不能为空'); if (!val.objType) {
return false; this.$modal.msgWarning('对象维度不能为空')
} return false
this.queryParams.workOrderId = val.workOrderId; }
this.queryParams.objType = val.objType; this.queryParams.workOrderId = val.workOrderId
this.queryParams.energyTypeId = val.energyTypeId; this.queryParams.objType = val.objType
getWorkOrderMsg({ ...this.queryParams }).then((res) => { this.queryParams.energyTypeId = val.energyTypeId
this.orderMsg = res.data || {}; getWorkOrderMsg({ ...this.queryParams }).then(res => {
getOrderEnergyData({ this.orderMsg = res.data || {}
...this.queryParams, getOrderEnergyData({
startProduceTime: res.data.startProduceTime || '', ...this.queryParams,
finishProduceTime: res.data.finishProduceTime || '', startProduceTime: res.data.startProduceTime || '',
}).then((result) => { finishProduceTime: res.data.finishProduceTime || ''
this.tableData = result.data || []; }).then(result => {
this.chartData = result.data || []; this.tableData = result.data || []
}); this.chartData = result.data || []
}); })
}, })
toggleTab(val) { },
this.activeModule = val; toggleTab(val) {
if (this.activeModule === 'barChart') { this.activeModule = val
this.$nextTick((res) => { if (this.activeModule === 'barChart') {
this.$refs.orderEnergyChart.getChart(); this.$nextTick((res) => {
}); this.$refs.orderEnergyChart.getChart()
} })
}, }
headBtnClick() {}, },
}, headBtnClick() {}
}; }
}
</script> </script>
<style lang='scss' scoped> <style lang='scss' scoped>
.orderEnergyContainer { .orderEnergyContainer {
background-color: rgb(242, 244, 249); background-color: rgb(242, 244, 249);
.box1, .box1, .box2, .box3 {
.box2, background-color: #fff;
.box3 { border-radius: 9px;
background-color: #fff; }
border-radius: 9px; .box1 {
} height: 64px;
.box1 { padding: 12px 16px 0;
height: 64px; }
padding: 12px 16px 0; .box2 {
} height: 122px;
.box2 { margin: 8px 0;
height: 122px; padding: 16px;
margin: 8px 0; .blodTip {
padding: 16px; font-weight: 600;
.blodTip { color: rgba(0,0,0,0.85);
font-weight: 600; margin-bottom: 8px;
color: rgba(0, 0, 0, 0.85); }
margin-bottom: 8px; .lightTip {
} font-weight: 400;
.lightTip { color: rgba(102,102,102,0.75);
font-weight: 400; }
color: rgba(102, 102, 102, 0.75); }
overflow: hidden; .box3 {
white-space: nowrap; padding: 16px;
text-overflow: ellipsis; height: calc(100vh - 330px);
} .toggleTabBox {
} display: inline-block;
.box3 { div {
padding: 16px; display: inline-block;
height: calc(100vh - 330px); padding:0 8px 4px;
.toggleTabBox { color: rgba(102, 102, 102, 0.5);
display: inline-block; border-bottom: 2px solid rgba(242, 244, 249, 1);
div { cursor: pointer;
display: inline-block; }
padding: 0 8px 4px; .active {
color: rgba(102, 102, 102, 0.5); color: rgba(0,0,0,0.85);
border-bottom: 2px solid rgba(242, 244, 249, 1); border-bottom-color: #0B58FF;
cursor: pointer; }
} }
.active { }
color: rgba(0, 0, 0, 0.85); .boxTitle {
border-bottom-color: #0b58ff; display: inline-block;
} font-size: 16px;
} font-weight: 400;
} color: #000000;
.boxTitle { margin:0 10px 20px 0;
display: inline-block; }
font-size: 16px; .blueTitle {
font-weight: 400; content: '';
color: #000000; display: inline-block;
margin: 0 10px 20px 0; width: 4px;
} height: 18px;
.blueTitle { background-color: #0B58FF;
content: ''; border-radius: 1px;
display: inline-block; margin-right: 8px;
width: 4px; vertical-align: bottom;
height: 18px; }
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
vertical-align: bottom;
}
} }
</style> </style>

View File

@ -1,429 +1,390 @@
<template> <template>
<div class="app-container orderMonitoring"> <div class="app-container orderMonitoring">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
:formConfigs="formConfig" <el-tabs v-model="activeName" @tab-click="toggleTab">
ref="searchBarForm" <el-tab-pane label="数据列表" name="dataList"></el-tab-pane>
@headBtnClick="buttonClick" /> <el-tab-pane label="环形图" name="barChart"></el-tab-pane>
<el-tabs </el-tabs>
v-model="activeName" <!-- -->
@tab-click="toggleTab"> <div v-if="activeName === 'dataList'">
<el-tab-pane <base-table :page="1" :limit="1000000000000" :table-props="tableProps" :table-data="list" :max-height="tableH"
label="数据列表" row-key="id" :tree-props="{ children: 'orderMonitorVOS', hasChildren: 'hasChildren' }">
name="dataList"></el-tab-pane> <method-btn v-if="tableBtn.length" slot="handleBtn" :width="100" label="操作" :method-list="tableBtn"
<el-tab-pane @clickBtn="handleClick" />
label="环形图" </base-table>
name="barChart"></el-tab-pane> </div>
</el-tabs> <!-- -->
<!-- --> <monitoring-ring-charts ref='monitoringRingCharts' v-else :chart-list='chartList' />
<div v-if="activeName === 'dataList'"> <!-- <pagination
<base-table
:page="1"
:limit="1000000000000"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
row-key="id"
:tree-props="{
children: 'orderMonitorVOS',
hasChildren: 'hasChildren',
}">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
</div>
<!-- -->
<monitoring-ring-charts
ref="monitoringRingCharts"
v-else
:chart-list="chartList" />
<!-- <pagination
:page.sync="queryParams.pageNo" :page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
:total="total" :total="total"
@pagination="getPage" @pagination="getPage"
/> --> /> -->
</div> </div>
</template> </template>
<script> <script>
import { parseTime } from '@/utils/ruoyi'; import { parseTime } from '@/utils/ruoyi'
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict'
import { orderGroupMonitor } from '@/api/base/orderGroup'; import { orderGroupMonitor } from '@/api/base/orderGroup'
import MonitoringRingCharts from './../components/monitoringRingCharts'; import MonitoringRingCharts from './../components/monitoringRingCharts'
import moment from 'moment'; import moment from "moment"
const tableProps = [ const tableProps = [
{ {
prop: 'name', prop: 'name',
label: '订单名称', label: '订单名称',
minWidth: 140, minWidth: 140,
showOverflowtooltip: true, showOverflowtooltip: true
}, },
{ {
prop: 'orderType', prop: 'orderType',
label: '订单类型', label: '订单类型'
}, },
{ {
prop: 'customerName', prop: 'customerName',
label: '客户', label: '客户'
}, },
{ {
prop: 'productname', prop: 'productname',
label: '产品', label: '产品',
minWidth: 200, minWidth: 200,
showOverflowtooltip: true, showOverflowtooltip: true
}, },
{ {
prop: 'planStartTime', prop: 'planStartTime',
label: '计划开始时间', label: '计划开始时间',
filter: parseTime, filter: parseTime,
minWidth: 160, minWidth: 160
}, },
{ {
prop: 'planFinishTime', prop: 'planFinishTime',
label: '计划完成时间', label: '计划完成时间',
filter: parseTime, filter: parseTime,
minWidth: 160, minWidth: 160
}, },
{ {
prop: 'status', prop: 'status',
label: '订单状态', label: '订单状态',
filter: publicFormatter('order_status'), filter: publicFormatter('order_status')
}, },
{ {
prop: 'startProduceTime', prop: 'startProduceTime',
label: '实际开始时间', label: '实际开始时间',
filter: parseTime, filter: parseTime,
minWidth: 160, minWidth: 160
}, },
{ {
prop: 'finishProduceTime', prop: 'finishProduceTime',
label: '实际完成时间', label: '实际完成时间',
filter: parseTime, filter: parseTime,
minWidth: 160, minWidth: 160
}, },
{ {
prop: 'deliveTime', prop: 'deliveTime',
label: '交货时间', label: '交货时间',
filter: parseTime, filter: parseTime,
minWidth: 160, minWidth: 160
}, },
{ {
prop: 'lineNames', prop: 'lineNames',
label: '加工线', label: '加工线',
filter: (val) => (val ? val.join(',') : ''), filter: (val) => val ? val.join(',') : '',
minWidth: 180, minWidth: 180
}, },
{ {
prop: 'planQuantity', prop: 'planQuantity',
label: '计划生产量', label: '计划生产量',
width: 100, width: 100
}, },
{ {
prop: 'actualquantity', prop: 'actualquantity',
label: '实际产出量', label: '实际产出量',
width: 100, width: 100
}, },
{ {
prop: 'completeRate', prop: 'completeRate',
label: '订单完成率', label: '订单完成率',
width: 100, width: 100
}, },
{ {
prop: 'orderNum', prop: 'orderNum',
label: '关联订单/工单数量', label: '关联订单/工单数量',
width: 110, width: 110
}, }
]; ]
export default { export default {
name: 'OrderCompletionMonitoring', name: 'OrderCompletionMonitoring',
data() { data() {
return { return {
formConfig: [ formConfig: [
{ {
type: 'input', type: 'input',
label: '集团订单名称', label: '集团订单名称',
param: 'name', param: 'name'
}, },
{ {
type: 'datePicker', type: 'datePicker',
label: '时间段', label: '时间段',
dateType: 'daterange', dateType: 'daterange',
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd', valueFormat: "yyyy-MM-dd",
rangeSeparator: '-', rangeSeparator: '-',
startPlaceholder: '开始时间', startPlaceholder: '开始时间',
endPlaceholder: '结束时间', endPlaceholder: '结束时间',
param: 'timeVal', param: 'timeVal',
defaultSelect: [], defaultSelect: [],
width: 250, width: 250
}, },
{ {
type: 'button', type: 'button',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary'
}, }
], ],
activeName: 'dataList', activeName: 'dataList',
// //
queryParams: { queryParams: {
name: null, name: null,
deliveTime: [], deliveTime: []
}, },
tableProps, tableProps,
list: [], list: [],
tableH: this.tableHeight(260), tableH: this.tableHeight(260),
total: 0, total: 0,
tableBtn: [ tableBtn: [
this.$auth.hasPermi('base:order-completion-monitoring:orderDet') this.$auth.hasPermi('base:order-completion-monitoring:orderDet')
? { ? {
type: 'orderDetail', type: 'orderDetail',
btnName: '详情', btnName: '详情',
showTip: '订单/工单详情', showTip: '订单/工单详情',
showParam: { showParam: {
type: '&', type: '&',
data: [ data: [
{ {
type: 'more', type: 'more',
name: 'orderNum', name: 'orderNum',
value: 1, value: 1
}, }
], ]
}, }
} }
: undefined, : undefined,
this.$auth.hasPermi('base:order-completion-monitoring:qualityDet') this.$auth.hasPermi('base:order-completion-monitoring:qualityDet')
? { ? {
type: 'qualityDetail', type: 'qualityDetail',
btnName: '质量', btnName: '质量',
showTip: '质量详情', showTip: '质量详情',
showParam: { showParam: {
type: '&', type: '&',
data: [ data: [
{ {
type: 'more', type: 'more',
name: 'orderNum', name: 'orderNum',
value: 1, value: 1
}, },
{ {
type: 'unequal', type: 'unequal',
name: 'woIdString', name: 'woIdString',
value: '', value: ''
}, }
], ]
}, }
} }
: undefined, : undefined
// this.$auth.hasPermi('base:order-completion-monitoring:sendOut') // this.$auth.hasPermi('base:order-completion-monitoring:sendOut')
// ? { // ? {
// type: 'sendOutDetail', // type: 'sendOutDetail',
// btnName: '', // btnName: '',
// showTip: '', // showTip: '',
// showParam: { // showParam: {
// type: '&', // type: '&',
// data: [ // data: [
// { // {
// type: 'more', // type: 'more',
// name: 'workOrderNum', // name: 'workOrderNum',
// value: 1 // value: 1
// } // }
// ] // ]
// } // }
// } // }
// : undefined // : undefined
].filter((v) => v), ].filter((v) => v),
chartList: [], chartList: []
}; }
}, },
components: { MonitoringRingCharts }, components: { MonitoringRingCharts },
mounted() { mounted() {
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260); this.tableH = this.tableHeight(260)
}); })
let start = moment().subtract(30, 'days').format('yyyy-MM-DD'); let start = moment().subtract(30, 'days').format('yyyy-MM-DD')
let end = moment().format('yyyy-MM-DD'); let end = moment().format('yyyy-MM-DD')
this.formConfig[1].defaultSelect = [start, end]; this.formConfig[1].defaultSelect = [start, end]
this.queryParams.deliveTime[0] = start + ' 00:00:00'; this.queryParams.deliveTime[0] = start + ' 00:00:00'
this.queryParams.deliveTime[1] = end + ' 23:59:59'; this.queryParams.deliveTime[1] = end + ' 23:59:59'
this.getPage(); this.getPage()
}, },
methods: { methods: {
getPage() { getPage() {
orderGroupMonitor({ ...this.queryParams }).then((res) => { orderGroupMonitor({ ...this.queryParams }).then(res => {
let arr = res.data || []; let arr = res.data || []
if (arr.length > 0) { if (arr.length > 0) {
let color = ['#7164FF', '#288AFF', '#63BDFF', '#8EF0AB', '#FFCE6A']; let color = ['#7164FF', '#288AFF', '#63BDFF', '#8EF0AB', '#FFCE6A']
let arr2 = []; let arr2 = []
arr.map((item) => { arr.map(item => {
item.orderType = '集团订单'; // item.orderType = '集团订单'//
let woIdString = ''; //str let woIdString = ''//str
//========= //=========
let arr3 = []; let arr3 = []
let obj = {}; let obj = {}
obj.orderGroupName = item.name; obj.orderGroupName = item.name
obj.id = item.id; obj.id = item.id
obj.num = item.planQuantity || 0; obj.num = item.planQuantity || 0
let sunNum = 0; let sunNum = 0
if (item.orderMonitorVOS && item.orderMonitorVOS.length > 0) { if (item.orderMonitorVOS && item.orderMonitorVOS.length > 0) {
for (let i = 0; i < item.orderMonitorVOS.length; i++) { for (let i = 0; i < item.orderMonitorVOS.length; i++) {
item.orderMonitorVOS[i].orderType = '厂务订单'; // item.orderMonitorVOS[i].orderType = '厂务订单'//
item.orderMonitorVOS[i].id = item.orderMonitorVOS[i].orderid; item.orderMonitorVOS[i].id = item.orderMonitorVOS[i].orderid
item.orderMonitorVOS[i].orderNum = item.orderMonitorVOS[i].orderNum = item.orderMonitorVOS[i].workOrderNum
item.orderMonitorVOS[i].workOrderNum; woIdString += item.orderMonitorVOS[i].woIdString ? item.orderMonitorVOS[i].woIdString : ''
woIdString += item.orderMonitorVOS[i].woIdString //==============
? item.orderMonitorVOS[i].woIdString + ',' let subObj = {}
: ''; subObj.value = item.orderMonitorVOS[i].actualquantity
//============== subObj.name = item.orderMonitorVOS[i].name
let subObj = {}; if (i < 5) {
subObj.value = item.orderMonitorVOS[i].actualquantity; subObj.color = color[i]
subObj.name = item.orderMonitorVOS[i].name; } else {
if (i < 5) { subObj.color = color[i % 5]
subObj.color = color[i]; }
} else { sunNum += (item.orderMonitorVOS[i].actualquantity || 0)
subObj.color = color[i % 5]; arr3.push(subObj)
} }
sunNum += item.orderMonitorVOS[i].actualquantity || 0; }
arr3.push(subObj); item.woIdString = woIdString
} arr3.push({
woIdString = woIdString.slice(0, -1); value: item.planQuantity - sunNum > 0 ? item.planQuantity - sunNum : 0,
} name: '未生产',
item.woIdString = woIdString; color: '#F5F5F5'
arr3.push({ })
value: obj.sunNum = sunNum
item.planQuantity - sunNum > 0 ? item.planQuantity - sunNum : 0, obj.order = arr3
name: '未生产', arr2.push(obj)
color: '#F5F5F5', })
}); this.chartList = arr2
obj.sunNum = sunNum; if (this.activeName === 'barChart' && this.chartList.length > 0) {
obj.order = arr3; this.$nextTick(() => {
arr2.push(obj); this.$refs.monitoringRingCharts.initChart()
}); })
this.chartList = arr2; }
if (this.activeName === 'barChart' && this.chartList.length > 0) { } else {
this.$nextTick(() => { //
this.$refs.monitoringRingCharts.initChart(); this.chartList = []
}); }
} console.log(arr)
} else { this.list = arr
// })
this.chartList = []; },
} //
console.log(arr); buttonClick(val) {
this.list = arr; this.queryParams.name = val.name
}); if (val.timeVal && val.timeVal.length > 0) {
}, this.queryParams.deliveTime[0] = val.timeVal[0] + ' 00:00:00'
// this.queryParams.deliveTime[1] = val.timeVal[1] + ' 23:59:59'
buttonClick(val) { } else {
this.queryParams.name = val.name; this.queryParams.deliveTime = []
if (val.timeVal && val.timeVal.length > 0) { }
this.queryParams.deliveTime[0] = val.timeVal[0] + ' 00:00:00'; this.getPage()
this.queryParams.deliveTime[1] = val.timeVal[1] + ' 23:59:59'; },
} else { handleClick(val) {
this.queryParams.deliveTime = []; console.log(val)
} switch (val.type) {
this.getPage(); case 'orderDetail':
}, if (val.data.orderType === '集团订单') {
handleClick(val) { this.$router.push({//
console.log(val); path: '/order/base/order-manage/order-detail-data?orderIdString=' + val.data.orderIds.join(',')
switch (val.type) { })
case 'orderDetail': } else {
if (val.data.orderType === '集团订单') { this.$router.push({//
this.$router.push({ path: '/core/core-work-order-detail?woIdString=' + val.data.woIdString
// })
path: }
'/order/base/order-manage/order-detail-data?orderIdString=' + break
val.data.orderIds.join(','), case 'qualityDetail':
}); this.$router.push({
} else { path: '/quality/base/quality-inspection-data/detection-information/statistical-data?woIdString=' + val.data.woIdString
this.$router.push({ })
// break
path: default:
'/core/core-work-order-detail?woIdString=' + // this.$router.push({
val.data.woIdString, // path: '/delivery/delivery-log?orderId='+encodeURI(val.data.name)
}); // })
} }
break; },
case 'qualityDetail': toggleTab() {
this.$router.push({ if (this.activeName === 'barChart' && this.chartList.length > 0) {
path: this.$nextTick(() => {
'/quality/base/quality-inspection-data/detection-information/statistical-data?woIdString=' + this.$refs.monitoringRingCharts.initChart()
val.data.woIdString, })
}); }
break; }
default: }
// this.$router.push({ }
// path: '/delivery/delivery-log?orderId='+encodeURI(val.data.name)
// })
}
},
toggleTab() {
if (this.activeName === 'barChart' && this.chartList.length > 0) {
this.$nextTick(() => {
this.$refs.monitoringRingCharts.initChart();
});
}
},
},
};
</script> </script>
<style lang='scss'> <style lang='scss'>
.orderMonitoring { .orderMonitoring {
.el-tabs__nav::after { .el-tabs__nav::after {
content: ''; content: "";
position: absolute; position: absolute;
left: 0; left: 0;
bottom: 0; bottom: 0;
width: 100%; width: 100%;
height: 2px; height: 2px;
background-color: #e4e7ed; background-color: #e4e7ed;
} }
.el-tabs__nav-wrap::after { .el-tabs__nav-wrap::after {
width: 0; width: 0;
} }
.el-tabs__item { .el-tabs__item {
padding: 0 10px; padding: 0 10px;
} }
.el-tabs__item:hover { .el-tabs__item:hover {
color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85);
} }
.el-tabs__item.is-active { .el-tabs__item.is-active {
color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85);
} }
.el-tabs__item { .el-tabs__item {
color: rgba(0, 0, 0, 0.45); color: rgba(0, 0, 0, 0.45);
} }
.searchBarBox { .searchBarBox {
margin-bottom: 0; margin-bottom: 0;
} }
.boxTitle { .boxTitle {
display: inline-block; display: inline-block;
font-size: 16px; font-size: 16px;
font-weight: 400; font-weight: 400;
color: #000000; color: #000000;
margin: 0 10px 16px 0; margin: 0 10px 16px 0;
} }
.blueTitle { .blueTitle {
content: ''; content: '';
display: inline-block; display: inline-block;
width: 4px; width: 4px;
height: 18px; height: 18px;
background-color: #0b58ff; background-color: #0B58FF;
border-radius: 1px; border-radius: 1px;
margin-right: 8px; margin-right: 8px;
vertical-align: bottom; vertical-align: bottom;
} }
} }
</style> </style>