|
@@ -0,0 +1,898 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <div class="custom-tree-container">
|
|
|
+ <div class="block-l">
|
|
|
+ <el-card shadow="hover">
|
|
|
+ <el-tag class="full space-vertical">当前所选:载体结构</el-tag>
|
|
|
+ <!-- @node-click="handleDeptNodeClick" -->
|
|
|
+ <el-tree
|
|
|
+ ref="selectTree"
|
|
|
+ default-expand-all
|
|
|
+ :data="DeptTree"
|
|
|
+ node-key="id"
|
|
|
+ :indent="deptTreeIndent"
|
|
|
+ accordion
|
|
|
+ :expand-on-click-node="expandDeptClick"
|
|
|
+ :default-expanded-keys="expandedDeptKey"
|
|
|
+ node-click="(data, node, item) => nodeClick(data, node, item)"
|
|
|
+ @node-click="getCheckedNodes"
|
|
|
+ >
|
|
|
+ <span slot-scope="{ node, data }" class="custom-tree-node">
|
|
|
+ <span>
|
|
|
+ <i v-if="data.level == 0" class="el-icon-s-home" />
|
|
|
+ <i v-else-if="data.level == 1" class="el-icon-menu" />
|
|
|
+ <i v-else class="el-icon-link" />
|
|
|
+ {{ node.label }}
|
|
|
+ </span>
|
|
|
+ <span v-if="data.level == 0">
|
|
|
+ <el-link class="space" type="primary" @click="() => unFoldAll()">展开</el-link>
|
|
|
+ <el-link class="space" type="primary" @click="() => collapseAll()">折叠</el-link>
|
|
|
+ </span>
|
|
|
+ </span>
|
|
|
+ </el-tree>
|
|
|
+ </el-card>
|
|
|
+ </div>
|
|
|
+ <div class="block-r">
|
|
|
+ <el-row class="handle-box" style="margin-bottom: 10px">
|
|
|
+ <el-col :span="1">
|
|
|
+ 楼栋号
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="23">
|
|
|
+ <el-input v-model="queryParam.ldmc" size="small" placeholder="请输入楼栋号" class="ch-input-size" @keyup.enter.native="handleSearch()" />
|
|
|
+ <el-button size="small" class="ch-button-export" style="float: right;margin-top: 4px" @click="handleExcel()"><i class="el-icon-menu" /> 导出Excel</el-button>
|
|
|
+ <el-button size="small" class="ch-button-add" style="float: right; margin-right: 10px; margin-top: 4px" @click="handleAdd()"><i class="el-icon-menu" /> 新增楼栋</el-button>
|
|
|
+ <el-button size="small" class="ch-button" style="float: right;margin-top: 4px" @click="handleSearch()"><i class="el-icon-menu" /> 查询</el-button>
|
|
|
+ <el-button size="small" class="ch-button-warning" style="float: right;margin-top: 4px" @click="handleReset()"><i class="el-icon-menu" /> 重置</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="handle-box">
|
|
|
+ <el-col :span="24">
|
|
|
+ <!-- @current-change="handleRowSelectChange" -->
|
|
|
+ <el-table ref="singleTable" v-loading="loading" :data="AllData" highlight-current-row>
|
|
|
+ <el-table-column label="编号" type="index" width="60" />
|
|
|
+ <el-table-column label="园区" prop="parkName" />
|
|
|
+ <el-table-column label="楼盘" prop="lpmc" />
|
|
|
+ <el-table-column label="楼栋号" prop="ldmc">
|
|
|
+ <template scope="scope">
|
|
|
+ <span @click="handleView(scope.row)">{{ scope.row.ldmc }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="类型" prop="type" :formatter="typeFormatter" />
|
|
|
+ <el-table-column label="面积" prop="mj" header-align="center" align="center" width="80" />
|
|
|
+ <el-table-column label="操作" header-align="center" width="160">
|
|
|
+ <template scope="scope">
|
|
|
+ <el-button size="mini" type="primary" @click="handleEdit(scope.row)" class="editButton">编辑</el-button>
|
|
|
+ <el-button v-if="scope.row.id != '1'" size="mini" type="info" @click="buildDel(scope.row)" class="deleButton">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="table-page">
|
|
|
+ <el-pagination
|
|
|
+ :current-page.sync="currentPage"
|
|
|
+ :page-size="pageSize"
|
|
|
+ background
|
|
|
+ layout="total, prev, pager, next"
|
|
|
+ :total="allpage"
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="950px" top="50px" @open="dlgOpen" @close="dlgClose">
|
|
|
+ <el-form ref="buildForm" :model="buildForm" style="width: 100%;padding: 5px" :rules="commitRules">
|
|
|
+ <el-row>
|
|
|
+ <el-col style="padding-bottom: 10px">
|
|
|
+ <span class="card_title">基本信息</span>
|
|
|
+ <el-card shadow="always" style="padding-top: 10px">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="4" class="col-txt"><span>父级</span></el-col>
|
|
|
+ <el-col :span="20" class="col-input">
|
|
|
+ <el-form-item>
|
|
|
+ <!-- @change="handleChange" -->
|
|
|
+ <el-cascader
|
|
|
+ ref="findids"
|
|
|
+ v-model="buildForm.findids"
|
|
|
+ class="full"
|
|
|
+ :options="options"
|
|
|
+ clearable
|
|
|
+ @change="handleChange"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="4" class="col-txt"><span>*楼栋号|地块号</span></el-col>
|
|
|
+ <el-col :span="8" class="col-input">
|
|
|
+ <el-form-item prop="ldmc">
|
|
|
+ <el-input v-model="buildForm.ldmc" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4" class="col-txt"><span>*关联区域</span></el-col>
|
|
|
+ <el-col :span="8" class="col-input">
|
|
|
+ <el-form-item prop="lcqymc">
|
|
|
+ <el-select v-model="buildForm.lcqymc" placeholder="" filterable multiple>
|
|
|
+ <el-option
|
|
|
+ v-for="item in dc_data.MNP_BUILDING_LCQY"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="4" class="col-txt"><span>*关联楼层</span></el-col>
|
|
|
+ <el-col :span="20" class="col-input">
|
|
|
+ <el-form-item prop="lcmc">
|
|
|
+ <el-select v-model="buildForm.lcmc" placeholder="" filterable multiple>
|
|
|
+ <el-option
|
|
|
+ v-for="item in dc_data.MNP_BUILDING_LC"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="4" class="col-txt"><span>*面积(㎡)</span></el-col>
|
|
|
+ <el-col :span="8" class="col-input">
|
|
|
+ <el-form-item prop="mj">
|
|
|
+ <el-input v-model="buildForm.mj" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4" class="col-txt"><span>类型</span></el-col>
|
|
|
+ <el-col :span="8" class="col-input">
|
|
|
+ <el-form-item>
|
|
|
+ <el-select v-model="buildForm.type" placeholder="" filterable>
|
|
|
+ <el-option
|
|
|
+ v-for="item in dc_data.parkType"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="4" class="col-txt"><span>经纬度</span></el-col>
|
|
|
+ <el-col :span="20" class="col-input">
|
|
|
+ <el-form-item>
|
|
|
+ <el-input v-model="buildForm.latAndLon" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="4" class="col-txt"><span>产证名称</span></el-col>
|
|
|
+ <el-col :span="8" class="col-input">
|
|
|
+ <el-form-item prop="mj">
|
|
|
+ <el-input v-model="buildForm.certificateName" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4" class="col-txt"><span>产证编号</span></el-col>
|
|
|
+ <el-col :span="8" class="col-input">
|
|
|
+ <el-form-item prop="mj">
|
|
|
+ <el-input v-model="buildForm.certificateNumber" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="4" class="col-txt"><span>产证地址</span></el-col>
|
|
|
+ <el-col :span="20" class="col-input">
|
|
|
+ <el-form-item>
|
|
|
+ <el-input v-model="buildForm.certificateAddress" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <!-- <el-row>-->
|
|
|
+ <!-- <el-col :span="4" class="col-txt"><span>楼栋介绍</span></el-col>-->
|
|
|
+ <!-- <el-col :span="20" class="col-txt">-->
|
|
|
+ <!-- <el-form-item>-->
|
|
|
+ <!-- <text-edit ref="textEdit" :text-content="buildForm.introduction" @input="test" />-->
|
|
|
+ <!-- </el-form-item>-->
|
|
|
+ <!-- </el-col>-->
|
|
|
+ <!-- </el-row>-->
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer">
|
|
|
+ <el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="confirmSubmit()">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ :visible.sync="dialogViewVisible"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :close-on-press-escape="false"
|
|
|
+ width="950px"
|
|
|
+ top="50px"
|
|
|
+ append-to-body
|
|
|
+ >
|
|
|
+ <build-view ref="buildView" @cancel="cancel" />
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import Base from '@/views/base/base'
|
|
|
+import BaseData from '@/views/base/baseData'
|
|
|
+import BaseDept from '@/views/base/baseDept'
|
|
|
+import constant from '../../../static/utils/constant'
|
|
|
+import BuildView from './buildView'
|
|
|
+// import textEdit from '../../textEdit/index'
|
|
|
+export default {
|
|
|
+ name: 'User',
|
|
|
+ components: { BuildView },
|
|
|
+ mixins: [Base, BaseData, BaseDept],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ dc_key: ['parkType', 'MNP_BUILDING_LCQY', 'MNP_BUILDING_LC'],
|
|
|
+ // 查询参数
|
|
|
+ queryParam: {
|
|
|
+ ldmc: ''
|
|
|
+ },
|
|
|
+ buildForm: {
|
|
|
+
|
|
|
+ },
|
|
|
+ DeptTree: [],
|
|
|
+ options: [],
|
|
|
+
|
|
|
+ // 字典项
|
|
|
+ dc_gender: [],
|
|
|
+ dc_map: {},
|
|
|
+
|
|
|
+ // 列表相关
|
|
|
+ username: '',
|
|
|
+ truename: '',
|
|
|
+ dataRoleId: '',
|
|
|
+ postId: '',
|
|
|
+ AllData: [],
|
|
|
+ loading: false,
|
|
|
+ currentRow: null,
|
|
|
+ isAdminSelect: false,
|
|
|
+ isGroupUser: false,
|
|
|
+
|
|
|
+ // 用户维护相关
|
|
|
+ dialogVisible: false,
|
|
|
+ dialogTitle: '新增用户',
|
|
|
+ isAdd: true,
|
|
|
+ selectDepartment: [],
|
|
|
+ form: this.getBaseForm(),
|
|
|
+ LeaderData: [],
|
|
|
+ commitRules: {
|
|
|
+ ldmc: [{ required: true, trigger: 'blur', message: '请输入楼栋号' }],
|
|
|
+ mj: [{ required: true, trigger: 'blur', message: '请输入面积' }]
|
|
|
+ // lcqymc: [{ required: true, trigger: 'blur', message: '请选择关联区域' }],
|
|
|
+ // lcmc: [{ required: true, trigger: 'blur', message: '请选择关联楼层' }]
|
|
|
+ },
|
|
|
+
|
|
|
+ // 角色维护相关
|
|
|
+ dialogRoleVisible: false,
|
|
|
+ dialogRoleTitle: '角色选择',
|
|
|
+ selectUserId: '',
|
|
|
+ selectUserName: '',
|
|
|
+ SelectMenuRole: [],
|
|
|
+ SelectDataRoleId: '',
|
|
|
+ MenuRole: [],
|
|
|
+ nodeId: '',
|
|
|
+ level: '',
|
|
|
+ dialogViewVisible: false
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.initDict(this.dc_key).then((res) => {
|
|
|
+ this.getList()
|
|
|
+ })
|
|
|
+ this.getTreeData()
|
|
|
+ this.getTreeSelectData()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ handleChange(value) {
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ handleSearch: function() {
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+
|
|
|
+ getTreeData: function() {
|
|
|
+ this.baseInfoRequest('getTreeData2', {}).then((res) => {
|
|
|
+ this.DeptTree = res.data.data
|
|
|
+ }).catch(() => {
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ getTreeSelectData: function() {
|
|
|
+ this.baseInfoRequest('getTreeData3', {}).then((res) => {
|
|
|
+ this.options = res.data.data
|
|
|
+ }).catch(() => {
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ handleReset: function() {
|
|
|
+ this.queryParam = {}
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+
|
|
|
+ getList: function() {
|
|
|
+ const _this = this
|
|
|
+ _this.loading = true
|
|
|
+ _this.AllData = []
|
|
|
+ this.queryParam.pageNum = this.currentPage
|
|
|
+ this.queryParam.pageSize = this.pageSize
|
|
|
+ this.baseRequest('list', this.queryParam).then((res) => {
|
|
|
+ // if (res.data.rows) {
|
|
|
+ // res.data.rows.forEach(function(item) {
|
|
|
+ // _this.AllData.push(_this.getItemJson(item))
|
|
|
+ // })
|
|
|
+ // _this.allpage = res.data.total
|
|
|
+ // }
|
|
|
+ _this.AllData = res.data.rows
|
|
|
+ _this.allpage = res.data.total
|
|
|
+ _this.loading = false
|
|
|
+ }).catch(() => {
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleAdd: function() {
|
|
|
+ this.dialogVisible = true
|
|
|
+ this.dialogTitle = '新增楼栋'
|
|
|
+ },
|
|
|
+
|
|
|
+ // handleExcel: function() {
|
|
|
+ // this.baseRequest('excelList', this.queryParam).then((res) => {
|
|
|
+ // console.log(res)
|
|
|
+ // window.location.href = constant.BASE_URI + '/' + res.data.msg
|
|
|
+ // }).catch(() => {
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+
|
|
|
+ // 导出
|
|
|
+ handleExcel: function() {
|
|
|
+ const _this = this
|
|
|
+ this.OutData = []
|
|
|
+ const title = ['园区', '楼盘', '楼栋号', '类型', '面积']
|
|
|
+ this.OutData.push(title)
|
|
|
+ const temp = []
|
|
|
+ this.baseRequest('excelListAll', _this.queryParam).then(res => {
|
|
|
+ const data = res.data
|
|
|
+ data.forEach(function(item) {
|
|
|
+ const json = _this.getItemJson(item)
|
|
|
+ temp.push(json)
|
|
|
+ })
|
|
|
+ temp.forEach(function(item) {
|
|
|
+ const jsonArray = []
|
|
|
+ jsonArray.push(item.groupName)
|
|
|
+ jsonArray.push(item.lpmc)
|
|
|
+ jsonArray.push(item.ldmc)
|
|
|
+ jsonArray.push(item.type)
|
|
|
+ jsonArray.push(item.mj)
|
|
|
+ _this.OutData.push(jsonArray)
|
|
|
+ })
|
|
|
+ const OutSize = [{ wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }]
|
|
|
+ const fileName = '载体导出 ' + new Date().Format('yyyyMMddhhmm')
|
|
|
+ _this.$outputXlsxFile(this.OutData, OutSize, fileName)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ handleEdit: function(val) {
|
|
|
+ this.buildForm = val
|
|
|
+ this.buildForm.findids = []
|
|
|
+ if (this.buildForm.groupId != null &&
|
|
|
+ this.buildForm.groupId !== '') {
|
|
|
+ this.buildForm.findids[0] = this.buildForm.groupId
|
|
|
+ if (this.buildForm.discId != null &&
|
|
|
+ this.buildForm.discId !== '') {
|
|
|
+ this.buildForm.findids[1] = this.buildForm.discId
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.buildForm.lcqymc = val.lcqymc.split(',')
|
|
|
+ this.buildForm.lcmc = val.lcmc.split(',')
|
|
|
+ if (this.buildForm.latAndLon) {
|
|
|
+ this.buildForm.latAndLon = val.lat + ',' + val.lon
|
|
|
+ }
|
|
|
+ this.dialogVisible = true
|
|
|
+ this.dialogTitle = '编辑楼栋'
|
|
|
+ },
|
|
|
+ buildDel(val) {
|
|
|
+ this.$confirm('此操作将删除楼栋, 是否继续?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.baseRequest('remove/' + val.id, {}).then(res => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ // this.getData()
|
|
|
+ this.getList()
|
|
|
+ this.getTreeData()
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '删除成功!'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch((err) => {
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: err
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消删除'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ confirmSubmit: function() {
|
|
|
+ console.log()
|
|
|
+ if (undefined == this.buildForm.lcmc || this.buildForm.lcmc.length < 1) {
|
|
|
+ this.$message({
|
|
|
+ message: '请选择关联楼层',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (undefined == this.buildForm.lcqymc || this.buildForm.lcqymc.length < 1) {
|
|
|
+ this.$message({
|
|
|
+ message: '请选择关联区域',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$refs.buildForm.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ const _this = this
|
|
|
+ const extraData = {}
|
|
|
+ const postData = Object.assign({}, _this.buildForm, extraData)
|
|
|
+ // 父级
|
|
|
+ const ids = this.buildForm.findids
|
|
|
+ const arr = this.$refs['findids'].getCheckedNodes()[0].pathLabels
|
|
|
+ if (ids != null && ids != [] && ids != '') {
|
|
|
+ postData.groupId = ids[0]
|
|
|
+ postData.discId = ids[1]
|
|
|
+ }
|
|
|
+ if (arr != null && arr != [] && arr != '') {
|
|
|
+ postData.groupName = arr[0]
|
|
|
+ postData.lpmc = arr[1]
|
|
|
+ }
|
|
|
+ let urlAdd = 'add'
|
|
|
+ if (undefined != this.buildForm.id && this.buildForm.id != null && this.buildForm.id != '') {
|
|
|
+ urlAdd = 'edit'
|
|
|
+ }
|
|
|
+ // 经纬度
|
|
|
+ const latAndLon = this.buildForm.latAndLon
|
|
|
+ if (latAndLon != null && latAndLon != [] && latAndLon != '') {
|
|
|
+ const latAndLon = this.buildForm.latAndLon.split(',')
|
|
|
+ postData.lon = latAndLon[0]
|
|
|
+ postData.lat = latAndLon[1]
|
|
|
+ }
|
|
|
+ // 关联区域
|
|
|
+ const lcqymc = this.buildForm.lcqymc.join(',')
|
|
|
+ postData.lcqymc = lcqymc
|
|
|
+ // 关联楼层
|
|
|
+ const lcmc = this.buildForm.lcmc.join(',')
|
|
|
+ postData.lcmc = lcmc
|
|
|
+
|
|
|
+ // if (ids != null && ids != [] && ids != '') {
|
|
|
+ // this.buildForm.groupId = ids[0]
|
|
|
+ // this.buildForm.discId = ids[1]
|
|
|
+ // }
|
|
|
+ // if (arr != null && arr != [] && arr != '') {
|
|
|
+ // this.buildForm.groupName = arr[0]
|
|
|
+ // this.buildForm.lpmc = arr[1]
|
|
|
+ // }
|
|
|
+ // let urlAdd = 'add'
|
|
|
+ // if (undefined != this.buildForm.id && this.buildForm.id != null && this.buildForm.id != '') {
|
|
|
+ // urlAdd = 'edit'
|
|
|
+ // }
|
|
|
+ // // 经纬度
|
|
|
+ // const latAndLon = this.buildForm.latAndLon
|
|
|
+ // if (latAndLon != null && latAndLon != [] && latAndLon != '') {
|
|
|
+ // const latAndLon = this.buildForm.latAndLon.split(',')
|
|
|
+ // this.buildForm.lon = latAndLon[0]
|
|
|
+ // this.buildForm.lat = latAndLon[1]
|
|
|
+ // }
|
|
|
+ // // 关联区域
|
|
|
+ // const lcqymc = this.buildForm.lcqymc.join(',')
|
|
|
+ // this.buildForm.lcqymc = lcqymc
|
|
|
+ // // 关联楼层
|
|
|
+ // const lcmc = this.buildForm.lcmc.join(',')
|
|
|
+ // this.buildForm.lcmc = lcmc
|
|
|
+
|
|
|
+ this.baseRequest(urlAdd, postData).then((res) => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ this.buildForm = {}
|
|
|
+ this.dialogVisible = false
|
|
|
+ // this.getList()
|
|
|
+ this.getTreeData()
|
|
|
+ this.$message({
|
|
|
+ message: '提交成功',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch((err) => {
|
|
|
+ this.$message({
|
|
|
+ message: err,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getCheckedNodes(data, node, item) {
|
|
|
+ const _this = this
|
|
|
+ console.log('节点====', node)
|
|
|
+ console.log('节点id====', node.data.id)
|
|
|
+ console.log('层级====', node.level)
|
|
|
+ _this.queryParam.nodeId = node.data.id
|
|
|
+ _this.queryParam.level = node.level
|
|
|
+ // this.getData()
|
|
|
+ _this.getList()
|
|
|
+ },
|
|
|
+ getData: function() {
|
|
|
+ const _this = this
|
|
|
+ this.loading = true
|
|
|
+ this.AllData = []
|
|
|
+
|
|
|
+ const postData = {
|
|
|
+ department: this.selectDeptNode.id === '0' ? '' : this.selectDeptNode.id,
|
|
|
+ username: this.username,
|
|
|
+ truename: this.truename,
|
|
|
+ dataRole: this.dataRoleId,
|
|
|
+ postId: this.postId,
|
|
|
+ pageNum: this.currentPage,
|
|
|
+ pageSize: this.pageSize,
|
|
|
+ nodeId: this.nodeId,
|
|
|
+ level: this.level
|
|
|
+ }
|
|
|
+ if (this.$common.currUser().groupId) {
|
|
|
+ postData.groupId = this.$common.currUser().groupId
|
|
|
+ }
|
|
|
+ this.baseRequest('list', postData).then((res) => {
|
|
|
+ if (res.data.rows) {
|
|
|
+ res.data.rows.forEach(function(item) {
|
|
|
+ _this.AllData.push(_this.getItemJson(item))
|
|
|
+ })
|
|
|
+ _this.allpage = res.data.total
|
|
|
+ }
|
|
|
+ _this.loading = false
|
|
|
+ }).catch(() => {
|
|
|
+ })
|
|
|
+
|
|
|
+ // this.initRole()
|
|
|
+ },
|
|
|
+ getItemJson: function(item) {
|
|
|
+ // const posts = item.posts ? item.posts.split(',') : []
|
|
|
+ // if (posts.length > 0) {
|
|
|
+ // const postStr = []
|
|
|
+ // posts.forEach(post => {
|
|
|
+ // postStr.push(this.PostMap[post])
|
|
|
+ // })
|
|
|
+ // item.postStr = postStr.join(',')
|
|
|
+ // }
|
|
|
+ // item.type = this.dc_map.parkType[item.type]
|
|
|
+ // item.dataRoleStr = this.DataRoleMap[item.dataRole]
|
|
|
+ // item.department = item.department ? this.DeptMap[item.department] : ''
|
|
|
+ // 合同状态
|
|
|
+ item.type = this.dc_map.parkType[item.type]
|
|
|
+ return item
|
|
|
+ },
|
|
|
+ typeFormatter(row, column) {
|
|
|
+ return this.dc_map.parkType[row.type]
|
|
|
+ },
|
|
|
+ // initRole: function() {
|
|
|
+ // const _this = this
|
|
|
+ // this.MenuRole = []
|
|
|
+ //
|
|
|
+ // this.$channel.baseRequest('RoleController', 'listAll', '', 'All Role').then((res) => {
|
|
|
+ // if (res.data) {
|
|
|
+ // res.data.forEach(function(item) {
|
|
|
+ // const json = {
|
|
|
+ // name: item.name,
|
|
|
+ // id: item.id
|
|
|
+ // }
|
|
|
+ // _this.MenuRole.push(json)
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // }).catch(() => {
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+
|
|
|
+ // handleReset: function() {
|
|
|
+ // this.username = ''
|
|
|
+ // this.truename = ''
|
|
|
+ // this.postId = ''
|
|
|
+ // this.dataRoleId = ''
|
|
|
+ // this.handleSearch()
|
|
|
+ // },
|
|
|
+ handleRowSelectChange(val) {
|
|
|
+ this.currentRow = val
|
|
|
+ if (this.currentRow) {
|
|
|
+ if (this.currentRow.id === '1') {
|
|
|
+ this.isAdminSelect = true
|
|
|
+ } else {
|
|
|
+ this.isAdminSelect = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getBaseForm: function() {
|
|
|
+ const baseForm = {
|
|
|
+ id: '',
|
|
|
+ groupId: '',
|
|
|
+ username: '',
|
|
|
+ password: null,
|
|
|
+ truename: '',
|
|
|
+ leader: '',
|
|
|
+ department: [],
|
|
|
+ posts: [],
|
|
|
+ gender: '',
|
|
|
+ phone: '',
|
|
|
+ sequenceNo: '',
|
|
|
+ secretKey: '',
|
|
|
+ comment: ''
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.$common.currUser().groupId) {
|
|
|
+ baseForm.groupId = this.$common.currUser().groupId
|
|
|
+ }
|
|
|
+
|
|
|
+ return baseForm
|
|
|
+ },
|
|
|
+ dlgOpen: function() {
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // this.$refs.buildForm.resetFields()
|
|
|
+ // })
|
|
|
+ },
|
|
|
+ dlgClose: function() {
|
|
|
+ const _this = this
|
|
|
+ _this.buildForm = {}
|
|
|
+ _this.getList()
|
|
|
+ },
|
|
|
+
|
|
|
+ assignRole: function() {
|
|
|
+ if (this.currentRow) {
|
|
|
+ this.selectUserId = this.currentRow.id
|
|
|
+ this.selectUserName = this.currentRow.truename
|
|
|
+ this.SelectMenuRole = []
|
|
|
+ this.SelectDataRoleId = this.currentRow.dataRole
|
|
|
+ this.dialogRoleTitle = this.currentRow.username + '[' + this.currentRow.truename + ']角色选择'
|
|
|
+ this.dialogRoleVisible = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ dlgRoleOpen: function() {
|
|
|
+ const _this = this
|
|
|
+ const postData = {
|
|
|
+ sysUserId: this.selectUserId
|
|
|
+ }
|
|
|
+ this.baseRequest('listUserRole', postData).then((res) => {
|
|
|
+ if (res.data) {
|
|
|
+ res.data.forEach(function(item) {
|
|
|
+ _this.SelectMenuRole.push(item.sysRoleId)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ })
|
|
|
+ },
|
|
|
+ confirmSubmitRole: function() {
|
|
|
+ const postRole = {
|
|
|
+ userId: this.selectUserId
|
|
|
+ }
|
|
|
+ if (this.SelectMenuRole) {
|
|
|
+ postRole.prem = this.SelectMenuRole.join(',')
|
|
|
+ }
|
|
|
+
|
|
|
+ this.baseRequest('updateRole', postRole)
|
|
|
+
|
|
|
+ const postUser = {
|
|
|
+ id: this.selectUserId,
|
|
|
+ dataRole: this.SelectDataRoleId
|
|
|
+ }
|
|
|
+ this.opRecord(postUser, 'edit')
|
|
|
+ },
|
|
|
+ // /* 重置密码*/
|
|
|
+ // resetPWD: function() {
|
|
|
+ // if (!this.currentRow) return
|
|
|
+ // const _this = this
|
|
|
+ // this.confirm('是否为' + this.currentRow.username + '重置密码,默认密码为:Ab654321?').then(() => {
|
|
|
+ // const doing = _this.$notify({
|
|
|
+ // title: '正在处理,请稍等',
|
|
|
+ // type: 'warning'
|
|
|
+ // })
|
|
|
+ // const postData = {
|
|
|
+ // id: this.currentRow.id,
|
|
|
+ // password: 'Ab654321'
|
|
|
+ // }
|
|
|
+ // _this.baseRequest('editPwd', postData).then((res) => {
|
|
|
+ // doing.close()
|
|
|
+ // _this.$notify({
|
|
|
+ // title: '重置成功',
|
|
|
+ // type: 'info'
|
|
|
+ // })
|
|
|
+ // }).catch(() => {
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+ // /* 状态变更*/
|
|
|
+ // handleStatusSwitch: function(row) {
|
|
|
+ // let info = ''
|
|
|
+ // let preStatus = '0'
|
|
|
+ // switch (row.status) {
|
|
|
+ // case '0':
|
|
|
+ // info = '是否禁用用户?'
|
|
|
+ // preStatus = '1'
|
|
|
+ // break
|
|
|
+ // case '1':
|
|
|
+ // info = '是否启用用户?'
|
|
|
+ // preStatus = '0'
|
|
|
+ // break
|
|
|
+ // }
|
|
|
+ // this.confirm(info).then(() => {
|
|
|
+ // const postData = {
|
|
|
+ // id: row.id,
|
|
|
+ // status: row.status
|
|
|
+ // }
|
|
|
+ // this.opRecord(postData, 'edit')
|
|
|
+ // }).catch(() => {
|
|
|
+ // row.status = preStatus
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+ // handleStatus: function(_id, _status) {
|
|
|
+ // let info = ''
|
|
|
+ // const _this = this
|
|
|
+ // switch (_status) {
|
|
|
+ // case '0':
|
|
|
+ // info = '是否禁用用户?'
|
|
|
+ // break
|
|
|
+ // case '1':
|
|
|
+ // info = '是否启用用户?'
|
|
|
+ // break
|
|
|
+ // }
|
|
|
+ // this.confirm(info).then(() => {
|
|
|
+ // const postData = {
|
|
|
+ // id: _id,
|
|
|
+ // status: _status
|
|
|
+ // }
|
|
|
+ // _this.opRecord(postData, 'edit')
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+ // opRefresh: function() {
|
|
|
+ // this.getList()
|
|
|
+ // // this.getData()
|
|
|
+ // this.dialogVisible = false
|
|
|
+ // this.dialogRoleVisible = false
|
|
|
+ // },
|
|
|
+ // initValidLeader: function(_uid = '') {
|
|
|
+ // const _this = this
|
|
|
+ // this.LeaderData = []
|
|
|
+ //
|
|
|
+ // const postData = {
|
|
|
+ // uid: _uid
|
|
|
+ // }
|
|
|
+ // return this.globleRequest('UserController', 'listLeaderValid', postData, 'Valid Leader Users').then((res) => {
|
|
|
+ // if (res.data) {
|
|
|
+ // res.data.forEach(function(item) {
|
|
|
+ // const json = {
|
|
|
+ // label: item.truename,
|
|
|
+ // value: item.id
|
|
|
+ // }
|
|
|
+ // _this.LeaderData.push(json)
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // }).catch(() => {
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+ handleView(data) {
|
|
|
+ this.dialogViewVisible = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.buildView.initData(data)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ cancel() {
|
|
|
+ this.dialogViewVisible = false
|
|
|
+ },
|
|
|
+ test(val) {
|
|
|
+ // this.$set(this.buildForm, 'introduction', val)
|
|
|
+ },
|
|
|
+ // 字典项
|
|
|
+ generateDcMap: function() {
|
|
|
+ this.dc_map['dc_gender'] = this.$common.transDcMap(this.dc_gender)
|
|
|
+ },
|
|
|
+ // 请求封装,继承类中调用,必须存在
|
|
|
+ baseRequest: function(opUrl, postData) {
|
|
|
+ return this.$channel.baseRequest('MnpBuildingController', opUrl, postData, 'User')
|
|
|
+ },
|
|
|
+ baseInfoRequest: function(opUrl, postData) {
|
|
|
+ return this.$channel.baseRequest('ParkInfoController', opUrl, postData, 'User')
|
|
|
+ },
|
|
|
+ postRequest: function(opUrl, postData) {
|
|
|
+ return this.$channel.baseRequest('PostController', opUrl, postData, 'Post')
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+ .el-cascader-menu{
|
|
|
+ max-width:250px;
|
|
|
+ }
|
|
|
+ .custom-tree-node {
|
|
|
+ flex: 1;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ font-size: 16px;
|
|
|
+ padding-right: 8px;
|
|
|
+ }
|
|
|
+ .custom-tree-container .block-l {
|
|
|
+ /*flex-grow: 2 ;*/
|
|
|
+ float: left;
|
|
|
+ width: 20%;
|
|
|
+ padding: 0 8px 0 0;
|
|
|
+ }
|
|
|
+ .custom-tree-container .block-r {
|
|
|
+ /*flex-grow: 10;*/
|
|
|
+ float: left;
|
|
|
+ width: 80%;
|
|
|
+ /*padding: 0 0 0 8px;*/
|
|
|
+ }
|
|
|
+</style>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+ /*.ch-input .el-input__inner {*/
|
|
|
+ /*border-radius: 0px;*/
|
|
|
+ /*border-color: #32323A;*/
|
|
|
+ /*}*/
|
|
|
+
|
|
|
+ /*.ch-input-size {*/
|
|
|
+ /*width: 200px;*/
|
|
|
+ /*margin-right: 10px;*/
|
|
|
+ /*}*/
|
|
|
+
|
|
|
+ /*.ch-button {*/
|
|
|
+ /*border-radius: 0px;*/
|
|
|
+ /*border-color: #32323A;*/
|
|
|
+ /*background-color: #32323A;*/
|
|
|
+ /*color: #fff;*/
|
|
|
+ /*}*/
|
|
|
+
|
|
|
+ .ch-input .el-input__inner {
|
|
|
+ border-color: #32323A;
|
|
|
+ }
|
|
|
+ .ch-input-size {
|
|
|
+ width: 150px;
|
|
|
+ }
|
|
|
+ .ch-button {
|
|
|
+ border-color: #32323A;
|
|
|
+ background-color: #32323A;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ .ch-button-warning {
|
|
|
+ margin-left: 10px;
|
|
|
+ border-color: #E6A23C;
|
|
|
+ background-color: #E6A23C;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ .ch-button-export {
|
|
|
+ margin-left: 10px;
|
|
|
+ border-color: #98CC1F;
|
|
|
+ background-color: #98CC1F;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ /deep/ .el-card{
|
|
|
+ max-height: 952px;
|
|
|
+ overflow: hidden;
|
|
|
+ overflow-y: scroll;
|
|
|
+ }
|
|
|
+</style>
|