Exemple #1
0
    def deny_approval(self):
        self.current_case = 'case 1'
        _login = login.Login()
        _login.login(self.userinfo_super['username'], self.userinfo_super['password'], self.userinfo_super['role'])
        self.cookie = _login.cookie
        self.csrf = _login.csrf
        _CustomersApproval = CustomersApproval.ApprovalSettings(self.cookie, self.csrf)
        _CustomersApproval.open_approval()
        # a =0
        customer_id = ''
        dict = {}
        list = []
        for userinfo in self.userinfo_list:
            print(userinfo['username'])
            _login.login(userinfo['username'], userinfo['password'], userinfo['role'])
            self.cookie = _login.cookie
            self.csrf = _login.csrf
            _AddCustomer = AddCustomer.AddCustomer(self.cookie, self.csrf)
            # 8个用户新增一条关闭审批的客户
            ##添加 审批通过后驳回
            customer_id = _AddCustomer.add_customers(approve_status='applying', DepartmentId=0)
            _CustomersApproval.approve_verify(customer_id)
            # 审批被驳回
            _CustomersApproval.deny_approval(customer_id)
            dict.update({userinfo['username']: customer_id})
            list.append(customer_id)
            print(list)
        a = list
        # a = [1233194, 1233195, 1233196, 1233197, 1233198, 1233199, 1233200, 1233201]

        b = 1
        for userinfo in self.userinfo_list:
            print(userinfo['username'])
            _login.login(userinfo['username'], userinfo['password'], userinfo['role'])
            self.cookie = _login.cookie
            self.csrf = _login.csrf
            _UpdateCustomer = UpdateCustomer.UpdateCustomer(self.cookie, self.csrf)
            for i in range(b):
                for j in range(6):
                    _UpdateCustomer.add_customer_revisit_log(a[b - 1 - i], date_list=self.date_list[j],data='审批驳回')
            b = b + 1
Exemple #2
0
    def approvaled(self):
        self.current_case = 'case 1'
        _login = login.Login()
        _login.login(self.userinfo_super['username'], self.userinfo_super['password'], self.userinfo_super['role'])
        self.cookie =_login.cookie
        self.csrf = _login.csrf
        _CustomersApproval = CustomersApproval.ApprovalSettings(self.cookie,self.csrf)
        _CustomersApproval.close_approval()
        dict={}
        list=[]
        for userinfo in self.userinfo_list:
            print (userinfo['username'])
            _login.login(userinfo['username'], userinfo['password'], userinfo['role'])
            self.cookie =_login.cookie
            self.csrf = _login.csrf
            _AddCustomer = AddCustomer.AddCustomer(self.cookie, self.csrf)
            # 8个用户新增一条关闭审批的客户
            ## 添加
            customer_id =_AddCustomer.add_customers()
            dict.update({userinfo['username']: customer_id})
            list.append(customer_id)
            print(list)
        a=list
        # a = [1233194, 1233195, 1233196, 1233197, 1233198, 1233199, 1233200, 1233201]

        b = 1
        for userinfo in self.userinfo_list:
            print(userinfo['username'])
            _login.login(userinfo['username'], userinfo['password'], userinfo['role'])
            self.cookie = _login.cookie
            self.csrf = _login.csrf
            _UpdateCustomer = UpdateCustomer.UpdateCustomer(self.cookie, self.csrf,self.token)
            for i in range(b):
                for j in range(6):
                    _UpdateCustomer.add_customer_revisit_log(a[b - 1 - i], date_list=self.date_list[j],data='关闭审批')

            b = b + 1