def on_treeWidget_stufflist_customContextMenuRequested(self, pos):
        id = 0
        lrid = 0
        # 返回调用者的对象
        sender_widget = self.sender()
        current_item = sender_widget.currentItem()
        if current_item is None:
            return

        id = int(current_item.text(0))
        lrid = int(current_item.text(1))

        menu = QMenu()
        button1 = menu.addAction("登记入库")
        button2 = menu.addAction("查看检验报告")

        global_pos = sender_widget.mapToGlobal(pos)
        action = menu.exec(global_pos)

        if action == button1:
            detail = EditStuffCheckInModule(id, lrid, self)
            detail.accepted.connect(self.get_stuff_list)
            detail.show()

        elif action == button2:
            if lrid == 0:
                message = MessageBox(text="没有找到对应的检验报告", parent=self)
                message.show()
                return
            detail = CheckreportModule(lrid, True, self)
            detail.show()
 def on_treeWidget_reportlist_itemDoubleClicked(self, qtreeitem, p_int):
     index = self.tabWidget.currentIndex()
     id = int(qtreeitem.text(0))
     if index == 2:
         detail = CheckreportModule(id, True, self)
         detail.show()
     else:
         detail = ApplyDaliycheckModule(autoid=id, parent=self)
         detail.accepted.connect(self.get_detail)
         detail.show()
Exemple #3
0
 def on_treeWidget_reportlist_itemDoubleClicked(self, qtreeitem, p_int):
     autoid = int(qtreeitem.text(0))
     detail = CheckreportModule(autoid, True, self)
     detail.show()
 def on_treeWidget_labrecord_itemDoubleClicked(self, qtreeitem, p_int):
     if self.power[1] == '0':
         return
     id = int(qtreeitem.text(0))
     detail = CheckreportModule(id, True, self)
     detail.show()
 def on_treeWidget_labreport_itemDoubleClicked(self, qtreeitem, p_int):
     id = int(qtreeitem.text(1))
     detail = CheckreportModule(autoid=id, is_view=True, parent=self)
     detail.show()
Exemple #6
0
 def on_treeWidget_labrecords_itemDoubleClicked(self, qtreeitem, p_int):
     autoid = qtreeitem.text(0)
     detail = CheckreportModule(autoid, False, self)
     detail.accepted.connect(self.show_records_list)
     # 修改了记录,刷新列表
     detail.show()
Exemple #7
0
    def on_treewidget_filetree_itemClicked(self, qitem, p_int):
        try:
            # 判断之前是否有打开过文档且没有保存
            if self.current_content.flat:
                dialog = MessageBox(self,
                                    title="提醒",
                                    text="文档尚未保存",
                                    informative="是否要保存文档",
                                    yes_text="保存",
                                    no_text="放弃保存")
                result = dialog.exec()
                if result == QtWidgets.QMessageBox.Yes:
                    # 调用保存的槽函数
                    self.on_pushButton_accept_clicked()

        except (AttributeError, TypeError):
            pass
        finally:
            if not self.gridLayout_4.isEmpty():
                self.gridLayout_4.removeWidget(self.current_content)
                self.current_content.close()

        self.label_filename.setText(qitem.text(0))
        self.current_docid = qitem.text(3)

        # 点击的是内建文档
        if qitem.text(1) == '2':
            doctype = int(qitem.text(3))
            # 生产指令
            if doctype == -1:
                self.current_content = PorductionInstructionModule(
                    self.autoid, self)
            # 领料单
            if doctype in (-2, -3, -4):
                self.current_content = StuffdrawpaperModule(
                    qitem.text(4), self)
            # 退料单
            elif doctype in (-5, -6, -7):
                self.current_content = StuffReturnPaperModule(
                    qitem.text(4), self)
            # 批包装指令
            elif doctype == -8:
                self.current_content = PackageInstructionModule(
                    self.autoid, self)
            # 批剩余(残次)标签、包装材料销毁记录
            elif doctype == -9:
                pass
            # 称量配料记录
            elif doctype == -10:
                pass
            # 半成品登记/发放记录
            elif doctype in (-11, -12):
                self.current_content = MidproddrawnoteModule(
                    self.autoid,
                    abs(doctype) - 11)
            # 前处理入库单
            elif doctype == -14:
                self.current_content = PreProdPutInModule(autoid=self.autoid,
                                                          parent=self)
            # 成品寄库单
            elif doctype == -13:
                self.current_content = ProductputinModule(
                    int(qitem.text(4)), self)
            # 请验单
            if doctype in (-15, -16, -17, -18):
                docid = qitem.text(2)
                if docid == "-1":
                    self.current_content = CheckreportModule(autoid=int(
                        qitem.text(4)),
                                                             is_view=True,
                                                             parent=self)
                else:
                    self.current_content = ApplycheckModule(autoid=int(
                        qitem.text(4)),
                                                            parent=self)

            # 清场合格证(副本)
            elif doctype == -19:
                self.current_content = CleanconfirmityCopyModule(
                    int(qitem.text(4)), self)
            # 清场合格证(正本)
            elif doctype == -20:
                self.current_content = CleanconfirmityOriginalModule(
                    qitem.text(4), int(qitem.parent().text(3)), self)
            # 库存零头领取单
            elif doctype == -21:
                pass
            # 尾料销毁记录
            elif doctype == -22:
                pass
            # 产品二维码
            elif doctype == -23:
                self.current_content = QrcodelistModule(self.autoid, self)
            # 小、中包装二维码关联
            elif doctype == -24:
                pass
            # 大、中包装二维码关联
            elif doctype == -25:
                pass
            # 巨、大包装二维码关联
            elif doctype == -26:
                pass
            # 零头登记记录
            elif doctype == -27:
                self.current_content = OddmentregisternoteModule(
                    self.autoid, self)
            # 零头发放记录
            elif doctype == -28:
                self.current_content = OddmentdrawnoteModule(self.autoid, self)
            # 退货产品领料单
            elif doctype == -29:
                pass
            self.gridLayout_4.addWidget(self.current_content)
        # 点击的是自定义文档
        elif qitem.text(1) == '3':
            # 自定义文档在Forms表里的id
            formatid = qitem.text(3)
            document = self.wsmodels.get_form(formatid)
            if document is not None:
                content = document.format
                self.current_content = XMLReadWrite(self)
                self.current_content.openxml(content)
                self.gridLayout_4.addWidget(self.current_content)
                self.current_content.__setattr__('autoid', self.autoid)
        # 点击的是岗位名
        elif qitem.text(1) == '1':
            self.current_content = PostdetailModule(qitem.text(2),
                                                    self.detail[0].lineid,
                                                    qitem.text(3),
                                                    qitem.text(0), self)
            self.gridLayout_4.addWidget(self.current_content)
        # 点击的是封面
        elif qitem.text(1) == '0':
            self.current_content = HomePageModule(self.autoid, self)
            self.gridLayout_4.addWidget(self.current_content)