xqsun835 xqsun835
一个符号承载一段回忆,一丝美好穿越一生时光
关注数: 17 粉丝数: 18 发帖数: 1,422 关注贴吧数: 15
对账辅助工具,自动填写参数,[学习aardio自动化的作业] import fonts.fontAwesome; import win.ui; import winex; //import sys; import key; import fsys.ini import fsys.lnk; import fsys.dlg; import console; import process; /*DSG{{*/ var winform = win.form(text="对账辅助工具";right=759;bottom=469;max=false) winform.add( groupbox1={cls="groupbox";text="银行对账单参数";left=10;top=5;right=751;bottom=193;bgcolor=65280;cp=1;dl=1;dr=1;edge=1;font=LOGFONT(h=-16;name='微软雅黑');z=1}; groupbox2={cls="groupbox";text="银行存款明细账参数";left=12;top=209;right=753;bottom=397;bgcolor=65280;cp=1;dl=1;dr=1;edge=1;font=LOGFONT(h=-16;name='微软雅黑');z=17}; plus01={cls="plus";text="文件名称";left=105;top=44;right=678;bottom=70;align="right";border={bottom=1;color=-6908266};editable=1;font=LOGFONT(h=-13);notify=1;textPadding={top=6;bottom=2};z=2}; plus02={cls="plus";text="工作表";left=105;top=81;right=443;bottom=107;align="right";border={bottom=1;color=-6908266};editable=1;font=LOGFONT(h=-13);textPadding={top=6;bottom=2};z=3}; plus03={cls="plus";text="数据首行";left=532;top=115;right=683;bottom=141;align="right";border={bottom=1;color=-6908266};editable=1;font=LOGFONT(h=-13);textPadding={top=6;bottom=2};z=4}; plus04={cls="plus";text="数据末行";left=527;top=154;right=678;bottom=180;align="right";border={bottom=1;color=-6908266};editable=1;font=LOGFONT(h=-13);textPadding={top=6;bottom=2};z=5}; plus05={cls="plus";text="收支同列";left=279;top=110;right=379;bottom=141;align="left";font=LOGFONT(h=-16);iconStyle={align="left";font=LOGFONT(h=-15;name='FontAwesome')};iconText='\uF111 ';notify=1;textPadding={left=24};z=6}; plus06={cls="plus";text="收入列";left=105;top=115;right=256;bottom=141;align="right";border={bottom=1;color=-6908266};editable=1;font=LOGFONT(h=-13);textPadding={top=6;bottom=2};z=7}; plus07={cls="plus";text="支出列";left=105;top=154;right=256;bottom=180;align="right";border={bottom=1;color=-6908266};editable=1;font=LOGFONT(h=-13);textPadding={top=6;bottom=2};z=8}; plus11={cls="plus";text="文件名称";left=107;top=248;right=680;bottom=274;align="right";border={bottom=1;color=-6908266};editable=1;font=LOGFONT(h=-13);notify=1;textPadding={top=6;bottom=2};z=18}; plus12={cls="plus";text="工作表";left=107;top=285;right=445;bottom=311;align="right";border={bottom=1;color=-6908266};editable=1;font=LOGFONT(h=-13);textPadding={top=6;bottom=2};z=19}; plus13={cls="plus";text="数据首行";left=534;top=319;right=685;bottom=345;align="right";border={bottom=1;color=-6908266};editable=1;font=LOGFONT(h=-13);textPadding={top=6;bottom=2};z=20}; plus14={cls="plus";text="数据末行";left=529;top=358;right=680;bottom=384;align="right";border={bottom=1;color=-6908266};editable=1;font=LOGFONT(h=-13);textPadding={top=6;bottom=2};z=21}; plus15={cls="plus";text="收支同列";left=281;top=314;right=381;bottom=345;align="left";font=LOGFONT(h=-16);iconStyle={align="left";font=LOGFONT(h=-15;name='FontAwesome')};iconText='\uF111 ';notify=1;textPadding={left=24};z=22}; plus16={cls="plus";text="收入列";left=107;top=319;right=258;bottom=345;align="right";border={bottom=1;color=-6908266};editable=1;font=LOGFONT(h=-13);textPadding={top=6;bottom=2};z=23}; plus17={cls="plus";text="支出列";left=107;top=358;right=258;bottom=384;align="right";border={bottom=1;color=-6908266};editable=1;font=LOGFONT(h=-13);textPadding={top=6;bottom=2};z=24}; plus21={cls="plus";text="保存参数";left=15;top=428;right=145;bottom=458;align="left";bgcolor=-5197169;font=LOGFONT(h=-13);iconStyle={align="left";font=LOGFONT(h=-13;name='FontAwesome');padding={left=20}};iconText='\uF021';notify=1;textPadding={left=39};z=10}; plus22={cls="plus";text="开始对账";left=593;top=428;right=723;bottom=458;align="left";bgcolor=-5197169;font=LOGFONT(h=-13);iconStyle={align="left";font=LOGFONT(h=-13;name='FontAwesome');padding={left=20}};iconText='\uF021';notify=1;textPadding={left=39};z=9}; static01={cls="static";text="数据位置:";left=19;top=44;right=97;bottom=70;align="right";center=1;font=LOGFONT(h=-13);transparent=1;z=11}; static02={cls="static";text="工作表:";left=22;top=81;right=97;bottom=107;align="right";center=1;font=LOGFONT(h=-13);transparent=1;z=12}; static03={cls="static";text="数据首行:";left=444;top=115;right=527;bottom=141;align="right";center=1;font=LOGFONT(h=-13);transparent=1;z=13}; static04={cls="static";text="数据末行:";left=444;top=154;right=527;bottom=180;align="right";center=1;font=LOGFONT(h=-13);transparent=1;z=14}; static05={cls="static";text="收入列:";left=22;top=115;right=97;bottom=141;align="right";center=1;font=LOGFONT(h=-13);transparent=1;z=15}; static06={cls="static";text="支出列:";left=22;top=154;right=97;bottom=180;align="right";center=1;font=LOGFONT(h=-13);transparent=1;z=16}; static11={cls="static";text="数据位置:";left=21;top=248;right=99;bottom=274;align="right";center=1;font=LOGFONT(h=-13);transparent=1;z=25}; static12={cls="static";text="工作表:";left=24;top=285;right=99;bottom=311;align="right";center=1;font=LOGFONT(h=-13);transparent=1;z=26}; static13={cls="static";text="数据首行:";left=444;top=319;right=527;bottom=345;align="right";center=1;font=LOGFONT(h=-13);transparent=1;z=27}; static14={cls="static";text="数据末行:";left=444;top=360;right=527;bottom=386;align="right";center=1;font=LOGFONT(h=-13);transparent=1;z=29}; static15={cls="static";text="收入列:";left=21;top=319;right=96;bottom=345;align="right";center=1;font=LOGFONT(h=-13);transparent=1;z=30}; static16={cls="static";text="支出列:";left=24;top=358;right=99;bottom=384;align="right";center=1;font=LOGFONT(h=-13);transparent=1;z=28} ) /*}}*/ ini=fsys.ini("\银企对账配置文件.ini") sec1 = ini.getSection("银行对账单") sec2 = ini.getSection("银行存款明细账") winform.plus21.skin({ background={ default=0x668FB2B0; disabled=0xFFCCCCCC; hover=0xFF928BB3 }; color={ default=0xFF000000; disabled=0xFF6D6D6D } }) winform.plus22.skin({ background={ default=0x668FB2B0; disabled=0xFFCCCCCC; hover=0xFF928BB3 }; color={ default=0xFF000000; disabled=0xFF6D6D6D } }) winform.plus05.skin({ color={ active=0xFF00FF00; default=0xFF000000; disabled=0xFF6D6D6D; hover=0xFFFF0000 }; checked={ background={ //default=0xFFFFE7BF }; iconText='\uF058' } }) winform.plus15.skin({ color={ active=0xFF00FF00; default=0xFF000000; disabled=0xFF6D6D6D; hover=0xFFFF0000 }; checked={ background={ //default=0xFFFFE7BF }; iconText='\uF058' } }) winform.plus01.skin( background = { hover = "/res/images/btn-hover.png"; focus = "/res/images/btn-focus.jpg"; active = "/res/images/btn-active.png"; disabled = "/res/images/btn-disabled.png"; } ) winform.plus11.skin( background = { hover = "/res/images/btn-hover.png"; focus = "/res/images/btn-focus.jpg"; active = "/res/images/btn-active.png"; disabled = "/res/images/btn-disabled.png"; } ) winform.plus01.text = sec1.文件名称 winform.plus02.text = sec1.工作表 winform.plus03.text = sec1.数据首行 winform.plus04.text = sec1.数据末行 a_check=tonumber(sec1.收支同列) winform.plus05.checked = a_check winform.plus06.text = sec1.收入列 winform.plus07.text = sec1.支出列 winform.plus11.text = sec2.文件名称 winform.plus12.text = sec2.工作表 winform.plus13.text = sec2.数据首行 winform.plus14.text = sec2.数据末行 a_check=tonumber(sec2.收支同列) winform.plus15.checked = a_check winform.plus16.text = sec2.收入列 winform.plus17.text = sec2.支出列 if(winform.plus05.checked==true) { winform.plus07.text=winform.plus06.text winform.plus07.disabledText = true; } else { winform.plus07.disabledText = false; } if(winform.plus15.checked==true) { winform.plus17.text=winform.plus16.text winform.plus17.disabledText = true; } else { winform.plus17.disabledText = false; } winform.plus05.oncommand = function(id,event){ if(winform.plus05.checked==true) { winform.plus07.text=winform.plus06.text winform.plus07.disabledText = true; } else { winform.plus07.disabledText = false; } } winform.plus15.oncommand = function(id,event){ if(winform.plus15.checked==true) { winform.plus17.text=winform.plus16.text winform.plus17.disabledText = true; } else { winform.plus17.disabledText = false; } } winform.plus21.oncommand = function(id,event){ sec1.文件名称=winform.plus01.text sec1.工作表=winform.plus02.text sec1.数据首行=winform.plus03.text sec1.数据末行=winform.plus04.text if (winform.plus05.checked=true){ sec1.收支同列=1 } else { sec1.收支同列=0 } sec1.收入列=winform.plus06.text sec1.支出列=winform.plus07.text sec1.save() sec2.文件名称=winform.plus11.text sec2.工作表=winform.plus12.text sec2.数据首行=winform.plus13.text sec2.数据末行=winform.plus14.text if (winform.plus15.checked=true){ sec2.收支同列=1 } else { sec2.收支同列=0 } sec2.收入列=winform.plus16.text sec2.支出列=winform.plus17.text sec2.save() winform.text = winform.text+" OK!" } winform.plus22.oncommand = function(id,event){ key.block(true) var filePath = fsys.lnk.search( {"达人银企对账器.exe"} ) process.execute(filePath ); var hwnd = winex.waitVisible("达人银企对账器",,"达人银企对账器") key.repeat("tab",5) key.sendString(sec1.文件名称) win.delay(1500) key.press("tab") win.delay(500) key.press("DOWN") win.delay(500) key.press("tab") key.sendString(sec1.数据首行) key.press("tab") key.sendString(sec1.数据末行) if (winform.plus05.checked=true){ sec1.收支同列=1 key.repeat("tab",2) key.press("space") key.repeat("tab",1) key.sendString(sec1.收入列) key.repeat("tab",4) } else { sec1.收支同列=0 key.repeat("tab",4) key.sendString(sec1.收入列) key.press("tab") key.sendString(sec1.支出列) key.repeat("tab",3) } key.pressEx("CTRL","tab") key.press("tab") key.sendString(sec2.文件名称) //key.sendString(fsys.getCurDir()+sec2.文件名称) win.delay(1500) key.repeat("tab",2) key.sendString(sec2.数据首行) key.press("tab") key.sendString(sec2.数据末行) if (winform.plus15.checked=true){ sec2.收支同列=1 key.repeat("tab",2) key.press("space") key.repeat("tab",1) key.sendString(sec2.收入列) key.repeat("tab",4) } else { sec2.收支同列=0 key.repeat("tab",4) key.sendString(sec2.收入列) key.press("tab") key.sendString(sec2.支出列) key.repeat("tab",3) } key.pressEx("CTRL","tab") key.press("tab") key.block(false) } winform.plus01.oncommand = function(id,event){ var path = fsys.dlg.open('所有文件|*.*|电子表格文件|*.xls||',,,winform); if(path){ winform.plus01.text = path; } } winform.plus11.oncommand = function(id,event){ var path = fsys.dlg.open('所有文件|*.*|电子表格文件|*.xls||',,,winform); if(path){ winform.plus11.text = path; } } winform.show(); win.loopMessage();
1 下一页