minitiger 8 лет назад
Родитель
Сommit
33feca3e61

+ 6 - 1
VisualInspection/js/appeal_management/appeal_checked.js

@@ -53,5 +53,10 @@ function queryCheckedAppealTask(){
 function showTaskDetail(id){
     var rowData=getItemByIdFromArr(id,$('#checked_datatable').mytable('getTableData'));
     $.checkTask = rowData;
-    changePage("/view/mytask/taskDetail.html",checkedAppealTableObj);
+    post_common_service("/checkAppeal/getByTaskId", {"task_id":rowData.id}, function(data){
+        $.checkTask = rowData;
+        $.checkTask.appeal = data;
+        changePage("/view/mytask/taskDetail.html", checkedAppealTableObj);
+    });
+    // changePage("/view/mytask/taskDetail.html",checkedAppealTableObj);
 }

+ 6 - 6
VisualInspection/js/constant/constant.js

@@ -4,14 +4,14 @@ function queryConstant(){
         "flag_name": $("#keywords").val()
     }
     var cols = [
-                {width: 80, text: '序号', type: 'number', flex: false, field: 'num'},
-                {width: 80, text: '字典值', type: 'string', flex: false, field: 'code_value'},
+                {width: 40, text: '序号', type: 'number', flex: true, field: 'num'},
+                {width: 40, text: '字典值', type: 'string', flex: true, field: 'code_value'},
                 {width: 80, text: '字典名称', type: 'string', flex: true, field: 'code_name'},
-                {width: 80, text: '有效标志', type: 'string', flex: false, field: 'valid'},
-                {width: 80, text: '字典标识', type: 'string', flex: true, field: 'code_flag'},
-                {width: 160, text: '标识名称', type: 'string', flex: false, field: 'flag_name'},
+                {width: 60, text: '有效标志', type: 'string', flex: true, field: 'valid'},
+                {width: 160, text: '字典标识', type: 'string', flex: true, field: 'code_flag'},
+                {width: 160, text: '标识名称', type: 'string', flex: true, field: 'flag_name'},
                 {width: 80, text: '备注', type: 'string', flex: true, field: 'remark'},
-                {width: 160, text: '操作', type: 'string', flex: true, field: 'id',
+                {width: 80, text: '操作', type: 'string', flex: true, field: 'id',
                     oper:[
                         {func:'showEditConstant',text:'修改',icon_class:'icon-edit'},
                         {func:'deleteConstant',text:'删除',icon_class:'icon-remove-circle'}

+ 4 - 0
VisualInspection/js/role/addpermision.js

@@ -7,8 +7,12 @@ function loadPermisionData(nodedata) {
 
     if (edittype == "add") {
         $("#dept_name").val("")
+        $('#addModal .modal-title').html('添加权限');
+        $('#permision_add_btn').html('添加');
     }
     if (edittype == "edit") {
+        $('#addModal .modal-title').html('修改权限');
+        $('#permision_add_btn').html('保存');
         permisiontemp = PermisionMap.get(nodedata[0].id);
         setPermison();
     }

+ 3 - 1
VisualInspection/js/role/addrole.js

@@ -5,11 +5,13 @@ function loadRoleData(role) {
     $("#role_level").val("");
 
     if(role!=null && edittype=="edit"){
+       $('#addRoleModal .modal-title').html('修改角色');
          $("#role_name").val(role.name);
         $("#role_des").val(role.des);
         $("#role_level").val(role.level);
         roletemp = role;
-       
+    }else{
+        $('#addRoleModal .modal-title').html('添加角色');
     }
 
     $("#role_add_btn").off("click");

+ 25 - 17
VisualInspection/js/role/permision.js

@@ -63,14 +63,18 @@ $(document).ready(function () {
             });
             return;
         }
-        PermisionDelete(nodedata[0].id, function (data) {
-            layer.msg('删除成功!', {
-                time: 2000, //20s后自动关闭
-            });
-            dept_tree.removeNode(nodedata[0]);
-        }, function (error) {
 
-        });
+        deleteItem4Common(function(){
+            PermisionDelete(nodedata[0].id, function (data) {
+                layer.msg('删除成功!', {
+                    time: 2000, //20s后自动关闭
+                });
+                dept_tree.removeNode(nodedata[0]);
+            }, function (error) {
+
+            });
+        }); 
+        
     });
     $("#role_add").on("click", function () {
         var nodedata = dept_tree.getSelectedNodes();
@@ -83,6 +87,7 @@ $(document).ready(function () {
         }
         loadPermisionRoleData(nodedata, 0)
         $('#addRoleModal').modal('show');
+        $('#addRoleModal .modal-title').html('添加角色');
     });
 
     $('.datatable').datatable({
@@ -97,10 +102,11 @@ $(document).ready(function () {
     $('.datatable').on('click', 'button', function () {
         if (this.name == "user_edit") {
             var nodedata = dept_tree.getSelectedNodes();
-            edittype = "edit"
-            var user = nodedata
-            loadPermisionRoleData(user, this.id)
-            $('#addRoleModal').modal('show')
+            edittype = "edit";
+            var user = nodedata;
+            loadPermisionRoleData(user, this.id);
+            $('#addRoleModal').modal('show');
+            $('#addRoleModal .modal-title').html('修改角色');
         }
         if (this.name == "user_delete") {
             var nodedata = dept_tree.getSelectedNodes();
@@ -108,17 +114,19 @@ $(document).ready(function () {
                 "role_id": this.id,
                 "permission_id": nodedata[0].id
             }
-            PermisionRoleDELETE(data, function (data) {
-                layer.msg('角色删除成功!', {
-                    time: 2000, //20s后自动关闭
-                }, function () {
+            deleteItem4Common(function(){
+                PermisionRoleDELETE(data, function (data) {
                     var nodedata = dept_tree.getSelectedNodes();
                     updateRole(nodedata[0].id)
-                });
-            },
+                    layer.msg('角色删除成功!', {
+                        time: 2000, //20s后自动关闭
+                    }, function () {
+                    });
+                },
                 function (error) {
 
                 })
+            });
         }
     });
 

+ 9 - 7
VisualInspection/js/role/role.js

@@ -57,17 +57,19 @@ $(document).ready(function () {
             $('#addRoleModal').modal('show');
         }
         if (this.name == "user_delete") {
-
-            RoleDelete(this.id, function (data) {
-                layer.msg('角色删除成功!', {
-                    time: 2000, //20s后自动关闭
-                }, function () {
+            var roleId = this.id;
+            deleteItem4Common(function(){
+                RoleDelete(roleId, function (data) {
                     getrole(pagesize, 1);
-                });
-            },
+                    layer.msg('角色删除成功!', {
+                        time: 2000, //20s后自动关闭
+                    }, function () {
+                    });
+                },
                 function (error) {
 
                 })
+            });           
         }
     });
 

+ 4 - 3
VisualInspection/js/user/adddept.js

@@ -3,20 +3,21 @@ var selectednodetemp;
 
 function loadData(nodedata) {
     var pnode = nodedata;
-
+    
     if (edittype == "add") {
         $("#dept_name").val("")
+        $('#addModal .modal-title').html('添加部门');
     }
     if (edittype == "edit") {
         selectednodetemp = nodedata[0];
         $("#dept_name").val(nodedata[0].name)
         $("#dept_add_btn").html("保存")
-        if (pnode != null && pnode.length > 0) {
+        $('#addModal .modal-title').html('修改部门');
+        if (pnode != null && pnode[0].pId && pnode.length > 0) {
             pnode = [dept_tree.getNodeByParam("id", pnode[0].pId, null)]
         }
     }
 
-
     dept_selectinput = new TreeSelect({
         element: '#dept_select',
         data: zdata,

+ 18 - 15
VisualInspection/js/user/userManager.js

@@ -102,24 +102,27 @@
          edittype = "edit"
          loadData(nodedata)
          $('#addModal').modal('show');
+         
      });
 
      $("#dept_delete").on("click", function() {
-         //获取选中的节点
-         var nodedata = dept_tree.getSelectedNodes();
-         if (nodedata.length < 1) {
-             layer.msg('请先选择部门!', {
-                 time: 2000, //20s后自动关闭
-             });
-             return;
-         }
-         DeptDelete(nodedata[0].id, function(data) {
-             layer.msg('删除成功!', {
-                 time: 2000, //20s后自动关闭
-             });
-             dept_tree.removeNode(nodedata[0]);
-         }, function(error) {
-
+         
+        //获取选中的节点
+        var nodedata = dept_tree.getSelectedNodes();
+        if (nodedata.length < 1) {
+            layer.msg('请先选择部门!', {
+                time: 2000, //20s后自动关闭
+            });
+            return;
+        }
+        deleteItem4Common(function(){
+            DeptDelete(nodedata[0].id, function(data) {
+                layer.msg('删除成功!', {
+                    time: 2000, //20s后自动关闭
+                });
+                dept_tree.removeNode(nodedata[0]);
+            }, function(error) {
+            });
          });
      });
 

+ 10 - 0
VisualInspection/js/util/util.js

@@ -161,6 +161,16 @@ function deleteItem4Common(id, url, okCb, offset) {
     });
 }
 
+function deleteItem4Common(cb){
+    layer.confirm('确定删除记录?', {
+        shade: 0,
+        btn: ['确定', '取消'] //按钮
+    }, function() {
+        if(cb) cb();
+    }, function(index) {
+        layer.close(index);
+    });
+}
 function addOrUpdateItem4Common(param, url, okCb) {
     no_return_common_service(url, param, function(data) {
         if (okCb) okCb(); //重新加载表格数据

+ 2 - 2
VisualInspection/view/role/addpermision.html

@@ -47,10 +47,10 @@
             </div>
         </div>
         
-        <div class="form-group">
+        <!-- <div class="form-group">
             <div class="col-sm-offset-2 col-sm-10">
                 <button type="button" id="permision_add_btn" class="btn btn-default" >添加</button>
             </div>
-        </div>
+        </div> -->
     </form>
 </div>

+ 3 - 0
VisualInspection/view/role/permision.html

@@ -57,6 +57,9 @@
             <div class="modal-body">
                 <link rel="import" href="/view/role/addpermision.html?__inline">
             </div>
+            <div class="modal-footer">
+                <button type="button" id="permision_add_btn" class="btn btn-primary" >添加</button>
+            </div>
         </div>
     </div>
 </div>

+ 2 - 2
VisualInspection/view/user/addDept.html

@@ -24,10 +24,10 @@
             </div>
         </div>
 
-        <div class="form-group">
+        <!-- <div class="form-group">
             <div class="col-sm-offset-2 col-sm-10">
                 <button type="button" id="dept_add_btn" class="btn btn-default" onclick="addDept()">添加</button>
             </div>
-        </div>
+        </div> -->
     </form>
 </div>

+ 4 - 1
VisualInspection/view/user/userManager.html

@@ -57,12 +57,15 @@
             <div class="modal-body">
                 <link rel="import" href="/view/user/addDept.html?__inline">
             </div>
+            <div class="modal-footer">
+                <button type="button" id="dept_add_btn" class="btn btn-primary" onclick="addDept()">添加</button>
+            </div>
         </div>
     </div>
 </div>
 
 <div class="modal fade" id="addUserModal">
-    <div class="modal-dialog modal-lg">
+    <div class="modal-dialog">
         <div class="modal-content">
             <div class="modal-header">
                 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button>