You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.5 KiB
43 lines
1.5 KiB
# -*- coding:utf-8 -*-
|
|
"""
|
|
@Created on : 2023/12/24 10:03
|
|
@Author: bzy
|
|
@Des:
|
|
"""
|
|
from helper.export.base import ReportExport
|
|
from helper.report import report_put_in_detail_drug
|
|
|
|
|
|
class ReportPutInDetail(ReportExport):
|
|
def __init__(self, request, keyword):
|
|
super().__init__()
|
|
self.title = "入库信息记录"
|
|
self.stateDict = {0: "待入库", 1: "在库", 2: "出库", 3: "空瓶", 4: "报废"}
|
|
self.request = request
|
|
self.keyword = keyword
|
|
|
|
async def parse_data(self, request, keyword):
|
|
keyword.page_no = 0
|
|
result = await report_put_in_detail_drug(request, keyword)
|
|
self.drug_attribute_key_list = result.get("attribute_key")
|
|
return result.get("data")
|
|
|
|
def parse_key_finds_list(self):
|
|
"""
|
|
解析键列名
|
|
:return:
|
|
"""
|
|
key_list = ["rfid", "cas_code", "batch_no", "manufacturer", "net_weight", "remain_gross_weight", "position", "expired_at", "storage_at", "storage_user", "state"]
|
|
finds_list = ["RFID", "CAS码", "批号", "生产厂家", "净重", "余量", "位置", "有效日期", "入库时间", "入库人", "当前状态"]
|
|
self.key_list = self.drug_attribute_key_list + key_list
|
|
self.finds_list = self.drug_attribute_key_list + finds_list
|
|
|
|
async def main(self):
|
|
"""
|
|
主函数
|
|
:param kwargs:
|
|
:return:
|
|
"""
|
|
self.data_list = await self.parse_data(self.request, self.keyword)
|
|
self.parse_key_finds_list()
|