from rest_framework_csv.renderers import CSVStreamingRenderer def file_headers_list(): return [ 'document_date', 'document_number', 'document_type', 'business_type', 'iout_type', 'department', 'warehouse_name', 'goods_code', 'goods_desc', 'goods_std', 'goods_batch', 'in_batch', 'out_batch', 'goods_in', 'goods_out', 'goods_notes', 'creator' ] def cn_data_header_list(): return dict([ ('document_date', '单据日期'), ('document_number', '单据编号'), ('document_type', '单据类型'), ('business_type', '业务类型'), ('iout_type', '出入库类型'), ('department', '部门'), ('warehouse_code', '仓库编码'), ('warehouse_name', '仓库名称'), ('goods_code', '商品编码'), ('goods_desc', '商品描述'), ('goods_std', '商品标准'), ('goods_batch', '商品批次'), ('in_batch', '入库批次'), ('out_batch', '出库批次'), ('goods_in', '入库数量'), ('goods_out', '出库数量'), ('goods_notes', '备注'), ('creator', '创建人') ]) class FileFlowListRenderCN(CSVStreamingRenderer): header = file_headers_list() labels = cn_data_header_list() def BatchList_file_headers_list(): return [ 'id', 'bound_number', 'sourced_number', 'bound_batch_order', 'warehouse_name', 'goods_code', 'goods_desc', 'goods_std', 'goods_unit', 'goods_qty', 'goods_package', 'goods_in_qty', 'goods_in_location_qty', 'goods_out_qty', 'container_number', 'check_status' ] def BatchList_cn_data_header_list(): return dict([ ('id', '序号'), ('bound_number', '入库批次号'), ('goods_qty', '商品数量'), ('goods_in_qty', '组盘入库数量'), ('goods_in_location_qty', '当前在库数目'), ('goods_out_qty', '出库数量'), ('sourced_number', 'ERP下发批次号'), ('bound_batch_order', '批次顺序'), ('warehouse_name', '仓库名称'), ('goods_code', '商品编码'), ('goods_desc', '商品描述'), ('goods_std', '商品标准'), ('goods_unit', '商品单位'), ('goods_package', '商品包装'), ('container_number', '托盘数目'), ('check_status', '质检状态') ]) class FileBatchListRenderCN(CSVStreamingRenderer): header = BatchList_file_headers_list() labels = BatchList_cn_data_header_list() def MaterialChangeHistory_file_headers_list(): return [ 'id', 'batch_log', 'goods_code', 'goods_desc', 'goods_std', 'goods_unit', 'change_time', 'in_quantity', 'out_quantity', 'change_type', 'opening_quantity', 'closing_quantity' ] def MaterialChangeHistory_cn_data_header_list(): return dict([ ('id', '序号'), ('batch_log', '批次日志'), ('goods_code', '货品编码'), ('goods_desc', '货品描述'), ('goods_std', '货品规格'), ('goods_unit', '货品单位'), ('change_time', '变动时间'), ('in_quantity', '入库数量'), ('out_quantity', '出库数量'), ('change_type', '变动类型'), ('opening_quantity', '期初数量'), ('closing_quantity', '期末数量') ]) class MaterialChangeHistoryRenderCN(CSVStreamingRenderer): header = MaterialChangeHistory_file_headers_list() labels = MaterialChangeHistory_cn_data_header_list() def batchLog_file_headers_list(): return [ 'id', 'log_type', 'batch_code', 'goods_code', 'goods_desc', 'goods_std', 'goods_in_qty', 'goods_out_qty', 'goods_unit', 'check_status', 'create_time', 'detail_logs', ] def batchLog_cn_data_header_list(): return dict([ ('id', '序号'), ('bound', '绑定'), ('batch', '批次'), ('log_type', '日志类型'), ('goods_code', '货品编码'), ('goods_desc', '货品描述'), ('goods_std', '货品规格'), ('goods_unit', '货品单位'), ('goods_in_qty', '新入数量'), ('goods_out_qty', '新出数量'), ('detail_logs', '托盘日志'), ('create_time', '创建时间'), ('check_status', '质检状态(0:未质检,1:已质检,2:质检不合格)') ]) class batchLogRenderCN(CSVStreamingRenderer): header = batchLog_file_headers_list() labels = batchLog_cn_data_header_list() def ContainerDetailLog_file_headers_list(): return [ 'id', 'batch', 'container_code', 'goods_code', 'goods_desc', 'detail_goods_qty', 'goods_qty', 'goods_out_qty', 'batch_goods_qty', 'batch_goods_in_qty', 'batch_goods_in_location_qty', 'batch_goods_out_qty', 'create_time', 'log_type', 'old_goods_qty', 'old_goods_out_qty', 'old_status', 'new_goods_qty', 'new_goods_out_qty', 'new_status', 'creater', 'tobatchlog', 'container_detail' ] def ContainerDetailLog_cn_data_header_list(): return dict([ ('id', '序号'), ('batch', '批次'), ('container_code', '托盘编码'), ('goods_code', '货品编码'), ('goods_desc', '货品描述'), ('detail_goods_qty', '托盘货品数量'), ('goods_qty', '货品数量'), ('goods_out_qty', '出库数量'), ('batch_goods_qty', '批次货品数量'), ('batch_goods_in_qty', '批次入库数量'), ('batch_goods_in_location_qty', '批次入库库位数量'), ('batch_goods_out_qty', '批次出库数量'), ('create_time', '创建时间'), ('log_type', '日志类型'), ('old_goods_qty', '原数量'), ('old_goods_out_qty', '原出库数量'), ('old_status', '原状态'), ('new_goods_qty', '新数量'), ('new_goods_out_qty', '新出库数量'), ('new_status', '新状态'), ('creater', '操作人'), ('tobatchlog', '是否转移到批次日志'), ('container_detail', '托盘明细') ]) class ContainerDetailLogRenderCN(CSVStreamingRenderer): header = ContainerDetailLog_file_headers_list() labels = ContainerDetailLog_cn_data_header_list()