SalesDataAnalysisVC.m 247 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013
  1. //
  2. // SalesDataAnalysisVC.m
  3. // IBOSS-HJ
  4. //
  5. // Created by 关宏厚 on 2020/12/30.
  6. // Copyright © 2020 elongtian. All rights reserved.
  7. //
  8. #import "SalesDataAnalysisVC.h"
  9. @interface SalesDataAnalysisVC ()
  10. {
  11. UIScrollView *scroll;
  12. UIView *content;
  13. UIView *salesStatusContent;
  14. CAShapeLayer *btnSalesStatusCustomMaskLayer;
  15. CAShapeLayer *btnSalesStatusRecentlyThirtyDaysMaskLayer;
  16. NSInteger topMargin;
  17. UIView *vDate;
  18. UIView *collectionContent;
  19. UIView *salesAmountContent;
  20. UIView *orderStatusContent;
  21. UIView *repairStatusContent;
  22. UIView *shoppingGuideFilingContent;
  23. UIView *deliveryStatusContent;
  24. UIView *installStatusContent;
  25. UIView *salesAchievementContent;
  26. UIView *nextThreeDaysNeedDeliveyCountView;
  27. UIView *orderAmountContent;
  28. UILabel *lblSalesAmount;
  29. UILabel *lblCollectionAmount;
  30. UILabel *lblSalesAddCustomer;
  31. UILabel *lblOrderCustomerCount;
  32. UILabel *lblUnsubscribeCustomerCount;
  33. UILabel *lblOrderAmount;
  34. UILabel *lblUnsubscribeAmount;
  35. UIView *vCollectionStatusDate;
  36. UILabel *lblSalesCustomerCount;
  37. UILabel *lblSalesAchievementPercent;
  38. CAShapeLayer *btnSalesStatusChannelMaskLayer;
  39. CAShapeLayer *btnSalesStatusDepartmentMaskLayer;
  40. CAShapeLayer *btnCollectionStatusChannelMaskLayer;
  41. CAShapeLayer *btnCollectionStatusDepartmentMaskLayer;
  42. CAShapeLayer *btnCollectionStatusCustomMaskLayer;
  43. CAShapeLayer *btnCollectionStatusRecentlyThirtyDaysMaskLayer;
  44. UIView *collectionAmountContent;
  45. CAShapeLayer *btnOrderStatusCustomMaskLayer;
  46. CAShapeLayer *btnOrderStatusRecentlyThirtyDaysMaskLayer;
  47. CAShapeLayer *btnOrderStatusChannelMaskLayer;
  48. CAShapeLayer *btnOrderStatusDepartmentMaskLayer;
  49. CAShapeLayer *btnSalesAchievementCustomMaskLayer;
  50. CAShapeLayer *btnSalesAchievementCurrentMonthMaskLayer;
  51. UIView *vOrderStatusDate;
  52. UILabel *lblSalesAchievementPlanAmount;
  53. UILabel *lblSalesAchievementSalesAmount;
  54. CAShapeLayer *btnSalesAchievementDepartmentMaskLayer;
  55. CAShapeLayer *btnSalesAchievementStaffMaskLayer;
  56. UILabel *lblFilingCustomerCount;
  57. UILabel *lblTransactionCustomerCount;
  58. UILabel *lblTransactionPercent;
  59. UILabel *lblDeliveryPercent;
  60. UILabel *lblInstallPercent;
  61. UILabel *lblRepairPercent;
  62. UILabel *lblNeedDeliveryCustomerCount;
  63. UILabel *lblDeliveredCustomerCount;
  64. UILabel *lblNeedInstallCustomerCount;
  65. UILabel *lblInstalledCustomerCount;
  66. UILabel *lblNeedRepairCustomerCount;
  67. UILabel *lblRepairedCustomerCount;
  68. UILabel *lblNextDayNeedDeliveryCount;
  69. UILabel *lblNextTwoDaysNeedDeliveryCount;
  70. UILabel *lblNextThreeDaysNeedDeliveryCount;
  71. UILabel *lblNextDayNeedInstallCount;
  72. UILabel *lblNextTwoDaysNeedInstallCount;
  73. UILabel *lblNextThreeDaysNeedInstallCount;
  74. UILabel *lblNextDayNeedRepairCount;
  75. UILabel *lblNextTwoDaysNeedRepairCount;
  76. UILabel *lblNextThreeDaysNeedRepairCount;
  77. NSMutableArray *salesStatusXArray;
  78. NSMutableArray *salesStatusYArray;
  79. NSMutableArray *collectionStatusXArray;
  80. NSMutableArray *collectionStatusYArray;
  81. NSMutableArray *orderStatusXArray;
  82. NSMutableArray *orderStatusYArray;
  83. NSMutableArray *salesAchievementXArray;
  84. NSMutableArray *salesAchievementYArray;
  85. NSMutableArray *salesAchievementTitleArray;
  86. NSMutableArray *shoppingGuideXArray;
  87. NSMutableArray *shoppingGuideYArray;
  88. NSMutableArray *shoppingGuideTitleArray;
  89. CGFloat height;
  90. NSString *typeId;
  91. NSString *salesAchievementTypeId;
  92. NSString *cashStatusTypeId;
  93. NSString *orderStatusTypeId;
  94. UIView *nextDayNeedDeliveyCountView;
  95. UIView *nextDayNeedInstallCountView;
  96. UIView *nextDayNeedRepairCountView;
  97. CustomBorderView *salesStatusBorderV;
  98. CustomBorderView *collectionStatusBorderV;
  99. CustomBorderView *orderStatusBorderV;
  100. CustomBorderView *shoppingGuidePieBorderV;
  101. CustomBorderView *shoppingGuideChartBorderV;
  102. CustomBorderView *deliveryStatusBorderV;
  103. CustomBorderView *installStatusBorderV;
  104. CustomBorderView *repairStatusBorderV;
  105. CustomBorderView *salesAchievementBorderV;
  106. CustomBorderView *salesAchievementPieBorderV;
  107. int borderWidth;
  108. }
  109. @end
  110. @implementation SalesDataAnalysisVC
  111. #pragma mark - 公共函数
  112. - (void)viewDidLoad {
  113. [super viewDidLoad];
  114. topMargin=15;
  115. typeId=@"1";
  116. height=0;
  117. borderWidth=1;
  118. cashStatusTypeId=@"1";
  119. orderStatusTypeId=@"1";
  120. salesAchievementTypeId=@"0";
  121. salesStatusXArray=[[NSMutableArray alloc]init];
  122. salesStatusYArray=[[NSMutableArray alloc]init];
  123. collectionStatusXArray=[[NSMutableArray alloc]init];
  124. collectionStatusYArray=[[NSMutableArray alloc]init];
  125. NSArray *initDateArray= [DateFormat getMonthFirstLastDay];
  126. _shoppingGuideStartDate=[initDateArray objectAtIndex:0];
  127. _shoppingGuideEndDate=[DateFormat getCurrentDate];
  128. _deliveryStatusStartDate=[initDateArray objectAtIndex:0];
  129. _deliveryStatusEndDate=[DateFormat getCurrentDate];
  130. _installStatusStartDate=[initDateArray objectAtIndex:0];
  131. _installStatusEndDate=[DateFormat getCurrentDate];
  132. _repairStatusStartDate=[initDateArray objectAtIndex:0];
  133. _repairStatusEndDate=[DateFormat getCurrentDate];
  134. orderStatusXArray=[[NSMutableArray alloc]init];
  135. orderStatusYArray=[[NSMutableArray alloc]init];
  136. salesAchievementXArray=[[NSMutableArray alloc]init];
  137. // [salesAchievementXArray addObject:@"总经办"];
  138. // [salesAchievementXArray addObject:@"工程部"];
  139. // [salesAchievementXArray addObject:@"采购中心"];
  140. salesAchievementYArray=[[NSMutableArray alloc]init];
  141. // NSMutableDictionary *dic=[[NSMutableDictionary alloc]init];
  142. // [dic setObject:@"40000" forKey:@"planAmount"];
  143. // [dic setObject:@"38000" forKey:@"saleAmount"];
  144. // [salesAchievementYArray addObject:dic];
  145. // NSMutableDictionary *dic1=[[NSMutableDictionary alloc]init];
  146. // [dic1 setObject:@"30000" forKey:@"planAmount"];
  147. // [dic1 setObject:@"20000" forKey:@"saleAmount"];
  148. // [salesAchievementYArray addObject:dic1];
  149. //
  150. // NSMutableDictionary *dic2=[[NSMutableDictionary alloc]init];
  151. // [dic2 setObject:@"35000" forKey:@"planAmount"];
  152. // [dic2 setObject:@"23000" forKey:@"saleAmount"];
  153. // [salesAchievementYArray addObject:dic2];
  154. salesAchievementTitleArray=[[NSMutableArray alloc]init];
  155. [salesAchievementTitleArray addObject:@"任务额"];
  156. [salesAchievementTitleArray addObject:@"销售额"];
  157. shoppingGuideXArray=[[NSMutableArray alloc]init];
  158. shoppingGuideTitleArray=[[NSMutableArray alloc]init];
  159. [shoppingGuideTitleArray addObject:@"成交客户数"];
  160. [shoppingGuideTitleArray addObject:@"报备客户数"];
  161. shoppingGuideYArray=[[NSMutableArray alloc]init];
  162. [self loadNavStyle];
  163. [self initUI];
  164. [self startLoading];
  165. _salesStatusStartDate=[initDateArray objectAtIndex:0];
  166. _salesStatusEndDate=[DateFormat getCurrentDate];
  167. _collectionStatusStartDate=[initDateArray objectAtIndex:0];
  168. _collectionStatusEndDate=[DateFormat getCurrentDate];
  169. // _orderStatusStartDate=[DateFormat getCurrentDate];
  170. _orderStatusStartDate=[initDateArray objectAtIndex:0];
  171. _orderStatusEndDate=[DateFormat getCurrentDate];
  172. cashStatusTypeId=@"1";
  173. _salesAchievementMonth=[DateFormat getCurrentNoSeparateMonth];
  174. [self asyncConcurrent];
  175. }
  176. #pragma mark - 私有函数
  177. /**
  178. 切换销售利润按钮颜色
  179. */
  180. -(void)changeSalesStatusButtonColor
  181. {
  182. btnSalesStatusCustomMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  183. _btnSalesStatusToday.layer.borderColor=[UIColor lightGrayColor].CGColor;
  184. _btnSalesStatusYesterday.layer.borderColor=[UIColor lightGrayColor].CGColor;
  185. _btnSalesStatusRecentlySevenDays.layer.borderColor=[UIColor lightGrayColor].CGColor;
  186. btnSalesStatusRecentlyThirtyDaysMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  187. [_btnSalesStatusCustom setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  188. [_btnSalesStatusToday setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  189. [_btnSalesStatusYesterday setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  190. [_btnSalesStatusRecentlySevenDays setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  191. [_btnSalesStatusRecentlyThirtyDays setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  192. }
  193. -(void)changeOrderStatusButtonColor
  194. {
  195. btnOrderStatusCustomMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  196. [_btnOrderStatusCustom setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  197. _btnOrderStatusToday.layer.borderColor=[UIColor lightGrayColor].CGColor;
  198. [_btnOrderStatusToday setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  199. _btnOrderStatusYesterday.layer.borderColor=[UIColor lightGrayColor].CGColor;
  200. [_btnOrderStatusYesterday setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  201. _btnOrderStatusRecentlySevenDays.layer.borderColor=[UIColor lightGrayColor].CGColor;
  202. [_btnOrderStatusRecentlySevenDays setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  203. btnOrderStatusRecentlyThirtyDaysMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  204. [_btnOrderStatusRecentlyThirtyDays setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  205. }
  206. -(void)changeCashStatusButtonColor
  207. {
  208. btnCollectionStatusCustomMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  209. [_btnCollectionStatusCustom setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  210. _btnCollectionStatusToday.layer.borderColor=[UIColor lightGrayColor].CGColor;
  211. [_btnCollectionStatusToday setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  212. _btnCollectionStatusYesterday.layer.borderColor=[UIColor lightGrayColor].CGColor;
  213. [_btnCollectionStatusYesterday setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  214. _btnCollectionStatusRecentlySevenDays.layer.borderColor=[UIColor lightGrayColor].CGColor;
  215. [_btnCollectionStatusRecentlySevenDays setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  216. btnCollectionStatusRecentlyThirtyDaysMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  217. [_btnCollectionStatusRecentlyThirtyDays setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  218. }
  219. -(void)clearSalesStatusData
  220. {
  221. lblSalesAmount.text=@"0.00";
  222. lblSalesAddCustomer.text=@"0";
  223. lblSalesCustomerCount.text=@"0";
  224. }
  225. -(void)clearCollectionStatusData
  226. {
  227. lblCollectionAmount.text=@"0.00";
  228. }
  229. -(void)clearOrderStatusData
  230. {
  231. lblOrderCustomerCount.text=@"0";
  232. lblUnsubscribeCustomerCount.text=@"0";
  233. lblOrderAmount.text=@"0.00";
  234. lblUnsubscribeAmount.text=@"0.00";
  235. }
  236. -(void)clearSalesAchievementData
  237. {
  238. lblSalesAchievementPercent.text=@"完成率0.00%";
  239. lblSalesAchievementSalesAmount.text=@"0.00";
  240. lblSalesAchievementPlanAmount.text=@"0.00";
  241. }
  242. -(void)clearShoppingGuideFilingData
  243. {
  244. lblFilingCustomerCount.text=@"0";
  245. lblTransactionCustomerCount.text=@"0";
  246. lblTransactionPercent.text=@"成交率0.00%";
  247. }
  248. -(void)clearDeliveryData
  249. {
  250. lblDeliveredCustomerCount.text=@"0";
  251. lblNeedDeliveryCustomerCount.text=@"0";
  252. lblNextDayNeedDeliveryCount.text=@"0";
  253. lblNextTwoDaysNeedDeliveryCount.text=@"0";
  254. lblNextThreeDaysNeedDeliveryCount.text=@"0";
  255. lblDeliveryPercent.text=@"完成率0.00%";
  256. }
  257. -(void)clearInstallData
  258. {
  259. lblNeedInstallCustomerCount.text=@"0";
  260. lblInstalledCustomerCount.text=@"0";
  261. lblNextDayNeedInstallCount.text=@"0";
  262. lblNextTwoDaysNeedInstallCount.text=@"0";
  263. lblNextThreeDaysNeedInstallCount.text=@"0";
  264. lblInstallPercent.text=@"完成率0.00%";
  265. }
  266. -(void)clearRepairData
  267. {
  268. lblNeedRepairCustomerCount.text=@"0";
  269. lblRepairedCustomerCount.text=@"0";
  270. lblNextDayNeedRepairCount.text=@"0";
  271. lblNextTwoDaysNeedRepairCount.text=@"0";
  272. lblNextThreeDaysNeedRepairCount.text=@"0";
  273. }
  274. /**
  275. 导航按钮样式
  276. */
  277. -(void)loadNavStyle
  278. {
  279. self.navigationItem.title=@"销售数据分析";
  280. //返回
  281. UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
  282. [button setBackgroundImage:[UIImage imageNamed:@"icon_back"]
  283. forState:UIControlStateNormal];
  284. [button addTarget:self action:@selector(goBack)
  285. forControlEvents:UIControlEventTouchUpInside];
  286. button.frame = CGRectMake(0, 0, 15, 18);
  287. UIBarButtonItem *menuButton = [[UIBarButtonItem alloc] initWithCustomView:button];
  288. self.navigationItem.leftBarButtonItem = menuButton;
  289. }
  290. /**
  291. 获取y轴最大值
  292. */
  293. -(double)getYAxisMaximumValue:(NSMutableArray*) yValueArray
  294. {
  295. double maximumValue=[[yValueArray objectAtIndex:0]doubleValue];
  296. for(int i=1;i<yValueArray.count;i++)
  297. {
  298. double yValue=[[yValueArray objectAtIndex:i]doubleValue];
  299. if(yValue>maximumValue)
  300. {
  301. maximumValue=yValue;
  302. }
  303. }
  304. return maximumValue;
  305. }
  306. /**
  307. 获取y轴最小值
  308. */
  309. -(double)getYAxisMinimumValue:(NSMutableArray*) yValueArray
  310. {
  311. double minimumValue=[[yValueArray objectAtIndex:0]doubleValue];
  312. for(int i=1;i<yValueArray.count;i++)
  313. {
  314. double yValue=[[yValueArray objectAtIndex:i]doubleValue];
  315. if(yValue<minimumValue)
  316. {
  317. minimumValue=yValue;
  318. }
  319. }
  320. return minimumValue;
  321. }
  322. /**
  323. 选择销售状态开始日期
  324. */
  325. - (void)btnSelectStartDate
  326. {
  327. __weak typeof(self) weakself=self;
  328. _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""];
  329. [_dealDatePicker configureSelectionBlock:^(NSString *date){
  330. _tempSalesStatusStartDate=date;
  331. } andCompletionBlock:^(void){
  332. _salesStatusStartDate = _tempSalesStatusStartDate;
  333. [weakself.btnSalesStatusStartDate setTitle:_salesStatusStartDate forState:UIControlStateNormal];
  334. [self startLoading];
  335. [salesStatusXArray removeAllObjects];
  336. [salesStatusYArray removeAllObjects];
  337. [self clearSalesStatusData];
  338. [self loadSalesStatusData];
  339. } andCancelBlock:^(void){
  340. }];
  341. [_dealDatePicker show];
  342. }
  343. /**
  344. 选择销售状态结束日期
  345. */
  346. - (void)btnSelectEndDate
  347. {
  348. __weak typeof(self) weakself=self;
  349. _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""];
  350. [_dealDatePicker configureSelectionBlock:^(NSString *date){
  351. _tempSalesStatusEndDate=date;
  352. } andCompletionBlock:^(void){
  353. _salesStatusEndDate = _tempSalesStatusEndDate;
  354. [weakself.btnSalesStatusEndDate setTitle:_salesStatusEndDate forState:UIControlStateNormal];
  355. [salesStatusXArray removeAllObjects];
  356. [salesStatusYArray removeAllObjects];
  357. [self clearSalesStatusData];
  358. [self startLoading];
  359. [self loadSalesStatusData];
  360. } andCancelBlock:^(void){
  361. }];
  362. [_dealDatePicker show];
  363. }
  364. -(void)selectCollectionStatusCustomDateData
  365. {
  366. vCollectionStatusDate.hidden=NO;
  367. vCollectionStatusDate.frame=CGRectMake(0, CGRectGetMaxY(_btnCollectionStatusCustom.frame)+topMargin, Screen_Width, 25);
  368. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_STATUS_IPHONE].location!=NSNotFound){
  369. salesAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnSalesStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(salesStatusBorderV.frame)+10);
  370. salesStatusContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10);
  371. height=CGRectGetMaxY(salesStatusContent.frame);
  372. // }
  373. collectionAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnCollectionStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(collectionStatusBorderV.frame)+10);
  374. collectionContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10);
  375. height=CGRectGetMaxY(collectionContent.frame);
  376. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_ORDER_STATUS_IPHONE].location!=NSNotFound){
  377. orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10);
  378. height=CGRectGetMaxY(orderStatusContent.frame);
  379. //}
  380. salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10);
  381. height=CGRectGetMaxY(salesAchievementContent.frame);
  382. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound)
  383. // {
  384. shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10);
  385. height=CGRectGetMaxY(shoppingGuideFilingContent.frame);
  386. // }
  387. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound)
  388. // {
  389. deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30);
  390. height=CGRectGetMaxY(deliveryStatusContent.frame);
  391. // }
  392. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound)
  393. // {
  394. installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30);
  395. height=CGRectGetMaxY(installStatusContent.frame);
  396. // }
  397. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound)
  398. // {
  399. repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30);
  400. height=CGRectGetMaxY(repairStatusContent.frame);
  401. // }
  402. // orderStatusContent.frame=CGRectMake(10, CGRectGetMaxY(collectionContent.frame)+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10);
  403. //
  404. // shoppingGuideFilingContent.frame=CGRectMake(10, CGRectGetMaxY(orderStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10);
  405. // deliveryStatusContent.frame=CGRectMake(10, CGRectGetMaxY(shoppingGuideFilingContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30);
  406. // installStatusContent.frame=CGRectMake(10, CGRectGetMaxY(deliveryStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30);
  407. //
  408. // repairStatusContent.frame=CGRectMake(10, CGRectGetMaxY(installStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30);
  409. _collectionStatusStartDate=[DateFormat getCurrentDate];
  410. _collectionStatusEndDate=[DateFormat getCurrentDate];
  411. [_btnCollectionStatusStartDate setTitle:_collectionStatusStartDate forState:UIControlStateNormal];
  412. [_btnCollectionStatusEndDate setTitle:_collectionStatusEndDate forState:UIControlStateNormal];
  413. [self changeCashStatusButtonColor];
  414. btnCollectionStatusCustomMaskLayer.strokeColor=[UIColor redColor].CGColor;
  415. [_btnCollectionStatusCustom setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  416. }
  417. -(void)selectCustomDateData
  418. {
  419. vDate.hidden=NO;
  420. vDate.frame=CGRectMake(0, CGRectGetMaxY(_btnSalesStatusCustom.frame)+topMargin, Screen_Width, 25);
  421. salesAmountContent.frame=CGRectMake(0, CGRectGetMaxY(vDate.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(salesStatusBorderV.frame)+10);
  422. salesStatusContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10);
  423. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_COLLECTION_STATUS_IPHONE].location!=NSNotFound){
  424. collectionContent.frame=CGRectMake(10, CGRectGetMaxY(salesStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10);
  425. height=CGRectGetMaxY(collectionContent.frame);
  426. // }
  427. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_ORDER_STATUS_IPHONE].location!=NSNotFound){
  428. orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10);
  429. height=CGRectGetMaxY(orderStatusContent.frame);
  430. // }
  431. salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10);
  432. height=CGRectGetMaxY(salesAchievementContent.frame);
  433. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound)
  434. // {
  435. shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10);
  436. height=CGRectGetMaxY(shoppingGuideFilingContent.frame);
  437. // }
  438. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound)
  439. // {
  440. deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30);
  441. height=CGRectGetMaxY(deliveryStatusContent.frame);
  442. // }
  443. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound)
  444. // {
  445. installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30);
  446. height=CGRectGetMaxY(installStatusContent.frame);
  447. //}
  448. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound)
  449. // {
  450. repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30);
  451. height=CGRectGetMaxY(repairStatusContent.frame);
  452. // }
  453. _salesStatusStartDate=[DateFormat getCurrentDate];
  454. _salesStatusEndDate=[DateFormat getCurrentDate];
  455. [_btnSalesStatusStartDate setTitle:_salesStatusStartDate forState:UIControlStateNormal];
  456. [_btnSalesStatusEndDate setTitle:_salesStatusEndDate forState:UIControlStateNormal];
  457. [self changeSalesStatusButtonColor];
  458. btnSalesStatusCustomMaskLayer.strokeColor=[UIColor redColor].CGColor;
  459. [_btnSalesStatusCustom setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  460. }
  461. -(void)selectSevenDaysData
  462. {
  463. vDate.hidden=YES;
  464. [self changeSalesStatusButtonColor];
  465. _btnSalesStatusRecentlySevenDays.layer.borderColor=[UIColor redColor].CGColor;
  466. [_btnSalesStatusRecentlySevenDays setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  467. _salesStatusStartDate=[DateFormat getDateBefore:7];
  468. _salesStatusEndDate=[DateFormat getCurrentDate];
  469. salesAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnSalesStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(salesStatusBorderV.frame)+10);
  470. salesStatusContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10);
  471. height=CGRectGetMaxY(salesStatusContent.frame);
  472. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_COLLECTION_STATUS_IPHONE].location!=NSNotFound){
  473. collectionContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10);
  474. height=CGRectGetMaxY(collectionContent.frame);
  475. // }
  476. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_ORDER_STATUS_IPHONE].location!=NSNotFound){
  477. orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10);
  478. height=CGRectGetMaxY(orderStatusContent.frame);
  479. // }
  480. salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10);
  481. height=CGRectGetMaxY(salesAchievementContent.frame);
  482. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound)
  483. // {
  484. shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10);
  485. height=CGRectGetMaxY(shoppingGuideFilingContent.frame);
  486. // }
  487. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound)
  488. // {
  489. deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30);
  490. height=CGRectGetMaxY(deliveryStatusContent.frame);
  491. // }
  492. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound)
  493. // {
  494. installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30);
  495. height=CGRectGetMaxY(installStatusContent.frame);
  496. // }
  497. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound)
  498. // {
  499. repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30);
  500. height=CGRectGetMaxY(repairStatusContent.frame);
  501. // }
  502. // collectionContent.frame=CGRectMake(10, CGRectGetMaxY(salesStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10);
  503. //
  504. // orderStatusContent.frame=CGRectMake(10, CGRectGetMaxY(collectionContent.frame)+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10);
  505. //
  506. // shoppingGuideFilingContent.frame=CGRectMake(10, CGRectGetMaxY(orderStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10);
  507. // deliveryStatusContent.frame=CGRectMake(10, CGRectGetMaxY(shoppingGuideFilingContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30);
  508. // installStatusContent.frame=CGRectMake(10, CGRectGetMaxY(deliveryStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30);
  509. //
  510. // repairStatusContent.frame=CGRectMake(10, CGRectGetMaxY(installStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30);
  511. [salesStatusXArray removeAllObjects];
  512. [salesStatusYArray removeAllObjects];
  513. [self clearSalesStatusData];
  514. [self startLoading];
  515. [self loadSalesStatusData];
  516. }
  517. -(void)selectThirtyDaysData
  518. {
  519. vDate.hidden=YES;
  520. [self changeSalesStatusButtonColor];
  521. _btnSalesStatusRecentlyThirtyDays.layer.borderColor=[UIColor redColor].CGColor;
  522. [_btnSalesStatusRecentlyThirtyDays setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  523. _salesStatusStartDate=[DateFormat getDateBefore:30];
  524. _salesStatusEndDate=[DateFormat getCurrentDate];
  525. salesAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnSalesStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(salesStatusBorderV.frame)+10);
  526. salesStatusContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10);
  527. height=CGRectGetMaxY(salesStatusContent.frame);
  528. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_COLLECTION_STATUS_IPHONE].location!=NSNotFound){
  529. collectionContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10);
  530. height=CGRectGetMaxY(collectionContent.frame);
  531. // }
  532. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_ORDER_STATUS_IPHONE].location!=NSNotFound){
  533. orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10);
  534. height=CGRectGetMaxY(orderStatusContent.frame);
  535. //}
  536. salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10);
  537. height=CGRectGetMaxY(salesAchievementContent.frame);
  538. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound)
  539. // {
  540. shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10);
  541. height=CGRectGetMaxY(shoppingGuideFilingContent.frame);
  542. // }
  543. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound)
  544. // {
  545. deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30);
  546. height=CGRectGetMaxY(deliveryStatusContent.frame);
  547. // }
  548. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound)
  549. // {
  550. installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30);
  551. height=CGRectGetMaxY(installStatusContent.frame);
  552. // }
  553. //
  554. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound)
  555. // {
  556. repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30);
  557. height=CGRectGetMaxY(repairStatusContent.frame);
  558. // }
  559. //
  560. // collectionContent.frame=CGRectMake(10, CGRectGetMaxY(salesStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10);
  561. //
  562. // orderStatusContent.frame=CGRectMake(10, CGRectGetMaxY(collectionContent.frame)+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10);
  563. //
  564. // shoppingGuideFilingContent.frame=CGRectMake(10, CGRectGetMaxY(orderStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10);
  565. // deliveryStatusContent.frame=CGRectMake(10, CGRectGetMaxY(shoppingGuideFilingContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30);
  566. // installStatusContent.frame=CGRectMake(10, CGRectGetMaxY(deliveryStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30);
  567. //
  568. // repairStatusContent.frame=CGRectMake(10, CGRectGetMaxY(installStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30);
  569. //
  570. [salesStatusXArray removeAllObjects];
  571. [salesStatusYArray removeAllObjects];
  572. [self clearSalesStatusData];
  573. [self startLoading];
  574. [self loadSalesStatusData];
  575. }
  576. -(void)selectTodayDateData
  577. {
  578. vDate.hidden=YES;
  579. [salesStatusXArray removeAllObjects];
  580. [salesStatusYArray removeAllObjects];
  581. [self changeSalesStatusButtonColor];
  582. _btnSalesStatusToday.layer.borderColor=[UIColor redColor].CGColor;
  583. [_btnSalesStatusToday setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  584. _salesStatusStartDate=[DateFormat getCurrentDate];
  585. _salesStatusEndDate=[DateFormat getCurrentDate];
  586. salesAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnSalesStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(salesStatusBorderV.frame)+10);
  587. salesStatusContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10);
  588. height=CGRectGetMaxY(salesStatusContent.frame);
  589. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_COLLECTION_STATUS_IPHONE].location!=NSNotFound){
  590. collectionContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10);
  591. height=CGRectGetMaxY(collectionContent.frame);
  592. //}
  593. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_ORDER_STATUS_IPHONE].location!=NSNotFound){
  594. orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10);
  595. height=CGRectGetMaxY(orderStatusContent.frame);
  596. //}
  597. salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10);
  598. height=CGRectGetMaxY(salesAchievementContent.frame);
  599. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound)
  600. // {
  601. shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10);
  602. height=CGRectGetMaxY(shoppingGuideFilingContent.frame);
  603. // }
  604. //
  605. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound)
  606. // {
  607. deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30);
  608. height=CGRectGetMaxY(deliveryStatusContent.frame);
  609. // }
  610. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound)
  611. // {
  612. installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30);
  613. height=CGRectGetMaxY(installStatusContent.frame);
  614. // }
  615. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound)
  616. // {
  617. repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30);
  618. height=CGRectGetMaxY(repairStatusContent.frame);
  619. // }
  620. // collectionContent.frame=CGRectMake(10, CGRectGetMaxY(salesStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10);
  621. //
  622. // orderStatusContent.frame=CGRectMake(10, CGRectGetMaxY(collectionContent.frame)+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10);
  623. //
  624. // shoppingGuideFilingContent.frame=CGRectMake(10, CGRectGetMaxY(orderStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10);
  625. // deliveryStatusContent.frame=CGRectMake(10, CGRectGetMaxY(shoppingGuideFilingContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30);
  626. // installStatusContent.frame=CGRectMake(10, CGRectGetMaxY(deliveryStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30);
  627. //
  628. // repairStatusContent.frame=CGRectMake(10, CGRectGetMaxY(installStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30);
  629. [self clearSalesStatusData];
  630. [self startLoading];
  631. [self loadSalesStatusData];
  632. }
  633. -(void)selectYesterdayDateData
  634. {
  635. vDate.hidden=YES;
  636. [salesStatusXArray removeAllObjects];
  637. [salesStatusYArray removeAllObjects];
  638. [self changeSalesStatusButtonColor];
  639. _btnSalesStatusYesterday.layer.borderColor=[UIColor redColor].CGColor;
  640. [_btnSalesStatusYesterday setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  641. _salesStatusStartDate=[DateFormat getDateBefore:1];
  642. _salesStatusEndDate=[DateFormat getDateBefore:1];
  643. salesAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnSalesStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(salesStatusBorderV.frame)+10);
  644. salesStatusContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10);
  645. height=CGRectGetMaxY(salesStatusContent.frame);
  646. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_COLLECTION_STATUS_IPHONE].location!=NSNotFound){
  647. collectionContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10);
  648. height=CGRectGetMaxY(collectionContent.frame);
  649. // }
  650. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_ORDER_STATUS_IPHONE].location!=NSNotFound){
  651. orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10);
  652. height=CGRectGetMaxY(orderStatusContent.frame);
  653. // }
  654. salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10);
  655. height=CGRectGetMaxY(salesAchievementContent.frame);
  656. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound)
  657. // {
  658. shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10);
  659. height=CGRectGetMaxY(shoppingGuideFilingContent.frame);
  660. // }
  661. //
  662. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound)
  663. // {
  664. deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30);
  665. height=CGRectGetMaxY(deliveryStatusContent.frame);
  666. // }
  667. //
  668. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound)
  669. // {
  670. installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30);
  671. height=CGRectGetMaxY(installStatusContent.frame);
  672. //}
  673. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound)
  674. // {
  675. repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30);
  676. height=CGRectGetMaxY(repairStatusContent.frame);
  677. // }
  678. // collectionContent.frame=CGRectMake(10, CGRectGetMaxY(salesStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10);
  679. //
  680. // orderStatusContent.frame=CGRectMake(10, CGRectGetMaxY(collectionContent.frame)+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10);
  681. //
  682. // shoppingGuideFilingContent.frame=CGRectMake(10, CGRectGetMaxY(orderStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10);
  683. // deliveryStatusContent.frame=CGRectMake(10, CGRectGetMaxY(shoppingGuideFilingContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30);
  684. // installStatusContent.frame=CGRectMake(10, CGRectGetMaxY(deliveryStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30);
  685. //
  686. // repairStatusContent.frame=CGRectMake(10, CGRectGetMaxY(installStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30);
  687. [self clearSalesStatusData];
  688. [self startLoading];
  689. [self loadSalesStatusData];
  690. }
  691. -(void)selectCollectionStatusYesterdayDateData
  692. {
  693. [self changeCashStatusButtonColor];
  694. vCollectionStatusDate.hidden=YES;
  695. [collectionStatusXArray removeAllObjects];
  696. [collectionStatusYArray removeAllObjects];
  697. _btnCollectionStatusYesterday.layer.borderColor=[UIColor redColor].CGColor;
  698. [_btnCollectionStatusYesterday setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  699. _collectionStatusStartDate=[DateFormat getDateBefore:1];
  700. _collectionStatusEndDate=[DateFormat getDateBefore:1];
  701. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_STATUS_IPHONE].location!=NSNotFound){
  702. salesAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnSalesStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(salesStatusBorderV.frame)+10);
  703. salesStatusContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10);
  704. height=CGRectGetMaxY(salesStatusContent.frame);
  705. // }
  706. collectionAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnCollectionStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(collectionStatusBorderV.frame)+10);
  707. collectionContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10);
  708. height=CGRectGetMaxY(salesStatusContent.frame);
  709. height=CGRectGetMaxY(collectionContent.frame);
  710. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_ORDER_STATUS_IPHONE].location!=NSNotFound){
  711. orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10);
  712. height=CGRectGetMaxY(orderStatusContent.frame);
  713. // }
  714. salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10);
  715. height=CGRectGetMaxY(salesAchievementContent.frame);
  716. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound)
  717. // {
  718. shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10);
  719. height=CGRectGetMaxY(shoppingGuideFilingContent.frame);
  720. // }
  721. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound)
  722. // {
  723. deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30);
  724. height=CGRectGetMaxY(deliveryStatusContent.frame);
  725. // }
  726. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound)
  727. // {
  728. installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30);
  729. height=CGRectGetMaxY(installStatusContent.frame);
  730. //}
  731. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound)
  732. // {
  733. repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30);
  734. height=CGRectGetMaxY(repairStatusContent.frame);
  735. // }
  736. // orderStatusContent.frame=CGRectMake(10, CGRectGetMaxY(collectionContent.frame)+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10);
  737. //
  738. // shoppingGuideFilingContent.frame=CGRectMake(10, CGRectGetMaxY(orderStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10);
  739. // deliveryStatusContent.frame=CGRectMake(10, CGRectGetMaxY(shoppingGuideFilingContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30);
  740. // installStatusContent.frame=CGRectMake(10, CGRectGetMaxY(deliveryStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30);
  741. //
  742. // repairStatusContent.frame=CGRectMake(10, CGRectGetMaxY(installStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30);
  743. [self clearCollectionStatusData];
  744. [self startLoading];
  745. [self loadCashData];
  746. }
  747. -(void)selectOrderStatusCustomDateData
  748. {
  749. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_STATUS_IPHONE].location!=NSNotFound){
  750. salesStatusContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10);
  751. height=CGRectGetMaxY(salesStatusContent.frame);
  752. // }
  753. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_COLLECTION_STATUS_IPHONE].location!=NSNotFound){
  754. collectionContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10);
  755. height=CGRectGetMaxY(collectionContent.frame);
  756. // }
  757. vOrderStatusDate.hidden=NO;
  758. vOrderStatusDate.frame=CGRectMake(0, CGRectGetMaxY(_btnOrderStatusCustom.frame)+topMargin, Screen_Width, 25);
  759. orderAmountContent.frame=CGRectMake(0, CGRectGetMaxY(vOrderStatusDate.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(orderStatusBorderV.frame)+10);
  760. orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10);
  761. height=CGRectGetMaxY(orderStatusContent.frame);
  762. salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10);
  763. height=CGRectGetMaxY(salesAchievementContent.frame);
  764. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound)
  765. // {
  766. shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10);
  767. height=CGRectGetMaxY(shoppingGuideFilingContent.frame);
  768. // }
  769. //
  770. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound)
  771. // {
  772. deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30);
  773. height=CGRectGetMaxY(deliveryStatusContent.frame);
  774. // }
  775. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound)
  776. // {
  777. installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30);
  778. height=CGRectGetMaxY(installStatusContent.frame);
  779. // }
  780. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_REPAIR_STATUS_IPHONE].location!=NSNotFound)
  781. // {
  782. repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30);
  783. height=CGRectGetMaxY(repairStatusContent.frame);
  784. // }
  785. // shoppingGuideFilingContent.frame=CGRectMake(10, CGRectGetMaxY(orderStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10);
  786. // deliveryStatusContent.frame=CGRectMake(10, CGRectGetMaxY(shoppingGuideFilingContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30);
  787. // installStatusContent.frame=CGRectMake(10, CGRectGetMaxY(deliveryStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30);
  788. //
  789. // repairStatusContent.frame=CGRectMake(10, CGRectGetMaxY(installStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30);
  790. _orderStatusStartDate=[DateFormat getCurrentDate];
  791. _orderStatusEndDate=[DateFormat getCurrentDate];
  792. [_btnOrderStatusStartDate setTitle:_orderStatusStartDate forState:UIControlStateNormal];
  793. [_btnOrderStatusEndDate setTitle:_orderStatusEndDate forState:UIControlStateNormal];
  794. [self changeOrderStatusButtonColor];
  795. btnOrderStatusCustomMaskLayer.strokeColor=[UIColor redColor].CGColor;
  796. [_btnOrderStatusCustom setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  797. }
  798. -(void)selectOrderStatusYesterdayDateData
  799. {
  800. [self changeOrderStatusButtonColor];
  801. vOrderStatusDate.hidden=YES;
  802. [orderStatusXArray removeAllObjects];
  803. [orderStatusYArray removeAllObjects];
  804. _btnOrderStatusYesterday.layer.borderColor=[UIColor redColor].CGColor;
  805. [_btnOrderStatusYesterday setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  806. _orderStatusStartDate=[DateFormat getDateBefore:1];
  807. _orderStatusEndDate=[DateFormat getDateBefore:1];
  808. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_STATUS_IPHONE].location!=NSNotFound){
  809. //
  810. salesStatusContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10);
  811. height=CGRectGetMaxY(salesStatusContent.frame);
  812. // }
  813. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_COLLECTION_STATUS_IPHONE].location!=NSNotFound){
  814. collectionContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10);
  815. height=CGRectGetMaxY(collectionContent.frame);
  816. // }
  817. orderAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnOrderStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(orderStatusBorderV.frame)+10);
  818. orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10);
  819. height=CGRectGetMaxY(orderStatusContent.frame);
  820. salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10);
  821. height=CGRectGetMaxY(salesAchievementContent.frame);
  822. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound)
  823. // {
  824. shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10);
  825. height=CGRectGetMaxY(shoppingGuideFilingContent.frame);
  826. // }
  827. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound)
  828. // {
  829. deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30);
  830. height=CGRectGetMaxY(deliveryStatusContent.frame);
  831. // }
  832. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound)
  833. // {
  834. installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30);
  835. height=CGRectGetMaxY(installStatusContent.frame);
  836. // }
  837. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound)
  838. // {
  839. repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30);
  840. height=CGRectGetMaxY(repairStatusContent.frame);
  841. // }
  842. // shoppingGuideFilingContent.frame=CGRectMake(10, CGRectGetMaxY(orderStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10);
  843. // deliveryStatusContent.frame=CGRectMake(10, CGRectGetMaxY(shoppingGuideFilingContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30);
  844. // installStatusContent.frame=CGRectMake(10, CGRectGetMaxY(deliveryStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30);
  845. //
  846. // repairStatusContent.frame=CGRectMake(10, CGRectGetMaxY(installStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30);
  847. [self clearOrderStatusData];
  848. [self startLoading];
  849. [self loadOrderStatusData];
  850. }
  851. -(void)selectOrderStatusTodayDateData
  852. {
  853. [self changeOrderStatusButtonColor];
  854. vOrderStatusDate.hidden=YES;
  855. [orderStatusXArray removeAllObjects];
  856. [orderStatusYArray removeAllObjects];
  857. _btnOrderStatusToday.layer.borderColor=[UIColor redColor].CGColor;
  858. [_btnOrderStatusToday setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  859. _orderStatusStartDate=[DateFormat getCurrentDate];
  860. _orderStatusEndDate=[DateFormat getCurrentDate];
  861. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_STATUS_IPHONE].location!=NSNotFound){
  862. salesStatusContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10);
  863. height=CGRectGetMaxY(salesStatusContent.frame);
  864. // }
  865. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_COLLECTION_STATUS_IPHONE].location!=NSNotFound){
  866. collectionContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10);
  867. height=CGRectGetMaxY(collectionContent.frame);
  868. // }
  869. orderAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnOrderStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(orderStatusBorderV.frame)+10);
  870. orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10);
  871. height=CGRectGetMaxY(orderStatusContent.frame);
  872. salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10);
  873. height=CGRectGetMaxY(salesAchievementContent.frame);
  874. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound)
  875. // {
  876. shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10);
  877. height=CGRectGetMaxY(shoppingGuideFilingContent.frame);
  878. // }
  879. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound)
  880. // {
  881. deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30);
  882. height=CGRectGetMaxY(deliveryStatusContent.frame);
  883. // }
  884. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound)
  885. // {
  886. installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30);
  887. height=CGRectGetMaxY(installStatusContent.frame);
  888. // }
  889. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound)
  890. // {
  891. repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30);
  892. height=CGRectGetMaxY(repairStatusContent.frame);
  893. // }
  894. // shoppingGuideFilingContent.frame=CGRectMake(10, CGRectGetMaxY(orderStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10);
  895. // deliveryStatusContent.frame=CGRectMake(10, CGRectGetMaxY(shoppingGuideFilingContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30);
  896. // installStatusContent.frame=CGRectMake(10, CGRectGetMaxY(deliveryStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30);
  897. //
  898. // repairStatusContent.frame=CGRectMake(10, CGRectGetMaxY(installStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30);
  899. [self clearOrderStatusData];
  900. [self startLoading];
  901. [self loadOrderStatusData];
  902. }
  903. -(void)selectOrderStatusSevenDaysData
  904. {
  905. [self changeOrderStatusButtonColor];
  906. vOrderStatusDate.hidden=YES;
  907. [orderStatusXArray removeAllObjects];
  908. [orderStatusYArray removeAllObjects];
  909. _btnOrderStatusRecentlySevenDays.layer.borderColor=[UIColor redColor].CGColor;
  910. [_btnOrderStatusRecentlySevenDays setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  911. _orderStatusStartDate=[DateFormat getDateBefore:7];
  912. _orderStatusEndDate=[DateFormat getCurrentDate];
  913. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_STATUS_IPHONE].location!=NSNotFound){
  914. salesStatusContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10);
  915. height=CGRectGetMaxY(salesStatusContent.frame);
  916. // }
  917. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_COLLECTION_STATUS_IPHONE].location!=NSNotFound){
  918. collectionContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10);
  919. height=CGRectGetMaxY(collectionContent.frame);
  920. // }
  921. orderAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnOrderStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(orderStatusBorderV.frame)+10);
  922. orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10);
  923. height=CGRectGetMaxY(orderStatusContent.frame);
  924. salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10);
  925. height=CGRectGetMaxY(salesAchievementContent.frame);
  926. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound)
  927. // {
  928. shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10);
  929. height=CGRectGetMaxY(shoppingGuideFilingContent.frame);
  930. // }
  931. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound)
  932. // {
  933. deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30);
  934. height=CGRectGetMaxY(deliveryStatusContent.frame);
  935. // }
  936. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound)
  937. // {
  938. installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30);
  939. height=CGRectGetMaxY(installStatusContent.frame);
  940. // }
  941. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound)
  942. // {
  943. repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30);
  944. height=CGRectGetMaxY(repairStatusContent.frame);
  945. // }
  946. // shoppingGuideFilingContent.frame=CGRectMake(10, CGRectGetMaxY(orderStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10);
  947. // deliveryStatusContent.frame=CGRectMake(10, CGRectGetMaxY(shoppingGuideFilingContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30);
  948. // installStatusContent.frame=CGRectMake(10, CGRectGetMaxY(deliveryStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30);
  949. //
  950. // repairStatusContent.frame=CGRectMake(10, CGRectGetMaxY(installStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30);
  951. [self clearOrderStatusData];
  952. [self startLoading];
  953. [self loadOrderStatusData];
  954. }
  955. -(void)selectOrderStatusThirtyDaysData
  956. {
  957. [self changeOrderStatusButtonColor];
  958. vOrderStatusDate.hidden=YES;
  959. [orderStatusXArray removeAllObjects];
  960. [orderStatusYArray removeAllObjects];
  961. btnOrderStatusRecentlyThirtyDaysMaskLayer.strokeColor=[UIColor redColor].CGColor;
  962. [_btnOrderStatusRecentlyThirtyDays setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  963. _orderStatusStartDate=[DateFormat getDateBefore:30];
  964. _orderStatusEndDate=[DateFormat getCurrentDate];
  965. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_STATUS_IPHONE].location!=NSNotFound){
  966. salesStatusContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10);
  967. height=CGRectGetMaxY(salesStatusContent.frame);
  968. // }
  969. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_COLLECTION_STATUS_IPHONE].location!=NSNotFound){
  970. collectionContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10);
  971. height=CGRectGetMaxY(collectionContent.frame);
  972. // }
  973. orderAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnOrderStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(orderStatusBorderV.frame)+10);
  974. orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10);
  975. height=CGRectGetMaxY(orderStatusContent.frame);
  976. salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10);
  977. height=CGRectGetMaxY(salesAchievementContent.frame);
  978. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound)
  979. // {
  980. shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10);
  981. height=CGRectGetMaxY(shoppingGuideFilingContent.frame);
  982. // }
  983. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound)
  984. // {
  985. deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30);
  986. height=CGRectGetMaxY(deliveryStatusContent.frame);
  987. // }
  988. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound)
  989. // {
  990. installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30);
  991. height=CGRectGetMaxY(installStatusContent.frame);
  992. //}
  993. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound)
  994. // {
  995. repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30);
  996. height=CGRectGetMaxY(repairStatusContent.frame);
  997. // }
  998. // shoppingGuideFilingContent.frame=CGRectMake(10, CGRectGetMaxY(orderStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10);
  999. // deliveryStatusContent.frame=CGRectMake(10, CGRectGetMaxY(shoppingGuideFilingContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30);
  1000. // installStatusContent.frame=CGRectMake(10, CGRectGetMaxY(deliveryStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30);
  1001. //
  1002. // repairStatusContent.frame=CGRectMake(10, CGRectGetMaxY(installStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30);
  1003. [self clearOrderStatusData];
  1004. [self startLoading];
  1005. [self loadOrderStatusData];
  1006. }
  1007. -(void)selectCollectionStatusTodayDateData
  1008. {
  1009. [self changeCashStatusButtonColor];
  1010. vCollectionStatusDate.hidden=YES;
  1011. [collectionStatusXArray removeAllObjects];
  1012. [collectionStatusYArray removeAllObjects];
  1013. _btnCollectionStatusToday.layer.borderColor=[UIColor redColor].CGColor;
  1014. [_btnCollectionStatusToday setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  1015. _collectionStatusStartDate=[DateFormat getCurrentDate];
  1016. _collectionStatusEndDate=[DateFormat getCurrentDate];
  1017. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_STATUS_IPHONE].location!=NSNotFound){
  1018. salesAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnSalesStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(salesStatusBorderV.frame)+10);
  1019. salesStatusContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10);
  1020. height=CGRectGetMaxY(salesStatusContent.frame);
  1021. // }
  1022. collectionAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnCollectionStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(collectionStatusBorderV.frame)+10);
  1023. collectionContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10);
  1024. height=CGRectGetMaxY(collectionContent.frame);
  1025. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_ORDER_STATUS_IPHONE].location!=NSNotFound){
  1026. orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10);
  1027. height=CGRectGetMaxY(orderStatusContent.frame);
  1028. // }
  1029. salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10);
  1030. height=CGRectGetMaxY(salesAchievementContent.frame);
  1031. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound)
  1032. // {
  1033. shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10);
  1034. height=CGRectGetMaxY(shoppingGuideFilingContent.frame);
  1035. // }
  1036. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound)
  1037. // {
  1038. deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30);
  1039. height=CGRectGetMaxY(deliveryStatusContent.frame);
  1040. // }
  1041. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound)
  1042. // {
  1043. installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30);
  1044. height=CGRectGetMaxY(installStatusContent.frame);
  1045. // }
  1046. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound)
  1047. // {
  1048. repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30);
  1049. height=CGRectGetMaxY(repairStatusContent.frame);
  1050. // }
  1051. // orderStatusContent.frame=CGRectMake(10, CGRectGetMaxY(collectionContent.frame)+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10);
  1052. //
  1053. // shoppingGuideFilingContent.frame=CGRectMake(10, CGRectGetMaxY(orderStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10);
  1054. // deliveryStatusContent.frame=CGRectMake(10, CGRectGetMaxY(shoppingGuideFilingContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30);
  1055. // installStatusContent.frame=CGRectMake(10, CGRectGetMaxY(deliveryStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30);
  1056. //
  1057. // repairStatusContent.frame=CGRectMake(10, CGRectGetMaxY(installStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30);
  1058. [self clearCollectionStatusData];
  1059. [self startLoading];
  1060. [self loadCashData];
  1061. }
  1062. -(void)selectCollectionStatusSevenDaysData
  1063. {
  1064. vCollectionStatusDate.hidden=YES;
  1065. [collectionStatusXArray removeAllObjects];
  1066. [collectionStatusYArray removeAllObjects];
  1067. [self changeCashStatusButtonColor];
  1068. _btnCollectionStatusRecentlySevenDays.layer.borderColor=[UIColor redColor].CGColor;
  1069. [_btnCollectionStatusRecentlySevenDays setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  1070. _collectionStatusStartDate=[DateFormat getDateBefore:7];
  1071. _collectionStatusEndDate=[DateFormat getCurrentDate];
  1072. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_STATUS_IPHONE].location!=NSNotFound){
  1073. salesAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnSalesStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(salesStatusBorderV.frame)+10);
  1074. salesStatusContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10);
  1075. height=CGRectGetMaxY(salesStatusContent.frame);
  1076. // }
  1077. collectionAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnCollectionStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(collectionStatusBorderV.frame)+10);
  1078. collectionContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10);
  1079. height=CGRectGetMaxY(collectionContent.frame);
  1080. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_ORDER_STATUS_IPHONE].location!=NSNotFound){
  1081. orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10);
  1082. height=CGRectGetMaxY(orderStatusContent.frame);
  1083. // }
  1084. salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10);
  1085. height=CGRectGetMaxY(salesAchievementContent.frame);
  1086. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound)
  1087. // {
  1088. shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10);
  1089. height=CGRectGetMaxY(shoppingGuideFilingContent.frame);
  1090. // }
  1091. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound)
  1092. // {
  1093. deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30);
  1094. height=CGRectGetMaxY(deliveryStatusContent.frame);
  1095. // }
  1096. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound)
  1097. // {
  1098. installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30);
  1099. height=CGRectGetMaxY(installStatusContent.frame);
  1100. // }
  1101. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound)
  1102. // {
  1103. repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30);
  1104. height=CGRectGetMaxY(repairStatusContent.frame);
  1105. // }
  1106. // orderStatusContent.frame=CGRectMake(10, CGRectGetMaxY(collectionContent.frame)+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10);
  1107. //
  1108. // shoppingGuideFilingContent.frame=CGRectMake(10, CGRectGetMaxY(orderStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10);
  1109. // deliveryStatusContent.frame=CGRectMake(10, CGRectGetMaxY(shoppingGuideFilingContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30);
  1110. // installStatusContent.frame=CGRectMake(10, CGRectGetMaxY(deliveryStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30);
  1111. //
  1112. // repairStatusContent.frame=CGRectMake(10, CGRectGetMaxY(installStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30);
  1113. [self clearCollectionStatusData];
  1114. [self startLoading];
  1115. [self loadCashData];
  1116. }
  1117. -(void)selectCollectionStatusThirtyDaysData
  1118. {
  1119. vCollectionStatusDate.hidden=YES;
  1120. [collectionStatusXArray removeAllObjects];
  1121. [collectionStatusYArray removeAllObjects];
  1122. [self changeCashStatusButtonColor];
  1123. btnCollectionStatusRecentlyThirtyDaysMaskLayer.strokeColor=[UIColor redColor].CGColor;
  1124. [_btnCollectionStatusRecentlyThirtyDays setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  1125. _collectionStatusStartDate=[DateFormat getDateBefore:30];
  1126. _collectionStatusEndDate=[DateFormat getCurrentDate];
  1127. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_STATUS_IPHONE].location!=NSNotFound){
  1128. salesAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnSalesStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(salesStatusBorderV.frame)+10);
  1129. salesStatusContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10);
  1130. height=CGRectGetMaxY(salesStatusContent.frame);
  1131. // }
  1132. collectionAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnCollectionStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(collectionStatusBorderV.frame)+10);
  1133. collectionContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10);
  1134. height=CGRectGetMaxY(collectionContent.frame);
  1135. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_ORDER_STATUS_IPHONE].location!=NSNotFound){
  1136. orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10);
  1137. height=CGRectGetMaxY(orderStatusContent.frame);
  1138. // }
  1139. salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10);
  1140. height=CGRectGetMaxY(salesAchievementContent.frame);
  1141. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound)
  1142. // {
  1143. shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10);
  1144. height=CGRectGetMaxY(shoppingGuideFilingContent.frame);
  1145. // }
  1146. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound)
  1147. // {
  1148. deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30);
  1149. height=CGRectGetMaxY(deliveryStatusContent.frame);
  1150. // }
  1151. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound)
  1152. // {
  1153. installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30);
  1154. height=CGRectGetMaxY(installStatusContent.frame);
  1155. // }
  1156. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound)
  1157. // {
  1158. repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30);
  1159. height=CGRectGetMaxY(repairStatusContent.frame);
  1160. // }
  1161. // orderStatusContent.frame=CGRectMake(10, CGRectGetMaxY(collectionContent.frame)+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10);
  1162. //
  1163. // shoppingGuideFilingContent.frame=CGRectMake(10, CGRectGetMaxY(orderStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10);
  1164. // deliveryStatusContent.frame=CGRectMake(10, CGRectGetMaxY(shoppingGuideFilingContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30);
  1165. // installStatusContent.frame=CGRectMake(10, CGRectGetMaxY(deliveryStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30);
  1166. //
  1167. // repairStatusContent.frame=CGRectMake(10, CGRectGetMaxY(installStatusContent.frame)+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30);
  1168. [self clearCollectionStatusData];
  1169. [self startLoading];
  1170. [self loadCashData];
  1171. }
  1172. -(void)initUI
  1173. {
  1174. int rowHeight=50;
  1175. content=[UIView new];
  1176. content.frame=CGRectMake(0, 0,Screen_Width,0);
  1177. scroll=[[UIScrollView alloc]init];
  1178. scroll.frame=CGRectMake(0,0, Screen_Width, Screen_Height);
  1179. [self.view addSubview:scroll];
  1180. [scroll addSubview:content];
  1181. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_STATUS_IPHONE].location!=NSNotFound){
  1182. salesStatusContent=[UIView new];
  1183. salesStatusContent.frame=CGRectMake(10, 10,Screen_Width,0);
  1184. salesStatusContent.backgroundColor=[UIColor whiteColor];
  1185. [content addSubview:salesStatusContent];
  1186. UIView *salesStatusTitleView = [[UIView alloc]init];
  1187. salesStatusTitleView.frame = CGRectMake(0,0 ,Screen_Width, 45);
  1188. UIView *salesStatusImgView=[UIImageView new];
  1189. salesStatusImgView.frame=CGRectMake(10, 10,10 , 25);
  1190. [salesStatusImgView setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]];
  1191. [salesStatusTitleView addSubview:salesStatusImgView];
  1192. UILabel *titleSalesStatus = [[UILabel alloc]init];
  1193. titleSalesStatus.frame = CGRectMake(CGRectGetMaxX(salesStatusImgView.frame)+10, 10, 100, 25);
  1194. titleSalesStatus.text = @"销售情况";
  1195. titleSalesStatus.textColor = [UIColor blackColor];
  1196. titleSalesStatus.font = [UIFont systemFontOfSize:NoDataFontOfSize];
  1197. [salesStatusTitleView addSubview:titleSalesStatus];
  1198. [salesStatusContent addSubview:salesStatusTitleView];
  1199. UIView *separator=[UIView new];
  1200. separator.frame=CGRectMake(0,salesStatusTitleView.frame.size.height-1, salesStatusTitleView.frame.size.width-20, 0.5);
  1201. [separator setBackgroundColor:[UIColor lightGrayColor]];
  1202. [salesStatusTitleView addSubview:separator ];
  1203. _btnSalesStatusCustom = [[UIButton alloc] initWithFrame:CGRectMake(Screen_Width/2-175-10,CGRectGetMaxY(salesStatusTitleView.frame)+topMargin, 70, 35)];
  1204. [_btnSalesStatusCustom setTitle:@"自定义" forState:UIControlStateNormal];
  1205. [_btnSalesStatusCustom setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  1206. _btnSalesStatusCustom.titleLabel.font = [UIFont systemFontOfSize: 10.0];
  1207. [_btnSalesStatusCustom addTarget:self action:@selector(selectCustomDateData) forControlEvents:UIControlEventTouchUpInside];
  1208. UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:_btnSalesStatusCustom.bounds byRoundingCorners:UIRectCornerTopLeft|UIRectCornerBottomLeft cornerRadii:CGSizeMake(25.0, 25.0)];
  1209. CAShapeLayer *maskLayer = [CAShapeLayer layer];
  1210. maskLayer.frame = _btnSalesStatusCustom.bounds;
  1211. maskLayer.path = maskPath.CGPath;
  1212. _btnSalesStatusCustom.layer.mask = maskLayer;
  1213. [salesStatusContent addSubview:_btnSalesStatusCustom];
  1214. btnSalesStatusCustomMaskLayer = [CAShapeLayer layer];
  1215. btnSalesStatusCustomMaskLayer.frame = _btnSalesStatusCustom.bounds;
  1216. btnSalesStatusCustomMaskLayer.path = maskPath.CGPath;
  1217. btnSalesStatusCustomMaskLayer.fillColor=[UIColor clearColor].CGColor;
  1218. btnSalesStatusCustomMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  1219. btnSalesStatusCustomMaskLayer.lineWidth=1;
  1220. [_btnSalesStatusCustom.layer addSublayer:btnSalesStatusCustomMaskLayer];
  1221. _btnSalesStatusYesterday = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnSalesStatusCustom.frame),CGRectGetMaxY(salesStatusTitleView.frame)+topMargin, 70, 35)];
  1222. [_btnSalesStatusYesterday setTitle:[DateFormat getDateBefore:1] forState:UIControlStateNormal];
  1223. _btnSalesStatusYesterday.layer.cornerRadius=0;
  1224. _btnSalesStatusYesterday.layer.borderWidth=1;
  1225. [_btnSalesStatusYesterday addTarget:self action:@selector(selectYesterdayDateData) forControlEvents:UIControlEventTouchUpInside];
  1226. [_btnSalesStatusYesterday setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  1227. [_btnSalesStatusYesterday.layer setMasksToBounds:YES];//设置按钮的圆角半径不会被遮挡
  1228. _btnSalesStatusYesterday.layer.borderColor=[UIColor lightGrayColor].CGColor;
  1229. _btnSalesStatusYesterday.titleLabel.font = [UIFont systemFontOfSize: 10.0];
  1230. [salesStatusContent addSubview:_btnSalesStatusYesterday];
  1231. _btnSalesStatusToday = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnSalesStatusYesterday.frame),CGRectGetMaxY(salesStatusTitleView.frame)+topMargin, 70, 35)];
  1232. [_btnSalesStatusToday setTitle: [DateFormat getCurrentDate]forState:UIControlStateNormal];
  1233. _btnSalesStatusToday.layer.cornerRadius=0;
  1234. _btnSalesStatusToday.layer.borderWidth=1;
  1235. _btnSalesStatusToday.titleLabel.font = [UIFont systemFontOfSize: 10.0];
  1236. [_btnSalesStatusToday addTarget:self action:@selector(selectTodayDateData) forControlEvents:UIControlEventTouchUpInside];
  1237. [_btnSalesStatusToday setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  1238. [_btnSalesStatusToday.layer setMasksToBounds:YES];//设置按钮的圆角半径不会被遮挡
  1239. _btnSalesStatusToday.layer.borderColor=[UIColor redColor].CGColor;
  1240. [salesStatusContent addSubview:_btnSalesStatusToday];
  1241. _btnSalesStatusRecentlySevenDays = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnSalesStatusToday.frame),CGRectGetMaxY(salesStatusTitleView.frame)+topMargin, 70, 35)];
  1242. [_btnSalesStatusRecentlySevenDays setTitle:@"近7天" forState:UIControlStateNormal];
  1243. _btnSalesStatusRecentlySevenDays.titleLabel.font = [UIFont systemFontOfSize: 10.0];
  1244. _btnSalesStatusRecentlySevenDays.layer.cornerRadius=0;
  1245. _btnSalesStatusRecentlySevenDays.layer.borderWidth=1;
  1246. [_btnSalesStatusRecentlySevenDays addTarget:self action:@selector(selectSevenDaysData) forControlEvents:UIControlEventTouchUpInside];
  1247. [_btnSalesStatusRecentlySevenDays setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  1248. [_btnSalesStatusRecentlySevenDays.layer setMasksToBounds:YES];//设置按钮的圆角半径不会被遮挡
  1249. _btnSalesStatusRecentlySevenDays.layer.borderColor=[UIColor lightGrayColor].CGColor;
  1250. [salesStatusContent addSubview:_btnSalesStatusRecentlySevenDays];
  1251. _btnSalesStatusRecentlyThirtyDays = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnSalesStatusRecentlySevenDays.frame),CGRectGetMaxY(salesStatusTitleView.frame)+topMargin, 70, 35)];
  1252. [_btnSalesStatusRecentlyThirtyDays setTitle:@"近30天" forState:UIControlStateNormal];
  1253. _btnSalesStatusRecentlyThirtyDays.titleLabel.font = [UIFont systemFontOfSize: 10.0];
  1254. [_btnSalesStatusRecentlyThirtyDays addTarget:self action:@selector(selectThirtyDaysData) forControlEvents:UIControlEventTouchUpInside];
  1255. [_btnSalesStatusRecentlyThirtyDays setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  1256. UIBezierPath *maskPath2 = [UIBezierPath bezierPathWithRoundedRect:_btnSalesStatusRecentlyThirtyDays.bounds byRoundingCorners:UIRectCornerTopRight|UIRectCornerBottomRight cornerRadii:CGSizeMake(25.0, 25.0)];
  1257. CAShapeLayer *maskLayer2 = [CAShapeLayer layer];
  1258. maskLayer2.frame = _btnSalesStatusRecentlyThirtyDays.bounds;
  1259. maskLayer2.path = maskPath2.CGPath;
  1260. _btnSalesStatusRecentlyThirtyDays.layer.mask = maskLayer2;
  1261. [salesStatusContent addSubview:_btnSalesStatusRecentlyThirtyDays];
  1262. btnSalesStatusRecentlyThirtyDaysMaskLayer = [CAShapeLayer layer];
  1263. btnSalesStatusRecentlyThirtyDaysMaskLayer.frame = _btnSalesStatusRecentlyThirtyDays.bounds;
  1264. btnSalesStatusRecentlyThirtyDaysMaskLayer.path = maskPath2.CGPath;
  1265. btnSalesStatusRecentlyThirtyDaysMaskLayer.fillColor=[UIColor clearColor].CGColor;
  1266. btnSalesStatusRecentlyThirtyDaysMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  1267. btnSalesStatusRecentlyThirtyDaysMaskLayer.lineWidth=1;
  1268. [_btnSalesStatusRecentlyThirtyDays.layer addSublayer:btnSalesStatusRecentlyThirtyDaysMaskLayer];
  1269. vDate =[UIView new];
  1270. vDate.frame=CGRectMake(0, CGRectGetMaxY(_btnSalesStatusCustom.frame)+topMargin, Screen_Width, 0);
  1271. [salesStatusContent addSubview:vDate];
  1272. vDate.hidden=YES;
  1273. _btnSalesStatusStartDate = [UIButton buttonWithType:UIButtonTypeCustom];
  1274. [_btnSalesStatusStartDate setTitle:_salesStatusStartDate forState:UIControlStateNormal];
  1275. [_btnSalesStatusStartDate setBackgroundColor:[UIColor whiteColor]];
  1276. [_btnSalesStatusStartDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  1277. _btnSalesStatusStartDate.titleLabel.font= [UIFont systemFontOfSize:14];
  1278. [_btnSalesStatusStartDate addTarget:self action:@selector(btnSelectStartDate) forControlEvents:UIControlEventTouchUpInside];
  1279. _btnSalesStatusStartDate.frame = CGRectMake(Screen_Width/2-110 ,0 , 100, 25);
  1280. [vDate addSubview:_btnSalesStatusStartDate];
  1281. UILabel *separatorLbl=[UILabel new];
  1282. separatorLbl.frame=CGRectMake(CGRectGetMaxX(_btnSalesStatusStartDate.frame), 0, 20, 25);
  1283. separatorLbl.text=@"--";
  1284. separatorLbl.textColor = [UIColor blackColor];
  1285. separatorLbl.font = [UIFont systemFontOfSize: 14];
  1286. [vDate addSubview:separatorLbl];
  1287. _btnSalesStatusEndDate = [UIButton buttonWithType:UIButtonTypeCustom];
  1288. [_btnSalesStatusEndDate setTitle:_salesStatusEndDate forState:UIControlStateNormal];
  1289. [_btnSalesStatusEndDate setBackgroundColor:[UIColor whiteColor]];
  1290. [_btnSalesStatusEndDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  1291. _btnSalesStatusEndDate.titleLabel.font= [UIFont systemFontOfSize:14];
  1292. [_btnSalesStatusEndDate addTarget:self action:@selector(btnSelectEndDate) forControlEvents:UIControlEventTouchUpInside];
  1293. _btnSalesStatusEndDate.frame = CGRectMake(CGRectGetMaxX(separatorLbl.frame) ,0 , 100, 25);
  1294. [vDate addSubview:_btnSalesStatusEndDate];
  1295. salesAmountContent =[[UIView alloc]init];
  1296. salesAmountContent.frame = CGRectMake(0,CGRectGetMaxY(_btnSalesStatusCustom.frame)+topMargin, Screen_Width, 0);
  1297. [salesStatusContent addSubview:salesAmountContent];
  1298. UIView *salesAmountView= [[UIView alloc]init];
  1299. salesAmountView.frame = CGRectMake(0,0, Screen_Width, 25);
  1300. UILabel *lblTitleSalesAmount = [[UILabel alloc]init];
  1301. lblTitleSalesAmount.frame = CGRectMake(Screen_Width/2-110, 0, 110, 25);
  1302. lblTitleSalesAmount.text = @"销售金额:";
  1303. lblTitleSalesAmount.textColor = [UIColor redColor];
  1304. lblTitleSalesAmount.font = [UIFont systemFontOfSize:NoDataFontOfSize];
  1305. [salesAmountView addSubview:lblTitleSalesAmount];
  1306. lblSalesAmount = [[UILabel alloc]init];
  1307. lblSalesAmount.frame = CGRectMake(CGRectGetMaxX(lblTitleSalesAmount.frame), 0, 150, 25);
  1308. lblSalesAmount.textColor = [UIColor redColor];
  1309. lblSalesAmount.text=@"0.00";
  1310. lblSalesAmount.font = [UIFont systemFontOfSize:NoDataFontOfSize];
  1311. [salesAmountView addSubview:lblSalesAmount];
  1312. [salesAmountContent addSubview:salesAmountView];
  1313. UIView *salesAddCustomerView = [[UIView alloc]init];
  1314. salesAddCustomerView.frame = CGRectMake(0,CGRectGetMaxY(salesAmountView.frame)+topMargin,Screen_Width/2, rowHeight);
  1315. lblSalesAddCustomer= [[UILabel alloc]init];
  1316. lblSalesAddCustomer.frame = CGRectMake(0, 0,salesAddCustomerView.frame.size.width, 25);
  1317. lblSalesAddCustomer.textAlignment=UITextAlignmentCenter;
  1318. lblSalesAddCustomer.textColor = [UIColor blackColor];
  1319. lblSalesAddCustomer.text=@"0";
  1320. lblSalesAddCustomer.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  1321. [salesAddCustomerView addSubview:lblSalesAddCustomer];
  1322. UILabel *lblTitleSalesAddCustomer = [[UILabel alloc]init];
  1323. lblTitleSalesAddCustomer.frame = CGRectMake(0,CGRectGetMaxY(lblSalesAddCustomer.frame),salesAddCustomerView.frame.size.width, 25);
  1324. lblTitleSalesAddCustomer.text = @"销售新增客户";
  1325. lblTitleSalesAddCustomer.textColor = [UIColor blackColor];
  1326. lblTitleSalesAddCustomer.textAlignment=UITextAlignmentCenter;
  1327. lblTitleSalesAddCustomer.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  1328. [salesAddCustomerView addSubview:lblTitleSalesAddCustomer];
  1329. [salesAmountContent addSubview:salesAddCustomerView];
  1330. UIView *middleSeparator=[UIView new];
  1331. middleSeparator.frame=CGRectMake(Screen_Width/2, CGRectGetMaxY(salesAmountView.frame)+topMargin, 0.5, 45);
  1332. middleSeparator.backgroundColor=[UIColor lightGrayColor];
  1333. [salesAmountContent addSubview:middleSeparator];
  1334. UIView *salesCustomerCountView = [[UIView alloc]init];
  1335. salesCustomerCountView.frame = CGRectMake(Screen_Width/2,CGRectGetMaxY(salesAmountView.frame)+topMargin, Screen_Width/2, rowHeight);
  1336. lblSalesCustomerCount = [[UILabel alloc]init];
  1337. lblSalesCustomerCount.frame = CGRectMake(0, 0, salesCustomerCountView.frame.size.width, 25);
  1338. lblSalesCustomerCount.textAlignment=UITextAlignmentCenter;
  1339. lblSalesCustomerCount.text=@"0";
  1340. lblSalesCustomerCount.textColor = [UIColor blackColor];
  1341. lblSalesCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  1342. [salesCustomerCountView addSubview:lblSalesCustomerCount];
  1343. UILabel *lblSalesCustomerCountTitle = [[UILabel alloc]init];
  1344. lblSalesCustomerCountTitle.frame = CGRectMake(0,CGRectGetMaxY(lblSalesCustomerCount.frame), salesCustomerCountView.frame.size.width, 25);
  1345. lblSalesCustomerCountTitle.text = @"销售客户数";
  1346. lblSalesCustomerCountTitle.textAlignment=UITextAlignmentCenter;
  1347. lblSalesCustomerCountTitle.textColor = [UIColor blackColor];
  1348. lblSalesCustomerCountTitle.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  1349. [salesCustomerCountView addSubview:lblSalesCustomerCountTitle];
  1350. [salesAmountContent addSubview:salesCustomerCountView];
  1351. _btnSalesStatusDepartment = [[UIButton alloc] initWithFrame:CGRectMake(Screen_Width/2-70,CGRectGetMaxY(salesAddCustomerView.frame)+topMargin, 70, 35)];
  1352. [_btnSalesStatusDepartment setTitle:@"部门" forState:UIControlStateNormal];
  1353. [_btnSalesStatusDepartment setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  1354. _btnSalesStatusDepartment.titleLabel.font = [UIFont systemFontOfSize: 12.0];
  1355. [_btnSalesStatusDepartment addTarget:self action:@selector(goSalesStatus:) forControlEvents:UIControlEventTouchUpInside];
  1356. _btnSalesStatusDepartment.tag=1001;
  1357. UIBezierPath *maskPath7 = [UIBezierPath bezierPathWithRoundedRect:_btnSalesStatusDepartment.bounds byRoundingCorners:UIRectCornerTopLeft|UIRectCornerBottomLeft cornerRadii:CGSizeMake(25.0, 25.0)];
  1358. CAShapeLayer *maskLayer8 = [CAShapeLayer layer];
  1359. maskLayer8.frame = _btnSalesStatusDepartment.bounds;
  1360. maskLayer8.path = maskPath7.CGPath;
  1361. _btnSalesStatusDepartment.layer.mask = maskLayer8;
  1362. [salesAmountContent addSubview:_btnSalesStatusDepartment];
  1363. btnSalesStatusDepartmentMaskLayer = [CAShapeLayer layer];
  1364. btnSalesStatusDepartmentMaskLayer.frame = _btnSalesStatusDepartment.bounds;
  1365. btnSalesStatusDepartmentMaskLayer.path = maskPath7.CGPath;
  1366. btnSalesStatusDepartmentMaskLayer.fillColor=[UIColor clearColor].CGColor;
  1367. btnSalesStatusDepartmentMaskLayer.strokeColor=[UIColor redColor].CGColor;
  1368. btnSalesStatusDepartmentMaskLayer.lineWidth=1;
  1369. [_btnSalesStatusDepartment.layer addSublayer:btnSalesStatusDepartmentMaskLayer];
  1370. _btnSalesStatusChannel = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnSalesStatusDepartment.frame),CGRectGetMaxY(salesAddCustomerView.frame)+topMargin, 70, 35)];
  1371. [_btnSalesStatusChannel setTitle:@"渠道" forState:UIControlStateNormal];
  1372. [_btnSalesStatusChannel setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  1373. _btnSalesStatusChannel.tag=1000;
  1374. [_btnSalesStatusChannel addTarget:self action:@selector(goSalesStatus:) forControlEvents:UIControlEventTouchUpInside];
  1375. _btnSalesStatusChannel.titleLabel.font = [UIFont systemFontOfSize: 12.0];
  1376. UIBezierPath *maskPath5 = [UIBezierPath bezierPathWithRoundedRect:_btnSalesStatusChannel.bounds byRoundingCorners:UIRectCornerTopRight|UIRectCornerBottomRight cornerRadii:CGSizeMake(25.0, 25.0)];
  1377. CAShapeLayer *maskLayer5 = [CAShapeLayer layer];
  1378. maskLayer5.frame = _btnSalesStatusChannel.bounds;
  1379. maskLayer5.path = maskPath5.CGPath;
  1380. _btnSalesStatusChannel.layer.mask = maskLayer5;
  1381. [salesAmountContent addSubview:_btnSalesStatusChannel];
  1382. btnSalesStatusChannelMaskLayer = [CAShapeLayer layer];
  1383. btnSalesStatusChannelMaskLayer.frame = _btnSalesStatusChannel.bounds;
  1384. btnSalesStatusChannelMaskLayer.path = maskPath5.CGPath;
  1385. btnSalesStatusChannelMaskLayer.fillColor=[UIColor clearColor].CGColor;
  1386. btnSalesStatusChannelMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  1387. btnSalesStatusChannelMaskLayer.lineWidth=1;
  1388. [_btnSalesStatusChannel.layer addSublayer:btnSalesStatusChannelMaskLayer];
  1389. salesStatusBorderV=[CustomBorderView new];
  1390. salesStatusBorderV.frame=CGRectMake(5, CGRectGetMaxY(_btnSalesStatusDepartment.frame)+topMargin,Screen_Width-30, 350);
  1391. [salesStatusBorderV setBackgroundColor:[UIColor whiteColor]];
  1392. [salesStatusBorderV drawBoardLine:borderWidth cornerRadius:2 color:[UIColor hexColor:@"D5CDCD"]];
  1393. [salesAmountContent addSubview:salesStatusBorderV];
  1394. _salesStatusChartView=[[BarChartView alloc]init];
  1395. _salesStatusChartView.frame=CGRectMake(0,0,salesStatusBorderV.frame.size.width, 350);
  1396. [salesStatusBorderV addSubview:_salesStatusChartView];
  1397. salesAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnSalesStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(salesStatusBorderV.frame)+10);
  1398. salesStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAmountContent.frame)+10);
  1399. height=CGRectGetMaxY(salesStatusContent.frame);
  1400. salesStatusContent.layer.cornerRadius=CornerRadius;
  1401. // }
  1402. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_COLLECTION_STATUS_IPHONE].location!=NSNotFound){
  1403. //收款状态
  1404. collectionContent=[UIView new];
  1405. collectionContent.backgroundColor=[UIColor whiteColor];
  1406. collectionContent.frame=CGRectMake(10,height+10, Screen_Width-20, 0);
  1407. [content addSubview:collectionContent];
  1408. UIView *collectionStatusTitleView = [[UIView alloc]init];
  1409. collectionStatusTitleView.frame = CGRectMake(0,0 ,Screen_Width, 45);
  1410. UIView *collectionStatusImgView=[UIImageView new];
  1411. collectionStatusImgView.frame=CGRectMake(10, 10,10 , 25);
  1412. [collectionStatusImgView setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]];
  1413. [collectionStatusTitleView addSubview:collectionStatusImgView];
  1414. UILabel *titleCollectionStatus = [[UILabel alloc]init];
  1415. titleCollectionStatus.frame = CGRectMake(CGRectGetMaxX(collectionStatusImgView.frame)+10, 10, 100, 25);
  1416. titleCollectionStatus.text = @"收款情况";
  1417. titleCollectionStatus.textColor = [UIColor blackColor];
  1418. titleCollectionStatus.font = [UIFont systemFontOfSize:NoDataFontOfSize];
  1419. [collectionStatusTitleView addSubview:titleCollectionStatus];
  1420. [collectionContent addSubview:collectionStatusTitleView];
  1421. UIView *separator1=[UIView new];
  1422. separator1.frame=CGRectMake(0,collectionStatusTitleView.frame.size.height-1, collectionStatusTitleView.frame.size.width-20, 0.5);
  1423. [separator1 setBackgroundColor:[UIColor lightGrayColor]];
  1424. [collectionStatusTitleView addSubview:separator1 ];
  1425. _btnCollectionStatusCustom = [[UIButton alloc] initWithFrame:CGRectMake(Screen_Width/2-175-10,CGRectGetMaxY(collectionStatusTitleView.frame)+topMargin, 70, 35)];
  1426. [_btnCollectionStatusCustom setTitle:@"自定义" forState:UIControlStateNormal];
  1427. [_btnCollectionStatusCustom setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  1428. _btnCollectionStatusCustom.titleLabel.font = [UIFont systemFontOfSize: 10.0];
  1429. [_btnCollectionStatusCustom addTarget:self action:@selector(selectCollectionStatusCustomDateData) forControlEvents:UIControlEventTouchUpInside];
  1430. UIBezierPath *maskPath1 = [UIBezierPath bezierPathWithRoundedRect:_btnCollectionStatusCustom.bounds byRoundingCorners:UIRectCornerTopLeft|UIRectCornerBottomLeft cornerRadii:CGSizeMake(25.0, 25.0)];
  1431. CAShapeLayer *maskLayer1 = [CAShapeLayer layer];
  1432. maskLayer1.frame = _btnCollectionStatusCustom.bounds;
  1433. maskLayer1.path = maskPath1.CGPath;
  1434. _btnCollectionStatusCustom.layer.mask = maskLayer1;
  1435. [collectionContent addSubview:_btnCollectionStatusCustom];
  1436. btnCollectionStatusCustomMaskLayer = [CAShapeLayer layer];
  1437. btnCollectionStatusCustomMaskLayer.frame = _btnSalesStatusCustom.bounds;
  1438. btnCollectionStatusCustomMaskLayer.path = maskPath1.CGPath;
  1439. btnCollectionStatusCustomMaskLayer.fillColor=[UIColor clearColor].CGColor;
  1440. btnCollectionStatusCustomMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  1441. btnCollectionStatusCustomMaskLayer.lineWidth=1;
  1442. [_btnCollectionStatusCustom.layer addSublayer:btnCollectionStatusCustomMaskLayer];
  1443. _btnCollectionStatusYesterday = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnCollectionStatusCustom.frame),CGRectGetMaxY(collectionStatusTitleView.frame)+topMargin, 70, 35)];
  1444. [_btnCollectionStatusYesterday setTitle:[DateFormat getDateBefore:1] forState:UIControlStateNormal];
  1445. _btnCollectionStatusYesterday.layer.cornerRadius=0;
  1446. _btnCollectionStatusYesterday.layer.borderWidth=1;
  1447. [_btnCollectionStatusYesterday addTarget:self action:@selector(selectCollectionStatusYesterdayDateData) forControlEvents:UIControlEventTouchUpInside];
  1448. [_btnCollectionStatusYesterday setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  1449. [_btnCollectionStatusYesterday.layer setMasksToBounds:YES];//设置按钮的圆角半径不会被遮挡
  1450. _btnCollectionStatusYesterday.layer.borderColor=[UIColor lightGrayColor].CGColor;
  1451. _btnCollectionStatusYesterday.titleLabel.font = [UIFont systemFontOfSize: 10.0];
  1452. [collectionContent addSubview:_btnCollectionStatusYesterday];
  1453. _btnCollectionStatusToday = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnCollectionStatusYesterday.frame),CGRectGetMaxY(collectionStatusTitleView.frame)+topMargin, 70, 35)];
  1454. [_btnCollectionStatusToday setTitle: [DateFormat getCurrentDate]forState:UIControlStateNormal];
  1455. _btnCollectionStatusToday.layer.cornerRadius=0;
  1456. _btnCollectionStatusToday.layer.borderWidth=1;
  1457. _btnCollectionStatusToday.titleLabel.font = [UIFont systemFontOfSize: 10.0];
  1458. [_btnCollectionStatusToday addTarget:self action:@selector(selectCollectionStatusTodayDateData) forControlEvents:UIControlEventTouchUpInside];
  1459. [_btnCollectionStatusToday setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  1460. [_btnCollectionStatusToday.layer setMasksToBounds:YES];//设置按钮的圆角半径不会被遮挡
  1461. _btnCollectionStatusToday.layer.borderColor=[UIColor redColor].CGColor;
  1462. [collectionContent addSubview:_btnCollectionStatusToday];
  1463. _btnCollectionStatusRecentlySevenDays = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnCollectionStatusToday.frame),CGRectGetMaxY(collectionStatusTitleView.frame)+topMargin, 70, 35)];
  1464. [_btnCollectionStatusRecentlySevenDays setTitle:@"近7天" forState:UIControlStateNormal];
  1465. _btnCollectionStatusRecentlySevenDays.titleLabel.font = [UIFont systemFontOfSize: 10.0];
  1466. _btnCollectionStatusRecentlySevenDays.layer.cornerRadius=0;
  1467. _btnCollectionStatusRecentlySevenDays.layer.borderWidth=1;
  1468. [_btnCollectionStatusRecentlySevenDays addTarget:self action:@selector(selectCollectionStatusSevenDaysData) forControlEvents:UIControlEventTouchUpInside];
  1469. [_btnCollectionStatusRecentlySevenDays setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  1470. [_btnCollectionStatusRecentlySevenDays.layer setMasksToBounds:YES];//设置按钮的圆角半径不会被遮挡
  1471. _btnCollectionStatusRecentlySevenDays.layer.borderColor=[UIColor lightGrayColor].CGColor;
  1472. [collectionContent addSubview:_btnCollectionStatusRecentlySevenDays];
  1473. _btnCollectionStatusRecentlyThirtyDays = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnCollectionStatusRecentlySevenDays.frame),CGRectGetMaxY(collectionStatusTitleView.frame)+topMargin, 70, 35)];
  1474. [_btnCollectionStatusRecentlyThirtyDays setTitle:@"近30天" forState:UIControlStateNormal];
  1475. _btnCollectionStatusRecentlyThirtyDays.titleLabel.font = [UIFont systemFontOfSize: 10.0];
  1476. [_btnCollectionStatusRecentlyThirtyDays addTarget:self action:@selector(selectCollectionStatusThirtyDaysData) forControlEvents:UIControlEventTouchUpInside];
  1477. [_btnCollectionStatusRecentlyThirtyDays setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  1478. UIBezierPath *maskPath4 = [UIBezierPath bezierPathWithRoundedRect:_btnCollectionStatusRecentlyThirtyDays.bounds byRoundingCorners:UIRectCornerTopRight|UIRectCornerBottomRight cornerRadii:CGSizeMake(25.0, 25.0)];
  1479. CAShapeLayer *maskLayer4 = [CAShapeLayer layer];
  1480. maskLayer4.frame = _btnCollectionStatusRecentlyThirtyDays.bounds;
  1481. maskLayer4.path = maskPath4.CGPath;
  1482. _btnCollectionStatusRecentlyThirtyDays.layer.mask = maskLayer4;
  1483. [collectionContent addSubview:_btnCollectionStatusRecentlyThirtyDays];
  1484. btnCollectionStatusRecentlyThirtyDaysMaskLayer = [CAShapeLayer layer];
  1485. btnCollectionStatusRecentlyThirtyDaysMaskLayer.frame = _btnCollectionStatusRecentlyThirtyDays.bounds;
  1486. btnCollectionStatusRecentlyThirtyDaysMaskLayer.path = maskPath4.CGPath;
  1487. btnCollectionStatusRecentlyThirtyDaysMaskLayer.fillColor=[UIColor clearColor].CGColor;
  1488. btnCollectionStatusRecentlyThirtyDaysMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  1489. btnCollectionStatusRecentlyThirtyDaysMaskLayer.lineWidth=1;
  1490. [_btnCollectionStatusRecentlyThirtyDays.layer addSublayer:btnCollectionStatusRecentlyThirtyDaysMaskLayer];
  1491. vCollectionStatusDate =[UIView new];
  1492. vCollectionStatusDate.frame=CGRectMake(0, CGRectGetMaxY(_btnCollectionStatusCustom.frame)+topMargin, Screen_Width, 0);
  1493. [collectionContent addSubview:vCollectionStatusDate];
  1494. vCollectionStatusDate.hidden=YES;
  1495. _btnCollectionStatusStartDate = [UIButton buttonWithType:UIButtonTypeCustom];
  1496. [_btnCollectionStatusStartDate setTitle:_collectionStatusStartDate forState:UIControlStateNormal];
  1497. [_btnCollectionStatusStartDate setBackgroundColor:[UIColor whiteColor]];
  1498. [_btnCollectionStatusStartDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  1499. _btnCollectionStatusStartDate.titleLabel.font= [UIFont systemFontOfSize:14];
  1500. [_btnCollectionStatusStartDate addTarget:self action:@selector(btnSelectCollectionStatusStartDate) forControlEvents:UIControlEventTouchUpInside];
  1501. _btnCollectionStatusStartDate.frame = CGRectMake(Screen_Width/2-110 ,0 , 100, 25);
  1502. [vCollectionStatusDate addSubview:_btnCollectionStatusStartDate];
  1503. UILabel *separatorCollectionStatusLbl=[UILabel new];
  1504. separatorCollectionStatusLbl.frame=CGRectMake(CGRectGetMaxX(_btnCollectionStatusStartDate.frame), 0, 20, 25);
  1505. separatorCollectionStatusLbl.text=@"--";
  1506. separatorCollectionStatusLbl.textColor = [UIColor blackColor];
  1507. separatorCollectionStatusLbl.font = [UIFont systemFontOfSize: 14];
  1508. [vCollectionStatusDate addSubview:separatorCollectionStatusLbl];
  1509. _btnCollectionStatusEndDate = [UIButton buttonWithType:UIButtonTypeCustom];
  1510. [_btnCollectionStatusEndDate setTitle:_collectionStatusEndDate forState:UIControlStateNormal];
  1511. [_btnCollectionStatusEndDate setBackgroundColor:[UIColor whiteColor]];
  1512. [_btnCollectionStatusEndDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  1513. _btnCollectionStatusEndDate.titleLabel.font= [UIFont systemFontOfSize:14];
  1514. [_btnSalesStatusEndDate addTarget:self action:@selector(btnSelectCollectionStatusEndDate) forControlEvents:UIControlEventTouchUpInside];
  1515. _btnCollectionStatusEndDate.frame = CGRectMake(CGRectGetMaxX(separatorCollectionStatusLbl.frame) ,0 , 100, 25);
  1516. [vCollectionStatusDate addSubview:_btnCollectionStatusEndDate];
  1517. collectionAmountContent =[[UIView alloc]init];
  1518. collectionAmountContent.frame = CGRectMake(0,CGRectGetMaxY(_btnCollectionStatusCustom.frame)+topMargin, Screen_Width, 0);
  1519. [collectionContent addSubview:collectionAmountContent];
  1520. UIView *collectionAmountView= [[UIView alloc]init];
  1521. collectionAmountView.frame = CGRectMake(0,0, Screen_Width, 25);
  1522. UILabel *lblTitleCollectionAmount = [[UILabel alloc]init];
  1523. lblTitleCollectionAmount.frame = CGRectMake(Screen_Width/2-110, 0, 110, 25);
  1524. lblTitleCollectionAmount.text = @"收款金额:";
  1525. lblTitleCollectionAmount.textColor = [UIColor redColor];
  1526. lblTitleCollectionAmount.font = [UIFont systemFontOfSize:NoDataFontOfSize];
  1527. [collectionAmountView addSubview:lblTitleCollectionAmount];
  1528. lblCollectionAmount = [[UILabel alloc]init];
  1529. lblCollectionAmount.frame = CGRectMake(CGRectGetMaxX(lblTitleCollectionAmount.frame), 0, 150, 25);
  1530. lblCollectionAmount.textColor = [UIColor redColor];
  1531. lblCollectionAmount.text=@"0.00";
  1532. lblCollectionAmount.font = [UIFont systemFontOfSize:NoDataFontOfSize];
  1533. [collectionAmountView addSubview:lblCollectionAmount];
  1534. [collectionAmountContent addSubview:collectionAmountView];
  1535. _btnCollectionStatusDepartment = [[UIButton alloc] initWithFrame:CGRectMake(Screen_Width/2-70,CGRectGetMaxY(collectionAmountView.frame)+topMargin, 70, 35)];
  1536. [_btnCollectionStatusDepartment setTitle:@"部门" forState:UIControlStateNormal];
  1537. [_btnCollectionStatusDepartment setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  1538. _btnCollectionStatusDepartment.titleLabel.font = [UIFont systemFontOfSize: 12.0];
  1539. [_btnCollectionStatusDepartment addTarget:self action:@selector(goCollectionStatus:) forControlEvents:UIControlEventTouchUpInside];
  1540. _btnCollectionStatusDepartment.tag=1003;
  1541. UIBezierPath *maskPath8 = [UIBezierPath bezierPathWithRoundedRect:_btnCollectionStatusDepartment.bounds byRoundingCorners:UIRectCornerTopLeft|UIRectCornerBottomLeft cornerRadii:CGSizeMake(25.0, 25.0)];
  1542. CAShapeLayer *maskLayer9 = [CAShapeLayer layer];
  1543. maskLayer9.frame = _btnCollectionStatusDepartment.bounds;
  1544. maskLayer9.path = maskPath8.CGPath;
  1545. _btnCollectionStatusDepartment.layer.mask = maskLayer9;
  1546. [collectionAmountContent addSubview:_btnCollectionStatusDepartment];
  1547. btnCollectionStatusDepartmentMaskLayer = [CAShapeLayer layer];
  1548. btnCollectionStatusDepartmentMaskLayer.frame = _btnSalesStatusDepartment.bounds;
  1549. btnCollectionStatusDepartmentMaskLayer.path = maskPath8.CGPath;
  1550. btnCollectionStatusDepartmentMaskLayer.fillColor=[UIColor clearColor].CGColor;
  1551. btnCollectionStatusDepartmentMaskLayer.strokeColor=[UIColor redColor].CGColor;
  1552. btnCollectionStatusDepartmentMaskLayer.lineWidth=1;
  1553. [_btnCollectionStatusDepartment.layer addSublayer:btnCollectionStatusDepartmentMaskLayer];
  1554. _btnCollectionStatusChannel = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnCollectionStatusDepartment.frame),CGRectGetMaxY(collectionAmountView.frame)+topMargin, 70, 35)];
  1555. [_btnCollectionStatusChannel setTitle:@"渠道" forState:UIControlStateNormal];
  1556. [_btnCollectionStatusChannel setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  1557. _btnCollectionStatusChannel.tag=1004;
  1558. [_btnCollectionStatusChannel addTarget:self action:@selector(goCollectionStatus:) forControlEvents:UIControlEventTouchUpInside];
  1559. _btnCollectionStatusChannel.titleLabel.font = [UIFont systemFontOfSize: 12.0];
  1560. UIBezierPath *maskPath11 = [UIBezierPath bezierPathWithRoundedRect:_btnCollectionStatusChannel.bounds byRoundingCorners:UIRectCornerTopRight|UIRectCornerBottomRight cornerRadii:CGSizeMake(25.0, 25.0)];
  1561. CAShapeLayer *maskLayer11 = [CAShapeLayer layer];
  1562. maskLayer11.frame = _btnCollectionStatusChannel.bounds;
  1563. maskLayer11.path = maskPath11.CGPath;
  1564. _btnCollectionStatusChannel.layer.mask = maskLayer11;
  1565. [collectionAmountContent addSubview:_btnCollectionStatusChannel];
  1566. btnCollectionStatusChannelMaskLayer = [CAShapeLayer layer];
  1567. btnCollectionStatusChannelMaskLayer.frame = _btnCollectionStatusChannel.bounds;
  1568. btnCollectionStatusChannelMaskLayer.path = maskPath11.CGPath;
  1569. btnCollectionStatusChannelMaskLayer.fillColor=[UIColor clearColor].CGColor;
  1570. btnCollectionStatusChannelMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  1571. btnCollectionStatusChannelMaskLayer.lineWidth=1;
  1572. [_btnCollectionStatusChannel.layer addSublayer:btnCollectionStatusChannelMaskLayer];
  1573. collectionStatusBorderV=[CustomBorderView new];
  1574. collectionStatusBorderV.frame=CGRectMake(5, CGRectGetMaxY(_btnCollectionStatusDepartment.frame)+topMargin,Screen_Width-30, 350);
  1575. [collectionStatusBorderV setBackgroundColor:[UIColor whiteColor]];
  1576. [collectionStatusBorderV drawBoardLine:borderWidth cornerRadius:2 color:[UIColor hexColor:@"D5CDCD"]];
  1577. [collectionAmountContent addSubview:collectionStatusBorderV];
  1578. _collectionStatusChartView=[[BarChartView alloc]init];
  1579. _collectionStatusChartView.frame=CGRectMake(0, 0,collectionStatusBorderV.frame.size.width, 350);
  1580. [collectionStatusBorderV addSubview:_collectionStatusChartView];
  1581. collectionAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnCollectionStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(collectionStatusBorderV.frame)+10);
  1582. collectionContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(collectionAmountContent.frame)+10);
  1583. collectionContent.layer.cornerRadius=CornerRadius;
  1584. height=CGRectGetMaxY(collectionContent.frame);
  1585. // }
  1586. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_ORDER_STATUS_IPHONE].location!=NSNotFound){
  1587. //订单情况
  1588. orderStatusContent=[UIView new];
  1589. orderStatusContent.backgroundColor=[UIColor whiteColor];
  1590. orderStatusContent.frame=CGRectMake(10,height+10, Screen_Width-20, 0);
  1591. [content addSubview:orderStatusContent];
  1592. UIView *orderStatusTitleView = [[UIView alloc]init];
  1593. orderStatusTitleView.frame = CGRectMake(0,0 ,Screen_Width, 45);
  1594. UIView *orderStatusImgView=[UIImageView new];
  1595. orderStatusImgView.frame=CGRectMake(10, 10,10 , 25);
  1596. [orderStatusImgView setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]];
  1597. [orderStatusTitleView addSubview:orderStatusImgView];
  1598. UILabel *titleOrderStatus = [[UILabel alloc]init];
  1599. titleOrderStatus.frame = CGRectMake(CGRectGetMaxX(orderStatusImgView.frame)+10, 10, 100, 25);
  1600. titleOrderStatus.text = @"订单情况";
  1601. titleOrderStatus.textColor = [UIColor blackColor];
  1602. titleOrderStatus.font = [UIFont systemFontOfSize:NoDataFontOfSize];
  1603. [orderStatusTitleView addSubview:titleOrderStatus];
  1604. [orderStatusContent addSubview:orderStatusTitleView];
  1605. UIView *separator2=[UIView new];
  1606. separator2.frame=CGRectMake(0,orderStatusTitleView.frame.size.height-1, orderStatusTitleView.frame.size.width-20, 0.5);
  1607. [separator2 setBackgroundColor:[UIColor lightGrayColor]];
  1608. [orderStatusTitleView addSubview:separator2 ];
  1609. _btnOrderStatusCustom = [[UIButton alloc] initWithFrame:CGRectMake(Screen_Width/2-175-10,CGRectGetMaxY(orderStatusTitleView.frame)+topMargin, 70, 35)];
  1610. [_btnOrderStatusCustom setTitle:@"自定义" forState:UIControlStateNormal];
  1611. [_btnOrderStatusCustom setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  1612. _btnOrderStatusCustom.titleLabel.font = [UIFont systemFontOfSize: 10.0];
  1613. [_btnOrderStatusCustom addTarget:self action:@selector(selectOrderStatusCustomDateData) forControlEvents:UIControlEventTouchUpInside];
  1614. UIBezierPath *maskPath13 = [UIBezierPath bezierPathWithRoundedRect:_btnOrderStatusCustom.bounds byRoundingCorners:UIRectCornerTopLeft|UIRectCornerBottomLeft cornerRadii:CGSizeMake(25.0, 25.0)];
  1615. CAShapeLayer *maskLayer13 = [CAShapeLayer layer];
  1616. maskLayer13.frame = _btnOrderStatusCustom.bounds;
  1617. maskLayer13.path = maskPath13.CGPath;
  1618. _btnOrderStatusCustom.layer.mask = maskLayer13;
  1619. [orderStatusContent addSubview:_btnOrderStatusCustom];
  1620. btnOrderStatusCustomMaskLayer = [CAShapeLayer layer];
  1621. btnOrderStatusCustomMaskLayer.frame = _btnOrderStatusCustom.bounds;
  1622. btnOrderStatusCustomMaskLayer.path = maskPath13.CGPath;
  1623. btnOrderStatusCustomMaskLayer.fillColor=[UIColor clearColor].CGColor;
  1624. btnOrderStatusCustomMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  1625. btnOrderStatusCustomMaskLayer.lineWidth=1;
  1626. [_btnOrderStatusCustom.layer addSublayer:btnOrderStatusCustomMaskLayer];
  1627. _btnOrderStatusYesterday = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnOrderStatusCustom.frame),CGRectGetMaxY(orderStatusTitleView.frame)+topMargin, 70, 35)];
  1628. [_btnOrderStatusYesterday setTitle:[DateFormat getDateBefore:1] forState:UIControlStateNormal];
  1629. _btnOrderStatusYesterday.layer.cornerRadius=0;
  1630. _btnOrderStatusYesterday.layer.borderWidth=1;
  1631. [_btnOrderStatusYesterday addTarget:self action:@selector(selectOrderStatusYesterdayDateData) forControlEvents:UIControlEventTouchUpInside];
  1632. [_btnOrderStatusYesterday setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  1633. [_btnOrderStatusYesterday.layer setMasksToBounds:YES];//设置按钮的圆角半径不会被遮挡
  1634. _btnOrderStatusYesterday.layer.borderColor=[UIColor lightGrayColor].CGColor;
  1635. _btnOrderStatusYesterday.titleLabel.font = [UIFont systemFontOfSize: 10.0];
  1636. [orderStatusContent addSubview:_btnOrderStatusYesterday];
  1637. _btnOrderStatusToday = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnOrderStatusYesterday.frame),CGRectGetMaxY(orderStatusTitleView.frame)+topMargin, 70, 35)];
  1638. [_btnOrderStatusToday setTitle: [DateFormat getCurrentDate]forState:UIControlStateNormal];
  1639. _btnOrderStatusToday.layer.cornerRadius=0;
  1640. _btnOrderStatusToday.layer.borderWidth=1;
  1641. _btnOrderStatusToday.titleLabel.font = [UIFont systemFontOfSize: 10.0];
  1642. [_btnOrderStatusToday addTarget:self action:@selector(selectOrderStatusTodayDateData) forControlEvents:UIControlEventTouchUpInside];
  1643. [_btnOrderStatusToday setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  1644. [_btnOrderStatusToday.layer setMasksToBounds:YES];//设置按钮的圆角半径不会被遮挡
  1645. _btnOrderStatusToday.layer.borderColor=[UIColor redColor].CGColor;
  1646. [orderStatusContent addSubview:_btnOrderStatusToday];
  1647. _btnOrderStatusRecentlySevenDays = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnOrderStatusToday.frame),CGRectGetMaxY(orderStatusTitleView.frame)+topMargin, 70, 35)];
  1648. [_btnOrderStatusRecentlySevenDays setTitle:@"近7天" forState:UIControlStateNormal];
  1649. _btnOrderStatusRecentlySevenDays.titleLabel.font = [UIFont systemFontOfSize: 10.0];
  1650. _btnOrderStatusRecentlySevenDays.layer.cornerRadius=0;
  1651. _btnOrderStatusRecentlySevenDays.layer.borderWidth=1;
  1652. [_btnOrderStatusRecentlySevenDays addTarget:self action:@selector(selectOrderStatusSevenDaysData) forControlEvents:UIControlEventTouchUpInside];
  1653. [_btnOrderStatusRecentlySevenDays setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  1654. [_btnOrderStatusRecentlySevenDays.layer setMasksToBounds:YES];//设置按钮的圆角半径不会被遮挡
  1655. _btnOrderStatusRecentlySevenDays.layer.borderColor=[UIColor lightGrayColor].CGColor;
  1656. [orderStatusContent addSubview:_btnOrderStatusRecentlySevenDays];
  1657. _btnOrderStatusRecentlyThirtyDays = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnOrderStatusRecentlySevenDays.frame),CGRectGetMaxY(orderStatusTitleView.frame)+topMargin, 70, 35)];
  1658. [_btnOrderStatusRecentlyThirtyDays setTitle:@"近30天" forState:UIControlStateNormal];
  1659. _btnOrderStatusRecentlyThirtyDays.titleLabel.font = [UIFont systemFontOfSize: 10.0];
  1660. [_btnOrderStatusRecentlyThirtyDays addTarget:self action:@selector(selectOrderStatusThirtyDaysData) forControlEvents:UIControlEventTouchUpInside];
  1661. [_btnOrderStatusRecentlyThirtyDays setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  1662. UIBezierPath *maskPath15 = [UIBezierPath bezierPathWithRoundedRect:_btnOrderStatusRecentlyThirtyDays.bounds byRoundingCorners:UIRectCornerTopRight|UIRectCornerBottomRight cornerRadii:CGSizeMake(25.0, 25.0)];
  1663. CAShapeLayer *maskLayer15 = [CAShapeLayer layer];
  1664. maskLayer15.frame = _btnOrderStatusRecentlyThirtyDays.bounds;
  1665. maskLayer15.path = maskPath15.CGPath;
  1666. _btnOrderStatusRecentlyThirtyDays.layer.mask = maskLayer15;
  1667. [orderStatusContent addSubview:_btnOrderStatusRecentlyThirtyDays];
  1668. btnOrderStatusRecentlyThirtyDaysMaskLayer = [CAShapeLayer layer];
  1669. btnOrderStatusRecentlyThirtyDaysMaskLayer.frame = _btnOrderStatusRecentlyThirtyDays.bounds;
  1670. btnOrderStatusRecentlyThirtyDaysMaskLayer.path = maskPath15.CGPath;
  1671. btnOrderStatusRecentlyThirtyDaysMaskLayer.fillColor=[UIColor clearColor].CGColor;
  1672. btnOrderStatusRecentlyThirtyDaysMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  1673. btnOrderStatusRecentlyThirtyDaysMaskLayer.lineWidth=1;
  1674. [_btnOrderStatusRecentlyThirtyDays.layer addSublayer:btnOrderStatusRecentlyThirtyDaysMaskLayer];
  1675. vOrderStatusDate =[UIView new];
  1676. vOrderStatusDate.frame=CGRectMake(0, CGRectGetMaxY(_btnOrderStatusCustom.frame)+topMargin, Screen_Width, 0);
  1677. [orderStatusContent addSubview:vOrderStatusDate];
  1678. vOrderStatusDate.hidden=YES;
  1679. _btnOrderStatusStartDate = [UIButton buttonWithType:UIButtonTypeCustom];
  1680. [_btnOrderStatusStartDate setTitle:_orderStatusStartDate forState:UIControlStateNormal];
  1681. [_btnOrderStatusStartDate setBackgroundColor:[UIColor whiteColor]];
  1682. [_btnOrderStatusStartDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  1683. _btnOrderStatusStartDate.titleLabel.font= [UIFont systemFontOfSize:14];
  1684. [_btnOrderStatusStartDate addTarget:self action:@selector(btnSelectOrderStatusStartDate) forControlEvents:UIControlEventTouchUpInside];
  1685. _btnOrderStatusStartDate.frame = CGRectMake(Screen_Width/2-110 ,0 , 100, 25);
  1686. [vOrderStatusDate addSubview:_btnOrderStatusStartDate];
  1687. UILabel *separatorOrderStatusLbl=[UILabel new];
  1688. separatorOrderStatusLbl.frame=CGRectMake(CGRectGetMaxX(_btnOrderStatusStartDate.frame), 0, 20, 25);
  1689. separatorOrderStatusLbl.text=@"--";
  1690. separatorOrderStatusLbl.textColor = [UIColor blackColor];
  1691. separatorOrderStatusLbl.font = [UIFont systemFontOfSize: 14];
  1692. [vOrderStatusDate addSubview:separatorOrderStatusLbl];
  1693. _btnOrderStatusEndDate = [UIButton buttonWithType:UIButtonTypeCustom];
  1694. [_btnOrderStatusEndDate setTitle:_orderStatusEndDate forState:UIControlStateNormal];
  1695. [_btnOrderStatusEndDate setBackgroundColor:[UIColor whiteColor]];
  1696. [_btnOrderStatusEndDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  1697. _btnOrderStatusEndDate.titleLabel.font= [UIFont systemFontOfSize:14];
  1698. [_btnOrderStatusEndDate addTarget:self action:@selector(btnSelectOrderStatusEndDate) forControlEvents:UIControlEventTouchUpInside];
  1699. _btnOrderStatusEndDate.frame = CGRectMake(CGRectGetMaxX(separatorOrderStatusLbl.frame) ,0 , 100, 25);
  1700. [vOrderStatusDate addSubview:_btnOrderStatusEndDate];
  1701. orderAmountContent =[[UIView alloc]init];
  1702. orderAmountContent.frame = CGRectMake(0,CGRectGetMaxY(_btnOrderStatusCustom.frame)+topMargin, Screen_Width, 0);
  1703. [orderStatusContent addSubview:orderAmountContent];
  1704. UIView *orderCustomerCountView = [[UIView alloc]init];
  1705. orderCustomerCountView.frame = CGRectMake(0,topMargin,Screen_Width/2, rowHeight);
  1706. lblOrderCustomerCount= [[UILabel alloc]init];
  1707. lblOrderCustomerCount.frame = CGRectMake(0, 0,orderCustomerCountView.frame.size.width, 25);
  1708. lblOrderCustomerCount.textAlignment=UITextAlignmentCenter;
  1709. lblOrderCustomerCount.textColor = [UIColor blackColor];
  1710. lblOrderCustomerCount.text=@"0";
  1711. lblOrderCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  1712. [orderCustomerCountView addSubview:lblOrderCustomerCount];
  1713. UILabel *lblTitleOrderCustomerCount = [[UILabel alloc]init];
  1714. lblTitleOrderCustomerCount.frame = CGRectMake(0,CGRectGetMaxY(lblOrderCustomerCount.frame),orderCustomerCountView.frame.size.width, 25);
  1715. lblTitleOrderCustomerCount.text = @"开单户数";
  1716. lblTitleOrderCustomerCount.textColor = [UIColor blackColor];
  1717. lblTitleOrderCustomerCount.textAlignment=UITextAlignmentCenter;
  1718. lblTitleOrderCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  1719. [orderCustomerCountView addSubview:lblTitleOrderCustomerCount];
  1720. [orderAmountContent addSubview:orderCustomerCountView];
  1721. UIView *unsubscribeCustomerCountView = [[UIView alloc]init];
  1722. unsubscribeCustomerCountView.frame = CGRectMake(0,CGRectGetMaxY(orderCustomerCountView.frame)+topMargin,Screen_Width/2, rowHeight);
  1723. lblUnsubscribeCustomerCount= [[UILabel alloc]init];
  1724. lblUnsubscribeCustomerCount.frame = CGRectMake(0, 0,unsubscribeCustomerCountView.frame.size.width, 25);
  1725. lblUnsubscribeCustomerCount.textAlignment=UITextAlignmentCenter;
  1726. lblUnsubscribeCustomerCount.textColor = [UIColor blackColor];
  1727. lblUnsubscribeCustomerCount.text=@"0";
  1728. lblUnsubscribeCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  1729. [unsubscribeCustomerCountView addSubview:lblUnsubscribeCustomerCount];
  1730. UILabel *lblTitleUnsubscribeCustomerCount = [[UILabel alloc]init];
  1731. lblTitleUnsubscribeCustomerCount.frame = CGRectMake(0,CGRectGetMaxY(lblUnsubscribeCustomerCount.frame),unsubscribeCustomerCountView.frame.size.width, 25);
  1732. lblTitleUnsubscribeCustomerCount.text = @"退订户数";
  1733. lblTitleUnsubscribeCustomerCount.textColor = [UIColor blackColor];
  1734. lblTitleUnsubscribeCustomerCount.textAlignment=UITextAlignmentCenter;
  1735. lblTitleUnsubscribeCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  1736. [unsubscribeCustomerCountView addSubview:lblTitleUnsubscribeCustomerCount];
  1737. [orderAmountContent addSubview:unsubscribeCustomerCountView];
  1738. UIView *middleSeparator1=[UIView new];
  1739. middleSeparator1.frame=CGRectMake(Screen_Width/2,topMargin, 0.5, 45);
  1740. middleSeparator1.backgroundColor=[UIColor lightGrayColor];
  1741. [orderAmountContent addSubview:middleSeparator1];
  1742. UIView *orderAmountView = [[UIView alloc]init];
  1743. orderAmountView.frame = CGRectMake(Screen_Width/2,topMargin, Screen_Width/2, rowHeight);
  1744. lblOrderAmount = [[UILabel alloc]init];
  1745. lblOrderAmount.frame = CGRectMake(0, 0, orderAmountView.frame.size.width, 25);
  1746. lblOrderAmount.textAlignment=UITextAlignmentCenter;
  1747. lblOrderAmount.text=@"0.00";
  1748. lblOrderAmount.textColor = [UIColor blackColor];
  1749. lblOrderAmount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  1750. [orderAmountView addSubview:lblOrderAmount];
  1751. UILabel *lblOrderAmountTitle = [[UILabel alloc]init];
  1752. lblOrderAmountTitle.frame = CGRectMake(0,CGRectGetMaxY(lblOrderAmount.frame), orderAmountView.frame.size.width, 25);
  1753. lblOrderAmountTitle.text = @"开单金额";
  1754. lblOrderAmountTitle.textAlignment=UITextAlignmentCenter;
  1755. lblOrderAmountTitle.textColor = [UIColor blackColor];
  1756. lblOrderAmountTitle.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  1757. [orderAmountView addSubview:lblOrderAmountTitle];
  1758. [orderAmountContent addSubview:orderAmountView];
  1759. UIView *unsubscribeAmountView = [[UIView alloc]init];
  1760. unsubscribeAmountView.frame = CGRectMake(Screen_Width/2,CGRectGetMaxY(orderAmountView.frame)+topMargin, Screen_Width/2, rowHeight);
  1761. lblUnsubscribeAmount = [[UILabel alloc]init];
  1762. lblUnsubscribeAmount.frame = CGRectMake(0, 0, unsubscribeAmountView.frame.size.width, 25);
  1763. lblUnsubscribeAmount.textAlignment=UITextAlignmentCenter;
  1764. lblUnsubscribeAmount.text=@"0.00";
  1765. lblUnsubscribeAmount.textColor = [UIColor blackColor];
  1766. lblUnsubscribeAmount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  1767. [unsubscribeAmountView addSubview:lblUnsubscribeAmount];
  1768. UILabel *lblUnsubscribeAmountTitle= [[UILabel alloc]init];
  1769. lblUnsubscribeAmountTitle.frame = CGRectMake(0,CGRectGetMaxY(lblUnsubscribeAmount.frame), unsubscribeAmountView.frame.size.width, 25);
  1770. lblUnsubscribeAmountTitle.text = @"退订金额";
  1771. lblUnsubscribeAmountTitle.textAlignment=UITextAlignmentCenter;
  1772. lblUnsubscribeAmountTitle.textColor = [UIColor blackColor];
  1773. lblUnsubscribeAmountTitle.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  1774. [unsubscribeAmountView addSubview:lblUnsubscribeAmountTitle];
  1775. [orderAmountContent addSubview:unsubscribeAmountView];
  1776. _btnOrderStatusDepartment = [[UIButton alloc] initWithFrame:CGRectMake(Screen_Width/2-70,CGRectGetMaxY(unsubscribeCustomerCountView.frame)+topMargin, 70, 35)];
  1777. [_btnOrderStatusDepartment setTitle:@"部门" forState:UIControlStateNormal];
  1778. [_btnOrderStatusDepartment setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  1779. _btnOrderStatusDepartment.titleLabel.font = [UIFont systemFontOfSize: 12.0];
  1780. [_btnOrderStatusDepartment addTarget:self action:@selector(goOrderStatus:) forControlEvents:UIControlEventTouchUpInside];
  1781. _btnOrderStatusDepartment.tag=1005;
  1782. UIBezierPath *maskPath16 = [UIBezierPath bezierPathWithRoundedRect:_btnOrderStatusDepartment.bounds byRoundingCorners:UIRectCornerTopLeft|UIRectCornerBottomLeft cornerRadii:CGSizeMake(25.0, 25.0)];
  1783. CAShapeLayer *maskLayer16 = [CAShapeLayer layer];
  1784. maskLayer16.frame = _btnOrderStatusDepartment.bounds;
  1785. maskLayer16.path = maskPath16.CGPath;
  1786. _btnOrderStatusDepartment.layer.mask = maskLayer16;
  1787. [orderAmountContent addSubview:_btnOrderStatusDepartment];
  1788. btnOrderStatusDepartmentMaskLayer = [CAShapeLayer layer];
  1789. btnOrderStatusDepartmentMaskLayer.frame = _btnOrderStatusDepartment.bounds;
  1790. btnOrderStatusDepartmentMaskLayer.path = maskPath16.CGPath;
  1791. btnOrderStatusDepartmentMaskLayer.fillColor=[UIColor clearColor].CGColor;
  1792. btnOrderStatusDepartmentMaskLayer.strokeColor=[UIColor redColor].CGColor;
  1793. btnOrderStatusDepartmentMaskLayer.lineWidth=1;
  1794. [_btnOrderStatusDepartment.layer addSublayer:btnOrderStatusDepartmentMaskLayer];
  1795. _btnOrderStatusChannel = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnOrderStatusDepartment.frame),CGRectGetMaxY(unsubscribeCustomerCountView.frame)+topMargin, 70, 35)];
  1796. [_btnOrderStatusChannel setTitle:@"渠道" forState:UIControlStateNormal];
  1797. [_btnOrderStatusChannel setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  1798. _btnOrderStatusChannel.tag=1006;
  1799. [_btnOrderStatusChannel addTarget:self action:@selector(goOrderStatus:) forControlEvents:UIControlEventTouchUpInside];
  1800. _btnOrderStatusChannel.titleLabel.font = [UIFont systemFontOfSize: 12.0];
  1801. UIBezierPath *maskPath19 = [UIBezierPath bezierPathWithRoundedRect:_btnOrderStatusChannel.bounds byRoundingCorners:UIRectCornerTopRight|UIRectCornerBottomRight cornerRadii:CGSizeMake(25.0, 25.0)];
  1802. CAShapeLayer *maskLayer19 = [CAShapeLayer layer];
  1803. maskLayer19.frame = _btnOrderStatusChannel.bounds;
  1804. maskLayer19.path = maskPath19.CGPath;
  1805. _btnOrderStatusChannel.layer.mask = maskLayer19;
  1806. [orderAmountContent addSubview:_btnOrderStatusChannel];
  1807. btnOrderStatusChannelMaskLayer = [CAShapeLayer layer];
  1808. btnOrderStatusChannelMaskLayer.frame = _btnOrderStatusChannel.bounds;
  1809. btnOrderStatusChannelMaskLayer.path = maskPath19.CGPath;
  1810. btnOrderStatusChannelMaskLayer.fillColor=[UIColor clearColor].CGColor;
  1811. btnOrderStatusChannelMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  1812. btnOrderStatusChannelMaskLayer.lineWidth=1;
  1813. [_btnOrderStatusChannel.layer addSublayer:btnOrderStatusChannelMaskLayer];
  1814. orderStatusBorderV=[CustomBorderView new];
  1815. orderStatusBorderV.frame=CGRectMake(5, CGRectGetMaxY(_btnOrderStatusDepartment.frame)+topMargin,Screen_Width-30, 350);
  1816. [orderStatusBorderV setBackgroundColor:[UIColor whiteColor]];
  1817. [orderStatusBorderV drawBoardLine:borderWidth cornerRadius:2 color:[UIColor hexColor:@"D5CDCD"]];
  1818. [orderAmountContent addSubview:orderStatusBorderV];
  1819. _orderStatusChartView=[[BarChartView alloc]init];
  1820. _orderStatusChartView.frame=CGRectMake(0,0,orderStatusBorderV.frame.size.width, 350);
  1821. [orderStatusBorderV addSubview:_orderStatusChartView];
  1822. orderAmountContent.frame=CGRectMake(0, CGRectGetMaxY(_btnOrderStatusCustom.frame)+topMargin,Screen_Width-20,CGRectGetMaxY(orderStatusBorderV.frame)+10);
  1823. orderStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(orderAmountContent.frame)+10);
  1824. orderStatusContent.layer.cornerRadius=CornerRadius;
  1825. height=CGRectGetMaxY(orderStatusContent.frame);
  1826. // }
  1827. salesAchievementContent=[UIView new];
  1828. salesAchievementContent.backgroundColor=[UIColor whiteColor];
  1829. salesAchievementContent.frame=CGRectMake(10,height+10, Screen_Width-20, 0);
  1830. [content addSubview:salesAchievementContent];
  1831. UIView *salesAchievementTitleView = [[UIView alloc]init];
  1832. salesAchievementTitleView.frame = CGRectMake(0,0 ,Screen_Width, 45);
  1833. UIView *salesAchievementImgView=[UIImageView new];
  1834. salesAchievementImgView.frame=CGRectMake(10, 10,10 , 25);
  1835. [salesAchievementImgView setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]];
  1836. [salesAchievementTitleView addSubview:salesAchievementImgView];
  1837. UILabel *titleSalesAchievement = [[UILabel alloc]init];
  1838. titleSalesAchievement.frame = CGRectMake(CGRectGetMaxX(salesAchievementImgView.frame)+10, 10, 100, 25);
  1839. titleSalesAchievement.text = @"销售业绩";
  1840. titleSalesAchievement.textColor = [UIColor blackColor];
  1841. titleSalesAchievement.font = [UIFont systemFontOfSize:NoDataFontOfSize];
  1842. [salesAchievementTitleView addSubview:titleSalesAchievement];
  1843. [salesAchievementContent addSubview:salesAchievementTitleView];
  1844. UIView *separator3=[UIView new];
  1845. separator3.frame=CGRectMake(0,salesAchievementTitleView.frame.size.height-1, orderStatusTitleView.frame.size.width-20, 0.5);
  1846. [separator3 setBackgroundColor:[UIColor lightGrayColor]];
  1847. [salesAchievementTitleView addSubview:separator3 ];
  1848. _btnSalesAchievementCustom= [[UIButton alloc] initWithFrame:CGRectMake(Screen_Width/2-90,CGRectGetMaxY(salesAchievementTitleView.frame)+topMargin, 70, 35)];
  1849. [_btnSalesAchievementCustom setTitle:@"自定义" forState:UIControlStateNormal];
  1850. [_btnSalesAchievementCustom setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  1851. _btnSalesAchievementCustom.titleLabel.font = [UIFont systemFontOfSize: 12.0];
  1852. [_btnSalesAchievementCustom addTarget:self action:@selector(selectSalesAchievementCustomDate) forControlEvents:UIControlEventTouchUpInside];
  1853. UIBezierPath *maskPath20 = [UIBezierPath bezierPathWithRoundedRect:_btnSalesAchievementCustom.bounds byRoundingCorners:UIRectCornerTopLeft|UIRectCornerBottomLeft cornerRadii:CGSizeMake(25.0, 25.0)];
  1854. CAShapeLayer *maskLayer20 = [CAShapeLayer layer];
  1855. maskLayer20.frame = _btnSalesAchievementCustom.bounds;
  1856. maskLayer20.path = maskPath20.CGPath;
  1857. _btnSalesAchievementCustom.layer.mask = maskLayer20;
  1858. btnSalesAchievementCustomMaskLayer= [CAShapeLayer layer];
  1859. btnSalesAchievementCustomMaskLayer.frame = _btnSalesAchievementCustom.bounds;
  1860. btnSalesAchievementCustomMaskLayer.path = maskPath20.CGPath;
  1861. btnSalesAchievementCustomMaskLayer.fillColor=[UIColor clearColor].CGColor;
  1862. btnSalesAchievementCustomMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  1863. btnSalesAchievementCustomMaskLayer.lineWidth=1;
  1864. [_btnSalesAchievementCustom.layer addSublayer:btnSalesAchievementCustomMaskLayer];
  1865. [salesAchievementContent addSubview:_btnSalesAchievementCustom];
  1866. _btnSalesAchievemmentToday = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnSalesAchievementCustom.frame),CGRectGetMaxY(salesAchievementTitleView.frame)+topMargin, 70, 35)];
  1867. _btnSalesAchievemmentToday.titleLabel.font = [UIFont systemFontOfSize: 12.0];
  1868. [_btnSalesAchievemmentToday setTitle:[DateFormat getCurrentMonth] forState:UIControlStateNormal];
  1869. [_btnSalesAchievemmentToday setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  1870. [_btnSalesAchievemmentToday addTarget:self action:@selector(getSalesAchievementCurrentMonth) forControlEvents:UIControlEventTouchUpInside];
  1871. UIBezierPath *maskPath22 = [UIBezierPath bezierPathWithRoundedRect:_btnSalesAchievemmentToday.bounds byRoundingCorners:UIRectCornerTopRight|UIRectCornerBottomRight cornerRadii:CGSizeMake(25.0, 25.0)];
  1872. CAShapeLayer *maskLayer22 = [CAShapeLayer layer];
  1873. maskLayer22.frame = _btnSalesAchievemmentToday.bounds;
  1874. maskLayer22.path = maskPath22.CGPath;
  1875. _btnSalesAchievemmentToday.layer.mask = maskLayer22;
  1876. btnSalesAchievementCurrentMonthMaskLayer= [CAShapeLayer layer];
  1877. btnSalesAchievementCurrentMonthMaskLayer.frame = _btnSalesAchievemmentToday.bounds;
  1878. btnSalesAchievementCurrentMonthMaskLayer.path = maskPath22.CGPath;
  1879. btnSalesAchievementCurrentMonthMaskLayer.fillColor=[UIColor clearColor].CGColor;
  1880. btnSalesAchievementCurrentMonthMaskLayer.strokeColor=[UIColor redColor].CGColor;
  1881. btnSalesAchievementCurrentMonthMaskLayer.lineWidth=1;
  1882. [_btnSalesAchievemmentToday.layer addSublayer:btnSalesAchievementCurrentMonthMaskLayer];
  1883. [salesAchievementContent addSubview:_btnSalesAchievemmentToday];
  1884. salesAchievementPieBorderV=[CustomBorderView new];
  1885. salesAchievementPieBorderV.frame=CGRectMake(5, CGRectGetMaxY(_btnSalesAchievementCustom.frame)+topMargin,Screen_Width-30, 200);
  1886. [salesAchievementPieBorderV setBackgroundColor:[UIColor whiteColor]];
  1887. [salesAchievementPieBorderV drawBoardLine:borderWidth cornerRadius:2 color:[UIColor hexColor:@"D5CDCD"]];
  1888. [salesAchievementContent addSubview:salesAchievementPieBorderV];
  1889. _salesAchievementChart = [[MyView alloc]initWithFrame:CGRectMake(0,0, salesAchievementPieBorderV.frame.size.width,200)];
  1890. [salesAchievementPieBorderV addSubview:_salesAchievementChart];
  1891. UIView *percentView = [[UIView alloc]init];
  1892. percentView.frame = CGRectMake(0,CGRectGetMaxY(salesAchievementPieBorderV.frame)-30, Screen_Width, 25);
  1893. lblSalesAchievementPercent= [[UILabel alloc]init];
  1894. lblSalesAchievementPercent.frame = CGRectMake(0, 0, percentView.frame.size.width, 25);
  1895. lblSalesAchievementPercent.textColor = [UIColor blackColor];
  1896. lblSalesAchievementPercent.text=@"完成率0.00%";
  1897. lblSalesAchievementPercent.font = [UIFont systemFontOfSize:22];
  1898. lblSalesAchievementPercent.textAlignment=NSTextAlignmentCenter;
  1899. [percentView addSubview:lblSalesAchievementPercent];
  1900. [salesAchievementContent addSubview:percentView];
  1901. UIView *planAmountView = [[UIView alloc]init];
  1902. planAmountView.frame = CGRectMake(0,CGRectGetMaxY(percentView.frame)+topMargin, Screen_Width/2, rowHeight);
  1903. lblSalesAchievementPlanAmount = [[UILabel alloc]init];
  1904. lblSalesAchievementPlanAmount.frame = CGRectMake(0, 0, planAmountView.frame.size.width, 25);
  1905. lblSalesAchievementPlanAmount.textColor = [UIColor blackColor];
  1906. lblSalesAchievementPlanAmount.text=@"0.00";
  1907. lblSalesAchievementPlanAmount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  1908. lblSalesAchievementPlanAmount.textAlignment=NSTextAlignmentCenter;
  1909. [planAmountView addSubview:lblSalesAchievementPlanAmount];
  1910. UILabel *lblTitleSalesAchievementPlanAmount = [[UILabel alloc]init];
  1911. lblTitleSalesAchievementPlanAmount.frame = CGRectMake(0,CGRectGetMaxY(lblSalesAchievementPlanAmount.frame),planAmountView.frame.size.width, 25);
  1912. lblTitleSalesAchievementPlanAmount.text = @"任务额";
  1913. lblTitleSalesAchievementPlanAmount.textColor = [UIColor blackColor];
  1914. lblTitleSalesAchievementPlanAmount.textAlignment=NSTextAlignmentCenter;
  1915. lblTitleSalesAchievementPlanAmount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  1916. [planAmountView addSubview:lblTitleSalesAchievementPlanAmount];
  1917. [salesAchievementContent addSubview:planAmountView];
  1918. UIView *middleSeparator7=[UIView new];
  1919. middleSeparator7.frame=CGRectMake(Screen_Width/2, CGRectGetMaxY(percentView.frame)+topMargin,0.5, 45);
  1920. middleSeparator7.backgroundColor=[UIColor lightGrayColor];
  1921. [salesAchievementContent addSubview:middleSeparator7];
  1922. UIView *achievementSalesAmountView = [[UIView alloc]init];
  1923. achievementSalesAmountView.frame = CGRectMake(Screen_Width/2,CGRectGetMaxY(percentView.frame)+topMargin,Screen_Width/2,rowHeight);
  1924. lblSalesAchievementSalesAmount = [[UILabel alloc]init];
  1925. lblSalesAchievementSalesAmount.frame = CGRectMake(0, 0,achievementSalesAmountView.frame.size.width, 25);
  1926. lblSalesAchievementSalesAmount.text=@"0.00";
  1927. lblSalesAchievementSalesAmount.textColor = [UIColor blackColor];
  1928. lblSalesAchievementSalesAmount.textAlignment=NSTextAlignmentCenter;
  1929. lblSalesAchievementSalesAmount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  1930. [achievementSalesAmountView addSubview:lblSalesAchievementSalesAmount];
  1931. UILabel *lblAchievementSalesAmountTitle= [[UILabel alloc]init];
  1932. lblAchievementSalesAmountTitle.frame = CGRectMake(0,CGRectGetMaxY(lblSalesAchievementSalesAmount.frame), achievementSalesAmountView.frame.size.width, 25);
  1933. lblAchievementSalesAmountTitle.text = @"销售金额";
  1934. lblAchievementSalesAmountTitle.textAlignment=NSTextAlignmentCenter;
  1935. lblAchievementSalesAmountTitle.textColor = [UIColor blackColor];
  1936. lblAchievementSalesAmountTitle.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  1937. [achievementSalesAmountView addSubview:lblAchievementSalesAmountTitle];
  1938. [salesAchievementContent addSubview:achievementSalesAmountView];
  1939. _btnSalesAchievementDepartment = [[UIButton alloc] initWithFrame:CGRectMake(Screen_Width/2-70,CGRectGetMaxY(planAmountView.frame)+topMargin, 70, 35)];
  1940. [_btnSalesAchievementDepartment setTitle:@"部门" forState:UIControlStateNormal];
  1941. [_btnSalesAchievementDepartment setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  1942. _btnSalesAchievementDepartment.titleLabel.font = [UIFont systemFontOfSize: 12.0];
  1943. [_btnSalesAchievementDepartment addTarget:self action:@selector(goSalesAchievement:) forControlEvents:UIControlEventTouchUpInside];
  1944. _btnSalesAchievementDepartment.tag=1007;
  1945. UIBezierPath *maskPath23 = [UIBezierPath bezierPathWithRoundedRect:_btnSalesAchievementDepartment.bounds byRoundingCorners:UIRectCornerTopLeft|UIRectCornerBottomLeft cornerRadii:CGSizeMake(25.0, 25.0)];
  1946. CAShapeLayer *maskLayer24 = [CAShapeLayer layer];
  1947. maskLayer24.frame = _btnSalesAchievementDepartment.bounds;
  1948. maskLayer24.path = maskPath23.CGPath;
  1949. _btnSalesAchievementDepartment.layer.mask = maskLayer24;
  1950. [salesAchievementContent addSubview:_btnSalesAchievementDepartment];
  1951. btnSalesAchievementDepartmentMaskLayer = [CAShapeLayer layer];
  1952. btnSalesAchievementDepartmentMaskLayer.frame = _btnSalesAchievementDepartment.bounds;
  1953. btnSalesAchievementDepartmentMaskLayer.path = maskPath23.CGPath;
  1954. btnSalesAchievementDepartmentMaskLayer.fillColor=[UIColor clearColor].CGColor;
  1955. btnSalesAchievementDepartmentMaskLayer.strokeColor=[UIColor redColor].CGColor;
  1956. btnSalesAchievementDepartmentMaskLayer.lineWidth=1;
  1957. [_btnSalesAchievementDepartment.layer addSublayer:btnSalesAchievementDepartmentMaskLayer];
  1958. _btnSalesAchievementStaff = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnSalesAchievementDepartment.frame),CGRectGetMaxY(planAmountView.frame)+topMargin, 70, 35)];
  1959. [_btnSalesAchievementStaff setTitle:@"业务员" forState:UIControlStateNormal];
  1960. [_btnSalesAchievementStaff setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  1961. _btnSalesAchievementStaff.tag=1008;
  1962. [_btnSalesAchievementStaff addTarget:self action:@selector(goSalesAchievement:) forControlEvents:UIControlEventTouchUpInside];
  1963. _btnSalesAchievementStaff.titleLabel.font = [UIFont systemFontOfSize: 12.0];
  1964. UIBezierPath *maskPath26 = [UIBezierPath bezierPathWithRoundedRect:_btnSalesAchievementStaff.bounds byRoundingCorners:UIRectCornerTopRight|UIRectCornerBottomRight cornerRadii:CGSizeMake(25.0, 25.0)];
  1965. CAShapeLayer *maskLayer26 = [CAShapeLayer layer];
  1966. maskLayer26.frame = _btnSalesAchievementStaff.bounds;
  1967. maskLayer26.path = maskPath26.CGPath;
  1968. _btnSalesAchievementStaff.layer.mask = maskLayer26;
  1969. [salesAchievementContent addSubview:_btnSalesAchievementStaff];
  1970. btnSalesAchievementStaffMaskLayer = [CAShapeLayer layer];
  1971. btnSalesAchievementStaffMaskLayer.frame = _btnSalesAchievementStaff.bounds;
  1972. btnSalesAchievementStaffMaskLayer.path = maskPath26.CGPath;
  1973. btnSalesAchievementStaffMaskLayer.fillColor=[UIColor clearColor].CGColor;
  1974. btnSalesAchievementStaffMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  1975. btnSalesAchievementStaffMaskLayer.lineWidth=1;
  1976. [_btnSalesAchievementStaff.layer addSublayer:btnSalesAchievementStaffMaskLayer];
  1977. salesAchievementBorderV=[CustomBorderView new];
  1978. salesAchievementBorderV.frame=CGRectMake(5, CGRectGetMaxY(_btnSalesAchievementDepartment.frame)+topMargin,Screen_Width-30, 350);
  1979. [salesAchievementBorderV setBackgroundColor:[UIColor whiteColor]];
  1980. [salesAchievementBorderV drawBoardLine:borderWidth cornerRadius:2 color:[UIColor hexColor:@"D5CDCD"]];
  1981. [salesAchievementContent addSubview:salesAchievementBorderV];
  1982. _salesAchievementChartView=[[BarChartView alloc]init];
  1983. _salesAchievementChartView.frame=CGRectMake(0,0,salesAchievementBorderV.frame.size.width, 350);
  1984. [salesAchievementBorderV addSubview:_salesAchievementChartView];
  1985. salesAchievementContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(salesAchievementBorderV.frame)+10);
  1986. salesAchievementContent.layer.cornerRadius=CornerRadius;
  1987. [content addSubview:salesAchievementContent];
  1988. height=CGRectGetMaxY(salesAchievementContent.frame);
  1989. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound){
  1990. shoppingGuideFilingContent=[UIView new];
  1991. shoppingGuideFilingContent.backgroundColor=[UIColor whiteColor];
  1992. shoppingGuideFilingContent.frame=CGRectMake(10,height+10, Screen_Width-20, 0);
  1993. [content addSubview:shoppingGuideFilingContent];
  1994. UIView *shoppingGuideFilingTitleView = [[UIView alloc]init];
  1995. shoppingGuideFilingTitleView.frame = CGRectMake(0,0 ,Screen_Width, 45);
  1996. UIView *shoppingGuideFilingImgView=[UIImageView new];
  1997. shoppingGuideFilingImgView.frame=CGRectMake(10, 10,10 , 25);
  1998. [shoppingGuideFilingImgView setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]];
  1999. [shoppingGuideFilingTitleView addSubview:shoppingGuideFilingImgView];
  2000. UILabel *titleShoppingGuideFiling = [[UILabel alloc]init];
  2001. titleShoppingGuideFiling.frame = CGRectMake(CGRectGetMaxX(shoppingGuideFilingImgView.frame)+10, 10, 300, 25);
  2002. titleShoppingGuideFiling.text = @"导购报备/成交客户排行(前5名)";
  2003. titleShoppingGuideFiling.textColor = [UIColor blackColor];
  2004. titleShoppingGuideFiling.font = [UIFont systemFontOfSize:NoDataFontOfSize];
  2005. [shoppingGuideFilingTitleView addSubview:titleShoppingGuideFiling];
  2006. [shoppingGuideFilingContent addSubview:shoppingGuideFilingTitleView];
  2007. UIView *separator4=[UIView new];
  2008. separator4.frame=CGRectMake(0,shoppingGuideFilingTitleView.frame.size.height-1, shoppingGuideFilingTitleView.frame.size.width-20, 0.5);
  2009. [separator4 setBackgroundColor:[UIColor lightGrayColor]];
  2010. [shoppingGuideFilingTitleView addSubview:separator4 ];
  2011. UIView *vShoppingGuideFilingDate =[UIView new];
  2012. vShoppingGuideFilingDate.frame=CGRectMake(0, CGRectGetMaxY(shoppingGuideFilingTitleView.frame)+topMargin, Screen_Width, 25);
  2013. [shoppingGuideFilingContent addSubview:vShoppingGuideFilingDate];
  2014. _btnShoppingGuideStartDate = [UIButton buttonWithType:UIButtonTypeCustom];
  2015. [_btnShoppingGuideStartDate setTitle:_shoppingGuideStartDate forState:UIControlStateNormal];
  2016. [_btnShoppingGuideStartDate setBackgroundColor:[UIColor whiteColor]];
  2017. [_btnShoppingGuideStartDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  2018. _btnShoppingGuideStartDate.titleLabel.font= [UIFont systemFontOfSize:18];
  2019. [_btnShoppingGuideStartDate addTarget:self action:@selector(btnSelectShoppingGuideStartDate) forControlEvents:UIControlEventTouchUpInside];
  2020. _btnShoppingGuideStartDate.frame = CGRectMake(Screen_Width/2-120 ,0 , 110, 25);
  2021. [vShoppingGuideFilingDate addSubview:_btnShoppingGuideStartDate];
  2022. UILabel *separatorShoppingGuideLbl=[UILabel new];
  2023. separatorShoppingGuideLbl.frame=CGRectMake(CGRectGetMaxX(_btnShoppingGuideStartDate.frame), 0, 20, 25);
  2024. separatorShoppingGuideLbl.text=@"--";
  2025. separatorShoppingGuideLbl.textColor = [UIColor blackColor];
  2026. separatorShoppingGuideLbl.font = [UIFont systemFontOfSize: 18];
  2027. [vShoppingGuideFilingDate addSubview:separatorShoppingGuideLbl];
  2028. _btnShoppingGuideEndDate = [UIButton buttonWithType:UIButtonTypeCustom];
  2029. [_btnShoppingGuideEndDate setTitle:_shoppingGuideEndDate forState:UIControlStateNormal];
  2030. [_btnShoppingGuideEndDate setBackgroundColor:[UIColor whiteColor]];
  2031. [_btnShoppingGuideEndDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  2032. _btnShoppingGuideEndDate.titleLabel.font= [UIFont systemFontOfSize:18];
  2033. [_btnShoppingGuideEndDate addTarget:self action:@selector(btnSelectShoppingGuideEndDate) forControlEvents:UIControlEventTouchUpInside];
  2034. _btnShoppingGuideEndDate.frame = CGRectMake(CGRectGetMaxX(separatorShoppingGuideLbl.frame) ,0 , 110, 25);
  2035. [vShoppingGuideFilingDate addSubview:_btnShoppingGuideEndDate];
  2036. UIView *filingCustomerCountView = [[UIView alloc]init];
  2037. filingCustomerCountView.frame = CGRectMake(0,CGRectGetMaxY(vShoppingGuideFilingDate.frame)+topMargin,Screen_Width/2, rowHeight);
  2038. lblFilingCustomerCount= [[UILabel alloc]init];
  2039. lblFilingCustomerCount.frame = CGRectMake(0, 0,filingCustomerCountView.frame.size.width, 25);
  2040. lblFilingCustomerCount.textAlignment=UITextAlignmentCenter;
  2041. lblFilingCustomerCount.textColor = [UIColor blackColor];
  2042. lblFilingCustomerCount.text=@"0";
  2043. lblFilingCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2044. [filingCustomerCountView addSubview:lblFilingCustomerCount];
  2045. UILabel *lblTitleFilingCustomerCount = [[UILabel alloc]init];
  2046. lblTitleFilingCustomerCount.frame = CGRectMake(0,CGRectGetMaxY(lblFilingCustomerCount.frame),filingCustomerCountView.frame.size.width, 25);
  2047. lblTitleFilingCustomerCount.text = @"报备客户数";
  2048. lblTitleFilingCustomerCount.textColor = [UIColor blackColor];
  2049. lblTitleFilingCustomerCount.textAlignment=UITextAlignmentCenter;
  2050. lblTitleFilingCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2051. [filingCustomerCountView addSubview:lblTitleFilingCustomerCount];
  2052. [shoppingGuideFilingContent addSubview:filingCustomerCountView];
  2053. UIView *middleSeparator6=[UIView new];
  2054. middleSeparator6.frame=CGRectMake(Screen_Width/2, CGRectGetMaxY(vShoppingGuideFilingDate.frame)+topMargin, 0.5, 45);
  2055. middleSeparator6.backgroundColor=[UIColor lightGrayColor];
  2056. [shoppingGuideFilingContent addSubview:middleSeparator6];
  2057. UIView *transactionCustomerCountView = [[UIView alloc]init];
  2058. transactionCustomerCountView.frame = CGRectMake(Screen_Width/2,CGRectGetMaxY(vShoppingGuideFilingDate.frame)+topMargin, Screen_Width/2, rowHeight);
  2059. lblTransactionCustomerCount = [[UILabel alloc]init];
  2060. lblTransactionCustomerCount.frame = CGRectMake(0, 0, transactionCustomerCountView.frame.size.width, 25);
  2061. lblTransactionCustomerCount.textAlignment=UITextAlignmentCenter;
  2062. lblTransactionCustomerCount.text=@"0";
  2063. lblTransactionCustomerCount.textColor = [UIColor blackColor];
  2064. lblTransactionCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2065. [transactionCustomerCountView addSubview:lblTransactionCustomerCount];
  2066. UILabel *lblTransactionCustomerCountTitle = [[UILabel alloc]init];
  2067. lblTransactionCustomerCountTitle.frame = CGRectMake(0,CGRectGetMaxY(lblTransactionCustomerCount.frame), transactionCustomerCountView.frame.size.width, 25);
  2068. lblTransactionCustomerCountTitle.text = @"成交客户数";
  2069. lblTransactionCustomerCountTitle.textAlignment=UITextAlignmentCenter;
  2070. lblTransactionCustomerCountTitle.textColor = [UIColor blackColor];
  2071. lblTransactionCustomerCountTitle.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2072. [transactionCustomerCountView addSubview:lblTransactionCustomerCountTitle];
  2073. [shoppingGuideFilingContent addSubview:transactionCustomerCountView];
  2074. shoppingGuidePieBorderV=[CustomBorderView new];
  2075. shoppingGuidePieBorderV.frame=CGRectMake(5, CGRectGetMaxY(filingCustomerCountView.frame)+topMargin,Screen_Width-30, 200);
  2076. [shoppingGuidePieBorderV setBackgroundColor:[UIColor whiteColor]];
  2077. [shoppingGuidePieBorderV drawBoardLine:borderWidth cornerRadius:2 color:[UIColor hexColor:@"D5CDCD"]];
  2078. [shoppingGuideFilingContent addSubview:shoppingGuidePieBorderV];
  2079. _transactionView = [[MyView alloc]initWithFrame:CGRectMake(5,5, shoppingGuidePieBorderV.frame.size.width-10,190)];
  2080. [shoppingGuidePieBorderV addSubview:_transactionView];
  2081. UIView *transactionPercentView = [[UIView alloc]init];
  2082. transactionPercentView.frame = CGRectMake(5,CGRectGetMaxY(shoppingGuidePieBorderV.frame)-30, shoppingGuideFilingContent.frame.size.width-10, 25);
  2083. lblTransactionPercent= [[UILabel alloc]init];
  2084. lblTransactionPercent.frame = CGRectMake(0, 0, transactionPercentView.frame.size.width, 25);
  2085. lblTransactionPercent.textColor = [UIColor blackColor];
  2086. lblTransactionPercent.text=@"成交率0.00%";
  2087. lblTransactionPercent.font = [UIFont systemFontOfSize:22];
  2088. lblTransactionPercent.textAlignment=NSTextAlignmentCenter;
  2089. [transactionPercentView addSubview:lblTransactionPercent];
  2090. [shoppingGuideFilingContent addSubview:transactionPercentView];
  2091. shoppingGuideChartBorderV=[CustomBorderView new];
  2092. shoppingGuideChartBorderV.frame=CGRectMake(5, CGRectGetMaxY(transactionPercentView.frame)+topMargin,Screen_Width-30, 350);
  2093. [shoppingGuideChartBorderV setBackgroundColor:[UIColor whiteColor]];
  2094. [shoppingGuideChartBorderV drawBoardLine:borderWidth cornerRadius:2 color:[UIColor hexColor:@"D5CDCD"]];
  2095. [shoppingGuideFilingContent addSubview:shoppingGuideChartBorderV];
  2096. _transactionChartView=[[HorizontalBarChartView alloc]init];
  2097. _transactionChartView.frame=CGRectMake(0, 0,shoppingGuideChartBorderV.frame.size.width, 350);
  2098. [shoppingGuideChartBorderV addSubview:_transactionChartView];
  2099. shoppingGuideFilingContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(shoppingGuideChartBorderV.frame)+10);
  2100. shoppingGuideFilingContent.layer.cornerRadius=CornerRadius;
  2101. height=CGRectGetMaxY(shoppingGuideFilingContent.frame);
  2102. // }
  2103. //
  2104. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound){
  2105. //配送情况
  2106. deliveryStatusContent=[UIView new];
  2107. deliveryStatusContent.backgroundColor=[UIColor whiteColor];
  2108. deliveryStatusContent.frame=CGRectMake(10,height+10, Screen_Width-20, 0);
  2109. [content addSubview:deliveryStatusContent];
  2110. UIView *deliveryStatusTitleView = [[UIView alloc]init];
  2111. deliveryStatusTitleView.frame = CGRectMake(0,0 ,Screen_Width, 45);
  2112. UIView *deliveryStatusImgView=[UIImageView new];
  2113. deliveryStatusImgView.frame=CGRectMake(10, 10,10 , 25);
  2114. [deliveryStatusImgView setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]];
  2115. [deliveryStatusTitleView addSubview:deliveryStatusImgView];
  2116. UILabel *titleDeliveryStatus = [[UILabel alloc]init];
  2117. titleDeliveryStatus.frame = CGRectMake(CGRectGetMaxX(deliveryStatusImgView.frame)+10, 10, 100, 25);
  2118. titleDeliveryStatus.text = @"配送情况";
  2119. titleDeliveryStatus.textColor = [UIColor blackColor];
  2120. titleDeliveryStatus.font = [UIFont systemFontOfSize:NoDataFontOfSize];
  2121. [deliveryStatusTitleView addSubview:titleDeliveryStatus];
  2122. [deliveryStatusContent addSubview:deliveryStatusTitleView];
  2123. UIView *separator7=[UIView new];
  2124. separator7.frame=CGRectMake(0,deliveryStatusTitleView.frame.size.height-1, deliveryStatusTitleView.frame.size.width-20, 0.5);
  2125. [separator7 setBackgroundColor:[UIColor lightGrayColor]];
  2126. [deliveryStatusTitleView addSubview:separator7 ];
  2127. UIView *vDeliveryStatusDate =[UIView new];
  2128. vDeliveryStatusDate.frame=CGRectMake(0, CGRectGetMaxY(deliveryStatusTitleView.frame)+topMargin, Screen_Width, 25);
  2129. [deliveryStatusContent addSubview:vDeliveryStatusDate];
  2130. _btnDeliveryStatusStartDate = [UIButton buttonWithType:UIButtonTypeCustom];
  2131. [_btnDeliveryStatusStartDate setTitle:_shoppingGuideStartDate forState:UIControlStateNormal];
  2132. [_btnDeliveryStatusStartDate setBackgroundColor:[UIColor whiteColor]];
  2133. [_btnDeliveryStatusStartDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  2134. _btnDeliveryStatusStartDate.titleLabel.font= [UIFont systemFontOfSize:18];
  2135. [_btnDeliveryStatusStartDate addTarget:self action:@selector(btnSelectDeliveryStatusStartDate) forControlEvents:UIControlEventTouchUpInside];
  2136. _btnDeliveryStatusStartDate.frame = CGRectMake(Screen_Width/2-120 ,0 , 110, 25);
  2137. [vDeliveryStatusDate addSubview:_btnDeliveryStatusStartDate];
  2138. UILabel *separatorDeliveryStatusLbl=[UILabel new];
  2139. separatorDeliveryStatusLbl.frame=CGRectMake(CGRectGetMaxX(_btnDeliveryStatusStartDate.frame), 0, 20, 25);
  2140. separatorDeliveryStatusLbl.text=@"--";
  2141. separatorDeliveryStatusLbl.textColor = [UIColor blackColor];
  2142. separatorDeliveryStatusLbl.font = [UIFont systemFontOfSize: 18];
  2143. [vDeliveryStatusDate addSubview:separatorDeliveryStatusLbl];
  2144. _btnDeliveryStatusEndDate = [UIButton buttonWithType:UIButtonTypeCustom];
  2145. [_btnDeliveryStatusEndDate setTitle:_deliveryStatusEndDate forState:UIControlStateNormal];
  2146. [_btnDeliveryStatusEndDate setBackgroundColor:[UIColor whiteColor]];
  2147. [_btnDeliveryStatusEndDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  2148. _btnDeliveryStatusEndDate.titleLabel.font= [UIFont systemFontOfSize:18];
  2149. [_btnDeliveryStatusEndDate addTarget:self action:@selector(btnSelectDeliveryStatusEndDate) forControlEvents:UIControlEventTouchUpInside];
  2150. _btnDeliveryStatusEndDate.frame = CGRectMake(CGRectGetMaxX(separatorDeliveryStatusLbl.frame) ,0 , 110, 25);
  2151. [vDeliveryStatusDate addSubview:_btnDeliveryStatusEndDate];
  2152. deliveryStatusBorderV=[CustomBorderView new];
  2153. deliveryStatusBorderV.frame=CGRectMake(5, CGRectGetMaxY(vDeliveryStatusDate.frame)+topMargin,Screen_Width-30, 200);
  2154. [deliveryStatusBorderV setBackgroundColor:[UIColor whiteColor]];
  2155. [deliveryStatusBorderV drawBoardLine:borderWidth cornerRadius:2 color:[UIColor hexColor:@"D5CDCD"]];
  2156. [deliveryStatusContent addSubview:deliveryStatusBorderV];
  2157. _deliveryStatusView = [[MyView alloc]initWithFrame:CGRectMake(0,0 ,deliveryStatusBorderV.frame.size.width-10,190)];
  2158. [deliveryStatusBorderV addSubview:_deliveryStatusView];
  2159. UIView *deliveryPercentView = [[UIView alloc]init];
  2160. deliveryPercentView.frame = CGRectMake(5,CGRectGetMaxY(deliveryStatusBorderV.frame)-30, Screen_Width-30, 25);
  2161. lblDeliveryPercent= [[UILabel alloc]init];
  2162. lblDeliveryPercent.frame = CGRectMake(0, 0, deliveryPercentView.frame.size.width, 25);
  2163. lblDeliveryPercent.textColor = [UIColor blackColor];
  2164. lblDeliveryPercent.font = [UIFont systemFontOfSize:22]; lblDeliveryPercent.text=@"完成率0.00%";
  2165. lblDeliveryPercent.textAlignment=NSTextAlignmentCenter;
  2166. [deliveryPercentView addSubview:lblDeliveryPercent];
  2167. [deliveryStatusContent addSubview:deliveryPercentView];
  2168. UIView *needDeliveryCustomerCountView = [[UIView alloc]init];
  2169. needDeliveryCustomerCountView.frame = CGRectMake(0,CGRectGetMaxY(deliveryPercentView.frame)+topMargin,Screen_Width/2, rowHeight);
  2170. lblNeedDeliveryCustomerCount= [[UILabel alloc]init];
  2171. lblNeedDeliveryCustomerCount.frame = CGRectMake(0, 0,needDeliveryCustomerCountView.frame.size.width, 25);
  2172. lblNeedDeliveryCustomerCount.textAlignment=UITextAlignmentCenter;
  2173. lblNeedDeliveryCustomerCount.textColor = [UIColor blackColor];
  2174. lblNeedDeliveryCustomerCount.text=@"0";
  2175. lblNeedDeliveryCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2176. [needDeliveryCustomerCountView addSubview:lblNeedDeliveryCustomerCount];
  2177. UILabel *lblTitleNeedDeliveryCustomerCount = [[UILabel alloc]init];
  2178. lblTitleNeedDeliveryCustomerCount.frame = CGRectMake(0,CGRectGetMaxY(lblNeedDeliveryCustomerCount.frame),needDeliveryCustomerCountView.frame.size.width, 25);
  2179. lblTitleNeedDeliveryCustomerCount.text = @"需配送数";
  2180. lblTitleNeedDeliveryCustomerCount.textColor = [UIColor blackColor];
  2181. lblTitleNeedDeliveryCustomerCount.textAlignment=UITextAlignmentCenter;
  2182. lblTitleNeedDeliveryCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2183. [needDeliveryCustomerCountView addSubview:lblTitleNeedDeliveryCustomerCount];
  2184. [deliveryStatusContent addSubview:needDeliveryCustomerCountView];
  2185. UIView *middleSeparator8=[UIView new];
  2186. middleSeparator8.frame=CGRectMake(Screen_Width/2, CGRectGetMaxY(deliveryPercentView.frame)+topMargin, 0.5, 45);
  2187. middleSeparator8.backgroundColor=[UIColor lightGrayColor];
  2188. [deliveryStatusContent addSubview:middleSeparator8];
  2189. UIView *deliveredCustomerCountView = [[UIView alloc]init];
  2190. deliveredCustomerCountView.frame = CGRectMake(Screen_Width/2,CGRectGetMaxY(deliveryPercentView.frame)+topMargin, Screen_Width/2, rowHeight);
  2191. lblDeliveredCustomerCount = [[UILabel alloc]init];
  2192. lblDeliveredCustomerCount.frame = CGRectMake(0, 0, deliveredCustomerCountView.frame.size.width, 25);
  2193. lblDeliveredCustomerCount.textAlignment=UITextAlignmentCenter;
  2194. lblDeliveredCustomerCount.text=@"0";
  2195. lblDeliveredCustomerCount.textColor = [UIColor blackColor];
  2196. lblDeliveredCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2197. [deliveredCustomerCountView addSubview:lblDeliveredCustomerCount];
  2198. UILabel *lblDeliveredCustomerCountTitle = [[UILabel alloc]init];
  2199. lblDeliveredCustomerCountTitle.frame = CGRectMake(0,CGRectGetMaxY(lblDeliveredCustomerCount.frame), deliveredCustomerCountView.frame.size.width, 25);
  2200. lblDeliveredCustomerCountTitle.text = @"已配送数";
  2201. lblDeliveredCustomerCountTitle.textAlignment=UITextAlignmentCenter;
  2202. lblDeliveredCustomerCountTitle.textColor = [UIColor blackColor];
  2203. lblDeliveredCustomerCountTitle.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2204. [deliveredCustomerCountView addSubview:lblDeliveredCustomerCountTitle];
  2205. [deliveryStatusContent addSubview:deliveredCustomerCountView];
  2206. nextDayNeedDeliveyCountView = [[UIView alloc]init];
  2207. nextDayNeedDeliveyCountView.frame = CGRectMake(0,CGRectGetMaxY(needDeliveryCustomerCountView.frame)+topMargin,Screen_Width/3, rowHeight);
  2208. lblNextDayNeedDeliveryCount= [[UILabel alloc]init];
  2209. lblNextDayNeedDeliveryCount.frame = CGRectMake(0, 0,nextDayNeedDeliveyCountView.frame.size.width, 25);
  2210. lblNextDayNeedDeliveryCount.textAlignment=UITextAlignmentCenter;
  2211. lblNextDayNeedDeliveryCount.textColor = [UIColor blackColor];
  2212. lblNextDayNeedDeliveryCount.text=@"0";
  2213. lblNextDayNeedDeliveryCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2214. [nextDayNeedDeliveyCountView addSubview:lblNextDayNeedDeliveryCount];
  2215. UILabel *lblTitleNextDayNeedDeliveryCount = [[UILabel alloc]init];
  2216. lblTitleNextDayNeedDeliveryCount.frame = CGRectMake(0,CGRectGetMaxY(lblNextDayNeedDeliveryCount.frame),nextDayNeedDeliveyCountView.frame.size.width, 50);
  2217. lblTitleNextDayNeedDeliveryCount.text = @"未来1天需配送数";
  2218. lblTitleNextDayNeedDeliveryCount.textColor = [UIColor blackColor];
  2219. lblTitleNextDayNeedDeliveryCount.textAlignment=UITextAlignmentCenter;
  2220. lblTitleNextDayNeedDeliveryCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2221. [lblTitleNextDayNeedDeliveryCount setLineBreakMode:NSLineBreakByWordWrapping];
  2222. lblTitleNextDayNeedDeliveryCount.numberOfLines = 0;
  2223. [nextDayNeedDeliveyCountView addSubview:lblTitleNextDayNeedDeliveryCount];
  2224. [deliveryStatusContent addSubview:nextDayNeedDeliveyCountView];
  2225. UIView *nextTwoDaysNeedDeliveyCountView = [[UIView alloc]init];
  2226. nextTwoDaysNeedDeliveyCountView.frame = CGRectMake(Screen_Width/3,CGRectGetMaxY(needDeliveryCustomerCountView.frame)+topMargin,Screen_Width/3, rowHeight);
  2227. lblNextTwoDaysNeedDeliveryCount= [[UILabel alloc]init];
  2228. lblNextTwoDaysNeedDeliveryCount.frame = CGRectMake(0, 0,nextTwoDaysNeedDeliveyCountView.frame.size.width, 25);
  2229. lblNextTwoDaysNeedDeliveryCount.textAlignment=UITextAlignmentCenter;
  2230. lblNextTwoDaysNeedDeliveryCount.textColor = [UIColor blackColor];
  2231. lblNextTwoDaysNeedDeliveryCount.text=@"0";
  2232. lblNextTwoDaysNeedDeliveryCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2233. [nextTwoDaysNeedDeliveyCountView addSubview:lblNextTwoDaysNeedDeliveryCount];
  2234. UILabel *lblTitleNextTwoDaysNeedDeliveryCount = [[UILabel alloc]init];
  2235. lblTitleNextTwoDaysNeedDeliveryCount.frame = CGRectMake(0,CGRectGetMaxY(lblNextTwoDaysNeedDeliveryCount.frame),nextTwoDaysNeedDeliveyCountView.frame.size.width,50);
  2236. lblTitleNextTwoDaysNeedDeliveryCount.text = @"未来2天需配送数";
  2237. lblTitleNextTwoDaysNeedDeliveryCount.textColor = [UIColor blackColor];
  2238. lblTitleNextTwoDaysNeedDeliveryCount.textAlignment=UITextAlignmentCenter;
  2239. [lblTitleNextTwoDaysNeedDeliveryCount setLineBreakMode:NSLineBreakByWordWrapping];
  2240. lblTitleNextTwoDaysNeedDeliveryCount.numberOfLines = 0;
  2241. lblTitleNextTwoDaysNeedDeliveryCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2242. [nextTwoDaysNeedDeliveyCountView addSubview:lblTitleNextTwoDaysNeedDeliveryCount];
  2243. [deliveryStatusContent addSubview:nextTwoDaysNeedDeliveyCountView];
  2244. nextThreeDaysNeedDeliveyCountView= [[UIView alloc]init];
  2245. nextThreeDaysNeedDeliveyCountView.frame = CGRectMake(Screen_Width/3*2,CGRectGetMaxY(needDeliveryCustomerCountView.frame)+topMargin,Screen_Width/3, rowHeight);
  2246. [deliveryStatusContent addSubview:nextThreeDaysNeedDeliveyCountView];
  2247. lblNextThreeDaysNeedDeliveryCount= [[UILabel alloc]init];
  2248. lblNextThreeDaysNeedDeliveryCount.frame = CGRectMake(0, 0,nextThreeDaysNeedDeliveyCountView.frame.size.width, 25);
  2249. lblNextThreeDaysNeedDeliveryCount.textAlignment=UITextAlignmentCenter;
  2250. lblNextThreeDaysNeedDeliveryCount.textColor = [UIColor blackColor];
  2251. lblNextThreeDaysNeedDeliveryCount.text=@"0";
  2252. lblNextThreeDaysNeedDeliveryCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2253. [nextThreeDaysNeedDeliveyCountView addSubview:lblNextThreeDaysNeedDeliveryCount];
  2254. UILabel *lblTitleNextThreeDaysNeedDeliveryCount = [[UILabel alloc]init];
  2255. lblTitleNextThreeDaysNeedDeliveryCount.frame = CGRectMake(0,CGRectGetMaxY(lblNextThreeDaysNeedDeliveryCount.frame),nextThreeDaysNeedDeliveyCountView.frame.size.width-10, 50);
  2256. lblTitleNextThreeDaysNeedDeliveryCount.text = @"未来3天需配送数";
  2257. lblTitleNextThreeDaysNeedDeliveryCount.textColor = [UIColor blackColor];
  2258. [lblTitleNextThreeDaysNeedDeliveryCount setLineBreakMode:NSLineBreakByWordWrapping];
  2259. lblTitleNextThreeDaysNeedDeliveryCount.numberOfLines = 0;
  2260. lblTitleNextThreeDaysNeedDeliveryCount.textAlignment=UITextAlignmentCenter;
  2261. lblTitleNextThreeDaysNeedDeliveryCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2262. [nextThreeDaysNeedDeliveyCountView addSubview:lblTitleNextThreeDaysNeedDeliveryCount];
  2263. deliveryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedDeliveyCountView.frame)+30);
  2264. deliveryStatusContent.layer.cornerRadius=CornerRadius;
  2265. height=CGRectGetMaxY(deliveryStatusContent.frame);
  2266. //}
  2267. //
  2268. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound){
  2269. installStatusContent=[UIView new];
  2270. installStatusContent.backgroundColor=[UIColor whiteColor];
  2271. installStatusContent.frame=CGRectMake(10,height+10, Screen_Width-20, 0);
  2272. [content addSubview:installStatusContent];
  2273. UIView *installStatusTitleView = [[UIView alloc]init];
  2274. installStatusTitleView.frame = CGRectMake(0,0 ,Screen_Width, 45);
  2275. UIView *installStatusImgView=[UIImageView new];
  2276. installStatusImgView.frame=CGRectMake(10, 10,10 , 25);
  2277. [installStatusImgView setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]];
  2278. [installStatusTitleView addSubview:installStatusImgView];
  2279. UILabel *titleInstallStatus = [[UILabel alloc]init];
  2280. titleInstallStatus.frame = CGRectMake(CGRectGetMaxX(installStatusImgView.frame)+10, 10, 100, 25);
  2281. titleInstallStatus.text = @"安装情况";
  2282. titleInstallStatus.textColor = [UIColor blackColor];
  2283. titleInstallStatus.font = [UIFont systemFontOfSize:NoDataFontOfSize];
  2284. [installStatusTitleView addSubview:titleInstallStatus];
  2285. [installStatusContent addSubview:installStatusTitleView];
  2286. UIView *separator8=[UIView new];
  2287. separator8.frame=CGRectMake(0,installStatusTitleView.frame.size.height-1, installStatusTitleView.frame.size.width-20, 0.5);
  2288. [separator8 setBackgroundColor:[UIColor lightGrayColor]];
  2289. [installStatusTitleView addSubview:separator8];
  2290. UIView *vInstallStatusDate =[UIView new];
  2291. vInstallStatusDate.frame=CGRectMake(0, CGRectGetMaxY(installStatusTitleView.frame)+topMargin, Screen_Width, 25);
  2292. [installStatusContent addSubview:vInstallStatusDate];
  2293. _btnInstallStatusStartDate = [UIButton buttonWithType:UIButtonTypeCustom];
  2294. [_btnInstallStatusStartDate setTitle:_installStatusStartDate forState:UIControlStateNormal];
  2295. [_btnInstallStatusStartDate setBackgroundColor:[UIColor whiteColor]];
  2296. [_btnInstallStatusStartDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  2297. _btnInstallStatusStartDate.titleLabel.font= [UIFont systemFontOfSize:18];
  2298. [_btnInstallStatusStartDate addTarget:self action:@selector(btnSelectInstallStatusStartDate) forControlEvents:UIControlEventTouchUpInside];
  2299. _btnInstallStatusStartDate.frame = CGRectMake(Screen_Width/2-120 ,0 , 110, 25);
  2300. [vInstallStatusDate addSubview:_btnInstallStatusStartDate];
  2301. UILabel *separatorInstallStatusLbl=[UILabel new];
  2302. separatorInstallStatusLbl.frame=CGRectMake(CGRectGetMaxX(_btnInstallStatusStartDate.frame), 0, 20, 25);
  2303. separatorInstallStatusLbl.text=@"--";
  2304. separatorInstallStatusLbl.textColor = [UIColor blackColor];
  2305. separatorInstallStatusLbl.font = [UIFont systemFontOfSize: 18];
  2306. [vInstallStatusDate addSubview:separatorInstallStatusLbl];
  2307. _btnInstallStatusEndDate = [UIButton buttonWithType:UIButtonTypeCustom];
  2308. [_btnInstallStatusEndDate setTitle:_installStatusEndDate forState:UIControlStateNormal];
  2309. [_btnInstallStatusEndDate setBackgroundColor:[UIColor whiteColor]];
  2310. [_btnInstallStatusEndDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  2311. _btnInstallStatusEndDate.titleLabel.font= [UIFont systemFontOfSize:18];
  2312. [_btnInstallStatusEndDate addTarget:self action:@selector(btnSelectInstallStatusEndDate) forControlEvents:UIControlEventTouchUpInside];
  2313. _btnInstallStatusEndDate.frame = CGRectMake(CGRectGetMaxX(separatorInstallStatusLbl.frame) ,0 , 110, 25);
  2314. [vInstallStatusDate addSubview:_btnInstallStatusEndDate];
  2315. installStatusBorderV=[CustomBorderView new];
  2316. installStatusBorderV.frame=CGRectMake(5, CGRectGetMaxY(vInstallStatusDate.frame)+topMargin,Screen_Width-30, 200);
  2317. [installStatusBorderV setBackgroundColor:[UIColor whiteColor]];
  2318. [installStatusBorderV drawBoardLine:borderWidth cornerRadius:2 color:[UIColor hexColor:@"D5CDCD"]];
  2319. [installStatusContent addSubview:installStatusBorderV];
  2320. _installStatusView = [[MyView alloc]initWithFrame:CGRectMake(5,5, installStatusBorderV.frame.size.width-10,190)];
  2321. [installStatusBorderV addSubview:_installStatusView];
  2322. UIView *installPercentView = [[UIView alloc]init];
  2323. installPercentView.frame = CGRectMake(5,CGRectGetMaxY(installStatusBorderV.frame)-30, Screen_Width-30, 25);
  2324. lblInstallPercent= [[UILabel alloc]init];
  2325. lblInstallPercent.frame = CGRectMake(0, 0, installPercentView.frame.size.width, 25);
  2326. lblInstallPercent.textColor = [UIColor blackColor];
  2327. lblInstallPercent.font = [UIFont systemFontOfSize:22];
  2328. lblInstallPercent.text=@"完成率0%";
  2329. lblInstallPercent.textAlignment=NSTextAlignmentCenter;
  2330. [installPercentView addSubview:lblInstallPercent];
  2331. [installStatusContent addSubview:installPercentView];
  2332. UIView *needInstallCustomerCountView = [[UIView alloc]init];
  2333. needInstallCustomerCountView.frame = CGRectMake(0,CGRectGetMaxY(installPercentView.frame)+topMargin,Screen_Width/2, rowHeight);
  2334. lblNeedInstallCustomerCount= [[UILabel alloc]init];
  2335. lblNeedInstallCustomerCount.frame = CGRectMake(0, 0,needInstallCustomerCountView.frame.size.width, 25);
  2336. lblNeedInstallCustomerCount.textAlignment=UITextAlignmentCenter;
  2337. lblNeedInstallCustomerCount.textColor = [UIColor blackColor];
  2338. lblNeedInstallCustomerCount.text=@"0";
  2339. lblNeedInstallCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2340. [needInstallCustomerCountView addSubview:lblNeedInstallCustomerCount];
  2341. UILabel *lblTitleNeedInstallCustomerCount = [[UILabel alloc]init];
  2342. lblTitleNeedInstallCustomerCount.frame = CGRectMake(0,CGRectGetMaxY(lblNeedInstallCustomerCount.frame),needInstallCustomerCountView.frame.size.width, 25);
  2343. lblTitleNeedInstallCustomerCount.text = @"需安装数";
  2344. lblTitleNeedInstallCustomerCount.textColor = [UIColor blackColor];
  2345. lblTitleNeedInstallCustomerCount.textAlignment=UITextAlignmentCenter;
  2346. lblTitleNeedInstallCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2347. [needInstallCustomerCountView addSubview:lblTitleNeedInstallCustomerCount];
  2348. [installStatusContent addSubview:needInstallCustomerCountView];
  2349. UIView *middleSeparator9=[UIView new];
  2350. middleSeparator9.frame=CGRectMake(Screen_Width/2, CGRectGetMaxY(installPercentView.frame)+topMargin, 0.5, 45);
  2351. middleSeparator9.backgroundColor=[UIColor lightGrayColor];
  2352. [installStatusContent addSubview:middleSeparator9];
  2353. UIView *installedCustomerCountView = [[UIView alloc]init];
  2354. installedCustomerCountView.frame = CGRectMake(Screen_Width/2,CGRectGetMaxY(installPercentView.frame)+topMargin, Screen_Width/2, rowHeight);
  2355. lblInstalledCustomerCount = [[UILabel alloc]init];
  2356. lblInstalledCustomerCount.frame = CGRectMake(0, 0, installedCustomerCountView.frame.size.width, 25);
  2357. lblInstalledCustomerCount.textAlignment=UITextAlignmentCenter;
  2358. lblInstalledCustomerCount.text=@"0";
  2359. lblInstalledCustomerCount.textColor = [UIColor blackColor];
  2360. lblInstalledCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2361. [installedCustomerCountView addSubview:lblInstalledCustomerCount];
  2362. UILabel *lblInstalledCustomerCountTitle = [[UILabel alloc]init];
  2363. lblInstalledCustomerCountTitle.frame = CGRectMake(0,CGRectGetMaxY(lblInstalledCustomerCount.frame), installedCustomerCountView.frame.size.width, 25);
  2364. lblInstalledCustomerCountTitle.text = @"已安装数";
  2365. lblInstalledCustomerCountTitle.textAlignment=UITextAlignmentCenter;
  2366. lblInstalledCustomerCountTitle.textColor = [UIColor blackColor];
  2367. lblInstalledCustomerCountTitle.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2368. [installedCustomerCountView addSubview:lblInstalledCustomerCountTitle];
  2369. [installStatusContent addSubview:installedCustomerCountView];
  2370. nextDayNeedInstallCountView= [[UIView alloc]init];
  2371. nextDayNeedInstallCountView.frame = CGRectMake(0,CGRectGetMaxY(needInstallCustomerCountView.frame)+topMargin,Screen_Width/3, rowHeight);
  2372. lblNextDayNeedInstallCount= [[UILabel alloc]init];
  2373. lblNextDayNeedInstallCount.frame = CGRectMake(0, 0,nextDayNeedInstallCountView.frame.size.width, 25);
  2374. lblNextDayNeedInstallCount.textAlignment=UITextAlignmentCenter;
  2375. lblNextDayNeedInstallCount.textColor = [UIColor blackColor];
  2376. lblNextDayNeedInstallCount.text=@"0";
  2377. lblNextDayNeedInstallCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2378. [nextDayNeedInstallCountView addSubview:lblNextDayNeedInstallCount];
  2379. UILabel *lblTitleNextDayNeedInstallCount = [[UILabel alloc]init];
  2380. lblTitleNextDayNeedInstallCount.frame = CGRectMake(0,CGRectGetMaxY(lblNextDayNeedInstallCount.frame),nextDayNeedInstallCountView.frame.size.width, 50);
  2381. lblTitleNextDayNeedInstallCount.text = @"未来1天需安装数";
  2382. lblTitleNextDayNeedInstallCount.textColor = [UIColor blackColor];
  2383. lblTitleNextDayNeedInstallCount.textAlignment=UITextAlignmentCenter;
  2384. lblTitleNextDayNeedInstallCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2385. [lblTitleNextDayNeedInstallCount setLineBreakMode:NSLineBreakByWordWrapping];
  2386. lblTitleNextDayNeedInstallCount.numberOfLines = 0;
  2387. [nextDayNeedInstallCountView addSubview:lblTitleNextDayNeedInstallCount];
  2388. [installStatusContent addSubview:nextDayNeedInstallCountView];
  2389. UIView *nextTwoDaysNeedInstallCountView = [[UIView alloc]init];
  2390. nextTwoDaysNeedInstallCountView.frame = CGRectMake(Screen_Width/3,CGRectGetMaxY(needInstallCustomerCountView.frame)+topMargin,Screen_Width/3, rowHeight);
  2391. lblNextTwoDaysNeedInstallCount= [[UILabel alloc]init];
  2392. lblNextTwoDaysNeedInstallCount.frame = CGRectMake(0, 0,nextTwoDaysNeedInstallCountView.frame.size.width, 25);
  2393. lblNextTwoDaysNeedInstallCount.textAlignment=UITextAlignmentCenter;
  2394. lblNextTwoDaysNeedInstallCount.textColor = [UIColor blackColor];
  2395. lblNextTwoDaysNeedInstallCount.text=@"0";
  2396. lblNextTwoDaysNeedInstallCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2397. [nextTwoDaysNeedInstallCountView addSubview:lblNextTwoDaysNeedInstallCount];
  2398. UILabel *lblTitleNextTwoDaysNeedInstallCount = [[UILabel alloc]init];
  2399. lblTitleNextTwoDaysNeedInstallCount.frame = CGRectMake(0,CGRectGetMaxY(lblNextTwoDaysNeedInstallCount.frame),nextTwoDaysNeedInstallCountView.frame.size.width,50);
  2400. lblTitleNextTwoDaysNeedInstallCount.text = @"未来2天需安装数";
  2401. lblTitleNextTwoDaysNeedInstallCount.textColor = [UIColor blackColor];
  2402. lblTitleNextTwoDaysNeedInstallCount.textAlignment=UITextAlignmentCenter;
  2403. [lblTitleNextTwoDaysNeedInstallCount setLineBreakMode:NSLineBreakByWordWrapping];
  2404. lblTitleNextTwoDaysNeedInstallCount.numberOfLines = 0;
  2405. lblTitleNextTwoDaysNeedInstallCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2406. [nextTwoDaysNeedInstallCountView addSubview:lblTitleNextTwoDaysNeedInstallCount];
  2407. [installStatusContent addSubview:nextTwoDaysNeedInstallCountView];
  2408. UIView *nextThreeDaysNeedInstallCountView = [[UIView alloc]init];
  2409. nextThreeDaysNeedInstallCountView.frame = CGRectMake(Screen_Width/3*2,CGRectGetMaxY(needInstallCustomerCountView.frame)+topMargin,Screen_Width/3, rowHeight);
  2410. [installStatusContent addSubview:nextThreeDaysNeedInstallCountView];
  2411. lblNextThreeDaysNeedInstallCount= [[UILabel alloc]init];
  2412. lblNextThreeDaysNeedInstallCount.frame = CGRectMake(0, 0,nextThreeDaysNeedInstallCountView.frame.size.width, 25);
  2413. lblNextThreeDaysNeedInstallCount.textAlignment=UITextAlignmentCenter;
  2414. lblNextThreeDaysNeedInstallCount.textColor = [UIColor blackColor];
  2415. lblNextThreeDaysNeedInstallCount.text=@"0";
  2416. lblNextThreeDaysNeedInstallCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2417. [nextThreeDaysNeedInstallCountView addSubview:lblNextThreeDaysNeedInstallCount];
  2418. UILabel *lblTitleNextThreeDaysNeedInstallCount = [[UILabel alloc]init];
  2419. lblTitleNextThreeDaysNeedInstallCount.frame = CGRectMake(0,CGRectGetMaxY(lblNextThreeDaysNeedInstallCount.frame),nextThreeDaysNeedDeliveyCountView.frame.size.width-10, 50);
  2420. lblTitleNextThreeDaysNeedInstallCount.text = @"未来3天需安装数";
  2421. lblTitleNextThreeDaysNeedInstallCount.textColor = [UIColor blackColor];
  2422. [lblTitleNextThreeDaysNeedInstallCount setLineBreakMode:NSLineBreakByWordWrapping];
  2423. lblTitleNextThreeDaysNeedInstallCount.numberOfLines = 0;
  2424. lblTitleNextThreeDaysNeedInstallCount.textAlignment=UITextAlignmentCenter;
  2425. lblTitleNextThreeDaysNeedInstallCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2426. [nextThreeDaysNeedInstallCountView addSubview:lblTitleNextThreeDaysNeedInstallCount];
  2427. installStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedInstallCountView.frame)+30);
  2428. installStatusContent.layer.cornerRadius=CornerRadius;
  2429. height=CGRectGetMaxY(installStatusContent.frame);
  2430. // }
  2431. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_REPAIR_STATUS_IPHONE].location!=NSNotFound){
  2432. //维修情况
  2433. repairStatusContent=[UIView new];
  2434. repairStatusContent.backgroundColor=[UIColor whiteColor];
  2435. repairStatusContent.frame=CGRectMake(10,height+10, Screen_Width-20, 0);
  2436. [content addSubview:repairStatusContent];
  2437. UIView *repairStatusTitleView = [[UIView alloc]init];
  2438. repairStatusTitleView.frame = CGRectMake(0,0 ,Screen_Width, 45);
  2439. UIView *repairStatusImgView=[UIImageView new];
  2440. repairStatusImgView.frame=CGRectMake(10, 10,10 , 25);
  2441. [repairStatusImgView setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]];
  2442. [repairStatusTitleView addSubview:repairStatusImgView];
  2443. UILabel *titleRepairStatus = [[UILabel alloc]init];
  2444. titleRepairStatus.frame = CGRectMake(CGRectGetMaxX(repairStatusImgView.frame)+10, 10, 100, 25);
  2445. titleRepairStatus.text = @"维修情况";
  2446. titleRepairStatus.textColor = [UIColor blackColor];
  2447. titleRepairStatus.font = [UIFont systemFontOfSize:NoDataFontOfSize];
  2448. [repairStatusTitleView addSubview:titleRepairStatus];
  2449. [repairStatusContent addSubview:repairStatusTitleView];
  2450. UIView *separator10=[UIView new];
  2451. separator10.frame=CGRectMake(0,repairStatusTitleView.frame.size.height-1, repairStatusTitleView.frame.size.width-20, 0.5);
  2452. [separator10 setBackgroundColor:[UIColor lightGrayColor]];
  2453. [repairStatusTitleView addSubview:separator10];
  2454. UIView *vRepairStatusDate =[UIView new];
  2455. vRepairStatusDate.frame=CGRectMake(0, CGRectGetMaxY(repairStatusTitleView.frame)+topMargin, Screen_Width, 25);
  2456. [repairStatusContent addSubview:vRepairStatusDate];
  2457. _btnRepairStatusStartDate = [UIButton buttonWithType:UIButtonTypeCustom];
  2458. [_btnRepairStatusStartDate setTitle:_repairStatusStartDate forState:UIControlStateNormal];
  2459. [_btnRepairStatusStartDate setBackgroundColor:[UIColor whiteColor]];
  2460. [_btnRepairStatusStartDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  2461. _btnRepairStatusStartDate.titleLabel.font= [UIFont systemFontOfSize:18];
  2462. [_btnRepairStatusStartDate addTarget:self action:@selector(btnSelectRepairStatusStartDate) forControlEvents:UIControlEventTouchUpInside];
  2463. _btnRepairStatusStartDate.frame = CGRectMake(Screen_Width/2-120 ,0 , 110, 25);
  2464. [vRepairStatusDate addSubview:_btnRepairStatusStartDate];
  2465. UILabel *separatorRepairStatusLbl=[UILabel new];
  2466. separatorRepairStatusLbl.frame=CGRectMake(CGRectGetMaxX(_btnRepairStatusStartDate.frame), 0, 20, 25);
  2467. separatorRepairStatusLbl.text=@"--";
  2468. separatorRepairStatusLbl.textColor = [UIColor blackColor];
  2469. separatorRepairStatusLbl.font = [UIFont systemFontOfSize: 18];
  2470. [vRepairStatusDate addSubview:separatorRepairStatusLbl];
  2471. _btnRepairStatusEndDate = [UIButton buttonWithType:UIButtonTypeCustom];
  2472. [_btnRepairStatusEndDate setTitle:_repairStatusEndDate forState:UIControlStateNormal];
  2473. [_btnRepairStatusEndDate setBackgroundColor:[UIColor whiteColor]];
  2474. [_btnRepairStatusEndDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  2475. _btnRepairStatusEndDate.titleLabel.font= [UIFont systemFontOfSize:18];
  2476. [_btnRepairStatusEndDate addTarget:self action:@selector(btnSelectRepairStatusEndDate) forControlEvents:UIControlEventTouchUpInside];
  2477. _btnRepairStatusEndDate.frame = CGRectMake(CGRectGetMaxX(separatorRepairStatusLbl.frame) ,0 , 110, 25);
  2478. [vRepairStatusDate addSubview:_btnRepairStatusEndDate];
  2479. repairStatusBorderV=[CustomBorderView new];
  2480. repairStatusBorderV.frame=CGRectMake(5, CGRectGetMaxY(vRepairStatusDate.frame)+topMargin,Screen_Width-30, 200);
  2481. [repairStatusBorderV setBackgroundColor:[UIColor whiteColor]];
  2482. [repairStatusBorderV drawBoardLine:borderWidth cornerRadius:2 color:[UIColor hexColor:@"D5CDCD"]];
  2483. [repairStatusContent addSubview:repairStatusBorderV];
  2484. _repairStatusView = [[MyView alloc]initWithFrame:CGRectMake(5,5, repairStatusBorderV.frame.size.width-10,190)];
  2485. [repairStatusBorderV addSubview:_repairStatusView];
  2486. UIView *repairPercentView = [[UIView alloc]init];
  2487. repairPercentView.frame = CGRectMake(5,CGRectGetMaxY(repairStatusBorderV.frame)-30, Screen_Width-30, 25);
  2488. lblRepairPercent= [[UILabel alloc]init];
  2489. lblRepairPercent.frame = CGRectMake(0, 0, repairPercentView.frame.size.width, 25);
  2490. lblRepairPercent.textColor = [UIColor blackColor];
  2491. lblRepairPercent.font = [UIFont systemFontOfSize:22];
  2492. lblRepairPercent.text=@"完成率0%";
  2493. lblRepairPercent.textAlignment=NSTextAlignmentCenter;
  2494. [repairPercentView addSubview:lblRepairPercent];
  2495. [repairStatusContent addSubview:repairPercentView];
  2496. UIView *needRepairCustomerCountView = [[UIView alloc]init];
  2497. needRepairCustomerCountView.frame = CGRectMake(0,CGRectGetMaxY(repairPercentView.frame)+topMargin,Screen_Width/2, rowHeight);
  2498. lblNeedRepairCustomerCount= [[UILabel alloc]init];
  2499. lblNeedRepairCustomerCount.frame = CGRectMake(0, 0,needRepairCustomerCountView.frame.size.width, 25);
  2500. lblNeedRepairCustomerCount.textAlignment=UITextAlignmentCenter;
  2501. lblNeedRepairCustomerCount.textColor = [UIColor blackColor];
  2502. lblNeedRepairCustomerCount.text=@"0";
  2503. lblNeedRepairCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2504. [needRepairCustomerCountView addSubview:lblNeedRepairCustomerCount];
  2505. UILabel *lblTitleNeedRepairCustomerCount = [[UILabel alloc]init];
  2506. lblTitleNeedRepairCustomerCount.frame = CGRectMake(0,CGRectGetMaxY(lblNeedRepairCustomerCount.frame),needRepairCustomerCountView.frame.size.width, 25);
  2507. lblTitleNeedRepairCustomerCount.text = @"需维修数";
  2508. lblTitleNeedRepairCustomerCount.textColor = [UIColor blackColor];
  2509. lblTitleNeedRepairCustomerCount.textAlignment=UITextAlignmentCenter;
  2510. lblTitleNeedRepairCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2511. [needRepairCustomerCountView addSubview:lblTitleNeedRepairCustomerCount];
  2512. [repairStatusContent addSubview:needRepairCustomerCountView];
  2513. UIView *middleSeparator10=[UIView new];
  2514. middleSeparator10.frame=CGRectMake(Screen_Width/2, CGRectGetMaxY(repairPercentView.frame)+topMargin, 0.5, 45);
  2515. middleSeparator10.backgroundColor=[UIColor lightGrayColor];
  2516. [repairStatusContent addSubview:middleSeparator10];
  2517. UIView *repairedCustomerCountView = [[UIView alloc]init];
  2518. repairedCustomerCountView.frame = CGRectMake(Screen_Width/2,CGRectGetMaxY(repairPercentView.frame)+topMargin, Screen_Width/2, rowHeight);
  2519. lblRepairedCustomerCount = [[UILabel alloc]init];
  2520. lblRepairedCustomerCount.frame = CGRectMake(0, 0, repairedCustomerCountView.frame.size.width, 25);
  2521. lblRepairedCustomerCount.textAlignment=UITextAlignmentCenter;
  2522. lblRepairedCustomerCount.text=@"0";
  2523. lblRepairedCustomerCount.textColor = [UIColor blackColor];
  2524. lblRepairedCustomerCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2525. [repairedCustomerCountView addSubview:lblRepairedCustomerCount];
  2526. UILabel *lblRepairedCustomerCountTitle = [[UILabel alloc]init];
  2527. lblRepairedCustomerCountTitle.frame = CGRectMake(0,CGRectGetMaxY(lblRepairedCustomerCount.frame), repairedCustomerCountView.frame.size.width, 25);
  2528. lblRepairedCustomerCountTitle.text = @"已维修数";
  2529. lblRepairedCustomerCountTitle.textAlignment=UITextAlignmentCenter;
  2530. lblRepairedCustomerCountTitle.textColor = [UIColor blackColor];
  2531. lblRepairedCustomerCountTitle.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2532. [repairedCustomerCountView addSubview:lblRepairedCustomerCountTitle];
  2533. [repairStatusContent addSubview:repairedCustomerCountView];
  2534. nextDayNeedRepairCountView= [[UIView alloc]init];
  2535. nextDayNeedRepairCountView.frame = CGRectMake(0,CGRectGetMaxY(needRepairCustomerCountView.frame)+topMargin,Screen_Width/3, rowHeight);
  2536. lblNextDayNeedRepairCount= [[UILabel alloc]init];
  2537. lblNextDayNeedRepairCount.frame = CGRectMake(0, 0,nextDayNeedRepairCountView.frame.size.width, 25);
  2538. lblNextDayNeedRepairCount.textAlignment=UITextAlignmentCenter;
  2539. lblNextDayNeedRepairCount.textColor = [UIColor blackColor];
  2540. lblNextDayNeedRepairCount.text=@"0";
  2541. lblNextDayNeedRepairCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2542. [nextDayNeedRepairCountView addSubview:lblNextDayNeedRepairCount];
  2543. UILabel *lblTitleNextDayNeedRepairCount = [[UILabel alloc]init];
  2544. lblTitleNextDayNeedRepairCount.frame = CGRectMake(0,CGRectGetMaxY(lblNextDayNeedRepairCount.frame),nextDayNeedInstallCountView.frame.size.width, 50);
  2545. lblTitleNextDayNeedRepairCount.text = @"未来1天需维修数";
  2546. lblTitleNextDayNeedRepairCount.textColor = [UIColor blackColor];
  2547. lblTitleNextDayNeedRepairCount.textAlignment=UITextAlignmentCenter;
  2548. lblTitleNextDayNeedRepairCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2549. [lblTitleNextDayNeedRepairCount setLineBreakMode:NSLineBreakByWordWrapping];
  2550. lblTitleNextDayNeedRepairCount.numberOfLines = 0;
  2551. [nextDayNeedRepairCountView addSubview:lblTitleNextDayNeedRepairCount];
  2552. [repairStatusContent addSubview:nextDayNeedRepairCountView];
  2553. UIView *nextTwoDaysNeedRepairCountView = [[UIView alloc]init];
  2554. nextTwoDaysNeedRepairCountView.frame = CGRectMake(Screen_Width/3,CGRectGetMaxY(needRepairCustomerCountView.frame)+topMargin,Screen_Width/3, rowHeight);
  2555. lblNextTwoDaysNeedRepairCount= [[UILabel alloc]init];
  2556. lblNextTwoDaysNeedRepairCount.frame = CGRectMake(0, 0,nextTwoDaysNeedRepairCountView.frame.size.width, 25);
  2557. lblNextTwoDaysNeedRepairCount.textAlignment=UITextAlignmentCenter;
  2558. lblNextTwoDaysNeedRepairCount.textColor = [UIColor blackColor];
  2559. lblNextTwoDaysNeedRepairCount.text=@"0";
  2560. lblNextTwoDaysNeedRepairCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2561. [nextTwoDaysNeedRepairCountView addSubview:lblNextTwoDaysNeedRepairCount];
  2562. UILabel *lblTitleNextTwoDaysNeedRepairCount = [[UILabel alloc]init];
  2563. lblTitleNextTwoDaysNeedRepairCount.frame = CGRectMake(0,CGRectGetMaxY(lblNextTwoDaysNeedRepairCount.frame),nextTwoDaysNeedRepairCountView.frame.size.width,50);
  2564. lblTitleNextTwoDaysNeedRepairCount.text = @"未来2天需维修数";
  2565. lblTitleNextTwoDaysNeedRepairCount.textColor = [UIColor blackColor];
  2566. lblTitleNextTwoDaysNeedRepairCount.textAlignment=UITextAlignmentCenter;
  2567. [lblTitleNextTwoDaysNeedRepairCount setLineBreakMode:NSLineBreakByWordWrapping];
  2568. lblTitleNextTwoDaysNeedRepairCount.numberOfLines = 0;
  2569. lblTitleNextTwoDaysNeedRepairCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2570. [nextTwoDaysNeedRepairCountView addSubview:lblTitleNextTwoDaysNeedRepairCount];
  2571. [repairStatusContent addSubview:nextTwoDaysNeedRepairCountView];
  2572. UIView *nextThreeDaysNeedRepairCountView = [[UIView alloc]init];
  2573. nextThreeDaysNeedRepairCountView.frame = CGRectMake(Screen_Width/3*2,CGRectGetMaxY(needRepairCustomerCountView.frame)+topMargin,Screen_Width/3, rowHeight);
  2574. [repairStatusContent addSubview:nextThreeDaysNeedRepairCountView];
  2575. lblNextThreeDaysNeedRepairCount= [[UILabel alloc]init];
  2576. lblNextThreeDaysNeedRepairCount.frame = CGRectMake(0, 0,nextThreeDaysNeedRepairCountView.frame.size.width, 25);
  2577. lblNextThreeDaysNeedRepairCount.textAlignment=UITextAlignmentCenter;
  2578. lblNextThreeDaysNeedRepairCount.textColor = [UIColor blackColor];
  2579. lblNextThreeDaysNeedRepairCount.text=@"0";
  2580. lblNextThreeDaysNeedRepairCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2581. [nextThreeDaysNeedRepairCountView addSubview:lblNextThreeDaysNeedRepairCount];
  2582. UILabel *lblTitleNextThreeDaysNeedRepairCount = [[UILabel alloc]init];
  2583. lblTitleNextThreeDaysNeedRepairCount.frame = CGRectMake(0,CGRectGetMaxY(lblNextThreeDaysNeedRepairCount.frame),nextThreeDaysNeedRepairCountView.frame.size.width-10, 50);
  2584. lblTitleNextThreeDaysNeedRepairCount.text = @"未来3天需维修数";
  2585. lblTitleNextThreeDaysNeedRepairCount.textColor = [UIColor blackColor];
  2586. [lblTitleNextThreeDaysNeedRepairCount setLineBreakMode:NSLineBreakByWordWrapping];
  2587. lblTitleNextThreeDaysNeedRepairCount.numberOfLines = 0;
  2588. lblTitleNextThreeDaysNeedRepairCount.textAlignment=UITextAlignmentCenter;
  2589. lblTitleNextThreeDaysNeedRepairCount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
  2590. [nextThreeDaysNeedRepairCountView addSubview:lblTitleNextThreeDaysNeedRepairCount];
  2591. repairStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(nextDayNeedRepairCountView.frame)+30);
  2592. repairStatusContent.layer.cornerRadius=CornerRadius;
  2593. height=CGRectGetMaxY(repairStatusContent.frame);
  2594. // }
  2595. content.frame=CGRectMake(0, 0,Screen_Width,height);
  2596. scroll.contentSize = CGSizeMake(self.view.frame.size.width, height+rectStatusHeight+rectNavHeight+100);
  2597. }
  2598. -(void)goSalesAchievement:(UIButton*)sender
  2599. {
  2600. [self changeSalesAchievementDepartmentStaffColor];
  2601. if(sender.tag==1007)
  2602. {
  2603. salesAchievementTypeId=@"0";
  2604. btnSalesAchievementDepartmentMaskLayer.strokeColor=[UIColor redColor].CGColor;
  2605. [_btnSalesAchievementDepartment setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  2606. }
  2607. else{
  2608. salesAchievementTypeId=@"1";
  2609. btnSalesAchievementStaffMaskLayer.strokeColor=[UIColor redColor].CGColor;
  2610. [_btnSalesAchievementStaff setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  2611. }
  2612. [salesAchievementXArray removeAllObjects];
  2613. [salesAchievementYArray removeAllObjects];
  2614. [self startLoading];
  2615. [self loadSalesAchievementData];
  2616. }
  2617. -(void)goSalesStatus:(UIButton*)sender
  2618. {
  2619. [self changeSalesStatusChannelDepartmentColor];
  2620. if(sender.tag==1000)
  2621. {
  2622. typeId=@"0";
  2623. btnSalesStatusChannelMaskLayer.strokeColor=[UIColor redColor].CGColor;
  2624. [_btnSalesStatusChannel setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  2625. }
  2626. else{
  2627. typeId=@"1";
  2628. btnSalesStatusDepartmentMaskLayer.strokeColor=[UIColor redColor].CGColor;
  2629. [_btnSalesStatusDepartment setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  2630. }
  2631. [salesStatusXArray removeAllObjects];
  2632. [salesStatusYArray removeAllObjects];
  2633. [self startLoading];
  2634. [self loadSalesStatusData];
  2635. }
  2636. -(void)goOrderStatus:(UIButton*)sender
  2637. {
  2638. [self changeOrderStatusChannelDepartmentColor];
  2639. if(sender.tag==1006)
  2640. {
  2641. orderStatusTypeId=@"0";
  2642. btnOrderStatusChannelMaskLayer.strokeColor=[UIColor redColor].CGColor;
  2643. [_btnOrderStatusChannel setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  2644. }
  2645. else{
  2646. orderStatusTypeId=@"1";
  2647. btnOrderStatusDepartmentMaskLayer.strokeColor=[UIColor redColor].CGColor;
  2648. [_btnOrderStatusDepartment setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  2649. }
  2650. [orderStatusXArray removeAllObjects];
  2651. [orderStatusYArray removeAllObjects];
  2652. [self startLoading];
  2653. [self loadOrderStatusData];
  2654. }
  2655. -(void)goCollectionStatus:(UIButton*)sender
  2656. {
  2657. [self changeCollectionStatusChannelDepartmentColor];
  2658. if(sender.tag==1003)
  2659. {
  2660. cashStatusTypeId=@"1";
  2661. btnCollectionStatusDepartmentMaskLayer.strokeColor=[UIColor redColor].CGColor;
  2662. [_btnCollectionStatusDepartment setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  2663. }
  2664. if(sender.tag==1004)
  2665. {
  2666. cashStatusTypeId=@"0";
  2667. btnCollectionStatusChannelMaskLayer.strokeColor=[UIColor redColor].CGColor;
  2668. [_btnCollectionStatusChannel setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  2669. }
  2670. [collectionStatusXArray removeAllObjects];
  2671. [collectionStatusYArray removeAllObjects];
  2672. [self startLoading];
  2673. [self loadCashData];
  2674. }
  2675. /**
  2676. 画两个柱状图
  2677. */
  2678. -(void)drawTwoBarchart:(NSMutableArray*)barchartArray receivablesTitleArray:(NSMutableArray*)receivablesTitleArry barChartView:(BarChartView*) chartView
  2679. axisValueFormatter:(id<ChartAxisValueFormatter>)formatter xAxisLabelCount:(NSInteger)count maximumValue:(double)maximumValue
  2680. minimumValue:(double)minimumValue
  2681. {
  2682. chartView.delegate = self;
  2683. chartView.extraBottomOffset=20;
  2684. chartView.chartDescription.enabled = NO;
  2685. chartView.pinchZoomEnabled = NO;
  2686. chartView.drawBarShadowEnabled = NO;
  2687. chartView.drawGridBackgroundEnabled = NO;
  2688. chartView.maxVisibleCount = 60;
  2689. BalloonMarker *marker = [[BalloonMarker alloc]
  2690. initWithColor: [UIColor colorWithWhite:210/255. alpha:1.0]
  2691. font: [UIFont systemFontOfSize:12.0]
  2692. textColor: UIColor.whiteColor
  2693. insets: UIEdgeInsetsMake(8.0, 8.0, 20.0, 8.0)];
  2694. marker.chartView = chartView;
  2695. marker.minimumSize = CGSizeMake(80.f, 40.f);
  2696. chartView.marker = marker;
  2697. ChartLegend *legend = chartView.legend;
  2698. legend.horizontalAlignment = ChartLegendHorizontalAlignmentCenter;
  2699. legend.verticalAlignment = ChartLegendVerticalAlignmentBottom;
  2700. legend.orientation = ChartLegendOrientationHorizontal ;
  2701. legend.drawInside = NO;
  2702. legend.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:12.0f];
  2703. legend.yOffset = 1.0;
  2704. legend.xOffset = 1.0;
  2705. legend.yEntrySpace =1;
  2706. ChartXAxis *xAxis = chartView.xAxis;
  2707. xAxis.labelFont = [UIFont fontWithName:@"HelveticaNeue-Light" size:10.f];
  2708. xAxis.axisMinimum = 0.0;
  2709. xAxis.granularity = 1.0f;
  2710. xAxis.labelCount=count;
  2711. xAxis.labelRotationAngle=20;
  2712. xAxis.drawGridLinesEnabled=NO;
  2713. xAxis.centerAxisLabelsEnabled = YES;
  2714. xAxis.labelPosition = XAxisLabelPositionBottom;
  2715. xAxis.valueFormatter =formatter ;
  2716. ChartYAxis *leftAxis = chartView.leftAxis;
  2717. leftAxis.labelFont = [UIFont fontWithName:@"HelveticaNeue-Light" size:10.f];
  2718. leftAxis.valueFormatter = [[YAxisValueFormatter alloc] init];
  2719. leftAxis.drawGridLinesEnabled = YES;
  2720. leftAxis.gridColor = [UIColor colorWithRed:200/255.0f green:200/255.0f blue:200/255.0f alpha:1];//网格线颜色
  2721. leftAxis.spaceTop = 0.35;
  2722. leftAxis.granularityEnabled=YES;
  2723. leftAxis.gridLineWidth =1;
  2724. if(minimumValue<0)
  2725. {
  2726. leftAxis.axisMinimum = minimumValue;
  2727. }
  2728. else
  2729. {
  2730. leftAxis.axisMinimum=0;
  2731. }
  2732. leftAxis.axisMaximum=maximumValue+100;
  2733. leftAxis.decimals=2;
  2734. // leftAxis.granularity=maximumValue/5;
  2735. chartView.rightAxis.enabled = NO;
  2736. float groupSpace = 0.1f;
  2737. float barSpace = 0.15f;
  2738. float barWidth = 0.3f;
  2739. NSMutableArray *yVals1 = [[NSMutableArray alloc] init];
  2740. NSMutableArray *yVals2 = [[NSMutableArray alloc] init];
  2741. int start =0;
  2742. long end = barchartArray.count;
  2743. for (int i = start; i < end; i++)
  2744. {
  2745. NSMutableDictionary *barchartDic=barchartArray[i];
  2746. double y1=0;
  2747. double y2=0;
  2748. if([[barchartDic allKeys] containsObject:@"planAmount"])
  2749. {
  2750. y1= [[barchartDic objectForKey:@"planAmount"]doubleValue];
  2751. }
  2752. if([[barchartDic allKeys] containsObject:@"saleAmount"])
  2753. {
  2754. y2=[[barchartDic objectForKey:@"saleAmount"]doubleValue];
  2755. }
  2756. [yVals1 addObject:[[BarChartDataEntry alloc]
  2757. initWithX:i
  2758. y:y1]];
  2759. [yVals2 addObject:[[BarChartDataEntry alloc]
  2760. initWithX:i
  2761. y:y2]];
  2762. }
  2763. BarChartDataSet *set1 = nil, *set2 = nil;
  2764. if (chartView.data.dataSetCount > 0)
  2765. {
  2766. set1 = (BarChartDataSet *)chartView.data.dataSets[0];
  2767. set2 = (BarChartDataSet *)chartView.data.dataSets[1];
  2768. [set1 replaceEntries:yVals1];
  2769. [set2 replaceEntries:yVals2];
  2770. BarChartData *data = chartView.barData;
  2771. chartView.xAxis.axisMinimum = start;
  2772. chartView.xAxis.axisMaximum = [data groupWidthWithGroupSpace:groupSpace barSpace: barSpace] * end + start;
  2773. [data groupBarsFromX: start groupSpace: groupSpace barSpace: barSpace];
  2774. [chartView.data notifyDataChanged];
  2775. [chartView notifyDataSetChanged];
  2776. }
  2777. else
  2778. {
  2779. set1 = [[BarChartDataSet alloc] initWithEntries:yVals1 label:receivablesTitleArry[0]];
  2780. [set1 setColor:[UIColor colorWithRed:70/255.0f green:116/255.0f blue:193/255.0f alpha:1]];
  2781. set2 = [[BarChartDataSet alloc] initWithEntries:yVals2 label:receivablesTitleArry[1]];
  2782. [set2 setColor:[UIColor colorWithRed:235/255.0f green:125/255.0f blue:60/255.0f alpha:1]];
  2783. [set1 setDrawValuesEnabled:NO];
  2784. [set2 setDrawValuesEnabled:NO];
  2785. NSMutableArray *dataSets = [[NSMutableArray alloc] init];
  2786. [dataSets addObject:set1];
  2787. [dataSets addObject:set2];
  2788. BarChartData *data = [[BarChartData alloc] initWithDataSets:dataSets];
  2789. [data setValueFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:10.f]];
  2790. data.barWidth = barWidth;
  2791. // restrict the x-axis range
  2792. chartView.xAxis.axisMinimum = start;
  2793. // groupWidthWithGroupSpace(...) is a helper that calculates the width each group needs based on the provided parameters
  2794. chartView.xAxis.axisMaximum = start+ [data groupWidthWithGroupSpace:groupSpace barSpace: barSpace] * end;
  2795. [data groupBarsFromX: start groupSpace: groupSpace barSpace: barSpace];
  2796. chartView.data = data;
  2797. }
  2798. }
  2799. -(void)drawHorizontalTwoBarchart:(NSMutableArray*)barchartArray receivablesTitleArray:(NSMutableArray*)receivablesTitleArry barChartView:(HorizontalBarChartView*) chartView
  2800. axisValueFormatter:(id<ChartAxisValueFormatter>)formatter xAxisLabelCount:(NSInteger)count maximumValue:(double)maximumValue
  2801. minimumValue:(double)minimumValue
  2802. {
  2803. chartView.delegate = self;
  2804. chartView.extraBottomOffset=20;
  2805. chartView.chartDescription.enabled = NO;
  2806. chartView.pinchZoomEnabled = NO;
  2807. chartView.drawBarShadowEnabled = NO;
  2808. chartView.drawGridBackgroundEnabled = NO;
  2809. chartView.maxVisibleCount = 60;
  2810. BalloonMarker *marker = [[BalloonMarker alloc]
  2811. initWithColor: [UIColor colorWithWhite:210/255. alpha:1.0]
  2812. font: [UIFont systemFontOfSize:12.0]
  2813. textColor: UIColor.whiteColor
  2814. insets: UIEdgeInsetsMake(8.0, 8.0, 20.0, 8.0)];
  2815. marker.chartView = chartView;
  2816. marker.minimumSize = CGSizeMake(80.f, 40.f);
  2817. chartView.marker = marker;
  2818. ChartLegend *legend = chartView.legend;
  2819. legend.horizontalAlignment = ChartLegendHorizontalAlignmentCenter;
  2820. legend.verticalAlignment = ChartLegendVerticalAlignmentBottom;
  2821. legend.orientation = ChartLegendOrientationHorizontal ;
  2822. legend.drawInside = NO;
  2823. legend.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:12.0f];
  2824. legend.yOffset = 1.0;
  2825. legend.xOffset = 1.0;
  2826. legend.yEntrySpace =1;
  2827. ChartXAxis *xAxis = chartView.xAxis;
  2828. xAxis.labelFont = [UIFont fontWithName:@"HelveticaNeue-Light" size:10.f];
  2829. xAxis.axisMinimum = 0.0;
  2830. xAxis.granularity = 1.0f;
  2831. xAxis.labelCount=count;
  2832. xAxis.labelRotationAngle=20;
  2833. xAxis.drawGridLinesEnabled=NO;
  2834. xAxis.centerAxisLabelsEnabled = YES;
  2835. xAxis.labelPosition = XAxisLabelPositionBottom;
  2836. xAxis.valueFormatter =formatter ;
  2837. ChartYAxis *leftAxis = chartView.leftAxis;
  2838. leftAxis.labelFont = [UIFont fontWithName:@"HelveticaNeue-Light" size:10.f];
  2839. leftAxis.valueFormatter = [[YAxisValueFormatter alloc] init];
  2840. leftAxis.drawGridLinesEnabled = YES;
  2841. leftAxis.gridColor = [UIColor colorWithRed:200/255.0f green:200/255.0f blue:200/255.0f alpha:1];//网格线颜色
  2842. leftAxis.spaceTop = 0.35;
  2843. leftAxis.granularityEnabled=YES;
  2844. leftAxis.gridLineWidth =1;
  2845. if(minimumValue<0)
  2846. {
  2847. leftAxis.axisMinimum = minimumValue;
  2848. }
  2849. else
  2850. {
  2851. leftAxis.axisMinimum=0;
  2852. }
  2853. leftAxis.axisMaximum=maximumValue+100;
  2854. leftAxis.decimals=2;
  2855. // leftAxis.granularity=maximumValue/5;
  2856. chartView.rightAxis.enabled = NO;
  2857. float groupSpace = 0.1f;
  2858. float barSpace = 0.15f;
  2859. float barWidth = 0.3f;
  2860. NSMutableArray *yVals1 = [[NSMutableArray alloc] init];
  2861. NSMutableArray *yVals2 = [[NSMutableArray alloc] init];
  2862. int start =0;
  2863. long end = barchartArray.count;
  2864. for (int i = start; i < end; i++)
  2865. {
  2866. NSMutableDictionary *barchartDic=barchartArray[i];
  2867. double y1=0;
  2868. double y2=0;
  2869. if([[barchartDic allKeys] containsObject:@"transactionCount"])
  2870. {
  2871. y1= [[barchartDic objectForKey:@"transactionCount"]doubleValue];
  2872. }
  2873. if([[barchartDic allKeys] containsObject:@"filingCount"])
  2874. {
  2875. y2=[[barchartDic objectForKey:@"filingCount"]doubleValue];
  2876. }
  2877. [yVals1 addObject:[[BarChartDataEntry alloc]
  2878. initWithX:i
  2879. y:y1]];
  2880. [yVals2 addObject:[[BarChartDataEntry alloc]
  2881. initWithX:i
  2882. y:y2]];
  2883. }
  2884. BarChartDataSet *set1 = nil, *set2 = nil;
  2885. if (chartView.data.dataSetCount > 0)
  2886. {
  2887. set1 = (BarChartDataSet *)chartView.data.dataSets[0];
  2888. set2 = (BarChartDataSet *)chartView.data.dataSets[1];
  2889. [set1 replaceEntries:yVals1];
  2890. [set2 replaceEntries:yVals2];
  2891. BarChartData *data = chartView.barData;
  2892. chartView.xAxis.axisMinimum = start;
  2893. chartView.xAxis.axisMaximum = [data groupWidthWithGroupSpace:groupSpace barSpace: barSpace] * end + start;
  2894. [data groupBarsFromX: start groupSpace: groupSpace barSpace: barSpace];
  2895. [chartView.data notifyDataChanged];
  2896. [chartView notifyDataSetChanged];
  2897. }
  2898. else
  2899. {
  2900. set1 = [[BarChartDataSet alloc] initWithEntries:yVals1 label:receivablesTitleArry[0]];
  2901. [set1 setColor:[UIColor colorWithRed:70/255.0f green:116/255.0f blue:193/255.0f alpha:1]];
  2902. set2 = [[BarChartDataSet alloc] initWithEntries:yVals2 label:receivablesTitleArry[1]];
  2903. [set2 setColor:[UIColor colorWithRed:235/255.0f green:125/255.0f blue:60/255.0f alpha:1]];
  2904. [set1 setDrawValuesEnabled:NO];
  2905. [set2 setDrawValuesEnabled:NO];
  2906. NSMutableArray *dataSets = [[NSMutableArray alloc] init];
  2907. [dataSets addObject:set1];
  2908. [dataSets addObject:set2];
  2909. BarChartData *data = [[BarChartData alloc] initWithDataSets:dataSets];
  2910. [data setValueFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:10.f]];
  2911. data.barWidth = barWidth;
  2912. // restrict the x-axis range
  2913. chartView.xAxis.axisMinimum = start;
  2914. // groupWidthWithGroupSpace(...) is a helper that calculates the width each group needs based on the provided parameters
  2915. chartView.xAxis.axisMaximum = start+ [data groupWidthWithGroupSpace:groupSpace barSpace: barSpace] * end;
  2916. [data groupBarsFromX: start groupSpace: groupSpace barSpace: barSpace];
  2917. chartView.data = data;
  2918. }
  2919. }
  2920. /**
  2921. 切换渠道部门按钮颜色
  2922. */
  2923. -(void)changeSalesStatusChannelDepartmentColor
  2924. {
  2925. btnSalesStatusChannelMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  2926. [_btnSalesStatusChannel setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  2927. btnSalesStatusDepartmentMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  2928. [_btnSalesStatusDepartment setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  2929. }
  2930. -(void)changeSalesAchievementDepartmentStaffColor
  2931. {
  2932. btnSalesAchievementDepartmentMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  2933. [_btnSalesAchievementDepartment setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  2934. btnSalesAchievementStaffMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  2935. [_btnSalesAchievementStaff setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  2936. }
  2937. -(void)changeOrderStatusChannelDepartmentColor
  2938. {
  2939. btnOrderStatusChannelMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  2940. [_btnOrderStatusChannel setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  2941. btnOrderStatusDepartmentMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  2942. [_btnOrderStatusDepartment setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  2943. }
  2944. -(void)selectSalesAchievementCustomDate
  2945. {
  2946. [self changeSalesAchievementMonthColor];
  2947. [_btnSalesAchievementCustom setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  2948. btnSalesAchievementCustomMaskLayer.strokeColor=[UIColor redColor].CGColor;
  2949. ITDatePickerController *datePickerController = [[ITDatePickerController alloc] init];
  2950. datePickerController.tag = 100;
  2951. datePickerController.delegate = self;
  2952. datePickerController.showToday = NO;
  2953. datePickerController.defaultDate = nil;
  2954. [self presentViewController:datePickerController animated:YES completion:nil];
  2955. }
  2956. -(void)getSalesAchievementCurrentMonth
  2957. {
  2958. [self changeSalesAchievementMonthColor];
  2959. btnSalesAchievementCurrentMonthMaskLayer.strokeColor=[UIColor redColor].CGColor;
  2960. [_btnSalesAchievemmentToday setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
  2961. //NSDate转NSString
  2962. _salesAchievementMonth = [DateFormat getCurrentNoSeparateMonth];
  2963. [_btnSalesAchievemmentToday setTitle: [DateFormat getCurrentMonth] forState:UIControlStateNormal];
  2964. [self clearSalesAchievementData];
  2965. [self startLoading];
  2966. [self loadSalesAchievementData];
  2967. }
  2968. -(void)changeSalesAchievementMonthColor
  2969. {
  2970. btnSalesAchievementCustomMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  2971. [_btnSalesAchievementCustom setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  2972. btnSalesAchievementCurrentMonthMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  2973. [_btnSalesAchievemmentToday setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  2974. }
  2975. /**
  2976. 切换收款状态渠道部门按钮颜色
  2977. */
  2978. -(void)changeCollectionStatusChannelDepartmentColor
  2979. {
  2980. btnCollectionStatusChannelMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  2981. [_btnCollectionStatusChannel setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  2982. btnCollectionStatusDepartmentMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
  2983. [_btnCollectionStatusDepartment setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  2984. }
  2985. -(void)btnSelectShoppingGuideStartDate
  2986. {
  2987. __weak typeof(self) weakself=self;
  2988. _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""];
  2989. [_dealDatePicker configureSelectionBlock:^(NSString *date){
  2990. _tempShoppingGuideStartDate=date;
  2991. } andCompletionBlock:^(void){
  2992. _shoppingGuideStartDate = _tempShoppingGuideStartDate;
  2993. [weakself.btnShoppingGuideStartDate setTitle:_shoppingGuideStartDate forState:UIControlStateNormal];
  2994. [self clearShoppingGuideFilingData];
  2995. [self startLoading];
  2996. [self loadShoppingGuideData];
  2997. } andCancelBlock:^(void){
  2998. }];
  2999. [_dealDatePicker show];
  3000. }
  3001. -(void)btnSelectShoppingGuideEndDate
  3002. {
  3003. _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""];
  3004. [_dealDatePicker configureSelectionBlock:^(NSString *date){
  3005. _tempShoppingGuideEndDate=date;
  3006. } andCompletionBlock:^(void){
  3007. _shoppingGuideEndDate = _tempShoppingGuideEndDate;
  3008. [_btnShoppingGuideEndDate setTitle:_shoppingGuideEndDate forState:UIControlStateNormal];
  3009. [self clearShoppingGuideFilingData];
  3010. [self startLoading];
  3011. [self loadShoppingGuideData];
  3012. } andCancelBlock:^(void){
  3013. }];
  3014. [_dealDatePicker show];
  3015. }
  3016. -(void)btnSelectCollectionStatusStartDate
  3017. {
  3018. __weak typeof(self) weakself=self;
  3019. _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""];
  3020. [_dealDatePicker configureSelectionBlock:^(NSString *date){
  3021. _tempCollectionStatusStartDate=date;
  3022. } andCompletionBlock:^(void){
  3023. _collectionStatusStartDate = _tempCollectionStatusStartDate;
  3024. [weakself.btnCollectionStatusStartDate setTitle:_collectionStatusStartDate forState:UIControlStateNormal];
  3025. [self startLoading];
  3026. [collectionStatusXArray removeAllObjects];
  3027. [collectionStatusYArray removeAllObjects];
  3028. [self clearCollectionStatusData];
  3029. [self loadCashData];
  3030. } andCancelBlock:^(void){
  3031. }];
  3032. [_dealDatePicker show];
  3033. }
  3034. -(void)btnSelectDeliveryStatusStartDate
  3035. {
  3036. __weak typeof(self) weakself=self;
  3037. _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""];
  3038. [_dealDatePicker configureSelectionBlock:^(NSString *date){
  3039. _tempDeliveryStatusStartDate=date;
  3040. } andCompletionBlock:^(void){
  3041. _deliveryStatusStartDate = _tempDeliveryStatusStartDate;
  3042. [weakself.btnDeliveryStatusStartDate setTitle:_deliveryStatusStartDate forState:UIControlStateNormal];
  3043. [self startLoading];
  3044. [self clearDeliveryData];
  3045. [self loadDeliveryData];
  3046. } andCancelBlock:^(void){
  3047. }];
  3048. [_dealDatePicker show];
  3049. }
  3050. -(void)btnSelectDeliveryStatusEndDate
  3051. {
  3052. __weak typeof(self) weakself=self;
  3053. _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""];
  3054. [_dealDatePicker configureSelectionBlock:^(NSString *date){
  3055. _tempDeliveryStatusEndDate=date;
  3056. } andCompletionBlock:^(void){
  3057. _deliveryStatusEndDate = _tempDeliveryStatusEndDate;
  3058. [weakself.btnDeliveryStatusEndDate setTitle:_deliveryStatusEndDate forState:UIControlStateNormal];
  3059. [self startLoading];
  3060. [self clearDeliveryData];
  3061. [self loadDeliveryData];
  3062. } andCancelBlock:^(void){
  3063. }];
  3064. [_dealDatePicker show];
  3065. }
  3066. -(void)btnSelectCollectionStatusEndDate
  3067. {
  3068. __weak typeof(self) weakself=self;
  3069. _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""];
  3070. [_dealDatePicker configureSelectionBlock:^(NSString *date){
  3071. _tempCollectionStatusEndDate=date;
  3072. } andCompletionBlock:^(void){
  3073. _collectionStatusEndDate = _tempCollectionStatusEndDate;
  3074. [weakself.btnCollectionStatusEndDate setTitle:_collectionStatusEndDate forState:UIControlStateNormal];
  3075. [self startLoading];
  3076. [collectionStatusXArray removeAllObjects];
  3077. [collectionStatusYArray removeAllObjects];
  3078. [self clearCollectionStatusData];
  3079. [self loadCashData];
  3080. } andCancelBlock:^(void){
  3081. }];
  3082. [_dealDatePicker show];
  3083. }
  3084. -(void)btnSelectInstallStatusStartDate
  3085. {
  3086. __weak typeof(self) weakself=self;
  3087. _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""];
  3088. [_dealDatePicker configureSelectionBlock:^(NSString *date){
  3089. _tempInstallStatusStartDate=date;
  3090. } andCompletionBlock:^(void){
  3091. _installStatusStartDate = _tempInstallStatusStartDate;
  3092. [weakself.btnInstallStatusStartDate setTitle:_installStatusStartDate forState:UIControlStateNormal];
  3093. [self startLoading];
  3094. [self clearInstallData];
  3095. [self loadInstallData];
  3096. } andCancelBlock:^(void){
  3097. }];
  3098. [_dealDatePicker show];
  3099. }
  3100. -(void)btnSelectInstallStatusEndDate
  3101. {
  3102. __weak typeof(self) weakself=self;
  3103. _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""];
  3104. [_dealDatePicker configureSelectionBlock:^(NSString *date){
  3105. _tempInstallStatusEndDate=date;
  3106. } andCompletionBlock:^(void){
  3107. _installStatusEndDate = _tempInstallStatusEndDate;
  3108. [weakself.btnInstallStatusEndDate setTitle:_installStatusEndDate forState:UIControlStateNormal];
  3109. [self startLoading];
  3110. [self clearInstallData];
  3111. [self loadInstallData];
  3112. } andCancelBlock:^(void){
  3113. }];
  3114. [_dealDatePicker show];
  3115. }
  3116. -(void)btnSelectRepairStatusStartDate
  3117. {
  3118. __weak typeof(self) weakself=self;
  3119. _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""];
  3120. [_dealDatePicker configureSelectionBlock:^(NSString *date){
  3121. _tempRepairStatusStartDate=date;
  3122. } andCompletionBlock:^(void){
  3123. _repairStatusStartDate = _tempRepairStatusStartDate;
  3124. [weakself.btnRepairStatusStartDate setTitle:_repairStatusStartDate forState:UIControlStateNormal];
  3125. [self startLoading];
  3126. [self clearRepairData];
  3127. [self loadRepairData];
  3128. } andCancelBlock:^(void){
  3129. }];
  3130. [_dealDatePicker show];
  3131. }
  3132. -(void)btnSelectRepairStatusEndDate
  3133. {
  3134. __weak typeof(self) weakself=self;
  3135. _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""];
  3136. [_dealDatePicker configureSelectionBlock:^(NSString *date){
  3137. _tempRepairStatusEndDate=date;
  3138. } andCompletionBlock:^(void){
  3139. _repairStatusEndDate = _tempRepairStatusEndDate;
  3140. [weakself.btnRepairStatusEndDate setTitle:_repairStatusEndDate forState:UIControlStateNormal];
  3141. [self startLoading];
  3142. [self clearRepairData];
  3143. [self loadRepairData];
  3144. } andCancelBlock:^(void){
  3145. }];
  3146. [_dealDatePicker show];
  3147. }
  3148. -(void)btnSelectOrderStatusStartDate
  3149. {
  3150. __weak typeof(self) weakself=self;
  3151. _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""];
  3152. [_dealDatePicker configureSelectionBlock:^(NSString *date){
  3153. _tempOrderStatusStartDate=date;
  3154. } andCompletionBlock:^(void){
  3155. _orderStatusStartDate = _tempOrderStatusStartDate;
  3156. [weakself.btnOrderStatusStartDate setTitle:_orderStatusStartDate forState:UIControlStateNormal];
  3157. [self startLoading];
  3158. [orderStatusXArray removeAllObjects];
  3159. [orderStatusYArray removeAllObjects];
  3160. [self clearOrderStatusData];
  3161. [self loadOrderStatusData];
  3162. } andCancelBlock:^(void){
  3163. }];
  3164. [_dealDatePicker show];
  3165. }
  3166. -(void)btnSelectOrderStatusEndDate
  3167. {
  3168. __weak typeof(self) weakself=self;
  3169. _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""];
  3170. [_dealDatePicker configureSelectionBlock:^(NSString *date){
  3171. _tempOrderStatusEndDate=date;
  3172. } andCompletionBlock:^(void){
  3173. _orderStatusEndDate = _tempOrderStatusEndDate;
  3174. [weakself.btnOrderStatusEndDate setTitle:_orderStatusEndDate forState:UIControlStateNormal];
  3175. [self clearOrderStatusData];
  3176. [self startLoading];
  3177. [orderStatusXArray removeAllObjects];
  3178. [orderStatusYArray removeAllObjects];
  3179. [self loadOrderStatusData];
  3180. } andCancelBlock:^(void){
  3181. }];
  3182. [_dealDatePicker show];
  3183. }
  3184. /**
  3185. 画单个柱状图
  3186. */
  3187. -(void)drawSingleBarchart:(NSMutableArray*)barchartArray chartView:(BarChartView*)chart
  3188. axisValueFormatter:(id<ChartAxisValueFormatter>)formatter xAxisLabelCount:(NSInteger)count maximumValue:(double)maximumValue minimumValue:(double)minimumValue
  3189. {
  3190. chart.chartDescription.enabled = NO;
  3191. chart.legend.enabled = NO;
  3192. chart.drawGridBackgroundEnabled = NO;
  3193. chart.dragEnabled = YES;
  3194. [chart setScaleEnabled:YES];
  3195. chart.pinchZoomEnabled = NO;
  3196. chart.extraBottomOffset=20;
  3197. chart.rightAxis.enabled = NO;
  3198. chart.delegate = self;
  3199. chart.drawBarShadowEnabled = NO;
  3200. chart.drawValueAboveBarEnabled = YES;
  3201. BalloonMarker *marker = [[BalloonMarker alloc]
  3202. initWithColor: [UIColor colorWithWhite:210/255. alpha:1.0]
  3203. font: [UIFont systemFontOfSize:12.0]
  3204. textColor: UIColor.whiteColor
  3205. insets: UIEdgeInsetsMake(8.0, 8.0, 20.0, 8.0)];
  3206. marker.chartView = chart;
  3207. marker.minimumSize = CGSizeMake(80.f, 40.f);
  3208. chart.marker = marker;
  3209. chart.maxVisibleCount = 60;
  3210. ChartXAxis *xAxis = chart.xAxis;
  3211. xAxis.labelPosition = XAxisLabelPositionBottom;
  3212. xAxis.labelFont = [UIFont systemFontOfSize:10.f];
  3213. xAxis.drawGridLinesEnabled = NO;
  3214. xAxis.granularity = 1.0; // only intervals of 1 day
  3215. xAxis.labelCount = count;
  3216. xAxis.labelRotationAngle=20;
  3217. xAxis.valueFormatter = formatter;
  3218. ChartYAxis *leftAxis = chart.leftAxis;
  3219. leftAxis.labelFont = [UIFont systemFontOfSize:10.f];
  3220. leftAxis.axisMaximum=maximumValue+100;
  3221. leftAxis.labelPosition = YAxisLabelPositionOutsideChart;
  3222. leftAxis.spaceTop = 0.15;
  3223. if(minimumValue<0)
  3224. {
  3225. leftAxis.axisMinimum =minimumValue;
  3226. }
  3227. else{
  3228. leftAxis.axisMinimum = 0.0;
  3229. }
  3230. double start = 0;
  3231. NSMutableArray *yVals1 = [[NSMutableArray alloc] init];
  3232. for (int i = start; i < barchartArray.count; i++)
  3233. {
  3234. BarChartDataEntry *dataEntry;
  3235. dataEntry= [[BarChartDataEntry alloc] initWithX:i y:[[barchartArray objectAtIndex:i]doubleValue] icon: [UIImage imageNamed:@"icon"] ];
  3236. [yVals1 addObject:dataEntry];
  3237. }
  3238. BarChartDataSet *set1 = nil;
  3239. UIColor *blueColor= [UIColor colorWithRed:70/255.0f green:116/255.0f blue:193/255.0f alpha:1];
  3240. NSMutableArray *colorArray=[[NSMutableArray alloc]init];
  3241. [colorArray addObject:blueColor];
  3242. if (chart.data.dataSetCount > 0)
  3243. {
  3244. set1 = (BarChartDataSet *)chart.data.dataSets[0];
  3245. [set1 replaceEntries: yVals1];
  3246. [chart.data notifyDataChanged];
  3247. [chart notifyDataSetChanged];
  3248. }
  3249. else
  3250. {
  3251. set1 = [[BarChartDataSet alloc] initWithEntries:yVals1 label:@"资金"];
  3252. [set1 setColors:colorArray];
  3253. set1.drawIconsEnabled = NO;
  3254. [set1 setDrawValuesEnabled:NO];
  3255. NSMutableArray *dataSets = [[NSMutableArray alloc] init];
  3256. [dataSets addObject:set1];
  3257. BarChartData *data = [[BarChartData alloc] initWithDataSets:dataSets];
  3258. [data setValueFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:10.0f]];
  3259. data.barWidth = 0.5f;
  3260. chart.data = data;
  3261. }
  3262. }
  3263. /**
  3264. * 异步执行 + 并发队列
  3265. * 特点:可以开启多个线程,任务交替(同时)执行。
  3266. */
  3267. - (void)asyncConcurrent {
  3268. dispatch_queue_t queue = dispatch_queue_create("com.test.queue", DISPATCH_QUEUE_CONCURRENT);
  3269. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_SALES_STATUS_IPHONE].location!=NSNotFound){
  3270. dispatch_async(queue, ^{
  3271. // 追加任务 1
  3272. [NSThread sleepForTimeInterval:1]; // 模拟耗时操作
  3273. [self loadSalesStatusData];
  3274. });
  3275. // }
  3276. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_COLLECTION_STATUS_IPHONE].location!=NSNotFound){
  3277. dispatch_async(queue, ^{
  3278. // 追加任务 1
  3279. [NSThread sleepForTimeInterval:1]; // 模拟耗时操作
  3280. [self loadCashData];
  3281. });
  3282. //}
  3283. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_ORDER_STATUS_IPHONE].location!=NSNotFound){
  3284. dispatch_async(queue, ^{
  3285. // 追加任务 1
  3286. [NSThread sleepForTimeInterval:1]; // 模拟耗时操作
  3287. [self loadOrderStatusData];
  3288. });
  3289. // }
  3290. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_SHOPPING_GUIDE_IPHONE].location!=NSNotFound){
  3291. dispatch_async(queue, ^{
  3292. // 追加任务 1
  3293. [NSThread sleepForTimeInterval:1]; // 模拟耗时操作
  3294. [self loadShoppingGuideData];
  3295. });
  3296. // }
  3297. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_DELIVERY_STATUS_IPHONE].location!=NSNotFound){
  3298. dispatch_async(queue, ^{
  3299. // 追加任务 1
  3300. [NSThread sleepForTimeInterval:1]; // 模拟耗时操作
  3301. [self loadDeliveryData];
  3302. });
  3303. // }
  3304. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_INSTALL_STATUS_IPHONE].location!=NSNotFound){
  3305. dispatch_async(queue, ^{
  3306. // 追加任务 1
  3307. [NSThread sleepForTimeInterval:1]; // 模拟耗时操作
  3308. [self loadInstallData];
  3309. });
  3310. // }
  3311. // if([kkRights rangeOfString: FUNCTION_SALES_DATA_REPAIR_STATUS_IPHONE].location!=NSNotFound){
  3312. dispatch_async(queue, ^{
  3313. // 追加任务 1
  3314. [NSThread sleepForTimeInterval:1]; // 模拟耗时操作
  3315. [self loadRepairData];
  3316. });
  3317. // }
  3318. dispatch_async(queue, ^{
  3319. // 追加任务 1
  3320. [NSThread sleepForTimeInterval:1]; // 模拟耗时操作
  3321. [self loadSalesAchievementData];
  3322. });
  3323. }
  3324. -(void)loadDeliveryData
  3325. {
  3326. NSString *urlStr = [NSString stringWithFormat:@"%@", ServerURL];
  3327. NSMutableDictionary *dict = [NSMutableDictionary dictionary];
  3328. [dict setObject:@"GetSalesStatisticalAnalysisDistributionDataIphone" forKey:@"Action"];
  3329. [dict setObject:[NSString stringWithFormat:@"%@",kkAccountCode]forKey:@"AccountCode"];
  3330. [dict setObject:kkUserCode forKey:@"UserCode"];
  3331. [dict setObject:kkUserPwd forKey:@"UserPassword"];
  3332. [dict setObject:kkSessionKey forKey:@"SessionKey"];
  3333. _deliveryDownManager = [[ASIDownManager alloc] init];
  3334. _deliveryDownManager.delegate = self;
  3335. _deliveryDownManager.onRequestSuccess = @selector(onDeliveryStatusLoadFinish:);
  3336. _deliveryDownManager.onRequestFail = @selector(onDeliveryStatusLoadFail:);
  3337. [_deliveryDownManager postHttpRequest:urlStr dic:dict path:nil fileName:nil];
  3338. }
  3339. -(void)loadRepairData
  3340. {
  3341. NSString *urlStr = [NSString stringWithFormat:@"%@", ServerURL];
  3342. NSMutableDictionary *dict = [NSMutableDictionary dictionary];
  3343. [dict setObject:@"GetSalesStatisticalAnalysisRepairDataIphone" forKey:@"Action"];
  3344. [dict setObject:[NSString stringWithFormat:@"%@",kkAccountCode]forKey:@"AccountCode"];
  3345. [dict setObject:kkUserCode forKey:@"UserCode"];
  3346. [dict setObject:kkUserPwd forKey:@"UserPassword"];
  3347. [dict setObject:kkSessionKey forKey:@"SessionKey"];
  3348. _repairDownManager = [[ASIDownManager alloc] init];
  3349. _repairDownManager.delegate = self;
  3350. _repairDownManager.onRequestSuccess = @selector(onRepairStatusLoadFinish:);
  3351. _repairDownManager.onRequestFail = @selector(onRepairStatusLoadFail:);
  3352. [_repairDownManager postHttpRequest:urlStr dic:dict path:nil fileName:nil];
  3353. }
  3354. -(void)loadInstallData
  3355. {
  3356. NSString *urlStr = [NSString stringWithFormat:@"%@", ServerURL];
  3357. NSMutableDictionary *dict = [NSMutableDictionary dictionary];
  3358. [dict setObject:@"GetSalesStatisticalAnalysisInstallationDataIphone" forKey:@"Action"];
  3359. [dict setObject:[NSString stringWithFormat:@"%@",kkAccountCode]forKey:@"AccountCode"];
  3360. [dict setObject:kkUserCode forKey:@"UserCode"];
  3361. [dict setObject:kkUserPwd forKey:@"UserPassword"];
  3362. [dict setObject:kkSessionKey forKey:@"SessionKey"];
  3363. _installDownManager = [[ASIDownManager alloc] init];
  3364. _installDownManager.delegate = self;
  3365. _installDownManager.onRequestSuccess = @selector(onInstallStatusLoadFinish:);
  3366. _installDownManager.onRequestFail = @selector(onInstallStatusLoadFail:);
  3367. [_installDownManager postHttpRequest:urlStr dic:dict path:nil fileName:nil];
  3368. }
  3369. /**
  3370. 加载销售利润数据源
  3371. */
  3372. -(void)loadSalesStatusData
  3373. {
  3374. NSString *urlStr = [NSString stringWithFormat:@"%@", ServerURL];
  3375. NSMutableDictionary *dict = [NSMutableDictionary dictionary];
  3376. [dict setObject:@"GetSalesStatisticalAnalysisSaleDataIphone" forKey:@"Action"];
  3377. [dict setObject:[NSString stringWithFormat:@"%@",kkAccountCode]forKey:@"AccountCode"];
  3378. [dict setObject:kkUserCode forKey:@"UserCode"];
  3379. [dict setObject:kkUserPwd forKey:@"UserPassword"];
  3380. [dict setObject:kkSessionKey forKey:@"SessionKey"];
  3381. [dict setObject:typeId forKeyedSubscript:@"TypeID"];
  3382. [dict setObject:_salesStatusStartDate forKeyedSubscript:@"AccountDateFrom"];
  3383. [dict setObject:_salesStatusEndDate forKeyedSubscript:@"AccountDateTo"];
  3384. _salesStatusDownManager = [[ASIDownManager alloc] init];
  3385. _salesStatusDownManager.delegate = self;
  3386. _salesStatusDownManager.onRequestSuccess = @selector(onSalesStatusLoadFinish:);
  3387. _salesStatusDownManager.onRequestFail = @selector(onSalesStatusLoadFail:);
  3388. [_salesStatusDownManager postHttpRequest:urlStr dic:dict path:nil fileName:nil];
  3389. }
  3390. -(void)loadSalesAchievementData
  3391. {
  3392. NSString *urlStr = [NSString stringWithFormat:@"%@", ServerURL];
  3393. NSMutableDictionary *dict = [NSMutableDictionary dictionary];
  3394. [dict setObject:@"GetSalesStatisticalAnalysisAchievementDataIphone" forKey:@"Action"];
  3395. [dict setObject:[NSString stringWithFormat:@"%@",kkAccountCode]forKey:@"AccountCode"];
  3396. [dict setObject:kkUserCode forKey:@"UserCode"];
  3397. [dict setObject:kkUserPwd forKey:@"UserPassword"];
  3398. [dict setObject:kkSessionKey forKey:@"SessionKey"];
  3399. [dict setObject:salesAchievementTypeId forKeyedSubscript:@"TypeID"];
  3400. [dict setObject:_salesAchievementMonth forKeyedSubscript:@"AccountMonth"];
  3401. _salesAchievementDownManager = [[ASIDownManager alloc] init];
  3402. _salesAchievementDownManager.delegate = self;
  3403. _salesAchievementDownManager.onRequestSuccess = @selector(onSalesAchievementLoadFinish:);
  3404. _salesAchievementDownManager.onRequestFail = @selector(onSalesAchievementLoadFail:);
  3405. [_salesAchievementDownManager postHttpRequest:urlStr dic:dict path:nil fileName:nil];
  3406. }
  3407. -(void)loadOrderStatusData
  3408. {
  3409. NSString *urlStr = [NSString stringWithFormat:@"%@", ServerURL];
  3410. NSMutableDictionary *dict = [NSMutableDictionary dictionary];
  3411. [dict setObject:@"GetSalesStatisticalAnalysisOrderData" forKey:@"Action"];
  3412. [dict setObject:[NSString stringWithFormat:@"%@",kkAccountCode]forKey:@"AccountCode"];
  3413. [dict setObject:kkUserCode forKey:@"UserCode"];
  3414. [dict setObject:kkUserPwd forKey:@"UserPassword"];
  3415. [dict setObject:kkSessionKey forKey:@"SessionKey"];
  3416. [dict setObject:orderStatusTypeId forKeyedSubscript:@"TypeID"];
  3417. [dict setObject:_orderStatusStartDate forKeyedSubscript:@"AccountDateFrom"];
  3418. [dict setObject:_orderStatusEndDate forKeyedSubscript:@"AccountDateTo"];
  3419. _orderStatusDownManager = [[ASIDownManager alloc] init];
  3420. _orderStatusDownManager.delegate = self;
  3421. _orderStatusDownManager.onRequestSuccess = @selector(onOrderStatusLoadFinish:);
  3422. _orderStatusDownManager.onRequestFail = @selector(onOrderStatusLoadFail:);
  3423. [_orderStatusDownManager postHttpRequest:urlStr dic:dict path:nil fileName:nil];
  3424. }
  3425. -(void)loadShoppingGuideData
  3426. {
  3427. NSString *urlStr = [NSString stringWithFormat:@"%@", ServerURL];
  3428. NSMutableDictionary *dict = [NSMutableDictionary dictionary];
  3429. [dict setObject:@"GetSalesStatisticalAnalysisRecordDataIphone" forKey:@"Action"];
  3430. [dict setObject:[NSString stringWithFormat:@"%@",kkAccountCode]forKey:@"AccountCode"];
  3431. [dict setObject:kkUserCode forKey:@"UserCode"];
  3432. [dict setObject:kkUserPwd forKey:@"UserPassword"];
  3433. [dict setObject:kkSessionKey forKey:@"SessionKey"];
  3434. [dict setObject:_shoppingGuideStartDate forKeyedSubscript:@"AccountDateFrom"];
  3435. [dict setObject:_shoppingGuideEndDate forKeyedSubscript:@"AccountDateTo"];
  3436. _shoppingGuideDownManager = [[ASIDownManager alloc] init];
  3437. _shoppingGuideDownManager.delegate = self;
  3438. _shoppingGuideDownManager.onRequestSuccess = @selector(onShoppingGuideLoadFinish:);
  3439. _shoppingGuideDownManager.onRequestFail = @selector(onShoppingGuideLoadFail:);
  3440. [_shoppingGuideDownManager postHttpRequest:urlStr dic:dict path:nil fileName:nil];
  3441. }
  3442. -(void)loadCashData
  3443. {
  3444. NSString *urlStr = [NSString stringWithFormat:@"%@", ServerURL];
  3445. NSMutableDictionary *dict = [NSMutableDictionary dictionary];
  3446. [dict setObject:@"GetSalesStatisticalAnalysisCashDataIphone" forKey:@"Action"];
  3447. [dict setObject:[NSString stringWithFormat:@"%@",kkAccountCode]forKey:@"AccountCode"];
  3448. [dict setObject:kkUserCode forKey:@"UserCode"];
  3449. [dict setObject:kkUserPwd forKey:@"UserPassword"];
  3450. [dict setObject:kkSessionKey forKey:@"SessionKey"];
  3451. [dict setObject:cashStatusTypeId forKeyedSubscript:@"TypeID"];
  3452. [dict setObject:_collectionStatusStartDate forKeyedSubscript:@"AccountDateFrom"];
  3453. [dict setObject:_collectionStatusEndDate forKeyedSubscript:@"AccountDateTo"];
  3454. _cashStatusDownManager = [[ASIDownManager alloc] init];
  3455. _cashStatusDownManager.delegate = self;
  3456. _cashStatusDownManager.onRequestSuccess = @selector(onCashStatusLoadFinish:);
  3457. _cashStatusDownManager.onRequestFail = @selector(onCashStatusLoadFail:);
  3458. [_cashStatusDownManager postHttpRequest:urlStr dic:dict path:nil fileName:nil];
  3459. }
  3460. #pragma mark - 代理函数
  3461. - (void)datePickerController:(ITDatePickerController *)datePickerController didSelectedDate:(NSDate *)date dateString:(NSString *)dateString {
  3462. NSInteger tag = datePickerController.tag;
  3463. if (datePickerController.tag == 100) {
  3464. NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
  3465. [dateFormatter setDateFormat:@"yyyy-MM"] ;
  3466. NSDateFormatter *dateFormatter1 = [[NSDateFormatter alloc] init];
  3467. [dateFormatter1 setDateFormat:@"yyyyMM"];
  3468. //NSDate转NSString
  3469. _salesAchievementMonth = [dateFormatter1 stringFromDate:date];
  3470. [_btnSalesAchievementCustom setTitle: [dateFormatter stringFromDate:date] forState:UIControlStateNormal];
  3471. [self clearSalesAchievementData];
  3472. [self startLoading];
  3473. [self loadSalesAchievementData];
  3474. }
  3475. }
  3476. -(void)onSalesAchievementLoadFinish:(ASIDownManager *)sender {
  3477. [self stopLoading];
  3478. RequestResultModel *resultModel = [RequestResultModel dk_modelWithJSON:sender.mWebStr];
  3479. int status= resultModel.status;
  3480. if(status==0)
  3481. {
  3482. NSDictionary *resultDic=(NSDictionary*)[resultModel result];
  3483. NSArray *tableArray= [resultDic objectForKey:@"Table"];
  3484. if(tableArray!=nil&&tableArray.count>0)
  3485. {
  3486. double totalAmount=0;
  3487. double totalPlanAmount=0;
  3488. NSMutableArray *salesAchievementArray=[[NSMutableArray alloc]init];
  3489. for(int i=0;i<tableArray.count;i++)
  3490. {
  3491. NSDictionary *dic=[tableArray objectAtIndex:i];
  3492. double amount= [[dic objectForKey:@"Amount"]doubleValue];
  3493. double planAmount= [[dic objectForKey:@"PlanAmount"]doubleValue];
  3494. NSString *name=[dic objectForKey:@"Name"];
  3495. NSString *amountStr=[NSString stringWithFormat:@"%.2f",amount];
  3496. NSString *planAmountStr=[NSString stringWithFormat:@"%.2f",amount];
  3497. NSMutableDictionary *dic2=[[NSMutableDictionary alloc]init];
  3498. [dic2 setObject:planAmountStr forKey:@"planAmount"];
  3499. [dic2 setObject:amountStr forKey:@"saleAmount"];
  3500. [salesAchievementArray addObject:amountStr];
  3501. [salesAchievementArray addObject:planAmountStr];
  3502. [salesAchievementYArray addObject:dic2];
  3503. [salesAchievementXArray addObject:name];
  3504. totalAmount+=amount;
  3505. totalPlanAmount+=planAmount;
  3506. }
  3507. NSString *totalAmountStr=[NSString stringWithFormat:@"%.2f",totalAmount];
  3508. NSString *totalPlanAmountStr=[NSString stringWithFormat:@"%.2f",totalPlanAmount];
  3509. double percent;
  3510. if(totalPlanAmount==0)
  3511. {
  3512. percent=0;
  3513. }
  3514. percent= totalAmount/totalPlanAmount*100;
  3515. [_salesAchievementChart progress:percent ];
  3516. lblSalesAchievementPercent.text=[NSString stringWithFormat:@"%@%.2f%@",@"完成率",percent,@"%"];
  3517. totalAmountStr=[Util thousandSeparatorFormat:totalAmountStr];
  3518. totalPlanAmountStr=[Util thousandSeparatorFormat:totalPlanAmountStr];
  3519. lblSalesAchievementPlanAmount.text=totalPlanAmountStr;
  3520. lblSalesAchievementSalesAmount.text=totalAmountStr;
  3521. IntAxisValueFormatter *formatter3=[[IntAxisValueFormatter alloc]init];
  3522. [formatter3 setTitle:salesAchievementXArray];
  3523. double maximumValue3= [self getYAxisMaximumValue:salesAchievementArray];
  3524. double minimumValue3=[self getYAxisMinimumValue:salesAchievementArray];
  3525. [self drawTwoBarchart:salesAchievementYArray receivablesTitleArray:salesAchievementTitleArray barChartView:_salesAchievementChartView axisValueFormatter:formatter3 xAxisLabelCount:salesAchievementXArray.count maximumValue:maximumValue3 minimumValue:minimumValue3];
  3526. }
  3527. else
  3528. {
  3529. [ _salesAchievementChartView clear];
  3530. [_salesAchievementChartView notifyDataSetChanged];
  3531. }
  3532. }
  3533. }
  3534. -(void)onSalesAchievementLoadFail:(ASIDownManager *)sender {
  3535. [self stopLoading];
  3536. }
  3537. -(void)onRepairStatusLoadFinish:(ASIDownManager *)sender {
  3538. [self stopLoading];
  3539. RequestResultModel *resultModel = [RequestResultModel dk_modelWithJSON:sender.mWebStr];
  3540. int status= resultModel.status;
  3541. if(status==0)
  3542. {
  3543. NSDictionary *resultDic=(NSDictionary*)[resultModel result];
  3544. NSArray *resultArray=[resultDic objectForKey:@"Table"];
  3545. if(resultArray!=nil&&resultArray.count>0)
  3546. {
  3547. NSDictionary *dic=[resultArray objectAtIndex:0];
  3548. int repairNo= [[dic objectForKey:@"RepairNo"]intValue];
  3549. int repairOkNo= [[dic objectForKey:@"RepairOkNo"]intValue];
  3550. int repairNoOne= [[dic objectForKey:@"RepairNo_One"]intValue];
  3551. int repairNoTwo=[[dic objectForKey:@"RepairNo_Two"]intValue];
  3552. int repairNoThree=[[dic objectForKey:@"RepairNo_Three"]intValue];
  3553. lblNeedRepairCustomerCount.text=[NSString stringWithFormat:@"%d",repairNo];
  3554. lblRepairedCustomerCount.text=[NSString stringWithFormat:@"%d",repairOkNo];
  3555. lblNextDayNeedRepairCount.text=[NSString stringWithFormat:@"%d",repairNoOne];
  3556. lblNextTwoDaysNeedRepairCount.text=[NSString stringWithFormat:@"%d",repairNoTwo];
  3557. lblNextThreeDaysNeedRepairCount.text=[NSString stringWithFormat:@"%d",repairNoThree];
  3558. double percent=0;
  3559. if(repairNo==0)
  3560. {
  3561. percent=0;
  3562. }
  3563. else{
  3564. percent= repairOkNo/repairNo*100;
  3565. }
  3566. [_repairStatusView progress:percent ];
  3567. lblRepairPercent.text=[NSString stringWithFormat:@"%@%.2f%@",@"完成率",percent,@"%"];
  3568. }
  3569. }
  3570. }
  3571. -(void)onRepairStatusLoadFail:(ASIDownManager *)sender {
  3572. [self stopLoading];
  3573. }
  3574. -(void)onDeliveryStatusLoadFinish:(ASIDownManager *)sender {
  3575. [self stopLoading];
  3576. RequestResultModel *resultModel = [RequestResultModel dk_modelWithJSON:sender.mWebStr];
  3577. int status= resultModel.status;
  3578. if(status==0)
  3579. {
  3580. NSDictionary *resultDic=(NSDictionary*)[resultModel result];
  3581. NSArray *resultArray=[resultDic objectForKey:@"Table"];
  3582. if(resultArray!=nil&&resultArray.count>0)
  3583. {
  3584. NSDictionary *dic=[resultArray objectAtIndex:0];
  3585. int deliveryNo= [[dic objectForKey:@"DeliveryNo"]intValue];
  3586. int deliveryOkNo= [[dic objectForKey:@"DeliveryOkNo"]intValue];
  3587. int deliveryNoOne= [[dic objectForKey:@"DeliveryNo_One"]intValue];
  3588. int deliveryNoTwo=[[dic objectForKey:@"DeliveryNo_Two"]intValue];
  3589. int deliveryNoThree=[[dic objectForKey:@"DeliveryNo_Three"]intValue];
  3590. lblNeedDeliveryCustomerCount.text=[NSString stringWithFormat:@"%d",deliveryNo];
  3591. lblDeliveredCustomerCount.text=[NSString stringWithFormat:@"%d",deliveryOkNo];
  3592. lblNextDayNeedDeliveryCount.text=[NSString stringWithFormat:@"%d",deliveryNoOne];
  3593. lblNextTwoDaysNeedDeliveryCount.text=[NSString stringWithFormat:@"%d",deliveryNoTwo];
  3594. lblNextThreeDaysNeedDeliveryCount.text=[NSString stringWithFormat:@"%d",deliveryNoThree];
  3595. double percent=0;
  3596. if(deliveryNo==0)
  3597. {
  3598. percent=0;
  3599. }
  3600. else{
  3601. percent= deliveryOkNo/deliveryNo*100;
  3602. }
  3603. [_deliveryStatusView progress:percent ];
  3604. lblDeliveryPercent.text=[NSString stringWithFormat:@"%@%.2f%@",@"完成率",percent,@"%"];
  3605. }
  3606. }
  3607. }
  3608. -(void)onDeliveryStatusLoadFail:(ASIDownManager *)sender {
  3609. [self stopLoading];
  3610. }
  3611. -(void)onInstallStatusLoadFinish:(ASIDownManager *)sender {
  3612. [self stopLoading];
  3613. RequestResultModel *resultModel = [RequestResultModel dk_modelWithJSON:sender.mWebStr];
  3614. int status= resultModel.status;
  3615. if(status==0)
  3616. {
  3617. NSDictionary *resultDic=(NSDictionary*)[resultModel result];
  3618. if(resultDic!=nil)
  3619. {
  3620. NSArray *resultArray=[resultDic objectForKey:@"Table"];
  3621. if(resultArray!=nil&&resultArray.count>0)
  3622. {
  3623. NSDictionary *dic=[resultArray objectAtIndex:0];
  3624. int installNo= [[dic objectForKey:@"InstallationNo"]intValue];
  3625. int installOkNo= [[dic objectForKey:@"InstallationOkNo"]intValue];
  3626. int installNoOne= [[dic objectForKey:@"InstallationNo_One"]intValue];
  3627. int installNoTwo=[[dic objectForKey:@"InstallationNo_Two"]intValue];
  3628. int installNoThree=[[dic objectForKey:@"InstallationNo_Three"]intValue];
  3629. lblNeedInstallCustomerCount.text=[NSString stringWithFormat:@"%d",installNo];
  3630. lblInstalledCustomerCount.text=[NSString stringWithFormat:@"%d",installOkNo];
  3631. lblNextDayNeedInstallCount.text=[NSString stringWithFormat:@"%d",installNoOne];
  3632. lblNextTwoDaysNeedInstallCount.text=[NSString stringWithFormat:@"%d",installNoTwo];
  3633. lblNextThreeDaysNeedInstallCount.text=[NSString stringWithFormat:@"%d",installNoThree];
  3634. double percent=0;
  3635. if(installNo==0)
  3636. {
  3637. percent=0;
  3638. }
  3639. else{
  3640. percent= installOkNo/installNo*100;
  3641. }
  3642. [_installStatusView progress:percent];
  3643. lblInstallPercent.text=[NSString stringWithFormat:@"%@%.2f%@",@"完成率",percent,@"%"];
  3644. }
  3645. }
  3646. }
  3647. }
  3648. -(void)onInstallStatusLoadFail:(ASIDownManager *)sender {
  3649. [self stopLoading];
  3650. }
  3651. -(void)onShoppingGuideLoadFinish:(ASIDownManager *)sender {
  3652. [self stopLoading];
  3653. RequestResultModel *resultModel = [RequestResultModel dk_modelWithJSON:sender.mWebStr];
  3654. int status= resultModel.status;
  3655. if(status==0)
  3656. {
  3657. NSDictionary *resultDic=(NSDictionary*)[resultModel result];
  3658. if(resultDic!=nil)
  3659. {
  3660. NSArray *table1Array= [resultDic objectForKey:@"Table1"];
  3661. NSArray *tableArray= [resultDic objectForKey:@"Table"];
  3662. if(table1Array!=nil&&table1Array.count>0)
  3663. {
  3664. NSDictionary *table1Dic=[table1Array objectAtIndex:0];
  3665. int num= [[table1Dic objectForKey:@"Num"]intValue];
  3666. int okNum= [[table1Dic objectForKey:@"OkNum"]intValue];
  3667. double transactionPercent=0;
  3668. if(num==0)
  3669. {
  3670. transactionPercent=0;
  3671. }
  3672. else{
  3673. transactionPercent= okNum/num*100;
  3674. }
  3675. lblFilingCustomerCount.text=[NSString stringWithFormat:@"%d",num];
  3676. lblTransactionCustomerCount.text=[NSString stringWithFormat:@"%d",okNum];
  3677. [_transactionView progress:transactionPercent ];
  3678. }
  3679. if(tableArray!=nil&&tableArray.count>0)
  3680. {
  3681. NSMutableArray *yArray=[[NSMutableArray alloc]init];
  3682. for(int i=0;i<tableArray.count;i++)
  3683. {
  3684. NSDictionary *tableDic=[tableArray objectAtIndex:i];
  3685. int num= [[tableDic objectForKey:@"Num"]intValue];
  3686. NSString *numStr=[NSString stringWithFormat:@"%d",num];
  3687. int okNum=[[tableDic objectForKey:@"OkNum"]intValue];
  3688. NSString *okNumStr=[NSString stringWithFormat:@"%d",okNum];
  3689. NSString *name=[tableDic objectForKey:@"Name"];
  3690. [shoppingGuideXArray addObject:name];
  3691. NSMutableDictionary *dic=[[NSMutableDictionary alloc]init];
  3692. [dic setObject:okNumStr forKey:@"transactionCount"];
  3693. [dic setObject:numStr forKey:@"filingCount"];
  3694. [shoppingGuideYArray addObject:dic];
  3695. [yArray addObject:numStr];
  3696. [yArray addObject:okNumStr];
  3697. }
  3698. IntAxisValueFormatter *formatter4=[[IntAxisValueFormatter alloc]init];
  3699. [formatter4 setTitle:shoppingGuideXArray];
  3700. double maximumValue= [self getYAxisMaximumValue:yArray];
  3701. double minimumValue=[self getYAxisMinimumValue:yArray];
  3702. [self drawHorizontalTwoBarchart:shoppingGuideYArray receivablesTitleArray:shoppingGuideTitleArray barChartView:_transactionChartView axisValueFormatter:formatter4 xAxisLabelCount:shoppingGuideXArray.count maximumValue:maximumValue minimumValue:minimumValue];
  3703. }
  3704. }
  3705. }
  3706. }
  3707. -(void)onShoppingGuideLoadFail:(ASIDownManager *)sender {
  3708. [self stopLoading];
  3709. }
  3710. -(void)onOrderStatusLoadFinish:(ASIDownManager *)sender {
  3711. [self stopLoading];
  3712. RequestResultModel *resultModel = [RequestResultModel dk_modelWithJSON:sender.mWebStr];
  3713. int status= resultModel.status;
  3714. if(status==0)
  3715. {
  3716. NSDictionary *resultDic=(NSDictionary*)resultModel.result;
  3717. if(resultDic!=nil)
  3718. {
  3719. NSArray *resultArray=[resultDic objectForKey:@"Table"];
  3720. if(resultArray!=nil&&resultArray.count>0)
  3721. {
  3722. for(int i=0;i<resultArray.count;i++)
  3723. {
  3724. NSDictionary *dic=[resultArray objectAtIndex:i];
  3725. double amount=[[dic objectForKey:@"Amount"]doubleValue];
  3726. NSString *amountStr=[NSString stringWithFormat:@"%.2f",amount];
  3727. NSString *name=[dic objectForKey:@"Name"];
  3728. [orderStatusXArray addObject:name];
  3729. [orderStatusYArray addObject:amountStr];
  3730. }
  3731. IntAxisValueFormatter *formatter2=[[IntAxisValueFormatter alloc]init];
  3732. [formatter2 setTitle:orderStatusXArray];
  3733. double maximumValue2= [self getYAxisMaximumValue:orderStatusYArray];
  3734. double minimumValue2=[self getYAxisMinimumValue:orderStatusYArray];
  3735. [self drawSingleBarchart:orderStatusYArray chartView:_orderStatusChartView axisValueFormatter:formatter2 xAxisLabelCount:orderStatusXArray.count maximumValue:maximumValue2 minimumValue:minimumValue2];
  3736. }
  3737. NSArray *table1Array=[resultDic objectForKey:@"Table1"];
  3738. if(table1Array!=nil&&table1Array.count>0)
  3739. {
  3740. NSDictionary *table1Dic=[table1Array objectAtIndex:0];
  3741. int customerReturnNo=[[table1Dic objectForKey:@"CustomerReturnNo"]intValue];
  3742. int customerNo=[[table1Dic objectForKey:@"CustomerNo"]intValue];
  3743. double amount=[[table1Dic objectForKey:@"Amount"]doubleValue];
  3744. double returnAmount=[[table1Dic objectForKey:@"ReturnAmount"]doubleValue];
  3745. lblOrderCustomerCount.text=[NSString stringWithFormat:@"%d",customerNo];
  3746. lblUnsubscribeCustomerCount.text=[NSString stringWithFormat:@"%d",customerReturnNo];
  3747. NSString *amountStr=[NSString stringWithFormat:@"%.2f",amount];
  3748. amountStr=[Util thousandSeparatorFormat:amountStr];
  3749. lblOrderAmount.text=amountStr;
  3750. NSString *returnAmountStr=[NSString stringWithFormat:@"%.2f",returnAmount];
  3751. returnAmountStr=[Util thousandSeparatorFormat:returnAmountStr];
  3752. lblUnsubscribeAmount.text=returnAmountStr;
  3753. }
  3754. }
  3755. }
  3756. }
  3757. -(void)onOrderStatusLoadFail:(ASIDownManager *)sender {
  3758. [self stopLoading];
  3759. }
  3760. -(void)onCashStatusLoadFinish:(ASIDownManager *)sender {
  3761. [self stopLoading];
  3762. RequestResultModel *resultModel = [RequestResultModel dk_modelWithJSON:sender.mWebStr];
  3763. int status= resultModel.status;
  3764. if(status==0)
  3765. {
  3766. NSDictionary *resultDic=(NSDictionary*)resultModel.result;
  3767. if(resultDic!=nil)
  3768. {
  3769. NSArray *resultArray=[resultDic objectForKey:@"Table"];
  3770. if(resultArray!=nil&&resultArray.count>0)
  3771. {
  3772. double totalAmount=0;
  3773. for(int i=0;i<resultArray.count;i++)
  3774. {
  3775. NSDictionary *dic=[resultArray objectAtIndex:i];
  3776. double amount=[[dic objectForKey:@"Amount"]doubleValue];
  3777. totalAmount+=amount;
  3778. NSString *amountStr=[NSString stringWithFormat:@"%.2f",amount];
  3779. NSString *name=[dic objectForKey:@"Name"];
  3780. [collectionStatusXArray addObject:name];
  3781. [collectionStatusYArray addObject:amountStr];
  3782. }
  3783. NSString *totalAmountStr=[NSString stringWithFormat:@"%.2f",totalAmount];
  3784. totalAmountStr =[Util thousandSeparatorFormat:totalAmountStr];
  3785. lblCollectionAmount.text=totalAmountStr;
  3786. IntAxisValueFormatter *formatter1=[[IntAxisValueFormatter alloc]init];
  3787. [formatter1 setTitle:collectionStatusXArray];
  3788. double maximumValue1= [self getYAxisMaximumValue:collectionStatusYArray];
  3789. double minimumValue1=[self getYAxisMinimumValue:collectionStatusYArray];
  3790. [self drawSingleBarchart:collectionStatusYArray chartView:_collectionStatusChartView axisValueFormatter:formatter1 xAxisLabelCount:collectionStatusXArray.count maximumValue:maximumValue1 minimumValue:minimumValue1];
  3791. }
  3792. }
  3793. }
  3794. }
  3795. -(void)onCashStatusLoadFail:(ASIDownManager *)sender {
  3796. [self stopLoading];
  3797. }
  3798. -(void)onSalesStatusLoadFinish:(ASIDownManager *)sender {
  3799. [self stopLoading];
  3800. RequestResultModel *resultModel = [RequestResultModel dk_modelWithJSON:sender.mWebStr];
  3801. int status= resultModel.status;
  3802. if(status==0)
  3803. {
  3804. NSDictionary *resultDic=(NSDictionary*)resultModel.result;
  3805. if(resultDic!=nil)
  3806. {
  3807. NSArray *tableArray= [resultDic objectForKey:@"Table"];
  3808. NSArray *table1Array= [resultDic objectForKey:@"Table1"];
  3809. if(table1Array!=nil&&table1Array.count>0)
  3810. {
  3811. NSDictionary *table1Dic= [table1Array objectAtIndex:0];
  3812. int customerNewNo=[[table1Dic objectForKey:@"CustomerNewNo"]intValue];
  3813. int customerNo=[[table1Dic objectForKey:@"CustomerNo"]intValue];
  3814. lblSalesAddCustomer.text=[NSString stringWithFormat:@"%d",customerNewNo];
  3815. lblSalesCustomerCount.text=[NSString stringWithFormat:@"%d",customerNo];
  3816. }
  3817. if(tableArray!=nil&&tableArray.count>0)
  3818. {
  3819. double totalAmount=0;
  3820. for(int i=0;i<tableArray.count;i++)
  3821. {
  3822. NSDictionary *tableDic=[tableArray objectAtIndex:i];
  3823. double amount= [[tableDic objectForKey:@"Amount"]doubleValue];
  3824. NSString *amountStr=[NSString stringWithFormat:@"%.2f",amount];
  3825. NSString *name=[tableDic objectForKey:@"Name"];
  3826. totalAmount+=amount;
  3827. [salesStatusYArray addObject:amountStr];
  3828. [salesStatusXArray addObject:name];
  3829. }
  3830. NSString *totalAmountStr=[NSString stringWithFormat:@"%.2f",totalAmount];
  3831. totalAmountStr= [Util thousandSeparatorFormat:totalAmountStr];
  3832. lblSalesAmount.text=totalAmountStr;
  3833. IntAxisValueFormatter *formatter=[[IntAxisValueFormatter alloc]init];
  3834. [formatter setTitle:salesStatusXArray];
  3835. double maximumValue= [self getYAxisMaximumValue:salesStatusYArray];
  3836. double minimumValue=[self getYAxisMinimumValue:salesStatusYArray];
  3837. [self drawSingleBarchart:salesStatusYArray chartView:_salesStatusChartView axisValueFormatter:formatter xAxisLabelCount:salesStatusXArray.count maximumValue:maximumValue minimumValue:minimumValue];
  3838. }
  3839. }
  3840. }
  3841. }
  3842. -(void)onSalesStatusLoadFail:(ASIDownManager *)sender {
  3843. [self stopLoading];
  3844. }
  3845. @end