示例#1
0
 def __init__(self, request):
     super(DeptSelect, self).__init__()
     #设置sql
     from mosys.sql_utils import  get_sql
     self.grid.sql = get_sql("sqls","dept_select")
   
     #设置 colum 属性
     self.grid.fields["DeptID"]["width"]=10
     self.grid.fields["code"]["width"]=200
     self.grid.fields["DeptName"]["width"]=200
     
     self.grid.fields["DeptID"]["hide"] = True
示例#2
0
    def __init__(self, request):
        super(AreaSelect, self).__init__()
        #设置sql
        from mosys.sql_utils import get_sql
        self.grid.sql = get_sql("sqls", "area_select")

        #设置 colum 属性
        self.grid.fields["id"]["width"] = 10
        self.grid.fields["areaid"]["width"] = 120
        self.grid.fields["areaname"]["width"] = 120

        self.grid.fields["id"]["hide"] = True
示例#3
0
 def __init__(self, request):
     super(AreaSelect, self).__init__()
     #设置sql
     from mosys.sql_utils import  get_sql
     self.grid.sql = get_sql("sqls","area_select")
      
     #设置 colum 属性
     self.grid.fields["id"]["width"]=10
     self.grid.fields["areaid"]["width"]=120
     self.grid.fields["areaname"]["width"]=120
     
     self.grid.fields["id"]["hide"] = True
示例#4
0
    def __init__(self, request):
        super(DeptSelect, self).__init__()
        #设置sql
        from mosys.sql_utils import get_sql
        self.grid.sql = get_sql("sqls", "dept_select")
        #        self.grid.sql_data = "select DeptID,code,DeptName from departments  where status=0 LIMIT 0,20"

        #设置 colum 属性
        self.grid.fields["DeptID"]["width"] = 10
        self.grid.fields["code"]["width"] = 200
        self.grid.fields["DeptName"]["width"] = 200

        self.grid.fields["DeptID"]["hide"] = True
示例#5
0
    def __init__(self, request):
        super(DeptSelect, self).__init__()
        #设置sql
        from mosys.sql_utils import  get_sql
        self.grid.sql = get_sql("sqls","dept_select")
#        self.grid.sql_data = "select DeptID,code,DeptName from departments  where status=0 LIMIT 0,20"
            
        #设置 colum 属性
        self.grid.fields["DeptID"]["width"]=10
        self.grid.fields["code"]["width"]=200
        self.grid.fields["DeptName"]["width"]=200
        
        self.grid.fields["DeptID"]["hide"] = True
示例#6
0
 def __init__(self, request):
     super(EmpSelect, self).__init__()
     #设置sql
     from mosys.sql_utils import  get_sql
     self.grid.sql = get_sql("sqls","emp_select")
      
     #设置 colum 属性
     self.grid.fields["userid"]["width"]=10
     self.grid.fields["badgenumber"]["width"]=100
     self.grid.fields["name"]["width"]=100
     self.grid.fields["DeptName"]["width"]=120
     self.grid.fields["code"]["width"]=100
     
     self.grid.fields["userid"]["hide"] = True
     self.grid.fields["DeptID"]["hide"] = True
示例#7
0
    def __init__(self, request):
        super(EmpSelect, self).__init__()
        #设置sql
        from mosys.sql_utils import get_sql
        self.grid.sql = get_sql("sqls",
                                "emp_select")  #sqlUtil.getEmpSelectSql()

        #设置 colum 属性
        self.grid.fields["userid"]["width"] = 10
        self.grid.fields["badgenumber"]["width"] = 100
        self.grid.fields["name"]["width"] = 100
        self.grid.fields["DeptName"]["width"] = 120
        self.grid.fields["code"]["width"] = 100

        self.grid.fields["userid"]["hide"] = True
        self.grid.fields["DeptID"]["hide"] = True
 def __init__(self, request):
     super(OrderAttReport, self).__init__()
     #设置sql
     from mosys.sql_utils import  get_sql
     self.grid.sql = get_sql("attResult","OrderAttReport")
     #设置 colum 属性
     self.grid.fields["name"]["width"]=100
     self.grid.fields["badgenumber"]["width"]=150
     self.grid.fields["DeptName"]["width"]=100
     self.grid.fields["attdate"]["width"]=80
     self.grid.fields["attTimes"]["width"]=50
     self.grid.fields["attdays"]["width"]=70
     self.grid.fields["overtimes"]["width"]=50
     self.grid.fields["leaveimes"]["width"]=50
     self.grid.fields["stopWorkTimes"]["width"]=50
     
     self.grid.fields["attTimes"]["sortable"]=True
     self.grid.fields["attdays"]["sortable"]=True
