| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985 |
- //
- // StatisticsDataAnalysisVC.m
- // IBOSS-HJ
- //
- // Created by 关宏厚 on 2020/12/7.
- // Copyright © 2020 elongtian. All rights reserved.
- //
- #import "StatisticsDataAnalysisVC.h"
- #import "DateFormat.h"
- #import "Util.h"
- #import "MyView.h"
- #import "StatisticsDataAnalysisDetailVC.h"
- @interface StatisticsDataAnalysisVC ()
- {
- NSMutableArray *salesIncomeYValues;
-
- NSMutableArray *salesProfitTitleArray;
- UIScrollView *scroll;
- UIView *content;
- UIView *salesProfitContent;
-
- UIView *currencyCapitalContent;
-
- UIView *currentSituationContent;
-
- UIView *payableContent;
-
- UIView *inventoryStatusContent;
-
- UIView *paymentFeesStatusContent;
-
- MyView *procurementStatusV;
-
- UIView *procurementSituationContent;
-
- UIView *titleView;
- UIView *debtSumView;
- UIView *depositAmountView;
- UIView *netMoneyInflowView;
- NSMutableArray *assetDebtyValues;
- NSMutableArray *netMoneyValues;
-
- NSMutableArray *receivableTitleArray;
-
- NSMutableArray *receivableXTitleArray;
-
- NSMutableArray *procurementStatusXTitleArray;
-
- NSMutableArray *procurementStatusTitleArray;
-
- NSMutableArray *inventoryAmountArray;
-
- NSMutableArray *inventoryQuantityArray;
-
- NSMutableArray *procurementStatusYArray;
-
- NSMutableArray *salesIncomeTitleArray;
-
- NSMutableArray *advancePaymentTitleArray;
- NSMutableArray *payableXTitleArray;
- NSMutableArray *inventoryTitleArray;
-
-
- NSMutableArray *paymentFeesXArray;
- NSMutableArray *paymentFeesYArray;
-
- NSMutableArray *paymentFeesYIdArray;
-
-
- NSMutableArray *accountArray;
- NSArray *fncArray;
-
- NSMutableArray *receivablesValuesArray;
-
- NSMutableArray *advancePaymentValuesArray;
- NSInteger height;
- NSInteger innerheight;
- NSString *accountId;
- NSString *accountCode;
- NSInteger topMargin;
- UILabel *lblNetProfitRate;
- UILabel *lblSalesIncome;
- UILabel *lblSalesCost;
- UILabel *lblFeeAmount;
- UILabel *lblNetProfit;
- UILabel *lblSalesMargin;
- UILabel *lblGrossProfitMargin;
- UILabel *lblMonetoryCapitalAmount;
- UILabel *lblCashInHand;
- UILabel *lblBankDeposit;
- UILabel *lblNetMoneyInflow;
- UILabel *lblReceivablesAmount;
- UILabel *lblDepositAmount;
- UILabel *lblAdvancePayment;
- UILabel *lblAccountsPayable;
- UILabel *lblAdvancePaymentAmount;
- UILabel *lblOtherMonetoryCaiptal;
- UILabel *lblReceivablesAdvanceDeposit;
- UILabel *lblInventoryAmount;
- UILabel *lblInventoryQuantity;
- UILabel *lblTitleInventoryAmount;
- UILabel *lblInventoryQuantityTitle;
- UILabel *lblPlanAmount;
- UILabel *lblProcuremmentPercent;
- UILabel *lblProcurementAmount;
- NSString *typeId;
- NSString *moneytoryAssetsDate;
- NSString *procurementStatusDate;
- NSString *paymentFeesDate;
- UIButton *btnFncAccount;
- UIView *advancePayment;
- UIView *netProfitRateView;
- CAShapeLayer *btnCustomMaskLayer;
- CAShapeLayer *btnRecentlyThirtyDaysMaskLayer;
- CAShapeLayer *btnChannelMaskLayer;
- CAShapeLayer *btnDepartmentMaskLayer;
- CAShapeLayer *moneytoryCapitalMaskLayer;
- CAShapeLayer *moneytoryCapitalCurrentMonthMaskLayer;
- CAShapeLayer *currentSituationChannelMaskLayer;
- CAShapeLayer *currentSituationDepartmentMaskLayer;
-
- CAShapeLayer *procurementCustomMonthMaskLayer;
- CAShapeLayer *procurementCurrentMonthMaskLayer;
-
- CAShapeLayer *paymentFeesCustomMonthMaskLayer;
- CAShapeLayer *paymentFeesCurrentMonthMaskLayer;
- UIView *netProfitContent;
- UILabel *lblFeesTotalAmount;
- int count;
- UIView *vDate;
- CustomBorderView *salesProfitBorderV;
- CustomBorderView *currencyCapitalBorderV;
- CustomBorderView *currentSituationBorderV;
- CustomBorderView *payableBorderV;
- CustomBorderView *procurementStatusPieBorderV;
- CustomBorderView *procurementStatusChartBorderV;
-
- CustomBorderView *inventoryStatusBorderV;
-
- CustomBorderView *paymentBorderV;
- int borderLineWidth;
- }
- @end
- @implementation StatisticsDataAnalysisVC
- - (void)viewDidLoad {
- [super viewDidLoad];
- [self loadNavStyle];
- typeId=@"0";
- count=0;
- topMargin=15;
- borderLineWidth=1;
- salesIncomeYValues=[[NSMutableArray alloc]init];
- accountArray=[[NSMutableArray alloc]init];
- salesProfitTitleArray=[[NSMutableArray alloc]init];
- receivablesValuesArray=[[NSMutableArray alloc]init];
- receivableXTitleArray=[[NSMutableArray alloc]init];
- procurementStatusTitleArray=[[NSMutableArray alloc]init];
-
- [procurementStatusTitleArray addObject:@"计划额"];
- [procurementStatusTitleArray addObject:@"完成额"];
- advancePaymentValuesArray=[[NSMutableArray alloc]init];
- procurementStatusYArray=[[NSMutableArray alloc]init];
- payableXTitleArray=[[NSMutableArray alloc]init];
- assetDebtyValues=[[NSMutableArray alloc]init];
- [assetDebtyValues addObject:[NSNumber numberWithDouble:5760392.95]];
- [assetDebtyValues addObject:[NSNumber numberWithDouble:1922981.77]];
-
- netMoneyValues=[[NSMutableArray alloc]init];
- procurementStatusXTitleArray=[[NSMutableArray alloc]init];
- receivableTitleArray=[[NSMutableArray alloc]init];
- [receivableTitleArray addObject:@"应收款"];
- [receivableTitleArray addObject:@"预收款"];
-
- salesIncomeTitleArray=[[NSMutableArray alloc]init];
-
- [salesIncomeTitleArray addObject:@"销售收入金额"];
- [salesIncomeTitleArray addObject:@"销售成本"];
- [salesIncomeTitleArray addObject:@"费用金额"];
- advancePaymentTitleArray=[[NSMutableArray alloc]init];
-
- [advancePaymentTitleArray addObject:@"应付款"];
- [advancePaymentTitleArray addObject:@"预付款"];
-
- inventoryTitleArray=[[NSMutableArray alloc]init];
-
- inventoryAmountArray=[[NSMutableArray alloc]init];
-
- inventoryQuantityArray=[[NSMutableArray alloc]init];
-
- paymentFeesXArray=[[NSMutableArray alloc]init];
- paymentFeesYArray=[[NSMutableArray alloc]init];
- paymentFeesYIdArray=[[NSMutableArray alloc]init];
-
- _salesProfitStartDate =[DateFormat getCurrentDate];
- _salesProfitEndDate=[DateFormat getCurrentDate];
-
- moneytoryAssetsDate=[DateFormat getCurrentNoSeparateMonth];
- procurementStatusDate=[DateFormat getCurrentNoSeparateMonth];
- paymentFeesDate=[DateFormat getCurrentNoSeparateMonth];
- [self initUI];
- [self startLoading];
- [self asyncConcurrent];
-
- }
- #pragma mark - 私有函数
- /**
- 初始化UI
- */
- -(void)initUI
- {
- // titleView = [[UIView alloc]init];
- // titleView.backgroundColor = NavigationBarTintColor;
- // titleView.frame = CGRectMake(0, 0, Screen_Width, 40);
- // UILabel *titleCustom = [[UILabel alloc]init];
- // titleCustom.frame = CGRectMake(Screen_Width/4-35, 10, 70, 25);
- // titleCustom.text = @"自定义";
- // titleCustom.textColor = [UIColor whiteColor];
- // titleCustom.font = [UIFont systemFontOfSize:16];
- // [titleView addSubview:titleCustom];
- // [self.view addSubview:titleView];
- // UIImageView *customImgView=[UIImageView new];
- // customImgView.frame=CGRectMake(CGRectGetMaxX(titleCustom.frame), 10, 25, 25);
- // [customImgView setImage:[UIImage imageNamed:@"drop_down"]];
- // [titleView addSubview:customImgView];
- // UIView *separatorView=[UIView new];
- // separatorView.frame=CGRectMake(Screen_Width/2, 10,2,20);
- // [separatorView setBackgroundColor:[UIColor lightGrayColor]];
- // [titleView addSubview:separatorView];
- //
- // UILabel *titleAll = [[UILabel alloc]init];
- // titleAll.frame = CGRectMake(Screen_Width/4*3, 10, 50, 25);
- // titleAll.text = @"全部";
- // titleAll.textColor = [UIColor whiteColor];
- // titleAll.font = [UIFont systemFontOfSize:16];
- // [titleView addSubview:titleAll];
- //
- // UIImageView *customImgView1=[UIImageView new];
- // customImgView1.frame=CGRectMake(CGRectGetMaxX(titleAll.frame), 10, 25, 25);
- // [customImgView1 setImage:[UIImage imageNamed:@"drop_down"]];
- // [titleView addSubview:customImgView1];
-
- int rowHeight=50;
- height=0;
- content=[UIView new];
- content.frame=CGRectMake(0, 0,Screen_Width,0);
- scroll=[[UIScrollView alloc]init];
- scroll.frame=CGRectMake(0,0, Screen_Width, Screen_Height);
- [self.view addSubview:scroll];
- [scroll addSubview:content];
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_SALES_PROFIT_IPHONE].location!=NSNotFound){
-
- salesProfitContent=[UIView new];
- salesProfitContent.frame=CGRectMake(10, 10,Screen_Width,0);
- salesProfitContent.backgroundColor=[UIColor whiteColor];
-
- [content addSubview:salesProfitContent];
- UIView *profitTitleView = [[UIView alloc]init];
-
- profitTitleView.frame = CGRectMake(0,0 ,Screen_Width, 45);
-
- UIView *profitView=[UIImageView new];
- profitView.frame=CGRectMake(10, 10,10 , 25);
- [profitView setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]];
- [profitTitleView addSubview:profitView];
-
- UILabel *titleProfit = [[UILabel alloc]init];
- titleProfit.frame = CGRectMake(CGRectGetMaxX(profitView.frame)+10, 10, 100, 25);
- titleProfit.text = @"销售利润";
- titleProfit.textColor = [UIColor blackColor];
- titleProfit.font = [UIFont systemFontOfSize:NoDataFontOfSize];
- [profitTitleView addSubview:titleProfit];
- [salesProfitContent addSubview:profitTitleView];
-
- UIView *separator=[UIView new];
- separator.frame=CGRectMake(0,profitTitleView.frame.size.height-1, profitTitleView.frame.size.width-20, 0.5);
- [separator setBackgroundColor:[UIColor lightGrayColor]];
- [profitTitleView addSubview:separator ];
- _btnCustom = [[UIButton alloc] initWithFrame:CGRectMake(Screen_Width/2-175-10,CGRectGetMaxY(profitTitleView.frame)+topMargin, 70, 35)];
- [_btnCustom setTitle:@"自定义" forState:UIControlStateNormal];
- [_btnCustom setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
-
- _btnCustom.titleLabel.font = [UIFont systemFontOfSize: 10.0];
-
- [_btnCustom addTarget:self action:@selector(selectCustomDateData) forControlEvents:UIControlEventTouchUpInside];
- UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:_btnCustom.bounds byRoundingCorners:UIRectCornerTopLeft|UIRectCornerBottomLeft cornerRadii:CGSizeMake(25.0, 25.0)];
- CAShapeLayer *maskLayer = [CAShapeLayer layer];
- maskLayer.frame = _btnCustom.bounds;
- maskLayer.path = maskPath.CGPath;
- _btnCustom.layer.mask = maskLayer;
-
- [salesProfitContent addSubview:_btnCustom];
-
- btnCustomMaskLayer = [CAShapeLayer layer];
- btnCustomMaskLayer.frame = _btnCustom.bounds;
- btnCustomMaskLayer.path = maskPath.CGPath;
- btnCustomMaskLayer.fillColor=[UIColor clearColor].CGColor;
- btnCustomMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
- btnCustomMaskLayer.lineWidth=1;
- [_btnCustom.layer addSublayer:btnCustomMaskLayer];
-
- _btnYesterday = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnCustom.frame),CGRectGetMaxY(profitTitleView.frame)+topMargin, 70, 35)];
-
- [_btnYesterday setTitle:[DateFormat getDateBefore:1] forState:UIControlStateNormal];
- _btnYesterday.layer.cornerRadius=0;
- _btnYesterday.layer.borderWidth=1;
- [_btnYesterday addTarget:self action:@selector(selectYesterdayDateData) forControlEvents:UIControlEventTouchUpInside];
- [_btnYesterday setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
- [_btnYesterday.layer setMasksToBounds:YES];//设置按钮的圆角半径不会被遮挡
- _btnYesterday.layer.borderColor=[UIColor lightGrayColor].CGColor;
-
- _btnYesterday.titleLabel.font = [UIFont systemFontOfSize: 10.0];
-
- [salesProfitContent addSubview:_btnYesterday];
-
- _btnToday = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnYesterday.frame),CGRectGetMaxY(profitTitleView.frame)+topMargin, 70, 35)];
-
- [_btnToday setTitle: [DateFormat getCurrentDate]forState:UIControlStateNormal];
- _btnToday.layer.cornerRadius=0;
- _btnToday.layer.borderWidth=1;
- _btnToday.titleLabel.font = [UIFont systemFontOfSize: 10.0];
- [_btnToday addTarget:self action:@selector(selectTodayDateData) forControlEvents:UIControlEventTouchUpInside];
- [_btnToday setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
- [_btnToday.layer setMasksToBounds:YES];//设置按钮的圆角半径不会被遮挡
- _btnToday.layer.borderColor=[UIColor redColor].CGColor;
- [salesProfitContent addSubview:_btnToday];
-
-
- _btnRecentlySevenDays = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnToday.frame),CGRectGetMaxY(profitTitleView.frame)+topMargin, 70, 35)];
-
- [_btnRecentlySevenDays setTitle:@"近7天" forState:UIControlStateNormal];
-
- _btnRecentlySevenDays.titleLabel.font = [UIFont systemFontOfSize: 10.0];
- _btnRecentlySevenDays.layer.cornerRadius=0;
- _btnRecentlySevenDays.layer.borderWidth=1;
- [_btnRecentlySevenDays addTarget:self action:@selector(selectSevenDaysData) forControlEvents:UIControlEventTouchUpInside];
- [_btnRecentlySevenDays setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
- [_btnRecentlySevenDays.layer setMasksToBounds:YES];//设置按钮的圆角半径不会被遮挡
- _btnRecentlySevenDays.layer.borderColor=[UIColor lightGrayColor].CGColor;
- [salesProfitContent addSubview:_btnRecentlySevenDays];
-
- _btnRecentlyThirtyDays = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnRecentlySevenDays.frame),CGRectGetMaxY(profitTitleView.frame)+topMargin, 70, 35)];
-
-
- [_btnRecentlyThirtyDays setTitle:@"近30天" forState:UIControlStateNormal];
- _btnRecentlyThirtyDays.titleLabel.font = [UIFont systemFontOfSize: 10.0];
- [_btnRecentlyThirtyDays addTarget:self action:@selector(selectThirtyDaysData) forControlEvents:UIControlEventTouchUpInside];
- [_btnRecentlyThirtyDays setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
- UIBezierPath *maskPath2 = [UIBezierPath bezierPathWithRoundedRect:_btnRecentlyThirtyDays.bounds byRoundingCorners:UIRectCornerTopRight|UIRectCornerBottomRight cornerRadii:CGSizeMake(25.0, 25.0)];
- CAShapeLayer *maskLayer2 = [CAShapeLayer layer];
- maskLayer2.frame = _btnRecentlyThirtyDays.bounds;
- maskLayer2.path = maskPath2.CGPath;
- _btnRecentlyThirtyDays.layer.mask = maskLayer2;
-
- [salesProfitContent addSubview:_btnRecentlyThirtyDays];
-
- btnRecentlyThirtyDaysMaskLayer = [CAShapeLayer layer];
- btnRecentlyThirtyDaysMaskLayer.frame = _btnRecentlyThirtyDays.bounds;
- btnRecentlyThirtyDaysMaskLayer.path = maskPath2.CGPath;
- btnRecentlyThirtyDaysMaskLayer.fillColor=[UIColor clearColor].CGColor;
- btnRecentlyThirtyDaysMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
- btnRecentlyThirtyDaysMaskLayer.lineWidth=1;
- [_btnRecentlyThirtyDays.layer addSublayer:btnRecentlyThirtyDaysMaskLayer];
-
- vDate =[UIView new];
- vDate.frame=CGRectMake(0, CGRectGetMaxY(_btnCustom.frame)+topMargin, Screen_Width, 0);
- [salesProfitContent addSubview:vDate];
- vDate.hidden=YES;
- _btnSalesProfitStartDate = [UIButton buttonWithType:UIButtonTypeCustom];
- [_btnSalesProfitStartDate setTitle:_salesProfitStartDate forState:UIControlStateNormal];
- [_btnSalesProfitStartDate setBackgroundColor:[UIColor whiteColor]];
- [_btnSalesProfitStartDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
-
- _btnSalesProfitStartDate.titleLabel.font= [UIFont systemFontOfSize:14];
- [_btnSalesProfitStartDate addTarget:self action:@selector(btnSelectStartDate) forControlEvents:UIControlEventTouchUpInside];
-
- _btnSalesProfitStartDate.frame = CGRectMake(Screen_Width/2-110 ,0 , 100, 25);
- [vDate addSubview:_btnSalesProfitStartDate];
-
- UILabel *separatorLbl=[UILabel new];
- separatorLbl.frame=CGRectMake(CGRectGetMaxX(_btnSalesProfitStartDate.frame), 0, 20, 25);
- separatorLbl.text=@"--";
- separatorLbl.textColor = [UIColor blackColor];
- separatorLbl.font = [UIFont systemFontOfSize: 14];
- [vDate addSubview:separatorLbl];
-
- _btnSalesProfitEndDate = [UIButton buttonWithType:UIButtonTypeCustom];
- [_btnSalesProfitEndDate setTitle:_salesProfitEndDate forState:UIControlStateNormal];
- [_btnSalesProfitEndDate setBackgroundColor:[UIColor whiteColor]];
- [_btnSalesProfitEndDate setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
-
- _btnSalesProfitEndDate.titleLabel.font= [UIFont systemFontOfSize:14];
- [_btnSalesProfitEndDate addTarget:self action:@selector(btnSelectEndDate) forControlEvents:UIControlEventTouchUpInside];
-
- _btnSalesProfitEndDate.frame = CGRectMake(CGRectGetMaxX(separatorLbl.frame) ,0 , 100, 25);
- [vDate addSubview:_btnSalesProfitEndDate];
-
-
-
- netProfitContent =[[UIView alloc]init];
-
- netProfitContent.frame = CGRectMake(0,CGRectGetMaxY(_btnCustom.frame)+topMargin, Screen_Width, 0);
- [salesProfitContent addSubview:netProfitContent];
-
- netProfitRateView= [[UIView alloc]init];
- netProfitRateView.frame = CGRectMake(0,0, Screen_Width, 25);
- UILabel *lblTitleNetProfitRate = [[UILabel alloc]init];
- lblTitleNetProfitRate.frame = CGRectMake(Screen_Width/2-90, 0, 90, 25);
- lblTitleNetProfitRate.text = @"净利率:";
- lblTitleNetProfitRate.textColor = [UIColor redColor];
- lblTitleNetProfitRate.font = [UIFont systemFontOfSize:NoDataFontOfSize];
- [netProfitRateView addSubview:lblTitleNetProfitRate];
-
- lblNetProfitRate = [[UILabel alloc]init];
- lblNetProfitRate.frame = CGRectMake(CGRectGetMaxX(lblTitleNetProfitRate.frame), 0, 150, 25);
- lblNetProfitRate.textColor = [UIColor redColor];
- lblNetProfitRate.text=@"0.00%";
- lblNetProfitRate.font = [UIFont systemFontOfSize:NoDataFontOfSize];
- [netProfitRateView addSubview:lblNetProfitRate];
- [netProfitContent addSubview:netProfitRateView];
-
-
- UIView *salesIncomeView = [[UIView alloc]init];
-
- salesIncomeView.frame = CGRectMake(0,CGRectGetMaxY(netProfitRateView.frame),Screen_Width/2, rowHeight);
- lblSalesIncome= [[UILabel alloc]init];
- lblSalesIncome.frame = CGRectMake(0, 0,salesIncomeView.frame.size.width, 25);
- lblSalesIncome.textAlignment=UITextAlignmentCenter;
- lblSalesIncome.textColor = [UIColor blackColor];
- lblSalesIncome.text=@"0.00";
- lblSalesIncome.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [salesIncomeView addSubview:lblSalesIncome];
-
- UILabel *lblTitleSalesIncome = [[UILabel alloc]init];
- lblTitleSalesIncome.frame = CGRectMake(0,CGRectGetMaxY(lblSalesIncome.frame),salesIncomeView.frame.size.width, 25);
- lblTitleSalesIncome.text = @"销售收入";
- lblTitleSalesIncome.textColor = [UIColor blackColor];
- lblTitleSalesIncome.textAlignment=UITextAlignmentCenter;
- lblTitleSalesIncome.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [salesIncomeView addSubview:lblTitleSalesIncome];
- [netProfitContent addSubview:salesIncomeView];
-
- UIView *salesCostView = [[UIView alloc]init];
-
- salesCostView.frame = CGRectMake(0,CGRectGetMaxY(salesIncomeView.frame)+10, Screen_Width/2, rowHeight);
- lblSalesCost = [[UILabel alloc]init];
- lblSalesCost.frame = CGRectMake(0, 0,salesCostView.frame.size.width, 25);
- lblSalesCost.textAlignment=UITextAlignmentCenter;
- lblSalesCost.textColor = [UIColor blackColor];
- lblSalesCost.text=@"0.00";
- lblSalesCost.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [salesCostView addSubview:lblSalesCost];
-
- UILabel *lblTitleSalesCost = [[UILabel alloc]init];
- lblTitleSalesCost.frame = CGRectMake(0, CGRectGetMaxY(lblSalesCost.frame),salesCostView.frame.size.width , 25);
- lblTitleSalesCost.text = @"销售成本";
- lblTitleSalesCost.textAlignment=UITextAlignmentCenter;
- lblTitleSalesCost.textColor = [UIColor blackColor];
- lblTitleSalesCost.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [salesCostView addSubview:lblTitleSalesCost];
-
- [netProfitContent addSubview:salesCostView];
-
-
- UIView *feeAmountView = [[UIView alloc]init];
-
- feeAmountView.frame = CGRectMake(0,CGRectGetMaxY(salesCostView.frame)+10, Screen_Width/2, rowHeight);
-
- lblFeeAmount = [[UILabel alloc]init];
- lblFeeAmount.frame = CGRectMake(0, 0,feeAmountView.frame.size.width , 25);
- lblFeeAmount.textAlignment=UITextAlignmentCenter;
- lblFeeAmount.textColor = [UIColor blackColor];
- lblFeeAmount.text=@"0.00 ";
- lblFeeAmount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [feeAmountView addSubview:lblFeeAmount];
-
- UILabel *lblTitleFeeAmount = [[UILabel alloc]init];
- lblTitleFeeAmount.frame = CGRectMake(0, CGRectGetMaxY(lblFeeAmount.frame), feeAmountView.frame.size.width, 25);
- lblTitleFeeAmount.text = @"费用金额";
- lblTitleFeeAmount.textAlignment=UITextAlignmentCenter;
- lblTitleFeeAmount.textColor = [UIColor blackColor];
- lblTitleFeeAmount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [feeAmountView addSubview:lblTitleFeeAmount];
-
- [netProfitContent addSubview:feeAmountView];
-
- UIView *middleSeparator=[UIView new];
-
- middleSeparator.frame=CGRectMake(Screen_Width/2, CGRectGetMaxY(netProfitRateView.frame)+topMargin, 0.5, 150);
- middleSeparator.backgroundColor=[UIColor lightGrayColor];
- [netProfitContent addSubview:middleSeparator];
-
-
- UIView *netProfitView = [[UIView alloc]init];
-
- netProfitView.frame = CGRectMake(Screen_Width/2,CGRectGetMaxY(netProfitRateView.frame), Screen_Width/2, rowHeight);
- lblNetProfit = [[UILabel alloc]init];
- lblNetProfit.frame = CGRectMake(0, 0, netProfitView.frame.size.width, 25);
- lblNetProfit.textAlignment=UITextAlignmentCenter;
- lblNetProfit.text=@"0.00";
- lblNetProfit.textColor = [UIColor blackColor];
- lblNetProfit.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [netProfitView addSubview:lblNetProfit];
-
- UILabel *lblNetProfitTitle = [[UILabel alloc]init];
- lblNetProfitTitle.frame = CGRectMake(0,CGRectGetMaxY(lblNetProfit.frame), netProfitView.frame.size.width, 25);
- lblNetProfitTitle.text = @"净利润";
- lblNetProfitTitle.textAlignment=UITextAlignmentCenter;
- lblNetProfitTitle.textColor = [UIColor blackColor];
- lblNetProfitTitle.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [netProfitView addSubview:lblNetProfitTitle];
- [netProfitContent addSubview:netProfitView];
-
-
- UIView *salesMarginView = [[UIView alloc]init];
-
- salesMarginView.frame = CGRectMake(Screen_Width/2,CGRectGetMaxY(netProfitView.frame)+10,Screen_Width/2, rowHeight);
- lblSalesMargin = [[UILabel alloc]init];
- lblSalesMargin.frame = CGRectMake(0, 0,salesMarginView.frame.size.width, 25);
- lblSalesMargin.textAlignment=UITextAlignmentCenter;
- lblSalesMargin.textColor = [UIColor blackColor];
- lblSalesMargin.text=@"0.00";
- lblSalesMargin.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [salesMarginView addSubview:lblSalesMargin];
-
- UILabel *lblSalesMarginTitle = [[UILabel alloc]init];
- lblSalesMarginTitle.frame = CGRectMake(0,CGRectGetMaxY(lblSalesMargin.frame), salesMarginView.frame.size.width, 25);
- lblSalesMarginTitle.text = @"销售毛利";
- lblSalesMarginTitle.textColor = [UIColor blackColor];
- lblSalesMarginTitle.textAlignment=UITextAlignmentCenter;
- lblSalesMarginTitle.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [salesMarginView addSubview:lblSalesMarginTitle];
- [netProfitContent addSubview:salesMarginView];
-
-
- UIView *grossProfitMarginView = [[UIView alloc]init];
-
- grossProfitMarginView.frame = CGRectMake(Screen_Width/2,CGRectGetMaxY(salesMarginView.frame)+10,Screen_Width/2, rowHeight);
- lblGrossProfitMargin = [[UILabel alloc]init];
- lblGrossProfitMargin.frame = CGRectMake(0, 0,grossProfitMarginView.frame.size.width, 25);
- lblGrossProfitMargin.textAlignment=UITextAlignmentCenter;
- lblGrossProfitMargin.textColor = [UIColor blackColor];
- lblGrossProfitMargin.text=@"0.00";
- lblGrossProfitMargin.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [grossProfitMarginView addSubview:lblGrossProfitMargin];
-
- UILabel *lblGrossProfitMarginTitle = [[UILabel alloc]init];
- lblGrossProfitMarginTitle.frame = CGRectMake(0,CGRectGetMaxY(lblGrossProfitMargin.frame), grossProfitMarginView.frame.size.width, 25);
- lblGrossProfitMarginTitle.text = @"毛利率";
- lblGrossProfitMarginTitle.textAlignment=UITextAlignmentCenter;
- lblGrossProfitMarginTitle.textColor = [UIColor blackColor];
- lblGrossProfitMarginTitle.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [grossProfitMarginView addSubview:lblGrossProfitMarginTitle];
- [netProfitContent addSubview:grossProfitMarginView];
-
-
- _btnChannel = [[UIButton alloc] initWithFrame:CGRectMake(Screen_Width/2-70,CGRectGetMaxY(feeAmountView.frame)+topMargin, 70, 35)];
- [_btnChannel setTitle:@"渠道" forState:UIControlStateNormal];
- [_btnChannel setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
- _btnChannel.tag=1000;
- [_btnChannel addTarget:self action:@selector(goSalesProfit:) forControlEvents:UIControlEventTouchUpInside];
- _btnChannel.titleLabel.font = [UIFont systemFontOfSize: 12.0];
- UIBezierPath *maskPath5 = [UIBezierPath bezierPathWithRoundedRect:_btnChannel.bounds byRoundingCorners:UIRectCornerTopLeft|UIRectCornerBottomLeft cornerRadii:CGSizeMake(25.0, 25.0)];
- CAShapeLayer *maskLayer5 = [CAShapeLayer layer];
- maskLayer5.frame = _btnChannel.bounds;
- maskLayer5.path = maskPath5.CGPath;
- _btnChannel.layer.mask = maskLayer5;
-
- [netProfitContent addSubview:_btnChannel];
-
- btnChannelMaskLayer = [CAShapeLayer layer];
- btnChannelMaskLayer.frame = _btnChannel.bounds;
- btnChannelMaskLayer.path = maskPath5.CGPath;
- btnChannelMaskLayer.fillColor=[UIColor clearColor].CGColor;
- btnChannelMaskLayer.strokeColor=[UIColor redColor].CGColor;
- btnChannelMaskLayer.lineWidth=1;
- [_btnChannel.layer addSublayer:btnChannelMaskLayer];
-
- _btnDepartment = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnChannel.frame),CGRectGetMaxY(feeAmountView.frame)+topMargin, 70, 35)];
- [_btnDepartment setTitle:@"部门" forState:UIControlStateNormal];
- [_btnDepartment setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
- _btnDepartment.titleLabel.font = [UIFont systemFontOfSize: 12.0];
- [_btnDepartment addTarget:self action:@selector(goSalesProfit:) forControlEvents:UIControlEventTouchUpInside];
- _btnDepartment.tag=1001;
-
- UIBezierPath *maskPath7 = [UIBezierPath bezierPathWithRoundedRect:_btnDepartment.bounds byRoundingCorners:UIRectCornerTopRight|UIRectCornerBottomRight cornerRadii:CGSizeMake(25.0, 25.0)];
- CAShapeLayer *maskLayer8 = [CAShapeLayer layer];
- maskLayer8.frame = _btnDepartment.bounds;
- maskLayer8.path = maskPath7.CGPath;
- _btnDepartment.layer.mask = maskLayer8;
-
- [netProfitContent addSubview:_btnDepartment];
-
- btnDepartmentMaskLayer = [CAShapeLayer layer];
- btnDepartmentMaskLayer.frame = _btnDepartment.bounds;
- btnDepartmentMaskLayer.path = maskPath7.CGPath;
- btnDepartmentMaskLayer.fillColor=[UIColor clearColor].CGColor;
- btnDepartmentMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
- btnDepartmentMaskLayer.lineWidth=1;
- [_btnDepartment.layer addSublayer:btnDepartmentMaskLayer];
-
- netProfitContent.frame = CGRectMake(0,CGRectGetMaxY(_btnCustom.frame)+10, Screen_Width, CGRectGetMaxY(_btnDepartment.frame));
-
-
- salesProfitBorderV=[CustomBorderView new];
- salesProfitBorderV.frame=CGRectMake(5, CGRectGetMaxY(netProfitContent.frame)+topMargin,Screen_Width-30, 350);
- [salesProfitBorderV setBackgroundColor:[UIColor whiteColor]];
- [salesProfitBorderV drawBoardLine:borderLineWidth cornerRadius:2 color:[UIColor hexColor:@"D5CDCD"]];
- [salesProfitContent addSubview:salesProfitBorderV];
-
- _chartView=[[BarChartView alloc]init];
- _chartView.frame=CGRectMake(0,0,salesProfitBorderV.frame.size.width, 350);
- [salesProfitBorderV addSubview:_chartView];
-
-
-
- salesProfitContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesProfitBorderV.frame)+10);
- height=CGRectGetMaxY(salesProfitContent.frame);
-
- salesProfitContent.layer.cornerRadius=CornerRadius;
- [content addSubview:salesProfitContent];
- }
-
- // UIView *assetDebtTitleView = [[UIView alloc]init];
- //
- // assetDebtTitleView.frame = CGRectMake(0,CGRectGetMaxY(_chartView.frame)+10 ,Screen_Width, 40);
- //
- // UIView *assetDebtView=[UIImageView new];
- // assetDebtView.frame=CGRectMake(10, 10,10 , 25);
- // [assetDebtView setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]];
- // [assetDebtTitleView addSubview:assetDebtView];
- //
- //
- // UILabel *titleAssetsDebt = [[UILabel alloc]init];
- // titleAssetsDebt.frame = CGRectMake(CGRectGetMaxX(assetDebtView.frame)+10, 10, 70, 25);
- // titleAssetsDebt.text = @"资产负债";
- // titleAssetsDebt.textColor = [UIColor blackColor];
- // titleAssetsDebt.font = [UIFont systemFontOfSize:16];
- // [assetDebtTitleView addSubview:titleAssetsDebt];
- // [content addSubview:assetDebtTitleView];
- //
- //
- // _btnAssetsCustom = [[UIButton alloc] initWithFrame:CGRectMake(Screen_Width/2-135,CGRectGetMaxY(assetDebtTitleView.frame)+10, 90, 35)];
- // [_btnAssetsCustom setTitle:@"自定义" forState:UIControlStateNormal];
- // [_btnAssetsCustom setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
- // UIBezierPath *maskPath10 = [UIBezierPath bezierPathWithRoundedRect:_btnAssetsCustom.bounds byRoundingCorners:UIRectCornerTopLeft|UIRectCornerBottomLeft cornerRadii:CGSizeMake(10.0, 10.0)];
- // CAShapeLayer *maskLayer10 = [CAShapeLayer layer];
- // maskLayer10.frame = _btnAssetsCustom.bounds;
- // maskLayer10.path = maskPath10.CGPath;
- // _btnAssetsCustom.layer.mask = maskLayer10;
- //
- // CAShapeLayer *maskLayer12 = [CAShapeLayer layer];
- // maskLayer12.frame = _btnAssetsCustom.bounds;
- // maskLayer12.path = maskPath10.CGPath;
- // maskLayer12.fillColor=[UIColor clearColor].CGColor;
- // maskLayer12.strokeColor=[UIColor lightGrayColor].CGColor;
- // maskLayer12.lineWidth=1;
- // [_btnAssetsCustom.layer addSublayer:maskLayer12];
- //
- // [content addSubview:_btnAssetsCustom];
- //
- // _btnLastYear = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnAssetsCustom.frame),CGRectGetMaxY(assetDebtTitleView.frame)+10, 90, 35)];
- //
- // [_btnLastYear setTitle:@"2020-12" forState:UIControlStateNormal];
- // _btnLastYear.layer.cornerRadius=0;
- // _btnLastYear.layer.borderWidth=1;
- // [_btnLastYear setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
- // [_btnLastYear.layer setMasksToBounds:YES];//设置按钮的圆角半径不会被遮挡
- // _btnLastYear.layer.borderColor=[UIColor lightGrayColor].CGColor;
- // [content addSubview:_btnLastYear];
- //
- // _btnThisYear = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnLastYear.frame),CGRectGetMaxY(assetDebtTitleView.frame)+10, 90, 35)];
- // [_btnThisYear setTitle:@"本年" forState:UIControlStateNormal];
- // [_btnThisYear setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
- // UIBezierPath *maskPath11 = [UIBezierPath bezierPathWithRoundedRect:_btnThisYear.bounds byRoundingCorners:UIRectCornerTopRight|UIRectCornerBottomRight cornerRadii:CGSizeMake(10.0, 10.0)];
- // CAShapeLayer *maskLayer11 = [CAShapeLayer layer];
- // maskLayer11.frame = _btnThisYear.bounds;
- // maskLayer11.path = maskPath11.CGPath;
- // _btnThisYear.layer.mask = maskLayer11;
- //
- // CAShapeLayer *maskLayer13 = [CAShapeLayer layer];
- // maskLayer13.frame = _btnThisYear.bounds;
- // maskLayer13.path = maskPath11.CGPath;
- // maskLayer13.fillColor=[UIColor clearColor].CGColor;
- // maskLayer13.strokeColor=[UIColor lightGrayColor].CGColor;
- // maskLayer13.lineWidth=1;
- // [_btnThisYear.layer addSublayer:maskLayer13];
- //
- // [content addSubview:_btnThisYear];
- //
- //
- // UIView *debtRatioView = [[UIView alloc]init];
- //
- // debtRatioView.frame = CGRectMake(0,CGRectGetMaxY(_btnAssetsCustom.frame)+5, Screen_Width, 40);
- // UILabel *lblTitleDebtRatio = [[UILabel alloc]init];
- // lblTitleDebtRatio.frame = CGRectMake(Screen_Width/2-70, 10, 70, 25);
- // lblTitleDebtRatio.text = @"负债率:";
- // lblTitleDebtRatio.textColor = [UIColor redColor];
- // lblTitleDebtRatio.font = [UIFont systemFontOfSize:16];
- // [debtRatioView addSubview:lblTitleDebtRatio];
- //
- // UILabel *lblDebtRatio = [[UILabel alloc]init];
- // lblDebtRatio.frame = CGRectMake(CGRectGetMaxX(lblTitleDebtRatio.frame), 10, 70, 25);
- // lblDebtRatio.text = @"42.45%";
- // lblDebtRatio.textColor = [UIColor redColor];
- // lblDebtRatio.font = [UIFont systemFontOfSize:16];
- // [debtRatioView addSubview:lblDebtRatio];
- // [content addSubview:debtRatioView];
- //
- //
- // UIView *assetsTotalView = [[UIView alloc]init];
- //
- // assetsTotalView.frame = CGRectMake(0,CGRectGetMaxY(debtRatioView.frame)+5, 100, 60);
- // UILabel *lblAssetsTotal = [[UILabel alloc]init];
- // lblAssetsTotal.frame = CGRectMake(Screen_Width/4-35, 10, 200, 25);
- // lblAssetsTotal.text = @"7683374.82";
- // lblAssetsTotal.textColor = [UIColor blackColor];
- // lblAssetsTotal.font = [UIFont systemFontOfSize:16];
- // [assetsTotalView addSubview:lblAssetsTotal];
- //
- // UILabel *lblTitleAssetsTotal = [[UILabel alloc]init];
- // lblTitleAssetsTotal.frame = CGRectMake(Screen_Width/4-35,CGRectGetMaxY(lblAssetsTotal.frame), 100, 25);
- // lblTitleAssetsTotal.text = @"资产总计";
- // lblTitleAssetsTotal.textColor = [UIColor blackColor];
- // lblTitleAssetsTotal.font = [UIFont systemFontOfSize:16];
- // [assetsTotalView addSubview:lblTitleAssetsTotal];
- // [content addSubview:assetsTotalView];
- //
- //
- // UIView *middleSeparator1=[UIView new];
- //
- // middleSeparator1.frame=CGRectMake(Screen_Width/2, CGRectGetMaxY(debtRatioView.frame)+15, 3, 60);
- // middleSeparator1.backgroundColor=[UIColor lightGrayColor];
- // [content addSubview:middleSeparator1];
- //
- //
- // debtSumView = [[UIView alloc]init];
- //
- // debtSumView.frame = CGRectMake(Screen_Width/4*3,CGRectGetMaxY(debtRatioView.frame)+5, 200, 60);
- // UILabel *lblDebtSum = [[UILabel alloc]init];
- // lblDebtSum.frame = CGRectMake(0, 10, 150, 25);
- // lblDebtSum.text = @"3261302.77";
- // lblDebtSum.textColor = [UIColor blackColor];
- // lblDebtSum.font = [UIFont systemFontOfSize:16];
- // [debtSumView addSubview:lblDebtSum];
- //
- // UILabel *lblDebtSumTitle = [[UILabel alloc]init];
- // lblDebtSumTitle.frame = CGRectMake(0,CGRectGetMaxY(lblDebtSum.frame), 200, 25);
- // lblDebtSumTitle.text = @"负债总额";
- // lblDebtSumTitle.textColor = [UIColor blackColor];
- // lblDebtSumTitle.font = [UIFont systemFontOfSize:16];
- // [debtSumView addSubview:lblDebtSumTitle];
- // [content addSubview:debtSumView];
- // height=CGRectGetMaxY(assetsTotalView.frame)+10;
- // AssetDebtAxisValueFormatter *debtAxisValueFormatter=[[AssetDebtAxisValueFormatter alloc]init];
- // [self drawSingleBarchart:assetDebtyValues height:height axisValueFormatter:debtAxisValueFormatter xAxisLabelCount:2];
-
-
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_MONETORY_CAPITAL_IPHONE].location!=NSNotFound){
- currencyCapitalContent=[UIView new];
- currencyCapitalContent.backgroundColor=[UIColor whiteColor];
- currencyCapitalContent.frame=CGRectMake(10,height+10, Screen_Width-20, 0);
- [content addSubview:currencyCapitalContent];
- UIView *monetoryCaiptalTitleView = [[UIView alloc]init];
-
- monetoryCaiptalTitleView.frame = CGRectMake(0,0 ,Screen_Width, 45);
-
- UIView *monetoryCapitalView=[UIImageView new];
- monetoryCapitalView.frame=CGRectMake(10, 10,10 , 25);
- [monetoryCapitalView setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]];
- [monetoryCaiptalTitleView addSubview:monetoryCapitalView];
-
-
- UILabel *titleMonetoryCapital = [[UILabel alloc]init];
- titleMonetoryCapital.frame = CGRectMake(CGRectGetMaxX(monetoryCapitalView.frame)+10, 10, 90, 25);
- titleMonetoryCapital.text = @"货币资金";
- titleMonetoryCapital.textColor = [UIColor blackColor];
- titleMonetoryCapital.font = [UIFont systemFontOfSize:NoDataFontOfSize];
- [monetoryCaiptalTitleView addSubview:titleMonetoryCapital];
-
-
- UIView *separator1=[UIView new];
- separator1.frame=CGRectMake(0,monetoryCaiptalTitleView.frame.size.height-1, monetoryCaiptalTitleView.frame.size.width-20, 0.5);
- [separator1 setBackgroundColor:[UIColor lightGrayColor]];
- [monetoryCaiptalTitleView addSubview:separator1 ];
- [currencyCapitalContent addSubview:monetoryCaiptalTitleView];
-
-
- _btnMonetoryCaitalCustom = [[UIButton alloc] initWithFrame:CGRectMake(Screen_Width/2-90,CGRectGetMaxY(monetoryCaiptalTitleView.frame)+topMargin, 70, 35)];
- [_btnMonetoryCaitalCustom setTitle:@"自定义" forState:UIControlStateNormal];
- [_btnMonetoryCaitalCustom setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
- _btnMonetoryCaitalCustom.titleLabel.font = [UIFont systemFontOfSize: 12.0];
- [_btnMonetoryCaitalCustom addTarget:self action:@selector(selectCustomDate) forControlEvents:UIControlEventTouchUpInside];
- UIBezierPath *maskPath13 = [UIBezierPath bezierPathWithRoundedRect:_btnMonetoryCaitalCustom.bounds byRoundingCorners:UIRectCornerTopLeft|UIRectCornerBottomLeft cornerRadii:CGSizeMake(25.0, 25.0)];
- CAShapeLayer *maskLayer14 = [CAShapeLayer layer];
- maskLayer14.frame = _btnAssetsCustom.bounds;
- maskLayer14.path = maskPath13.CGPath;
- _btnMonetoryCaitalCustom.layer.mask = maskLayer14;
-
- moneytoryCapitalMaskLayer= [CAShapeLayer layer];
- moneytoryCapitalMaskLayer.frame = _btnMonetoryCaitalCustom.bounds;
- moneytoryCapitalMaskLayer.path = maskPath13.CGPath;
- moneytoryCapitalMaskLayer.fillColor=[UIColor clearColor].CGColor;
- moneytoryCapitalMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
- moneytoryCapitalMaskLayer.lineWidth=1;
- [_btnMonetoryCaitalCustom.layer addSublayer:moneytoryCapitalMaskLayer];
-
- [currencyCapitalContent addSubview:_btnMonetoryCaitalCustom];
-
-
- _btnMonetoryCaitalCurrentMonth = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnMonetoryCaitalCustom.frame),CGRectGetMaxY(monetoryCaiptalTitleView.frame)+topMargin, 70, 35)];
- _btnMonetoryCaitalCurrentMonth.titleLabel.font = [UIFont systemFontOfSize: 12.0];
- [_btnMonetoryCaitalCurrentMonth setTitle:[DateFormat getCurrentMonth] forState:UIControlStateNormal];
- [_btnMonetoryCaitalCurrentMonth setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
-
- [_btnMonetoryCaitalCurrentMonth addTarget:self action:@selector(getMoneytoryAssetsCurrentMonth) forControlEvents:UIControlEventTouchUpInside];
-
-
- UIBezierPath *maskPath14 = [UIBezierPath bezierPathWithRoundedRect:_btnMonetoryCaitalCurrentMonth.bounds byRoundingCorners:UIRectCornerTopRight|UIRectCornerBottomRight cornerRadii:CGSizeMake(25.0, 25.0)];
- CAShapeLayer *maskLayer15 = [CAShapeLayer layer];
- maskLayer15.frame = _btnMonetoryCaitalCurrentMonth.bounds;
- maskLayer15.path = maskPath14.CGPath;
- _btnMonetoryCaitalCurrentMonth.layer.mask = maskLayer15;
-
- moneytoryCapitalCurrentMonthMaskLayer= [CAShapeLayer layer];
- moneytoryCapitalCurrentMonthMaskLayer.frame = _btnMonetoryCaitalCurrentMonth.bounds;
- moneytoryCapitalCurrentMonthMaskLayer.path = maskPath14.CGPath;
- moneytoryCapitalCurrentMonthMaskLayer.fillColor=[UIColor clearColor].CGColor;
- moneytoryCapitalCurrentMonthMaskLayer.strokeColor=[UIColor redColor].CGColor;
- moneytoryCapitalCurrentMonthMaskLayer.lineWidth=1;
- [_btnMonetoryCaitalCurrentMonth.layer addSublayer:moneytoryCapitalCurrentMonthMaskLayer];
-
- [currencyCapitalContent addSubview:_btnMonetoryCaitalCurrentMonth];
-
-
- UIView *monetoryCapitalAmountView = [[UIView alloc]init];
-
- monetoryCapitalAmountView.frame = CGRectMake(0,CGRectGetMaxY(_btnMonetoryCaitalCustom.frame)+topMargin, Screen_Width, 25);
- UILabel *lblTitleMonetoryCapitalAmount = [[UILabel alloc]init];
- lblTitleMonetoryCapitalAmount.frame = CGRectMake(Screen_Width/2-110, 0, 110, 25);
- lblTitleMonetoryCapitalAmount.text = @"货币资金:";
- lblTitleMonetoryCapitalAmount.textColor = [UIColor redColor];
- lblTitleMonetoryCapitalAmount.font = [UIFont systemFontOfSize:NoDataFontOfSize];
- [monetoryCapitalAmountView addSubview:lblTitleMonetoryCapitalAmount];
-
- lblMonetoryCapitalAmount= [[UILabel alloc]init];
- lblMonetoryCapitalAmount.frame = CGRectMake(CGRectGetMaxX(lblTitleMonetoryCapitalAmount.frame), 0, 150, 25);
- lblMonetoryCapitalAmount.text=@"0.00";
- lblMonetoryCapitalAmount.textColor = [UIColor redColor];
- lblMonetoryCapitalAmount.font = [UIFont systemFontOfSize:NoDataFontOfSize];
- [monetoryCapitalAmountView addSubview:lblMonetoryCapitalAmount];
- [currencyCapitalContent addSubview:monetoryCapitalAmountView];
-
-
- UIView *cashInHandView = [[UIView alloc]init];
-
- cashInHandView.frame = CGRectMake(0,CGRectGetMaxY(monetoryCapitalAmountView.frame)+topMargin, Screen_Width/3, rowHeight);
- lblCashInHand= [[UILabel alloc]init];
- lblCashInHand.frame = CGRectMake(0, 0, cashInHandView.frame.size.width, 25);
- lblCashInHand.text = @"0.00";
- lblCashInHand.textAlignment=UITextAlignmentCenter;
- lblCashInHand.textColor = [UIColor blackColor];
- lblCashInHand.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [cashInHandView addSubview:lblCashInHand];
-
- UILabel *lblTitleCashInHand = [[UILabel alloc]init];
- lblTitleCashInHand.frame = CGRectMake(0,CGRectGetMaxY(lblCashInHand.frame), cashInHandView.frame.size.width, 25);
- lblTitleCashInHand.text = @"库存现金";
- lblTitleCashInHand.textAlignment=UITextAlignmentCenter;
- lblTitleCashInHand.textColor = [UIColor blackColor];
- lblTitleCashInHand.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [cashInHandView addSubview:lblTitleCashInHand];
- [currencyCapitalContent addSubview:cashInHandView];
-
-
- UIView *bankDepositView = [[UIView alloc]init];
-
- bankDepositView.frame = CGRectMake(Screen_Width/3,CGRectGetMaxY(monetoryCapitalAmountView.frame)+topMargin, Screen_Width/3, rowHeight);
- lblBankDeposit = [[UILabel alloc]init];
- lblBankDeposit.frame = CGRectMake(0, 0, bankDepositView.frame.size.width, 25);
- lblBankDeposit.text = @"0.00";
- lblBankDeposit.textAlignment=UITextAlignmentCenter;
- lblBankDeposit.textColor = [UIColor blackColor];
- lblBankDeposit.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [bankDepositView addSubview:lblBankDeposit];
-
- UILabel *lblTitleBankDeposit = [[UILabel alloc]init];
- lblTitleBankDeposit.frame = CGRectMake(0,CGRectGetMaxY(lblBankDeposit.frame), bankDepositView.frame.size.width, 25);
- lblTitleBankDeposit.text = @"银行存款";
- lblTitleBankDeposit.textColor = [UIColor blackColor];
- lblTitleBankDeposit.textAlignment=UITextAlignmentCenter;
- lblTitleBankDeposit.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [bankDepositView addSubview:lblTitleBankDeposit];
- [currencyCapitalContent addSubview:bankDepositView];
-
-
-
- UIView *otherMonetoryCaiptalView = [[UIView alloc]init];
-
- otherMonetoryCaiptalView.frame = CGRectMake(Screen_Width/3*2-10,CGRectGetMaxY(monetoryCapitalAmountView.frame)+topMargin, Screen_Width/3+10, rowHeight);
- lblOtherMonetoryCaiptal = [[UILabel alloc]init];
- lblOtherMonetoryCaiptal.frame = CGRectMake(0, 0, otherMonetoryCaiptalView.frame.size.width, 25);
- lblOtherMonetoryCaiptal.textAlignment=UITextAlignmentCenter;
- lblOtherMonetoryCaiptal.textColor = [UIColor blackColor];
- lblOtherMonetoryCaiptal.text=@"0.00";
- lblOtherMonetoryCaiptal.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [otherMonetoryCaiptalView addSubview:lblOtherMonetoryCaiptal];
-
- UILabel *lblTitleOtherMonetoryCaiptal = [[UILabel alloc]init];
- lblTitleOtherMonetoryCaiptal.frame = CGRectMake(0,CGRectGetMaxY(lblOtherMonetoryCaiptal.frame), otherMonetoryCaiptalView.frame.size.width, 25);
- lblTitleOtherMonetoryCaiptal.text = @"其他货币资金";
- lblTitleOtherMonetoryCaiptal.textColor = [UIColor blackColor];
- lblTitleOtherMonetoryCaiptal.textAlignment=UITextAlignmentCenter;
- lblTitleOtherMonetoryCaiptal.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [otherMonetoryCaiptalView addSubview:lblTitleOtherMonetoryCaiptal];
- [currencyCapitalContent addSubview:otherMonetoryCaiptalView];
-
-
- netMoneyInflowView = [[UIView alloc]init];
- netMoneyInflowView.frame = CGRectMake(0,CGRectGetMaxY(cashInHandView.frame)+topMargin, Screen_Width, 25);
- UILabel *lblTitleNetMoneyInflow = [[UILabel alloc]init];
- lblTitleNetMoneyInflow.frame = CGRectMake(Screen_Width/2-130, 0, 130, 25);
- lblTitleNetMoneyInflow.text = @"货币净流入:";
- lblTitleNetMoneyInflow.textColor = [UIColor redColor];
- lblTitleNetMoneyInflow.font = [UIFont systemFontOfSize:NoDataFontOfSize];
- [netMoneyInflowView addSubview:lblTitleNetMoneyInflow];
-
- lblNetMoneyInflow = [[UILabel alloc]init];
- lblNetMoneyInflow.frame = CGRectMake(CGRectGetMaxX(lblTitleNetMoneyInflow.frame), 0, 150, 25);
- lblNetMoneyInflow.textColor = [UIColor redColor];
- lblNetMoneyInflow.text=@"0.00";
- lblNetMoneyInflow.font = [UIFont systemFontOfSize:NoDataFontOfSize];
- [netMoneyInflowView addSubview:lblNetMoneyInflow];
- [currencyCapitalContent addSubview:netMoneyInflowView];
-
-
- currencyCapitalBorderV=[CustomBorderView new];
- currencyCapitalBorderV.frame=CGRectMake(5, CGRectGetMaxY(netMoneyInflowView.frame)+topMargin,Screen_Width-30, 350);
- [currencyCapitalBorderV setBackgroundColor:[UIColor whiteColor]];
- [currencyCapitalBorderV drawBoardLine:borderLineWidth cornerRadius:2 color:[UIColor hexColor:@"D5CDCD"]];
- [currencyCapitalContent addSubview:currencyCapitalBorderV];
-
- _singleChartView=[[BarChartView alloc]init];
- _singleChartView.frame=CGRectMake(0,0,currencyCapitalBorderV.frame.size.width, 350);
- [currencyCapitalBorderV addSubview:_singleChartView];
- currencyCapitalContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(currencyCapitalBorderV.frame));
- height=CGRectGetMaxY(currencyCapitalContent.frame);
- currencyCapitalContent.layer.cornerRadius=CornerRadius;
- }
-
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_CURRENT_IPHONE].location!=NSNotFound){
- //往来情况
- currentSituationContent=[UIView new];
- currentSituationContent.backgroundColor=[UIColor whiteColor];
- currentSituationContent.frame=CGRectMake(10,height+10, Screen_Width-20, 0);
- [content addSubview:currentSituationContent];
-
-
- UIView *currentSituationTitleView = [[UIView alloc]init];
-
- currentSituationTitleView.frame = CGRectMake(0,0 ,Screen_Width, 45);
-
- UIView *currentSituationView=[UIImageView new];
- currentSituationView.frame=CGRectMake(10, 10,10 , 25);
- [currentSituationView setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]];
- [currentSituationTitleView addSubview:currentSituationView];
-
-
- UILabel *titleCurrentSituation = [[UILabel alloc]init];
- titleCurrentSituation.frame = CGRectMake(CGRectGetMaxX(currentSituationView.frame)+10, 10, 90, 25);
- titleCurrentSituation.text = @"往来情况";
- titleCurrentSituation.textColor = [UIColor blackColor];
- titleCurrentSituation.font = [UIFont systemFontOfSize:NoDataFontOfSize];
- [currentSituationTitleView addSubview:titleCurrentSituation];
-
- UIView *separator3=[UIView new];
- separator3.frame=CGRectMake(0,currentSituationTitleView.frame.size.height-1, currentSituationTitleView.frame.size.width-20, 0.5);
- [separator3 setBackgroundColor:[UIColor lightGrayColor]];
- [currentSituationTitleView addSubview:separator3 ];
-
- [currentSituationContent addSubview:currentSituationTitleView];
-
-
- _btnCurrentChannel = [[UIButton alloc] initWithFrame:CGRectMake(Screen_Width/2-70,CGRectGetMaxY(currentSituationTitleView.frame)+topMargin, 70, 35)];
- [_btnCurrentChannel setTitle:@"渠道" forState:UIControlStateNormal];
- [_btnCurrentChannel setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
- _btnCurrentChannel.tag=1002;
- _btnCurrentChannel.titleLabel.font = [UIFont systemFontOfSize: 12.0];
- [_btnCurrentChannel addTarget:self action:@selector(goCurrentSituation:) forControlEvents:UIControlEventTouchUpInside];
- UIBezierPath *maskPath19 = [UIBezierPath bezierPathWithRoundedRect:_btnCurrentChannel.bounds byRoundingCorners:UIRectCornerTopLeft|UIRectCornerBottomLeft cornerRadii:CGSizeMake(25.0, 25.0)];
- CAShapeLayer *maskLayer19 = [CAShapeLayer layer];
- maskLayer19.frame = _btnCurrentChannel.bounds;
- maskLayer19.path = maskPath19.CGPath;
- _btnCurrentChannel.layer.mask = maskLayer19;
-
- [currentSituationContent addSubview:_btnCurrentChannel];
-
- currentSituationChannelMaskLayer = [CAShapeLayer layer];
- currentSituationChannelMaskLayer.frame = _btnCurrentChannel.bounds;
- currentSituationChannelMaskLayer.path = maskPath19.CGPath;
- currentSituationChannelMaskLayer.fillColor=[UIColor clearColor].CGColor;
- currentSituationChannelMaskLayer.strokeColor=[UIColor redColor].CGColor;
- currentSituationChannelMaskLayer.lineWidth=1;
- [_btnCurrentChannel.layer addSublayer:currentSituationChannelMaskLayer];
-
- _btnCurrentDepartment = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnCurrentChannel.frame),CGRectGetMaxY(currentSituationTitleView.frame)+topMargin, 70, 35)];
- [_btnCurrentDepartment setTitle:@"部门" forState:UIControlStateNormal];
-
- _btnCurrentDepartment.tag=1003;
- [_btnCurrentDepartment addTarget:self action:@selector(goCurrentSituation:) forControlEvents:UIControlEventTouchUpInside];
- [_btnCurrentDepartment setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
-
- _btnCurrentDepartment.titleLabel.font = [UIFont systemFontOfSize: 12.0];
- UIBezierPath *maskPath20 = [UIBezierPath bezierPathWithRoundedRect:_btnCurrentDepartment.bounds byRoundingCorners:UIRectCornerTopRight|UIRectCornerBottomRight cornerRadii:CGSizeMake(25.0, 25.0)];
- CAShapeLayer *maskLayer21 = [CAShapeLayer layer];
- maskLayer21.frame = _btnCurrentDepartment.bounds;
- maskLayer21.path = maskPath20.CGPath;
- _btnCurrentDepartment.layer.mask = maskLayer21;
-
- [currentSituationContent addSubview:_btnCurrentDepartment];
-
- currentSituationDepartmentMaskLayer = [CAShapeLayer layer];
- currentSituationDepartmentMaskLayer.frame = _btnCurrentDepartment.bounds;
- currentSituationDepartmentMaskLayer.path = maskPath20.CGPath;
- currentSituationDepartmentMaskLayer.fillColor=[UIColor clearColor].CGColor;
- currentSituationDepartmentMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
- currentSituationDepartmentMaskLayer.lineWidth=1;
- [_btnCurrentDepartment.layer addSublayer:currentSituationDepartmentMaskLayer];
-
-
-
- UIView *receivablesAmountView = [[UIView alloc]init];
-
- receivablesAmountView.frame = CGRectMake(0,CGRectGetMaxY(_btnCurrentChannel.frame)+topMargin, Screen_Width/2, rowHeight);
-
- lblReceivablesAmount= [[UILabel alloc]init];
- lblReceivablesAmount.frame = CGRectMake(0, 0, receivablesAmountView.frame.size.width, 25);
- lblReceivablesAmount.text = @"0.00";
- lblReceivablesAmount.textAlignment=UITextAlignmentCenter;
- lblReceivablesAmount.textColor = [UIColor blackColor];
- lblReceivablesAmount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [receivablesAmountView addSubview:lblReceivablesAmount];
-
- UILabel *lblTitleReceivablesAmount = [[UILabel alloc]init];
- lblTitleReceivablesAmount.frame = CGRectMake(0,CGRectGetMaxY(lblReceivablesAmount.frame), receivablesAmountView.frame.size.width, 25);
- lblTitleReceivablesAmount.text = @"应收款金额";
- lblTitleReceivablesAmount.textColor = [UIColor blackColor];
- lblTitleReceivablesAmount.textAlignment=UITextAlignmentCenter;
- lblTitleReceivablesAmount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [receivablesAmountView addSubview:lblTitleReceivablesAmount];
- [currentSituationContent addSubview:receivablesAmountView];
-
-
- UIView *depositAmountView = [[UIView alloc]init];
-
- depositAmountView.frame = CGRectMake(0,CGRectGetMaxY(receivablesAmountView.frame)+10, Screen_Width/2, rowHeight);
-
- lblDepositAmount = [[UILabel alloc]init];
- lblDepositAmount.frame = CGRectMake(0, 0, depositAmountView.frame.size.width, 25);
- lblDepositAmount.text = @"0.00";
- lblDepositAmount.textAlignment=UITextAlignmentCenter;
- lblDepositAmount.textColor = [UIColor blackColor];
- lblDepositAmount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [depositAmountView addSubview:lblDepositAmount];
-
- UILabel *lblTitleDepositAmount = [[UILabel alloc]init];
- lblTitleDepositAmount.frame = CGRectMake(0,CGRectGetMaxY(lblDepositAmount.frame), depositAmountView.frame.size.width, 25);
- lblTitleDepositAmount.text = @"定金金额";
- lblTitleDepositAmount.textAlignment=UITextAlignmentCenter;
- lblTitleDepositAmount.textColor = [UIColor blackColor];
- lblTitleDepositAmount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [depositAmountView addSubview:lblTitleDepositAmount];
- [currentSituationContent addSubview:depositAmountView];
-
-
- UIView *middleSeparator2=[UIView new];
-
- middleSeparator2.frame=CGRectMake(Screen_Width/2, CGRectGetMaxY(_btnCurrentChannel.frame)+topMargin,0.5, 110);
- middleSeparator2.backgroundColor=[UIColor lightGrayColor];
- [currentSituationContent addSubview:middleSeparator2];
-
-
- advancePayment= [[UIView alloc]init];
-
- advancePayment.frame = CGRectMake(Screen_Width/2,CGRectGetMaxY(_btnCurrentChannel.frame)+topMargin, Screen_Width/2, rowHeight);
- lblAdvancePayment= [[UILabel alloc]init];
- lblAdvancePayment.frame = CGRectMake(0, 0, advancePayment.frame.size.width, 25);
- lblAdvancePayment.textAlignment=UITextAlignmentCenter;
- lblAdvancePayment.text=@"0.00";
- lblAdvancePayment.textColor = [UIColor blackColor];
- lblAdvancePayment.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [advancePayment addSubview:lblAdvancePayment];
-
- UILabel *lblAdvancePaymentTitle = [[UILabel alloc]init];
- lblAdvancePaymentTitle.frame = CGRectMake(0,CGRectGetMaxY(lblAdvancePayment.frame), advancePayment.frame.size.width, 25);
- lblAdvancePaymentTitle.text = @"预收款金额";
- lblAdvancePaymentTitle.textAlignment=UITextAlignmentCenter;
- lblAdvancePaymentTitle.textColor = [UIColor blackColor];
- lblAdvancePaymentTitle.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [advancePayment addSubview:lblAdvancePaymentTitle];
- [currentSituationContent addSubview:advancePayment];
-
-
- UIView *receivablesAdvanceDepositView = [[UIView alloc]init];
-
- receivablesAdvanceDepositView.frame = CGRectMake(Screen_Width/2,CGRectGetMaxY(advancePayment.frame)+10, Screen_Width/2, rowHeight);
- lblReceivablesAdvanceDeposit = [[UILabel alloc]init];
- lblReceivablesAdvanceDeposit.frame = CGRectMake(0, 0, receivablesAdvanceDepositView.frame.size.width, 25);
- lblReceivablesAdvanceDeposit.textAlignment=UITextAlignmentCenter;
- lblReceivablesAdvanceDeposit.text=@"0.00";
- lblReceivablesAdvanceDeposit.textColor = [UIColor blackColor];
- lblReceivablesAdvanceDeposit.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [receivablesAdvanceDepositView addSubview:lblReceivablesAdvanceDeposit];
-
- UILabel *lblReceivablesAdvanceDepositTitle = [[UILabel alloc]init];
- lblReceivablesAdvanceDepositTitle.frame = CGRectMake(0,CGRectGetMaxY(lblReceivablesAdvanceDeposit.frame),receivablesAdvanceDepositView.frame.size.width, 25);
- lblReceivablesAdvanceDepositTitle.text = @"应收-预收-定金";
- lblReceivablesAdvanceDepositTitle.textColor = [UIColor blackColor];
- lblReceivablesAdvanceDepositTitle.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- lblReceivablesAdvanceDepositTitle.textAlignment=UITextAlignmentCenter;
- [receivablesAdvanceDepositView addSubview:lblReceivablesAdvanceDepositTitle];
- [currentSituationContent addSubview:receivablesAdvanceDepositView];
-
-
- currentSituationBorderV=[CustomBorderView new];
- currentSituationBorderV.frame=CGRectMake(5, CGRectGetMaxY(depositAmountView.frame)+topMargin,Screen_Width-30, 350);
- [currentSituationBorderV setBackgroundColor:[UIColor whiteColor]];
- [currentSituationBorderV drawBoardLine:borderLineWidth cornerRadius:2 color:[UIColor hexColor:@"D5CDCD"]];
-
- [currentSituationContent addSubview:currentSituationBorderV];
- _currentSituationChartView=[[BarChartView alloc]init];
- _currentSituationChartView.frame=CGRectMake(0, 0,currentSituationBorderV.frame.size.width, 350);
- [currentSituationBorderV addSubview:_currentSituationChartView];
-
- currentSituationContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(currentSituationBorderV.frame)+10);
- height=CGRectGetMaxY(currentSituationContent.frame);
-
- currentSituationContent.layer.cornerRadius=CornerRadius;
- }
-
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_PAYABLE_IPHONE].location!=NSNotFound){
- //应付
- payableContent=[UIView new];
- payableContent.backgroundColor=[UIColor whiteColor];
- payableContent.frame=CGRectMake(10,height+10, Screen_Width-20, 0);
- [content addSubview:payableContent];
- UIView *accountPayableTitleView = [[UIView alloc]init];
-
- accountPayableTitleView.frame = CGRectMake(0,10 ,Screen_Width, 45);
-
- UIView *accountPayableView=[UIImageView new];
- accountPayableView.frame=CGRectMake(10, 10,10 , 25);
- [accountPayableView setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]];
- [accountPayableTitleView addSubview:accountPayableView];
- UILabel *titleAccountPayable = [[UILabel alloc]init];
- titleAccountPayable.frame = CGRectMake(CGRectGetMaxX(accountPayableView.frame)+10, 10, 90, 25);
- titleAccountPayable.text = @"应付情况";
- titleAccountPayable.textColor = [UIColor blackColor];
- titleAccountPayable.font = [UIFont systemFontOfSize:NoDataFontOfSize];
- [accountPayableTitleView addSubview:titleAccountPayable];
-
- UIView *separator4=[UIView new];
- separator4.frame=CGRectMake(0,accountPayableTitleView.frame.size.height-1, accountPayableTitleView.frame.size.width-20, 0.5);
- [separator4 setBackgroundColor:[UIColor lightGrayColor]];
- [accountPayableTitleView addSubview:separator4 ];
- [payableContent addSubview:accountPayableTitleView];
-
-
- UIView *accountsPayableView = [[UIView alloc]init];
-
- accountsPayableView.frame = CGRectMake(0,CGRectGetMaxY(accountPayableTitleView.frame)+topMargin,Screen_Width/2, rowHeight);
-
- [payableContent addSubview:accountsPayableView];
-
- lblAccountsPayable = [[UILabel alloc]init];
- lblAccountsPayable.frame = CGRectMake(0, 0,accountsPayableView.frame.size.width, 25);
- lblAccountsPayable.textAlignment=NSTextAlignmentCenter;
- lblAccountsPayable.text=@"0.00";
- lblAccountsPayable.textColor = [UIColor blackColor];
- lblAccountsPayable.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [accountsPayableView addSubview:lblAccountsPayable];
-
- UILabel *lblTitleAccountsPayable = [[UILabel alloc]init];
- lblTitleAccountsPayable.frame = CGRectMake(0,CGRectGetMaxY(lblAccountsPayable.frame),Screen_Width/2, 25);
- lblTitleAccountsPayable.text = @"应付款金额";
- lblTitleAccountsPayable.textAlignment=NSTextAlignmentCenter;
- lblTitleAccountsPayable.textColor = [UIColor blackColor];
- lblTitleAccountsPayable.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [accountsPayableView addSubview:lblTitleAccountsPayable];
-
- UIView *middleSeparator5=[UIView new];
-
- middleSeparator5.frame=CGRectMake(Screen_Width/2, CGRectGetMaxY(accountPayableTitleView.frame)+topMargin, 0.5, 50);
- middleSeparator5.backgroundColor=[UIColor lightGrayColor];
- [payableContent addSubview:middleSeparator5];
-
-
- UIView *advancePaymentView = [[UIView alloc]init];
-
- advancePaymentView.frame = CGRectMake(Screen_Width/2,CGRectGetMaxY(accountPayableTitleView.frame)+topMargin, Screen_Width/2,rowHeight);
- lblAdvancePaymentAmount = [[UILabel alloc]init];
- lblAdvancePaymentAmount.frame = CGRectMake(0, 0, advancePaymentView.frame.size.width, 25);
- lblAdvancePaymentAmount.textAlignment=NSTextAlignmentCenter;
- lblAdvancePaymentAmount.text=@"0.00";
- lblAdvancePaymentAmount.textColor = [UIColor blackColor];
- lblAdvancePaymentAmount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [advancePaymentView addSubview:lblAdvancePaymentAmount];
-
- UILabel *lblAdvancePaymentAmountTitle = [[UILabel alloc]init];
- lblAdvancePaymentAmountTitle.frame = CGRectMake(0,CGRectGetMaxY(lblAdvancePaymentAmount.frame),advancePaymentView.frame.size.width, 25);
- lblAdvancePaymentAmountTitle.text = @"预付款金额";
- lblAdvancePaymentAmountTitle.textAlignment=NSTextAlignmentCenter;
- lblAdvancePaymentAmountTitle.textColor = [UIColor blackColor];
- lblAdvancePaymentAmountTitle.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [advancePaymentView addSubview:lblAdvancePaymentAmountTitle];
- [payableContent addSubview:advancePaymentView];
-
- payableBorderV=[CustomBorderView new];
- payableBorderV.frame=CGRectMake(5, CGRectGetMaxY(accountsPayableView.frame)+topMargin,Screen_Width-30, 350);
- [payableBorderV setBackgroundColor:[UIColor whiteColor]];
- [payableBorderV drawBoardLine:borderLineWidth cornerRadius:2 color:[UIColor hexColor:@"D5CDCD"]];
- [payableContent addSubview:payableBorderV];
-
- _payableChartView=[[BarChartView alloc]init];
- _payableChartView.frame=CGRectMake(0,0,payableBorderV.frame.size.width, 350);
- [payableBorderV addSubview:_payableChartView];
-
- payableContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(payableBorderV.frame)+10);
- height=CGRectGetMaxY(payableContent.frame);
-
- payableContent.layer.cornerRadius=CornerRadius;
- }
-
-
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_INVENTORY_IPHONE].location!=NSNotFound){
- //库存状况
- inventoryStatusContent=[UIView new];
- inventoryStatusContent.frame=CGRectMake(10,CGRectGetMaxY(payableContent.frame)+10,Screen_Width,0);
- inventoryStatusContent.backgroundColor=[UIColor whiteColor];
- [content addSubview:inventoryStatusContent];
- UIView *inventoryStatusTitleView = [[UIView alloc]init];
-
- inventoryStatusTitleView.frame = CGRectMake(0,10 ,Screen_Width, 45);
-
- UIView * inventoryStatusView=[UIImageView new];
- inventoryStatusView.frame=CGRectMake(10, 10,10 , 25);
- [inventoryStatusView setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]];
-
- UIView *separator5=[UIView new];
- separator5.frame=CGRectMake(0,inventoryStatusTitleView.frame.size.height-1, inventoryStatusTitleView.frame.size.width-20, 0.5);
- [separator5 setBackgroundColor:[UIColor lightGrayColor]];
- [inventoryStatusTitleView addSubview:separator5];
- [inventoryStatusTitleView addSubview:inventoryStatusView];
-
-
- UILabel *titleInventoryStatus = [[UILabel alloc]init];
- titleInventoryStatus.frame = CGRectMake(CGRectGetMaxX(inventoryStatusView.frame)+10, 10, 90, 25);
- titleInventoryStatus.text = @"库存情况";
- titleInventoryStatus.textColor = [UIColor blackColor];
- titleInventoryStatus.font = [UIFont systemFontOfSize:NoDataFontOfSize];
- [inventoryStatusTitleView addSubview:titleInventoryStatus];
- [inventoryStatusContent addSubview:inventoryStatusTitleView];
-
- UIView *inventoryAmountView = [[UIView alloc]init];
-
- inventoryAmountView.frame = CGRectMake(0,CGRectGetMaxY(inventoryStatusTitleView.frame)+topMargin, Screen_Width/2, rowHeight);
-
- lblInventoryAmount = [[UILabel alloc]init];
- lblInventoryAmount.frame = CGRectMake(0, 0, inventoryAmountView.frame.size.width, 25);
- lblInventoryAmount.textColor = [UIColor redColor];
- lblInventoryAmount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- lblInventoryAmount.textAlignment=NSTextAlignmentCenter;
- lblInventoryAmount.text=@"0.00";
- [inventoryAmountView addSubview:lblInventoryAmount];
-
- lblTitleInventoryAmount = [[UILabel alloc]init];
- lblTitleInventoryAmount.frame = CGRectMake(0,CGRectGetMaxY(lblInventoryAmount.frame),inventoryAmountView.frame.size.width, 25);
- lblTitleInventoryAmount.text = @"库存金额";
- lblTitleInventoryAmount.textColor = [UIColor redColor];
- lblTitleInventoryAmount.textAlignment=NSTextAlignmentCenter;
- lblTitleInventoryAmount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [inventoryAmountView addSubview:lblTitleInventoryAmount];
-
-
- UITapGestureRecognizer *inventoryAmountTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(touchInventoryAmount:)];
-
- inventoryAmountView.userInteractionEnabled = YES;
-
- [inventoryAmountView addGestureRecognizer:inventoryAmountTap];
- [inventoryStatusContent addSubview:inventoryAmountView];
-
-
-
- UIView *middleSeparator6=[UIView new];
-
- middleSeparator6.frame=CGRectMake(Screen_Width/2, CGRectGetMaxY(inventoryStatusTitleView.frame)+topMargin,0.5, 45);
- middleSeparator6.backgroundColor=[UIColor lightGrayColor];
- [inventoryStatusContent addSubview:middleSeparator6];
-
-
- UIView *inventoryQuantityView = [[UIView alloc]init];
- inventoryQuantityView.frame = CGRectMake(Screen_Width/2,CGRectGetMaxY(inventoryStatusTitleView.frame)+topMargin,Screen_Width/2,rowHeight);
- lblInventoryQuantity = [[UILabel alloc]init];
- lblInventoryQuantity.frame = CGRectMake(0, 0,inventoryQuantityView.frame.size.width, 25);
- lblInventoryQuantity.text=@"0.00";
- lblInventoryQuantity.textColor = [UIColor blackColor];
- lblInventoryQuantity.textAlignment=NSTextAlignmentCenter;
- lblInventoryQuantity.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [inventoryQuantityView addSubview:lblInventoryQuantity];
-
- lblInventoryQuantityTitle= [[UILabel alloc]init];
- lblInventoryQuantityTitle.frame = CGRectMake(0,CGRectGetMaxY(lblInventoryQuantity.frame), inventoryQuantityView.frame.size.width, 25);
- lblInventoryQuantityTitle.text = @"库存量";
- lblInventoryQuantityTitle.textAlignment=NSTextAlignmentCenter;
- lblInventoryQuantityTitle.textColor = [UIColor blackColor];
- lblInventoryQuantityTitle.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [inventoryQuantityView addSubview:lblInventoryQuantityTitle];
- [inventoryStatusContent addSubview:inventoryQuantityView];
-
-
-
- // UITapGestureRecognizer *inventoryQuantityTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(touchInventoryQuantity:)];
- //
- // inventoryQuantityView.userInteractionEnabled = YES;
- //
- // [inventoryQuantityView addGestureRecognizer:inventoryQuantityTap];
- [inventoryStatusContent addSubview:inventoryAmountView];
-
- inventoryStatusBorderV=[CustomBorderView new];
- inventoryStatusBorderV.frame=CGRectMake(5, CGRectGetMaxY(inventoryAmountView.frame)+topMargin,Screen_Width-30, 300);
- [inventoryStatusBorderV setBackgroundColor:[UIColor whiteColor]];
- [inventoryStatusBorderV drawBoardLine:borderLineWidth cornerRadius:2 color:[UIColor hexColor:@"D5CDCD"]];
- [inventoryStatusContent addSubview:inventoryStatusBorderV];
-
- _pieView=[[PieChartView alloc]init];
- _pieView.frame=CGRectMake(0,0, inventoryStatusBorderV.frame.size.width, 300);
- [inventoryStatusBorderV addSubview:_pieView];
-
- inventoryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(inventoryStatusBorderV.frame)+10);
- inventoryStatusContent.layer.cornerRadius=CornerRadius;
- height=CGRectGetMaxY(inventoryStatusContent.frame);
- }
-
-
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_PROCUREMENT_IPHONE].location!=NSNotFound){
- //采购状况
- procurementSituationContent=[UIView new];
- procurementSituationContent.frame=CGRectMake(10,height+10,Screen_Width,0);
- procurementSituationContent.backgroundColor=[UIColor whiteColor];
- [content addSubview:procurementSituationContent];
-
- UIView *procurementSituationTitleView = [[UIView alloc]init];
-
- procurementSituationTitleView.frame = CGRectMake(0,10 ,Screen_Width, 45);
-
- UIView * procurementSituationImgView=[UIImageView new];
- procurementSituationImgView.frame=CGRectMake(10, 10,10 , 25);
- [procurementSituationImgView setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]];
-
-
-
- UIView *separator6=[UIView new];
- separator6.frame=CGRectMake(0,procurementSituationTitleView.frame.size.height-1, procurementSituationTitleView.frame.size.width-20, 0.5);
- [separator6 setBackgroundColor:[UIColor lightGrayColor]];
- [procurementSituationTitleView addSubview:separator6];
- [procurementSituationTitleView addSubview:procurementSituationImgView];
-
-
- UILabel *titleProcurementSituation = [[UILabel alloc]init];
- titleProcurementSituation.frame = CGRectMake(CGRectGetMaxX(procurementSituationImgView.frame)+10, 10, 90, 25);
- titleProcurementSituation.text = @"采购情况";
- titleProcurementSituation.textColor = [UIColor blackColor];
- titleProcurementSituation.font = [UIFont systemFontOfSize:NoDataFontOfSize];
- [procurementSituationTitleView addSubview:titleProcurementSituation];
- [procurementSituationContent addSubview:procurementSituationTitleView];
-
-
-
- _btnProcurementCustomMonth = [[UIButton alloc] initWithFrame:CGRectMake(Screen_Width/2-70,CGRectGetMaxY(procurementSituationTitleView.frame)+topMargin, 70, 35)];
- [_btnProcurementCustomMonth setTitle:@"自定义" forState:UIControlStateNormal];
- [_btnProcurementCustomMonth setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
- _btnProcurementCustomMonth.tag=1004;
- _btnProcurementCustomMonth.titleLabel.font = [UIFont systemFontOfSize: 12.0];
- [_btnProcurementCustomMonth addTarget:self action:@selector(goProcurementCustomMonth:) forControlEvents:UIControlEventTouchUpInside];
-
- UIBezierPath *maskPath21= [UIBezierPath bezierPathWithRoundedRect:_btnProcurementCustomMonth.bounds byRoundingCorners:UIRectCornerTopLeft|UIRectCornerBottomLeft cornerRadii:CGSizeMake(25.0, 25.0)];
- CAShapeLayer *maskLayer22 = [CAShapeLayer layer];
- maskLayer22.frame = _btnProcurementCustomMonth.bounds;
- maskLayer22.path = maskPath21.CGPath;
- _btnProcurementCustomMonth.layer.mask = maskLayer22;
-
- [procurementSituationContent addSubview:_btnProcurementCustomMonth];
-
- procurementCustomMonthMaskLayer = [CAShapeLayer layer];
- procurementCustomMonthMaskLayer.frame = _btnProcurementCustomMonth.bounds;
- procurementCustomMonthMaskLayer.path = maskPath21.CGPath;
- procurementCustomMonthMaskLayer.fillColor=[UIColor clearColor].CGColor;
- procurementCustomMonthMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
- procurementCustomMonthMaskLayer.lineWidth=1;
- [_btnProcurementCustomMonth.layer addSublayer:procurementCustomMonthMaskLayer];
-
- _btnProcurementCurrentMonth = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnProcurementCustomMonth.frame),CGRectGetMaxY(procurementSituationTitleView.frame)+topMargin, 70, 35)];
- [_btnProcurementCurrentMonth setTitle:[DateFormat getCurrentMonth] forState:UIControlStateNormal];
-
- _btnProcurementCurrentMonth.tag=1005;
- [_btnProcurementCurrentMonth addTarget:self action:@selector(goProcurementCurrentMonth:) forControlEvents:UIControlEventTouchUpInside];
- [_btnProcurementCurrentMonth setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
-
- _btnProcurementCurrentMonth.titleLabel.font = [UIFont systemFontOfSize: 12.0];
- UIBezierPath *maskPath22 = [UIBezierPath bezierPathWithRoundedRect:_btnProcurementCurrentMonth.bounds byRoundingCorners:UIRectCornerTopRight|UIRectCornerBottomRight cornerRadii:CGSizeMake(25.0, 25.0)];
- CAShapeLayer *maskLayer23 = [CAShapeLayer layer];
- maskLayer23.frame = _btnProcurementCurrentMonth.bounds;
- maskLayer23.path = maskPath22.CGPath;
- _btnProcurementCurrentMonth.layer.mask = maskLayer23;
-
- [procurementSituationContent addSubview:_btnProcurementCurrentMonth];
-
- procurementCurrentMonthMaskLayer = [CAShapeLayer layer];
- procurementCurrentMonthMaskLayer.frame = _btnProcurementCurrentMonth.bounds;
- procurementCurrentMonthMaskLayer.path = maskPath22.CGPath;
- procurementCurrentMonthMaskLayer.fillColor=[UIColor clearColor].CGColor;
- procurementCurrentMonthMaskLayer.strokeColor=[UIColor redColor].CGColor;
- procurementCurrentMonthMaskLayer.lineWidth=1;
- [_btnProcurementCurrentMonth.layer addSublayer:procurementCurrentMonthMaskLayer];
-
- procurementStatusPieBorderV=[CustomBorderView new];
- procurementStatusPieBorderV.frame=CGRectMake(5, CGRectGetMaxY(_btnProcurementCurrentMonth.frame)+topMargin,Screen_Width-30, 200);
- [procurementStatusPieBorderV setBackgroundColor:[UIColor whiteColor]];
- [procurementStatusPieBorderV drawBoardLine:borderLineWidth cornerRadius:2 color:[UIColor hexColor:@"D5CDCD"]];
- [procurementSituationContent addSubview:procurementStatusPieBorderV];
-
-
- procurementStatusV = [[MyView alloc]initWithFrame:CGRectMake(5,5, procurementStatusPieBorderV.frame.size.width-10,190)];
- [procurementStatusPieBorderV addSubview:procurementStatusV];
-
-
- UIView *percentView = [[UIView alloc]init];
-
- percentView.frame = CGRectMake(5,CGRectGetMaxY(procurementStatusPieBorderV.frame)-30, Screen_Width-30, 25);
-
- lblProcuremmentPercent= [[UILabel alloc]init];
- lblProcuremmentPercent.frame = CGRectMake(0, 0, percentView.frame.size.width, 25);
- lblProcuremmentPercent.textColor = [UIColor blackColor];
- lblProcuremmentPercent.font = [UIFont systemFontOfSize:22];
- lblProcuremmentPercent.text=@"完成率0.00%";
- lblProcuremmentPercent.textAlignment=NSTextAlignmentCenter;
- [percentView addSubview:lblProcuremmentPercent];
- [procurementSituationContent addSubview:percentView];
-
- UIView *planAmountView = [[UIView alloc]init];
-
- planAmountView.frame = CGRectMake(0,CGRectGetMaxY(percentView.frame)+topMargin, Screen_Width/2, rowHeight);
-
- lblPlanAmount = [[UILabel alloc]init];
- lblPlanAmount.frame = CGRectMake(0, 0, planAmountView.frame.size.width, 25);
- lblPlanAmount.textColor = [UIColor blackColor];
- lblPlanAmount.text=@"0.00";
- lblPlanAmount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- lblPlanAmount.textAlignment=NSTextAlignmentCenter;
- [planAmountView addSubview:lblPlanAmount];
-
- UILabel *lblTitlePlanAmount = [[UILabel alloc]init];
- lblTitlePlanAmount.frame = CGRectMake(0,CGRectGetMaxY(lblPlanAmount.frame),planAmountView.frame.size.width, 25);
- lblTitlePlanAmount.text = @"任务额";
- lblTitlePlanAmount.textColor = [UIColor blackColor];
- lblTitlePlanAmount.textAlignment=NSTextAlignmentCenter;
- lblTitlePlanAmount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [planAmountView addSubview:lblTitlePlanAmount];
-
- [procurementSituationContent addSubview:planAmountView];
-
-
- UIView *middleSeparator7=[UIView new];
-
- middleSeparator7.frame=CGRectMake(Screen_Width/2, CGRectGetMaxY(percentView.frame)+topMargin,0.5, 45);
- middleSeparator7.backgroundColor=[UIColor lightGrayColor];
- [procurementSituationContent addSubview:middleSeparator7];
-
-
- UIView *procurementAmountView = [[UIView alloc]init];
- procurementAmountView.frame = CGRectMake(Screen_Width/2,CGRectGetMaxY(percentView.frame)+topMargin,Screen_Width/2,rowHeight);
- lblProcurementAmount = [[UILabel alloc]init];
- lblProcurementAmount.frame = CGRectMake(0, 0,procurementAmountView.frame.size.width, 25);
- lblProcurementAmount.text=@"0.00";
- lblProcurementAmount.textColor = [UIColor blackColor];
- lblProcurementAmount.textAlignment=NSTextAlignmentCenter;
- lblProcurementAmount.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [procurementAmountView addSubview:lblProcurementAmount];
-
- UILabel *lblProcurementAmountTitle= [[UILabel alloc]init];
- lblProcurementAmountTitle.frame = CGRectMake(0,CGRectGetMaxY(lblProcurementAmount.frame), procurementAmountView.frame.size.width, 25);
- lblProcurementAmountTitle.text = @"实际采购额";
- lblProcurementAmountTitle.textAlignment=NSTextAlignmentCenter;
- lblProcurementAmountTitle.textColor = [UIColor blackColor];
- lblProcurementAmountTitle.font = [UIFont systemFontOfSize:BoldSystemFontOfSize18];
- [procurementAmountView addSubview:lblProcurementAmountTitle];
- [procurementSituationContent addSubview:procurementAmountView];
-
-
- procurementStatusChartBorderV=[CustomBorderView new];
- procurementStatusChartBorderV.frame=CGRectMake(5, CGRectGetMaxY(planAmountView.frame)+topMargin,Screen_Width-30, 350);
- [procurementStatusChartBorderV setBackgroundColor:[UIColor whiteColor]];
- [procurementStatusChartBorderV drawBoardLine:borderLineWidth cornerRadius:2 color:[UIColor hexColor:@"D5CDCD"]];
- [procurementSituationContent addSubview:procurementStatusChartBorderV];
-
- _procurementStatusChartView=[[BarChartView alloc]init];
- _procurementStatusChartView.frame=CGRectMake(0, 0,procurementStatusChartBorderV.frame.size.width, 350);
- [procurementStatusChartBorderV addSubview:_procurementStatusChartView];
-
-
- procurementSituationContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(procurementStatusChartBorderV.frame)+10);
-
- procurementSituationContent.layer.cornerRadius=CornerRadius;
- height=CGRectGetMaxY(procurementSituationContent.frame);
- }
-
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_FEES_IPHONE].location!=NSNotFound){
-
- paymentFeesStatusContent=[UIView new];
-
- paymentFeesStatusContent.frame=CGRectMake(10,height+10,Screen_Width,0);
- paymentFeesStatusContent.backgroundColor=[UIColor whiteColor];
- [content addSubview:paymentFeesStatusContent];
-
-
- UIView *paymentFeesTitleView = [[UIView alloc]init];
-
- paymentFeesTitleView.frame = CGRectMake(0,10 ,Screen_Width, 45);
-
- UIView *paymentFeesImgView=[UIImageView new];
- paymentFeesImgView.frame=CGRectMake(10, 10,10 , 25);
- [paymentFeesImgView setBackgroundColor:[UIColor hexColor:LIGHT_BROWN]];
-
-
- UIView *separator7=[UIView new];
- separator7.frame=CGRectMake(0,paymentFeesTitleView.frame.size.height-1, paymentFeesTitleView.frame.size.width-20, 0.5);
- [separator7 setBackgroundColor:[UIColor lightGrayColor]];
- [paymentFeesTitleView addSubview:separator7];
- [paymentFeesTitleView addSubview:paymentFeesImgView];
-
-
- UILabel *titlePaymentFees = [[UILabel alloc]init];
- titlePaymentFees.frame = CGRectMake(CGRectGetMaxX(paymentFeesImgView.frame)+10, 10, 130, 25);
- titlePaymentFees.text = @"支出费用情况";
- titlePaymentFees.textColor = [UIColor blackColor];
- titlePaymentFees.font = [UIFont systemFontOfSize:NoDataFontOfSize];
- [paymentFeesTitleView addSubview:titlePaymentFees];
- [paymentFeesStatusContent addSubview:paymentFeesTitleView];
-
- _btnPaymentFeesCustomMonth = [[UIButton alloc] initWithFrame:CGRectMake(Screen_Width/2-70,CGRectGetMaxY(paymentFeesTitleView.frame)+topMargin, 70, 35)];
- [_btnPaymentFeesCustomMonth setTitle:@"自定义" forState:UIControlStateNormal];
- [_btnPaymentFeesCustomMonth setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
- _btnPaymentFeesCustomMonth.tag=1005;
- _btnPaymentFeesCustomMonth.titleLabel.font = [UIFont systemFontOfSize: 12.0];
- [_btnPaymentFeesCustomMonth addTarget:self action:@selector(goPaymentFeesCustomMonth:) forControlEvents:UIControlEventTouchUpInside];
-
- UIBezierPath *maskPath23= [UIBezierPath bezierPathWithRoundedRect:_btnPaymentFeesCustomMonth.bounds byRoundingCorners:UIRectCornerTopLeft|UIRectCornerBottomLeft cornerRadii:CGSizeMake(25.0, 25.0)];
- CAShapeLayer *maskLayer24= [CAShapeLayer layer];
- maskLayer24.frame = _btnProcurementCustomMonth.bounds;
- maskLayer24.path = maskPath23.CGPath;
- _btnPaymentFeesCustomMonth.layer.mask = maskLayer24;
-
- [paymentFeesStatusContent addSubview:_btnPaymentFeesCustomMonth];
-
- paymentFeesCustomMonthMaskLayer = [CAShapeLayer layer];
- paymentFeesCustomMonthMaskLayer.frame = _btnPaymentFeesCustomMonth.bounds;
- paymentFeesCustomMonthMaskLayer.path = maskPath23.CGPath;
- paymentFeesCustomMonthMaskLayer.fillColor=[UIColor clearColor].CGColor;
- paymentFeesCustomMonthMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
- paymentFeesCustomMonthMaskLayer.lineWidth=1;
- [_btnPaymentFeesCustomMonth.layer addSublayer:paymentFeesCustomMonthMaskLayer];
-
-
- _btnPaymentFeesCurrentMonth = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_btnPaymentFeesCustomMonth.frame),CGRectGetMaxY(paymentFeesTitleView.frame)+topMargin, 70, 35)];
- [_btnPaymentFeesCurrentMonth setTitle:[DateFormat getCurrentMonth] forState:UIControlStateNormal];
-
- _btnPaymentFeesCurrentMonth.tag=1006;
- [_btnPaymentFeesCurrentMonth addTarget:self action:@selector(goPaymentFeesCurrentMonth:) forControlEvents:UIControlEventTouchUpInside];
- [_btnPaymentFeesCurrentMonth setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
-
- _btnPaymentFeesCurrentMonth.titleLabel.font = [UIFont systemFontOfSize: 12.0];
- UIBezierPath *maskPath27 = [UIBezierPath bezierPathWithRoundedRect:_btnPaymentFeesCurrentMonth.bounds byRoundingCorners:UIRectCornerTopRight|UIRectCornerBottomRight cornerRadii:CGSizeMake(25.0, 25.0)];
- CAShapeLayer *maskLayer28 = [CAShapeLayer layer];
- maskLayer28.frame = _btnPaymentFeesCurrentMonth.bounds;
- maskLayer28.path = maskPath27.CGPath;
- _btnPaymentFeesCurrentMonth.layer.mask = maskLayer28;
-
- [paymentFeesStatusContent addSubview:_btnPaymentFeesCurrentMonth];
-
- paymentFeesCurrentMonthMaskLayer = [CAShapeLayer layer];
- paymentFeesCurrentMonthMaskLayer.frame = _btnPaymentFeesCurrentMonth.bounds;
- paymentFeesCurrentMonthMaskLayer.path = maskPath27.CGPath;
- paymentFeesCurrentMonthMaskLayer.fillColor=[UIColor clearColor].CGColor;
- paymentFeesCurrentMonthMaskLayer.strokeColor=[UIColor redColor].CGColor;
- paymentFeesCurrentMonthMaskLayer.lineWidth=1;
- [_btnPaymentFeesCurrentMonth.layer addSublayer:paymentFeesCurrentMonthMaskLayer];
-
-
- UIView *feesAmountView= [[UIView alloc]init];
- feesAmountView.frame = CGRectMake(0,CGRectGetMaxY(_btnPaymentFeesCustomMonth.frame)+topMargin, Screen_Width, 25);
- UILabel *lblTitleFeesAmount= [[UILabel alloc]init];
- lblTitleFeesAmount.frame = CGRectMake(Screen_Width/2-110, 0, 110, 25);
- lblTitleFeesAmount.text = @"费用总额:";
- lblTitleFeesAmount.textColor = [UIColor redColor];
- lblTitleFeesAmount.font = [UIFont systemFontOfSize:NoDataFontOfSize];
- [feesAmountView addSubview:lblTitleFeesAmount];
-
- lblFeesTotalAmount = [[UILabel alloc]init];
- lblFeesTotalAmount.frame = CGRectMake(CGRectGetMaxX(lblTitleFeesAmount.frame), 0, 150, 25);
- lblFeesTotalAmount.textColor = [UIColor redColor];
- lblFeesTotalAmount.text=@"0.00";
- lblFeesTotalAmount.font = [UIFont systemFontOfSize:NoDataFontOfSize];
- [feesAmountView addSubview:lblFeesTotalAmount];
- [paymentFeesStatusContent addSubview:feesAmountView];
-
-
- paymentBorderV=[CustomBorderView new];
- paymentBorderV.frame=CGRectMake(5, CGRectGetMaxY(feesAmountView.frame)+topMargin,Screen_Width-30, 350);
- [paymentBorderV setBackgroundColor:[UIColor whiteColor]];
- [paymentBorderV drawBoardLine:borderLineWidth cornerRadius:2 color:[UIColor hexColor:@"D5CDCD"]];
-
- [paymentFeesStatusContent addSubview:paymentBorderV];
-
- _paymentFeesChartView=[[BarChartView alloc]init];
- _paymentFeesChartView.frame=CGRectMake(0,0,paymentBorderV.frame.size.width, 350);
- _paymentFeesChartView.tag=1001;
- [paymentBorderV addSubview:_paymentFeesChartView];
-
-
- paymentFeesStatusContent.frame=CGRectMake(10,height+10,Screen_Width,CGRectGetMaxY(paymentBorderV.frame)+10);
-
- paymentFeesStatusContent.layer.cornerRadius=CornerRadius;
- height=CGRectGetMaxY(paymentFeesStatusContent.frame);
- }
- content.frame=CGRectMake(0, 0,Screen_Width,height-CGRectGetMaxY(titleView.frame));
- scroll.contentSize = CGSizeMake(self.view.frame.size.width, height-CGRectGetMaxY(titleView.frame)+rectStatusHeight+rectNavHeight+100);
-
-
- }
- -(void)touchInventoryAmount:(UITapGestureRecognizer *)gesture
- {
- [self changeInventoryStatusTextColor];
- lblInventoryAmount.textColor = [UIColor redColor];
- lblTitleInventoryAmount.textColor = [UIColor redColor];
- [self drawPieView:inventoryAmountArray pieTitleArray:inventoryTitleArray pieView:_pieView];
- }
- -(void)touchInventoryQuantity:(UITapGestureRecognizer *)gesture
- {
- [self changeInventoryStatusTextColor];
-
- lblInventoryQuantity.textColor = [UIColor redColor];
- lblInventoryQuantityTitle.textColor = [UIColor redColor];
- [self drawPieView:inventoryQuantityArray pieTitleArray:inventoryTitleArray pieView:_pieView];
- }
- -(void)changeInventoryStatusTextColor
- {
- lblInventoryAmount.textColor = [UIColor blackColor];
- lblTitleInventoryAmount.textColor = [UIColor blackColor];;
- lblInventoryQuantity.textColor = [UIColor blackColor];
- lblInventoryQuantityTitle.textColor = [UIColor blackColor];
- }
- /**
- 画饼图
- */
- -(void)drawPieView:(NSMutableArray*)pieArray pieTitleArray:(NSMutableArray*)pieTitleArry pieView:(PieChartView*)pieView
- {
-
- pieView.usePercentValuesEnabled = YES;
- pieView.drawSlicesUnderHoleEnabled = NO;
- pieView.dragDecelerationFrictionCoef = 0.5;
- // chartView.holeRadiusPercent = 0.58;
- pieView.transparentCircleRadiusPercent = 0;
- pieView.drawEntryLabelsEnabled=NO;
- // chartView.transparentCircleRadiusPercent = 0.61;
- pieView.chartDescription.enabled = NO;
- [pieView setExtraOffsetsWithLeft:5.f top:10.f right:5.f bottom:5.f];
-
- NSMutableParagraphStyle *paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
- paragraphStyle.lineBreakMode = NSLineBreakByTruncatingTail;
- paragraphStyle.alignment = NSTextAlignmentCenter;
-
- pieView.drawHoleEnabled = NO;
- pieView.rotationAngle = 0.0;
- pieView.rotationEnabled = YES;
- pieView.highlightPerTapEnabled = YES;
-
- BalloonMarker *marker = [[BalloonMarker alloc]
- initWithColor: [UIColor colorWithWhite:210/255. alpha:1.0]
- font: [UIFont systemFontOfSize:12.0]
- textColor: UIColor.whiteColor
- insets: UIEdgeInsetsMake(8.0, 8.0, 20.0, 8.0)];
- marker.chartView = pieView;
- marker.minimumSize = CGSizeMake(80.f, 40.f);
- pieView.marker = marker;
-
- ChartLegend *l = pieView.legend;
- l.horizontalAlignment = ChartLegendHorizontalAlignmentCenter;
- l.verticalAlignment = ChartLegendVerticalAlignmentBottom;
- l.orientation = ChartLegendOrientationHorizontal;
- l.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:10.f];
- l.drawInside = NO;
- l.xEntrySpace =1;
- l.yEntrySpace =3;
- l.yOffset =5;
- pieView.legend.enabled = YES;
- pieView.delegate = self;
- [pieView animateWithYAxisDuration:1.4 easingOption:ChartEasingOptionEaseOutBack];
-
-
-
- NSMutableArray *entries = [[NSMutableArray alloc] init];
-
- for (int i = 0; i < pieArray.count; i++)
- {
- [entries addObject:[[PieChartDataEntry alloc] initWithValue:[[pieArray objectAtIndex:i] doubleValue] label:[pieTitleArry objectAtIndex:i]]];
- }
-
- PieChartDataSet *dataSet = [[PieChartDataSet alloc] initWithEntries:entries label:@""];
- dataSet.sliceSpace = 2.0;
- // add a lot of colors
-
- NSMutableArray *colors = [[NSMutableArray alloc] init];
- [colors addObject:[UIColor colorWithRed:112/255.f green:168/255.f blue:76/255.f alpha:1.f]];
- [colors addObject:[UIColor colorWithRed:40/255.f green:69/255.f blue:118/255.f alpha:1.f]];
- [colors addObject:[UIColor colorWithRed:153/255.f green:70/255.f blue:24/255.f alpha:1.f]];
- [colors addObject:[UIColor colorWithRed:70/255.f green:116/255.f blue:194/255.f alpha:1.f]];
- [colors addObject:[UIColor colorWithRed:235/255.f green:125/255.f blue:60/255.f alpha:1.f]];
- [colors addObject:[UIColor colorWithRed:163/255.f green:162/255.f blue:166/255.f alpha:1.f]];
- [colors addObject:[UIColor colorWithRed:232/255.f green:175/255.f blue:41/255.f alpha:1.f]];
- [colors addObject:[UIColor colorWithRed:88/255.f green:147/255.f blue:198/255.f alpha:1.f]];
- dataSet.colors = colors;
-
- dataSet.valueLinePart1OffsetPercentage = 0.8;
- dataSet.valueLinePart1Length = 0.4;
- dataSet.valueLinePart2Length = 0.4;
- dataSet.yValuePosition = PieChartValuePositionOutsideSlice;
-
- PieChartData *data = [[PieChartData alloc] initWithDataSet:dataSet];
-
- NSNumberFormatter *pFormatter = [[NSNumberFormatter alloc] init];
- pFormatter.numberStyle=NSNumberFormatterPercentStyle;
- pFormatter.maximumFractionDigits = 2;
- pFormatter.minimumFractionDigits=2;
- pFormatter.multiplier = @1.0f;
- pFormatter.percentSymbol = @"%";
- [data setValueFormatter:[[ChartDefaultValueFormatter alloc] initWithFormatter:pFormatter]];
-
- [data setValueFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:11.f]];
- [data setValueTextColor:UIColor.blackColor];
-
- pieView.data = data;
- [pieView highlightValues:nil];
- }
- /**
- 画单个柱状图
- */
- -(void)drawSingleBarchart:(NSMutableArray*)barchartArray chartView:(BarChartView*)chart
- axisValueFormatter:(id<ChartAxisValueFormatter>)formatter xAxisLabelCount:(NSInteger)count maximumValue:(double)maximumValue minimumValue:(double)minimumValue paymentFeesIdArray:(NSArray*)feesArray
- {
-
- chart.chartDescription.enabled = NO;
- chart.legend.enabled = NO;
- chart.drawGridBackgroundEnabled = NO;
- chart.dragEnabled = NO;
- [chart setScaleEnabled:NO];
- chart.pinchZoomEnabled = NO;
- chart.extraBottomOffset=20;
- chart.rightAxis.enabled = NO;
- chart.delegate = self;
- chart.drawBarShadowEnabled = NO;
- chart.drawValueAboveBarEnabled = YES;
- BalloonMarker *marker = [[BalloonMarker alloc]
- initWithColor: [UIColor colorWithWhite:210/255. alpha:1.0]
- font: [UIFont systemFontOfSize:12.0]
- textColor: UIColor.whiteColor
- insets: UIEdgeInsetsMake(8.0, 8.0, 20.0, 8.0)];
- marker.chartView = chart;
- marker.minimumSize = CGSizeMake(80.f, 40.f);
- chart.marker = marker;
- chart.maxVisibleCount = 60;
-
- ChartXAxis *xAxis = chart.xAxis;
- xAxis.labelPosition = XAxisLabelPositionBottom;
- xAxis.labelFont = [UIFont systemFontOfSize:10.f];
- xAxis.drawGridLinesEnabled = NO;
- xAxis.granularity = 1.0; // only intervals of 1 day
- xAxis.labelCount = count;
- xAxis.labelRotationAngle=20;
- xAxis.valueFormatter = formatter;
-
-
- ChartYAxis *leftAxis = chart.leftAxis;
- leftAxis.labelFont = [UIFont systemFontOfSize:10.f];
- leftAxis.axisMaximum=maximumValue+100;
- leftAxis.labelPosition = YAxisLabelPositionOutsideChart;
- leftAxis.spaceTop = 0.15;
- if(minimumValue<0)
- {
-
- leftAxis.axisMinimum =minimumValue;
- }
- else{
- leftAxis.axisMinimum = 0.0;
- }
-
- double start = 0;
- NSMutableArray *yVals1 = [[NSMutableArray alloc] init];
-
- NSMutableArray *colorArray = [[NSMutableArray alloc] init];
-
- for (int i = start; i < barchartArray.count; i++)
- {
- BarChartDataEntry *dataEntry;
- if(feesArray!=nil&&feesArray.count>0)
- {
- dataEntry= [[BarChartDataEntry alloc] initWithX:i y:[[barchartArray objectAtIndex:i]doubleValue] icon: [UIImage imageNamed:@"icon"] idValue:[[feesArray objectAtIndex:i]intValue]];
- [yVals1 addObject:dataEntry];
- }
- else
- {
- dataEntry= [[BarChartDataEntry alloc] initWithX:i y:[[barchartArray objectAtIndex:i]doubleValue] icon: [UIImage imageNamed:@"icon"] ];
- [yVals1 addObject:dataEntry];
- }
-
-
-
- }
-
- BarChartDataSet *set1 = nil;
- UIColor *blueColor= [UIColor colorWithRed:70/255.0f green:116/255.0f blue:193/255.0f alpha:1];
-
- [colorArray addObject:blueColor];
-
-
-
- if (chart.data.dataSetCount > 0)
- {
- set1 = (BarChartDataSet *)chart.data.dataSets[0];
- [set1 replaceEntries: yVals1];
-
- [chart.data notifyDataChanged];
- [chart notifyDataSetChanged];
- }
- else
- {
- set1 = [[BarChartDataSet alloc] initWithEntries:yVals1 label:@"资金"];
- [set1 setColors:colorArray];
-
- set1.drawIconsEnabled = NO;
- [set1 setDrawValuesEnabled:NO];
- NSMutableArray *dataSets = [[NSMutableArray alloc] init];
- [dataSets addObject:set1];
-
-
- BarChartData *data = [[BarChartData alloc] initWithDataSets:dataSets];
- [data setValueFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:10.0f]];
-
- data.barWidth = 0.5f;
-
- chart.data = data;
- }
- }
- /**
- 画三个柱状图
- */
- -(void)drawMultipleBarchart:(NSArray*)barchartArray receivablesTitleArray:(NSMutableArray*)receivablesTitleArry barChartView:(BarChartView*) chartView
- axisValueFormatter:(id<ChartAxisValueFormatter>)formatter xAxisLabelCount:(NSInteger)count maximumValue:(double)maximumValue
- minimumValue:(double)minimumValue
- {
-
-
- chartView.delegate = self;
- chartView.chartDescription.enabled = NO;
- chartView.extraBottomOffset=20;
- chartView.dragEnabled = NO;
- [chartView setScaleEnabled:NO];
- chartView.pinchZoomEnabled = NO;
- chartView.drawBarShadowEnabled = NO;
-
- BalloonMarker *marker = [[BalloonMarker alloc]
- initWithColor: [UIColor colorWithWhite:210/255. alpha:1.0]
- font: [UIFont systemFontOfSize:12.0]
- textColor: UIColor.whiteColor
- insets: UIEdgeInsetsMake(8.0, 8.0, 20.0, 8.0)];
- marker.chartView = chartView;
- marker.minimumSize = CGSizeMake(80.f, 40.f);
- chartView.marker = marker;
- chartView.drawGridBackgroundEnabled = NO;
- ChartLegend *legend = chartView.legend;
- legend.horizontalAlignment = ChartLegendHorizontalAlignmentCenter;
- legend.verticalAlignment = ChartLegendVerticalAlignmentBottom;
- legend.orientation = ChartLegendOrientationHorizontal;
- legend.drawInside = NO;
-
- legend.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:12.f];
- legend.yOffset = 1;
- legend.xOffset = 1;
- legend.yEntrySpace =1;
- ChartXAxis *xAxis = chartView.xAxis;
- xAxis.labelFont = [UIFont fontWithName:@"HelveticaNeue-Light" size:10.f];
- xAxis.axisMinimum=0;
- xAxis.labelRotationAngle=20;
- xAxis.granularity = 1.0f;
- xAxis.labelCount=count;
- xAxis.drawGridLinesEnabled=NO;
- xAxis.centerAxisLabelsEnabled = YES;
- xAxis.labelPosition = XAxisLabelPositionBottom;
- xAxis.valueFormatter =formatter ;
-
- ChartYAxis *leftAxis = chartView.leftAxis;
- leftAxis.labelFont = [UIFont fontWithName:@"HelveticaNeue-Light" size:10.f];
- leftAxis.valueFormatter = [[YAxisValueFormatter alloc] init];
- leftAxis.drawGridLinesEnabled = YES;
- leftAxis.gridColor = [UIColor colorWithRed:200/255.0f green:200/255.0f blue:200/255.0f alpha:1];//网格线颜色
- leftAxis.spaceTop = 0.35;
- leftAxis.granularityEnabled=YES;
- leftAxis.inverted=NO;
- leftAxis.gridLineWidth =1;
- if(minimumValue<0)
- {
- leftAxis.axisMinimum = minimumValue;
- }
- else
- {
- leftAxis.axisMinimum=0;
- }
- leftAxis.axisMaximum=maximumValue+100;
- leftAxis.decimals=2;
- // leftAxis.granularity=maximumValue/5;
- chartView.rightAxis.enabled = NO;
-
- float groupSpace = 0.1f;
- float barSpace = 0.15f;
- float barWidth = 0.15f;
- NSMutableArray *yVals1 = [[NSMutableArray alloc] init];
- NSMutableArray *yVals2 = [[NSMutableArray alloc] init];
- NSMutableArray *yVals3 = [[NSMutableArray alloc] init];
-
-
- int start =0;
- long end = barchartArray.count;
-
- for (int i = start; i < end; i++)
- {
-
- NSMutableDictionary *barchartDic=barchartArray[i];
- double y1= [[barchartDic objectForKey:@"Amount"]doubleValue];
- double y2=[[barchartDic objectForKey:@"CostAmount"]doubleValue];
- double y3=[[barchartDic objectForKey:@"FeeAmount"]doubleValue];
- [yVals1 addObject:[[BarChartDataEntry alloc]
- initWithX:i
- y:y1]];
-
- [yVals2 addObject:[[BarChartDataEntry alloc]
- initWithX:i
- y:y2]];
-
-
- [yVals3 addObject:[[BarChartDataEntry alloc]
- initWithX:i
- y:y3]];
-
- }
-
- BarChartDataSet *set1 = nil, *set2 = nil,*set3=nil;
-
- if (chartView.data.dataSetCount > 0)
- {
- set1 = (BarChartDataSet *)chartView.data.dataSets[0];
- set2 = (BarChartDataSet *)chartView.data.dataSets[1];
- set3 = (BarChartDataSet *)chartView.data.dataSets[2];
-
- [set1 replaceEntries:yVals1];
- [set2 replaceEntries:yVals2];
- [set3 replaceEntries:yVals3];
-
- BarChartData *data = chartView.barData;
-
- chartView.xAxis.axisMinimum = start;
- chartView.xAxis.axisMaximum = [data groupWidthWithGroupSpace:groupSpace barSpace: barSpace] * end + start;
- [data groupBarsFromX: start groupSpace: groupSpace barSpace: barSpace];
-
- [chartView.data notifyDataChanged];
- [chartView notifyDataSetChanged];
- }
- else
- {
- set1 = [[BarChartDataSet alloc] initWithEntries:yVals1 label:receivablesTitleArry[0]];
- [set1 setColor:[UIColor colorWithRed:70/255.0f green:116/255.0f blue:193/255.0f alpha:1]];
-
- set2 = [[BarChartDataSet alloc] initWithEntries:yVals2 label:receivablesTitleArry[1]];
- [set2 setColor:[UIColor colorWithRed:235/255.0f green:125/255.0f blue:60/255.0f alpha:1]];
-
-
- set3 = [[BarChartDataSet alloc] initWithEntries:yVals3 label:receivablesTitleArry[2]];
- [set3 setColor:[UIColor lightGrayColor]];
- [set1 setDrawValuesEnabled:NO];
- [set2 setDrawValuesEnabled:NO];
- [set3 setDrawValuesEnabled:NO];
-
- NSMutableArray *dataSets = [[NSMutableArray alloc] init];
- [dataSets addObject:set1];
- [dataSets addObject:set2];
- [dataSets addObject:set3];
-
- BarChartData *data = [[BarChartData alloc] initWithDataSets:dataSets];
- [data setValueFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:10.f]];
- data.barWidth = barWidth;
-
- // restrict the x-axis range
- chartView.xAxis.axisMinimum = start;
-
- // groupWidthWithGroupSpace(...) is a helper that calculates the width each group needs based on the provided parameters
- chartView.xAxis.axisMaximum = start+ [data groupWidthWithGroupSpace:groupSpace barSpace: barSpace] * end;
-
- [data groupBarsFromX: start groupSpace: groupSpace barSpace: barSpace];
-
- chartView.data = data;
- }
- }
- /**
- 画两个柱状图
- */
- -(void)drawTwoBarchart:(NSMutableArray*)barchartArray receivablesTitleArray:(NSMutableArray*)receivablesTitleArry barChartView:(BarChartView*) chartView
- axisValueFormatter:(id<ChartAxisValueFormatter>)formatter xAxisLabelCount:(NSInteger)count maximumValue:(double)maximumValue
- minimumValue:(double)minimumValue
- {
- chartView.delegate = self;
- chartView.extraBottomOffset=20;
- chartView.chartDescription.enabled = NO;
- chartView.dragEnabled = NO;
- [chartView setScaleEnabled:NO];
- chartView.pinchZoomEnabled = NO;
- chartView.drawBarShadowEnabled = NO;
- chartView.drawGridBackgroundEnabled = NO;
- chartView.maxVisibleCount = 60;
-
- BalloonMarker *marker = [[BalloonMarker alloc]
- initWithColor: [UIColor colorWithWhite:210/255. alpha:1.0]
- font: [UIFont systemFontOfSize:12.0]
- textColor: UIColor.whiteColor
- insets: UIEdgeInsetsMake(8.0, 8.0, 20.0, 8.0)];
- marker.chartView = chartView;
- marker.minimumSize = CGSizeMake(80.f, 40.f);
- chartView.marker = marker;
-
- ChartLegend *legend = chartView.legend;
- legend.horizontalAlignment = ChartLegendHorizontalAlignmentCenter;
- legend.verticalAlignment = ChartLegendVerticalAlignmentBottom;
- legend.orientation = ChartLegendOrientationHorizontal ;
- legend.drawInside = NO;
- legend.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:12.0f];
- legend.yOffset = 1.0;
- legend.xOffset = 1.0;
- legend.yEntrySpace =1;
-
- ChartXAxis *xAxis = chartView.xAxis;
- xAxis.labelFont = [UIFont fontWithName:@"HelveticaNeue-Light" size:10.f];
- xAxis.axisMinimum = 0.0;
- xAxis.granularity = 1.0f;
- xAxis.labelCount=count;
- xAxis.labelRotationAngle=20;
- xAxis.drawGridLinesEnabled=NO;
- xAxis.centerAxisLabelsEnabled = YES;
- xAxis.labelPosition = XAxisLabelPositionBottom;
- xAxis.valueFormatter =formatter ;
-
-
- ChartYAxis *leftAxis = chartView.leftAxis;
- leftAxis.labelFont = [UIFont fontWithName:@"HelveticaNeue-Light" size:10.f];
- leftAxis.valueFormatter = [[YAxisValueFormatter alloc] init];
- leftAxis.drawGridLinesEnabled = YES;
- leftAxis.gridColor = [UIColor colorWithRed:200/255.0f green:200/255.0f blue:200/255.0f alpha:1];//网格线颜色
- leftAxis.spaceTop = 0.35;
- leftAxis.granularityEnabled=YES;
- leftAxis.gridLineWidth =1;
- if(minimumValue<0)
- {
- leftAxis.axisMinimum = minimumValue;
- }
- else
- {
- leftAxis.axisMinimum=0;
- }
-
- leftAxis.axisMaximum=maximumValue+100;
- leftAxis.decimals=2;
- // leftAxis.granularity=maximumValue/5;
- chartView.rightAxis.enabled = NO;
-
- float groupSpace = 0.1f;
- float barSpace = 0.15f;
- float barWidth = 0.3f;
- NSMutableArray *yVals1 = [[NSMutableArray alloc] init];
- NSMutableArray *yVals2 = [[NSMutableArray alloc] init];
-
-
- int start =0;
- long end = barchartArray.count;
-
- for (int i = start; i < end; i++)
- {
-
- NSMutableDictionary *barchartDic=barchartArray[i];
- double y1=0;
- double y2=0;
- if([[barchartDic allKeys] containsObject:@"AccountReceivable"])
- {
- y1= [[barchartDic objectForKey:@"AccountReceivable"]doubleValue];
- }
-
- if([[barchartDic allKeys] containsObject:@"DepositReceived"])
- {
- y2=[[barchartDic objectForKey:@"DepositReceived"]doubleValue];
- }
-
-
- if([[barchartDic allKeys] containsObject:@"AccountPayable"])
- {
- y1= [[barchartDic objectForKey:@"AccountPayable"]doubleValue];
- }
-
- if([[barchartDic allKeys] containsObject:@"AdvanceMoney"])
- {
- y2=[[barchartDic objectForKey:@"AdvanceMoney"]doubleValue];
- }
-
- if([[barchartDic allKeys] containsObject:@"PlanAmount"])
- {
- y1= [[barchartDic objectForKey:@"PlanAmount"]doubleValue];
- }
-
- if([[barchartDic allKeys] containsObject:@"OrderAmount"])
- {
- y2=[[barchartDic objectForKey:@"OrderAmount"]doubleValue];
- }
-
-
- [yVals1 addObject:[[BarChartDataEntry alloc]
- initWithX:i
- y:y1]];
-
- [yVals2 addObject:[[BarChartDataEntry alloc]
- initWithX:i
- y:y2]];
-
-
-
-
- }
-
- BarChartDataSet *set1 = nil, *set2 = nil;
-
- if (chartView.data.dataSetCount > 0)
- {
- set1 = (BarChartDataSet *)chartView.data.dataSets[0];
- set2 = (BarChartDataSet *)chartView.data.dataSets[1];
-
- [set1 replaceEntries:yVals1];
- [set2 replaceEntries:yVals2];
-
-
- BarChartData *data = chartView.barData;
-
- chartView.xAxis.axisMinimum = start;
- chartView.xAxis.axisMaximum = [data groupWidthWithGroupSpace:groupSpace barSpace: barSpace] * end + start;
- [data groupBarsFromX: start groupSpace: groupSpace barSpace: barSpace];
-
- [chartView.data notifyDataChanged];
- [chartView notifyDataSetChanged];
- }
- else
- {
- set1 = [[BarChartDataSet alloc] initWithEntries:yVals1 label:receivablesTitleArry[0]];
- [set1 setColor:[UIColor colorWithRed:70/255.0f green:116/255.0f blue:193/255.0f alpha:1]];
-
- set2 = [[BarChartDataSet alloc] initWithEntries:yVals2 label:receivablesTitleArry[1]];
- [set2 setColor:[UIColor colorWithRed:235/255.0f green:125/255.0f blue:60/255.0f alpha:1]];
- [set1 setDrawValuesEnabled:NO];
- [set2 setDrawValuesEnabled:NO];
-
-
- NSMutableArray *dataSets = [[NSMutableArray alloc] init];
- [dataSets addObject:set1];
- [dataSets addObject:set2];
-
-
- BarChartData *data = [[BarChartData alloc] initWithDataSets:dataSets];
- [data setValueFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:10.f]];
- data.barWidth = barWidth;
-
- // restrict the x-axis range
- chartView.xAxis.axisMinimum = start;
-
- // groupWidthWithGroupSpace(...) is a helper that calculates the width each group needs based on the provided parameters
- chartView.xAxis.axisMaximum = start+ [data groupWidthWithGroupSpace:groupSpace barSpace: barSpace] * end;
-
- [data groupBarsFromX: start groupSpace: groupSpace barSpace: barSpace];
-
- chartView.data = data;
- }
- }
- -(void)clearSalesProfitData
- {
- lblNetProfitRate.text=@"0.00%";
- lblSalesIncome.text=@"0.00";
- lblSalesCost.text=@"0.00";
- lblFeeAmount.text=@"0.00";
- lblNetProfit.text=@"0.00";
- lblSalesMargin.text=@"0.00";
- lblGrossProfitMargin.text=@"0.00%";
-
-
- }
- -(void)clearProcuremmentData
- {
- lblProcuremmentPercent.text=@"完成率0.00%";
- lblPlanAmount.text=@"0.00";
- lblProcurementAmount.text=@"0.00";
-
- }
- -(void)clearPaymentFeesData
- {
- lblFeesTotalAmount.text=@"0.00";
- }
- -(void)clearMoneytoryAssetsData
- {
- lblMonetoryCapitalAmount.text=@"0.00";
- lblCashInHand.text=@"0.00";
- lblBankDeposit.text=@"0.00";
- lblOtherMonetoryCaiptal.text=@"0.00";
- lblNetMoneyInflow.text=@"0.00";
-
- }
- -(void)clearCurrentSituation
- {
- lblReceivablesAmount.text=@"0.00";
- lblDepositAmount.text=@"0.00";
- lblAdvancePayment.text = @"0.00";
- lblReceivablesAdvanceDeposit.text=@"0.00";
-
- }
- -(void)clearPayableSituation
- {
- lblAccountsPayable.text=@"0.00";
- lblAdvancePaymentAmount.text=@"0.00";
-
- }
- -(void)clearInventorySituation
- {
- lblInventoryAmount.text=@"0.00";
- lblInventoryQuantity.text=@"0";
- }
- /**
- * 异步执行 + 并发队列
- * 特点:可以开启多个线程,任务交替(同时)执行。
- */
- - (void)asyncConcurrent {
-
- dispatch_queue_t queue = dispatch_queue_create("com.test.queue", DISPATCH_QUEUE_CONCURRENT);
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_SALES_PROFIT_IPHONE].location!=NSNotFound){
- dispatch_async(queue, ^{
- // 追加任务 1
- [NSThread sleepForTimeInterval:1]; // 模拟耗时操作
- [self loadSalesProfitData];
-
- });
- }
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_MONETORY_CAPITAL_IPHONE].location!=NSNotFound){
- dispatch_async(queue, ^{
- // 追加任务 2
- [NSThread sleepForTimeInterval:1]; // 模拟耗时操作
- [self loadtAccountCashsData];
- });
-
- }
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_CURRENT_IPHONE].location!=NSNotFound){
- dispatch_async(queue, ^{
- // 追加任务 3
- [NSThread sleepForTimeInterval:1]; // 模拟耗时操作
- [self loadCurrentSituationData];
-
- });
- }
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_PAYABLE_IPHONE].location!=NSNotFound){
-
- dispatch_async(queue, ^{
- // 追加任务 4
- [NSThread sleepForTimeInterval:1]; // 模拟耗时操作
- [self loadPayableData];
-
- });
-
- }
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_INVENTORY_IPHONE].location!=NSNotFound){
- dispatch_async(queue, ^{
- // 追加任务 5
- [NSThread sleepForTimeInterval:1]; // 模拟耗时操作
- [self loadInvnetoryStatusData];
-
- });
-
- }
-
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_PROCUREMENT_IPHONE].location!=NSNotFound){
- dispatch_async(queue, ^{
- // 追加任务 5
- [NSThread sleepForTimeInterval:1]; // 模拟耗时操作
- [self loadProcurementStatusData];
-
- });
-
- }
-
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_FEES_IPHONE].location!=NSNotFound){
- dispatch_async(queue, ^{
- // 追加任务 5
- [NSThread sleepForTimeInterval:1]; // 模拟耗时操作
- [self loadPaymentFeesData];
-
- });
- }
-
- }
- /**
- 导航按钮样式
- */
- -(void)loadNavStyle
- {
- self.navigationItem.title=@"统计数据分析";
-
- //返回
- UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
- [button setBackgroundImage:[UIImage imageNamed:@"icon_back"]
- forState:UIControlStateNormal];
- [button addTarget:self action:@selector(goBack)
- forControlEvents:UIControlEventTouchUpInside];
- button.frame = CGRectMake(0, 0, 15, 18);
-
- UIBarButtonItem *menuButton = [[UIBarButtonItem alloc] initWithCustomView:button];
- self.navigationItem.leftBarButtonItem = menuButton;
- }
- /**
- 选择销售利润开始日期
- */
- - (void)btnSelectStartDate
- {
- __weak typeof(self) weakself=self;
- _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""];
- [_dealDatePicker configureSelectionBlock:^(NSString *date){
- _tempSalesProfitStartDate=date;
- } andCompletionBlock:^(void){
- _salesProfitStartDate = _tempSalesProfitStartDate;
- [weakself.btnSalesProfitStartDate setTitle:weakself.salesProfitStartDate forState:UIControlStateNormal];
- [self startLoading];
- [self clearSalesProfitData];
- [self loadSalesProfitData];
- } andCancelBlock:^(void){
-
- }];
- [_dealDatePicker show];
- }
- /**
- 选择销售利润结束日期
- */
- - (void)btnSelectEndDate
- {
- __weak typeof(self) weakself=self;
- _dealDatePicker = [BRDatePickerView PickerAlertWithTitle:@""];
- [_dealDatePicker configureSelectionBlock:^(NSString *date){
- _tempSalesProfitEndDate=date;
- } andCompletionBlock:^(void){
- weakself.salesProfitEndDate = _tempSalesProfitEndDate;
- [weakself.btnSalesProfitEndDate setTitle:weakself.salesProfitEndDate forState:UIControlStateNormal];
- [self clearSalesProfitData];
- [self startLoading];
- [self loadSalesProfitData];
- } andCancelBlock:^(void){
-
- }];
- [_dealDatePicker show];
- }
- /**
- 选择销售利润今天日期
- */
- -(void)selectTodayDateData
- {
- vDate.hidden=YES;
- netProfitContent.frame = CGRectMake(0,CGRectGetMaxY(_btnCustom.frame)+topMargin, Screen_Width, CGRectGetMaxY(_btnDepartment.frame));
-
- salesProfitBorderV.frame=CGRectMake(0, CGRectGetMaxY(netProfitContent.frame)+topMargin,Screen_Width-20, 350);
-
- salesProfitContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesProfitBorderV.frame)+10);
- height=CGRectGetMaxY(salesProfitContent.frame);
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_MONETORY_CAPITAL_IPHONE].location!=NSNotFound){
- currencyCapitalContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(currencyCapitalBorderV.frame));
- height=CGRectGetMaxY(currencyCapitalContent.frame);
- }
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_CURRENT_IPHONE].location!=NSNotFound){
- currentSituationContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(currentSituationBorderV.frame)+10);
- height=CGRectGetMaxY(currentSituationContent.frame);
- }
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_PAYABLE_IPHONE].location!=NSNotFound){
- payableContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(payableBorderV.frame)+30);
- height=CGRectGetMaxY(payableContent.frame);
- }
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_INVENTORY_IPHONE].location!=NSNotFound){
- inventoryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(inventoryStatusBorderV.frame)+10);
- height=CGRectGetMaxY(inventoryStatusContent.frame);
- }
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_PROCUREMENT_IPHONE].location!=NSNotFound){
- procurementSituationContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(procurementStatusChartBorderV.frame)+10);
-
- height=CGRectGetMaxY(procurementSituationContent.frame);
-
- }
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_FEES_IPHONE].location!=NSNotFound){
- paymentFeesStatusContent.frame=CGRectMake(10,height+10,Screen_Width,CGRectGetMaxY(paymentBorderV.frame)+10);
- height=CGRectGetMaxY(paymentFeesStatusContent.frame);
-
- }
-
- content.frame=CGRectMake(0, 0,Screen_Width,height-CGRectGetMaxY(titleView.frame));
- scroll.contentSize = CGSizeMake(self.view.frame.size.width, height-CGRectGetMaxY(titleView.frame)+rectStatusHeight+rectNavHeight+100);
- [salesIncomeYValues removeAllObjects];
- [salesProfitTitleArray removeAllObjects];
- [self changeButtonColor];
- [self clearSalesProfitData];
- _btnToday.layer.borderColor=[UIColor redColor].CGColor;
- [_btnToday setTitleColor:[UIColor redColor]forState:UIControlStateNormal];
- _salesProfitStartDate=[DateFormat getCurrentDate];
- _salesProfitEndDate=[DateFormat getCurrentDate];
- [self startLoading];
- [self loadSalesProfitData];
-
-
- }
- /**
- 获取y轴最大值
- */
- -(double)getYAxisMaximumValue:(NSMutableArray*) yValueArray
- {
- double maximumValue=[[yValueArray objectAtIndex:0]doubleValue];
- for(int i=1;i<yValueArray.count;i++)
- {
- double yValue=[[yValueArray objectAtIndex:i]doubleValue];
- if(yValue>maximumValue)
- {
- maximumValue=yValue;
- }
- }
-
- return maximumValue;
- }
- /**
- 获取y轴最小值
- */
- -(double)getYAxisMinimumValue:(NSMutableArray*) yValueArray
- {
- double minimumValue=[[yValueArray objectAtIndex:0]doubleValue];
- for(int i=1;i<yValueArray.count;i++)
- {
- double yValue=[[yValueArray objectAtIndex:i]doubleValue];
- if(yValue<minimumValue)
- {
- minimumValue=yValue;
- }
- }
-
- return minimumValue;
- }
- /**
- 获取销售利润昨天日期
- */
- -(void)selectYesterdayDateData
- {
- vDate.hidden=YES;
-
- netProfitContent.frame = CGRectMake(0,CGRectGetMaxY(_btnCustom.frame)+topMargin, Screen_Width, CGRectGetMaxY(_btnDepartment.frame));
-
- salesProfitBorderV.frame=CGRectMake(0, CGRectGetMaxY(netProfitContent.frame)+topMargin,Screen_Width-20, 350);
-
-
- salesProfitContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesProfitBorderV.frame)+10);
- height=CGRectGetMaxY(salesProfitContent.frame);
-
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_MONETORY_CAPITAL_IPHONE].location!=NSNotFound){
- currencyCapitalContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(currencyCapitalBorderV.frame));
- height=CGRectGetMaxY(currencyCapitalContent.frame);
- }
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_CURRENT_IPHONE].location!=NSNotFound){
- currentSituationContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(currentSituationBorderV.frame)+10);
- height=CGRectGetMaxY(currentSituationContent.frame);
- }
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_PAYABLE_IPHONE].location!=NSNotFound){
- payableContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(payableBorderV.frame)+30);
- height=CGRectGetMaxY(payableContent.frame);
- }
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_INVENTORY_IPHONE].location!=NSNotFound){
- inventoryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(inventoryStatusBorderV.frame)+10);
- height=CGRectGetMaxY(inventoryStatusContent.frame);
- }
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_PROCUREMENT_IPHONE].location!=NSNotFound){
- procurementSituationContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(procurementStatusChartBorderV.frame)+10);
-
- height=CGRectGetMaxY(procurementSituationContent.frame);
-
- }
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_FEES_IPHONE].location!=NSNotFound){
- paymentFeesStatusContent.frame=CGRectMake(10,height+10,Screen_Width,CGRectGetMaxY(paymentBorderV.frame)+10);
- height=CGRectGetMaxY(paymentFeesStatusContent.frame);
-
- }
-
- content.frame=CGRectMake(0, 0,Screen_Width,height-CGRectGetMaxY(titleView.frame));
- scroll.contentSize = CGSizeMake(self.view.frame.size.width, height-CGRectGetMaxY(titleView.frame)+rectStatusHeight+rectNavHeight+100);
- [salesIncomeYValues removeAllObjects];
- [salesProfitTitleArray removeAllObjects];
- [self clearSalesProfitData];
- [self changeButtonColor];
- _btnYesterday.layer.borderColor=[UIColor redColor].CGColor;
- [_btnYesterday setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
- _salesProfitStartDate=[DateFormat getDateBefore:1];
- _salesProfitEndDate=[DateFormat getDateBefore:1];
- [self startLoading];
- [self loadSalesProfitData];
- }
- /**
-
- 获取销售利润定制日期
- */
- -(void)selectCustomDateData
- {
- vDate.hidden=NO;
- vDate.frame= vDate.frame=CGRectMake(0, CGRectGetMaxY(_btnCustom.frame)+topMargin, Screen_Width, 25);
-
- netProfitContent.frame = CGRectMake(0,CGRectGetMaxY(vDate.frame)+topMargin, Screen_Width, CGRectGetMaxY(_btnDepartment.frame));
-
- salesProfitBorderV.frame=CGRectMake(0, CGRectGetMaxY(netProfitContent.frame)+topMargin,Screen_Width-20, 350);
-
-
- salesProfitContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesProfitBorderV.frame)+10);
- height=CGRectGetMaxY(salesProfitContent.frame);
-
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_MONETORY_CAPITAL_IPHONE].location!=NSNotFound){
- currencyCapitalContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(currencyCapitalBorderV.frame));
- height=CGRectGetMaxY(currencyCapitalContent.frame);
- }
-
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_CURRENT_IPHONE].location!=NSNotFound){
- currentSituationContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(currentSituationBorderV.frame)+10);
-
- height=CGRectGetMaxY(currentSituationContent.frame);
- }
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_PAYABLE_IPHONE].location!=NSNotFound){
- payableContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(payableBorderV.frame)+10);
-
- height=CGRectGetMaxY(payableContent.frame);
-
- }
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_INVENTORY_IPHONE].location!=NSNotFound){
- inventoryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(inventoryStatusBorderV.frame)+10);
-
- height=CGRectGetMaxY(inventoryStatusContent.frame);
-
- }
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_PROCUREMENT_IPHONE].location!=NSNotFound){
- procurementSituationContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(procurementStatusChartBorderV.frame)+10);
-
- height=CGRectGetMaxY(procurementSituationContent.frame);
-
- }
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_FEES_IPHONE].location!=NSNotFound){
- paymentFeesStatusContent.frame=CGRectMake(10,height+10,Screen_Width,CGRectGetMaxY(paymentBorderV.frame)+10);
-
- height=CGRectGetMaxY(paymentFeesStatusContent.frame);
-
- }
- content.frame=CGRectMake(0, 0,Screen_Width,height-CGRectGetMaxY(titleView.frame));
- scroll.contentSize = CGSizeMake(self.view.frame.size.width, height-CGRectGetMaxY(titleView.frame)+rectStatusHeight+rectNavHeight+100);
-
- [salesIncomeYValues removeAllObjects];
- [salesProfitTitleArray removeAllObjects];
-
- NSArray *dateInitArray=[DateFormat getMonthFirstLastDay];
- _salesProfitStartDate=[dateInitArray objectAtIndex:0];
- _salesProfitEndDate=[DateFormat getCurrentDate];
- [_btnSalesProfitStartDate setTitle:_salesProfitStartDate forState:UIControlStateNormal];
-
- [_btnSalesProfitEndDate setTitle:_salesProfitEndDate forState:UIControlStateNormal];
-
- [self changeButtonColor];
- btnCustomMaskLayer.strokeColor=[UIColor redColor].CGColor;
- [_btnCustom setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
- [self startLoading];
- [self loadSalesProfitData];
- }
- /**
- 获取销售利润前7天日期
- */
- -(void)selectSevenDaysData
- {
- vDate.hidden=YES;
- netProfitContent.frame = CGRectMake(0,CGRectGetMaxY(_btnCustom.frame)+topMargin, Screen_Width, CGRectGetMaxY(_btnDepartment.frame));
- salesProfitBorderV.frame=CGRectMake(0, CGRectGetMaxY(netProfitContent.frame)+topMargin,Screen_Width-20, 350);
-
- salesProfitContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesProfitBorderV.frame)+10);
-
- height=CGRectGetMaxY(salesProfitContent.frame);
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_MONETORY_CAPITAL_IPHONE].location!=NSNotFound){
- currencyCapitalContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(currencyCapitalBorderV.frame));
- height=CGRectGetMaxY(currencyCapitalContent.frame);
- }
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_CURRENT_IPHONE].location!=NSNotFound){
- currentSituationContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(currentSituationBorderV.frame)+10);
- height=CGRectGetMaxY(currentSituationContent.frame);
- }
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_PAYABLE_IPHONE].location!=NSNotFound){
- payableContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(payableBorderV.frame)+30);
- height=CGRectGetMaxY(payableContent.frame);
- }
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_INVENTORY_IPHONE].location!=NSNotFound){
- inventoryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(inventoryStatusBorderV.frame)+10);
- height=CGRectGetMaxY(inventoryStatusContent.frame);
- }
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_PROCUREMENT_IPHONE].location!=NSNotFound){
- procurementSituationContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(procurementStatusChartBorderV.frame)+10);
-
- height=CGRectGetMaxY(procurementSituationContent.frame);
-
- }
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_FEES_IPHONE].location!=NSNotFound){
- paymentFeesStatusContent.frame=CGRectMake(10,height+10,Screen_Width,CGRectGetMaxY(paymentBorderV.frame)+10);
- height=CGRectGetMaxY(paymentFeesStatusContent.frame);
-
- }
- content.frame=CGRectMake(0, 0,Screen_Width,height-CGRectGetMaxY(titleView.frame));
- scroll.contentSize = CGSizeMake(self.view.frame.size.width, height-CGRectGetMaxY(titleView.frame)+rectStatusHeight+rectNavHeight+100);
- [salesIncomeYValues removeAllObjects];
- [salesProfitTitleArray removeAllObjects];
- [self clearSalesProfitData];
- [self changeButtonColor];
- _btnRecentlySevenDays.layer.borderColor=[UIColor redColor].CGColor;
-
- [_btnRecentlySevenDays setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
- _salesProfitStartDate=[DateFormat getDateBefore:7];
- _salesProfitEndDate=[DateFormat getCurrentDate];
- [self startLoading];
- [self loadSalesProfitData];
- }
- /**
- 获取销售利润前30天日期
- */
- -(void)selectThirtyDaysData
- {
- vDate.hidden=YES;
- netProfitContent.frame = CGRectMake(0,CGRectGetMaxY(_btnCustom.frame)+topMargin, Screen_Width, CGRectGetMaxY(_btnDepartment.frame));
-
- salesProfitBorderV.frame=CGRectMake(0, CGRectGetMaxY(netProfitContent.frame)+topMargin,Screen_Width-20, 350);
-
-
- salesProfitContent.frame=CGRectMake(10, 10,Screen_Width-20,CGRectGetMaxY(salesProfitBorderV.frame)+10);
- height=CGRectGetMaxY(salesProfitContent.frame);
-
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_MONETORY_CAPITAL_IPHONE].location!=NSNotFound){
- currencyCapitalContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(currencyCapitalBorderV.frame));
- height=CGRectGetMaxY(currencyCapitalContent.frame);
- }
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_CURRENT_IPHONE].location!=NSNotFound){
- currentSituationContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(currentSituationBorderV.frame)+10);
- height=CGRectGetMaxY(currentSituationContent.frame);
- }
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_PAYABLE_IPHONE].location!=NSNotFound){
- payableContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(payableBorderV.frame)+30);
- height=CGRectGetMaxY(payableContent.frame);
- }
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_INVENTORY_IPHONE].location!=NSNotFound){
- inventoryStatusContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(inventoryStatusBorderV.frame)+10);
- height=CGRectGetMaxY(inventoryStatusContent.frame);
- }
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_PROCUREMENT_IPHONE].location!=NSNotFound){
- procurementSituationContent.frame=CGRectMake(10, height+10,Screen_Width-20,CGRectGetMaxY(procurementStatusChartBorderV.frame)+10);
-
- height=CGRectGetMaxY(procurementSituationContent.frame);
-
- }
-
- if([kkRights rangeOfString: FUNCTION_STATISTICS_DATA_FEES_IPHONE].location!=NSNotFound){
- paymentFeesStatusContent.frame=CGRectMake(10,height+10,Screen_Width,CGRectGetMaxY(paymentBorderV.frame)+10);
- height=CGRectGetMaxY(paymentFeesStatusContent.frame);
-
- }
-
- content.frame=CGRectMake(0, 0,Screen_Width,height-CGRectGetMaxY(titleView.frame));
- scroll.contentSize = CGSizeMake(self.view.frame.size.width, height-CGRectGetMaxY(titleView.frame)+rectStatusHeight+rectNavHeight+100);
- [salesIncomeYValues removeAllObjects];
- [salesProfitTitleArray removeAllObjects];
- [self clearSalesProfitData];
- [self changeButtonColor];
- btnRecentlyThirtyDaysMaskLayer.strokeColor=[UIColor redColor].CGColor;
- [_btnRecentlyThirtyDays setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
- _salesProfitStartDate=[DateFormat getDateBefore:30];
- _salesProfitEndDate=[DateFormat getCurrentDate];
- [self startLoading];
- [self loadSalesProfitData];
- }
- /**
- 切换销售利润按钮颜色
- */
- -(void)changeButtonColor
- {
- btnCustomMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
- _btnToday.layer.borderColor=[UIColor lightGrayColor].CGColor;
- _btnYesterday.layer.borderColor=[UIColor lightGrayColor].CGColor;
- _btnRecentlySevenDays.layer.borderColor=[UIColor lightGrayColor].CGColor;
- btnRecentlyThirtyDaysMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
-
- [_btnCustom setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
-
- [_btnToday setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
-
- [_btnYesterday setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
- [_btnRecentlySevenDays setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
-
- [_btnRecentlyThirtyDays setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
- }
- -(void)goProcurementCurrentMonth:(UIButton *)sender
- {
- procurementStatusDate=[DateFormat getCurrentNoSeparateMonth];
- [self changeProcurementStatusColor];
- procurementCustomMonthMaskLayer.strokeColor=[UIColor redColor].CGColor;
- [_btnProcurementCustomMonth setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
- [procurementStatusYArray removeAllObjects];
- [procurementStatusXTitleArray removeAllObjects];
- [self clearProcuremmentData];
- [self startLoading];
- [self loadProcurementStatusData];
- }
- -(void)goPaymentFeesCustomMonth:(UIButton *)sender
- {
- [self changePaymentFeesColor];
-
- paymentFeesCustomMonthMaskLayer.strokeColor=[UIColor redColor].CGColor;
- [_btnPaymentFeesCustomMonth setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
-
- ITDatePickerController *datePickerController = [[ITDatePickerController alloc] init];
- datePickerController.tag = 102;
- datePickerController.delegate = self;
- datePickerController.showToday = NO;
- datePickerController.defaultDate = nil;
- [self presentViewController:datePickerController animated:YES completion:nil];
- }
- /**
- 切换渠道部门按钮颜色
- */
- -(void)changeChannelDepartmentColor
- {
- btnChannelMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
- [_btnChannel setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
- btnDepartmentMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
- [_btnDepartment setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
- }
- /**
- 切换往来情况渠道部门按钮颜色
- */
- -(void)changeCurrentSituationColor
- {
- currentSituationDepartmentMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
-
- currentSituationChannelMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
- [_btnCurrentChannel setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
- [_btnCurrentDepartment setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
- }
- /**
- 切换货币资金按钮颜色
- */
- -(void)changeMoneytoryCapitalColor
- {
- moneytoryCapitalCurrentMonthMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
- [_btnMonetoryCaitalCustom setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
- [_btnMonetoryCaitalCurrentMonth setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
-
- moneytoryCapitalMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
- }
- -(void)changeProcurementStatusColor
- {
- procurementCustomMonthMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
- [_btnProcurementCustomMonth setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
- [_btnProcurementCurrentMonth setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
-
- procurementCurrentMonthMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
- }
- -(void)changePaymentFeesColor
- {
- paymentFeesCustomMonthMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
- [_btnPaymentFeesCustomMonth setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
- [_btnPaymentFeesCurrentMonth setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
- paymentFeesCurrentMonthMaskLayer.strokeColor=[UIColor lightGrayColor].CGColor;
-
- }
- /**
- 加载库存状态数据源
- */
- -(void)loadInvnetoryStatusData
- {
- NSString *urlStr = [NSString stringWithFormat:@"%@", ServerURL];
- NSMutableDictionary *dict = [NSMutableDictionary dictionary];
- [dict setObject:@"GetAccountInventoryReportDataIphone" forKey:@"Action"];
- [dict setObject:[NSString stringWithFormat:@"%@",kkAccountCode]forKey:@"AccountCode"];
- [dict setObject:kkUserCode forKey:@"UserCode"];
- [dict setObject:kkUserPwd forKey:@"UserPassword"];
- [dict setObject:kkSessionKey forKey:@"SessionKey"];
- _inventoryStatusDownManager = [[ASIDownManager alloc] init];
- _inventoryStatusDownManager.delegate = self;
- _inventoryStatusDownManager.onRequestSuccess = @selector(onInventoryStatusLoadFinish:);
- _inventoryStatusDownManager.onRequestFail = @selector(onInventoryStatusLoadFail:);
- [_inventoryStatusDownManager postHttpRequest:urlStr dic:dict path:nil fileName:nil];
- }
- -(void)loadPaymentFeesData
- {
- NSString *urlStr = [NSString stringWithFormat:@"%@", ServerURL];
- NSMutableDictionary *dict = [NSMutableDictionary dictionary];
- [dict setObject:@"GetAccountFeeReportDataIphone" forKey:@"Action"];
- [dict setObject:[NSString stringWithFormat:@"%@",kkAccountCode]forKey:@"AccountCode"];
- [dict setObject:kkUserCode forKey:@"UserCode"];
- [dict setObject:kkUserPwd forKey:@"UserPassword"];
- [dict setObject:kkSessionKey forKey:@"SessionKey"];
- [dict setObject:paymentFeesDate forKey:@"AccountMonth"];
- _paymentFeesDownManager = [[ASIDownManager alloc] init];
- _paymentFeesDownManager.delegate = self;
- _paymentFeesDownManager.onRequestSuccess = @selector(onPaymentFeesLoadFinish:);
- _paymentFeesDownManager.onRequestFail = @selector(onPaymentFeesLoadFail:);
- [_paymentFeesDownManager postHttpRequest:urlStr dic:dict path:nil fileName:nil];
- }
- -(void)loadProcurementStatusData
- {
- NSString *urlStr = [NSString stringWithFormat:@"%@", ServerURL];
- NSMutableDictionary *dict = [NSMutableDictionary dictionary];
- [dict setObject:@"GetAccountProcurementTaskReportDataIphone" forKey:@"Action"];
- [dict setObject:[NSString stringWithFormat:@"%@",kkAccountCode]forKey:@"AccountCode"];
- [dict setObject:kkUserCode forKey:@"UserCode"];
- [dict setObject:kkUserPwd forKey:@"UserPassword"];
- [dict setObject:kkSessionKey forKey:@"SessionKey"];
- [dict setObject:procurementStatusDate forKeyedSubscript:@"AccountMonth"];
- _procurementStatusDownManager = [[ASIDownManager alloc] init];
- _procurementStatusDownManager.delegate = self;
- _procurementStatusDownManager.onRequestSuccess = @selector(onProcurementStatusLoadFinish:);
- _procurementStatusDownManager.onRequestFail = @selector(onProcurementStatusLoadFail:);
- [_procurementStatusDownManager postHttpRequest:urlStr dic:dict path:nil fileName:nil];
- }
- //-(void)loadFNCAccount
- //{
- // NSString *urlStr = [NSString stringWithFormat:@"%@", ServerURL];
- // NSMutableDictionary *dict = [NSMutableDictionary dictionary];
- // [dict setObject:@"GetFNCAccount" forKey:@"Action"];
- // [dict setObject:[NSString stringWithFormat:@"%@",kkAccountCode]forKey:@"AccountCode"];
- // [dict setObject:kkUserCode forKey:@"UserCode"];
- // [dict setObject:kkUserPwd forKey:@"UserPassword"];
- // [dict setObject:kkSessionKey forKey:@"SessionKey"];
- // _downManager = [[ASIDownManager alloc] init];
- // _downManager.delegate = self;
- // _downManager.onRequestSuccess = @selector(onFNCAccountLoadFinish:);
- // _downManager.onRequestFail = @selector(onFNCAccountLoadFail:);
- // [_downManager postHttpRequest:urlStr dic:dict path:nil fileName:nil];
- //}
- /**
- 加载销售利润数据源
- */
- -(void)loadSalesProfitData
- {
- NSString *urlStr = [NSString stringWithFormat:@"%@", ServerURL];
- NSMutableDictionary *dict = [NSMutableDictionary dictionary];
- [dict setObject:@"GetAccountStatisticalAnalysisDataIphone" forKey:@"Action"];
- [dict setObject:[NSString stringWithFormat:@"%@",kkAccountCode]forKey:@"AccountCode"];
- [dict setObject:kkUserCode forKey:@"UserCode"];
- [dict setObject:kkUserPwd forKey:@"UserPassword"];
- [dict setObject:kkSessionKey forKey:@"SessionKey"];
- [dict setObject:typeId forKeyedSubscript:@"TypeID"];
- [dict setObject:_salesProfitStartDate forKeyedSubscript:@"AccountDateFrom"];
- [dict setObject:_salesProfitEndDate forKeyedSubscript:@"AccountDateTo"];
- _downManager = [[ASIDownManager alloc] init];
- _downManager.delegate = self;
- _downManager.onRequestSuccess = @selector(onSalesProfitLoadFinish:);
- _downManager.onRequestFail = @selector(onSalesProfitLoadFail:);
- [_downManager postHttpRequest:urlStr dic:dict path:nil fileName:nil];
- }
- /**
- 销售利润渠道业务部门按钮点击事件
- */
- -(void)goSalesProfit:(UIButton *)sender
- {
- [salesIncomeYValues removeAllObjects];
- [salesProfitTitleArray removeAllObjects];
-
- [self changeChannelDepartmentColor];
-
- if(sender.tag==1000)
- {
- typeId=@"0";
- btnChannelMaskLayer.strokeColor=[UIColor redColor].CGColor;
- [_btnChannel setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
- }
- if(sender.tag==1001)
- {
- typeId=@"1";
- btnDepartmentMaskLayer.strokeColor=[UIColor redColor].CGColor;
- [_btnDepartment setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
- }
- [self clearSalesProfitData];
- [self startLoading];
- [self loadSalesProfitData];
- }
- -(void)goProcurementCustomMonth:(UIButton *)sender
- {
- [self changeProcurementStatusColor];
- procurementCustomMonthMaskLayer.strokeColor=[UIColor redColor].CGColor;
- [_btnProcurementCustomMonth setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
-
- ITDatePickerController *datePickerController = [[ITDatePickerController alloc] init];
- datePickerController.tag = 101;
- datePickerController.delegate = self;
- datePickerController.showToday = NO;
- datePickerController.defaultDate = nil;
- [self presentViewController:datePickerController animated:YES completion:nil];
- }
- /**
- 往来情况渠道业务部门按钮点击事件
- */
- -(void)goCurrentSituation:(UIButton *)sender
- {
- [self changeCurrentSituationColor];
- [receivablesValuesArray removeAllObjects];
- [receivableXTitleArray removeAllObjects];
- if(sender.tag==1002)
- {
- typeId=@"0";
- currentSituationChannelMaskLayer.strokeColor=[UIColor redColor].CGColor;
- [_btnCurrentChannel setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
-
-
- }
- if(sender.tag==1003)
- {
- typeId=@"1";
- currentSituationDepartmentMaskLayer.strokeColor=[UIColor redColor].CGColor;
-
- [_btnCurrentDepartment setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
- }
- [self clearCurrentSituation];
- [self startLoading];
- [self loadCurrentSituationData];
- }
- /**
- 加载货币资金当前月
- */
- -(void)getMoneytoryAssetsCurrentMonth
- {
- [self changeMoneytoryCapitalColor];
- [_btnMonetoryCaitalCurrentMonth setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
- [netMoneyValues removeAllObjects];
- moneytoryAssetsDate=[DateFormat getCurrentNoSeparateMonth];
- [self clearMoneytoryAssetsData];
- [self startLoading];
- [self loadtAccountCashsData];
- }
- -(void)goPaymentFeesCurrentMonth:(UIButton*)sender
- {
- [self changePaymentFeesColor];
- [_btnPaymentFeesCurrentMonth setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
- paymentFeesCurrentMonthMaskLayer.strokeColor=[UIColor redColor].CGColor;
- paymentFeesDate=[DateFormat getCurrentNoSeparateMonth];
- [paymentFeesYArray removeAllObjects];
- [paymentFeesYIdArray removeAllObjects];
- [paymentFeesXArray removeAllObjects];
- [self clearPaymentFeesData];
- [self startLoading];
- [self loadPaymentFeesData];
- }
- /**
- 货币资金定制日期点击事件
- */
- -(void)selectCustomDate
- {
- [netMoneyValues removeAllObjects];
- [self changeMoneytoryCapitalColor];
- [_btnMonetoryCaitalCustom setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
- moneytoryCapitalMaskLayer.strokeColor=[UIColor redColor].CGColor;
- ITDatePickerController *datePickerController = [[ITDatePickerController alloc] init];
- datePickerController.tag = 100;
- datePickerController.delegate = self;
- datePickerController.showToday = NO;
- datePickerController.defaultDate = nil;
- [self presentViewController:datePickerController animated:YES completion:nil];
-
- }
- /**
- 加载应付情况数据源
- */
- -(void)loadPayableData
- {
- NSString *urlStr = [NSString stringWithFormat:@"%@", ServerURL];
- NSMutableDictionary *dict = [NSMutableDictionary dictionary];
- [dict setObject:@"GetAccountSupplierDataIphone" forKey:@"Action"];
- [dict setObject:[NSString stringWithFormat:@"%@",kkAccountCode]forKey:@"AccountCode"];
- [dict setObject:kkUserCode forKey:@"UserCode"];
- [dict setObject:kkUserPwd forKey:@"UserPassword"];
- [dict setObject:kkSessionKey forKey:@"SessionKey"];
-
- _payableDownManager = [[ASIDownManager alloc] init];
- _payableDownManager.delegate = self;
- _payableDownManager.onRequestSuccess = @selector(onPayableLoadFinish:);
- _payableDownManager.onRequestFail = @selector(onPayableLoadFail:);
- [_payableDownManager postHttpRequest:urlStr dic:dict path:nil fileName:nil];
- }
- /**
- 加载往来情况数据源
- */
- -(void)loadCurrentSituationData
- {
- NSString *urlStr = [NSString stringWithFormat:@"%@", ServerURL];
- NSMutableDictionary *dict = [NSMutableDictionary dictionary];
- [dict setObject:@"GetAccountCustomersDataIphone" forKey:@"Action"];
- [dict setObject:[NSString stringWithFormat:@"%@",kkAccountCode]forKey:@"AccountCode"];
- [dict setObject:kkUserCode forKey:@"UserCode"];
- [dict setObject:kkUserPwd forKey:@"UserPassword"];
- [dict setObject:kkSessionKey forKey:@"SessionKey"];
- [dict setObject:typeId forKeyedSubscript:@"TypeID"];
-
- _currentSituationDownManager = [[ASIDownManager alloc] init];
- _currentSituationDownManager.delegate = self;
- _currentSituationDownManager.onRequestSuccess = @selector(onCurrentSituationLoadFinish:);
- _currentSituationDownManager.onRequestFail = @selector(onCurrentSituationLoadFail:);
- [_currentSituationDownManager postHttpRequest:urlStr dic:dict path:nil fileName:nil];
- }
- /**
- 加载货币资金数据源
- */
- -(void)loadtAccountCashsData
- {
-
- NSString *urlStr = [NSString stringWithFormat:@"%@", ServerURL];
- NSMutableDictionary *dict = [NSMutableDictionary dictionary];
- [dict setObject:@"GetAccountCashsDataIphone" forKey:@"Action"];
- [dict setObject:[NSString stringWithFormat:@"%@",kkAccountCode]forKey:@"AccountCode"];
- [dict setObject:kkUserCode forKey:@"UserCode"];
- [dict setObject:kkUserPwd forKey:@"UserPassword"];
- [dict setObject:kkSessionKey forKey:@"SessionKey"];
- [dict setObject:moneytoryAssetsDate forKeyedSubscript:@"AccountMonth"];
-
- _accountCashDownManager = [[ASIDownManager alloc] init];
- _accountCashDownManager.delegate = self;
- _accountCashDownManager.onRequestSuccess = @selector(onAccountCashsDataLoadFinish:);
- _accountCashDownManager.onRequestFail = @selector(onAccountCashsDataLoadFail:);
- [_accountCashDownManager postHttpRequest:urlStr dic:dict path:nil fileName:nil];
- }
- #pragma mark - 委托函数
- -(void)onPaymentFeesLoadFinish:(ASIDownManager *)sender {
- count++;
- if(count>=3)
- {
- [self stopLoading];
- }
- RequestResultModel *resultModel = [RequestResultModel dk_modelWithJSON:sender.mWebStr];
- int status= resultModel.status;
- if(status==0)
- {
- NSDictionary *resultDic=(NSDictionary*)resultModel.result;
- NSArray *resultArray=[resultDic objectForKey:@"Table"];
- if(resultArray!=nil&&resultArray.count>0)
- {
- double totalFeesAmount=0;
- for(int i=0;i<resultArray.count;i++)
- {
- NSDictionary *dic=[resultArray objectAtIndex:i];
- double confirmFeeSumValue= [[dic objectForKey:@"ConfirmFeeSum"]doubleValue];
- NSString *confirmFeeSumStr=[NSString stringWithFormat:@"%.2f",confirmFeeSumValue];
- NSString *organizationName=[dic objectForKey:@"OrganizationName"];
- NSInteger organizationId=[[dic objectForKey:@"OrganizationID"]integerValue];
- [paymentFeesYArray addObject:confirmFeeSumStr];
- [paymentFeesXArray addObject:organizationName];
- [paymentFeesYIdArray addObject:[NSString stringWithFormat:@"%ld",organizationId]];
- totalFeesAmount+=confirmFeeSumValue;
- }
-
- double maximumValue= [self getYAxisMaximumValue:paymentFeesYArray];
- double minimumValue=[self getYAxisMinimumValue:paymentFeesYArray];
-
- NSString *totalFeesAmountStr=[NSString stringWithFormat:@"%.2f",totalFeesAmount];
- lblFeesTotalAmount.text=[Util thousandSeparatorFormat:totalFeesAmountStr];
-
- IntAxisValueFormatter *formatter=[[IntAxisValueFormatter alloc]init];
- [formatter setTitle:paymentFeesXArray];
-
- [self drawSingleBarchart:paymentFeesYArray chartView:_paymentFeesChartView axisValueFormatter:formatter xAxisLabelCount:paymentFeesXArray.count maximumValue:maximumValue minimumValue:minimumValue paymentFeesIdArray:paymentFeesYIdArray];
- }
- else
- {
- [_paymentFeesChartView clear];
- [_paymentFeesChartView notifyDataSetChanged];
- }
- }
- }
- -(void)onPaymentFeesLoadFail:(ASIDownManager *)sender {
- [self stopLoading];
- [self showAlertViewText:@"网络异常"];
- }
- -(void)onProcurementStatusLoadFinish:(ASIDownManager *)sender {
- count++;
- if(count>=3)
- {
- [self stopLoading];
- }
- RequestResultModel *resultModel = [RequestResultModel dk_modelWithJSON:sender.mWebStr];
- int status= resultModel.status;
- if(status==0)
- {
- NSDictionary *resultDic=(NSDictionary*)resultModel.result;
- NSArray *resultArray=[resultDic objectForKey:@"Table"];
- NSArray *resultArray1=[resultDic objectForKey:@"Table1"];
- double totalPlanAmount=0;
- NSString *totalPlanAmountStr;
- if(resultArray1!=nil&&resultArray1.count>0)
- {
- NSDictionary *resultDic1=[resultArray1 objectAtIndex:0];
- totalPlanAmount= [[resultDic1 objectForKey:@"PlanAmount"]doubleValue];
- totalPlanAmountStr =[NSString stringWithFormat:@"%.2f",totalPlanAmount];
- }
- if(resultArray!=nil&&resultArray.count>0)
- {
-
- double totalOrderAmount=0;
- NSMutableArray *orderAmountArray=[[NSMutableArray alloc]init];
- for(int i=0;i<resultArray.count;i++)
- {
- NSDictionary *dic=[resultArray objectAtIndex:i];
- double planAmount=[[dic objectForKey:@"PlanAmount"]doubleValue];
- double orderAmount=[[dic objectForKey:@"OrderAmount"]doubleValue];
- totalOrderAmount+=orderAmount;
- NSString *procurementCategoryName=[dic objectForKey:@"BrandName"];
- NSMutableDictionary *orderDic=[[NSMutableDictionary alloc]init];
- NSString *planAmountStr=[NSString stringWithFormat:@"%.2f",planAmount];
- [orderAmountArray addObject:planAmountStr];
- NSString *orderAmountStr=[NSString stringWithFormat:@"%.2f",orderAmount];
- [orderAmountArray addObject:orderAmountStr];
- [orderDic setObject:orderAmountStr forKey:@"OrderAmount"];
- [orderDic setObject:planAmountStr forKey:@"PlanAmount"];
- [procurementStatusYArray addObject:orderDic];
- [procurementStatusXTitleArray addObject:procurementCategoryName];
-
- }
-
- NSString *totalOrderAmountStr=[NSString stringWithFormat:@"%.2f",totalOrderAmount];
-
- lblPlanAmount.text=[Util thousandSeparatorFormat:totalPlanAmountStr];
- lblProcurementAmount.text=[Util thousandSeparatorFormat:totalOrderAmountStr];
- double percent=(totalOrderAmount/totalPlanAmount)*100;
- NSString *percentStr=[NSString stringWithFormat:@"%.2f",percent];
- lblProcuremmentPercent.text=[NSString stringWithFormat:@"%@%@%@",@"完成率",percentStr,@"%"];
- percent=[percentStr doubleValue];
- [procurementStatusV progress:percent];
-
- double maximumValue=[self getYAxisMaximumValue:orderAmountArray];
- double minimumValue=[self getYAxisMinimumValue:orderAmountArray];
- IntAxisValueFormatter *formatter= [[IntAxisValueFormatter alloc] init];
- [formatter setTitle:procurementStatusXTitleArray];
-
- [self drawTwoBarchart:procurementStatusYArray receivablesTitleArray:procurementStatusTitleArray barChartView:_procurementStatusChartView axisValueFormatter:formatter xAxisLabelCount:procurementStatusXTitleArray.count maximumValue:maximumValue minimumValue:minimumValue];
- }
- else{
- [_procurementStatusChartView clear];
- [_procurementStatusChartView notifyDataSetChanged];
- }
-
- }
-
- }
- -(void)onProcurementStatusLoadFail{
- [self stopLoading];
- [self showAlertViewText:@"网络连接异常"];
- }
- /**
- 库存状态加载完成
- */
- -(void)onInventoryStatusLoadFinish:(ASIDownManager *)sender {
-
- RequestResultModel *resultModel = [RequestResultModel dk_modelWithJSON:sender.mWebStr];
- int iStatus = resultModel.status;
- count++;
- if(count>=3)
- {
- [self stopLoading];
- }
-
- if(iStatus==0)
- {
- NSDictionary *resultDic= (NSDictionary*)resultModel.result;
- NSArray *resultArray= [resultDic objectForKey:@"Table"];
- if(resultArray!=nil&&resultArray.count>0)
- {
- double totalInventoryQuantity=0;
- double totalInventoryAmount=0;
- for(int i=0;i<resultArray.count;i++)
- {
- NSDictionary *dic=[resultArray objectAtIndex:i];
- double inventoryAmountValue=[[dic objectForKey:@"InventoryAmount"]doubleValue];double inventoryQuantityValue=[[dic objectForKey:@"InventoryQuantity"]doubleValue];
- totalInventoryQuantity+=inventoryQuantityValue;
- totalInventoryAmount+=inventoryAmountValue;
- NSString *kindName=[dic objectForKey:@"KindName"];
- [inventoryTitleArray addObject:kindName];
- NSString *inventoryAmountStr=[NSString stringWithFormat:@"%.2f",inventoryAmountValue];
-
- NSString *inventoryQuantityStr=[NSString stringWithFormat:@"%.2f",inventoryQuantityValue];
- [inventoryAmountArray addObject:inventoryAmountStr];
- [inventoryQuantityArray addObject:inventoryQuantityStr];
- }
-
- NSString *totalInventoryQuantityStr= [NSString stringWithFormat:@"%.2f",totalInventoryQuantity];
-
- totalInventoryQuantityStr= [Util thousandSeparatorFormat:totalInventoryQuantityStr];
- lblInventoryQuantity.text=totalInventoryQuantityStr;
- NSString *totalInventoryAmountStr=[NSString stringWithFormat:@"%.2f",totalInventoryAmount];
- totalInventoryAmountStr= [Util thousandSeparatorFormat:totalInventoryAmountStr];
- lblInventoryAmount.text=totalInventoryAmountStr;
-
- [self drawPieView:inventoryAmountArray pieTitleArray:inventoryTitleArray pieView:_pieView];
-
-
- }
-
- else{
- [_pieView clear];
- [_pieView notifyDataSetChanged];
- }
-
- }
- }
- /**
- 库存状态加载失败
- */
- -(void)onInventoryStatusLoadFail:(ASIDownManager *)sender {
- [self stopLoading];
- [self showAlertViewText:@"网络异常"];
- }
- /**
- 应付情况加载完成
- */
- -(void)onPayableLoadFinish:(ASIDownManager *)sender {
- count++;
- if(count>=3)
- {
- [self stopLoading];
- }
-
- RequestResultModel *resultModel = [RequestResultModel dk_modelWithJSON:sender.mWebStr];
- int iStatus = resultModel.status;
- if(iStatus==0)
- {
- NSDictionary *resultDic= (NSDictionary*)resultModel.result;
-
- NSMutableArray *yAxisArray=[[NSMutableArray alloc]init];
- if(resultDic!=nil)
- {
- NSArray *resultArray= [resultDic objectForKey:@"Table"];
- NSMutableArray *yAxisArray=[[NSMutableArray alloc]init];
- if(resultArray!=nil&&resultArray.count>0)
- {
- double totalAccountPayable=0;
- double totalAdvanceMoney=0;
- for(int i=0;i<resultArray.count;i++)
- {
- NSDictionary *dic=[resultArray objectAtIndex:i];
- double accountPayableValue=[[dic objectForKey:@"AccountPayable"]doubleValue];
-
- NSString * accountPayable=[NSString stringWithFormat:@"%.2f",accountPayableValue];
-
- [yAxisArray addObject:accountPayable];
- totalAccountPayable+=accountPayableValue;
- double advanceMoneyValue=[[dic objectForKey:@"AdvanceMoney"]doubleValue];
- NSString *advanceMoney=[NSString stringWithFormat:@"%.2f",advanceMoneyValue];
- [yAxisArray addObject:accountPayable];
-
- totalAdvanceMoney+=advanceMoneyValue;
- NSString *name=[dic objectForKey:@"Name"];
- [payableXTitleArray addObject:name];
-
- NSMutableDictionary *payableDic=[[NSMutableDictionary alloc]init];
- [payableDic setObject:accountPayable forKeyedSubscript:@"AccountReceivable"];
- [yAxisArray addObject:accountPayable];
- [payableDic setObject:advanceMoney forKeyedSubscript:@"AdvanceMoney"];
-
- [advancePaymentValuesArray addObject:payableDic];
- }
-
- NSString *totalAccountPayableStr= [NSString stringWithFormat:@"%.2f",totalAccountPayable];
-
- totalAccountPayableStr= [Util thousandSeparatorFormat:totalAccountPayableStr];
- lblAccountsPayable.text=totalAccountPayableStr;
-
- NSString *totalAdvanceMoneyStr= [NSString stringWithFormat:@"%.2f",totalAdvanceMoney];
-
- totalAdvanceMoneyStr= [Util thousandSeparatorFormat:totalAdvanceMoneyStr];
-
- lblAdvancePaymentAmount.text=totalAdvanceMoneyStr;
-
- double maximumValue=[self getYAxisMaximumValue:yAxisArray];
- double minimumValue=[self getYAxisMinimumValue:yAxisArray];
- IntAxisValueFormatter *formatter= [[IntAxisValueFormatter alloc] init];
- [formatter setTitle:payableXTitleArray];
-
- [self drawTwoBarchart:advancePaymentValuesArray receivablesTitleArray:advancePaymentTitleArray barChartView:_payableChartView axisValueFormatter:formatter xAxisLabelCount:payableXTitleArray.count maximumValue:maximumValue minimumValue:minimumValue];
-
- }
- else{
- [ _payableChartView clear];
- [_payableChartView notifyDataSetChanged];
- }
- }
- }
- }
- /**
- 应付情况加载失败
- */
- -(void)onPayableLoadFail:(ASIDownManager *)sender {
- [self stopLoading];
- [self showAlertViewText:@"网络异常"];
-
- }
- /**
- 往来情况加载完成
- */
- -(void)onCurrentSituationLoadFinish:(ASIDownManager *)sender {
- count++;
- if(count>=3)
- {
- [self stopLoading];
- }
- RequestResultModel *resultModel = [RequestResultModel dk_modelWithJSON:sender.mWebStr];
- int iStatus = resultModel.status;
- if(iStatus==0)
- {
-
- NSDictionary *resultDic= (NSDictionary*)resultModel.result;
- if(resultDic!=nil)
- {
- NSArray *resultArray= [resultDic objectForKey:@"Table"];
- NSMutableArray *yAxisArray=[[NSMutableArray alloc]init];
- if(resultArray!=nil&&resultArray.count>0)
- {
- double totalAccountReceivable=0;
- double totalBalanceAmount=0;
- double totalDepositReceived=0;
- double totalEarnest=0;
- for(int i=0;i<resultArray.count;i++)
- {
- NSDictionary *dic=[resultArray objectAtIndex:i];
- double accountReceivableValue=[[dic objectForKey:@"AccountReceivable"]doubleValue];
-
- NSString *accountReceivable=[NSString stringWithFormat:@"%.2f",accountReceivableValue];
- [yAxisArray addObject:accountReceivable];
- double balanceAmountValue=[[dic objectForKey:@"BalanceAmount"]doubleValue];
- double depositReceivedValue=[[dic objectForKey:@"DepositReceived"]doubleValue];
-
- NSString *depositReceived=[NSString stringWithFormat:@"%.2f",depositReceivedValue];
- [yAxisArray addObject:depositReceived];
- NSMutableDictionary *accountReceivableDic=[[NSMutableDictionary alloc]init];
- [accountReceivableDic setObject:accountReceivable forKeyedSubscript:@"AccountReceivable"];
-
- [accountReceivableDic setObject:depositReceived forKeyedSubscript:@"DepositReceived"];
-
- [receivablesValuesArray addObject:accountReceivableDic];
-
- double earnestValue=[[dic objectForKey:@"Earnest"]doubleValue];
- NSString *name=[dic objectForKey:@"Name"];
-
- [receivableXTitleArray addObject:name];
- totalAccountReceivable+=accountReceivableValue;
- totalBalanceAmount+=balanceAmountValue;
- totalDepositReceived+=depositReceivedValue;
- totalEarnest+=earnestValue;
- }
-
-
- NSString *totalAccountReceivableStr= [NSString stringWithFormat:@"%.2f",totalAccountReceivable];
- totalAccountReceivableStr= [Util thousandSeparatorFormat:totalAccountReceivableStr];
-
- lblReceivablesAmount.text=totalAccountReceivableStr;
-
- NSString *totalEarnestStr=[NSString stringWithFormat:@"%.2f",totalEarnest];
- totalEarnestStr= [Util thousandSeparatorFormat:totalEarnestStr];
-
- lblDepositAmount.text=totalEarnestStr;
-
- NSString *totalDepositReceivedStr= [NSString stringWithFormat:@"%.2f",totalDepositReceived];
-
- totalDepositReceivedStr= [Util thousandSeparatorFormat:totalDepositReceivedStr];
-
- lblAdvancePayment.text=totalDepositReceivedStr;
-
- NSString *totalBalanceAmountStr= [NSString stringWithFormat:@"%.2f",totalBalanceAmount];
-
- totalBalanceAmountStr= [Util thousandSeparatorFormat:totalBalanceAmountStr];
-
- lblReceivablesAdvanceDeposit.text=totalBalanceAmountStr;
-
- double maximumValue=[self getYAxisMaximumValue:yAxisArray];
- double minimumValue=[self getYAxisMinimumValue:yAxisArray];
-
- IntAxisValueFormatter *formatter= [[IntAxisValueFormatter alloc] init];
- [formatter setTitle:receivableXTitleArray];
-
-
- [self drawTwoBarchart:receivablesValuesArray receivablesTitleArray:receivableTitleArray barChartView:_currentSituationChartView axisValueFormatter:formatter xAxisLabelCount:receivableXTitleArray.count maximumValue:maximumValue minimumValue:minimumValue];
-
-
- }
- else{
- [_currentSituationChartView clear];
- [_currentSituationChartView notifyDataSetChanged];
- }
- }
-
-
- }
- }
- /**
- 往来情况加载失败
- */
- -(void)onCurrentSituationLoadFail:(ASIDownManager *)sender {
- [self stopLoading];
- [self showAlertViewText:@"网络异常"];
- }
- /**
- 货币资金加载完成
- */
- -(void)onAccountCashsDataLoadFinish:(ASIDownManager *)sender {
- ++count;
- if(count>=3)
- {
- [self stopLoading];
- }
- RequestResultModel *resultModel = [RequestResultModel dk_modelWithJSON:sender.mWebStr];
- int iStatus = resultModel.status;
- if(iStatus==0)
- {
- NSDictionary *resultDic= (NSDictionary*)resultModel.result;
- NSArray *resultArray=[resultDic objectForKey:@"Table"];
- double totalInComeAmount=0;
- double totalPayAmount=0;
-
- double totalMoneytoryAssets=0;
-
- double totalNetIncome=0;
-
- double inventoryCash=0;
- double bankDeposit=0;
- double otherMoneytoryAssets=0;
- if(resultArray!=nil&&resultArray.count>0)
- {
- NSMutableArray *yAxisArray=[[NSMutableArray alloc]init];
- for(int i=0;i<resultArray.count;i++)
- {
- NSDictionary *dic=[resultArray objectAtIndex:i];
- //借
- double incomeAmount=[[dic objectForKey:@"DebitAmount"]doubleValue];
- totalInComeAmount+=incomeAmount;
- //贷
- double payAmount=[[dic objectForKey:@"CreditAmount"]doubleValue];
- totalPayAmount+=payAmount;
- NSString *subjectCode=[dic objectForKey:@"CapitalAccountTypeName"];
-
-
- double amount=[[dic objectForKey:@"Amount"]doubleValue];
- if([subjectCode containsString:@"现金"])
- {
- inventoryCash=amount;
- }
-
- if([subjectCode containsString:@"银行"])
- {
- bankDeposit=amount;
- }
- if([subjectCode containsString:@"其他"])
- {
- otherMoneytoryAssets=amount;
- }
-
- totalMoneytoryAssets+=amount;
- }
-
-
- totalNetIncome=totalInComeAmount-totalPayAmount;
- NSString * totalNetIncomeStr=[NSString stringWithFormat:@"%.2f",totalNetIncome];
-
-
- NSString * totalMoneytoryAssetsStr=[NSString stringWithFormat:@"%.2f",totalMoneytoryAssets];
-
- NSString * totalInComeAmountStr=[NSString stringWithFormat:@"%.2f",totalInComeAmount];
- NSString *totalPayAmountStr=[NSString stringWithFormat:@"%.2f",totalPayAmount];
- [yAxisArray addObject:totalInComeAmountStr];
- [yAxisArray addObject:totalPayAmountStr];
- double maximumValue= [self getYAxisMaximumValue:yAxisArray];
- double minimumValue=[self getYAxisMinimumValue:yAxisArray];
- [netMoneyValues addObject:totalInComeAmountStr];
- [netMoneyValues addObject:totalPayAmountStr];
- NetMoneyInflowAxisValueFormatter *netMoneyFormatter=[[NetMoneyInflowAxisValueFormatter alloc]init];
-
-
- totalMoneytoryAssetsStr= [Util thousandSeparatorFormat:totalMoneytoryAssetsStr];
- lblMonetoryCapitalAmount.text=totalMoneytoryAssetsStr;
-
-
-
- NSString *inventoryCashStr= [NSString stringWithFormat:@"%.2f",inventoryCash];
-
- inventoryCashStr= [Util thousandSeparatorFormat:inventoryCashStr];
-
- lblCashInHand.text=inventoryCashStr;
-
- NSString *bankDepositStr= [NSString stringWithFormat:@"%.2f",bankDeposit];
-
- bankDepositStr= [Util thousandSeparatorFormat:bankDepositStr];
-
- lblBankDeposit.text=bankDepositStr;
-
- NSString *otherMoneytoryAssetsStr= [NSString stringWithFormat:@"%.2f",otherMoneytoryAssets];
-
- otherMoneytoryAssetsStr= [Util thousandSeparatorFormat:otherMoneytoryAssetsStr];
-
- lblOtherMonetoryCaiptal.text=otherMoneytoryAssetsStr;
- totalNetIncomeStr= [Util thousandSeparatorFormat:totalNetIncomeStr];
- lblNetMoneyInflow.text=totalNetIncomeStr;
-
- [self drawSingleBarchart:netMoneyValues chartView:_singleChartView axisValueFormatter:netMoneyFormatter xAxisLabelCount:netMoneyValues.count maximumValue:maximumValue minimumValue:minimumValue paymentFeesIdArray:nil];
-
- }
- else{
- [_singleChartView clear];
- [_singleChartView notifyDataSetChanged];
- }
- }
- }
- /**
- 货币资金日期回调
-
- @param datePickerController <#datePickerController description#>
- @param date <#date description#>
- @param dateString <#dateString description#>
- */
- - (void)datePickerController:(ITDatePickerController *)datePickerController didSelectedDate:(NSDate *)date dateString:(NSString *)dateString {
- NSInteger tag = datePickerController.tag;
- if (datePickerController.tag == 100) {
-
-
- NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
- [dateFormatter setDateFormat:@"yyyy-MM"] ;
-
- NSDateFormatter *dateFormatter1 = [[NSDateFormatter alloc] init];
- [dateFormatter1 setDateFormat:@"yyyyMM"];
- //NSDate转NSString
- moneytoryAssetsDate = [dateFormatter1 stringFromDate:date];
- [_btnMonetoryCaitalCustom setTitle: [dateFormatter stringFromDate:date] forState:UIControlStateNormal];
- [self clearMoneytoryAssetsData];
- [self startLoading];
- [self loadtAccountCashsData];
- }
-
- if(datePickerController.tag == 101)
- {
- NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
- [dateFormatter setDateFormat:@"yyyy-MM"] ;
-
- NSDateFormatter *dateFormatter1 = [[NSDateFormatter alloc] init];
- [dateFormatter1 setDateFormat:@"yyyyMM"];
- //NSDate转NSString
- procurementStatusDate = [dateFormatter1 stringFromDate:date];
- [_btnProcurementCustomMonth setTitle: [dateFormatter stringFromDate:date] forState:UIControlStateNormal];
- [procurementStatusYArray removeAllObjects];
- [procurementStatusXTitleArray removeAllObjects];
- [self clearProcuremmentData];
- [self startLoading];
-
- [self loadProcurementStatusData];
- }
-
- if(datePickerController.tag == 102)
- {
- NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
- [dateFormatter setDateFormat:@"yyyy-MM"] ;
-
- NSDateFormatter *dateFormatter1 = [[NSDateFormatter alloc] init];
- [dateFormatter1 setDateFormat:@"yyyyMM"];
- //NSDate转NSString
- paymentFeesDate = [dateFormatter1 stringFromDate:date];
- [_btnPaymentFeesCustomMonth setTitle: [dateFormatter stringFromDate:date] forState:UIControlStateNormal];
-
- [paymentFeesYArray removeAllObjects];
- [paymentFeesYIdArray removeAllObjects];
- [paymentFeesXArray removeAllObjects];
- [self clearPaymentFeesData];
- [self startLoading];
- [self loadPaymentFeesData];
- }
-
- }
- /**
- 货币资金数据加载失败
- */
- -(void)onAccountCashsDataLoadFail:(ASIDownManager *)sender {
- [self stopLoading];
- [self showAlertViewText:@"网络异常"];
- }
- //-(void)onFNCAccountLoadFinish:(ASIDownManager *)sender {
- // // [self stopLoading];
- // RequestResultModel *resultModel = [RequestResultModel dk_modelWithJSON:sender.mWebStr];
- // int iStatus = resultModel.status;
- // if(iStatus==0)
- // {
- // fncArray=(NSArray*)resultModel.result;
- // if(fncArray!=nil&&fncArray.count>0)
- // {
- // NSDictionary *resultDic=[fncArray objectAtIndex:0];
- // int accountIdValue=[[resultDic objectForKey:@"AccountID"]intValue];
- // accountCode=[resultDic objectForKey:@"AccountCode"];
- // accountId =[NSString stringWithFormat:@"%d",accountIdValue];
- // [btnFncAccount setTitle:accountCode forState:UIControlStateNormal];
- //
- // }
- // }
- //
- //}
- //-(void)goFncAccount
- //{
- // CustomerReportTextVC *tc = [[CustomerReportTextVC alloc] init];
- // tc.delegate=self;
- // tc.jsonArr=fncArray;
- // tc.showDialogViewTag=ReportFncAccount;
- // [self.navigationController pushViewController:tc animated:YES];
- //}
- //-(void)onFNCAccountLoadFail:(ASIDownManager *)sender {
- // // [self stopLoading];
- //}
- //- (void)customerReportTextDoneDatas:(CustomerReportTextInfoModel *)model CustomerReport:(CustomerReport)cr{
- // if (model == nil) {
- // return;
- // }
- //
- // //渠道返回值
- // if(cr == ReportFncAccount){
- // accountId=model.idCode;
- // accountCode=model.name;
- // [btnFncAccount setTitle:model.name forState:UIControlStateNormal];
- //
- // }
- //
- //}
- /**
- 销售利润加载完成
- */
- - (void)onSalesProfitLoadFinish:(ASIDownManager *)sender {
- // 取消进度条
- count++;
- if(count>=3)
- {
- [self stopLoading];
- }
- // 服务器返回数据
- RequestResultModel *resultModel = [RequestResultModel dk_modelWithJSON:sender.mWebStr];
- // 服务器返回数据状态值
- int iStatus = resultModel.status;
- // 服务器返回数据消息
- NSString *message = resultModel.message;
- // ++count;
-
- [self stopLoading];
-
- // 服务器返回数据状态值正确
- if (iStatus == 0)
- {
- NSDictionary *result=(NSDictionary*)resultModel.result;
- if(result!=nil)
- {
- NSArray *resultArray=[result objectForKey:@"Table"];
- if(resultArray!=nil&&resultArray.count>0)
- {
- double totalNetProfitRate=0;
- double totalSalesIncome=0;
- double totalSalesCost=0;
- double totalFeeAmount=0;
- double totalNetProfit=0;
- double totalMariProfit=0;
- double totalMariProfitRate=0;
- NSMutableArray *yAxisArray=[[NSMutableArray alloc]init];
- for(int i=0;i<resultArray.count;i++)
- {
- NSDictionary *resultDic=[resultArray objectAtIndex:i];
- double amountValue=[[resultDic objectForKey:@"Amount"]doubleValue];
- totalSalesIncome+=amountValue;
- NSString *amount=[NSString stringWithFormat:@"%.2f",amountValue];
- double costAmountValue=[[resultDic objectForKey:@"CostAmount"]doubleValue];
- totalSalesCost+=costAmountValue;
- NSString *costAmount=[NSString stringWithFormat:@"%.2f",costAmountValue];
-
- double feeAmountValue=[[resultDic objectForKey:@"FeeAmount"]doubleValue];
- totalFeeAmount+=feeAmountValue;
- NSString *feeAmount=[NSString stringWithFormat:@"%.2f",feeAmountValue];
-
- double mariProfitValue=[[resultDic objectForKey:@"MariProfit"]doubleValue];
-
- totalMariProfit+=mariProfitValue;
- NSString *mariProfit=[NSString stringWithFormat:@"%.2f",mariProfitValue];
- NSString *name=[resultDic objectForKey:@"Name"];
- [salesProfitTitleArray addObject:name];
- double profitValue=[[resultDic objectForKey:@"Profit"]doubleValue];
- totalNetProfit+=profitValue;
- NSString *profit=[NSString stringWithFormat:@"%.2f",profitValue];
-
- NSMutableDictionary *salesIncomeDic=[[NSMutableDictionary alloc]init];
- [salesIncomeDic setObject:amount forKeyedSubscript:@"Amount"];
- [salesIncomeDic setObject:costAmount forKeyedSubscript:@"CostAmount"];
-
- [salesIncomeDic setObject:feeAmount forKeyedSubscript:@"FeeAmount"];
- [salesIncomeYValues addObject:salesIncomeDic];
-
- [yAxisArray addObject:amount];
-
- [yAxisArray addObject:costAmount];
-
- [yAxisArray addObject:feeAmount];
- }
-
- double maximumValue= [self getYAxisMaximumValue:yAxisArray];
- double minimumValue=[self getYAxisMinimumValue:yAxisArray];
- if(totalSalesIncome==0)
- {
- totalMariProfitRate=0;
- }
- else{
- totalMariProfitRate=(totalMariProfit/totalSalesIncome)*100;
- }
- NSString * totalMariProfitRateStr=[NSString stringWithFormat:@"%.2f",totalMariProfitRate];
-
- lblGrossProfitMargin.text=[NSString stringWithFormat:@"%@%@",totalMariProfitRateStr,@"%"];
- if(totalSalesIncome==0)
- {
- totalNetProfitRate=0;
- }
- else{
- totalNetProfitRate =( totalNetProfit/totalSalesIncome)*100;
- }
- NSString * totalNetProfitRateStr=[NSString stringWithFormat:@"%.2f",totalNetProfitRate];
-
- lblNetProfitRate.text=[NSString stringWithFormat:@"%@%@",totalNetProfitRateStr,@"%"];
-
- NSString *totalSalesIncomeStr= [NSString stringWithFormat:@"%.2f",totalSalesIncome];
- totalSalesIncomeStr= [Util thousandSeparatorFormat:totalSalesIncomeStr];
- lblSalesIncome.text=totalSalesIncomeStr;
-
- NSString *totalSalesCostStr=[NSString stringWithFormat:@"%.2f",totalSalesCost];
- totalSalesCostStr= [Util thousandSeparatorFormat:totalSalesCostStr];
- lblSalesCost.text=totalSalesCostStr;
-
- NSString *totalFeeAmountStr= [NSString stringWithFormat:@"%.2f",totalFeeAmount];
- lblFeeAmount.text=[Util thousandSeparatorFormat:totalFeeAmountStr];
-
- NSString *totalNetProfitStr= [NSString stringWithFormat:@"%.2f",totalNetProfit];
- totalNetProfitStr=[Util thousandSeparatorFormat:totalNetProfitStr];
- lblNetProfit.text=totalNetProfitStr;
-
- NSString *totalMariProfitStr= [NSString stringWithFormat:@"%.2f",totalMariProfit];
- totalMariProfitStr=[Util thousandSeparatorFormat:totalMariProfitStr];
- lblSalesMargin.text=totalMariProfitStr;
- IntAxisValueFormatter *formatter= [[IntAxisValueFormatter alloc] init];
- [formatter setTitle:salesProfitTitleArray];
-
- [self drawMultipleBarchart:salesIncomeYValues receivablesTitleArray:salesIncomeTitleArray barChartView:_chartView axisValueFormatter:formatter xAxisLabelCount:salesProfitTitleArray.count maximumValue:maximumValue+100 minimumValue:minimumValue];
-
- }
- else
- {
-
- [_chartView clear];
- [_chartView notifyDataSetChanged];
-
- }
-
- }
-
-
- }
- }
- /**
- 销售利润加载失败
- * @param sender <#sender description#>
- */
- - (void)onSalesProfitLoadFail:(ASIDownManager *)sender {
- [self stopLoading];
- [self showAlertViewText:@"网络异常"];
- }
- /**
- 柱状图选中事件
- */
- - (void)chartValueSelected:(ChartViewBase * __nonnull)chartView entry:(ChartDataEntry * __nonnull)entry highlight:(ChartHighlight * __nonnull)highlight
- {
- if(chartView.tag==1001)
- {
- NSInteger organizationId=entry.id;
- if(organizationId>0)
- {
- self.hidesBottomBarWhenPushed=YES;
- StatisticsDataAnalysisDetailVC *detailVc = [[StatisticsDataAnalysisDetailVC alloc] init];
- detailVc.organizationId=[NSString stringWithFormat:@"%ld",organizationId];
- detailVc.accountMonth=paymentFeesDate;
- detailVc.typeId=@"0";
- [self.navigationController pushViewController:detailVc animated:YES];
-
- }
- else
- {
- NSMutableArray *otherArray=[[NSMutableArray alloc]init];
- for(int i=0;i<paymentFeesYIdArray.count;i++)
- {
- NSString *departmentId=[paymentFeesYIdArray objectAtIndex:i];
- if([departmentId intValue]>0)
- {
- [otherArray addObject:departmentId];
- NSString *departmentIds= [otherArray componentsJoinedByString:@","];
-
- self.hidesBottomBarWhenPushed=YES;
- StatisticsDataAnalysisDetailVC *detailVc = [[StatisticsDataAnalysisDetailVC alloc] init];
- detailVc.organizationId=departmentIds;
- detailVc.accountMonth=paymentFeesDate;
- detailVc.typeId=@"1";
- [self.navigationController pushViewController:detailVc animated:YES];
-
- }
-
- }
- }
-
- }
- }
- /**
- 柱状图反选事件
- */
- - (void)chartValueNothingSelected:(ChartViewBase * __nonnull)chartView
- {
-
- }
- @end
|