Ming 4 anni fa
parent
commit
9be8a04bcf
4 ha cambiato i file con 118 aggiunte e 129 eliminazioni
  1. 3 8
      api/request.js
  2. 74 81
      js/team-inner.js
  3. 40 39
      js/team.js
  4. 1 1
      pages/operation/team.html

+ 3 - 8
api/request.js

@@ -164,17 +164,12 @@ const RECORD_POINT_DETAIL = 'iot/inspectionpoints/getList' //维保点位图片
 
 
 const TEAM_LIST = 'iot/devopsteam/getDevopsTeamList'; //班组人员列表查询
-const TEAM_PERSON = 'iot/devopsteam/getUserList'; //班组人员责任人下拉
-
-
-
-const MONTH_REPORT = "iot/px/queryPf"; //月报考评导出     
-
-
-
+const TEAM_PERSON = 'iot/devopsteam/getUserList'; //班组人员责任人下拉    
+const TEAM_INNERLIST = 'iot/devopsteam/getUserPdList'; //组织人员列表查询
 
 
 
+const MONTH_REPORT = "iot/px/queryPf"; //月报考评导出       
 
 
 function ajaxRequest(path, method, data, success, error, type = 1) {

+ 74 - 81
js/team-inner.js

@@ -1,35 +1,28 @@
-// 详情弹框js start
-var pointId = '';
-var innerPage = 1;
-
-// 详情弹框
-$(document).on('click', 'a.view-detail', function() {
-    let dataId = $(this).data('id'); // 单位ID
-    pointId = dataId;
-    queryPointDetailList = layer.open({
+// 新增弹框
+$(document).on('click', '.add', function() {
+    layerCreateIndex = layer.open({
         type: 1,
         title: false,
         closeBtn: 0,
         shadeClose: true,
         skin: 'yourclass',
-        area: [
-            '700px', '500px'
-        ],
-        content: $(".queryPointDetailList"),
+        area: ['450px', '500px'],
+        content: $(".addDeviceTypeOut"),
         success: function() {
-            getPointDetailAjax({ "id": dataId })
-                // 获取部门列表 ajax请求
             $('.clsBtn,.cancel').click(function() {
-                alert(1)
-                innerPage = 1;
-                layer.close(queryPointDetailList);
+                layer.close(layerCreateIndex);
             })
         }
     })
 })
 
+// 新增列表渲染
+
+
+
+
 // 获取列表 ajax请求
-function getPointDetailAjax(queryParam = {}, innerPage = 1) {
+function getTeamInnerList(queryParam = {}, innerPage = 1) {
     queryParam.page = innerPage;
     queryParam.limit = 1; // 每页显示条数
     queryParam.start = (queryParam.page - 1) * queryParam.limit;
@@ -85,29 +78,29 @@ function getPointDetailAjax(queryParam = {}, innerPage = 1) {
 // 分页操作
 $('#firstPageButton2').on('click', function() {
     innerPage = 1;
-    getPointDetailAjax(getSearchParamObj2(), 1);
+    getTeamInnerList(getSearchParamObj2(), 1);
 });
 
 $('#lastPageButton2').on('click', function() {
     innerPage = totalPages;
-    getPointDetailAjax(getSearchParamObj2(), innerPage);
+    getTeamInnerList(getSearchParamObj2(), innerPage);
 });
 
 $('#prevPageButton2').on('click', function() {
     innerPage -= 1;
-    getPointDetailAjax(getSearchParamObj2(), innerPage);
+    getTeamInnerList(getSearchParamObj2(), innerPage);
 });
 
 $('#nextPageButton2').on('click', function() {
     innerPage += 1;
-    getPointDetailAjax(getSearchParamObj2(), innerPage);
+    getTeamInnerList(getSearchParamObj2(), innerPage);
 })
 
 
 // 按钮搜索
 $('#buttonSearch2').on('click', function() {
     innerPage = 1;
-    getPointDetailAjax(getSearchParamObj2());
+    getTeamInnerList(getSearchParamObj2());
 })
 
 // 拼接搜索条件
@@ -125,66 +118,66 @@ $('.pg-refresh2').click(resetForm);
 function resetForm() {
     innerPage = 1;
     $("#weibao").val("0");
-    getPointDetailAjax(getSearchParamObj2());
+    getTeamInnerList(getSearchParamObj2());
 }
 
 
 //点位详情弹框
-$(document).on('click', 'a.pointDetail', function() {
-    let dwId = $(this).data('id');
-    layerDepartmentIndex = layer.open({
-        type: 1,
-        title: false,
-        closeBtn: 0,
-        shadeClose: true,
-        skin: 'yourclass',
-        area: [
-            '400px', '400px'
-        ],
-        content: $(".pointDetailOut"),
-        success: function() {
-            ajaxRequest(RECORD_POINT_DETAIL, "POST", { "id": dwId }, function(result) {
-                console.log(result.RESULT[0])
-                var data = result.RESULT[0];
-                $('#pointDetailUrl').attr('src', data.picture_route);
-            }, function(errorMsg) {
-                alert("请求数据失败!");
-            }, 3);
-
-            $('.clsBtn2,.cancel2').click(function() {
-                innerPage = 1;
-                layer.close(layerDepartmentIndex);
-            })
-        }
-    })
-})
+// $(document).on('click', 'a.pointDetail', function() {
+//     let dwId = $(this).data('id');
+//     layerDepartmentIndex = layer.open({
+//         type: 1,
+//         title: false,
+//         closeBtn: 0,
+//         shadeClose: true,
+//         skin: 'yourclass',
+//         area: [
+//             '400px', '400px'
+//         ],
+//         content: $(".pointDetailOut"),
+//         success: function() {
+//             ajaxRequest(RECORD_POINT_DETAIL, "POST", { "id": dwId }, function(result) {
+//                 console.log(result.RESULT[0])
+//                 var data = result.RESULT[0];
+//                 $('#pointDetailUrl').attr('src', data.picture_route);
+//             }, function(errorMsg) {
+//                 alert("请求数据失败!");
+//             }, 3);
+
+//             $('.clsBtn2,.cancel2').click(function() {
+//                 innerPage = 1;
+//                 layer.close(layerDepartmentIndex);
+//             })
+//         }
+//     })
+// })
 
 //维保报告点击
-$(document).on('click', 'a.weibaoReport', function() {
-    let jlId = $(this).data('id'); //单位ID
-    layerReportIndex = layer.open({
-        type: 1,
-        title: false,
-        closeBtn: 0,
-        shadeClose: true,
-        skin: 'yourclass',
-        area: [
-            '400px', '400px'
-        ],
-        content: $(".weibaoReportOut"),
-        success: function() {
-            ajaxRequest(RECORD_AND_POINT, "POST", { "jlid": jlId }, function(result) {
-                console.log(result.RESULT[0])
-                var data = result.RESULT[0];
-                $('#weibaoReportUrl').attr('src', data.report_photos);
-            }, function(errorMsg) {
-                alert("请求数据失败!");
-            }, 3);
-
-            $('.clsBtn3,.cancel3').click(function() {
-                innerPage = 1;
-                layer.close(layerReportIndex);
-            })
-        }
-    })
-})
+// $(document).on('click', 'a.weibaoReport', function() {
+//     let jlId = $(this).data('id'); //单位ID
+//     layerReportIndex = layer.open({
+//         type: 1,
+//         title: false,
+//         closeBtn: 0,
+//         shadeClose: true,
+//         skin: 'yourclass',
+//         area: [
+//             '400px', '400px'
+//         ],
+//         content: $(".weibaoReportOut"),
+//         success: function() {
+//             ajaxRequest(RECORD_AND_POINT, "POST", { "jlid": jlId }, function(result) {
+//                 console.log(result.RESULT[0])
+//                 var data = result.RESULT[0];
+//                 $('#weibaoReportUrl').attr('src', data.report_photos);
+//             }, function(errorMsg) {
+//                 alert("请求数据失败!");
+//             }, 3);
+
+//             $('.clsBtn3,.cancel3').click(function() {
+//                 innerPage = 1;
+//                 layer.close(layerReportIndex);
+//             })
+//         }
+//     })
+// })

+ 40 - 39
js/team.js

@@ -153,9 +153,10 @@ getNameList()
 //单位下拉 ajax请求
 function getNameList() {
     ajaxRequest(DEVICE_TYPE_COMPANYLIST, "POST", {}, function(result) {
+
         let data = result.RESULT;
         let items = '';
-
+        console.log(data)
         data.forEach(function(item, key) {
             items += `<option value="${item.owner_id}">${item.owner_name}</option>`
         })
@@ -175,53 +176,53 @@ var layerUpdateIndex = ''
 layui.use('layer', function() {
 
     //新增弹框
-    $('.add').click(function() {
-            layerCreateIndex = layer.open({
+    // $('.add').click(function() {
+    //         layerCreateIndex = layer.open({
+    //             type: 1,
+    //             title: false,
+    //             closeBtn: 0,
+    //             shadeClose: true,
+    //             skin: 'yourclass',
+    //             area: ['450px', '500px'],
+    //             content: $(".addDeviceTypeOut"),
+    //             success: function() {
+    //                 $('.clsBtn,.cancel').click(function() {
+    //                     layer.close(layerCreateIndex);
+    //                 })
+    //             }
+    //         })
+    //     }),
+    //修改弹框信息 
+    $('.edit').click(function() {
+
+        if (!$('.pure-table tr').has('.checked').length) {
+            layer.msg('请选择一条需要修改的信息!', { icon: 5 });
+        } else {
+            let userInfo = $('.pure-table tr').find('.checked').data('user');
+
+            $('.editDeviceTypeOut input[name=type_name]').val(userInfo.type_name)
+            $('.editDeviceTypeOut input[name=type_value]').val(userInfo.type_value)
+            $('.editDeviceTypeOut select[name=transmission_model]').val(userInfo.transmission_model)
+            $('.editDeviceTypeOut input[name=business').val(userInfo.business)
+            $('.editDeviceTypeOut select[name=company_code]').val(userInfo.company_code)
+            $('.editDeviceTypeOut input[name=id').val(userInfo.id)
+
+            layerUpdateIndex = layer.open({
                 type: 1,
                 title: false,
                 closeBtn: 0,
                 shadeClose: true,
                 skin: 'yourclass',
-                area: ['450px', '500px'],
-                content: $(".addDeviceTypeOut"),
+                area: ['410px', '400px'],
+                content: $(".editDeviceTypeOut"),
                 success: function() {
                     $('.clsBtn,.cancel').click(function() {
-                        layer.close(layerCreateIndex);
+                        layer.close(layerUpdateIndex);
                     })
                 }
-            })
-        }),
-        //修改弹框信息 
-        $('.edit').click(function() {
-
-            if (!$('.pure-table tr').has('.checked').length) {
-                layer.msg('请选择一条需要修改的信息!', { icon: 5 });
-            } else {
-                let userInfo = $('.pure-table tr').find('.checked').data('user');
-
-                $('.editDeviceTypeOut input[name=type_name]').val(userInfo.type_name)
-                $('.editDeviceTypeOut input[name=type_value]').val(userInfo.type_value)
-                $('.editDeviceTypeOut select[name=transmission_model]').val(userInfo.transmission_model)
-                $('.editDeviceTypeOut input[name=business').val(userInfo.business)
-                $('.editDeviceTypeOut select[name=company_code]').val(userInfo.company_code)
-                $('.editDeviceTypeOut input[name=id').val(userInfo.id)
-
-                layerUpdateIndex = layer.open({
-                    type: 1,
-                    title: false,
-                    closeBtn: 0,
-                    shadeClose: true,
-                    skin: 'yourclass',
-                    area: ['410px', '400px'],
-                    content: $(".editDeviceTypeOut"),
-                    success: function() {
-                        $('.clsBtn,.cancel').click(function() {
-                            layer.close(layerUpdateIndex);
-                        })
-                    }
-                });
-            }
-        })
+            });
+        }
+    })
 
     //删除信息
     $('.delete').click(function() {

+ 1 - 1
pages/operation/team.html

@@ -102,7 +102,7 @@
                     <div>
                         <span>所属单位<i class="necessary">*</i>
                         </span>
-                        <select name="getNameList">
+                        <select id="getNameList">
                             <option value="">所有</option>
                             <!-- <option value="1">NB-IOT</option>
                             <option value="2">Lora-IOT</option>