|
@@ -9,10 +9,14 @@
|
|
<view class="space" v-for="(node,index) in item.roomMap" :key="index">{{node}}</view>
|
|
<view class="space" v-for="(node,index) in item.roomMap" :key="index">{{node}}</view>
|
|
</view>
|
|
</view>
|
|
<view class="other">
|
|
<view class="other">
|
|
- <view class="item">
|
|
|
|
|
|
+ <view class="item" v-if="type === 1">
|
|
<view class="label">关联租客</view>
|
|
<view class="label">关联租客</view>
|
|
<view class="value">{{item.tenantType === 1 ? item.merchantName: item.clientName}}</view>
|
|
<view class="value">{{item.tenantType === 1 ? item.merchantName: item.clientName}}</view>
|
|
</view>
|
|
</view>
|
|
|
|
+ <view class="item" v-else>
|
|
|
|
+ <view class="label">房东信息</view>
|
|
|
|
+ <view class="value">{{item.organizationName}}</view>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
<view class="state">
|
|
<view class="state">
|
|
<view class="create">
|
|
<view class="create">
|
|
@@ -39,6 +43,10 @@
|
|
import {
|
|
import {
|
|
getContractListByPage
|
|
getContractListByPage
|
|
} from '@/request/api/contract.js'
|
|
} from '@/request/api/contract.js'
|
|
|
|
+ import {
|
|
|
|
+ bindProjectDetail
|
|
|
|
+ } from '@/request/api/organization.js'
|
|
|
|
+
|
|
import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
|
|
import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
|
|
export default {
|
|
export default {
|
|
mixins: [MescrollMixin], // 使用mixin
|
|
mixins: [MescrollMixin], // 使用mixin
|
|
@@ -46,7 +54,9 @@
|
|
return {
|
|
return {
|
|
list: [],
|
|
list: [],
|
|
type: '',
|
|
type: '',
|
|
- menu: {}
|
|
|
|
|
|
+ menu: {},
|
|
|
|
+ clientId: '',
|
|
|
|
+ merchantId: ''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad(body) {
|
|
onLoad(body) {
|
|
@@ -91,15 +101,69 @@
|
|
},
|
|
},
|
|
/*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
|
|
/*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
|
|
upCallback(page) {
|
|
upCallback(page) {
|
|
- getContractListByPage({
|
|
|
|
|
|
+ let postData = {
|
|
currPage: page.num,
|
|
currPage: page.num,
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
- organizationId: this.$store.getters.organization.id,
|
|
|
|
projectId: this.$store.getters.project.id
|
|
projectId: this.$store.getters.project.id
|
|
- }).then(res => {
|
|
|
|
|
|
+ }
|
|
|
|
+ if (this.type === 1) {
|
|
|
|
+ postData['organizationId'] = this.$store.getters.organization.id;
|
|
|
|
+ this.getContractList(postData);
|
|
|
|
+ } else if (this.type === 2) {
|
|
|
|
+ postData['statusList'] = [1, 2, 3, 4, 5];
|
|
|
|
+ if (this.merchantId) {
|
|
|
|
+ postData['merchantId'] = this.merchantId;
|
|
|
|
+ this.getContractList(postData);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ bindProjectDetail({
|
|
|
|
+ bindOrganizationId: this.$store.getters.organization.id,
|
|
|
|
+ projectId: this.$store.getters.project.id,
|
|
|
|
+ identityId: 4
|
|
|
|
+ }).then(res => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ if (res.data.length == 0) return this.mescroll.endBySize(0, 0);
|
|
|
|
+ this.merchantId = res.data[0].merchantId;
|
|
|
|
+ postData['merchantId'] = this.merchantId;
|
|
|
|
+ this.getContractList(postData);
|
|
|
|
+ } else {
|
|
|
|
+ this.mescroll.endErr();
|
|
|
|
+ }
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ //联网失败, 结束加载
|
|
|
|
+ this.mescroll.endErr();
|
|
|
|
+ })
|
|
|
|
+ } else if (this.type === 3) {
|
|
|
|
+ postData['statusList'] = [1, 2, 3, 4, 5];
|
|
|
|
+ if (this.clientId) {
|
|
|
|
+ postData['clientId'] = this.clientId;
|
|
|
|
+ this.getContractList(postData);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ bindProjectDetail({
|
|
|
|
+ userId: this.$store.getters.user.userId,
|
|
|
|
+ projectId: this.$store.getters.project.id,
|
|
|
|
+ identityId: 1
|
|
|
|
+ }).then(res => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ if (res.data.length == 0) return this.mescroll.endBySize(0, 0);
|
|
|
|
+ this.clientId = res.data[0].clientId;
|
|
|
|
+ postData['clientId'] = this.clientId;
|
|
|
|
+ this.getContractList(postData);
|
|
|
|
+ } else {
|
|
|
|
+ this.mescroll.endErr();
|
|
|
|
+ }
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ //联网失败, 结束加载
|
|
|
|
+ this.mescroll.endErr();
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ getContractList(postData) {
|
|
|
|
+ getContractListByPage(postData).then(res => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
this.mescroll.endBySize(res.data.dataList.length, res.data.totalCount);
|
|
this.mescroll.endBySize(res.data.dataList.length, res.data.totalCount);
|
|
- if (page.num == 1) this.list = []; //如果是第一页需手动制空列表
|
|
|
|
|
|
+ if (postData.currPage == 1) this.list = []; //如果是第一页需手动制空列表
|
|
let data = res.data.dataList;
|
|
let data = res.data.dataList;
|
|
this.list = this.list.concat(data); //追加新数据
|
|
this.list = this.list.concat(data); //追加新数据
|
|
} else {
|
|
} else {
|
|
@@ -109,7 +173,7 @@
|
|
//联网失败, 结束加载
|
|
//联网失败, 结束加载
|
|
this.mescroll.endErr();
|
|
this.mescroll.endErr();
|
|
})
|
|
})
|
|
- },
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|