minor fix
This commit is contained in:
37
销售订单自动导入.py
37
销售订单自动导入.py
@@ -550,24 +550,7 @@ def main(workbook=None):
|
|||||||
print(f'[警告] 分页选项设置失败')
|
print(f'[警告] 分页选项设置失败')
|
||||||
pass
|
pass
|
||||||
|
|
||||||
match args.automation:
|
if args.automation == 'override':
|
||||||
case 'draft', 'final':
|
|
||||||
while ready(driver):
|
|
||||||
for link in driver.find_elements(By.CSS_SELECTOR, ".list-frame-table .vue-recycle-scroller__item-wrapper .cell[data-cci='1'] a"):
|
|
||||||
try:
|
|
||||||
modify(link)
|
|
||||||
except Exception as e:
|
|
||||||
print(f'[!!!!] 编辑订单时发生了错误:{e}')
|
|
||||||
return 85
|
|
||||||
|
|
||||||
try:
|
|
||||||
button = locate(".paas-invoice-list-frame .list-okki-footer-wrap li.okki-pagination-next button", wait=False)
|
|
||||||
if bool(button.get_attribute('disabled')): raise KeyboardInterrupt()
|
|
||||||
click(button)
|
|
||||||
except:
|
|
||||||
print('[信息] 已经是最后一页')
|
|
||||||
break
|
|
||||||
case 'override':
|
|
||||||
for number in workbook['订单号'].unique():
|
for number in workbook['订单号'].unique():
|
||||||
try:
|
try:
|
||||||
box = locate(".list-header-wrap div[data-item-name='订单号']", condition=None)
|
box = locate(".list-header-wrap div[data-item-name='订单号']", condition=None)
|
||||||
@@ -618,6 +601,24 @@ def main(workbook=None):
|
|||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
while ready(driver):
|
||||||
|
for link in driver.find_elements(By.CSS_SELECTOR, ".list-frame-table .vue-recycle-scroller__item-wrapper .cell[data-cci='1'] a"):
|
||||||
|
try:
|
||||||
|
modify(link)
|
||||||
|
except Exception as e:
|
||||||
|
print(f'[!!!!] 编辑订单时发生了错误:{e}')
|
||||||
|
return 85
|
||||||
|
|
||||||
|
try:
|
||||||
|
button = locate(".paas-invoice-list-frame .list-okki-footer-wrap li.okki-pagination-next button", wait=False)
|
||||||
|
if bool(button.get_attribute('disabled')): raise KeyboardInterrupt()
|
||||||
|
click(button)
|
||||||
|
except:
|
||||||
|
print('[信息] 已经是最后一页')
|
||||||
|
break
|
||||||
|
|
||||||
|
return 0
|
||||||
|
|
||||||
class FieldArray[K, V]:
|
class FieldArray[K, V]:
|
||||||
def __init__(self, *args: K):
|
def __init__(self, *args: K):
|
||||||
self.map: dict[K, list[V]] = { name: [] for name in args }
|
self.map: dict[K, list[V]] = { name: [] for name in args }
|
||||||
|
|||||||
Reference in New Issue
Block a user