Example #1
0
 def GET(self):
     users_id=str(auth.get_users_id()[0]['users_id'])
     if users_id:
         try:
             org_id=str(org_users.get_org_by_users(users_id)[0]['org_id'])
             return json.dumps(org_users.get_users_by_org(org_id))
         except:
             return sr.show_result_fail()
     else:
         return sr.show_result_fail()
Example #2
0
    def GET(self):
        try:
            params=web.input()
            product_type=params.product_type
            page=params.page if hasattr(params, 'page') else 1
            per_page=params.per_page if hasattr(params, 'per_page') else 10

            result= product.get_product_by_type_with_page(product_type,page_num=page,per_page=per_page)

            if result:
                return json.dumps(result,
                        cls=encoder.DateEncoder,ensure_ascii=False)
            else:
                return sr.show_result_fail()
        except:
            return sr.show_result_fail()+traceback.print_exc()
Example #3
0
    def GET(self):
        try:
            params=web.input()
            page=params.page if hasattr(params, 'page') else 1
            per_page=params.per_page if hasattr(params, 'per_page') else 10

            return json.dumps(customer.get_customer_list_paged(page_num=page,per_page=per_page),
                              cls=encoder.DateEncoder,ensure_ascii=False)
        except:
            return sr.show_result_fail()+traceback.print_exc()
Example #4
0
    def GET(self):
        try:
            params=web.input()
            page=params.page if hasattr(params, 'page') else 1
            perpage = 10
            offset = (int(page) - 1) * perpage

            return json.dumps(operating_range.get_operating_range_list_paged(offset,perpage),ensure_ascii=False)
        except:
            return sr.show_result_fail()
Example #5
0
    def GET(self):
        try:
            params=web.input()
            page=params.page if hasattr(params, 'page') else 1
            perpage = 10
            offset = (int(page) - 1) * perpage

            return json.dumps(orgnization.get_orgnization_list_paged(offset,perpage),ensure_ascii=False)
        except:
            return sr.show_result_fail()+traceback.print_exc()
    def GET(self):
        try:
            params=web.input()
            credit_type=params.credit_type
            page=params.page if hasattr(params, 'page') else 1
            perpage = params.perpage if hasattr(params, 'perpage') else 10

            return json.dumps(credit_manage.get_credit_manage_list_paged(credit_type,page,perpage),
                              cls=encoder.DateEncoder,ensure_ascii=False)
        except:
            return sr.show_result_fail()
Example #7
0
 def GET(self):
     try:
         params=web.input()
         page=params.page if hasattr(params, 'page') else 1
         perpage = 10
         offset = (int(page) - 1) * perpage
         
         return json.dumps(saler_target.get_saler_target_list_paged(offset,perpage)
                             ,cls=encoder.DateEncoder,ensure_ascii=False)
     except:
         return sr.show_result_fail()
Example #8
0
    def GET(self):
        try:
            params=web.input()
            credit_type=params.credit_type
            page=params.page if hasattr(params, 'page') else 1
            perpage = params.perpage if hasattr(params, 'perpage') else 10

            return json.dumps(credit_manage.get_credit_manage_list_paged(credit_type,page,perpage),
                              cls=encoder.DateEncoder,ensure_ascii=False)
        except:
            return sr.show_result_fail()
Example #9
0
    def GET(self):
        try:
            params=web.input()
            page=params.page if hasattr(params, 'page') else 1
            perpage =params.perpage if hasattr(params, 'perpage') else 10
            customer_number=params.customer_number
            users_id=params.users_id
            company_name=params.company_name

            return json.dumps(customer_users.get_customer_users_list_paged(page,perpage,users_id,customer_number,company_name)
                ,cls=encoder.DateEncoder,ensure_ascii=False)
        except:
            return sr.show_result_fail()+traceback.print_exc()
Example #10
0
    def POST(self):
        params=web.input()
        try:
            type=params.type
            saler_manager=int(params.saler_manager)
            customer_number=str(params.customer_number)
            credit_type=int(params.credit_type)
            beg_date=str(params.beg_date)
            end_date=str(params.end_date)
            page_num=params.page if hasattr(params, 'page') else 1
            per_page =params.per_page if hasattr(params, 'per_page') else 10



            if type=='1':
                credit=models.credit()
                result=credit.get_credit_list_query_paged(page_num,per_page,saler_manager,
                                                          customer_number,credit_type,
                                                          beg_date,end_date)
                return dm.download_report(1,result)
            elif type=='2':
                credit_grant=models.credit_grant()
                result=credit_grant.get_credit_grant_list_query_paged(page_num,per_page,saler_manager,
                                                                      customer_number,credit_type,
                                                                      beg_date,end_date)

                return dm.download_report(2,result)
            elif type=='3':
                credit_manage=models.credit_manage()
                result=credit_manage.get_credit_manage_list_query_paged(page_num,per_page,saler_manager,
                                                                        customer_number,credit_type,
                                                                        beg_date,end_date)

                return dm.download_report(3,result)
            elif type=='4':
                saler_target=saler.saler_target
                result=saler_target.get_saler_target_list_by_condition(self,page_num,per_page,saler_manager,beg_date,end_date)
                return dm.download_report(4,result)


        except:
            return sr.show_result_fail()+traceback.print_exc()
Example #11
0
    def GET(self):
        params=web.input()
        try:
            type=params.type
            saler_manager=int(params.saler_manager)
            customer_number=str(params.customer_number)
            credit_type=int(params.credit_type)
            beg_date=str(params.beg_date)
            end_date=str(params.end_date)
            page_num=params.page if hasattr(params, 'page') else 1
            per_page =params.per_page if hasattr(params, 'per_page') else 10



            if type=='1':
                credit=models.credit()
                result=credit.get_credit_list_query_paged(page_num,per_page,saler_manager,
                                                          customer_number,credit_type,
                                                          beg_date,end_date)
                return json.dumps(result,cls=encoder.DateEncoder,ensure_ascii=False)
            elif type=='2':
                credit_grant=models.credit_grant()
                result=credit_grant.get_credit_grant_list_query_paged(page_num,per_page,saler_manager,
                                                          customer_number,credit_type,
                                                          beg_date,end_date)

                return json.dumps(result,cls=encoder.DateEncoder,ensure_ascii=False)
            elif type=='3':
                credit_manage=models.credit_manage()
                result=credit_manage.get_credit_manage_list_query_paged(page_num,per_page,saler_manager,
                                                                      customer_number,credit_type,
                                                                      beg_date,end_date)

                return json.dumps(result,cls=encoder.DateEncoder,ensure_ascii=False)
            elif type=='4':
                saler_target=saler.saler_target
                result=saler_target.get_saler_target_list_by_condition(self,page_num,per_page,saler_manager,beg_date,end_date)
                return json.dumps(result,cls=encoder.DateEncoder,ensure_ascii=False)


        except:
            return sr.show_result_fail()+traceback.print_exc()