def showAccount(): ui = pool.return_UI() mlist = command.get_KdAccount() Service.account_list = mlist for i in mlist: if Service.checkWhetherAccount(i['数据库名称']): ui.Accountlist.addItem(i['账套名称'])
def setDate(_date_value,dateedit): ui = pool.return_UI() if dateedit == pool.AFTER_DATE: ui.after_date.setDate(_date_value) elif dateedit == pool.BEFORE_DATE: ui.before_date.setDate(_date_value) ui.calendar_yes_button.clicked.disconnect() if check() == False: ui.after_date.setDate(ui.before_date.date()) hideCalendar()
def showCalendar(_value = ""): ui = pool.return_UI() ui.calendar1.setHidden(False) ui.calendar_yes_button.setHidden(False) ui.calendar_cancal_button.setHidden(False) ui.verticalLayoutWidget_2.setHidden(False) #ui.buttonBox.accepted.connect(lambda : setDate(ui.calendar1.selectedDate(),_value)) ui.calendar_yes_button.clicked.connect(lambda : setDate(ui.calendar1.selectedDate(),_value)) ui.calendar_cancal_button.clicked.connect(hideCalendar)
def showSuplier(_databasename): ui = pool.return_UI() command.changeDataBase(_database=_databasename) mlist = command.getSuplier() Service.suplier_list = mlist count = len(mlist) ui.Supliertable.setRowCount(count) _i = 0 for i in mlist: ui.Supliertable.setItem(_i, 0, QTableWidgetItem(str(i['编码']))) ui.Supliertable.setItem(_i, 1, QTableWidgetItem(str(i['供应商名称']))) _i += 1
def check(): ui = pool.return_UI() beforestring = ui.before_date.date().toString(Qt.ISODate) afterstring = ui.after_date.date().toString(Qt.ISODate) _is = beforestring.split('-') _js = afterstring.split('-') _i = 0 for i in _is : bf = float(i) af = float(_js[_i]) if bf > af: return False elif bf == af: _i += 1 continue else: return True
def hideCalendar(): ui =pool.return_UI() ui.calendar1.setHidden(True) ui.calendar_yes_button.setHidden(True) ui.calendar_cancal_button.setHidden(True) ui.verticalLayoutWidget_2.setHidden(True)