SalesDataAnalysisVC.m 243 KB

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