개정판 3590ad41
issue #49: import allowable
Change-Id: I234cce6c4f44820da4776c7602a0442fb90b13b7
DTI_PID/DTI_PID/CodeTableDialog.py | ||
---|---|---|
320 | 320 |
@date 2018.07.10 |
321 | 321 |
''' |
322 | 322 |
|
323 |
def fill_codes(self, table, tableDatas): |
|
323 |
def fill_codes(self, table, tableDatas, from_exel=False):
|
|
324 | 324 |
try: |
325 | 325 |
table.setRowCount(len(tableDatas)) |
326 | 326 |
row = 0 |
327 | 327 |
for tableData in tableDatas: |
328 | 328 |
table.setItem(row, 0, QTableWidgetItem(tableData[0])) # UID |
329 |
table.setItem(row, 1, QTableWidgetItem(tableData[1])) # Name
|
|
329 |
table.setItem(row, 1, QTableWidgetItem(tableData[1])) # Code
|
|
330 | 330 |
table.setItem(row, 2, QTableWidgetItem(tableData[2] if tableData[2] else '')) # Description |
331 |
table.setItem(row, 3, QTableWidgetItem((tableData[3] if type(tableData[3]) is str else ','.join(tableData[3])) \ |
|
332 |
if tableData[3] else '')) # Allowables |
|
331 |
if not from_exel: |
|
332 |
table.setItem(row, 3, QTableWidgetItem((tableData[3] if type(tableData[3]) is str else ','.join(tableData[3])) \ |
|
333 |
if tableData[3] else '')) # Allowables |
|
334 |
else: |
|
335 |
table.setItem(row, 3, QTableWidgetItem(self.makeAllowable(tableData[1]) if tableData[1] else '')) |
|
336 |
|
|
333 | 337 |
row += 1 |
334 | 338 |
except Exception as ex: |
335 | 339 |
from App import App |
... | ... | |
538 | 542 |
item = table.item(row, 1) |
539 | 543 |
if not item: return |
540 | 544 |
code = item.text() |
545 |
if code == '': return |
|
546 |
|
|
541 | 547 |
if column == 1: |
542 | 548 |
result = self.isExistCode(table, code) |
543 | 549 |
if result: |
... | ... | |
775 | 781 |
|
776 | 782 |
row_index += 1 |
777 | 783 |
|
778 |
self.fill_codes(table, codes) |
|
784 |
from_exel = True if self.ui.checkBoxAllowable.isChecked() else False |
|
785 |
self.fill_codes(table, codes, from_exel=from_exel) |
|
779 | 786 |
except Exception as ex: |
780 | 787 |
from App import App |
781 | 788 |
from AppDocData import MessageType |
내보내기 Unified diff