Example #1
0
    def __init__(self, autoid, lrid=0, parent=None):
        super(EditStuffCheckInModule, self).__init__(parent)
        self.ori_detail = dict()
        self.detail = {
            'content': decimal.Decimal('-1'),
            'cunit': '%',
            'water': decimal.Decimal('-1'),
            'rdensity': decimal.Decimal('-1'),
            'impurity': decimal.Decimal('-1'),
            'position': ''
        }
        self.new_detail = dict()
        self.LC = LabrecordsController()
        self.WC = WarehouseController()
        self.SFC = StuffController()
        self.setupUi(self)

        self.autoid = autoid
        self.lrid = lrid

        self.get_detail()
        if lrid != 0:
            self.set_putin_parameter()
        self.set_validator()
        self.get_location_list()
        if len(self.ori_detail):
            self.set_content_unit()
    def __init__(self, kind, parent=None):
        super(DaliyRecordsList, self).__init__(parent)
        self.setupUi(self)
        if kind == 0:
            index = '51'
        elif kind == 1:
            index = '52'
        elif kind == 2:
            index = '13'
        else:
            index = '-1'
        if index not in user.powers:
            self.close()
        if user.powers[index] == 0:
            self.close()
        self.power = '{:03b}'.format(user.powers[index])
        self.kind = kind
        self.LC = LabrecordsController()
        self.stuffid = ''
        self.kindname = ''
        self.status = tuple()
        self.treeWidget_kindname.hideColumn(1)
        self.treeWidget_reportlist.hideColumn(0)

        self.get_location_list()
 def __init__(self, parent=None):
     super(SelectProdictionListModule, self).__init__(parent)
     self.setupUi(self)
     # 用于显示不用的批记录,0为没有找到留样记录的批记录,1为全部批记录
     self.type = 0
     self.PC = ProductController()
     self.LC = LabrecordsController()
     self.get_detail()
Example #4
0
    def __init__(self, chkid, batchno, parent=None):
        super(FindCheckReportModule, self).__init__(parent)
        self.setupUi(self)
        self.chkid = chkid
        self.batchno = batchno
        self.LC = LabrecordsController()

        self.get_report_list()
Example #5
0
    def __init__(self, autoid, is_view=False, parent=None):
        super(CheckreportModule, self).__init__(parent)
        self.setupUi(self)
        if is_view:
            self.power = '000'
        else:
            if '8' not in user.powers:
                self.close()
            if user.powers['8'] == 0:
                self.close()
            self.power = '{:03b}'.format(user.powers['8'])

        if self.power[1] == '0':
            self.pushButton_save.setVisible(False)
            self.pushButton_accept.setVisible(False)
            self.pushButton_add_oripaper.setVisible(False)
        if self.power[2] == '0':
            self.pushButton_print.setVisible(False)
        self.is_view = is_view
        self.autoid = autoid
        self.ori_detail = dict()
        self.new_detail = dict()
        self.ori_checkitem = []
        self.new_checkitem = []
        self.images_list = []
        self.current_img = object
        self.current_page = object
        self.LC = LabrecordsController()
        self.SC = StuffController()
        self.PC = ProductController()
        # 自动缩放
        self.label_image.setScaledContents(True)

        # 获取当前报告的信息
        has_find_report = self.get_report_detail(self.autoid)
        # 获取检验项目
        self.get_checkitem()
        if has_find_report:
            # 获取检验依据的下拉项目
            self.get_combobox_items(self.comboBox_checkgist,
                                    'checkgist',
                                    chkid=self.ori_detail['chkid'])
            # 获取结论的下拉项目
            self.get_combobox_items(self.comboBox_result,
                                    'result',
                                    chkid=self.ori_detail['chkid'])

        # 获取图片
        self.get_images(autoid)
        # 获取原始检验记录
        self.get_oricheckpaper(autoid)
        # 检验项目的右键菜单功能
        if len(self.ori_detail):
            if self.ori_detail['paperno'] == '':
                self.get_paperno()
            self.new_paperstatus = self.ori_detail['paperstatus']
            # 根据签名情况确定是否允许修改签名
            self.set_paperstatus()
 def __init__(self, dictid, itemtype, parent=None):
     super(SelectoricheckpaperModule, self).__init__(parent)
     self.detail = []
     self.LC = LabrecordsController()
     self.setupUi(self)
     self.treeWidget_filelist.hideColumn(0)
     self.treeWidget_filelist.hideColumn(1)
     # 或取当前检品的检验报告列表
     self.get_oricheckpaper(dictid, itemtype)
 def __init__(self, kind, parent=None):
     super(SelectRecordsModule, self).__init__(parent)
     self.kind = kind
     self.detail = []
     self.PC = ProductController()
     self.LC = LabrecordsController()
     self.setupUi(self)
     self.treeWidget_filelist.hideColumn(1)
     # 或取记录
     self.get_generalrecords()
