Merge branch 'projects/mesxc-test' into projects/mesxc-zhp

This commit is contained in:
‘937886381’ 2024-03-21 16:35:02 +08:00
commit 96de42dc6a
16 changed files with 138 additions and 54 deletions

View File

@ -111,6 +111,7 @@ export default {
startPlaceholder: '开始时间', startPlaceholder: '开始时间',
endPlaceholder: '结束时间', endPlaceholder: '结束时间',
param: 'searchTime', param: 'searchTime',
defaultSelect: [],
}, },
{ {
type: 'button', type: 'button',
@ -132,6 +133,14 @@ export default {
}, },
components: {}, components: {},
created() { created() {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
this.formConfig[2].defaultSelect = [start, end];
this.listQuery.reportTime = [
moment(start).startOf('day').format('x'),
moment(end).endOf('day').format('x'),
];
getEnergyTypeListAll().then((response) => { getEnergyTypeListAll().then((response) => {
this.formConfig[1].selectOptions = response.data; this.formConfig[1].selectOptions = response.data;
}); });

View File

@ -110,6 +110,7 @@ export default {
startPlaceholder: '开始时间', startPlaceholder: '开始时间',
endPlaceholder: '结束时间', endPlaceholder: '结束时间',
param: 'searchTime', param: 'searchTime',
defaultSelect: [],
}, },
{ {
type: 'button', type: 'button',
@ -131,6 +132,14 @@ export default {
}, },
components: {}, components: {},
created() { created() {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
this.formConfig[2].defaultSelect = [start, end];
this.listQuery.times = [
moment(start).startOf('day').format('x'),
moment(end).endOf('day').format('x'),
];
getHotMaterialList().then((response) => { getHotMaterialList().then((response) => {
this.formConfig[1].selectOptions = response.data; this.formConfig[1].selectOptions = response.data;
}); });

View File

@ -1,8 +1,5 @@
<template> <template>
<div <div id="analysischartLine" style="width: 100%;height: 100%;"></div>
id="analysischartLine"
style="width: 100%;height: 100%;"
></div>
</template> </template>
<script> <script>
import * as echarts from 'echarts' import * as echarts from 'echarts'
@ -56,11 +53,10 @@ export default {
let yData = [] let yData = []
for (let j = 0; j < arr.length; j++) { for (let j = 0; j < arr.length; j++) {
for (let k = 0; k < keys.length; k++) { for (let k = 0; k < keys.length; k++) {
if (keys[k].indexOf(arr[j]+'_上年同期') > -1 || keys[k].indexOf(arr[j]+'_能源消耗') > -1) { if (keys[k].indexOf(arr[j] + '_上年同期') > -1 || keys[k].indexOf(arr[j] + '_能源消耗') > -1) {
let obj = { let obj = {
name: '', name: '',
type: 'line', type: 'line',
stack: 'Total',
data: [] data: []
} }
obj.name = keys[k] obj.name = keys[k]
@ -71,14 +67,14 @@ export default {
for (let i = 0; i < this.chartData.length; i++) { for (let i = 0; i < this.chartData.length; i++) {
xData.push(this.chartData[i].time) xData.push(this.chartData[i].time)
for (let p = 0; p < yData.length; p++) { for (let p = 0; p < yData.length; p++) {
yData[p].data.push(this.chartData[i][ yData[p].name]) yData[p].data.push(this.chartData[i][yData[p].name])
} }
} }
var option = { var option = {
color:['#FFDC94','#8EF0AB','#63BDFF','#288AFF','#7164FF','#FF6860','#FF9747','#B0EB42','#D680FF','#0043D2'], color: ['#FFDC94', '#8EF0AB', '#63BDFF', '#288AFF', '#7164FF', '#FF6860', '#FF9747', '#B0EB42', '#D680FF', '#0043D2'],
legend: { legend: {
data: keys, data: keys,
right:'1%' right: '1%'
}, },
tooltip: { tooltip: {
trigger: 'axis' trigger: 'axis'

View File

@ -2,40 +2,22 @@
<div class="app-container energyOverlimitLog"> <div class="app-container energyOverlimitLog">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<el-tabs v-model="activeName" @tab-click="toggleTab"> <el-tabs v-model="activeName" @tab-click="toggleTab">
<el-tab-pane label="自动抄表" name="auto"></el-tab-pane> <el-tab-pane label="自动抄表" name="auto"></el-tab-pane>
<el-tab-pane label="手动抄表" name="manual"></el-tab-pane> <el-tab-pane label="手动抄表" name="manual"></el-tab-pane>
</el-tabs> </el-tabs>
<!-- 列表 --> <!-- 列表 -->
<div v-if="activeName === 'auto'"> <div v-if="activeName === 'auto'">
<base-table <base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
:page="queryParams.pageNo" :max-height="tableH" />
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
/>
</div> </div>
<div v-if="activeName === 'manual'"> <div v-if="activeName === 'manual'">
<base-table <base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps2"
:page="queryParams.pageNo" :table-data="list2" :max-height="tableH" />
:limit="queryParams.pageSize"
:table-props="tableProps2"
:table-data="list2"
:max-height="tableH"
/>
</div> </div>
<pagination <pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
:page.sync="queryParams.pageNo" @pagination="getList" />
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
</div> </div>
</template> </template>
@ -160,8 +142,8 @@ export default {
method: '1' method: '1'
}, },
typeList: [ typeList: [
{id: 1, name: '合并'}, { id: 1, name: '合并' },
{id: 2, name: '详细'} { id: 2, name: '详细' }
] ]
}; };
}, },
@ -183,7 +165,7 @@ export default {
getList() { getList() {
getEnergyOverlimitLogPage(this.queryParams).then(response => { getEnergyOverlimitLogPage(this.queryParams).then(response => {
let arr = response.data.list || []; let arr = response.data.list || [];
arr&&arr.map((item) => { arr && arr.map((item) => {
this.typeList.map((i) => { this.typeList.map((i) => {
if (item.type === i.id) { if (item.type === i.id) {
item.type = i.name item.type = i.name
@ -191,15 +173,21 @@ export default {
}) })
if (item.minValue && item.maxValue) { if (item.minValue && item.maxValue) {
item.limitValue = item.minValue + '-' + item.maxValue item.limitValue = item.minValue + '-' + item.maxValue
} else if(item.minValue){ } else if (item.minValue) {
item.limitValue = '最小值' + item.minValue item.limitValue = '最小值' + item.minValue
}else if(item.maxValue){ } else if (item.maxValue) {
item.limitValue = '最大值' + item.maxValue item.limitValue = '最大值' + item.maxValue
} else { } else {
item.limitValue = '' item.limitValue = ''
} }
}) })
this.list = arr if (this.queryParams.method === '1') {
this.list = arr
this.list2 = []
} else {
this.list2 = arr
this.list1 = []
}
this.total = response.data.total; this.total = response.data.total;
}); });
}, },
@ -212,7 +200,7 @@ export default {
toggleTab() { toggleTab() {
if (this.activeName === 'auto') { if (this.activeName === 'auto') {
this.queryParams.method = '1' this.queryParams.method = '1'
}else{ } else {
this.queryParams.method = '2' this.queryParams.method = '2'
} }
this.queryParams.pageNo = 1 this.queryParams.pageNo = 1
@ -232,21 +220,27 @@ export default {
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;
} }

View File

@ -24,6 +24,8 @@
<el-form-item label="部门" prop="departmentId"> <el-form-item label="部门" prop="departmentId">
<el-select <el-select
v-model="dataForm.departmentId" v-model="dataForm.departmentId"
filterable
clearable
:placeholder="`请选择部门`"> :placeholder="`请选择部门`">
<el-option <el-option
v-for="opt in departmentOptions" v-for="opt in departmentOptions"
@ -167,7 +169,7 @@ export default {
const workerlist = await this.$axios( const workerlist = await this.$axios(
// '/base/core-worker/listAll' // '/base/core-worker/listAll'
'/base/core-worker/workerList' '/base/core-worker/workerList'
); );
if (workerlist.code == 0) { if (workerlist.code == 0) {
inspectorList = inspectorList.concat( inspectorList = inspectorList.concat(
workerlist.data.map((item) => ({ workerlist.data.map((item) => ({

View File

@ -155,6 +155,18 @@ export default {
rules: [ rules: [
{ required: true, message: '设备不能为空', trigger: 'blur' }, { required: true, message: '设备不能为空', trigger: 'blur' },
], ],
bind: {
clearable: true,
filterable: true
}
},
{
input: true,
label: '巡检项目',
prop: 'program',
rules: [
{ required: true, message: '巡检项目不能为空', trigger: 'blur' },
],
}, },
], ],
[ [

View File

@ -251,6 +251,10 @@ export default {
rules: [ rules: [
{ required: true, message: '设备不能为空', trigger: 'blur' }, { required: true, message: '设备不能为空', trigger: 'blur' },
], ],
bind: {
filterable: true,
clearable: true,
}
}, },
], ],
[ [

View File

@ -91,7 +91,7 @@ export default {
tableProps: [ tableProps: [
{ prop: 'name', label: '巡检单名称' }, { prop: 'name', label: '巡检单名称' },
{ prop: 'department', label: '部门' }, { prop: 'department', label: '部门' },
{ prop: 'actualCheckTime', label: '巡检时间', filter: parseTime }, { prop: 'planCheckTime', label: '巡检时间', filter: parseTime },
{ prop: 'groupClass', label: '班次' }, { prop: 'groupClass', label: '班次' },
// { // {
// prop: '_detail', // prop: '_detail',

View File

@ -109,6 +109,7 @@ export default {
departmentId: null, departmentId: null,
planCheckTime: null, planCheckTime: null,
confirmTimeLimit: null, confirmTimeLimit: null,
checkPeriod: null,
groupClass: null, groupClass: null,
remark: null, remark: null,
// special: true, // special: true,

View File

@ -40,37 +40,37 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="保养计划名称" prop="name"> <el-form-item label="保养计划名称" prop="name">
<span>{{ form.name }}</span> <span>{{ form.name || '---' }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="部门" prop="departmentName"> <el-form-item label="部门" prop="departmentName">
<span>{{ form.departmentName }}</span> <span>{{ form.departmentName || '---' }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="产线名" prop="lineName"> <el-form-item label="产线名" prop="lineName">
<span>{{ form.lineName }}</span> <span>{{ form.lineName || '---' }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="保养频率" prop="maintenancePeriod"> <el-form-item label="保养频率" prop="maintenancePeriod">
<span>{{ form.maintenancePeriod }}</span> <span>{{ form.maintenancePeriod || '---' }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="保养时长" prop="maintainDuration"> <el-form-item label="保养时长" prop="maintainDuration">
<span>{{ form.maintainDuration }}</span> <span>{{ form.maintainDuration || '---' }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="计划保养人员" prop="maintainer"> <el-form-item label="计划保养人员" prop="maintainer">
<span>{{ form.maintainer }}</span> <span>{{ form.maintainer || '---' }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>

View File

@ -119,7 +119,7 @@ const btn = {
render: function (h) { render: function (h) {
return ( return (
<el-button type="text" onClick={this.handleClick}> <el-button type="text" onClick={this.handleClick}>
{this.injectData.name} {this.injectData.entryText}
</el-button> </el-button>
); );
}, },
@ -188,7 +188,7 @@ export default {
{ {
prop: 'opt2', prop: 'opt2',
label: '保养内容', label: '保养内容',
name: '详情', entryText: '详情',
subcomponent: btn, subcomponent: btn,
width: 100, width: 100,
}, },
@ -386,6 +386,7 @@ export default {
case '保养内容': case '保养内容':
this.monitorDetailVisible = true; this.monitorDetailVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
console.log('value', value);
this.$refs.monitorDetailDrawer.show(value); this.$refs.monitorDetailDrawer.show(value);
}); });
break; break;

View File

@ -188,6 +188,10 @@ export default {
rules: [ rules: [
{ required: true, message: '设备不能为空', trigger: 'blur' }, { required: true, message: '设备不能为空', trigger: 'blur' },
], ],
bind: {
filterable: true,
clearable: true,
}
}, },
], ],
[ [

View File

@ -296,6 +296,8 @@ export default {
placeholder: '请选择保养计划名称', placeholder: '请选择保养计划名称',
param: 'maintainPlanId', param: 'maintainPlanId',
defaultSelect: null, defaultSelect: null,
filterable: true,
clearable: true
}, },
// //
{ {

View File

@ -269,6 +269,7 @@ export default {
}, },
mounted() { mounted() {
// !this.edit && this.getCode('/base/equipment-maintain-plan/getCode'); // !this.edit && this.getCode('/base/equipment-maintain-plan/getCode');
// this.getList('code');
this.getList('maintainer'); this.getList('maintainer');
this.getList('department'); this.getList('department');
this.getList('line'); this.getList('line');
@ -328,6 +329,7 @@ export default {
'/base/core-department/listAll', '/base/core-department/listAll',
'/base/core-worker/workerList', '/base/core-worker/workerList',
// '/base/core-worker/listAll', // '/base/core-worker/listAll',
'/base/equipment-maintain-log/getCode',
]; ];
let res; let res;
switch (source) { switch (source) {

View File

@ -381,6 +381,8 @@ export default {
placeholder: '请选择保养计划名称', placeholder: '请选择保养计划名称',
param: 'maintainPlanId', param: 'maintainPlanId',
defaultSelect: null, defaultSelect: null,
clearable: true,
filterable: true,
}, },
// //
{ {
@ -669,8 +671,21 @@ export default {
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.open = true; this.$axios({
this.title = '添加待确认保养记录'; url: '/base/equipment-maintain-log/getCode',
})
.then((res) => {
if (res.code == 0) {
this.form.maintainOrderNumber = res.data;
this.open = true;
this.title = '添加待确认保养记录';
}
})
.catch((err) => {
this.$message.error('获取保养单号出错');
this.open = true;
this.title = '添加待确认保养记录';
});
}, },
getConfirmed() { getConfirmed() {

View File

@ -9,7 +9,9 @@
<el-drawer <el-drawer
:visible="visible" :visible="visible"
:show-close="false" :show-close="false"
:wrapper-closable="false" :wrapperClosable="true"
:close-on-click-modal="true"
:before-close="handleConfirmClose"
class="drawer" class="drawer"
custom-class="mes-drawer" custom-class="mes-drawer"
size="60%" size="60%"
@ -172,6 +174,10 @@ export default {
rules: [ rules: [
{ required: true, message: '设备不能为空', trigger: 'blur' }, { required: true, message: '设备不能为空', trigger: 'blur' },
], ],
bind: {
filterable: true,
clearable: true,
},
}, },
], ],
[ [
@ -253,6 +259,33 @@ export default {
// this.getList('line'); // this.getList('line');
}, },
methods: { methods: {
/** 确认是否关闭 */
async handleConfirmClose() {
try {
if (
await this.$confirm(
<div style="position: relative; margin-bottom: 26px; overflow: visible;">
<h1 style="font-size: 16px; font-weight: bold; color: #000c;">
确认要关闭页面吗?
</h1>
</div>,
// <p style="font-size: 14px; color: #0008; position: absolute; top: 24px;">
//
// </p>
{
confirmButtonText: '确 定',
cancelButtonText: '取 消',
type: 'warning',
}
)
) {
this.handleConfirm();
}
} catch (err) {
return false;
}
},
handleSearchBarBtnClick(btn) { handleSearchBarBtnClick(btn) {
switch (btn.btnName) { switch (btn.btnName) {
case 'search': case 'search':