コード例 #1
0
def materialstorage_makexlsx_all(request, page):
    datas, tempFilePath, fileName = get_post_data(request,
                                                  Materialstorage.objects)
    ids = [i for i in range(1, len(datas) + 1)]  #序号
    if convertxlsx(datas, tempFilePath, ids):
        return down_file(tempFilePath, fileName)
    return HttpResponseRedirect(r'/web/materialstorage/list/%s' % (page))
コード例 #2
0
def salesreport_makexlsx_page(request, page):
    datas, tempFilePath, fileName = get_post_data(request, Salesreport.objects)
    datas, pageList, num_pages, page = djangoPage(datas, page, PAGE_NUM)  #调用分页函数
    ids = [i+PAGE_NUM * (page - 1) for i in range(1,PAGE_NUM+1) ]  #序号
    if convertxlsx(datas, tempFilePath, ids):
        return down_file(tempFilePath, fileName)
    return HttpResponseRedirect(r'/web/materialreport/list/%s' % (page))
コード例 #3
0
def download(request):
    tpl_path = os.path.join(settings.BASE_DIR, 'web', 'files',\
                             'AnalysisReport.docx')
    tpl_path = TPL_FILE
    if not os.path.exists(tpl_path):
        meg = '%s 文件不存在。  ^o^' %tpl_path
        return render(request, 'bank/excel_import.html', context=locals())         
    return down_file(tpl_path, 'tpl_word.docx')
コード例 #4
0
def purchase_tpl(request):
    """下载采购模板"""
    tpl_path = os.path.join(settings.BASE_DIR, 'web', 'files', '批量导入采购模板.xlsx')
    return down_file(tpl_path, 'purchase_excel_tpl.xlsx')
コード例 #5
0
def user_tpl(request):
    """下载用户模板"""
    tpl_path = os.path.join(settings.BASE_DIR, 'web', 'files', '批量导入用户模板.xlsx')
    return down_file(tpl_path, 'user_excel_tpl.xlsx')
コード例 #6
0
def salesreport_tpl(request):
    """下载材料报表模板"""
    tpl_path = 'web/files/%s' % '批量导入产销存报表模板.xlsx' 
    return down_file(tpl_path, 'excel_tpl.xlsx')
コード例 #7
0
def materialstorage_tpl(request):
    """下载材料入库模板"""
    tpl_path = 'web/files/%s' % '批量导入材料入库模板.xlsx'
    return down_file(tpl_path, 'excel_tpl.xlsx')
コード例 #8
0
def receivable_tpl(request):
    """下载应收账款模板"""
    tpl_path = 'web/files/%s' % '批量导入应收账款模板.xlsx'
    return down_file(tpl_path, 'excel_tpl.xlsx')
コード例 #9
0
def copewith_tpl(request):
    """下载应付账款模板"""
    tpl_path = 'web/files/%s' % '批量导入应付账款模板.xlsx'
    return down_file(tpl_path, 'copewith_excel_tpl.xlsx')
コード例 #10
0
def delivery_tpl(request):
    """下载送货模板"""
    #tpl_path = os.path.join(settings.BASE_DIR, 'web', 'files', '批量导入送货模板.xlsx')
    tpl_path = 'web/files/%s' % '批量导入送货模板.xlsx'
    return down_file(tpl_path, 'delivery_excel_tpl.xlsx')
コード例 #11
0
def warehousing_makexlsx_all(request, page):
    datas, tempFilePath, fileName = get_post_data(request, Warehousing.objects)
    ids = [i for i in range(1, len(datas) + 1)]  #序号
    if convertxlsx(datas, tempFilePath, ids):
        return down_file(tempFilePath, fileName)
    return HttpResponseRedirect(r'/web/warehousing/list/%s' % (page))
コード例 #12
0
def warehousing_tpl(request):
    """下载成品入库模板"""
    tpl_path = 'web/files/%s' % '批量导入成品入库模板.xlsx'
    return down_file(tpl_path, 'excel_tpl.xlsx')
コード例 #13
0
def picking_tpl(request):
    """下载材料报表模板"""
    tpl_path = 'web/files/%s' % '批量导入领料汇总模板.xlsx'
    return down_file(tpl_path, 'excel_tpl.xlsx')