Example #8
0
 def __init__(self, opid, parent=None):
     super(SelectOriCheckPaperEquipmentModule, self).__init__(parent)
     self.setupUi(self)
     self.opid = opid
     self.LC = LabrecordsController()
     self.EC = EquipmentController()
     self.get_detail()
     self.get_equipments()
     self.treeWidget_useeq.hideColumn(0)
     self.treeWidget_eqlist.hideColumn(2)
    def __init__(self, autoid, parent=None):
        super(EditcheckitemModule, self).__init__(parent)
        self.autoid = autoid
        self.ori_detail = dict()
        self.new_detail = dict()
        self.LC = LabrecordsController()
        self.setupUi(self)

        # 获取检验项目内容
        self.get_checkitemdetail()
Example #10
0
 def get_sys_vars(self, kind=0):
     if self.autoid != 0:
         try:
             if kind == 0:
                 pm = ProductController()
                 vlist = ('prodid', 'prodname', 'commonname', 'batchno',
                          'spec', 'package', 'medkind', 'planamount',
                          'mpunit', 'plantime', 'realamount', 'makedate',
                          'linename', 'workshopid', 'workshopname')
                 self.proddetail = pm.get_producingplan(
                     *vlist, autoid=self.autoid)[0]
             elif kind == 1:
                 sm = StuffController()
                 self.stuffdetail = sm.get_prodstuff(ppid=self.autoid)
                 for item in self.stuffdetail:
                     stufftype = item.stufftype
                     if stufftype == 0:
                         self.stuffdetailZC.append(item)
                         self.stuffdetailZF.append(item)
                     elif stufftype == 1:
                         self.stuffdetailFC.append(item)
                         self.stuffdetailZF.append(item)
                     elif stufftype == 2:
                         self.stuffdetailNB.append(item)
                         self.stuffdetailBC.append(item)
                     elif stufftype == 3:
                         self.stuffdetailWB.append(item)
                         self.stuffdetailBC.append(item)
                     elif stufftype == 4:
                         self.stuffdetailQC.append(item)
             elif kind == 2:
                 sm = StuffController()
                 self.mstuffdetail = sm.get_Mprodstuff(self.autoid)
                 for item in self.mstuffdetail:
                     stufftype = item.stufftype
                     if stufftype == 0:
                         self.stuffdetailMZC.append(item)
                         self.stuffdetailMZF.append(item)
                     elif stufftype == 1:
                         self.stuffdetailMFC.append(item)
                         self.stuffdetailMZF.append(item)
                     elif stufftype == 2:
                         self.stuffdetailMNB.append(item)
                         self.stuffdetailMBC.append(item)
                     elif stufftype == 3:
                         self.stuffdetailMWB.append(item)
                         self.stuffdetailMBC.append(item)
                     elif stufftype == 4:
                         self.stuffdetailMQC.append(item)
             elif kind == 3:
                 lm = LabrecordsController()
                 self.labdetail = lm.get_labrecord(self.autoid)[0]
         except:
             # traceback.print_exc()
             SaveExcept("获取系统变量出错", self.get_content(), kind)
Example #11
0
 def __init__(self, parent=None):
     super(SampleRecordsListModule, self).__init__(parent)
     self.setupUi(self)
     if '50' not in user.powers:
         self.close()
     if user.powers['10'] == 0:
         self.close()
     self.power = '{:03b}'.format(user.powers['10'])
     self.status = 0
     self.kind = 0
     self.LC = LabrecordsController()
     self.get_detail()
