From c48733f1af2b912f158ecdd60e984425616f4a4a Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Tue, 30 Jun 2020 23:26:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B4=BE=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 4 +- .../dispatchRepair/dispatchRepair.html | 39 +++++ .../property/dispatchRepair/dispatchRepair.js | 137 ++++++++++++++++++ .../repairPoolManage/repairPoolManage.html | 6 +- .../repairPoolManage/repairPoolManage.js | 3 + 5 files changed, 185 insertions(+), 4 deletions(-) create mode 100644 public/components/property/dispatchRepair/dispatchRepair.html create mode 100644 public/components/property/dispatchRepair/dispatchRepair.js diff --git a/app.js b/app.js index 19ebffe20..cf23f416e 100644 --- a/app.js +++ b/app.js @@ -33,8 +33,8 @@ let opts = { //app.use('/callComponent',proxy('https://app.demo.winqi.cn/',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('/callComponent',proxy('http://192.168.1.16:8012',opts)); +app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012',opts)); +//app.use('/callComponent',proxy('http://192.168.1.16:8012',opts)); //app.listen(3000); diff --git a/public/components/property/dispatchRepair/dispatchRepair.html b/public/components/property/dispatchRepair/dispatchRepair.html new file mode 100644 index 000000000..4fdd278df --- /dev/null +++ b/public/components/property/dispatchRepair/dispatchRepair.html @@ -0,0 +1,39 @@ + \ No newline at end of file diff --git a/public/components/property/dispatchRepair/dispatchRepair.js b/public/components/property/dispatchRepair/dispatchRepair.js new file mode 100644 index 000000000..74b4b85ed --- /dev/null +++ b/public/components/property/dispatchRepair/dispatchRepair.js @@ -0,0 +1,137 @@ +(function (vc) { + + vc.extends({ + data: { + dispatchRepairInfo: { + repairId: '', + repairType: '', + staffId: '', + staffName: '', + context: '', + repairTypeUsers: [] + } + }, + _initMethod: function () { + //vc.component._initDispatchRepairInfo(); + }, + _initEvent: function () { + vc.on('dispatchRepair', 'openDispatchRepairModal', function (_repair) { + $that.dispatchRepairInfo.repairType = _repair.repairType; + $that.dispatchRepairInfo.repairId = _repair.repairId; + $that._listRepairTypeUsers() + $('#dispatchRepairModel').modal('show'); + }); + }, + methods: { + dispatchRepairValidate() { + return vc.validate.validate({ + dispatchRepairInfo: vc.component.dispatchRepairInfo + }, { + 'dispatchRepairInfo.repairId': [ + { + limit: "required", + param: "", + errInfo: "报修单不能为空" + } + ], + 'dispatchRepairInfo.staffId': [ + { + limit: "required", + param: "", + errInfo: "报修师傅不能为空" + } + ], + 'dispatchRepairInfo.staffName': [ + { + limit: "required", + param: "", + errInfo: "报修师傅不能为空" + } + ], + 'dispatchRepairInfo.context': [ + { + limit: "required", + param: "", + errInfo: "处理意见不能为空" + } + ] + }); + }, + dispatchRepairInfo: function () { + if (!vc.component.dispatchRepairValidate()) { + vc.toast(vc.validate.errInfo); + + return; + } + vc.component.dispatchRepairInfo.communityId = vc.getCurrentCommunity().communityId; + + $that.dispatchRepairInfo.repairTypeUsers.forEach(item => { + if(item.staffId == $that.dispatchRepairInfo.staffId){ + $that.dispatchRepairInfo.staffName = item.staffName; + } + }); + + + vc.http.apiPost( + 'ownerRepair.repairDispatch', + JSON.stringify(vc.component.dispatchRepairInfo), + { + emulateJSON: true + }, + function (json, res) { + //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); + if (res.status == 200) { + //关闭model + $('#dispatchRepairModel').modal('hide'); + vc.component.clearDispatchRepairInfo(); + vc.emit('repairPoolManage', 'listRepairPool', {}); + + return; + } + vc.toast(json); + + }, + function (errInfo, error) { + console.log('请求失败处理'); + + vc.toast(errInfo); + + }); + }, + clearDispatchRepairInfo: function () { + vc.component.dispatchRepairInfo = { + repairId: '', + repairType: '', + staffId: '', + staffName: '', + context: '', + repairTypeUsers: [] + }; + }, + _listRepairTypeUsers: function () { + + var param = { + params: { + page: 1, + row: 50, + communityId: vc.getCurrentCommunity().communityId, + repairType: $that.dispatchRepairInfo.repairType + } + }; + + //发送get请求 + vc.http.apiGet('repair.listRepairTypeUsers', + param, + function (json, res) { + var _repairTypeUserManageInfo = JSON.parse(json); + vc.component.dispatchRepairInfo.repairTypeUsers = _repairTypeUserManageInfo.data; + + }, function (errInfo, error) { + console.log('请求失败处理'); + } + ); + }, + } + }); + +})(window.vc); diff --git a/public/pages/property/repairPoolManage/repairPoolManage.html b/public/pages/property/repairPoolManage/repairPoolManage.html index 9d95773b4..9413bb185 100644 --- a/public/pages/property/repairPoolManage/repairPoolManage.html +++ b/public/pages/property/repairPoolManage/repairPoolManage.html @@ -92,9 +92,9 @@ {{repairPool.appointmentTime}} {{repairPool.stateName}} -
+
@@ -121,4 +121,6 @@
+ + \ No newline at end of file diff --git a/public/pages/property/repairPoolManage/repairPoolManage.js b/public/pages/property/repairPoolManage/repairPoolManage.js index b7f8f56c4..7422a6a3e 100644 --- a/public/pages/property/repairPoolManage/repairPoolManage.js +++ b/public/pages/property/repairPoolManage/repairPoolManage.js @@ -92,6 +92,9 @@ vc.component.repairPoolManageInfo.moreCondition = true; } }, + _openDispatchRepairModel:function(_repair){ + vc.emit('dispatchRepair', 'openDispatchRepairModal',_repair); + }, _listRepairSettings: function (_page, _rows) { var param = { params: {