From 502ff36e3490d348ea4e89cf4ce959758a26382c Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: Sat, 5 Mar 2022 16:16:38 +0800
Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5=20=E7=BB=93=E6=9E=84?=
=?UTF-8?q?=E5=9B=BE=E5=BC=80=E5=8F=91=E5=AE=8C=E6=88=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app.js | 8 +--
.../property/floorUnitTree/floorUnitTree.html | 2 +-
.../property/floorUnitTree/floorUnitTree.js | 51 +++++++++----------
.../property/roomStructure/roomStructure.html | 18 +++++--
.../property/roomStructure/roomStructure.js | 47 +++++++++++++++++
5 files changed, 91 insertions(+), 35 deletions(-)
diff --git a/app.js b/app.js
index 107317d49..a4f1c7dc5 100755
--- a/app.js
+++ b/app.js
@@ -36,10 +36,10 @@ let opts = {
// app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012',opts));
-// app.use('/callComponent', proxy('http://proxy.homecommunity.cn:9034', opts));
-// app.use('/app', proxy('http://proxy.homecommunity.cn:9034', opts));
-app.use('/callComponent', proxy('http://proxy.homecommunity.cn:9011', opts));
-app.use('/app', proxy('http://proxy.homecommunity.cn:9011', opts));
+app.use('/callComponent', proxy('http://proxy.homecommunity.cn:9034', opts));
+app.use('/app', proxy('http://proxy.homecommunity.cn:9034', opts));
+// app.use('/callComponent', proxy('http://proxy.homecommunity.cn:9011', opts));
+// app.use('/app', proxy('http://proxy.homecommunity.cn:9011', opts));
// app.use('/callComponent', proxy('http://127.0.0.1:8008', opts));
diff --git a/public/components/property/floorUnitTree/floorUnitTree.html b/public/components/property/floorUnitTree/floorUnitTree.html
index 5047ff1eb..f36ee5316 100644
--- a/public/components/property/floorUnitTree/floorUnitTree.html
+++ b/public/components/property/floorUnitTree/floorUnitTree.html
@@ -1,4 +1,4 @@
-
+
\ No newline at end of file
diff --git a/public/components/property/floorUnitTree/floorUnitTree.js b/public/components/property/floorUnitTree/floorUnitTree.js
index 9bca6c8e7..3f589e940 100644
--- a/public/components/property/floorUnitTree/floorUnitTree.js
+++ b/public/components/property/floorUnitTree/floorUnitTree.js
@@ -3,6 +3,9 @@
**/
(function(vc) {
vc.extends({
+ propTypes: {
+ callBackListener: vc.propTypes.string, //父组件名称
+ },
data: {
floorUnitTreeInfo: {
units: []
@@ -51,33 +54,30 @@
'data': _data
}
});
- $('#jstree_privilege').on("changed.jstree", function(e, data) {
+ $("#jstree_floorUnit").on("ready.jstree", function(e, data) {
+ //data.instance.open_all();//打开所有节点
+ $('#jstree_floorUnit').jstree('select_node', _data[0].children[0].id /* , true */ );
+
+ });
+
+ $('#jstree_floorUnit').on("changed.jstree", function(e, data) {
if (data.action == 'model' || data.action == 'ready') {
//默认合并
- $("#jstree_floorUnit").jstree("close_all");
+ //$("#jstree_floorUnit").jstree("close_all");
+
return;
}
- // let _selected = data.node.state.selected;
- // let _d = data.node.children_d;
- // if (_d.length < 1) {
- // _d.push(data.node.id);
- // }
- // let _selectPrivileges = [];
- // _d.forEach(_dItem => {
- // if (_dItem.indexOf('p_') > -1) {
- // _selectPrivileges.push(_dItem.substring(2));
- // }
- // });
+ let _selected = data.selected[0];
- // if (_selectPrivileges.length < 1) {
- // return;
- // }
+ if (_selected.startsWith('f_')) {
+ return;
+ }
- // if (_selected) {
- // $that.addPrivilegeToPrivilegeFloor(_selectPrivileges);
- // } else {
- // $that.deletePrivilege(_selectPrivileges);
- // }
+ //console.log(_selected, data.node.original.unitId)
+
+ vc.emit($props.callBackListener, 'switchUnit', {
+ unitId: data.node.original.unitId
+ })
});
@@ -98,7 +98,7 @@
if (!_includeFloor) {
let _floorItem = {
- id: 'g_' + pItem.floorId,
+ id: 'f_' + pItem.floorId,
floorId: pItem.floorId,
icon: "/img/floor.png",
text: pItem.floorNum + "栋",
@@ -127,13 +127,10 @@
}
if (!_includeMenu) {
let _menuItem = {
- id: 'm_' + _units[_pIndex].unitId,
+ id: 'u_' + _units[_pIndex].unitId,
unitId: _units[_pIndex].unitId,
text: _units[_pIndex].unitNum + "单元",
- icon: "/img/unit.png",
- state: {
- opened: true
- }
+ icon: "/img/unit.png"
};
_children.push(_menuItem);
}
diff --git a/public/pages/property/roomStructure/roomStructure.html b/public/pages/property/roomStructure/roomStructure.html
index 4e292b45b..55965eb1e 100644
--- a/public/pages/property/roomStructure/roomStructure.html
+++ b/public/pages/property/roomStructure/roomStructure.html
@@ -1,11 +1,23 @@
-
-
+
+
+
+
+
+
+
+
{{room.floorNum}}-{{room.unitNum}}-{{room.roomNum}}
+
{{room.stateName}}
+
{{room.ownerName?room.ownerName:'无'}}
+
欠费:{{room.oweAmount}}元
+
+
+
+
-
diff --git a/public/pages/property/roomStructure/roomStructure.js b/public/pages/property/roomStructure/roomStructure.js
index ce3b5b49a..6014e31ea 100644
--- a/public/pages/property/roomStructure/roomStructure.js
+++ b/public/pages/property/roomStructure/roomStructure.js
@@ -7,6 +7,7 @@
vc.extends({
data: {
roomStructureInfo: {
+ rooms: [],
}
},
@@ -15,9 +16,55 @@
},
_initEvent: function() {
+ vc.on('roomStructure', 'switchUnit', function(_param) {
+ $that._loadRooms(_param.unitId)
+ });
+
},
methods: {
+ _loadRooms: function(_unitId) {
+ let param = {
+ params: {
+ page: 1,
+ row: 100,
+ unitId: _unitId,
+ communityId: vc.getCurrentCommunity().communityId
+ }
+ }
+ vc.http.apiGet('/room.listRoomStructure',
+ param,
+ function(json, res) {
+ let listRoomData = JSON.parse(json);
+ $that.roomStructureInfo.rooms = listRoomData.data;
+ },
+ function(errInfo, error) {
+ console.log('请求失败处理');
+ }
+ );
+ },
+ _getBgColor: function(room) {
+ if (!room.ownerName) {
+ return "#1AB394";
+ }
+ if (room.oweAmount > 0) {
+ return "#DC3545";
+ }
+ return "#1296db"
+ },
+ _toSimplifyAcceptance: function(_room) {
+ let _date = new Date();
+ vc.saveData("JAVA110_IS_BACK", _date.getTime());
+ vc.saveData('simplifyAcceptanceSearch', {
+ searchType: '1',
+ searchValue: _room.floorNum + "-" + _room.unitNum + "-" + _room.roomNum,
+ searchPlaceholder: '请输入房屋编号 楼栋-单元-房屋 如1-1-1',
+ })
+
+ vc.jumpToPage('/#/pages/property/simplifyAcceptance?tab=业务受理');
+
+ }
+
}
});
})(window.vc);
\ No newline at end of file