daily.vue 446 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443
  1. <template>
  2. <section >
  3. <!--列表-->
  4. <div>
  5. <el-card class="box-card daily" shadow="never">
  6. <div style="position: relative;margin-top: -20px;margin-bottom: 20px">
  7. <div class="jjk" style="display:inline-block;position:absolute;top:15px;background:#fff;left:0px;z-index: 10;margin-top: -10px;padding-top: 10px;height: 42px;">
  8. <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
  9. style="width:190px;"
  10. @change="changeMonthOut" :clearable="false" type="month" :placeholder="$t('Selectmonth')" :picker-options="getPickerOptions"></el-date-picker>
  11. <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showWorkTime"></el-button>
  12. </div>
  13. <div slot="header" class="clearfix" id="clearfix" style="padding-left: 255px;">
  14. <span v-for="(item,index) in allDate" :id="'day'+index" class="date_item"
  15. @click="choseDate(index, item)" :key="index" :style="'padding:0 6px;display: inline-block;width: 55px;text-align: center;' + (canClick(index,item) == false && user.timeType.fillAhead == 0 ? 'color:#c0c0c0;cursor:not-allowed;' : '') ">
  16. <div :style="'display:inline-block;text-align: center;'+(item.state == null?'':'')" >
  17. <div style="text-align:center;"><span :class="statusStyle[item.state]">{{item.showDate}}</span>
  18. <br>
  19. <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
  20. <span class="chooseDate" v-if="index == choseDay"></span>
  21. </div>
  22. </div>
  23. </span>
  24. </div>
  25. </div>
  26. <div style="display:flex;">
  27. <div class="grand flex">
  28. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  29. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  30. <!-- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;margin-bottom:10px">
  31. </div> -->
  32. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  33. <el-input :placeholder="$t('defaultText.PleaseEnterYourName')" size="small" v-model="seluserText" style="width:100%;margin-bottom:10px" clearable>
  34. <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
  35. </el-input>
  36. <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
  37. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  38. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  39. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  40. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  41. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  42. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  43. </el-select>
  44. </div>
  45. <div>
  46. <!-- <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChange" @node-expand="nodeChange" node-key="id" :default-expanded-keys="expandDate" v-loading="dataLoading"> -->
  47. <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChangeCollapse" @node-expand="nodeChangeExpand" ref="treeDataRef" :default-expanded-keys="nodeModelData" node-key="id" v-loading="dataLoading">
  48. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  49. <!-- <span>{{ node.label }}</span> -->
  50. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  51. <span v-if="user.userNameNeedTranslate == '1'">
  52. <span v-if="node.data.children">
  53. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  54. </span>
  55. <span v-else>
  56. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  57. </span>
  58. </span>
  59. <span v-if="user.userNameNeedTranslate != '1'">
  60. {{ node.label }}
  61. </span>
  62. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  63. </span>
  64. <div style="position: absolute;right: 15px;">
  65. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  66. <!-- 未填报 -->
  67. {{$t('state.DidNotFillIn')}}
  68. </span>
  69. <span v-if="data.isUser == 1 && data.state == null && (data.leaveDays || data.leaveTimes)" :style="(data.leaveDays < 1 || data.leaveTimes < user.timeType.allday) ? 'color:red;font-size:13px' : 'color:#32cd32;font-size:13px'">
  70. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  71. {{data.leaveDays ? (data.leaveDays >= 1 ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveDays.toFixed(1) + $t('time.day')+')') : (data.leaveTimes >= user.timeType.allday ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveTimes + 'h)')}}
  72. </span>
  73. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  74. <!-- 待审核 -->
  75. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  76. </span>
  77. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  78. <!-- 已通过 -->
  79. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  80. </span>
  81. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  82. <!-- 未通过 -->
  83. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  84. </span>
  85. <span v-if="data.isUser == 1 && data.state == 3" style="color:#409eff;font-size:13px">
  86. <!-- 待提交 -->
  87. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  88. </span>
  89. </div>
  90. </span>
  91. </el-tree>
  92. </div>
  93. </div>
  94. </div>
  95. <div class="line line-second" style="display:flex;justify-content: center;align-items: center;position: relative;left: -9px;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  96. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  97. -
  98. -
  99. -
  100. </div>
  101. </div>
  102. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  103. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  104. <div class="allDaily" style="float:left;flex-grow:1">
  105. <!--系统管理员和部门负责人 -->
  106. <div class="report_title" style="display:flex;justify-content: space-between;">
  107. <span>
  108. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  109. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  110. <!-- {{depData != null ?depData.label:""}} -->
  111. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  112. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='depData.label'></ww-open-data></span>
  113. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='depData.label'></ww-open-data></span>
  114. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  115. <span v-if="targetUid == null">
  116. <!-- - 已提交 -->
  117. -{{$t('state.hasBeenSubmitted')}}
  118. <el-link :underline="false" @click="showMembList(1)"><span style="margin-left:5px;margin-right:5px;color:green;">{{fillList.filter(item => item.state != 3).length}}</span></el-link>{{$t('other.people')}},
  119. <!-- 待提交 -->
  120. {{$t('state.waitingsubmit')}}
  121. <el-link :underline="false" @click="showMembList(2)"><span style="margin-left:5px;margin-right:5px;color:green;">{{fillList.filter(item => item.state == 3).length}}</span></el-link>{{$t('other.people')}},
  122. <!-- 漏填 -->
  123. <!-- {{$t('state.missFillReport')}} -->
  124. 未填
  125. <el-link :underline="false" @click="showMembList(0)"><span style="margin-left:5px;margin-right:5px;color:red;">{{(unFillList.length - leaveAllNum) | numbers}}</span>{{$t('other.people')}}
  126. <span v-if="leaveAllNum">{{', 全天请假' + leaveAllNum + '人'}}</span></el-link>
  127. </span>
  128. </span>
  129. </span>
  130. <span style="float:right;">
  131. <el-link type="primary" v-if="user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
  132. <el-link v-if="reportTimeType.type != 0 && user.companyId != yuzhongCompId && user.timeType.enableNewWeeklyfill != 1 && user.companyId != 3092" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
  133. <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link>
  134. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link> -->
  135. <el-link type="primary" v-if="permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,2)">{{$t('textLink.helpToFillIn')}}</el-link>
  136. <el-link type="primary" v-if="permissions.reportBatch && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">{{$t('textLink.batchFillIn')}}</el-link>
  137. <el-link type="primary" v-if="user.companyId != yuzhongCompId && (permissions.importReport || user.manageDeptId != 0)" style="margin-right:10px;" :underline="false" @click="imports()">{{$t('textLink.workHoursImport')}}</el-link>
  138. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  139. <!--部门负责人给个导出工时的功能 -->
  140. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  141. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">推送工时</el-link>
  142. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">工时推送日志</el-link>
  143. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  144. </span>
  145. </div>
  146. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  147. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  148. <i class="fa fa-circle"></i>
  149. <!-- {{item1.name}} -->
  150. <span v-if="user.userNameNeedTranslate == '1'">
  151. <ww-open-data type='userName' :openid='item1.name'></ww-open-data>
  152. </span>
  153. <span v-if="user.userNameNeedTranslate != '1'">
  154. {{item1.name}}
  155. </span>
  156. <span style="margin-left:30px;">
  157. <span style="margin-right:20px;">
  158. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  159. <!-- 工作总时长: -->
  160. {{$t('other.totalWorkingHours')}}
  161. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  162. <span >{{item1.reportTime | amounts}}</span>h
  163. </span>
  164. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  165. <i class="iconfont firerock-iconliucheng1"></i>
  166. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  167. <!-- 审批流程 -->
  168. {{$t('other.approvalProcess')}}
  169. </span>
  170. </span>
  171. </span>
  172. <div class="checkbtn" style="padding-right:20px;">
  173. <!--编辑和删除日报-->
  174. <el-button v-if="item1.state >= 2 && user.id == item1.id && user.timeType.enableNewWeeklyfill == 1" type="primary" size="small" @click="isSubstitude=false;fillInReportCustom()">{{$t('btn.editWorkReport')}}</el-button>
  175. <el-button v-if="item1.state >= 2 && user.id == item1.id && user.timeType.enableNewWeeklyfill != 1" type="primary" size="small" @click="isSubstitude=false; fillInReport(index1,0)">{{$t('btn.editWorkReport')}}</el-button>
  176. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  177. </div>
  178. <div v-if="user.timeType.enableNewWeeklyfill == 1 && item1.summary != null" style="margin-left:20px;">
  179. <p v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  180. </div>
  181. <div class="one_daily_body">
  182. <el-timeline>
  183. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  184. <el-card shadow="never">
  185. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  186. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  187. <span v-if="user.company.packageEngineering == 0">
  188. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  189. <span v-if="item2.isDeptAudit==0">
  190. <span v-if="item2.projectAuditState==0">
  191. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  192. <span v-if="item2.projectAuditorName != null">(
  193. <!-- {{item2.projectAuditorName}} -->
  194. <span v-if="user.userNameNeedTranslate == '1'">
  195. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  196. </span>
  197. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  198. )</span>
  199. <!-- 审核 --> {{$t('other.audit')}}
  200. </span>
  201. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  202. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  203. <span v-if="item2.projectAuditorName != null">(
  204. <!-- {{item2.projectAuditorName}} -->
  205. <span v-if="user.userNameNeedTranslate == '1'">
  206. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  207. </span>
  208. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  209. )</span>
  210. <!-- 审核通过 --> {{$t('state.approved')}}
  211. </span>
  212. </span>
  213. <span v-else-if="item2.isDeptAudit==1">
  214. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  215. ({{$t('other.await')}}
  216. <span v-if="user.userNameNeedTranslate == '1'">
  217. <ww-open-data type='departmentName' :openid='user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName'></ww-open-data>
  218. </span>
  219. <span v-if="user.userNameNeedTranslate != '1'">{{user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName}}</span>
  220. {{$t('other.audit')}})
  221. </span>
  222. ]</span>
  223. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  224. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  225. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1">{{$t('other.automaticReview')}}</span>
  226. </span>
  227. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  228. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  229. </span>
  230. <!-- <el-button v-if="(user.role == 1 || user.role == 2) && item2.state != 1 && user.manageDeptId != 0" size="mini" @click="guanli(item2, item1)" style="float: right;">删除</el-button> -->
  231. <span v-if="user.company.packageEngineering == 1">
  232. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  233. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  234. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  235. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  236. (
  237. <span v-if="user.userNameNeedTranslate != 1">
  238. {{item2.projectAuditorName}}
  239. </span>
  240. <span v-if="user.userNameNeedTranslate == 1">
  241. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  242. </span>
  243. )
  244. </span>{{$t('other.audit')}} ]</span>
  245. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  246. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  247. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  248. </span>
  249. <!--每个项目上单独审核 -->
  250. <span style="float:right;">
  251. <el-button type="primary" size="small" v-if="item2.state == 1&&user.companyId==3092&&user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime(item2.id)">{{'推送'}}</el-button>
  252. <el-button v-if="item2.state == 0 && (((permissions.projectReportReview || user.id == item2.projectAuditorId) && item2.isDeptAudit==0 && item2.projectAuditState==0) || (item2.isDeptAudit==1 && item2.auditDeptManagerid == user.id))" type="primary" :loading="logining"
  253. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  254. <el-button v-if="item2.state == 0 && (((permissions.projectReportReview ||user.id == item2.projectAuditorId) && item2.isDeptAudit==0 && item2.projectAuditState==0) || (item2.isDeptAudit==1 && item2.auditDeptManagerid == user.id))" type="danger" :loading="logining"
  255. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  256. <el-button v-if="(permissions.projectReportReview ||user.id == item2.projectAuditorId || ((user.timeType.reportAuditType== 5 || user.timeType.reportAuditType== 6)&& (user.id == item2.projectAuditorId || (item2.isDeptAudit == 1 && user.id == item2.auditDeptManagerid)))) && item2.state == 1" type="normal" :loading="logining" size="small"
  257. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  258. <!--自己可以撤回待审核状态的报告 -->
  259. <el-button v-if="user.id == item1.id && (item2.state == 0 || item2.state == -1)" type="normal" :loading="logining" size="small" @click="cancel(item1)">{{$t('btn.withdraw')}}</el-button>
  260. </span>
  261. </p>
  262. <p v-if="user.companyId == yuzhongCompId">
  263. <span>角色:{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  264. <span style="margin-left:10px;">工作职责:{{ item2.extraField2? item2.extraField2Name:''}}</span>
  265. <span style="margin-left:10px;">工作内容:{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  266. <!--任务分组和阶段 -->
  267. <p v-if="item2.groupId != 0">
  268. {{$t('other.taskGroup')}}:{{item2.groupName}}
  269. <span v-if="item2.stage != null && item2.stage != '-' && user.companyId != yuzhongCompId && user.timeType.enableNewWeeklyfill != 1" style="margin-left:10px;">{{$t('other.inputStage')}}:{{item2.stage}}</span>
  270. </p>
  271. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  272. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  273. <!-- 自定义日报文本 -->
  274. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  275. <p v-if="user.company.packageEngineering == 1">
  276. {{$t('other.professionalProgress')}}:
  277. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  278. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  279. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  280. </el-tooltip>
  281. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  282. <i class="iconfont firerock-iconshenhetongguo"></i>
  283. </el-tooltip>
  284. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  285. <i class="iconfont firerock-iconshenhebohui"></i>
  286. </el-tooltip>
  287. </span>
  288. </p>
  289. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  290. <span style="margin-left:10px;" v-if="user.companyId==3092">-- 服务:{{ item2.sapServiceName }}</span>
  291. </p>
  292. <div v-if="item2.multiWorktime==0">
  293. <p style="display: inline-block;">{{$t('time.duration')}}:
  294. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  295. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  296. {{item2.time.toFixed(1)}}h
  297. <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{$t('other.WorkOvertime')}}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag>
  298. </p>
  299. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  300. </div>
  301. <div v-if="item2.multiWorktime==1" >
  302. <p>{{$t('other.projectDuration')}}:{{item2.time.toFixed(1)}}h <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{ $t('other.WorkOvertime') }}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag></p>
  303. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  304. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  305. <p style="display: inline-block;">{{$t('time.duration')}}:
  306. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  307. {{timeItem.time.toFixed(1)}}h
  308. </p>
  309. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  310. </div>
  311. </div>
  312. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  313. <!--照片的显示 -->
  314. <p v-if="item2.pics != null && item2.pics.length > 0">
  315. <el-image v-for="(pic, index) in item2.pics" :key="index"
  316. style="width: 100px; height: 100px; margin-right:10px;"
  317. :src="pic"
  318. :preview-src-list="item2.pics">
  319. </el-image>
  320. </p>
  321. </el-card>
  322. </el-timeline-item>
  323. </el-timeline>
  324. </div>
  325. </div>
  326. <div v-if="hasMore && !listLoading" style="width:100%;font-size:17px;text-align:center;padding-bottom:15px;"><el-link @click="reqMore" :underline=false style="color:#20a0ff;">加载更多日报</el-link></div>
  327. <!-- 简陋的无报告提示 -->
  328. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  329. </div>
  330. </div>
  331. </div>
  332. </div>
  333. </div>
  334. </el-card>
  335. </div>
  336. <!-- 工时推送日志弹窗 -->
  337. <el-dialog title="工时推送日志" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  338. <template>
  339. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">导出</el-button>
  340. </template>
  341. <template>
  342. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  343. <el-table-column prop="syncTime" label="推送时间" width="150"></el-table-column>
  344. <el-table-column prop="remark" label="推送名称" width="180"></el-table-column>
  345. <el-table-column prop="operator" label="操作人员" width="150"></el-table-column>
  346. <el-table-column prop="syncType" label="推送方式" width="150"></el-table-column>
  347. <el-table-column prop="result" label="推送结果" width="250">
  348. <template slot-scope="scope">
  349. <span style="color:green;" v-if="scope.row.result.includes('成功')">{{scope.row.result}}</span>
  350. <span style="color:red;" v-if="scope.row.result.includes('失败')">{{scope.row.result}}</span>
  351. </template>
  352. </el-table-column>
  353. <el-table-column prop="resultRemark" label="备注" width="400"></el-table-column>
  354. </el-table>
  355. </template>
  356. <span slot="footer" class="dialog-footer">
  357. <el-button type="primary" @click="pushWorkTimeLogDig = false">关 闭</el-button>
  358. </span>
  359. </el-dialog>
  360. <!-- 填写日报的dialog -->
  361. <el-dialog :title="editTitle[isBatch]" :visible.sync="dialogVisible" width="60%" :close-on-click-modal="false" @closed="guanbi()" :top="'5.5vh'" custom-class="editReportDialog" ref="editReportDialog">
  362. <div style="height: 65vh;overflow: auto;">
  363. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  364. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  365. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  366. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  367. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  368. <span class="spnn" v-if="workForm.userNames">
  369. <span v-for="(item, index) in workForm.userNames" :key="index">
  370. <span><ww-open-data type='userName' :openid='item'></ww-open-data></span>
  371. <span v-if="index < workForm.userNames.length - 1">,</span>
  372. </span>
  373. </span>
  374. <span class="spnn hover" v-else>
  375. {{$t('defaultText.pleaseSelectAsubstitute')}}
  376. </span>
  377. </div>
  378. </el-form-item>
  379. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  380. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  381. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  382. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  383. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  384. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  385. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName" style="margin-left:10px;">{{isBatch==0? $t('other.total'):$t('weekDay.daily')}}{{$t('time.duration')}}:</span>
  386. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  387. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  388. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  389. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  390. <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} <el-input v-model="jsTime" @change="onBatchTimeChange" style="width:80px;"/> {{$t('time.hour')}}</span>
  391. <span v-if="workForm.time">{{$t('other.attendancePunch')}}: {{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
  392. <span v-if="workForm.time.askLeaveTime">|&nbsp;请假{{ workForm.time.askLeaveTime }}小时</span>
  393. </span>
  394. <!--批量填报和批量代填不显示考勤记录-->
  395. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  396. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  397. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">{{',考勤时长'}}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  398. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  399. v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh"
  400. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  401. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  402. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  403. @click="refreshAttendance(workForm.createDate)"></el-button>
  404. <!-- AI智能填报 -->
  405. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >智能填报</el-button>
  406. </el-form-item>
  407. <!-- 000000 -->
  408. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  409. <div v-if="reportTimeType.multiWorktime==0">
  410. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  411. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  412. <el-select v-model="domain.timeType" style="width:200px;"
  413. v-if="reportTimeType.type == 0"
  414. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  415. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  416. @change="onTimeTypeChange(domain.timeType)">
  417. <el-option
  418. v-for="item in timeType"
  419. :key="item.value"
  420. :label="item.label"
  421. :value="item.value">
  422. </el-option>
  423. </el-select>
  424. <!-- 数字时长选择 -->
  425. <el-select v-model="domain.workingTime" style="width:200px;"
  426. v-if="reportTimeType.type == 1"
  427. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  428. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  429. @change="seleChn(0,domain)">
  430. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  431. </el-select>
  432. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  433. <span v-if="reportTimeType.type == 2">
  434. <!--时间范围选择 -->
  435. <el-time-picker
  436. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  437. v-model="domain.startTime"
  438. :placeholder="$t('time.startTime')"
  439. style="width:120px;"
  440. format="HH:mm"
  441. value-format="HH:mm"
  442. :picker-options="{
  443. start: '08:00',
  444. end: '23:30'
  445. }"
  446. @change="iptChang()">
  447. </el-time-picker> - <el-time-picker
  448. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  449. v-model="domain.endTime"
  450. :placeholder="$t('time.endTime')"
  451. style="width:120px;"
  452. format="HH:mm"
  453. value-format="HH:mm"
  454. :picker-options="{
  455. start: '08:00',
  456. end: '23:30',
  457. minTime: domain.startTime
  458. }"
  459. @change="iptChang()">
  460. </el-time-picker>
  461. </span>
  462. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  463. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  464. <el-input :disabled="!domain.canEdit || domain.isOvertime==null || domain.isOvertime==0 || !domain.isOvertime" v-model="domain.overtimeHours" @blur="triggerCalculateOT(index)" @input="domain.overtimeHours=domain.overtimeHours.replace(/[^\d.]/g,'')" style="width: 100px;"></el-input><span style="margin-left:5px">{{$t('time.hour')}}</span>
  465. </div>
  466. </el-form-item>
  467. <el-form-item :label="user.companyId==781? $t('screening.workTasks') : $t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  468. :rules="{ required: true, message: user.companyId==781? $t('defaultText.pleaseSelectaJob'): $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  469. <el-select v-model="domain.projectId" :placeholder="user.companyId==781?$t('defaultText.pleaseSelectaJob'): $t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  470. @change="selectProject(domain, index)"
  471. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  472. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  473. <el-option v-for="item in group.peojectList" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id" :disabled="item.status!=1 && item.status!=4">
  474. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  475. <span style="float: right;">{{ item.projectName }}</span>
  476. </el-option>
  477. </el-option-group>
  478. </el-select>
  479. <!--昱众不显示子项目-->
  480. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  481. <span style="margin-left:45px;">
  482. {{$t('lable.subproject')}}</span>
  483. <!--子项目 -->
  484. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  485. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  486. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  487. </el-select>
  488. </template>
  489. <template v-if="user.companyId == yuzhongCompId">
  490. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">角色选择</span>
  491. <!--角色选择 -->
  492. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  493. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  494. <el-option
  495. v-for="item in roleList"
  496. :key="item.value"
  497. :label="item.label"
  498. :value="item.value">
  499. </el-option>
  500. </el-select>
  501. </template>
  502. <el-link v-if="(index >= 1 || workForm.domains.length > 1)&&domain.canEdit" type="primary" :underline="false" @click="delDomain(index)" style="float:right;margin-right:15%;"
  503. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  504. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  505. </el-link>
  506. <!-- <el-link type="primary" v-if="canEdit"
  507. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  508. </el-form-item>
  509. <el-form-item :label="user.companyId==781? $t('other.describe'):$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  510. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  511. </el-form-item>
  512. <!--如果设置了工时成本预警的预算成本项-->
  513. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  514. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  515. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  516. </el-select>
  517. </el-form-item>
  518. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  519. <template slot="label">
  520. <span style="color:#FF0000;" v-if="user.timeType.reportAuditType == 1 ||user.timeType.reportAuditType == 2">*</span>
  521. <span >{{$t('lable.taskGrouping')}}</span>
  522. </template>
  523. <!-- 任务分组 -->
  524. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  525. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  526. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  527. </el-select>
  528. <template v-if="user.companyId == yuzhongCompId">
  529. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>工作职责</span>
  530. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" placeHolder="请选择"
  531. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  532. <el-option
  533. v-for="item in domain.filteredRespList"
  534. :key="item.id"
  535. :label="item.jobRespon"
  536. :value="item.id">
  537. </el-option>
  538. </el-select>
  539. </template>
  540. <template v-else><!-- 项目的阶段 -->
  541. <span v-if="domain.stages != null && domain.stages.length> 0" style="margin-left:45px;">{{$t('other.inputStage')}}</span>
  542. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  543. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  544. @change="changeStages(domain, index)"
  545. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  546. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  547. </el-select>
  548. </template>
  549. </el-form-item>
  550. <div v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList">
  551. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  552. <template slot="label">
  553. <span style="color:#FF0000;">*</span>
  554. <span >{{user.companyId==781? $t('other.reviewer') : $t('other.projectAuditor')}}</span>
  555. </template>
  556. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  557. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  558. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  559. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  560. </el-option>
  561. </el-select>
  562. <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :subject="domain.auditUserList" :idx="index" :subjectId="domain.projectAuditorId" ref="selectCat" :flg="domain.projectAuditorId ? true : false" :flgs="true" @selectCatCli="selectCatCli" :disabled="!domain.canEdit"></selectCat>
  563. </el-form-item>
  564. </div>
  565. <el-form-item v-if="user.companyId == yuzhongCompId">
  566. <template slot="label">
  567. <span style="color:#FF0000;">*</span>
  568. <span >工作内容</span>
  569. </template>
  570. <el-select v-model="domain.extraField3" style="width:200px;" placeHolder="请选择" @change="$forceUpdate()"
  571. :disabled="(workForm.domains[index].state>=2?false:true)" >
  572. <el-option
  573. v-for="item in domain.workContentList"
  574. :key="item.id"
  575. :label="item.workContext"
  576. :value="item.id">
  577. </el-option>
  578. </el-select>
  579. </el-form-item>
  580. <!-- 111111 -->
  581. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  582. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  583. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  584. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  585. <span v-else>{{item.name}}</span>
  586. </el-option>
  587. </el-select>
  588. <template v-if="user.timeType.auditLevel > 1">
  589. <i class="el-icon-right"></i>
  590. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  591. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  592. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  593. <span v-else>{{item.name}}</span>
  594. </el-option>
  595. </el-select>
  596. </template>
  597. <template v-if="user.timeType.auditLevel > 2">
  598. <i class="el-icon-right"></i>
  599. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  600. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  601. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  602. <span v-else>{{item.name}}</span>
  603. </el-option>
  604. </el-select>
  605. </template>
  606. </el-form-item>
  607. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  608. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  609. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  610. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  611. <span v-else>{{item.name}}</span>
  612. </el-option>
  613. </el-select>
  614. </el-form-item>
  615. <!-- 相关维度/自定义维度 -->
  616. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1 && !yonghuUser.customDegreeMultiple" :rules="user.timeType.customDegreeStatus == 1 && domain.wuduList != undefined && domain.wuduList.length != 0 ? { required: true, message: $t('defaultText.pleaseChoose') + yonghuUser.customDegreeName, trigger: ['change','blur'] } : null" :prop="'domains.' + index + '.degreeId'">
  617. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  618. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  619. </el-option>
  620. </el-select>
  621. </el-form-item>
  622. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1 && yonghuUser.customDegreeMultiple" :rules="user.timeType.customDegreeStatus == 1 && domain.wuduList != undefined && domain.wuduList.length != 0 ? { required: true, message: $t('defaultText.pleaseChoose') + yonghuUser.customDegreeName, trigger: ['change','blur'] } : null" :prop="'domains.' + index + '.multiDegrIdArray'">
  623. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  624. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  625. </el-option>
  626. </el-select>
  627. </el-form-item>
  628. <!-- 相关数值 -->
  629. <el-form-item :label="yonghuUser.customDataName" v-if="yonghuUser.customDataActive == 1" :prop="'domains.' + index + '.customData'" :rules="user.timeType.customDataStatus == 1 ? { type: 'number', required: true, message: $t('defaultText.pleaseFillOut') + yonghuUser.customDataName, trigger: ['change','blur'] } : null">
  630. <el-input-number :id="'numberData_'+index" :disabled="!domain.canEdit" v-model="domain.customData" style="width:200px;" @keyup.native="restrictNumber('numberData_'+index)" :max="user.timeType.customDataMaxStatus == 1 ? user.timeType.customDataMaxValue : 'infinity'"></el-input-number>
  631. </el-form-item>
  632. <!-- 自定义文本 -->
  633. <el-form-item :label="yonghuUser.customTextName" v-if="yonghuUser.customTextActive == 1" :prop="'domains.' + index + '.customText'" :rules="user.timeType.customTextStatus == 1 ? { required: true, message: $t('defaultText.pleaseFillOut') + yonghuUser.customTextName, trigger: ['change','blur'] } : null">
  634. <el-input :disabled="!domain.canEdit" v-model="domain.customText" type="textarea" :rows="1" style="width:75%;margin-right:7%" maxlength="1000" show-word-limit></el-input>
  635. </el-form-item>
  636. <!--按比例填报-->
  637. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  638. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  639. <div style="width:400px;">
  640. <el-col span="14"><el-slider :disabled="!domain.canEdit" v-model="domain.progress" :min="0" :show-tooltip="false" :step="5" style="width:280px;" @input="domain.workingTime = (reportTimeType.allday*domain.progress/100).toFixed(1)" @change="seleChn(0)" show-input="true" input-size="small"></el-slider></el-col>
  641. <el-col :span="isBatch?6:10"><span style="margin-left:10px;float:right;"><span style="margin-right:10px;">{{domain.progress}}%</span><span v-if="isBatch == 0">{{domain.workingTime}}{{$t('time.hour')}}</span></span></el-col>
  642. </div>
  643. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  644. <el-input :disabled="!domain.canEdit || domain.isOvertime==null || domain.isOvertime==0 || !domain.isOvertime" v-model="domain.overtimeHours" @blur="triggerCalculateOT(index)" @input="domain.overtimeHours=domain.overtimeHours.replace(/[^\d.]/g,'')" style="width: 100px;"></el-input><span style="margin-left:5px">{{$t('time.hour')}}</span>
  645. </div>
  646. </el-form-item>
  647. <!--工程专业版本模式下, 各个专业的进度填报 -->
  648. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  649. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  650. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  651. <el-input size="mini" style="width:60px;" v-model="item.progress"
  652. @keyup.native="onProgressChange"
  653. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  654. </span>
  655. </el-form-item>
  656. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  657. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic!=1))" >
  658. <template slot="label" v-if="user.timeType.taskRequired == 1">
  659. <span style="color:#FF0000;">*</span>
  660. <span >任务</span>
  661. </template>
  662. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  663. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  664. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  665. </el-select>
  666. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  667. </el-form-item>
  668. <!--针对依斯贝的SAP服务-->
  669. <el-form-item v-if="user.companyId==3092" label="服务" :prop="'domains.' + index + '.sapServiceId'"
  670. :rules=" { required: true, message: '请选择服务', trigger: 'blur' }">
  671. <el-select v-model="domain.sapServiceId" placeholder="请选择服务" style="width:75%;margin-right:7%" filterable="true"
  672. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  673. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  674. </el-select>
  675. </el-form-item>
  676. <!--工作事项-->
  677. <el-form-item :label="user.companyId==781? $t('other.specificContentAndResults') : $t('other.workMatters') " :prop="'domains.' + index + '.content'"
  678. :rules="user.timeType.workContentState == 1 ? { required: true, message: user.companyId==781? $t('other.tianspecificContentAndResults'):$t('other.tianworkMatters'), trigger: 'blur' } : null">
  679. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  680. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  681. </el-form-item>
  682. <!-- 拍照上传 -->
  683. <el-form-item label="图片上传" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  684. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: '请选择图片', trigger: 'blur' } : null">
  685. <div class="photos">
  686. <div>
  687. <el-upload
  688. list-type="picture-card"
  689. :http-request="(file) => {return addImg(file, index)}"
  690. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  691. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  692. :file-list="domain.imgListUrl" :limit="9"
  693. :disabled="workForm.domains[index].state>=2?false:true">
  694. <i class="el-icon-plus"></i>
  695. </el-upload>
  696. </div>
  697. </div>
  698. </el-form-item>
  699. </div>
  700. <!--多个工作事项填报的情况 -->
  701. <div v-if="reportTimeType.multiWorktime==1">
  702. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  703. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  704. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  705. @change="selectProject(domain, index)"
  706. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  707. <!-- <el-option v-for="item in fillProjectList" :disabled="item.status!=1 && item.status!=4" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id">
  708. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  709. <span style="float: right;">{{ item.projectName }}</span>
  710. </el-option> -->
  711. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  712. <el-option v-for="item in group.peojectList" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id" :disabled="item.status!=1 && item.status!=4">
  713. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  714. <span style="float: right;">{{ item.projectName }}</span>
  715. </el-option>
  716. </el-option-group>
  717. </el-select>
  718. <template v-if="user.timeType.mainProjectState != 1">
  719. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  720. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  721. <!--子项目 -->
  722. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  723. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  724. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  725. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  726. </el-select>
  727. </template>
  728. <el-link v-if="(index >= 1 || workForm.domains.length > 1)&&domain.canEdit" type="primary" :underline="false" @click="delDomain(index)" style="float:right;margin-right:10px;"
  729. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  730. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  731. </el-link>
  732. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  733. <el-input :disabled="!domain.canEdit || domain.isOvertime==null || domain.isOvertime==0 || !domain.isOvertime" v-model="domain.overtimeHours" @blur="triggerCalculateOT(index)" @input="domain.overtimeHours=domain.overtimeHours.replace(/[^\d.]/g,'')" style="width: 100px;"></el-input><span style="margin-left:5px">{{$t('time.hour')}}</span>
  734. </div>
  735. <!-- <el-link type="primary" v-if="canEdit"
  736. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  737. </el-form-item>
  738. <el-form-item :label="user.companyId==781?$t('other.describe'):$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  739. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  740. </el-form-item>
  741. <!--如果设置了工时成本预警的预算成本项-->
  742. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  743. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  744. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  745. </el-select>
  746. </el-form-item>
  747. <el-form-item :label="$t('lable.taskGrouping')" v-if="user.company.packageProject == 1">
  748. <!-- 任务分组 -->
  749. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  750. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  751. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  752. </el-select>
  753. <!-- 项目的阶段 -->
  754. <span v-if="domain.stages != null && domain.stages.length> 0"
  755. style="margin-left:30px;">{{$t('other.inputStage')}}</span>
  756. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  757. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  758. @change="changeStages(domain, index)"
  759. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  760. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  761. </el-select>
  762. </el-form-item>
  763. <el-form-item :label="$t('other.projectAuditor')" >
  764. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  765. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  766. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  767. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  768. </el-option>
  769. </el-select>
  770. <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'small'" :subject="domain.auditUserList" :idx="index" :subjectId="domain.projectAuditorId" ref="selectCat" :flg="true" :flgs="true" @selectCatCli="selectCatCli"></selectCat>
  771. </el-form-item>
  772. <!--工程专业版本模式下, 各个专业的进度填报 -->
  773. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  774. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  775. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  776. <el-input size="mini" style="width:60px;" v-model="item.progress"
  777. @keyup.native="onProgressChange"
  778. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  779. </span>
  780. </el-form-item>
  781. <!-- 相关维度 -->
  782. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1" :rules="user.timeType.customDegreeStatus == 1 && domain.wuduList.length != 0 ? { required: true, message: $t('defaultText.pleaseChoose') + yonghuUser.customDegreeName, trigger: ['change','blur'] } : null" :prop="'domains.' + index + '.degreeId'">
  783. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  784. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  785. </el-option>
  786. </el-select>
  787. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  788. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  789. </el-option>
  790. </el-select>
  791. </el-form-item>
  792. <!-- 相关数值 -->
  793. <el-form-item :label="yonghuUser.customDataName" v-if="domain.projectId && yonghuUser.customDataActive == 1" :prop="'domains.' + index + '.customData'" :rules="user.timeType.customDataStatus == 1 ? { type: 'number', required: true, message: $t('defaultText.pleaseFillOut') + yonghuUser.customDataName, trigger: ['change','blur'] } : null">
  794. <el-input-number :id="'numberData_'+index" :disabled="!domain.canEdit" v-model="domain.customData" style="width:200px;" @keyup.native="restrictNumber('numberData_'+index)" :max="user.timeType.customDataMaxStatus == 1 ? user.timeType.customDataMaxValue : 'infinity'"></el-input-number>
  795. </el-form-item>
  796. <!-- 自定义文本 -->
  797. <el-form-item :label="yonghuUser.customTextName" v-if="yonghuUser.customTextActive == 1" :prop="'domains.' + index + '.customText'" :rules="user.timeType.customTextStatus == 1 ? { required: true, message: $t('defaultText.pleaseFillOut') + yonghuUser.customTextName, trigger: ['change','blur'] } : null">
  798. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  799. </el-form-item>
  800. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  801. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  802. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  803. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  804. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  805. </el-select>
  806. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  807. </el-form-item>
  808. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  809. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  810. <i v-if="tIndex>0&&workForm.domains[index].state>=2" @click="removeTimeItem(domain,tIndex)" class="el-icon-delete" style="position:absolute;right:-7px;top:-7px;font-size:16px;"></i>
  811. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  812. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  813. <span v-if="reportTimeType.type == 2">
  814. <!-- <span> -->
  815. <!--时间范围选择 -->
  816. <el-time-picker
  817. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  818. v-model="timeItem.startTime"
  819. :placeholder="$t('time.startTime')"
  820. style="width:120px;"
  821. format="HH:mm"
  822. value-format="HH:mm"
  823. :picker-options="{
  824. start: '00:00',
  825. end: '23:59',
  826. }"
  827. @change="iptChangs()">
  828. </el-time-picker> - <el-time-picker
  829. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  830. v-model="timeItem.endTime"
  831. :placeholder="$t('time.endTime')"
  832. style="width:120px;"
  833. format="HH:mm"
  834. value-format="HH:mm"
  835. :picker-options="{
  836. start: '00:00',
  837. end: '23:59',
  838. minTime: timeItem.startTime
  839. }"
  840. @change="iptChangs()">
  841. </el-time-picker>
  842. </span>
  843. </el-form-item>
  844. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  845. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  846. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  847. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  848. ></el-input>
  849. </el-form-item>
  850. </div>
  851. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  852. </div>
  853. <!--照片的显示 -->
  854. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  855. <el-image v-for="(pic, index) in domain.pics" :key="index"
  856. style="width: 100px; height: 100px; margin-right:10px;"
  857. :src="pic"
  858. :preview-src-list="domain.pics">
  859. </el-image>
  860. </p>
  861. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  862. </div>
  863. <span id="workFormsItemBottom"></span>
  864. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  865. </el-form>
  866. </div>
  867. <span slot="footer" class="dialog-footer">
  868. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  869. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">合计工时:{{totalReportHours}}小时</span>
  870. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  871. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  872. <el-button v-if="!isSubstitude && !isBatch" @click="submitReport(1)" :loading="submitingReport" :disabled="workForm.domains.length==0?true:(canEdit?false:true)">{{$t('btn.temporaryStorage')}}</el-button>
  873. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  874. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  875. </span>
  876. </el-dialog>
  877. <!-- 按周填报 -->
  878. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  879. <!-- 按周填报-已填工时-点击 -->
  880. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  881. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  882. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  883. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  884. <el-table-column prop="state" :label="$t('state.states')">
  885. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  886. </el-table-column>
  887. <!-- <el-table-column label="操作">
  888. <template slot-scope="scope">
  889. <el-button v-if="scope.row.state == 2 || scope.row.state == 3" size="small" @click="weeklyFilledTimeDelete(scope.row)">删除</el-button>
  890. </template>
  891. </el-table-column> -->
  892. </el-table>
  893. <span slot="footer" class="dialog-footer">
  894. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  895. </span>
  896. </el-dialog>
  897. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px">
  898. <el-form-item style="height:30px;margin-top:-72px;">
  899. <!-- <el-date-picker v-model="weekDateRange" size="small" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="initWeekFormData()" type="daterange" :range-separator="$t('other.to')" :start-placeholder="$t('time.startDate')" :end-placeholder="$t('time.endDate')" style="margin-right: 18px" :clearable="false"></el-date-picker> -->
  900. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  901. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  902. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  903. <!-- <el-button @click="newDates()" size="small">{{$t('time.addedDate')}}</el-button> -->
  904. <el-select v-model="selCon" size="small" multiple :placeholder="$t('defaultText.pleaseChoose')" @change="onSelProjectChange()" filterable style="margin-right:50px;float:right;width:50%;" collapse-tags>
  905. <el-option
  906. v-for="item in fillProjectList"
  907. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  908. :key="item.id"
  909. :label="item.projectName + '\u3000' + item.projectCode"
  910. :value="item.id">
  911. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  912. <span style="float: right">{{ item.projectName }}</span>
  913. </el-option>
  914. </el-select>
  915. <span style="float:right;margin-right:10px;">选择项目</span>
  916. </el-form-item>
  917. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  918. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  919. <template slot-scope="scope">
  920. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  921. </template>
  922. </el-table-column>
  923. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  924. <template slot-scope="scope">
  925. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  926. <p v-else></p>
  927. </template>
  928. </el-table-column> -->
  929. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  930. <template slot-scope="scope">
  931. <div v-if="scope.row.canFill == 1">
  932. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  933. <el-button v-if="scope.row[item.projectName].workingTime != null && scope.row[item.projectName].workingTime != '' && reportTimeType.type == 3 && scope.row[item.projectName].workingTime > 0" type="text" slot="reference">{{scope.row[item.projectName].workingTime}} h<span v-if="scope.row[item.projectName].state != 3" :class="statusStyle[scope.row[item.projectName].state]">({{workReportStateString[scope.row[item.projectName].state]}})</span></el-button>
  934. <el-button v-else-if="scope.row[item.projectName].workingTime != null && scope.row[item.projectName].workingTime != '' && reportTimeType.type == 1 && scope.row[item.projectName].workingTime > 0" type="text" slot="reference">{{scope.row[item.projectName].workingTime}} h<span v-if="scope.row[item.projectName].state != 3" :class="statusStyle[scope.row[item.projectName].state]">({{workReportStateString[scope.row[item.projectName].state]}})</span></el-button>
  935. <el-button v-else-if="scope.row[item.projectName].time != null && scope.row[item.projectName].time != '' && reportTimeType.type == 2" type="text" slot="reference">{{scope.row[item.projectName].time[0]}} - {{scope.row[item.projectName].time[1]}}<span v-if="scope.row[item.projectName].state != 3" :class="statusStyle[scope.row[item.projectName].state]">({{scope.row[item.projectName].workingTime+'h-'+workReportStateString[scope.row[item.projectName].state]}})</span></el-button>
  936. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  937. </div>
  938. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  939. <el-button v-if="scope.row[item.projectName] != null && scope.row[item.projectName].time != null && scope.row[item.projectName].time != '' && reportTimeType.type == 2" type="text" slot="reference">{{scope.row[item.projectName].time[0]}} - {{scope.row[item.projectName].time[1]}}<span v-if="scope.row[item.projectName].state != 3" :class="statusStyle[scope.row[item.projectName].state]">({{scope.row[item.projectName].workingTime+'h-'+hworkReportStateString[scope.row[item.projectName].state]}})</span></el-button>
  940. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  941. </div>
  942. </div>
  943. <div v-else >
  944. <span style="color:#999999;">不可超前填报</span>
  945. </div>
  946. </template>
  947. </el-table-column>
  948. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  949. <template slot-scope="scope">
  950. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}</span>
  951. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  952. </template>
  953. </el-table-column>
  954. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  955. <template slot-scope="scope">
  956. <div class="zhiss">
  957. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  958. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  959. </div>
  960. </template>
  961. </el-table-column>
  962. </el-table>
  963. </el-form>
  964. <span slot="footer" class="dialog-footer" >
  965. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  966. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  967. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  968. <el-button type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  969. </span>
  970. </el-dialog>
  971. <!-- 重庆物奇私人定制的按周填报 -->
  972. <el-dialog :title="'按周填报'" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  973. <div class="fillWeekDialogVisiCustom">
  974. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  975. </div>
  976. </el-dialog>
  977. <!-- 选择时间 -->
  978. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  979. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  980. <span slot="footer" class="dialog-footer">
  981. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  982. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  983. </span>
  984. </el-dialog>
  985. <!-- 按周填报弹窗 -->
  986. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  987. <div>
  988. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  989. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  990. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  991. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  992. </el-select>
  993. </div>
  994. <!--如果设置了工时成本预警的预算成本项-->
  995. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  996. <p>{{$t('lable.budgetSource')}}</p>
  997. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  998. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  999. </el-select>
  1000. </div>
  1001. <!-- 任务分组 -->
  1002. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1003. <p>{{$t('lable.taskGrouping')}}</p>
  1004. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1005. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1006. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1007. </el-select>
  1008. </div>
  1009. <div class="zhoFel" v-if="user.company.packageProject == 1 && zhoBao.stages != null && zhoBao.stages.length> 0">
  1010. <p>{{$t('other.inputStage')}}</p>
  1011. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1012. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1013. </el-select>
  1014. </div>
  1015. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1016. <p>{{$t('other.reviewer')}}</p>
  1017. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1018. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1019. </el-select>
  1020. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1021. </div>
  1022. <template v-if="user.timeType.reportAuditType == 3">
  1023. <div class="zhoFel">
  1024. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1025. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1026. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1027. </el-select>
  1028. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1029. </div>
  1030. <div class="zhoFel">
  1031. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1032. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1033. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1034. </el-select>
  1035. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1036. </div>
  1037. <div class="zhoFel">
  1038. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1039. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1040. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1041. </el-select>
  1042. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1043. </div>
  1044. <div class="zhoFel">
  1045. <p>{{ $t('chao-song-ren') }}</p>
  1046. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1047. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1048. </el-select>
  1049. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1050. </div>
  1051. </template>
  1052. <!-- 自定义维度 -->
  1053. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1054. <p>{{user.timeType.customDegreeName}}</p>
  1055. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1056. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1057. </el-select>
  1058. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1059. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1060. </el-select>
  1061. </div>
  1062. <!-- 自定义数值 -->
  1063. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1064. <p>{{user.timeType.customDataName}}</p>
  1065. <el-input-number :id="'weekData_num'" v-model="zhoBao.customData" style="width:200px;margin-right:155px;" @keyup.native="restrictNumber('weekData_num')" :max="user.timeType.customDataMaxStatus == 1 ? user.timeType.customDataMaxValue : 'infinity'"></el-input-number>
  1066. </div>
  1067. <!-- 自定义文本 -->
  1068. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1069. <p>{{user.timeType.customTextName}}</p>
  1070. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1071. </div>
  1072. <!-- 选择任务 -->
  1073. <div class="zhoFel" v-if="user.company.packageProject==1 && user.company.nonProjectSimple==0">
  1074. <p>任务 / 里程碑</p>
  1075. <el-select v-model="zhoBao.taskId" :placeholder="'请选择'" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1076. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1077. </el-select>
  1078. </div>
  1079. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1080. <p>{{$t('other.timeSelection')}}</p>
  1081. <el-time-picker style="width: 355px" is-range v-model="zhoBao.time" format="HH:mm" value-format="HH:mm" :range-separator="$t('other.to')" @change="$forceUpdate()" :start-placeholder="$t('time.startDate')" :end-placeholder="$t('time.endDate')" :placeholder="$t('time.selectTimeRange')"></el-time-picker>
  1082. </div>
  1083. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1084. <p>{{$t('other.chooseDuration')}}</p>
  1085. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1086. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1087. </el-select>
  1088. </div>
  1089. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1090. <p>{{$t('lable.percentageOfTime')}}</p>
  1091. <div style="width:400px;display: flex;align-items: center;">
  1092. <el-col span="23"><el-slider style="margin-left: 5px;width:299px;" v-model="zhoBao.progress" :min="0" :show-tooltip="false" :step="10" @input="zhoBao.workingTime = (reportTimeType.allday*zhoBao.progress/100).toFixed(1)" show-input="true" input-size="small"></el-slider></el-col>
  1093. <el-col span="10"><span style="float:right;"><span style="margin-right:10px;">{{zhoBao.progress || 0}}%</span>{{zhoBao.workingTime | amounts}}{{$t('time.hour')}}</span></el-col>
  1094. </div>
  1095. </div>
  1096. <div class="zhoFel">
  1097. <p>{{$t('other.workMatters')}}</p>
  1098. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1099. </div>
  1100. </div>
  1101. <span slot="footer" class="dialog-footer">
  1102. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1103. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1104. </span>
  1105. </el-dialog>
  1106. <!--导出报表条件选择 -->
  1107. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1108. <el-form ref="form3" :model="exportParam" >
  1109. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1110. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1111. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1112. </el-select>
  1113. </el-form-item>
  1114. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1115. <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="exportParam.departmentId" :placeholder="$t('other.allDepartments')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 350px;"></el-cascader>
  1116. <vueCascader :size="'medium'" :widthStr="'350'" :clearable="true" :subjectId="exportParam.departmentId" :subject="option" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1117. </el-form-item>
  1118. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1119. <el-date-picker
  1120. v-model="exportParam.dateRange" :editable="false"
  1121. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1122. :range-separator="$t('other.to')"
  1123. type="daterange"
  1124. :start-placeholder="$t('time.startDate')"
  1125. :end-placeholder="$t('time.endDate')"
  1126. ></el-date-picker>
  1127. </el-form-item>
  1128. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1129. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1130. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1131. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1132. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1133. </el-select>
  1134. </el-form-item>
  1135. <el-form-item prop="exportType" :label="'导出方式'" v-if="user.companyId == '936'">
  1136. <div class="exportReportRadio">
  1137. <el-radio v-model="exportType" :label="0">完整导出</el-radio>
  1138. <el-radio v-model="exportType" :label="1">精简导出</el-radio>
  1139. <el-tooltip effect="dark" :content="'精简日报不含工作事项和审批信息,数据量更小导出更快。'" placement="top-start">
  1140. <i class="el-icon-question"></i>
  1141. </el-tooltip>
  1142. </div>
  1143. </el-form-item>
  1144. </el-form>
  1145. <div slot="footer" class="dialog-footer">
  1146. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1147. </div>
  1148. </el-dialog>
  1149. <!--导出报表条件选择 -->
  1150. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1151. <el-form ref="form3" :model="exportParam" >
  1152. <el-form-item prop="range" :label="$t('time.dateRange')">
  1153. <el-date-picker
  1154. v-model="exportParam.dateRange" :editable="false"
  1155. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1156. :clearable="true"
  1157. :range-separator="$t('other.to')"
  1158. type="daterange"
  1159. :start-placeholder="$t('time.startDate')"
  1160. :end-placeholder="$t('time.endDate')"
  1161. ></el-date-picker>
  1162. </el-form-item>
  1163. </el-form>
  1164. <div slot="footer" class="dialog-footer">
  1165. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1166. </div>
  1167. </el-dialog>
  1168. <!--人员列表 -->
  1169. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1170. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1171. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1172. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1173. <el-table-column type="selection"></el-table-column>
  1174. <el-table-column prop="label" :label="$t('lable.name')" >
  1175. <template slot-scope="scope">
  1176. <span>
  1177. <!-- {{(scope.row.leaveDays || scope.row.leaveTimes) ? scope.row.label + (scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)') : scope.row.label}} -->
  1178. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1179. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1180. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1181. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1182. </span>
  1183. <span v-else>
  1184. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1185. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1186. </span>
  1187. </span>
  1188. </template>
  1189. </el-table-column>
  1190. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1191. <template slot-scope="scope">
  1192. <div>
  1193. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1194. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1195. </div>
  1196. </template>
  1197. </el-table-column>
  1198. </el-table>
  1199. </el-tab-pane>
  1200. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1201. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1202. <el-table-column prop="label" :label="$t('lable.name')" >
  1203. <template slot-scope="scope">
  1204. <!-- <span>{{(scope.row.leaveDays || scope.row.leaveTimes) ? scope.row.label + (scope.row.leaveDays ? '(请假' + scope.row.leaveDays + '天 - ' + leaveTypeName[scope.row.leaveType] + ')' : '(请假' + scope.row.leaveTimes + 'h - ' + leaveTypeName[scope.row.leaveType] + ')') : scope.row.label}}</span> -->
  1205. <!-- <span>{{(scope.row.leaveDays || scope.row.leaveTimes) ? scope.row.label + (scope.row.leaveDays ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')') : scope.row.label}}</span> -->
  1206. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1207. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1208. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1209. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1210. </span>
  1211. <span v-else>
  1212. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1213. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1214. </span>
  1215. </template>
  1216. </el-table-column>
  1217. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1218. <template slot-scope="scope">
  1219. <div>
  1220. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1221. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1222. </div>
  1223. </template>
  1224. </el-table-column>
  1225. </el-table>
  1226. </el-tab-pane>
  1227. </el-tabs>
  1228. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1229. <el-table-column type="selection"></el-table-column>
  1230. <el-table-column prop="label" :label="$t('lable.name')" >
  1231. <template slot-scope="scope">
  1232. <div>
  1233. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1234. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1235. </div>
  1236. </template>
  1237. </el-table-column>
  1238. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1239. <template slot-scope="scope">
  1240. <div>
  1241. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1242. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1243. </div>
  1244. </template>
  1245. </el-table-column>
  1246. </el-table>
  1247. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1248. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1249. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1250. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1251. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1252. </div>
  1253. </el-dialog>
  1254. <!-- 按部门选择人员 -->
  1255. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1256. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1257. <el-input v-if="user.userNameNeedTranslate == 1" placeholder="请输入姓名搜索" v-model.trim="nameAearch" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1258. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1259. </el-input>
  1260. <div class="tree" style="height:400px">
  1261. <el-scrollbar style="height:100%">
  1262. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1263. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1264. highlight-current :filter-node-method="filterNode">
  1265. <span class="custom-tree-node" slot-scope="{ node }">
  1266. <span v-if="user.userNameNeedTranslate == '1'">
  1267. <span v-if="node.data.children">
  1268. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  1269. </span>
  1270. <span v-else>
  1271. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  1272. </span>
  1273. </span>
  1274. <span v-if="user.userNameNeedTranslate != '1'">
  1275. {{ node.label }}
  1276. </span>
  1277. <!-- {{ node.label }} -->
  1278. </span>
  1279. </el-tree>
  1280. </el-scrollbar>
  1281. </div>
  1282. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1283. <div slot="footer" class="dialog-footer">
  1284. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1285. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1286. </div>
  1287. </el-dialog>
  1288. <el-dialog
  1289. v-if="monthWorkTimeDialog"
  1290. :visible.sync="monthWorkTimeDialog"
  1291. :close-on-click-modal="false"
  1292. customClass="customWidth selectworktime"
  1293. width="1200px"
  1294. title=""
  1295. >
  1296. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1297. <el-tabs v-model="activeName" @tab-click="handleClick">
  1298. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1299. <div class="selectworktime_export" style="margin-top:10px;">
  1300. <div class="selectworktime_export_l">
  1301. <el-date-picker
  1302. class="selecteworktime_datapick"
  1303. v-model="WorktimeDatepickValue"
  1304. value-format="yyyy-MM-dd"
  1305. type="daterange"
  1306. align="right"
  1307. unlink-panels
  1308. :range-separator="$t('other.to')"
  1309. :start-placeholder="$t('time.startDate')"
  1310. :end-placeholder="$t('time.endDate')"
  1311. :default-time="['12:00:00', '12:00:00']"
  1312. size="small"
  1313. popper-class="selecteorktime_datapick_popper"
  1314. @change="showMonthWorkTime()"
  1315. >
  1316. </el-date-picker>
  1317. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1318. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1319. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1320. <!-- 222 -->
  1321. </div>
  1322. <div>
  1323. <el-input style="float:left;width:22%" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1324. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1325. </el-input>
  1326. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1327. </div>
  1328. <el-link
  1329. type="primary"
  1330. style="float: right; vertical-align: middle;height:32px"
  1331. @click="exportMembWorkHours()"
  1332. >{{$t('export.exportData')}}</el-link
  1333. >
  1334. </div>
  1335. <el-table ref="hasworkTbl"
  1336. :data="monthWorkDataS"
  1337. v-el-table-infinite-scroll="listScroll"
  1338. border
  1339. :height="500"
  1340. highlight-current-row
  1341. style="width: 100%"
  1342. v-loading="tbload"
  1343. :lazy="true"
  1344. >
  1345. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1346. <template slot-scope="scope">
  1347. {{ scope.$index + 1 }}
  1348. </template>
  1349. </el-table-column>
  1350. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1351. <template slot-scope="scope">
  1352. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1353. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1354. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1355. <!-- {{scope.row.name}} -->
  1356. </span>
  1357. </template>
  1358. </el-table-column>
  1359. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1360. <template slot-scope="scope">
  1361. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1362. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1363. </template>
  1364. </el-table-column>
  1365. <el-table-column
  1366. min-width="105"
  1367. v-for="(item, index) in pickDateArray"
  1368. :key="index"
  1369. :label="item.label"
  1370. align="center"
  1371. >
  1372. <template slot-scope="scope">
  1373. <div
  1374. style="color: red"
  1375. v-if="
  1376. scope.row.worktimeList.filter(
  1377. (w) =>
  1378. w.createDate==item.date
  1379. ).length > 0 &&
  1380. scope.row.worktimeList.filter(
  1381. (w) =>w.createDate==item.date
  1382. )[0].workingTime < reportTimeType.allday
  1383. "
  1384. >
  1385. {{
  1386. scope.row.worktimeList.filter(
  1387. (w) =>w.createDate==item.date
  1388. )[0].workingTime.toFixed(1)
  1389. }}
  1390. </div>
  1391. <div
  1392. style="color: #20a0ff"
  1393. v-if="
  1394. scope.row.worktimeList.filter(
  1395. (w) =>w.createDate==item.date
  1396. ).length > 0 &&
  1397. scope.row.worktimeList.filter(
  1398. (w) =>w.createDate==item.date
  1399. )[0].workingTime > reportTimeType.allday
  1400. "
  1401. >
  1402. {{
  1403. scope.row.worktimeList.filter(
  1404. (w) =>w.createDate==item.date
  1405. )[0].workingTime.toFixed(1)
  1406. }}
  1407. </div>
  1408. <div
  1409. v-if="
  1410. scope.row.worktimeList.filter(
  1411. (w) =>w.createDate==item.date
  1412. ).length > 0 &&
  1413. scope.row.worktimeList.filter(
  1414. (w) =>w.createDate==item.date
  1415. )[0].workingTime == reportTimeType.allday
  1416. "
  1417. >
  1418. {{
  1419. scope.row.worktimeList.filter(
  1420. (w) =>w.createDate==item.date
  1421. )[0].workingTime
  1422. }}
  1423. </div>
  1424. <div
  1425. v-if="
  1426. scope.row.worktimeList.filter(
  1427. (w) =>w.createDate==item.date
  1428. ).length == 0
  1429. "
  1430. >
  1431. 0
  1432. </div>
  1433. <div
  1434. v-if="
  1435. scope.row.worktimeList.filter(
  1436. (w) =>w.createDate==item.date
  1437. ).length > 0 &&
  1438. typeof scope.row.worktimeList.filter(
  1439. (w) =>w.createDate==item.date
  1440. )[0].workingTime == 'string'
  1441. "
  1442. >
  1443. {{
  1444. scope.row.worktimeList.filter(
  1445. (w) =>w.createDate==item.date
  1446. )[0].workingTime
  1447. }}
  1448. </div>
  1449. </template>
  1450. </el-table-column>
  1451. </el-table>
  1452. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isFlag" :title="$t('message.loading')+'...'" type="success" center :closable="false" show-icon></el-alert>
  1453. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1454. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1455. <label style="font-size: 16px">员工每日已填报工时数</label>
  1456. <el-link
  1457. type="primary"
  1458. style="float: right; margin-right: 60px"
  1459. @click="exportMembWorkHours()"
  1460. >导出已填报数据</el-link
  1461. > -->
  1462. <!-- <el-button >导出</el-button> -->
  1463. <!-- </div> -->
  1464. </el-tab-pane>
  1465. <el-tab-pane label="未提交人员列表" name="second" >
  1466. <div class="selectworktime_export" style="margin-top:10px">
  1467. <div class="selectworktime_export_l">
  1468. <el-date-picker
  1469. class="selecteworktime_datapick"
  1470. v-model="WorktimeDatepickValue"
  1471. value-format="yyyy-MM-dd"
  1472. type="daterange"
  1473. align="right"
  1474. unlink-panels
  1475. :range-separator="$t('other.to')"
  1476. :start-placeholder="$t('time.startDate')"
  1477. :end-placeholder="$t('time.endDate')"
  1478. :default-time="['12:00:00', '12:00:00']"
  1479. size="small"
  1480. popper-class="selecteorktime_datapick_popper"
  1481. @change="showMonthNotWorkTime()"
  1482. >
  1483. </el-date-picker>
  1484. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1485. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1486. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1487. </div>
  1488. <div>
  1489. <div style="margin-top:10px;">
  1490. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForNoReport" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthNotWorkTime()"></el-cascader>
  1491. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="departmentList" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')" @change="showMonthNotWorkTime()"></vueCascader>
  1492. <el-input style="width:200px;margin-left: 15px" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1493. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1494. </el-input>
  1495. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1496. <el-link
  1497. type="primary"
  1498. style="float: right; vertical-align: middle;height:32px"
  1499. @click="exportMembNotWorkHours()"
  1500. >{{$t('export.exportData')}}</el-link
  1501. >
  1502. </div>
  1503. </div>
  1504. </div>
  1505. <el-table
  1506. ref="hasworkTbl2"
  1507. :data="monthNotWorkDateS"
  1508. v-el-table-infinite-scroll="notListScroll"
  1509. border
  1510. :height="500"
  1511. highlight-current-row
  1512. style="width: 100%"
  1513. v-loading="tbload"
  1514. lazy
  1515. >
  1516. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1517. <template slot-scope="scope">
  1518. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.department'></ww-open-data></span>
  1519. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1520. </template>
  1521. </el-table-column>
  1522. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1523. <template slot-scope="scope">
  1524. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1525. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1526. </template>
  1527. </el-table-column>
  1528. <el-table-column
  1529. min-width="200"
  1530. :label="$t('weekDay.date')"
  1531. align="center"
  1532. prop="createDate"
  1533. >
  1534. </el-table-column>
  1535. <el-table-column
  1536. min-width="200"
  1537. :label="$t('state.states')"
  1538. align="center"
  1539. prop="status"
  1540. />
  1541. <el-table-column
  1542. min-width="200"
  1543. :label="$t('other.attendanceData')"
  1544. prop="cardTime"
  1545. align="center"
  1546. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1547. </el-table>
  1548. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isFlag" :title="$t('message.loading')+'...'" type="success" center :closable="false" show-icon></el-alert>
  1549. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1550. </el-tab-pane>
  1551. </el-tabs>
  1552. </el-dialog>
  1553. <!--驳回弹出框 -->
  1554. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1555. <div>
  1556. <el-input type="textarea" v-model="denyForm.reason" rows="2" :placeholder="$t('defaultText.pleaseEnterYourDecision')+(denyForm.i==0?$t('btn.rejected'):$t('btn.undo'))+$t('other.reason')" />
  1557. </div>
  1558. <div slot="footer" class="dialog-footer">
  1559. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1560. <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1561. </div>
  1562. </el-dialog>
  1563. <!-- 通过弹出框 -->
  1564. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1565. <div>
  1566. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1567. </div>
  1568. <div slot="footer" class="dialog-footer">
  1569. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1570. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1571. </div>
  1572. </el-dialog>
  1573. <!--批量导入日报 -->
  1574. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1575. <p>1. {{$t('other.download')}}
  1576. <el-link type="primary" style="margin-left:5px;" :underline="false" :href="(user.timeType.enableNewWeeklyfill==1||user.companyId == 936)?('./upload/员工工时导入模板_新版.xlsx'):('./upload/'+$t('template.EmployeeHoursStatisticsTemplate')+'2.xlsx')" :download="((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate'))+'.xlsx'">{{((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate')) + '.xlsx'}}</el-link>
  1577. </p>
  1578. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1579. <p style="display: flex;justify-content: center;">
  1580. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1581. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1582. </el-upload>
  1583. </p>
  1584. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1585. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1586. </div>
  1587. </el-dialog>
  1588. <!-- 工时导入记录弹窗 -->
  1589. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1590. <div style="height: 452px">
  1591. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1592. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1593. <el-table-column prop="userName" :label="$t('other.operator')">
  1594. <template slot-scope="scope">
  1595. <div>
  1596. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.userName'></ww-open-data></span>
  1597. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1598. </div>
  1599. </template>
  1600. </el-table-column>
  1601. <el-table-column prop="datel" :label="$t('other.document')">
  1602. <template slot-scope="scope">
  1603. <div>
  1604. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1605. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1606. </div>
  1607. </template>
  1608. </el-table-column>
  1609. <el-table-column label="操作" v-if="user.companyId == 469 && user.roleName=='超级管理员'">
  1610. <template slot-scope="scope">
  1611. <div>
  1612. <el-button type="default" size="small" @click="openModImportTime(scope.row)">修改导入记录</el-button>
  1613. <el-button type="primary" size="small" @click="delImportTime(scope.row)">删除记录</el-button>
  1614. </div>
  1615. </template>
  1616. </el-table-column>
  1617. </el-table>
  1618. <el-col :span="24" class="paginatis">
  1619. <el-pagination
  1620. @size-change="handleSizeChange"
  1621. @current-change="handleCurrentChange"
  1622. :page-sizes="[20 , 50 , 80 , 100]"
  1623. :page-size="20"
  1624. layout="total, sizes, prev, pager, next"
  1625. :total="toViewForm.total"
  1626. style="float:right;"
  1627. ></el-pagination>
  1628. </el-col>
  1629. </div>
  1630. </el-dialog>
  1631. <!--基于企业微信考勤数据的工时导入 -->
  1632. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1633. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1634. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1635. </el-step>
  1636. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1637. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1638. </el-steps>
  1639. <div v-if="active==0" style="padding:30px;height:360px;">
  1640. <div style="margin-top:50px;margin-left:280px;">
  1641. <el-date-picker
  1642. v-model="importWxParam.date" :editable="false"
  1643. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1644. :clearable="true"
  1645. :range-separator="$t('other.to')"
  1646. type="daterange"
  1647. :start-placeholder="$t('time.startDate')"
  1648. :end-placeholder="$t('time.endDate')"
  1649. @change="loadCheckInData"
  1650. ></el-date-picker>
  1651. </div>
  1652. </div>
  1653. <div v-if="active==1" style="padding:10px;">
  1654. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1655. style="width: 100%;margin-top:5px;" >
  1656. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1657. <template slot-scope="scope">
  1658. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1659. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1660. </template>
  1661. </el-table-column>
  1662. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1663. </el-table-column>
  1664. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1665. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1666. <template slot-scope="scope">
  1667. <div>
  1668. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1669. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1670. </div>
  1671. </template>
  1672. </el-table-column>
  1673. <el-table-column prop="departmentName" label="部门" >
  1674. <template slot-scope="scope">
  1675. <div>
  1676. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1677. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1678. </div>
  1679. </template>
  1680. </el-table-column>
  1681. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1682. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1683. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1684. <template slot-scope="scope">
  1685. {{scope.row.workHours.toFixed(1)}}h
  1686. </template>
  1687. </el-table-column>
  1688. </el-table>
  1689. </div>
  1690. <div v-if="active==2" >
  1691. <p style="display: flex;justify-content: center;height:390px;">
  1692. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1693. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1694. </el-upload>
  1695. </p>
  1696. </div>
  1697. <div slot="title">
  1698. <span style="font-size:16px;">{{$t('other.Batchimportofworkinghours')}}</span>
  1699. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1700. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">下载填报工时占比表</el-link>
  1701. <el-link v-if="active==0 && user.companyId == 469 && user.roleName.indexOf('管理员') > 0" style="float:right;margin-right:100px;" type="primary" @click="importCardTimeVisi = true">导入考勤时长</el-link>
  1702. <el-link v-if="active==0 && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchDeleteReport = true; startDeleting = false;">批量删除日报</el-link>
  1703. <el-link v-if="active==0 && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchSimpleApproveReport = true; startDeleting = false;getDepartmentForApprove();">批量审核日报</el-link>
  1704. </div>
  1705. <span slot="footer">
  1706. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1707. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1708. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1709. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1710. </span>
  1711. </el-dialog>
  1712. <el-dialog title="导入考勤时长" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1713. <p style="display: flex;justify-content: center;height:100px;">
  1714. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1715. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1716. </el-upload>
  1717. </p>
  1718. </el-dialog>
  1719. <el-dialog title="批量删除日报" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1720. <div>
  1721. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1722. v-model="deleteReportParam.date" :editable="false"
  1723. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1724. :clearable="true"
  1725. :range-separator="$t('other.to')"
  1726. type="daterange"
  1727. :start-placeholder="$t('time.startDate')"
  1728. :end-placeholder="$t('time.endDate')"
  1729. ></el-date-picker>
  1730. </div>
  1731. <div style="margin-top:10px;">
  1732. <span>请选择部门:</span>
  1733. <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="deleteReportParam.deptId" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 350px;"></el-cascader>
  1734. <vueCascader :size="'medium'" :widthStr="'350'" :clearable="true" :subject="departmentList" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1735. </div>
  1736. <div style="margin-top:10px;">
  1737. <span>请选择员工:</span>
  1738. <el-select v-model="deleteReportParam.userIds" placeholder="请选择" style="width:500px;" filterable multiple>
  1739. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1740. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1741. <span v-else>{{item.name}}</span>
  1742. </el-option>
  1743. </el-select>
  1744. </div>
  1745. <span slot="footer">
  1746. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >开始删除</el-button>
  1747. </span>
  1748. </el-dialog>
  1749. <el-dialog title="批量审核日报" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  1750. <div>
  1751. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1752. v-model="deleteReportParam.date" :editable="false"
  1753. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1754. :clearable="true"
  1755. :range-separator="$t('other.to')"
  1756. type="daterange"
  1757. :start-placeholder="$t('time.startDate')"
  1758. :end-placeholder="$t('time.endDate')"
  1759. ></el-date-picker>
  1760. </div>
  1761. <div style="margin-top:15px;">
  1762. <span>选择部门:</span>
  1763. <el-cascader v-model="deleteReportParam.departmentId" placeholder="全部部门" style="width: 350px;margin-left:25px;"
  1764. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  1765. size="small" v-if="user.userNameNeedTranslate != 1"
  1766. ></el-cascader>
  1767. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  1768. </div>
  1769. <span slot="footer">
  1770. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >审批通过</el-button>
  1771. </span>
  1772. </el-dialog>
  1773. <el-dialog title="修改导入记录" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  1774. <div>
  1775. <span>选择时间:</span><el-date-picker
  1776. v-model="modImportTime"
  1777. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  1778. :clearable="true"
  1779. type="datetime"
  1780. ></el-date-picker>
  1781. <span>选择导入人员:</span><el-select
  1782. v-model="modImportUserId"
  1783. >
  1784. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1785. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1786. <span v-else>{{item.name}}</span>
  1787. </el-option>
  1788. </el-select>
  1789. </div>
  1790. <span slot="footer">
  1791. <el-button @click="confirmChangeModTime" >确认</el-button>
  1792. </span>
  1793. </el-dialog>
  1794. <el-dialog title="导出员工填报工时占比" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  1795. <div>
  1796. <span>请选择年月:</span>
  1797. <el-date-picker
  1798. v-model="ratioYmonth" :editable="false"
  1799. format="yyyyMM" value-format="yyyyMM"
  1800. type="month"
  1801. ></el-date-picker>
  1802. </div>
  1803. <span slot="footer">
  1804. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">导出</el-button>
  1805. </span>
  1806. </el-dialog>
  1807. <!--工时批量代填 -->
  1808. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  1809. <div>
  1810. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1811. v-model="importWxParam.date" :editable="false"
  1812. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1813. :clearable="true"
  1814. :range-separator="$t('other.to')"
  1815. type="daterange"
  1816. :start-placeholder="$t('time.startDate')"
  1817. :end-placeholder="$t('time.endDate')"
  1818. @change="loadCheckInData"
  1819. ></el-date-picker>
  1820. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  1821. </div>
  1822. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  1823. :key="timeStamp"
  1824. style="width: 100%;margin-top:5px;" ref="tab">
  1825. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  1826. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  1827. <template slot-scope="scope">
  1828. <div>
  1829. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1830. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1831. </div>
  1832. </template>
  1833. </el-table-column>
  1834. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  1835. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  1836. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  1837. <template slot-scope="scope">
  1838. {{scope.row.workHours.toFixed(1)}}h
  1839. </template>
  1840. </el-table-column>
  1841. <!--项目名称列表 -->
  1842. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  1843. <template slot-scope="scope">
  1844. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  1845. </template>
  1846. </el-table-column>
  1847. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  1848. <template slot-scope="scope">
  1849. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  1850. </template>
  1851. </el-table-column>
  1852. </el-table>
  1853. </el-dialog>
  1854. <!--基于企业微信考勤数据的工时导入 -->
  1855. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  1856. <div style="padding-bottom:10px;">
  1857. <p>{{importResultMsg}}</p>
  1858. </div>
  1859. <!-- <span slot="footer" class="dialog-footer">
  1860. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  1861. </span> -->
  1862. </el-dialog>
  1863. <!-- 审核流程展示 -->
  1864. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  1865. <div style="padding:20px 40px 20px 0">
  1866. <el-timeline :reverse="false">
  1867. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  1868. <!-- {{item.msg}} -->
  1869. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  1870. <span v-if="user.userNameNeedTranslate == 1">
  1871. <span><ww-open-data type='userName' :openid='item.msgCon.one'></ww-open-data></span>
  1872. <span>{{item.msgCon.two}}</span>
  1873. </span>
  1874. </el-timeline-item>
  1875. </el-timeline>
  1876. </div>
  1877. </el-dialog>
  1878. </section>
  1879. </template>
  1880. <script>
  1881. // 左右滑动
  1882. import dragMixin from "@/common/js/tensile.js";
  1883. import util from "../../common/js/util";
  1884. // 自定义select组件
  1885. import selectCat from "@/components/select.vue"
  1886. // 引入自定义级联组件
  1887. import vueCascader from "@/components/cascader.vue"
  1888. // 重庆物奇定制组件
  1889. import WeeklyCustomization from "./weeklyCustomization.vue"
  1890. import { mapMutations } from 'vuex'
  1891. let _that = this
  1892. export default {
  1893. mixins: [dragMixin],
  1894. components: {
  1895. selectCat,
  1896. vueCascader,
  1897. WeeklyCustomization
  1898. },
  1899. data() {
  1900. return {
  1901. pageIndex: 0,
  1902. hasMore: true,
  1903. exportType: 0,
  1904. exportingData: false,
  1905. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  1906. jobResponseList:[],
  1907. yisibeiCompId: 3092,
  1908. yuzhongCompId: 3385,
  1909. mingyiName : '成都明夷电子科技有限公司',
  1910. // mingyiName : '明夷',
  1911. modItemDataId: null,
  1912. modImportTime: null,
  1913. modImportUserId: null,
  1914. showModImportTimeDialog: false,
  1915. showBatchSimpleApproveReport: false,
  1916. startDeleting: false,
  1917. showBatchDeleteReport: false,
  1918. deleteReportParam: {date:null, userIds:[]},
  1919. isDenying: false,
  1920. targetWeekDate: null,//填写周报中的周日期
  1921. importCardTimeVisi: false,
  1922. startRatioExporting: false,
  1923. exportUserRatio: false,
  1924. ratioYmonth:null,
  1925. hasWrittenReport: false,
  1926. today:null,
  1927. syncTimeLoading: false,
  1928. seluserText: '',
  1929. translation: '1', // 1、文字, 2、部门, 3、人员
  1930. exportLoad: false,
  1931. getPickerOptions: {
  1932. disabledDate: (time) => {
  1933. var date = new Date();
  1934. var year = date.getFullYear();
  1935. var month = date.getMonth() + 1;
  1936. if (month >= 1 && month <= 9) {
  1937. month = "0" + month;
  1938. }
  1939. var currentdate = year.toString() + month.toString();
  1940. var timeyear = time.getFullYear();
  1941. var timemonth = time.getMonth() + 1;
  1942. if (timemonth >= 1 && timemonth <= 9) {
  1943. timemonth = "0" + timemonth;
  1944. }
  1945. var timedate = timeyear.toString() + timemonth.toString();
  1946. if(this.user.timeType.fillAhead == 0){
  1947. return currentdate < timedate;
  1948. }else{
  1949. return false
  1950. }
  1951. }
  1952. },
  1953. alalal: '8.0',
  1954. timeBasecostList:null,
  1955. tbload: false,
  1956. exportTimeDialog: false,
  1957. searchKeyword: '',
  1958. monthWorkDataS: [],
  1959. monthNotWorkDateS: [],
  1960. pickDateArray:[],
  1961. WorktimeDatepickValue: [],
  1962. activeName:"first",
  1963. isLeave: 0,
  1964. submitingReport: false,
  1965. importResultMsg:null,
  1966. showImportResult:false,
  1967. importingData: false,
  1968. isDraft: 0,
  1969. timeStamp: 0,
  1970. projectColumns:[],
  1971. checkinLoading:false,
  1972. importWxParam:{date:null,},
  1973. active:0,
  1974. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  1975. importWxDialog:false,
  1976. importDialog:false,
  1977. denyForm:null,
  1978. denyReasonDialog:false,
  1979. monthWorkTimeDialog: false,
  1980. isSubstitude:false,
  1981. isFill:false,
  1982. unFillList:[],
  1983. fillList:[],
  1984. fillMembList:[],
  1985. fillMembList_leave: [],
  1986. membListVisible: false,
  1987. isBatch:0,//是否是批量填报
  1988. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  1989. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  1990. weekDay : [this.$t('weekDay.sunday'), this.$t('weekDay.monday'), this.$t('weekDay.tuesday'), this.$t('weekDay.wednesday'), this.$t('weekDay.thursday'), this.$t('weekDay.friday'), this.$t('weekDay.saturday')],
  1991. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  1992. fillStatusList: [],
  1993. exportParam:{projectId: null, dateRange:[], departmentId: null},
  1994. exportDialog:false,
  1995. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  1996. subProjectList:[],
  1997. canEdit: true,
  1998. originCanEdit: true,
  1999. timeRange:[0.0,0.5,1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5,7.0,7.5,8.0,8.5,9.0,9.5,10.0,10.5,11.0,11.5,12.0,12.5,13.0,13.5,14.0,14.5,15.0,15.5,16.0,16.5,17.0,17.5,18.0,18.5,19.0,19.5,20.0],
  2000. selectTime:null,
  2001. reportTimeType:{},
  2002. curDate:'',
  2003. isAllSelect: false,
  2004. approveDialogVisible:false,
  2005. deptId:null,
  2006. targetUid: null,
  2007. membCount:0,
  2008. selectState:"-1",
  2009. user: JSON.parse(sessionStorage.getItem("user")),
  2010. allUsersList: [],
  2011. showAddMore:false,
  2012. allDate: [],
  2013. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2014. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2015. choseDay: 0,
  2016. tableHeight: 0,
  2017. listLoading: false,
  2018. projectList: [], //项目列表
  2019. fillProjectList: [],
  2020. reportList: [], //日报列表
  2021. reportNames:[], //批量审批列表
  2022. selCon:[], //筛选条件
  2023. selProjectList:[], //筛选后项目列表
  2024. selConShow: true,
  2025. usersList: [], // 全部人员列表
  2026. usersListId: '', // 选中的人员id
  2027. dialogVisible: false, //项目弹窗
  2028. report: '',
  2029. workForm: {
  2030. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2031. domains: [{
  2032. id: null,
  2033. projectId: "",
  2034. workingTime: "",
  2035. timeType:0,
  2036. content: "",
  2037. state: 2,
  2038. multiWorktime:0,
  2039. worktimeList:[],
  2040. degreeId: null,
  2041. auditUserList: [],
  2042. }],
  2043. },
  2044. workRules: {
  2045. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2046. },
  2047. chooseParticipVisible: false,
  2048. logining: false,
  2049. isDisable: false,
  2050. timeType:[],
  2051. deptMembData: [
  2052. ],
  2053. //部门人员树状结构
  2054. data: [
  2055. {
  2056. id: -1,
  2057. label: this.$t('lable.allStaff'),
  2058. membCount:0
  2059. },
  2060. {
  2061. id: 0,
  2062. label: this.$t('lable.unassigned'),
  2063. }
  2064. ],
  2065. allData:{},
  2066. batchShowData:{},
  2067. option: [],
  2068. deptOptionList: [],
  2069. depData: {
  2070. id: -1,
  2071. label: this.$t('lable.allStaff'),
  2072. },
  2073. defaultProps: {
  2074. children: 'children',
  2075. label: 'label'
  2076. },
  2077. isNew: false,
  2078. selected: false,
  2079. valuet: new Date(),
  2080. domObj: null,
  2081. participator:[],
  2082. chosenMembCount:0,
  2083. jsDay: 0,
  2084. jsTime: 0,
  2085. falsss: false,
  2086. weidu: [],
  2087. weiduList: [],
  2088. yonghuUser: [],
  2089. dateAr: [],
  2090. batchSubFillDialog: false,
  2091. isSubstiS: false,
  2092. fillWeekDialogVisi: false,
  2093. fillWeekDialogVisiCustom: false,
  2094. zhoData: [],
  2095. weekDateRange: [],
  2096. btnZho: false,
  2097. weekDataLoading: false,
  2098. changdu: 6,
  2099. tianxieDialogVisible: false,
  2100. scopess: {},
  2101. zhoBao: {
  2102. time: '',
  2103. workingTime: '',
  2104. progress: '',
  2105. con: '',
  2106. subProjectId: '',
  2107. stage: '',
  2108. subProjectList: [],
  2109. stages: [],
  2110. },
  2111. zhoBaoIdx: '',
  2112. zhoBaoName: '',
  2113. zhis: {},
  2114. dealList: [],
  2115. toViewDialogVisible: false,
  2116. toViewList: [],
  2117. toViewloading: true,
  2118. toViewForm: {
  2119. pageIndex: '1',
  2120. pageSize: '20',
  2121. total: 0,
  2122. },
  2123. toViewloadings: false,
  2124. tabPositionss: 'top',
  2125. monthTotal: 0,
  2126. monthTotalPage: 0,
  2127. monthTotalLages: 20,
  2128. monthWorkData: [],
  2129. monthNotWorkDate: [],
  2130. monthWorkDataS1: [],
  2131. monthnotTotal: 0,
  2132. monthnotTotalPage: 0,
  2133. monthnotTotalLages: 20,
  2134. monthNotWorkDateS1: [],
  2135. deptMembDataText: '',
  2136. isFlag: false,
  2137. isMore: false,
  2138. stateKey: '0',
  2139. expandDate: [],
  2140. notifySelList:[],
  2141. departmentList: [],
  2142. approvalProcessDialog: false,
  2143. approvalProcessData: [],
  2144. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2145. leaveTypeName: [this.$t('leave.personalLeave'),this.$t('leave.sickLeave'),this.$t('leave.annualLeave'),this.$t('leave.maternityLeave'),this.$t('leave.marriageLeave'),this.$t('leave.bereavementLeave'),this.$t('leave.leave'),this.$t('leave.paternityLeave'),this.$t('leave.other')],
  2146. isWeekend: false,
  2147. canCancelInDialog: false,
  2148. approveinData: {},
  2149. approveinDialog: false,
  2150. reportCanDelete: false,
  2151. weeklyFilledTimeDialog: false,
  2152. weeklyFilledTimeList: [],
  2153. weeklyFilledTimeLoading: false,
  2154. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2155. weeklyFilledTimeCanDelete: false,
  2156. weeklyFilledTimeDate: null,
  2157. leaveAllNum: 0,
  2158. dataLoading: false,
  2159. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2160. vacationTime: {},
  2161. integrationProjectList: [],
  2162. totalReportHours: 0, // 合计的工时
  2163. workTimeForMinYi:0,
  2164. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2165. weekIndex: 1,
  2166. weekParentData: {},
  2167. deptIdForNoReport:[],
  2168. nameAearch: '', // 企业微信姓名搜索
  2169. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2170. deptMembDataLoading: false,
  2171. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2172. {
  2173. id: 4811,
  2174. // id: 10,
  2175. name: '陕西柘中建设工程有限公司'
  2176. }
  2177. ],
  2178. pushWorkTimeLogDig:false,
  2179. pushWorkTimeLogData:[],
  2180. };
  2181. },
  2182. watch: {
  2183. deptMembDataText(val) {
  2184. this.$refs.chooseMembTree.filter(val);
  2185. }
  2186. },
  2187. filters: {
  2188. // 过滤
  2189. amounts(value) {
  2190. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2191. return 0
  2192. }
  2193. var zhi = +value + 0
  2194. return zhi.toFixed(1)
  2195. },
  2196. // zhoData
  2197. zhoData(value, arr) {
  2198. var dateArray = value.split("-");
  2199. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2200. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2201. // console.log(arr[date.getDay()])
  2202. // return "周" + "日一二三四五六".charAt(date.getDay());
  2203. return arr[date.getDay()]
  2204. },
  2205. // 过滤数字
  2206. numbers(value) {
  2207. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2208. return 0
  2209. }
  2210. return value
  2211. },
  2212. },
  2213. computed: {},
  2214. mounted() {
  2215. var now = new Date();
  2216. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2217. this.today = t;
  2218. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2219. this.exportParam.dateRange = [startStr,t];
  2220. this.getAllDate(1);
  2221. this.getReportList();
  2222. this.getProjectList();
  2223. this.getFillProjectList();
  2224. this.getTimeType();
  2225. this.getDepartment();
  2226. this.scrollFunction()
  2227. this.userssHu();
  2228. if(this.user.timeType.reportAuditType == 3){
  2229. this.getAllUsersList()
  2230. }
  2231. if (this.user.company.packageProject == 1) {
  2232. this.getBasecostItemList();
  2233. }
  2234. if(this.user.timeType.lockWorktime){
  2235. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2236. }
  2237. //设置了下限
  2238. if (this.user.timeType.minReportTime) {
  2239. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2240. }
  2241. const that = this
  2242. if(this.user.userNameNeedTranslate == 1) {
  2243. that.dataLoading = that.$store.state.dataLoading
  2244. this.upDataLoading()
  2245. setTimeout(()=>{
  2246. that.dataLoading = that.$store.state.dataLoading
  2247. }, 1000)
  2248. }
  2249. if (this.user.companyId == this.yuzhongCompId) {
  2250. this.getJobResponList();
  2251. }
  2252. },
  2253. methods: {
  2254. ...mapMutations(['upDataLoading']),
  2255. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2256. isCustomization(userInfo, permissionArray) {
  2257. const { companyId } = userInfo
  2258. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2259. return isReportPictureRequired
  2260. },
  2261. //任务被选中
  2262. onTaskSelected(domainItem) {
  2263. //取服务
  2264. if (domainItem.taskId) {
  2265. var that = this;
  2266. var param = {taskId:domainItem.taskId};
  2267. if (this.isSubstitude) {
  2268. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2269. param.userId = this.workForm.userId[0];
  2270. }
  2271. }
  2272. this.http.post('/task/getMyTaskService',param, res => {
  2273. if (res.code == "ok") {
  2274. // domainItem.workContentList = res.data;
  2275. that.$set(domainItem, 'sapServiceId', null);
  2276. that.$set(domainItem, 'serviceList', res.data);
  2277. } else {
  2278. this.$message({
  2279. message: res.msg,
  2280. type: "error"
  2281. });
  2282. }
  2283. },error => {
  2284. this.$message({
  2285. message: error,
  2286. type: "error"
  2287. });
  2288. }
  2289. );
  2290. } else {
  2291. //清空服务
  2292. }
  2293. },
  2294. onBatchTimeChange() {
  2295. //反向计算每日工作时长
  2296. if (this.workForm.createDate) {
  2297. let sdate = new Date(this.workForm.createDate[0]);
  2298. let edate = new Date(this.workForm.createDate[1]);
  2299. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2300. console.log('days===', days)
  2301. if (days < 0) {
  2302. return;
  2303. }
  2304. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2305. //总时长发生改变,自动按比例计算
  2306. this.workForm.domains.forEach(d=>{
  2307. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2308. });
  2309. }
  2310. },
  2311. //更新工作内容列表
  2312. updateJobContent(domainItem) {
  2313. var that = this;
  2314. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2315. if (res.code == "ok") {
  2316. // domainItem.workContentList = res.data;
  2317. that.$set(domainItem, 'extraField3', null);
  2318. that.$set(domainItem, 'workContentList', res.data);
  2319. } else {
  2320. this.$message({
  2321. message: res.msg,
  2322. type: "error"
  2323. });
  2324. }
  2325. },error => {
  2326. this.$message({
  2327. message: error,
  2328. type: "error"
  2329. });
  2330. }
  2331. );
  2332. },
  2333. updateResponse(domainItem) {
  2334. var that = this;
  2335. var selectPid = domainItem.projectId;
  2336. domainItem.extraField2 = null;
  2337. domainItem.extraField3 = null;
  2338. if (selectPid && domainItem.extraField1) {
  2339. //是否非项目
  2340. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2341. console.log('==========','isPublic=='+isPublic);
  2342. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2343. console.log(filteredRespList);
  2344. domainItem.filteredRespList = filteredRespList;
  2345. }
  2346. },
  2347. getJobResponList() {
  2348. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2349. if (res.code == "ok") {
  2350. this.jobResponseList = res.data;
  2351. } else {
  2352. this.$message({
  2353. message: res.msg,
  2354. type: "error"
  2355. });
  2356. }
  2357. },error => {
  2358. this.$message({
  2359. message: error,
  2360. type: "error"
  2361. });
  2362. }
  2363. );
  2364. },
  2365. openModImportTime(row) {
  2366. this.showModImportTimeDialog = true;
  2367. this.modItemDataId = row.id;
  2368. },
  2369. delImportTime(row) {
  2370. let rowId = row.id;
  2371. this.$confirm('您确定要删除该条记录吗?',this.$t('other.prompts'), {
  2372. confirmButtonText: this.$t('btn.determine'),
  2373. cancelButtonText: this.$t('btn.cancel'),
  2374. type: "warning"
  2375. })
  2376. .then(() => {
  2377. this.http.post('/report-import-log/delete',{
  2378. id: rowId
  2379. },res => {
  2380. if (res.code == "ok") {
  2381. this.$message({
  2382. message: '删除成功',
  2383. type: "success"
  2384. });
  2385. this.getToView();
  2386. } else {
  2387. this.$message({
  2388. message: res.msg,
  2389. type: "error"
  2390. });
  2391. }
  2392. },error => {
  2393. this.$message({
  2394. message: error,
  2395. type: "error"
  2396. });
  2397. }
  2398. );
  2399. }).catch(() => {this.startDeleting = false});
  2400. },
  2401. confirmChangeModTime() {
  2402. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2403. this.$message({
  2404. message: '请选择时间',
  2405. type: "error"
  2406. });
  2407. return;
  2408. }
  2409. this.http.post('/report-import-log/changeTime',{
  2410. modLogDateTime: this.modImportTime,
  2411. modImportUserId: this.modImportUserId,
  2412. id: this.modItemDataId
  2413. },res => {
  2414. if (res.code == "ok") {
  2415. this.$message({
  2416. message: '修改成功',
  2417. type: "success"
  2418. });
  2419. this.getToView();
  2420. this.showModImportTimeDialog = false;
  2421. } else {
  2422. this.$message({
  2423. message: res.msg,
  2424. type: "error"
  2425. });
  2426. }
  2427. },error => {
  2428. this.$message({
  2429. message: error,
  2430. type: "error"
  2431. });
  2432. }
  2433. );
  2434. },
  2435. confirmBatchApproveReport() {
  2436. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2437. this.$message({
  2438. message: '请选择日期范围',
  2439. type: "error"
  2440. });
  2441. return;
  2442. }
  2443. this.$confirm('您确定要审核通过该时间段内全部的日报吗?',this.$t('other.prompts'), {
  2444. confirmButtonText: this.$t('btn.determine'),
  2445. cancelButtonText: this.$t('btn.cancel'),
  2446. type: "warning"
  2447. })
  2448. .then(() => {
  2449. this.startDeleting = true;
  2450. let obj = {
  2451. startDate: this.deleteReportParam.date[0],
  2452. endDate: this.deleteReportParam.date[1]
  2453. }
  2454. if(this.deleteReportParam.departmentId) {
  2455. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2456. } else {
  2457. obj.departmentId = null
  2458. }
  2459. this.http.post('/report/batchApproveByDate',obj,res => {
  2460. if (res.code == "ok") {
  2461. this.$message({
  2462. message: '审核通过',
  2463. type: "success"
  2464. });
  2465. this.getReportList();
  2466. this.getDepartment();
  2467. this.startDeleting = false;
  2468. } else {
  2469. this.$message({
  2470. message: res.msg,
  2471. type: "error"
  2472. });
  2473. }
  2474. },error => {
  2475. this.$message({
  2476. message: error,
  2477. type: "error"
  2478. });
  2479. }
  2480. );
  2481. }).catch(() => {this.startDeleting = false});
  2482. },
  2483. confirmBatchDelReport() {
  2484. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2485. this.$message({
  2486. message: '请选择部门或人员',
  2487. type: "error"
  2488. });
  2489. return;
  2490. }
  2491. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2492. this.$message({
  2493. message: '请选择日期范围',
  2494. type: "error"
  2495. });
  2496. return;
  2497. }
  2498. this.$confirm('您确定要删除该时间段内的日报吗,删除后将不可恢复',this.$t('other.prompts'), {
  2499. confirmButtonText: this.$t('btn.determine'),
  2500. cancelButtonText: this.$t('btn.cancel'),
  2501. type: "warning"
  2502. })
  2503. .then(() => {
  2504. this.startDeleting = true;
  2505. this.http.post('/report/batchDelete',{
  2506. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2507. startDate: this.deleteReportParam.date[0],
  2508. endDate: this.deleteReportParam.date[1],
  2509. deptId: this.deleteReportParam.deptId[0]
  2510. },res => {
  2511. if (res.code == "ok") {
  2512. this.$message({
  2513. message: this.$t('message.successfullyDeleted'),
  2514. type: "success"
  2515. });
  2516. this.getReportList();
  2517. this.getDepartment();
  2518. this.startDeleting = false;
  2519. } else {
  2520. this.$message({
  2521. message: res.msg,
  2522. type: "error"
  2523. });
  2524. }
  2525. },error => {
  2526. this.$message({
  2527. message: error,
  2528. type: "error"
  2529. });
  2530. }
  2531. );
  2532. }).catch(() => {this.startDeleting = false});
  2533. },
  2534. getRecentlyProject() {
  2535. this.http.post('/project/nearProject',{},res => {
  2536. if(res.code == 'ok'){
  2537. let topObj = {
  2538. label: '最近选择项目',
  2539. peojectList: res.data
  2540. }
  2541. let botomObj = {
  2542. label: '全部项目',
  2543. peojectList: this.fillProjectList
  2544. }
  2545. //最近项目如果在fillProjectList中不存在,需要移除
  2546. topObj.peojectList = topObj.peojectList.filter(top=>this.fillProjectList.find(fp=>fp.id==top.id) != null);
  2547. this.integrationProjectList = [topObj, botomObj]
  2548. }else {
  2549. this.$message({
  2550. message: res.msg,
  2551. type: 'error'
  2552. })
  2553. }
  2554. },err => {
  2555. this.$message({
  2556. message: err,
  2557. type: 'error'
  2558. })
  2559. })
  2560. },
  2561. handlePictureCardPreview(file, index) {
  2562. console.log(file, index)
  2563. let arr = []
  2564. let imgArr = this.workForm.domains[index].imgListUrl
  2565. for(var i in imgArr) {
  2566. arr.push(imgArr[i].url)
  2567. }
  2568. console.log(arr, '图片数据')
  2569. const $viewer = this.$viewerApi({
  2570. images: arr
  2571. });
  2572. },
  2573. // 图片上传
  2574. addImg(e, index) {
  2575. console.log(e, '数据')
  2576. let formData = new FormData()
  2577. formData.append('multipartFile', e.file)
  2578. this.http.uploadFile('/common/uploadFile', formData,
  2579. res => {
  2580. if (res.code == "ok") {
  2581. this.$message({
  2582. message: this.$t('uploadedsuccessfully'),
  2583. type: "success"
  2584. });
  2585. if(!this.workForm.domains[index].imgList) {
  2586. this.workForm.domains[index].imgList = []
  2587. this.workForm.domains[index].imgListUrl = []
  2588. }
  2589. this.workForm.domains[index].imgList.push(res.data)
  2590. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2591. } else {
  2592. this.$message({message: res.msg,type: "error"});
  2593. }
  2594. console.log(this.workForm.domains[index])
  2595. },
  2596. error => {this.$message({message: error,type: "error"});
  2597. });
  2598. },
  2599. // 删除图片
  2600. delImg(file,fileList, index) {
  2601. console.log(file, fileList)
  2602. let idx = 0
  2603. for(let i in fileList) {
  2604. if(fileList[i].uid == file.uid) {
  2605. idx = i
  2606. }
  2607. }
  2608. this.workForm.domains[index].imgList.splice(idx, 1)
  2609. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  2610. console.log(this.workForm.domains[index])
  2611. },
  2612. test(){
  2613. console.log('test',this.workForm.domains);
  2614. },
  2615. getHour(s1, s2) {
  2616. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  2617. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  2618. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  2619. var ms = s2.getTime() - s1.getTime();
  2620. if (ms < 0) return 0;
  2621. let ma = ms / 1000 / 60 / 60
  2622. return ma; //小时
  2623. },
  2624. refreshWXCardTime(workdate) {
  2625. if (!workdate) return;
  2626. this.syncTimeLoading = true;
  2627. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  2628. date: workdate,
  2629. },res => {
  2630. this.syncTimeLoading = false;
  2631. if(res.code == 'ok'){
  2632. this.workForm.time = res.data.time;
  2633. }else {
  2634. this.$message({
  2635. message: res.msg,
  2636. type: 'error'
  2637. })
  2638. }
  2639. },err => {
  2640. this.syncTimeLoading = false;
  2641. this.$message({
  2642. message: err,
  2643. type: 'error'
  2644. })
  2645. })
  2646. },
  2647. refreshAttendance(workdate) {
  2648. if (!workdate) return;
  2649. this.syncTimeLoading = true;
  2650. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  2651. startDate: workdate[0],
  2652. endDate: workdate[1]
  2653. },res => {
  2654. this.syncTimeLoading = false;
  2655. if(res.code == 'ok'){
  2656. this.workTimeForMinYi = parseFloat(res.data.workHours);
  2657. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  2658. this.totalReportHours = this.workTimeForMinYi;
  2659. }else {
  2660. this.$message({
  2661. message: res.msg,
  2662. type: 'error'
  2663. })
  2664. }
  2665. },err => {
  2666. this.syncTimeLoading = false;
  2667. this.$message({
  2668. message: err,
  2669. type: 'error'
  2670. })
  2671. })
  2672. },
  2673. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  2674. this.weeklyFilledTimeDialog = true
  2675. this.weeklyFilledTimeLoading = true
  2676. this.weeklyFilledTimeDate = parameterDate
  2677. this.http.post('/report/getReportList',{
  2678. date: parameterDate,
  2679. userId: this.user.id
  2680. },res => {
  2681. this.weeklyFilledTimeLoading = false
  2682. if(res.code == 'ok'){
  2683. this.weeklyFilledTimeList = res.data[0].data
  2684. let candelete = true
  2685. for(let i in this.weeklyFilledTimeList){
  2686. if(this.weeklyFilledTimeList[i].state < 2){
  2687. candelete = false
  2688. }
  2689. }
  2690. this.weeklyFilledTimeCanDelete = candelete
  2691. }else {
  2692. this.$message({
  2693. message: res.msg,
  2694. type: 'error'
  2695. })
  2696. }
  2697. },err => {
  2698. this.weeklyFilledTimeLoading = false
  2699. this.$message({
  2700. message: err,
  2701. type: 'error'
  2702. })
  2703. })
  2704. },
  2705. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  2706. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  2707. confirmButtonText: this.$t('btn.determine'),
  2708. cancelButtonText: this.$t('btn.cancel'),
  2709. type: "warning"
  2710. })
  2711. .then(() => {
  2712. this.http.post('/report/delete',{
  2713. userId: this.user.id,
  2714. date: this.weeklyFilledTimeDate
  2715. },res => {
  2716. if (res.code == "ok") {
  2717. this.$message({
  2718. message: this.$t('message.successfullyDeleted'),
  2719. type: "success"
  2720. });
  2721. this.getWeeklyWorkTime()
  2722. this.getReportList();
  2723. this.getDepartment();
  2724. this.weeklyFilledTimeDialog = false;
  2725. } else {
  2726. this.$message({
  2727. message: res.msg,
  2728. type: "error"
  2729. });
  2730. }
  2731. },error => {
  2732. this.$message({
  2733. message: error,
  2734. type: "error"
  2735. });
  2736. }
  2737. );
  2738. }).catch(() => {});
  2739. },
  2740. getApprovalProcess(item){
  2741. // console.log('this.date',this.choseDate);
  2742. this.http.post('/report-log/get',{
  2743. creatorId: item.id,
  2744. createDate: sessionStorage.msg
  2745. },res => {
  2746. if(res.code == 'ok'){
  2747. this.approvalProcessDialog = true
  2748. if(this.user.userNameNeedTranslate == 1) {
  2749. for(var i in res.data) {
  2750. let obj = {
  2751. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  2752. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  2753. }
  2754. res.data[i].msgCon = obj
  2755. }
  2756. }
  2757. this.approvalProcessData = res.data
  2758. console.log(this.approvalProcessData, '数据卡看')
  2759. }else{
  2760. this.$message({
  2761. message: res.msg,
  2762. type: 'error'
  2763. })
  2764. }
  2765. },err => {
  2766. this.$message({
  2767. message: err,
  2768. type: 'error'
  2769. })
  2770. })
  2771. },
  2772. filterNode(value, data) {
  2773. if (!value) return true;
  2774. return data.label.indexOf(value) !== -1;
  2775. },
  2776. triggerCalculateOT(index) {
  2777. var str = this.workForm.domains[index].overtimeHours + ''
  2778. if(str.indexOf('.') != '-1') {
  2779. var s = str.split('.')[0]
  2780. var st = str.split('.')[1]
  2781. var sts = st.split('')
  2782. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  2783. }
  2784. },
  2785. searchScreen(e){
  2786. if(e){
  2787. this.monthNotWorkDateS1 = []
  2788. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  2789. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  2790. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  2791. }
  2792. }
  2793. if (this.monthNotWorkDateS1.length > 50) {
  2794. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  2795. }else{
  2796. this.monthNotWorkDateS = this.monthNotWorkDateS1
  2797. }
  2798. // if (this.monthNotWorkDateS1.length > 0) {
  2799. // setTimeout(() => {
  2800. // this.tableListenernot()
  2801. // }, 1000);
  2802. // }
  2803. }else{
  2804. this.monthWorkDataS1 = []
  2805. for (let i = 0; i < this.monthWorkData.length; i++) {
  2806. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  2807. this.monthWorkDataS1.push(this.monthWorkData[i])
  2808. }
  2809. }
  2810. if (this.monthWorkDataS1.length > 50) {
  2811. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  2812. }else{
  2813. this.monthWorkDataS = this.monthWorkDataS1
  2814. }
  2815. // if (this.monthWorkDataS1.length > 0) {
  2816. // setTimeout(() => {
  2817. // this.tableListener()
  2818. // }, 1000);
  2819. // }
  2820. }
  2821. },
  2822. addUpload(data) {
  2823. // var zhi = data.fileName.split('.')[0]
  2824. // var sss = zhi + '.xlsx'
  2825. // return
  2826. var filePath = '/upload/' + data.serverName;
  2827. const a = document.createElement('a'); // 创建a标签
  2828. a.setAttribute('download', data.fileName);// download属性
  2829. a.setAttribute('href', filePath);// href链接
  2830. a.click(); //自执行点击事件
  2831. a.remove();
  2832. },
  2833. restrictNumber(targetId) {
  2834. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  2835. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  2836. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  2837. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  2838. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  2839. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  2840. inpu.value = parseFloat(inpu.value);
  2841. }
  2842. },
  2843. //获取项目下的任务分组
  2844. getTaskGroups(domain, index) {
  2845. domain.groupId=null;
  2846. this.http.post('/task-group/listMyJoinGroup',{
  2847. projectId: domain.projectId,
  2848. isSubstitude: this.isSubstitude ? 1 : 0
  2849. },
  2850. res => {
  2851. if (res.code == "ok") {
  2852. this.workForm.domains[index].taskGroups = res.data;
  2853. // if (this.workForm.domains[index].taskGroups.length > 0) {
  2854. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  2855. // this.getGroupStages(domain, index);
  2856. // }
  2857. this.$forceUpdate();
  2858. }
  2859. },
  2860. error => {
  2861. this.$message({
  2862. message: error,
  2863. type: "error"
  2864. });
  2865. }
  2866. );
  2867. },
  2868. //下载填报工时占比报表
  2869. downloadProjectRatio() {
  2870. this.exportUserRatio = true;
  2871. // let now = new Date();
  2872. // let month = now.getMonth();//默认看上个月的
  2873. // let monthStr = month<10? ('0'+month): month;
  2874. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  2875. const today = new Date();
  2876. const year = today.getFullYear();
  2877. const month = today.getMonth() + 1;
  2878. let lastMonthYear, lastMonth;
  2879. if (month === 1) {
  2880. lastMonthYear = year - 1;
  2881. lastMonth = 12;
  2882. } else {
  2883. lastMonthYear = year;
  2884. lastMonth = month - 1;
  2885. }
  2886. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  2887. console.log('赋值 ==>', this.ratioYmonth)
  2888. },
  2889. confirmDownloadRatio() {
  2890. this.startRatioExporting = true;
  2891. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  2892. ymonth: this.ratioYmonth
  2893. },
  2894. res => {
  2895. if (res.code == "ok") {
  2896. this.startRatioExporting = false;
  2897. var filePath = res.data;
  2898. const a = document.createElement('a'); // 创建a标签
  2899. var data = filePath.split("/");
  2900. a.setAttribute('download', data[data.length-1]);// download属性
  2901. a.setAttribute('href', filePath);// href链接
  2902. a.click(); //自执行点击事件
  2903. a.remove();
  2904. } else {
  2905. this.startRatioExporting = false;
  2906. this.$message({
  2907. message: res.msg,
  2908. type: "error"
  2909. });
  2910. }
  2911. },
  2912. error => {
  2913. this.checkinLoading = false;
  2914. this.$message({
  2915. message: error,
  2916. type: "error"
  2917. });
  2918. }
  2919. );
  2920. },
  2921. //下载带企业微信考勤数据的工时统计模板
  2922. downloadCheckInExcel() {
  2923. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  2924. startDate: this.importWxParam.date[0],
  2925. endDate: this.importWxParam.date[1],
  2926. },
  2927. res => {
  2928. if (res.code == "ok") {
  2929. var filePath = res.data;
  2930. const a = document.createElement('a'); // 创建a标签
  2931. var data = filePath.split("/");
  2932. a.setAttribute('download', data[data.length-1]);// download属性
  2933. a.setAttribute('href', filePath);// href链接
  2934. a.click(); //自执行点击事件
  2935. a.remove();
  2936. } else {
  2937. this.$message({
  2938. message: res.msg,
  2939. type: "error"
  2940. });
  2941. }
  2942. },
  2943. error => {
  2944. this.checkinLoading = false;
  2945. this.$message({
  2946. message: error,
  2947. type: "error"
  2948. });
  2949. }
  2950. );
  2951. },
  2952. pre() {
  2953. if (this.active == 0) return;
  2954. this.active--;
  2955. },
  2956. next() {
  2957. this.active++;
  2958. },
  2959. triggerTotalTime(index) {
  2960. var item = this.checkinList[index];
  2961. var total = 0.0;
  2962. for (var i=0;i<this.projectColumns.length; i++) {
  2963. var key = this.projectColumns[i];
  2964. if (item[key] != null && item[key] != '') {
  2965. total += parseFloat(item[key]);
  2966. }
  2967. }
  2968. item.totalFillTime = total;
  2969. },
  2970. //提交批量代填的数据
  2971. submitBatchSubFillData() {
  2972. var data = JSON.stringify(this.checkinList);
  2973. this.http.post('/user-corpwx-time/submitProjectTime',{
  2974. json: data,
  2975. projectColumns: JSON.stringify(this.projectColumns)
  2976. },
  2977. res => {
  2978. if (res.code == "ok") {
  2979. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  2980. this.importWxDialog = false;
  2981. }
  2982. },
  2983. error => {
  2984. this.checkinLoading = false;
  2985. this.$message({
  2986. message: error,
  2987. type: "error"
  2988. });
  2989. }
  2990. );
  2991. },
  2992. loadCheckInData() {
  2993. if (this.importWxParam.date == null) {
  2994. this.checkinList = [];
  2995. return;
  2996. }
  2997. this.checkinLoading = true;
  2998. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  2999. startDate: this.importWxParam.date[0],
  3000. endDate: this.importWxParam.date[1],
  3001. },
  3002. res => {
  3003. if (res.code == "ok") {
  3004. this.checkinLoading = false;
  3005. this.checkinList = res.data.list;
  3006. this.projectColumns = res.data.projects;
  3007. // 自定义表格会导致表格错乱,需重新计算表格
  3008. this.$nextTick(()=>{
  3009. this.$refs.tab.doLayout()
  3010. })
  3011. }
  3012. },
  3013. error => {
  3014. this.checkinLoading = false;
  3015. this.$message({
  3016. message: error,
  3017. type: "error"
  3018. });
  3019. }
  3020. );
  3021. },
  3022. importCardTime(item) {
  3023. //首先判断文件类型
  3024. let str = item.file.name.split(".");
  3025. let format = str[str.length - 1];
  3026. if (format != "xls" && format != "xlsx") {
  3027. this.$message({
  3028. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3029. type: "error"
  3030. });
  3031. } else {
  3032. this.importingData = true;
  3033. let formData = new FormData();
  3034. formData.append("multipartFile", item.file);
  3035. formData.append("companyId", this.user.companyId);
  3036. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3037. res => {
  3038. this.$refs.uploadCardTime.clearFiles();
  3039. this.importingData = false;
  3040. if (res.code == "ok") {
  3041. //换成弹出框,以免有人等了半天回来啥也没看到
  3042. this.$message({
  3043. message: '导入考勤时长成功',
  3044. type: "success"
  3045. });
  3046. } else {
  3047. this.$message({
  3048. message: res.msg,
  3049. type: "error"
  3050. });
  3051. }
  3052. },
  3053. error => {
  3054. this.$refs.upload.clearFiles();
  3055. this.listLoading = false;
  3056. this.$message({
  3057. message: error,
  3058. type: "error"
  3059. });
  3060. });
  3061. }
  3062. },
  3063. batchImportWxData(item) {
  3064. //首先判断文件类型
  3065. let str = item.file.name.split(".");
  3066. let format = str[str.length - 1];
  3067. if (format != "xls" && format != "xlsx") {
  3068. this.$message({
  3069. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3070. type: "error"
  3071. });
  3072. } else {
  3073. this.importingData = true;
  3074. let formData = new FormData();
  3075. formData.append("file", item.file);
  3076. formData.append("companyId", this.user.companyId);
  3077. formData.append("withCheckIn", 1);
  3078. this.http.uploadFile('/report/importData', formData,
  3079. res => {
  3080. this.$refs.upload.clearFiles();
  3081. this.showImportResult = true;
  3082. this.importingData = false;
  3083. if (res.code == "ok") {
  3084. //换成弹出框,以免有人等了半天回来啥也没看到
  3085. this.importResultMsg = '成功导入' +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3086. this.getReportList();
  3087. this.importWxDialog = false;
  3088. } else {
  3089. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3090. }
  3091. },
  3092. error => {
  3093. this.$refs.upload.clearFiles();
  3094. this.listLoading = false;
  3095. this.$message({
  3096. message: error,
  3097. type: "error"
  3098. });
  3099. });
  3100. }
  3101. },
  3102. batchImportData(item) {
  3103. //首先判断文件类型
  3104. let str = item.file.name.split(".");
  3105. let format = str[str.length - 1];
  3106. if (format != "xls" && format != "xlsx") {
  3107. this.$message({
  3108. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3109. type: "error"
  3110. });
  3111. } else {
  3112. this.importingData = true;
  3113. let formData = new FormData();
  3114. formData.append("file", item.file);
  3115. formData.append("companyId", this.user.companyId);
  3116. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936)?'/report/importNewData':'/report/importData'
  3117. this.http.uploadFile(url, formData,
  3118. res => {
  3119. this.$refs.upload.clearFiles();
  3120. this.importingData = false;
  3121. this.showImportResult = true;
  3122. if (res.code == "ok") {
  3123. //换成弹出框,以免有人等了半天回来啥也没看到
  3124. this.importResultMsg = "成功导入"+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3125. this.getReportList();
  3126. this.importWXDialog = false;
  3127. } else {
  3128. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3129. }
  3130. },
  3131. error => {
  3132. this.$refs.upload.clearFiles();
  3133. this.importingData = false;
  3134. this.$message({
  3135. message: error,
  3136. type: "error"
  3137. });
  3138. });
  3139. }
  3140. },
  3141. userssHu() {
  3142. this.http.post('/time-type/getCompanyTimeSetting',{
  3143. companyId: this.user.companyId
  3144. },
  3145. res => {
  3146. if (res.code == "ok") {
  3147. this.yonghuUser = res.data
  3148. }
  3149. },
  3150. error => {
  3151. this.$message({
  3152. message: error,
  3153. type: "error"
  3154. });
  3155. }
  3156. );
  3157. },
  3158. iptBlur(i) {
  3159. if(this.isBatch == 0) {
  3160. return
  3161. }
  3162. var reqParam = {
  3163. startDate: this.workForm.createDate[0],
  3164. endDate: this.workForm.createDate[1]
  3165. };
  3166. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3167. reqParam.userId = this.workForm.userId[0];
  3168. }
  3169. this.http.post('/report/getWorkDays',reqParam,
  3170. res => {
  3171. if (res.code == "ok") {
  3172. this.jsDay = res.data
  3173. this.chuji(i)
  3174. } else {
  3175. this.$message({
  3176. message: res.msg,
  3177. type: "error"
  3178. });
  3179. }
  3180. },
  3181. error => {
  3182. this.$message({
  3183. message: error,
  3184. type: "error"
  3185. });
  3186. }
  3187. );
  3188. //明夷硬编码获取
  3189. if (this.user.company.companyName == this.mingyiName) {
  3190. this.getWorkTimeForMinYi();
  3191. }
  3192. },
  3193. getWorkTimeForMinYi(){
  3194. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3195. startDate: this.workForm.createDate[0],
  3196. endDate: this.workForm.createDate[1]
  3197. },
  3198. res => {
  3199. if (res.code == "ok") {
  3200. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3201. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3202. this.totalReportHours = this.workTimeForMinYi;
  3203. } else {
  3204. this.$message({
  3205. message: res.msg,
  3206. type: "error"
  3207. });
  3208. this.workForm.createDate = [];
  3209. }
  3210. },
  3211. error => {
  3212. this.$message({
  3213. message: error,
  3214. type: "error"
  3215. });
  3216. }
  3217. );
  3218. },
  3219. chuji(i) {
  3220. if(i == 0) {
  3221. this.seleChn(1)
  3222. } else if(i == 1) {
  3223. this.seleChn(0)
  3224. } else if(i == 2) {
  3225. if(this.workForm.domains[0].multiWorktime > 0) {
  3226. this.iptChangs()
  3227. } else {
  3228. this.iptChang()
  3229. }
  3230. } else if(i == 3) {
  3231. this.seleChn(0)
  3232. }
  3233. },
  3234. seleChn(e,domain) {
  3235. if(e == 1) {
  3236. for(var i in this.workForm.domains) {
  3237. if(this.workForm.domains[i].timeType == 0) {
  3238. this.workForm.domains[i].workingTime = 8
  3239. } else {
  3240. this.workForm.domains[i].workingTime = 4
  3241. }
  3242. }
  3243. }
  3244. var quanbu = 0
  3245. var spl = this.workForm.domains
  3246. var zhi = ''
  3247. for(var i in spl) {
  3248. var sp = +spl[i].workingTime + 0
  3249. zhi = this.jsDay * sp
  3250. quanbu = +quanbu + zhi
  3251. }
  3252. this.jsTime = quanbu
  3253. this.totalReportHours = quanbu
  3254. let worktime = this.jsTime
  3255. // 自动计算加班时长
  3256. if(this.isBatch != 0){
  3257. worktime = this.jsTime / this.jsDay
  3258. }
  3259. if(this.user.timeType.fillOvertime && domain){
  3260. let isover = false
  3261. let alltime = 0
  3262. let allover = 0 //此处alltime同上面的worktime
  3263. for(let d in spl){
  3264. if(spl[d].isOvertime){
  3265. isover = true
  3266. allover += spl[d].overtimeHours*1
  3267. }
  3268. alltime += spl[d].workingTime*1
  3269. }
  3270. if(domain.overtimeHours){
  3271. allover = allover - domain.overtimeHours
  3272. }
  3273. if(worktime*1 > this.user.timeType.allday){
  3274. if(isover){
  3275. if(alltime > (allover + this.user.timeType.allday)){
  3276. this.$set(domain,'isOvertime',true)
  3277. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3278. }else{
  3279. this.$set(domain,'isOvertime',false)
  3280. this.$set(domain,'overtimeHours',null)
  3281. if(alltime < (allover + this.user.timeType.allday)){
  3282. let overtime = allover + this.user.timeType.allday - alltime
  3283. for(let pi in spl){
  3284. if(spl[pi].overtimeHours){
  3285. if((overtime - spl[pi].overtimeHours*1) > 0){
  3286. overtime = overtime - spl[pi].overtimeHours*1
  3287. this.$set(spl[pi],'isOvertime',false)
  3288. this.$set(spl[pi],'overtimeHours',null)
  3289. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3290. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3291. break
  3292. }else{
  3293. this.$set(spl[pi],'isOvertime',false)
  3294. this.$set(spl[pi],'overtimeHours',null)
  3295. break
  3296. }
  3297. }
  3298. }
  3299. }
  3300. }
  3301. }else{
  3302. this.$set(domain,'isOvertime',true)
  3303. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3304. }
  3305. }else{
  3306. for(let di in spl){
  3307. this.$set(spl[di],'isOvertime',false)
  3308. this.$set(spl[di],'overtimeHours',null)
  3309. }
  3310. }
  3311. }
  3312. },
  3313. iptChang() {
  3314. var sl = this.workForm.domains
  3315. let timeArr = []
  3316. for(var i in sl) {
  3317. if(sl[i].startTime && sl[i].endTime) {
  3318. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3319. }
  3320. }
  3321. this.getTimeHours(timeArr)
  3322. // for(let j in arrNum) {
  3323. // this.timeJsonStr += arrNum[j]
  3324. // if(flg) {
  3325. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3326. // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
  3327. // }
  3328. // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
  3329. // flg = true
  3330. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3331. // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
  3332. // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
  3333. // }
  3334. // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
  3335. // this.$set(this.workForm.domains[j],'isOvertime', false)
  3336. // this.$set(this.workForm.domains[j],'overtimeHours', '')
  3337. // }
  3338. // }
  3339. },
  3340. iptChangs() {
  3341. var sl = this.workForm.domains
  3342. let timeArr = []
  3343. for(var i in sl) {
  3344. for(var j in sl[i].worktimeList){
  3345. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3346. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3347. }
  3348. }
  3349. }
  3350. this.getTimeHours(timeArr)
  3351. },
  3352. // 调用接口或去数据
  3353. getTimeHours(arr) {
  3354. this.http.post('/report/getHoursByTimeRange',{
  3355. timeJsonStr: JSON.stringify(arr)
  3356. },res => {
  3357. if(res.code === 'ok') {
  3358. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3359. } else {
  3360. this.$message({
  3361. message: res.msg,
  3362. type: 'error'
  3363. })
  3364. }
  3365. },err => {
  3366. this.$message({
  3367. message: err,
  3368. type: 'error'
  3369. })
  3370. })
  3371. },
  3372. // 按周填报调用接口计算时间
  3373. async getWeekHoursByTimeRange(timeRange) {
  3374. const url = '/report/getHoursByTimeRange';
  3375. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3376. var that = this;
  3377. return new Promise((resolve, reject) => {
  3378. this.http.post(url, data, function(res) {
  3379. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3380. }, function(err) {
  3381. reject(err);
  3382. });
  3383. });
  3384. },
  3385. removeTimeItem(item, index) {
  3386. item.worktimeList.splice(index, 1);
  3387. this.iptChangs()
  3388. },
  3389. //添加工时
  3390. addNewWorktime(index, item) {
  3391. if(item.worktimeList == null ) {
  3392. item.worktimeList = []
  3393. }
  3394. item.worktimeList.push({});
  3395. },
  3396. //复制项目
  3397. copyProject(index) {
  3398. var leftProgress = 10;
  3399. if (this.reportTimeType.type == 3) {
  3400. //计算已经待分配工时比例
  3401. let array = this.workForm.domains;
  3402. let totalProgress = 0;
  3403. for (var i=0;i<array.length; i++) {
  3404. totalProgress += array[i].progress;
  3405. }
  3406. if (totalProgress < 100) {
  3407. leftProgress = 100 - totalProgress;
  3408. }
  3409. }
  3410. var newIndex = index+1;
  3411. var itemDomain = {
  3412. projectId: this.workForm.domains[index].projectId,
  3413. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3414. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3415. ),
  3416. content: "",
  3417. progress:leftProgress,
  3418. state:2,//2-表示待提交
  3419. };
  3420. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3421. if (this.reportTimeType.type == 0) {
  3422. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3423. var length = this.workForm.domains.length;
  3424. if (length == 2) {
  3425. this.showAddMore = false;
  3426. }
  3427. }
  3428. this.selectProject(itemDomain, newIndex);
  3429. },
  3430. pushWorkTime(reportId){
  3431. let url=''
  3432. if(this.user.timeType.syncSap == 1){
  3433. url='/report/pushProjectReportToSap'
  3434. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3435. var pushDate = this.date + day;
  3436. this.$confirm(reportId?'确认推送当前工时?':('确认推送'+pushDate+'的工时?'), '提示', {
  3437. confirmButtonText: '确定',
  3438. cancelButtonText: '取消',
  3439. type: 'info'
  3440. }).then(() => {
  3441. const loading = this.$loading({
  3442. lock: true,
  3443. text: '正在推送中,请耐心等待。',
  3444. spinner: 'el-icon-loading',
  3445. background: 'rgba(0, 0, 0, 0.7)'
  3446. });
  3447. this.http.post(url,{
  3448. pushDate: pushDate,
  3449. reportId: reportId
  3450. },res => {
  3451. loading.close();
  3452. if(res.code == 'ok'){
  3453. this.$message({
  3454. type: 'success',
  3455. message: res.data
  3456. });
  3457. }else{
  3458. this.$message({
  3459. type: 'error',
  3460. message: res.msg
  3461. })
  3462. }
  3463. },err => {
  3464. loading.close();
  3465. this.$message({
  3466. type: 'error',
  3467. message: err
  3468. })
  3469. })
  3470. }).catch(() => {
  3471. });
  3472. }else{
  3473. url='/report/pushReportDataToThird'
  3474. this.$confirm('确认推送'+this.date+'月的工时?', '提示', {
  3475. confirmButtonText: '确定',
  3476. cancelButtonText: '取消',
  3477. type: 'info'
  3478. }).then(() => {
  3479. const loading = this.$loading({
  3480. lock: true,
  3481. text: '正在推送中,请耐心等待。',
  3482. spinner: 'el-icon-loading',
  3483. background: 'rgba(0, 0, 0, 0.7)'
  3484. });
  3485. this.http.post(url,{
  3486. yearMonth: this.date
  3487. },res => {
  3488. loading.close();
  3489. if(res.code == 'ok'){
  3490. this.$message({
  3491. type: 'success',
  3492. message: '推送成功!'
  3493. });
  3494. }else{
  3495. this.$message({
  3496. type: 'error',
  3497. message: res.msg
  3498. })
  3499. }
  3500. },err => {
  3501. loading.close();
  3502. this.$message({
  3503. type: 'error',
  3504. message: err
  3505. })
  3506. })
  3507. }).catch(() => {
  3508. });
  3509. }
  3510. },
  3511. showWorkTime(){
  3512. this.monthWorkTimeDialog = true;
  3513. this.searchKeyword = ''
  3514. this.WorktimeDatepickValue = this.istoMonth()
  3515. if(this.WorktimeDatepickValue.length == 0){
  3516. let newdate = new Date();
  3517. let nowdate = newdate.toLocaleDateString();
  3518. let getauto = this.getAutoWeekDate(nowdate)
  3519. let nowwd = [getauto[0],getauto[6]]
  3520. this.WorktimeDatepickValue = nowwd
  3521. }
  3522. this.showMonthWorkTime()
  3523. },
  3524. handleClick(t,e){
  3525. if (t.name == "first") {
  3526. this.showMonthWorkTime()
  3527. }else{
  3528. this.showMonthNotWorkTime()
  3529. }
  3530. },
  3531. //导出员工每日填报工时数
  3532. exportMembWorkHours() {
  3533. this.http.post(
  3534. "/report/exportUserDailyWorkTime",
  3535. {
  3536. // month: this.date,
  3537. startDate: this.WorktimeDatepickValue[0],
  3538. endDate: this.WorktimeDatepickValue[1],
  3539. },
  3540. (res) => {
  3541. if (res.code == "ok") {
  3542. let url = res.data;
  3543. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3544. }
  3545. },
  3546. (error) => {
  3547. this.$message({
  3548. message: error,
  3549. type: "error",
  3550. });
  3551. }
  3552. );
  3553. },
  3554. exportMembNotWorkHours() {
  3555. this.http.post(
  3556. "/report/exportNoReportUserList",
  3557. {
  3558. // month: this.date,
  3559. startDate: this.WorktimeDatepickValue[0],
  3560. endDate: this.WorktimeDatepickValue[1],
  3561. },
  3562. (res) => {
  3563. if (res.code == "ok") {
  3564. let url = res.data;
  3565. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3566. }
  3567. },
  3568. (error) => {
  3569. this.$message({
  3570. message: error,
  3571. type: "error",
  3572. });
  3573. }
  3574. );
  3575. },
  3576. downloadByA(name, url) {
  3577. const a = document.createElement("a"); // 创建a标签
  3578. a.setAttribute("download", name); // download属性
  3579. a.setAttribute("href", url); // href链接
  3580. a.click(); // 自执行点击事件
  3581. a.remove();
  3582. },
  3583. // 是否本月判断
  3584. istoMonth(){
  3585. let todate = new Date()
  3586. let tomonth = todate.getMonth() + 1
  3587. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  3588. if(this.date == adate){
  3589. return []
  3590. }else{
  3591. let sedate = new Date(this.date)
  3592. let semonth = sedate.getMonth() + 1
  3593. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  3594. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  3595. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  3596. return [sedates1, sedates2]
  3597. }
  3598. },
  3599. showMonthWorkTime() {
  3600. this.monthTotalPage = 0,
  3601. this.tbload = true
  3602. this.http.post(
  3603. "/report/getUserDailyWorkTime",
  3604. // "/report/getNoReportUserList",
  3605. {
  3606. // month: this.date,
  3607. startDate: this.WorktimeDatepickValue[0],
  3608. endDate: this.WorktimeDatepickValue[1],
  3609. },
  3610. (res) => {
  3611. if (res.code == "ok") {
  3612. this.tbload = false;
  3613. this.pickDateArray = res.data.days;
  3614. // console.log('dataarray',res.data.days);
  3615. this.monthWorkData = res.data.list;
  3616. // this.monthWorkDataS = this.monthWorkData
  3617. // this.monthWorkDataS1 = res.data.list
  3618. this.monthTotal = res.data.list.length
  3619. if (this.monthWorkData.length > 50) {
  3620. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3621. }else{
  3622. this.monthWorkDataS = this.monthWorkData
  3623. }
  3624. this.searchScreen(0)
  3625. // this.monthWorkDataS = infoList
  3626. // 判断
  3627. // if (this.monthWorkDataS1.length > 0) {
  3628. // setTimeout(() => {
  3629. // this.tableListener()
  3630. // }, 1000);
  3631. // }
  3632. this.$nextTick(function(){
  3633. this.$refs.hasworkTbl.doLayout();
  3634. });
  3635. // this.$forceUpdate()
  3636. }
  3637. },
  3638. (error) => {
  3639. this.tbload = false
  3640. this.$message({
  3641. message: error,
  3642. type: "error",
  3643. });
  3644. }
  3645. );
  3646. },
  3647. // tableListener(){
  3648. // let that = this;
  3649. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  3650. // // 添加scroll监听事件
  3651. // dom.addEventListener("scroll", function () {
  3652. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3653. // if (scrollDistance < 2) {
  3654. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  3655. // that.monthTotalPage++; //当前页数自增
  3656. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  3657. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  3658. // var infoList = arrList.splice(
  3659. // that.monthTotalPage * that.monthTotalLages,
  3660. // that.monthTotalLages
  3661. // );
  3662. // // 数据添加
  3663. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  3664. // }
  3665. // }
  3666. // })
  3667. // },
  3668. showMonthNotWorkTime() {
  3669. this.monthTotalPage = 0,
  3670. this.tbload = true,
  3671. this.http.post(
  3672. "/report/getNoReportUserList",
  3673. {
  3674. startDate: this.WorktimeDatepickValue[0],
  3675. endDate: this.WorktimeDatepickValue[1],
  3676. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  3677. },
  3678. (res) => {
  3679. if (res.code == "ok") {
  3680. this.tbload = false
  3681. this.monthNotWorkDate = res.data;
  3682. // this.monthNotWorkDateS1 = res.data
  3683. this.monthnotTotal = res.data.length
  3684. // 2222111
  3685. if (this.monthNotWorkDate.length > 50) {
  3686. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  3687. } else {
  3688. this.monthNotWorkDateS = this.monthNotWorkDate
  3689. }
  3690. this.searchScreen(1)
  3691. // 判断
  3692. // if (this.monthnotworkDateS1.length > 0) {
  3693. // setTimeout(() => {
  3694. // this.tableListenernot()
  3695. // }, 1000);
  3696. // }
  3697. this.$nextTick(function(){
  3698. this.$refs.hasworkTbl2.doLayout();
  3699. });
  3700. }
  3701. },
  3702. (error) => {
  3703. this.tbload = false
  3704. this.$message({
  3705. message: error,
  3706. type: "error",
  3707. });
  3708. }
  3709. );
  3710. },
  3711. // tableListenernot(){
  3712. // let that = this;
  3713. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  3714. // dom.addEventListener("scroll", function () {
  3715. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  3716. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3717. // if (scrollDistance2 < 2) {
  3718. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  3719. // that.monthnotTotalPage++; //当前页数自增
  3720. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  3721. // var infoList = arrList.splice(
  3722. // that.monthnotTotalPage * that.monthnotTotalLages,
  3723. // that.monthnotTotalLages
  3724. // );
  3725. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  3726. // }
  3727. // }
  3728. // })
  3729. // },
  3730. listScroll(){
  3731. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  3732. this.isMore = true
  3733. setTimeout(()=>{
  3734. this.isMore = false
  3735. },1000)
  3736. }else {
  3737. this.isFlag = true
  3738. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  3739. this.monthWorkDataS = datalist
  3740. setTimeout(()=>{
  3741. this.isFlag = false
  3742. },300)
  3743. }
  3744. },
  3745. notListScroll(){
  3746. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  3747. this.isMore = true
  3748. setTimeout(()=>{
  3749. this.isMore = false
  3750. },1000)
  3751. }else {
  3752. this.isFlag = true
  3753. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  3754. this.monthNotWorkDateS = datalist
  3755. // console.log('length',this.monthNotWorkDateS.length)
  3756. setTimeout(()=>{
  3757. this.isFlag = false
  3758. },300)
  3759. }
  3760. },
  3761. // 获取默认这zhou日期参数 222
  3762. getLastWeek(e){
  3763. let newdate = new Date()
  3764. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  3765. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  3766. if(e){
  3767. this.WorktimeDatepickValue = lastwd
  3768. this.showMonthWorkTime()
  3769. }else{
  3770. this.WorktimeDatepickValue = lastwd
  3771. this.showMonthNotWorkTime()
  3772. }
  3773. },
  3774. getThisWeek(e){
  3775. let newdate = new Date();
  3776. let nowdate = newdate.toLocaleDateString();
  3777. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  3778. if(e){
  3779. this.WorktimeDatepickValue = nowwd
  3780. this.showMonthWorkTime()
  3781. }else{
  3782. this.WorktimeDatepickValue = nowwd
  3783. this.showMonthNotWorkTime()
  3784. }
  3785. },
  3786. getDoubleLastWeek(e){
  3787. let newdate = new Date()
  3788. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  3789. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  3790. if(e){
  3791. this.WorktimeDatepickValue = nextwd
  3792. this.showMonthWorkTime()
  3793. }else{
  3794. this.WorktimeDatepickValue = nextwd
  3795. this.showMonthNotWorkTime()
  3796. }
  3797. },
  3798. alreadyAllDate(stime,etime){
  3799. let diffdate = new Array();
  3800. let i=0;
  3801. while(stime<=etime){
  3802. let dateArray = stime.split("-");
  3803. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  3804. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  3805. let stimewk = this.weekDay[date.getDay()]
  3806. let timedate = (stime.split("-")[1].charAt(0) == 0 ? stime.split("-")[1].charAt(1) : stime.split("-")[1]) + this.$t('weekDay.month') + (stime.split("-")[2].charAt(0) == 0 ? stime.split("-")[2].charAt(1) : stime.split("-")[2]) + this.$t('weekDay.day')
  3807. let timeshowdate = (stime.split("-")[1].charAt(0) == 0 ? stime.split("-")[1].charAt(1) : stime.split("-")[1]) + "." + (stime.split("-")[2].charAt(0) == 0 ? stime.split("-")[2].charAt(1) : stime.split("-")[2])
  3808. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  3809. let stime_ts = new Date(stime).getTime();
  3810. let next_date = stime_ts + (24*60*60*1000);
  3811. let next_dates_y = new Date(next_date).getFullYear()+'-';
  3812. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  3813. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  3814. stime = next_dates_y+next_dates_m+next_dates_d;
  3815. i++;
  3816. }
  3817. return diffdate
  3818. },
  3819. getAutoWeekDate(e) {
  3820. let dateString = e;
  3821. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  3822. if (dateString.match(dateStringReg)) {
  3823. let presentDate = new Date(dateString),
  3824. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  3825. return Array.from(new Array(7), function (val, index) {
  3826. let formatDate = new Date(
  3827. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  3828. );
  3829. return (
  3830. formatDate.getFullYear() +
  3831. "-" +
  3832. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  3833. "-" +
  3834. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  3835. );
  3836. });
  3837. } else {
  3838. throw new Error(
  3839. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  3840. );
  3841. }
  3842. },
  3843. onProgressChange() {
  3844. this.$forceUpdate();
  3845. },
  3846. showChooseMembTree() {
  3847. this.chosenMembCount = this.participator.length;
  3848. this.chooseParticipVisible = true;
  3849. },
  3850. onTreeItemChange() {
  3851. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3852. var list = chosenList.filter(item=>item.isUser == 1);
  3853. this.chosenMembCount = list.length;
  3854. },
  3855. findUserInTree() {
  3856. if (this.filterName == '') {
  3857. this.deptMembData = this.allMembData;
  3858. } else {
  3859. var list = this.findRecursively(this.filterName, this.allMembData);
  3860. this.deptMembData = list;
  3861. }
  3862. },
  3863. findRecursively(username, list) {
  3864. var filterList = [];
  3865. for (var i=0;i<list.length; i++) {
  3866. if (list[i].isUser == 1) {
  3867. if (list[i].label.indexOf(username) >= 0) {
  3868. //匹配上了
  3869. filterList.push(list[i]);
  3870. }
  3871. } else if (list[i].children != null && list[i].children.length > 0) {
  3872. var subList = this.findRecursively(username, list[i].children);
  3873. if (subList.length > 0) {
  3874. subList.forEach(s=>filterList.push(s));
  3875. }
  3876. }
  3877. }
  3878. return filterList;
  3879. },
  3880. //确定选择参与人
  3881. chooseParticip() {
  3882. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3883. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  3884. //针对专业版,只能选择一个人进行代填,防止任务有问题
  3885. if (this.user.company.packageProject == 1) {
  3886. if (this.chosenMembList.length > 1) {
  3887. this.$message({
  3888. message: '每次仅支持代填一个人',
  3889. type: "error",
  3890. });
  3891. return;
  3892. }
  3893. }
  3894. this.chooseParticipVisible = false;
  3895. this.workForm.userNames = '';
  3896. this.workForm.userId = [];
  3897. this.participator = [];
  3898. for (var i=0;i<this.chosenMembList.length; i++) {
  3899. this.workForm.userId.push(this.chosenMembList[i].id);
  3900. this.workForm.userNames += this.chosenMembList[i].label+',';
  3901. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  3902. this.participator.push(item);
  3903. }
  3904. if (this.workForm.userNames.length > 0) {
  3905. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  3906. }
  3907. if(this.user.userNameNeedTranslate == 1) {
  3908. if(this.workForm.userNames) {
  3909. this.workForm.userNames = this.workForm.userNames.split(',')
  3910. }
  3911. }
  3912. },
  3913. notifySel(sel){
  3914. // console.log(sel);
  3915. this.notifySelList = sel
  3916. },
  3917. //微信通知人员填写
  3918. Notify(code) {
  3919. if (this.notifySelList.length == 0) return;
  3920. var ids = '';
  3921. this.notifySelList.forEach(f=>{
  3922. ids += f.id+',';
  3923. })
  3924. this.http.post('/user/pushFillReport',{
  3925. ids: ids, date: this.curDate,
  3926. code: code
  3927. },
  3928. res => {
  3929. if (res.code == "ok") {
  3930. this.$message({
  3931. message: this.$t('message.sentSuccessfully'),
  3932. type: "success"
  3933. });
  3934. }
  3935. },
  3936. error => {
  3937. this.$message({
  3938. message: error,
  3939. type: "error"
  3940. });
  3941. }
  3942. );
  3943. },
  3944. //导出人员列表
  3945. exportMemb() {
  3946. if (this.fillMembList.length == 0) return;
  3947. var ids = '';
  3948. this.fillMembList.forEach(f=>{
  3949. ids += f.id+',';
  3950. })
  3951. this.http.post('/user/exportMembList',{
  3952. ids: ids,isFill: this.isFill, date: this.curDate
  3953. },
  3954. res => {
  3955. if (res.code == "ok") {
  3956. var aTag = document.createElement('a');
  3957. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  3958. aTag.href = res.data;
  3959. aTag.click();
  3960. }
  3961. },
  3962. error => {
  3963. this.$message({
  3964. message: error,
  3965. type: "error"
  3966. });
  3967. }
  3968. );
  3969. },
  3970. showMembList(fill) {
  3971. this.membListVisible = true;
  3972. if (fill == 0) {
  3973. this.fillMembList = this.unFillList;
  3974. this.isFill = false;
  3975. let leaveList = []
  3976. let unleaveList = []
  3977. for(let i in this.fillMembList){
  3978. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  3979. leaveList.push(this.fillMembList[i])
  3980. }else{
  3981. unleaveList.push(this.fillMembList[i])
  3982. }
  3983. }
  3984. this.fillMembList = unleaveList
  3985. this.fillMembList_leave = leaveList
  3986. } else if(fill == 1){
  3987. this.fillMembList = this.fillList.filter(item => item.state != 3);
  3988. this.isFill = true;
  3989. }else{
  3990. this.fillMembList = this.fillList.filter(item => item.state == 3);
  3991. this.isFill = true;
  3992. }
  3993. },
  3994. //获取自己填写的日报状态
  3995. getReportFillStatus() {
  3996. this.http.post('/report/getReportFillStatus',{
  3997. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  3998. },
  3999. res => {
  4000. if (res.code == "ok") {
  4001. this.fillStatusList = res.data;
  4002. this.allDate.forEach(d=>{
  4003. var fillInfo = null;
  4004. d.state = null;
  4005. this.fillStatusList.forEach(s=>{
  4006. // console.log(d)
  4007. var d1 = s.createDate.split('-')[2];
  4008. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4009. // console.log(d2, '我被执行了')
  4010. if (d1.indexOf('0') == 0) {
  4011. d1 = d1.substring(1,d1.length);
  4012. }
  4013. if (d1 == d2) {
  4014. d.state = s.state;
  4015. }
  4016. })
  4017. })
  4018. this.$forceUpdate();
  4019. }
  4020. },
  4021. error => {
  4022. this.$message({
  4023. message: error,
  4024. type: "error"
  4025. });
  4026. }
  4027. );
  4028. },
  4029. scrollFunction () {
  4030. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4031. if (this.domObj.attachEvent) { // IE
  4032. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4033. } else if (this.domObj.addEventListener) {
  4034. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4035. }
  4036. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4037. },
  4038. mouseScroll(event) { // google 浏览器下
  4039. let detail = event.wheelDelta || event.detail
  4040. let moveForwardStep = -1
  4041. let moveBackStep = 1
  4042. let step = 0
  4043. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4044. event.preventDefault() // 阻止浏览器默认事件
  4045. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4046. },
  4047. // //左右滚动
  4048. // wheel(e){
  4049. // var a = document.getElementById("dateScroll");
  4050. // var scroll_width = 80; //滚动一下的距离
  4051. // var e = e || window.event, v;
  4052. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4053. // if(v>3||-v>3) v=-v;
  4054. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4055. // e.preventDefault(); //阻止浏览器的默认滚动
  4056. // },
  4057. showExportDialog() {
  4058. this.exportType = 0
  4059. this.exportDialog = true;
  4060. },
  4061. showExportTimeDialog() {
  4062. this.exportTimeDialog = true;
  4063. },
  4064. changeAllTime() {
  4065. //总时长发生改变,自动按比例计算
  4066. this.workForm.domains.forEach(d=>{
  4067. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4068. });
  4069. //计算jsTime
  4070. if (this.workForm.createDate) {
  4071. let sdate = new Date(this.workForm.createDate[0]);
  4072. let edate = new Date(this.workForm.createDate[1]);
  4073. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4074. console.log('days===', days)
  4075. if (days < 0) {
  4076. days = 0;
  4077. }
  4078. this.jsTime = this.reportTimeType.allday * days;
  4079. }
  4080. },
  4081. // 是否加班的单机事件
  4082. check() {
  4083. this.selected = !this.selected
  4084. this.isNew = this.selected
  4085. },
  4086. updateSubProject() {
  4087. this.$forceUpdate();
  4088. },
  4089. selectDegreeId(domain, index) {
  4090. this.http.post('/report/defaultDegree',{
  4091. projectId: domain.projectId
  4092. },
  4093. res => {
  4094. if (res.code == "ok") {
  4095. if(res.data) {
  4096. this.workForm.domains[index].degreeId = res.data.id + ''
  4097. this.$forceUpdate();
  4098. }
  4099. }
  4100. },
  4101. error => {
  4102. this.$message({
  4103. message: error,
  4104. type: "error"
  4105. });
  4106. }
  4107. );
  4108. },
  4109. //项目选中了, 加载子项目
  4110. selectProject(domain, index) {
  4111. if(!domain.projectId){
  4112. return;
  4113. }
  4114. // 默认选中上次填写的自定义维度
  4115. if(this.yonghuUser.customDegreeActive == 1) {
  4116. this.selectDegreeId(domain, index)
  4117. }
  4118. // console.log('projectId===',domain.projectId);
  4119. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4120. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4121. this.http.post('/sub-project/list',{
  4122. projectId: domain.projectId,
  4123. isReport: true
  4124. },
  4125. res => {
  4126. //清空之前选中的子项目
  4127. // this.workForm.domains[index].subProjectId = 0;
  4128. if (res.code == "ok") {
  4129. this.workForm.domains[index].subProjectList = res.data;
  4130. this.workForm.domains[index].subProjectId = null;
  4131. this.$forceUpdate();
  4132. }
  4133. },
  4134. error => {
  4135. this.$message({
  4136. message: error,
  4137. type: "error"
  4138. });
  4139. }
  4140. );
  4141. //项目相关的近期任务
  4142. if (this.user.company.packageProject == 1) {
  4143. this.getRecentTaskList(domain, index);
  4144. //获取项目相关专业
  4145. if (this.user.company.packageEngineering == 1) {
  4146. this.getProjectProfessions(domain, index);
  4147. }
  4148. //获取项目下的任务分组
  4149. this.getTaskGroups(domain, index);
  4150. }
  4151. // 获取项目相关的维度
  4152. // domain.degreeId = null
  4153. this.$set(domain,'degreeId',null)
  4154. this.$set(domain,'multiDegrIdArray',null)
  4155. this.dimension(domain, index);
  4156. //获取项目审核人
  4157. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4158. this.getProjectAuditorList(domain, index);
  4159. } else {
  4160. //按分组的负责人来审核
  4161. domain.projectAuditorId = null;
  4162. domain.projectAuditorName = null;
  4163. domain.auditUserList = null;
  4164. }
  4165. console.log('this.reportTimeType.type==='+this.reportTimeType.type);
  4166. if (this.reportTimeType.type == 3) {
  4167. //新增项目时,自动计算
  4168. console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
  4169. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4170. }
  4171. //加载昱众的工作职责
  4172. if (this.user.companyId == this.yuzhongCompId) {
  4173. this.updateResponse(domain);
  4174. }
  4175. },
  4176. getRecentTaskList(domain, index) {
  4177. //刷新任务时,清空服务
  4178. this.$set(domain, 'sapServiceId', null);
  4179. this.$set(domain, 'taskId', null);
  4180. var param = {
  4181. projectId: domain.projectId,
  4182. isSubstitude:this.isSubstitude?1:0,
  4183. };
  4184. if (domain.groupId) {
  4185. param.groupId = domain.groupId;
  4186. }
  4187. if (domain.stage) {
  4188. param.stage = domain.stage;
  4189. }
  4190. //专业版代填,获取代填员工的任务
  4191. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4192. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4193. this.$message({
  4194. message: '请选择代填的员工',
  4195. type: "error"
  4196. });
  4197. return;
  4198. } else {
  4199. param.userId = this.workForm.userId[0];
  4200. }
  4201. }
  4202. this.http.post('/task/getRecentTask',param,
  4203. res => {
  4204. if (res.code == "ok") {
  4205. this.workForm.domains[index].allTaskList = res.data;
  4206. this.workForm.domains[index].taskList = res.data;
  4207. this.$forceUpdate();
  4208. }
  4209. },
  4210. error => {
  4211. this.$message({
  4212. message: error,
  4213. type: "error"
  4214. });
  4215. }
  4216. );
  4217. },
  4218. //获取项目审核人
  4219. getProjectAuditorList(domainItem, index) {
  4220. if(domainItem.projectId == '') {
  4221. return
  4222. }
  4223. domainItem.projectAuditorId = null;
  4224. domainItem.projectAuditorName = null;
  4225. this.http.post('/project-auditor/getList',{
  4226. projectId: domainItem.projectId,
  4227. },
  4228. res => {
  4229. if (res.code == "ok") {
  4230. domainItem.auditUserList = res.data;
  4231. if (res.data.length==0) {
  4232. this.$message({
  4233. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4234. type: "error"
  4235. });
  4236. } else if (res.data.length==1) {
  4237. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4238. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4239. }
  4240. this.$forceUpdate();
  4241. }
  4242. },
  4243. error => {
  4244. this.$message({
  4245. message: error,
  4246. type: "error"
  4247. });
  4248. }
  4249. );
  4250. },
  4251. // 获取维度数据
  4252. dimension(domain, index) {
  4253. if(domain.projectId == '') {
  4254. return
  4255. }
  4256. this.http.post('/project/getDegreeList',{
  4257. projectId: domain.projectId,
  4258. },
  4259. res => {
  4260. if (res.code == "ok") {
  4261. // console.log("维度数据",res.data);
  4262. this.workForm.domains[index].wuduList = res.data
  4263. // this.workForm = this.workForm
  4264. this.$forceUpdate()
  4265. }
  4266. },
  4267. error => {
  4268. this.$message({
  4269. message: error,
  4270. type: "error"
  4271. });
  4272. }
  4273. );
  4274. },
  4275. //切换任务阶段
  4276. changeStages(domain, index) {
  4277. if (domain.stage == null || domain.stage == '') {
  4278. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4279. } else {
  4280. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4281. }
  4282. this.getRecentTaskList(domain, index);
  4283. this.$forceUpdate();
  4284. },
  4285. getGroupStages(domain, index, keepStage) {
  4286. // console.log(domain);
  4287. if(!domain.groupId){
  4288. domain.projectAuditorId = ''
  4289. domain.stages = []
  4290. if(this.user.timeType.reportAuditType >= 1){
  4291. domain.auditUserList = []
  4292. }
  4293. this.$forceUpdate();
  4294. return
  4295. }
  4296. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4297. res => {
  4298. if (res.code == "ok") {
  4299. if (!keepStage) {
  4300. domain.stage = '';
  4301. }
  4302. domain.stages = res.data;
  4303. this.getRecentTaskList(domain, index);
  4304. this.$forceUpdate();
  4305. }
  4306. },
  4307. error => {
  4308. this.$message({
  4309. message: error,
  4310. type: "error"
  4311. });
  4312. });
  4313. //检查当前的项目是否需要获取分组的负责人
  4314. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 ) {
  4315. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4316. res => {
  4317. if (res.code == "ok") {
  4318. domain.getProjectAuditorList = res.data;
  4319. domain.auditUserList = res.data;
  4320. if (res.data.length==1) {
  4321. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4322. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4323. } else if (res.data.length==0) {
  4324. domain.projectAuditorId = null;
  4325. domain.projectAuditorName = null;
  4326. }
  4327. this.$forceUpdate();
  4328. }
  4329. },
  4330. error => {
  4331. this.$message({
  4332. message: error,
  4333. type: "error"
  4334. });
  4335. });
  4336. }
  4337. },
  4338. getProjectProfessions(domain, index) {
  4339. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4340. res => {
  4341. if (res.code == "ok") {
  4342. this.workForm.domains[index].professionProgress = res.data;
  4343. this.$forceUpdate();
  4344. }
  4345. },
  4346. error => {
  4347. this.$message({
  4348. message: error,
  4349. type: "error"
  4350. });
  4351. });
  4352. },
  4353. //删除自己的日报
  4354. deleteReport() {
  4355. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4356. confirmButtonText: this.$t('btn.determine'),
  4357. cancelButtonText: this.$t('btn.cancel'),
  4358. type: "warning"
  4359. })
  4360. .then(() => {
  4361. this.listLoading = true;
  4362. this.http.post('/report/delete',{
  4363. userId: this.user.id,
  4364. date: this.workForm.createDate
  4365. },
  4366. res => {
  4367. this.listLoading = false;
  4368. if (res.code == "ok") {
  4369. this.$message({
  4370. message: this.$t('message.successfullyDeleted'),
  4371. type: "success"
  4372. });
  4373. this.getReportList();
  4374. this.getDepartment();
  4375. this.dialogVisible = false;
  4376. } else {
  4377. this.$message({
  4378. message: res.msg,
  4379. type: "error"
  4380. });
  4381. }
  4382. },
  4383. error => {
  4384. this.listLoading = false;
  4385. this.$message({
  4386. message: error,
  4387. type: "error"
  4388. });
  4389. }
  4390. );
  4391. })
  4392. .catch(() => {});
  4393. },
  4394. // 管理员删除日报
  4395. guanli(item) {
  4396. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4397. let param = {date: this.date + day, userId: item.id};
  4398. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4399. confirmButtonText: this.$t('btn.determine'),
  4400. cancelButtonText: this.$t('btn.cancel'),
  4401. type: "warning"
  4402. })
  4403. .then(() => {
  4404. this.listLoading = true;
  4405. this.http.post('/report/delete',param,
  4406. res => {
  4407. this.listLoading = false;
  4408. if (res.code == "ok") {
  4409. this.$message({
  4410. message: this.$t('message.successfullyDeleted'),
  4411. type: "success"
  4412. });
  4413. this.getReportList();
  4414. this.getDepartment();
  4415. this.dialogVisible = false;
  4416. } else {
  4417. this.$message({
  4418. message: res.msg,
  4419. type: "error"
  4420. });
  4421. }
  4422. },
  4423. error => {
  4424. this.listLoading = false;
  4425. this.$message({
  4426. message: error,
  4427. type: "error"
  4428. });
  4429. }
  4430. );
  4431. })
  4432. .catch(() => {});
  4433. },
  4434. selectAll() {
  4435. if (this.isAllSelect) {
  4436. var keys = [];
  4437. this.reportNames.forEach(b=>{
  4438. keys.push(b.id);
  4439. })
  4440. this.$refs.approveTree.setCheckedKeys(keys);
  4441. } else {
  4442. this.$refs.approveTree.setCheckedKeys([]);
  4443. }
  4444. },
  4445. removeEmptyNode(list) {
  4446. for (var i=0;i<list.length;i++) {
  4447. var cnt = 0;
  4448. if (list[i].membCount == 0) {
  4449. list.splice(i, 1);
  4450. i--;
  4451. } else if (list[i].children != null) {
  4452. this.removeEmptyNode(list[i].children);
  4453. }
  4454. }
  4455. },
  4456. calculateMembCount(list) {
  4457. for (var i in list) {
  4458. var cnt = 0;
  4459. if (list[i].children != null) {
  4460. this.calculateMembCount(list[i].children);
  4461. for (var m in list[i].children) {
  4462. cnt += list[i].children[m].membCount;
  4463. }
  4464. }
  4465. if (list[i].isUser == 1) {
  4466. cnt++;
  4467. this.membCount++;
  4468. }
  4469. list[i].membCount = cnt;
  4470. }
  4471. },
  4472. stateChange() {
  4473. // console.log(this.allData,'alldate');
  4474. this.membCount = 0;
  4475. if (this.selectState == -1) {
  4476. //全部状态
  4477. this.data = this.allData;
  4478. } else {
  4479. //未填报
  4480. this.seluserText = ''
  4481. var newData = JSON.parse(JSON.stringify(this.allData));
  4482. this.filterState(this.selectState, newData);
  4483. this.data = newData;
  4484. }
  4485. this.calculateMembCount(this.data);
  4486. this.data[0].membCount = this.membCount;//总人数
  4487. },
  4488. //按状态过滤部门人员
  4489. filterState(state, list) {
  4490. for (var i =0;i<list.length; i++) {
  4491. var obj = list[i];
  4492. if (obj.isUser == 1) {
  4493. var match = false;
  4494. if (state == -2) {
  4495. if (obj.state == null) {
  4496. match = true;
  4497. }
  4498. } else {
  4499. if (obj.state == state) {
  4500. match = true;
  4501. }
  4502. }
  4503. if (!match) {
  4504. list.splice(i, 1);
  4505. i--;
  4506. } else {
  4507. }
  4508. } else {
  4509. if (obj.children != null) {
  4510. this.filterState(state, obj.children);
  4511. }
  4512. }
  4513. }
  4514. },
  4515. //a按名称过滤部门人员
  4516. async seluserforText(){
  4517. const { userNameNeedTranslate } = this.user
  4518. this.membCount = 0;
  4519. var newData = JSON.parse(JSON.stringify(this.allData));
  4520. let textList = [this.seluserText]
  4521. if(userNameNeedTranslate == 1) {
  4522. this.dataLoading = true
  4523. let res = await this.postData('/user/getEmployeeList', {
  4524. keyword: this.seluserText,
  4525. cursor: '',
  4526. departmentId: -1,
  4527. pageIndex: 1,
  4528. pageSize: 1000
  4529. })
  4530. textList = res.data.records.map(item => item.name)
  4531. this.dataLoading = false
  4532. }
  4533. // return
  4534. console.log(textList, '<=== textList')
  4535. this.seluserforTextin(this.seluserText, newData, textList)
  4536. console.log(newData, 'Data')
  4537. this.data = newData;
  4538. this.calculateMembCount(this.data);
  4539. this.data[0].membCount = this.membCount;//总人数
  4540. },
  4541. seluserforTextin(text, list, textList = []){
  4542. for (var i =0;i<list.length; i++) {
  4543. var obj = list[i];
  4544. if (obj.isUser == 1) {
  4545. var match = false;
  4546. // if (obj.label.indexOf(text) != -1) {
  4547. // match = true
  4548. // }
  4549. if(textList.some(item => item.includes(obj.label))) {
  4550. match = true
  4551. }
  4552. if (!match) {
  4553. list.splice(i, 1);
  4554. i--;
  4555. } else {
  4556. }
  4557. } else {
  4558. if (obj.children != null) {
  4559. this.seluserforTextin(text, obj.children, textList);
  4560. }
  4561. }
  4562. }
  4563. },
  4564. // 当节点发生变化时
  4565. nodeChangeExpand(data) {
  4566. // 保存当前展开的节点
  4567. let flag = false
  4568. this.nodeModelData.some(item => {
  4569. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  4570. flag = true
  4571. return true
  4572. }
  4573. })
  4574. if (!flag) { // 不存在则存到数组里
  4575. this.nodeModelData.push(data.id)
  4576. }
  4577. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4578. },
  4579. nodeChangeCollapse(data) {
  4580. console.log(this.nodeModelData)
  4581. this.nodeModelData.some((item, i) => {
  4582. if (item === data.id) {
  4583. this.nodeModelData.length = i
  4584. }
  4585. })
  4586. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4587. },
  4588. // 部门列表点击
  4589. handleNodeClick(data) {
  4590. // this.dealList = data
  4591. this.theValues(data.id, this.allData)
  4592. // this.depData = data;
  4593. var list = [];
  4594. if (data.id == -1) {
  4595. this.deptId = null;
  4596. this.targetUid = null;
  4597. list = this.data;
  4598. } else if (data.isUser == 1) {
  4599. this.deptId = null;
  4600. this.targetUid = data.id;
  4601. } else {
  4602. this.deptId = data.id;
  4603. this.targetUid = null;
  4604. list.push(data);
  4605. }
  4606. this.getReportList();
  4607. if (list.length > 0) {
  4608. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  4609. this.fillList = this.getUserMembListFromDeptList(list, 1)
  4610. }
  4611. },
  4612. exportPushLog(){
  4613. this.http.post('/sap-sync-log/export',{},
  4614. res => {
  4615. if (res.code == "ok") {
  4616. var filePath = res.data;
  4617. var fName = '推送日志.xlsx'
  4618. const a = document.createElement('a'); // 创建a标签
  4619. a.setAttribute('download', fName);// download属性
  4620. a.setAttribute('href', filePath);// href链接
  4621. a.click(); //自执行点击事件
  4622. a.remove();
  4623. } else {
  4624. this.$message({
  4625. message: res.msg,
  4626. type: "error"
  4627. });
  4628. }
  4629. },
  4630. error => {
  4631. this.$message({
  4632. message: error,
  4633. type: "error"
  4634. });
  4635. });
  4636. },
  4637. theValues(id, item) {
  4638. for(var i in item) {
  4639. if(item[i].id == id) {
  4640. this.depData = item[i]
  4641. if(id == '-1') {
  4642. this.translation = '1'
  4643. } else {
  4644. if(item[i].children) {
  4645. this.translation = '2'
  4646. } else {
  4647. this.translation = '3'
  4648. }
  4649. }
  4650. return
  4651. } else {
  4652. if(item[i].children) {
  4653. this.theValues(id, item[i].children)
  4654. }
  4655. }
  4656. }
  4657. },
  4658. //获取可以选择的代填的人员列表
  4659. getSubstitudeUserDeptList() {
  4660. if (this.deptMembData.length == 0) {
  4661. this.http.post("/department/listMyMembs", {},
  4662. res => {
  4663. if (res.code == "ok") {
  4664. let noAllData = JSON.parse(JSON.stringify(res.data));
  4665. if (noAllData.length > 0) {
  4666. // if (noAllData[0].label == '全部人员') {
  4667. if (noAllData[0].label == this.$t('lable.allStaff')) {
  4668. noAllData.splice(0,1);
  4669. }
  4670. }
  4671. this.setUserToDept(noAllData);
  4672. this.deptMembData = noAllData;
  4673. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  4674. console.log(this.deptMembData, '代填人员数据')
  4675. } else {
  4676. this.$message({
  4677. message: res.msg,
  4678. type: "error"
  4679. });
  4680. }
  4681. },
  4682. error => {
  4683. this.$message({
  4684. message: error,
  4685. type: "error"
  4686. });
  4687. });
  4688. }
  4689. },
  4690. // 获取部门列表
  4691. getDepartmentForApprove() {
  4692. this.http.post( this.port.manage.depList, {},
  4693. res => {
  4694. if (res.code == "ok") {
  4695. var list1 = JSON.parse(JSON.stringify(res.data));
  4696. this.deptOptionList = this.changeArr(list1);
  4697. console.log(this.deptOptionList, '部门')
  4698. } else {
  4699. this.$message({
  4700. message: res.msg,
  4701. type: "error"
  4702. });
  4703. }
  4704. },
  4705. error => {
  4706. this.$message({
  4707. message: error,
  4708. type: "error"
  4709. });
  4710. });
  4711. },
  4712. // 获取部门列表
  4713. getDepartment() {
  4714. //如果没有权限,就不需要获取
  4715. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  4716. return;
  4717. }
  4718. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4719. var param = {date:this.date + day};
  4720. this.http.post("/report/getMembList", param,
  4721. res => {
  4722. if (res.code == "ok") {
  4723. if(res.data.length == 0){
  4724. return
  4725. }
  4726. this.departmentList = JSON.parse(JSON.stringify(res.data))
  4727. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  4728. // let noAllData = JSON.parse(JSON.stringify(res.data));
  4729. // if (this.user.role > 0) {
  4730. // }
  4731. list.splice(0,0,{
  4732. id: -1,
  4733. label: this.$t('lable.allStaff'),
  4734. })
  4735. this.membCount = 0;
  4736. //设置员工到部门下面
  4737. this.setUserToDept(list);
  4738. this.data = list;
  4739. // console.log('data',this.data);
  4740. this.expandDate = [this.data[1].id]
  4741. this.allData = list;
  4742. // if (noAllData.length > 0) {
  4743. // if (noAllData[0].label == '全部人员') {
  4744. // noAllData.splice(0,1);
  4745. // }
  4746. // }
  4747. // this.setUserToDept(noAllData);
  4748. // this.deptMembData = noAllData;
  4749. this.option = this.changeArr(list1);
  4750. list[0].membCount = this.membCount;
  4751. if (this.depData.id == -1) {
  4752. this.depData.membCount = this.membCount;
  4753. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  4754. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  4755. } else {
  4756. if (this.depData.isUser == null) {
  4757. var dep = this.findTargetDept(this.data, this.depData.id);
  4758. var membDeptList = [];
  4759. membDeptList.push(dep);
  4760. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  4761. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  4762. }
  4763. }
  4764. if (this.depData.isUser == null) {
  4765. if (this.isFill) {
  4766. this.fillMembList = this.fillList;
  4767. } else {
  4768. this.fillMembList = this.unFillList;
  4769. }
  4770. }
  4771. this.leaveAllNum = 0
  4772. for(let i in this.unFillList){
  4773. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  4774. this.leaveAllNum += 1
  4775. }
  4776. }
  4777. this.stateChange()
  4778. } else {
  4779. this.$message({
  4780. message: res.msg,
  4781. type: "error"
  4782. });
  4783. }
  4784. },
  4785. error => {
  4786. this.$message({
  4787. message: error,
  4788. type: "error"
  4789. });
  4790. });
  4791. this.getReportFillStatus();
  4792. },
  4793. findTargetDept(list, deptId) {
  4794. var t = null;
  4795. for (var i=0;i<list.length; i++) {
  4796. if (list[i].isUser == null && list[i].id == deptId) {
  4797. t = list[i];
  4798. break;
  4799. }
  4800. }
  4801. if (t == null) {
  4802. for (var i=0;i<list.length; i++) {
  4803. if (list[i].children != null && list[i].children.length > 0) {
  4804. t = this.findTargetDept(list[i].children, deptId);
  4805. if (t != null) {
  4806. break;
  4807. }
  4808. }
  4809. }
  4810. }
  4811. return t;
  4812. },
  4813. getUserMembListFromDeptList(list, isFill) {
  4814. var membList = [];
  4815. for (var i in list) {
  4816. var deptName = list[i].label;
  4817. if (list[i].userList != null) {
  4818. list[i].userList.forEach(element => {
  4819. if (isFill == 0) {
  4820. //获取未填的
  4821. if (element.state == null) {
  4822. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  4823. membList.push(obj);
  4824. }
  4825. } else {
  4826. if (element.state != null) {
  4827. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  4828. membList.push(obj);
  4829. }
  4830. }
  4831. });
  4832. }
  4833. if (list[i].children != null) {
  4834. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  4835. }
  4836. }
  4837. return membList;
  4838. },
  4839. setUserToDept(list) {
  4840. for (var i in list) {
  4841. var cnt = 0;
  4842. if (list[i].children != null) {
  4843. this.setUserToDept(list[i].children);
  4844. for (var m in list[i].children) {
  4845. cnt += list[i].children[m].membCount;
  4846. }
  4847. }
  4848. if (list[i].userList != null) {
  4849. if (list[i].children == null) {
  4850. list[i].children = [];
  4851. }
  4852. list[i].userList.forEach(element => {
  4853. var obj = {
  4854. id: element.id,
  4855. label:element.name,
  4856. state:element.state,
  4857. parentId:element.departmentId,
  4858. isUser:1,
  4859. workingTime: element.workingTime,
  4860. leaveDays: element.leaveDays,
  4861. leaveTimes: element.leaveTimes
  4862. };
  4863. list[i].children.push(obj);
  4864. this.membCount++;
  4865. cnt++;
  4866. });
  4867. }
  4868. list[i].membCount = cnt;
  4869. }
  4870. },
  4871. // 修改数组
  4872. changeArr(arr) {
  4873. for (var i = 0; i < arr.length; i++) {
  4874. if(arr[i].id != -1 && arr[i].id != 0) {
  4875. if (arr[i].children != null && arr[i].children.length>0) {
  4876. arr[i].children = this.changeArr(arr[i].children);
  4877. }
  4878. arr[i].id && (arr[i].value = arr[i].id);
  4879. delete arr[i].id;
  4880. }
  4881. }
  4882. for(var i in arr) {
  4883. if(arr[i].id == -1 || arr[i].id == 0) {
  4884. arr.splice(i,1)
  4885. }
  4886. }
  4887. return arr;
  4888. },
  4889. //时间段范围设置改动,监听
  4890. onTimeTypeChange(timeType) {
  4891. this.seleChn(1)
  4892. this.showAddMore = true;
  4893. for(var i in this.workForm.domains) {
  4894. if (this.workForm.domains[i].timeType == 0) {
  4895. this.showAddMore = false;
  4896. break;
  4897. }
  4898. }
  4899. if (this.showAddMore) {
  4900. //检测数量
  4901. if (this.workForm.domains.length == 2) {
  4902. this.showAddMore = false;
  4903. } else {
  4904. this.showAddMore = true;
  4905. }
  4906. }
  4907. },
  4908. getTimeType() {
  4909. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  4910. res => {
  4911. if (res.code == "ok") {
  4912. var t = res.data;
  4913. this.reportTimeType = t;
  4914. if (this.reportTimeType.type > 0) {
  4915. this.showAddMore = true;
  4916. }
  4917. //转化时间格式
  4918. if (t.allday != null) {
  4919. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  4920. }
  4921. if (t.am != null) {
  4922. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  4923. }
  4924. if (t.pm != null) {
  4925. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  4926. }
  4927. let arr = []
  4928. for(var i in res.data.excludeTimeList) {
  4929. let obj = {
  4930. s: res.data.excludeTimeList[i].startTime,
  4931. e: res.data.excludeTimeList[i].endTime,
  4932. }
  4933. arr.push(obj)
  4934. }
  4935. this.vacationTime = arr
  4936. } else {
  4937. this.$message({
  4938. message: res.msg,
  4939. type: "error"
  4940. });
  4941. }
  4942. },
  4943. error => {
  4944. this.listLoading = false;
  4945. this.$message({
  4946. message: error,
  4947. type: "error"
  4948. });
  4949. });
  4950. },
  4951. // 改变月份 -------
  4952. changeMonthOut() {
  4953. this.getAllDate();
  4954. this.getReportList();
  4955. this.getDepartment();
  4956. },
  4957. // 选择日期
  4958. choseDate(i, item) {
  4959. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  4960. return
  4961. }
  4962. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  4963. this.choseDay = i;
  4964. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4965. sessionStorage.msg = this.date + day,
  4966. this.getReportList();
  4967. this.getDepartment();
  4968. this.curDate = item.date;
  4969. },
  4970. canClick(i, item){
  4971. let nowDate = new Date()
  4972. let nowDateYear = nowDate.getFullYear()
  4973. let itemYear = parseInt(this.date.split('-')[0])
  4974. let nowDateMonth = nowDate.getMonth() + 1
  4975. let itemMonth = parseInt(this.date.split('-')[1])
  4976. let nowDateDay = nowDate.getDate()
  4977. let itemDay = parseInt(item.showDate.split('.')[1])
  4978. if(nowDateYear < itemYear){
  4979. return false
  4980. }else if(nowDateYear == itemYear){
  4981. if(nowDateMonth < itemMonth){
  4982. return false
  4983. }else if(nowDateMonth == itemMonth){
  4984. if(nowDateDay < itemDay){
  4985. return false
  4986. }
  4987. }
  4988. }
  4989. },
  4990. // 获取日期列表
  4991. getAllDate(e) {
  4992. var dayArry = [];
  4993. var day = this.getCountDays();
  4994. let curMonthDay = null;
  4995. for (var k = 1; k <= day; k++) {
  4996. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  4997. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  4998. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  4999. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5000. if(sessionStorage.msg) {
  5001. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5002. this.choseDay = k - 1;
  5003. curMonthDay = str;
  5004. }
  5005. } else {
  5006. if (new Date().getDate() == k) {
  5007. this.choseDay = k - 1;
  5008. }
  5009. }
  5010. } else {
  5011. this.choseDay = 0;
  5012. }
  5013. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5014. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5015. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5016. }
  5017. this.allDate = dayArry;
  5018. //不能超过最大日期
  5019. if (this.choseDay > day-1) {
  5020. this.choseDay = day-1;
  5021. }
  5022. if(sessionStorage.from != 1){
  5023. let nowmonth = new Date().getMonth() + 1
  5024. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5025. let nowdate = new Date().getDate()
  5026. if(nowd == this.date){
  5027. if(e && sessionStorage.msg){
  5028. }else{
  5029. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5030. }
  5031. let nowday = new Date(sessionStorage.msg).getDate()
  5032. this.choseDay = nowday - 1
  5033. let monthdate = new Date(sessionStorage.msg)
  5034. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5035. }else{
  5036. if(e && sessionStorage.msg){
  5037. }else{
  5038. sessionStorage.msg = this.date + '-01'
  5039. }
  5040. let monthdate = new Date(sessionStorage.msg)
  5041. this.choseDay = monthdate.getDate() - 1
  5042. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5043. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5044. }
  5045. }else{
  5046. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5047. }
  5048. //从消息点击跳转过来的,直接加载指定日期
  5049. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5050. this.curDate = sessionStorage.msg;
  5051. sessionStorage.from = 0;
  5052. } else {
  5053. // if (curMonthDay != null) {
  5054. // // this.curDate = curMonthDay;
  5055. // let d = new Date(sessionStorage.msg)
  5056. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5057. // } else {
  5058. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5059. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5060. // }
  5061. }
  5062. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5063. // if(!sessionStorage.msg){
  5064. // let msgday = this.choseDay + 1
  5065. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5066. // }
  5067. this.getReportFillStatus();
  5068. },
  5069. getCountDays() {
  5070. var newstr = this.date.replace(/-/g, "/");
  5071. var curDate = new Date(newstr+'/01');
  5072. var curMonth = curDate.getMonth();
  5073. curDate.setMonth(curMonth + 1);
  5074. curDate.setDate(0);
  5075. return curDate.getDate();
  5076. },
  5077. reqMore() {
  5078. if (this.hasMore) {
  5079. this.pageIndex++;
  5080. this.requestHttpReports();
  5081. }
  5082. },
  5083. //加载日报数据
  5084. requestHttpReports() {
  5085. //请求数据
  5086. this.listLoading = true;
  5087. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5088. let param = {date: this.date + day};
  5089. if (this.deptId) {
  5090. param.deptId = this.deptId;
  5091. }
  5092. if (this.targetUid) {
  5093. param.userId = this.targetUid;
  5094. }
  5095. //传页码
  5096. if (this.hasMore) {
  5097. param.pageIndex = this.pageIndex;
  5098. }
  5099. this.http.post( this.port.report.list, param,
  5100. res => {
  5101. this.listLoading = false;
  5102. if (res.code == "ok") {
  5103. //扩增
  5104. this.reportList = this.reportList.concat(res.data.data);
  5105. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5106. if(document.querySelector("#day"+this.choseDay)){
  5107. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5108. }
  5109. } else {
  5110. this.$message({
  5111. message: res.msg,
  5112. type: "error"
  5113. });
  5114. }
  5115. },
  5116. error => {
  5117. this.listLoading = false;
  5118. this.$message({
  5119. message: error,
  5120. type: "error"
  5121. });
  5122. });
  5123. },
  5124. //获取日报列表
  5125. getReportList() {
  5126. //初始化,重置数据
  5127. this.pageIndex = 0;
  5128. this.hasMore = true;
  5129. this.reportList = [];
  5130. this.requestHttpReports();
  5131. },
  5132. // 处理数据
  5133. // dealWith() {
  5134. // var tianxie = 0
  5135. // var weixtianxie = 0
  5136. // if(this.selectState == -1) {
  5137. // } else {
  5138. // var arr = []
  5139. // for (var i in this.reportList) {
  5140. // arr.push(this.reportList[i].id)
  5141. // }
  5142. // this.getDealWith(this.dealList.children, tianxie, weixtianxie, arr)
  5143. // }
  5144. // },
  5145. // getDealWith(item, tx, wtx, arr) {
  5146. // for(var i in item) {
  5147. // if(item[i].children) {
  5148. // this.getDealWith(item[i].children, tx, wtx, arr)
  5149. // } else {
  5150. // if(arr.indexOf(item[i].id) != '-1') {
  5151. // tx = +tx + 1
  5152. // }
  5153. // }
  5154. // }
  5155. // },
  5156. //导出员工工时统计
  5157. exportUserTime() {
  5158. this.listLoading = true;
  5159. var param = {};
  5160. if (this.exportParam.dateRange != null) {
  5161. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5162. }
  5163. this.http.post('/department/exportDeptStatistic', param,
  5164. res => {
  5165. this.listLoading = false;
  5166. if (res.code == "ok") {
  5167. location.href = res.data;
  5168. this.exportTimeDialog = false;
  5169. } else {
  5170. this.$message({
  5171. message: res.msg,
  5172. type: "error"
  5173. });
  5174. }
  5175. },
  5176. error => {
  5177. this.listLoading = false;
  5178. this.$message({
  5179. message: error,
  5180. type: "error"
  5181. });
  5182. });
  5183. },
  5184. //导出日报
  5185. exportReport() {
  5186. this.exportingData = true;
  5187. var param = {};
  5188. if (this.exportParam.dateRange != null) {
  5189. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5190. }
  5191. if (this.exportParam.projectId != null) {
  5192. param.projectId = this.exportParam.projectId;
  5193. }
  5194. if (this.exportParam.departmentId != null) {
  5195. param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5196. }
  5197. param.stateKey = this.stateKey
  5198. // param.departmentId = this.user.departmentId
  5199. console.log(param, '《=== 导出传的参数')
  5200. return
  5201. this.http.post( this.port.report.export, param,
  5202. res => {
  5203. this.exportingData = false;
  5204. if (res.code == "ok") {
  5205. location.href = res.data;
  5206. this.exportDialog = false;
  5207. } else {
  5208. this.$message({
  5209. message: res.msg,
  5210. type: "error"
  5211. });
  5212. }
  5213. },
  5214. error => {
  5215. this.exportingData = false;
  5216. this.$message({
  5217. message: error,
  5218. type: "error"
  5219. });
  5220. });
  5221. },
  5222. //获取项目列表
  5223. getProjectList() {
  5224. this.listLoading = true;
  5225. this.http.post( this.port.project.list, {},
  5226. res => {
  5227. this.listLoading = false;
  5228. if (res.code == "ok") {
  5229. for(var i in res.data) {
  5230. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5231. res.data[i].projectCode = ''
  5232. }
  5233. }
  5234. this.projectList = res.data;
  5235. console.log("项目列表",this.projectList);
  5236. } else {
  5237. this.$message({
  5238. message: res.msg,
  5239. type: "error"
  5240. });
  5241. }
  5242. },
  5243. error => {
  5244. this.listLoading = false;
  5245. this.$message({
  5246. message: error,
  5247. type: "error"
  5248. });
  5249. });
  5250. },
  5251. // 获取填报日报的项目下拉列表
  5252. getFillProjectList() {
  5253. this.http.post( this.port.project.list, {
  5254. forReport: 1
  5255. },res => {
  5256. if (res.code == "ok") {
  5257. for(var i in res.data) {
  5258. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5259. res.data[i].projectCode = ''
  5260. }
  5261. }
  5262. this.fillProjectList = res.data;
  5263. this.getRecentlyProject()
  5264. } else {
  5265. this.$message({
  5266. message: res.msg,
  5267. type: "error"
  5268. });
  5269. }
  5270. },
  5271. error => {
  5272. this.$message({
  5273. message: error,
  5274. type: "error"
  5275. });
  5276. });
  5277. },
  5278. getBasecostItemList() {
  5279. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5280. companyId: this.user.companyId
  5281. },
  5282. res => {
  5283. if (res.code == "ok") {
  5284. this.timeBasecostList = res.data;
  5285. }
  5286. });
  5287. },
  5288. getAIReport(createDate) {
  5289. this.http.post('/report/getAIReport', {},
  5290. res => {
  5291. if (res.code == "ok") {
  5292. var quanbu = 0
  5293. this.jsDay = 1
  5294. var zhi = ''
  5295. var slp = res.data
  5296. for(var i in slp) {
  5297. var sp = +slp[i].workingTime + 0
  5298. zhi = this.jsDay * sp
  5299. quanbu = +quanbu + zhi
  5300. }
  5301. this.jsTime = quanbu
  5302. var aiReportData = res.data;
  5303. this.canCancelInDialog = false
  5304. if(aiReportData.length != 0) {
  5305. var arr = [];
  5306. for(var i in aiReportData) {
  5307. arr.push({
  5308. id: null,
  5309. projectId: aiReportData[i].projectId,
  5310. workingTime: aiReportData[i].workingTime,
  5311. content: '',
  5312. progress:100,
  5313. state: 2,
  5314. timeType: aiReportData[i].timeType,
  5315. subProjectList: aiReportData[i].subProjectList,
  5316. taskList: aiReportData[i].taskList,
  5317. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  5318. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  5319. taskId: aiReportData[i].taskId,
  5320. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5321. startTime: aiReportData[i].startTime,
  5322. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5323. endTime: aiReportData[i].endTime,
  5324. isOvertime: 0,
  5325. progress:aiReportData[i].progress,
  5326. professionProgress: aiReportData[i].professionProgressList,
  5327. stages:aiReportData[i].stages,
  5328. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  5329. pics: null,
  5330. multiWorktime: aiReportData[i].multiWorktime,
  5331. worktimeList: [{}],
  5332. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  5333. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  5334. wuduList: aiReportData[i].degreeList,
  5335. taskGroups:aiReportData[i].taskGroups,
  5336. customData: aiReportData[i].customData,//自定义的数值
  5337. auditUserList: aiReportData[i].auditUserList,
  5338. projectAuditorId: aiReportData[i].projectAuditorId,
  5339. projectAuditorName: aiReportData[i].projectAuditorName,
  5340. overtimeHours: aiReportData[i].overtimeHours,
  5341. customText: aiReportData[i].customText,
  5342. basecostId: aiReportData[i].basecostId,
  5343. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  5344. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  5345. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  5346. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  5347. canEdit: true
  5348. })
  5349. }
  5350. this.workForm.domains = arr;
  5351. } else {
  5352. }
  5353. this.canEdit = true;
  5354. this.originCanEdit = true;
  5355. this.seleChn()
  5356. } else {
  5357. this.$message({
  5358. message: res.msg,
  5359. type: "error"
  5360. });
  5361. }
  5362. },
  5363. error => {
  5364. this.$message({
  5365. message: error,
  5366. type: "error"
  5367. });
  5368. });
  5369. },
  5370. // 获取个人某天的日报 111111
  5371. getReport() {
  5372. this.http.post( this.port.report.getPort, {
  5373. date: this.workForm.createDate
  5374. },
  5375. res => {
  5376. if (res.code == "ok") {
  5377. var quanbu = 0
  5378. this.jsDay = 1
  5379. var zhi = ''
  5380. var slp = res.data.report
  5381. for(var i in slp) {
  5382. var sp = +slp[i].workingTime + 0
  5383. zhi = this.jsDay * sp
  5384. quanbu = +quanbu + zhi
  5385. }
  5386. this.jsTime = quanbu
  5387. var list = res.data;
  5388. this.report = list;
  5389. this.reportTimeType = this.report.timeType;
  5390. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  5391. this.isWeekend = !this.report.isWorkDay;
  5392. this.canCancelInDialog = false;
  5393. this.hasWrittenReport = list.report.length != 0;
  5394. if(list.report.length != 0) {
  5395. var arr = [];
  5396. this.canEdit = false;
  5397. let candelete = true
  5398. for(var i in list.report) {
  5399. var flg = null
  5400. list.report[i].isOvertime == 1 ? flg = true : flg = false
  5401. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  5402. var filteredRespList = null
  5403. if (targetP.length > 0) {
  5404. var isPublic = targetP[0].isPublic;
  5405. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  5406. }
  5407. arr.push({
  5408. id: list.report[i].id,
  5409. projectId: list.report[i].projectId,
  5410. workingTime: list.report[i].workingTime,
  5411. content: list.report[i].content,
  5412. state: list.report[i].state,
  5413. timeType: list.report[i].timeType,
  5414. subProjectList: list.report[i].subProjectList,
  5415. taskList: list.report[i].taskList,
  5416. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  5417. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  5418. taskId: list.report[i].taskId,
  5419. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5420. startTime: list.report[i].startTime,
  5421. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5422. endTime: list.report[i].endTime,
  5423. isOvertime: flg,
  5424. progress:list.report[i].progress,
  5425. professionProgress: list.report[i].professionProgressList,
  5426. stages:list.report[i].stages,
  5427. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  5428. pics: list.report[i].pics,
  5429. multiWorktime: list.report[i].multiWorktime,
  5430. worktimeList: list.report[i].worktimeList,
  5431. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  5432. multiDegrIdArray: list.report[i].multiDegrIdList,
  5433. wuduList: list.report[i].degreeList,
  5434. taskGroups:list.report[i].taskGroups,
  5435. customData: list.report[i].customData,//自定义的数值
  5436. auditUserList: list.report[i].auditUserList,
  5437. projectAuditorId: list.report[i].projectAuditorId,
  5438. projectAuditorName: list.report[i].projectAuditorName,
  5439. overtimeHours: list.report[i].overtimeHours,
  5440. customText: list.report[i].customText,
  5441. basecostId: list.report[i].basecostId,
  5442. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  5443. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  5444. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  5445. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  5446. canEdit: list.report[i].state >= 2 ? true : false,
  5447. extraField1: list.report[i].extraField1,
  5448. extraField2: list.report[i].extraField2,
  5449. extraField3: list.report[i].extraField3,
  5450. workContentList: list.report[i].workContentList,
  5451. filteredRespList: filteredRespList,
  5452. serviceList: list.report[i].serviceList,
  5453. sapServiceId: list.report[i].sapServiceId,
  5454. })
  5455. if (list.report[i].state >= 2) {
  5456. this.canEdit = true;
  5457. }
  5458. if(list.report[i].state < 2){
  5459. candelete = false
  5460. }
  5461. if (list.report[i].state == 0){
  5462. this.canCancelInDialog = true
  5463. }
  5464. // 加判断
  5465. if(this.user.timeType.choseFromAlbum == 1) {
  5466. let arrList = []
  5467. for(var k in list.report[i].pics) {
  5468. let obj = {
  5469. name: k,
  5470. url: list.report[i].pics[k]
  5471. }
  5472. arrList.push(obj)
  5473. }
  5474. arr[i].imgListUrl = arrList
  5475. arr[i].imgList = list.report[i].pics
  5476. }
  5477. }
  5478. this.reportCanDelete = candelete
  5479. this.workForm = {
  5480. createDate: this.workForm.createDate,
  5481. domains: arr,
  5482. userNames:null,
  5483. userId:null,
  5484. time: list.time
  5485. }
  5486. console.log('workForm', this.workForm)
  5487. } else {
  5488. this.workForm = {
  5489. createDate: this.workForm.createDate,
  5490. domains: [{
  5491. id: null,
  5492. projectId: "",
  5493. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5494. content: "",
  5495. progress:100,
  5496. state: 2,
  5497. timeType:0,
  5498. multiWorktime: this.reportTimeType.multiWorktime,
  5499. worktimeList:[{}],
  5500. canEdit: true,
  5501. auditorFirst: '',
  5502. auditorSec: '',
  5503. auditorThird: '',
  5504. ccUserid: ''
  5505. }],
  5506. userId:null,
  5507. userNames:null,
  5508. time: this.report.time
  5509. }
  5510. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  5511. this.$set(this.workForm.domains[0],'isOvertime',true)
  5512. if(this.reportTimeType.type != 2){
  5513. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  5514. }
  5515. }
  5516. if(this.user.timeType.type == 1) {
  5517. var shuzhi = this.user.timeType.allday + ''
  5518. // console.log('执行一次', shuzhi.indexOf('.'))
  5519. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5520. }
  5521. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5522. //默认给第一个,必填字段
  5523. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5524. }
  5525. this.canEdit = true;
  5526. }
  5527. this.originCanEdit = this.canEdit;
  5528. this.seleChn()
  5529. } else {
  5530. this.$message({
  5531. message: res.msg,
  5532. type: "error"
  5533. });
  5534. }
  5535. },
  5536. error => {
  5537. this.$message({
  5538. message: error,
  5539. type: "error"
  5540. });
  5541. });
  5542. },
  5543. guanbi() {
  5544. this.falsss = false,
  5545. this.workTimeForMinYi=0
  5546. },
  5547. // 打开日报填写
  5548. fillInReport(i, isBatch) {
  5549. this.isWeekend = false
  5550. this.reportCanDelete = false
  5551. // console.log(this.user.timeType.type, '选择时长')
  5552. if(i != 1) {
  5553. this.falsss = false
  5554. } else {
  5555. this.falsss = true
  5556. }
  5557. if (this.isSubstitude) {
  5558. this.getSubstitudeUserDeptList();
  5559. }
  5560. if(i == -1 || this.isSubstitude) {
  5561. this.isDisable = false;
  5562. } else {
  5563. this.isDisable = true;
  5564. }
  5565. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5566. this.isBatch = isBatch;
  5567. if (this.isBatch == 0 && !this.isSubstitude) {
  5568. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  5569. let weekday = new Date(this.workForm.createDate).getDay()
  5570. if(this.user.companyId == 817){
  5571. if(weekday == 0){
  5572. this.isWeekend = true
  5573. }
  5574. }else{
  5575. if(weekday == 0 || weekday == 6){
  5576. this.isWeekend = true
  5577. }
  5578. }
  5579. this.getReport(i);
  5580. } else {
  5581. // console.log('执行到了这里')
  5582. this.jsTime = 0
  5583. this.jsDay = 0
  5584. this.workForm = {
  5585. createDate: null,//批量填报没有日期
  5586. domains: [{
  5587. id: null,
  5588. projectId: "",
  5589. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5590. content: "",
  5591. progress:100,
  5592. state: 2,
  5593. timeType:0,
  5594. multiWorktime: this.reportTimeType.multiWorktime,
  5595. worktimeList:[{}],
  5596. canEdit: true,
  5597. }],
  5598. }
  5599. if(this.user.timeType.type == 1) {
  5600. var shuzhi = this.user.timeType.allday + ''
  5601. // console.log('执行二次')
  5602. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5603. }
  5604. // console.log(this.workForm)
  5605. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  5606. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5607. }
  5608. this.canEdit = true;
  5609. }
  5610. this.dialogVisible = true;
  5611. },
  5612. //按周填报的弹窗口中编辑单项目相关数据
  5613. setWeekFormReportItem(reportId, i, names, row,sss) {
  5614. console.log(sss)
  5615. this.http.post('/report/getReportById', {
  5616. reportId: reportId
  5617. },
  5618. res => {
  5619. if (res.code == "ok") {
  5620. var data = res.data.report;
  5621. sss.subProjectId = data.subProjectId
  5622. sss.subProjectList = data.subProjectList;
  5623. sss.stage = data.stage
  5624. sss.subProjectList = data.subProjectList
  5625. sss.stages = data.stages
  5626. sss.taskGroups = data.taskGroups;
  5627. sss.auditUserList = data.auditUserList;
  5628. sss.degreeId = data.degreeId;
  5629. sss.customData = data.customData;
  5630. sss.wuduList = data.degreeList;
  5631. this.zhoBaoIdx = i
  5632. this.zhoBaoName = names
  5633. this.zhoBao = sss
  5634. this.zhis = row
  5635. if (sss.groupId) {
  5636. //最后一个参数表示是否保留stage的值,不要重置为空
  5637. this.getGroupStages(this.zhoBao, 0, true)
  5638. }
  5639. this.$forceUpdate();
  5640. }
  5641. });
  5642. },
  5643. // 按周填报里内容的填写
  5644. tianxies(item, i, names, row) {
  5645. if (item.state == 0) {
  5646. this.$message({
  5647. message: '待审核状态不可修改,请返回到查看日报中先撤回',
  5648. type: "error"
  5649. });
  5650. return;
  5651. }
  5652. if (item.state == 1) {
  5653. this.$message({
  5654. message: '已通过状态不可修改',
  5655. type: "error"
  5656. });
  5657. return;
  5658. }
  5659. if(this.user.timeType.notAllowedNoAttendance == 1){
  5660. if(this.zhoData[i].corpTime){
  5661. if(this.zhoData[i].corpTime.workHours == 0){
  5662. this.$message({
  5663. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5664. type: 'error'
  5665. })
  5666. return
  5667. }
  5668. }else{
  5669. this.$message({
  5670. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5671. type: 'error'
  5672. })
  5673. return
  5674. }
  5675. }
  5676. var idd = ''
  5677. var obj = {}
  5678. for(var l in this.projectList) {
  5679. if(this.projectList[l].projectName == names) idd = this.projectList[l].id
  5680. }
  5681. obj.projectId = idd
  5682. this.tianxieDialogVisible = true
  5683. this.scopess = item
  5684. console.log(item, '《==== 当前的对象')
  5685. var sss = {}
  5686. if (item.id != null) {
  5687. sss.id = item.id;
  5688. sss.state = item.state;
  5689. } else {
  5690. sss.id = -1;
  5691. sss.state = 3;
  5692. }
  5693. sss.projectId = idd;
  5694. sss.progress = item.progress
  5695. sss.time = item.time
  5696. sss.content = item.content;
  5697. console.log('333', sss.content)
  5698. if (sss.time == '' && this.reportTimeType.type == 2) {
  5699. //取已填时间范围中最大的一个作为开始时间
  5700. var startTime = '09:00';
  5701. var fillStartTime = '00:00';
  5702. for (var t in this.selProjectList) {
  5703. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  5704. if (fillItem.time) {
  5705. if (fillItem.time[1] > fillStartTime) {
  5706. fillStartTime = fillItem.time[1];
  5707. }
  5708. }
  5709. }
  5710. if (fillStartTime == '00:00') {
  5711. fillStartTime = '09:00';
  5712. }
  5713. var fillEndMax = '18:00';
  5714. if (fillStartTime >= '18:00') {
  5715. fillEndMax = '23:59';
  5716. }
  5717. sss.time = [fillStartTime, fillEndMax];
  5718. }
  5719. sss.groupId = item.groupId
  5720. sss.stage = item.stage;
  5721. sss.workingTime = item.workingTime
  5722. sss.projectAuditorId = item.projectAuditorId;
  5723. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5724. //默认选中第一个
  5725. sss.basecostId = this.timeBasecostList[0].id;
  5726. }
  5727. var hasEdited = this.zhoData[i][names].hasEdited;
  5728. if (hasEdited) {
  5729. sss = { ...item }
  5730. //编辑过了
  5731. sss.subProjectId = item.subProjectId
  5732. sss.stage = item.stage
  5733. sss.subProjectList = item.subProjectList
  5734. sss.stages = item.stages
  5735. sss.taskGroups = item.taskGroups;
  5736. console.log(sss.taskGroups, '33333');
  5737. sss.auditUserList = obj.auditUserList;
  5738. sss.degreeId = item.degreeId;
  5739. sss.customData = item.customData;
  5740. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5741. //只有一个审核人,自动设置上去
  5742. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  5743. }
  5744. sss.wuduList = item.wuduList;
  5745. this.zhoBaoIdx = i
  5746. this.zhoBaoName = names
  5747. this.zhoBao = sss
  5748. this.zhis = row
  5749. if (sss.groupId) {
  5750. //最后一个参数表示是否保留stage的值,不要重置为空
  5751. this.getGroupStages(this.zhoBao, 0, true)
  5752. }
  5753. this.$forceUpdate();
  5754. this.getWeeklyTaskList(sss)
  5755. console.log('最后的周报 ===>', this.zhoBao)
  5756. } else {
  5757. //第一次打开,获取数据
  5758. if (sss.id == -1) {
  5759. //新填报的
  5760. this.selectProject(obj, 0);
  5761. var that = this
  5762. setTimeout(() =>{
  5763. sss.subProjectId = that.workForm.domains[0].subProjectId
  5764. sss.subProjectList = item.subProjectList;
  5765. sss.stage = that.workForm.domains[0].stage
  5766. sss.subProjectList = that.workForm.domains[0].subProjectList
  5767. sss.stages = that.workForm.domains[0].stages
  5768. sss.taskGroups = that.workForm.domains[0].taskGroups;
  5769. sss.auditUserList = obj.auditUserList;
  5770. sss.degreeId = item.degreeId;
  5771. sss.customData = item.customData;
  5772. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5773. //只有一个审核人,自动设置上去
  5774. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  5775. }
  5776. sss.wuduList = row[0].wuduList
  5777. that.zhoBaoIdx = i
  5778. that.zhoBaoName = names
  5779. that.zhoBao = sss
  5780. that.zhis = row
  5781. if (sss.groupId) {
  5782. //最后一个参数表示是否保留stage的值,不要重置为空
  5783. this.getGroupStages(that.zhoBao, 0, false)
  5784. }
  5785. that.$forceUpdate();
  5786. this.getWeeklyTaskList(sss)
  5787. },600);
  5788. } else {
  5789. //编辑填报过的;数据库已经存在的
  5790. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  5791. }
  5792. }
  5793. },
  5794. // 按周填报里内容的填写点击确定
  5795. setWeekProItemData() {
  5796. //专业版模式下,任务分组和阶段必填
  5797. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  5798. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  5799. this.$message({
  5800. message: '任务分组和阶段必填,请检查',
  5801. type: "error"
  5802. });
  5803. return;
  5804. }
  5805. }
  5806. //检查子项目是否必填
  5807. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  5808. this.$message({
  5809. message: '子项目必填,请检查',
  5810. type: "error"
  5811. });
  5812. return;
  5813. }
  5814. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  5815. this.$message({
  5816. message: this.$t('message.Pleaseselectareviewer'),
  5817. type: "error"
  5818. });
  5819. return
  5820. }
  5821. if(this.user.timeType.reportAuditType == 3){
  5822. let auditTips = ''
  5823. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  5824. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  5825. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  5826. if(auditTips){
  5827. auditTips = auditTips.substring(0,auditTips.length - 1)
  5828. this.$message({
  5829. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  5830. type: 'error'
  5831. })
  5832. return
  5833. }
  5834. }
  5835. let errtips = ''
  5836. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  5837. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  5838. errtips += this.user.timeType.customDegreeName + '、'
  5839. }
  5840. }
  5841. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  5842. errtips += this.user.timeType.customDataName + '、'
  5843. }
  5844. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  5845. errtips += this.user.timeType.customTextName + '、'
  5846. }
  5847. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  5848. errtips += this.user.companyId==781?this.$t('other.specificcontentandresults')+'、': this.$t('other.workMatters') +'、'
  5849. }
  5850. if(errtips){
  5851. errtips = errtips.substring(0,errtips.length - 1)
  5852. this.$message({
  5853. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  5854. type: 'error'
  5855. })
  5856. return
  5857. }
  5858. this.tianxieDialogVisible = false
  5859. var zhong = this.zhoData
  5860. this.zhoBao.hasEdited = true;
  5861. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  5862. this.zhoData = zhong
  5863. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  5864. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  5865. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  5866. },
  5867. // 获取本周
  5868. getCurrentWeek() {
  5869. //今天
  5870. this.targetWeekDate = new Date();
  5871. this.initWeekFormData();
  5872. // this.jiazai()
  5873. },
  5874. // 获取上周
  5875. handleGetPrevWeek() {
  5876. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  5877. this.initWeekFormData();
  5878. // this.jiazai()
  5879. },
  5880. // 获取下周
  5881. handleGetNextvWeek() {
  5882. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  5883. this.initWeekFormData()
  5884. },
  5885. // 加载动画
  5886. jiazai() {
  5887. this.weekDataLoading = true
  5888. var that = this
  5889. setTimeout(() =>{
  5890. that.weekDataLoading = false
  5891. },1000);
  5892. },
  5893. // 转时间格式
  5894. dealdate(date) {
  5895. const dt = new Date(date)
  5896. const y = dt.getFullYear()
  5897. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  5898. const d = (dt.getDate() + '').padStart(2, '0')
  5899. return `${y}-${m}-${d}`
  5900. },
  5901. // 按周填报
  5902. fillInReportss() {
  5903. window.addEventListener('scroll', this.handleScroll, true)
  5904. // this.jiazai()
  5905. this.fillWeekDialogVisi = true
  5906. this.getCurrentWeek();
  5907. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  5908. //重新获取工时预警类型的预算项
  5909. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5910. companyId: this.user.companyId
  5911. },
  5912. res => {
  5913. if (res.code == "ok") {
  5914. this.timeBasecostList = res.data;
  5915. }
  5916. });
  5917. }
  5918. },
  5919. fillInReportCustom() {
  5920. this.weekIndex++
  5921. this.weekParentData = {
  5922. isSubstitude: this.isSubstitude
  5923. }
  5924. this.fillWeekDialogVisiCustom = true
  5925. },
  5926. // 按周填报的项目筛选
  5927. selListFun(){
  5928. this.selProjectList = []
  5929. if(this.selCon.length){
  5930. for (let i = 0; i < this.selCon.length; i++) {
  5931. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  5932. }
  5933. this.selConShow = false ;
  5934. for (let i in this.zhoData) {
  5935. var obj = this.zhoData[i];
  5936. for(var j in this.selProjectList) {
  5937. var xinzhi = this.selProjectList[j].projectName
  5938. obj[xinzhi] = {}
  5939. obj[xinzhi].time = ''
  5940. obj[xinzhi].content = ''
  5941. obj[xinzhi].progress = 0
  5942. obj[xinzhi].workingTime = 0
  5943. }
  5944. }
  5945. this.initWeekFormData();
  5946. }else{
  5947. this.$message({
  5948. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  5949. type:'error'
  5950. })
  5951. }
  5952. },
  5953. setWeekCardTimeData(list) {
  5954. for(let i in list){
  5955. let datei = '';
  5956. if (this.user.timeType.showDdCardtime == 1) {
  5957. datei = list[i].workDate;
  5958. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  5959. datei = list[i].createDate;
  5960. } else if (this.user.timeType.syncFanwei == 1) {
  5961. datei = list[i].workDate;
  5962. }
  5963. for(let m in this.zhoData) {
  5964. if(datei == this.zhoData[m].zhoDataTime){
  5965. let item = {
  5966. startTime: list[i].startTime,
  5967. endTime: list[i].endTime,
  5968. workHours: list[i].workHours
  5969. }
  5970. this.$set(this.zhoData[m],'corpTime',item)
  5971. }
  5972. }
  5973. }
  5974. },
  5975. getWeeklyCardTime(){ //按周填报获取考勤信息
  5976. let dateStr = []
  5977. for(let i in this.zhoData){
  5978. dateStr.push(this.zhoData[i].zhoDataTime)
  5979. }
  5980. this.http.post('/report/getWeeklyCardTime',{
  5981. dateStr: JSON.stringify(dateStr)
  5982. },res => {
  5983. if(res.code == 'ok'){
  5984. for(let i in res.data){
  5985. let datei = '';
  5986. if (this.user.timeType.showDdCardtime == 1) {
  5987. datei = res.data[i].workDate.split('-');
  5988. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  5989. datei = res.data[i].createDate.split('-');
  5990. }
  5991. for(let m in this.zhoData){
  5992. let datem = new Date(this.zhoData[m].zhoDataTime)
  5993. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  5994. let item = {
  5995. startTime: res.data[i].startTime,
  5996. endTime: res.data[i].endTime,
  5997. workHours: res.data[i].workHours
  5998. }
  5999. this.$set(this.zhoData[m],'corpTime',item)
  6000. }
  6001. }
  6002. }
  6003. }else{
  6004. this.$message({
  6005. message: res.msg,
  6006. type: 'error'
  6007. })
  6008. }
  6009. },err => {
  6010. this.$message({
  6011. message: err,
  6012. type: 'error'
  6013. })
  6014. })
  6015. },
  6016. selListqx(){
  6017. this.fillWeekDialogVisi = false
  6018. this.selProjectList = []
  6019. this.selCon = []
  6020. },
  6021. handleScroll() {
  6022. this.changdu = this.projectList.length + 1
  6023. },
  6024. // 自动选择时间点的事件
  6025. // async zhoTimes(item, i) {
  6026. // var iss = i
  6027. // if(item.time == null) {
  6028. // return
  6029. // } else {
  6030. // const zhi = this.zhoData[iss];
  6031. // let he = 0;
  6032. // const timeArr = Object.values(zhi)
  6033. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6034. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6035. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6036. // console.log(data, 'data');
  6037. // zhi.he = `${he}h`;
  6038. // }
  6039. // },
  6040. async zhoTimes(item, index) {
  6041. const zho = this.zhoData[index];
  6042. if (!item.time) {
  6043. return;
  6044. }
  6045. const timeArr = Object.values(zho)
  6046. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6047. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6048. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6049. zho.he = `${totalHours[0]}h`;
  6050. },
  6051. // 判断两个时间段是否重叠
  6052. timeOverlap(idx, dateAr) {
  6053. let zhi = 0
  6054. for (let k in dateAr) {
  6055. if (idx !== k) {
  6056. if (((dateAr[k].s <= dateAr[idx].s && dateAr[k].e >= dateAr[idx].s) || (dateAr[k].s <= dateAr[idx].s && dateAr[k].e <= dateAr[idx].e))) {
  6057. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6058. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6059. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6060. }
  6061. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6062. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6063. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6064. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6065. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6066. } else {
  6067. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6068. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6069. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6070. }
  6071. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6072. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6073. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6074. }
  6075. }
  6076. }
  6077. }
  6078. }
  6079. return zhi
  6080. },
  6081. // 计算时间
  6082. getHourMinutes(str, end) {
  6083. var he = 0
  6084. var date2 = '2021/12/12 ' + end +':00'
  6085. var date1 = '2021/12/12 ' + str +':00'
  6086. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6087. var leave1=date3%(24*3600*1000)
  6088. var hours=Math.floor(leave1/(3600*1000))
  6089. var leave2=leave1%(3600*1000)
  6090. var minutes=Math.floor(leave2/(60*1000))
  6091. var shi = hours+'.'+ minutes
  6092. return he += +shi
  6093. },
  6094. // 自动选择事件长度的事件
  6095. zhoXuan(item, i) {
  6096. var iss = i
  6097. if(item.time == null) {
  6098. return
  6099. } else {
  6100. var zhi = this.zhoData[iss]
  6101. var he = 0
  6102. for(var i in zhi) {
  6103. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6104. he += +zhi[i].workingTime
  6105. }
  6106. }
  6107. zhi.he = he + 'h'
  6108. }
  6109. },
  6110. getPushWorkLogData(){
  6111. this.http.post('/sap-sync-log/list', {},
  6112. res => {
  6113. if (res.code == "ok") {
  6114. this.pushWorkTimeLogData = res.data;
  6115. } else {
  6116. this.$message({
  6117. message: res.msg,
  6118. type: "error"
  6119. });
  6120. }
  6121. },
  6122. error => {
  6123. this.$message({
  6124. message: error,
  6125. type: "error"
  6126. });
  6127. });
  6128. },
  6129. // 获取全部人员
  6130. getUsers() {
  6131. this.http.post('/user/getSimpleActiveUserList', {},
  6132. res => {
  6133. if (res.code == "ok") {
  6134. this.usersList = res.data;
  6135. } else {
  6136. this.$message({
  6137. message: res.msg,
  6138. type: "error"
  6139. });
  6140. }
  6141. },
  6142. error => {
  6143. this.$message({
  6144. message: error,
  6145. type: "error"
  6146. });
  6147. });
  6148. },
  6149. // 按时间比例
  6150. addBli(item, i) {
  6151. var iss = i
  6152. if(item.time == null) {
  6153. return
  6154. } else {
  6155. var zhi = this.zhoData[iss]
  6156. var he = 0
  6157. for(var i in zhi) {
  6158. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6159. he += +zhi[i].workingTime
  6160. }
  6161. }
  6162. zhi.he = he.toFixed(1) + 'h'
  6163. }
  6164. },
  6165. //按周填报选择的项目发生变化,需要设置列
  6166. onSelProjectChange() {
  6167. for (let i = 0; i < this.selCon.length; i++) {
  6168. var exists = false;
  6169. for (let j = 0; j < this.selProjectList.length; j++) {
  6170. if (this.selProjectList[j].id == this.selCon[i]) {
  6171. exists = true;
  6172. break;
  6173. }
  6174. }
  6175. if (!exists) {
  6176. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6177. this.selProjectList.push(newProject);
  6178. //添加新项目
  6179. for (var w in this.zhoData) {
  6180. var dayItem = this.zhoData[w];
  6181. var pName = newProject.projectName;
  6182. dayItem[pName] = {};
  6183. dayItem[pName].time = ''
  6184. dayItem[pName].content = ''
  6185. dayItem[pName].progress = 0
  6186. dayItem[pName].workingTime = 0
  6187. }
  6188. }
  6189. }
  6190. //去掉
  6191. for (let j = 0; j < this.selProjectList.length; j++) {
  6192. var exists = false;
  6193. for (let i = 0; i < this.selCon.length; i++) {
  6194. if (this.selProjectList[j].id == this.selCon[i]) {
  6195. exists = true;
  6196. break;
  6197. }
  6198. }
  6199. if (!exists) {
  6200. this.selProjectList.splice(j, 1);
  6201. j--;
  6202. }
  6203. }
  6204. this.loadFilledWeekReportItem();
  6205. //刷新表格
  6206. // this.$refs.weekTable.doLayout();
  6207. },
  6208. //根据选中的项目来刷新填写表格
  6209. loadFilledWeekReportItem() {
  6210. for (var w in this.zhoData) {
  6211. var dayItem = this.zhoData[w];
  6212. for (var i = 0; i < this.selProjectList.length; i++) {
  6213. var curColumnProject = this.selProjectList[i];
  6214. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6215. for (var t in dayItem.reportList) {
  6216. //有日报的项目,不能取消选择
  6217. for (var p in this.fillProjectList) {
  6218. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6219. }
  6220. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6221. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6222. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6223. if (this.reportTimeType.type == 2) {
  6224. //时间段模式
  6225. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6226. }
  6227. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6228. break;
  6229. }
  6230. }
  6231. // dayItem[curColumnProject.projectName] = matchReportItem;
  6232. }
  6233. }
  6234. this.$nextTick(()=>{
  6235. this.$refs.weekTable.doLayout();
  6236. });
  6237. },
  6238. initWeekFormData() {
  6239. this.weekDataLoading = true;
  6240. for (var p in this.fillProjectList) {
  6241. this.fillProjectList[p].canCancel = 1;
  6242. }
  6243. this.http.post('/report/getWeeklyReportData',{
  6244. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  6245. },res => {
  6246. this.weekDataLoading = false;
  6247. if(res.code == 'ok'){
  6248. let projectList = res.data.projectList;
  6249. if (projectList.length > 0) {
  6250. //有选择过项目进行填报,直接选中
  6251. this.selProjectList = projectList;
  6252. this.selCon = [];
  6253. for (let i = 0; i < projectList.length; i++) {
  6254. this.selCon.push(projectList[i].id);
  6255. }
  6256. }
  6257. //设置日期
  6258. this.weekDateRange = res.data.dateList;
  6259. this.zhoData = [];
  6260. var arrst = []
  6261. for(var i in this.weekDateRange) {
  6262. var obj = {}
  6263. obj.zhoDataTime = this.weekDateRange[i].date
  6264. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  6265. obj.he = this.weekDateRange[i].filledTime;
  6266. obj.canFill = this.weekDateRange[i].canFill;
  6267. // obj.filledTime = this.weekDateRange[i].filledTime;
  6268. obj.reportList = this.weekDateRange[i].reportList;
  6269. //初始化,防止渲染报错
  6270. for (var j = 0; j < this.selProjectList.length; j++) {
  6271. var pName = this.selProjectList[j].projectName
  6272. obj[pName] = {}
  6273. obj[pName].time = ''
  6274. obj[pName].content = ''
  6275. obj[pName].progress = 0
  6276. obj[pName].workingTime = 0
  6277. }
  6278. arrst.push(obj)
  6279. }
  6280. this.zhoData = arrst
  6281. this.setWeekCardTimeData(res.data.cardTimeList);
  6282. this.loadFilledWeekReportItem();
  6283. }else{
  6284. this.$message({
  6285. message: res.msg,
  6286. type: 'error'
  6287. })
  6288. }
  6289. },err => {
  6290. this.$message({
  6291. message: err,
  6292. type: 'error'
  6293. })
  6294. })
  6295. },
  6296. zhoZhi(res, i) {
  6297. var zhi = 0
  6298. for(var i in res) {
  6299. if(i != 'zhoDataTime' && i != 'he') {
  6300. zhi += +res[i]
  6301. }
  6302. }
  6303. res.he = zhi
  6304. },
  6305. zhoBtn(i) {
  6306. // this.zhoData.split(i, 1)
  6307. var arr = this.zhoData
  6308. arr.splice(i, 1)
  6309. },
  6310. zhoAddlast(){
  6311. this.selConShow = true
  6312. },
  6313. closeAddWeeklyReport(){
  6314. this.fillWeekDialogVisi = false
  6315. this.selConShow = true
  6316. this.selProjectList = []
  6317. this.selCon = []
  6318. },
  6319. // 提交按周填报
  6320. submitWeekReport(isDraft) {
  6321. var zhi = this.zhoData
  6322. var ll = 0
  6323. if(this.reportTimeType.type == 2) {
  6324. for(var i in zhi) {
  6325. this.dateAr = []
  6326. var alp = []
  6327. var zhis = zhi[i]
  6328. console.log(zhis)
  6329. for(var j in zhis) {
  6330. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  6331. let objs = {}
  6332. objs.s = zhis[j].time[0]
  6333. objs.e = zhis[j].time[1]
  6334. objs.p = j
  6335. alp.push(objs)
  6336. }
  6337. }
  6338. console.log(alp)
  6339. this.dateAr = alp
  6340. if (this.reportTimeType.timeCanOverlap == 0) {
  6341. let str = this.$t('message.Filledtimeperiodsoverlap')
  6342. if(this.dateAr.length > 0) {
  6343. const trus = this.fns();
  6344. const overlapDataTime = this.getOverlapData(alp);
  6345. if (overlapDataTime.length > 0) {
  6346. const arrList = overlapDataTime.map((item) => item.p);
  6347. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  6348. }
  6349. ll += 1
  6350. if(!trus) {
  6351. this.$message({
  6352. message: str,
  6353. type: 'error'
  6354. })
  6355. return false
  6356. }
  6357. }
  6358. } else {
  6359. if(this.dateAr.length > 0) {
  6360. ll +=1 ;
  6361. }
  6362. }
  6363. }
  6364. if(ll == 0) {
  6365. this.$message({
  6366. message: this.$t('message.Pleasefillinthetime'),
  6367. type: 'error'
  6368. })
  6369. return false
  6370. }
  6371. } else if(this.reportTimeType.type == 1){
  6372. for(var i in zhi) {
  6373. var zhis = zhi[i]
  6374. for(var j in zhis) {
  6375. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  6376. ll += 1
  6377. }
  6378. }
  6379. }
  6380. if(ll == 0) {
  6381. this.$message({
  6382. message: this.$t('message.Pleaseselectatime'),
  6383. type: 'error'
  6384. })
  6385. return false
  6386. }
  6387. let overcorp = ''
  6388. for(let n in zhi){
  6389. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  6390. overcorp += zhi[n].zhoDataTime + ','
  6391. }
  6392. }
  6393. if(overcorp != ''){
  6394. overcorp = overcorp.substring(0,overcorp.length - 1)
  6395. this.$message({
  6396. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  6397. type: 'error'
  6398. })
  6399. return
  6400. }
  6401. }
  6402. var submits = []
  6403. let formData = new FormData();
  6404. formData.append("draft", isDraft);
  6405. if(this.reportTimeType.multiWorktime == 1){
  6406. for (var i in this.zhoData) {
  6407. var zhoD = this.zhoData[i]
  6408. var flgs = false
  6409. for(var j in zhoD) {
  6410. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  6411. flgs = true
  6412. // formData.append("degreeId", "-1");
  6413. formData.append("id", '-1');
  6414. for(var s in this.projectList) {
  6415. if(j == this.projectList[s].projectName) {
  6416. formData.append("projectId", this.projectList[s].id);
  6417. }
  6418. }
  6419. if(this.user.timeType.reportAuditType == 3){
  6420. let audItem = {}
  6421. if(this.user.timeType.auditLevel > 0){
  6422. audItem.auditorFirst = zhoD[j].auditorFirst
  6423. }
  6424. if(this.user.timeType.auditLevel > 1){
  6425. audItem.auditorSec = zhoD[j].auditorSec
  6426. }
  6427. if(this.user.timeType.auditLevel > 2){
  6428. audItem.auditorThird = zhoD[j].auditorThird
  6429. }
  6430. if(zhoD[j].ccUserid){
  6431. audItem.ccUserid = zhoD[j].ccUserid
  6432. }
  6433. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6434. }
  6435. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6436. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6437. formData.append("reportTimeType", this.reportTimeType.type);
  6438. formData.append("endTime", '');
  6439. formData.append("startTime", '');
  6440. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6441. var lix = []
  6442. var objjs = {}
  6443. objjs.startTime = zhoD[j].time[0]
  6444. objjs.endTime = zhoD[j].time[1]
  6445. if (zhoD[j].content == null || zhoD[j].content == '') {
  6446. zhoD[j].content == '-'
  6447. }
  6448. objjs.content = zhoD[j].content
  6449. lix.push(objjs)
  6450. var zhiZhi = JSON.stringify(lix)
  6451. zhiZhi = zhiZhi.replace(/,/g,"@");
  6452. formData.append("content", zhiZhi)
  6453. formData.append("isOvertime", 0)
  6454. formData.append("professionProgress", "[]")
  6455. if (zhoD[j].groupId) {
  6456. formData.append("groupId",zhoD[j].groupId)
  6457. } else {
  6458. //解决后台groupId数组越界的问题
  6459. formData.append("groupId",0)
  6460. }
  6461. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6462. formData.append("createDate",zhoD.zhoDataTime)
  6463. if (zhoD[j].projectAuditorId) {
  6464. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6465. }
  6466. if(zhoD[j].basecostId) {
  6467. formData.append("basecostId", zhoD[j].basecostId);
  6468. } else {
  6469. formData.append("basecostId", 0);
  6470. }
  6471. if(this.user.timeType.customDegreeActive){
  6472. if (this.user.timeType.customDegreeMultiple) {
  6473. if (zhoD[j].multiDegrIdArray) {
  6474. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  6475. } else {
  6476. formData.append('multiDegrId','[]')
  6477. }
  6478. } else {
  6479. if (zhoD[j].degreeId) {
  6480. formData.append('degreeId',zhoD[j].degreeId)
  6481. } else {
  6482. formData.append('degreeId','-1')
  6483. }
  6484. }
  6485. }else{
  6486. formData.append("degreeId", "-1");
  6487. }
  6488. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6489. formData.append('customData',zhoD[j].customData)
  6490. }else if(this.user.timeType.customDataActive){
  6491. formData.append('customData',0)
  6492. }
  6493. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6494. formData.append('customText',zhoD[j].customText)
  6495. }else if(this.user.timeType.customTextActive){
  6496. formData.append('customText','-')
  6497. }
  6498. }
  6499. }
  6500. }
  6501. } else {
  6502. for (var i in this.zhoData) {
  6503. var zhoD = this.zhoData[i]
  6504. var flgs = false
  6505. if(this.reportTimeType.type == 2) {
  6506. for(var k in this.selProjectList) {
  6507. var pItem = this.selProjectList[k];
  6508. var pName = pItem.projectName;
  6509. var j = pName;
  6510. console.log('j==周报中的项目='+j);
  6511. if(zhoD[j].time && zhoD[j].time != 'null') {
  6512. flgs = true
  6513. // formData.append("degreeId", "-1");
  6514. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6515. for(var s in this.projectList) {
  6516. if(j == this.projectList[s].projectName) {
  6517. formData.append("projectId", this.projectList[s].id);
  6518. }
  6519. }
  6520. if(this.user.timeType.reportAuditType == 3){
  6521. let audItem = {}
  6522. if(this.user.timeType.auditLevel > 0){
  6523. audItem.auditorFirst = zhoD[j].auditorFirst
  6524. }
  6525. if(this.user.timeType.auditLevel > 1){
  6526. audItem.auditorSec = zhoD[j].auditorSec
  6527. }
  6528. if(this.user.timeType.auditLevel > 2){
  6529. audItem.auditorThird = zhoD[j].auditorThird
  6530. }
  6531. if(zhoD[j].ccUserid){
  6532. audItem.ccUserid = zhoD[j].ccUserid
  6533. }
  6534. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6535. }
  6536. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6537. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6538. formData.append("reportTimeType", this.reportTimeType.type);
  6539. formData.append("endTime", zhoD[j].time[1]);
  6540. formData.append("startTime", zhoD[j].time[0]);
  6541. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6542. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6543. formData.append("isOvertime", 0)
  6544. formData.append("professionProgress", "[]")
  6545. if (zhoD[j].groupId) {
  6546. formData.append("groupId",zhoD[j].groupId)
  6547. } else {
  6548. //解决后台groupId数组越界的问题
  6549. formData.append("groupId",0)
  6550. }
  6551. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6552. formData.append("createDate",zhoD.zhoDataTime)
  6553. if (zhoD[j].projectAuditorId) {
  6554. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6555. }
  6556. if(zhoD[j].basecostId) {
  6557. formData.append("basecostId", zhoD[j].basecostId);
  6558. } else {
  6559. formData.append("basecostId", 0);
  6560. }
  6561. if(this.user.timeType.customDegreeActive){
  6562. if (this.user.timeType.customDegreeMultiple) {
  6563. if (zhoD[j].multiDegrIdArray) {
  6564. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  6565. } else {
  6566. formData.append("multiDegrId", "[]");
  6567. }
  6568. } else {
  6569. if (zhoD[j].degreeId) {
  6570. formData.append('degreeId',zhoD[j].degreeId)
  6571. } else {
  6572. formData.append("degreeId", "-1");
  6573. }
  6574. }
  6575. }else{
  6576. formData.append("degreeId", "-1");
  6577. }
  6578. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6579. formData.append('customData',zhoD[j].customData)
  6580. }else if(this.user.timeType.customDataActive){
  6581. formData.append('customData',0)
  6582. }
  6583. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6584. formData.append('customText',zhoD[j].customText)
  6585. }else if(this.user.timeType.customTextActive){
  6586. formData.append('customText','-')
  6587. }
  6588. }
  6589. }
  6590. } else {
  6591. for(var k in this.selProjectList) {
  6592. var pItem = this.selProjectList[k];
  6593. var pName = pItem.projectName;
  6594. var j = pName;
  6595. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  6596. flgs = true
  6597. // formData.append("degreeId", "-1");
  6598. console.log('进入了workFpppp==='+j);
  6599. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6600. for(var s in this.projectList) {
  6601. if(j == this.projectList[s].projectName) {
  6602. formData.append("projectId", this.projectList[s].id);
  6603. }
  6604. }
  6605. if(this.user.timeType.reportAuditType == 3){
  6606. let audItem = {}
  6607. if(this.user.timeType.auditLevel > 0){
  6608. audItem.auditorFirst = zhoD[j].auditorFirst
  6609. }
  6610. if(this.user.timeType.auditLevel > 1){
  6611. audItem.auditorSec = zhoD[j].auditorSec
  6612. }
  6613. if(this.user.timeType.auditLevel > 2){
  6614. audItem.auditorThird = zhoD[j].auditorThird
  6615. }
  6616. if(zhoD[j].ccUserid){
  6617. audItem.ccUserid = zhoD[j].ccUserid
  6618. }
  6619. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6620. }
  6621. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  6622. // formData.append("subProjectId", zhoD[j].subProjectId);
  6623. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6624. formData.append("reportTimeType", this.reportTimeType.type);
  6625. if(this.reportTimeType.type == 1) {
  6626. formData.append("workingTime", zhoD[j].workingTime);
  6627. } else if(this.reportTimeType.type == 2) {
  6628. formData.append("endTime", zhoD[j].time[1]);
  6629. formData.append("startTime", zhoD[j].time[0]);
  6630. } else if(this.reportTimeType.type == 3) {
  6631. formData.append("progress", zhoD[j].progress);
  6632. formData.append("workingTime", zhoD[j].workingTime);
  6633. }
  6634. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6635. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6636. formData.append("isOvertime", 0)
  6637. formData.append("professionProgress", "[]")
  6638. if (zhoD[j].groupId) {
  6639. formData.append("groupId",zhoD[j].groupId)
  6640. } else {
  6641. //解决后台groupId数组越界的问题
  6642. formData.append("groupId",0)
  6643. }
  6644. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6645. formData.append("createDate",zhoD.zhoDataTime)
  6646. if (zhoD[j].projectAuditorId) {
  6647. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6648. }
  6649. if(zhoD[j].basecostId) {
  6650. formData.append("basecostId", zhoD[j].basecostId);
  6651. } else {
  6652. formData.append("basecostId", 0);
  6653. }
  6654. if(this.user.timeType.customDegreeActive){
  6655. if (this.user.timeType.customDegreeMultiple) {
  6656. if (zhoD[j].multiDegrIdArray) {
  6657. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  6658. } else {
  6659. formData.append("multiDegrId", "[]");
  6660. }
  6661. } else {
  6662. if (zhoD[j].degreeId) {
  6663. formData.append('degreeId',zhoD[j].degreeId)
  6664. } else {
  6665. formData.append("degreeId", "-1");
  6666. }
  6667. }
  6668. }else{
  6669. formData.append("degreeId", "-1");
  6670. }
  6671. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6672. formData.append('customData',zhoD[j].customData)
  6673. }else if(this.user.timeType.customDataActive){
  6674. formData.append('customData',0)
  6675. }
  6676. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6677. formData.append('customText',zhoD[j].customText)
  6678. }else if(this.user.timeType.customTextActive){
  6679. formData.append('customText','-')
  6680. }
  6681. }
  6682. }
  6683. }
  6684. }
  6685. }
  6686. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  6687. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  6688. if(!next) {
  6689. this.$message({
  6690. message: `【${error.join('、')}】请填写任务分组`,
  6691. type: 'error'
  6692. })
  6693. return
  6694. }
  6695. // 自定义维度
  6696. this.submitingReport = true;
  6697. this.http.uploadFile( this.port.report.editPort, formData,
  6698. res => {
  6699. // this.listLoading = false;
  6700. this.submitingReport = false;
  6701. if (res.code == "ok") {
  6702. this.$message({
  6703. message: this.$t('message.fillinsuccessfully'),
  6704. type: "success"
  6705. });
  6706. this.fillWeekDialogVisi = false
  6707. this.selConShow = true
  6708. this.zhoData = []
  6709. this.weekDateRange = ''
  6710. this.getReportList();
  6711. this.getDepartment();
  6712. // 关闭弹窗 并 清空
  6713. this.selProjectList = []
  6714. this.selCon = []
  6715. this.getRecentlyProject()
  6716. } else {
  6717. this.$message({
  6718. message: res.msg,
  6719. type: "error"
  6720. });
  6721. }
  6722. },
  6723. error => {
  6724. this.submitingReport = false;
  6725. this.$message({
  6726. message: error,
  6727. type: "error"
  6728. });
  6729. });
  6730. },
  6731. handleGroupAuditorData(data) {
  6732. const { reportAuditType } = this.user.timeType
  6733. if(reportAuditType != 1 && reportAuditType != 2) {
  6734. return {next: true}
  6735. }
  6736. let arrList = [];
  6737. Object.entries(data).forEach(([key, obj]) => {
  6738. Object.entries(obj).forEach(([projectName, projectData]) => {
  6739. if (projectData.workingTime && !projectData.groupId) {
  6740. arrList.push({
  6741. projectName,
  6742. date: obj.zhoDataTime,
  6743. dateText: obj.zhoDataTimeTxt
  6744. });
  6745. }
  6746. });
  6747. });
  6748. if(arrList.length > 0) {
  6749. return {
  6750. next: false,
  6751. error: arrList.map(item => `【${item.date} ${item.dateText} 中的 (${item.projectName})项目】`),
  6752. }
  6753. } else {
  6754. return {
  6755. next: true,
  6756. error: [],
  6757. }
  6758. }
  6759. },
  6760. ChangeHourMinutestr (str) {
  6761. if (str !== "0" && str !== "" && str !== null) {
  6762. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  6763. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  6764. } else {
  6765. return "";
  6766. }
  6767. },
  6768. // 得到两个日期中间的日期
  6769. getdiffdate(stime,etime){
  6770. //初始化日期列表,数组
  6771. var diffdate = new Array();
  6772. var i=0;
  6773. //开始日期小于等于结束日期,并循环
  6774. while(stime<=etime){
  6775. diffdate[i] = stime;
  6776. //获取开始日期时间戳
  6777. var stime_ts = new Date(stime).getTime();
  6778. //增加一天时间戳后的日期
  6779. var next_date = stime_ts + (24*60*60*1000);
  6780. //拼接年月日,这里的月份会返回(0-11),所以要+1
  6781. var next_dates_y = new Date(next_date).getFullYear()+'-';
  6782. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  6783. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  6784. stime = next_dates_y+next_dates_m+next_dates_d;
  6785. //增加数组key
  6786. i++;
  6787. }
  6788. return diffdate;
  6789. },
  6790. // 添加模块
  6791. addDomain(i) {
  6792. var leftProgress = 10;
  6793. if (this.reportTimeType.type == 3) {
  6794. //计算已经待分配工时比例
  6795. let array = this.workForm.domains;
  6796. let totalProgress = 0;
  6797. for (var i=0;i<array.length; i++) {
  6798. totalProgress += array[i].progress;
  6799. }
  6800. if (totalProgress < 100) {
  6801. leftProgress = 100 - totalProgress;
  6802. }
  6803. }
  6804. var addItem = {
  6805. projectId: "",
  6806. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  6807. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  6808. ),
  6809. content: "",
  6810. progress:leftProgress,
  6811. state:2,//2-表示待提交
  6812. multiWorktime: this.reportTimeType.multiWorktime,
  6813. worktimeList:[{}],
  6814. canEdit: true,
  6815. auditorFirst: '',
  6816. auditorSec: '',
  6817. auditorThird: '',
  6818. ccUserid: ''
  6819. // degreeId: '',
  6820. };
  6821. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  6822. this.$set(addItem,'isOvertime',true)
  6823. if(this.reportTimeType.type == 3){
  6824. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  6825. }
  6826. }
  6827. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6828. //默认给第一个,必填字段
  6829. addItem.basecostId = this.timeBasecostList[0].id;
  6830. }
  6831. this.workForm.domains.push(addItem);
  6832. document.getElementById('workFormsItemBottom').scrollIntoView()
  6833. this.canEdit = true
  6834. if (this.reportTimeType.type == 0) {
  6835. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  6836. var length = this.workForm.domains.length;
  6837. if (length == 2) {
  6838. this.showAddMore = false;
  6839. }
  6840. }
  6841. this.chuji()
  6842. this.seleChn()
  6843. },
  6844. // 移除模块
  6845. delDomain(i) {
  6846. this.workForm.domains.splice(i,1)
  6847. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  6848. if (!this.originCanEdit) {
  6849. let iscan = false
  6850. for(let i in this.workForm.domains){
  6851. if(this.workForm.domains[i].canEdit){
  6852. iscan = true
  6853. }
  6854. }
  6855. this.canEdit = iscan
  6856. }
  6857. //检测当前剩下的一个,时间类型是否是全天
  6858. if (this.reportTimeType.type == 0) {
  6859. if (this.workForm.domains[0].timeType == 0) {
  6860. this.showAddMore = false;
  6861. } else {
  6862. this.showAddMore = true;
  6863. }
  6864. }
  6865. if(this.user.timeType.multiWorktime == 1) {
  6866. this.iptChangs()
  6867. } else {
  6868. this.seleChn(0)
  6869. }
  6870. },
  6871. // 改变月份
  6872. changeMonth() {
  6873. this.isWeekend = false
  6874. let date = new Date()
  6875. let nowmon = date.getMonth() + 1
  6876. let nowday = date.getDate()
  6877. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  6878. if (this.isBatch == 0) {
  6879. if(this.user.timeType.fillAhead == 0){
  6880. let date_a = new Date(this.workForm.createDate)
  6881. if(date_a.getTime() > date.getTime()){
  6882. this.workForm.createDate = nowdate
  6883. }
  6884. }
  6885. //只有按天填报才能获取当天的日报
  6886. if(!this.isSubstitude){
  6887. let weekday = new Date(this.workForm.createDate).getDay()
  6888. if(this.user.companyId == 817){
  6889. if(weekday == 0){
  6890. this.isWeekend = true
  6891. }
  6892. }else{
  6893. if(weekday == 0 || weekday == 6){
  6894. this.isWeekend = true
  6895. }
  6896. }
  6897. this.getReport()
  6898. }
  6899. }else {
  6900. if(this.user.timeType.fillAhead == 0){
  6901. let date_a = new Date(this.workForm.createDate[1])
  6902. if(date_a.getTime() > date.getTime()){
  6903. this.workForm.createDate[1] = nowdate
  6904. let sdate = new Date(this.workForm.createDate[0])
  6905. let edate = new Date(this.workForm.createDate[1])
  6906. if(sdate > edate){
  6907. this.workForm.createDate[0] = this.workForm.createDate[1]
  6908. }
  6909. }
  6910. }
  6911. }
  6912. },
  6913. // 判断时间段
  6914. fns() {
  6915. for (let k in this.dateAr) {
  6916. if (!this.judege(k)) {
  6917. return false
  6918. }
  6919. }
  6920. return true
  6921. },
  6922. judege(idx){
  6923. for (let k in this.dateAr) {
  6924. if (idx !== k) {
  6925. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  6926. return false
  6927. }
  6928. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  6929. return false
  6930. }
  6931. }
  6932. }
  6933. return true
  6934. },
  6935. getOverlapData(data) {
  6936. let overlapData = [];
  6937. for (let i = 0; i < data.length; i++) {
  6938. for (let j = i + 1; j < data.length; j++) {
  6939. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  6940. overlapData.push(data[i], data[j]);
  6941. }
  6942. }
  6943. }
  6944. return overlapData;
  6945. },
  6946. // 保存日报111111
  6947. submitReport(isDraft) {
  6948. this.isDraft = isDraft;
  6949. this.$refs.workForm.validate(valid => {
  6950. if (valid) {
  6951. if(this.totalReportHours < this.user.timeType.allday){
  6952. this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
  6953. confirmButtonText: '确定',
  6954. cancelButtonText: '取消',
  6955. type: 'warning'
  6956. }).then(() => {
  6957. this.submitReportSon()
  6958. }).catch(() => {
  6959. });
  6960. }else{
  6961. this.submitReportSon()
  6962. }
  6963. }
  6964. });
  6965. },
  6966. submitReportSon() {
  6967. this.dateAr = []
  6968. //检查重叠
  6969. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  6970. let alp = []
  6971. if(this.user.timeType.multiWorktime != 1) {
  6972. for(var p in this.workForm.domains) {
  6973. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  6974. let objs = {}
  6975. objs.s = this.workForm.domains[p].startTime
  6976. objs.e = this.workForm.domains[p].endTime
  6977. alp.push(objs)
  6978. }
  6979. }
  6980. this.dateAr = alp
  6981. if(this.dateAr.length > 0) {
  6982. let trus = this.fns()
  6983. if(!trus) {
  6984. this.$message({
  6985. message: this.$t('message.Filledtimeperiodsoverlap'),
  6986. type: "error"
  6987. });
  6988. return
  6989. }
  6990. }
  6991. } else {
  6992. for(var p in this.workForm.domains) {
  6993. var slll = this.workForm.domains[p]
  6994. for(var o in slll.worktimeList) {
  6995. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  6996. let objs = {}
  6997. objs.s = slll.worktimeList[o].startTime
  6998. objs.e = slll.worktimeList[o].endTime
  6999. alp.push(objs)
  7000. }
  7001. }
  7002. }
  7003. this.dateAr = alp
  7004. if(this.dateAr.length > 0) {
  7005. let trus = this.fns()
  7006. if(!trus) {
  7007. this.$message({
  7008. message: this.$t('message.Filledtimeperiodsoverlap'),
  7009. type: "error"
  7010. });
  7011. return
  7012. }
  7013. }
  7014. }
  7015. }
  7016. //检查子项目
  7017. if (this.user.timeType.subProMustFill == 1) {
  7018. for(var p in this.workForm.domains) {
  7019. var oneProItem = this.workForm.domains[p]
  7020. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  7021. //没有选择子项目
  7022. this.$message({
  7023. message: '子项目必填,请检查',
  7024. type: "error"
  7025. });
  7026. return
  7027. }
  7028. }
  7029. }
  7030. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  7031. if (this.user.companyId == this.yuzhongCompId) {
  7032. for(var p in this.workForm.domains) {
  7033. var oneProItem = this.workForm.domains[p]
  7034. if (!oneProItem.extraField1) {
  7035. this.$message({
  7036. message: '角色必填,请检查',
  7037. type: "error"
  7038. });
  7039. return
  7040. }
  7041. if (!oneProItem.extraField2) {
  7042. this.$message({
  7043. message: '工作职责必填,请检查',
  7044. type: "error"
  7045. });
  7046. return
  7047. }
  7048. if (!oneProItem.extraField3) {
  7049. this.$message({
  7050. message: '工作内容必填,请检查',
  7051. type: "error"
  7052. });
  7053. return
  7054. }
  7055. }
  7056. }
  7057. // return
  7058. //代填的情况,检查人员是否已经选择
  7059. if (this.isSubstitude) {
  7060. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  7061. this.$message({
  7062. message: this.$t('message.pleaseselectthepersontofillin'),
  7063. type: "error"
  7064. });
  7065. return;
  7066. }
  7067. }
  7068. //检查时间,全天和上下午不能同时存在
  7069. if (this.reportTimeType.type == 0) {
  7070. var alldayNum = 0;
  7071. var amNum = 0;
  7072. var pmNum = 0;
  7073. for(var i in this.workForm.domains) {
  7074. if (this.workForm.domains[i].timeType == 0) {
  7075. alldayNum ++;
  7076. } else if (this.workForm.domains[i].timeType == 1) {
  7077. amNum++;
  7078. } else if (this.workForm.domains[i].timeType == 2) {
  7079. pmNum++;
  7080. }
  7081. }
  7082. if (alldayNum > 1) {
  7083. this.$message({
  7084. // message: "工作时间-全天,只能选择一次",
  7085. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  7086. type: "error"
  7087. });
  7088. return;
  7089. }
  7090. if (amNum > 1) {
  7091. this.$message({
  7092. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  7093. type: "error"
  7094. });
  7095. return;
  7096. }
  7097. if (pmNum > 1) {
  7098. this.$message({
  7099. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  7100. type: "error"
  7101. });
  7102. return;
  7103. }
  7104. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  7105. this.$message({
  7106. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  7107. type: "error"
  7108. });
  7109. return;
  7110. }
  7111. } else if (this.reportTimeType.type == 3) {
  7112. //总百分比不能超过100%
  7113. let total = 0;
  7114. this.workForm.domains.forEach(w=>{total += w.progress});
  7115. if (total > 100) {
  7116. this.$message({
  7117. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  7118. type: "error"
  7119. });
  7120. return;
  7121. } else if (total < 100) {
  7122. this.$message({
  7123. message: this.$t('message.cannotbesubmitted'),
  7124. type: "error"
  7125. });
  7126. return;
  7127. }
  7128. }
  7129. this.listLoading = true;
  7130. let formData = new FormData();
  7131. formData.append("draft", this.isDraft);
  7132. var totalTime = 0;
  7133. for (var t=0;t<this.workForm.domains.length; t++) {
  7134. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7135. }
  7136. //批量填报不校验考勤时长,交给后台校验
  7137. if (!this.isBatch) {
  7138. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  7139. if (this.workForm.time){
  7140. if (this.workForm.time.workHours == 0){
  7141. this.$message({
  7142. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7143. type: 'error'
  7144. })
  7145. return
  7146. }
  7147. }else{
  7148. this.$message({
  7149. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7150. type: 'error'
  7151. })
  7152. return
  7153. }
  7154. }
  7155. }
  7156. if (this.reportTimeType.type == 1 && this.workForm.time) {
  7157. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  7158. this.$message({
  7159. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  7160. type: "error"
  7161. });
  7162. return;
  7163. }
  7164. }
  7165. for(var i in this.workForm.domains) {
  7166. // 检查任务/里程碑是否为必填
  7167. let taskRequired = this.user.timeType.taskRequired
  7168. if(taskRequired == 1) {
  7169. if(!this.workForm.domains[i].taskId) {
  7170. this.$message({
  7171. message: `【${this.workForm.domains[i].projectName}】请选择 任务/里程碑`,
  7172. type: "error"
  7173. });
  7174. return
  7175. }
  7176. }
  7177. if(this.user.timeType.reportAuditType == 3){
  7178. let audItem = {}
  7179. let auditRule = ''
  7180. if(this.workForm.domains[i].id){
  7181. audItem.reportId = this.workForm.domains[i].id
  7182. }
  7183. if(this.user.timeType.auditLevel > 0){
  7184. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  7185. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  7186. }
  7187. if(this.user.timeType.auditLevel > 1){
  7188. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  7189. audItem.auditorSec = this.workForm.domains[i].auditorSec
  7190. }
  7191. if(this.user.timeType.auditLevel > 2){
  7192. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  7193. audItem.auditorThird = this.workForm.domains[i].auditorThird
  7194. }
  7195. if(this.workForm.domains[i].ccUserid){
  7196. audItem.ccUserid = this.workForm.domains[i].ccUserid
  7197. }
  7198. if(auditRule){
  7199. auditRule = auditRule.substring(0,auditRule.length - 1)
  7200. this.$message({
  7201. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  7202. type: 'error'
  7203. })
  7204. return
  7205. }
  7206. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7207. }
  7208. if (this.user.timeType.customDegreeActive) {
  7209. if (this.user.timeType.customDegreeMultiple) {
  7210. //多选
  7211. if (this.workForm.domains[i].multiDegrIdArray) {
  7212. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  7213. degreeArray = degreeArray.replace(/,/g,"@");
  7214. formData.append("multiDegrId", degreeArray);
  7215. } else {
  7216. formData.append("multiDegrId", '[]');
  7217. }
  7218. } else {
  7219. //单选
  7220. if (this.workForm.domains[i].degreeId) {
  7221. formData.append("degreeId", this.workForm.domains[i].degreeId);
  7222. } else {
  7223. formData.append("degreeId", -1);
  7224. }
  7225. }
  7226. } else {
  7227. formData.append("degreeId", -1);
  7228. }
  7229. if(this.workForm.domains[i].customData) {
  7230. // var sss = this.workForm.domains[i].degreeId.toString()
  7231. formData.append("customData", this.workForm.domains[i].customData);
  7232. } else {
  7233. formData.append("customData", 0);
  7234. }
  7235. if(this.workForm.domains[i].customText) {
  7236. formData.append("customText", this.workForm.domains[i].customText);
  7237. } else {
  7238. formData.append("customText", '-');
  7239. }
  7240. if (this.workForm.domains[i].id) {
  7241. formData.append("id", this.workForm.domains[i].id);
  7242. } else {
  7243. formData.append("id", -1);
  7244. }
  7245. formData.append("projectId", this.workForm.domains[i].projectId);
  7246. if (this.workForm.domains[i].subProjectId) {
  7247. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  7248. } else {
  7249. formData.append("subProjectId", 0);
  7250. }
  7251. if (this.workForm.domains[i].groupId) {
  7252. formData.append("groupId", this.workForm.domains[i].groupId);
  7253. } else {
  7254. formData.append("groupId", 0);
  7255. }
  7256. if (this.workForm.domains[i].taskId) {
  7257. formData.append("taskId", this.workForm.domains[i].taskId);
  7258. } else {
  7259. formData.append("taskId", 0);
  7260. }
  7261. if (this.workForm.domains[i].taskFinish == true) {
  7262. formData.append("taskFinish", 1);
  7263. } else {
  7264. formData.append("taskFinish", 0);
  7265. }
  7266. formData.append("reportTimeType", this.reportTimeType.type);
  7267. if (this.reportTimeType.type == 0) {
  7268. formData.append("timeType", this.workForm.domains[i].timeType);
  7269. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  7270. formData.append("workingTime", workingTime);
  7271. } else if (this.reportTimeType.type == 1){
  7272. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7273. } else if (this.reportTimeType.type == 2) {
  7274. formData.append("endTime", this.workForm.domains[i].endTime);
  7275. formData.append("startTime", this.workForm.domains[i].startTime);
  7276. } else if (this.reportTimeType.type == 3) {
  7277. //按比例分配
  7278. formData.append("progress", this.workForm.domains[i].progress);
  7279. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7280. }
  7281. if(this.user.timeType.choseFromAlbum == 1 ) {
  7282. console.log(this.workForm.domains[i].imgList)
  7283. if(this.workForm.domains[i].imgList) {
  7284. let imgListFor = this.workForm.domains[i].imgList
  7285. for(var b in imgListFor) {
  7286. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  7287. }
  7288. console.log(imgListFor)
  7289. let m = JSON.stringify(imgListFor);
  7290. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7291. formData.append("picStr", m);
  7292. } else {
  7293. formData.append("picStr", '[]');
  7294. }
  7295. }
  7296. //处理多个时间事项
  7297. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  7298. if (this.reportTimeType.multiWorktime == 1) {
  7299. //检查时间是否有重叠
  7300. var workList = this.workForm.domains[i].worktimeList;
  7301. for (var j=0;j<workList.length; j++) {
  7302. var curItem = workList[j];
  7303. //检查开始时间是否大于结束时间
  7304. if (curItem.startTime >= curItem.endTime) {
  7305. this.$message({
  7306. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  7307. this.$t('message.Endtimemustbegreaterthanstarttime'),
  7308. type: "error"
  7309. });
  7310. return;
  7311. }
  7312. //时间不可重叠
  7313. if (this.reportTimeType.timeCanOverlap == 0) {
  7314. for (var p = j+1;p<workList.length; p++) {
  7315. var jItem = workList[p];
  7316. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  7317. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  7318. this.$message({
  7319. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  7320. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  7321. type: "error"
  7322. });
  7323. return;
  7324. }
  7325. }
  7326. }
  7327. }
  7328. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  7329. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7330. formData.append("content", m);
  7331. } else {
  7332. if (this.workForm.domains[i].content) {
  7333. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  7334. m = m.replace(/,/g,",");
  7335. console.log(m, '需要传值的数据')
  7336. // formData.append("content", this.workForm.domains[i].content);
  7337. formData.append("content", m);
  7338. } else {
  7339. formData.append("content", '-');
  7340. }
  7341. }
  7342. if (this.isBatch == 0) {
  7343. formData.append("createDate", this.workForm.createDate);
  7344. } else {
  7345. //批量填报,时间范围
  7346. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  7347. }
  7348. if(this.workForm.domains[i].isOvertime) {
  7349. formData.append("isOvertime", 1);
  7350. } else {
  7351. formData.append("isOvertime", 0);
  7352. }
  7353. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  7354. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  7355. } else {
  7356. formData.append("overtimeHours", 0);
  7357. }
  7358. if(this.workForm.domains[i].basecostId) {
  7359. formData.append("basecostId", this.workForm.domains[i].basecostId);
  7360. } else {
  7361. formData.append("basecostId", 0);
  7362. }
  7363. if (this.workForm.userId != null) {
  7364. var targetUids = '';
  7365. this.workForm.userId.forEach(u=>{
  7366. targetUids += u + '@';
  7367. });
  7368. if (targetUids.length > 0) {
  7369. targetUids = targetUids.substring(0, targetUids.length -1);
  7370. formData.append("targetUids", targetUids);
  7371. }
  7372. }
  7373. //项目专业进度
  7374. if (this.workForm.domains[i].professionProgress) {
  7375. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  7376. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7377. formData.append("professionProgress", m);
  7378. } else {
  7379. formData.append("professionProgress", "[]");
  7380. }
  7381. if (this.workForm.domains[i].stage) {
  7382. formData.append("stage", this.workForm.domains[i].stage);
  7383. } else {
  7384. formData.append("stage", "-");
  7385. }
  7386. // console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
  7387. if (this.workForm.domains[i].projectAuditorId) {
  7388. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  7389. } else {
  7390. // console.log('执行到了这里')
  7391. // console.log(this.user.timeType.reportAuditType)
  7392. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  7393. this.$message({
  7394. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  7395. type: "error"
  7396. });
  7397. return;
  7398. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
  7399. //分组负责人先审核, 确定是选择了任务分组
  7400. if (this.workForm.domains[i].taskGroups.length == 0) {
  7401. this.$message({
  7402. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  7403. type: "error"
  7404. });
  7405. } else if (!this.workForm.domains[i].groupId) {
  7406. // console.log(this.workForm.domains[i]);
  7407. this.$message({
  7408. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  7409. type: "error"
  7410. });
  7411. } else {
  7412. this.$message({
  7413. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  7414. type: "error"
  7415. });
  7416. }
  7417. return;
  7418. }
  7419. }
  7420. if (this.user.companyId == this.yuzhongCompId) {
  7421. formData.append('extraField1', this.workForm.domains[i].extraField1);
  7422. formData.append('extraField2', this.workForm.domains[i].extraField2);
  7423. formData.append('extraField3', this.workForm.domains[i].extraField3);
  7424. }
  7425. //依斯贝的服务Id
  7426. if (this.user.companyId == this.yisibeiCompId) {
  7427. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  7428. }
  7429. }
  7430. this.submitingReport = true;
  7431. this.http.uploadFile( this.port.report.editPort, formData,
  7432. res => {
  7433. this.listLoading = false;
  7434. this.submitingReport = false;
  7435. if (res.code == "ok") {
  7436. if(res.msg!=null){
  7437. this.$message({
  7438. dangerouslyUseHTMLString: true,
  7439. message: res.msg,
  7440. type: "warning",
  7441. showClose: true,
  7442. duration: 0
  7443. });
  7444. }else{
  7445. this.$message({
  7446. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  7447. type: "success"
  7448. });
  7449. }
  7450. this.dialogVisible = false;
  7451. this.jsDay = 0
  7452. this.jsTime = 0
  7453. this.getReportList();
  7454. this.getDepartment();
  7455. this.getRecentlyProject()
  7456. } else {
  7457. this.$message({
  7458. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  7459. type: "error"
  7460. });
  7461. }
  7462. },
  7463. error => {
  7464. this.listLoading = false;
  7465. this.submitingReport = false;
  7466. this.$message({
  7467. message: error,
  7468. type: "error"
  7469. });
  7470. });
  7471. },
  7472. // 判断是展示那个工时导入
  7473. imports() {
  7474. if(this.user.timeType.syncCorpwxTime == 0) {
  7475. this.importDialog = true
  7476. } else {
  7477. this.importWxDialog = true
  7478. }
  7479. },
  7480. // 跳转
  7481. junpToDeskTop(id) {
  7482. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7483. this.$router.push("/desktop/" + id + "/" + this.date +day);
  7484. },
  7485. // 通过日报
  7486. approve(id, item) {
  7487. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7488. this.approveinData = {
  7489. id: id,
  7490. date: this.date +day,
  7491. reportIds: item.id
  7492. }
  7493. if(this.user.timeType.needEvaluate == 1){
  7494. this.$set(this.approveinData,'evaluate','')
  7495. this.approveinDialog = true
  7496. }else{
  7497. this.logining = true;
  7498. this.approveinfun()
  7499. }
  7500. },
  7501. approveinfun(){
  7502. this.http.post( this.port.report.approve, this.approveinData,
  7503. res => {
  7504. this.logining = false;
  7505. if (res.code == "ok") {
  7506. this.approveinDialog = false
  7507. this.$message({
  7508. message: this.$t('message.Reviewsucceeded'),
  7509. type: "success"
  7510. });
  7511. this.getReportList();
  7512. this.getDepartment();
  7513. } else {
  7514. this.$message({
  7515. message: res.msg,
  7516. type: "error"
  7517. });
  7518. }
  7519. },
  7520. error => {
  7521. this.logining = false;
  7522. this.$message({
  7523. message: error,
  7524. type: "error"
  7525. });
  7526. });
  7527. },
  7528. //撤回日报
  7529. cancel(item,e) {
  7530. // console.log('can can need',item);
  7531. this.logining = true;
  7532. var ids = '';
  7533. var data = e ? item : item.data;
  7534. data.forEach(element => {
  7535. if(element.id){
  7536. ids +=(element.id+',');
  7537. }
  7538. });
  7539. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  7540. res => {
  7541. this.logining = false;
  7542. if (res.code == "ok") {
  7543. this.$message({
  7544. message:this.$t('message.Withdrawalsucceeded'),
  7545. type: "success"
  7546. });
  7547. this.getReportList();
  7548. if(e){this.getReport()}
  7549. this.getDepartment();
  7550. } else {
  7551. this.$message({
  7552. message: res.msg,
  7553. type: "error"
  7554. });
  7555. }
  7556. },
  7557. error => {
  7558. this.logining = false;
  7559. this.$message({
  7560. message: error,
  7561. type: "error"
  7562. });
  7563. });
  7564. },
  7565. showDenyDialog(id,i, item) {
  7566. this.denyReasonDialog = true;
  7567. this.isDenying = false;
  7568. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7569. var ids = item.id;
  7570. // var data = item.data;
  7571. // data.forEach(element => {
  7572. // ids +=(element.id+',');
  7573. // });
  7574. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  7575. },
  7576. // 未通过日报
  7577. deny() {
  7578. this.logining = true;
  7579. this.isDenying = true;
  7580. this.http.post( this.port.report.deny, this.denyForm,
  7581. res => {
  7582. this.logining = false;
  7583. this.isDenying = false;
  7584. if (res.code == "ok") {
  7585. this.$message({
  7586. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  7587. type: "success"
  7588. });
  7589. this.getReportList();
  7590. this.getDepartment();
  7591. this.denyReasonDialog = false;
  7592. } else {
  7593. this.$message({
  7594. message: res.msg,
  7595. type: "error"
  7596. });
  7597. }
  7598. },
  7599. error => {
  7600. this.logining = false;
  7601. this.$message({
  7602. message: error,
  7603. type: "error"
  7604. });
  7605. });
  7606. },
  7607. // 查看工时记录弹窗
  7608. toView() {
  7609. this.toViewDialogVisible = true
  7610. this.toViewloading = true
  7611. this.getToView()
  7612. },
  7613. getToView() {
  7614. this.http.post( '/report-import-log/getList', this.toViewForm,
  7615. res => {
  7616. this.toViewloading = false;
  7617. if (res.code == "ok") {
  7618. // console.log(res.data, '数据数据')
  7619. this.toViewList = res.data.records
  7620. this.toViewForm.total = res.data.total
  7621. } else {
  7622. this.toViewloading = false;
  7623. this.$message({
  7624. message: res.msg,
  7625. type: "error"
  7626. });
  7627. }
  7628. })
  7629. },
  7630. // 触发 selectCat 组件更改他的值
  7631. selectCatCli(obj) {
  7632. // console.log(obj, '看看')
  7633. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  7634. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  7635. },
  7636. vueCasader(obj) {
  7637. console.log(obj, '看看值')
  7638. if(obj.distinction == 1 && obj.item) {
  7639. let arr = []
  7640. arr.push(obj.item.value)
  7641. this.exportParam.departmentId = arr
  7642. }
  7643. },
  7644. //分页
  7645. handleCurrentChange(val) {
  7646. this.toViewForm.pageIndex = val;
  7647. this.getToView();
  7648. },
  7649. handleSizeChange(val) {
  7650. this.toViewForm.pageSize = val;
  7651. this.getToView();
  7652. },
  7653. getAllUsersList(){
  7654. this.http.post('/user/getSimpleActiveUserList',{
  7655. },res => {
  7656. if(res.code == 'ok'){
  7657. this.allUsersList = res.data
  7658. }else{
  7659. this.$message({
  7660. message: res.msg,
  7661. type: 'error'
  7662. })
  7663. }
  7664. },err => {
  7665. this.$message({
  7666. message: err,
  7667. type: 'error'
  7668. })
  7669. })
  7670. },
  7671. // 重庆物奇私人定制的按周填报弹窗关闭事件
  7672. fillWeekCustomClne() {
  7673. this.fillWeekDialogVisiCustom = false
  7674. },
  7675. fillWeekCustomSubmit() {
  7676. this.getReportList();
  7677. this.getDepartment();
  7678. this.getRecentlyProject()
  7679. },
  7680. // 待填日报姓名搜索
  7681. nameAearchSeek(flg) {
  7682. if(!this.nameAearch) {
  7683. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  7684. return
  7685. }
  7686. if(flg) {
  7687. this.enterpriseWechatgetUser()
  7688. }
  7689. },
  7690. handleThreeData(userList) {
  7691. console.log(userList, '人员数据')
  7692. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  7693. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  7694. },
  7695. // 过滤树节点
  7696. filterTreeNodes(treeData, filterKeywords) {
  7697. return treeData.filter((node) => {
  7698. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  7699. if (node.children && node.children.length > 0) {
  7700. node.children = this.filterTreeNodes(node.children, filterKeywords);
  7701. }
  7702. return true;
  7703. }
  7704. if (node.children && node.children.length > 0) {
  7705. node.children = this.filterTreeNodes(node.children, filterKeywords);
  7706. return node.children.length > 0;
  7707. }
  7708. return false;
  7709. });
  7710. },
  7711. // 企业微信获取人员
  7712. enterpriseWechatgetUser() {
  7713. this.deptMembDataLoading = true
  7714. this.http.post('/user/getEmployeeList',{
  7715. departmentId: -1,
  7716. pageIndex: 1,
  7717. pageSize: 100,
  7718. keyword: this.nameAearch,
  7719. status: '',
  7720. roleId: '',
  7721. cursor: '',
  7722. onlyDirect: '',
  7723. matchingType: ''
  7724. },res => {
  7725. if(res.code == 'ok'){
  7726. this.deptMembDataLoading = false
  7727. const userListName = res.data.records.map(item => item.name)
  7728. this.handleThreeData(userListName)
  7729. }else{
  7730. this.deptMembDataLoading = false
  7731. this.$message({
  7732. message: res.msg,
  7733. type: 'error'
  7734. })
  7735. }
  7736. },err => {
  7737. this.deptMembDataLoading = false
  7738. this.$message({
  7739. message: err,
  7740. type: 'error'
  7741. })
  7742. })
  7743. },
  7744. // 按周填报获取相关任务
  7745. async getWeeklyTaskList(item) {
  7746. console.log(item, '<=== 数据')
  7747. const { projectId, groupId, stage, taskId } = item
  7748. console.log(projectId, groupId, stage)
  7749. let parms = { projectId, isSubstitude: 0 }
  7750. groupId ? parms.groupId = groupId : ''
  7751. stage ? parms.stage = stage : ''
  7752. const { data } = await this.postData('/task/getRecentTask', parms)
  7753. this.zhoBao.taskId = taskId
  7754. this.$set(this.zhoBao, 'taskList', data)
  7755. console.log(this.zhoBao)
  7756. },
  7757. // 封装 post 请求
  7758. postData(url, params) {
  7759. return new Promise((resolve, reject) => {
  7760. this.http.post(url, { ...params },
  7761. res => {
  7762. resolve(res)
  7763. },
  7764. error => {
  7765. this.$message({
  7766. message: error,
  7767. type: "error"
  7768. });
  7769. reject(error)
  7770. })
  7771. })
  7772. },
  7773. // 自定义事件
  7774. selectCal(obj) {
  7775. console.log(obj, '传数据来源')
  7776. if(obj.distinction == '1') {
  7777. this.zhoBao.projectAuditorId = obj.id
  7778. } else if(obj.distinction == '2') {
  7779. this.zhoBao.auditorFirst = obj.id
  7780. } else if(obj.distinction == '3') {
  7781. this.zhoBao.auditorSec = obj.id
  7782. } else if(obj.distinction == '4') {
  7783. this.zhoBao.auditorThird = obj.id
  7784. } else if(obj.distinction == '5') {
  7785. this.zhoBao.ccUserid = obj.id
  7786. } else if(obj.distinction == '12') {
  7787. this.usersListId = obj.id
  7788. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  7789. this.searchKeyword = obj.name
  7790. } else {
  7791. this.searchKeyword = ''
  7792. }
  7793. this.searchScreen(0)
  7794. } else if(obj.distinction == '13') {
  7795. this.usersListId = obj.id
  7796. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  7797. this.searchKeyword = obj.name
  7798. } else {
  7799. this.searchKeyword = ''
  7800. }
  7801. this.searchScreen(1)
  7802. }
  7803. }
  7804. },
  7805. created() {
  7806. this.getUsers()
  7807. let height = window.innerHeight;
  7808. this.tableHeight = height - 178;
  7809. const that = this;
  7810. window.onresize = function temp() {
  7811. that.tableHeight = window.innerHeight - 178;
  7812. };
  7813. this.toViewForm.companyId = this.user.companyId
  7814. this.initDrag([{
  7815. type: "LR",
  7816. domClass: {
  7817. // 中间分割线的名字
  7818. resize: "line-line",
  7819. // 左侧盒子的名字
  7820. left: "box-left",
  7821. // 右侧盒子的名字
  7822. right: "box-right",
  7823. // 父级的名字
  7824. box: "box-father",
  7825. },
  7826. otherInfo: {
  7827. // 限制左边栏最低宽度
  7828. leftWidth: 120,
  7829. },
  7830. },
  7831. {
  7832. type: "LR",
  7833. domClass: {
  7834. // 中间分割线的名字
  7835. resize: "line-second",
  7836. // 左侧盒子的名字
  7837. left: "left-laowang",
  7838. // 右侧盒子的名字
  7839. right: "box-second-father",
  7840. // 父级的名字
  7841. box: "grand",
  7842. },
  7843. otherInfo: {
  7844. // 限制左边栏最低宽度
  7845. leftWidth: 120,
  7846. },
  7847. },
  7848. ]);
  7849. }
  7850. };
  7851. </script>
  7852. <style lang="scss" scoped>
  7853. .fillWeekDialogVisiCustom {
  7854. width: 100%;
  7855. height: 70vh;
  7856. }
  7857. .fillWeekCustom {
  7858. .el-dialog__body {
  7859. padding: 20px 20px !important;
  7860. }
  7861. }
  7862. .photos {
  7863. position: relative;
  7864. display: flex;
  7865. flex-wrap: wrap;
  7866. }
  7867. .photos_img {
  7868. width: 120px;
  7869. height: 120px;
  7870. margin-right: 20px;
  7871. margin-bottom: 20px;
  7872. cursor: pointer;
  7873. img {
  7874. width: 100%;
  7875. height: 100%;
  7876. }
  7877. }
  7878. .paginatis {
  7879. padding: 10px 10px;
  7880. background: #f2f2f2;
  7881. }
  7882. .waiting {
  7883. color:orange;
  7884. }
  7885. .filledReportStyle {
  7886. color:#32CD32;
  7887. }
  7888. .RejectStyle {
  7889. color:red;
  7890. }
  7891. .waitSubmitStyle{
  7892. color: #409eff;
  7893. }
  7894. .chooseDate {
  7895. .waiting {
  7896. color: #20a0ff;
  7897. }
  7898. .filledReportStyle {
  7899. color:#20a0ff;
  7900. }
  7901. .RejectStyle {
  7902. color: #20a0ff;
  7903. }
  7904. .waitSubmitStyle{
  7905. color: #20a0ff;
  7906. }
  7907. }
  7908. .allDaily {
  7909. width:100%;
  7910. }
  7911. .report_title {
  7912. padding:10px 0;
  7913. color:#666;
  7914. }
  7915. .clearfix {
  7916. overflow-x: auto;
  7917. white-space: nowrap;
  7918. padding: 15px 0 10px 0;
  7919. // overflow-y: hidden;
  7920. .date_item {
  7921. padding: 0 3px;
  7922. cursor: pointer;
  7923. position: relative;
  7924. }
  7925. .chooseDate {
  7926. position: absolute;
  7927. bottom: -3px;
  7928. width: 37px;
  7929. height: 2px;
  7930. left: 14px;
  7931. background: #20a0ff;
  7932. }
  7933. }
  7934. .one_daily {
  7935. i {
  7936. color: #9ed0ff;
  7937. margin-right: 5px;
  7938. }
  7939. .one_daily_body {
  7940. padding: 10px 0px;
  7941. p {
  7942. margin: 0;
  7943. line-height: 30px;
  7944. }
  7945. }
  7946. ul {
  7947. padding: 0;
  7948. }
  7949. }
  7950. .checkbtn {
  7951. float: right;
  7952. margin-top: -10px;
  7953. }
  7954. .selConStyle{
  7955. margin-top:9rem;
  7956. margin-bottom:11rem;
  7957. .selConStyle_title{
  7958. height: 3rem;
  7959. text-align: center;
  7960. font-size: 17px;
  7961. }
  7962. .el-select{
  7963. margin: 0 15%;
  7964. width: 70%;
  7965. }
  7966. }
  7967. </style>
  7968. <style lang="scss">
  7969. /*去除upload组件过渡效果*/
  7970. .photos .el-upload-list__item {
  7971. transition: none !important;
  7972. }
  7973. .daily {
  7974. .el-card__body {
  7975. height: 80%;
  7976. overflow-y: auto;
  7977. }
  7978. .el-card__header {
  7979. padding: 0 20px;
  7980. }
  7981. }
  7982. .membListClass{
  7983. .el-dialog__body{
  7984. padding-top: 10px;
  7985. }
  7986. }
  7987. // .editReportDialog .el-dialog__footer{
  7988. // position: sticky;
  7989. // bottom: 0;
  7990. // background: #fff;
  7991. // height: 70px;
  7992. // z-index: 1010;
  7993. // }
  7994. .editReportDialog{
  7995. min-width: 800px;
  7996. }
  7997. .touruxiangmu{
  7998. max-width: 1000px;
  7999. }
  8000. </style>
  8001. <style scoped>
  8002. /* 项目标签的样式 */
  8003. .el-tag + .el-tag {
  8004. margin-left: 10px;
  8005. }
  8006. .button-new-tag {
  8007. margin-left: 10px;
  8008. height: 32px;
  8009. line-height: 30px;
  8010. padding-top: 0;
  8011. padding-bottom: 0;
  8012. }
  8013. .input-new-tag {
  8014. width: 90px;
  8015. margin-left: 10px;
  8016. vertical-align: bottom;
  8017. }
  8018. .selectworktime .el-table__fixed-body-wrapper{
  8019. top: 48px !important;
  8020. }
  8021. .selectworktime_export .selectworktime_export_l{
  8022. width: 650px;
  8023. float: left;
  8024. height: 42px;
  8025. }
  8026. .approvalProcessBox{
  8027. margin-left: 30px;
  8028. font-size: 14px;
  8029. line-height: 16px;
  8030. cursor: pointer;
  8031. }
  8032. .approvalProcessBox i {
  8033. margin-right: 0;
  8034. height: 16px;
  8035. width: 16px;
  8036. display: inline-block;
  8037. transform: scale(1.2);
  8038. position: relative;
  8039. top: 0.5px;
  8040. color: #409eff;
  8041. }
  8042. .approvalProcessBox .approvalProcessClick{
  8043. cursor: pointer;
  8044. color: #409eff;
  8045. font-size: 14px;
  8046. }
  8047. .approvalProcessBox:hover .approvalProcessClick{
  8048. color: #3485fb;
  8049. }
  8050. </style>
  8051. <style lang="scss" scoped>
  8052. // 加班样式
  8053. .overtime {
  8054. display: inline-block;
  8055. margin-left: 20px;
  8056. input {
  8057. display: inline-block;
  8058. margin-top: 5px;
  8059. }
  8060. }
  8061. .plus {
  8062. display: inline-block;
  8063. }
  8064. // .tages {
  8065. // float: right;
  8066. // }
  8067. .overtime {
  8068. display: inline-block;
  8069. margin-left: 30px;
  8070. }
  8071. .bloks {
  8072. display: inline-block;
  8073. width: 380px;
  8074. }
  8075. .zhiss {
  8076. display: flex;
  8077. justify-content: space-around;
  8078. align-items: center;
  8079. }
  8080. .zhoFel {
  8081. display: flex;
  8082. justify-content: space-between;
  8083. align-items: center;
  8084. }
  8085. // 左右滑动样式
  8086. .line {
  8087. width: 30px;
  8088. /* height: 500px; */
  8089. background: #f2f2f2;
  8090. cursor: w-resize;
  8091. }
  8092. .box-father {
  8093. border: 8px solid #000;
  8094. }
  8095. .line-second {
  8096. width: 10px;
  8097. /* background: red; */
  8098. }
  8099. .flex {
  8100. display: flex;
  8101. width: 100%;
  8102. }
  8103. .box-left {
  8104. flex: 0 0 400px;
  8105. /* height: 600px; */
  8106. /* background: blue; */
  8107. }
  8108. .box-right {
  8109. /* height: 600px; */
  8110. /* background: green; */
  8111. flex: 1;
  8112. }
  8113. .box-postion {
  8114. width: 200px;
  8115. /* height: 400px; */
  8116. background: #ccc;
  8117. }
  8118. .custom-tree-node {
  8119. flex: 1;
  8120. display: flex;
  8121. align-items: center;
  8122. justify-content: space-between;
  8123. font-size: 14px;
  8124. padding-right: 8px;
  8125. }
  8126. .daitianrbao {
  8127. width: 100%;
  8128. box-sizing: border-box;
  8129. height: 40px;
  8130. border-radius: 4px;
  8131. border: 1px solid #DCDFE6;
  8132. overflow: hidden;
  8133. text-overflow: ellipsis;
  8134. display: flex;
  8135. // align-items: center;
  8136. }
  8137. .daitianrbao .spnn {
  8138. display: inline-block;
  8139. box-sizing: border-box;
  8140. padding: 0 15px;
  8141. overflow: hidden;
  8142. text-overflow: ellipsis;
  8143. }
  8144. .daitianrbao .hover {
  8145. color: #DCDFE6 !important;
  8146. }
  8147. </style>