projects/mesxc-zjl #138

Merged
juzi merged 3 commits from projects/mesxc-zjl into projects/mesxc-test 2023-12-06 10:09:07 +08:00
21 changed files with 1159 additions and 44 deletions
Showing only changes of commit 1ce61f13b7 - Show all commits

View File

@ -13,8 +13,8 @@ VUE_APP_TITLE = MES系统
# 芋道管理系统/开发环境
# VUE_APP_BASE_API = 'http://100.64.0.26:48082'
VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.4.173:48080'
# VUE_APP_BASE_API = 'http://192.168.0.33:48082'
VUE_APP_BASE_API = 'http://192.168.4.173:48080'
# VUE_APP_BASE_API = 'http://192.168.2.173:48080'
# VUE_APP_BASE_API = 'http://192.168.1.49:48082'
# VUE_APP_BASE_API = 'http://192.168.1.8:48082'

View File

@ -0,0 +1,56 @@
import request from '@/utils/request'
// 获得分页数据
export function energyQuantityManualPage(data) {
return request({
url: '/base/energy-quantity-manual/page',
method: 'post',
data: data
})
}
// 创建
export function energyQuantityManualCreate(data) {
return request({
url: '/base/energy-quantity-manual/create',
method: 'post',
data: data
})
}
// 更新
export function energyQuantityManualUpdate(data) {
return request({
url: '/base/energy-quantity-manual/update',
method: 'put',
data: data
})
}
//获得能源抄表(手动)
export function energyQuantityManualGet(query) {
return request({
url: '/base/energy-quantity-manual/get',
method: 'get',
params: query
})
}
//删除
export function energyQuantityManualDelete(query) {
return request({
url: '/base/energy-quantity-manual/delete',
method: 'delete',
params: query
})
}
//导出
export function energyQuantityManualExport(data) {
return request({
url: '/base/energy-quantity-manual/export-excel',
method: 'post',
data: data,
responseType: 'blob'
})
}

View File

@ -94,6 +94,8 @@ export const DICT_TYPE = {
OBJECT_TYPE: 'object_type',
STATISTIC_TYPE: 'statistic_type',
TIME_DIM: 'time_dim',
TABLE_NAME: 'table_name',
METHOD: 'method',
// ============== ORDER - 订单模块 =============
ORDER_STATUS: 'order_status',

View File

@ -0,0 +1,150 @@
<template>
<el-form ref="energyQuantityManualForm" :rules="rules" label-width="90px" :model="form">
<el-row :gutter="20">
<el-col :span='12'>
<el-form-item label="能源类型" prop="energyTypeId">
<el-select v-model="form.energyTypeId" placeholder="请选择" style="width: 100%;" filterable>
<el-option
v-for="item in this.energyTypeList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="水/气表名" prop="tableName">
<el-select v-model="form.tableName" placeholder="请选择" style="width: 100%;" filterable>
<el-option
v-for="item in getDictDatas(DICT_TYPE.TABLE_NAME)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span='12'>
<el-form-item label="抄表数" prop="readingQuantity">
<el-input-number v-model="form.readingQuantity" :min="0" :max="999999999999" :controls='false' style="width: 50%;"></el-input-number>
<el-select v-model="form.unit" placeholder="单位" style="width: 50%;">
<el-option
v-for="item in getDictDatas(DICT_TYPE.ENERGY_UNIT)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="抄表日期" prop="recordTime">
<el-date-picker
v-model="form.recordTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期"
style="width: 100%;">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import { energyQuantityManualCreate, energyQuantityManualUpdate, energyQuantityManualGet } from '@/api/base/energyQuantityManual'
import moment from 'moment'
export default {
name: 'EnergyQuantityManualAdd',
props: {
energyTypeList: {
type: Array,
required: true,
default: () => {
return []
}
}
},
data() {
return {
form: {
id: '',
energyTypeId: '',
tableName: '',
readingQuantity: null,
unit: '',
recordTime: ''
},
rules: {
energyTypeId: [{ required: true, message: '能源类型不能为空', trigger: 'change' }],
tableName: [{ required: true, message: '水/气表名不能为空', trigger: 'change' }],
readingQuantity: [{ required: true, message: '抄表数不能为空', trigger: 'blur' }],
recordTime: [{ required: true, message: '抄表日期不能为空', trigger: 'change' }]
},
isEdit: false
}
},
methods: {
init(params) {
console.log(params)
this.form.recordTime = moment().format('YYYY-MM-DD')
console.log(this.form.recordTime)
if (params.type === 'add') {
this.isEdit = false
} else if (params.type === 'meterReading') {
this.isEdit = false
this.form.energyTypeId = params.energyType
this.form.tableName = params.tableName + ''
}else {
this.isEdit = true
this.form.id = params.id
energyQuantityManualGet({id: this.form.id}).then(res => {
console.log(res)
if (res.code === 0) {
this.form.energyTypeId = res.data.energyTypeId
this.form.tableName = res.data.tableName ? res.data.tableName+'' : ''
this.form.readingQuantity = res.data.readingQuantity
this.form.unit = res.data.unit ? res.data.unit+'' : ''
this.form.recordTime = res.data.recordTime ? res.data.recordTime : null
}
})
}
},
submitForm() {
this.$refs['energyQuantityManualForm'].validate((valid) => {
if (valid) {
if (!this.form.unit) {
this.$modal.msgError("抄表数单位不能为空");
}
if (this.isEdit) {
//
energyQuantityManualUpdate({...this.form}).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit')
}
})
} else {
energyQuantityManualCreate({...this.form}).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit')
}
})
}
} else {
return false
}
})
},
formClear() {
this.$refs.energyQuantityManualForm.resetFields()
this.form.unit = ''
this.isEdit = false
}
}
}
</script>

