projects/mesxc-zjl #312

Merged
juzi merged 6 commits from projects/mesxc-zjl into projects/mesxc-test 2024-04-08 10:44:10 +08:00
25 changed files with 2059 additions and 1934 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,38 +0,0 @@
<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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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