123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255 |
- <template>
- <div>
- <div>
- <el-row class="handle-box">
- <el-col :span="24">
- <span class="card_title">房屋信息</span>
- <el-button style="float: right" type="text" size="small" @click="handleAdd()">
- 去选房
- </el-button>
- </el-col>
- </el-row>
- <el-divider />
- <el-row class="handle-box">
- <el-col :span="24">
- <el-table
- ref="multipleTable"
- v-loading="loading"
- :data="AllData"
- stripe
- row-class-name="g_table_row"
- :header-cell-style="{textAlign: 'center'}"
- :cell-style="{ textAlign: 'center' }"
- @selection-change="handleSelectionChange"
- >
- <el-table-column
- type="selection"
- width="55"
- />
- <el-table-column type="index" label="序号" width="60" />
- <el-table-column label="单元/楼栋号" prop="buildName" width="180" />
- <el-table-column label="户室号" prop="roomNo" />
- <el-table-column label="套内面积(㎡)" prop="actualInternalArea" />
- <el-table-column label="建筑面积(㎡)" prop="actualBuildArea" />
- <el-table-column label="装修情况" prop="decorationSituationStr" />
- <el-table-column label="经办人" prop="createdName" />
- <el-table-column label="经办时间" prop="createdAt" />
- <el-table-column label="操作" width="180">
- <template scope="scope">
- <el-button
- size="mini"
- type="text"
- @click="handleDelete(scope.$index)"
- >删除
- </el-button>
- <el-button
- size="mini"
- type="text"
- @click="downLoad(scope.row)"
- > 房源确认单下载
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-col>
- </el-row>
- <!-- <el-row class="handle-box">-->
- <!-- <span>经办时间 {{ dataStr }}</span>-->
- <!-- </el-row>-->
- <!-- <el-row class="handle-box">-->
- <!-- <span>经办人 {{ username }}</span>-->
- <!-- </el-row>-->
- </div>
- <div style="text-align: right;margin-top: 50px">
- <el-button @click="cancel">取 消</el-button>
- <el-button v-if="fromAddress!== 'intentionalDepositManagement'" type="primary" @click="confirmSubmit()">提交选房</el-button>
- <el-button v-if="fromAddress=== 'intentionalDepositManagement'" type="primary" @click="intentionalDepositConfirmSubmit()">意向金提交选房</el-button>
- </div>
- <!--选房-->
- <el-dialog
- :visible.sync="dialogRoomVisible"
- :close-on-click-modal="false"
- :close-on-press-escape="false"
- width="90%"
- top="20px"
- class="statistic_base"
- :append-to-body="true"
- :modal-append-to-body="true"
- custom-class="tagdialog"
- >
- <park-room v-if="dialogRoomVisible" ref="parkRoom" @getChildrenData="getChildrenData" />
- </el-dialog>
- </div>
- </template>
- <script>
- import Base from '@/views/base/base.vue'
- import BaseData from '@/views/base/baseData.vue'
- import ParkRoom from '@/views/customerManagement/roomChose/roomIndex.vue'
- import constant from '@/static/utils/constant'
- export default {
- name: 'AddHouse',
- components: { ParkRoom },
- mixins: [Base, BaseData],
- props: {
- // 确认从哪个页面跳转过来的,这样可以做相应的操作
- fromAddress: {
- type: String,
- default: ''
- }
- },
- data() {
- return {
- dc_key: ['DECORATION_SITUATION'],
- loading: false,
- AllData: [],
- dialogRoomVisible: false,
- customerManagementId: '',
- dataStr: '',
- username: '',
- groupId: '',
- discId: ''
- }
- },
- mounted() {
- const myDate = new Date()
- const dateStr = myDate.getFullYear() + '-' + (myDate.getMonth() + 1) + '-' + myDate.getDate()
- const username = this.$common.currUser().username
- this.dataStr = dateStr
- this.username = username
- },
- methods: {
- initData(data) {
- this.initDict(this.dc_key).then(res => {
- this.customerManagementId = data.id
- this.groupId = data.groupId
- this.discId = data.discId
- this.getData(data.id)
- })
- },
- handleAdd() {
- this.dialogRoomVisible = true
- const data = {
- level: 2,
- nodeId: this.discId
- }
- // 新vue时调用的方法
- this.$nextTick(() => {
- this.$refs.parkRoom.initData(data)
- })
- },
- getData: function(val) {
- const _this = this
- _this.loading = true
- _this.AllData = []
- const data = {
- customerManagementId: val
- }
- this.baseRequest('listAll', data).then((res) => {
- if (res.data) {
- res.data.forEach(function(item) {
- const json = _this.getItemJson(item)
- _this.AllData.push(json)
- })
- }
- _this.loading = false
- }).catch(() => {
- })
- },
- getItemJson: function(item) {
- item.decorationSituationStr = this.dc_map.DECORATION_SITUATION[item.decorationSituation]
- return item
- },
- confirmSubmit: function() {
- if (!this.AllData || this.AllData.length === 0) {
- this.$message({
- message: '请选择房间',
- type: 'warning'
- })
- }
- const data = {
- houseIds: this.AllData.map(obj => { return obj.houseId }).join(','),
- customerManagementId: this.customerManagementId
- }
- this.baseRequest('submit', data).then(res => {
- if (res.data.code === 200) {
- this.$message({
- message: '提交成功',
- type: 'success'
- })
- this.cancel()
- }
- }).catch((err) => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
- intentionalDepositConfirmSubmit: function() {
- if (!this.AllData) {
- if (this.AllData.length === 0) {
- this.$message({
- message: '请选择房间',
- type: 'warning'
- })
- }
- if (this.AllData.length > 1) {
- this.$message({
- message: '只能选择一个房间',
- type: 'warning'
- })
- }
- return
- }
- const obj = this.AllData[0]
- const data = {
- houseId: obj.id,
- customerManagementId: this.customerManagementId,
- buildName: obj.buildName,
- roomNo: obj.roomNo
- }
- this.cancel(data)
- },
- cancel(data) {
- this.$emit('cancel', data)
- },
- // 删除单个行
- handleDelete(index) {
- this.AllData.splice(index, 1)
- },
- downLoad(row) {
- // const data = {
- // customerManagementId: this.customerManagementId,
- // houseId: row.houseId
- // }
- // const url = constant.BASE_URI + '/RoomSelectionInfoController/download?customerManagementId=' + this.customerManagementId + '&houseId=' + row.houseId
- // window.location.href = url
- },
- getChildrenData(data) {
- if (data) {
- data.forEach(item => {
- item.createdName = this.username
- item.createdAt = this.dataStr
- })
- this.AllData = data
- }
- this.dialogRoomVisible = false
- },
- baseRequest(opUrl, postData) {
- return this.$channel.globeRequest('RoomSelectionInfoController', opUrl, postData, 'project')
- }
- }
- }
- </script>
- <style scoped>
- </style>
|