示例#9
0
    def __init__(self, request):
        super(OrderAttReport, self).__init__()
        #设置sql
        from mosys.sql_utils import get_sql
        self.grid.sql = get_sql("attResult", "OrderAttReport")
        #设置 colum 属性
        self.grid.fields["name"]["width"] = 100
        self.grid.fields["badgenumber"]["width"] = 150
        self.grid.fields["DeptName"]["width"] = 100
        self.grid.fields["attdate"]["width"] = 80
        self.grid.fields["attTimes"]["width"] = 50
        self.grid.fields["attdays"]["width"] = 70
        self.grid.fields["overtimes"]["width"] = 50
        self.grid.fields["leaveimes"]["width"] = 50
        self.grid.fields["stopWorkTimes"]["width"] = 50

        self.grid.fields["attTimes"]["sortable"] = True
        self.grid.fields["attdays"]["sortable"] = True
示例#10
0
    def __init__(self, request):
        super(SumAttReport, self).__init__()
        #设置sql
        from mosys.sql_utils import get_sql
        self.grid.sql = get_sql("attResult", "SumAttReport")

        def fooRate(r):
            """
            出勤率
            """
            if int(r[5]) == 0:
                rate = "100%"
            else:
                rate = float(r[6]) / float(r[5])
                return u"<font color=red>%10.2f</font>" % rate
            return rate

        def fooName(r):
            """
            姓名转化
            """
            val = r[2]  #人员姓名对应sql语句中的第2列,如果sql语句中发生变化,请注意调整该处
            val_id = r[0]
            return '<a href="javascript:showDetail(%s);" title="">%s</a>' % (
                val_id, val)

        #设置 colum 属性
        self.grid.fields["name"]["width"] = 100
        self.grid.fields["badgenumber"]["width"] = 150
        self.grid.fields["DeptName"]["width"] = 100
        self.grid.fields["attTimes_sum"]["width"] = 80
        self.grid.fields["attDays_sum"]["width"] = 80
        self.grid.fields["overtimes_sum"]["width"] = 80
        self.grid.fields["leaveimes_sum"]["width"] = 80
        self.grid.fields["stopWorkTimes_sum"]["width"] = 80
        self.grid.fields["completionRate"]["width"] = 150

        self.grid.fields["attTimes_sum"]["sortable"] = True
        self.grid.fields["attDays_sum"]["sortable"] = True
        self.grid.colum_trans["completionRate"] = fooRate
        self.grid.colum_trans["name"] = fooName

        self.grid.fields["userid"]["hide"] = True
        self.grid.fields["DeptID"]["hide"] = True
示例#11
0
    def __init__(self, request):
        super(SumAttReport, self).__init__()
        #设置sql
        from mosys.sql_utils import  get_sql
        self.grid.sql = get_sql("attResult","SumAttReport")

        def fooRate(r,val):
            """
            出勤率
            """
            if int(r[5])==0:
                rate = "100%"
            else:
                rate = float(r[6])/float(r[5])
                return u"<font color=red>%10.2f</font>"%rate
            return rate    
            
        def fooName(r,val):
            """
            姓名转化
            """
            val_id = r[0]
            return '<a href="javascript:showDetail(%s);" title="">%s</a>'%(val_id,val)
        
        #设置 colum 属性
        self.grid.fields["name"]["width"]=100
        self.grid.fields["badgenumber"]["width"]=150
        self.grid.fields["DeptName"]["width"]=100
        self.grid.fields["attTimes_sum"]["width"]=80
        self.grid.fields["attDays_sum"]["width"]=80
        self.grid.fields["overtimes_sum"]["width"]=80
        self.grid.fields["leaveimes_sum"]["width"]=80
        self.grid.fields["stopWorkTimes_sum"]["width"]=80
        self.grid.fields["completionRate"]["width"]=150
        
        self.grid.fields["attTimes_sum"]["sortable"]=True
        self.grid.fields["attDays_sum"]["sortable"]=True
        self.grid.colum_trans["completionRate"] = fooRate
        self.grid.colum_trans["name"] = fooName
        
        self.SetHide("userid")
        self.SetHide("DeptID")