123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331 |
- <template>
- <div>
- <div>
- <el-row class="handle-box">
- <el-col :span="24">
- <span class="card_title">客户信息</span>
- </el-col>
- </el-row>
- <el-row class="handle-box">
- <el-col :span="4">
- <span>小区-分期:</span>
- <span>{{ form.groupDiscName }}</span>
- </el-col>
- <el-col :span="4">
- <span>批次号:</span>
- <span>{{ form.batchNumber }}</span>
- </el-col>
- <el-col :span="4">
- <span>选房号:</span>
- <span>{{ form.roomSelectionNumber }}</span>
- </el-col>
- <el-col :span="4">
- <span>买受人:</span>
- <span>{{ form.buyerName }}</span>
- </el-col>
- <el-col :span="4">
- <span>选房日期:</span>
- <span>{{ form.roomSelectionDate }}</span>
- </el-col>
- </el-row>
- <el-divider />
- <el-row class="handle-box">
- <el-col :span="24">
- <span class="card_title">房屋信息</span>
- <el-button v-if="roomSelectionCount < 1 || AllData.length < 1" 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: '',
- form: {},
- roomSelectionCount: 0,
- chooseFlag: false
- }
- },
- 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
- this.getPermission()
- },
- methods: {
- initData(data) {
- // console.log('data', data)
- this.getByCustomerManagementId(data.customerManagementId)
- this.initDict(this.dc_key).then(res => {
- this.customerManagementId = data.customerManagementId
- // this.groupId = data.groupId
- // this.discId = data.discId
- this.getData(data)
- })
- },
- 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 postData = {
- // customerManagementId: val.customerManagementId
- // }
- let postData
- if (val.houseId) {
- postData = {
- id: val.houseId
- }
- this.baseRoomRequest('getById', postData).then((res) => {
- if (res.data) {
- const json = _this.getItemJson(res.data)
- _this.AllData.push(json)
- }
- _this.loading = false
- }).catch(() => {
- })
- } else {
- postData = {
- customerManagementId: val.customerManagementId
- }
- this.baseRequest('listAll', postData).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'
- })
- return
- }
- 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()
- } else {
- this.$message({
- message: res.data.msg,
- type: 'error'
- })
- }
- }).catch((err) => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
- intentionalDepositConfirmSubmit: function() {
- if (!this.AllData) {
- if (this.AllData.length === 0) {
- this.$message({
- message: '请选择房间',
- type: 'warning'
- })
- return
- }
- } else if (this.AllData.length > 1) {
- this.$message({
- message: '只能选择一个房间',
- type: 'warning'
- })
- return
- }
- const obj = this.AllData[0]
- const data = {
- houseId: obj.houseId,
- 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 url = constant.BASE_URI + '/RoomSelectionInfoController/download?customerManagementId=' + this.customerManagementId + '&houseId=' + row.houseId
- window.open(url, '_blank')
- },
- getChildrenData(data) {
- if (data) {
- data.forEach(item => {
- item.createdName = this.username
- item.createdAt = this.dataStr
- })
- this.AllData = data
- }
- this.dialogRoomVisible = false
- },
- getByCustomerManagementId(val) {
- this.form = {}
- this.baseCustomerRequest('getById', { id: val }).then(res => {
- this.form = res.data
- this.roomSelectionCount = res.data.roomSelectionCount
- }).catch((err) => {
- })
- },
- getPermission() {
- // 关联数量大于0 并且 列表有数据
- if (this.roomSelectionCount > 0 && this.AllData.length > 0) {
- this.chooseFlag = false
- } else {
- this.chooseFlag = true
- }
- },
- baseRequest(opUrl, postData) {
- return this.$channel.globeRequest('RoomSelectionInfoController', opUrl, postData, 'project')
- },
- baseCustomerRequest(opUrl, postData) {
- return this.$channel.globeRequest('CustomerManagementController', opUrl, postData, 'project')
- },
- baseRoomRequest(opUrl, postData) {
- return this.$channel.globeRequest('ParkRoomController', opUrl, postData, 'project')
- }
- }
- }
- </script>
- <style scoped>
- </style>
|