下载 http://pan.baidu.com/s/1temcU
IfNotExist, config.ini { IniWrite, 0, config.ini, setting, disautorun IniWrite, 20130101, config.ini, setting, lastuse } IfNotExist, rules.ini { FileAppend, +2`n+9`n+19, rules.ini } IfNotExist, %A_Scriptdir%\data\ FileCreateDir, %A_Scriptdir%\data\ IniRead, disauto, config.ini, setting, disautorun IniRead, lastuse, config.ini, setting, lastuse menu, Tray, NoStandard Menu, tray, add, 查看今日提醒 Menu, tray, add, 销售信息录入 Menu, tray, add, 提醒规则管理 Menu, tray, add, 退出 menu, tray, Default, 查看今日提醒 date = %A_YYYY%%A_MM%%A_DD% m01 = 0 m02 = 31 m03 = 59 m04 = 90 m05 = 120 m06 = 151 m07 = 181 m08 = 212 m09 = 243 m10 = 273 m11 = 304 m12 = 334 noask = 1 if lastuse < %date% { sleep, 2000 goto, 查看今日提醒 } Return 查看今日提醒: if noask = 0 { MsgBox, 36, 询问, 您今天已经查看过全部提醒,是否强制刷新规则及提醒? IfMsgBox, No goto, show IfMsgBox, Yes FileDelete, %A_Scriptdir%\data\%date%.csv } jump: b = %date% StringLeft, by, b, 4 StringTrimLeft, b, b, 4 StringLeft, bm, b, 2 StringTrimLeft, b, b, 2 StringLeft, bd, b, 2 dy := by-2000 br := dy/4 StringSplit, dr, br, . dr = %dr1% bmd = %bm%%bd% IfInString, br, .000000 { if bmd > 0229 dr += 1 } dm = % m%bm% dd := bd-1 btmp := dy*365+dm+dr+dd FileRead, rules, rules.ini StringSplit, tmp, rules, `n IfExist, 信息.csv { FileRead, data, 信息.csv StringSplit, line, data, `n, } Else { MsgBox, 16, 错误, 信息.csv 不存在!`n请右键桌面右下角程序图标来录入信息! Return } idx = 0 Loop { idx += 1 if idx > %line0% Break content = % line%idx% if content <> { StringSplit, var, content, `, if var6 <> { Loop { if A_Index > %tmp0% Break temp = % tmp%A_Index% if temp <> { IfInString, temp, + { StringReplace, tp, temp, +, , All if tp is Number { tempdate := date - tp if tempdate = var6 FileAppend, %temp%`,%var1%`,%var2%`,%var3%`,%var4%`,%var5%`,%var6%`,%var7%`,%var8%`,%var9%`n, %A_Scriptdir%\data\%date%.csv } } Else { StringReplace, tp, temp, E, , All a = %var6% StringLeft, ay, a, 4 StringTrimLeft, a, a, 4 StringLeft, am, a, 2 StringTrimLeft, a, a, 2 StringLeft, ad, a, 2 cy := ay-2000 ar := cy/4 StringSplit, cr, ar, . cr = %cr1% amd = %am%%ad% IfInString, ar, .000000 { if amd > 0229 cr += 1 } cm = % m%am% cd := ad-1 atmp := cy*365+cm+cr+cd x := btmp-atmp if x < 1 Continue if tp is Number { e = %tp% xe := x/e IfInString, xe, .000000 FileAppend, %temp%`,%var1%`,%var2%`,%var3%`,%var4%`,%var5%`,%var6%`,%var7%`,%var8%`,%var9%`n, %A_Scriptdir%\data\%date%.csv } if tp = W { e = 7 xe := x/e IfInString, xe, .000000 FileAppend, %temp%`,%var1%`,%var2%`,%var3%`,%var4%`,%var5%`,%var6%`,%var7%`,%var8%`,%var9%`n, %A_Scriptdir%\data\%date%.csv } if tp = M { if ad = %bd% FileAppend, %temp%`,%var1%`,%var2%`,%var3%`,%var4%`,%var5%`,%var6%`,%var7%`,%var8%`,%var9%`n, %A_Scriptdir%\data\%date%.csv } if tp = Y { amd = %am%%ad% if amd = %bmd% FileAppend, %temp%`,%var1%`,%var2%`,%var3%`,%var4%`,%var5%`,%var6%`,%var7%`,%var8%`,%var9%`n, %A_Scriptdir%\data\%date%.csv } } } } } } noask = 0 } show: IfWinNotExist, 销售信息日常关怀提醒 双击查看/标记 { Gui, 3:Add, Text, x0 y10 w40 h20 , 姓名 Gui, 3:Add, Edit, x40 y10 w200 h20 v3name Gui, 3:Add, Text, x0 y50 w40 h20 , 手机 Gui, 3:Add, Edit, x40 y50 w200 h20 v3cell Gui, 3:Add, Text, x0 y190 w40 h20 , 电话 Gui, 3:Add, Edit, x40 y190 w200 h20 v3phone Gui, 3:Add, Text, x0 y70 w40 h20 , 产品 Gui, 3:Add, Edit, x40 y70 w200 h20 v3product Gui, 3:Add, Text, x0 y90 w40 h40 , 产品信息 Gui, 3:Add, Edit, x40 y90 w200 h100 v3info Gui, 3:Add, MonthCal, x250 y80 w270 h180 v3pdate, Gui, 3:Add, Button, x250 y260 w270 h20 gcdate, 查看此日提醒 Gui, 3:Add, Text, x250 y60 w270 h20 vgdate, 购买时间 Gui, 3:Add, Text, x0 y30 w40 h20 , QQ Gui, 3:Add, Edit, x40 y30 w200 h20 v3qq Gui, 3:Add, Text, x0 y210 w40 h50 , 住址 Gui, 3:Add, Edit, x40 y210 w200 h80 v3site Gui, 3:Add, Text, x250 y10 w30 h50 , 备注 Gui, 3:Add, Edit, x280 y10 w240 h50 v3note Gui, 3:Add, ListView, x6 y300 w520 h200 glist, ID|标记|触发规则|姓名|电话|手机|产品型号|产品信息|日期|QQ|地址|备注 Gui, 3:Show, , 销售信息日常关怀提醒 双击查看/标记 Gui, 3:Default } IfExist, %A_Scriptdir%\data\%date%.csv { Loop { FileReadLine, line, %A_Scriptdir%\data\%date%.csv, %A_Index% if errorlevel Break StringSplit, var, line, `,, IniRead, chk, config.ini, %date%, %A_Index% if chk = 1 LV_Add("", A_Index,"√",var1,var2,var3,var4,var5,var6,var7,var8,var9,var10) Else LV_Add("", A_Index,"",var1,var2,var3,var4,var5,var6,var7,var8,var9,var10) } LV_ModifyCol() } Return list: FocusedRowNumber := LV_GetNext(0, "F") if FocusedRowNumber { LV_GetText(id, FocusedRowNumber, 1) LV_GetText(mark, FocusedRowNumber, 2) if mark <> √ { LV_Modify(FocusedRowNumber, Col, id, "√") IniWrite, 1, config.ini, %date%, %id% } Else { LV_Modify(FocusedRowNumber, Col, id, "") IniDelete, config.ini, %date%, %id% } FileReadLine, line, %A_Scriptdir%\data\%date%.csv, %id% StringSplit, var, line, `, name = %var2% phone = %var3% cell = %var4% product = %var5% info = %var6% pdate = %var7% qq = %var8% site = %var9% note = %var10% StringLeft, py, pdate, 4 StringTrimLeft, p, pdate, 4 StringLeft, pm, p, 2 StringTrimLeft, p, p, 2 StringLeft, pd, p, 2 pdate = %py%-%pm%-%pd% StringReplace, info, info, \n, `n, All StringReplace, site, site, \n, `n, All StringReplace, note, note, \n, `n, All GuiControl, 3:, 3name, %name% GuiControl, 3:, 3phone, %phone% GuiControl, 3:, 3cell, %cell% GuiControl, 3:, 3product, %product% GuiControl, 3:, 3info, %info% GuiControl, 3:, gdate, 购买时间:%pdate% GuiControl, 3:, 3qq, %qq% GuiControl, 3:, 3site, %site% GuiControl, 3:, 3note, %note% } LV_ModifyCol() Return cdate: GuiControlGet, 3pdate StringReplace, 3pdate, 3pdate, -, , All date = %3pdate% LV_Delete() FileDelete, %A_Scriptdir%\data\%date%.csv noask = 1 goto, 查看今日提醒 Return 3GuiClose: gui 3:Destroy Return 销售信息录入: bk = 0 IfWinNotExist, 销售信息录入 { Gui, Add, Text, x0 y10 w40 h20 , 姓名 Gui, Add, Edit, x40 y10 w200 h20 vname Gui, Add, Text, x0 y50 w40 h20 , 手机 Gui, Add, Edit, x40 y50 w200 h20 vcell Gui, Add, Text, x0 y190 w40 h20 , 电话 Gui, Add, Edit, x40 y190 w200 h20 vphone Gui, Add, Text, x0 y70 w40 h20 , 产品 Gui, Add, Edit, x40 y70 w200 h20 vproduct Gui, Add, Text, x0 y90 w40 h40 , 产品信息 Gui, Add, Edit, x40 y90 w200 h100 vinfo Gui, Add, MonthCal, x250 y80 w270 h180 vpdate, Gui, Add, Text, x250 y60 w270 h20, 购买时间 Gui, Add, Button, x250 y260 w270 h30 gsubmit, 提交 Gui, Add, Text, x0 y30 w40 h20 , QQ Gui, Add, Edit, x40 y30 w200 h20 vqq Gui, Add, Text, x0 y210 w40 h50 , 住址 Gui, Add, Edit, x40 y210 w200 h80 vsite Gui, Add, Text, x250 y10 w30 h50 , 备注 Gui, Add, Edit, x280 y10 w240 h50 vnote Gui, Show, , 销售信息录入 } Else WinActivate, 销售信息录入 Return submit: GuiControlGet, name GuiControlGet, phone GuiControlGet, cell GuiControlGet, product GuiControlGet, info GuiControlGet, pdate GuiControlGet, qq GuiControlGet, site GuiControlGet, note if name = { MsgBox, 姓名不能为空! Return } if cell = { MsgBox, 手机不能为空! Return } GuiControl, , name, GuiControl, , phone, GuiControl, , cell, GuiControl, , product, GuiControl, , info, GuiControl, , qq, GuiControl, , site, GuiControl, , note, StringReplace, info, info, `,, ,, All StringReplace, info, info, `n, \n, All StringReplace, site, site, `,, ,, All StringReplace, site, site, `n, \n, All StringReplace, note, note, `,, ,, All StringReplace, note, note, `n, \n, All StringReplace, note, note, `,, ,, All StringReplace, pdate, pdate, -, , All FileAppend, %name%`,%phone%`,%cell%`,%product%`,%info%`,%pdate%`,%qq%`,%site%`,%note%`n, 信息.csv if bk = 1 gui, Destroy Return 提醒规则管理: FileRead, rules, rules.ini Gui, 2:add, text, x0 y0 w200 h80, 请输入规则,示例:`n+6则延后6天提醒`nE7则每隔7天`nEW每周`nEM每月`nEY每年,每排一个 gui, 2:add, edit, x0 y80 w200 h200 vrules, gui, 2:add, button, x0 y280 w200 h20 gsave, 保存 gui, 2:show, , 规则管理 GuiControl, 2:, rules, %rules% Return 2GuiClose: MsgBox, 36, 询问, 是否保存修改? IfMsgBox, Yes { GuiControlGet, rules FileDelete, rules.ini FileAppend, %rules%, rules.ini } gui 2:Destroy Return save: GuiControlGet, rules FileDelete, rules.ini FileAppend, %rules%, rules.ini MsgBox, 64, 提示, 已保存完毕! Return 退出: IniWrite, %date%, config.ini, setting, lastuse RegRead, reg, HKCU, Software\Microsoft\Windows\CurrentVersion\Run, attention if Errorlevel goto, addautorun if reg <> %A_ScriptFullPath% goto, addautorun ExitApp GuiClose: MsgBox, 36, 询问, 是否提交当前录入信息? IfMsgBox, Yes { bk = 1 goto, submit } Gui, Destroy noask = 0 Return addautorun: if disauto <> 1 { MsgBox, 67, 提醒, 程序没有加入开机启动,是否加入?`n程序仅在开机加载完成后工作,不影响启动时间。`n取消则不再询问。 IfMsgBox, Yes { RegWrite, REG_SZ, HKCU, Software\Microsoft\Windows\CurrentVersion\Run, attention, %A_ScriptFullPath% If Errorlevel MsgBox, 16, 错误, 没有权限或者被安全软件拦截了,请下次再试! } IfMsgBox, Cancel { IniWrite, 1, config.ini, setting, disautorun } } ExitApp
49 queries in 1.398 seconds |