Example #12
0
    def __init__(self, autoid=None, srid=None, unit='', parent=None):
        super(EditObservationModule, self).__init__(parent)
        self.setupUi(self)
        self.autoid = autoid
        self.srid = srid
        self.unit = unit
        self.ori_detail = {}
        self.new_detail = {}
        self.LC = LabrecordsController()

        self.get_detail()

        self.set_validator()
Example #13
0
 def get_sys_vars(self, kind=0):
     if self.autoid != 0:
         try:
             if kind == 0:
                 pm = ProductController()
                 self.proddetail = pm.get_producingplan(
                     autoid=self.autoid)[0]
             elif kind == 1:
                 sm = StuffController()
                 self.stuffdetail = sm.get_prodstuff(self.autoid)
                 for item in self.stuffdetail:
                     stufftype = item.stufftype
                     if stufftype == 0:
                         self.stuffdetailZC.append(item)
                         self.stuffdetailZF.append(item)
                     elif stufftype == 1:
                         self.stuffdetailFC.append(item)
                         self.stuffdetailZF.append(item)
                     elif stufftype == 2:
                         self.stuffdetailNB.append(item)
                         self.stuffdetailBC.append(item)
                     elif stufftype == 3:
                         self.stuffdetailWB.append(item)
                         self.stuffdetailBC.append(item)
                     elif stufftype == 4:
                         self.stuffdetailQC.append(item)
             elif kind == 2:
                 sm = StuffController()
                 self.mstuffdetail = sm.get_Mprodstuff(self.autoid)
                 for item in self.mstuffdetail:
                     stufftype = item.stufftype
                     if stufftype == 0:
                         self.stuffdetailMZC.append(item)
                         self.stuffdetailMZF.append(item)
                     elif stufftype == 1:
                         self.stuffdetailMFC.append(item)
                         self.stuffdetailMZF.append(item)
                     elif stufftype == 2:
                         self.stuffdetailMNB.append(item)
                         self.stuffdetailMBC.append(item)
                     elif stufftype == 3:
                         self.stuffdetailMWB.append(item)
                         self.stuffdetailMBC.append(item)
                     elif stufftype == 4:
                         self.stuffdetailMQC.append(item)
             elif kind == 3:
                 lm = LabrecordsController()
                 self.labdetail = lm.get_labrecord(1, autoid=self.autoid)[0]
         except:
             # traceback.print_exc()
             pass
    def __init__(self, parent=None):
        super(PreProdputinlistModule, self).__init__(parent)
        self.setupUi(self)
        if '36' not in user.powers:
            self.close()
        if user.powers['36'] == 0:
            self.close()
        self.power = '{:03b}'.format(user.powers['36'])

        self.PC = ProductController()
        self.WC = WorkshopController()
        self.LC = LabrecordsController()
        # 获取当前状态的批生产记录
        self.get_proddetail()
    def __init__(self, parent=None):
        super(StuffRepositoryModule, self).__init__(parent)
        self.setupUi(self)

        if '41' not in user.powers:
            self.close()
        if user.powers['41'] == 0:
            self.close()
        self.power = '{:03b}'.format(user.powers['41'])

        self.WC = WarehouseController()
        self.CI = CheckItem()
        self.LC = LabrecordsController()
        self.SFC = StuffController()
        self.current_button = self.radioButton_batchno
        self.get_stuff_list()
Example #16
0
    def __init__(self, parent=None):
        super(DaliyRecordsetting, self).__init__(parent)
        self.setupUi(self)
        # if '8' not in user.powers:
        #     self.close()
        # if user.powers['16'] == 0:
        #     self.close()
        # self.power = '{:03b}'.format(user.powers['16'])
        self.LC = LabrecordsController()

        # self.treeWidget_kindname.hideColumn(1)
        # self.treeWidget_reportlist.hideColumn(0)
        self.kind = 1
        self.kind_id = 0
        self.dictid = 0
        self.get_location_list()
