123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059 |
- <template>
- <div>
- <div class="custom-tree-container">
- <div class="block-l">
- <el-card shadow="hover" style="background: white">
- <el-tag class="full space-vertical">当前所选:载体结构</el-tag>
- <!-- @node-click="handleDeptNodeClick" -->
- <div style="height: 72vh;overflow-y: auto;">
- <el-tree
- ref="selectTree"
- :default-expand-all="false"
- :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>
- </div>
- </el-card>
- </div>
- <div class="block-r">
- <div style="width: 100%;padding: 10px;background: white;margin-bottom: 10px;">
- <el-row class="lineheight20">
- <el-col :span="3">
- 用途:
- </el-col>
- <el-col :span="21">
- <el-checkbox-group
- v-model="roomUse"
- >
- <el-checkbox
- v-for="item in dc_data.HOUSE_USAGE"
- :key="item.value"
- :label="item.value"
- >{{ item.label }}</el-checkbox>
- </el-checkbox-group>
- </el-col>
- </el-row>
- <el-row class="lineheight20">
- <el-col :span="3">
- 装修情况:
- </el-col>
- <el-col :span="21">
- <el-checkbox-group
- v-model="decorationSituation"
- >
- <el-checkbox
- v-for="item in dc_data.DECORATION_SITUATION"
- :key="item.value"
- :label="item.value"
- >{{ item.label }}</el-checkbox>
- </el-checkbox-group>
- </el-col>
- </el-row>
- <el-row class="lineheight20">
- <el-col :span="3">
- 可售状态:
- </el-col>
- <el-col :span="21">
- <el-checkbox-group
- v-model="saleStatus"
- >
- <el-checkbox
- v-for="item in dc_data.SALE_STATUS"
- :key="item.value"
- :label="item.value"
- >{{ item.label }}</el-checkbox>
- </el-checkbox-group>
- </el-col>
- </el-row>
- <el-row class="lineheight20">
- <el-col :span="3">
- 已售状态:
- </el-col>
- <el-col :span="21">
- <el-checkbox-group
- v-model="soldStatus"
- >
- <el-checkbox
- v-for="item in dc_data.SOLD_STATUS"
- :key="item.value"
- :label="item.value"
- >{{ item.label }}</el-checkbox>
- </el-checkbox-group>
- </el-col>
- </el-row>
- <el-row class="lineheight20">
- <el-col :span="4">
- <div style="margin-top: 6px">套内面积(㎡):</div>
- </el-col>
- <el-col :span="6">
- <el-input v-model="queryParam.actualInternalArea" size="small" placeholder="请输入面积" class="ch-input-size" @keyup.enter.native="handleSearch()" />
- </el-col>
- <el-col :span="4">
- <div style="margin-top: 6px">建筑面积(㎡):</div>
- </el-col>
- <el-col :span="4">
- <el-input v-model="queryParam.actualBuildArea" size="small" placeholder="请输入面积" class="ch-input-size" @keyup.enter.native="handleSearch()" />
- </el-col>
- </el-row>
- <el-row class="lineheight20">
- <el-col :span="4">
- <div style="margin-top: 6px">关键字:</div>
- </el-col>
- <el-col :span="4">
- <el-input v-model="queryParam.roomNo" size="small" placeholder="请输入房号" class="ch-input-size" @keyup.enter.native="handleSearch()" />
- </el-col>
- </el-row>
- <el-row class="lineheight20">
- <el-col :span="24">
- <el-button v-if="$has('roomExport')" :loading="excelFlag" 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-export" style="float: right;margin-top: 4px" @click="batchImport()"><i class="el-icon-menu" /> 批量导入</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>
- </div>
- <el-row class="lineheight20">
- <el-col :span="24">
- <el-table
- ref="singleTable"
- v-loading="loading"
- :data="AllData"
- highlight-current-row
- height="300"
- @current-change="handleRowSelectChange"
- >
- <el-table-column label="编号" type="index" width="60" />
- <el-table-column label="单元/楼栋号" prop="buildName" />
- <el-table-column label="所在层" prop="floor" />
- <el-table-column label="户室号" prop="roomNo" />
- <el-table-column label="套内面积(㎡)" prop="actualInternalArea" />
- <el-table-column label="建筑面积(㎡)" prop="actualBuildArea" />
- <el-table-column label="性质" prop="natureStr" />
- <el-table-column label="用途" prop="roomUseStr" />
- <el-table-column label="装修情况" prop="decorationSituationStr" />
- <el-table-column label="可售状态" prop="saleStatusStr" />
- <el-table-column label="已售状态" prop="soldStatusStr" />
- <el-table-column label="操作" header-align="center" width="250">
- <template scope="scope">
- <el-button size="mini" type="text" @click="handleEdit(scope.row)">编辑</el-button>
- <el-button :disabled="scope.row.soldStatus!=1" size="mini" type="text" @click="handleDelete(scope.row)">删除</el-button>
- <el-button size="mini" type="text" @click="handleView(scope.row)">查看</el-button>
- </template>
- </el-table-column>
- </el-table>
- <div class="table-page">
- <el-pagination
- :current-page.sync="currentPage"
- :page-sizes="[10, 20, 50, 100]"
- :page-size="pageSize"
- background
- layout="total, sizes, prev, pager, next, jumper"
- :total="allpage"
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- />
- </div>
- </el-col>
- </el-row>
- </div>
- </div>
- <el-dialog
- :title="dialogTitle"
- :visible.sync="dialogVisible"
- :before-close="dialogChose"
- width="75%"
- top="50px"
- class="statistic_base"
- :append-to-body="true"
- :modal-append-to-body="true"
- custom-class="tagdialog"
- @open="dlgOpen"
- >
- <el-form ref="houseForm" :model="houseForm" 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="3" class="col-txt"><span><span class="red-asterisk">*</span>父级</span></el-col>
- <el-col :span="21" class="col-input">
- <el-form-item prop="findids">
- <el-cascader
- ref="findids"
- v-model="houseForm.findids"
- :append-to-body="false"
- :disabled="isView"
- style="width: 100%;"
- :options="options"
- clearable
- @change="buildChange"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="3" class="col-txt"><span><span class="red-asterisk">*</span>户室号</span></el-col>
- <el-col :span="9" class="col-input">
- <el-form-item prop="roomNo">
- <el-input v-model="houseForm.roomNo" :disabled="isView" />
- </el-form-item>
- </el-col>
- <el-col :span="3" class="col-txt"><span><span class="red-asterisk">*</span>所在层</span></el-col>
- <el-col :span="9" class="col-input">
- <el-form-item prop="floor">
- <el-input v-model="houseForm.floor" :disabled="isView" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="3" class="col-txt"><span>预测套内面积(㎡)</span></el-col>
- <el-col :span="9" class="col-input">
- <el-form-item>
- <el-input v-model="houseForm.predictionInternalArea" :disabled="isView" type="number" />
- </el-form-item>
- </el-col>
- <el-col :span="3" class="col-txt"><span>预测分摊面积(㎡)</span></el-col>
- <el-col :span="9" class="col-input">
- <el-form-item>
- <el-input v-model="houseForm.predictionShareArea" :disabled="isView" type="number" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="3" class="col-txt"><span>预测建筑面积(㎡)</span></el-col>
- <el-col :span="9" class="col-input">
- <el-form-item>
- <el-input v-model="houseForm.predictionBuildArea" :disabled="isView" type="number" />
- </el-form-item>
- </el-col>
- <el-col :span="3" class="col-txt"><span>预测土地面积(㎡)</span></el-col>
- <el-col :span="9" class="col-input">
- <el-form-item>
- <el-input v-model="houseForm.predictionLandArea" :disabled="isView" type="number" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="3" class="col-txt"><span><span class="red-asterisk">*</span>实测套内面积(㎡)</span></el-col>
- <el-col :span="9" class="col-input">
- <el-form-item prop="actualInternalArea">
- <el-input v-model="houseForm.actualInternalArea" :disabled="isView" type="number" />
- </el-form-item>
- </el-col>
- <el-col :span="3" class="col-txt"><span><span class="red-asterisk">*</span>实测分摊面积(㎡)</span></el-col>
- <el-col :span="9" class="col-input">
- <el-form-item prop="actualShareArea">
- <el-input v-model="houseForm.actualShareArea" :disabled="isView" type="number" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="3" class="col-txt"><span><span class="red-asterisk">*</span>实测建筑面积(㎡)</span></el-col>
- <el-col :span="9" class="col-input">
- <el-form-item prop="actualBuildArea">
- <el-input v-model="houseForm.actualBuildArea" :disabled="isView" type="number" />
- </el-form-item>
- </el-col>
- <el-col :span="3" class="col-txt"><span>实测土地面积(㎡)</span></el-col>
- <el-col :span="9" class="col-input">
- <el-form-item>
- <el-input v-model="houseForm.actualLandArea" :disabled="isView" type="number" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="3" class="col-txt"><span><span class="red-asterisk">*</span>用途:</span></el-col>
- <el-col :span="9" class="col-input">
- <el-form-item prop="roomUse">
- <el-select
- v-model="houseForm.roomUse"
- placeholder=""
- filterable
- clearable
- :disabled="isView"
- >
- <el-option
- v-for="item in dc_data.HOUSE_USAGE"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="3" class="col-txt"><span>房屋代码</span></el-col>
- <el-col :span="9" class="col-input">
- <el-form-item>
- <el-input v-model="houseForm.roomNumber" :disabled="isView" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="3" class="col-txt"><span>装修情况:</span></el-col>
- <el-col :span="9" class="col-input">
- <el-form-item>
- <el-select
- v-model="houseForm.decorationSituation"
- placeholder=""
- filterable
- clearable
- :disabled="isView"
- >
- <el-option
- v-for="item in dc_data.DECORATION_SITUATION"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="3" class="col-txt"><span>2.2米以上面积</span></el-col>
- <el-col :span="9" class="col-input">
- <el-form-item>
- <el-input v-model="houseForm.twoPointTwo" :disabled="isView" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="3" class="col-txt"><span>户型</span></el-col>
- <el-col :span="9" class="col-input">
- <el-form-item>
- <el-select
- v-model="houseForm.houseTypeId"
- placeholder=""
- filterable
- clearable
- @change="houseTypeChange"
- >
- <el-option
- v-for="item in houseTypeOption"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="3" class="col-txt"><span>房屋性质</span></el-col>
- <el-col :span="9" class="col-input">
- <el-form-item prop="roomUse">
- <el-select
- v-model="houseForm.nature"
- placeholder=""
- filterable
- clearable
- :disabled="isView"
- >
- <el-option
- v-for="item in dc_data.GROUP_NATURE"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="3" class="col-txt"><span>房屋总价</span></el-col>
- <el-col :span="9" class="col-input">
- <el-form-item>
- <el-input v-model="houseForm.houseTotalPrice" type="number" :disabled="isView" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="3" class="col-txt"><span>户型图:</span></el-col>
- <el-col v-if="fileList.length>0" :span="20" class="col-input">
- <el-form-item>
- <el-upload
- ref="upload"
- action
- accept="image/png,image/gif,image/jpg,image/jpeg"
- list-type="picture-card"
- :file-list="fileList"
- :limit="9"
- :http-request="uploadHouseTypePicture"
- :on-preview="handlePictureCardPreview"
- :on-remove="handleRemove"
- :on-exceed="handleExceed"
- disabled
- >
- <!-- <i class="el-icon-plus" />-->
- <div slot="tip" class="el-upload__tip">
- 只能上传jpg/png文件,限制上传9张
- </div>
- </el-upload>
- </el-form-item>
- </el-col>
- <el-col v-else :span="9" class="col-input">
- <el-form-item>
- <span>未上传</span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="3" class="col-txt"><span>备注:</span></el-col>
- <el-col :span="21" class="col-input">
- <el-form-item>
- <el-input v-model="houseForm.remark" type="textarea" maxlength="2000" show-word-limit :disabled="isView" />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="3" class="col-txt"><span><span><span class="red-asterisk">*</span>可售状态:</span></span></el-col>
- <el-col :span="21" class="col-input">
- <el-form-item prop="saleStatus">
- <el-select
- v-model="houseForm.saleStatus"
- placeholder="请选择"
- :disabled="isView"
- clearable
- >
- <el-option
- v-for="item in dc_data.SALE_STATUS"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- </el-card>
- </el-col>
- </el-row>
- </el-form>
- <div slot="footer">
- <el-button @click="dialogChose">取 消</el-button>
- <el-button :loading="loadingFlag" type="primary" @click="confirmSubmit()">确 定</el-button>
- </div>
- </el-dialog>
- <el-dialog
- :visible.sync="dialogImageVisible"
- :close-on-click-modal="false"
- :close-on-press-escape="false"
- append-to-body
- >
- <img width="100%" :src="dialogImageUrl" alt="">
- </el-dialog>
- <!-- 批量导入 -->
- <upload-cost
- v-if="importVisible"
- :dialog-visible="importVisible"
- :import-type="importType"
- :upload-title="uploadTitle"
- :import-title="importTitle"
- @cancelUpload="cancelImport"
- />
- </div>
- </template>
- <script>
- import Base from '@/views/base/base'
- import BaseData from '@/views/base/baseData'
- import BaseDept from '@/views/base/baseDept'
- import { upload } from '@/static/utils/channel'
- import uploadCost from '@/views/parkAssets/component/uploadCost.vue'
- import constant from '@/static/utils/constant'
- export default {
- name: 'User',
- components: { uploadCost },
- mixins: [Base, BaseData, BaseDept],
- data() {
- return {
- dc_key: ['HOUSE_USAGE', 'DECORATION_SITUATION', 'SALE_STATUS', 'SOLD_STATUS', 'GROUP_NATURE'],
- // 查询参数
- queryParam: {
- nodeId: '',
- level: ''
- },
- options: [],
- houseForm: {
- houseTypeId: null
- },
- DeptTree: [],
- urlStr: 'add',
- AllData: [],
- loading: false,
- dialogVisible: false,
- dialogTitle: '',
- isAdd: true,
- commitRules: {
- findids: [{ required: true, trigger: 'blur', message: '请选择父级' }],
- roomNo: [{ required: true, trigger: 'blur', message: '请输入户室号' }],
- floor: [{ required: true, trigger: 'blur', message: '请输入所在层' }],
- // predictionInternalArea: [{ required: true, trigger: 'blur', message: '请输入预测套内面积' }],
- // predictionShareArea: [{ required: true, trigger: 'blur', message: '请输入预测分摊面积' }],
- // predictionBuildArea: [{ required: true, trigger: 'blur', message: '请输入预测建筑面积' }],
- // predictionLandArea: [{ required: true, trigger: 'blur', message: '请输入预测土地面积' }],
- actualInternalArea: [{ required: true, trigger: 'blur', message: '请输入实测套内面积' }],
- actualShareArea: [{ required: true, trigger: 'blur', message: '请输入实测分摊面积' }],
- actualBuildArea: [{ required: true, trigger: 'blur', message: '请输入实测建筑面积' }],
- // actualLandArea: [{ required: true, trigger: 'blur', message: '请输入实测土地面积' }],
- roomUse: [{ required: true, trigger: 'change', message: '请选择用途' }],
- // roomNumber: [{ required: true, trigger: 'blur', message: '请输入户编号' }]
- saleStatus: [{ required: true, trigger: 'change', message: '请选择可售状态' }]
- },
- roomId: '',
- roomUse: [],
- saleStatus: [],
- soldStatus: [],
- decorationSituation: [],
- isView: false,
- fileList: [],
- houseTypeOption: [],
- // 图片预览及其他
- dialogImageUrl: '',
- dialogImageVisible: false,
- // 批量导入
- importVisible: false,
- importType: '',
- importTitle: '',
- uploadTitle: [],
- loadingFlag: false,
- excelFlag: false
- }
- },
- mounted() {
- this.initDict(this.dc_key).then((res) => {
- this.getData()
- })
- this.getTreeData()
- this.getTreeSelectData()
- },
- methods: {
- handleSearch: function() {
- this.getData()
- },
- // 导出
- handleExcel: function() {
- const _this = this
- _this.excelFlag = true
- _this.queryParam.pageNum = _this.currentPage
- _this.queryParam.pageSize = _this.pageSize
- _this.queryParam.roomUseStr = _this.roomUse.join(',')
- _this.queryParam.saleStatusStr = _this.saleStatus.join(',')
- _this.queryParam.soldStatusStr = _this.soldStatus.join(',')
- _this.queryParam.decorationSituationStr = _this.decorationSituation.join(',')
- this.OutData = []
- const title = ['小区', '分期', '单元/楼栋号', '户室号', '所在层', '预测套内面积(㎡)', '预测分摊面积(㎡)', '预测建筑面积(㎡)', '预测土地面积(㎡)',
- '实测套内面积(㎡)', '实测分摊面积(㎡)', '实测建筑面积(㎡)', '实测土地面积(㎡)', '用途', '房屋代码', '装修情况', '2.2米以上面积',
- '户型', '房屋性质', '备注', '可售状态'
- ]
- this.OutData.push(title)
- const temp = []
- this.baseRequest('excelList', _this.queryParam).then(res => {
- const data = res.data
- 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.discName)
- jsonArray.push(item.buildName)
- jsonArray.push(item.roomNo)
- jsonArray.push(item.floor)
- jsonArray.push(item.predictionInternalArea)
- jsonArray.push(item.predictionShareArea)
- jsonArray.push(item.predictionBuildArea)
- jsonArray.push(item.predictionLandArea)
- jsonArray.push(item.actualInternalArea)
- jsonArray.push(item.actualShareArea)
- jsonArray.push(item.actualBuildArea)
- jsonArray.push(item.actualLandArea)
- jsonArray.push(item.roomUseStr)
- jsonArray.push(item.roomNumber)
- jsonArray.push(item.decorationSituationStr)
- jsonArray.push(item.twoPointTwo)
- jsonArray.push(item.houseTypeStr)
- jsonArray.push(item.natureStr)
- jsonArray.push(item.remark)
- jsonArray.push(item.saleStatusStr)
- _this.OutData.push(jsonArray)
- })
- const OutSize = [{ wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 },
- { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 },
- { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }]
- const fileName = '房间导出 ' + new Date().Format('yyyyMMddhhmm')
- this.$outputXlsxFile(this.OutData, OutSize, fileName)
- _this.excelFlag = false
- })
- },
- handleReset: function() {
- this.queryParam = {}
- this.roomUse = []
- this.saleStatus = []
- this.soldStatus = []
- this.decorationSituation = []
- this.getData()
- },
- getTreeData: function() {
- this.baseInfoRequest('getTreeData1', {}).then((res) => {
- this.DeptTree = res.data.data
- }).catch(() => {
- })
- },
- getTreeSelectData: function() {
- this.baseInfoRequest('getTreeData2', {}).then((res) => {
- this.options = res.data.data
- }).catch(() => {
- })
- },
- getData: function() {
- const _this = this
- _this.loading = true
- _this.AllData = []
- _this.queryParam.pageNum = _this.currentPage
- _this.queryParam.pageSize = _this.pageSize
- _this.queryParam.roomUseStr = _this.roomUse.join(',')
- _this.queryParam.saleStatusStr = _this.saleStatus.join(',')
- _this.queryParam.soldStatusStr = _this.soldStatus.join(',')
- _this.queryParam.decorationSituationStr = _this.decorationSituation.join(',')
- _this.baseRequest('listByModel', _this.queryParam).then((res) => {
- if (res.data.rows) {
- res.data.rows.forEach(function(item) {
- const json = _this.getItemJson(item)
- _this.AllData.push(json)
- })
- _this.allpage = res.data.total
- }
- _this.loading = false
- }).catch(() => {
- })
- },
- handleAdd: function() {
- this.isView = false
- this.urlStr = 'add'
- this.dialogVisible = true
- this.fileList = []
- this.houseTypeOption = []
- // 可售状态 默认为正常
- this.$set(this.houseForm, 'saleStatus', '1')
- this.dialogTitle = '新增房间'
- },
- handleEdit: function(val) {
- this.isView = false
- this.urlStr = 'edit'
- this.houseForm = val
- this.fileList = []
- this.houseTypeOption = []
- this.dialogVisible = true
- this.dialogTitle = '编辑房间'
- },
- handleView: function(val) {
- this.isView = true
- this.houseForm.id = val.id
- this.dialogVisible = true
- this.dialogTitle = '查看房间'
- },
- getCheckedNodes(data, node, item) {
- console.log('节点====', node)
- console.log('节点id====', node.data.id)
- console.log('层级====', node.level)
- const _this = this
- _this.queryParam.nodeId = node.data.id
- _this.queryParam.level = node.level
- this.getData()
- },
- dialogChose() {
- this.houseForm = {}
- this.dialogVisible = false
- },
- confirmSubmit: function() {
- const _this = this
- this.$refs.houseForm.validate(valid => {
- if (valid) {
- const ids = this.houseForm.findids
- const arr = this.$refs['findids'].getCheckedNodes()[0].pathLabels
- if (ids != null && ids != [] && ids != '') {
- this.houseForm.groupId = ids[0]
- this.houseForm.discId = ids[1]
- this.houseForm.buildId = ids[2]
- }
- if (arr != null && arr != [] && arr != '') {
- this.houseForm.groupName = arr[0]
- this.houseForm.discName = arr[1]
- this.houseForm.buildName = arr[2]
- }
- const extraData = {}
- const postData = Object.assign({}, this.houseForm, extraData)
- if (!postData.groupId) {
- this.$message({
- message: '请选择小区',
- type: 'warning'
- })
- return
- }
- if (!postData.discId) {
- this.$message({
- message: '请选择分期',
- type: 'warning'
- })
- return
- }
- if (!postData.buildId) {
- this.$message({
- message: '请选择楼栋',
- type: 'warning'
- })
- return
- }
- _this.loadingFlag = true
- this.baseRequest(this.urlStr, postData).then((res) => {
- this.houseForm = {}
- this.dialogVisible = false
- this.getData()
- this.getTreeData()
- this.$message({
- message: '提交成功',
- type: 'success'
- })
- _this.loadingFlag = false
- }).catch(() => {
- })
- }
- })
- },
- getItemJson: function(item) {
- // 性质
- item.natureStr = this.dc_map.GROUP_NATURE[item.nature]
- // 用途
- item.roomUseStr = this.dc_map.HOUSE_USAGE[item.roomUse]
- // 装修情况
- item.decorationSituationStr = this.dc_map.DECORATION_SITUATION[item.decorationSituation]
- // 可售状态
- item.saleStatusStr = this.dc_map.SALE_STATUS[item.saleStatus]
- // 可售状态
- item.soldStatusStr = this.dc_map.SOLD_STATUS[item.soldStatus]
- return item
- },
- handleRowSelectChange(val) {
- this.currentRow = val
- if (this.currentRow) {
- if (this.currentRow.id === '1') {
- this.isAdminSelect = true
- } else {
- this.isAdminSelect = false
- }
- }
- },
- dlgOpen: function() {
- const _this = this
- if (_this.houseForm.id) {
- const postData = {
- id: _this.houseForm.id
- }
- this.baseRequest('getById', postData)
- .then(res => {
- if (res.data) {
- _this.houseForm = Object.assign({}, _this.houseForm, res.data)
- if (res.data.roomUse) {
- _this.houseForm.roomUse = res.data.roomUse + ''
- }
- if (res.data.decorationSituation) {
- _this.houseForm.decorationSituation = res.data.decorationSituation + ''
- }
- if (res.data.houseTypeId) {
- _this.houseForm.houseTypeId = res.data.houseTypeId + ''
- }
- if (res.data.saleStatus) {
- _this.houseForm.saleStatus = res.data.saleStatus + ''
- }
- // 回显户型
- _this.houseTypeOption = []
- _this.baseHouseTypeRequest('listAll', { discId: _this.houseForm.discId }).then(res => {
- if (res.data) {
- res.data.forEach(item => {
- _this.houseTypeOption.push({
- label: item.name + ',建筑面积' + item.buildArea + ',使用面积' + item.useArea,
- value: item.id,
- files: item.fileList
- })
- })
- // 回显户型图片
- const obj = _this.houseTypeOption.find(item =>
- item.value === _this.houseForm.houseTypeId
- )
- if (obj !== undefined) {
- this.fileList = []
- const files = JSON.parse(obj.files)
- files.forEach(v => {
- if (v) {
- this.fileList.push({
- url: constant.BASE_URI + '/FileController/download/' + v.data,
- id: v.data
- })
- }
- })
- } else {
- _this.houseForm.houseTypeId = ''
- }
- }
- })
- // 填充父级
- this.houseForm.findids = []
- if (undefined != this.houseForm.groupId && this.houseForm.groupId != null &&
- this.houseForm.groupId != '') {
- this.houseForm.findids[0] = this.houseForm.groupId
- if (undefined != this.houseForm.discId && this.houseForm.discId != null &&
- this.houseForm.discId != '') {
- this.houseForm.findids[1] = this.houseForm.discId
- if (undefined != this.houseForm.buildId && this.houseForm.buildId != null &&
- this.houseForm.buildId != '') {
- this.houseForm.findids[2] = this.houseForm.buildId
- }
- }
- }
- }
- })
- .catch(() => {})
- } else {
- }
- },
- // 上传相关,包括图片、文件
- handlePictureCardPreview: function(file) {
- this.handlePicturePreview(file.url)
- },
- handlePicturePreview: function(url) {
- this.dialogImageUrl = url
- this.dialogImageVisible = true
- },
- uploadHouseTypePicture: function(param) {
- upload(param, true).then((res) => {
- this.fileList.push(res)
- })
- },
- buildChange(val) {
- const postData = {
- discId: val[1]
- }
- this.getHouseTypeList(postData)
- this.houseForm.houseTypeId = ''
- this.fileList = []
- },
- getHouseTypeList(val) {
- const _this = this
- _this.houseTypeOption = []
- _this.baseHouseTypeRequest('listAll', val).then(res => {
- if (res.data) {
- res.data.forEach(item => {
- _this.houseTypeOption.push({
- label: item.name + ',建筑面积' + item.buildArea + ',使用面积' + item.useArea,
- value: item.id,
- files: item.fileList
- })
- })
- }
- })
- },
- // 导入
- batchImport() {
- this.importVisible = true
- this.importType = 'roomInsert'
- this.importTitle = '房间批量导入'
- },
- cancelImport(refresh) {
- this.importVisible = false
- this.importType = ''
- this.getTreeData()
- this.getData()
- },
- handleDelete(val) {
- this.$confirm('确认删除该数据,删除后将无法恢复,确认删除吗?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.baseRequest('delete', { id: val.id }).then(res => {
- if (res.data.code == 200) {
- this.getData()
- this.getTreeData()
- this.$message({
- type: 'success',
- message: '删除成功!'
- })
- } else {
- this.$message({
- type: 'error',
- message: res.data.msg
- })
- }
- }).catch((err) => {
- this.$message({
- type: 'error',
- message: err
- })
- })
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消删除'
- })
- })
- },
- houseTypeChange(val) {
- this.fileList = []
- const obj = this.houseTypeOption.find(item =>
- item.value === val
- )
- if (obj !== undefined) {
- const files = JSON.parse(obj.files)
- files.forEach(v => {
- if (v) {
- this.fileList.push({
- url: constant.BASE_URI + '/FileController/download/' + v.data,
- id: v.data
- })
- }
- })
- }
- },
- handleExceed: function() {
- this.$message.info('超过文件个数限制')
- },
- handleRemove: function(item) {
- const id = item.id
- const idx = this.fileList.findIndex(item => item.id === id)
- this.fileList.splice(idx, 1)
- },
- // 请求封装,继承类中调用,必须存在
- baseRequest: function(opUrl, postData) {
- return this.$channel.baseRequest('ParkRoomController', opUrl, postData, 'User')
- },
- baseInfoRequest: function(opUrl, postData) {
- return this.$channel.baseRequest('ParkInfoController', opUrl, postData, 'User')
- },
- baseHouseTypeRequest: function(opUrl, postData) {
- return this.$channel.baseRequest('HouseTypeController', opUrl, postData, 'Post')
- }
- }
- }
- </script>
- <style scoped>
- .custom-tree-node {
- flex: 1;
- display: flex;
- align-items: center;
- justify-content: space-between;
- font-size: 16px;
- padding-right: 8px;
- }
- .custom-tree-container{
- display: flex;
- }
- .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>
- .lineheight20{
- padding: 7px;
- background-color: white;
- line-height: 15rpx;
- }
- .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;
- }
- .listBox{
- display: flex;
- flex-wrap: wrap;
- }
- .list {
- border: 1px solid #BEC3CB;
- padding: 0px 40px;
- border-radius: 10px;
- margin-right: 20px;
- cursor: pointer;
- height: 30px;
- line-height: 30px;
- background: #F2F2F2;
- color: #333333;
- }
- .checked {
- color: #FFFFFF;
- background: #6600FF;
- border: 1px solid #3377FF;
- }
- .red-asterisk {
- color: red;
- }
- </style>
|