瀏覽代碼

公众号迁移

caotao 5 年之前
父節點
當前提交
09b08852b3

+ 145 - 0
admin-ui/app/whepi/lingyun/addUser.js

@@ -0,0 +1,145 @@
+define(function (require) {
+    return function (context) {
+
+        var $dlg, $form, $coma;
+
+        // 弹框的方式
+        var widgets = {
+            // 搜索分类检索
+            selectTableUnit: {
+                url: 'app/whepi/home/selectLYbumen.js',
+                bind: {
+                    unitId: 'unitId',
+                    unit: 'unit',
+                },
+            },
+        };
+
+        // 下拉选清空并重新赋值
+        function reloadValuea(_datas) {
+            if ($coma) {
+                $coma.combobox('clear');// 清除当前的选项
+                $coma.combobox('loadData', _datas);// 重新加载数据
+            }
+        }
+
+        // 获取联机下拉选二级信息
+        function getList(id) {
+            debugger
+            id = id == undefined ? 0 : id
+            var _datas = [];
+            _datas.push({
+                "id": "",
+                "text": "全部",
+                "selected": true
+            });
+            $.yvan.ajax({
+                url: api('/home/getDepartmentIdLYepi.json?unitId=' + id),
+                method: 'GET',
+                async: true,
+                success: function (data) {
+                    if (data.data != null && data.data != undefined) {
+                        for (var i = 0; i < data.data.length; i++) {
+                            _datas.push({
+                                "id": data.data[i].departmentId,
+                                "text": data.data[i].departmentName
+                            })
+                        }
+                        reloadValuea(_datas);
+                    }
+                }
+            });
+            return _datas;
+        }
+
+
+        return {
+            xtype: 'dialog',
+            dialogId: 'dialogEnvLog',
+            title: context.isEdit ? '人员入职部门' : '人员入职部门',
+            width: 450,
+            height: 300,
+            onOpen: function () {
+                $dlg = $(this);
+                $form.formSet({ids:context.ids,});
+            },
+            center: {
+                items: {
+                    width: 450,
+                    height: 756,
+                    autoSizeColumns: true,
+                    xtype: 'formgroup',
+                    onRender: function () {
+                        $form = $(this);
+                    },
+                    items: [
+                        [
+                            {name: 'ids', xtype: 'hidden'},
+
+                            { name: 'unitId',xtype: 'hidden'},
+                            {
+                                xtype: 'searchbox',
+                                label: '一级部门',
+                                name: 'unit',
+                                prompt: "一级部门",
+                                maxlength: 60,
+                                width: 350,
+                                widget: widgets.selectTableUnit,// 弹出框方法
+                                onChange: function (value) {
+                                    debugger
+                                    if (!isNotNullOrEmpty(value)) {
+                                        $form.formSet({
+                                            unitId : 0
+                                        })
+                                    }
+                                    getList($form.formGet().unitId);
+                                },
+                            },
+                            {
+                                xtype: 'combobox',
+                                label: '二级部门',
+                                name: 'departmentId',
+                                maxlength: 60,
+                                width: 350,
+                                value: '',
+                                data: getList(),
+                                onRender: function () {
+                                    $coma = $(this);
+                                },
+                                onValue: function (data) {
+                                },
+                                onChange: function () {
+
+                                }
+                            },
+
+
+                        ]
+                    ],
+                }
+            },
+            buttons: [
+                {
+                    text: "保存", iconCls: "fa fa-save", onClick: function () {
+                        $.yvan.postForm($form, {
+                            url: api('/user/entryUser'),
+                            success: function (data) {
+                                if (data.data > 0) {
+                                    $.yvan.msg('保存成功');
+                                    $dlg.window('close');
+                                    if ($.type(context.confirm) === 'function') {
+                                        context.confirm();
+                                    }
+                                }
+                            }
+                        });
+                    }
+                }, {
+                    text: "关闭", iconCls: "fa fa-times", onClick: function () {
+                        $dlg.dialog('close');
+                    }
+                }
+            ]
+        };
+    };
+});

+ 246 - 0
admin-ui/app/whepi/lingyun/lingyunUserNotOnJob.js

