<template>
|
<div class="deviceCalendar_list">
|
<a-card :bordered="false">
|
<!-- 查询区域 -->
|
|
<div>
|
<div class="table-page-search-wrapper">
|
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
<a-row :gutter="24">
|
<a-col :md="6" :sm="6">
|
<a-form-item label="时间">
|
<a-range-picker @change="dateParamChange" format="YYYYMMDD" v-model="dates"/>
|
</a-form-item>
|
</a-col>
|
<a-col :md="2" :sm="2" :xs="2">
|
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
|
</a-col>
|
<a-col :md="2" :sm="2">
|
<!--//沈飞-->
|
<a-button v-has="'user.disposition'" type="primary" @click="handleAdd" icon="plus">配置</a-button>
|
|
<!--<a-button type="primary" @click="handleAdd" icon="plus">配置</a-button>-->
|
</a-col>
|
|
|
</a-row>
|
</a-form>
|
</div>
|
</div>
|
|
<div style="overflow: auto;width: 100%;margin-top: 20px;height: 569px;">
|
<a-table ref="table" bordered size="middle" rowKey="id" :columns="columns" @change="handleTableChange" class="ant-table-striped"
|
:dataSource="dataSource" :pagination="ipagination" :loading="loading" :row-class-name="(_record, index) => (index % 2 === 1 ? 'table-striped' : null)">
|
<span slot="action"
|
slot-scope="text, record">
|
<a-popconfirm
|
title="确定删除吗?"
|
@confirm="() => handleDelete(record.id)"
|
>
|
<a>删除</a>
|
</a-popconfirm>
|
</span>
|
<span slot="isDaySpan" slot-scope="text, record">
|
<span v-if="text == 'true'">是</span>
|
<span v-if="text == 'false'">否</span>
|
</span>
|
</a-table>
|
</div>
|
<device-calendar-model ref="modalForm" @ok="modalFormOk"></device-calendar-model>
|
</a-card>
|
</div>
|
</template>
|
|
<script>
|
import moment from 'moment'
|
import { filterObj } from '@/utils/util';
|
import { putAction, getAction } from '@/api/manage'
|
import DeviceCalendarModel from './DeviceCalendarModel'
|
import DeviceCalendarAdd from './DeviceCalendarAdd'
|
import DeviceCalendarListModel from './DeviceCalendarListModel'
|
import {
|
JeecgListMixin
|
} from '@/mixins/JeecgListMixin'
|
|
export default {
|
name: 'DeviceCalendarList',
|
components: { DeviceCalendarModel,DeviceCalendarAdd ,DeviceCalendarListModel},
|
mixins: [JeecgListMixin],
|
data() {
|
return {
|
dates:[],
|
yearAndMonth: {},
|
identifying: [],
|
queryParam: {},
|
disableMixinCreated: true,
|
/* 分页参数 */
|
ipagination:{
|
current: 1,
|
pageSize: 10,
|
pageSizeOptions: ['10', '20', '30'],
|
showTotal: (total, range) => {
|
return range[0] + "-" + range[1] + " 共" + total + "条"
|
},
|
showQuickJumper: true,
|
showSizeChanger: true,
|
total: 0
|
},
|
columns: [
|
{
|
title: '日期',
|
align: 'center',
|
dataIndex: 'effectiveDate',
|
},
|
{
|
title: '设备编号',
|
align: 'center',
|
dataIndex: 'equipmentId'
|
},
|
{
|
title: '设备名称',
|
align: 'center',
|
dataIndex: 'equipmentName',
|
},
|
{
|
title: '班制',
|
align: 'center',
|
dataIndex: 'shiftName'
|
},
|
{
|
title: '班次',
|
align: 'center',
|
dataIndex: 'shiftSubName'
|
},
|
{
|
title: '开始时间',
|
align: 'center',
|
dataIndex: 'startDate'
|
},
|
{
|
title: '结束时间',
|
align: 'center',
|
dataIndex: 'endDate'
|
},
|
{
|
title: '是否跨天',
|
align: 'center',
|
dataIndex: 'isDaySpan',
|
scopedSlots: { customRender: 'isDaySpan' }
|
},
|
{
|
title: '开始休息时间',
|
align: 'center',
|
dataIndex: 'sleepStartDate'
|
},
|
{
|
title: '结束休息时间',
|
align: 'center',
|
dataIndex: 'sleepEndDate'
|
},
|
{
|
title: '操作',
|
dataIndex: 'action',
|
align: "center",
|
fixed: "right",
|
width: 147,
|
scopedSlots: { customRender: 'action' }
|
}
|
],
|
checkedList: ['lyl'],
|
dataList: [],
|
url: {
|
list: '/mdc/mdcDeviceCalendar/list',
|
delete:'/mdc/mdcDeviceCalendar/delete'
|
}
|
}
|
},
|
props: { node: {}, Type:'' },
|
created() {
|
this.dates = [moment().subtract('days', 0), moment().subtract('days', 0)]
|
this.queryParam.startTime = moment(this.dates[0]).format('YYYYMMDD')
|
this.queryParam.endTime = moment(this.dates[1]).format('YYYYMMDD')
|
this.queryParam.typeTree = "1"
|
this.loadData()
|
},
|
watch: {
|
Type(valmath){
|
this.dataList = [];
|
this.queryParam.typeTree = valmath
|
// console.log(this.queryParams.typeTree)
|
},
|
node(val) { //监听currSelected 变化,将变化后的数值传递给 getCurrSelected 事件
|
if (JSON.stringify(val) != '{}') {
|
if (val.equipmentId != null) {
|
this.queryParam.equipmentId = val.equipmentId
|
this.queryParam.parentId = " "
|
this.ipagination.current = 1
|
this.loadData()
|
} else {
|
this.queryParam.parentId = val.key
|
this.queryParam.equipmentId = null
|
this.ipagination.current = 1
|
this.loadData()
|
}
|
}
|
}
|
},
|
methods: {
|
dateParamChange(v1, v2) {
|
this.queryParam.startTime = v2[0]
|
this.queryParam.endTime = v2[1]
|
},
|
searchQuery() {
|
this.loadData()
|
},
|
searchReset() {
|
this.queryParam = {}
|
this.loadData()
|
},
|
loadData(arg) {
|
this.dataSource = [];
|
if(!this.url.list){
|
this.$message.error("请设置url.list属性!")
|
return
|
}
|
//加载数据 若传入参数1则加载第一页的内容
|
if (arg === 1) {
|
this.ipagination.current = 1;
|
}
|
|
var params = this.getQueryParams();//查询条件
|
|
if(!params){
|
return false;
|
}
|
params.startTime = this.queryParam.startTime;
|
params.endTime = this.queryParam.endTime;
|
params.parentId = this.queryParam.parentId;
|
params.equipmentId = this.queryParam.equipmentId;
|
params.orderByName = "ascend";
|
this.loading = true;
|
getAction(this.url.list, params).then((res) => {
|
if (res.success) {
|
// console.log(res)
|
//update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
|
this.dataSource = res.result.records||res.result;
|
if(res.result.total)
|
{
|
this.ipagination.total = res.result.total;
|
}else{
|
this.ipagination.total = 0;
|
}
|
//update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
}else{
|
this.$message.warning(res.message)
|
}
|
}).finally(() => {
|
this.loading = false
|
})
|
},
|
handleAdd() {
|
let record = {}
|
if (JSON.stringify(this.node) != '{}') {
|
record = { equipmentId: this.node.equipmentId, equmentName: this.node.equipmentName }
|
}
|
this.$refs.modalForm.add(record)
|
this.$refs.modalForm.title = '设备工作日历配置'
|
this.$refs.modalForm.disableSubmit = false
|
}
|
}
|
}
|
</script>
|
<style scoped>
|
@media screen and (min-width: 1920px){
|
.deviceCalendar_list{
|
height: 812px!important;
|
overflow: scroll;
|
}
|
}
|
@media screen and (min-width: 1680px) and (max-width: 1920px){
|
.deviceCalendar_list{
|
height: 812px!important;
|
overflow: scroll;
|
}
|
}
|
@media screen and (min-width: 1400px) and (max-width: 1680px){
|
.deviceCalendar_list{
|
height: 664px!important;
|
overflow: scroll;
|
}
|
}
|
@media screen and (min-width: 1280px) and (max-width: 1400px){
|
.deviceCalendar_list{
|
height: 565px!important;
|
overflow: scroll;
|
}
|
}
|
@media screen and (max-width: 1280px){
|
.deviceCalendar_list{
|
height: 565px!important;
|
overflow: scroll;
|
}
|
}
|
|
.ant-table-striped /deep/ .table-striped td {
|
background-color: #fafafa;
|
}
|
.identifyingclass {
|
width: 55px;
|
height: 15px;
|
display: inline-block
|
}
|
|
.dataContent {
|
border: 1px solid #ccc;
|
width: 100%;
|
/*height: 100%;*/
|
overflow: hidden;
|
overflow-y: auto;
|
text-align: center;
|
}
|
|
.dataContent .fixed th {
|
width: 50px;
|
}
|
|
.dataContent .thead th {
|
background-color: #fafafa;
|
text-align: center;
|
height: 30px;
|
padding: 5px;
|
}
|
|
.dataContent .notfixed th {
|
width: auto;
|
}
|
|
.dataContent tr td {
|
height: 35px;
|
}
|
|
.dataContent .mathData td {
|
padding: 10px;
|
/*display: none;*/
|
}
|
|
.dataContent .mathData .td {
|
/*background-color: #ff9bd2;*/
|
display: inline-block;
|
padding: 10px;
|
}
|
|
.dataContent .mathData .tdd {
|
/*display: none;*/
|
}
|
|
.pink {
|
background-color: #ff9bd2;
|
}
|
|
.yellow {
|
background-color: #e8ff37;
|
}
|
|
.green {
|
background-color: #99ff4e;
|
}
|
</style>
|