mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-24 21:59:12 +08:00
优化代码
This commit is contained in:
parent
218e0d9c29
commit
3f5e43ca68
117
public/components/owner/ownerDetailVisit/ownerDetailVisit.html
Normal file
117
public/components/owner/ownerDetailVisit/ownerDetailVisit.html
Normal file
@ -0,0 +1,117 @@
|
||||
<div class="margin-top">
|
||||
<div class="row margin-top-lg">
|
||||
|
||||
</div>
|
||||
<div class="margin-top">
|
||||
<table class="footable table table-stripped toggle-arrow-tiny" data-page-size="15">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">
|
||||
<vc:i18n name="访客ID" namespace="visitManage"></vc:i18n>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<vc:i18n name="照片" namespace="visitManage"></vc:i18n>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<vc:i18n name="访客" namespace="visitManage"></vc:i18n>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<vc:i18n name="业主姓名" namespace="visitManage"></vc:i18n>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<vc:i18n name="来访事由/类型" namespace="visitManage"></vc:i18n>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<vc:i18n name="车牌号" namespace="visitManage"></vc:i18n>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<vc:i18n name="随行人数" namespace="visitManage"></vc:i18n>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<vc:i18n name="创建时间" namespace="visitManage"></vc:i18n>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<vc:i18n name="来访/离开时间" namespace="visitManage"></vc:i18n>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<vc:i18n name="访客状态" namespace="visitManage"></vc:i18n>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<vc:i18n name="车辆状态" namespace="visitManage"></vc:i18n>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<vc:i18n name="操作" namespace="visitManage"></vc:i18n>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="visit in ownerDetailVisitInfo.visits">
|
||||
<td class="text-center">{{visit.vId}}</td>
|
||||
<td class="text-center">
|
||||
<div style="position: relative; display: inline-block;"
|
||||
v-on:click="showVisitImg(visit.url?visit.url:'/img/noPhoto.jpg')">
|
||||
<img width="50" height="50" v-bind:src="visit.url?visit.url:'/img/noPhoto.jpg'"
|
||||
onerror="this.src='/img/noPhoto.jpg';">
|
||||
<img src="/img/icon-bigimg.png" style="position: absolute;right: 0;bottom: 0;" width="50"
|
||||
height="50" alt="">
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{{visit.vName}}({{visit.phoneNumber}})/{{visit.visitGender=='0'?'男':'女'}}
|
||||
</td>
|
||||
<td class="text-center">{{visit.ownerName}}</td>
|
||||
<td class="text-center">{{visit.visitCase}}({{visit.reasonTypeName}})
|
||||
</td>
|
||||
<td class="text-center"
|
||||
v-if="visit.carState == '1' && visit.psId != null && visit.psId != '' && visit.psId != undefined">
|
||||
{{visit.carNum}}<br />({{visit.parkAreaNum}}停车场-{{visit.parkingSpaceNum}}停车位)
|
||||
</td>
|
||||
<td class="text-center" v-else>{{visit.carNum}}</td>
|
||||
<td class="text-center">{{visit.entourage}}</td>
|
||||
<td class="text-center">{{visit.createTime}}</td>
|
||||
<td class="text-center">{{visit.visitTime}}<br />{{visit.departureTime}}</td>
|
||||
<td class="text-center">{{visit.stateName}}</td>
|
||||
<td class="text-center">{{visit.carStateName}}</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<button class="btn-white btn btn-xs" v-on:click="_openVisitDetail(visit)">
|
||||
<vc:i18n name='详情'></vc:i18n>
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group" v-if="visit.state != '1' && visit.state != '2'">
|
||||
<button class="btn-white btn btn-xs" v-on:click="_openEditVisitModel(visit)">
|
||||
<vc:i18n name="修改" namespace="visitManage"></vc:i18n>
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group" v-if="visit.carNum != '' && visit.carState == '0'">
|
||||
<button class="btn-white btn btn-xs" v-on:click="_openExamineVisitCarModel(visit)">
|
||||
<vc:i18n name="审核" namespace="visitManage"></vc:i18n>
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button class="btn-white btn btn-xs" v-on:click="_openDeleteVisitModel(visit)">
|
||||
<vc:i18n name="删除" namespace="visitManage"></vc:i18n>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<!-- 分页 -->
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<vc:create namespace="ownerDetailVisit" path="frame/paginationPlus"></vc:create>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<vc:create path="property/editVisit"></vc:create>
|
||||
<vc:create path="property/examineVisit"></vc:create>
|
||||
<vc:create path="property/examineVisitCar"></vc:create>
|
||||
<vc:create path="property/deleteVisit"></vc:create>
|
||||
<vc:create path="common/viewImage"></vc:create>
|
||||
|
||||
|
||||
</div>
|
||||
100
public/components/owner/ownerDetailVisit/ownerDetailVisit.js
Normal file
100
public/components/owner/ownerDetailVisit/ownerDetailVisit.js
Normal file
@ -0,0 +1,100 @@
|
||||
/**
|
||||
入驻小区
|
||||
**/
|
||||
(function (vc) {
|
||||
var DEFAULT_PAGE = 1;
|
||||
var DEFAULT_ROWS = 10;
|
||||
vc.extends({
|
||||
data: {
|
||||
ownerDetailVisitInfo: {
|
||||
visits: [],
|
||||
ownerId: '',
|
||||
link: '',
|
||||
}
|
||||
},
|
||||
_initMethod: function () {
|
||||
},
|
||||
_initEvent: function () {
|
||||
vc.on('ownerDetailVisit', 'switch', function (_data) {
|
||||
$that.ownerDetailVisitInfo.ownerId = _data.ownerId;
|
||||
$that.ownerDetailVisitInfo.link = _data.link;
|
||||
$that._loadOwnerDetailVisitData(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
});
|
||||
vc.on('ownerDetailVisit', 'listVisit',
|
||||
function (_data) {
|
||||
vc.component._loadOwnerDetailVisitData(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
});
|
||||
vc.on('ownerDetailVisit', 'paginationPlus', 'page_event',
|
||||
function (_currentPage) {
|
||||
vc.component._loadOwnerDetailVisitData(_currentPage, DEFAULT_ROWS);
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
_loadOwnerDetailVisitData: function (_page, _row) {
|
||||
let param = {
|
||||
params: {
|
||||
page: _page,
|
||||
row: _row,
|
||||
communityId: vc.getCurrentCommunity().communityId,
|
||||
ownerTel: $that.ownerDetailVisitInfo.link,
|
||||
channel:'PC'
|
||||
}
|
||||
};
|
||||
|
||||
//发送get请求
|
||||
vc.http.apiGet('/visit.listVisits',
|
||||
param,
|
||||
function (json) {
|
||||
let _roomInfo = JSON.parse(json);
|
||||
vc.component.ownerDetailVisitInfo.visits = _roomInfo.visits;
|
||||
vc.emit('ownerDetailVisit', 'paginationPlus', 'init', {
|
||||
total: _roomInfo.records,
|
||||
dataCount: _roomInfo.total,
|
||||
currentPage: _page
|
||||
});
|
||||
},
|
||||
function () {
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
);
|
||||
},
|
||||
//查询
|
||||
_qureyOwnerDetailVisit: function () {
|
||||
$that._loadOwnerDetailVisitData(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
},
|
||||
_openAddVisitModal: function () {
|
||||
vc.jumpToPage("/#/pages/property/addVisitSpace")
|
||||
// vc.emit('addVisit','openAddVisitModal',{});
|
||||
},
|
||||
//访客审核
|
||||
_openExamineVisitModel: function (_visit) {
|
||||
vc.emit('examineVisit', 'openExamineVisitModel', _visit);
|
||||
},
|
||||
//访客车辆审核
|
||||
_openExamineVisitCarModel: function (_visit) {
|
||||
vc.emit('examineVisitCar', 'openExamineVisitCarModel', _visit);
|
||||
},
|
||||
_openEditVisitModel: function (_visit) {
|
||||
vc.jumpToPage("/#/pages/property/updateVisitSpace?vId=" + _visit.vId)
|
||||
//vc.emit('editVisit', 'openEditVisitModel', _visit);
|
||||
// vc.emit('deleteVisit','openDeleteVisitModal',_visit);
|
||||
},
|
||||
_openDeleteVisitModel: function (_visit) {
|
||||
vc.emit('deleteVisit', 'openVisitModel', _visit);
|
||||
},
|
||||
showVisitImg: function (e) {
|
||||
if (!e) {
|
||||
e = '/img/noPhoto.jpg';
|
||||
}
|
||||
vc.emit('viewImage', 'showImage', {url: e});
|
||||
},
|
||||
_openVisitDetail: function (_item) {
|
||||
let _flowId = _item.flowId;
|
||||
if (!_flowId) {
|
||||
_flowId = '';
|
||||
}
|
||||
vc.jumpToPage("/#/pages/property/visitDetail?vId=" + _item.vId + "&flowId=" + _flowId);
|
||||
},
|
||||
}
|
||||
});
|
||||
})(window.vc);
|
||||
@ -26,6 +26,9 @@
|
||||
//关闭model
|
||||
$('#deleteVisitModel').modal('hide');
|
||||
vc.emit('visitManage', 'listVisit', {});
|
||||
vc.emit('ownerDetailVisit', 'listVisit', {});
|
||||
|
||||
|
||||
vc.toast("删除成功");
|
||||
return;
|
||||
} else {
|
||||
|
||||
@ -146,19 +146,19 @@
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" v-bind:class="{active:ownerDetailInfo._currentTab == 'ownerDetailRoom'}"
|
||||
v-on:click="changeTab('ownerDetailRoom')">
|
||||
<vc:i18n name="业主房屋" namespace="ownerDetail"></vc:i18n>
|
||||
<vc:i18n name="房屋" namespace="ownerDetail"></vc:i18n>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" v-bind:class="{active:ownerDetailInfo._currentTab == 'ownerDetailCar'}"
|
||||
v-on:click="changeTab('ownerDetailCar')">
|
||||
<vc:i18n name="业主车辆" namespace="ownerDetail"></vc:i18n>
|
||||
<vc:i18n name="车辆" namespace="ownerDetail"></vc:i18n>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" v-bind:class="{active:ownerDetailInfo._currentTab == 'ownerDetailMember'}"
|
||||
v-on:click="changeTab('ownerDetailMember')">
|
||||
<vc:i18n name="业主成员" namespace="ownerDetail"></vc:i18n>
|
||||
<vc:i18n name="成员" namespace="ownerDetail"></vc:i18n>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
@ -183,25 +183,31 @@
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" v-bind:class="{active:ownerDetailInfo._currentTab == 'ownerDetailComplaint'}"
|
||||
v-on:click="changeTab('ownerDetailComplaint')">
|
||||
<vc:i18n name="业主投诉" namespace="ownerDetail"></vc:i18n>
|
||||
<vc:i18n name="投诉" namespace="ownerDetail"></vc:i18n>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" v-bind:class="{active:ownerDetailInfo._currentTab == 'ownerDetailRepair'}"
|
||||
v-on:click="changeTab('ownerDetailRepair')">
|
||||
<vc:i18n name="业主报修" namespace="ownerDetail"></vc:i18n>
|
||||
<vc:i18n name="报修" namespace="ownerDetail"></vc:i18n>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" v-bind:class="{active:ownerDetailInfo._currentTab == 'ownerDetailVisit'}"
|
||||
v-on:click="changeTab('ownerDetailVisit')">
|
||||
<vc:i18n name="访客" namespace="ownerDetail"></vc:i18n>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" v-bind:class="{active:ownerDetailInfo._currentTab == 'ownerDetailContract'}"
|
||||
v-on:click="changeTab('ownerDetailContract')">
|
||||
<vc:i18n name="业主合同" namespace="ownerDetail"></vc:i18n>
|
||||
<vc:i18n name="合同" namespace="ownerDetail"></vc:i18n>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" v-bind:class="{active:ownerDetailInfo._currentTab == 'ownerDetailOweFee'}"
|
||||
v-on:click="changeTab('ownerDetailOweFee')">
|
||||
<vc:i18n name="业主欠费" namespace="ownerDetail"></vc:i18n>
|
||||
<vc:i18n name="欠费" namespace="ownerDetail"></vc:i18n>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
@ -256,6 +262,10 @@
|
||||
<div v-if="ownerDetailInfo._currentTab == 'ownerDetailRepair'">
|
||||
<vc:create path="owner/ownerDetailRepair"></vc:create>
|
||||
</div>
|
||||
<div v-show="ownerDetailInfo._currentTab == 'ownerDetailVisit'">
|
||||
<vc:create path="owner/ownerDetailVisit"></vc:create>
|
||||
</div>
|
||||
|
||||
<div v-if="ownerDetailInfo._currentTab == 'ownerDetailContract'">
|
||||
<vc:create path="owner/ownerDetailContract"></vc:create>
|
||||
</div>
|
||||
|
||||
@ -125,8 +125,7 @@
|
||||
{{visit.vName}}({{visit.phoneNumber}})/{{visit.visitGender=='0'?'男':'女'}}
|
||||
</td>
|
||||
<td class="text-center">{{visit.ownerName}}</td>
|
||||
<td class="text-center">{{visit.visitCase}}({{visit.reasonType == 0 ? '喜事' :
|
||||
visit.reasonType == 1 ? '白事' : visit.reasonType == 2 ? '其他' : '-'}})
|
||||
<td class="text-center">{{visit.visitCase}}({{visit.reasonTypeName}})
|
||||
</td>
|
||||
<td class="text-center"
|
||||
v-if="visit.carState == '1' && visit.psId != null && visit.psId != '' && visit.psId != undefined">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user