|
@@ -0,0 +1,521 @@
|
|
|
+<template>
|
|
|
+ <div v-loading="loading">
|
|
|
+ <el-form ref="form" :model="form" style="width: 100%;padding: 5px" :rules="rules" label-width="auto">
|
|
|
+ <el-row>
|
|
|
+ <el-col style="padding-bottom: 10px">
|
|
|
+ <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="form.findids"
|
|
|
+ :append-to-body="false"
|
|
|
+ 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="form.roomNo" />
|
|
|
+ </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="form.floor" />
|
|
|
+ </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="form.predictionInternalArea" 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="form.predictionShareArea" 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="form.predictionBuildArea" 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="form.predictionLandArea" 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="form.actualInternalArea" 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="form.actualShareArea" 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="form.actualBuildArea" 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="form.actualLandArea" 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="form.roomUse"
|
|
|
+ placeholder=""
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <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="form.roomNumber" />
|
|
|
+ </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="form.decorationSituation"
|
|
|
+ placeholder=""
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <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="form.twoPointTwo" />
|
|
|
+ </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="form.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="form.nature"
|
|
|
+ placeholder=""
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <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="form.houseTotalPrice" type="number" />
|
|
|
+ </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
|
|
|
+ >
|
|
|
+ <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="form.remark" type="textarea" maxlength="2000" show-word-limit />
|
|
|
+ </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="form.saleStatus"
|
|
|
+ placeholder="请选择"
|
|
|
+
|
|
|
+ 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" style="text-align: right">
|
|
|
+ <el-button @click="handleClose">关 闭</el-button>
|
|
|
+ <el-button :loading="loadingFlag" type="primary" @click="confirmSubmit()">提 交</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import Base from '@/views/base/base'
|
|
|
+import { upload } from '@/static/utils/channel'
|
|
|
+import constant from '@/static/utils/constant'
|
|
|
+export default {
|
|
|
+ name: 'AddRoom',
|
|
|
+ mixins: [Base],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ id: '',
|
|
|
+ dc_key: ['SALE_STATUS', 'GROUP_NATURE', 'DECORATION_SITUATION', 'HOUSE_USAGE'],
|
|
|
+ loading: false,
|
|
|
+ loadingFlag: false,
|
|
|
+ form: {
|
|
|
+ houseTypeId: null
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ findids: [{ required: true, trigger: 'blur', message: '请选择父级' }],
|
|
|
+ roomNo: [{ required: true, trigger: 'blur', message: '请输入户室号' }],
|
|
|
+ floor: [{ required: true, trigger: 'blur', message: '请输入所在层' }],
|
|
|
+ actualInternalArea: [{ required: true, trigger: 'blur', message: '请输入实测套内面积' }],
|
|
|
+ actualShareArea: [{ required: true, trigger: 'blur', message: '请输入实测分摊面积' }],
|
|
|
+ actualBuildArea: [{ required: true, trigger: 'blur', message: '请输入实测建筑面积' }],
|
|
|
+ roomUse: [{ required: true, trigger: 'change', message: '请选择用途' }],
|
|
|
+ saleStatus: [{ required: true, trigger: 'change', message: '请选择可售状态' }]
|
|
|
+ },
|
|
|
+ fileList: [],
|
|
|
+ options: [],
|
|
|
+ houseTypeOption: [],
|
|
|
+ // 图片预览及其他
|
|
|
+ dialogImageUrl: '',
|
|
|
+ dialogImageVisible: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ initData(id) {
|
|
|
+ this.id = id
|
|
|
+ this.initDict(this.dc_key).then((res) => {
|
|
|
+ if (this.id) {
|
|
|
+ this.getData()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.getTreeSelectData()
|
|
|
+ },
|
|
|
+ getData() {
|
|
|
+ const _this = this
|
|
|
+ const postData = {
|
|
|
+ id: this.id
|
|
|
+ }
|
|
|
+ this.baseRequest('getById', postData).then(res => {
|
|
|
+ if (res.data) {
|
|
|
+ _this.form = Object.assign({}, _this.form, res.data)
|
|
|
+ if (res.data.roomUse) {
|
|
|
+ _this.form.roomUse = res.data.roomUse + ''
|
|
|
+ }
|
|
|
+ if (res.data.decorationSituation) {
|
|
|
+ _this.form.decorationSituation = res.data.decorationSituation + ''
|
|
|
+ }
|
|
|
+ if (res.data.houseTypeId) {
|
|
|
+ _this.form.houseTypeId = res.data.houseTypeId + ''
|
|
|
+ }
|
|
|
+ if (res.data.saleStatus) {
|
|
|
+ _this.form.saleStatus = res.data.saleStatus + ''
|
|
|
+ }
|
|
|
+ // 回显户型
|
|
|
+ _this.houseTypeOption = []
|
|
|
+ _this.baseHouseTypeRequest('listAll', { discId: _this.form.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.form.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.form.houseTypeId = ''
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 填充父级
|
|
|
+ this.form.findids = []
|
|
|
+ if (this.form.groupId) {
|
|
|
+ this.form.findids[0] = this.form.groupId
|
|
|
+ if (this.form.discId) {
|
|
|
+ this.form.findids[1] = this.form.discId
|
|
|
+ if (this.form.buildId) {
|
|
|
+ this.form.findids[2] = this.form.buildId
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getTreeSelectData() {
|
|
|
+ this.baseInfoRequest('getTreeData2', {}).then((res) => {
|
|
|
+ this.options = res.data.data || []
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 上传相关,包括图片、文件
|
|
|
+ handlePictureCardPreview(file) {
|
|
|
+ this.handlePicturePreview(file.url)
|
|
|
+ },
|
|
|
+ handlePicturePreview(url) {
|
|
|
+ this.dialogImageUrl = url
|
|
|
+ this.dialogImageVisible = true
|
|
|
+ },
|
|
|
+ uploadHouseTypePicture(param) {
|
|
|
+ upload(param, true).then((res) => {
|
|
|
+ this.fileList.push(res)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ buildChange(val) {
|
|
|
+ const postData = {
|
|
|
+ discId: val[1]
|
|
|
+ }
|
|
|
+ this.getHouseTypeList(postData)
|
|
|
+ this.form.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
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ 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() {
|
|
|
+ this.$message.info('超过文件个数限制')
|
|
|
+ },
|
|
|
+ handleRemove(item) {
|
|
|
+ const id = item.id
|
|
|
+ const idx = this.fileList.findIndex(item => item.id === id)
|
|
|
+ this.fileList.splice(idx, 1)
|
|
|
+ },
|
|
|
+ handleClose() {
|
|
|
+ this.$emit('handleClose')
|
|
|
+ },
|
|
|
+ confirmSubmit() {
|
|
|
+ const _this = this
|
|
|
+ this.$refs.form.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ const ids = this.form.findids
|
|
|
+ const arr = this.$refs['findids'].getCheckedNodes()[0].pathLabels
|
|
|
+ if (ids != null && ids != [] && ids != '') {
|
|
|
+ this.form.groupId = ids[0]
|
|
|
+ this.form.discId = ids[1]
|
|
|
+ this.form.buildId = ids[2]
|
|
|
+ }
|
|
|
+ if (arr != null && arr != [] && arr != '') {
|
|
|
+ this.form.groupName = arr[0]
|
|
|
+ this.form.discName = arr[1]
|
|
|
+ this.form.buildName = arr[2]
|
|
|
+ }
|
|
|
+ const extraData = {}
|
|
|
+ const postData = Object.assign({}, this.form, 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.loading = true
|
|
|
+ _this.loadingFlag = true
|
|
|
+ const url = this.id ? 'edit' : 'add'
|
|
|
+ this.baseRequest(url, postData).then((res) => {
|
|
|
+ if (res.data.key === 200) {
|
|
|
+ this.$message.success('提交成功')
|
|
|
+ this.$emit('handleClose', true)
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.data.msg)
|
|
|
+ }
|
|
|
+ _this.loading = false
|
|
|
+ _this.loadingFlag = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ baseRequest(opUrl, postData) {
|
|
|
+ return this.$channel.baseRequest('ParkRoomController', opUrl, postData, 'User')
|
|
|
+ },
|
|
|
+ baseInfoRequest(opUrl, postData) {
|
|
|
+ return this.$channel.baseRequest('ParkInfoController', opUrl, postData, 'User')
|
|
|
+ },
|
|
|
+ baseHouseTypeRequest(opUrl, postData) {
|
|
|
+ return this.$channel.baseRequest('HouseTypeController', opUrl, postData, 'Post')
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+ .doubleInput{
|
|
|
+ display: flex;
|
|
|
+ ::v-deep{
|
|
|
+ .el-input{
|
|
|
+ width: 50%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|
|
|
+<style lang="scss">
|
|
|
+.changedItem .el-form-item__label{
|
|
|
+ background-color: yellow;
|
|
|
+}
|
|
|
+</style>
|