|
@@ -0,0 +1,219 @@
|
|
|
+<template>
|
|
|
+ <div class="main">
|
|
|
+ <div class="search">
|
|
|
+ <el-input placeholder="订单编号/业主/房间号" class="search-input" clearable v-model="mixins_query.name"></el-input>
|
|
|
+ <el-select v-model="mixins_query.communityId">
|
|
|
+ <el-option v-for="(item, index) in communityArr" :key="index" :label="item.communityName" :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-input placeholder="欠费天数(大于)" class="search-input" clearable v-model="mixins_query.arrearageDays"></el-input>
|
|
|
+ <el-button type="primary" placeholder="状态" class="search-btn" @click="mixins_search" icon="el-icon-search">查询 </el-button>
|
|
|
+ <div class="search-icon">
|
|
|
+ <i class="iconfont" @click="deluserbyidFn()" v-txt-tip data-txt="删除"></i>
|
|
|
+ <i class="iconfont" @click="addOrEdit('add')" v-left-txt-tip data-txt="新增"></i>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="roles-wrap">
|
|
|
+ <zz-table
|
|
|
+ :cols="cols"
|
|
|
+ :settings="{ showCheckbox: true, showIndex: true, stripe: true }"
|
|
|
+ :loading="mixins_onQuery"
|
|
|
+ :data="mixins_list"
|
|
|
+ :pageset="mixins_pageset"
|
|
|
+ @page-change="pageChange"
|
|
|
+ @selection-change="selectionChange"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope" slot="opt">
|
|
|
+ <div class="opt">
|
|
|
+ <el-tooltip effect="light" placement="bottom" content="编辑">
|
|
|
+ <i class="zoniot_font zoniot-icon-bianji" @click="addOrEdit('edit', scope.row)"></i>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip effect="light" placement="bottom" content="删除">
|
|
|
+ <i class="zoniot_font zoniot-icon-shanchu redText" @click="deluserbyidFn(scope.row.id)"></i>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip effect="light" placement="bottom" :content="scope.row.deviceStatus === 5 ? '已报废' : '报废'">
|
|
|
+ <i v-if="scope.row.deviceStatus === 5" class="zoniot_font zoniot-icon-baofei ashText"></i>
|
|
|
+ <i v-else class="zoniot_font zoniot-icon-baofei redText" @click="Scrap(scope.row.id)"></i>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip effect="light" placement="bottom" content="下载二维码">
|
|
|
+ <i class="zoniot_font zoniot-icon-erweimaxiazai" @click="lookImg(scope.row)"></i>
|
|
|
+ </el-tooltip>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </zz-table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import list from '@utils/list.js';
|
|
|
+export default {
|
|
|
+ mixins: [list],
|
|
|
+ data() {
|
|
|
+ let _this = this;
|
|
|
+ return {
|
|
|
+ selectRow: [],
|
|
|
+ cols: [
|
|
|
+ {
|
|
|
+ label: '所属小区',
|
|
|
+ prop: 'communityId',
|
|
|
+ format(val) {
|
|
|
+ let va = '';
|
|
|
+ _this.$store.getters['getAreaSelect'].forEach((element) => {
|
|
|
+ if (element.id === val) {
|
|
|
+ va = element.communityName;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return va;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '设备类型',
|
|
|
+ prop: 'deviceTypeName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '设备编号',
|
|
|
+ prop: 'deviceNo'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '设备名称',
|
|
|
+ prop: 'deviceName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '设备地址',
|
|
|
+ prop: 'address'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '添加日期',
|
|
|
+ prop: 'createDate'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '设备状态',
|
|
|
+ prop: 'deviceStatus',
|
|
|
+ format(val) {
|
|
|
+ if (val == '1') {
|
|
|
+ return '正常';
|
|
|
+ } else if (val == '2') {
|
|
|
+ return '告警';
|
|
|
+ } else if (val == '3') {
|
|
|
+ return '离线';
|
|
|
+ } else if (val == '4') {
|
|
|
+ return '未启用';
|
|
|
+ } else if (val == '5') {
|
|
|
+ return '报废';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '二维码',
|
|
|
+ prop: 'deviceQrcode',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '操作',
|
|
|
+ prop: 'id',
|
|
|
+ slot: 'opt'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ mixins_post: 'post',
|
|
|
+ productOptions: [],
|
|
|
+ communityArr: [],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getorgTree();
|
|
|
+ this.mixins_dataUrl = '/device/page';
|
|
|
+ this.mixins_query = {};
|
|
|
+ this.mixins_search();
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getProductOptions();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getorgTree() {
|
|
|
+ this.$http
|
|
|
+ .get('/sc-community/assets/community/list')
|
|
|
+ .then((data) => {
|
|
|
+ this.communityArr = data.data;
|
|
|
+ this.$store.commit('setAreaSelect', data.data);
|
|
|
+ })
|
|
|
+
|
|
|
+ .catch(function () {});
|
|
|
+ },
|
|
|
+ deluserbyidFn(id) {
|
|
|
+ let ids = [];
|
|
|
+ if (!!id) {
|
|
|
+ ids = [id];
|
|
|
+ } else {
|
|
|
+ if (!this.selectRow.length) {
|
|
|
+ this.$message.error('您尚未选择要删除的记录,请选择后再操作批量删除');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.selectRow.forEach((v) => {
|
|
|
+ ids.push(v.id);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ const h = this.$createElement;
|
|
|
+ this.$msgBox(`删除`, '删除后将无法恢复,请问是否继续?')
|
|
|
+ .then(() => {
|
|
|
+ this.$http.post('/device/delete', ids).then(({ status, data, msg }) => {
|
|
|
+ if (0 === status) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '删除成功!'
|
|
|
+ });
|
|
|
+ this.mixins_search();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ },
|
|
|
+ Scrap(id) {
|
|
|
+ this.$msgBox(`确认提示`, '设备报废后将无法正常接收数据,请问是否继续?')
|
|
|
+ .then(() => {
|
|
|
+ this.$http.post('/device/deviceScrapInterface', { id: id, deviceStatus: 5 }).then(({ status, data, msg }) => {
|
|
|
+ if (0 === status) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '报废成功!'
|
|
|
+ });
|
|
|
+ this.mixins_search();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ },
|
|
|
+ addOrEdit(todo, data = {}) {
|
|
|
+ new Promise((resolve) => {
|
|
|
+ let title = '添加设备';
|
|
|
+ if (todo == 'add') {
|
|
|
+ // title = this.mixins_query.alarmCategory == '2' ? '添加离线规则' : '添加告警';
|
|
|
+ } else {
|
|
|
+ title = '修改设备';
|
|
|
+ }
|
|
|
+ this.$store.dispatch('addPopup', {
|
|
|
+ url: '/deviceManagement/popups/addDeviceManagement.vue',
|
|
|
+ width: '500px',
|
|
|
+ height: '400px',
|
|
|
+ props: {
|
|
|
+ data,
|
|
|
+ todo,
|
|
|
+ productOptions: this.productOptions,
|
|
|
+ callback: resolve
|
|
|
+ },
|
|
|
+ title: title
|
|
|
+ });
|
|
|
+ }).then(() => {
|
|
|
+ this.mixins_search();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ selectionChange(val) {
|
|
|
+ this.selectRow = val;
|
|
|
+ },
|
|
|
+ getProductOptions() {
|
|
|
+ this.$http.postForm('/devicetype/selectList', { name: '' }).then((data) => {
|
|
|
+ this.productOptions = data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|