Commit 7d596bb511977c1caa013bb746c21f454dfe47de
1 parent
13f457c9
v1.9 丢掉合同租期变更丢掉房屋的bug
Showing
4 changed files
with
35 additions
and
34 deletions
src/components/contract/ChooseContract.vue
| @@ -39,12 +39,7 @@ import { queryContract } from '@/api/contract/contractChangeDetailApi' | @@ -39,12 +39,7 @@ import { queryContract } from '@/api/contract/contractChangeDetailApi' | ||
| 39 | 39 | ||
| 40 | export default { | 40 | export default { |
| 41 | name: 'ChooseContract', | 41 | name: 'ChooseContract', |
| 42 | - props: { | ||
| 43 | - emitChooseContract: { | ||
| 44 | - type: String, | ||
| 45 | - default: '' | ||
| 46 | - }, | ||
| 47 | - }, | 42 | + |
| 48 | data() { | 43 | data() { |
| 49 | return { | 44 | return { |
| 50 | dialogVisible: false, | 45 | dialogVisible: false, |
src/components/contract/ContractChangeAssets.vue
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | <el-card class="box-card"> | 2 | <el-card class="box-card"> |
| 3 | <div slot="header" class="flex justify-between"> | 3 | <div slot="header" class="flex justify-between"> |
| 4 | <span>{{ $t('contractChangeAssets.title') }}</span> | 4 | <span>{{ $t('contractChangeAssets.title') }}</span> |
| 5 | - <el-button type="primary" size="small" style="float: right" @click="selectRoom"> | 5 | + <el-button type="primary" size="small" style="float: right" @click="openSeachRoom"> |
| 6 | <i class="el-icon-plus"></i> | 6 | <i class="el-icon-plus"></i> |
| 7 | {{ $t('common.add') }} | 7 | {{ $t('common.add') }} |
| 8 | </el-button> | 8 | </el-button> |
| @@ -35,13 +35,19 @@ | @@ -35,13 +35,19 @@ | ||
| 35 | </template> | 35 | </template> |
| 36 | </el-table-column> | 36 | </el-table-column> |
| 37 | </el-table> | 37 | </el-table> |
| 38 | + | ||
| 39 | + <search-room ref="searchRoom" @chooseRoom="chooseRoom" /> | ||
| 38 | </el-card> | 40 | </el-card> |
| 39 | </template> | 41 | </template> |
| 40 | 42 | ||
| 41 | <script> | 43 | <script> |
| 44 | +import SearchRoom from '@/components/room/searchRoom' | ||
| 45 | +import { queryContractRoom } from '@/api/contract/addContractApi' | ||
| 42 | export default { | 46 | export default { |
| 43 | name: 'ContractChangeAssets', | 47 | name: 'ContractChangeAssets', |
| 44 | - | 48 | + components: { |
| 49 | + SearchRoom | ||
| 50 | + }, | ||
| 45 | data() { | 51 | data() { |
| 46 | return { | 52 | return { |
| 47 | contractChangeAssetsInfo: { | 53 | contractChangeAssetsInfo: { |
| @@ -60,8 +66,12 @@ export default { | @@ -60,8 +66,12 @@ export default { | ||
| 60 | } | 66 | } |
| 61 | }, | 67 | }, |
| 62 | methods: { | 68 | methods: { |
| 63 | - selectRoom() { | ||
| 64 | - this.$emit('openSearchRoom') | 69 | + open(param) { |
| 70 | + this.contractChangeAssetsInfo.contractId = param.contractId | ||
| 71 | + this.loadContractRooms() | ||
| 72 | + }, | ||
| 73 | + openSeachRoom() { | ||
| 74 | + this.$refs.searchRoom.open() | ||
| 65 | }, | 75 | }, |
| 66 | openDelRoomModel(room) { | 76 | openDelRoomModel(room) { |
| 67 | this.$confirm( | 77 | this.$confirm( |
| @@ -81,33 +91,19 @@ export default { | @@ -81,33 +91,19 @@ export default { | ||
| 81 | item => item.roomId !== room.roomId | 91 | item => item.roomId !== room.roomId |
| 82 | ) | 92 | ) |
| 83 | }, | 93 | }, |
| 84 | - loadContractRooms() { | ||
| 85 | - // 这里应该调用API加载合同关联的房间数据 | ||
| 86 | - // 示例代码: | ||
| 87 | - /* | ||
| 88 | - getContractRooms({ contractId: this.contractChangeAssetsInfo.contractId }) | ||
| 89 | - .then(response => { | ||
| 90 | - this.contractChangeAssetsInfo.rooms = response.data | ||
| 91 | - }) | ||
| 92 | - */ | ||
| 93 | - } | ||
| 94 | - }, | ||
| 95 | - created() { | ||
| 96 | - this.$on('chooseRoom', room => { | ||
| 97 | - // 检查是否已存在相同房间 | 94 | + async loadContractRooms() { |
| 95 | + const res = await queryContractRoom({ contractId: this.contractChangeAssetsInfo.contractId, page: 1, row: 500 }) | ||
| 96 | + this.contractChangeAssetsInfo.rooms = res.data | ||
| 97 | + }, | ||
| 98 | + chooseRoom(room) { | ||
| 98 | const exists = this.contractChangeAssetsInfo.rooms.some( | 99 | const exists = this.contractChangeAssetsInfo.rooms.some( |
| 99 | item => item.roomId === room.roomId | 100 | item => item.roomId === room.roomId |
| 100 | ) | 101 | ) |
| 101 | if (!exists) { | 102 | if (!exists) { |
| 102 | this.contractChangeAssetsInfo.rooms.push(room) | 103 | this.contractChangeAssetsInfo.rooms.push(room) |
| 103 | } | 104 | } |
| 104 | - }) | ||
| 105 | - | ||
| 106 | - this.$on('contractInfo', param => { | ||
| 107 | - this.contractChangeAssetsInfo.contractId = param.contractId | ||
| 108 | - this.loadContractRooms() | ||
| 109 | - }) | ||
| 110 | - } | 105 | + } |
| 106 | + }, | ||
| 111 | } | 107 | } |
| 112 | </script> | 108 | </script> |
| 113 | 109 |
src/views/contract/contractChangeDetailList.vue
| @@ -157,6 +157,8 @@ import ContractChangeAssets from '@/components/contract/ContractChangeAssets' | @@ -157,6 +157,8 @@ import ContractChangeAssets from '@/components/contract/ContractChangeAssets' | ||
| 157 | import PurchaseApprovers from '@/components/contract/purchaseApprovers' | 157 | import PurchaseApprovers from '@/components/contract/purchaseApprovers' |
| 158 | import ChooseContract from '@/components/contract/ChooseContract' | 158 | import ChooseContract from '@/components/contract/ChooseContract' |
| 159 | import { getCommunityId } from '@/api/community/communityApi' | 159 | import { getCommunityId } from '@/api/community/communityApi' |
| 160 | +import { queryContractRoom } from '@/api/contract/addContractApi' | ||
| 161 | + | ||
| 160 | 162 | ||
| 161 | export default { | 163 | export default { |
| 162 | name: 'ContractChangeDetailList', | 164 | name: 'ContractChangeDetailList', |
| @@ -273,7 +275,15 @@ export default { | @@ -273,7 +275,15 @@ export default { | ||
| 273 | this.contractChangeDetailInfo.startTime = contract.startTime | 275 | this.contractChangeDetailInfo.startTime = contract.startTime |
| 274 | this.contractChangeDetailInfo.endTime = contract.endTime | 276 | this.contractChangeDetailInfo.endTime = contract.endTime |
| 275 | this.contractChangeDetailInfo.signingTime = contract.signingTime | 277 | this.contractChangeDetailInfo.signingTime = contract.signingTime |
| 276 | - } | 278 | + if(this.$refs.contractChangeAssets){ |
| 279 | + this.$refs.contractChangeAssets.open(this.contractChangeDetailInfo) | ||
| 280 | + } | ||
| 281 | + this.loadContractRooms() | ||
| 282 | + }, | ||
| 283 | + async loadContractRooms() { | ||
| 284 | + const res = await queryContractRoom({ contractId: this.contractChangeDetailInfo.contractId, page: 1, row: 500 }) | ||
| 285 | + this.contractChangeDetailInfo.rooms = res.data | ||
| 286 | + }, | ||
| 277 | } | 287 | } |
| 278 | } | 288 | } |
| 279 | </script> | 289 | </script> |
src/views/user/login/Login.vue
| @@ -44,8 +44,8 @@ export default { | @@ -44,8 +44,8 @@ export default { | ||
| 44 | logo: '', | 44 | logo: '', |
| 45 | companyName:'', | 45 | companyName:'', |
| 46 | loginForm: { | 46 | loginForm: { |
| 47 | - username: '', | ||
| 48 | - passwd: '', | 47 | + username: 'wuxw', |
| 48 | + passwd: 'admin', | ||
| 49 | validateCode: '' | 49 | validateCode: '' |
| 50 | }, | 50 | }, |
| 51 | captchaUrl: '', | 51 | captchaUrl: '', |