Example #17
0
    def __init__(self, parent=None):
        super().__init__(parent)
        self.setupUi(self)
        if '8' not in user.powers:
            self.close()
        if user.powers['8'] == 0:
            self.close()
        self.power = '{:03b}'.format(user.powers['8'])

        # 数据库操作类
        self.LC = LabrecordsController()
        self.detail = ''

        # 显示物料列表
        self.show_records_list()
        # 添加右键菜单功能
        self.__add_menu()
Example #18
0
    def __init__(self, autoid, parent=None):
        super(SamplingModule, self).__init__(parent)
        self.autoid = autoid
        self.LC = LabrecordsController()
        self.ori_detail = dict()
        self.new_detail = dict()

        self.ori_labitemstate = []
        self.new_labitemstate = []

        self.setupUi(self)

        # 获取当前取样单的信息
        self.get_records()
        # 获取检验项目
        self.get_labrecord_item()
        # 设置样品数量校验器
        self.set_sampleamount_valitor()
class SelectRecordsModule(QDialog, Ui_Dialog):
    selected = pyqtSignal(int, list)

    def __init__(self, kind, parent=None):
        super(SelectRecordsModule, self).__init__(parent)
        self.kind = kind
        self.detail = []
        self.PC = ProductController()
        self.LC = LabrecordsController()
        self.setupUi(self)
        self.treeWidget_filelist.hideColumn(1)
        # 或取记录
        self.get_generalrecords()

    def get_generalrecords(self):
        if self.kind == 0:
            res = self.PC.get_data(3, False, *VALUES_TUPLE_PP)
            for item in res:
                qtreeitem = QTreeWidgetItem(self.treeWidget_filelist)
                qtreeitem.setText(0, str(item['autoid']))
                qtreeitem.setText(1, item['prodid'])
                qtreeitem.setText(2, item['prodname'])
                qtreeitem.setText(3, item['batchno'])
                qtreeitem.setText(4, item['spec'])
                qtreeitem.setText(5, item['package'])
        else:
            res = self.LC.get_data(0, False, *VALUES_TUPLE_LR)
            for item in res:
                qtreeitem = QTreeWidgetItem(self.treeWidget_filelist)
                qtreeitem.setText(0, str(item['autoid']))
                qtreeitem.setText(1, item['chkid'])
                qtreeitem.setText(2, item['chkname'])
                qtreeitem.setText(3, item['batchno'])
                qtreeitem.setText(4, item['spec'])
                qtreeitem.setText(5, item['package'])
        for i in range(1, 6):
            self.treeWidget_filelist.resizeColumnToContents(i)

    @pyqtSlot(QTreeWidgetItem, int)
    def on_treeWidget_filelist_itemDoubleClicked(self, qitem, p_int):
        self.selected.emit(self.kind, [int(qitem.text(0)),])
        self.accept()

    @pyqtSlot()
    def on_pushButton_accept_clicked(self):
        items = self.treeWidget_filelist.selectedItems()
        select_list = []
        for item in items:
            select_list.append(int(item.text(0)))
        if len(select_list):
            self.selected.emit(self.kind, select_list)
        self.accept()

    @pyqtSlot()
    def on_pushButton_cancel_clicked(self):
        self.close()
