minor fix
This commit is contained in:
39
销售订单自动导入.py
39
销售订单自动导入.py
@@ -550,25 +550,8 @@ def main(workbook=None):
|
|||||||
print(f'[警告] 分页选项设置失败')
|
print(f'[警告] 分页选项设置失败')
|
||||||
pass
|
pass
|
||||||
|
|
||||||
match args.automation:
|
if args.automation == 'override':
|
||||||
case 'draft', 'final':
|
for number in workbook['订单号'].unique():
|
||||||
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():
|
|
||||||
try:
|
try:
|
||||||
box = locate(".list-header-wrap div[data-item-name='订单号']", condition=None)
|
box = locate(".list-header-wrap div[data-item-name='订单号']", condition=None)
|
||||||
search = locate("input", parent=box, condition=None)
|
search = locate("input", parent=box, condition=None)
|
||||||
@@ -616,6 +599,24 @@ def main(workbook=None):
|
|||||||
print(f'[!!!!] {number}: 编辑订单时发生了错误:{e}')
|
print(f'[!!!!] {number}: 编辑订单时发生了错误:{e}')
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
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
|
return 0
|
||||||
|
|
||||||
class FieldArray[K, V]:
|
class FieldArray[K, V]:
|
||||||
|
|||||||
Reference in New Issue
Block a user