@@ -0,0 +1,246 @@
+define(function (require) {
+    return function (context) {
+
+      var $grid1, $form, $coma;
+
+      // 输入搜索文本后点击回车按钮查询列表
+      function enterQueryGrid1(e) {
+        if (e.keyCode === 13) {
+          var tmp = $(this).val();
+          $form.formSet({queryProperties: tmp});
+          queryGrid1();
+        }
+      }
+
+      // 弹框的方式
+      var widgets = {
+        // 搜索分类检索
+        selectTableUnit: {
+          url: 'app/whepi/home/selectLYbumen.js',
+          bind: {
+            unitId: 'unitId',
+            unit: 'unit',
+          },
+        },
+      };
+
+      // 下拉选清空并重新赋值
+      function reloadValuea(_datas) {
+        if ($coma) {
+          $coma.combobox('clear');// 清除当前的选项
+          $coma.combobox('loadData', _datas);// 重新加载数据
+        }
+      }
+
+      // 获取联机下拉选二级信息
+      function getList(id) {
+        id = id == undefined ? 0 : id
+        var _datas = [];
+        _datas.push({
+          "id": "",
+          "text": "全部",
+          "selected": true
+        });
+        $.yvan.ajax({
+          url: api('/home/getDepartmentIdLYepi.json?unitId=' + id),
+          method: 'GET',
+          async: true,
+          success: function (data) {
+            if (data.data != null && data.data != undefined) {
+              for (var i = 0; i < data.data.length; i++) {
+                _datas.push({
+                  "id": data.data[i].departmentId,
+                  "text": data.data[i].departmentName
+                })
+              }
+              reloadValuea(_datas);
+            }
+          }
+        });
+        return _datas;
+      }
+
+      // 检索条件查询
+      function queryGrid1() {
+        var queryForm = $form.formGet();
+        $grid1.reload({
+          mtype: 'POST',
+          url: api('/sweepCode/selectLingyunUserNotOnJob'),
+          queryParams: queryForm
+        }, true);
+      }
+
+      var queryToolbar = {
+        xtype: 'toolbar',
+        title: '用户管理',
+        items: [
+          {
+            text: '查询', iconCls: 'fa fa-search', onClick: function () {
+              queryGrid1();
+            }
+          }, {
+            text: '重置', iconCls: 'fa fa-refresh', onClick: function () {
+              $form.formClear();
+              queryGrid1();
+            }
+          }, {
+            text: '关闭', iconCls: 'fa fa-times-circle', onClick: function () {
+              App.closeMe(this);
+            }
+          }
+        ]
+      };
+
+      var queryForm = {
+        onRender: function () {
+          $form = $(this);
+        },
+        xtype: 'form',
+        items: [[
+          {
+            xtype: 'textbox',
+            label: '检索条件',
+            name: 'queryProperties',
+            prompt: "用户名称/电话号码",
+            labelWidth: 'auto',
+            events: {keydown: enterQueryGrid1}, width: 200
+          },
+          {
+            name: 'isBand',
+            xtype: 'combobox',
+            label: '是否绑定',
+            data: [{id: '', text: '全部'}, {id: '1', text: '否'}, {id: '2', text: '是'}],
+            value: '',
+            onChange: function (value) {
+              queryGrid1();
+            },
+          },
+]]
+      };
+
+      return {
+        north: {
+          height: 88,
+          /* split: true,
+           border: false,*///底框是否可变动
+          items: [
+            queryToolbar,
+            queryForm
+          ]
+        },
+        center: {
+          height: '60%',
+          split: true,
+          items:
+            {
+              onRender: function () {
+                $grid1 = $(this);
+                queryGrid1()
+              },
+              xtype: 'grid',
+              toolbar: {
+                xtype: 'toolbar',
+                title: '用户列表',
+                items: [
+                  {
+                    text: '入职', iconCls: 'fa fa-plus-circle fa-lg', onClick: function () {
+
+                      var row = $grid1.checkedData();
+                      if (row.length == 0) {
+                        $.yvan.msg('请至少选择一行数据');
+                        return;
+                      }
+                      var ids = "";
+                      for (var i=0; i<row.length; i++) {
+                        ids += row[i].houseId + ","
+                      }
+
+
+                      $.yvan.showDialog(this,
+                          require('/app/whepi/lingyun/addUser.js')({
+                            isEdit: false,
+                            ids: ids,
+                            confirm: function () {
+                              queryGrid1();
+                            }
+                          })
+                      );
+                    }
+                  },
+                ]
+              },
+              multiselect: true, /// 表格多选
+              idField: 'userId',
+              editable: true,
+              editOnSelected: true,
+              autoSizeColumns: true,
+              columns:
+                [
+                  [
+                    {field: 'userId', title: '用户ID', hidden: true},
+                    {field: 'houseId', title: 'houseId', hidden: true},
+                    {field: 'linkman', title: '姓名', maxWidth: 200, align: 'left',},
+                    {field: 'loudong', title: '部门名称', maxWidth: 200, align: 'left',},
+                    {
+                      field: 'returnWork', title: '今日复工', maxWidth: 100, align: 'center', formatter: function (value) {
+                        if (value == 1) {
+                          return "<span style='color: green;'>允许复工<span>";
+                        } else if (value == 0) {
+                          return "<span style='color: red;'>禁止复工<span>";
+                        }
+                      }
+                    },
+                    {field: 'reportStatus', title: '上报', hidden: true},
+                    {
+                      field: 'msStatus', title: '个人上报状态', maxWidth: 100, align: 'center', formatter: function (value, row) {
+                        if (row.rowData.reportStatus == 0) {
+                          return "<span style='color: #ffb717;'>未上报<span>";
+                        } else if (value == 1) {
+                          return "<span style='color: green;'>正常<span>";
+                        } else {
+                          return "<span style='color: red;'>异常<span>";
+                        }
+                      }
+                    },
+                    {field: 'phone', title: '联系电话', maxWidth: 200, align: 'left',},
+                    {field: 'doorplate', title: '工号', maxWidth: 200, align: 'left',},
+                    {field: 'oldOpenId', title: '旧openId',hidden: true},
+                    {field: 'isBand', title: '是否绑定', maxWidth: 200, align:  'center', formatter: function (value, row) {
+                        if (row.rowData.oldOpenId) {
+                          return "<span style='color: green;'>是<span>";
+                        } else {
+                          return "<span style='color: red;'>否<span>";
+                        }
+                      }
+                    },
+                    {field: 'bingqingDesc', title: '病情表述', align: 'left',},
+                    {field: 'isContactDesc', title: '家人确诊或接触', align: 'left',formatter: function (value) {
+                        if (value == "否") {
+                          return "<span style='color: green;'>否<span>";
+                        } else {
+                          return "<span style='color: red;'>是<span>";
+                        }
+                      }
+                    },
+                    {field: 'isSuspectedDesc', title: '家人健康异常', align: 'left',formatter: function (value) {
+                        if (value == "否") {
+                          return "<span style='color: green;'>否<span>";
+                        } else {
+                          return "<span style='color: red;'>是<span>";
+                        }
+                      }
+                    },
+                    {field: 'workLoalDesc', title: '工作驻地', maxWidth: 200, align: 'left',},
+                    {field: 'todayLoalDesc', title: '今晚住地', maxWidth: 200, align: 'left',},
+                    {field: 'autoLocal', title: '定位地区', maxWidth: 200, align: 'left',},
+                    {field: 'autoAddr', title: '定位地址', maxWidth: 200, align: 'left',},
+                    {field: 'isTripDesc', title: '是否出行', maxWidth: 200, align: 'left',},
+                    {field: 'tripDetDesc', title: '出行详细', align: 'left',},
+                  ]
+                ]
+            }
+        }
+      };
+    };
+  }
+);

