From ba462f80dbda71f0b942ab906bda75959f968937 Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Tue, 15 Sep 2020 18:49:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 8 +- .../admin/confirmRenting/confirmRenting.html | 54 ++++++++ .../admin/confirmRenting/confirmRenting.js | 124 ++++++++++++++++++ .../deleteRentingAppointment.html | 45 +++++-- .../deleteRentingAppointment.js | 31 ++++- .../rentingAppointmentManage.html | 20 ++- .../rentingAppointmentManage.js | 7 +- 7 files changed, 259 insertions(+), 30 deletions(-) create mode 100644 public/components/admin/confirmRenting/confirmRenting.html create mode 100644 public/components/admin/confirmRenting/confirmRenting.js diff --git a/app.js b/app.js index cf911fe7b..de97f63d2 100644 --- a/app.js +++ b/app.js @@ -36,12 +36,12 @@ let opts = { //app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012',opts)); - app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012',opts)); - app.use('/app',proxy('http://api.demo.winqi.cn:8012',opts)); + //app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012',opts)); + //app.use('/app',proxy('http://api.demo.winqi.cn:8012',opts)); -//app.use('/callComponent',proxy('http://192.168.1.16:8012',opts)); -//app.use('/app',proxy('http://192.168.1.16:8012',opts)); +app.use('/callComponent',proxy('http://192.168.1.16:8012',opts)); +app.use('/app',proxy('http://192.168.1.16:8012',opts)); //app.listen(3000); app.use(express.json()); diff --git a/public/components/admin/confirmRenting/confirmRenting.html b/public/components/admin/confirmRenting/confirmRenting.html new file mode 100644 index 000000000..310e6d013 --- /dev/null +++ b/public/components/admin/confirmRenting/confirmRenting.html @@ -0,0 +1,54 @@ +
\ No newline at end of file diff --git a/public/components/admin/confirmRenting/confirmRenting.js b/public/components/admin/confirmRenting/confirmRenting.js new file mode 100644 index 000000000..35f9c98fc --- /dev/null +++ b/public/components/admin/confirmRenting/confirmRenting.js @@ -0,0 +1,124 @@ +(function (vc, vm) { + + vc.extends({ + data: { + confirmRentingInfo: { + msg: '', + appointmentId: '', + tenantName: '', + communityId: '', + communitys: [], + rentingPools: [], + rentingId: '' + } + }, + _initMethod: function () { + $that._loadCommunitys(); + }, + _initEvent: function () { + vc.on('confirmRenting', 'openConfirmRentingModal', function (_params) { + + //vc.component.confirmRentingInfo = _params; + vc.copyObject(_params, $that.confirmRentingInfo); + $('#confirmRentingModel').modal('show'); + + }); + }, + methods: { + confirmRenting: function () { + + let data = { + appointmentId: $that.confirmRentingInfo.appointmentId, + rentingId: $that.confirmRentingInfo.rentingId + }; + + + vc.http.apiPost( + '/rentingAppointment/confirmRenting', + JSON.stringify(data), + { + emulateJSON: true + }, + function (json, res) { + //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); + let _json = JSON.parse(json); + if (_json.code == 0) { + //关闭model + $('#confirmRentingModel').modal('hide'); + $that._clearRentingAppointment(); + vc.emit('rentingAppointmentManage', 'listRentingAppointment', {}); + return; + } + vc.message(_json.msg); + }, + function (errInfo, error) { + console.log('请求失败处理'); + vc.message(json); + + }); + }, + closeConfirmRentingModel: function () { + $('#confirmRentingModel').modal('hide'); + }, + _clearRentingAppointment: function () { + let _communitys = $that.confirmRentingInfo.communitys; + $that.confirmRentingInfo = { + msg: '', + appointmentId: '', + tenantName: '', + communityId: '', + communitys: _communitys, + rentingPools: [], + rentingId: '' + } + }, + _loadCommunitys: function () { + let param = { + params: { + _uId: 'ccdd00opikookjuhyyttvhnnjuuu', + page: 1, + row: 50 + } + }; + vc.http.get('initData', + 'getCommunitys', + param, + function (json, res) { + if (res.status == 200) { + let _communityInfos = JSON.parse(json).communitys; + $that.confirmRentingInfo.communitys = _communityInfos; + } + }, function () { + console.log('请求失败处理'); + vc.jumpToPage(_param.url); + } + ); + }, + _changeCommunity: function () { + $that._listRentingPoolsByConfirmRenting(); + }, + _listRentingPoolsByConfirmRenting: function (_page, _rows) { + var param = { + params: { + page: 1, + row: 100, + communityId: $that.confirmRentingInfo.communityId, + state: '1,2,3,4,5' + } + }; + + //发送get请求 + vc.http.apiGet('/renting/queryRentingPool', + param, + function (json, res) { + var _rentingPoolManageInfo = JSON.parse(json); + vc.component.confirmRentingInfo.rentingPools = _rentingPoolManageInfo.data; + }, function (errInfo, error) { + console.log('请求失败处理'); + } + ); + }, + } + }); + +})(window.vc, window.vc.component); diff --git a/public/components/admin/deleteRentingAppointment/deleteRentingAppointment.html b/public/components/admin/deleteRentingAppointment/deleteRentingAppointment.html index eb1e4b5a6..a47452a19 100644 --- a/public/components/admin/deleteRentingAppointment/deleteRentingAppointment.html +++ b/public/components/admin/deleteRentingAppointment/deleteRentingAppointment.html @@ -1,19 +1,36 @@ -