|
|
@@ -6,7 +6,7 @@
|
|
|
</el-breadcrumb>-->
|
|
|
<el-row :gutter="5">
|
|
|
<el-col :span="6">
|
|
|
- <el-tree style="height: calc(100vh - 243px); overflow: auto;" draggable highlight-current :expand-on-click-node="true" node-key="id" :data="customerTreeList" :props="orgtreeprops"
|
|
|
+ <el-tree style="height: calc(100vh - 75px); overflow: auto;" draggable highlight-current :expand-on-click-node="true" node-key="id" :data="customerTreeList" :props="orgtreeprops"
|
|
|
@node-click="orgtreeNodeClick" ref="orgmanagetree">
|
|
|
</el-tree>
|
|
|
</el-col>
|
|
|
@@ -16,13 +16,17 @@
|
|
|
<span>
|
|
|
<i class="icon icon-table2"></i>
|
|
|
</span>
|
|
|
- <span style="float: right;">
|
|
|
- <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="NewEntity">添加</el-button>
|
|
|
- </span>
|
|
|
+
|
|
|
<el-form ref="form" :inline="true" style="float: right; margin-top: -10px">
|
|
|
- <el-form-item label="生成时间">
|
|
|
- <el-date-picker size="mini" style="width: 220px" v-model="CreateOn" type="daterange" range-separator="至"
|
|
|
- start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
|
|
+ <el-form-item label="状态">
|
|
|
+ <el-select v-model="statusValue" clearable @change="ProjectTypeChangeHandler" @clear="ProjectTypeClearHandler" placeholder="请选择" size="mini">
|
|
|
+ <el-option
|
|
|
+ v-for="item in statusOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="设备分类">
|
|
|
@@ -40,11 +44,14 @@
|
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" size="mini" style="" @click="NewEntity">添加</el-button>
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
- <el-alert title="提示: 已过期为【红色】, 当月到期为【黄色】" type="warning" :closable="false">
|
|
|
+ <el-alert title="提示: 已过期为【红色】, 一个月内到期为【黄色】,正常为【绿色】" type="warning" :closable="false">
|
|
|
</el-alert>
|
|
|
- <el-table :data="entityList" border style="width: 100%" @sort-change="orderby" :row-class-name="tableRowClassName" size="mini">
|
|
|
+ <el-table :height="437" :data="entityList" border style="width: 100%;" @sort-change="orderby" :cell-class-name="tableRowClassName" size="mini">
|
|
|
<el-table-column label="操作" width="160px" align="center" fixed>
|
|
|
<template slot-scope="scope">
|
|
|
<el-button type="primary" title="编辑" size="small" plain @click="ShowEntityDialog(scope.row.Id)">编辑</el-button>
|
|
|
@@ -52,10 +59,13 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column v-for="column in tableColumns" :key="column.Id"
|
|
|
- v-if="column.prop != 'CreateOn'" :prop="column.prop" sortable min-width="100" :label="column.label" align="center" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column label="状态" width="80px" align="center" >
|
|
|
+ <i class="el-icon-s-opportunity"></i>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column v-for="column in tableColumns" :key="column.Id" :prop="column.prop" sortable min-width="100" :label="column.label" align="center" show-overflow-tooltip></el-table-column>
|
|
|
|
|
|
- <el-table-column prop="CreateOn" sortable min-width="150" label="上次检测日期" align="center" show-overflow-tooltip>
|
|
|
+ <el-table-column prop="LastCheckDate" sortable min-width="150" label="上次检测日期" align="center" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
{{ jstimehandle(scope.row.LastCheckDate+'') }}
|
|
|
</template>
|
|
|
@@ -66,10 +76,19 @@
|
|
|
{{ scope.row.Cycle + ' ' + scope.row.CycleUnit }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+
|
|
|
+ <el-table-column prop="NextCheckDate" sortable min-width="150" label="下次检测日期" align="center" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ jstimehandle(scope.row.NextCheckDate+'') }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
</el-table>
|
|
|
- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
|
|
|
- :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
|
|
|
- </el-pagination>
|
|
|
+ <div class="bottom clearfix">
|
|
|
+ <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
|
|
|
+ :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
</el-card>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -78,14 +97,14 @@
|
|
|
<el-form ref="advancedsearchForm" label-width="110px">
|
|
|
<el-row>
|
|
|
|
|
|
- <el-col :span="12">
|
|
|
+ <!-- <el-col :span="12">
|
|
|
<el-form-item label="生成时间">
|
|
|
<el-date-picker size="mini" v-model="CreateOn" type="daterange" style="width:100%" range-separator="至"
|
|
|
start-placeholder="生成日期" end-placeholder="结束日期"></el-date-picker>
|
|
|
</el-form-item>
|
|
|
- </el-col>
|
|
|
+ </el-col> -->
|
|
|
|
|
|
- <el-col :span="12">
|
|
|
+ <!-- <el-col :span="12">
|
|
|
<el-form-item label="序号">
|
|
|
<el-input v-model="searchForm.OrderNo" style="width:100%" placeholder="请输入"></el-input>
|
|
|
</el-form-item>
|
|
|
@@ -95,7 +114,7 @@
|
|
|
<el-form-item label="编号">
|
|
|
<el-input size="mini" v-model="searchForm.CustNo" style="width:100%" placeholder="请输入"></el-input>
|
|
|
</el-form-item>
|
|
|
- </el-col>
|
|
|
+ </el-col> -->
|
|
|
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="检测地点">
|
|
|
@@ -129,18 +148,19 @@
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <el-dialog title="编辑" :visible.sync="dialogFormVisible">
|
|
|
+ <el-dialog :title="addoredittitle" :visible.sync="dialogFormVisible">
|
|
|
<el-form :model="formData" ref="EntityForm">
|
|
|
- <el-form-item label="序号" :label-width="formLabelWidth">
|
|
|
+ <!-- <el-form-item label="序号" :label-width="formLabelWidth">
|
|
|
<el-input-number v-model="formData.OrderNo" :min="1" style="width:100%" placeholder="请输入"></el-input-number>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item label="编号" :label-width="formLabelWidth">
|
|
|
- <el-input v-model="formData.CustNo" style="width:100%" placeholder="请输入"></el-input>
|
|
|
- </el-form-item>
|
|
|
+
|
|
|
|
|
|
<el-form-item label="设备名称" :label-width="formLabelWidth">
|
|
|
<el-input v-model="formData.DeviceName" autocomplete="off"></el-input>
|
|
|
+ </el-form-item> -->
|
|
|
+ <el-form-item label="编号" :label-width="formLabelWidth">
|
|
|
+ <el-input v-model="formData.CustNo" style="width:100%" placeholder="请输入"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="设备类型" :label-width="formLabelWidth" prop="TemplateTypeId" required>
|
|
|
<el-select ref="refProjectTypeId" v-model="formData.TemplateTypeId" style="width:100%" filterable placeholder="请选择">
|
|
|
@@ -204,6 +224,18 @@
|
|
|
|
|
|
data () {
|
|
|
return {
|
|
|
+ statusOptions: [{
|
|
|
+ value: '-2',
|
|
|
+ label: '已过期'
|
|
|
+ }, {
|
|
|
+ value: '-1',
|
|
|
+ label: '一个月内到期'
|
|
|
+ }, {
|
|
|
+ value: '0',
|
|
|
+ label: '正常'
|
|
|
+ }],
|
|
|
+ statusValue: '',
|
|
|
+ addoredittitle: '添加',
|
|
|
QueryProjectTypeId: '',
|
|
|
dialogVisible: false,
|
|
|
dialogFormVisible: false,
|
|
|
@@ -251,19 +283,19 @@
|
|
|
sort: true
|
|
|
},
|
|
|
|
|
|
- {
|
|
|
- prop: 'OrderNo',
|
|
|
- label: '序号',
|
|
|
- width: 100,
|
|
|
- sort: true
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // prop: 'OrderNo',
|
|
|
+ // label: '序号',
|
|
|
+ // width: 100,
|
|
|
+ // sort: true
|
|
|
+ // },
|
|
|
|
|
|
- {
|
|
|
- prop: 'CustNo',
|
|
|
- label: '编号',
|
|
|
- width: 100,
|
|
|
- sort: true
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // prop: 'CustNo',
|
|
|
+ // label: '编号',
|
|
|
+ // width: 100,
|
|
|
+ // sort: true
|
|
|
+ // },
|
|
|
|
|
|
{
|
|
|
prop: 'Spec',
|
|
|
@@ -356,7 +388,7 @@
|
|
|
this.initDatas()
|
|
|
},
|
|
|
|
|
|
- tableRowClassName ({row}) {
|
|
|
+ tableRowClassName ({row, column, rowIndex, columnIndex}) {
|
|
|
let lastDate = new Date(row.LastCheckDate)
|
|
|
let cycleDate = new Date()
|
|
|
if (row.CycleUnit === '年') {
|
|
|
@@ -368,12 +400,13 @@
|
|
|
}
|
|
|
let curDate = new Date()
|
|
|
let nearCycleDate = new Date(curDate.getFullYear(), (curDate.getMonth() + 1), curDate.getDate())
|
|
|
- if (cycleDate <= new Date()) {
|
|
|
+ if (cycleDate < new Date(curDate.getFullYear(), curDate.getMonth(), curDate.getDate()) && columnIndex === 1) {
|
|
|
return 'error-row'
|
|
|
- } else if (cycleDate <= nearCycleDate) {
|
|
|
+ } else if (cycleDate >= new Date(curDate.getFullYear(), curDate.getMonth(), curDate.getDate()) && cycleDate <= nearCycleDate && columnIndex === 1) {
|
|
|
return 'warning-row'
|
|
|
+ } else if (cycleDate > nearCycleDate && columnIndex === 1) {
|
|
|
+ return 'normal-row'
|
|
|
}
|
|
|
- return ''
|
|
|
},
|
|
|
|
|
|
CheckCycleDate () {
|
|
|
@@ -395,7 +428,8 @@
|
|
|
Order: this.Column.Order,
|
|
|
Prop: this.Column.Prop,
|
|
|
TemplateTypeId: this.QueryProjectTypeId + '',
|
|
|
- PositionAllTypeId: this.selectNodeId + ''
|
|
|
+ PositionAllTypeId: this.selectNodeId + '',
|
|
|
+ statusValue: this.statusValue
|
|
|
}
|
|
|
let myCreateOn = []
|
|
|
// 解析时间
|
|
|
@@ -565,6 +599,7 @@
|
|
|
},
|
|
|
|
|
|
NewEntity () {
|
|
|
+ this.addoredittitle = '添加'
|
|
|
this.dialogFormVisible = true
|
|
|
this.PositionList = []
|
|
|
this.formData.Id = 0
|
|
|
@@ -577,7 +612,7 @@
|
|
|
this.formData.Position = ''
|
|
|
this.formData.CustNo = ''
|
|
|
this.formData.DeviceName = ''
|
|
|
- this.formData.TemplateTypeId = ''
|
|
|
+ this.formData.TemplateTypeId = this.projectTypeList[0].Id
|
|
|
this.formData.TemplateTypeName = ''
|
|
|
this.formData.Spec = ''
|
|
|
this.formData.SpecId = 0
|
|
|
@@ -597,6 +632,7 @@
|
|
|
this.formData.PositionID = value[1]
|
|
|
},
|
|
|
ShowEntityDialog (entityId) {
|
|
|
+ this.addoredittitle = '编辑'
|
|
|
this.initEntity(entityId)
|
|
|
this.dialogFormVisible = true
|
|
|
},
|
|
|
@@ -620,7 +656,8 @@
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- if (this.PositionList.length <= 0) {
|
|
|
+
|
|
|
+ if (this.PositionList.length !== 2) {
|
|
|
this.$message({
|
|
|
type: 'warning',
|
|
|
message: '请选择安装位置'
|
|
|
@@ -700,10 +737,29 @@
|
|
|
}
|
|
|
|
|
|
.el-table .warning-row {
|
|
|
- background: burlywood;
|
|
|
+ color: yellow;
|
|
|
}
|
|
|
|
|
|
.el-table .error-row {
|
|
|
- background: indianred;
|
|
|
+ color: red;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-table .normal-row {
|
|
|
+ color: green;
|
|
|
+ }
|
|
|
+
|
|
|
+ .bottom {
|
|
|
+ // margin-top: 13px;
|
|
|
+ line-height: 12px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .clearfix:before,
|
|
|
+ .clearfix:after {
|
|
|
+ display: table;
|
|
|
+ content: "";
|
|
|
+ }
|
|
|
+
|
|
|
+ .clearfix:after {
|
|
|
+ clear: both
|
|
|
}
|
|
|
</style>
|