|
@@ -1,182 +1,224 @@
|
|
|
<template>
|
|
|
- <div class="content">
|
|
|
- <community-tree @organId="currentOrganId"></community-tree>
|
|
|
- <div class="content-right">
|
|
|
- <div class="search">
|
|
|
- <el-input placeholder="巡检项内容" class="search-input" clearable v-model="mixins_query.cotent"></el-input>
|
|
|
- <el-cascader
|
|
|
- v-model="typeId"
|
|
|
- :props="defaultProps"
|
|
|
- placeholder="设备设施类型"
|
|
|
- :options="productOptions"
|
|
|
- @change="deviceArrToggle"
|
|
|
- ></el-cascader>
|
|
|
- <el-button type="primary" placeholder="状态" class="search-btn" @click="mixins_search" icon="el-icon-search"
|
|
|
- >查询
|
|
|
- </el-button>
|
|
|
+ <div class="content">
|
|
|
+ <community-tree @organId="currentOrganId"></community-tree>
|
|
|
+ <div class="content-right">
|
|
|
+ <div class="search">
|
|
|
+ <el-input
|
|
|
+ placeholder="巡检项内容"
|
|
|
+ class="search-input"
|
|
|
+ clearable
|
|
|
+ v-model="mixins_query.cotent"
|
|
|
+ ></el-input>
|
|
|
+ <el-cascader
|
|
|
+ v-model="typeId"
|
|
|
+ :props="defaultProps"
|
|
|
+ clearable
|
|
|
+ placeholder="设备设施类型"
|
|
|
+ :options="productOptions"
|
|
|
+ @change="deviceArrToggle"
|
|
|
+ ></el-cascader>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ placeholder="状态"
|
|
|
+ class="search-btn"
|
|
|
+ @click="mixins_search"
|
|
|
+ icon="el-icon-search"
|
|
|
+ >查询
|
|
|
+ </el-button>
|
|
|
|
|
|
- <div class="search-icon">
|
|
|
- <el-dropdown type="primary" @command="addCommand">
|
|
|
- <span class="iconfont"></span>
|
|
|
- <el-dropdown-menu slot="dropdown" hide-on-click="false" class="device-search-dropdown">
|
|
|
- <el-dropdown-item command="add">单个添加</el-dropdown-item>
|
|
|
- <el-dropdown-item command="batchAdd">
|
|
|
- <div class="upload_div">
|
|
|
- <xk-upload class="upload_class" @callback="mixins_search" :params="{ importType: 'INSEPTION_OPTION' }">
|
|
|
- <span class="upload_text" slot="content">批量添加</span>
|
|
|
- </xk-upload>
|
|
|
- </div>
|
|
|
- </el-dropdown-item>
|
|
|
- <el-dropdown-item command="template">下载模板</el-dropdown-item>
|
|
|
- </el-dropdown-menu>
|
|
|
- </el-dropdown>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <zz-table
|
|
|
- :cols="cols"
|
|
|
- :settings="{ showIndex: true, stripe: true }"
|
|
|
- :loading="mixins_onQuery"
|
|
|
- :data="mixins_list"
|
|
|
- :pageset="mixins_pageset"
|
|
|
- @page-change="pageChange"
|
|
|
+ <div class="search-icon">
|
|
|
+ <el-dropdown
|
|
|
+ type="primary"
|
|
|
+ @command="addCommand"
|
|
|
+ >
|
|
|
+ <span class="iconfont"></span>
|
|
|
+ <el-dropdown-menu
|
|
|
+ slot="dropdown"
|
|
|
+ hide-on-click="false"
|
|
|
+ class="device-search-dropdown"
|
|
|
>
|
|
|
- <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="deleteOne(scope.row.id)"></i>
|
|
|
- </el-tooltip>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </zz-table>
|
|
|
+ <el-dropdown-item command="add">单个添加</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="batchAdd">
|
|
|
+ <div class="upload_div">
|
|
|
+ <xk-upload
|
|
|
+ class="upload_class"
|
|
|
+ @callback="mixins_search"
|
|
|
+ :params="{ importType: 'INSEPTION_OPTION' }"
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ class="upload_text"
|
|
|
+ slot="content"
|
|
|
+ >批量添加</span>
|
|
|
+ </xk-upload>
|
|
|
+ </div>
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item command="template">下载模板</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
</div>
|
|
|
+ </div>
|
|
|
+ <zz-table
|
|
|
+ :cols="cols"
|
|
|
+ :settings="{ showIndex: true, stripe: true }"
|
|
|
+ :loading="mixins_onQuery"
|
|
|
+ :data="mixins_list"
|
|
|
+ :pageset="mixins_pageset"
|
|
|
+ @page-change="pageChange"
|
|
|
+ >
|
|
|
+ <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="deleteOne(scope.row.id)"
|
|
|
+ ></i>
|
|
|
+ </el-tooltip>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </zz-table>
|
|
|
</div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import communityTree from './communityTree.vue';
|
|
|
import list from '@utils/list.js';
|
|
|
export default {
|
|
|
- mixins: [list],
|
|
|
- components: {
|
|
|
- communityTree
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- currentId: '',
|
|
|
- productOptions: [],
|
|
|
- cols: [
|
|
|
- {
|
|
|
- label: '设备设施类型',
|
|
|
- prop: 'typeName'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '巡检项内容',
|
|
|
- prop: 'cotent'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '类型',
|
|
|
- prop: 'type',
|
|
|
- format(val) {
|
|
|
- let value = '-';
|
|
|
- let selctArr = ['单选', '多选', '输入框'];
|
|
|
- if (!!val) {
|
|
|
- return selctArr[Number(val) - 1];
|
|
|
- } else {
|
|
|
- return value;
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- label: '选项',
|
|
|
- prop: 'value'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '操作',
|
|
|
- prop: 'id',
|
|
|
- slot: 'opt',
|
|
|
- width: 130
|
|
|
- }
|
|
|
- ],
|
|
|
- defaultProps: {
|
|
|
- value: 'id', // 唯一标识
|
|
|
- label: 'label', // 标签显示
|
|
|
- children: 'children'
|
|
|
- },
|
|
|
- mixins_post: 'post'
|
|
|
- };
|
|
|
- },
|
|
|
- created() {
|
|
|
- this.getProductOptions();
|
|
|
- this.mixins_dataUrl = '/czc-community/inspectionOption/page';
|
|
|
- this.mixins_query = {
|
|
|
- communityId: ''
|
|
|
- };
|
|
|
- this.mixins_search();
|
|
|
- },
|
|
|
- methods: {
|
|
|
- currentOrganId(data) {
|
|
|
- this.mixins_query.communityId = data.id || '';
|
|
|
- this.mixins_search();
|
|
|
- },
|
|
|
- addCommand(command) {
|
|
|
- if (command === 'add') {
|
|
|
- this.addOrEdit('add');
|
|
|
- }
|
|
|
- if (command === 'template') {
|
|
|
- this.__exportExcel('/czc-community/excel/download/template', { importType: 'INSEPTION_OPTION' });
|
|
|
- return;
|
|
|
- }
|
|
|
+ mixins: [list],
|
|
|
+ components: {
|
|
|
+ communityTree
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ currentId: '',
|
|
|
+ productOptions: [],
|
|
|
+ cols: [
|
|
|
+ {
|
|
|
+ label: '设备设施类型',
|
|
|
+ prop: 'typeName'
|
|
|
},
|
|
|
- addOrEdit(todo, row) {
|
|
|
- new Promise((resolve) => {
|
|
|
- let rows,
|
|
|
- title = '编辑巡检项';
|
|
|
- if ('add' == todo) {
|
|
|
- title = '添加巡检项';
|
|
|
- } else {
|
|
|
- rows = JSON.parse(JSON.stringify(row));
|
|
|
- }
|
|
|
- this.$store.dispatch('openModal', {
|
|
|
- url: '/facilityInspections/popups/addStandard.vue',
|
|
|
- title: title,
|
|
|
- width: '500px',
|
|
|
- height: '400px',
|
|
|
- props: {
|
|
|
- data: rows,
|
|
|
- communityId: this.mixins_query.communityId,
|
|
|
- deviceArr: this.productOptions,
|
|
|
- todo: todo,
|
|
|
- callback: resolve
|
|
|
- }
|
|
|
- });
|
|
|
- }).then(() => {
|
|
|
- this.mixins_search();
|
|
|
- });
|
|
|
+ {
|
|
|
+ label: '巡检项内容',
|
|
|
+ prop: 'cotent'
|
|
|
},
|
|
|
- deleteOne(id) {
|
|
|
- this.$msgBox(`刪除巡检标准`, '删除后将无法恢复,请问是否继续?')
|
|
|
- .then(() => {
|
|
|
- this.$http.get('/czc-community/inspectionOption/delete?id=' + id).then(({ msg, status, data }) => {
|
|
|
- if (status == 0) {
|
|
|
- this.$message.success(msg);
|
|
|
- this.mixins_search();
|
|
|
- } else {
|
|
|
- this.$message.error(msg);
|
|
|
- }
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
+ {
|
|
|
+ label: '类型',
|
|
|
+ prop: 'type',
|
|
|
+ format (val) {
|
|
|
+ let value = '-';
|
|
|
+ let selctArr = ['单选', '多选', '输入框'];
|
|
|
+ if (!!val) {
|
|
|
+ return selctArr[Number(val) - 1];
|
|
|
+ } else {
|
|
|
+ return value;
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
- deviceArrToggle(va) {
|
|
|
- this.mixins_query.typeId = _.last(va);
|
|
|
+ {
|
|
|
+ label: '选项',
|
|
|
+ prop: 'value'
|
|
|
},
|
|
|
- getProductOptions() {
|
|
|
- this.$http.postForm('/czc-community/devicetype/getTypeTree', { name: '' }).then((data) => {
|
|
|
- this.productOptions = data;
|
|
|
- });
|
|
|
+ {
|
|
|
+ label: '操作',
|
|
|
+ prop: 'id',
|
|
|
+ slot: 'opt',
|
|
|
+ width: 130
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ defaultProps: {
|
|
|
+ value: 'id', // 唯一标识
|
|
|
+ label: 'label', // 标签显示
|
|
|
+ children: 'children'
|
|
|
+ },
|
|
|
+ mixins_post: 'post'
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ this.getProductOptions();
|
|
|
+ this.mixins_dataUrl = '/czc-community/inspectionOption/page';
|
|
|
+ this.mixins_query = {
|
|
|
+ communityId: ''
|
|
|
+ };
|
|
|
+ this.mixins_search();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ currentOrganId (data) {
|
|
|
+ this.mixins_query.communityId = data.id || '';
|
|
|
+ this.mixins_search();
|
|
|
+ },
|
|
|
+ addCommand (command) {
|
|
|
+ if (command === 'add') {
|
|
|
+ this.addOrEdit('add');
|
|
|
+ }
|
|
|
+ if (command === 'template') {
|
|
|
+ this.__exportExcel('/czc-community/excel/download/template', { importType: 'INSEPTION_OPTION' });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ addOrEdit (todo, row) {
|
|
|
+ new Promise((resolve) => {
|
|
|
+ let rows,
|
|
|
+ title = '编辑巡检项';
|
|
|
+ if ('add' == todo) {
|
|
|
+ title = '添加巡检项';
|
|
|
+ } else {
|
|
|
+ rows = JSON.parse(JSON.stringify(row));
|
|
|
}
|
|
|
+ this.$store.dispatch('openModal', {
|
|
|
+ url: '/facilityInspections/popups/addStandard.vue',
|
|
|
+ title: title,
|
|
|
+ width: '500px',
|
|
|
+ height: '400px',
|
|
|
+ props: {
|
|
|
+ data: rows,
|
|
|
+ communityId: this.mixins_query.communityId,
|
|
|
+ deviceArr: this.productOptions,
|
|
|
+ todo: todo,
|
|
|
+ callback: resolve
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }).then(() => {
|
|
|
+ this.mixins_search();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ deleteOne (id) {
|
|
|
+ this.$msgBox(`刪除巡检标准`, '删除后将无法恢复,请问是否继续?')
|
|
|
+ .then(() => {
|
|
|
+ this.$http.get('/czc-community/inspectionOption/delete?id=' + id).then(({ msg, status, data }) => {
|
|
|
+ if (status == 0) {
|
|
|
+ this.$message.success(msg);
|
|
|
+ this.mixins_search();
|
|
|
+ } else {
|
|
|
+ this.$message.error(msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => { });
|
|
|
+ },
|
|
|
+ deviceArrToggle (va) {
|
|
|
+ this.mixins_query.typeId = _.last(va);
|
|
|
+ },
|
|
|
+ getProductOptions () {
|
|
|
+ this.$http.postForm('/czc-community/devicetype/getTypeTree', { name: '' }).then((data) => {
|
|
|
+ this.productOptions = data;
|
|
|
+ });
|
|
|
}
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|