123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262 |
- <!--
- * @Author: zouwenying
- * @Date: 2020-10-22 11:08:44
- * @LastEditTime: 2021-04-28 08:49:01
- * @LastEditors: zwy
- * @Description: In User Settings Edit
- * @FilePath: \vue-manage-system-master\src\views\system\dictionarys\index.vue
- -->
- <script src="../../../../../../WEB/WEB/userCenter/src/router/index.js"></script>
- <template>
- <div class="main">
- <div>
- <div class="search">
- <el-input v-model="query.buildingName" placeholder="请输入楼栋名称" class="search-input" v-model.trim="mixins_query.keyWords"></el-input>
- <el-select v-model="query.communityName" placeholder="请选择社区名称">
- <el-option label="清空" value=""></el-option>
- <el-option v-for="(item,index) in communityList" :label="item.label" :value="item.id"></el-option>
- </el-select>
- <el-button type="primary" @click="mixins_search" class="search-btn" icon="el-icon-search">查询
- <!-- <i class="iconfont"></i> -->
- </el-button>
- <template>
- <el-tooltip
- class="item"
- effect="light"
- placement="bottom"
- content="导出"
- >
- <span class="zoniot_font item el-fl-right" @click="exportExcel()"
- ></span
- >
- </el-tooltip>
- <el-dropdown
- type="primary"
- @command="addCommand"
- class="el-fl-right"
- >
- <span class="zoniot_font item el-fl-right"></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: 7 }"
- >
- <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>
- </template>
- </div>
- <div class="dictionarys-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">
- <i @click="addOrEdit('edit', scope.index)" class="iconfont" style="color:#2787F1;margin-right:30px" v-txt-tip data-txt="编辑"></i>
- <i @click="deleteOne(scope.row.id)" class="iconfont" style="color:#FF7272" v-txt-tip data-txt="删除"></i>
- </template>
- </zz-table>
- </div>
- </div>
- <!-- <addplan :userinfo='userinfo' v-if="showaddDialog" @close='showaddDialog = false' @refresh='mixins_search'></addplan>-->
- </div>
- </template>
- <script>
- import list from '@utils/list.js';
- // import addplan from './pageJump/addoredit';
- export default {
- mixins: [list],
- data() {
- return {
- communityList:[],//社区名称下拉列表
- query:{
- buildingName:'',//楼栋名称
- communityName:'',//社区名称
- },
- cols: [
- {
- label: '所属社区',
- prop: 'dictCode'
- },
- {
- label: '楼栋名称',
- prop: 'dictName'
- },
- {
- label: '单元数',
- prop: 'remark'
- },
- {
- label: '楼栋类型',
- prop: 'remark'
- },
- {
- label: '建筑结构',
- prop: 'remark'
- },
- {
- label: '楼层',
- prop: 'remark'
- },
- {
- label: '楼栋用途',
- prop: 'remark'
- },
- {
- label: '建成日期',
- prop: 'remark'
- },
- {
- label: '验收日期',
- prop: 'remark'
- },
- {
- label: '建筑面积',
- prop: 'remark'
- },
- {
- label: '使用面积',
- prop: 'remark'
- },
- {
- label: '操作',
- prop: 'opt',
- slot: 'opt'
- }
- ],
- selectRow: [],
- // showaddDialog:false,
- };
- },
- components: {
- // addplan
- // viewDetail
- },
- methods: {
- //获取社区名称下拉列表
- communityNameList(){
- this.communityList=[];
- let onOption='';
- this.$http.get('/assets/community/list', {}).then((res) => {
- res.data.map(res=>{
- onOption={
- label:res.communityName,
- id:res.id
- }
- this.communityList.push(onOption)
- })
- });
- },
- addCommand(command) {
- if (command === "add") {
- // this.showaddDialog=true
- this.$router.push('/buildingManagement/pageJump/addoredit')
- return;
- }
- if (command === "template") {
- // this.__exportExcel("/installPlan/plan/downTemplate");
- return;
- }
- },
- //批量删除
- deleteRow() {
- let ids = [];
- if (!this.selectRow.length) {
- this.$message.error('您尚未选择要删除的记录,请选择后再操作批量删除');
- return;
- }
- this.selectRow.forEach((v) => {
- ids.push(v.id);
- });
- this.$msgBox(`刪除楼栋`, '删除后将无法恢复,请问是否继续?')
- .then(() => {
- this.$http.post('/dict/delete', ids).then(({ status, data, msg }) => {
- if (0 === status) {
- this.$message({
- type: 'success',
- message: '删除成功!'
- });
- this.mixins_search();
- } else {
- this.$message.error('删除失败!');
- }
- });
- })
- .catch(() => {
- });
- },
- //单个删除
- deleteOne(ids) {
- this.$msgBox(`刪除字典`, '删除后将无法恢复,请问是否继续?')
- .then(() => {
- this.$http.post('/dict/delete', [ids]).then(({ status, data, msg }) => {
- if (0 === status) {
- this.$message({
- type: 'success',
- message: '删除成功!'
- });
- this.mixins_search();
- } else {
- this.$message.error('删除失败!');
- }
- });
- })
- .catch(() => {
- this.$message({
- type: 'info',
- message: '已取消删除'
- });
- });
- },
- selectionChange(val) {
- this.selectRow = val;
- },
- mixins_search(){
- this.communityList()
- },
- //获取列表数据
- communityList(){
- let submitData={
- "pageNum": 1,
- "pageSize": 10
- }
- this.$http.post('/sc-community-web/assets/building/page', submitData).then((data) => {
- this.mixins_list=data.data.list;
- this.mixins_onQuery=false;
- }).catch(function () {
- });
- }
- },
- created() {
- this.communityNameList();
- this.communityList();
- this.mixins_dataUrl = '/dict/selectPage';
- this.mixins_query = {
- keyWords: ''
- };
- // this.mixins_search();
- }
- };
- </script>
- <style lang="scss" scoped>
- </style>
|