View File

@ -0,0 +1,332 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
@selection-change="selectChange"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
: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-quantity-manual-add ref="energyQuantityManualAdd" :energyTypeList="energyTypeList" @successSubmit="successSubmit" />
</base-dialog>
</div>
</template>
<script>
import { energyQuantityManualPage, energyQuantityManualDelete, energyQuantityManualExport } from "@/api/base/energyQuantityManual"
import { getEnergyTypeListAll } from "@/api/base/energyType"
import { publicFormatter } from '@/utils/dict'
import { parseTime } from '@/utils/ruoyi'
// import FileSaver from "file-saver"
// import * as XLSX from 'xlsx/xlsx.mjs'
import EnergyQuantityManualAdd from './components/energyQuantityManualAdd.vue'
import moment from 'moment'
const tableProps = [
{
prop: 'energyType',
label: '能源类型'
},
{
prop: 'tableName',
label: '水/气表名',
filter: publicFormatter('table_name')
},
{
prop: 'recordTime',
label: '抄表日期',
filter: parseTime,
minWidth: 160
},
{
prop: 'readingQuantity',
label: '抄表值'
},
{
prop: 'recordTimeLast',
label: '上期抄表日期',
filter: parseTime,
minWidth: 160
},
{
prop: 'readingQuantityLast',
label: '上期抄表值'
},
{
prop: 'diff',
label: '差值'
}
]
export default {
name: "EnergyQuantityManual",
data() {
return {
formConfig: [
{
type: 'select',
label: '能源类型',
selectOptions: [],
param: 'energyTypeId',
filterable: true
},
{
type: 'datePicker',
label: '时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: []
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
},
{
type: 'separate'
},
{
type: this.$auth.hasPermi('base:energy-quantity-manual:export') ? 'button' : '',
btnName: '导出',
name: 'export',
color: 'primary',
plain: true
},
{
type: this.$auth.hasPermi('base:energy-quantity-manual:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
}
],
tableProps,
tableH: this.tableHeight(260),
//
total: 0,
//
list: [],
tableBtn: [
this.$auth.hasPermi('base:energy-quantity-manual:create')
? {
type: 'meterReading',
btnName: '抄表'
}
: undefined,
this.$auth.hasPermi('base:energy-quantity-manual:update')
? {
type: 'edit',
btnName: '编辑',
showParam: {
type: '&',
data: [
{
type: 'equal',
name: 'latest',
value: 1
}
]
}
}
: undefined,
this.$auth.hasPermi('base:energy-quantity-manual:delete')
? {
type: 'delete',
btnName: '删除'
}
: undefined
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
energyTypeId: '',
recordTime: []
},
energyTypeList: [],
exportList: [],
addOrEditTitle: '',
centervisible: false,
};
},
components: { EnergyQuantityManualAdd },
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]]
this.queryParams.recordTime[0] = arr[0].split('=')[1]
this.queryParams.recordTime[1] = arr[1].split('=')[1]
} else {
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')).valueOf()
this.formConfig[1].defaultSelect = [start, end]
this.queryParams.recordTime[0] = start
this.queryParams.recordTime[1] = end
}
this.getList();
this.getTypeList()
},
watch: {
$route: 'initData'
},
methods: {
initData(to) {
if (to.name === 'EnergyQuantityManual') {
if (location.href.indexOf('?') > 0) {
let arr = location.href.split('?')[1].split('&')
this.formConfig[1].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
this.queryParams.recordTime[0] = arr[0].split('=')[1]
this.queryParams.recordTime[1] = arr[1].split('=')[1]
} else {
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')).valueOf()
this.formConfig[1].defaultSelect = [start, end]
this.queryParams.recordTime[0] = start
this.queryParams.recordTime[1] = end
}
this.getList()
}
},
buttonClick(val) {
this.queryParams.pageNo = 1;
this.queryParams.energyTypeId = val.energyTypeId
this.queryParams.recordTime[0] = val.timeVal ? moment(moment(val.timeVal[0]).format('YYYY-MM-DD 00:00:00')).valueOf() : null
this.queryParams.recordTime[1] = val.timeVal ? moment(moment(val.timeVal[1]).format('YYYY-MM-DD 23:59:59')).valueOf() : null
switch (val.btnName) {
case 'search':
this.getList()
break
case 'add':
this.addOrEditTitle = '新增'
this.centervisible = true
let params = {}
params.type = 'add'
this.$nextTick(() => {
this.$refs.energyQuantityManualAdd.init(params)
})
break
default:
this.$modal.confirm('是否确认导出').then(() => {
return energyQuantityManualExport({...this.queryParams});
}).then(response => {
this.$download.excel(response, '能源报表.xls');
}).catch(() => {})
}
},
/** 查询列表 */
getList() {
energyQuantityManualPage(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
this.total = response.data.total;
this.exportList = []
});
},
getTypeList() {
getEnergyTypeListAll().then((res) => {
this.formConfig[0].selectOptions = res.data || []
this.energyTypeList = res.data || []
})
},
selectChange(val) {
console.log(val)
this.exportList = val
},
handleClick(val) {
console.log(val)
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑'
this.centervisible = true
let paramA = {}
paramA.type = 'edit'
paramA.id = val.data.id
this.$nextTick(() => {
this.$refs.energyQuantityManualAdd.init(paramA)
})
break
case 'meterReading':
this.addOrEditTitle = '新增'
this.centervisible = true
let paramB = {}
paramB.type = 'meterReading'
paramB.energyType = val.data.energyType
paramB.tableName = val.data.tableName
this.$nextTick(() => {
this.$refs.energyQuantityManualAdd.init(paramB)
})
break
default:
this.handleDelete(val.data)
}
},
//
handleCancel() {
this.$refs.energyQuantityManualAdd.formClear()
this.centervisible = false
this.addOrEditTitle = ''
},
handleConfirm() {
this.$refs.energyQuantityManualAdd.submitForm()
},
successSubmit() {
this.handleCancel()
this.getList()
},
/** 删除按钮操作 */
handleDelete(row) {
console.log(row.id)
this.$modal.confirm('是否确认删除能源类型为"' + row.energyType + '"的数据项?').then(function() {
return energyQuantityManualDelete({id: row.id});
}).then(() => {
this.queryParams.pageNo = 1;
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
}
};
</script>

View File

@ -1,5 +1,6 @@
<template>
<el-popover placement="right" width="400" trigger="click">
<span v-if='tableProps.length'>计量维度 {{dim === 4 ? '月' : (dim === 5 ? '年' : '-')}}</span>
<el-table :data="tableData" v-if='tableProps.length'>
<el-table-column
v-for='item in tableProps'
@ -70,7 +71,8 @@ export default {
tableProps: [],
singlePrice:'',
temp1,
temp2
temp2,
dim: ''
}
},
methods: {
@ -87,6 +89,7 @@ export default {
item.price = item.price.toFixed(2)
}
this.tableData = arr1
this.dim = ''
} else if (res.data.pricingMethod === 1) {
this.tableProps = this.temp2
this.singlePrice = ''
@ -95,10 +98,12 @@ export default {
item.price = item.price.toFixed(2)
}
this.tableData = arr2
this.dim = res.data.dim
} else {
this.tableProps = []
this.tableData = []
this.singlePrice = res.data.singlePrice
this.dim = ''
}
}
})

