Exemplo n.º 1
0
 def __init__(self, ppid, sdpid, kind, parent=None):
     super(DrawstuffModule, self).__init__(parent)
     self.ppid = ppid
     self.sdpid = sdpid
     self.kind = kind
     self.setupUi(self)
     if '37' not in user.powers:
         self.close()
     if user.powers['37'] == 0:
         self.close()
     self.power = '{:03b}'.format(user.powers['37'])
     if self.power[1] == '0':
         self.pushButton_accept.setVisible(False)
         self.pushButton_cancel.setVisible(False)
     self.WC = WarehouseController()
     self.SC = StuffController()
     self.PC = ProductController()
     self.PLC = ProductLineConroller()
     self.detail = dict()
     self.stuff_list = []
     # 当前正在修改的树节点
     self.edittreeitem = None
     self.stuff_repository = []
     # 公式错误信息
     self.errormsg = []
     self.treeWidget_stuffrepository.setDragDropMode(1)
     self.treeWidget_drawstuff.setDragDropMode(2)
Exemplo n.º 2
0
    def __init__(self, autoid=None, snid=None, parent=None):
        super(EditSaleProdMudule, self).__init__(parent)
        self.setupUi(self)
        if '53' not in user.powers:
            self.close()
        if user.powers['53'] == 0:
            self.close()
        self.power = '{:03b}'.format(user.powers['53'])
        if self.power[1] == '0':
            self.pushButton_accept.setVisible(False)
            self.pushButton_cancel.setVisible(False)

        self.autoid = autoid
        self.snid = snid
        self.SC = SaleController()
        self.PC = ProductController()
        self.ori_detail = dict()
        self.new_detail = dict()
        row = ('autoid', 'prodid', 'prodname', 'spec', 'package')
        key = ('prodid', 'prodname', 'commonname', 'inputcode')
        row_name = ("id", "产品编号", "产品名称", "含量规格", "包装规格")
        self.lineEdit_product.setup('Productdictionary', row, key, row_name,
                                    None, 620, 190)
        self.set_validator()
        if self.autoid is not None:
            self.get_detail()
Exemplo n.º 3
0
    def __init__(self, flag=0, parent=None):
        super().__init__(parent)
        self.setupUi(self)

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

        self.flag = flag
        if self.flag:
            self.addButton.setVisible(False)
            self.deleteButton.setVisible(False)
            self.editButton.setVisible(False)
            self.current_kind = 'produceButton'
            self.produceButton.setEnabled(False)
        # 数据库操作类
        self.sd = ProductModel()
        self.product = ProductController()
        self.detail = ''
        # 未下达/已下达/正在生产/审核/生产结束 五个状态按键的功能
        self.editButton.clicked.connect(self.on_statusButton_clikcked)
        self.releaseButton.clicked.connect(self.on_statusButton_clikcked)
        self.produceButton.clicked.connect(self.on_statusButton_clikcked)
        self.examineButton.clicked.connect(self.on_statusButton_clikcked)
        self.finishedpushButton.clicked.connect(self.on_statusButton_clikcked)
        # 显示产品列表
        self.show_production_list()
        # 添加右键菜单功能
        self.__add_menu()
Exemplo n.º 4
0
 def __init__(self):
     self.SC = StuffController()
     self.SLC = SaleController()
     self.SP = SupplyerController()
     self.WM = WarehouseModel()
     self.WC = WorkshopController()
     self.PC = ProductController()
    def __init__(self, ppid, parent=None):
        super(OddmentregisternoteModule, self).__init__(parent)
        self.ppid = ppid

        self.setupUi(self)
        self.PC = ProductController()
        # 获取半成品信息
        self.get_oddmentreg()
 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()
