|
@@ -1,11 +1,46 @@
|
|
|
<template>
|
|
|
<div class="dashboard-container">
|
|
|
+ <div class="demo-input-size">
|
|
|
+ <el-input
|
|
|
+ v-model="deviceCode"
|
|
|
+ size="mini"
|
|
|
+ placeholder="请输入设备编号"
|
|
|
+ />
|
|
|
+ <el-input
|
|
|
+ v-model="deviceType"
|
|
|
+ size="mini"
|
|
|
+ placeholder="请输入设备型号"
|
|
|
+ />
|
|
|
+ <el-input
|
|
|
+ v-model="region"
|
|
|
+ size="mini"
|
|
|
+ placeholder="请输入设备地区"
|
|
|
+ />
|
|
|
+ <el-input
|
|
|
+ v-model="address"
|
|
|
+ size="mini"
|
|
|
+ placeholder="请输入设备地址"
|
|
|
+ />
|
|
|
+ <el-date-picker
|
|
|
+ v-model="gmtCreated"
|
|
|
+ size="mini"
|
|
|
+ type="date"
|
|
|
+ placeholder="选择设备安装日期"
|
|
|
+ format="yyyy 年 MM 月 dd 日"
|
|
|
+ value-format="timestamp"
|
|
|
+ />
|
|
|
+ <el-button type="primary" size="mini" style="float: right;" @click="search">查询</el-button>
|
|
|
+ </div>
|
|
|
<el-table
|
|
|
- :data="deviceData.filter(data => !search || data.author.toLowerCase().includes(search.toLowerCase()))"
|
|
|
+ :data="deviceData"
|
|
|
style="width: 100%"
|
|
|
>
|
|
|
<el-table-column
|
|
|
- label="设备码"
|
|
|
+ label="设备安装时间"
|
|
|
+ prop="gmtCreated"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="设备编号"
|
|
|
prop="deviceCode"
|
|
|
/>
|
|
|
<el-table-column
|
|
@@ -17,15 +52,16 @@
|
|
|
prop="deviceType"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
+ label="设备地区"
|
|
|
+ prop="region"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="设备地址"
|
|
|
+ prop="address"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
align="right"
|
|
|
>
|
|
|
- <template slot="header" slot-scope="scope">
|
|
|
- <el-input
|
|
|
- v-model="search"
|
|
|
- size="mini"
|
|
|
- placeholder="输入关键字搜索"
|
|
|
- />
|
|
|
- </template>
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
v-show="type === '0'"
|
|
@@ -38,7 +74,7 @@
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
style="float: left; margin: 0 10px 0 0;"
|
|
|
- @click="handleMaintain(scope.$index, scope.row)"
|
|
|
+ @click="handleMaintainMessage(scope.$index, scope.row)"
|
|
|
>
|
|
|
维护信息
|
|
|
</el-button>
|
|
@@ -71,6 +107,38 @@
|
|
|
/>
|
|
|
</el-table>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ title="安装信息"
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
+ width="60%"
|
|
|
+ >
|
|
|
+ <div class="install">
|
|
|
+ 安装日期: {{ gridData.length > 0 ? gridData[0].deviceLog.gmtCreated : '' }}
|
|
|
+ </div>
|
|
|
+ <div class="install">
|
|
|
+ 安装人员: {{ gridData.length > 0 ? gridData[0].deviceModifier.name : '' }}
|
|
|
+ </div>
|
|
|
+ <div class="install">
|
|
|
+ 安装地区: {{ gridData.length > 0 ? gridData[0].deviceLog.region : '' }}
|
|
|
+ </div>
|
|
|
+ <div class="install">
|
|
|
+ 安装地址: {{ gridData.length > 0 ? gridData[0].deviceLog.address : '' }}
|
|
|
+ </div>
|
|
|
+ <div class="install">
|
|
|
+ 备注信息: {{ gridData.length > 0 ? gridData[0].deviceLog.description : '' }}
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog title="立即维护" :visible.sync="dialogFormVisible">
|
|
|
+ <el-form :model="solveForm" label-width="80px">
|
|
|
+ <el-form-item label="解决方案">
|
|
|
+ <el-input v-model="solveForm.description" type="textarea" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogFormVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="handSolve">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -82,13 +150,25 @@ export default {
|
|
|
name: 'Device',
|
|
|
data() {
|
|
|
return {
|
|
|
- search: '',
|
|
|
dialogTableVisible: false,
|
|
|
+ dialogVisible: false,
|
|
|
gridData: [],
|
|
|
gridTile: '',
|
|
|
type: getType(),
|
|
|
uid: getToken(),
|
|
|
- information: []
|
|
|
+ information: [],
|
|
|
+ deviceCode: '',
|
|
|
+ deviceType: '',
|
|
|
+ region: '',
|
|
|
+ address: '',
|
|
|
+ gmtCreated: '',
|
|
|
+ dialogFormVisible: false,
|
|
|
+ solveForm: {
|
|
|
+ deviceCode: '',
|
|
|
+ deviceId: '',
|
|
|
+ opType: 'MODIFIED',
|
|
|
+ description: ''
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -105,8 +185,25 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- onSubmit() {
|
|
|
- this.$message('submit!')
|
|
|
+ search() {
|
|
|
+ if (this.type === '2') {
|
|
|
+ this.$store.dispatch('admin/getDeviceData', {
|
|
|
+ deviceCode: this.deviceCode,
|
|
|
+ deviceType: this.deviceType,
|
|
|
+ region: this.region,
|
|
|
+ address: this.address,
|
|
|
+ gmtCreated: this.gmtCreated,
|
|
|
+ modifier: this.uid
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$store.dispatch('admin/getDeviceData', {
|
|
|
+ deviceCode: this.deviceCode,
|
|
|
+ deviceType: this.deviceType,
|
|
|
+ region: this.region,
|
|
|
+ address: this.address,
|
|
|
+ gmtCreated: this.gmtCreated
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
handleInstall(index, row) {
|
|
|
this.$store.dispatch('admin/queryLogData', {
|
|
@@ -116,27 +213,10 @@ export default {
|
|
|
}).then(() => {
|
|
|
this.gridData = this.$store.getters.logData
|
|
|
// this.gridData.push(row)
|
|
|
- this.gridTile = '安装信息'
|
|
|
- this.information = [{
|
|
|
- label: '安装日期',
|
|
|
- type: 'deviceLog[gmtCreated]'
|
|
|
- }, {
|
|
|
- label: '安装人员',
|
|
|
- type: 'deviceModifier[name]'
|
|
|
- }, {
|
|
|
- label: '安装地区',
|
|
|
- type: 'deviceLog[gmtCreated]'
|
|
|
- }, {
|
|
|
- label: '安装地址',
|
|
|
- type: 'deviceLog[gmtCreated]'
|
|
|
- }, {
|
|
|
- label: '备注信息',
|
|
|
- type: 'deviceLog[description]'
|
|
|
- }]
|
|
|
- this.dialogTableVisible = true
|
|
|
+ this.dialogVisible = true
|
|
|
})
|
|
|
},
|
|
|
- handleMaintain(index, row) {
|
|
|
+ handleMaintainMessage(index, row) {
|
|
|
this.$store.dispatch('admin/queryLogData', {
|
|
|
deviceId: row.id,
|
|
|
deviceCode: row.deviceCode,
|
|
@@ -161,7 +241,12 @@ export default {
|
|
|
type: 'deviceLog[description]'
|
|
|
}]
|
|
|
this.dialogTableVisible = true
|
|
|
- })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleMaintain(index, row) {
|
|
|
+ this.solveForm.deviceCode = row.deviceCode
|
|
|
+ this.solveForm.deviceId = row.id
|
|
|
+ this.dialogFormVisible = true
|
|
|
},
|
|
|
handleUse(index, row) {
|
|
|
console.log(index, row)
|
|
@@ -179,13 +264,17 @@ export default {
|
|
|
}, {
|
|
|
label: '设备连接日期',
|
|
|
type: 'deviceModifier[name]'
|
|
|
- }]
|
|
|
+ }]
|
|
|
this.dialogTableVisible = true
|
|
|
})
|
|
|
// this.gridData = []
|
|
|
// this.gridData.push(row)
|
|
|
// this.gridTile = '使用日志'
|
|
|
// this.dialogTableVisible = true
|
|
|
+ },
|
|
|
+ handSolve() {
|
|
|
+ this.$store.dispatch('install/addDeviceLog', this.solveForm)
|
|
|
+ this.dialogFormVisible = false
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -201,4 +290,10 @@ export default {
|
|
|
line-height: 46px;
|
|
|
}
|
|
|
}
|
|
|
+.el-input {
|
|
|
+ width: auto;
|
|
|
+}
|
|
|
+.install {
|
|
|
+ margin-bottom: 10px;
|
|
|
+}
|
|
|
</style>
|