Compare commits

..

20 Commits

Author SHA1 Message Date
zwq
91d269e1ce 更新成本和仓库 2023-12-13 09:18:36 +08:00
4e26d49ff5 Merge pull request '首页' (#140) from projects/mesxc-zjl into projects/mesxc-test
Reviewed-on: #140
2023-12-13 09:16:28 +08:00
63b19d84e4 首页 2023-12-13 09:12:52 +08:00
6c7390f61e Merge pull request 'projects/mesxc-zjl' (#139) from projects/mesxc-zjl into projects/mesxc-test
Reviewed-on: #139
2023-12-12 10:57:12 +08:00
1661615af4 环保 2023-12-12 10:56:25 +08:00
8fdaa3e968 环保管理 2023-12-08 17:03:01 +08:00
f2e38b5e67 Merge pull request 'projects/mesxc-zjl' (#138) from projects/mesxc-zjl into projects/mesxc-test
Reviewed-on: #138
2023-12-06 10:09:07 +08:00
fe0c84bc3a 能源&bug 2023-12-06 10:06:26 +08:00
0a53bcb57e merge test 2023-12-05 14:40:02 +08:00
1ce61f13b7 原模块修改能源 2023-12-05 14:30:32 +08:00
49d002142f Merge pull request 'projects/mesxc-dy' (#137) from projects/mesxc-dy into projects/mesxc-test
Reviewed-on: #137
2023-12-01 15:34:28 +08:00
helloDy
8399081a6f Merge branch 'projects/mesxc-test' into projects/mesxc-dy 2023-12-01 15:27:02 +08:00
helloDy
cc6c4772d3 ui 2023-12-01 15:25:46 +08:00
ba7dad7fce Merge pull request 'projects/mesxc-dy' (#136) from projects/mesxc-dy into projects/mesxc-test
Reviewed-on: #136
2023-11-30 16:01:21 +08:00
helloDy
8e7e31f918 Merge branch 'projects/mes-dy' into projects/mesxc-dy 2023-11-30 15:53:40 +08:00
helloDy
5e4df4d849 Merge branch 'projects/mes-test' into projects/mes-dy 2023-11-30 15:06:20 +08:00
helloDy
1d3372ed69 ui 2023-11-30 15:04:17 +08:00
86f246eb94 Merge pull request 'projects/mes-lb' (#134) from projects/mes-lb into projects/mes-test
Reviewed-on: #134
2023-11-30 14:24:09 +08:00
lb
e2a16332be Merge branch 'projects/mes-test' into projects/mes-lb 2023-11-30 14:22:56 +08:00
lb
69b6942f35 fix bugs 2023-11-30 14:19:13 +08:00
96 changed files with 14585 additions and 9058 deletions

View File

@ -20,7 +20,7 @@ VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.1.8:48082' # VUE_APP_BASE_API = 'http://192.168.1.8:48082'
# VUE_APP_BASE_API = 'http://192.168.4.159:48080' # VUE_APP_BASE_API = 'http://192.168.4.159:48080'
# VUE_APP_BASE_API = 'http://192.168.1.56:48082' # VUE_APP_BASE_API = 'http://192.168.1.56:48082'
# VUE_APP_BASE_API = 'http://192.168.4.159:48080' # VUE_APP_BASE_API = 'http://192.168.1.62:48082'
# 积木报表指向地址 # 积木报表指向地址
VUE_APP_JIMU_API = 'http://192.168.0.33:48082' VUE_APP_JIMU_API = 'http://192.168.0.33:48082'

View File

@ -48,7 +48,7 @@
"benz-amr-recorder": "^1.1.5", "benz-amr-recorder": "^1.1.5",
"bpmn-js-token-simulation": "0.10.0", "bpmn-js-token-simulation": "0.10.0",
"clipboard": "2.0.8", "clipboard": "2.0.8",
"code-brick-zj": "^1.0.2", "code-brick-zj": "^1.0.5",
"core-js": "^3.26.0", "core-js": "^3.26.0",
"crypto-js": "^4.0.0", "crypto-js": "^4.0.0",
"diagram-js": "^12.3.0", "diagram-js": "^12.3.0",

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

@ -0,0 +1,78 @@
/*
* @Author: zwq
* @Date: 2023-11-23 14:57:00
* @LastEditors: zwq
* @LastEditTime: 2023-12-07 09:37:18
* @Description:
*/
import request from '@/utils/request'
// 创建能源自动记录报
export function createCostEneryAutoReport(data) {
return request({
url: '/extend/cost-enery-auto-report/create',
method: 'post',
data: data
})
}
// 更新能源自动记录报
export function updateCostEneryAutoReport(data) {
return request({
url: '/extend/cost-enery-auto-report/update',
method: 'put',
data: data
})
}
// 删除能源自动记录报
export function deleteCostEneryAutoReport(id) {
return request({
url: '/extend/cost-enery-auto-report/delete?id=' + id,
method: 'delete'
})
}
// 获得能源自动记录报
export function getCostEneryAutoReport(id) {
return request({
url: '/extend/cost-enery-auto-report/get?id=' + id,
method: 'get'
})
}
// 获得能源自动记录报分页历史
export function getCostEneryAutoReportPage(data) {
return request({
url: '/extend/cost-enery-auto-report/page',
method: 'post',
data: data
})
}
// 获得能源查询
export function getCostEneryAutoPage(data) {
return request({
url: '/extend/cost-energy-search/getData',
method: 'post',
data: data
})
}
// 导出能源自动记录报 Excel
export function exportCostEneryAutoReportExcel(data) {
return request({
url: '/extend/cost-enery-auto-report/export-excel',
method: 'post',
data: data,
responseType: 'blob'
})
}
// 导出能源自动记录报 Excel 查询
export function exportCostEneryExcel(data) {
return request({
url: '/extend/cost-energy-search/export-excel',
method: 'post',
data: data,
responseType: 'blob'
})
}

View File

@ -0,0 +1,73 @@
import request from '@/utils/request'
// 创建原料成本自动统计报
export function createCostMaterialAutoReport(data) {
return request({
url: '/extend/cost-material-auto-report/create',
method: 'post',
data: data
})
}
// 更新原料成本自动统计报
export function updateCostMaterialAutoReport(data) {
return request({
url: '/extend/cost-material-auto-report/update',
method: 'put',
data: data
})
}
// 删除原料成本自动统计报
export function deleteCostMaterialAutoReport(id) {
return request({
url: '/extend/cost-material-auto-report/delete?id=' + id,
method: 'delete'
})
}
// 获得原料成本自动统计报
export function getCostMaterialAutoReport(id) {
return request({
url: '/extend/cost-material-auto-report/get?id=' + id,
method: 'get'
})
}
// 获得原料成本自动统计报分页历史
export function getCostMaterialAutoReportPage(data) {
return request({
url: '/extend/cost-material-auto-report/page',
method: 'post',
data: data
})
}
// 获得原料成本查询
export function getCostMaterialSearchPage(data) {
return request({
url: '/extend/cost-material-search/getData',
method: 'post',
data: data
})
}
// 导出原料成本自动统计报 Excel
export function exportCostMaterialAutoReportExcel(data) {
return request({
url: '/extend/cost-material-auto-report/export-excel',
method: 'post',
data: data,
responseType: 'blob'
})
}
// 导出原料成本自动统计报 Excel查询
export function exportCostMaterialSearch(data) {
return request({
url: '/extend/cost-material-search/export-excel',
method: 'post',
data: data,
responseType: 'blob'
})
}

View File

@ -0,0 +1,61 @@
/*
* @Author: zwq
* @Date: 2023-11-15 09:24:30
* @LastEditors: zwq
* @LastEditTime: 2023-12-05 14:38:48
* @Description:
*/
import request from '@/utils/request'
// 创建原料价位配置
export function createCostMaterialSet(data) {
return request({
url: '/extend/cost-material-set/create',
method: 'post',
data: data
})
}
// 更新原料价位配置
export function updateCostMaterialSet(data) {
return request({
url: '/extend/cost-material-set/update',
method: 'put',
data: data
})
}
// 删除原料价位配置
export function deleteCostMaterialSet(id) {
return request({
url: '/extend/cost-material-set/delete?id=' + id,
method: 'delete'
})
}
// 获得原料价位配置
export function getCostMaterialSet(id) {
return request({
url: '/extend/cost-material-set/get?id=' + id,
method: 'get'
})
}
// 获得原料价位配置分页
export function getCostMaterialSetPage(data) {
return request({
url: '/extend/cost-material-set/page',
method: 'POST',
data: data
})
}
// 导出原料价位配置 Excel
export function exportCostMaterialSetExcel(query) {
return request({
url: '/extend/cost-material-set/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,92 @@
import request from '@/utils/request'
// 获得环保检测指标实时数据
export function environmentalCheckRealtime(query) {
return request({
url: '/base/environmental-check/realtime',
method: 'get',
params: query
})
}
// 获得环保检测指标趋势数据
export function environmentalCheckRealtimeTrend(data) {
return request({
url: '/base/environmental-check-record/trend',
method: 'post',
data: data
})
}
// 获得环保检测指标分页
export function environmentalCheckPage(query) {
return request({
url: '/base/environmental-check/page',
method: 'get',
params: query
})
}
// 创建环保检测指标
export function environmentalCheckCreate(data) {
return request({
url: '/base/environmental-check/create',
method: 'post',
data: data
})
}
// 更新环保检测指标
export function environmentalCheckUpdate(data) {
return request({
url: '/base/environmental-check/update',
method: 'put',
data: data
})
}
// 获得环保检测指标
export function environmentalCheckGet(query) {
return request({
url: '/base/environmental-check/get',
method: 'get',
params: query
})
}
// 删除环保检测指标
export function environmentalCheckDelete(query) {
return request({
url: '/base/environmental-check/delete',
method: 'delete',
params: query
})
}
// 获得环保检测记录分页
export function environmentalCheckRecordPage(data) {
return request({
url: '/base/environmental-check-record/page',
method: 'post',
data: data
})
}
// 导出环保检测记录 Excel
export function environmentalCheckRecordExport(data) {
return request({
url: '/base/environmental-check-record/export-excel',
method: 'post',
data: data,
responseType: 'blob'
})
}
// 获取环保检测指标code
export function getEnvironmentalCheckCode(query) {
return request({
url: '/base/environmental-check/getCode',
method: 'get',
params: query
})
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -125,11 +125,8 @@ export default {
// start // start
this.Quill?.enable(false); this.Quill?.enable(false);
this.$nextTick(() => { this.$nextTick(() => {
this.Quill?.enable(true);
this.Quill?.blur(); this.Quill?.blur();
// if (!this.readOnly) { this.Quill?.enable(true);
// this.Quill?.enable();
// }
}); });
// //
if (this.type === 'url') { if (this.type === 'url') {

View File

@ -78,7 +78,6 @@ export default {
return this.http(this.infoUrl == '' ? this.infoPath : this.infoUrl, 'get', payload); return this.http(this.infoUrl == '' ? this.infoPath : this.infoUrl, 'get', payload);
}, },
del(payload) { del(payload) {
debugger;
return this.http(this.deleteUrl == '' ? this.deletePath : this.deleteUrl, 'delete', payload); return this.http(this.deleteUrl == '' ? this.deletePath : this.deleteUrl, 'delete', payload);
}, },

View File

@ -94,6 +94,8 @@ export const DICT_TYPE = {
OBJECT_TYPE: 'object_type', OBJECT_TYPE: 'object_type',
STATISTIC_TYPE: 'statistic_type', STATISTIC_TYPE: 'statistic_type',
TIME_DIM: 'time_dim', TIME_DIM: 'time_dim',
TABLE_NAME: 'table_name',
METHOD: 'method',
// ============== ORDER - 订单模块 ============= // ============== ORDER - 订单模块 =============
ORDER_STATUS: 'order_status', ORDER_STATUS: 'order_status',
@ -104,6 +106,9 @@ export const DICT_TYPE = {
// ============== EQUIPMENT - 设备模块 ============= // ============== EQUIPMENT - 设备模块 =============
MAINTAIN_TYPE: 'maintain_type', MAINTAIN_TYPE: 'maintain_type',
FAULT_LEVEL: 'fault-level', FAULT_LEVEL: 'fault-level',
// ============== ENVIRONMENTAL - 环保模块 =============
ENVIRONMENT_CHECK_UNIT: 'environment_check_unit'
} }
/** /**

View File

@ -5,7 +5,7 @@
const baseURL = process.env.VUE_APP_BASE_API const baseURL = process.env.VUE_APP_BASE_API
// 日期格式化 // 日期格式化(通用)
export function parseTime(time, pattern) { export function parseTime(time, pattern) {
if (arguments.length === 0 || !time) { if (arguments.length === 0 || !time) {
return null return null
@ -48,6 +48,51 @@ export function parseTime(time, pattern) {
return time_str return time_str
} }
// 日期格式化(仅适用表格)
export function parseTimeTable(pattern) {
return function(time){
if (arguments.length === 0 || !time) {
return null
}
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
let date
if (typeof time === 'object') {
date = time
} else {
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
time = parseInt(time)
} else if (typeof time === 'string') {
time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.\d{3}/gm),'');
}
if ((typeof time === 'number') && (time.toString().length === 10)) {
time = time * 1000
}
date = new Date(time)
}
const formatObj = {
y: date.getFullYear(),
m: date.getMonth() + 1,
d: date.getDate(),
h: date.getHours(),
i: date.getMinutes(),
s: date.getSeconds(),
a: date.getDay()
}
const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => {
let value = formatObj[key]
// Note: getDay() returns 0 on Sunday
if (key === 'a') {
return ['日', '一', '二', '三', '四', '五', '六'][value]
}
if (result.length > 0 && value < 10) {
value = '0' + value
}
return value || 0
})
return time_str
}
}
// 表单重置 // 表单重置
export function resetForm(refName) { export function resetForm(refName) {
if (this.$refs[refName]) { if (this.$refs[refName]) {

View File

@ -248,6 +248,9 @@ export default {
label: '设备编码', label: '设备编码',
prop: 'code', prop: 'code',
url: '/base/core-equipment/getCode', url: '/base/core-equipment/getCode',
rules: [
{ required: true, message: '设备编码不能为空', trigger: 'blur' },
],
}, },
{ {
input: true, input: true,

View File

@ -2,7 +2,7 @@
<div class="choicepart-container"> <div class="choicepart-container">
<navbar /> <navbar />
<div class="choicepart-wrapper"> <div class="choicepart-wrapper">
<div class="choicepart-box" id="choicepartBox" :style="'transform:scale('+scale+');width:1574px;height:538px;'" v-show="showItem"> <div class="choicepart-box" id="choicepartBox" :style="'transform:scale('+scale+');width:1710px;height:538px;'" v-show="showItem">
<div class="choicepart-line1"> <div class="choicepart-line1">
<div <div
v-for="(item, index) in menuArr1" v-for="(item, index) in menuArr1"
@ -102,9 +102,7 @@ export default {
meta: { meta: {
title: '' title: ''
} }
} },
],
menuArr2: [
{ {
name: 'Packaging', name: 'Packaging',
title: '包装管理', title: '包装管理',
@ -112,7 +110,9 @@ export default {
meta: { meta: {
title: '' title: ''
} }
}, }
],
menuArr2: [
{ {
name: 'Material', name: 'Material',
title: '物料管理', title: '物料管理',
@ -129,17 +129,41 @@ export default {
title: '' title: ''
} }
}, },
// {
// name: 'Delivery',
// title: '',
// visible: false,
// meta: {
// title: ''
// }
// },
{ {
name: 'Delivery', name: 'Report',
title: '成品发货', title: '报表管理',
visible: false, visible: false,
meta: { meta: {
title: '' title: ''
} }
}, },
{ {
name: 'Report', name: 'Cost',
title: '报表管理', title: '成本管理',
visible: false,
meta: {
title: ''
}
},
{
name: 'SafetyEnvironmental',
title: '安环管理',
visible: false,
meta: {
title: ''
}
},
{
name: 'Databoard',
title: '数据驾驶舱',
visible: false, visible: false,
meta: { meta: {
title: '' title: ''
@ -176,7 +200,7 @@ export default {
console.log(menuList) console.log(menuList)
if (menuList.length > 0) { if (menuList.length > 0) {
for (let i = 0; i < menuList.length; i ++) { for (let i = 0; i < menuList.length; i ++) {
for (let k = 0; k < 7; k++) { for (let k = 0; k < 8; k++) {
if (menuList[i].name === this.menuArr1[k].name) { if (menuList[i].name === this.menuArr1[k].name) {
this.menuArr1[k].visible = true this.menuArr1[k].visible = true
this.menuArr1[k].id = menuList[i].id this.menuArr1[k].id = menuList[i].id
@ -185,7 +209,7 @@ export default {
this.menuArr1[k].meta = menuList[i].meta this.menuArr1[k].meta = menuList[i].meta
} }
} }
for (let j = 0; j < 6; j++) { for (let j = 0; j < 7; j++) {
if (menuList[i].name === this.menuArr2[j].name) { if (menuList[i].name === this.menuArr2[j].name) {
this.menuArr2[j].visible = true this.menuArr2[j].visible = true
this.menuArr2[j].id = menuList[i].id this.menuArr2[j].id = menuList[i].id

View File

@ -0,0 +1,162 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData"></base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
</div>
</template>
<script>
import basicPage from '../mixins/basic-page';
import codeFilter from '../mixins/code-filter';
import {
getCostEneryAutoPage,
exportCostEneryExcel,
} from '@/api/cost/costEneryAutoReport';
import { getEnergyTypeListAll } from '@/api/base/energyType';
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'energyTypeName',
label: '能源类型',
},
{
prop: 'objName',
label: '监控对象',
filter: (val) => (val != null ? val : '--'),
},
{
prop: 'tableName',
label: '水/气表名',
filter: (val) => (val != null ? val : '--'),
filter: publicFormatter('table_name'),
},
{
prop: 'totalUsed',
label: '累计使用量',
},
{
prop: 'totalCost',
label: '总价',
align: 'right',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getCostEneryAutoPage,
exportURL: exportCostEneryExcel
},
tableData: [],
tableProps,
drawerVisible: false,
formConfig: [
{
type: 'select',
label: '能源类型',
selectOptions: [],
param: 'energyTypeId',
filterable: true,
},
{
type: 'datePicker',
label: '时间范围',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: this.$auth.hasPermi('cost:energyCost:export')
? 'button'
: '',
btnName: '导出',
name: 'export',
color: 'primary',
plain: true,
},
],
};
},
components: {},
created() {
getEnergyTypeListAll().then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
//
getDataList() {
if(this.listQuery.searchTime){
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then(response => {
if(response.hasOwnProperty('data')){
this.tableData = response.data.list;
this.listQuery.total = response.data.total;
}
this.dataListLoading = false;
});
}else{
this.$message.warning('请选择时间范围')
}
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.energyTypeId = val.energyTypeId;
this.listQuery.searchTime = val.searchTime ? val.searchTime[0] : null;
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;
this.getDataList();
break;
case 'export':
const data = {
energyTypeId:val.energyTypeId,
startTime : val.searchTime ? val.searchTime[0] : null,
endTime : val.searchTime ? val.searchTime[1] : null,
}
this.handleExport(data);
break;
default:
console.log(val);
}
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,173 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData"></base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
</div>
</template>
<script>
import basicPage from '../mixins/basic-page';
import codeFilter from '../mixins/code-filter';
import {
getCostEneryAutoReportPage,
exportCostEneryAutoReportExcel,
} from '@/api/cost/costEneryAutoReport';
import { getEnergyTypeListAll } from '@/api/base/energyType';
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'reportType',
label: '维度',
filter: codeFilter('reportType'),
},
{
prop: 'reportName',
label: '时间',
minWidth: 150,
},
{
prop: 'energyType',
label: '能源类型',
},
{
prop: 'objName',
label: '监控对象',
filter: (val) => (val != null ? val : '--'),
},
{
prop: 'tableName',
label: '水/气表名',
filter: (val) => (val != null ? val : '--'),
filter: publicFormatter('table_name'),
},
{
prop: 'totalUsed',
label: '累计使用量',
},
{
prop: 'totalCost',
label: '总价',
align: 'right',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getCostEneryAutoReportPage,
exportURL: exportCostEneryAutoReportExcel,
},
tableData: [],
tableProps,
drawerVisible: false,
listQuery: {
reportType: 2,
},
formConfig: [
{
type: 'select',
label: '维度',
selectOptions: [
{ id: 2, name: '日' },
{ id: 3, name: '周' },
{ id: 4, name: '月' },
{ id: 5, name: '年' },
],
param: 'reportType',
filterable: true,
defaultSelect: 2, //
clearable: false,
},
{
type: 'select',
label: '能源类型',
selectOptions: [],
param: 'energyTypeId',
filterable: true,
},
{
type: 'datePicker',
label: '时间范围',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: this.$auth.hasPermi('cost:energyCostHis:export')
? 'button'
: '',
btnName: '导出',
name: 'export',
color: 'primary',
plain: true,
},
],
};
},
components: {},
created() {
getEnergyTypeListAll().then((response) => {
this.formConfig[1].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.reportType = val.reportType;
this.listQuery.energyTypeId = val.energyTypeId;
this.listQuery.reportTime = val.searchTime ? val.searchTime : null;
this.getDataList();
break;
case 'export':
const data = {
reportType: val.reportType,
energyTypeId: val.energyTypeId,
reportTime: val.searchTime ? val.searchTime : null
}
this.handleExport(data);
break;
default:
console.log(val);
}
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,121 @@
/*
* @Author: zwq
* @Date: 2022-08-24 11:19:43
* @LastEditors: zwq
* @LastEditTime: 2023-11-02 15:33:39
* @Description:
*/
import { listData } from "@/api/system/dict/data";
export default {
data() {
/* eslint-disable */
return {
urlOptions: {
createURL: '',
updateURL: '',
infoURL: '',
codeURL: '',
getOption: false, //是否加载获取下拉框方法
isGetCode: false, //是否加载获取code方法
getDictList: false, //是否加载获取数据字典方法
optionArrUrl: [], //需要获取下拉框的方法数组
optionArr: {}, //需要获取下拉框的方法数组的返回结果
dictList: {}, //需要获取数据字典的方法数组的返回结果
},
visible: false,
setData: false
}
},
created() {
},
activated() {
},
methods: {
init(id) {
this.dataForm.id = id || "";
this.visible = true;
if (this.urlOptions.getOption) {
this.getArr()
}
if (this.urlOptions.getDictList) {
this.getDict()
}
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
if (this.dataForm.id) {
this.urlOptions.infoURL(id).then(response => {
this.dataForm = response.data;
if (this.setData) {
this.setDataForm()
}
});
} else {
if (this.urlOptions.isGetCode) {
this.getCode()
}
}
});
},
getCode() {
this.urlOptions.codeURL()
.then(({ data: res }) => {
this.dataForm.code = res;
})
.catch(() => {});
},
getArr() {
const params = {
pageSize: 100,
pageNo: 1,
}
this.urlOptions.optionArrUrl.forEach((item, index) => {
item(params).then(({ data: res }) => {
this.$set(this.urlOptions.optionArr, `arr${index}`, res.list)
})
.catch(() => {
});
});
},
/** 查询字典数据列表 */
getDict() {
this.nameList.forEach((item,index)=>{
const queryParams = {
pageNo: 1,
pageSize: 99,
dictType: item,
}
listData(queryParams).then(response => {
this.$set(this.urlOptions.dictList, `dict${index}`, response.data.list)
});
})
},
// 表单提交
dataFormSubmit() {
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
return false;
}
// 修改的提交
if (this.dataForm.id) {
this.urlOptions.updateURL(this.dataForm).then(response => {
this.$modal.msgSuccess("修改成功");
this.visible = false;
this.$emit("refreshDataList");
});
return;
}
// 添加的提交
this.urlOptions.createURL(this.dataForm).then(response => {
this.$modal.msgSuccess("新增成功");
this.visible = false;
this.$emit("refreshDataList");
});
});
},
formClear() {
if (this.$refs.dataForm!==undefined) {
this.$refs.dataForm.resetFields();
}
}
}
}

View File

@ -0,0 +1,172 @@
/*
* @Author: zwq
* @Date: 2022-08-24 11:19:43
* @LastEditors: zwq
* @LastEditTime: 2023-12-07 09:35:33
* @Description:
*/
export default {
data() {
/* eslint-disable */
return {
urlOptions: {
getDataListURL: '',
deleteURL: '',
statusUrl: '',
exportURL: ''
},
tableData: [],
listQuery: {
pageSize: 10,
pageNo: 1,
total: 1,
},
exportLoading: false,
dataListLoading: false,
addOrEditTitle: '',
addOrUpdateVisible: false,
addOrUpdate:'addOrUpdate'
}
},
created() {
},
mounted() {
this.getDataList()
},
methods: {
// 获取数据列表
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then(response => {
if(response.hasOwnProperty('data')){
this.tableData = response.data.list;
this.listQuery.total = response.data.total;
}
this.dataListLoading = false;
});
},
// 每页数
sizeChangeHandle(val) {
this.listQuery.pageSize = val;
this.listQuery.pageNo = 1;
this.getDataList();
},
// 当前页
currentChangeHandle(val) {
this.listQuery.pageNo = val;
this.getDataList();
},
// 新增 / 修改
addOrUpdateHandle(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
},
cancel(id) {
this.$refs["popover-" + id].showPopper = false;
},
//改变状态
changeStatus(id) {
this.$http
.post(this.urlOptions.statusUrl, { id })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.$refs["popover-" + id].showPopper = false;
this.$message({
message: this.$t("prompt.success"),
type: "success",
duration: 500,
onClose: () => {
this.getDataList();
},
});
})
.catch(() => { });
},
//tableBtn点击
handleClick(val) {
if (val.type === "edit") {
this.addOrUpdateVisible = true;
this.addOrEditTitle = "编辑";
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
});
} else if (val.type === "delete") {
this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex)
} else if (val.type === "change") {
this.changeStatus(val.data.id)
} else {
this.otherMethods(val)
}
},
// 删除
deleteHandle(id, name, index) {
this.$confirm(`是否确认删除${name ? '名称为"' + name + '"' : '序号为"' + index + '"'}的数据项?`, "系统提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.urlOptions.deleteURL(id).then(({ data }) => {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.getDataList();
},
});
});
})
.catch(() => { });
},
//search-bar点击
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.xm1 = val.xm1;
this.listQuery.xm2 = val.xm2;
this.listQuery.pageNo = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
break;
default:
console.log(val)
}
},
handleCancel() {
this.$refs[this.addOrUpdate].formClear()
this.addOrUpdateVisible = false
this.addOrEditTitle = ''
this.addOrUpdate = 'addOrUpdate'
},
handleConfirm() {
this.$refs[this.addOrUpdate].dataFormSubmit()
},
successSubmit() {
this.handleCancel()
this.getDataList()
},
/** 导出按钮操作 */
handleExport(data) {
// 处理查询参数
let params = data?{ ...data }:{ ...this.listQuery };
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
this.exportLoading = true;
return this.urlOptions.exportURL(params);
}).then(response => {
this.$download.excel(response, '报表.xls');
this.exportLoading = false;
}).catch(() => { });
}
}
}