View File

@ -41,6 +41,14 @@
<el-input-number v-model="form.singlePrice" :precision="2" :min="0" :max="999999999" style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12" v-show="form.pricingMethod === 1">
<el-form-item label="计量维度" prop="dim">
<el-select v-model="form.dim" placeholder="请选择" style="width: 100%;">
<el-option label="月" :value= '4' ></el-option>
<el-option label="年" :value= '5' ></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24" v-show="form.pricingMethod === 0">
<el-form-item label="时间段" prop="pricingMethod">
<base-table
@ -289,6 +297,7 @@ export default {
unit: this.form.unit,
pricingMethod: this.form.pricingMethod,
description: this.form.description,
dim: this.form.pricingMethod === 1 ? this.form.dim: '',
singlePrice: this.form.pricingMethod === 2 ? this.form.singlePrice : '',
segPriceList: this.form.pricingMethod === 0 ? this.tableData1: [],
usedPriceList: this.form.pricingMethod === 1 ? this.tableData2: []
@ -305,6 +314,7 @@ export default {
unit: this.form.unit,
pricingMethod: this.form.pricingMethod,
description: this.form.description,
dim: this.form.pricingMethod === 1 ? this.form.dim: '',
singlePrice: this.form.pricingMethod === 2 ? this.form.singlePrice : '',
segPriceList: this.form.pricingMethod === 0 ? this.tableData1: [],
usedPriceList: this.form.pricingMethod === 1 ? this.tableData2: []

View File

@ -2,6 +2,18 @@
<el-form ref="form" :rules="rules" label-width="110px" :model="form">
<el-row>
<el-col :span="12">
<el-form-item label="抄表方式" prop="method">
<el-select v-model="form.method" placeholder="请选择" style="width: 100%;" @change="changeMethod">
<el-option
v-for="item in getDictDatas(DICT_TYPE.METHOD)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" v-if='form.method == 1'>
<el-form-item label="监控对象" prop="objectId">
<el-cascader
style='width: 100%;'
@ -13,8 +25,20 @@
clearable></el-cascader>
</el-form-item>
</el-col>
<el-col :span="12" v-if='form.method == 2'>
<el-form-item label="水/气表名" prop="tableName">
<el-select v-model="form.tableName" placeholder="请选择" style="width: 100%;">
<el-option
v-for="item in getDictDatas(DICT_TYPE.TABLE_NAME)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="能源类型" prop="energyTypeId">
<el-form-item label="监控能源类型" prop="energyTypeId">
<el-select v-model="form.energyTypeId" placeholder="请选择" style="width: 100%;" filterable @change="toggleType">
<el-option
v-for="item in this.energyTypeList"
@ -25,11 +49,29 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12" v-if='form.method == 1'>
<el-form-item label="监控模式" prop="type">
<el-select v-model="form.type" placeholder="请选择" style="width: 100%;" @change="typeChange">
<el-option label="合并" :value= "1" ></el-option>
<el-option label="详细" :value= "2" ></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" v-if='form.method == 1'>
<el-form-item label="监控详细参数" prop="type" v-if="form.type === 2">
<el-select v-model="form.plcParamId" placeholder="请选择" style="width: 100%;" @change="selectDetail">
<el-option
v-for="item in detailList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="指标类型" prop="limitType">
<el-select v-model="form.limitType" placeholder="请选择" style="width: 100%;">
<el-select v-model="form.limitType" placeholder="请选择" style="width: 100%;" :disabled='form.method == 2'>
<el-option
v-for="item in getDictDatas(DICT_TYPE.MONITOR_INDEX_TYPE)"
:key="item.value"
@ -39,34 +81,12 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="监控模式" prop="type">
<el-select v-model="form.type" placeholder="请选择" style="width: 100%;" @change="typeChange">
<el-option label="合并" :value= "1" ></el-option>
<el-option label="详细" :value= "2" ></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="消耗量阈值">
<el-input-number v-model="form.minValue" placeholder="最小值" :max="9999999" style="width: 50%;"></el-input-number>
<el-input-number v-model="form.maxValue" placeholder="最大值" :max="9999999" style="width: 50%;"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="监控详细参数" prop="type" v-if="form.type === 2">
<el-select v-model="form.plcParamId" placeholder="请选择" style="width: 100%;" @change="selectDetail">
<el-option
v-for="item in detailList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
@ -91,6 +111,7 @@ export default {
return {
form: {
id: '',
method: '1',
objectId: '',
objectType: '',
energyTypeId: '',
@ -103,7 +124,8 @@ export default {
objIds: [],//
isEdit: false, //
rules: {
objectId: [{ required: true, message: '对象不能为空', trigger: 'change' }],
method: [{ required: true, message: '抄表方式不能为空', trigger: 'change' }],
objectId: [{ required: true, message: '监控对象不能为空', trigger: 'change' }],
energyTypeId: [{ required: true, message: '能源类型不能为空', trigger: 'change' }],
type: [{ required: true, message: '监控模式不能为空', trigger: 'change' }],
limitType: [{ required: true, message: '指标类型不能为空', trigger: 'change' }]
@ -120,6 +142,7 @@ export default {
if (res.code === 0) {
this.form = res.data
this.form.plcParamId = res.data.plcParamId || ''
this.form.method = this.form.method ? this.form.method + '' : ''
this.form.limitType = this.form.limitType ? this.form.limitType + '' : ''
this.objIds = this.changeDetSelect(this.form.objectId, this.objList)
if (this.form.type === 2) {
@ -132,6 +155,14 @@ export default {
this.form.id = ''
}
},
//
changeMethod() {
if(this.form.method === '2'){
this.form.limitType = "2"
}else{
this.form.limitType = ''
}
},
//
getDetailList() {
getEnergyParamList({

View File

@ -51,6 +51,11 @@ import { getTree } from '@/api/base/factory'
import { publicFormatter } from '@/utils/dict'
import EnergyLimitAdd from './components/energyLimitAdd'
const tableProps = [
{
prop: 'method',
label: '抄表方式',
filter: publicFormatter('method')
},
{
prop: 'objName',
label: '监控对象'
@ -59,6 +64,11 @@ const tableProps = [
prop: 'objCode',
label: '对象编码'
},
{
prop: 'tableName',
label: '水/气表名',
filter: publicFormatter('table_name')
},
{
prop: 'energyType',
label: '能源类型'

View File

@ -1,5 +1,5 @@
<template>
<div class="app-container">
<div class="app-container energyOverlimitLog">
<!-- 搜索工作栏 -->
<search-bar
@ -7,7 +7,12 @@
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<el-tabs v-model="activeName" @tab-click="toggleTab">
<el-tab-pane label="自动抄表" name="auto"></el-tab-pane>
<el-tab-pane label="手动抄表" name="manual"></el-tab-pane>
</el-tabs>
<!-- 列表 -->
<div v-if="activeName === 'auto'">
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
@ -15,6 +20,16 @@
:table-data="list"
:max-height="tableH"
/>
</div>
<div v-if="activeName === 'manual'">
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps2"
:table-data="list2"
:max-height="tableH"
/>
</div>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@ -65,6 +80,41 @@ const tableProps = [
{
prop: 'overValue',
label: '超出值'
},
{
prop: 'time',
label: '提醒时间',
filter: parseTime,
minWidth: 160
}
]
const tableProps2 = [
{
prop: 'energyType',
label: '能源类型'
},
{
prop: 'limitType',
label: '指标类型',
filter: publicFormatter('monitor_index_type')
},
{
prop: 'realityValue',
label: '实际值'
},
{
prop: 'limitValue',
label: '阈值'
},
{
prop: 'overValue',
label: '超出值'
},
{
prop: 'time',
label: '提醒时间',
filter: parseTime,
minWidth: 160
}
]
export default {
@ -93,18 +143,20 @@ export default {
color: 'primary'
}
],
activeName: 'auto',
tableProps,
tableProps2,
tableH: this.tableHeight(260),
//
total: 0,
//
list: [],
list2: [],
//
queryParams: {
pageNo: 1,
pageSize: 20,
energyTypeId: '',
indexType: ''
indexType: '',
method: '1'
},
typeList: [
{id: 1, name: '合并'},
@ -155,7 +207,47 @@ export default {
console.log(res)
this.formConfig[0].selectOptions = res.data || []
})
},
toggleTab() {
if (this.activeName === 'auto') {
this.queryParams.method = '1'
}else{
this.queryParams.method = '2'
}
this.queryParams.pageNo = 1
this.getList()
}
}
};
</script>
<style lang='scss'>
.energyOverlimitLog {
.el-tabs__nav::after {
content: "";
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 2px;
background-color: #e4e7ed;
}
.el-tabs__nav-wrap::after {
width: 0;
}
.el-tabs__item {
padding: 0 10px;
}
.el-tabs__item:hover {
color: rgba(0, 0, 0, 0.85);
}
.el-tabs__item.is-active {
color: rgba(0, 0, 0, 0.85);
}
.el-tabs__item {
color: rgba(0, 0, 0, 0.45);
}
.searchBarBox {
margin-bottom: 0;
}
}
</style>

View File

@ -290,8 +290,8 @@ export default {
break;
case '2': //
this.$router.push({
// path: '/energy/monitoring/energy-report-search?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime
path: '/energy/base/energy-quantity-realtime?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime
// path: '/energy/base/energy-quantity-realtime?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime
path: '/energy/base/energy-quantity-manual?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime
})
break;
default:

View File

@ -0,0 +1,8 @@
<template>
<div>vocDetectionHistory</div>
</template>
<script>
export default {
name: 'VocDetectionHistory'
}
</script>

View File

@ -0,0 +1,8 @@
<template>
<div>vocDetectionIndication</div>
</template>
<script>
export default {
name: 'VocDetectionIndication'
}
</script>

View File

@ -0,0 +1,8 @@
<template>
<div>voc</div>
</template>
<script>
export default {
name: 'Voc'
}
</script>

View File

@ -0,0 +1,8 @@
<template>
<div>wasteGasDetectionHistory</div>
</template>
<script>
export default {
name: 'WasteGasDetectionHistory'
}
</script>

View File

@ -0,0 +1,8 @@
<template>
<div>wasteGasDetectionIndication</div>
</template>
<script>
export default {
name: 'WasteGasDetectionIndication'
}
</script>

View File

@ -0,0 +1,8 @@
<template>
<div>wasteGas</div>
</template>
<script>
export default {
name: 'WasteGas'
}
</script>

View File

@ -0,0 +1,8 @@
<template>
<div>wasteWaterDetectionHistory</div>
</template>
<script>
export default {
name: 'WasteWaterDetectionHistory'
}
</script>

View File

@ -0,0 +1,161 @@
<template>
<el-form ref="wasteWaterAddForm" :rules="rules" label-width="130px" :model="form">
<el-row :gutter="20">
<el-col :span='12'>
<el-form-item label="指标名称" prop="name">
<el-input v-model="form.name"></el-input>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="指标编码" prop="code">
<el-input v-model="form.code"></el-input>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="指标名称" prop="name1">
<el-input v-model="form.name"></el-input>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="最小值" prop="code11">
<el-input v-model="form.code"></el-input>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="最大值" prop="name12">
<el-input v-model="form.name"></el-input>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="备注" prop="code1122">
<el-input v-model="form.code"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
export default {
name: 'WasteWaterAdd',
data() {
return {
// rules: {
// name: [{ required: true, message: "", trigger: "blur" }],
// code: [{ required: true, message: "", trigger: "blur" }],
// planQuantity: [{ required: true, message: "", trigger: "blur" }],
// planProductId: [{ required: true, message: "", trigger: "change" }]
// }
}
},
methods: {
// init(id) {
// this.getList()
// if (id) {
// this.isEdit = true
// this.form.id = id
// getOrderById({id: this.form.id}).then(res => {
// if (res.code === 0) {
// this.form.name = res.data.name
// this.form.code = res.data.code
// this.form.planQuantity = res.data.planQuantity
// this.form.planProductId = res.data.planProductId
// this.form.price = res.data.price
// this.form.customerId = res.data.customerId
// this.form.priority = res.data.priority ? res.data.priority + '' : ''
// this.form.planStartTime = res.data.planStartTime ? res.data.planStartTime : null
// this.form.packSpec = res.data.packSpec ? res.data.packSpec+'' : ''
// this.form.workers = res.data.workers
// this.form.processFlowId = res.data.processFlowId
// this.form.materialMethod = res.data.materialMethod
// this.form.planFinishTime = res.data.planFinishTime ? res.data.planFinishTime : null
// this.form.remark = res.data.remark
// // this.form.description = res.data.description
// }
// })
// } else {
// this.isEdit = false
// this.form.id = ''
// //
// getOrderCode().then(res => {
// this.form.code = res.data || ''
// })
// }
// },
// getList() {
// //
// getProductAll().then(res => {
// this.productList = res.data || []
// })
// //
// getCustomerList().then(res => {
// this.customerList = res.data || []
// })
// //
// getProcessFlowList().then(res => {
// this.processFlowList = res.data || []
// })
// },
// timeChange() {
// if (this.form.planStartTime && this.form.planFinishTime) {
// if (this.form.planStartTime > this.form.planFinishTime) {
// this.$modal.msgError('')
// }
// }
// },
// //
// materialMethodChange(val) {
// if (val === 2 && !this.form.processFlowId) {
// this.form.materialMethod = 1
// this.$modal.msgError("");
// }
// },
// //
// processFlowIdChange(val) {
// console.log(val)
// if (!val) {
// this.form.materialMethod = 1
// }
// },
// submitForm() {
// this.$refs['orderAddForm'].validate((valid) => {
// if (valid) {
// if (this.form.planStartTime && this.form.planFinishTime) {
// if (this.form.planStartTime > this.form.planFinishTime) {
// this.$modal.msgError('')
// return false
// }
// }
// // console.log(this.form)
// if (this.isEdit) {
// //
// orderUpdate({ ...this.form }).then((res) => {
// if (res.code === 0) {
// this.$modal.msgSuccess("");
// this.$emit('successSubmit')
// }
// })
// } else {
// this.form.status = 1
// this.form.triggerOrigin = 1
// orderCreate({ ...this.form }).then((res) => {
// if (res.code === 0) {
// this.$modal.msgSuccess("");
// this.$emit('successSubmit')
// }
// })
// }
// } else {
// return false
// }
// })
// },
// formClear() {
// this.$refs.orderAddForm.resetFields()
// this.form.materialMethod = 1
// this.form.price = 0.00
// this.form.planQuantity = 0
// this.isEdit = false
// }
}
}
</script>

View File

@ -0,0 +1,202 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<!-- 列表 -->
<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="120"
label="操作"
: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"
width='60%'
>
<waste-water-add ref="wasteWaterAdd" @successSubmit="successSubmit" />
</base-dialog>
</div>
</template>
<script>
import { parseTime } from '@/utils/ruoyi'
// import { publicFormatter } from '@/utils/dict'
const tableProps = [
{
prop: 'name',
label: '指示名称',
minWidth: 120,
showOverflowtooltip: true
},
{
prop: 'code',
label: '指示编码',
minWidth: 120
},
{
prop: 'customerId',
label: '单位'
},
{
prop: 'customerId1',
label: '最小值'
},
{
prop: 'customerId2',
label: '最大值'
},
{
prop: 'customerId3',
label: '创建人'
},
// {
// prop: 'triggerOrigin',
// label: '',
// filter: publicFormatter('order_Origin')
// },
{
prop: 'createTime',
label: '创建时间',
filter: parseTime,
minWidth: 160
}
]
export default {
name: 'WasteWaterDetectionIndication',
data() {
return {
formConfig: [
{
type: 'select',
label: '指标名称',
selectOptions: this.getDictDatas(this.DICT_TYPE.ORDER_STATUS),
labelField: 'label',
valueField: 'value',
param: 'name'
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
},
{
type: this.$auth.hasPermi('base:order-manage:create') ? 'separate' : '',
},
{
type: this.$auth.hasPermi('base:order-manage:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
}
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
name: null,
status: null
},
total: 0,
tableProps,
list: [
{name:'1111'}
],
tableH: this.tableHeight(260),
tableBtn: [
this.$auth.hasPermi('base:order-manage:edit')
? {
type: 'edit',
btnName: '编辑'
}
: undefined,
this.$auth.hasPermi('base:order-manage:delete')
? {
type: 'delete',
btnName: '删除'
}
: undefined
],
addOrEditTitle: '',
centervisible: false
}
},
methods: {
getList() {},
buttonClick(val) {
console.log(val)
if (val.btnName === 'search') {
this.queryParams.name = val.name
this.getList()
} else {
this.addOrEditTitle = '新增'
this.centervisible = true
this.$nextTick(() => {
this.$refs.wasteWaterAdd.init()
})
}
},
handleClick(val) {
console.log(val)
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑'
this.centervisible = true
this.$nextTick(() => {
this.$refs.wasteWaterAdd.init(val.data.id)
})
break
default:
this.handleDelete(val.data)
}
},
//
handleDelete(val) {
this.$modal.confirm('是否确认删除"' + val.name + '"的数据项?').then(function() {
// return wasteWaterDelete({ id: val.id })
}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {});
},
//
handleCancel() {
this.$refs.wasteWaterAdd.formClear()
this.centervisible = false
this.addOrEditTitle = ''
},
handleConfirm() {
this.$refs.wasteWaterAdd.submitForm()
},
successSubmit() {
this.handleCancel()
this.getList()
}
}
}
</script>

View File

@ -0,0 +1,8 @@
<template>
<div>wasteWater</div>
</template>
<script>
export default {
name: 'WasteWater'
}
</script>