+ 285 - 0
admin-ui/app/whepi/lingyun/lingyunUserOnJob.js

@@ -0,0 +1,285 @@
+define(function (require) {
+      return function (context) {
+
+        var $grid1, $form, $coma;
+
+        // 输入搜索文本后点击回车按钮查询列表
+        function enterQueryGrid1(e) {
+          if (e.keyCode === 13) {
+            var tmp = $(this).val();
+            $form.formSet({queryProperties: tmp});
+            queryGrid1();
+          }
+        }
+
+        // 弹框的方式
+        var widgets = {
+          // 搜索分类检索
+          selectTableUnit: {
+            url: 'app/whepi/home/selectLYbumen.js',
+            bind: {
+              unitId: 'unitId',
+              unit: 'unit',
+            },
+          },
+        };
+
+        // 下拉选清空并重新赋值
+        function reloadValuea(_datas) {
+          if ($coma) {
+            $coma.combobox('clear');// 清除当前的选项
+            $coma.combobox('loadData', _datas);// 重新加载数据
+          }
+        }
+
+        // 获取联机下拉选二级信息
+        function getList(id) {
+          id = id == undefined ? 0 : id
+          var _datas = [];
+          _datas.push({
+            "id": "",
+            "text": "全部",
+            "selected": true
+          });
+          $.yvan.ajax({
+            url: api('/home/getDepartmentIdLYepi.json?unitId=' + id),
+            method: 'GET',
+            async: true,
+            success: function (data) {
+              if (data.data != null && data.data != undefined) {
+                for (var i = 0; i < data.data.length; i++) {
+                  _datas.push({
+                    "id": data.data[i].departmentId,
+                    "text": data.data[i].departmentName
+                  })
+                }
+                reloadValuea(_datas);
+              }
+            }
+          });
+          return _datas;
+        }
+
+        // 检索条件查询
+        function queryGrid1() {
+          var queryForm = $form.formGet();
+          $grid1.reload({
+            mtype: 'POST',
+            url: api('/sweepCode/selectLingyunUser'),
+            queryParams: queryForm
+          }, true);
+        }
+
+        var queryToolbar = {
+          xtype: 'toolbar',
+          title: '用户管理',
+          items: [
+            {
+              text: '查询', iconCls: 'fa fa-search', onClick: function () {
+                queryGrid1();
+              }
+            }, {
+              text: '重置', iconCls: 'fa fa-refresh', onClick: function () {
+                $form.formClear();
+                queryGrid1();
+              }
+            }, {
+              text: '关闭', iconCls: 'fa fa-times-circle', onClick: function () {
+                App.closeMe(this);
+              }
+            }
+          ]
+        };
+
+        var queryForm = {
+          onRender: function () {
+            $form = $(this);
+          },
+          xtype: 'form',
+          items: [[
+            {
+              xtype: 'textbox',
+              label: '检索条件',
+              name: 'queryProperties',
+              prompt: "用户名称/电话号码",
+              labelWidth: 'auto',
+              events: {keydown: enterQueryGrid1}, width: 200
+            },
+            {xtype: 'hidden', name: 'unitId'},
+            {
+              xtype: 'searchbox',
+              label: '部门',
+              labelWidth: 'auto',
+              name: 'unit',
+              prompt: "部门",
+              width: 250,
+              widget: widgets.selectTableUnit,// 弹出框方法
+              onChange: function (value) {
+                if (!isNotNullOrEmpty(value)) {
+                  $form.formSet({
+                    unitId : 0
+                  })
+                }
+                getList($form.formGet().unitId);
+                queryGrid1();
+              },
+            },
+            {
+              xtype: 'combobox',
+              label: '二级部门',
+              name: 'departmentId',
+              labelWidth: 'auto',
+              width: 280,
+              value: '',
+              data: getList(),
+              onRender: function () {
+                $coma = $(this);
+              },
+              onValue: function (data) {
+              },
+              onChange: function () {
+                queryGrid1();
+              }
+            },
+            {
+              name: 'isBand',
+              xtype: 'combobox',
+              label: '是否绑定',
+              data: [{id: '', text: '全部'}, {id: '1', text: '否'}, {id: '2', text: '是'}],
+              value: '',
+              onChange: function (value) {
+                queryGrid1();
+              },
+            },
+          ]]
+        };
+
+        return {
+          north: {
+            height: 88,
+            /* split: true,
+             border: false,*///底框是否可变动
+            items: [
+              queryToolbar,
+              queryForm
+            ]
+          },
+          center: {
+            height: '60%',
+            split: true,
+            items:
+                {
+                  onRender: function () {
+                    $grid1 = $(this);
+                    queryGrid1()
+                  },
+                  xtype: 'grid',
+                  toolbar: {
+                    xtype: 'toolbar',
+                    title: '用户列表',
+                    items: [
+                      {
+                        text: '离职', iconCls: 'fa fa fa-pencil-square-o fa-lg', onClick: function () {
+                          var row = $grid1.checkedData();
+                          if (row.length == 0) {
+                            $.yvan.msg('请至少选择一行数据');
+                            return;
+                          }
+                          var ids = "";
+                          for (var i=0; i<row.length; i++) {
+                            ids += row[i].houseId + ","
+                          }
+                          $.yvan.confirm('确定勾选的这' + row.length + '条人员做离职处理吗?', {
+                            yes: function (index) {
+                              $.yvan.ajax({
+                                method: 'post',
+                                url: api('/user/resignUser'),
+                                data: {ids: ids},
+                                success: function (data) {
+                                  $.yvan.msg("操作成功");
+                                  $grid1.reload();
+                                  queryGrid1();
+                                }
+                              });
+                            }
+                          });
+                        }
+                      },
+                    ]
+                  },
+                  multiselect: true, /// 表格多选
+                  idField: 'userId',
+                  editable: true,
+                  editOnSelected: true,
+                  autoSizeColumns: true,
+                  columns:
+                      [
+                        [
+                          {field: 'userId', title: '用户ID', hidden: true},
+                          {field: 'houseId', title: 'houseId', hidden: true},
+                          {field: 'linkman', title: '姓名', maxWidth: 200, align: 'left',},
+                          {field: 'loudong', title: '部门名称', maxWidth: 200, align: 'left',},
+                          {field: 'departmentName', title: '二级部门', maxWidth: 200, align: 'left',},
+                          {
+                            field: 'returnWork', title: '今日复工', maxWidth: 100, align: 'center', formatter: function (value) {
+                              if (value == 1) {
+                                return "<span style='color: green;'>允许复工<span>";
+                              } else if (value == 0) {
+                                return "<span style='color: red;'>禁止复工<span>";
+                              }
+                            }
+                          },
+                          {field: 'reportStatus', title: '上报', hidden: true},
+                          {
+                            field: 'msStatus', title: '个人上报状态', maxWidth: 100, align: 'center', formatter: function (value, row) {
+                              if (row.rowData.reportStatus == 0) {
+                                return "<span style='color: #ffb717;'>未上报<span>";
+                              } else if (value == 1) {
+                                return "<span style='color: green;'>正常<span>";
+                              } else {
+                                return "<span style='color: red;'>异常<span>";
+                              }
+                            }
+                          },
+                          {field: 'phone', title: '联系电话', maxWidth: 200, align: 'left',},
+                          {field: 'doorplate', title: '工号', maxWidth: 200, align: 'left',},
+                          {field: 'oldOpenId', title: '旧openId', hidden: true},
+                          {field: 'isBand', title: '是否绑定', maxWidth: 200, align:  'center', formatter: function (value, row) {
+                              if (row.rowData.oldOpenId) {
+                                return "<span style='color: green;'>是<span>";
+                              } else {
+                                return "<span style='color: red;'>否<span>";
+                              }
+                            }
+                          },
+                          {field: 'bingqingDesc', title: '病情表述', align: 'left',},
+                          {field: 'isContactDesc', title: '家人确诊或接触', align: 'left',formatter: function (value) {
+                              if (value == "否") {
+                                return "<span style='color: green;'>否<span>";
+                              } else {
+                                return "<span style='color: red;'>是<span>";
+                              }
+                            }
+                          },
+                          {field: 'isSuspectedDesc', title: '家人健康异常', align: 'left',formatter: function (value) {
+                              if (value == "否") {
+                                return "<span style='color: green;'>否<span>";
+                              } else {
+                                return "<span style='color: red;'>是<span>";
+                              }
+                            }
+                          },
+                          {field: 'workLoalDesc', title: '工作驻地', maxWidth: 200, align: 'left',},
+                          {field: 'todayLoalDesc', title: '今晚住地', maxWidth: 200, align: 'left',},
+                          {field: 'autoLocal', title: '定位地区', maxWidth: 200, align: 'left',},
+                          {field: 'autoAddr', title: '定位地址', maxWidth: 200, align: 'left',},
+                          {field: 'isTripDesc', title: '是否出行', maxWidth: 200, align: 'left',},
+                          {field: 'tripDetDesc', title: '出行详细', align: 'left',},
+                        ]
+                      ]
+                }
+          }
+        };
+      };
+    }
+);