View File

@ -0,0 +1,79 @@
/*
* @Date: 2020-12-29 16:49:28
* @LastEditors: zwq
* @LastEditTime: 2023-12-07 10:00:51
* @FilePath: \basic-admin\src\filters\basicData\index.js
* @Description:
*/
const table = {
lineStatus: {
1: '生产中',
2: '停止',
3: '未知',
},
deactivate: {
1: '启用',
0: '停用',
},
wareType: {
1: '缓存',
2: '活动',
3: '其它',
},
reportType: {
2: '日',
3: '周',
4: '月',
5: '年',
},
}
// 日期格式化
export function parseTime(time, pattern) {
if (arguments.length === 0 || !time) {
return null
}
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
let date
if (typeof time === 'object') {
date = time
} else {
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
time = parseInt(time)
} else if (typeof time === 'string') {
time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.\d{3}/gm),'');
}
if ((typeof time === 'number') && (time.toString().length === 10)) {
time = time * 1000
}
date = new Date(time)
}
const formatObj = {
y: date.getFullYear(),
m: date.getMonth() + 1,
d: date.getDate(),
h: date.getHours(),
i: date.getMinutes(),
s: date.getSeconds(),
a: date.getDay()
}
const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => {
let value = formatObj[key]
// Note: getDay() returns 0 on Sunday
if (key === 'a') {
return ['日', '一', '二', '三', '四', '五', '六'][value]
}
if (result.length > 0 && value < 10) {
value = '0' + value
}
return value || 0
})
return time_str
}
export default function (dictTable) {
return function (val) {
return table?.[dictTable]?.[val]
}
}

View File

@ -0,0 +1,23 @@
<!--
* @Author: zwq
* @Date: 2023-12-05 13:45:59
* @LastEditors: zwq
* @LastEditTime: 2023-12-06 15:54:40
* @Description
-->
<template>
<div>
<span>{{ parseTime(injectData.enableTime,'{y}年{m}月{d}日') + '-' + (parseTime(injectData.disableTime)?parseTime(injectData.disableTime,'{y}年{m}月{d}日'):'永久') }}</span>
</div>
</template>
<script>
export default {
name: '',
props: {
injectData: {
type: Object,
default: () => ({}),
},
},
};
</script>

View File

@ -0,0 +1,166 @@
<!--
* @Author: zwq
* @Date: 2023-08-01 13:52:10
* @LastEditors: zwq
* @LastEditTime: 2023-12-05 15:41:39
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
v-if="visible"
@keyup.enter.native="dataFormSubmit()"
label-width="100px"
label-position="top">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="原料名称" prop="materialId">
<el-select
v-model="dataForm.materialId"
filterable
clearable
@change="setCode"
:style="{ width: '100%' }"
placeholder="请选择原料名称">
<el-option
v-for="item in MaterialList"
: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="grade">
<el-select
v-model="dataForm.grade"
filterable
clearable
:style="{ width: '100%' }"
placeholder="请选择原料等级">
<el-option
v-for="item in urlOptions.dictList.dict0"
:key="item.id"
:label="item.label"
:value="parseInt(item.value)"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="原料编码" prop="code">
<el-input v-model="dataForm.code" clearable readonly />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单价" prop="price">
<el-input-number
:min="0"
style="width: 80%"
v-model="dataForm.price"
clearable
placeholder="请输入允许留存时间" />
(/)
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="生效开始时间" prop="enabledTime">
<el-date-picker
v-model="dataForm.enabledTime"
type="datetime"
value-format="timestamp"
:style="{ width: '100%' }"
placeholder="选择开始时间"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="生效结束时间" prop="disabledTime">
<el-date-picker
v-model="dataForm.disabledTime"
type="datetime"
value-format="timestamp"
:style="{ width: '100%' }"
placeholder="选择结束时间"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
clearable
placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '../mixins/basic-add';
import {
createCostMaterialSet,
updateCostMaterialSet,
getCostMaterialSet,
} from '@/api/cost/costMaterialSet';
import { getHotMaterialList } from '@/api/base/coreHotMaterial';
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
getDictList: true,
createURL: createCostMaterialSet,
updateURL: updateCostMaterialSet,
infoURL: getCostMaterialSet,
getOption: true,
},
nameList: ['material_grade'],
dataForm: {
id: undefined,
code: '',
materialId: '',
price: '',
grade: '',
enabledTime: new Date().getTime(),
disabledTime: null,
remark: '',
},
setData: true,
MaterialList: [],
dataRule: {
materialId: [
{ required: true, message: '原料不能为空', trigger: 'change' },
],
price: [{ required: true, message: '单价不能为空', trigger: 'blur' }],
enabledTime: [
{
required: true,
message: '生效开始时间不能为空',
trigger: 'change',
},
],
},
};
},
created() {},
methods: {
getArr() {
getHotMaterialList().then((response) => {
this.MaterialList = response.data;
});
},
setDataForm() {
this.setCode();
},
setCode() {
this.MaterialList.forEach((item) => {
if (item.id === this.dataForm.materialId) {
this.dataForm.code = item.code;
}
});
},
},
};
</script>

View File

