1
This commit is contained in:
@@ -1,185 +1,188 @@
|
||||
<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>
|
||||
<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'
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import {
|
||||
environmentalCheckRecordPage,
|
||||
environmentalCheckRecordExport,
|
||||
environmentalCheckPage,
|
||||
} from '@/api/safetyEnvironmental/environmental';
|
||||
import moment from 'moment';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
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
|
||||
}
|
||||
]
|
||||
{
|
||||
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 ''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
name: 'VocDetectionHistory',
|
||||
mixins: [tableHeightMixin],
|
||||
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,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
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;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: #fee1e1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,205 +1,210 @@
|
||||
<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>
|
||||
<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'
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import VocAdd from './components/vocAdd';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import {
|
||||
environmentalCheckPage,
|
||||
environmentalCheckDelete,
|
||||
} from '@/api/safetyEnvironmental/environmental';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
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
|
||||
}
|
||||
]
|
||||
{
|
||||
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()
|
||||
}
|
||||
}
|
||||
}
|
||||
name: 'VocDetectionIndication',
|
||||
mixins: [tableHeightMixin],
|
||||
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: [],
|
||||
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>
|
||||
@@ -1,185 +1,188 @@
|
||||
<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>
|
||||
<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'
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import {
|
||||
environmentalCheckRecordPage,
|
||||
environmentalCheckRecordExport,
|
||||
environmentalCheckPage,
|
||||
} from '@/api/safetyEnvironmental/environmental';
|
||||
import moment from 'moment';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
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
|
||||
}
|
||||
]
|
||||
{
|
||||
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 ''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
name: 'WasteGasDetectionHistory',
|
||||
mixins: [tableHeightMixin],
|
||||
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,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
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;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: #fee1e1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,205 +1,210 @@
|
||||
<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>
|
||||
<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'
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import WasteGasAdd from './components/wasteGasAdd';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import {
|
||||
environmentalCheckPage,
|
||||
environmentalCheckDelete,
|
||||
} from '@/api/safetyEnvironmental/environmental';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
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
|
||||
}
|
||||
]
|
||||
{
|
||||
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()
|
||||
}
|
||||
}
|
||||
}
|
||||
name: 'WasteGasDetectionIndication',
|
||||
mixins: [tableHeightMixin],
|
||||
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: [],
|
||||
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>
|
||||
@@ -1,185 +1,190 @@
|
||||
<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>
|
||||
<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'
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import {
|
||||
environmentalCheckRecordPage,
|
||||
environmentalCheckRecordExport,
|
||||
environmentalCheckPage,
|
||||
} from '@/api/safetyEnvironmental/environmental';
|
||||
import moment from 'moment';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
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
|
||||
}
|
||||
]
|
||||
{
|
||||
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 ''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
name: 'WasteWaterDetectionHistory',
|
||||
mixins: [tableHeightMixin],
|
||||
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,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
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;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: #fee1e1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,205 +1,212 @@
|
||||
<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>
|
||||
<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'
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import WasteWaterAdd from './components/wasteWaterAdd';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import {
|
||||
environmentalCheckPage,
|
||||
environmentalCheckDelete,
|
||||
} from '@/api/safetyEnvironmental/environmental';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
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
|
||||
}
|
||||
]
|
||||
{
|
||||
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()
|
||||
}
|
||||
}
|
||||
}
|
||||
name: 'WasteWaterDetectionIndication',
|
||||
mixins: [tableHeightMixin],
|
||||
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: [],
|
||||
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>
|
||||
Reference in New Issue
Block a user