Exemplo n.º 7
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()
Exemplo n.º 8
0
    def __init__(self, ppid, parent=None):
        # b,m,s分别对应大、中、小包装
        # num 为已经扫描的个数
        # amount 为包装比例
        super(ScanqrcodeModule, self).__init__(parent)
        self.setupUi(self)
        self.PC = ProductController()
        self.WC = WorkshopController()
        self.tts = Tts()
        self.tts.start()
        self.ppid = ppid

        self.batchno = ''
        self.commonname = ''
        self.allowno = ''
        # 上级码的对象
        self.lpid = None
        self.bpid = None
        self.mpid = None
        # 扫了多少个码
        self.scan_num = [0, 0, 0, 0]
        # 一箱对应的码数量
        self.lv_amount = [0, 0, 0, 0]
        # 各级码的出现次数
        self.lpsum = 0
        self.bpsum = 0
        self.mpsum = 0
        self.widget_list = [
            self.lineEdit_lpqrcode, self.lineEdit_bpqrcode,
            self.lineEdit_mpqrcode, self.lineEdit_spqrcode
        ]
        self.use_lv_qrcode = []

        qrtype = self.get_prod_packagelv()
        self.qrcode = AboxQrcode(
            qrtype, self.lv_amount[1], self.lv_amount[2],
            self.lv_amount[3]
        )

        q_list = ('lp', 'bp', 'mp', 'sp')
        qrtype = '{: 04b}'.format(qrtype)

        self.mpsum = self.lv_amount[3] if qrtype[3] == '1' else 1
        self.bpsum = self.mpsum * (self.lv_amount[2] if qrtype[2] == '1' else 1)
        self.lpsum = self.bpsum * (self.lv_amount[1] if qrtype[1] == '1' else 1)

        for i in (3, 2, 1, 0):
            if qrtype[i] == '1':
                self.use_lv_qrcode.append(q_list[i])
            else:
                self.widget_list[i].setEnabled(False)
                self.widget_list.pop(i)
                self.scan_num.pop(i)
                self.lv_amount.pop(i)
        self.use_lv_qrcode.reverse()
        self.widget_list[0].setFocus()
Exemplo n.º 9
0
 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()
Exemplo n.º 10
0
 def __init__(self, parent=None):
     super(OddmentdetailModule, self).__init__(parent)
     self.setupUi(self)
     self.ppid = 0
     self.PC = ProductController()
     self.ori_detail = dict()
     self.new_detail = dict()
     self.groupBox.setVisible(False)
     # 获取当前状态的批生产记录
     self.get_proddetail()
Exemplo n.º 11
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)
 def __init__(self, autoid, parent=None):
     super(PackageInstructionModule, self).__init__(parent)
     self.autoid = autoid
     self.setupUi(self)
     self.SC = StuffController()
     self.PC = ProductController()
     self.ori_detail = dict()
     self.new_detail = dict()
     # 获取物料信息
     self.get_stufflist()
     # 获取批包装指令信息
     self.get_detail()
Exemplo n.º 13
0
    def __init__(self, parent=None):
        super(MidproddetailModule, self).__init__(parent)
        self.setupUi(self)
        self.ppid = 0
        self.sign_id = ''
        self.sign_name = ''
        self.PC = ProductController()
        self.ori_detail = dict()
        self.new_detail = dict()
        self.groupBox.setVisible(False)

        # 获取当前状态的批生产记录
        self.get_prodstatusinmid()
Exemplo n.º 14
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
Exemplo n.º 15
0
    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()
Exemplo n.º 16
0
 def __init__(self, autoid: int=0, ppid: int=0, parent=None):
     super(Modifymiddetailmodule, self).__init__(parent)
     self.autoid = autoid
     self.ppid = ppid
     self.setupUi(self)
     self.PC = ProductController()
     self.ori_detail = dict()
     self.new_detail = dict()
     # 获取当前半成品登记的详情
     self.get_detail()
     # 设置桶号的校验器
     self.set_container_validator()
     # 设置数量的校验器
     self.set_amount_validator()
Exemplo n.º 17
0
 def __init__(self, autoid, parent=None):
     super(HomePageModule, self).__init__(parent)
     self.setupUi(self)
     self.autoid=autoid
     self.current_img = object
     self.current_page = object
     self.PC = ProductController()
     self.WC = WorkshopController()
     self.IC = ImageController()
     # 自动缩放
     self.label_image.setScaledContents(True)
     self.get_detail()
     self.get_images()
     self.scrollArea.setVisible(False)
     self.groupBox.setVisible(False)
Exemplo n.º 18
0
    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()
Exemplo n.º 19
0
    def __init__(self, parent=None):
        super(OddmentputinnoteModule, self).__init__(parent)
        self.setupUi(self)
        if '34' not in user.powers:
            self.close()
        if user.powers['34'] == 0:
            self.close()
        self.power = '{:03b}'.format(user.powers['34'])

        self.ppid = 0
        self.PC = ProductController()
        self.ori_detail = dict()
        self.new_detail = dict()
        self.groupBox.setVisible(False)
        # 获取当前状态的批生产记录
        self.get_proddetail()
