JX.Li преди 7 месеца
родител
ревизия
6288bb257f
променени са 8 файла, в които са добавени 1955 реда и са изтрити 0 реда
  1. 88 0
      src/api/yiqi/area.js
  2. 51 0
      src/api/yiqi/building.js
  3. 66 0
      src/api/yiqi/house.js
  4. 59 0
      src/api/yiqi/unit.js
  5. 735 0
      src/views/yiqi/area/index.vue
  6. 290 0
      src/views/yiqi/building/index.vue
  7. 347 0
      src/views/yiqi/house/index.vue
  8. 319 0
      src/views/yiqi/unit/index.vue

+ 88 - 0
src/api/yiqi/area.js

@@ -0,0 +1,88 @@
+import request from '@/utils/request'
+// 小区下拉框
+export function getAreaList() {
+  return request({
+    url: '/yq/gas/area/getArea',
+    method: 'get',
+  })
+}
+// 查询小区列表
+export function listArea(query) {
+  return request({
+    url: '/yq/gas/area/getList',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询小区详细
+export function getArea(id) {
+  return request({
+    url: '/yq/gas/area/' + id,
+    method: 'get'
+  })
+}
+
+// 新增小区
+export function addArea(data) {
+  return request({
+    url: '/yq/gas/area',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改小区
+export function updateArea(data) {
+  return request({
+    url: '/yq/gas/area',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除小区
+export function delArea(id) {
+  return request({
+    url: '/yq/gas/area/' + id,
+    method: 'delete'
+  })
+}
+
+
+// 下载
+export function areaUpload() {
+  return request({
+    url: '/obs/upload',
+    method: 'post',
+  })
+}
+//释放
+export function releaseIs(id) {
+  return request({
+    url: '/yq/gas/area/releaseIs?id=' + id,
+    method: 'get',
+  })
+}
+// 工号验证
+export function getForName(value,id) {
+  return request({
+    url: '/yq/gas/area/getForName?name='+value+'&id='+id,
+    method: 'get',
+  })
+}
+
+// 小区导入滚动条监控接口
+export function flushProgress() {
+  return request({
+    url: '/yq/gas/area/flushProgress',
+    method: 'get',
+  })
+}
+// 小区导入滚动条停止监控接口
+export function clearFlushProgress() {
+  return request({
+    url: '/yq/gas/area/clearFlushProgress',
+    method: 'get',
+  })
+}

+ 51 - 0
src/api/yiqi/building.js

@@ -0,0 +1,51 @@
+import request from '@/utils/request'
+
+// 查询楼宇列表
+export function listBuilding(query) {
+  return request({
+    url: '/yq/gas/building/getList',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询楼宇详细
+export function getBuilding(id) {
+  return request({
+    url: '/yq/gas/building/' + id,
+    method: 'get'
+  })
+}
+
+// 新增楼宇
+export function addBuilding(data) {
+  return request({
+    url: '/yq/gas/building',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改楼宇
+export function updateBuilding(data) {
+  return request({
+    url: '/yq/gas/building',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除楼宇
+export function delBuilding(id) {
+  return request({
+    url: '/yq/gas/building/' + id,
+    method: 'delete'
+  })
+}
+// 小区下拉框
+export function getArea() {
+  return request({
+    url: '/yq/gas/area/getArea',
+    method: 'get',
+  })
+}

+ 66 - 0
src/api/yiqi/house.js

@@ -0,0 +1,66 @@
+import request from '@/utils/request'
+
+// 查询房屋列表
+export function listHouse(query) {
+  return request({
+    url: '/yq/gas/house/getList',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询房屋详细
+export function getHouse(id) {
+  return request({
+    url: '/yq/gas/house/' + id,
+    method: 'get'
+  })
+}
+
+// 新增房屋
+export function addHouse(data) {
+  return request({
+    url: '/yq/gas/house',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改房屋
+export function updateHouse(data) {
+  return request({
+    url: '/yq/gas/house',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除房屋
+export function delHouse(id) {
+  return request({
+    url: '/yq/gas/house/' + id,
+    method: 'delete'
+  })
+}
+// 小区下拉框
+export function getArea() {
+  return request({
+    url: '/yq/gas/area/getArea',
+    method: 'get',
+  })
+}
+// 楼宇下拉框
+export function getBuilding(areaId) {
+  return request({
+    url: '/yq/gas/building/getBuilding?areaId='+ areaId,
+    method: 'get',
+
+  })
+}
+// 单元下拉框
+export function getUnit(buildingId) {
+  return request({
+    url: '/yq/gas/unit/getUnit?buildingId='+ buildingId,
+    method: 'get',
+  })
+}

+ 59 - 0
src/api/yiqi/unit.js

@@ -0,0 +1,59 @@
+import request from '@/utils/request'
+
+// 查询单元列表
+export function listUnit(query) {
+  return request({
+    url: '/yq/gas/unit/getList',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询单元详细
+export function getUnit(id) {
+  return request({
+    url: '/yq/gas/unit/' + id,
+    method: 'get'
+  })
+}
+
+// 新增单元
+export function addUnit(data) {
+  return request({
+    url: '/yq/gas/unit',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改单元
+export function updateUnit(data) {
+  return request({
+    url: '/yq/gas/unit',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除单元
+export function delUnit(id) {
+  return request({
+    url: '/yq/gas/unit/' + id,
+    method: 'delete'
+  })
+}
+// 小区下拉框
+export function getArea() {
+  return request({
+    url: '/yq/gas/area/getArea',
+    method: 'get',
+  })
+}
+// 楼宇下拉框
+export function getBuilding(areaId) {
+  return request({
+    url: '/yq/gas/building/getBuilding?areaId='+ areaId,
+    method: 'get',
+
+  })
+}

+ 735 - 0
src/views/yiqi/area/index.vue

@@ -0,0 +1,735 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="小区名" prop="name">
+        <el-input
+          v-model="queryParams.name"
+          placeholder="请输入小区名"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="行政区" prop="district">
+        <el-select v-model="queryParams.district" placeholder="请选择行政区" clearable style="width: 100%">
+          <el-option
+            v-for="dict in districtList"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+            @keyup.enter.native="handleQuery"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="核算行政区" prop="calculateDistrictId" label-width="100px">
+        <el-select v-model="queryParams.calculateDistrictId" placeholder="请选择核算行政区" clearable style="width: 100%">
+          <el-option
+            v-for="dict in districtList"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+            @keyup.enter.native="handleQuery"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="primary"-->
+<!--          plain-->
+<!--          icon="el-icon-plus"-->
+<!--          size="mini"-->
+<!--          @click="handleAdd"-->
+<!--          v-hasPermi="['gas:area:add']"-->
+<!--        >新增-->
+<!--        </el-button>-->
+<!--      </el-col>-->
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="danger"-->
+<!--          plain-->
+<!--          icon="el-icon-delete"-->
+<!--          size="mini"-->
+<!--          :disabled="multiple"-->
+<!--          @click="handleDelete"-->
+<!--          v-hasPermi="['gas:area:remove']"-->
+<!--        >删除-->
+<!--        </el-button>-->
+<!--      </el-col>-->
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['gas:area:export']"
+        >导出
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExports"
+        >所属包导出
+        </el-button>
+      </el-col>
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="info"-->
+<!--          plain-->
+<!--          icon="el-icon-upload2"-->
+<!--          size="mini"-->
+<!--          @click="handleImport"-->
+<!--          v-hasPermi="['system:user:import']"-->
+<!--        >导入-->
+<!--        </el-button>-->
+<!--      </el-col>-->
+      <!--<el-col :span="1.5">-->
+      <!--<el-button-->
+      <!--type="info"-->
+      <!--plain-->
+      <!--icon="el-icon-upload2"-->
+      <!--size="mini"-->
+      <!--@click="examinehandleImport"-->
+      <!--v-hasPermi="['system:user:import']"-->
+      <!--&gt;批量合格-->
+      <!--</el-button>-->
+      <!--</el-col>-->
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="info"-->
+<!--          plain-->
+<!--          icon="el-icon-upload2"-->
+<!--          size="mini"-->
+<!--          @click="handleUpload"-->
+<!--          v-hasPermi="['system:user:import']"-->
+<!--        >下载-->
+<!--        </el-button>-->
+<!--      </el-col>-->
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="areaList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center"/>
+      <el-table-column label="小区名" align="center" prop="name"/>
+<!--      <el-table-column label="完成率" align="center" prop="rate"/>-->
+      <el-table-column label="释放状态" align="center" prop="releaseIs">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.release_status" :value="scope.row.releaseIs"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="行政区" align="center" prop="calculateDistrictName">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.district" :value="scope.row.district"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="核算行政区" align="center" prop="calculateDistrictName">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.district" :value="scope.row.calculateDistrictId"/>
+        </template>
+      </el-table-column>
+
+      <el-table-column label="小区规模" align="center" prop="areaSize"/>
+
+      <el-table-column label="所属包" align="center" prop="affiliatedPackage">
+        <template slot-scope="scope">
+          {{affiliatedPackageList.filter(req => {return req.dictValue = scope.row.affiliatedPackage})[0].dictLabel }}
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+<!--          <el-button-->
+<!--            size="mini"-->
+<!--            type="text"-->
+<!--            icon="el-icon-download"-->
+<!--            @click="handleExportHouse(scope.row)"-->
+<!--            v-hasPermi="['gas:area:edit']"-->
+<!--          >导出完工详情-->
+<!--          </el-button>-->
+<!--          <el-button v-if="scope.row.releaseIs ==='001'"-->
+<!--                     size="mini"-->
+<!--                     type="text"-->
+<!--                     icon="el-icon-edit"-->
+<!--                     @click="handleRelease(scope.row)"-->
+<!--                     v-hasPermi="['gas:area:edit']"-->
+<!--          >释放-->
+<!--          </el-button>-->
+<!--          <el-button v-if="scope.row.releaseIs ==='001'"-->
+<!--                     type="text"-->
+<!--                     plain-->
+<!--                     icon="el-icon-download"-->
+<!--                     size="mini"-->
+<!--                     @click="handleUpload(scope.row)"-->
+<!--                     v-hasPermi="['gas:area:edit']"-->
+<!--          >下载-->
+<!--          </el-button>-->
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-view"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['gas:area:edit']"
+          >查看详情
+          </el-button>
+<!--          <el-button-->
+<!--            size="mini"-->
+<!--            type="text"-->
+<!--            icon="el-icon-delete"-->
+<!--            @click="handleDelete(scope.row)"-->
+<!--            v-hasPermi="['gas:area:remove']"-->
+<!--          >删除-->
+<!--          </el-button>-->
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改小区对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px" disabled>
+        <el-form-item label="行政区" prop="district" >
+          <el-select v-model="form.district" placeholder="请选择行政区">
+            <el-option
+              v-for="dict in dict.type.district"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="小区名" prop="name">
+          <el-input v-model="form.name" placeholder="请输入小区名" :disabled="disabled"/>
+        </el-form-item>
+        <el-form-item label="负责工长" prop="userId">
+          <el-select v-model="form.userId" filterable placeholder="请选择负责工长" style="width: 100%">
+            <el-option v-for="item in foremanList" :key="item.id" :value="item.id" :label="item.name">{{
+                item.name
+              }}
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="核算行政区" prop="calculateDistrictId">
+          <el-select v-model="form.calculateDistrictId" placeholder="请选择核算行政区" clearable style="width: 100%">
+            <el-option
+              v-for="dict in districtList"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="小区规模" prop="areaSize">
+          <el-input-number v-model="form.areaSize" style="width: 100%"></el-input-number>
+        </el-form-item>
+        <el-form-item label="所属包" prop="affiliatedPackage">
+          <el-select v-model="form.affiliatedPackage" placeholder="请选择所属包" clearable style="width: 100%">
+            <el-option
+              v-for="dict in affiliatedPackageList"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            />
+          </el-select>
+        </el-form-item>
+      </el-form>
+
+      <div slot="footer" class="dialog-footer">
+<!--        <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>-->
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+    <!-- 用户导入对话框 -->
+    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+      <el-upload
+        ref="upload"
+        :limit="1"
+        accept=".xlsx, .xls"
+        :headers="upload.headers"
+        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :disabled="upload.isUploading"
+        :on-progress="handleFileUploadProgress"
+        :on-success="handleFileSuccess"
+        :auto-upload="false"
+        drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+        <div class="el-upload__tip text-center" slot="tip">
+          <!--<div class="el-upload__tip" slot="tip">-->
+          <!--<el-checkbox v-model="upload.updateSupport"/>-->
+          <!--是否更新已经存在的用户数据-->
+          <!--</div>-->
+          <span>仅允许导入xls、xlsx格式文件。</span>
+          <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
+                   @click="importTemplate"
+          >下载模板
+          </el-link>
+        </div>
+      </el-upload>
+      <div style="padding-top: 15px;line-height: 25px;font-size: 14px;">
+        完成度:{{ bfb }}%
+        <progress max="100" :value="bfb" style="width: 200px;height: 18px;"></progress>
+        <br>
+        导入结果:{{ jdtMsg }}
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitFileForm">确 定</el-button>
+        <el-button @click="upload.open = false;bfb='0';jdtMsg=''">取 消</el-button>
+      </div>
+    </el-dialog>
+    <!--<el-dialog :title="examineupload.examinetitle" :visible.sync="examineupload.examineopen" width="400px" append-to-body>-->
+    <!--<el-upload-->
+    <!--ref="examineupload"-->
+    <!--:limit="1"-->
+    <!--accept=".xlsx, .xls"-->
+    <!--:headers="examineupload.examineheaders"-->
+    <!--:action="examineupload.examineurl + '?updateSupport=' + examineupload.examineupdateSupport"-->
+    <!--:disabled="examineupload.examineisUploading"-->
+    <!--:on-progress="examineishandleFileUploadProgress"-->
+    <!--:on-success="examineishandleFileSuccess"-->
+    <!--:auto-upload="false"-->
+    <!--drag-->
+    <!--&gt;-->
+    <!--<i class="el-icon-upload"></i>-->
+    <!--<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>-->
+    <!--<div class="el-upload__tip text-center" slot="tip">-->
+    <!--<div class="el-upload__tip" slot="tip">-->
+    <!--<el-checkbox v-model="examineupload.examineupdateSupport"/>-->
+    <!--是否更新已经存在的用户数据-->
+    <!--</div>-->
+    <!--<span>仅允许导入xls、xlsx格式文件。</span>-->
+    <!--<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"-->
+    <!--@click="importTemplate">下载模板-->
+    <!--</el-link>-->
+    <!--</div>-->
+    <!--</el-upload>-->
+    <!--<div slot="footer" class="dialog-footer">-->
+    <!--<el-button type="primary" @click="examinesubmitFileForm">确 定</el-button>-->
+    <!--<el-button @click="examineupload.examineopen = false">取 消</el-button>-->
+    <!--</div>-->
+    <!--</el-dialog>-->
+
+
+    <!-- 导出对话框 -->
+    <el-dialog title="所属包导出" :visible.sync="opens" width="500px" append-to-body>
+      <el-form ref="form" :model="forms" :rules="ruless" label-width="100px">
+        <el-form-item label="核算行政区" prop="calculateDistrictId">
+          <el-select v-model="forms.calculateDistrictId" placeholder="请选择核算行政区" clearable style="width: 100%">
+            <el-option
+              v-for="dict in districtList"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="所属包" prop="affiliatedPackage">
+          <el-select v-model="forms.affiliatedPackage" placeholder="请选择所属包" clearable style="width: 100%">
+            <el-option
+              v-for="dict in affiliatedPackageList"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            />
+          </el-select>
+        </el-form-item>
+      </el-form>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button :loading="buttonLoading" type="primary" @click="dowExports">确 定</el-button>
+        <el-button @click="cancels">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  listArea,
+  releaseIs,
+  getArea,
+  delArea,
+  addArea,
+  updateArea,
+  areaUpload,
+  flushProgress,
+  clearFlushProgress,
+  getForName,
+  getAreaList
+} from '@/api/yiqi/area'
+import { getToken } from '@/utils/auth'
+import {getYqDicts} from "@/api/system/dict/data";
+
+export default {
+  name: 'Area',
+  dicts: ['release_status', 'affiliated_package', 'district'],
+  data() {
+    // 工号唯一性验证
+    let validateAnother = (rule, value, callback) => {
+      if (value) {
+        getForName(value, this.form.id).then(res => {
+          if (res.data === false) {
+            callback('该小区已存在')
+          } else {
+            callback()
+          }
+        }).catch(err => {
+          callback(new Error(err.data.msg))
+        })
+      } else {
+        callback()
+      }
+    }
+    return {
+      //进度条
+      timeInterval: null,
+      bfb: '0',
+      jdtMsg: '',
+      // 按钮loading
+      buttonLoading: false,
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      disabled: false,
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 小区表格数据
+      areaList: [],
+      districtList: [],
+      affiliatedPackageList: [],
+      areaLists: [],
+      // 弹出层标题
+      title: '',
+      // 是否显示弹出层
+      open: false,
+      opens: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        name: undefined,
+        district: undefined,
+        calculateDistrictId: undefined,
+        userId: undefined
+      },
+      foremanList: [],
+      // 表单参数
+      form: {},
+      forms: {
+        pageNum: 1,
+        pageSize: 10
+      },
+      // 用户导入参数
+      upload: {
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: '',
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: 'Bearer ' + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + '/gas/area/importData'
+      },
+      // examineupload: {
+      //   // 是否显示弹出层(用户导入)
+      //   examineopen: false,
+      //   // 弹出层标题(用户导入)
+      //   examinetitle: "",
+      //   // 是否禁用上传
+      //   examineisUploading: false,
+      //   // 是否更新已经存在的用户数据
+      //   examineupdateSupport: 0,
+      //   // 设置上传的请求头部
+      //   examineheaders: {Authorization: "Bearer " + getToken()},
+      //   // 上传的地址
+      //   examineurl: process.env.VUE_APP_BASE_API + "/gas/area/importApprovalExcel"
+      // },
+      // 表单校验
+      rules: {
+        name: [
+          { required: true, message: '小区名不能为空', trigger: 'blur' },
+          { required: true, trigger: 'blur', validator: validateAnother }
+        ],
+        calculateDistrictId: [{ required: true, message: '请选择核算行政区', trigger: 'change' }],
+        areaSize: [{ required: true, message: '请输入小区规模', trigger: 'blur' }],
+        affiliatedPackage: [{ required: true, message: '请选择所属包', trigger: 'change' }]
+      },
+      // 表单校验
+      ruless: {
+        calculateDistrictId: [{ required: true, message: '请选择核算行政区', trigger: 'change' }],
+        affiliatedPackage: [{ required: true, message: '请选择所属包', trigger: 'change' }]
+      }
+    }
+  },
+  created() {
+    this.getList()
+    this.getYqDictsLists()
+    this.getAreaList()
+  },
+  methods: {
+    getYqDictsLists() {
+      getYqDicts("district").then(res => {
+        this.districtList = res.data
+      })
+      getYqDicts("affiliated_package").then(res => {
+        this.affiliatedPackageList = res.data
+      })
+    },
+    setCalculateDistrictName(data) {
+      this.form.calculateDistrictName = this.areaLists.filter(item => item.id == data)[0].name
+      console.log(this.form.calculateDistrictName)
+    },
+    /**小区下拉框*/
+    getAreaList() {
+      getAreaList().then(response => {
+        this.areaLists = response.data
+      })
+    },
+    /** 查询小区列表 */
+    getList() {
+      this.loading = true
+      listArea(this.queryParams).then(response => {
+        this.areaList = response.rows
+        this.total = response.total
+        this.loading = false
+      })
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false
+      this.reset()
+    },
+    // 取消按钮
+    cancels() {
+      this.opens = false
+      this.forms = {}
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: undefined,
+        name: undefined,
+        userId: undefined,
+        delFlag: undefined,
+        createBy: undefined,
+        createTime: undefined,
+        updateBy: undefined,
+        updateTime: undefined,
+        district:undefined,
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1
+      this.getList()
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm('queryForm')
+      this.handleQuery()
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset()
+      this.open = true
+      this.title = '添加小区'
+      this.disabled = false
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.loading = true
+      this.reset()
+      this.disabled = true
+      const id = row.id || this.ids
+      getArea(id).then(response => {
+        this.loading = false
+        this.form = response.data
+        this.open = true
+        this.title = '查看小区'
+      })
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs['form'].validate(valid => {
+        if (valid) {
+          this.buttonLoading = true
+          if (this.form.id != null) {
+            updateArea(this.form).then(response => {
+              this.$modal.msgSuccess('修改成功')
+              this.open = false
+              this.getList()
+            }).finally(() => {
+              this.buttonLoading = false
+            })
+          } else {
+            addArea(this.form).then(response => {
+              if (response.data) {
+                this.$modal.msgSuccess('新增成功')
+                this.open = false
+                this.getList()
+              } else {
+                this.$modal.msgError('小区名称不允许重复,请重新填写!')
+              }
+            }).finally(() => {
+              this.buttonLoading = false
+            })
+          }
+        }
+      })
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids
+      this.$modal.confirm('是否确认删除小区编号为"' + ids + '"的数据项?').then(() => {
+        this.loading = true
+        return delArea(ids)
+      }).then(() => {
+        this.loading = false
+        this.getList()
+        this.$modal.msgSuccess('删除成功')
+      }).finally(() => {
+        this.loading = false
+      })
+    },
+    //释放
+    handleRelease(row) {
+      this.$modal.confirm('请确认照片是否下载!释放过程不可逆!是否释放?').then(() => {
+        this.loading = true
+        return releaseIs(row.id)
+      }).then(() => {
+        this.loading = false
+        this.getList()
+        this.getArea()
+        this.$modal.msgSuccess('释放成功')
+      }).finally(() => {
+        this.loading = false
+      })
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.$download.excel('/yq/gas/area/export', this.queryParams)
+    },
+    /** 导出按钮操作 */
+    handleExports() {
+      this.opens = true
+      this.forms = {}
+    },
+    dowExports() {
+      this.$download.excel('/yq/gas/area/exports', this.forms)
+      this.opens = false
+    },
+    /** 导出完工率按钮操作 */
+    handleExportHouse(row) {
+      this.$download.excel('/yq/gas/area/getExportHouse?areaId=' + row.id)
+    },
+    /** 导入按钮操作 */
+    handleImport() {
+      this.upload.title = '用户导入'
+      this.upload.open = true
+    },
+    handleUpload(row) {
+      window.location.href = 'https://cczdsz.com/prod-api/gas/area/upload?id=' + row.id
+      // window.open("http://sz.cxcloudsci.com/prod-api/gas/area/upload?id=" + row.id, '_blank')
+      // window.open("http://localhost:8080/gas/area/upload?id=" + row.id, '_blank')
+      // window.location.href="http://localhost:8080/gas/area/upload?id=" + row.id;
+    },
+    /** 下载模板操作 */
+    importTemplate() {
+      this.$download.excel('/gas/area/importTemplate')
+    },
+    // 文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      // this.upload.open = false;
+      this.upload.isUploading = false
+      this.$refs.upload.clearFiles()
+      // this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
+      // this.jdtMsg=response.msg;
+      this.getList()
+    },
+    // 提交上传文件
+    submitFileForm() {
+      const ther = this
+      this.timeInterval = setInterval(function() {
+        ther.flushProgress()
+      }, 1500)
+      this.$refs.upload.submit()
+    },
+    // 提交上传文件
+    flushProgress() {
+      flushProgress().then(response => {
+        this.bfb = parseInt(response.data.bfb) >= 100 ? 100 : response.data.bfb
+        this.jdtMsg = response.data.message
+        if (response.data.message != null && response.data.message != '') {
+          clearFlushProgress().then(response => {
+          })
+          clearInterval(this.timeInterval)
+        }
+      })
+    }
+
+    // examinehandleImport() {
+    //   this.examineupload.examinetitle = "用户导入";
+    //   this.examineupload.examineopen = true;
+    // },
+    // // 文件上传中处理
+    // examineishandleFileUploadProgress(event, file, fileList) {
+    //   this.examineupload.examineisUploading = true;
+    // },
+    // // 文件上传成功处理
+    // examineishandleFileSuccess(response, file, fileList) {
+    //   this.examineupload.examineopen = false;
+    //   this.examineupload.examineisUploading = false;
+    //   this.$refs.examineupload.clearFiles();
+    //   this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
+    //   this.getList();
+    // },
+    // // 提交上传文件
+    // examinesubmitFileForm() {
+    //   this.$refs.examineupload.submit();
+    // }
+  }
+}
+</script>

+ 290 - 0
src/views/yiqi/building/index.vue

@@ -0,0 +1,290 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="楼宇名" prop="name">
+        <el-input
+          v-model="queryParams.name"
+          placeholder="请输入楼宇名"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item  label="所属小区" prop="areaId">
+        <el-select v-model="queryParams.areaId" filterable placeholder="请选择所属小区">
+          <el-option v-for="item in areaList" :key="item.id" :value="item.id" :label="item.name">{{ item.name }}</el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="primary"-->
+<!--          plain-->
+<!--          icon="el-icon-plus"-->
+<!--          size="mini"-->
+<!--          @click="handleAdd"-->
+<!--          v-hasPermi="['gas:building:add']"-->
+<!--        >新增</el-button>-->
+<!--      </el-col>-->
+
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="danger"-->
+<!--          plain-->
+<!--          icon="el-icon-delete"-->
+<!--          size="mini"-->
+<!--          :disabled="multiple"-->
+<!--          @click="handleDelete"-->
+<!--          v-hasPermi="['gas:building:remove']"-->
+<!--        >删除</el-button>-->
+<!--      </el-col>-->
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="warning"-->
+<!--          plain-->
+<!--          icon="el-icon-download"-->
+<!--          size="mini"-->
+<!--          :loading="exportLoading"-->
+<!--          @click="handleExport"-->
+<!--          v-hasPermi="['gas:building:export']"-->
+<!--        >导出</el-button>-->
+<!--      </el-col>-->
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="buildingList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="所属小区" align="center" prop="areaName" />
+      <el-table-column label="楼宇名" align="center" prop="name" />
+<!--      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
+<!--        <template slot-scope="scope">-->
+<!--          <el-button-->
+<!--            size="mini"-->
+<!--            type="text"-->
+<!--            icon="el-icon-edit"-->
+<!--            @click="handleUpdate(scope.row)"-->
+<!--            v-hasPermi="['gas:building:edit']"-->
+<!--          >修改</el-button>-->
+<!--          <el-button-->
+<!--            size="mini"-->
+<!--            type="text"-->
+<!--            icon="el-icon-delete"-->
+<!--            @click="handleDelete(scope.row)"-->
+<!--            v-hasPermi="['gas:building:remove']"-->
+<!--          >删除</el-button>-->
+<!--        </template>-->
+<!--      </el-table-column>-->
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改楼宇对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="楼宇名" prop="name">
+          <el-input v-model="form.name" placeholder="请输入楼宇名" />
+        </el-form-item>
+        <el-form-item  label="所属小区" prop="areaId">
+          <el-select v-model="form.areaId" filterable placeholder="请选择所属小区">
+            <el-option v-for="item in areaList" :key="item.id" :value="item.id" :label="item.name">{{ item.name }}</el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listBuilding, getBuilding, getArea,delBuilding, addBuilding, updateBuilding } from "@/api/yiqi/building";
+
+export default {
+  name: "Building",
+  data() {
+    return {
+      // 按钮loading
+      buttonLoading: false,
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 楼宇表格数据
+      buildingList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        name: undefined,
+        areaId: undefined,
+      },
+      areaList:[],
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        name: [
+          { required: true, message: "楼宇名不能为空", trigger: "blur" }
+        ],
+        areaId: [
+          { required: true, message: "小区id不能为空", trigger: "blur" }
+        ],
+      }
+    };
+  },
+  created() {
+    this.getList();
+    this.getArea();
+  },
+  methods: {
+    /** 查询楼宇列表 */
+    getList() {
+      this.loading = true;
+      listBuilding(this.queryParams).then(response => {
+        this.buildingList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    /**小区下拉框*/
+    getArea() {
+      this.loading = true;
+      getArea().then(response => {
+        this.areaList = response.data;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: undefined,
+        name: undefined,
+        areaId: undefined,
+        delFlag: undefined,
+        createBy: undefined,
+        createTime: undefined,
+        updateBy: undefined,
+        updateTime: undefined
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+      this.getArea();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加楼宇";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.loading = true;
+      this.reset();
+      const id = row.id || this.ids
+      getBuilding(id).then(response => {
+        this.loading = false;
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改楼宇";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          this.buttonLoading = true;
+          if (this.form.id != null) {
+            updateBuilding(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+              this.getArea();
+            }).finally(() => {
+              this.buttonLoading = false;
+            });
+          } else {
+            addBuilding(this.form).then(response => {
+              if(response.data){
+                this.$modal.msgSuccess("新增成功");
+                this.open = false;
+                this.getList();
+                this.getArea();
+              }else{
+                this.$modal.msgError("同一小区下楼宇名称不允许重复,请重新填写!");
+              }
+            }).finally(() => {
+              this.buttonLoading = false;
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除楼宇编号为"' + ids + '"的数据项?').then(() => {
+        this.loading = true;
+        return delBuilding(ids);
+      }).then(() => {
+        this.loading = false;
+        this.getList();
+        this.getArea();
+        this.$modal.msgSuccess("删除成功");
+      }).finally(() => {
+        this.loading = false;
+      });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+        this.$download.excel('/gas/building/export', this.queryParams);
+    }
+  }
+};
+</script>

+ 347 - 0
src/views/yiqi/house/index.vue

@@ -0,0 +1,347 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="房屋名" prop="name">
+        <el-input
+          v-model="queryParams.name"
+          placeholder="请输入房屋名"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item  label="所属小区" prop="areaId">
+        <el-select  v-model="queryParams.areaId" filterable placeholder="请选择小区" @change="getBuilding(queryParams.areaId) ,resetqueryform()">
+          <el-option v-for="item in areaList" :key="item.id" :value="item.id" :label="item.name" >{{ item.name }}</el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item  label="所属楼宇" prop="buildingId">
+        <el-select v-model="queryParams.buildingId" filterable placeholder="请选择楼宇" @change="getUnit(queryParams.buildingId),resetqueryunitform()">
+          <el-option v-for="item in buildingList" :key="item.id" :value="item.id" :label="item.name">{{ item.name }}</el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item  label="所属单元" prop="unitId">
+        <el-select v-model="queryParams.unitId" filterable placeholder="请选择楼宇">
+          <el-option v-for="item in unitList" :key="item.id" :value="item.id" :label="item.name">{{ item.name }}</el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="primary"-->
+<!--          plain-->
+<!--          icon="el-icon-plus"-->
+<!--          size="mini"-->
+<!--          @click="handleAdd"-->
+<!--          v-hasPermi="['gas:house:add']"-->
+<!--        >新增</el-button>-->
+<!--      </el-col>-->
+
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="danger"-->
+<!--          plain-->
+<!--          icon="el-icon-delete"-->
+<!--          size="mini"-->
+<!--          :disabled="multiple"-->
+<!--          @click="handleDelete"-->
+<!--          v-hasPermi="['gas:house:remove']"-->
+<!--        >删除</el-button>-->
+<!--      </el-col>-->
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="warning"-->
+<!--          plain-->
+<!--          icon="el-icon-download"-->
+<!--          size="mini"-->
+<!--          :loading="exportLoading"-->
+<!--          @click="handleExport"-->
+<!--          v-hasPermi="['gas:house:export']"-->
+<!--        >导出</el-button>-->
+<!--      </el-col>-->
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="houseList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="所属小区" align="center" prop="areaName" />
+      <el-table-column label="所属楼宇" align="center" prop="buildingName" />
+      <el-table-column label="所属单元" align="center" prop="unitName" />
+      <el-table-column label="房屋名" align="center" prop="name" />
+<!--      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
+<!--        <template slot-scope="scope">-->
+<!--          <el-button-->
+<!--            size="mini"-->
+<!--            type="text"-->
+<!--            icon="el-icon-edit"-->
+<!--            @click="handleUpdate(scope.row)"-->
+<!--            v-hasPermi="['gas:house:edit']"-->
+<!--          >修改</el-button>-->
+<!--          <el-button-->
+<!--            size="mini"-->
+<!--            type="text"-->
+<!--            icon="el-icon-delete"-->
+<!--            @click="handleDelete(scope.row)"-->
+<!--            v-hasPermi="['gas:house:remove']"-->
+<!--          >删除</el-button>-->
+<!--        </template>-->
+<!--      </el-table-column>-->
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改房屋对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="房屋名" prop="name">
+          <el-input v-model="form.name" placeholder="请输入房屋名" />
+        </el-form-item>
+        <el-form-item  label="所属小区" prop="areaId">
+          <el-select v-model="form.areaId" filterable placeholder="请选择小区" @change="getBuilding(form.areaId),resetform()">
+            <el-option v-for="item in areaList" :key="item.id" :value="item.id" :label="item.name" >{{ item.name }}</el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item  label="所属楼宇" prop="buildingId">
+          <el-select v-model="form.buildingId" filterable placeholder="请选择楼宇" @change="getUnit(form.buildingId),resetunitform()">
+            <el-option v-for="item in buildingList" :key="item.id" :value="item.id" :label="item.name">{{ item.name }}</el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item  label="所属单元" prop="unitId">
+          <el-select v-model="form.unitId" filterable placeholder="请选择单元">
+            <el-option v-for="item in unitList" :key="item.id" :value="item.id" :label="item.name">{{ item.name }}</el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+<!--        <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>-->
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listHouse, getHouse,getUnit,getArea,getBuilding, delHouse, addHouse, updateHouse } from "@/api/yiqi/house";
+
+export default {
+  name: "House",
+  data() {
+    return {
+      // 按钮loading
+      buttonLoading: false,
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 房屋表格数据
+      houseList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        name: undefined,
+        unitId: undefined,
+        buildingId: undefined,
+        areaId: undefined,
+      },
+      areaList:[],
+      buildingList:[],
+      unitList:[],
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        name: [
+          { required: true, message: "房屋名不能为空", trigger: "blur" }
+        ],
+        unitId: [
+          { required: true, message: "单元id不能为空", trigger: "blur" }
+        ],
+      }
+    };
+  },
+  created() {
+    this.getList();
+    this.getArea();
+  },
+  methods: {
+    /** 查询房屋列表 */
+    getList() {
+      this.loading = true;
+      listHouse(this.queryParams).then(response => {
+        this.houseList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    /**小区下拉框*/
+    getArea() {
+      this.loading = true;
+      getArea().then(response => {
+        this.areaList = response.data;
+      });
+    },
+    /**楼宇下拉框*/
+    getBuilding(areaId) {
+      getBuilding(areaId).then(response => {
+        this.buildingList = response.data;
+      });
+    },
+    getUnit(buildingId) {
+      getUnit(buildingId).then(response => {
+        this.unitList = response.data;
+      });
+    },
+    resetqueryform(){
+      this.queryParams.buildingId = undefined;
+      this.queryParams.unitId = undefined;
+    },
+    resetqueryunitform(){
+      this.queryParams.unitId = undefined;
+    },
+    resetform(){
+      this.form.buildingId = undefined;
+      this.form.unitId = undefined;
+    },
+    resetunitform(){
+      this.form.unitId = undefined;
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: undefined,
+        name: undefined,
+        unitId: undefined,
+        buildingId: undefined,
+        areaId: undefined,
+        delFlag: undefined,
+        createBy: undefined,
+        createTime: undefined,
+        updateBy: undefined,
+        updateTime: undefined
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.buildingList = [];
+      this.unitList = [];
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加房屋";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.loading = true;
+      this.reset();
+      const id = row.id || this.ids
+      getHouse(id).then(response => {
+        this.loading = false;
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改房屋";
+        this.getBuilding(this.form.areaId);
+        this.getUnit(this.form.buildingId);
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          this.buttonLoading = true;
+          if (this.form.id != null) {
+            updateHouse(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+              this.getArea();
+            }).finally(() => {
+              this.buttonLoading = false;
+            });
+          } else {
+            addHouse(this.form).then(response => {
+              if(response.data){
+                this.$modal.msgSuccess("新增成功");
+                this.open = false;
+                this.getList();
+                this.getArea();
+              }else{
+                this.$modal.msgError("同一小区、同一楼宇、同一单元下房屋名称不允许重复,请重新填写!");
+              }
+
+            }).finally(() => {
+              this.buttonLoading = false;
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除房屋编号为"' + ids + '"的数据项?').then(() => {
+        this.loading = true;
+        return delHouse(ids);
+      }).then(() => {
+        this.loading = false;
+        this.getList();
+        this.getArea();
+        this.$modal.msgSuccess("删除成功");
+      }).finally(() => {
+        this.loading = false;
+      });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+        this.$download.excel('/gas/house/export', this.queryParams);
+    }
+  }
+};
+</script>

+ 319 - 0
src/views/yiqi/unit/index.vue

@@ -0,0 +1,319 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="单元名" prop="name">
+        <el-input
+          v-model="queryParams.name"
+          placeholder="请输入单元名"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item  label="所属小区" prop="areaId">
+      <el-select  v-model="queryParams.areaId" filterable placeholder="请选择小区" @change="getBuilding(queryParams.areaId) ,resetqueryform()">
+        <el-option v-for="item in areaList" :key="item.id" :value="item.id" :label="item.name" >{{ item.name }}</el-option>
+      </el-select>
+      </el-form-item>
+      <el-form-item  label="所属楼宇" prop="buildingId">
+        <el-select v-model="queryParams.buildingId" filterable placeholder="请选择楼宇">
+          <el-option v-for="item in buildingList" :key="item.id" :value="item.id" :label="item.name">{{ item.name }}</el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="primary"-->
+<!--          plain-->
+<!--          icon="el-icon-plus"-->
+<!--          size="mini"-->
+<!--          @click="handleAdd"-->
+<!--          v-hasPermi="['gas:unit:add']"-->
+<!--        >新增</el-button>-->
+<!--      </el-col>-->
+
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="danger"-->
+<!--          plain-->
+<!--          icon="el-icon-delete"-->
+<!--          size="mini"-->
+<!--          :disabled="multiple"-->
+<!--          @click="handleDelete"-->
+<!--          v-hasPermi="['gas:unit:remove']"-->
+<!--        >删除</el-button>-->
+<!--      </el-col>-->
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="warning"-->
+<!--          plain-->
+<!--          icon="el-icon-download"-->
+<!--          size="mini"-->
+<!--          :loading="exportLoading"-->
+<!--          @click="handleExport"-->
+<!--          v-hasPermi="['gas:unit:export']"-->
+<!--        >导出</el-button>-->
+<!--      </el-col>-->
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="unitList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="所属小区" align="center" prop="areaName" />
+      <el-table-column label="所属楼宇" align="center" prop="buildingName" />
+      <el-table-column label="单元名" align="center" prop="name" />
+<!--      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
+<!--        <template slot-scope="scope">-->
+<!--&lt;!&ndash;          <el-button&ndash;&gt;-->
+<!--&lt;!&ndash;            size="mini"&ndash;&gt;-->
+<!--&lt;!&ndash;            type="text"&ndash;&gt;-->
+<!--&lt;!&ndash;            icon="el-icon-edit"&ndash;&gt;-->
+<!--&lt;!&ndash;            @click="handleUpdate(scope.row)"&ndash;&gt;-->
+<!--&lt;!&ndash;            v-hasPermi="['gas:unit:edit']"&ndash;&gt;-->
+<!--&lt;!&ndash;          >修改</el-button>&ndash;&gt;-->
+<!--          <el-button-->
+<!--            size="mini"-->
+<!--            type="text"-->
+<!--            icon="el-icon-delete"-->
+<!--            @click="handleDelete(scope.row)"-->
+<!--            v-hasPermi="['gas:unit:remove']"-->
+<!--          >删除</el-button>-->
+<!--        </template>-->
+<!--      </el-table-column>-->
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改单元对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="单元名" prop="name">
+          <el-input v-model="form.name" placeholder="请输入单元名" />
+        </el-form-item>
+        <el-form-item  label="所属小区" prop="areaId">
+        <el-select v-model="form.areaId" filterable placeholder="请选择小区" @change="getBuilding(form.areaId),resetform()">
+          <el-option v-for="item in areaList" :key="item.id" :value="item.id" :label="item.name" >{{ item.name }}</el-option>
+        </el-select>
+        </el-form-item>
+        <el-form-item  label="所属楼宇" prop="buildingId">
+          <el-select v-model="form.buildingId" filterable placeholder="请选择楼宇">
+            <el-option v-for="item in buildingList" :key="item.id" :value="item.id" :label="item.name">{{ item.name }}</el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+<!--        <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>-->
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listUnit, getUnit,getArea,getBuilding, delUnit, addUnit, updateUnit } from "@/api/yiqi/unit";
+
+export default {
+  name: "Unit",
+  data() {
+    return {
+      // 按钮loading
+      buttonLoading: false,
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 单元表格数据
+      unitList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        name: undefined,
+        buildingId: undefined,
+        areaId: undefined,
+      },
+      areaList:[],
+      buildingList:[],
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        name: [
+          { required: true, message: "单元名不能为空", trigger: "blur" }
+        ],
+        buildingId: [
+          { required: true, message: "楼宇id不能为空", trigger: "blur" }
+        ],
+      }
+    };
+  },
+  created() {
+    this.getList();
+    this.getArea();
+  },
+  methods: {
+    /** 查询单元列表 */
+    getList() {
+      this.loading = true;
+      listUnit(this.queryParams).then(response => {
+        this.unitList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    /**小区下拉框*/
+    getArea() {
+      this.loading = true;
+      getArea().then(response => {
+        this.areaList = response.data;
+      });
+    },
+    /**楼宇下拉框*/
+    getBuilding(areaId) {
+      getBuilding(areaId).then(response => {
+        this.buildingList = response.data;
+      });
+    },
+    resetqueryform(){
+      this.queryParams.buildingId = undefined;
+    },
+    resetform(){
+      this.form.buildingId = undefined;
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: undefined,
+        name: undefined,
+        buildingId: undefined,
+        areaId: undefined,
+        delFlag: undefined,
+        createBy: undefined,
+        createTime: undefined,
+        updateBy: undefined,
+        updateTime: undefined
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.buildingList = [];
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加单元";
+      this.buildingList = [];
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.loading = true;
+      this.reset();
+      const id = row.id || this.ids
+      getUnit(id).then(response => {
+        this.loading = false;
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改单元";
+        this.getBuilding(this.form.areaId);
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          this.buttonLoading = true;
+          if (this.form.id != null) {
+            updateUnit(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+              this.getArea();
+            }).finally(() => {
+              this.buttonLoading = false;
+            });
+          } else {
+            addUnit(this.form).then(response => {
+              if(response.data){
+                this.$modal.msgSuccess("新增成功");
+                this.open = false;
+                this.getList();
+                this.getArea();
+              }else{
+                this.$modal.msgError("同一小区、同一楼宇下房屋名称不允许重复,请重新填写!");
+              }
+            }).finally(() => {
+              this.buttonLoading = false;
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除单元编号为"' + ids + '"的数据项?').then(() => {
+        this.loading = true;
+        return delUnit(ids);
+      }).then(() => {
+        this.loading = false;
+        this.getList();
+        this.getArea();
+        this.$modal.msgSuccess("删除成功");
+      }).finally(() => {
+        this.loading = false;
+      });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+        this.$download.excel('/gas/unit/export', this.queryParams);
+    }
+  }
+};
+</script>