Example #20
0
    def __init__(self, autoid, labtpye=None, parent=None):
        # autoid :labrecords里的autoid
        super(ApplycheckModule, self).__init__(parent)
        self.setupUi(self)
        self.autoid = autoid
        self.labtype = labtpye
        # 请验单内容
        self.ori_detail = dict()
        self.new_detail = dict()
        self.ori_labitemstate = []
        self.new_labitemstate = []
        self.LC = LabrecordsController()

        # 获取请验单的状态
        self.get_labreord_detail()
        # 获取来源的下拉内容
        self.get_applysourcelist()
        # 获取检验项目
        self.get_labrecord_item()
    def __init__(self, autoid, is_view, parent=None):
        super(OricheckpaperModule, self).__init__(parent)

        self.setupUi(self)
        self.is_view = is_view
        if is_view:
            self.pushButton_accept.setVisible(False)
            self.pushButton_cancel.setVisible(False)
            self.pushButton_delete.setVisible(False)
        self.ori_detail = dict()
        self.autoid = autoid
        self.LC = LabrecordsController()
        self.current_content = object
        # 获取记录内容
        self.get_oricheckpaper()
        # 获取设备运行记录
        self.get_equiprunnote()
        self.treeWidget_equipment.setContextMenuPolicy(3)
        self.treeWidget_equipment.customContextMenuRequested.connect(
            self.eqrun_menu)
    def __init__(self, parent=None):
        super(PurchaseRegistrationModule, self).__init__(parent)
        self.setupUi(self)
        if '28' not in user.powers:
            self.close()
        if user.powers['28'] == 0:
            self.close()
        self.power = '{:03b}'.format(user.powers['28'])

        self.WC = WarehouseController()
        self.LC = LabrecordsController()
        self.SC = SupplyerController()
        self.SFC = StuffController()
        self.CI = CheckItem()
        self.groupBox.setVisible(False)
        self.spid = 0
        self.paperno = ''
        self.supid = ''
        self.supname = ''

        self.get_order_list()
    def __init__(self, autoid: int = 0, ppid: int = 0, parent=None):
        super(PreProdPutInModule, self).__init__(parent)
        self.setupUi(self)
        self.ppid = ppid
        self.autoid = autoid
        self.content = decimal.Decimal('-1')
        self.water = decimal.Decimal('-1')
        self.rdensity = decimal.Decimal('-1')
        self.impurity = decimal.Decimal('-1')
        self.lrid = 0
        self.checkdate = user.now_date
        # self.units = set()
        self.unit = ''
        self.cunit = '%'
        self.expireddays = 730
        self.countercheckdays = 365
        self.WC = WorkshopController()
        self.LC = LabrecordsController()
        self.PC = ProductController()
        self.SC = StuffController()
        self.product_detail = dict()
        self.ori_detail = dict()
        self.new_detail = dict()

        # 把autoid和ppid补全
        self.get_autoid_or_ppid()
        # 获取入库位置的下拉选项
        self.get_postiton()

        # 整箱数量的校验器
        self.set_valitor(self.lineEdit_amount, 0)
        # 获取产品信息
        self.get_productdetail()
        # 设置含量单位、复检日期、有效期等参数
        self.basicdetail()

        # 获取报告书的状态和编号
        self.get_labdetail()
        # 获取入库信息
        self.get_putinnote()
    def __init__(self, autoid=None, kind=0, chkid='', source='', parent=None):
        # autoid :labrecords里的autoid
        super(ApplyDaliycheckModule, self).__init__(parent)
        self.setupUi(self)
        self.autoid = autoid
        self.kind = kind
        self.chkid = chkid
        self.source = source
        # 请验单内容
        self.ori_detail = dict()
        self.new_detail = dict()
        self.ori_labitemstate = []
        self.new_labitemstate = []
        self.treeWidget_labitem.hideColumn(0)
        self.LC = LabrecordsController()

        # 获取请验单的状态
        self.get_labreord_detail()
        # 获取来源的下拉内容
        self.get_applysourcelist()
        # 获取检验项目
        self.get_labrecord_item()
    def __init__(self, autoid, parent=None):
        super(EditSampleRecordDetailModule, self).__init__(parent)
        self.setupUi(self)
        if '50' not in user.powers:
            self.close()
        if user.powers['10'] == 0:
            self.close()
        self.power = '{:03b}'.format(user.powers['10'])
        if self.power[1] == '0':
            self.pushButton_accept.setVisible(False)
            self.pushButton_cancel.setVisible(False)
        self.autoid = autoid
        self.checkitem_id = None
        self.ori_detail = object
        self.new_detail = {}
        self.lr_list = []
        self.LC = LabrecordsController()
        self.PC = ProductController()

        self.get_detail()
        self.get_observation_record()
        self.get_labrecord_list()
 def __init__(self, autoid:int=0, ppid: int=0, parent=None):
     super(ProductputinModule, self).__init__(parent)
     self.setupUi(self)
     self.ppid = ppid
     self.autoid = autoid
     self.bpamount = decimal.Decimal('0')
     self.mpamount = decimal.Decimal('0')
     self.spamount = decimal.Decimal('0')
     self.a_box_samount = decimal.Decimal('0')
     self.oddments_list = []
     self.units = set()
     self.WC = WorkshopController()
     self.LC = LabrecordsController()
     self.PC = ProductController()
     self.product_detail = dict()
     self.ori_detail = dict()
     self.new_detail = dict()
     if not self.ppid and not self.autoid:
         return
     # 把autoid和ppid补全
     self.get_autoid_or_ppid()
     # 获取产品信息
     self.get_productdetail()
     # 设置比例、一箱数量等参数
     self.basicdetail()
     # 获取寄库和入库位置的下拉选项
     self.get_postiton()
     # 获取报告书的状态和编号
     self.get_labdetail()
     # 获取入库信息
     self.get_putinnote()
     # 获取零头领取信息
     self.get_oddment()
     # 整箱数量的校验器
     self.set_valitor(self.lineEdit_amount, 0)
     # 零头数量的校验器
     self.set_valitor(self.lineEdit_oddment, 0, self.a_box_samount)
     self.set_total_amount()
    def __init__(self, autoid=None, parent=None):
        super(EditProductDetailModule, self).__init__(parent)
        self.setupUi(self)
        if '2s' not in user.powers:
            self.close()
        if user.powers['2'] == 0:
            self.cloe()
        self.power = '{:03b}'.format(user.powers['2'])
        self.autoid = autoid
        self.img_status = 0
        self.images_list = []
        self.current_img = object
        self.current_page = object
        self.PC = ProductController()
        self.PLC = ProductLineConroller()
        self.LC = LabrecordsController()
        self.IC = ImageController()

        self.ori_detail = {}
        self.new_detail = {}
        self.get_detail()
        # 获取种类的下拉列表
        self.get_medkind_list()
        self.get_qrtype()
        self.get_workshop()
        self.get_bworkshop()
        self.get_vworkshop()
        self.get_formula()
        self.get_images()
        self.get_checkitem(3, self.treeWidget_precheckitem)
        self.get_checkitem(4, self.treeWidget_prodcheckitem)
        self.get_checkitem(6, self.treeWidget_samplecheckitem)
        self.treeWidget_formula.hideColumn(0)
        self.treeWidget_precheckitem.hideColumn(0)
        self.treeWidget_prodcheckitem.hideColumn(0)
        self.treeWidget_samplecheckitem.hideColumn(0)
        self.treeWidget_imagenamelist.hideColumn(0)
        self.treeWidget_imagenamelist.hideColumn(1)
    def __init__(self, parent=None):
        super(ProductRepositoryModule, self).__init__(parent)
        self.setupUi(self)

        if '42' not in user.powers:
            self.close()
        if user.powers['42'] == 0:
            self.close()
        self.power = '{:03b}'.format(user.powers['42'])

        self.WC = WarehouseController()
        self.LC = LabrecordsController()
        self.PC = ProductController()
        self.current_button = self.radioButton_batchno
        self.get_product_list()
    def __init__(self, autoid=None, parent=None):
        super(EditStuffDetailModule, self).__init__(parent)
        self.setupUi(self)
        self.autoid = autoid

        self.SC = StuffController()
        self.LC = LabrecordsController()
        self.PC = ProductController()
        self.SPC = SupplyerController()
        self.ori_detail = {}
        self.new_detail = {}
        self.get_detail()
        if len(self.ori_detail):
            stufftype = self.ori_detail['stufftype']
            if stufftype == 1:
                self.tab.removeTab(4)
                self.tab.removeTab(1)
            else:
                self.tab.removeTab(3)
                self.tab.removeTab(2)
        self.get_formula()
        self.get_checkitem(0, self.treeWidget_checkitem)
        self.get_checkitem(2, self.treeWidget_precheckitem)
        self.get_stuffsupplyer()
    def __init__(self, parent=None):
        super(PurStuffCheckInModule, self).__init__(parent)
        self.setupUi(self)
        if '29' not in user.powers:
            self.close()
        if user.powers['29'] == 0:
            self.close()
        self.power = '{:03b}'.format(user.powers['29'])

        self.WC = WarehouseController()
        self.LC = LabrecordsController()
        self.SC = SupplyerController()
        self.SFC = StuffController()

        self.get_stuff_list()