diff --git a/public/components/examine/addExamineProject/addExamineProject.html b/public/components/examine/addExamineProject/addExamineProject.html new file mode 100644 index 000000000..8b47f6f5d --- /dev/null +++ b/public/components/examine/addExamineProject/addExamineProject.html @@ -0,0 +1,56 @@ + \ No newline at end of file diff --git a/public/components/examine/addExamineProject/addExamineProject.js b/public/components/examine/addExamineProject/addExamineProject.js new file mode 100644 index 000000000..9f958fdba --- /dev/null +++ b/public/components/examine/addExamineProject/addExamineProject.js @@ -0,0 +1,139 @@ +(function(vc){ + + vc.extends({ + propTypes: { + callBackListener:vc.propTypes.string, //父组件名称 + callBackFunction:vc.propTypes.string //父组件监听方法 + }, + data:{ + addExamineProjectInfo:{ + projectId:'', + name:'', +postCd:'', +weight:'', +state:'', + + } + }, + _initMethod:function(){ + + }, + _initEvent:function(){ + vc.on('addExamineProject','openAddExamineProjectModal',function(){ + $('#addExamineProjectModel').modal('show'); + }); + }, + methods:{ + addExamineProjectValidate(){ + return vc.validate.validate({ + addExamineProjectInfo:vc.component.addExamineProjectInfo + },{ + 'addExamineProjectInfo.name':[ +{ + limit:"required", + param:"", + errInfo:"项目名称不能为空" + }, + { + limit:"maxLength", + param:"64", + errInfo:"项目名称不能超过64" + }, + ], +'addExamineProjectInfo.postCd':[ +{ + limit:"required", + param:"", + errInfo:"岗位不能为空" + }, + { + limit:"maxLength", + param:"30", + errInfo:"岗位编号不能超过30" + }, + ], +'addExamineProjectInfo.weight':[ +{ + limit:"required", + param:"", + errInfo:"比重不能为空" + }, + { + limit:"maxLength", + param:"12", + errInfo:"比重不能超过12" + }, + ], +'addExamineProjectInfo.state':[ +{ + limit:"required", + param:"", + errInfo:"状态不能为空" + }, + { + limit:"maxLength", + param:"12", + errInfo:"状态不能超过12" + }, + ], + + + + + }); + }, + saveExamineProjectInfo:function(){ + if(!vc.component.addExamineProjectValidate()){ + vc.toast(vc.validate.errInfo); + + return ; + } + + vc.component.addExamineProjectInfo.communityId = vc.getCurrentCommunity().communityId; + //不提交数据将数据 回调给侦听处理 + if(vc.notNull($props.callBackListener)){ + vc.emit($props.callBackListener,$props.callBackFunction,vc.component.addExamineProjectInfo); + $('#addExamineProjectModel').modal('hide'); + return ; + } + + vc.http.apiPost( + 'examineProject.saveExamineProject', + JSON.stringify(vc.component.addExamineProjectInfo), + { + emulateJSON:true + }, + function(json,res){ + //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); + let _json = JSON.parse(json); + if (_json.code == 0) { + //关闭model + $('#addExamineProjectModel').modal('hide'); + vc.component.clearAddExamineProjectInfo(); + vc.emit('examineProjectManage','listExamineProject',{}); + + return ; + } + vc.message(_json.msg); + + }, + function(errInfo,error){ + console.log('请求失败处理'); + + vc.message(errInfo); + + }); + }, + clearAddExamineProjectInfo:function(){ + vc.component.addExamineProjectInfo = { + name:'', +postCd:'', +weight:'', +state:'', + + }; + } + } + }); + +})(window.vc); diff --git a/public/components/examine/deleteExamineProject/deleteExamineProject.html b/public/components/examine/deleteExamineProject/deleteExamineProject.html new file mode 100644 index 000000000..146e1d1a2 --- /dev/null +++ b/public/components/examine/deleteExamineProject/deleteExamineProject.html @@ -0,0 +1,19 @@ + diff --git a/public/components/examine/deleteExamineProject/deleteExamineProject.js b/public/components/examine/deleteExamineProject/deleteExamineProject.js new file mode 100644 index 000000000..e71a570c9 --- /dev/null +++ b/public/components/examine/deleteExamineProject/deleteExamineProject.js @@ -0,0 +1,52 @@ +(function(vc,vm){ + + vc.extends({ + data:{ + deleteExamineProjectInfo:{ + + } + }, + _initMethod:function(){ + + }, + _initEvent:function(){ + vc.on('deleteExamineProject','openDeleteExamineProjectModal',function(_params){ + + vc.component.deleteExamineProjectInfo = _params; + $('#deleteExamineProjectModel').modal('show'); + + }); + }, + methods:{ + deleteExamineProject:function(){ + vc.component.deleteExamineProjectInfo.communityId=vc.getCurrentCommunity().communityId; + vc.http.apiPost( + 'examineProject.deleteExamineProject', + JSON.stringify(vc.component.deleteExamineProjectInfo), + { + emulateJSON:true + }, + function(json,res){ + //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); + let _json = JSON.parse(json); + if (_json.code == 0) { + //关闭model + $('#deleteExamineProjectModel').modal('hide'); + vc.emit('examineProjectManage','listExamineProject',{}); + return ; + } + vc.message(_json.msg); + }, + function(errInfo,error){ + console.log('请求失败处理'); + vc.message(json); + + }); + }, + closeDeleteExamineProjectModel:function(){ + $('#deleteExamineProjectModel').modal('hide'); + } + } + }); + +})(window.vc,window.vc.component); diff --git a/public/components/examine/editExamineProject/editExamineProject.html b/public/components/examine/editExamineProject/editExamineProject.html new file mode 100644 index 000000000..0f060f7b5 --- /dev/null +++ b/public/components/examine/editExamineProject/editExamineProject.html @@ -0,0 +1,52 @@ + \ No newline at end of file diff --git a/public/components/examine/editExamineProject/editExamineProject.js b/public/components/examine/editExamineProject/editExamineProject.js new file mode 100644 index 000000000..a2b084f4c --- /dev/null +++ b/public/components/examine/editExamineProject/editExamineProject.js @@ -0,0 +1,123 @@ +(function(vc, vm) { + + vc.extends({ + data: { + editExamineProjectInfo: { + projectId: '', + name: '', + postCd: '', + weight: '', + state: '', + + } + }, + _initMethod: function() { + + }, + _initEvent: function() { + vc.on('editExamineProject', 'openEditExamineProjectModal', function(_params) { + vc.component.refreshEditExamineProjectInfo(); + $('#editExamineProjectModel').modal('show'); + vc.copyObject(_params, vc.component.editExamineProjectInfo); + vc.component.editExamineProjectInfo.communityId = vc.getCurrentCommunity().communityId; + }); + }, + methods: { + editExamineProjectValidate: function() { + return vc.validate.validate({ + editExamineProjectInfo: vc.component.editExamineProjectInfo + }, { + 'editExamineProjectInfo.name': [{ + limit: "required", + param: "", + errInfo: "项目名称不能为空" + }, + { + limit: "maxLength", + param: "64", + errInfo: "项目名称不能超过64" + }, + ], + 'editExamineProjectInfo.postCd': [{ + limit: "required", + param: "", + errInfo: "岗位不能为空" + }, + { + limit: "maxLength", + param: "30", + errInfo: "岗位编号不能超过30" + }, + ], + 'editExamineProjectInfo.weight': [{ + limit: "required", + param: "", + errInfo: "比重不能为空" + }, + { + limit: "maxLength", + param: "12", + errInfo: "比重不能超过12" + }, + ], + 'editExamineProjectInfo.state': [{ + limit: "required", + param: "", + errInfo: "状态不能为空" + }, + { + limit: "maxLength", + param: "12", + errInfo: "状态不能超过12" + }, + ], + 'editExamineProjectInfo.projectId': [{ + limit: "required", + param: "", + errInfo: "编号不能为空" + }] + + }); + }, + editExamineProject: function() { + if (!vc.component.editExamineProjectValidate()) { + vc.toast(vc.validate.errInfo); + return; + } + + vc.http.apiPost( + '/examine.updateExamineProject', + JSON.stringify(vc.component.editExamineProjectInfo), { + emulateJSON: true + }, + function(json, res) { + //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); + let _json = JSON.parse(json); + if (_json.code == 0) { + //关闭model + $('#editExamineProjectModel').modal('hide'); + vc.emit('examineProjectManage', 'listExamineProject', {}); + return; + } + vc.message(_json.msg); + }, + function(errInfo, error) { + console.log('请求失败处理'); + + vc.message(errInfo); + }); + }, + refreshEditExamineProjectInfo: function() { + vc.component.editExamineProjectInfo = { + projectId: '', + name: '', + postCd: '', + weight: '', + state: '', + + } + } + } + }); + +})(window.vc, window.vc.component); \ No newline at end of file diff --git a/public/pages/examine/examineProjectManage/examineProjectManage.html b/public/pages/examine/examineProjectManage/examineProjectManage.html new file mode 100644 index 000000000..e24136b24 --- /dev/null +++ b/public/pages/examine/examineProjectManage/examineProjectManage.html @@ -0,0 +1,99 @@ +
+
+
+
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+ +
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
{{examineProject.name}}{{examineProject.post}}{{examineProject.weight}}{{examineProject.state == 'Y'?'启用':'停用'}} +
+ +
+
+ +
+
+
    +
    + + +
    +
    +
    +
    + + + + + +
    \ No newline at end of file diff --git a/public/pages/examine/examineProjectManage/examineProjectManage.js b/public/pages/examine/examineProjectManage/examineProjectManage.js new file mode 100644 index 000000000..6cbd0ac39 --- /dev/null +++ b/public/pages/examine/examineProjectManage/examineProjectManage.js @@ -0,0 +1,86 @@ +/** + 入驻小区 +**/ +(function(vc) { + var DEFAULT_PAGE = 1; + var DEFAULT_ROWS = 10; + vc.extends({ + data: { + examineProjectManageInfo: { + examineProjects: [], + total: 0, + records: 1, + moreCondition: false, + projectId: '', + conditions: { + name: '', + post: '', + state: '', + communityId: vc.getCurrentCommunity().communityId + } + } + }, + _initMethod: function() { + vc.component._listExamineProjects(DEFAULT_PAGE, DEFAULT_ROWS); + }, + _initEvent: function() { + + vc.on('examineProjectManage', 'listExamineProject', function(_param) { + vc.component._listExamineProjects(DEFAULT_PAGE, DEFAULT_ROWS); + }); + vc.on('pagination', 'page_event', function(_currentPage) { + vc.component._listExamineProjects(_currentPage, DEFAULT_ROWS); + }); + }, + methods: { + _listExamineProjects: function(_page, _rows) { + + vc.component.examineProjectManageInfo.conditions.page = _page; + vc.component.examineProjectManageInfo.conditions.row = _rows; + let param = { + params: vc.component.examineProjectManageInfo.conditions + }; + + //发送get请求 + vc.http.apiGet('/examine.listExamineProject', + param, + function(json, res) { + var _examineProjectManageInfo = JSON.parse(json); + vc.component.examineProjectManageInfo.total = _examineProjectManageInfo.total; + vc.component.examineProjectManageInfo.records = _examineProjectManageInfo.records; + vc.component.examineProjectManageInfo.examineProjects = _examineProjectManageInfo.data; + vc.emit('pagination', 'init', { + total: vc.component.examineProjectManageInfo.records, + currentPage: _page + }); + }, + function(errInfo, error) { + console.log('请求失败处理'); + } + ); + }, + _openAddExamineProjectModal: function() { + vc.emit('addExamineProject', 'openAddExamineProjectModal', {}); + }, + _openEditExamineProjectModel: function(_examineProject) { + vc.emit('editExamineProject', 'openEditExamineProjectModal', _examineProject); + }, + _openDeleteExamineProjectModel: function(_examineProject) { + vc.emit('deleteExamineProject', 'openDeleteExamineProjectModal', _examineProject); + }, + _queryExamineProjectMethod: function() { + vc.component._listExamineProjects(DEFAULT_PAGE, DEFAULT_ROWS); + + }, + _moreCondition: function() { + if (vc.component.examineProjectManageInfo.moreCondition) { + vc.component.examineProjectManageInfo.moreCondition = false; + } else { + vc.component.examineProjectManageInfo.moreCondition = true; + } + } + + + } + }); +})(window.vc); \ No newline at end of file