Browse Source

添加设备维修率

master
yangzongjia 2 years ago
parent
commit
5c4a983d82
  1. 8
      src/api/device/device.js
  2. 45
      src/views/shebeitaizhang/shebeitaizhangAdd.vue
  3. 84
      src/views/shebeitaizhang/shebeitaizhangList.vue

8
src/api/device/device.js

@ -39,9 +39,15 @@ export function getInfoById(data) {
// 获取摄像头列表
export function getOtherList(data) {
return request({ url: '/device/getOtherList', method: 'GET',params:data })
return request({ url: '/device/getOtherList', method: 'GET', params: data })
}
// 获取状态列表
export function getStatusList(data) {
return request({ url: '/device/getStatusList', method: 'GET' })
}
/******************************************************************************************************************************************** */

45
src/views/shebeitaizhang/shebeitaizhangAdd.vue

@ -72,6 +72,19 @@
clearable />
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span>维修状态</span>
</el-col>
<el-col :span="8">
<el-form-item prop="maintenance">
<el-select v-model="addForm.maintenance" filterable clearable placeholder="请选择维修状态" style="width: 410px;">
<el-option v-for="item in maintenanceList" :key="item.id" :label="item.name" :value="item.id"
class="addinputw" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb" v-if="sxtFlag">
<span>上偏移</span>
</el-col>
@ -80,6 +93,17 @@
<el-input v-model="addForm.topPosition" maxlength="20" placeholder="请填写上偏移" class="addinputw" clearable />
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb" v-if="sxtFlag">
<span>请选择所属Nvr</span>
</el-col>
<el-col :span="8" v-if="sxtFlag">
<el-form-item prop="nvrId">
<el-select v-model="addForm.nvrId" filterable clearable placeholder="请选择所属Nvr" style="width: 410px;">
<el-option v-for="item in nvrList" :key="item.id" :label="item.name" :value="item.id"
class="addinputw" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="4" class="tleftb" v-if="ckFlag">
<span>仓库</span>
</el-col>
@ -116,21 +140,7 @@
</el-col>
</el-row>
<el-row v-if="sxtFlag">
<el-col :span="4" class="tleftb">
<span>请选择所属Nvr</span>
</el-col>
<el-col :span="8">
<el-form-item prop="nvrId">
<el-select v-model="addForm.nvrId" filterable clearable placeholder="请选择所属Nvr" style="width: 410px;">
<el-option v-for="item in nvrList" :key="item.id" :label="item.name" :value="item.id"
class="addinputw" />
</el-select>
</el-form-item>
<!-- <el-form-item prop="nvrSerial">
<el-input v-model="addForm.nvrSerial" maxlength="20" placeholder="请填写所属nvr序列号" class="addinputw"
clearable />
</el-form-item> -->
</el-col>
</el-row>
</el-form>
</div>
@ -180,6 +190,11 @@ export default {
{ name: '机器人', id: '4' },
{ name: '网络录像机', id: '5' }
],
maintenanceList: [
{ name: '完好', id: '1' },
{ name: '维修', id: '2' },
{ name: '损坏', id: '3' },
],
addForm: {},
baseManufacturerBankDto: [],
rules: {

84
src/views/shebeitaizhang/shebeitaizhangList.vue

@ -106,6 +106,16 @@
<span>{{ getCkTitle(scope.row.ckId) }}</span>
</template>
</el-table-column>
<el-table-column label="维修状态" align="center">
<template slot-scope="scope">
<span v-if="scope.row.maintenance == '1'" style="color:blue">{{ getMainTitle(scope.row.maintenance)
}}</span>
<span v-if="scope.row.maintenance == '2'" style="color:orange">{{ getMainTitle(scope.row.maintenance)
}}</span>
<span v-if="scope.row.maintenance == '3'" style="color:red">{{ getMainTitle(scope.row.maintenance)
}}</span>
</template>
</el-table-column>
<!-- <el-table-column label="状态" align="center">
<template slot-scope="scope">
<span v-if="scope.row.status == 1" style="color:red">{{ getStatus(scope.row.status) }}</span>
@ -133,23 +143,19 @@
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import ButtonBar from '@/components/ButtonBar'
// import { typeValues, getOrgSidByPath } from '@/api/cheliang/dictcommons'
import shebeitaizhangAdd from './shebeitaizhangAdd'
import shebeitaizhangInfo from './shebeitaizhangInfo'
import { getDevicePage, getInfoById, removeDevice } from '@/api/device/device'
// import req from '@/api/shebeitaizhang/shebeitaizhang'
import { getDevicePage, getInfoById, removeDevice, getStatusList } from '@/api/device/device'
import * as echarts from "echarts";
import PieChartrenyuan from '@/views/echarts/components/PieChartrenyuanb'
// 1.1
const wanhao_Chart = {
// seriesName: '',
unit: '次',
color: ['#30e9ff', '#d9d9d9', '#fdc004'],
Data: {
seriesData: [
{ value: 75, name: '完好' },
{ value: 25, name: '不完好' },
// { value: 12, name: '' }
]
},
label: {
@ -158,19 +164,15 @@ const wanhao_Chart = {
show: false
}
},
// radius: ['50%', '55%']
}
// 1.2
const weixiu_Chart = {
// seriesName: '',
unit: '次',
color: ['#fe7f02', '#fdc004'],
Data: {
seriesData: [
{ value: 15, name: '维修' },
{ value: 85, name: '无维修' },
// { value: 12, name: '' }
]
},
label: {
@ -179,12 +181,9 @@ const weixiu_Chart = {
show: false
}
},
// radius: ['50%', '55%']
}
// 1.3
const sunhai_Chart = {
// seriesName: '',
unit: '次',
color: ['#d2cece', '#ff0202', '#fdc004'],
Data: {
@ -199,8 +198,6 @@ const sunhai_Chart = {
show: false
}
},
// radius: ['50%', '55%']
}
export default {
@ -268,6 +265,11 @@ export default {
{ name: '机器人', id: '4' },
{ name: '网络录像机', id: '5' }
],
maintenanceList: [
{ name: '完好', id: '1' },
{ name: '维修', id: '2' },
{ name: '损坏', id: '3' },
],
floor_list: [
{ title: '一层', id: '1' },
{ title: '二层', id: '2' },
@ -318,6 +320,13 @@ export default {
}
}
},
getMainTitle(item) {
for (var i = 0; i < this.maintenanceList.length; i++) {
if (this.maintenanceList[i].id == item) {
return this.maintenanceList[i].name
}
}
},
btnHandle(btnKey) {
console.log('XXXXXXXXXXXXXXX ' + btnKey)
switch (btnKey) {
@ -354,17 +363,44 @@ export default {
},
init() {
this.getList()
getStatusList().then(res => {
if (res.code == 200) {
debugger
this.wanhao_Chart.Data.seriesData = []
this.weixiu_Chart.Data.seriesData = []
this.sunhai_Chart.Data.seriesData = []
for (var i = 0; i < res.data.length; i++) {
var item = res.data[i];
// 1 2 3
if (item.maintenance == '1') {
var bad = 100 - item.maintenanceCount;
var obj = { name: '完好', value: item.maintenanceCount }
var obj1 = { name: '不完好', value: bad }
this.wanhao_Chart.Data.seriesData.push(obj)
this.wanhao_Chart.Data.seriesData.push(obj1)
}
// 1 2 3
if (item.maintenance == '2') {
var bad = 100 - item.maintenanceCount;
var obj = { name: '维修', value: item.maintenanceCount }
var obj1 = { name: '不维修', value: bad }
this.weixiu_Chart.Data.seriesData.push(obj)
this.weixiu_Chart.Data.seriesData.push(obj1)
}
// 1 2 3
if (item.maintenance == '3') {
var bad = 100 - item.maintenanceCount;
var obj = { name: '损害', value: item.maintenanceCount }
var obj1 = { name: '不损害', value: bad }
this.sunhai_Chart.Data.seriesData.push(obj)
this.sunhai_Chart.Data.seriesData.push(obj1)
}
}
}
})
},
// getType() {
// typeValues({
// type: 'supplierType'
// }).then((res) => {
// if (res.code === '200') {
// this.supplierType_list = res.data
// console.log('', this.supplierType_list)
// }
// })
// },
//
indexMethod(index) {
var pagestart = (this.listQuery.current - 1) * this.listQuery.size

Loading…
Cancel
Save