Exemplo n.º 20
0
 def __init__(self, autoid=None, prodid=None, prodtype=0, parent=None):
     super(EditFormulaModule, self).__init__(parent)
     self.setupUi(self)
     self.autoid = autoid
     self.prodid = prodid
     self.prodtype = prodtype
     self.ori_detail = {}
     self.new_detail = {}
     self.PC = ProductController()
     self.set_validator()
     return_row = ("stufftype", "kind", )
     condition_key = {'kind', }
     treeheader_name = ["type", "物料种类"]
     self.lineEdit_stuffkind.setup(
         'Stuffdictionary', return_row, condition_key, treeheader_name, None,
         745, 200
     )
     self.get_detail()
Exemplo n.º 21
0
    def __init__(self, autoid=None, parent=None):
        super(EditProducingplan, self).__init__(parent)
        self.setupUi(self)

        # if '20' not in user.powers:
        #     self.close()
        #     self.accept_button.setVisible(False)
        #     self.cancel_button.setVisible(False)
        #     self.pushButton_audit.setVisible(False)
        # if user.powers['20'] == 0:
        #     self.close()
        # self.power = '{:03b}'.format(user.powers['20'])
        # if self.power[1] == '0':
        #     self.accept_button.setVisible(False)
        #     self.cancel_button.setVisible(False)
        #     self.pushButton_audit.setVisible(False)

        self.PC = ProductController()
        self.WC = WarehouseController()

        self.autoid = autoid
        self.prod_id = 0
        self.ori_detail = {}
        self.new_detail = {}
        self.detail = {}
        self.stuff_list = []
        self.stuff_repository = []
        self.no_enough_stuff_list = []
        self.treewidget_meterial.hideColumn(1)
        self.treeWidget_package.hideColumn(1)
        # 公式错误信息
        self.errormsg = []

        self.prodname.setup(DB_TABLE[0], PRODUCT_VALUE_TUPLE, PRODUCT_KEY,
                            VALUE_NAME, None, 650, 250)

        self.prodname.getItem.connect(self.setproduct)
        self.set_validator()
        if autoid is not None:
            self.get_detail()
            self.set_treewidget_formula((0, 1, 2), self.treewidget_meterial)
            self.set_treewidget_formula((3, 4), self.treeWidget_package)
        else:
            self.makedate.setDate(QDate.currentDate())
Exemplo n.º 22
0
    def __init__(self, autoid, kind, parent=None):
        super(MidproddrawnoteModule, self).__init__(parent)
        self.autoid = autoid
        self.kind = kind
        self.setupUi(self)
        self.PC = ProductController()
        self.ori_detail = dict()
        self.new_detail = dict()

        if kind == 0:
            self.treeWidget_midproductlist.headerItem().setText(3, "中间站登记人")
            self.treeWidget_midproductlist.headerItem().setText(5, "登记工人")
        elif kind == 1:
            self.treeWidget_midproductlist.headerItem().setText(3, "中间站发放人")
            self.treeWidget_midproductlist.headerItem().setText(5, "领料工人")
        # 获取半成品信息
        self.get_midprod()
        # 获取半成品的登记/发放状态
        self.get_midstatus()
Exemplo n.º 23
0
 def __init__(self, autoid: int = 0, ppid: int = 0, parent=None):
     super(Modifyoddmentmodule, self).__init__(parent)
     self.autoid = autoid
     self.ppid = ppid
     self.batchno = '0'
     self.setupUi(self)
     self.PC = ProductController()
     self.SC = SystemController()
     self.ori_detail = dict()
     self.new_detail = dict()
     self.proddetail = {'spunit': '', 'basicunit': ''}
     self.validdate = 90
     # 获取生产记录里小包装单位和基本单位
     self.get_producingplan_detail()
     # 获取当前零头登记的详情
     self.get_detail()
     # 设置数量的校验器
     self.set_amount_validator()
     # 获取零头有效期天数
     self.get_oddmentvaliddate()
Exemplo n.º 24
0
    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()
Exemplo n.º 25
0
 def __init__(self, parent=None):
     super().__init__(parent)
     self.setupUi(self)
     # 数据库操作类
     self.sd = ProductModel()
     self.product = ProductController()
     self.detail = ''
     if '2' not in  user.powers:
         self.close()
     if user.powers['2'] == 0:
         self.close()
     self.power = '{:03b}'.format(user.powers['2'])
     # 当前的物料种类,默认为“全部按键”
     #self.current_stuff_kind_button = self.ALLButton
     #self.ALLButton.clicked.connect(self.on_stufftypeButton_clicked)
     # 显示物料列表
     self.show_product_list()
     # 添加右键菜单功能
     self.__add_menu()
     # 获得所有的剂型
     medkind_list = self.product.get_all_medkind()
     self.set_medkind_list(medkind_list)
    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()