diff --git a/public/pages/machine/addMeterMachine/addMeterMachine.html b/public/pages/machine/addMeterMachine/addMeterMachine.html
new file mode 100644
index 000000000..fb2490146
--- /dev/null
+++ b/public/pages/machine/addMeterMachine/addMeterMachine.html
@@ -0,0 +1,109 @@
+
\ No newline at end of file
diff --git a/public/pages/machine/addMeterMachine/addMeterMachine.js b/public/pages/machine/addMeterMachine/addMeterMachine.js
new file mode 100644
index 000000000..8da07c6a0
--- /dev/null
+++ b/public/pages/machine/addMeterMachine/addMeterMachine.js
@@ -0,0 +1,236 @@
+(function (vc) {
+
+ vc.extends({
+ data: {
+ addMeterMachineInfo: {
+ machineId: '',
+ machineName: '',
+ address: '',
+ meterType: '',
+ machineModel: '',
+ roomId: '',
+ roomName: '',
+ feeConfigId: '',
+ implBean: '',
+ meterTypes:[],
+ feeConfigs:[],
+ factorys:[],
+ specs:[]
+ }
+ },
+ _initMethod: function () {
+ $that._listMeterType();
+ $that._listFeeConfigs();
+ $that._listFactorys();
+
+ },
+ _initEvent: function () {
+ vc.on('addMeterMachine', 'openAddMeterMachineModal', function () {
+ $('#addMeterMachineModel').modal('show');
+ });
+ vc.on('addMeterMachine', 'selectRoom', function(param) {
+ vc.copyObject(param,$that.addMeterMachineInfo);
+ })
+ },
+ methods: {
+ addMeterMachineValidate() {
+ return vc.validate.validate({
+ addMeterMachineInfo: vc.component.addMeterMachineInfo
+ }, {
+ 'addMeterMachineInfo.machineName': [
+ {
+ limit: "required",
+ param: "",
+ errInfo: "名称不能为空"
+ },
+ {
+ limit: "maxLength",
+ param: "200",
+ errInfo: "名称不能超过200"
+ },
+ ],
+ 'addMeterMachineInfo.address': [
+ {
+ limit: "required",
+ param: "",
+ errInfo: "表号不能为空"
+ },
+ {
+ limit: "maxLength",
+ param: "30",
+ errInfo: "表号不能超过30"
+ },
+ ],
+ 'addMeterMachineInfo.meterType': [
+ {
+ limit: "required",
+ param: "",
+ errInfo: "表类型不能为空"
+ },
+ {
+ limit: "maxLength",
+ param: "30",
+ errInfo: "表类型不能超过30"
+ },
+ ],
+ 'addMeterMachineInfo.machineModel': [
+ {
+ limit: "required",
+ param: "",
+ errInfo: "模式不能为空"
+ },
+ {
+ limit: "maxLength",
+ param: "12",
+ errInfo: "模式不能超过12"
+ },
+ ],
+ 'addMeterMachineInfo.roomId': [
+ {
+ limit: "required",
+ param: "",
+ errInfo: "房屋不能为空"
+ },
+ {
+ limit: "maxLength",
+ param: "30",
+ errInfo: "房屋不能超过30"
+ },
+ ],
+ 'addMeterMachineInfo.feeConfigId': [
+ {
+ limit: "required",
+ param: "",
+ errInfo: "费用项不能为空"
+ },
+ {
+ limit: "maxLength",
+ param: "30",
+ errInfo: "费用项ID,充值模式时不能超过30"
+ },
+ ],
+ 'addMeterMachineInfo.implBean': [
+ {
+ limit: "required",
+ param: "",
+ errInfo: "门禁厂家不能为空"
+ },
+ {
+ limit: "maxLength",
+ param: "30",
+ errInfo: "门禁厂家不能超过30"
+ },
+ ],
+ });
+ },
+ saveMeterMachineInfo: function () {
+ if (!vc.component.addMeterMachineValidate()) {
+ vc.toast(vc.validate.errInfo);
+ return;
+ }
+
+ vc.component.addMeterMachineInfo.communityId = vc.getCurrentCommunity().communityId;
+
+ vc.http.apiPost(
+ '/meterMachine.saveMeterMachine',
+ JSON.stringify(vc.component.addMeterMachineInfo),
+ {
+ emulateJSON: true
+ },
+ function (json, res) {
+ //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
+ let _json = JSON.parse(json);
+ if (_json.code == 0) {
+ //关闭model
+ vc.goBack();
+ return;
+ }
+ vc.toast(_json.msg);
+ },
+ function (errInfo, error) {
+ console.log('请求失败处理');
+ vc.toast(errInfo);
+ });
+ },
+ _goBack:function(){
+ vc.goBack();
+ },
+ _listMeterType: function (_page, _rows) {
+ let param = {
+ params: {
+ page:1,
+ row:500,
+ communityId:vc.getCurrentCommunity().communityId,
+ }
+ };
+ //发送get请求
+ vc.http.apiGet('/meterType.listMeterType',
+ param,
+ function (json, res) {
+ let _accessControlMachineManageInfo = JSON.parse(json);
+ $that.addMeterMachineInfo.meterTypes = _accessControlMachineManageInfo.data;
+ },
+ function (errInfo, error) {
+ console.log('请求失败处理');
+ }
+ );
+ },
+ _listFeeConfigs: function(_page, _rows) {
+ let param = {
+ params: {
+ page:1,
+ row:500,
+ communityId:vc.getCurrentCommunity().communityId,
+ }
+ };
+ //发送get请求
+ vc.http.apiGet('/feeConfig.listFeeConfigs', param,
+ function(json, res) {
+ let _feeConfigManageInfo = JSON.parse(json);
+ $that.addMeterMachineInfo.feeConfigs = _feeConfigManageInfo.feeConfigs;
+
+ },
+ function(errInfo, error) {
+ console.log('请求失败处理');
+ }
+ );
+ },
+ _listFactorys: function(_page, _rows) {
+ let param = {
+ params: {
+ page:1,
+ row:500,
+ }
+ };
+ //发送get请求
+ vc.http.apiGet('/meterMachine.listMeterMachineFactory', param,
+ function(json, res) {
+ let _feeConfigManageInfo = JSON.parse(json);
+ $that.addMeterMachineInfo.factorys = _feeConfigManageInfo.data;
+
+ },
+ function(errInfo, error) {
+ console.log('请求失败处理');
+ }
+ );
+ },
+ _changeFactory:function(){
+ let _factorys = $that.addMeterMachineInfo.factorys;
+ _factorys.forEach(item => {
+ if (item.factoryId == $that.addMeterMachineInfo.implBean) {
+ item.specs.forEach(specItem => {
+ specItem.specValue = "";
+ })
+ $that.addMeterMachineInfo.specs = item.specs;
+ }
+ });
+ },
+ _selectRoom: function() {
+ vc.emit('roomTree','openRoomTree',{
+ callName:'addMeterMachine'
+ })
+ },
+ }
+ });
+
+})(window.vc);
diff --git a/public/pages/machine/editMeterMachine/editMeterMachine.html b/public/pages/machine/editMeterMachine/editMeterMachine.html
new file mode 100644
index 000000000..dd676c0bd
--- /dev/null
+++ b/public/pages/machine/editMeterMachine/editMeterMachine.html
@@ -0,0 +1,109 @@
+
\ No newline at end of file
diff --git a/public/pages/machine/editMeterMachine/editMeterMachine.js b/public/pages/machine/editMeterMachine/editMeterMachine.js
new file mode 100644
index 000000000..de343979e
--- /dev/null
+++ b/public/pages/machine/editMeterMachine/editMeterMachine.js
@@ -0,0 +1,257 @@
+(function (vc) {
+
+ vc.extends({
+ data: {
+ editMeterMachineInfo: {
+ machineId: '',
+ machineName: '',
+ address: '',
+ meterType: '',
+ machineModel: '',
+ roomId: '',
+ roomName: '',
+ feeConfigId: '',
+ implBean: '',
+ meterTypes:[],
+ feeConfigs:[],
+ factorys:[],
+ specs:[]
+ }
+ },
+ _initMethod: function () {
+ $that.editMeterMachineInfo.machineId = vc.getParam('machineId');
+ $that._listMeterMachines();
+ $that._listMeterType();
+ $that._listFeeConfigs();
+ $that._listFactorys();
+
+ },
+ _initEvent: function () {
+ vc.on('editMeterMachine', 'selectRoom', function(param) {
+ vc.copyObject(param,$that.editMeterMachineInfo);
+ })
+ },
+ methods: {
+ editMeterMachineValidate() {
+ return vc.validate.validate({
+ editMeterMachineInfo: vc.component.editMeterMachineInfo
+ }, {
+ 'editMeterMachineInfo.machineName': [
+ {
+ limit: "required",
+ param: "",
+ errInfo: "名称不能为空"
+ },
+ {
+ limit: "maxLength",
+ param: "200",
+ errInfo: "名称不能超过200"
+ },
+ ],
+ 'editMeterMachineInfo.address': [
+ {
+ limit: "required",
+ param: "",
+ errInfo: "表号不能为空"
+ },
+ {
+ limit: "maxLength",
+ param: "30",
+ errInfo: "表号不能超过30"
+ },
+ ],
+ 'editMeterMachineInfo.meterType': [
+ {
+ limit: "required",
+ param: "",
+ errInfo: "表类型不能为空"
+ },
+ {
+ limit: "maxLength",
+ param: "30",
+ errInfo: "表类型不能超过30"
+ },
+ ],
+ 'editMeterMachineInfo.machineModel': [
+ {
+ limit: "required",
+ param: "",
+ errInfo: "模式不能为空"
+ },
+ {
+ limit: "maxLength",
+ param: "12",
+ errInfo: "模式不能超过12"
+ },
+ ],
+ 'editMeterMachineInfo.roomId': [
+ {
+ limit: "required",
+ param: "",
+ errInfo: "房屋不能为空"
+ },
+ {
+ limit: "maxLength",
+ param: "30",
+ errInfo: "房屋不能超过30"
+ },
+ ],
+ 'editMeterMachineInfo.feeConfigId': [
+ {
+ limit: "required",
+ param: "",
+ errInfo: "费用项不能为空"
+ },
+ {
+ limit: "maxLength",
+ param: "30",
+ errInfo: "费用项ID,充值模式时不能超过30"
+ },
+ ],
+ 'editMeterMachineInfo.implBean': [
+ {
+ limit: "required",
+ param: "",
+ errInfo: "门禁厂家不能为空"
+ },
+ {
+ limit: "maxLength",
+ param: "30",
+ errInfo: "门禁厂家不能超过30"
+ },
+ ],
+ });
+ },
+ saveMeterMachineInfo: function () {
+ if (!vc.component.editMeterMachineValidate()) {
+ vc.toast(vc.validate.errInfo);
+ return;
+ }
+
+ vc.component.editMeterMachineInfo.communityId = vc.getCurrentCommunity().communityId;
+
+ vc.http.apiPost(
+ '/meterMachine.updateMeterMachine',
+ JSON.stringify(vc.component.editMeterMachineInfo),
+ {
+ emulateJSON: true
+ },
+ function (json, res) {
+ //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
+ let _json = JSON.parse(json);
+ if (_json.code == 0) {
+ //关闭model
+ vc.goBack();
+ return;
+ }
+ vc.toast(_json.msg);
+ },
+ function (errInfo, error) {
+ console.log('请求失败处理');
+ vc.toast(errInfo);
+ });
+ },
+ _goBack:function(){
+ vc.goBack();
+ },
+ _listMeterType: function (_page, _rows) {
+ let param = {
+ params: {
+ page:1,
+ row:500,
+ communityId:vc.getCurrentCommunity().communityId,
+ }
+ };
+ //发送get请求
+ vc.http.apiGet('/meterType.listMeterType',
+ param,
+ function (json, res) {
+ let _accessControlMachineManageInfo = JSON.parse(json);
+ $that.editMeterMachineInfo.meterTypes = _accessControlMachineManageInfo.data;
+ },
+ function (errInfo, error) {
+ console.log('请求失败处理');
+ }
+ );
+ },
+ _listFeeConfigs: function(_page, _rows) {
+ let param = {
+ params: {
+ page:1,
+ row:500,
+ communityId:vc.getCurrentCommunity().communityId,
+ }
+ };
+ //发送get请求
+ vc.http.apiGet('/feeConfig.listFeeConfigs', param,
+ function(json, res) {
+ let _feeConfigManageInfo = JSON.parse(json);
+ $that.editMeterMachineInfo.feeConfigs = _feeConfigManageInfo.feeConfigs;
+
+ },
+ function(errInfo, error) {
+ console.log('请求失败处理');
+ }
+ );
+ },
+ _listFactorys: function(_page, _rows) {
+ let param = {
+ params: {
+ page:1,
+ row:500,
+ }
+ };
+ //发送get请求
+ vc.http.apiGet('/meterMachine.listMeterMachineFactory', param,
+ function(json, res) {
+ let _feeConfigManageInfo = JSON.parse(json);
+ $that.editMeterMachineInfo.factorys = _feeConfigManageInfo.data;
+
+ },
+ function(errInfo, error) {
+ console.log('请求失败处理');
+ }
+ );
+ },
+ _changeFactory:function(){
+ let _factorys = $that.editMeterMachineInfo.factorys;
+ _factorys.forEach(item => {
+ if (item.factoryId == $that.editMeterMachineInfo.implBean) {
+ item.specs.forEach(specItem => {
+ specItem.specValue = "";
+ })
+ $that.editMeterMachineInfo.specs = item.specs;
+ }
+ });
+ },
+ _selectRoom: function() {
+ vc.emit('roomTree','openRoomTree',{
+ callName:'editMeterMachine'
+ })
+ },
+ _listMeterMachines: function (_page, _rows) {
+
+ let param = {
+ params: {
+ page:1,
+ row:1,
+ communityId:vc.getCurrentCommunity().communityId,
+ machineId:$that.editMeterMachineInfo.machineId
+ }
+ };
+
+ //发送get请求
+ vc.http.apiGet('/meterMachine.listMeterMachine',
+ param,
+ function (json, res) {
+ let _meterMachineManageInfo = JSON.parse(json);
+ vc.copyObject(_meterMachineManageInfo.data[0],$that.editMeterMachineInfo);
+ }, function (errInfo, error) {
+ console.log('请求失败处理');
+ }
+ );
+ },
+ }
+ });
+
+})(window.vc);
diff --git a/public/pages/machine/meterMachineDetail/meterMachineDetail.html b/public/pages/machine/meterMachineDetail/meterMachineDetail.html
new file mode 100644
index 000000000..cc90cbf0f
--- /dev/null
+++ b/public/pages/machine/meterMachineDetail/meterMachineDetail.html
@@ -0,0 +1,63 @@
+
\ No newline at end of file
diff --git a/public/pages/machine/meterMachineDetail/meterMachineDetail.js b/public/pages/machine/meterMachineDetail/meterMachineDetail.js
new file mode 100644
index 000000000..cae18d607
--- /dev/null
+++ b/public/pages/machine/meterMachineDetail/meterMachineDetail.js
@@ -0,0 +1,64 @@
+/**
+ 入驻小区
+**/
+(function (vc) {
+ var DEFAULT_PAGE = 1;
+ var DEFAULT_ROWS = 10;
+ vc.extends({
+ data: {
+ meterMachineDetailInfo: {
+ details: [],
+ total: 0,
+ records: 1,
+ moreCondition: false,
+ machineId: '',
+
+ }
+ },
+ _initMethod: function () {
+ $that.meterMachineDetailInfo.machineId = vc.getParam('machineId');
+ vc.component._listMeterMachineDetails(DEFAULT_PAGE, DEFAULT_ROWS);
+
+ },
+ _initEvent: function () {
+ vc.on('pagination', 'page_event', function (_currentPage) {
+ vc.component._listMeterMachineDetails(_currentPage, DEFAULT_ROWS);
+ });
+ },
+ methods: {
+ _listMeterMachineDetails: function (_page, _rows) {
+
+ let param = {
+ params: {
+ page:_page,
+ row:_rows,
+ machineId:$that.meterMachineDetailInfo.machineId,
+ communityId:vc.getCurrentCommunity().communityId
+ }
+ };
+
+ //发送get请求
+ vc.http.apiGet('/meterMachine.listMeterMachineDetail',
+ param,
+ function (json, res) {
+ var _meterMachineDetailInfo = JSON.parse(json);
+ vc.component.meterMachineDetailInfo.total = _meterMachineDetailInfo.total;
+ vc.component.meterMachineDetailInfo.records = _meterMachineDetailInfo.records;
+ vc.component.meterMachineDetailInfo.details = _meterMachineDetailInfo.data;
+ vc.emit('pagination', 'init', {
+ total: vc.component.meterMachineDetailInfo.records,
+ currentPage: _page
+ });
+ }, function (errInfo, error) {
+ console.log('请求失败处理');
+ }
+ );
+ },
+
+ _queryMeterMachineDetailMethod: function () {
+ vc.component._listMeterMachineDetails(DEFAULT_PAGE, DEFAULT_ROWS);
+
+ },
+ }
+ });
+})(window.vc);
diff --git a/public/pages/machine/meterMachineManage/meterMachineManage.html b/public/pages/machine/meterMachineManage/meterMachineManage.html
new file mode 100644
index 000000000..8cd2e9841
--- /dev/null
+++ b/public/pages/machine/meterMachineManage/meterMachineManage.html
@@ -0,0 +1,195 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/pages/machine/meterMachineManage/meterMachineManage.js b/public/pages/machine/meterMachineManage/meterMachineManage.js
new file mode 100644
index 000000000..b2b673ab7
--- /dev/null
+++ b/public/pages/machine/meterMachineManage/meterMachineManage.js
@@ -0,0 +1,146 @@
+/**
+ 入驻小区
+**/
+(function (vc) {
+ var DEFAULT_PAGE = 1;
+ var DEFAULT_ROWS = 10;
+ vc.extends({
+ data: {
+ meterMachineManageInfo: {
+ meterMachines: [],
+ total: 0,
+ records: 1,
+ moreCondition: false,
+ machineId: '',
+ meterTypes:[],
+ factorys:[],
+ conditions: {
+ machineNameLike: '',
+ address: '',
+ meterType: '',
+ machineModel: '',
+ roomNameLike: '',
+ implBean: '',
+ communityId:vc.getCurrentCommunity().communityId
+ }
+ }
+ },
+ _initMethod: function () {
+ vc.component._listMeterMachines(DEFAULT_PAGE, DEFAULT_ROWS);
+ $that._listMeterType();
+ $that._listFactorys();
+ },
+ _initEvent: function () {
+
+ vc.on('meterMachineManage', 'listMeterMachine', function (_param) {
+ vc.component._listMeterMachines(DEFAULT_PAGE, DEFAULT_ROWS);
+ });
+ vc.on('pagination', 'page_event', function (_currentPage) {
+ vc.component._listMeterMachines(_currentPage, DEFAULT_ROWS);
+ });
+ },
+ methods: {
+ _listMeterMachines: function (_page, _rows) {
+
+ vc.component.meterMachineManageInfo.conditions.page = _page;
+ vc.component.meterMachineManageInfo.conditions.row = _rows;
+ let param = {
+ params: vc.component.meterMachineManageInfo.conditions
+ };
+
+ //发送get请求
+ vc.http.apiGet('/meterMachine.listMeterMachine',
+ param,
+ function (json, res) {
+ var _meterMachineManageInfo = JSON.parse(json);
+ vc.component.meterMachineManageInfo.total = _meterMachineManageInfo.total;
+ vc.component.meterMachineManageInfo.records = _meterMachineManageInfo.records;
+ vc.component.meterMachineManageInfo.meterMachines = _meterMachineManageInfo.data;
+ vc.emit('pagination', 'init', {
+ total: vc.component.meterMachineManageInfo.records,
+ currentPage: _page
+ });
+ }, function (errInfo, error) {
+ console.log('请求失败处理');
+ }
+ );
+ },
+ _openAddMeterMachineModal: function () {
+ vc.jumpToPage('/#/pages/machine/addMeterMachine')
+ },
+ _openEditMeterMachineModel: function (_meterMachine) {
+ vc.jumpToPage('/#/pages/machine/editMeterMachine?machineId='+_meterMachine.machineId)
+ },
+ _openDeleteMeterMachineModel: function (_meterMachine) {
+ vc.emit('deleteMeterMachine', 'openDeleteMeterMachineModal', _meterMachine);
+ },
+ _toDetail: function (_meterMachine) {
+ vc.jumpToPage('/#/pages/machine/meterMachineDetail?machineId='+_meterMachine.machineId)
+ },
+ _queryMeterMachineMethod: function () {
+ vc.component._listMeterMachines(DEFAULT_PAGE, DEFAULT_ROWS);
+
+ },
+ _moreCondition: function () {
+ if (vc.component.meterMachineManageInfo.moreCondition) {
+ vc.component.meterMachineManageInfo.moreCondition = false;
+ } else {
+ vc.component.meterMachineManageInfo.moreCondition = true;
+ }
+ },
+ _listMeterType: function (_page, _rows) {
+ let param = {
+ params: {
+ page:1,
+ row:500,
+ communityId:vc.getCurrentCommunity().communityId,
+ }
+ };
+ //发送get请求
+ vc.http.apiGet('/meterType.listMeterType',
+ param,
+ function (json, res) {
+ let _accessControlMachineManageInfo = JSON.parse(json);
+ $that.meterMachineManageInfo.meterTypes = _accessControlMachineManageInfo.data;
+ },
+ function (errInfo, error) {
+ console.log('请求失败处理');
+ }
+ );
+ },
+ _listFactorys: function(_page, _rows) {
+ let param = {
+ params: {
+ page:1,
+ row:500,
+ }
+ };
+ //发送get请求
+ vc.http.apiGet('/meterMachine.listMeterMachineFactory', param,
+ function(json, res) {
+ let _feeConfigManageInfo = JSON.parse(json);
+ $that.meterMachineManageInfo.factorys = _feeConfigManageInfo.data;
+
+ },
+ function(errInfo, error) {
+ console.log('请求失败处理');
+ }
+ );
+ },
+ _getMeterTypeName:function(meterType){
+ let _meterTypeName = "";
+ $that.meterMachineManageInfo.meterTypes.forEach(item => {
+ if(meterType == item.typeId){
+ _meterTypeName = item.typeName
+ }
+ });
+ if(!_meterTypeName){
+ _meterTypeName = '-';
+ }
+ return _meterTypeName;
+ }
+
+
+ }
+ });
+})(window.vc);
diff --git a/public/pages/property/meterTypeManage/meterTypeManage.js b/public/pages/property/meterTypeManage/meterTypeManage.js
index 0bc90456a..a60986146 100644
--- a/public/pages/property/meterTypeManage/meterTypeManage.js
+++ b/public/pages/property/meterTypeManage/meterTypeManage.js
@@ -38,7 +38,7 @@
params: vc.component.meterTypeManageInfo.conditions
};
//发送get请求
- vc.http.apiGet('meterType.listMeterType',
+ vc.http.apiGet('/meterType.listMeterType',
param,
function (json, res) {
var _meterTypeManageInfo = JSON.parse(json);