def slotSelectArticle(self): dlg = DlgArticle(self, True) dlg.setModal(True) if QDialog.Accepted!=dlg.exec_(): return self.__article = dlg.getSelectedArticle() self.ui.lineEdit_articlename.setText(self.__article.model)
def slotArticleMs(self): dlg = DlgArticle(self, True) dlg.setModal(True) '''未选中任何物品''' if QDialog.Accepted != dlg.exec_(): #print 'not accepted' return self.__article = dlg.getSelectedArticle() if self.__article == None: return #如果返回了正确的物品信息 self.ui.lineEdit_articlename.setText(self.__article.model) self.ui.label_unit.setText(self.__article.unit) remainList = dbArticle().getSpecArticleRemainList(self.__article.id) if len(remainList) > 0: remainInfo = remainList[0] self.ui.lineEdit_remain.setText('%f'%remainInfo.remainCount) else: self.ui.lineEdit_remain.setText(u'0') #更新价格列表 priceList = dbInOutRecord().getSpecArticlePriceList(self.__article.id) self.ui.comboBox_price.clear() for price in priceList: self.ui.comboBox_price.addItem(u'%.2f'%price) self.ui.comboBox_price.setCurrentIndex(0)