headers=self.headers
        #获取导入模版
        file_home = self.import_template
        log.info(file_home)
        
        wb = load_workbook(filename=file_home)
        ws = wb['sheet1']
        # 修改产废单位名称,以及备注
        ws['b3'] = 'itest产废单位'+self.dic["t"]
        ws['s3'] = 'i原料销售'+self.dic["t"]
        wb.save(file_home)

        url=self.url_1+"/companies/import?companyType=2"
        payload={}
        
        m=MultipartEncoder(
            fields={
                "parent_dir":'/',
                "name":'file',
                "filename":'name.xlsx',
                'file':('name.xlsx',open(file_home,'rb'),'application/vnd.ms-excel')
            }
        )
        headers['Content-Type']=m.content_type
        r=requests.post(url,headers=headers,data=m)

        log.info(r.json())

 

 

 

相关文章:

  • 2021-12-21
  • 2021-09-12
  • 2021-08-23
  • 2022-12-23
  • 2021-11-29
  • 2022-02-23
  • 2021-06-09
猜你喜欢
  • 2021-07-14
  • 2022-12-23
  • 2021-06-29
  • 2022-12-23
  • 2022-12-23
  • 2022-01-05
相关资源
相似解决方案