@ -0,0 +1,186 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="40%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../mixins/basic-page';
import { parseTime } from '../mixins/code-filter';
import {
deleteCostMaterialSet,
getCostMaterialSetPage,
} from '@/api/cost/costMaterialSet';
import { getHotMaterialList } from '@/api/base/coreHotMaterial';
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'rawMaterialName',
label: '原料名称',
},
{
prop: 'code',
label: '原料编码',
width: 190,
},
{
prop: 'grade',
label: '原料等级',
filter: publicFormatter('material_grade'),
},
{
prop: 'dailyUse',
label: '单日消耗量(天)吨',
width: 130,
},
{
prop: 'price',
label: '单价(元/吨)',
align: 'right',
},
{
prop: 'enabledTime',
label: '生效时间',
filter: parseTime,
width: 150,
},
{
prop: 'remark',
label: '备注',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getCostMaterialSetPage,
deleteURL: deleteCostMaterialSet,
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`cost:rawMaterialConfig:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`cost:rawMaterialConfig:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v) => v),
tableData: [],
formConfig: [
{
type: 'select',
label: '原料名称',
selectOptions: [],
param: 'name',
filterable: true,
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('cost:rawMaterialConfig:create')
? 'button'
: '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
],
};
},
components: {
AddOrUpdate,
},
created() {
getHotMaterialList().then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.materialId = val.name;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@ -0,0 +1,166 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData"></base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
</div>
</template>
<script>
import basicPage from '../mixins/basic-page';
import connectTime from '../mixins/connectTime';
import {
getCostMaterialSearchPage,
exportCostMaterialSearch,
} from '@/api/cost/costMaterialAutoReport';
import { getHotMaterialList } from '@/api/base/coreHotMaterial';
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'rawMaterialName',
label: '原料名称',
},
{
prop: 'grade',
label: '原料等级',
filter: publicFormatter('material_grade'),
},
{
prop: 'price',
label: '单价(元/吨)',
align: 'right',
},
{
prop: 'reportName',
label: '单价生效时间',
minWidth: 190,
subcomponent: connectTime,
},
{
prop: 'totalUsed',
label: '累计使用量(吨)',
},
{
prop: 'totalCost',
label: '总价(元)',
align: 'right',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getCostMaterialSearchPage,
exportURL: exportCostMaterialSearch,
},
tableData: [],
tableProps,
drawerVisible: false,
formConfig: [
{
type: 'select',
label: '原料名称',
selectOptions: [],
param: 'materialId',
filterable: true,
},
{
type: 'datePicker',
label: '时间范围',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: this.$auth.hasPermi('cost:rawMaterialCost:export')
? 'button'
: '',
btnName: '导出',
name: 'export',
color: 'primary',
plain: true,
},
],
};
},
components: {},
created() {
getHotMaterialList().then((response) => {
this.formConfig[0].selectOptions = response.data;
});
},
methods: {
//
getDataList() {
if (this.listQuery.searchTime) {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then((response) => {
if (response.hasOwnProperty('data')) {
this.tableData = response.data.list;
this.listQuery.total = response.data.total;
}
this.dataListLoading = false;
});
} else {
this.$message.warning('请选择时间范围');
}
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.materialId = val.materialId;
this.listQuery.searchTime = val.searchTime ? val.searchTime[0] : null;
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;
this.getDataList();
break;
case 'export':
this.listQuery.materialId = val.materialId;
this.listQuery.searchTime = val.searchTime ? val.searchTime[0] : null;
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,170 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData"></base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
</div>
</template>
<script>
import basicPage from '../mixins/basic-page';
import codeFilter from '../mixins/code-filter';
import {
getCostMaterialAutoReportPage,
exportCostMaterialAutoReportExcel,
} from '@/api/cost/costMaterialAutoReport';
import { getHotMaterialList } from '@/api/base/coreHotMaterial';
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'reportType',
label: '维度',
filter: codeFilter('reportType'),
},
{
prop: 'reportName',
label: '时间',
minWidth: 150,
},
{
prop: 'rawMaterialName',
label: '原料名称',
},
{
prop: 'grade',
label: '原料等级',
filter: publicFormatter('material_grade'),
},
{
prop: 'price',
label: '单价(元/吨)',
align: 'right',
},
{
prop: 'totalUsed',
label: '累计使用量(吨)',
},
{
prop: 'totalCost',
label: '总价(元)',
align: 'right',
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getCostMaterialAutoReportPage,
exportURL: exportCostMaterialAutoReportExcel
},
tableData: [],
tableProps,
drawerVisible: false,
listQuery: {
reportType: 2,
},
formConfig: [
{
type: 'select',
label: '维度',
selectOptions: [
{ id: 2, name: '日' },
{ id: 3, name: '周' },
{ id: 4, name: '月' },
{ id: 5, name: '年' },
],
param: 'reportType',
filterable: true,
defaultSelect: 2, //
clearable: false,
},
{
type: 'select',
label: '原料名称',
selectOptions: [],
param: 'materialId',
filterable: true,
},
{
type: 'datePicker',
label: '时间范围',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: this.$auth.hasPermi('cost:rawMaterialCostHis:export')
? 'button'
: '',
btnName: '导出',
name: 'export',
color: 'primary',
plain: true,
},
],
};
},
components: {},
created() {
getHotMaterialList().then((response) => {
this.formConfig[1].selectOptions = response.data;
});
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.reportType = val.reportType;
this.listQuery.materialId = val.materialId;
this.listQuery.times = val.searchTime ? val.searchTime : null;
this.getDataList();
break;
case 'export':
this.listQuery.reportType = val.reportType;
this.listQuery.materialId = val.materialId;
this.listQuery.times = val.searchTime ? val.searchTime : null;
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -221,18 +221,30 @@ export default {
timeSelect() { timeSelect() {
switch (this.queryParams.timeDim) { switch (this.queryParams.timeDim) {
case '1': case '1':
if (!this.timeValue) {
this.$modal.msgError('时间范围不能为空')
return false
}
if (this.timeValue[1] - this.timeValue[0] > 7*24*3600000) { if (this.timeValue[1] - this.timeValue[0] > 7*24*3600000) {
this.$modal.msgError('最大时间范围为7天请重新选择') this.$modal.msgError('最大时间范围为7天请重新选择')
this.timeValue = [] this.timeValue = []
} }
break break
case '2': case '2':
if (!this.dateValue) {
this.$modal.msgError('时间范围不能为空')
return false
}
if (this.dateValue[1] - this.dateValue[0] > 29*24*3600000) { if (this.dateValue[1] - this.dateValue[0] > 29*24*3600000) {
this.$modal.msgError('最大时间范围为30天请重新选择') // 0:00:0023:59:59 this.$modal.msgError('最大时间范围为30天请重新选择') // 0:00:0023:59:59
this.dateValue = [] this.dateValue = []
} }
break break
case '4': case '4':
if (!this.monthValue) {
this.$modal.msgError('时间范围不能为空')
return false
}
if (this.monthValue[1] - this.monthValue[0] > 729*24*3600000) { if (this.monthValue[1] - this.monthValue[0] > 729*24*3600000) {
this.$modal.msgError('最大时间范围为24个月请重新选择')// this.$modal.msgError('最大时间范围为24个月请重新选择')//
this.monthValue = [] this.monthValue = []
@ -338,7 +350,7 @@ export default {
} }
switch (this.queryParams.timeDim) { switch (this.queryParams.timeDim) {
case '1': case '1':
if (this.timeValue.length > 0) { if (this.timeValue && this.timeValue.length > 0) {
this.queryParams.startTime = this.timeValue[0] this.queryParams.startTime = this.timeValue[0]
this.queryParams.endTime = this.timeValue[1] // this.queryParams.endTime = this.timeValue[1] //
} else { } else {

View File

@ -8,7 +8,6 @@
<script> <script>
import * as echarts from 'echarts' import * as echarts from 'echarts'
import resize from '@/utils/chartMixins/resize' import resize from '@/utils/chartMixins/resize'
import moment from 'moment'
export default { export default {
name: "LineChart", name: "LineChart",
mixins: [resize], mixins: [resize],

View File

@ -207,18 +207,30 @@ export default {
timeSelect() { timeSelect() {
switch (this.queryParams.timeDim) { switch (this.queryParams.timeDim) {
case '1': case '1':
if (!this.timeValue) {
this.$modal.msgError('时间范围不能为空')
return false
}
if (this.timeValue[1] - this.timeValue[0] > 7*24*3600000) { if (this.timeValue[1] - this.timeValue[0] > 7*24*3600000) {
this.$modal.msgError('最大时间范围为7天请重新选择') this.$modal.msgError('最大时间范围为7天请重新选择')
this.timeValue = [] this.timeValue = []
} }
break break
case '2': case '2':
if (!this.dateValue) {
this.$modal.msgError('时间范围不能为空')
return false
}
if (this.dateValue[1] - this.dateValue[0] > 29*24*3600000) { if (this.dateValue[1] - this.dateValue[0] > 29*24*3600000) {
this.$modal.msgError('最大时间范围为30天请重新选择') // 0:00:0023:59:59 this.$modal.msgError('最大时间范围为30天请重新选择') // 0:00:0023:59:59
this.dateValue = [] this.dateValue = []
} }
break break
case '4': case '4':
if (!this.monthValue) {
this.$modal.msgError('时间范围不能为空')
return false
}
if (this.monthValue[1] - this.monthValue[0] > 729*24*3600000) { if (this.monthValue[1] - this.monthValue[0] > 729*24*3600000) {
this.$modal.msgError('最大时间范围为24个月请重新选择')// this.$modal.msgError('最大时间范围为24个月请重新选择')//
this.monthValue = [] this.monthValue = []
@ -307,7 +319,7 @@ export default {
} }
switch (this.queryParams.timeDim) { switch (this.queryParams.timeDim) {
case '1': case '1':
if (this.timeValue.length > 0) { if (this.timeValue && this.timeValue.length > 0) {
this.queryParams.startTime = this.timeValue[0] this.queryParams.startTime = this.timeValue[0]
this.queryParams.endTime = this.timeValue[1] // this.queryParams.endTime = this.timeValue[1] //
} else { } else {
@ -316,7 +328,7 @@ export default {
} }
break break
case '2': case '2':
if (this.dateValue.length > 0) { if (this.dateValue && this.dateValue.length > 0) {
this.queryParams.startTime = this.dateValue[0] this.queryParams.startTime = this.dateValue[0]
this.queryParams.endTime = this.dateValue[1] + 86399000 // 23:59:59 this.queryParams.endTime = this.dateValue[1] + 86399000 // 23:59:59
} else { } else {
@ -336,7 +348,7 @@ export default {
} }
break break
case '4':// case '4'://
if (this.monthValue.length > 0) { if (this.monthValue && this.monthValue.length > 0) {
this.queryParams.startTime = this.monthValue[0] this.queryParams.startTime = this.monthValue[0]
this.queryParams.endTime = this.transformTime(this.monthValue[1]) this.queryParams.endTime = this.transformTime(this.monthValue[1])
} else { } else {

View File

@ -0,0 +1,149 @@
<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"
format="yyyy-MM-dd"
value-format="timestamp"
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) {
this.form.recordTime = moment().valueOf()
if (params.type === 'add') {
this.isEdit = false
} else if (params.type === 'meterReading') {
this.isEdit = false
this.form.energyTypeId = params.energyTypeId
this.form.tableName = params.tableName + ''
}else {
this.isEdit = true
this.form.id = params.id
energyQuantityManualGet({id: this.form.id}).then(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("抄表数单位不能为空");
return false
}
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,309 @@
<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, parseTimeTable } from '@/utils/ruoyi'
// import FileSaver from "file-saver"
// import * as XLSX from 'xlsx/xlsx.mjs'
import EnergyQuantityManualAdd from './components/energyQuantityManualAdd'
import moment from 'moment'
const tableProps = [
{
prop: 'energyType',
label: '能源类型',
minWidth: 110,
showOverflowtooltip: true
},
{
prop: 'tableName',
label: '水/气表名',
filter: publicFormatter('table_name'),
minWidth: 110
},
{
prop: 'recordTime',
label: '抄表日期',
filter: parseTimeTable('{y}-{m}-{d}'),
minWidth: 110
},
{
prop: 'readingQuantity',
label: '抄表值'
},
{
prop: 'recordTimeLast',
label: '上期抄表日期',
filter: parseTimeTable('{y}-{m}-{d}'),
minWidth: 110
},
{
prop: 'readingQuantityLast',
label: '上期抄表值',
minWidth: 110
},
{
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
].filter((v)=>v),
//
queryParams: {
pageNo: 1,
pageSize: 20,
energyTypeId: '',
recordTime: []
},
energyTypeList: [],
exportList: [],
addOrEditTitle: '',
centervisible: false,
};
},
components: { EnergyQuantityManualAdd },
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')).valueOf()
this.formConfig[1].defaultSelect = [start, end]
this.queryParams.recordTime[0] = start
this.queryParams.recordTime[1] = end
this.getList();
this.getTypeList()
},
methods: {
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.energyTypeId = val.data.energyTypeId
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,12 +1,13 @@
<template> <template>
<el-popover placement="right" width="400" trigger="click"> <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 :data="tableData" v-if='tableProps.length'>
<el-table-column <el-table-column
v-for='item in tableProps' v-for='item in tableProps'
:key="item.prop" :key="item.prop"
:prop="item.prop" :prop="item.prop"
:label="item.label" :label="item.label"
:align="item.align ? item.align : 'left'" :align="item.align ? item.align : 'left'"
width="120"> width="120">
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -70,7 +71,8 @@ export default {
tableProps: [], tableProps: [],
singlePrice:'', singlePrice:'',
temp1, temp1,
temp2 temp2,
dim: ''
} }
}, },
methods: { methods: {
@ -78,7 +80,6 @@ export default {
let id = data.id let id = data.id
getEnergyType(id).then((res) => { getEnergyType(id).then((res) => {
if (res.code === 0) { if (res.code === 0) {
console.log(res)
if (res.data.pricingMethod === 0) { if (res.data.pricingMethod === 0) {
this.tableProps = this.temp1 this.tableProps = this.temp1
this.singlePrice = '' this.singlePrice = ''
@ -87,6 +88,7 @@ export default {
item.price = item.price.toFixed(2) item.price = item.price.toFixed(2)
} }
this.tableData = arr1 this.tableData = arr1
this.dim = ''
} else if (res.data.pricingMethod === 1) { } else if (res.data.pricingMethod === 1) {
this.tableProps = this.temp2 this.tableProps = this.temp2
this.singlePrice = '' this.singlePrice = ''
@ -95,10 +97,12 @@ export default {
item.price = item.price.toFixed(2) item.price = item.price.toFixed(2)
} }
this.tableData = arr2 this.tableData = arr2
this.dim = res.data.dim
} else { } else {
this.tableProps = [] this.tableProps = []
this.tableData = [] this.tableData = []
this.singlePrice = res.data.singlePrice this.singlePrice = res.data.singlePrice
this.dim = ''
} }
} }
}) })

View File

@ -22,7 +22,6 @@ export default {
}, },
methods: { methods: {
changeInput() { changeInput() {
console.log(this.list)
this.$emit('emitData', this.list) this.$emit('emitData', this.list)
} }
} }

View File

@ -28,7 +28,6 @@ export default {
}, },
methods: { methods: {
changeInput() { changeInput() {
console.log(this.list)
this.$emit('emitData', this.list) this.$emit('emitData', this.list)
} }
} }

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-input-number v-model="form.singlePrice" :precision="2" :min="0" :max="999999999" style="width: 100%;"></el-input-number>
</el-form-item> </el-form-item>
</el-col> </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-col :span="24" v-show="form.pricingMethod === 0">
<el-form-item label="时间段" prop="pricingMethod"> <el-form-item label="时间段" prop="pricingMethod">
<base-table <base-table
@ -213,10 +221,10 @@ export default {
// //
emitButtonClick1() { emitButtonClick1() {
let n = this.tableData1.length let n = this.tableData1.length
if (n >=3) { // if (n >=3) {
this.$modal.msgWarning('最多可添加3档计价') // this.$modal.msgWarning('3')
return false // return false
} // }
let obj = {} let obj = {}
obj.startTime = n === 0 ? '' : this.tableData1[n-1].endTime obj.startTime = n === 0 ? '' : this.tableData1[n-1].endTime
obj.endTime = '' obj.endTime = ''
@ -289,6 +297,7 @@ export default {
unit: this.form.unit, unit: this.form.unit,
pricingMethod: this.form.pricingMethod, pricingMethod: this.form.pricingMethod,
description: this.form.description, description: this.form.description,
dim: this.form.pricingMethod === 1 ? this.form.dim: '',
singlePrice: this.form.pricingMethod === 2 ? this.form.singlePrice : '', singlePrice: this.form.pricingMethod === 2 ? this.form.singlePrice : '',
segPriceList: this.form.pricingMethod === 0 ? this.tableData1: [], segPriceList: this.form.pricingMethod === 0 ? this.tableData1: [],
usedPriceList: this.form.pricingMethod === 1 ? this.tableData2: [] usedPriceList: this.form.pricingMethod === 1 ? this.tableData2: []
@ -305,6 +314,7 @@ export default {
unit: this.form.unit, unit: this.form.unit,
pricingMethod: this.form.pricingMethod, pricingMethod: this.form.pricingMethod,
description: this.form.description, description: this.form.description,
dim: this.form.pricingMethod === 1 ? this.form.dim: '',
singlePrice: this.form.pricingMethod === 2 ? this.form.singlePrice : '', singlePrice: this.form.pricingMethod === 2 ? this.form.singlePrice : '',
segPriceList: this.form.pricingMethod === 0 ? this.tableData1: [], segPriceList: this.form.pricingMethod === 0 ? this.tableData1: [],
usedPriceList: this.form.pricingMethod === 1 ? this.tableData2: [] 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-form ref="form" :rules="rules" label-width="110px" :model="form">
<el-row> <el-row>
<el-col :span="12"> <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-form-item label="监控对象" prop="objectId">
<el-cascader <el-cascader
style='width: 100%;' style='width: 100%;'
@ -13,8 +25,20 @@
clearable></el-cascader> clearable></el-cascader>
</el-form-item> </el-form-item>
</el-col> </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-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-select v-model="form.energyTypeId" placeholder="请选择" style="width: 100%;" filterable @change="toggleType">
<el-option <el-option
v-for="item in this.energyTypeList" v-for="item in this.energyTypeList"
@ -25,11 +49,29 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span="12" v-if='form.method == 1'>
<el-row> <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-col :span="12">
<el-form-item label="指标类型" prop="limitType"> <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 <el-option
v-for="item in getDictDatas(DICT_TYPE.MONITOR_INDEX_TYPE)" v-for="item in getDictDatas(DICT_TYPE.MONITOR_INDEX_TYPE)"
:key="item.value" :key="item.value"
@ -39,34 +81,12 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </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-col :span="12">
<el-form-item label="消耗量阈值"> <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.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-input-number v-model="form.maxValue" placeholder="最大值" :max="9999999" style="width: 50%;"></el-input-number>
</el-form-item> </el-form-item>
</el-col> </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-row>
</el-form> </el-form>
</template> </template>
@ -91,6 +111,7 @@ export default {
return { return {
form: { form: {
id: '', id: '',
method: '1',
objectId: '', objectId: '',
objectType: '', objectType: '',
energyTypeId: '', energyTypeId: '',
@ -103,7 +124,8 @@ export default {
objIds: [],// objIds: [],//
isEdit: false, // isEdit: false, //
rules: { 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' }], energyTypeId: [{ required: true, message: '能源类型不能为空', trigger: 'change' }],
type: [{ required: true, message: '监控模式不能为空', trigger: 'change' }], type: [{ required: true, message: '监控模式不能为空', trigger: 'change' }],
limitType: [{ required: true, message: '指标类型不能为空', trigger: 'change' }] limitType: [{ required: true, message: '指标类型不能为空', trigger: 'change' }]
@ -120,6 +142,7 @@ export default {
if (res.code === 0) { if (res.code === 0) {
this.form = res.data this.form = res.data
this.form.plcParamId = res.data.plcParamId || '' this.form.plcParamId = res.data.plcParamId || ''
this.form.method = this.form.method ? this.form.method + '' : ''
this.form.limitType = this.form.limitType ? this.form.limitType + '' : '' this.form.limitType = this.form.limitType ? this.form.limitType + '' : ''
this.objIds = this.changeDetSelect(this.form.objectId, this.objList) this.objIds = this.changeDetSelect(this.form.objectId, this.objList)
if (this.form.type === 2) { if (this.form.type === 2) {
@ -132,6 +155,14 @@ export default {
this.form.id = '' this.form.id = ''
} }
}, },
//
changeMethod() {
if(this.form.method === '2'){
this.form.limitType = "2"
}else{
this.form.limitType = ''
}
},
// //
getDetailList() { getDetailList() {
getEnergyParamList({ getEnergyParamList({

View File

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

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="app-container"> <div class="app-container energyOverlimitLog">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar
@ -7,14 +7,29 @@
ref="searchBarForm" ref="searchBarForm"
@headBtnClick="buttonClick" @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>
<!-- 列表 --> <!-- 列表 -->
<base-table <div v-if="activeName === 'auto'">
:page="queryParams.pageNo" <base-table
:limit="queryParams.pageSize" :page="queryParams.pageNo"
:table-props="tableProps" :limit="queryParams.pageSize"
:table-data="list" :table-props="tableProps"
:max-height="tableH" :table-data="list"
/> :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 <pagination
:page.sync="queryParams.pageNo" :page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@ -28,6 +43,7 @@
import { getEnergyOverlimitLogPage } from "@/api/monitoring/energyOverlimitLog"; import { getEnergyOverlimitLogPage } from "@/api/monitoring/energyOverlimitLog";
import { getEnergyTypeListAll } from "@/api/base/energyType"; import { getEnergyTypeListAll } from "@/api/base/energyType";
import { publicFormatter } from '@/utils/dict' import { publicFormatter } from '@/utils/dict'
import { parseTime } from '@/utils/ruoyi'
const tableProps = [ const tableProps = [
{ {
prop: 'objName', prop: 'objName',
@ -65,6 +81,41 @@ const tableProps = [
{ {
prop: 'overValue', prop: 'overValue',
label: '超出值' 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 { export default {
@ -93,18 +144,20 @@ export default {
color: 'primary' color: 'primary'
} }
], ],
activeName: 'auto',
tableProps, tableProps,
tableProps2,
tableH: this.tableHeight(260), tableH: this.tableHeight(260),
//
total: 0, total: 0,
//
list: [], list: [],
list2: [],
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 20, pageSize: 20,
energyTypeId: '', energyTypeId: '',
indexType: '' indexType: '',
method: '1'
}, },
typeList: [ typeList: [
{id: 1, name: '合并'}, {id: 1, name: '合并'},
@ -155,7 +208,47 @@ export default {
console.log(res) console.log(res)
this.formConfig[0].selectOptions = res.data || [] 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> </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

@ -27,20 +27,20 @@
<div class="legend"> <div class="legend">
<div class="legend-item"> <div class="legend-item">
<span class="icon blue"></span> <span class="icon blue"></span>
<span class="text">工作时长</span> <span class="text">有效时长</span>
</div> </div>
<div class="legend-item"> <div class="legend-item">
<span class="icon green"></span> <span class="icon green"></span>
<span class="text">机时长</span> <span class="text">机时长</span>
</div> </div>
<div class="legend-item"> <div class="legend-item">
<span class="icon purple"></span> <span class="icon purple"></span>
<span class="text">故障时长</span> <span class="text">中断时长</span>
</div> </div>
<div class="legend-item"> <!-- <div class="legend-item">
<span class="icon yellow"></span> <span class="icon yellow"></span>
<span class="text">速度开动率</span> <span class="text">速度开动率</span>
</div> </div> -->
</div> </div>
<div v-if="list.length" class="graph-grid"> <div v-if="list.length" class="graph-grid">
<div class="bg-grid grid-line"> <div class="bg-grid grid-line">
@ -389,14 +389,14 @@ export default {
position: relative; position: relative;
padding: 4px 0; padding: 4px 0;
padding-left: 12px; padding-left: 12px;
font-size: 14px; font-size: 18px;
&::before { &::before {
content: ''; content: '';
position: absolute; position: absolute;
left: 0; left: 0;
top: 6px; top: 6px;
height: 16px; height: 20px;
width: 4px; width: 4px;
border-radius: 1px; border-radius: 1px;
background: #0b58ff; background: #0b58ff;

View File

@ -16,23 +16,22 @@
<div class="data-view__item"> <div class="data-view__item">
<!-- <div class="data-view__item__value">111</div> --> <!-- <div class="data-view__item__value">111</div> -->
<div class="data-view__item__value">{{ textData.workTime }}</div> <div class="data-view__item__value">{{ textData.workTime }}</div>
<div class="data-view__item__title blue">工作时长</div> <div class="data-view__item__title blue">有效时长</div>
</div> </div>
<div class="data-view__item"> <div class="data-view__item">
<!-- <div class="data-view__item__value">22</div> --> <!-- <div class="data-view__item__value">22</div> -->
<div class="data-view__item__value">{{ textData.stopTime }}</div> <div class="data-view__item__value">{{ textData.stopTime }}</div>
<div class="data-view__item__title green">机时长</div> <div class="data-view__item__title green">机时长</div>
</div> </div>
<div class="data-view__item"> <div class="data-view__item">
<!-- <div class="data-view__item__value">10</div> --> <!-- <div class="data-view__item__value">10</div> -->
<div class="data-view__item__value">{{ textData.downTime }}</div> <div class="data-view__item__value">{{ textData.downTime }}</div>
<div class="data-view__item__title purple">故障时长</div> <div class="data-view__item__title purple">中断时长</div>
</div> </div>
<div class="data-view__item"> <!-- <div class="data-view__item">
<!-- <div class="data-view__item__value">100%</div> -->
<div class="data-view__item__value">{{ textData.peEfficiency }}</div> <div class="data-view__item__value">{{ textData.peEfficiency }}</div>
<div class="data-view__item__title yellow">速度开动率</div> <div class="data-view__item__title yellow">速度开动率</div>
</div> </div> -->
</div> </div>
</div> </div>
</template> </template>
@ -93,7 +92,7 @@ export default {
// //
name: '', name: '',
type: 'pie', type: 'pie',
radius: ['75%', '90%'], radius: ['60%', '90%'],
center: ['50%', '48%'], center: ['50%', '48%'],
label: { label: {
show: false, show: false,
@ -259,7 +258,7 @@ export default {
} }
.data-view__item__title { .data-view__item__title {
font-size: 8px; font-size: 14px;
line-height: 14px; line-height: 14px;
} }

View File

@ -19,6 +19,7 @@
:page="1" :page="1"
:limit="10" :limit="10"
:table-data="list" :table-data="list"
height="65vh"
@emitFun="handleEmitFun" /> @emitFun="handleEmitFun" />
<!-- <el-row> <!-- <el-row>
@ -122,23 +123,24 @@ export default {
// : undefined, // : undefined,
// ].filter((v) => v), // ].filter((v) => v),
tableProps: [ tableProps: [
{ prop: 'factoryName', label: '工厂' }, { prop: 'factoryName', label: '工厂', showOverflowtooltip: true },
{ prop: 'lineName', label: '产线' }, { prop: 'lineName', label: '产线', showOverflowtooltip: true },
{ prop: 'sectionName', label: '工段' }, { prop: 'sectionName', label: '工段', showOverflowtooltip: true },
{ prop: 'equipmentName', label: '设备' }, { prop: 'equipmentName', label: '设备', showOverflowtooltip: true },
{ {
label: '有效时间', label: '有效时间',
children: [ children: [
{ {
width: 128, width: 128,
prop: 'workTime', prop: 'workTime',
label: '工作时长[h]', label: '工作时长(h)',
filter: (val) => (val != null ? +Number(val).toFixed(2) : '-'),
}, },
{ {
width: 128, width: 128,
prop: 'workRate', prop: 'workRate',
label: '百分比[%]', label: '百分比(%)',
filter: (val) => (val != null ? +Number(val).toFixed(3) : '-'), filter: (val) => (val != null ? +Number(val).toFixed(0) : '-'),
}, },
], ],
}, },
@ -148,9 +150,10 @@ export default {
{ {
width: 128, width: 128,
prop: 'stopTime', prop: 'stopTime',
label: '停机时长[h]', label: '停机时长(h)',
filter: (val) => (val != null ? +Number(val).toFixed(0) : '-'),
}, },
{ width: 128, prop: 'stopRate', label: '百分比[%]' }, { width: 128, prop: 'stopRate', label: '百分比(%)', filter: (val) => (val != null ? +Number(val).toFixed(0) : '-'), },
], ],
}, },
{ {
@ -159,48 +162,52 @@ export default {
{ {
width: 128, width: 128,
prop: 'downTime', prop: 'downTime',
label: '故障时长[h]', label: '故障时长(h)',
filter: (val) => (val != null ? +val.toFixed(3) : '-'), filter: (val) => (val != null ? +val.toFixed(2) : '-'),
}, },
{ width: 128, prop: 'downRate', label: '百分比[%]' }, { width: 128, prop: 'downRate', label: '百分比(%)', filter: (val) => (val != null ? +Number(val).toFixed(0) : '-'), },
{ {
width: 128, width: 128,
prop: 'timeEfficiency', prop: 'timeEfficiency',
label: '时间开动率', label: '时间开动率',
filter: (val) => (val != null ? +Number(val).toFixed(3) : '-'), filter: (val) => (val != null ? +Number(val).toFixed(2) : '-'),
}, },
], ],
}, },
{ {
label: '速度损失', label: '速度损失',
showOverflowtooltip: true,
children: [ children: [
{ {
width: 128, width: 128,
prop: 'realProcSpeed', prop: 'realProcSpeed',
label: '实际加工速度', label: '实际加工速度',
filter: (val) => (val != null ? +Number(val).toFixed(2) : '-'),
}, },
{ {
width: 128, width: 128,
prop: 'designProcSpeed', prop: 'designProcSpeed',
label: '理论加工速度', label: '理论加工速度',
showOverflowtooltip: true,
filter: (val) => (val != null ? +Number(val).toFixed(2) : '-'),
}, },
{ {
width: 128, width: 128,
prop: 'peEfficiency', prop: 'peEfficiency',
label: '速度开动率', label: '速度开动率',
filter: (val) => (val != null ? +Number(val).toFixed(3) : '-'), filter: (val) => (val != null ? +Number(val).toFixed(2) : '-'),
}, },
], ],
}, },
{ {
prop: 'oee', prop: 'oee',
label: 'OEE', label: 'OEE',
filter: (val) => (val != null ? +Number(val).toFixed(3) : '-'), filter: (val) => (val != null ? +Number(val).toFixed(2) : '-'),
}, },
{ {
prop: 'teep', prop: 'teep',
label: 'TEEP', label: 'TEEP',
filter: (val) => (val != null ? +Number(val).toFixed(3) : '-'), filter: (val) => (val != null ? +Number(val).toFixed(2) : '-'),
}, },
// { // {
// _action: 'view-trend', // _action: 'view-trend',
@ -433,6 +440,9 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.app-container {
overflow: inherit;
}
.visualization { .visualization {
display: grid; display: grid;
grid-template-columns: repeat(3, minmax(240px, 1fr)); grid-template-columns: repeat(3, minmax(240px, 1fr));

View File

@ -94,7 +94,7 @@ export default {
return { return {
readOnly: false, readOnly: false,
chosedLogId: false, chosedLogId: false,
searchBarKeys: ['equipmentName', 'recordTime'], searchBarKeys: ['equipmentName', 'createTime'],
tableBtn: [ tableBtn: [
// this.$auth.hasPermi('equipment:spare-parts-config:update') // this.$auth.hasPermi('equipment:spare-parts-config:update')
// ? { // ? {
@ -124,11 +124,11 @@ export default {
label: '报警级别', label: '报警级别',
filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL), filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL),
}, },
{ prop: 'createTime', label: '报警时间', filter: timeFilter }, // { prop: 'createTime', label: '报警时间', filter: timeFilter },
{ prop: 'alarmCode', label: '设备报警码' }, // { prop: 'alarmCode', label: '设备报警码' },
{ prop: 'alarmContent', label: '报警内容' }, { prop: 'alarmContent', label: '报警内容' },
{ prop: 'opt1', label: '处理记录', name: '查看', subcomponent: btn }, { prop: 'opt1', label: '处理记录', name: '查看', subcomponent: btn },
{ prop: 'opt2', label: '处理', name: '报警处理', subcomponent: btn }, // TODO: { prop: 'opt2', label: '处理', name: '报警处理', subcomponent: btn },
// { prop: 'remark', label: '' }, // { prop: 'remark', label: '' },
], ],
searchBarFormConfig: [ searchBarFormConfig: [
@ -145,8 +145,8 @@ export default {
dateType: 'daterange', // datetimerange dateType: 'daterange', // datetimerange
// format: 'yyyy-MM-dd HH:mm:ss', // format: 'yyyy-MM-dd HH:mm:ss',
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
valueFormat: 'timestamp', // valueFormat: 'timestamp',
// valueFormat: 'yyyy-MM-dd HH:mm:ss', valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-', rangeSeparator: '-',
startPlaceholder: '开始日期', startPlaceholder: '开始日期',
endPlaceholder: '结束日期', endPlaceholder: '结束日期',

View File

@ -84,10 +84,10 @@ export default {
: undefined, : undefined,
].filter((v) => v), ].filter((v) => v),
tableProps: [ tableProps: [
{ prop: 'program', label: '巡检项目' }, { prop: 'program', label: '巡检项目', showOverflowtooltip: true },
{ prop: 'content', label: '巡检内容' }, { prop: 'content', label: '巡检内容', minWidth: 150, showOverflowtooltip: true },
{ prop: 'code', label: '巡检内容编码' }, { prop: 'code', label: '巡检内容编码', showOverflowtooltip: true },
{ prop: 'remark', label: '备注' }, { prop: 'remark', label: '备注', showOverflowtooltip: true },
], ],
searchBarFormConfig: [ searchBarFormConfig: [
{ {

View File

@ -12,7 +12,7 @@
:show-close="false" :show-close="false"
:wrapper-closable="isdetail" :wrapper-closable="isdetail"
class="drawer" class="drawer"
size="60%" size="55%"
@closed="$emit('destroy')"> @closed="$emit('destroy')">
<small-title slot="title" :no-padding="true"> <small-title slot="title" :no-padding="true">
{{ isdetail ? '查看详情' : !dataForm.id ? '新增' : '编辑' }} {{ isdetail ? '查看详情' : !dataForm.id ? '新增' : '编辑' }}
@ -24,7 +24,7 @@
label-width="100px" label-width="100px"
v-loading="formLoading"> v-loading="formLoading">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="8">
<el-form-item label="设备名称" prop="equipmentId"> <el-form-item label="设备名称" prop="equipmentId">
<el-select <el-select
v-model="dataForm.equipmentId" v-model="dataForm.equipmentId"
@ -41,7 +41,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="8">
<!-- <el-form-item label="物料名称" prop="name"> <!-- <el-form-item label="物料名称" prop="name">
<el-input v-model="dataForm.name" :disabled="isdetail" clearable placeholder="请输入物料名称" /> <el-input v-model="dataForm.name" :disabled="isdetail" clearable placeholder="请输入物料名称" />
</el-form-item> --> </el-form-item> -->
@ -61,21 +61,19 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span="8">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="设备编码" prop="equipmentCode"> <el-form-item label="设备编码" prop="equipmentCode">
<el-input v-model="dataForm.equipmentCode" disabled clearable placeholder="请输入设备编码" /> <el-input v-model="dataForm.equipmentCode" disabled clearable placeholder="请输入设备编码" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> </el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="巡检人" prop="responsible"> <el-form-item label="巡检人" prop="responsible">
<el-input v-model="dataForm.responsible" :disabled="isdetail" clearable placeholder="请输入巡检人" /> <el-input v-model="dataForm.responsible" :disabled="isdetail" clearable placeholder="请输入巡检人" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span="8">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="巡检时间" prop="actualTime"> <el-form-item label="巡检时间" prop="actualTime">
<el-date-picker <el-date-picker
v-model="dataForm.actualTime" v-model="dataForm.actualTime"
@ -86,7 +84,7 @@
placeholder="选择巡检时间" /> placeholder="选择巡检时间" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="8">
<el-form-item label="数据来源" prop="origin"> <el-form-item label="数据来源" prop="origin">
<el-select <el-select
v-model="dataForm.origin" v-model="dataForm.origin"
@ -95,7 +93,7 @@
style="width: 100%" style="width: 100%"
placeholder="请选择数据来源"> placeholder="请选择数据来源">
<el-option key="1" label="手动" :value="1" /> <el-option key="1" label="手动" :value="1" />
<el-option key="2" label="自动" :value="2" /> <el-option key="2" label="PDA" :value="2" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -108,7 +106,8 @@
:table-data="list" /> :table-data="list" />
</el-form-item> </el-form-item>
<el-form-item label="巡检详情" prop="description"> <el-form-item label="巡检详情" prop="description">
<editor v-model="dataForm.description" :read-only="isdetail" :min-height="150"/> <editor v-if="!isdetail" v-model="dataForm.description" :min-height="150"/>
<div v-else v-html="dataForm.description" style="padding: 5px; margin-left: 5px; border: 1px solid #dfdfdf" />
</el-form-item> </el-form-item>
<el-form-item label="附件"> <el-form-item label="附件">
<FileUpload v-model="file" :limit="1" :f-name="fileName" :disabled="isdetail" @name="setFileName" /> <FileUpload v-model="file" :limit="1" :f-name="fileName" :disabled="isdetail" @name="setFileName" />
@ -117,7 +116,7 @@
</el-form> </el-form>
<div v-if="!isdetail" class="drawer-body__footer"> <div v-if="!isdetail" class="drawer-body__footer">
<el-button type="primary" @click="goback()">取消</el-button> <el-button @click="goback()">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</div> </div>
</el-drawer> </el-drawer>
@ -185,7 +184,7 @@ export default {
actualTime: undefined, actualTime: undefined,
responsible: undefined, responsible: undefined,
description: undefined, description: undefined,
origin: undefined, origin: 1,
files: [] files: []
}, },
list: [], list: [],
@ -220,9 +219,12 @@ export default {
async setConfig() { async setConfig() {
const configres = await getcheckConfigByEqList({equipmentId: this.dataForm.equipmentId}) const configres = await getcheckConfigByEqList({equipmentId: this.dataForm.equipmentId})
this.configList = configres.data this.configList = configres.data
this.dataForm.configId = this.configList.filter(it => {
return it.id === this.dataForm.configId
})[0]?.id ?? undefined
this.dataForm.equipmentCode = this.eqList.filter(item => { this.dataForm.equipmentCode = this.eqList.filter(item => {
return item.id === this.dataForm.equipmentId return item.id === this.dataForm.equipmentId
})[0].code })[0]?.code ?? undefined
}, },
goback() { goback() {
this.$emit('refreshDataList'); this.$emit('refreshDataList');
@ -265,6 +267,7 @@ export default {
this.file = this.dataForm.files[0].fileUrl this.file = this.dataForm.files[0].fileUrl
this.fileName = this.dataForm.files[0].fileName this.fileName = this.dataForm.files[0].fileName
} }
this.dataForm.description = this.dataForm.description || '无'
this.setConfig() this.setConfig()
this.setInspectionContet() this.setInspectionContet()
}); });

View File

@ -94,7 +94,7 @@ export default {
tableProps: [ tableProps: [
{ prop: 'configName', label: '配置名称' }, { prop: 'configName', label: '配置名称' },
{ prop: 'equipmentName', label: '设备名称' }, { prop: 'equipmentName', label: '设备名称' },
{ prop: 'origin', label: '数据来源', filter: (val) => ['', '手动', '自动'][val] }, { prop: 'origin', label: '数据来源', filter: (val) => ['', '手动', 'PDA'][val] },
// { prop: 'sectionName', label: '' }, // { prop: 'sectionName', label: '' },
{ prop: 'actualTime', label: '实际巡检时间', filter: parseTime }, { prop: 'actualTime', label: '实际巡检时间', filter: parseTime },
// { prop: 'maintenanceDetail', label: '' }, // { prop: 'maintenanceDetail', label: '' },
@ -131,6 +131,15 @@ export default {
{ {
type: 'separate', type: 'separate',
}, },
{
type: this.$auth.hasPermi('equipment:check-record:export')
? 'button'
: '',
btnName: '导出',
name: 'export',
plain: true,
color: 'primary',
},
{ {
type: this.$auth.hasPermi('equipment:check-record:create') type: this.$auth.hasPermi('equipment:check-record:create')
? 'button' ? 'button'
@ -140,17 +149,6 @@ export default {
plain: true, plain: true,
color: 'success', color: 'success',
}, },
{
type: 'separate',
},
{
type: this.$auth.hasPermi('equipment:check-record:export')
? 'button'
: '',
btnName: '导出',
name: 'export',
color: 'warning',
},
], ],
rows: [ rows: [
[ [

View File

@ -2,14 +2,14 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2023-11-27 10:48:55 * @LastEditTime: 2023-12-01 11:02:43
* @Description: * @Description:
--> -->
<template> <template>
<el-drawer <el-drawer
:visible.sync="visible" :visible.sync="visible"
:show-close="false" :show-close="false"
:wrapper-closable="false" :wrapper-closable="true"
class="drawer" class="drawer"
size="50%"> size="50%">
<small-title slot="title" :no-padding="true"> <small-title slot="title" :no-padding="true">
@ -43,6 +43,8 @@
</el-form> </el-form>
</div> </div>
<el-divider />
<div class="attr-list"> <div class="attr-list">
<small-title <small-title
style="margin: 16px 0; padding-left: 8px" style="margin: 16px 0; padding-left: 8px"
@ -78,9 +80,9 @@
:page-sizes="[5, 10, 15]" :page-sizes="[5, 10, 15]"
@pagination="getList" /> @pagination="getList" />
<div class="drawer-body__footer"> <!-- <div class="drawer-body__footer">
<el-button type="primary" @click="goback()">关闭</el-button> <el-button type="primary" @click="goback()">关闭</el-button>
</div> </div> -->
</div> </div>
</div> </div>

View File

@ -1,7 +1,7 @@
<template> <template>
<el-dialog <el-dialog
:visible.sync="visible" :visible.sync="visible"
:width="'35%'" :width="'30%'"
:append-to-body="true" :append-to-body="true"
:close-on-click-modal="false" :close-on-click-modal="false"
class="dialog"> class="dialog">
@ -17,7 +17,7 @@
ref="dataForm" ref="dataForm"
:model="dataForm" :model="dataForm"
:rules="dataRule" :rules="dataRule"
label-width="100px" label-width="60px"
@keyup.enter.native="dataFormSubmit()"> @keyup.enter.native="dataFormSubmit()">
<el-form-item label="巡检" prop="checkId"> <el-form-item label="巡检" prop="checkId">
<el-select v-model="dataForm.checkId" filterable placeholder="请选择巡检" style="width: 100%"> <el-select v-model="dataForm.checkId" filterable placeholder="请选择巡检" style="width: 100%">

View File

@ -66,6 +66,13 @@ export default {
addOrEditTitle: '', addOrEditTitle: '',
searchBarKeys: ['equipmentId', 'name'], searchBarKeys: ['equipmentId', 'name'],
tableBtn: [ tableBtn: [
this.$auth.hasPermi('equipment:check-setting:addInsp')
? {
type: 'add',
btnName: '添加',
showTip: '添加巡检'
}
: undefined,
this.$auth.hasPermi('equipment:check-setting:update') this.$auth.hasPermi('equipment:check-setting:update')
? { ? {
type: 'edit', type: 'edit',
@ -78,12 +85,6 @@ export default {
btnName: '查看详情', btnName: '查看详情',
} }
: undefined, : undefined,
this.$auth.hasPermi('equipment:check-setting:addInsp')
? {
type: 'add',
btnName: '添加巡检',
}
: undefined,
this.$auth.hasPermi('equipment:check-setting:delete') this.$auth.hasPermi('equipment:check-setting:delete')
? { ? {
type: 'delete', type: 'delete',
@ -92,12 +93,12 @@ export default {
: undefined, : undefined,
].filter((v) => v), ].filter((v) => v),
tableProps: [ tableProps: [
{ prop: 'name', label: '配置名' }, { prop: 'name', label: '配置名', width: 110, showOverflowtooltip: true },
{ prop: 'code', label: '编码' }, { prop: 'code', label: '编码', minWidth: 150, showOverflowtooltip: true },
{ prop: 'lineName', label: '产线' }, { prop: 'lineName', label: '产线', showOverflowtooltip: true },
{ prop: 'sectionName', label: '工段' }, { prop: 'sectionName', label: '工段', showOverflowtooltip: true },
{ prop: 'equipmentName', label: '设备' }, { prop: 'equipmentName', label: '设备', showOverflowtooltip: true },
{ prop: 'equipmentCode', label: '设备编码' }, { prop: 'equipmentCode', label: '设备编码', minWidth: 150, showOverflowtooltip: true },
// { prop: 'responsible', label: '' }, // { prop: 'responsible', label: '' },
{ prop: 'checkNumber', label: '巡检条数' }, // TODO: { prop: 'checkNumber', label: '巡检条数' }, // TODO:
], ],

View File

@ -183,7 +183,7 @@ export default {
btnName: '导出', btnName: '导出',
name: 'export', name: 'export',
plain: true, plain: true,
color: 'warning', color: 'primary',
}, },
], ],
// //

View File

@ -170,7 +170,7 @@ export default {
btnName: '导出', btnName: '导出',
name: 'export', name: 'export',
plain: true, plain: true,
color: 'warning', color: 'primary',
}, },
{ {
type: this.$auth.hasPermi('equipment:maintain-record:create') type: this.$auth.hasPermi('equipment:maintain-record:create')

View File

@ -60,110 +60,112 @@
</el-col> </el-col>
</el-row> </el-row>
<el-divider style="margin-top: -10px" /> <el-divider />
<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true"> <div v-if=" disabled && dataForm.maintenanceStatus === 1 ? true : !disabled ? true : false">
{{ '设备维修信息' }} <small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
</small-title> {{ '设备维修信息' }}
<el-row :gutter="20"> </small-title>
<el-col :span="6"> <el-row :gutter="20">
<el-form-item <el-col :span="6">
label="维修开始时间" <el-form-item
prop="maintenanceStartTime" label="维修开始时间"
:rules="[{ required: true, message: '维修开始时间不能为空', trigger: 'blur' }]"> prop="maintenanceStartTime"
<el-date-picker :rules="[{ required: true, message: '维修开始时间不能为空', trigger: 'blur' }]">
v-model="dataForm.maintenanceStartTime" <el-date-picker
type="datetime" v-model="dataForm.maintenanceStartTime"
:disabled="disabled" type="datetime"
placeholder="请选择维修开始时间" :disabled="disabled"
value-format="timestamp" /> placeholder="请选择维修开始时间"
</el-form-item> value-format="timestamp" />
</el-col> </el-form-item>
<el-col :span="6"> </el-col>
<el-form-item <el-col :span="6">
label="维修结束时间" <el-form-item
prop="maintenanceFinishTime" label="维修结束时间"
:rules="[{ required: true, message: '维修结束时间不能为空', trigger: 'blur' }]"> prop="maintenanceFinishTime"
<el-date-picker :rules="[{ required: true, message: '维修结束时间不能为空', trigger: 'blur' }]">
v-model="dataForm.maintenanceFinishTime" <el-date-picker
type="datetime" v-model="dataForm.maintenanceFinishTime"
:disabled="disabled" type="datetime"
placeholder="请选择维修开始时间" :disabled="disabled"
value-format="timestamp" /> placeholder="请选择维修开始时间"
</el-form-item> value-format="timestamp" />
</el-col> </el-form-item>
<el-col :span="6"> </el-col>
<el-form-item <el-col :span="6">
label="维修方式" <el-form-item
prop="repairMode" label="维修方式"
:rules="[{ required: true, message: '维修方式不能为空', trigger: 'blur' }]"> prop="repairMode"
<el-select :rules="[{ required: true, message: '维修方式不能为空', trigger: 'blur' }]">
:disabled="disabled" <el-select
v-model="dataForm.repairMode" :disabled="disabled"
placeholder="请选择维修方式"> v-model="dataForm.repairMode"
<el-option placeholder="请选择维修方式">
v-for="opt in getDictDatas('repair-mode')" <el-option
:key="opt.value" v-for="opt in getDictDatas('repair-mode')"
:label="opt.label" :key="opt.value"
:value="opt.value" /> :label="opt.label"
</el-select> :value="opt.value" />
</el-form-item> </el-select>
</el-col> </el-form-item>
<el-col :span="6"> </el-col>
<el-form-item label="故障类型" prop="faultType"> <el-col :span="6">
<el-select <el-form-item label="故障类型" prop="faultType">
:disabled="disabled" <el-select
v-model="dataForm.faultType" :disabled="disabled"
placeholder="请选择故障类型"> v-model="dataForm.faultType"
<el-option placeholder="请选择故障类型">
v-for="opt in getDictDatas('fault-type')" <el-option
:key="opt.value" v-for="opt in getDictDatas('fault-type')"
:label="opt.label" :key="opt.value"
:value="opt.value" /> :label="opt.label"
</el-select> :value="opt.value" />
</el-form-item> </el-select>
</el-col> </el-form-item>
</el-row> </el-col>
</el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col> <el-col>
<el-form-item <el-form-item
label="故障明细" label="故障明细"
prop="faultDetail" prop="faultDetail"
:rules="[{ required: true, message: '故障明细不能为空', trigger: 'blur' }]"> :rules="[{ required: true, message: '故障明细不能为空', trigger: 'blur' }]">
<!-- // --> <!-- // -->
<editor v-model="dataForm.faultDetail" :read-only="disabled" :min-height="150"/> <editor v-model="dataForm.faultDetail" :read-only="disabled" :min-height="150"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col> <el-col>
<el-form-item label="维修记录" prop="maintenanceDetail"> <el-form-item label="维修记录" prop="maintenanceDetail">
<!-- // --> <!-- // -->
<editor v-model="dataForm.maintenanceDetail" :read-only="disabled" :min-height="150"/> <editor v-model="dataForm.maintenanceDetail" :read-only="disabled" :min-height="150"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col> <el-col>
<el-form-item label="维修附件" prop="file"> <el-form-item label="维修附件" prop="file">
<FileUpload v-model="file" :limit="1" :f-name="fileName" :disabled="disabled" @name="setFileName" /> <FileUpload v-model="file" :limit="1" :f-name="fileName" :disabled="disabled" @name="setFileName" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col> <el-col>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input <el-input
v-model="dataForm.remark" v-model="dataForm.remark"
:placeholder="`请输入备注`" :placeholder="`请输入备注`"
:disabled="disabled" /> :disabled="disabled" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</div>
</el-form> </el-form>
<div v-if="!disabled" class="drawer-body__footer"> <div v-if="!disabled" class="drawer-body__footer">
@ -249,7 +251,7 @@ export default {
getEqRepair(this.dataForm.id).then(response => { getEqRepair(this.dataForm.id).then(response => {
this.formLoading = false this.formLoading = false
this.dataForm = response.data; this.dataForm = response.data;
this.dataForm.maintenanceStatus = row.maintenanceStatus || 0 this.dataForm.maintenanceStatus = this.dataForm.maintenanceStatus || 0
if (this.dataForm.files.length > 0) { if (this.dataForm.files.length > 0) {
this.file = this.dataForm.files[0].fileUrl this.file = this.dataForm.files[0].fileUrl
this.fileName = this.dataForm.files[0].fileName this.fileName = this.dataForm.files[0].fileName

View File

@ -0,0 +1,35 @@
<!--
* @Author: zhp
* @Date: 2023-11-08 14:00:52
* @LastEditTime: 2023-12-01 10:12:27
* @LastEditors: DY
* @Description:
-->
<template>
<div v-html="content" />
</template>
<script>
export default {
props: {
injectData: {
type: Object,
default: () => ({})
}
},
data() {
return {
content: ''
}
},
mounted() {
this.getContent()
},
methods: {
getContent() {
this.content = this.injectData[this.injectData.prop] ?? ''
}
}
}
</script>

View File

@ -59,6 +59,7 @@ import basicPageMixin from '@/mixins/lb/basicPageMixin';
import CustomDialogForm from './CustomDialogForm.vue'; import CustomDialogForm from './CustomDialogForm.vue';
import { deleteRepair, exportRepairLogExcel } from '@/api/equipment/base/repair' import { deleteRepair, exportRepairLogExcel } from '@/api/equipment/base/repair'
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi'
import htmls from './htmls.vue'
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'); // const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
export default { export default {
@ -121,7 +122,7 @@ export default {
{ prop: 'lineName', label: '产线' }, { prop: 'lineName', label: '产线' },
{ prop: 'sectionName', label: '工段' }, { prop: 'sectionName', label: '工段' },
{ prop: 'equipmentName', label: '设备名称', minWidth: 100, showOverflowtooltip: true }, { prop: 'equipmentName', label: '设备名称', minWidth: 100, showOverflowtooltip: true },
{ prop: 'maintenanceDetail', label: '维修明细' }, { prop: 'maintenanceDetail', label: '维修明细', subcomponent: htmls, minWidth: 100, showOverflowtooltip: true },
{ prop: 'repairman', label: '维修工', minWidth: 100, showOverflowtooltip: true }, { prop: 'repairman', label: '维修工', minWidth: 100, showOverflowtooltip: true },
{ prop: 'repairmanPhone', label: '联系方式', minWidth: 100, showOverflowtooltip: true }, { prop: 'repairmanPhone', label: '联系方式', minWidth: 100, showOverflowtooltip: true },
{ prop: 'remark', label: '备注', minWidth: 120, showOverflowtooltip: true }, { prop: 'remark', label: '备注', minWidth: 120, showOverflowtooltip: true },
@ -168,6 +169,13 @@ export default {
{ {
type: 'separate', type: 'separate',
}, },
{
type: this.$auth.hasPermi('equipment:repair:export') ? 'button' : '',
btnName: '导出',
name: 'export',
plain: true,
color: 'primary',
},
{ {
type: this.$auth.hasPermi('equipment:repair:create') ? 'button' : '', type: this.$auth.hasPermi('equipment:repair:create') ? 'button' : '',
btnName: '新增', btnName: '新增',
@ -175,13 +183,6 @@ export default {
plain: true, plain: true,
color: 'success', color: 'success',
}, },
{
type: this.$auth.hasPermi('equipment:repair:export') ? 'button' : '',
btnName: '导出',
name: 'export',
plain: true,
color: 'warning',
},
], ],
rows: [ rows: [
[ [

View File

@ -9,72 +9,80 @@
<el-drawer <el-drawer
:visible.sync="visible" :visible.sync="visible"
:show-close="false" :show-close="false"
:wrapper-closable="false" :wrapper-closable="disabled"
class="drawer" class="drawer"
size="60%"> size="60%"
@closed="$emit('destroy')">
<small-title slot="title" :no-padding="true"> <small-title slot="title" :no-padding="true">
{{ disabled ? '查看备件' : '添加备件' }} {{ disabled ? '查看备件' : '添加备件' }}
</small-title> </small-title>
<el-form <div class="content">
ref="form" <el-form
:model="dataForm" ref="form"
label-width="100px" :model="dataForm"
v-loading="formLoading"> label-width="100px"
<el-row :gutter="20"> label-position="top"
<el-col :span="12"> v-loading="formLoading">
<el-form-item label="配置名" prop="name"> <el-row :gutter="20">
<span>{{ dataForm.name }}</span> <el-col :span="6">
</el-form-item> <el-form-item label="配置名" prop="name">
</el-col> <span>{{ dataForm.name }}</span>
<el-col :span="12"> </el-form-item>
<el-form-item label="设备名称" prop="equipmentName"> </el-col>
<span>{{ dataForm.equipmentName }}</span> <el-col :span="6">
</el-form-item> <el-form-item label="设备名称" prop="equipmentName">
</el-col> <span>{{ dataForm.equipmentName }}</span>
</el-row> </el-form-item>
<el-row :gutter="20"> </el-col>
<el-col :span="12"> <el-col :span="6">
<el-form-item label="负责人" prop="responsible"> <el-form-item label="负责人" prop="responsible">
<span>{{ dataForm.responsible }}</span> <span>{{ dataForm.responsible }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-form-item label="描述" prop="faultTime"> <el-form-item label="描述" prop="description">
<editor v-model="dataForm.description" read-only :min-height="200"/> <div v-html="dataForm.description" style="padding: 5px; margin: 0; border: 1px solid #dfdfdf" />
</el-form-item> <!-- <editor v-model="dataForm.description" read-only :min-height="200"/> -->
</el-form> </el-form-item>
</el-form>
<div v-if="!disabled" class="action_btn"> <div>
<template> <small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
<span style="display: inline-block;" @click="addNew()"> {{ '备品备件' }}
<svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" /> </small-title>
<span class="add">添加</span> <div v-if="!disabled" class="action_btn">
</span> <template>
</template> <span style="display: inline-block;" @click="addNew()">
</div> <svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" />
<base-table <span class="add">添加</span>
:table-props="tableProps" </span>
:page="listQuery.pageNo" </template>
:limit="listQuery.pageSize" </div>
:table-data="list"> <base-table
<method-btn :table-props="tableProps"
v-if="!disabled" :page="listQuery.pageNo"
slot="handleBtn" :limit="listQuery.pageSize"
:width="120" :table-data="list">
label="操作" <method-btn
:method-list="tableBtn" v-if="!disabled"
@clickBtn="handleClick" /> slot="handleBtn"
</base-table> :width="120"
<pagination label="操作"
v-show="listQuery.total > 0" :method-list="tableBtn"
:total="listQuery.total" @clickBtn="handleClick" />
:page.sync="listQuery.pageNo" </base-table>
:limit.sync="listQuery.pageSize" <pagination
:page-sizes="[5, 10, 15]" v-show="listQuery.total > 0"
@pagination="getList" /> :total="listQuery.total"
:page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize"
:page-sizes="[5, 10, 15]"
@pagination="getList" />
</div>
<div class="drawer-body__footer"> <div v-if="!disabled" class="drawer-body__footer">
<el-button type="primary" @click="goback()">关闭</el-button> <el-button type="primary" @click="goback()">关闭</el-button>
</div>
</div> </div>
<attr-add <attr-add
@ -255,10 +263,10 @@ export default {
padding: 18px; padding: 18px;
} }
.action_btn { .action_btn {
/* float: right; */ float: right;
display: flex; display: flex;
justify-content: right; justify-content: right;
margin: 5px 15px; margin: -35px 15px;
font-size: 14px; font-size: 14px;
} }
.add { .add {
@ -312,4 +320,7 @@ export default {
justify-content: flex-end; justify-content: flex-end;
padding: 18px; padding: 18px;
} }
.content {
padding: 0 20px;
}
</style> </style>

View File

@ -17,7 +17,7 @@
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
label="操作" label="操作"
:width="250" :width="180"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleTableBtnClick" /> @clickBtn="handleTableBtnClick" />
</base-table> </base-table>
@ -34,7 +34,7 @@
<base-dialog <base-dialog
:dialogTitle="title" :dialogTitle="title"
:dialogVisible="open" :dialogVisible="open"
width="35%" width="50%"
@close="cancel" @close="cancel"
@cancel="cancel" @cancel="cancel"
@confirm="submitForm"> @confirm="submitForm">
@ -44,12 +44,14 @@
v-model="form" v-model="form"
:disabled="mode == 'detail'" :disabled="mode == 'detail'"
:has-files="false" :has-files="false"
:rows="rows" /> :rows="rows"
style="margin: 0 30px" />
</base-dialog> </base-dialog>
<addSparts <addSparts
v-if="addOrUpdateVisible" v-if="addOrUpdateVisible"
ref="addOrUpdate" ref="addOrUpdate"
@refreshDataList="getList" /> @refreshDataList="getList"
@destroy="addOrUpdateVisible = false" />
</div> </div>
</template> </template>
@ -79,22 +81,24 @@ export default {
// btnName: '', // btnName: '',
// } // }
// : undefined, // : undefined,
this.$auth.hasPermi('equipment:spare-parts-config:update') this.$auth.hasPermi('equipment:spare-parts-config:addParts')
? { ? {
type: 'edit', type: 'addParts',
btnName: '修改', btnName: '添加',
showTip: '添加备件'
} }
: undefined, : undefined,
this.$auth.hasPermi('equipment:spare-parts-config:queryParts') this.$auth.hasPermi('equipment:spare-parts-config:queryParts')
? { ? {
type: 'queryParts', type: 'queryParts',
btnName: '查看备件', btnName: '查看',
showTip: '查看备件'
} }
: undefined, : undefined,
this.$auth.hasPermi('equipment:spare-parts-config:addParts') this.$auth.hasPermi('equipment:spare-parts-config:update')
? { ? {
type: 'addParts', type: 'edit',
btnName: '添加备件', btnName: '修改',
} }
: undefined, : undefined,
this.$auth.hasPermi('equipment:spare-parts-config:delete') this.$auth.hasPermi('equipment:spare-parts-config:delete')
@ -105,15 +109,15 @@ export default {
: undefined, : undefined,
].filter((v) => v), ].filter((v) => v),
tableProps: [ tableProps: [
{ prop: 'name', label: '配置名' }, { prop: 'name', label: '配置名', minWidth: 100, showOverflowtooltip: true },
{ prop: 'lineName', label: '产线' }, { prop: 'lineName', label: '产线', minWidth: 100, showOverflowtooltip: true },
{ prop: 'sectionName', label: '工段' }, { prop: 'sectionName', label: '工段', minWidth: 100, showOverflowtooltip: true },
{ prop: 'equipmentName', label: '设备名' }, { prop: 'equipmentName', label: '设备名', minWidth: 120, showOverflowtooltip: true },
{ prop: 'equipmentCode', label: '设备编码' }, { prop: 'equipmentCode', label: '设备编码', minWidth: 100, showOverflowtooltip: true },
{ prop: 'responsible', label: '负责人' }, { prop: 'responsible', label: '负责人', minWidth: 150, showOverflowtooltip: true },
// { prop: 'unit', label: '', filter: publicFormatter('unit_dict') }, // { prop: 'unit', label: '', filter: publicFormatter('unit_dict') },
{ prop: 'description', label: '描述', subcomponent: htmls }, { prop: 'description', label: '描述', subcomponent: htmls, minWidth: 120, showOverflowtooltip: true },
{ prop: 'sparePartNumber', label: '备品备件数量' }, { prop: 'sparePartNumber', label: '备品备件数量', width: 130 },
// { prop: 'remark', label: '' }, // { prop: 'remark', label: '' },
], ],
searchBarFormConfig: [ searchBarFormConfig: [
@ -198,7 +202,7 @@ export default {
prop: 'description', // TODO: prop: 'description', // TODO:
subcomponent: Editor, subcomponent: Editor,
bind: { bind: {
'min-height': 192 'min-height': 150
} }
}, },
], ],

View File

@ -9,81 +9,84 @@
<el-drawer <el-drawer
:visible.sync="visible" :visible.sync="visible"
:show-close="false" :show-close="false"
:wrapper-closable="false" :wrapper-closable="!isLog"
class="drawer" class="drawer"
size="60%"> size="60%">
<small-title slot="title" :no-padding="true"> <small-title slot="title" :no-padding="true">
{{ !isLog ? '操作页面' : '更换记录' }} {{ !isLog ? '操作页面' : '更换记录' }}
</small-title> </small-title>
<el-form <div class="content">
ref="form" <el-form
:model="dataForm" ref="form"
label-width="100px" :model="dataForm"
v-loading="formLoading"> label-width="90px"
<el-row :gutter="20"> v-loading="formLoading">
<el-col :span="12"> <el-row :gutter="20">
<el-form-item v-if="!isLog" label="配置名" prop="name"> <el-col :span="12">
<span>{{ dataForm.name }}</span> <el-form-item v-if="!isLog" label="配置名" prop="name">
</el-form-item> <span style="margin-left: 5px">{{ dataForm.name }}</span>
<el-form-item v-else label="产线名称" prop="lineName"> </el-form-item>
<span>{{ dataForm.lineName }}</span> <el-form-item v-else label="产线名称" prop="lineName">
</el-form-item> <span style="margin-left: 5px">{{ dataForm.lineName }}</span>
</el-col> </el-form-item>
<el-col :span="12"> </el-col>
<el-form-item label="设备名称" prop="equipmentName"> <el-col :span="12">
<span>{{ dataForm.equipmentName }}</span> <el-form-item label="设备名称" prop="equipmentName">
</el-form-item> <span style="margin-left: 5px">{{ dataForm.equipmentName }}</span>
</el-col> </el-form-item>
</el-row> </el-col>
<el-form-item label="描述" prop="faultTime"> </el-row>
<editor v-model="dataForm.description" read-only :min-height="200"/> <el-form-item label="描述" prop="description">
</el-form-item> <div v-html="dataForm.description" style="padding: 5px; margin-left: 5px; border: 1px solid #dfdfdf" />
</el-form> <!-- <editor v-model="dataForm.description" :read-only="true" :min-height="200"/> -->
</el-form-item>
<div v-if="!isLog"> </el-form>
<base-table
:table-props="tableProps" <div v-if="!isLog">
:page="listQuery.pageNo" <base-table
:limit="listQuery.pageSize" :table-props="tableProps"
:table-data="list"> :page="listQuery.pageNo"
<method-btn :limit="listQuery.pageSize"
v-if="!isLog" :table-data="list">
slot="handleBtn" <method-btn
:width="120" v-if="!isLog"
label="操作" slot="handleBtn"
:method-list="tableBtn" :width="120"
@clickBtn="handleClick" /> label="操作"
</base-table> :method-list="tableBtn"
<pagination @clickBtn="handleClick" />
v-show="listQuery.total > 0" </base-table>
:total="listQuery.total" <pagination
:page.sync="listQuery.pageNo" v-show="listQuery.total > 0"
:limit.sync="listQuery.pageSize" :total="listQuery.total"
:page-sizes="[5, 10, 15]" :page.sync="listQuery.pageNo"
@pagination="getList" /> :limit.sync="listQuery.pageSize"
:page-sizes="[5, 10, 15]"
@pagination="getList" />
</div>
<div v-else>
<!-- 搜索工作栏 -->
<SearchBar
:formConfigs="formConfig"
ref="search-bar"
@headBtnClick="buttonClick" />
<base-table
:table-props="tableProps1"
:page="listQuery1.pageNo"
:limit="listQuery1.pageSize"
:table-data="list1" />
<pagination
v-show="listQuery1.total > 0"
:total="listQuery1.total"
:page.sync="listQuery1.pageNo"
:limit.sync="listQuery1.pageSize"
:page-sizes="[5, 10, 15]"
@pagination="getList1" />
</div>
</div> </div>
<div v-else> <div v-if="isLog" class="drawer-body__footer">
<!-- 搜索工作栏 -->
<SearchBar
:formConfigs="formConfig"
ref="search-bar"
@headBtnClick="buttonClick" />
<base-table
:table-props="tableProps1"
:page="listQuery1.pageNo"
:limit="listQuery1.pageSize"
:table-data="list1" />
<pagination
v-show="listQuery1.total > 0"
:total="listQuery1.total"
:page.sync="listQuery1.pageNo"
:limit.sync="listQuery1.pageSize"
:page-sizes="[5, 10, 15]"
@pagination="getList1" />
</div>
<div class="drawer-body__footer">
<el-button type="primary" @click="goback()">关闭</el-button> <el-button type="primary" @click="goback()">关闭</el-button>
</div> </div>
@ -249,7 +252,7 @@ export default {
type: 'button', type: 'button',
btnName: '导出', btnName: '导出',
name: 'export', name: 'export',
color: 'warning', color: 'primary',
plain: true plain: true
}, },
], ],
@ -429,4 +432,7 @@ export default {
justify-content: flex-end; justify-content: flex-end;
padding: 18px; padding: 18px;
} }
.content {
padding: 0 20px;
}
</style> </style>

View File

@ -74,8 +74,7 @@ const remainBox = {
value() { value() {
const temp = this.injectData[this.injectData.prop] || null; const temp = this.injectData[this.injectData.prop] || null;
if (temp) { if (temp) {
console.log('12', temp); return temp === 'Green' ? '未超期' : temp === 'Red' ? '已超期' : '即将超期';
return temp === 'Green' ? 'green' : 'red';
} }
return this.injectData[this.injectData.prop] || null; return this.injectData[this.injectData.prop] || null;
}, },
@ -83,7 +82,7 @@ const remainBox = {
if (this.value) { if (this.value) {
// const v = +this.value; // const v = +this.value;
// return v < 0 ? 'red' : v >= 0 && v < 2 ? 'yellow' : 'green'; // return v < 0 ? 'red' : v >= 0 && v < 2 ? 'yellow' : 'green';
return this.value; return this.value === '未超期' ? '#37D97F' : this.value === '已超期' ? '#FF5454' : '#FFD767';
} }
return 'unset'; return 'unset';
}, },
@ -95,9 +94,9 @@ const remainBox = {
this.color this.color
// this.color == 'Green' ? 'green' : this.color == 'Red' ? 'red' : 'yellow' // this.color == 'Green' ? 'green' : this.color == 'Red' ? 'red' : 'yellow'
}; position:absolute; inset: 0; padding: 0 10px; display: flex; align-items: center; color: ${ }; position:absolute; inset: 0; padding: 0 10px; display: flex; align-items: center; color: ${
this.color == 'red' || this.color == 'green' ? '#fff' : 'unset' '#fff'
}`}> }`}>
{this.injectData[this.injectData.prop] || ''} {this.value}
</div> </div>
); );
}, },
@ -155,18 +154,19 @@ export default {
// : undefined, // : undefined,
].filter((v) => v), ].filter((v) => v),
tableProps: [ tableProps: [
{ prop: 'name', label: '配置名' }, { prop: 'name', label: '配置名', showOverflowtooltip: true },
{ prop: 'lineName', label: '产线名称' }, { prop: 'lineName', label: '产线名称', showOverflowtooltip: true },
{ prop: 'sectionName', label: '工段名' }, { prop: 'sectionName', label: '工段名', showOverflowtooltip: true },
{ prop: 'equipmentName', label: '设备名称' }, { prop: 'equipmentName', label: '设备名称', showOverflowtooltip: true },
{ prop: 'responsible', label: '负责人' }, { prop: 'responsible', label: '负责人', minWidth: 130, showOverflowtooltip: true },
{ prop: 'color', label: '是否超期', subcomponent: remainBox }, { prop: 'color', label: '是否超期', subcomponent: remainBox },
{ prop: 'opt1', label: '备件更换', name: '操作', subcomponent: btn }, { prop: 'opt1', label: '备件更换', name: '操作', subcomponent: btn, width: 110 },
{ {
prop: 'opt2', prop: 'opt2',
label: '更换记录', label: '更换记录',
name: '更新记录', name: '更新记录',
subcomponent: btn, subcomponent: btn,
width: 110
}, // TODO: }, // TODO:
// { prop: 'remark', label: '' }, // { prop: 'remark', label: '' },
], ],

View File

@ -290,7 +290,6 @@ export default {
break; break;
case '2': // case '2': //
this.$router.push({ 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
}) })
break; break;

View File

@ -0,0 +1,150 @@
<template>
<div
id="wasteWaterLine"
style="width: 100%"
:style="{ height: chartHeight + 'px' }"
></div>
</template>
<script>
import * as echarts from 'echarts'
import resize from '@/utils/chartMixins/resize'
export default {
name: "LineChart",
mixins: [resize],
data() {
return {
chartDom: '',
chart: '',
chartHeight: this.tableHeight(420)
}
},
props: {
chartData: {
type: Object,
required: true,
default: () => {
return {}
}
},
timeDim: {
type: String,
default: ''
}
},
mounted() {
window.addEventListener('resize', () => {
this.chartHeight = this.tableHeight(420)
})
this.getChart()
},
watch: {
chartData: function () {
this.getChart()
}
},
methods: {
getChart() {
if (
this.chart !== null &&
this.chart !== '' &&
this.chart !== undefined
) {
this.chart.dispose() // Dom
}
this.chartDom = document.getElementById('wasteWaterLine');
this.chart = echarts.init(this.chartDom);
if (Object.keys(this.chartData).length === 0) {
return false
}
let legendData = []
let xData = []
let seriesData = []
for (let item in this.chartData) {
legendData.push(item)
let obj = {}
let data = []
for (let subItem in this.chartData[item]) {
data.push(this.chartData[item][subItem].checkValue)
}
obj.name = item
obj.type = 'line'
obj.stack = 'Total'
obj.symbol = 'none'
obj.data = data
seriesData.push(obj)
}
for (let i = 0; i < this.chartData[legendData[0]].length; i++) {
let time = ""
if (this.timeDim === '3') {
let year = this.chartData[legendData[0]][i].axisTime.slice(0,4)
let weak = this.chartData[legendData[0]][i].axisTime.slice(6,8)
time = year+' 第 '+weak+' 周'
} else {
time = this.chartData[legendData[0]][i].axisTime
}
xData.push(time)
}
var option = {
color: ['#63BDFF', '#7164FF', '#FF6860', '#FF9747', '#B0EB42', '#D680FF', '#0043D2'],
tooltip: {
trigger: 'axis',
formatter: function (params) {
return (
params[0].axisValue +
`<br>` +
params
.map((item) => {
let str = `<span style="display:inline-block;width:8px;height:8px;margin: 0 8px 0 -3px;border-radius:2px;background-color:${item.color};"></span>`;
let seriesNameStr = `<span style="display:inline-block;">${item.seriesName}</span>`;
let value = item.value ? item.value : '-';
let valueStr = `<span style="display:inline-block;margin-left:10px;color:rgba(0,0,0,0.45);">${value}</span>`;
return `<span style="display:flex; justify-content:space-between; margin-bottom: 2px">
<span>${str}${seriesNameStr}</span>
<span>${valueStr}</span>
</span>`;
})
.join(``)
);
}
},
legend: {
data: legendData,
right: '2%',
icon: 'rect',
itemHeight: 8,
itemWidth: 8,
textStyle: {
color: 'auto'
}
},
grid: {
left: '3%',
right: '2%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'category',
boundaryGap: false,
data: xData,
axisLabel: {
rotate: "45"
}
},
yAxis: {
type: 'value'
},
axisPointer: {
type: 'line',
lineStyle: {
color: 'rgba(11, 88, 255, 1)'
}
},
series: seriesData
};
option && this.chart.setOption(option);
}
}
}
</script>

View File

@ -0,0 +1,378 @@
<template>
<div class="searchBarBox divHeight" ref="searchBarRef">
<el-form :inline="true" class="demo-form-inline">
<el-form-item label="时间维度" required>
<el-select v-model="queryParams.timeDim" placeholder="请选择" style="width: 80px;" size="small">
<el-option
v-for="item in getDictDatas(this.DICT_TYPE.TIME_DIM)"
:key="item.value"
:label="item.label"
:value="item.value"
size="small">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="时间范围" required>
<div v-show="queryParams.timeDim === '1'">
<el-date-picker
v-model="timeValue"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd HH:mm"
value-format="timestamp"
:picker-options="pickerOptions"
popper-class="noneMinute"
@change="timeSelect"
size="small"
style='width:350px;'
>
</el-date-picker>
</div>
<div v-show="queryParams.timeDim === '2'">
<el-date-picker
v-model="dateValue"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="timestamp"
:picker-options="pickerOptions"
@change="timeSelect"
size="small"
style='width:350px;'
>
</el-date-picker>
</div>
<div v-show="queryParams.timeDim === '3'">
<el-date-picker
v-model="weekValue1"
type="week"
format="yyyy 第 WW 周"
style='width:170px;'
:picker-options="pickerOptionsWeek"
@change="startWeek"
size="small"
placeholder="选择周">
</el-date-picker>-
<el-date-picker
v-model="weekValue2"
type="week"
format="yyyy 第 WW 周"
:picker-options="pickerOptionsWeek"
style='width:170px;'
@change="endWeek"
size="small"
placeholder="选择周">
</el-date-picker>
</div>
<div v-show="queryParams.timeDim === '4'">
<el-date-picker
v-model="monthValue"
type="monthrange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="timestamp"
:picker-options="pickerOptions"
size="small"
style='width:350px;'
@change="timeSelect"
>
</el-date-picker>
</div>
<div v-show="queryParams.timeDim === '5'">
<el-date-picker
style='width:170px;'
v-model="yearValue1"
type="year"
:picker-options="pickerOptions"
value-format="timestamp"
placeholder="选择年"
size="small"
@change="startYear"
>
</el-date-picker>-
<el-date-picker
style='width:170px;'
v-model="yearValue2"
type="year"
:picker-options="pickerOptions"
value-format="timestamp"
placeholder="选择年"
size="small"
@change="endYear"
>
</el-date-picker>
</div>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="search">查询</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import moment from 'moment'
export default {
name: 'SearchArea',
data() {
return {
//
queryParams: {
timeDim: null,
startTime: null,
endTime: null
},
timeValue: [],// 7
dateValue: [],// 30
weekValue1: null,//24
weekValue2: null,
monthValue: [],//24
yearValue1: null,//10
yearValue2: null,
pickerOptions: {
disabledDate(date) {
return date.getTime() > Date.now()
}
},
pickerOptionsWeek: {
disabledDate(time) {
let day = Date.now()
let limitTime = moment(day).day(-1)
return time.getTime() > new Date(limitTime).getTime()
}
}
}
},
mounted() {
this.queryParams.timeDim = this.getDictDatas(this.DICT_TYPE.TIME_DIM)[0].value //
this.timeValue = [moment().startOf('day'), moment().endOf('day')-59*61*1000]
},
methods: {
//
timeSelect() {
switch (this.queryParams.timeDim) {
case '1':
if (!this.timeValue) {
this.$modal.msgError('时间范围不能为空')
return false
}
if (this.timeValue[1] - this.timeValue[0] > 7*24*3600000) {
this.$modal.msgError('最大时间范围为7天请重新选择')
this.timeValue = []
}
break
case '2':
if (!this.dateValue) {
this.$modal.msgError('时间范围不能为空')
return false
}
if (this.dateValue[1] - this.dateValue[0] > 29*24*3600000) {
this.$modal.msgError('最大时间范围为30天请重新选择') // 0:00:0023:59:59
this.dateValue = []
}
break
case '4':
if (!this.monthValue) {
this.$modal.msgError('时间范围不能为空')
return false
}
if (this.monthValue[1] - this.monthValue[0] > 729*24*3600000) {
this.$modal.msgError('最大时间范围为24个月请重新选择')//
this.monthValue = []
}
break
default:
}
},
//
startYear() {
if (this.yearValue2 && this.yearValue2 < this.yearValue1) {
this.$modal.msgError('开始时间不能晚于结束时间,请重新选择')
this.yearValue1 = null
return false
}
if (this.yearValue1 && this.yearValue2) {
if (this.yearValue2 - this.yearValue1 > 10*365*24*3600000) {
this.$modal.msgError('最大时间范围为10年请重新选择')
this.yearValue1 = null
return false
}
}
},
endYear() {
if (this.yearValue2 && this.yearValue2 < this.yearValue1) {
this.$modal.msgError('结束时间不能早于开始时间,请重新选择')
this.yearValue2 = null
return false
}
if (this.yearValue1 && this.yearValue2) {
if (this.yearValue2 - this.yearValue1 > 10*365*24*3600000) {
this.$modal.msgError('最大时间范围为10年请重新选择')
this.yearValue2 = null
return false
}
}
},
//
startWeek() {
if (this.weekValue1 && this.weekValue2) {
let a = new Date(this.weekValue1).getTime()
let b = new Date(this.weekValue2).getTime()
if (a > b) {
this.$modal.msgError('开始时间不能晚于结束时间,请重新选择')
this.weekValue1 = null
return false
}
if (b - a > 167*24*3600000) {
this.$modal.msgError('最大时间范围为24周请重新选择')
this.weekValue1 = null
return false
}
}
},
endWeek() {
if (this.weekValue1 && this.weekValue2) {
let a = new Date(this.weekValue1).getTime()
let b = new Date(this.weekValue2).getTime()
if (a > b) {
this.$modal.msgError('结束时间不能早于开始时间,请重新选择')
this.weekValue2 = null
return false
}
if (b - a > 167*24*3600000) {
this.$modal.msgError('最大时间范围为24周请重新选择')
this.weekValue2 = null
return false
}
}
},
//
search() {
if (!this.queryParams.timeDim) {
this.$modal.msgError('请选择时间维度')
return false
}
switch (this.queryParams.timeDim) {
case '1':
if (this.timeValue && this.timeValue.length > 0) {
this.queryParams.startTime = this.timeValue[0]
this.queryParams.endTime = this.timeValue[1] //
} else {
this.$modal.msgError('时间范围不能为空')
return false
}
break
case '2':
if (this.dateValue && this.dateValue.length > 0) {
this.queryParams.startTime = this.dateValue[0]
this.queryParams.endTime = this.dateValue[1] + 86399000 // 23:59:59
} else {
this.$modal.msgError('日范围不能为空')
return false
}
break
case '3':
if (this.weekValue1 && this.weekValue2) {
let a = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' 00:00:00'
let b = moment(this.weekValue2).day(6).format('YYYY-MM-DD') + ' 23:59:59'
this.queryParams.startTime = new Date(a).getTime()
this.queryParams.endTime = new Date(b).getTime()
} else {
this.$modal.msgError('周范围不能为空')
return false
}
break
case '4'://
if (this.monthValue && this.monthValue.length > 0) {
this.queryParams.startTime = this.monthValue[0]
this.queryParams.endTime = this.transformTime(this.monthValue[1])
} else {
this.$modal.msgError('月范围不能为空')
return false
}
break
default://
if (this.yearValue1 && this.yearValue2) {
if (this.yearValue2 < this.yearValue1) {
this.$modal.msgError('结束时间不能早于开始时间')
return false
} else {
this.queryParams.startTime = this.yearValue1
this.queryParams.endTime = this.transformYear(this.yearValue2)
}
} else {
this.$modal.msgError('年范围不能为空')
return false
}
}
this.queryParams.startTime = this.queryParams.startTime + ''
this.queryParams.endTime = this.queryParams.endTime + ''
this.$emit('submit', this.queryParams)
},
transformTime(timeStamp) {//
let year = moment(timeStamp).format('YYYY')
let month = moment(timeStamp).format('MM')
let newData = moment(new Date(year,month,0)).format('YYYY-MM-DD') + ' 23:59:59'
let value = new Date(newData).getTime()
return value
},
transformYear(timeStamp) {//
let year = moment(timeStamp).format('YYYY')
let newData = year+'-12-31 23:59:59'
let value = new Date(newData).getTime()
return value
}
}
}
</script>
<style lang='scss'>
/* 级联选择器 */
.cascaderParent .el-cascader-panel .el-scrollbar:first-child .el-radio {
display: none;
}
/* 时间整点 */
.noneMinute .el-time-spinner__wrapper {
width: 100%;
}
.noneMinute .el-scrollbar:nth-of-type(2) {
display: none;
}
.demo-form-inline {
.el-date-editor .el-range__icon {
font-size: 16px;
color: #0B58FF;
}
.el-input__prefix .el-icon-date {
font-size: 16px;
color: #0B58FF;
}
}
</style>
<style lang="scss" scoped>
.searchBarBox .foldClass {
position: absolute;
top: 14px;
right: 0;
cursor: pointer;
font-size: 12px;
color:#0B58FF;
}
.searchBarBox .foldClass .iconfont {
font-size: 14px;
}
.divHeight {
height: 45px;
overflow: hidden;
}
.separateStyle {
display: inline-block;
width: 1px;
height: 24px;
background: #E8E8E8;
vertical-align: middle;
margin: 0 10px;
}
</style>

View File

@ -0,0 +1,185 @@
<template>
<div class="app-container vocHis">
<!-- 搜索工作栏 -->
<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"
:row-class-name="tableRowClassName"
/>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
</div>
</template>
<script>
import { publicFormatter } from '@/utils/dict'
import { parseTime } from '@/utils/ruoyi'
import { environmentalCheckRecordPage, environmentalCheckRecordExport, environmentalCheckPage } from '@/api/safetyEnvironmental/environmental'
import moment from 'moment'
const tableProps = [
{
prop: 'checkName',
label: '指标名称'
},
{
prop: 'checkValue',
label: '检测数值'
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('environment_check_unit')
},
{
prop: 'checkTime',
label: '检测时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'origin',
label: '来源',
filter: (val) => ['手动', '自动'][val]
},
{
prop: 'recordPerson',
label: '录入人'
},
{
prop: 'recordTime',
label: '录入时间',
filter: parseTime,
minWidth: 160
}
]
export default {
name: 'VocDetectionHistory',
data() {
return {
formConfig: [
{
type: 'select',
label: '指标名称',
selectOptions: [],
param: 'checkId',
filterable: true
},
{
type: 'datePicker',
label: '时间',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 350
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
},
{
type: this.$auth.hasPermi('base:voc:export') ? 'separate' : '',
},
{
type: this.$auth.hasPermi('base:voc:export') ? 'button' : '',
btnName: '导出',
name: 'export',
color: 'primary',
plain: true
}
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
checkId: null,
checkType: 3,
startTime: null,
endTime: null
},
tableProps,
list: [],
total: 0,
tableH: this.tableHeight(260)
}
},
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().format('YYYY-MM-DD 00:00:00')).valueOf()
this.formConfig[1].defaultSelect = [start, end]
this.queryParams.startTime = start
this.queryParams.endTime = end
this.getSelectList()
this.getList()
},
methods: {
buttonClick(val) {
this.queryParams.pageNo = 1;
this.queryParams.checkId = val.checkId
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null
if (val.btnName === 'search') {
this.getList()
} else {
this.$modal.confirm('是否确认导出').then(() => {
return environmentalCheckRecordExport({...this.queryParams});
}).then(response => {
this.$download.excel(response, '废水检测历史记录.xls');
}).catch(() => {})
}
},
getList() {
environmentalCheckRecordPage({...this.queryParams}).then(res => {
this.list = res.data.list || []
this.total = res.data.total || 0
})
},
getSelectList() {
environmentalCheckPage({
pageNo: 1,
pageSize: 100,
checkType: 3
}).then(res => {
console.log(res)
this.formConfig[0].selectOptions = res.data.list || []
})
},
tableRowClassName({row, rowIndex}) {
console.log(row)
if (row.markRed) {
return 'warning-row'
}else {
return ''
}
}
}
}
</script>
<style lang='scss'>
.vocHis {
.el-table .warning-row {
background: #fee1e1;
}
}
</style>

View File

@ -0,0 +1,124 @@
<template>
<el-form ref="vocAddForm" :rules="rules" label-width="80px" :model="form">
<el-row :gutter="20">
<el-col :span='12'>
<el-form-item label="指标名称" prop="name">
<el-input v-model="form.name" :disabled='isEdit'></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="unit">
<el-select v-model="form.unit" placeholder="请选择" style="width: 100%;" :disabled='form.method == 2'>
<el-option
v-for="item in getDictDatas(DICT_TYPE.ENVIRONMENT_CHECK_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="minValue">
<el-input-number v-model="form.minValue" placeholder="最小值" :max="9999999" style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="最大值" prop="maxValue">
<el-input-number v-model="form.maxValue" placeholder="最大值" :max="9999999" style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import { environmentalCheckGet, environmentalCheckUpdate, environmentalCheckCreate, getEnvironmentalCheckCode } from '@/api/safetyEnvironmental/environmental'
export default {
name: 'VocAdd',
data() {
return {
form: {
id: '',
name: '',
code: '',
unit: '',
minValue: null,
maxValue: null,
remark: '',
checkType: 3
},
isEdit: false,
rules: {
name: [{ required: true, message: "指标名称不能为空", trigger: "blur" }],
code: [{ required: true, message: "指标编码不能为空", trigger: "blur" }],
// unit: [{ required: true, message: "unit", trigger: "change" }],
minValue: [{ required: true, message: "最小值不能为空", trigger: "blur" }],
maxValue: [{ required: true, message: "最大值不能为空", trigger: "blur" }]
}
}
},
methods: {
init(id) {
if (id) {
this.isEdit = true
this.form.id = id
environmentalCheckGet({id: this.form.id}).then(res => {
if (res.code === 0) {
this.form = res.data
}
})
} else {
this.isEdit = false
this.form.id = ''
//
getEnvironmentalCheckCode().then(res => {
this.form.code = res.data || ''
})
}
},
submitForm() {
this.$refs['vocAddForm'].validate((valid) => {
if (valid) {
if (this.form.minValue > this.form.maxValue) {
this.$modal.msgError('最小值不能大于最大值')
return false
}
console.log(this.form)
if (this.isEdit) {
//
environmentalCheckUpdate({ ...this.form }).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit')
}
})
} else {
environmentalCheckCreate({ ...this.form }).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit')
}
})
}
} else {
return false
}
})
},
formClear() {
this.$refs.vocAddForm.resetFields()
this.isEdit = false
}
}
}
</script>

View File

@ -0,0 +1,205 @@
<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="80"
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%'
>
<voc-add ref="vocAdd" @successSubmit="successSubmit" />
</base-dialog>
</div>
</template>
<script>
import { parseTime } from '@/utils/ruoyi'
import VocAdd from './components/vocAdd'
import { publicFormatter } from '@/utils/dict'
import { environmentalCheckPage, environmentalCheckDelete } from '@/api/safetyEnvironmental/environmental'
const tableProps = [
{
prop: 'name',
label: '指标名称',
minWidth: 120,
showOverflowtooltip: true
},
{
prop: 'code',
label: '指示编码',
minWidth: 120
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('environment_check_unit')
},
{
prop: 'minValue',
label: '最小值'
},
{
prop: 'maxValue',
label: '最大值'
},
{
prop: 'creator',
label: '创建人'
},
{
prop: 'createTime',
label: '创建时间',
filter: parseTime,
minWidth: 160
}
]
export default {
name: 'VocDetectionIndication',
data() {
return {
formConfig: [
{
type: 'input',
label: '指标名称',
placeholder: '指标名称',
param: 'name'
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
},
{
type: this.$auth.hasPermi('base:voc:create') ? 'separate' : '',
},
{
type: this.$auth.hasPermi('base:voc:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
}
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
checkType: 3,
name: null
},
total: 0,
tableProps,
list: [],
tableH: this.tableHeight(260),
tableBtn: [
this.$auth.hasPermi('base:voc:update')
? {
type: 'edit',
btnName: '编辑'
}
: undefined,
this.$auth.hasPermi('base:voc:delete')
? {
type: 'delete',
btnName: '删除'
}
: undefined
].filter((v)=>v),
addOrEditTitle: '',
centervisible: false
}
},
components: { VocAdd },
mounted() {
this.getList()
},
methods: {
getList() {
environmentalCheckPage({...this.queryParams}).then(res => {
this.list = res.data.list || []
this.total = res.data.total || 0
})
},
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.vocAdd.init()
})
}
},
handleClick(val) {
console.log(val)
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑'
this.centervisible = true
this.$nextTick(() => {
this.$refs.vocAdd.init(val.data.id)
})
break
default:
this.handleDelete(val.data)
}
},
//
handleDelete(val) {
this.$modal.confirm('是否确认删除"' + val.name + '"的数据项?').then(function() {
return environmentalCheckDelete({ id: val.id })
}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {});
},
//
handleCancel() {
this.$refs.vocAdd.formClear()
this.centervisible = false
this.addOrEditTitle = ''
},
handleConfirm() {
this.$refs.vocAdd.submitForm()
},
successSubmit() {
this.handleCancel()
this.getList()
}
}
}
</script>

View File

@ -0,0 +1,152 @@
<template>
<div class="voc">
<div class="box1">
<div class="boxTitle">
<span class="blueTitle"></span>
<span>检测指标实时数据</span>
</div>
<div class="itemBox">
<div class="itemBox">
<div class="itemClass" v-for="(item, index) in realtimeList" :key='index'>
<div class="itemSub">
<p class="itemNum">{{item.checkValue}}</p>
<p class="itemDescribe">
<img src="./../../../../../assets/images/detectionData.png" alt="">
{{item.name}}</p>
</div>
</div>
</div>
</div>
</div>
<div class="box2">
<div class="boxTitle">
<span class="blueTitle"></span>
<span>检测指标趋势图</span>
</div>
<!-- 搜索工作栏 -->
<search-area @submit="getTrend"/>
<line-chart :chartData="chartData" v-show='Object.keys(chartData).length !== 0' :timeDim="queryParams.timeDim"/>
<!-- 没有数据 -->
<div class="no-data-bg" v-show='Object.keys(chartData).length === 0'></div>
</div>
</div>
</template>
<script>
import { environmentalCheckRealtime, environmentalCheckRealtimeTrend } from '@/api/safetyEnvironmental/environmental'
import LineChart from './../../components/lineChart'
import SearchArea from './../../components/searchArea'
export default {
name: 'Voc',
data(){
return {
realtimeList:[],
queryParams:{
checkType: 1,
timeDim: null,
timeRange: []
},
chartData: {}
}
},
components: { LineChart, SearchArea },
mounted() {
this.getMsg()
},
methods: {
getMsg() {
environmentalCheckRealtime({checkType: 3}).then(res => {
console.log(res)
this.realtimeList = res.data || []
})
},
getTrend(params) {
console.log(params)
this.queryParams.timeDim = params.timeDim
this.queryParams.timeRange[0] = params.startTime
this.queryParams.timeRange[1] = params.endTime
environmentalCheckRealtimeTrend({...this.queryParams}).then(res => {
console.log(res)
if (res.code === 0) {
this.chartData = res.data
} else {
this.chartData = {}
}
})
}
}
}
</script>
<style lang='scss' scoped>
.voc {
background-color: #f2f4f9;
.box1 {
height: 172px;
padding: 12px 16px 0;
margin-bottom: 8px;
background-color: #fff;
border-radius: 9px;
.itemBox {
display: flex;
flex-flow: row nowrap;
overflow: auto;
.itemClass {
width: 198px;
height: 88px;
// border: 1px solid green;
padding: 12px 0px 12px 18px;
.itemSub {
width: 176px;
height: 65px;
padding-right: 26px;
border-right: 1px solid #E8E8E8;
P{
margin: 0;
img {
width: 24px;
height: 24px;
vertical-align: middle;
}
}
.itemNum {
font-size: 32px;
font-weight: 600;
height: 43px;
color: #3E6AF7;
text-align: right;
}
.itemDescribe {
font-size: 16px;
text-align: right;
}
}
}
}
.itemClass:last-child > .itemSub{
border: none !important;
}
}
.box2 {
background-color: #fff;
border-radius: 9px;
padding: 16px;
height: calc(100vh - 308px);
}
.boxTitle {
display: inline-block;
font-size: 16px;
font-weight: 400;
color: #000000;
margin:0 10px 20px 0;
}
.blueTitle {
content: '';
display: inline-block;
width: 4px;
height: 18px;
background-color: #0B58FF;
border-radius: 1px;
margin-right: 8px;
vertical-align: bottom;
}
}
</style>

View File

@ -0,0 +1,185 @@
<template>
<div class="app-container wasteGasHis">
<!-- 搜索工作栏 -->
<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"
:row-class-name="tableRowClassName"
/>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
</div>
</template>
<script>
import { publicFormatter } from '@/utils/dict'
import { parseTime } from '@/utils/ruoyi'
import { environmentalCheckRecordPage, environmentalCheckRecordExport, environmentalCheckPage } from '@/api/safetyEnvironmental/environmental'
import moment from 'moment'
const tableProps = [
{
prop: 'checkName',
label: '指标名称'
},
{
prop: 'checkValue',
label: '检测数值'
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('environment_check_unit')
},
{
prop: 'checkTime',
label: '检测时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'origin',
label: '来源',
filter: (val) => ['手动', '自动'][val]
},
{
prop: 'recordPerson',
label: '录入人'
},
{
prop: 'recordTime',
label: '录入时间',
filter: parseTime,
minWidth: 160
}
]
export default {
name: 'WasteGasDetectionHistory',
data() {
return {
formConfig: [
{
type: 'select',
label: '指标名称',
selectOptions: [],
param: 'checkId',
filterable: true
},
{
type: 'datePicker',
label: '时间',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 350
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
},
{
type: this.$auth.hasPermi('base:waste-gas:export') ? 'separate' : '',
},
{
type: this.$auth.hasPermi('base:waste-gas:export') ? 'button' : '',
btnName: '导出',
name: 'export',
color: 'primary',
plain: true
}
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
checkId: null,
checkType: 2,
startTime: null,
endTime: null
},
tableProps,
list: [],
total: 0,
tableH: this.tableHeight(260)
}
},
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().format('YYYY-MM-DD 00:00:00')).valueOf()
this.formConfig[1].defaultSelect = [start, end]
this.queryParams.startTime = start
this.queryParams.endTime = end
this.getSelectList()
this.getList()
},
methods: {
buttonClick(val) {
this.queryParams.pageNo = 1;
this.queryParams.checkId = val.checkId
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null
if (val.btnName === 'search') {
this.getList()
} else {
this.$modal.confirm('是否确认导出').then(() => {
return environmentalCheckRecordExport({...this.queryParams});
}).then(response => {
this.$download.excel(response, '废气检测历史记录.xls');
}).catch(() => {})
}
},
getList() {
environmentalCheckRecordPage({...this.queryParams}).then(res => {
this.list = res.data.list || []
this.total = res.data.total || 0
})
},
getSelectList() {
environmentalCheckPage({
pageNo: 1,
pageSize: 100,
checkType: 2
}).then(res => {
console.log(res)
this.formConfig[0].selectOptions = res.data.list || []
})
},
tableRowClassName({row, rowIndex}) {
console.log(row)
if (row.markRed) {
return 'warning-row'
}else {
return ''
}
}
}
}
</script>
<style lang='scss'>
.wasteGasHis {
.el-table .warning-row {
background: #fee1e1;
}
}
</style>

View File

@ -0,0 +1,124 @@
<template>
<el-form ref="wasteGasAddForm" :rules="rules" label-width="80px" :model="form">
<el-row :gutter="20">
<el-col :span='12'>
<el-form-item label="指标名称" prop="name">
<el-input v-model="form.name" :disabled='isEdit'></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="unit">
<el-select v-model="form.unit" placeholder="请选择" style="width: 100%;" :disabled='form.method == 2'>
<el-option
v-for="item in getDictDatas(DICT_TYPE.ENVIRONMENT_CHECK_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="minValue">
<el-input-number v-model="form.minValue" placeholder="最小值" :max="9999999" style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="最大值" prop="maxValue">
<el-input-number v-model="form.maxValue" placeholder="最大值" :max="9999999" style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import { environmentalCheckGet, environmentalCheckUpdate, environmentalCheckCreate, getEnvironmentalCheckCode } from '@/api/safetyEnvironmental/environmental'
export default {
name: 'WasteGasAdd',
data() {
return {
form: {
id: '',
name: '',
code: '',
unit: '',
minValue: null,
maxValue: null,
remark: '',
checkType: 2
},
isEdit: false,
rules: {
name: [{ required: true, message: "指标名称不能为空", trigger: "blur" }],
code: [{ required: true, message: "指标编码不能为空", trigger: "blur" }],
// unit: [{ required: true, message: "unit", trigger: "change" }],
minValue: [{ required: true, message: "最小值不能为空", trigger: "blur" }],
maxValue: [{ required: true, message: "最大值不能为空", trigger: "blur" }]
}
}
},
methods: {
init(id) {
if (id) {
this.isEdit = true
this.form.id = id
environmentalCheckGet({id: this.form.id}).then(res => {
if (res.code === 0) {
this.form = res.data
}
})
} else {
this.isEdit = false
this.form.id = ''
//
getEnvironmentalCheckCode().then(res => {
this.form.code = res.data || ''
})
}
},
submitForm() {
this.$refs['wasteGasAddForm'].validate((valid) => {
if (valid) {
if (this.form.minValue > this.form.maxValue) {
this.$modal.msgError('最小值不能大于最大值')
return false
}
console.log(this.form)
if (this.isEdit) {
//
environmentalCheckUpdate({ ...this.form }).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit')
}
})
} else {
environmentalCheckCreate({ ...this.form }).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit')
}
})
}
} else {
return false
}
})
},
formClear() {
this.$refs.wasteGasAddForm.resetFields()
this.isEdit = false
}
}
}
</script>

View File

@ -0,0 +1,205 @@
<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="80"
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-gas-add ref="wasteGasAdd" @successSubmit="successSubmit" />
</base-dialog>
</div>
</template>
<script>
import { parseTime } from '@/utils/ruoyi'
import WasteGasAdd from './components/wasteGasAdd'
import { publicFormatter } from '@/utils/dict'
import { environmentalCheckPage, environmentalCheckDelete } from '@/api/safetyEnvironmental/environmental'
const tableProps = [
{
prop: 'name',
label: '指标名称',
minWidth: 120,
showOverflowtooltip: true
},
{
prop: 'code',
label: '指示编码',
minWidth: 120
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('environment_check_unit')
},
{
prop: 'minValue',
label: '最小值'
},
{
prop: 'maxValue',
label: '最大值'
},
{
prop: 'creator',
label: '创建人'
},
{
prop: 'createTime',
label: '创建时间',
filter: parseTime,
minWidth: 160
}
]
export default {
name: 'WasteGasDetectionIndication',
data() {
return {
formConfig: [
{
type: 'input',
label: '指标名称',
placeholder: '指标名称',
param: 'name'
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
},
{
type: this.$auth.hasPermi('base:waste-gas:create') ? 'separate' : '',
},
{
type: this.$auth.hasPermi('base:waste-gas:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
}
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
checkType: 2,
name: null
},
total: 0,
tableProps,
list: [],
tableH: this.tableHeight(260),
tableBtn: [
this.$auth.hasPermi('base:waste-gas:update')
? {
type: 'edit',
btnName: '编辑'
}
: undefined,
this.$auth.hasPermi('base:waste-gas:delete')
? {
type: 'delete',
btnName: '删除'
}
: undefined
].filter((v)=>v),
addOrEditTitle: '',
centervisible: false
}
},
components: { WasteGasAdd },
mounted() {
this.getList()
},
methods: {
getList() {
environmentalCheckPage({...this.queryParams}).then(res => {
this.list = res.data.list || []
this.total = res.data.total || 0
})
},
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.wasteGasAdd.init()
})
}
},
handleClick(val) {
console.log(val)
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑'
this.centervisible = true
this.$nextTick(() => {
this.$refs.wasteGasAdd.init(val.data.id)
})
break
default:
this.handleDelete(val.data)
}
},
//
handleDelete(val) {
this.$modal.confirm('是否确认删除"' + val.name + '"的数据项?').then(function() {
return environmentalCheckDelete({ id: val.id })
}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {});
},
//
handleCancel() {
this.$refs.wasteGasAdd.formClear()
this.centervisible = false
this.addOrEditTitle = ''
},
handleConfirm() {
this.$refs.wasteGasAdd.submitForm()
},
successSubmit() {
this.handleCancel()
this.getList()
}
}
}
</script>

View File

@ -0,0 +1,152 @@
<template>
<div class="wasteGasManagement">
<div class="box1">
<div class="boxTitle">
<span class="blueTitle"></span>
<span>检测指标实时数据</span>
</div>
<div class="itemBox">
<div class="itemBox">
<div class="itemClass" v-for="(item, index) in realtimeList" :key='index'>
<div class="itemSub">
<p class="itemNum">{{item.checkValue}}</p>
<p class="itemDescribe">
<img src="./../../../../../assets/images/detectionData.png" alt="">
{{item.name}}</p>
</div>
</div>
</div>
</div>
</div>
<div class="box2">
<div class="boxTitle">
<span class="blueTitle"></span>
<span>检测指标趋势图</span>
</div>
<!-- 搜索工作栏 -->
<search-area @submit="getTrend"/>
<line-chart :chartData="chartData" v-show='Object.keys(chartData).length !== 0' :timeDim="queryParams.timeDim"/>
<!-- 没有数据 -->
<div class="no-data-bg" v-show='Object.keys(chartData).length === 0'></div>
</div>
</div>
</template>
<script>
import { environmentalCheckRealtime, environmentalCheckRealtimeTrend } from '@/api/safetyEnvironmental/environmental'
import LineChart from './../../components/lineChart'
import SearchArea from './../../components/searchArea'
export default {
name: 'WasteGasManagement',
data(){
return {
realtimeList:[],
queryParams:{
checkType: 2,
timeDim: null,
timeRange: []
},
chartData: {}
}
},
components: { LineChart, SearchArea },
mounted() {
this.getMsg()
},
methods: {
getMsg() {
environmentalCheckRealtime({checkType: 2}).then(res => {
console.log(res)
this.realtimeList = res.data || []
})
},
getTrend(params) {
console.log(params)
this.queryParams.timeDim = params.timeDim
this.queryParams.timeRange[0] = params.startTime
this.queryParams.timeRange[1] = params.endTime
environmentalCheckRealtimeTrend({...this.queryParams}).then(res => {
console.log(res)
if (res.code === 0) {
this.chartData = res.data
} else {
this.chartData = {}
}
})
}
}
}
</script>
<style lang='scss' scoped>
.wasteGasManagement {
background-color: #f2f4f9;
.box1 {
height: 172px;
padding: 12px 16px 0;
margin-bottom: 8px;
background-color: #fff;
border-radius: 9px;
.itemBox {
display: flex;
flex-flow: row nowrap;
overflow: auto;
.itemClass {
width: 198px;
height: 88px;
// border: 1px solid green;
padding: 12px 0px 12px 18px;
.itemSub {
width: 176px;
height: 65px;
padding-right: 26px;
border-right: 1px solid #E8E8E8;
P{
margin: 0;
img {
width: 24px;
height: 24px;
vertical-align: middle;
}
}
.itemNum {
font-size: 32px;
font-weight: 600;
height: 43px;
color: #3E6AF7;
text-align: right;
}
.itemDescribe {
font-size: 16px;
text-align: right;
}
}
}
}
.itemClass:last-child > .itemSub{
border: none !important;
}
}
.box2 {
background-color: #fff;
border-radius: 9px;
padding: 16px;
height: calc(100vh - 308px);
}
.boxTitle {
display: inline-block;
font-size: 16px;
font-weight: 400;
color: #000000;
margin:0 10px 20px 0;
}
.blueTitle {
content: '';
display: inline-block;
width: 4px;
height: 18px;
background-color: #0B58FF;
border-radius: 1px;
margin-right: 8px;
vertical-align: bottom;
}
}
</style>

View File

@ -0,0 +1,185 @@
<template>
<div class="app-container wasteWaterHis">
<!-- 搜索工作栏 -->
<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"
:row-class-name="tableRowClassName"
/>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
</div>
</template>
<script>
import { publicFormatter } from '@/utils/dict'
import { parseTime } from '@/utils/ruoyi'
import { environmentalCheckRecordPage, environmentalCheckRecordExport, environmentalCheckPage } from '@/api/safetyEnvironmental/environmental'
import moment from 'moment'
const tableProps = [
{
prop: 'checkName',
label: '指标名称'
},
{
prop: 'checkValue',
label: '检测数值'
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('environment_check_unit')
},
{
prop: 'checkTime',
label: '检测时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'origin',
label: '来源',
filter: (val) => ['手动', '自动'][val]
},
{
prop: 'recordPerson',
label: '录入人'
},
{
prop: 'recordTime',
label: '录入时间',
filter: parseTime,
minWidth: 160
}
]
export default {
name: 'WasteWaterDetectionHistory',
data() {
return {
formConfig: [
{
type: 'select',
label: '指标名称',
selectOptions: [],
param: 'checkId',
filterable: true
},
{
type: 'datePicker',
label: '检测时间',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 350
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
},
{
type: this.$auth.hasPermi('base:waste-water:export') ? 'separate' : '',
},
{
type: this.$auth.hasPermi('base:waste-water:export') ? 'button' : '',
btnName: '导出',
name: 'export',
color: 'primary',
plain: true
}
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
checkId: null,
checkType: 1,
startTime: null,
endTime: null
},
tableProps,
list: [],
total: 0,
tableH: this.tableHeight(260)
}
},
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().format('YYYY-MM-DD 00:00:00')).valueOf()
this.formConfig[1].defaultSelect = [start, end]
this.queryParams.startTime = start
this.queryParams.endTime = end
this.getSelectList()
this.getList()
},
methods: {
buttonClick(val) {
this.queryParams.pageNo = 1;
this.queryParams.checkId = val.checkId
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null
if (val.btnName === 'search') {
this.getList()
} else {
this.$modal.confirm('是否确认导出').then(() => {
return environmentalCheckRecordExport({...this.queryParams});
}).then(response => {
this.$download.excel(response, '废水检测历史记录.xls');
}).catch(() => {})
}
},
getList() {
environmentalCheckRecordPage({...this.queryParams}).then(res => {
this.list = res.data.list || []
this.total = res.data.total || 0
})
},
getSelectList() {
environmentalCheckPage({
pageNo: 1,
pageSize: 100,
checkType: 1
}).then(res => {
console.log(res)
this.formConfig[0].selectOptions = res.data.list || []
})
},
tableRowClassName({row, rowIndex}) {
console.log(row)
if (row.markRed) {
return 'warning-row'
}else {
return ''
}
}
}
}
</script>
<style lang='scss'>
.wasteWaterHis {
.el-table .warning-row {
background: #fee1e1;
}
}
</style>

View File

@ -0,0 +1,124 @@
<template>
<el-form ref="wasteWaterAddForm" :rules="rules" label-width="80px" :model="form">
<el-row :gutter="20">
<el-col :span='12'>
<el-form-item label="指标名称" prop="name">
<el-input v-model="form.name" :disabled='isEdit'></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="unit">
<el-select v-model="form.unit" placeholder="请选择" style="width: 100%;" :disabled='form.method == 2'>
<el-option
v-for="item in getDictDatas(DICT_TYPE.ENVIRONMENT_CHECK_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="minValue">
<el-input-number v-model="form.minValue" placeholder="最小值" :max="9999999" style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="最大值" prop="maxValue">
<el-input-number v-model="form.maxValue" placeholder="最大值" :max="9999999" style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import { environmentalCheckGet, environmentalCheckUpdate, environmentalCheckCreate, getEnvironmentalCheckCode } from '@/api/safetyEnvironmental/environmental'
export default {
name: 'WasteWaterAdd',
data() {
return {
form: {
id: '',
name: '',
code: '',
unit: '',
minValue: null,
maxValue: null,
remark: '',
checkType: 1
},
isEdit: false,
rules: {
name: [{ required: true, message: "指标名称不能为空", trigger: "blur" }],
code: [{ required: true, message: "指标编码不能为空", trigger: "blur" }],
// unit: [{ required: true, message: "unit", trigger: "change" }],
minValue: [{ required: true, message: "最小值不能为空", trigger: "blur" }],
maxValue: [{ required: true, message: "最大值不能为空", trigger: "blur" }]
}
}
},
methods: {
init(id) {
if (id) {
this.isEdit = true
this.form.id = id
environmentalCheckGet({id: this.form.id}).then(res => {
if (res.code === 0) {
this.form = res.data
}
})
} else {
this.isEdit = false
this.form.id = ''
//
getEnvironmentalCheckCode().then(res => {
this.form.code = res.data || ''
})
}
},
submitForm() {
this.$refs['wasteWaterAddForm'].validate((valid) => {
if (valid) {
if (this.form.minValue > this.form.maxValue) {
this.$modal.msgError('最小值不能大于最大值')
return false
}
console.log(this.form)
if (this.isEdit) {
//
environmentalCheckUpdate({ ...this.form }).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit')
}
})
} else {
environmentalCheckCreate({ ...this.form }).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit')
}
})
}
} else {
return false
}
})
},
formClear() {
this.$refs.wasteWaterAddForm.resetFields()
this.isEdit = false
}
}
}
</script>

View File

@ -0,0 +1,205 @@
<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="80"
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 WasteWaterAdd from './components/wasteWaterAdd'
import { publicFormatter } from '@/utils/dict'
import { environmentalCheckPage, environmentalCheckDelete } from '@/api/safetyEnvironmental/environmental'
const tableProps = [
{
prop: 'name',
label: '指标名称',
minWidth: 120,
showOverflowtooltip: true
},
{
prop: 'code',
label: '指示编码',
minWidth: 120
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('environment_check_unit')
},
{
prop: 'minValue',
label: '最小值'
},
{
prop: 'maxValue',
label: '最大值'
},
{
prop: 'creator',
label: '创建人'
},
{
prop: 'createTime',
label: '创建时间',
filter: parseTime,
minWidth: 160
}
]
export default {
name: 'WasteWaterDetectionIndication',
data() {
return {
formConfig: [
{
type: 'input',
label: '指标名称',
placeholder: '指标名称',
param: 'name'
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
},
{
type: this.$auth.hasPermi('base:waste-water:create') ? 'separate' : '',
},
{
type: this.$auth.hasPermi('base:waste-water:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
}
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
checkType: 1,
name: null
},
total: 0,
tableProps,
list: [],
tableH: this.tableHeight(260),
tableBtn: [
this.$auth.hasPermi('base:waste-water:update')
? {
type: 'edit',
btnName: '编辑'
}
: undefined,
this.$auth.hasPermi('base:waste-water:delete')
? {
type: 'delete',
btnName: '删除'
}
: undefined
].filter((v)=>v),
addOrEditTitle: '',
centervisible: false
}
},
components: { WasteWaterAdd },
mounted() {
this.getList()
},
methods: {
getList() {
environmentalCheckPage({...this.queryParams}).then(res => {
this.list = res.data.list || []
this.total = res.data.total || 0
})
},
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 environmentalCheckDelete({ 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,150 @@
<template>
<div class="wasteWaterManagement">
<div class="box1">
<div class="boxTitle">
<span class="blueTitle"></span>
<span>检测指标实时数据</span>
</div>
<div class="itemBox">
<div class="itemClass" v-for="(item, index) in realtimeList" :key='index'>
<div class="itemSub">
<p class="itemNum">{{item.checkValue}}</p>
<p class="itemDescribe">
<img src="./../../../../../assets/images/detectionData.png" alt="">
{{item.name}}</p>
</div>
</div>
</div>
</div>
<div class="box2">
<div class="boxTitle">
<span class="blueTitle"></span>
<span>检测指标趋势图</span>
</div>
<!-- 搜索工作栏 -->
<search-area @submit="getTrend"/>
<line-chart :chartData="chartData" v-show='Object.keys(chartData).length !== 0' :timeDim="queryParams.timeDim"/>
<!-- 没有数据 -->
<div class="no-data-bg" v-show='Object.keys(chartData).length === 0'></div>
</div>
</div>
</template>
<script>
import { environmentalCheckRealtime, environmentalCheckRealtimeTrend } from '@/api/safetyEnvironmental/environmental'
import LineChart from './../../components/lineChart'
import SearchArea from './../../components/searchArea'
export default {
name: 'WasteWaterManagement',
data(){
return {
realtimeList:[],
queryParams:{
checkType: 1,
timeDim: null,
timeRange: []
},
chartData: {}
}
},
components: { LineChart, SearchArea },
mounted() {
this.getMsg()
},
methods: {
getMsg() {
environmentalCheckRealtime({checkType: 1}).then(res => {
console.log(res)
this.realtimeList = res.data || []
})
},
getTrend(params) {
console.log(params)
this.queryParams.timeDim = params.timeDim
this.queryParams.timeRange[0] = params.startTime
this.queryParams.timeRange[1] = params.endTime
environmentalCheckRealtimeTrend({...this.queryParams}).then(res => {
console.log(res)
if (res.code === 0) {
this.chartData = res.data
} else {
this.chartData = {}
}
})
}
}
}
</script>
<style lang='scss' scoped>
.wasteWaterManagement {
background-color: #f2f4f9;
.box1 {
height: 172px;
padding: 12px 16px 0;
margin-bottom: 8px;
background-color: #fff;
border-radius: 9px;
.itemBox {
display: flex;
flex-flow: row nowrap;
overflow: auto;
.itemClass {
width: 198px;
height: 88px;
// border: 1px solid green;
padding: 12px 0px 12px 18px;
.itemSub {
width: 176px;
height: 65px;
padding-right: 26px;
border-right: 1px solid #E8E8E8;
P{
margin: 0;
img {
width: 24px;
height: 24px;
vertical-align: middle;
}
}
.itemNum {
font-size: 32px;
font-weight: 600;
height: 43px;
color: #3E6AF7;
text-align: right;
}
.itemDescribe {
font-size: 16px;
text-align: right;
}
}
}
}
.itemClass:last-child > .itemSub{
border: none !important;
}
}
.box2 {
background-color: #fff;
border-radius: 9px;
padding: 16px;
height: calc(100vh - 308px);
}
.boxTitle {
display: inline-block;
font-size: 16px;
font-weight: 400;
color: #000000;
margin:0 10px 20px 0;
}
.blueTitle {
content: '';
display: inline-block;
width: 4px;
height: 18px;
background-color: #0B58FF;
border-radius: 1px;
margin-right: 8px;
vertical-align: bottom;
}
}
</style>

View File

@ -28,6 +28,7 @@
<el-table v-if="refreshTable" v-loading="loading" :data="deptList" row-key="id" :default-expand-all="isExpandAll" <el-table v-if="refreshTable" v-loading="loading" :data="deptList" row-key="id" :default-expand-all="isExpandAll"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"> :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
<el-table-column prop="id" label="部门编码" width="260"></el-table-column>
<el-table-column prop="name" label="部门名称" width="260"></el-table-column> <el-table-column prop="name" label="部门名称" width="260"></el-table-column>
<el-table-column prop="leader" label="负责人" :formatter="userNicknameFormat" width="120"/> <el-table-column prop="leader" label="负责人" :formatter="userNicknameFormat" width="120"/>
<el-table-column prop="sort" label="排序" width="200"></el-table-column> <el-table-column prop="sort" label="排序" width="200"></el-table-column>

View File

@ -62,6 +62,7 @@ const tableProps = [
{ {
prop: 'code', prop: 'code',
label: '物品编码', label: '物品编码',
width: 200
}, },
{ {
prop: 'spec', prop: 'spec',

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-11-03 16:37:06 * @Date: 2023-11-03 16:37:06
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2023-11-24 14:35:01 * @LastEditTime: 2023-12-06 15:31:23
* @Description: * @Description:
--> -->
<template> <template>
@ -42,7 +42,7 @@
<span>{{ parseTime(scope.row.latestOutTime) }}</span> <span>{{ parseTime(scope.row.latestOutTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="100"> <el-table-column label="操作" width="100" v-if="false">
<template v-slot="scope"> <template v-slot="scope">
<el-button <el-button
size="mini" size="mini"
@ -134,16 +134,16 @@ export default {
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, },
{ // {
type: 'separate', // type: 'separate',
}, // },
{ // {
type: this.$auth.hasPermi('end-material:warehouse-realtime:create') ? 'button' : '', // type: this.$auth.hasPermi('end-material:warehouse-realtime:create') ? 'button' : '',
btnName: '入库', // btnName: '',
name: 'add', // name: 'add',
color: 'primary', // color: 'primary',
plain: true, // plain: true,
}, // },
], ],
}; };
}, },

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2023-11-23 16:08:09 * @LastEditTime: 2023-12-06 15:15:52
* @Description: * @Description:
--> -->
<template> <template>
@ -41,21 +41,23 @@ const tableProps = [
{ {
prop: 'num', prop: 'num',
label: '数量', label: '数量',
width: 50
}, },
{ {
prop: 'allowTime', prop: 'allowTime',
label: '允许留存时长(天)', label: '允许留存时长(天)',
width: 150 width: 130
}, },
{ {
prop: 'inTime', prop: 'inTime',
label: '入库时间', label: '入库时间',
filter: parseTime, filter: parseTime,
width: 150
}, },
{ {
prop: 'leftTime', prop: 'leftTime',
label: '剩余留存时长(天)', label: '剩余留存时长(天)',
width: 150 width: 130
}, },
{ {
prop: 'remark', prop: 'remark',

View File

@ -16,7 +16,7 @@
<method-btn <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
:width="140" :width="70"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleClick" /> @clickBtn="handleClick" />
@ -36,7 +36,7 @@
:dialogTitle="addOrEditTitle" :dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible" :dialogVisible="addOrUpdateVisible"
:before-close="handleCancel" :before-close="handleCancel"
width="50%"> width="60%">
<add-or-update <add-or-update
ref="addOrUpdate" ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update> @refreshDataList="successSubmit"></add-or-update>
@ -99,7 +99,7 @@ const tableProps = [
prop: 'inTime', prop: 'inTime',
label: '入库时间', label: '入库时间',
filter: parseTime, filter: parseTime,
minWidth: 100, width: 150
}, },
{ {
prop: 'remark', prop: 'remark',
@ -124,18 +124,18 @@ export default {
tableData: [], tableData: [],
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi(`end-material:warehouse-realtime-location:query`) // this.$auth.hasPermi(`end-material:warehouse-realtime-location:query`)
? { // ? {
type: 'out', // type: 'out',
btnName: '出库', // btnName: '',
} // }
: undefined, // : undefined,
this.$auth.hasPermi(`end-material:warehouse-realtime-location:query`) // this.$auth.hasPermi(`end-material:warehouse-realtime-location:query`)
? { // ? {
type: 'in', // type: 'in',
btnName: '入库', // btnName: '',
} // }
: undefined, // : undefined,
this.$auth.hasPermi(`end-material:warehouse-realtime-location:query`) this.$auth.hasPermi(`end-material:warehouse-realtime-location:query`)
? { ? {
type: 'detail', type: 'detail',

View File

@ -62,6 +62,7 @@ const tableProps = [
{ {
prop: 'code', prop: 'code',
label: '物品编码', label: '物品编码',
width: 200
}, },
{ {
prop: 'spec', prop: 'spec',

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-11-03 16:37:06 * @Date: 2023-11-03 16:37:06
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2023-11-24 14:36:24 * @LastEditTime: 2023-12-06 15:31:06
* @Description: * @Description:
--> -->
<template> <template>
@ -42,7 +42,7 @@
<span>{{ parseTime(scope.row.latestOutTime) }}</span> <span>{{ parseTime(scope.row.latestOutTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="100"> <el-table-column label="操作" width="100" v-if="false">
<template v-slot="scope"> <template v-slot="scope">
<el-button <el-button
size="mini" size="mini"
@ -134,16 +134,16 @@ export default {
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, },
{ // {
type: 'separate', // type: 'separate',
}, // },
{ // {
type: this.$auth.hasPermi('out-material:warehouse-realtime:create') ? 'button' : '', // type: this.$auth.hasPermi('out-material:warehouse-realtime:create') ? 'button' : '',
btnName: '入库', // btnName: '',
name: 'add', // name: 'add',
color: 'primary', // color: 'primary',
plain: true, // plain: true,
}, // },
], ],
}; };
}, },

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2023-11-23 16:07:43 * @LastEditTime: 2023-12-06 15:15:40
* @Description: * @Description:
--> -->
<template> <template>
@ -41,21 +41,23 @@ const tableProps = [
{ {
prop: 'num', prop: 'num',
label: '数量', label: '数量',
width: 50
}, },
{ {
prop: 'allowTime', prop: 'allowTime',
label: '允许留存时长(天)', label: '允许留存时长(天)',
width: 150, width: 130
}, },
{ {
prop: 'inTime', prop: 'inTime',
label: '入库时间', label: '入库时间',
filter: parseTime, filter: parseTime,
width: 150
}, },
{ {
prop: 'leftTime', prop: 'leftTime',
label: '剩余留存时长(天)', label: '剩余留存时长(天)',
width: 150, width: 130
}, },
{ {
prop: 'remark', prop: 'remark',

View File

@ -16,7 +16,7 @@
<method-btn <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
:width="140" :width="70"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleClick" /> @clickBtn="handleClick" />
@ -36,7 +36,7 @@
:dialogTitle="addOrEditTitle" :dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible" :dialogVisible="addOrUpdateVisible"
:before-close="handleCancel" :before-close="handleCancel"
width="50%"> width="60%">
<add-or-update <add-or-update
ref="addOrUpdate" ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update> @refreshDataList="successSubmit"></add-or-update>
@ -99,7 +99,7 @@ const tableProps = [
prop: 'inTime', prop: 'inTime',
label: '入库时间', label: '入库时间',
filter: parseTime, filter: parseTime,
minWidth: 100, width: 150
}, },
{ {
prop: 'remark', prop: 'remark',
@ -124,18 +124,18 @@ export default {
tableData: [], tableData: [],
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi(`out-material:warehouse-realtime-location:query`) // this.$auth.hasPermi(`out-material:warehouse-realtime-location:query`)
? { // ? {
type: 'out', // type: 'out',
btnName: '出库', // btnName: '',
} // }
: undefined, // : undefined,
this.$auth.hasPermi(`out-material:warehouse-realtime-location:query`) // this.$auth.hasPermi(`out-material:warehouse-realtime-location:query`)
? { // ? {
type: 'in', // type: 'in',
btnName: '入库', // btnName: '',
} // }
: undefined, // : undefined,
this.$auth.hasPermi(`out-material:warehouse-realtime-location:query`) this.$auth.hasPermi(`out-material:warehouse-realtime-location:query`)
? { ? {
type: 'detail', type: 'detail',

View File

@ -62,6 +62,7 @@ const tableProps = [
{ {
prop: 'code', prop: 'code',
label: '物品编码', label: '物品编码',
width: 200
}, },
{ {
prop: 'spec', prop: 'spec',

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-11-03 16:37:06 * @Date: 2023-11-03 16:37:06
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2023-11-24 14:36:08 * @LastEditTime: 2023-12-06 15:30:52
* @Description: * @Description:
--> -->
<template> <template>
@ -42,7 +42,7 @@
<span>{{ parseTime(scope.row.latestOutTime) }}</span> <span>{{ parseTime(scope.row.latestOutTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="100"> <el-table-column label="操作" width="100" v-if="false">
<template v-slot="scope"> <template v-slot="scope">
<el-button <el-button
size="mini" size="mini"
@ -134,16 +134,16 @@ export default {
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, },
{ // {
type: 'separate', // type: 'separate',
}, // },
{ // {
type: this.$auth.hasPermi('pack-material:warehouse-realtime:create') ? 'button' : '', // type: this.$auth.hasPermi('pack-material:warehouse-realtime:create') ? 'button' : '',
btnName: '入库', // btnName: '',
name: 'add', // name: 'add',
color: 'primary', // color: 'primary',
plain: true, // plain: true,
}, // },
], ],
}; };
}, },

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2023-11-23 16:08:22 * @LastEditTime: 2023-12-06 15:15:26
* @Description: * @Description:
--> -->
<template> <template>
@ -41,21 +41,23 @@ const tableProps = [
{ {
prop: 'num', prop: 'num',
label: '数量', label: '数量',
width: 50
}, },
{ {
prop: 'allowTime', prop: 'allowTime',
label: '允许留存时长(天)', label: '允许留存时长(天)',
width: 150 width: 130
}, },
{ {
prop: 'inTime', prop: 'inTime',
label: '入库时间', label: '入库时间',
filter: parseTime, filter: parseTime,
width: 150
}, },
{ {
prop: 'leftTime', prop: 'leftTime',
label: '剩余留存时长(天)', label: '剩余留存时长(天)',
width: 150 width: 130
}, },
{ {
prop: 'remark', prop: 'remark',

View File

@ -16,7 +16,7 @@
<method-btn <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
:width="140" :width="70"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleClick" /> @clickBtn="handleClick" />
@ -36,7 +36,7 @@
:dialogTitle="addOrEditTitle" :dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible" :dialogVisible="addOrUpdateVisible"
:before-close="handleCancel" :before-close="handleCancel"
width="50%"> width="60%">
<add-or-update <add-or-update
ref="addOrUpdate" ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update> @refreshDataList="successSubmit"></add-or-update>
@ -99,7 +99,7 @@ const tableProps = [
prop: 'inTime', prop: 'inTime',
label: '入库时间', label: '入库时间',
filter: parseTime, filter: parseTime,
minWidth: 100, width: 150
}, },
{ {
prop: 'remark', prop: 'remark',
@ -124,18 +124,18 @@ export default {
tableData: [], tableData: [],
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi(`pack-material:warehouse-realtime-location:query`) // this.$auth.hasPermi(`pack-material:warehouse-realtime-location:query`)
? { // ? {
type: 'out', // type: 'out',
btnName: '出库', // btnName: '',
} // }
: undefined, // : undefined,
this.$auth.hasPermi(`pack-material:warehouse-realtime-location:query`) // this.$auth.hasPermi(`pack-material:warehouse-realtime-location:query`)
? { // ? {
type: 'in', // type: 'in',
btnName: '入库', // btnName: '',
} // }
: undefined, // : undefined,
this.$auth.hasPermi(`pack-material:warehouse-realtime-location:query`) this.$auth.hasPermi(`pack-material:warehouse-realtime-location:query`)
? { ? {
type: 'detail', type: 'detail',

View File

@ -62,6 +62,7 @@ const tableProps = [
{ {
prop: 'code', prop: 'code',
label: '物品编码', label: '物品编码',
width: 200
}, },
{ {
prop: 'spec', prop: 'spec',

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-11-03 16:37:06 * @Date: 2023-11-03 16:37:06
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2023-11-24 14:35:51 * @LastEditTime: 2023-12-06 15:30:39
* @Description: * @Description:
--> -->
<template> <template>
@ -42,7 +42,7 @@
<span>{{ parseTime(scope.row.latestOutTime) }}</span> <span>{{ parseTime(scope.row.latestOutTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="100"> <el-table-column label="操作" width="100" v-if="false">
<template v-slot="scope"> <template v-slot="scope">
<el-button <el-button
size="mini" size="mini"
@ -134,16 +134,16 @@ export default {
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, },
{ // {
type: 'separate', // type: 'separate',
}, // },
{ // {
type: this.$auth.hasPermi('part-material:warehouse-realtime:create') ? 'button' : '', // type: this.$auth.hasPermi('part-material:warehouse-realtime:create') ? 'button' : '',
btnName: '入库', // btnName: '',
name: 'add', // name: 'add',
color: 'primary', // color: 'primary',
plain: true, // plain: true,
}, // },
], ],
}; };
}, },

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2023-11-23 16:08:31 * @LastEditTime: 2023-12-06 15:15:11
* @Description: * @Description:
--> -->
<template> <template>
@ -41,21 +41,23 @@ const tableProps = [
{ {
prop: 'num', prop: 'num',
label: '数量', label: '数量',
width: 50
}, },
{ {
prop: 'allowTime', prop: 'allowTime',
label: '允许留存时长(天)', label: '允许留存时长(天)',
width: 150 width: 130
}, },
{ {
prop: 'inTime', prop: 'inTime',
label: '入库时间', label: '入库时间',
filter: parseTime, filter: parseTime,
width: 150
}, },
{ {
prop: 'leftTime', prop: 'leftTime',
label: '剩余留存时长(天)', label: '剩余留存时长(天)',
width: 150 width: 130
}, },
{ {
prop: 'remark', prop: 'remark',

View File

@ -16,7 +16,7 @@
<method-btn <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
:width="140" :width="70"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleClick" /> @clickBtn="handleClick" />
@ -36,7 +36,7 @@
:dialogTitle="addOrEditTitle" :dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible" :dialogVisible="addOrUpdateVisible"
:before-close="handleCancel" :before-close="handleCancel"
width="50%"> width="60%">
<add-or-update <add-or-update
ref="addOrUpdate" ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update> @refreshDataList="successSubmit"></add-or-update>
@ -99,7 +99,7 @@ const tableProps = [
prop: 'inTime', prop: 'inTime',
label: '入库时间', label: '入库时间',
filter: parseTime, filter: parseTime,
minWidth: 100, width: 150
}, },
{ {
prop: 'remark', prop: 'remark',
@ -124,18 +124,18 @@ export default {
tableData: [], tableData: [],
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi(`part-material:warehouse-realtime-location:query`) // this.$auth.hasPermi(`part-material:warehouse-realtime-location:query`)
? { // ? {
type: 'out', // type: 'out',
btnName: '出库', // btnName: '',
} // }
: undefined, // : undefined,
this.$auth.hasPermi(`part-material:warehouse-realtime-location:query`) // this.$auth.hasPermi(`part-material:warehouse-realtime-location:query`)
? { // ? {
type: 'in', // type: 'in',
btnName: '入库', // btnName: '',
} // }
: undefined, // : undefined,
this.$auth.hasPermi(`part-material:warehouse-realtime-location:query`) this.$auth.hasPermi(`part-material:warehouse-realtime-location:query`)
? { ? {
type: 'detail', type: 'detail',

View File

@ -62,6 +62,7 @@ const tableProps = [
{ {
prop: 'code', prop: 'code',
label: '物品编码', label: '物品编码',
width: 200
}, },
{ {
prop: 'spec', prop: 'spec',

View File

@ -42,7 +42,7 @@
<span>{{ parseTime(scope.row.latestOutTime) }}</span> <span>{{ parseTime(scope.row.latestOutTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="100"> <el-table-column label="操作" width="100" v-if="false">
<template v-slot="scope"> <template v-slot="scope">
<el-button <el-button
size="mini" size="mini"
@ -134,16 +134,16 @@ export default {
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, },
{ // {
type: 'separate', // type: 'separate',
}, // },
{ // {
type: this.$auth.hasPermi('raw-material:warehouse-realtime:create') ? 'button' : '', // type: this.$auth.hasPermi('raw-material:warehouse-realtime:create') ? 'button' : '',
btnName: '入库', // btnName: '',
name: 'add', // name: 'add',
color: 'primary', // color: 'primary',
plain: true, // plain: true,
}, // },
], ],
}; };
}, },

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2023-11-23 16:08:41 * @LastEditTime: 2023-12-06 15:14:12
* @Description: * @Description:
--> -->
<template> <template>
@ -41,21 +41,23 @@ const tableProps = [
{ {
prop: 'num', prop: 'num',
label: '数量', label: '数量',
width: 50
}, },
{ {
prop: 'allowTime', prop: 'allowTime',
label: '允许留存时长(天)', label: '允许留存时长(天)',
width: 150 width: 130
}, },
{ {
prop: 'inTime', prop: 'inTime',
label: '入库时间', label: '入库时间',
filter: parseTime, filter: parseTime,
width: 150
}, },
{ {
prop: 'leftTime', prop: 'leftTime',
label: '剩余留存时长(天)', label: '剩余留存时长(天)',
width: 150 width: 130
}, },
{ {
prop: 'remark', prop: 'remark',

View File

@ -16,7 +16,7 @@
<method-btn <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
:width="140" :width="70"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleClick" /> @clickBtn="handleClick" />
@ -36,7 +36,7 @@
:dialogTitle="addOrEditTitle" :dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible" :dialogVisible="addOrUpdateVisible"
:before-close="handleCancel" :before-close="handleCancel"
width="50%"> width="60%">
<add-or-update <add-or-update
ref="addOrUpdate" ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update> @refreshDataList="successSubmit"></add-or-update>
@ -99,7 +99,7 @@ const tableProps = [
prop: 'inTime', prop: 'inTime',
label: '入库时间', label: '入库时间',
filter: parseTime, filter: parseTime,
minWidth: 100, width: 150
}, },
{ {
prop: 'remark', prop: 'remark',
@ -124,18 +124,18 @@ export default {
tableData: [], tableData: [],
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi(`raw-material:warehouse-realtime-location:query`) // this.$auth.hasPermi(`raw-material:warehouse-realtime-location:query`)
? { // ? {
type: 'out', // type: 'out',
btnName: '出库', // btnName: '',
} // }
: undefined, // : undefined,
this.$auth.hasPermi(`raw-material:warehouse-realtime-location:query`) // this.$auth.hasPermi(`raw-material:warehouse-realtime-location:query`)
? { // ? {
type: 'in', // type: 'in',
btnName: '入库', // btnName: '',
} // }
: undefined, // : undefined,
this.$auth.hasPermi(`raw-material:warehouse-realtime-location:query`) this.$auth.hasPermi(`raw-material:warehouse-realtime-location:query`)
? { ? {
type: 'detail', type: 'detail',

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 13:52:10 * @Date: 2023-08-01 13:52:10
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2023-11-23 15:20:31 * @LastEditTime: 2023-12-05 14:05:08
* @Description: * @Description:
--> -->
<template> <template>
@ -92,7 +92,7 @@ export default {
updateURL: updateWarehouse, updateURL: updateWarehouse,
infoURL: getWarehouse, infoURL: getWarehouse,
}, },
nameList: ['warehouse_type', 'warehouse_good_type'], nameList: ['warehouse_type', 'material_type'],
dataForm: { dataForm: {
id: undefined, id: undefined,
name: undefined, name: undefined,

17390
yarn.lock

File diff suppressed because it is too large Load Diff