<template>
|
<a-card :bordered="false">
|
<!-- 查询区域 -->
|
<a-form class="query-form" layout="inline" :form="queryForm" @keyup.enter.native="searchQuery">
|
<a-form-item label="开始时间">
|
<a-range-picker
|
:show-time="{
|
hideDisabledOptions: true,
|
defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('11:59:59', 'HH:mm:ss')],
|
}"
|
:value="defaultTime"
|
style="width: 100%"
|
format="YYYY-MM-DD HH:mm:ss"
|
@change="onChange"
|
/>
|
</a-form-item>
|
<a-form-item label="是否符合规范">
|
<a-select v-model="queryParam.eventType" style="width: 180px" allowClear placeholder="请选择是否符合规范">
|
<a-select-option :value="1"> 合规操作 </a-select-option>
|
<a-select-option :value="2"> 异常告警 </a-select-option>
|
</a-select>
|
</a-form-item>
|
<!--<a-form-item label="车牌信息">-->
|
<!--<a-input allowClear style="width: 200px" v-model="queryParam.licenseNum" placeholder="请输入车牌信息" />-->
|
<!--</a-form-item>-->
|
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
|
<a-button type="primary" @click="resetForm" icon="reload" style="margin-left: 8px">重置</a-button>
|
<a-button type="primary" style="margin-left: 10px" icon="download" @click="handleExportXls('record')"
|
>导出</a-button
|
>
|
</a-form>
|
|
<!-- table区域-begin -->
|
<split-pane :min-percent="10" :default-percent="17" split="vertical">
|
<template slot="paneL">
|
<div class="organ_tree_ct">
|
<organ-tree ref="orgTree" @on-tree-node-select="onTreeNodeSelect"></organ-tree>
|
</div>
|
</template>
|
<template slot="paneR">
|
<div class="ant-alert ant-alert-info table-top">
|
<span style="float: right">
|
<a @click="loadData()"><a-icon type="sync" />刷新</a>
|
<a-divider type="vertical" />
|
<column-filter v-model="columns" :defaultColumns="defaultColumns"></column-filter>
|
</span>
|
</div>
|
|
<a-table
|
ref="table"
|
size="middle"
|
class="infoTable"
|
rowKey="id"
|
:scroll="{ x: true }"
|
:columns="columns"
|
:dataSource="dataSource"
|
:pagination="ipagination"
|
:loading="loading"
|
@change="handleTableChange"
|
>
|
<span slot="action" slot-scope="text, record, index, column">
|
<a @click="handleOk(record)">详情</a>
|
</span>
|
<span slot="eventTypeDictText" slot-scope="text, record, index, column">
|
<a-tag :color="record.eventType == 2 ? '#f50' : '#87d068'">{{ record.eventType_dictText }}</a-tag>
|
</span>
|
</a-table>
|
</template>
|
</split-pane>
|
<!-- table区域-end -->
|
|
<!-- 表单区域 -->
|
|
<OiloutRecordModal :visible="show" @modalClose="modalClose" :dialogdetails="dialogdetails"></OiloutRecordModal>
|
</a-card>
|
</template>
|
|
<script>
|
import { JeecgListMixin } from '@tievd/cube-block/lib/mixins/JeecgListMixin'
|
import OrganTree from '../tools/OrganTree'
|
import splitPane from 'vue-splitpane'
|
import OiloutRecordModal from './modules/OiloutRecordModal.vue'
|
import { postAction, putAction, getAction } from '@tievd/cube-block/lib/api/manage'
|
import moment from 'moment'
|
export default {
|
name: 'OiloutRecordList',
|
mixins: [JeecgListMixin],
|
components: {
|
OrganTree,
|
splitPane,
|
OiloutRecordModal,
|
},
|
|
data() {
|
return {
|
description: '卸油记录',
|
// 表头
|
columns: [],
|
show: false,
|
// 列定义
|
defaultColumns: [
|
{
|
title: '序号',
|
dataIndex: '',
|
key: 'rowIndex',
|
width: 60,
|
align: 'center',
|
customRender: function (t, r, index) {
|
return parseInt(index) + 1
|
},
|
},
|
// {
|
// title: '车牌号',
|
// align: 'center',
|
// dataIndex: 'licenseNum',
|
// },
|
{
|
title: '所属机构',
|
align: 'center',
|
dataIndex: 'orgName',
|
},
|
{
|
title: '开始时间',
|
align: 'center',
|
dataIndex: 'startTime',
|
},
|
{
|
title: '结束时间',
|
align: 'center',
|
dataIndex: 'endTime',
|
},
|
{
|
title: '卸油时长/min',
|
align: 'center',
|
dataIndex: 'spandTime',
|
},
|
{
|
title: '是否规范',
|
align: 'center',
|
scopedSlots: { customRender: 'eventTypeDictText' },
|
},
|
{
|
title: '完成情况',
|
align: 'center',
|
dataIndex: 'complete',
|
},
|
{
|
title: '操作',
|
dataIndex: 'action',
|
width: 150,
|
align: 'center',
|
scopedSlots: { customRender: 'action' },
|
},
|
],
|
queryForm: {},
|
url: {
|
list: '/jyz/oiloutRecord/pageList',
|
recordInfo: '/jyz/oiloutEvent/listByRecord',
|
// delete: '/jyz/camera/delete',
|
// deleteBatch: '/jyz/camera/deleteBatch',
|
exportXlsUrl: '/jyz/oiloutRecord/exportXls',
|
// importXlsUrl: '/jyz/camera/importExcel',
|
},
|
selectOrg: '',
|
dialogdetails: {},
|
defaultTime: [],
|
}
|
},
|
|
methods: {
|
moment,
|
onTreeNodeSelect(id, node) {
|
this.selectOrg = this.queryParam.orgCode = node.selectedNodes[0].data.props.orgCode
|
console.log(id, this.selectOrg)
|
this.loadData()
|
},
|
// 监听时间
|
onChange(date, dateString) {
|
console.log(dateString)
|
this.defaultTime = dateString
|
this.queryParam.startTime = dateString[0]
|
this.queryParam.endTime = dateString[1]
|
},
|
// 打开弹窗
|
handleOk(data) {
|
console.log(data)
|
getAction(this.url.recordInfo, { recordId: data.id }).then((res) => {
|
if (res.code == 200) {
|
this.show = true
|
this.dialogdetails = {
|
listData: JSON.parse(JSON.stringify(data)),
|
listDetails: res.result,
|
}
|
} else {
|
this.$message.error(res.message)
|
}
|
})
|
},
|
// 关闭弹窗
|
modalClose() {
|
this.show = false
|
},
|
resetForm() {
|
this.defaultTime = []
|
this.queryParam = {}
|
const { key } = this.$refs.orgTree.defaultFirstData
|
this.$set(this.$refs.orgTree.selectedKeys, 0, key)
|
this.loadData()
|
},
|
},
|
|
created() {},
|
}
|
</script>
|
<style scoped lang="less">
|
@import '~@assets/less/common.less';
|
.table-top {
|
margin-bottom: 16px;
|
height: 32.5px;
|
display: flex;
|
justify-content: flex-end;
|
align-items: center;
|
}
|
.query-form {
|
display: flex;
|
margin-bottom: 20px;
|
flex-wrap: wrap;
|
align-items: center;
|
}
|
.organ_tree_ct {
|
height: 76vh;
|
}
|
</style>
|