daily.vue 347 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601
  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')" v-if="user.userNameNeedTranslate != 1" 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-key="id" :default-expanded-keys="expandDate">
  47. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  48. <!-- <span>{{ node.label }}</span> -->
  49. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  50. <span v-if="user.userNameNeedTranslate == '1'">
  51. <span v-if="node.data.children">
  52. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  53. </span>
  54. <span v-else>
  55. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  56. </span>
  57. </span>
  58. <span v-if="user.userNameNeedTranslate != '1'">
  59. {{ node.label }}
  60. </span>
  61. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  62. </span>
  63. <div style="position: absolute;right: 15px;">
  64. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  65. <!-- 未填报 -->
  66. {{$t('state.DidNotFillIn')}}
  67. </span>
  68. <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'">
  69. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  70. {{data.leaveDays ? (data.leaveDays >= 1 ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveDays + $t('time.day')+')') : (data.leaveTimes >= user.timeType.allday ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveTimes + 'h)')}}
  71. </span>
  72. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  73. <!-- 待审核 -->
  74. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  75. </span>
  76. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  77. <!-- 已通过 -->
  78. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  79. </span>
  80. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  81. <!-- 未通过 -->
  82. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  83. </span>
  84. <span v-if="data.isUser == 1 && data.state == 3" style="color:#409eff;font-size:13px">
  85. <!-- 待提交 -->
  86. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  87. </span>
  88. </div>
  89. </span>
  90. </el-tree>
  91. </div>
  92. </div>
  93. </div>
  94. <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">
  95. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  96. -
  97. -
  98. -
  99. </div>
  100. </div>
  101. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  102. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  103. <div class="allDaily" style="float:left;flex-grow:1">
  104. <!--系统管理员和部门负责人 -->
  105. <div class="report_title" style="display:flex;justify-content: space-between;">
  106. <span>
  107. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  108. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  109. <!-- {{depData != null ?depData.label:""}} -->
  110. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  111. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='depData.label'></ww-open-data></span>
  112. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='depData.label'></ww-open-data></span>
  113. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  114. <span v-if="targetUid == null">
  115. <!-- - 已提交 -->
  116. -{{$t('state.hasBeenSubmitted')}}
  117. <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')}},
  118. <!-- 待提交 -->
  119. {{$t('state.waitingsubmit')}}
  120. <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')}},
  121. <!-- 漏填 -->
  122. {{$t('state.missFillReport')}}
  123. <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')}}
  124. <span v-if="leaveAllNum">{{', 全天请假' + leaveAllNum + '人'}}</span></el-link>
  125. </span>
  126. </span>
  127. </span>
  128. <span style="float:right;">
  129. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
  130. <el-link v-if="reportTimeType.type != 0" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
  131. <el-link type="primary" v-if="permissions.reportsFillOut" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,2)">{{$t('textLink.helpToFillIn')}}</el-link>
  132. <el-link type="primary" v-if="permissions.reportBatch" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">{{$t('textLink.batchFillIn')}}</el-link>
  133. <el-link type="primary" v-if="permissions.importReport || user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="imports()">{{$t('textLink.workHoursImport')}}</el-link>
  134. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  135. <!--部门负责人给个导出工时的功能 -->
  136. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  137. </span>
  138. </div>
  139. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  140. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  141. <i class="fa fa-circle"></i>
  142. <!-- {{item1.name}} -->
  143. <span v-if="user.userNameNeedTranslate == '1'">
  144. <ww-open-data type='userName' :openid='item1.name'></ww-open-data>
  145. </span>
  146. <span v-if="user.userNameNeedTranslate != '1'">
  147. {{item1.name}}
  148. </span>
  149. <span style="margin-left:30px;">
  150. <span style="margin-right:20px;">
  151. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  152. <!-- 工作总时长: -->
  153. {{$t('other.totalWorkingHours')}}
  154. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  155. <span >{{item1.reportTime | amounts}}</span>h
  156. </span>
  157. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  158. <i class="iconfont firerock-iconliucheng1"></i>
  159. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  160. <!-- 审批流程 -->
  161. {{$t('other.approvalProcess')}}
  162. </span>
  163. </span>
  164. </span>
  165. <div class="checkbtn" style="padding-right:20px;">
  166. <el-button v-if="item1.state >= 2 && user.id == item1.id" type="primary" size="small" @click="isSubstitude=false; fillInReport(index1,0)">{{$t('btn.editWorkReport')}}</el-button>
  167. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  168. </div>
  169. <div class="one_daily_body">
  170. <el-timeline>
  171. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  172. <el-card shadow="never">
  173. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  174. <!-- <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span> -->
  175. <span v-if="user.company.packageEngineering == 0">
  176. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  177. <span v-if="item2.isDeptAudit==0">
  178. <span v-if="item2.projectAuditState==0">
  179. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  180. <span v-if="item2.projectAuditorName != null">(
  181. <!-- {{item2.projectAuditorName}} -->
  182. <span v-if="user.userNameNeedTranslate == '1'">
  183. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  184. </span>
  185. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  186. )</span>
  187. <!-- 审核 --> {{$t('other.audit')}}
  188. </span>
  189. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  190. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  191. <span v-if="item2.projectAuditorName != null">(
  192. <!-- {{item2.projectAuditorName}} -->
  193. <span v-if="user.userNameNeedTranslate == '1'">
  194. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  195. </span>
  196. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  197. )</span>
  198. <!-- 审核通过 --> {{$t('state.approved')}}
  199. </span>
  200. </span>
  201. <span v-else-if="item2.isDeptAudit==1">
  202. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  203. ({{$t('other.await')}}
  204. <span v-if="user.userNameNeedTranslate == '1'">
  205. <ww-open-data type='departmentName' :openid='item2.auditDeptName'></ww-open-data>
  206. </span>
  207. <span v-if="user.userNameNeedTranslate != '1'">{{item2.auditDeptName}}</span>
  208. {{$t('other.audit')}})
  209. </span>
  210. ]</span>
  211. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  212. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  213. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1">{{$t('other.automaticReview')}}</span>
  214. </span>
  215. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  216. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  217. </span>
  218. <!-- <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> -->
  219. <span v-if="user.company.packageEngineering == 1">
  220. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  221. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  222. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  223. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  224. (
  225. <span v-if="user.userNameNeedTranslate != 1">
  226. {{item2.projectAuditorName}}
  227. </span>
  228. <span v-if="user.userNameNeedTranslate == 1">
  229. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  230. </span>
  231. )
  232. </span>{{$t('other.audit')}} ]</span>
  233. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  234. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  235. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  236. </span>
  237. <!--每个项目上单独审核 -->
  238. <span style="float:right;">
  239. <el-button v-if="(permissions.projectReportReview || user.id == item2.projectAuditorId) && item2.state == 0 && item2.isDeptAudit==0 && item2.projectAuditState==0" type="primary" :loading="logining"
  240. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  241. <el-button v-if="(permissions.projectReportReview ||user.id == item2.projectAuditorId) && item2.state == 0 && item2.isDeptAudit==0 && item2.projectAuditState==0" type="danger" :loading="logining"
  242. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  243. <el-button v-if="(permissions.projectReportReview ||user.id == item2.projectAuditorId) && item2.state == 1" type="normal" :loading="logining" size="small"
  244. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  245. <!--自己可以撤回待审核状态的报告 -->
  246. <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>
  247. </span>
  248. </p>
  249. <!--任务分组和阶段 -->
  250. <p v-if="item2.groupId != 0">{{$t('other.taskGroup')}}:{{item2.groupName}} <span v-if="item2.stage != null && item2.stage != '-'" style="margin-left:10px;">{{$t('other.inputStage')}}:{{item2.stage}}</span></p>
  251. <p v-if="user.timeType.customDegreeActive==1 && item2.degree_id != null && item2.degree_id != -1">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  252. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  253. <!-- 自定义日报文本 -->
  254. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  255. <p v-if="user.company.packageEngineering == 1">
  256. {{$t('other.professionalProgress')}}:
  257. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  258. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  259. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  260. </el-tooltip>
  261. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  262. <i class="iconfont firerock-iconshenhetongguo"></i>
  263. </el-tooltip>
  264. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  265. <i class="iconfont firerock-iconshenhebohui"></i>
  266. </el-tooltip>
  267. </span>
  268. </p>
  269. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  270. </p>
  271. <div v-if="item2.multiWorktime==0">
  272. <p style="display: inline-block;">{{$t('time.duration')}}:
  273. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  274. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  275. {{item2.time.toFixed(1)}}h
  276. <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>
  277. </p>
  278. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  279. </div>
  280. <div v-if="item2.multiWorktime==1" >
  281. <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>
  282. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  283. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  284. <p style="display: inline-block;">{{$t('time.duration')}}:
  285. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  286. {{timeItem.time.toFixed(1)}}h
  287. </p>
  288. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  289. </div>
  290. </div>
  291. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  292. <!--照片的显示 -->
  293. <p v-if="item2.pics != null && item2.pics.length > 0">
  294. <el-image v-for="(pic, index) in item2.pics" :key="index"
  295. style="width: 100px; height: 100px; margin-right:10px;"
  296. :src="pic"
  297. :preview-src-list="item2.pics">
  298. </el-image>
  299. </p>
  300. </el-card>
  301. </el-timeline-item>
  302. </el-timeline>
  303. </div>
  304. </div>
  305. <!-- 简陋的无报告提示 -->
  306. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  307. </div>
  308. </div>
  309. </div>
  310. </div>
  311. </div>
  312. </el-card>
  313. </div>
  314. <!-- 填写日报的dialog -->
  315. <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">
  316. <div style="height: 65vh;overflow: auto;">
  317. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  318. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  319. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  320. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  321. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  322. <span class="spnn" v-if="workForm.userNames">
  323. <span v-for="(item, index) in workForm.userNames" :key="index">
  324. <span><ww-open-data type='userName' :openid='item'></ww-open-data></span>
  325. <span v-if="index < workForm.userNames.length - 1">,</span>
  326. </span>
  327. </span>
  328. <span class="spnn hover" v-else>
  329. {{$t('defaultText.pleaseSelectAsubstitute')}}
  330. </span>
  331. </div>
  332. </el-form-item>
  333. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  334. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  335. :style="'width:'+(isBatch==0?'200':'280')+'px;'" :type="isBatch==0?'date':'daterange'"
  336. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  337. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  338. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{$t('other.fillInTheTotal')}} {{jsTime}} {{$t('time.hour')}}</div>
  339. <span v-if="reportTimeType.type == 3" style="margin-left:30px;">{{isBatch==0? $t('other.total'):$t('weekDay.daily')}}{{$t('time.duration')}}:</span>
  340. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3" style="margin-left:10px;" @change="changeAllTime"
  341. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  342. <span v-if="reportTimeType.type == 3">{{$t('time.hour')}}</span>
  343. <span v-if="workForm.time">{{$t('other.attendancePunch')}}: {{workForm.time.startTime}}-{{workForm.time.endTime}}, {{workForm.time.workHours}}{{$t('time.hour')}}</span>
  344. <!--批量填报和批量代填不显示考勤记录-->
  345. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  346. <el-button type="default" style="margin-left:5px;" size="mini" :loading="syncTimeLoading"
  347. v-if="!isBatch && user.timeType.syncCorpwxTime==1 && (workForm.createDate == today || !workForm.time || workForm.time.workHours <= 0)" icon="el-icon-refresh"
  348. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  349. </el-form-item>
  350. <!-- 000000 -->
  351. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  352. <div v-if="reportTimeType.multiWorktime==0">
  353. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  354. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  355. <el-select v-model="domain.timeType" style="width:200px;"
  356. v-if="reportTimeType.type == 0"
  357. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  358. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  359. @change="onTimeTypeChange(domain.timeType)">
  360. <el-option
  361. v-for="item in timeType"
  362. :key="item.value"
  363. :label="item.label"
  364. :value="item.value">
  365. </el-option>
  366. </el-select>
  367. <!-- 数字时长选择 -->
  368. <el-select v-model="domain.workingTime" style="width:200px;"
  369. v-if="reportTimeType.type == 1"
  370. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  371. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  372. @change="seleChn(0,domain)">
  373. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  374. </el-select>
  375. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  376. <span v-if="reportTimeType.type == 2">
  377. <!--时间范围选择 -->
  378. <el-time-picker
  379. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  380. v-model="domain.startTime"
  381. :placeholder="$t('time.startTime')"
  382. style="width:120px;"
  383. format="HH:mm"
  384. value-format="HH:mm"
  385. :picker-options="{
  386. start: '08:00',
  387. end: '23:30'
  388. }"
  389. @change="iptChang()">
  390. </el-time-picker> - <el-time-picker
  391. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  392. v-model="domain.endTime"
  393. :placeholder="$t('time.endTime')"
  394. style="width:120px;"
  395. format="HH:mm"
  396. value-format="HH:mm"
  397. :picker-options="{
  398. start: '08:00',
  399. end: '23:30',
  400. minTime: domain.startTime
  401. }"
  402. @change="iptChang()">
  403. </el-time-picker>
  404. </span>
  405. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  406. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  407. <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>
  408. </div>
  409. </el-form-item>
  410. <el-form-item :label="user.companyId==781? $t('screening.workTasks') : $t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  411. :rules="{ required: true, message: user.companyId==781? $t('defaultText.pleaseSelectaJob'): $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  412. <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"
  413. @change="selectProject(domain, index)"
  414. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  415. <!-- <el-option v-for="item in projectList" :disabled="item.status>=2" :key="item.id" :label="item.projectName" :value="item.id"></el-option> -->
  416. <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">
  417. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  418. <span style="float: right;">{{ item.projectName }}</span>
  419. </el-option>
  420. </el-select>
  421. <template v-if="user.timeType.mainProjectState != 1">
  422. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  423. style="margin-left:45px;">{{$t('lable.subproject')}}</span>
  424. <!--子项目 -->
  425. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  426. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  427. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  428. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  429. </el-select>
  430. </template>
  431. <el-link v-if="index >= 1&&domain.canEdit" type="primary" :underline="false" @click="delDomain(index)" style="float:right;margin-right:15%;"
  432. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  433. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  434. </el-link>
  435. <!-- <el-link type="primary" v-if="canEdit"
  436. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  437. </el-form-item>
  438. <el-form-item :label="user.companyId==781? $t('other.describe'):$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&projectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  439. <span>{{projectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  440. </el-form-item>
  441. <!--如果设置了工时成本预警的预算成本项-->
  442. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  443. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  444. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  445. </el-select>
  446. </el-form-item>
  447. <el-form-item :label="$t('lable.taskGrouping')" v-if="user.company.packageProject == 1">
  448. <!-- 任务分组 -->
  449. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  450. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  451. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  452. </el-select>
  453. <!-- 项目的阶段 -->
  454. <span v-if="domain.stages != null && domain.stages.length> 0"
  455. style="margin-left:30px;">{{$t('other.inputStage')}}</span>
  456. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  457. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  458. @change="changeStages(domain, index)"
  459. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  460. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  461. </el-select>
  462. </el-form-item>
  463. <el-form-item :label="user.companyId==781? $t('other.reviewer') : $t('other.projectAuditor')" v-if="user.timeType.reportAuditType != 3">
  464. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  465. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  466. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  467. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  468. </el-option>
  469. </el-select>
  470. <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>
  471. </el-form-item>
  472. <!-- 111111 -->
  473. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  474. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  475. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  476. </el-select>
  477. <template v-if="user.timeType.auditLevel > 1">
  478. <i class="el-icon-right"></i>
  479. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  480. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  481. </el-select>
  482. </template>
  483. <template v-if="user.timeType.auditLevel > 2">
  484. <i class="el-icon-right"></i>
  485. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  486. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  487. </el-select>
  488. </template>
  489. </el-form-item>
  490. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  491. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  492. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  493. </el-select>
  494. </el-form-item>
  495. <!-- 相关维度/自定义维度 -->
  496. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1" :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'">
  497. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  498. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  499. </el-option>
  500. </el-select>
  501. </el-form-item>
  502. <!-- 相关数值 -->
  503. <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">
  504. <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>
  505. </el-form-item>
  506. <!-- 自定义文本 -->
  507. <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">
  508. <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>
  509. </el-form-item>
  510. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  511. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  512. <div style="width:300px;">
  513. <el-col span="14"><el-slider :disabled="!domain.canEdit" v-model="domain.progress" :min="5" :show-tooltip="false" :step="5" style="width:180px;" @input="domain.workingTime = (reportTimeType.allday*domain.progress/100).toFixed(1)" @change="seleChn(0)"></el-slider></el-col>
  514. <el-col span="10"><span style="margin-left:10px;float:right;"><span style="margin-right:10px;">{{domain.progress}}%</span>{{domain.workingTime}}{{$t('time.hour')}}</span></el-col>
  515. </div>
  516. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  517. <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>
  518. </div>
  519. </el-form-item>
  520. <!--工程专业版本模式下, 各个专业的进度填报 -->
  521. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  522. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  523. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  524. <el-input size="mini" style="width:60px;" v-model="item.progress"
  525. @keyup.native="onProgressChange"
  526. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  527. </span>
  528. </el-form-item>
  529. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  530. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  531. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  532. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  533. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  534. </el-select>
  535. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  536. </el-form-item>
  537. <el-form-item :label="user.companyId==781? $t('other.specificContentAndResults') : $t('other.workMatters') " :prop="'domains.' + index + '.content'"
  538. :rules="user.timeType.workContentState == 1 ? { required: true, message: user.companyId==781? $t('other.tianspecificContentAndResults'):$t('other.tianworkMatters'), trigger: 'blur' } : null">
  539. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  540. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  541. </el-form-item>
  542. </div>
  543. <!--多个工作事项填报的情况 -->
  544. <div v-if="reportTimeType.multiWorktime==1">
  545. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  546. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  547. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  548. @change="selectProject(domain, index)"
  549. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  550. <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">
  551. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  552. <span style="float: right;">{{ item.projectName }}</span>
  553. </el-option>
  554. </el-select>
  555. <template v-if="user.timeType.mainProjectState != 1">
  556. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  557. style="margin-left:45px;">{{$t('lable.subproject')}}</span>
  558. <!--子项目 -->
  559. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  560. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  561. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  562. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  563. </el-select>
  564. </template>
  565. <el-link v-if="index >= 1&&domain.canEdit" type="primary" :underline="false" @click="delDomain(index)" style="float:right;margin-right:10px;"
  566. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  567. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  568. </el-link>
  569. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  570. <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>
  571. </div>
  572. <!-- <el-link type="primary" v-if="canEdit"
  573. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  574. </el-form-item>
  575. <el-form-item :label="user.companyId==781?$t('other.describe'):$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&projectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  576. <span>{{projectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  577. </el-form-item>
  578. <!--如果设置了工时成本预警的预算成本项-->
  579. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  580. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  581. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  582. </el-select>
  583. </el-form-item>
  584. <el-form-item :label="$t('lable.taskGrouping')" v-if="user.company.packageProject == 1">
  585. <!-- 任务分组 -->
  586. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  587. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  588. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  589. </el-select>
  590. <!-- 项目的阶段 -->
  591. <span v-if="domain.stages != null && domain.stages.length> 0"
  592. style="margin-left:30px;">{{$t('other.inputStage')}}</span>
  593. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  594. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  595. @change="changeStages(domain, index)"
  596. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  597. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  598. </el-select>
  599. </el-form-item>
  600. <el-form-item :label="$t('other.projectAuditor')" >
  601. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  602. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  603. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  604. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  605. </el-option>
  606. </el-select>
  607. <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>
  608. </el-form-item>
  609. <!--工程专业版本模式下, 各个专业的进度填报 -->
  610. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  611. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  612. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  613. <el-input size="mini" style="width:60px;" v-model="item.progress"
  614. @keyup.native="onProgressChange"
  615. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  616. </span>
  617. </el-form-item>
  618. <!-- 相关维度 -->
  619. <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'">
  620. <el-select v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  621. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  622. </el-option>
  623. </el-select>
  624. </el-form-item>
  625. <!-- 相关数值 -->
  626. <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">
  627. <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>
  628. </el-form-item>
  629. <!-- 自定义文本 -->
  630. <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">
  631. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  632. </el-form-item>
  633. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  634. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  635. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  636. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  637. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  638. </el-select>
  639. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  640. </el-form-item>
  641. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  642. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  643. <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>
  644. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  645. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  646. <span v-if="reportTimeType.type == 2">
  647. <!-- <span> -->
  648. <!--时间范围选择 -->
  649. <el-time-picker
  650. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  651. v-model="timeItem.startTime"
  652. :placeholder="$t('time.startTime')"
  653. style="width:120px;"
  654. format="HH:mm"
  655. value-format="HH:mm"
  656. :picker-options="{
  657. start: '00:00',
  658. end: '23:59',
  659. }"
  660. @change="iptChangs()">
  661. </el-time-picker> - <el-time-picker
  662. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  663. v-model="timeItem.endTime"
  664. :placeholder="$t('time.endTime')"
  665. style="width:120px;"
  666. format="HH:mm"
  667. value-format="HH:mm"
  668. :picker-options="{
  669. start: '00:00',
  670. end: '23:59',
  671. minTime: timeItem.startTime
  672. }"
  673. @change="iptChangs()">
  674. </el-time-picker>
  675. </span>
  676. </el-form-item>
  677. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  678. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  679. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  680. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  681. ></el-input>
  682. </el-form-item>
  683. </div>
  684. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  685. </div>
  686. <!--照片的显示 -->
  687. <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  688. <el-image v-for="(pic, index) in domain.pics" :key="index"
  689. style="width: 100px; height: 100px; margin-right:10px;"
  690. :src="pic"
  691. :preview-src-list="domain.pics">
  692. </el-image>
  693. </p>
  694. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider>
  695. </div>
  696. <span id="workFormsItemBottom"></span>
  697. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  698. </el-form>
  699. </div>
  700. <span slot="footer" class="dialog-footer">
  701. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  702. <span style="margin-right:20px" @click="test()">合计工时:{{totalReportHours}}小时</span>
  703. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  704. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  705. <el-button v-if="!isSubstitude" @click="submitReport(1)" :loading="submitingReport" :disabled="workForm.domains.length==0?true:(canEdit?false:true)">{{$t('btn.temporaryStorage')}}</el-button>
  706. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  707. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  708. </span>
  709. </el-dialog>
  710. <!-- 按周填报 -->
  711. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="diasZho" width="60%" :close-on-click-modal="false" @closed="guanbi(),zhoAddqx()">
  712. <!-- 按周填报-已填工时-点击 -->
  713. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  714. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  715. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  716. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  717. <el-table-column prop="state" :label="$t('state.states')">
  718. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  719. </el-table-column>
  720. <!-- <el-table-column label="操作">
  721. <template slot-scope="scope">
  722. <el-button v-if="scope.row.state == 2 || scope.row.state == 3" size="small" @click="weeklyFilledTimeDelete(scope.row)">删除</el-button>
  723. </template>
  724. </el-table-column> -->
  725. </el-table>
  726. <span slot="footer" class="dialog-footer">
  727. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  728. </span>
  729. </el-dialog>
  730. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!selConShow">
  731. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  732. <el-date-picker v-model="zhoRqi" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="zhoRqis()" 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>
  733. <el-button @click="handleGetPrevWeek()">{{$t('time.lastWeek')}}</el-button>
  734. <el-button @click="handleGetNextvWeek()">{{$t('time.nextWeek')}}</el-button>
  735. <el-button @click="getCurrentWeek()">{{$t('time.thisWeek')}}</el-button>
  736. <el-button @click="newDates()">{{$t('time.addedDate')}}</el-button>
  737. </el-form-item>
  738. <el-table :data="zhoData" style="width: 100%" v-loading="zhoLoading" max-height="400">
  739. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  740. <template slot-scope="scope">
  741. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTime | zhoData(weekDay)}})
  742. </template>
  743. </el-table-column>
  744. <el-table-column fixed="left" :label="$t('other.hoursFilled')+ '(h)'" width="100" prop="filledTime" align="center">
  745. <template slot-scope="scope">
  746. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  747. <p v-else></p>
  748. </template>
  749. </el-table-column>
  750. <!-- <el-table-column align="center" v-for="(item, index) in projectList" :key="item.id" :label="item.projectName" width="200"> -->
  751. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="200">
  752. <template slot-scope="scope">
  753. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  754. <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</el-button>
  755. <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</el-button>
  756. <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]}}</el-button>
  757. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  758. </div>
  759. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  760. <el-button v-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]}}</el-button>
  761. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  762. </div>
  763. </template>
  764. </el-table-column>
  765. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  766. <template slot-scope="scope">
  767. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours + 'h'}}</span>
  768. <span v-else>{{$t('other.noAttendanceRecord')}}</span>
  769. </template>
  770. </el-table-column>
  771. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  772. <template slot-scope="scope">
  773. <div class="zhiss">
  774. <p>{{scope.row.filledTime ? parseFloat(scope.row.he) + scope.row.filledTime*1 : parseFloat(scope.row.he)}}</p>
  775. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  776. </div>
  777. </template>
  778. </el-table-column>
  779. </el-table>
  780. </el-form>
  781. <!-- 按周填报项目筛选 -->
  782. <div v-if="selConShow" class="selConStyle">
  783. <div class="selConStyle_title">{{$t('defaultText.pleaseSelectTheItemYouWantToFillIn')}}</div>
  784. <el-select v-model="selCon" multiple :placeholder="$t('defaultText.pleaseChoose')" filterable>
  785. <el-option
  786. v-for="item in fillProjectList"
  787. :disabled="item.status!=1 && item.status!=4"
  788. :key="item.id"
  789. :label="item.projectName"
  790. :value="item.id">
  791. </el-option>
  792. </el-select>
  793. </div>
  794. <span slot="footer" class="dialog-footer" v-if="selConShow">
  795. <el-button @click="selListqx()">{{$t('btn.cancel')}}</el-button>
  796. <el-button type="primary" @click="selListFun()">{{$t('btn.nextStep')}}</el-button>
  797. <!-- :loading="submitingReport" -->
  798. </span>
  799. <span slot="footer" class="dialog-footer" v-if="!selConShow">
  800. <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button>
  801. <el-button @click="zhoAddqx()">{{$t('btn.cancel')}}</el-button>
  802. <el-button type="primary" @click="zhoAdd()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  803. </span>
  804. </el-dialog>
  805. <!-- 选择时间 -->
  806. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  807. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  808. <span slot="footer" class="dialog-footer">
  809. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  810. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  811. </span>
  812. </el-dialog>
  813. <!-- 按周填报弹窗 -->
  814. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  815. <div>
  816. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  817. <p>{{$t('lable.subproject')}}</p>
  818. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  819. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  820. </el-select>
  821. </div>
  822. <!--如果设置了工时成本预警的预算成本项-->
  823. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  824. <p>{{$t('lable.budgetSource')}}</p>
  825. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  826. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  827. </el-select>
  828. </div>
  829. <!-- 任务分组 -->
  830. <div class="zhoFel" v-if="user.company.packageProject == 1">
  831. <p>{{$t('lable.taskGrouping')}}</p>
  832. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  833. @change="getGroupStages(zhoBao, 0)">
  834. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  835. </el-select>
  836. </div>
  837. <div class="zhoFel" v-if="user.company.packageProject == 1 && zhoBao.stages != null && zhoBao.stages.length> 0">
  838. <p>{{$t('other.inputStage')}}</p>
  839. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" >
  840. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  841. </el-select>
  842. </div>
  843. <div class="zhoFel" v-if="user.timeType.reportAuditType != 3">
  844. <p>{{$t('other.reviewer')}}</p>
  845. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  846. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  847. </el-select>
  848. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  849. </div>
  850. <template v-if="user.timeType.reportAuditType == 3">
  851. <div class="zhoFel">
  852. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  853. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  854. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  855. </el-select>
  856. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  857. </div>
  858. <div class="zhoFel">
  859. <p>{{ $t('di-er-shen-he-ren') }}</p>
  860. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  861. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  862. </el-select>
  863. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  864. </div>
  865. <div class="zhoFel">
  866. <p>{{ $t('di-san-shen-he-ren') }}</p>
  867. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  868. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  869. </el-select>
  870. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  871. </div>
  872. <div class="zhoFel">
  873. <p>{{ $t('chao-song-ren') }}</p>
  874. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  875. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  876. </el-select>
  877. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  878. </div>
  879. </template>
  880. <!-- 自定义维度 -->
  881. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  882. <p>{{user.timeType.customDegreeName}}</p>
  883. <el-select v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  884. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  885. </el-select>
  886. </div>
  887. <!-- 自定义数值 -->
  888. <div class="zhoFel" v-if="user.timeType.customDataActive">
  889. <p>{{user.timeType.customDataName}}</p>
  890. <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>
  891. </div>
  892. <!-- 自定义文本 -->
  893. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  894. <p>{{user.timeType.customTextName}}</p>
  895. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  896. </div>
  897. <div class="zhoFel" v-if="reportTimeType.type == 2">
  898. <p>{{$t('other.timeSelection')}}</p>
  899. <el-time-picker style="width: 355px" is-range v-model="zhoBao.time" format="HH:mm" value-format="HH:mm" :range-separator="$t('other.to')" :start-placeholder="$t('time.startDate')" :end-placeholder="$t('time.endDate')" :placeholder="$t('time.selectTimeRange')"></el-time-picker>
  900. </div>
  901. <div class="zhoFel" v-if="reportTimeType.type == 1">
  902. <p>{{$t('other.chooseDuration')}}</p>
  903. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  904. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  905. </el-select>
  906. </div>
  907. <div class="zhoFel" v-if="reportTimeType.type == 3">
  908. <p>{{$t('lable.percentageOfTime')}}</p>
  909. <div style="width:355px;display: flex;align-items: center;">
  910. <el-col span="23"><el-slider style="margin-left: 5px;width:249px;" v-model="zhoBao.progress" :min="0" :show-tooltip="false" :step="10" @input="zhoBao.workingTime = (reportTimeType.allday*zhoBao.progress/100).toFixed(1)"></el-slider></el-col>
  911. <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>
  912. </div>
  913. </div>
  914. <div class="zhoFel">
  915. <p>{{$t('other.workMatters')}}</p>
  916. <el-input type="textarea" v-model="zhoBao.con" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  917. </div>
  918. </div>
  919. <span slot="footer" class="dialog-footer">
  920. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  921. <el-button type="primary" @click="btnTianxiaes()">{{$t('btn.determine')}}</el-button>
  922. </span>
  923. </el-dialog>
  924. <!-- 批量日报审核 -->
  925. <el-dialog :title="$t('other.bulkProjectReportReview')" :visible.sync="approveDialogVisible" width="500px" >
  926. <el-checkbox v-model="isAllSelect" :label="$t('btn.selectAll')" style="margin-left:24px;" @change="selectAll" v-if="reportNames.length > 0"></el-checkbox>
  927. <el-tree ref="approveTree" node-key="id" :data="reportNames" show-checkbox="true" @check-change="handleCheckChange" >
  928. </el-tree>
  929. <div style="margin-left:30px;color:#999;" v-if="user.company.packageEngineering==1">{{$t('other.responsibleForTheProjectLength')}}</div>
  930. <span slot="footer" class="dialog-footer">
  931. <el-button @click="approveDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  932. <el-button type="primary" @click="submitBatchApprove" :disabled="batchShowData.length == 0">{{$t('state.approved')}}</el-button>
  933. </span>
  934. </el-dialog>
  935. <!--导出报表条件选择 -->
  936. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  937. <el-form ref="form3" :model="exportParam" >
  938. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  939. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  940. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  941. </el-select>
  942. </el-form-item>
  943. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  944. <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>
  945. <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>
  946. </el-form-item>
  947. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  948. <el-date-picker
  949. v-model="exportParam.dateRange" :editable="false"
  950. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  951. :clearable="true"
  952. :range-separator="$t('other.to')"
  953. type="daterange"
  954. :start-placeholder="$t('time.startDate')"
  955. :end-placeholder="$t('time.endDate')"
  956. ></el-date-picker>
  957. </el-form-item>
  958. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  959. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  960. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  961. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  962. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  963. </el-select>
  964. </el-form-item>
  965. </el-form>
  966. <div slot="footer" class="dialog-footer">
  967. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="listLoading">{{$t('export.export')}}</el-button>
  968. </div>
  969. </el-dialog>
  970. <!--导出报表条件选择 -->
  971. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  972. <el-form ref="form3" :model="exportParam" >
  973. <el-form-item prop="range" :label="$t('time.dateRange')">
  974. <el-date-picker
  975. v-model="exportParam.dateRange" :editable="false"
  976. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  977. :clearable="true"
  978. :range-separator="$t('other.to')"
  979. type="daterange"
  980. :start-placeholder="$t('time.startDate')"
  981. :end-placeholder="$t('time.endDate')"
  982. ></el-date-picker>
  983. </el-form-item>
  984. </el-form>
  985. <div slot="footer" class="dialog-footer">
  986. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  987. </div>
  988. </el-dialog>
  989. <!--人员列表 -->
  990. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  991. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  992. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  993. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  994. <el-table-column type="selection"></el-table-column>
  995. <el-table-column prop="label" :label="$t('lable.name')" >
  996. <template slot-scope="scope">
  997. <span>
  998. <!-- {{(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}} -->
  999. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1000. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1001. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1002. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1003. </span>
  1004. <span v-else>
  1005. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1006. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1007. </span>
  1008. </span>
  1009. </template>
  1010. </el-table-column>
  1011. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1012. <template slot-scope="scope">
  1013. <div>
  1014. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1015. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1016. </div>
  1017. </template>
  1018. </el-table-column>
  1019. </el-table>
  1020. </el-tab-pane>
  1021. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1022. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1023. <el-table-column prop="label" :label="$t('lable.name')" >
  1024. <template slot-scope="scope">
  1025. <!-- <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> -->
  1026. <!-- <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> -->
  1027. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1028. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1029. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1030. <span>{{scope.row.leaveDays ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1031. </span>
  1032. <span v-else>
  1033. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1034. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1035. </span>
  1036. </template>
  1037. </el-table-column>
  1038. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1039. <template slot-scope="scope">
  1040. <div>
  1041. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1042. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1043. </div>
  1044. </template>
  1045. </el-table-column>
  1046. </el-table>
  1047. </el-tab-pane>
  1048. </el-tabs>
  1049. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1050. <el-table-column type="selection"></el-table-column>
  1051. <el-table-column prop="label" :label="$t('lable.name')" >
  1052. <template slot-scope="scope">
  1053. <div>
  1054. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1055. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1056. </div>
  1057. </template>
  1058. </el-table-column>
  1059. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1060. <template slot-scope="scope">
  1061. <div>
  1062. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1063. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1064. </div>
  1065. </template>
  1066. </el-table-column>
  1067. </el-table>
  1068. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1069. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1070. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1071. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1072. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1073. </div>
  1074. </el-dialog>
  1075. <!-- 按部门选择人员 -->
  1076. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1077. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1078. <div class="tree" style="height:400px">
  1079. <el-scrollbar style="height:100%">
  1080. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id"
  1081. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1082. highlight-current :filter-node-method="filterNode">
  1083. <span class="custom-tree-node" slot-scope="{ node, data }">
  1084. <span v-if="user.userNameNeedTranslate == '1'">
  1085. <span v-if="node.data.children">
  1086. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  1087. </span>
  1088. <span v-else>
  1089. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  1090. </span>
  1091. </span>
  1092. <span v-if="user.userNameNeedTranslate != '1'">
  1093. {{ node.label }}
  1094. </span>
  1095. </span>
  1096. </el-tree>
  1097. </el-scrollbar>
  1098. </div>
  1099. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1100. <div slot="footer" class="dialog-footer">
  1101. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1102. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1103. </div>
  1104. </el-dialog>
  1105. <el-dialog
  1106. v-if="monthWorkTimeDialog"
  1107. :visible.sync="monthWorkTimeDialog"
  1108. :close-on-click-modal="false"
  1109. customClass="customWidth selectworktime"
  1110. width="63%"
  1111. title=""
  1112. >
  1113. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1114. <el-tabs v-model="activeName" @tab-click="handleClick">
  1115. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1116. <div class="selectworktime_export" style="margin-top:10px;">
  1117. <div class="selectworktime_export_l">
  1118. <el-date-picker
  1119. class="selecteworktime_datapick"
  1120. v-model="WorktimeDatepickValue"
  1121. value-format="yyyy-MM-dd"
  1122. type="daterange"
  1123. align="right"
  1124. unlink-panels
  1125. :range-separator="$t('other.to')"
  1126. :start-placeholder="$t('time.startDate')"
  1127. :end-placeholder="$t('time.endDate')"
  1128. :default-time="['12:00:00', '12:00:00']"
  1129. size="small"
  1130. popper-class="selecteorktime_datapick_popper"
  1131. @change="showMonthWorkTime()"
  1132. >
  1133. </el-date-picker>
  1134. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1135. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1136. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1137. <!-- 222 -->
  1138. </div>
  1139. <div>
  1140. <el-input style="float:left;width:22%" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1141. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1142. </el-input>
  1143. </div>
  1144. <el-link
  1145. type="primary"
  1146. style="float: right; vertical-align: middle;height:32px"
  1147. @click="exportMembWorkHours()"
  1148. >{{$t('export.exportData')}}</el-link
  1149. >
  1150. </div>
  1151. <el-table ref="hasworkTbl"
  1152. :data="monthWorkDataS"
  1153. v-el-table-infinite-scroll="listScroll"
  1154. border
  1155. :height="500"
  1156. highlight-current-row
  1157. style="width: 100%"
  1158. v-loading="tbload"
  1159. :lazy="true"
  1160. >
  1161. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1162. <template slot-scope="scope">
  1163. {{ scope.$index + 1 }}
  1164. </template>
  1165. </el-table-column>
  1166. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1167. <template slot-scope="scope">
  1168. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1169. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1170. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1171. <!-- {{scope.row.name}} -->
  1172. </span>
  1173. </template>
  1174. </el-table-column>
  1175. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1176. <template slot-scope="scope">
  1177. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1178. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1179. </template>
  1180. </el-table-column>
  1181. <el-table-column
  1182. min-width="105"
  1183. v-for="(item, index) in pickDateArray"
  1184. :key="index"
  1185. :label="item.label"
  1186. align="center"
  1187. >
  1188. <template slot-scope="scope">
  1189. <div
  1190. style="color: red"
  1191. v-if="
  1192. scope.row.worktimeList.filter(
  1193. (w) =>
  1194. w.createDate==item.date
  1195. ).length > 0 &&
  1196. scope.row.worktimeList.filter(
  1197. (w) =>w.createDate==item.date
  1198. )[0].workingTime < reportTimeType.allday
  1199. "
  1200. >
  1201. {{
  1202. scope.row.worktimeList.filter(
  1203. (w) =>w.createDate==item.date
  1204. )[0].workingTime.toFixed(1)
  1205. }}
  1206. </div>
  1207. <div
  1208. style="color: #20a0ff"
  1209. v-if="
  1210. scope.row.worktimeList.filter(
  1211. (w) =>w.createDate==item.date
  1212. ).length > 0 &&
  1213. scope.row.worktimeList.filter(
  1214. (w) =>w.createDate==item.date
  1215. )[0].workingTime > reportTimeType.allday
  1216. "
  1217. >
  1218. {{
  1219. scope.row.worktimeList.filter(
  1220. (w) =>w.createDate==item.date
  1221. )[0].workingTime.toFixed(1)
  1222. }}
  1223. </div>
  1224. <div
  1225. v-if="
  1226. scope.row.worktimeList.filter(
  1227. (w) =>w.createDate==item.date
  1228. ).length > 0 &&
  1229. scope.row.worktimeList.filter(
  1230. (w) =>w.createDate==item.date
  1231. )[0].workingTime == reportTimeType.allday
  1232. "
  1233. >
  1234. {{
  1235. scope.row.worktimeList.filter(
  1236. (w) =>w.createDate==item.date
  1237. )[0].workingTime
  1238. }}
  1239. </div>
  1240. <div
  1241. v-if="
  1242. scope.row.worktimeList.filter(
  1243. (w) =>w.createDate==item.date
  1244. ).length == 0
  1245. "
  1246. >
  1247. 0
  1248. </div>
  1249. <div
  1250. v-if="
  1251. scope.row.worktimeList.filter(
  1252. (w) =>w.createDate==item.date
  1253. ).length > 0 &&
  1254. typeof scope.row.worktimeList.filter(
  1255. (w) =>w.createDate==item.date
  1256. )[0].workingTime == 'string'
  1257. "
  1258. >
  1259. {{
  1260. scope.row.worktimeList.filter(
  1261. (w) =>w.createDate==item.date
  1262. )[0].workingTime
  1263. }}
  1264. </div>
  1265. </template>
  1266. </el-table-column>
  1267. </el-table>
  1268. <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>
  1269. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1270. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1271. <label style="font-size: 16px">员工每日已填报工时数</label>
  1272. <el-link
  1273. type="primary"
  1274. style="float: right; margin-right: 60px"
  1275. @click="exportMembWorkHours()"
  1276. >导出已填报数据</el-link
  1277. > -->
  1278. <!-- <el-button >导出</el-button> -->
  1279. <!-- </div> -->
  1280. </el-tab-pane>
  1281. <el-tab-pane :label="$t('other.unfilledPersonList')" name="second" >
  1282. <div class="selectworktime_export" style="margin-top:10px">
  1283. <div class="selectworktime_export_l">
  1284. <el-date-picker
  1285. class="selecteworktime_datapick"
  1286. v-model="WorktimeDatepickValue"
  1287. value-format="yyyy-MM-dd"
  1288. type="daterange"
  1289. align="right"
  1290. unlink-panels
  1291. :range-separator="$t('other.to')"
  1292. :start-placeholder="$t('time.startDate')"
  1293. :end-placeholder="$t('time.endDate')"
  1294. :default-time="['12:00:00', '12:00:00']"
  1295. size="small"
  1296. popper-class="selecteorktime_datapick_popper"
  1297. @change="showMonthNotWorkTime()"
  1298. >
  1299. </el-date-picker>
  1300. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1301. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1302. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1303. </div>
  1304. <div>
  1305. <el-input style="float:left;width:22%" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1306. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1307. </el-input>
  1308. </div>
  1309. <el-link
  1310. type="primary"
  1311. style="float: right; vertical-align: middle;height:32px"
  1312. @click="exportMembNotWorkHours()"
  1313. >{{$t('export.exportData')}}</el-link
  1314. >
  1315. </div>
  1316. <el-table
  1317. ref="hasworkTbl2"
  1318. :data="monthNotWorkDateS"
  1319. v-el-table-infinite-scroll="notListScroll"
  1320. border
  1321. :height="500"
  1322. highlight-current-row
  1323. style="width: 100%"
  1324. v-loading="tbload"
  1325. lazy
  1326. >
  1327. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1328. <template slot-scope="scope">
  1329. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.department'></ww-open-data></span>
  1330. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1331. </template>
  1332. </el-table-column>
  1333. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1334. <template slot-scope="scope">
  1335. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1336. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1337. </template>
  1338. </el-table-column>
  1339. <el-table-column
  1340. min-width="200"
  1341. :label="$t('weekDay.date')"
  1342. align="center"
  1343. prop="createDate"
  1344. >
  1345. </el-table-column>
  1346. <el-table-column
  1347. min-width="200"
  1348. :label="$t('state.states')"
  1349. align="center"
  1350. prop="status"
  1351. />
  1352. <el-table-column
  1353. min-width="200"
  1354. :label="$t('other.attendanceData')"
  1355. prop="cardTime"
  1356. align="center"
  1357. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1358. </el-table>
  1359. <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>
  1360. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1361. </el-tab-pane>
  1362. </el-tabs>
  1363. </el-dialog>
  1364. <!--驳回弹出框 -->
  1365. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1366. <div>
  1367. <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')" />
  1368. </div>
  1369. <div slot="footer" class="dialog-footer">
  1370. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1371. <el-button type="primary" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1372. </div>
  1373. </el-dialog>
  1374. <!-- 通过弹出框 -->
  1375. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1376. <div>
  1377. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1378. </div>
  1379. <div slot="footer" class="dialog-footer">
  1380. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1381. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1382. </div>
  1383. </el-dialog>
  1384. <!--批量导入日报 -->
  1385. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1386. <p>1. {{$t('other.download')}}
  1387. <el-link type="primary" style="margin-left:5px;" :underline="false" :href="'./upload/'+$t('template.EmployeeHoursStatisticsTemplate')+'2.xlsx'" :download="$t('template.EmployeeTimeImportTemplate')+'.xlsx'">{{$t('template.EmployeeHoursStatisticsTemplate') + '.xlsx'}}</el-link>
  1388. </p>
  1389. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1390. <p style="display: flex;justify-content: center;">
  1391. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1392. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1393. </el-upload>
  1394. </p>
  1395. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1396. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1397. </div>
  1398. </el-dialog>
  1399. <!-- 工时导入记录弹窗 -->
  1400. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1401. <div style="height: 452px">
  1402. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1403. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1404. <el-table-column prop="userName" :label="$t('other.operator')">
  1405. <template slot-scope="scope">
  1406. <div>
  1407. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.userName'></ww-open-data></span>
  1408. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1409. </div>
  1410. </template>
  1411. </el-table-column>
  1412. <el-table-column prop="datel" :label="$t('other.document')">
  1413. <template slot-scope="scope">
  1414. <div>
  1415. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1416. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1417. </div>
  1418. </template>
  1419. </el-table-column>
  1420. </el-table>
  1421. <el-col :span="24" class="paginatis">
  1422. <el-pagination
  1423. @size-change="handleSizeChange"
  1424. @current-change="handleCurrentChange"
  1425. :page-sizes="[20 , 50 , 80 , 100]"
  1426. :page-size="20"
  1427. layout="total, sizes, prev, pager, next"
  1428. :total="toViewForm.total"
  1429. style="float:right;"
  1430. ></el-pagination>
  1431. </el-col>
  1432. </div>
  1433. </el-dialog>
  1434. <!--基于企业微信考勤数据的工时导入 -->
  1435. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1436. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1437. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1438. </el-step>
  1439. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1440. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1441. </el-steps>
  1442. <div v-if="active==0" style="padding:30px;height:360px;">
  1443. <div style="margin-top:50px;margin-left:280px;">
  1444. <el-date-picker
  1445. v-model="importWxParam.date" :editable="false"
  1446. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1447. :clearable="true"
  1448. :range-separator="$t('other.to')"
  1449. type="daterange"
  1450. :start-placeholder="$t('time.startDate')"
  1451. :end-placeholder="$t('time.endDate')"
  1452. @change="loadCheckInData"
  1453. ></el-date-picker>
  1454. </div>
  1455. </div>
  1456. <div v-if="active==1" style="padding:10px;">
  1457. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1458. style="width: 100%;margin-top:5px;" >
  1459. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1460. <template slot-scope="scope">
  1461. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1462. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1463. </template>
  1464. </el-table-column>
  1465. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1466. </el-table-column>
  1467. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1468. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1469. <template slot-scope="scope">
  1470. <div>
  1471. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1472. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1473. </div>
  1474. </template>
  1475. </el-table-column>
  1476. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1477. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1478. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1479. <template slot-scope="scope">
  1480. {{scope.row.workHours.toFixed(1)}}h
  1481. </template>
  1482. </el-table-column>
  1483. </el-table>
  1484. </div>
  1485. <div v-if="active==2" >
  1486. <p style="display: flex;justify-content: center;height:390px;">
  1487. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1488. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1489. </el-upload>
  1490. </p>
  1491. </div>
  1492. <div slot="title">
  1493. <span style="font-size:16px;">{{$t('other.Batchimportofworkinghours')}}</span>
  1494. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1495. </div>
  1496. <span slot="footer">
  1497. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1498. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1499. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1500. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1501. </span>
  1502. </el-dialog>
  1503. <!--工时批量代填 -->
  1504. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  1505. <div>
  1506. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1507. v-model="importWxParam.date" :editable="false"
  1508. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1509. :clearable="true"
  1510. :range-separator="$t('other.to')"
  1511. type="daterange"
  1512. :start-placeholder="$t('time.startDate')"
  1513. :end-placeholder="$t('time.endDate')"
  1514. @change="loadCheckInData"
  1515. ></el-date-picker>
  1516. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  1517. </div>
  1518. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  1519. :key="timeStamp"
  1520. style="width: 100%;margin-top:5px;" ref="tab">
  1521. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  1522. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  1523. <template slot-scope="scope">
  1524. <div>
  1525. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1526. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1527. </div>
  1528. </template>
  1529. </el-table-column>
  1530. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  1531. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  1532. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  1533. <template slot-scope="scope">
  1534. {{scope.row.workHours.toFixed(1)}}h
  1535. </template>
  1536. </el-table-column>
  1537. <!--项目名称列表 -->
  1538. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  1539. <template slot-scope="scope">
  1540. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  1541. </template>
  1542. </el-table-column>
  1543. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  1544. <template slot-scope="scope">
  1545. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  1546. </template>
  1547. </el-table-column>
  1548. </el-table>
  1549. </el-dialog>
  1550. <!--基于企业微信考勤数据的工时导入 -->
  1551. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  1552. <div>
  1553. <span>{{importResultMsg}}</span>
  1554. </div>
  1555. <!-- <span slot="footer" class="dialog-footer">
  1556. <el-button type="primary" @click="showImportResult=false">{{$t('btn.submit')}}</el-button>
  1557. </span> -->
  1558. </el-dialog>
  1559. <!-- 审核流程展示 -->
  1560. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  1561. <div style="padding:20px 40px 20px 0">
  1562. <el-timeline :reverse="false">
  1563. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">{{item.msg}}</el-timeline-item>
  1564. </el-timeline>
  1565. </div>
  1566. </el-dialog>
  1567. </section>
  1568. </template>
  1569. <script>
  1570. // 左右滑动
  1571. import dragMixin from "@/common/js/tensile.js";
  1572. import util from "../../common/js/util";
  1573. // 自定义select组件
  1574. import selectCat from "@/components/select.vue"
  1575. // 引入自定义级联组件
  1576. import vueCascader from "@/components/cascader.vue"
  1577. let _that = this
  1578. export default {
  1579. mixins: [dragMixin],
  1580. components: {
  1581. selectCat,
  1582. vueCascader
  1583. },
  1584. data() {
  1585. return {
  1586. today:null,
  1587. syncTimeLoading: false,
  1588. seluserText: '',
  1589. translation: '1', // 1、文字, 2、部门, 3、人员
  1590. exportLoad: false,
  1591. getPickerOptions: {
  1592. disabledDate: (time) => {
  1593. var date = new Date();
  1594. var year = date.getFullYear();
  1595. var month = date.getMonth() + 1;
  1596. if (month >= 1 && month <= 9) {
  1597. month = "0" + month;
  1598. }
  1599. var currentdate = year.toString() + month.toString();
  1600. var timeyear = time.getFullYear();
  1601. var timemonth = time.getMonth() + 1;
  1602. if (timemonth >= 1 && timemonth <= 9) {
  1603. timemonth = "0" + timemonth;
  1604. }
  1605. var timedate = timeyear.toString() + timemonth.toString();
  1606. if(this.user.timeType.fillAhead == 0){
  1607. return currentdate < timedate;
  1608. }else{
  1609. return false
  1610. }
  1611. }
  1612. },
  1613. alalal: '8.0',
  1614. timeBasecostList:null,
  1615. tbload: false,
  1616. exportTimeDialog: false,
  1617. searchKeyword: '',
  1618. monthWorkDataS: [],
  1619. monthNotWorkDateS: [],
  1620. pickDateArray:[],
  1621. WorktimeDatepickValue: [],
  1622. activeName:"first",
  1623. isLeave: 0,
  1624. submitingReport: false,
  1625. importResultMsg:null,
  1626. showImportResult:false,
  1627. importingData: false,
  1628. isDraft: 0,
  1629. timeStamp: 0,
  1630. projectColumns:[],
  1631. checkinLoading:false,
  1632. importWxParam:{date:null,},
  1633. active:0,
  1634. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  1635. importWxDialog:false,
  1636. importDialog:false,
  1637. denyForm:null,
  1638. denyReasonDialog:false,
  1639. monthWorkTimeDialog: false,
  1640. isSubstitude:false,
  1641. isFill:false,
  1642. unFillList:[],
  1643. fillList:[],
  1644. fillMembList:[],
  1645. fillMembList_leave: [],
  1646. membListVisible: false,
  1647. isBatch:0,//是否是批量填报
  1648. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  1649. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  1650. 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')],
  1651. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  1652. fillStatusList: [],
  1653. exportParam:{projectId: null, dateRange:[], departmentId: null},
  1654. exportDialog:false,
  1655. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  1656. subProjectList:[],
  1657. canEdit: true,
  1658. timeRange:[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],
  1659. selectTime:null,
  1660. reportTimeType:{},
  1661. curDate:'',
  1662. isAllSelect: false,
  1663. approveDialogVisible:false,
  1664. deptId:null,
  1665. targetUid: null,
  1666. membCount:0,
  1667. selectState:"-1",
  1668. user: JSON.parse(sessionStorage.getItem("user")),
  1669. allUsersList: [],
  1670. showAddMore:false,
  1671. allDate: [],
  1672. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  1673. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  1674. choseDay: 0,
  1675. tableHeight: 0,
  1676. listLoading: false,
  1677. projectList: [], //项目列表
  1678. fillProjectList: [],
  1679. reportList: [], //日报列表
  1680. reportNames:[], //批量审批列表
  1681. selCon:[], //筛选条件
  1682. selProjectList:[], //筛选后项目列表
  1683. selConShow: true,
  1684. dialogVisible: false, //项目弹窗
  1685. report: '',
  1686. workForm: {
  1687. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  1688. domains: [{
  1689. id: null,
  1690. projectId: "",
  1691. workingTime: "",
  1692. timeType:0,
  1693. content: "",
  1694. state: 2,
  1695. multiWorktime:0,
  1696. worktimeList:[],
  1697. degreeId: null,
  1698. auditUserList: []
  1699. }],
  1700. },
  1701. workRules: {
  1702. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  1703. },
  1704. chooseParticipVisible: false,
  1705. logining: false,
  1706. isDisable: false,
  1707. timeType:[],
  1708. deptMembData: [
  1709. ],
  1710. //部门人员树状结构
  1711. data: [
  1712. {
  1713. id: -1,
  1714. label: this.$t('lable.allStaff'),
  1715. membCount:0
  1716. },
  1717. {
  1718. id: 0,
  1719. label: this.$t('lable.unassigned'),
  1720. }
  1721. ],
  1722. allData:{},
  1723. batchShowData:{},
  1724. option: [],
  1725. depData: {
  1726. id: -1,
  1727. label: this.$t('lable.allStaff'),
  1728. },
  1729. defaultProps: {
  1730. children: 'children',
  1731. label: 'label'
  1732. },
  1733. isNew: false,
  1734. selected: false,
  1735. valuet: new Date(),
  1736. domObj: null,
  1737. participator:[],
  1738. chosenMembCount:0,
  1739. jsDay: 0,
  1740. jsTime: 0,
  1741. falsss: false,
  1742. weidu: [],
  1743. weiduList: [],
  1744. yonghuUser: [],
  1745. dateAr: [],
  1746. batchSubFillDialog: false,
  1747. isSubstiS: false,
  1748. diasZho: false,
  1749. zhoData: [],
  1750. zhoRqi: [],
  1751. btnZho: false,
  1752. zhoLoading: false,
  1753. changdu: 6,
  1754. tianxieDialogVisible: false,
  1755. scopess: {},
  1756. zhoBao: {
  1757. time: '',
  1758. workingTime: '',
  1759. progress: '',
  1760. con: '',
  1761. subProjectId: '',
  1762. stage: '',
  1763. subProjectList: [],
  1764. stages: [],
  1765. },
  1766. zhoBaoIdx: '',
  1767. zhoBaoName: '',
  1768. zhis: {},
  1769. dealList: [],
  1770. toViewDialogVisible: false,
  1771. toViewList: [],
  1772. toViewloading: true,
  1773. toViewForm: {
  1774. pageIndex: '1',
  1775. pageSize: '20',
  1776. total: 0,
  1777. },
  1778. toViewloadings: false,
  1779. tabPositionss: 'top',
  1780. monthTotal: 0,
  1781. monthTotalPage: 0,
  1782. monthTotalLages: 20,
  1783. monthWorkData: [],
  1784. monthNotWorkDate: [],
  1785. monthWorkDataS1: [],
  1786. monthnotTotal: 0,
  1787. monthnotTotalPage: 0,
  1788. monthnotTotalLages: 20,
  1789. monthNotWorkDateS1: [],
  1790. deptMembDataText: '',
  1791. isFlag: false,
  1792. isMore: false,
  1793. stateKey: '0',
  1794. expandDate: [],
  1795. notifySelList:[],
  1796. departmentList: [],
  1797. approvalProcessDialog: false,
  1798. approvalProcessData: [],
  1799. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  1800. 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')],
  1801. isWeekend: false,
  1802. canCancelInDialog: false,
  1803. approveinData: {},
  1804. approveinDialog: false,
  1805. reportCanDelete: false,
  1806. weeklyFilledTimeDialog: false,
  1807. weeklyFilledTimeList: [],
  1808. weeklyFilledTimeLoading: false,
  1809. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  1810. weeklyFilledTimeCanDelete: false,
  1811. weeklyFilledTimeDate: null,
  1812. leaveAllNum: 0
  1813. };
  1814. },
  1815. watch: {
  1816. deptMembDataText(val) {
  1817. this.$refs.chooseMembTree.filter(val);
  1818. }
  1819. },
  1820. filters: {
  1821. // 过滤
  1822. amounts(value) {
  1823. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  1824. return 0
  1825. }
  1826. var zhi = +value + 0
  1827. return zhi.toFixed(1)
  1828. },
  1829. // zhoData
  1830. zhoData(value, arr) {
  1831. var dateArray = value.split("-");
  1832. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  1833. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  1834. // console.log(arr[date.getDay()])
  1835. // return "周" + "日一二三四五六".charAt(date.getDay());
  1836. return arr[date.getDay()]
  1837. },
  1838. // 过滤数字
  1839. numbers(value) {
  1840. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  1841. return 0
  1842. }
  1843. return value
  1844. },
  1845. },
  1846. computed: {
  1847. totalReportHours(){
  1848. let domains = this.workForm.domains
  1849. let hours = 0
  1850. for(let i in domains){
  1851. if(domains[i].projectId){
  1852. if(this.reportTimeType.multiWorktime == 1){
  1853. for(let m in domains[i].worktimeList){
  1854. if(domains[i].worktimeList[m].startTime && domains[i].worktimeList[m].endTime){
  1855. hours += this.getHour(domains[i].worktimeList[m].startTime, domains[i].worktimeList[m].endTime)
  1856. }
  1857. }
  1858. }else{
  1859. if(this.user.timeType.type == 2){
  1860. if(domains[i].startTime && domains[i].endTime){
  1861. hours += this.getHour(domains[i].startTime, domains[i].endTime)
  1862. }
  1863. }else{
  1864. hours += domains[i].workingTime ? parseFloat(domains[i].workingTime) : 0
  1865. }
  1866. }
  1867. }
  1868. }
  1869. return hours.toFixed(1)
  1870. },
  1871. },
  1872. mounted() {
  1873. var now = new Date();
  1874. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  1875. this.today = t;
  1876. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  1877. this.exportParam.dateRange = [startStr,t];
  1878. this.getAllDate(1);
  1879. this.getReportList();
  1880. this.getProjectList();
  1881. this.getFillProjectList();
  1882. this.getTimeType();
  1883. this.getDepartment();
  1884. this.scrollFunction()
  1885. this.userssHu();
  1886. if(this.user.timeType.reportAuditType == 3){
  1887. this.getAllUsersList()
  1888. }
  1889. if (this.user.company.packageProject == 1) {
  1890. this.getBasecostItemList();
  1891. }
  1892. if(this.user.timeType.lockWorktime){
  1893. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  1894. }
  1895. },
  1896. methods: {
  1897. test(){
  1898. console.log('test',this.workForm.domains);
  1899. },
  1900. getHour(s1, s2) {
  1901. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  1902. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  1903. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  1904. var ms = s2.getTime() - s1.getTime();
  1905. if (ms < 0) return 0;
  1906. let ma = ms / 1000 / 60 / 60
  1907. return ma; //小时
  1908. },
  1909. refreshWXCardTime(workdate) {
  1910. if (!workdate) return;
  1911. this.syncTimeLoading = true;
  1912. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  1913. date: workdate,
  1914. },res => {
  1915. this.syncTimeLoading = false;
  1916. if(res.code == 'ok'){
  1917. this.workForm.time = res.data.time;
  1918. }else {
  1919. this.$message({
  1920. message: res.msg,
  1921. type: 'error'
  1922. })
  1923. }
  1924. },err => {
  1925. this.syncTimeLoading = false;
  1926. this.$message({
  1927. message: err,
  1928. type: 'error'
  1929. })
  1930. })
  1931. },
  1932. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  1933. this.weeklyFilledTimeDialog = true
  1934. this.weeklyFilledTimeLoading = true
  1935. this.weeklyFilledTimeDate = parameterDate
  1936. this.http.post('/report/getReportList',{
  1937. date: parameterDate,
  1938. userId: this.user.id
  1939. },res => {
  1940. this.weeklyFilledTimeLoading = false
  1941. if(res.code == 'ok'){
  1942. this.weeklyFilledTimeList = res.data[0].data
  1943. let candelete = true
  1944. for(let i in this.weeklyFilledTimeList){
  1945. if(this.weeklyFilledTimeList[i].state < 2){
  1946. candelete = false
  1947. }
  1948. }
  1949. this.weeklyFilledTimeCanDelete = candelete
  1950. }else {
  1951. this.$message({
  1952. message: res.msg,
  1953. type: 'error'
  1954. })
  1955. }
  1956. },err => {
  1957. this.weeklyFilledTimeLoading = false
  1958. this.$message({
  1959. message: err,
  1960. type: 'error'
  1961. })
  1962. })
  1963. },
  1964. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  1965. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  1966. confirmButtonText: this.$t('btn.determine'),
  1967. cancelButtonText: this.$t('btn.cancel'),
  1968. type: "warning"
  1969. })
  1970. .then(() => {
  1971. this.http.post('/report/delete',{
  1972. userId: this.user.id,
  1973. date: this.weeklyFilledTimeDate
  1974. },res => {
  1975. if (res.code == "ok") {
  1976. this.$message({
  1977. message: this.$t('message.successfullyDeleted'),
  1978. type: "success"
  1979. });
  1980. this.getWeeklyWorkTime()
  1981. this.getReportList();
  1982. this.getDepartment();
  1983. this.weeklyFilledTimeDialog = false;
  1984. } else {
  1985. this.$message({
  1986. message: res.msg,
  1987. type: "error"
  1988. });
  1989. }
  1990. },error => {
  1991. this.$message({
  1992. message: error,
  1993. type: "error"
  1994. });
  1995. }
  1996. );
  1997. }).catch(() => {});
  1998. },
  1999. getApprovalProcess(item){
  2000. // console.log('this.date',this.choseDate);
  2001. this.http.post('/report-log/get',{
  2002. creatorId: item.id,
  2003. createDate: sessionStorage.msg
  2004. },res => {
  2005. if(res.code == 'ok'){
  2006. this.approvalProcessDialog = true
  2007. this.approvalProcessData = res.data
  2008. }else{
  2009. this.$message({
  2010. message: res.msg,
  2011. type: 'error'
  2012. })
  2013. }
  2014. },err => {
  2015. this.$message({
  2016. message: err,
  2017. type: 'error'
  2018. })
  2019. })
  2020. },
  2021. filterNode(value, data) {
  2022. if (!value) return true;
  2023. return data.label.indexOf(value) !== -1;
  2024. },
  2025. triggerCalculateOT(index) {
  2026. var str = this.workForm.domains[index].overtimeHours + ''
  2027. if(str.indexOf('.') != '-1') {
  2028. var s = str.split('.')[0]
  2029. var st = str.split('.')[1]
  2030. var sts = st.split('')
  2031. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  2032. }
  2033. },
  2034. searchScreen(e){
  2035. if(e){
  2036. this.monthNotWorkDateS1 = []
  2037. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  2038. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  2039. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  2040. }
  2041. }
  2042. if (this.monthNotWorkDateS1.length > 50) {
  2043. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  2044. }else{
  2045. this.monthNotWorkDateS = this.monthNotWorkDateS1
  2046. }
  2047. // if (this.monthNotWorkDateS1.length > 0) {
  2048. // setTimeout(() => {
  2049. // this.tableListenernot()
  2050. // }, 1000);
  2051. // }
  2052. }else{
  2053. this.monthWorkDataS1 = []
  2054. for (let i = 0; i < this.monthWorkData.length; i++) {
  2055. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  2056. this.monthWorkDataS1.push(this.monthWorkData[i])
  2057. }
  2058. }
  2059. if (this.monthWorkDataS1.length > 50) {
  2060. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  2061. }else{
  2062. this.monthWorkDataS = this.monthWorkDataS1
  2063. }
  2064. // if (this.monthWorkDataS1.length > 0) {
  2065. // setTimeout(() => {
  2066. // this.tableListener()
  2067. // }, 1000);
  2068. // }
  2069. }
  2070. },
  2071. addUpload(data) {
  2072. // var zhi = data.fileName.split('.')[0]
  2073. // var sss = zhi + '.xlsx'
  2074. // return
  2075. var filePath = '/upload/' + data.serverName;
  2076. const a = document.createElement('a'); // 创建a标签
  2077. a.setAttribute('download', data.fileName);// download属性
  2078. a.setAttribute('href', filePath);// href链接
  2079. a.click(); //自执行点击事件
  2080. a.remove();
  2081. },
  2082. restrictNumber(targetId) {
  2083. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  2084. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  2085. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  2086. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  2087. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  2088. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  2089. inpu.value = parseFloat(inpu.value);
  2090. }
  2091. },
  2092. //获取项目下的任务分组
  2093. getTaskGroups(domain, index) {
  2094. domain.groupId=null;
  2095. this.http.post('/task-group/listMyJoinGroup',{
  2096. projectId: domain.projectId,
  2097. isSubstitude: this.isSubstitude ? 1 : 0
  2098. },
  2099. res => {
  2100. if (res.code == "ok") {
  2101. this.workForm.domains[index].taskGroups = res.data;
  2102. this.$forceUpdate();
  2103. }
  2104. },
  2105. error => {
  2106. this.$message({
  2107. message: error,
  2108. type: "error"
  2109. });
  2110. }
  2111. );
  2112. },
  2113. //下载带企业微信考勤数据的工时统计模板
  2114. downloadCheckInExcel() {
  2115. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  2116. startDate: this.importWxParam.date[0],
  2117. endDate: this.importWxParam.date[1],
  2118. },
  2119. res => {
  2120. if (res.code == "ok") {
  2121. var filePath = res.data;
  2122. const a = document.createElement('a'); // 创建a标签
  2123. var data = filePath.split("/");
  2124. a.setAttribute('download', data[data.length-1]);// download属性
  2125. a.setAttribute('href', filePath);// href链接
  2126. a.click(); //自执行点击事件
  2127. a.remove();
  2128. } else {
  2129. this.$message({
  2130. message: res.msg,
  2131. type: "error"
  2132. });
  2133. }
  2134. },
  2135. error => {
  2136. this.checkinLoading = false;
  2137. this.$message({
  2138. message: error,
  2139. type: "error"
  2140. });
  2141. }
  2142. );
  2143. },
  2144. pre() {
  2145. if (this.active == 0) return;
  2146. this.active--;
  2147. },
  2148. next() {
  2149. this.active++;
  2150. },
  2151. triggerTotalTime(index) {
  2152. var item = this.checkinList[index];
  2153. var total = 0.0;
  2154. for (var i=0;i<this.projectColumns.length; i++) {
  2155. var key = this.projectColumns[i];
  2156. if (item[key] != null && item[key] != '') {
  2157. total += parseFloat(item[key]);
  2158. }
  2159. }
  2160. item.totalFillTime = total;
  2161. },
  2162. //提交批量代填的数据
  2163. submitBatchSubFillData() {
  2164. var data = JSON.stringify(this.checkinList);
  2165. this.http.post('/user-corpwx-time/submitProjectTime',{
  2166. json: data,
  2167. projectColumns: JSON.stringify(this.projectColumns)
  2168. },
  2169. res => {
  2170. if (res.code == "ok") {
  2171. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  2172. this.importWxDialog = false;
  2173. }
  2174. },
  2175. error => {
  2176. this.checkinLoading = false;
  2177. this.$message({
  2178. message: error,
  2179. type: "error"
  2180. });
  2181. }
  2182. );
  2183. },
  2184. loadCheckInData() {
  2185. if (this.importWxParam.date == null) {
  2186. this.checkinList = [];
  2187. return;
  2188. }
  2189. this.checkinLoading = true;
  2190. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  2191. startDate: this.importWxParam.date[0],
  2192. endDate: this.importWxParam.date[1],
  2193. },
  2194. res => {
  2195. if (res.code == "ok") {
  2196. this.checkinLoading = false;
  2197. this.checkinList = res.data.list;
  2198. this.projectColumns = res.data.projects;
  2199. // 自定义表格会导致表格错乱,需重新计算表格
  2200. this.$nextTick(()=>{
  2201. this.$refs.tab.doLayout()
  2202. })
  2203. }
  2204. },
  2205. error => {
  2206. this.checkinLoading = false;
  2207. this.$message({
  2208. message: error,
  2209. type: "error"
  2210. });
  2211. }
  2212. );
  2213. },
  2214. batchImportWxData(item) {
  2215. //首先判断文件类型
  2216. let str = item.file.name.split(".");
  2217. let format = str[str.length - 1];
  2218. if (format != "xls" && format != "xlsx") {
  2219. this.$message({
  2220. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  2221. type: "error"
  2222. });
  2223. } else {
  2224. this.importingData = true;
  2225. let formData = new FormData();
  2226. formData.append("file", item.file);
  2227. formData.append("companyId", this.user.companyId);
  2228. formData.append("withCheckIn", 1);
  2229. this.http.uploadFile('/report/importData', formData,
  2230. res => {
  2231. this.$refs.upload.clearFiles();
  2232. this.showImportResult = true;
  2233. this.importingData = false;
  2234. if (res.code == "ok") {
  2235. //换成弹出框,以免有人等了半天回来啥也没看到
  2236. this.importResultMsg = this.$t('other.successful') + ':' + this.$t('other.importSuccess') +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  2237. this.getReportList();
  2238. this.importWxDialog = false;
  2239. } else {
  2240. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  2241. }
  2242. },
  2243. error => {
  2244. this.$refs.upload.clearFiles();
  2245. this.listLoading = false;
  2246. this.$message({
  2247. message: error,
  2248. type: "error"
  2249. });
  2250. });
  2251. }
  2252. },
  2253. batchImportData(item) {
  2254. //首先判断文件类型
  2255. let str = item.file.name.split(".");
  2256. let format = str[str.length - 1];
  2257. if (format != "xls" && format != "xlsx") {
  2258. this.$message({
  2259. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  2260. type: "error"
  2261. });
  2262. } else {
  2263. this.importingData = true;
  2264. let formData = new FormData();
  2265. formData.append("file", item.file);
  2266. formData.append("companyId", this.user.companyId);
  2267. this.http.uploadFile('/report/importData', formData,
  2268. res => {
  2269. this.$refs.upload.clearFiles();
  2270. this.importingData = false;
  2271. this.showImportResult = true;
  2272. if (res.code == "ok") {
  2273. //换成弹出框,以免有人等了半天回来啥也没看到
  2274. this.importResultMsg = this.$t('other.importSuccess')+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  2275. this.getReportList();
  2276. this.importWXDialog = false;
  2277. } else {
  2278. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  2279. }
  2280. },
  2281. error => {
  2282. this.$refs.upload.clearFiles();
  2283. this.importingData = false;
  2284. this.$message({
  2285. message: error,
  2286. type: "error"
  2287. });
  2288. });
  2289. }
  2290. },
  2291. userssHu() {
  2292. this.http.post('/time-type/getCompanyTimeSetting',{
  2293. companyId: this.user.companyId
  2294. },
  2295. res => {
  2296. if (res.code == "ok") {
  2297. this.yonghuUser = res.data
  2298. }
  2299. },
  2300. error => {
  2301. this.$message({
  2302. message: error,
  2303. type: "error"
  2304. });
  2305. }
  2306. );
  2307. },
  2308. iptBlur(i) {
  2309. if(this.isBatch == 0) {
  2310. return
  2311. }
  2312. this.http.post('/report/getWorkDays',{
  2313. startDate: this.workForm.createDate[0],
  2314. endDate: this.workForm.createDate[1]
  2315. },
  2316. res => {
  2317. if (res.code == "ok") {
  2318. this.jsDay = res.data
  2319. this.chuji(i)
  2320. } else {
  2321. this.$message({
  2322. message: res.msg,
  2323. type: "error"
  2324. });
  2325. this.workForm.createDate = [];
  2326. }
  2327. },
  2328. error => {
  2329. this.$message({
  2330. message: error,
  2331. type: "error"
  2332. });
  2333. }
  2334. );
  2335. var sl = this.workForm.domains
  2336. this.chuji(i)
  2337. },
  2338. chuji(i) {
  2339. if(i == 0) {
  2340. this.seleChn(1)
  2341. } else if(i == 1) {
  2342. this.seleChn(0)
  2343. } else if(i == 2) {
  2344. if(this.workForm.domains[0].multiWorktime > 0) {
  2345. this.iptChangs()
  2346. } else {
  2347. this.iptChang()
  2348. }
  2349. } else if(i == 3) {
  2350. this.seleChn(0)
  2351. }
  2352. },
  2353. seleChn(e,domain) {
  2354. if(e == 1) {
  2355. for(var i in this.workForm.domains) {
  2356. if(this.workForm.domains[i].timeType == 0) {
  2357. this.workForm.domains[i].workingTime = 8
  2358. } else {
  2359. this.workForm.domains[i].workingTime = 4
  2360. }
  2361. }
  2362. }
  2363. var quanbu = 0
  2364. var spl = this.workForm.domains
  2365. var zhi = ''
  2366. for(var i in spl) {
  2367. var sp = +spl[i].workingTime + 0
  2368. zhi = this.jsDay * sp
  2369. quanbu = +quanbu + zhi
  2370. }
  2371. this.jsTime = quanbu
  2372. let worktime = this.jsTime
  2373. // 自动计算加班时长
  2374. if(this.isBatch != 0){
  2375. worktime = this.jsTime / this.jsDay
  2376. }
  2377. if(this.user.timeType.fillOvertime && domain){
  2378. let isover = false
  2379. let alltime = 0
  2380. let allover = 0 //此处alltime同上面的worktime
  2381. for(let d in spl){
  2382. if(spl[d].isOvertime){
  2383. isover = true
  2384. allover += spl[d].overtimeHours*1
  2385. }
  2386. alltime += spl[d].workingTime*1
  2387. }
  2388. if(domain.overtimeHours){
  2389. allover = allover - domain.overtimeHours
  2390. }
  2391. if(worktime*1 > this.user.timeType.allday){
  2392. if(isover){
  2393. if(alltime > (allover + this.user.timeType.allday)){
  2394. this.$set(domain,'isOvertime',true)
  2395. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  2396. }else{
  2397. this.$set(domain,'isOvertime',false)
  2398. this.$set(domain,'overtimeHours',null)
  2399. if(alltime < (allover + this.user.timeType.allday)){
  2400. let overtime = allover + this.user.timeType.allday - alltime
  2401. for(let pi in spl){
  2402. if(spl[pi].overtimeHours){
  2403. if((overtime - spl[pi].overtimeHours*1) > 0){
  2404. overtime = overtime - spl[pi].overtimeHours*1
  2405. this.$set(spl[pi],'isOvertime',false)
  2406. this.$set(spl[pi],'overtimeHours',null)
  2407. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  2408. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  2409. break
  2410. }else{
  2411. this.$set(spl[pi],'isOvertime',false)
  2412. this.$set(spl[pi],'overtimeHours',null)
  2413. break
  2414. }
  2415. }
  2416. }
  2417. }
  2418. }
  2419. }else{
  2420. this.$set(domain,'isOvertime',true)
  2421. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  2422. }
  2423. }else{
  2424. for(let di in spl){
  2425. this.$set(spl[di],'isOvertime',false)
  2426. this.$set(spl[di],'overtimeHours',null)
  2427. }
  2428. }
  2429. }
  2430. },
  2431. iptChang() {
  2432. var sl = this.workForm.domains
  2433. var quanbu = 0
  2434. var zhi = ''
  2435. for(var i in sl) {
  2436. if(sl[i].startTime && sl[i].endTime) {
  2437. var date2 = '2021/12/12 ' + sl[i].endTime +':00'
  2438. var date1 = '2021/12/12 ' + sl[i].startTime +':00'
  2439. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  2440. var leave1=date3%(24*3600*1000)
  2441. var hours=Math.floor(leave1/(3600*1000))
  2442. var leave2=leave1%(3600*1000)
  2443. var minutes=Math.floor(leave2/(60*1000))
  2444. var shi = hours+'.'+ minutes
  2445. var sll = +shi + 0
  2446. zhi = this.jsDay * sll
  2447. quanbu = +quanbu + zhi
  2448. }
  2449. }
  2450. this.jsTime = quanbu
  2451. },
  2452. iptChangs() {
  2453. var sl = this.workForm.domains
  2454. var quanbu = 0
  2455. var zhi = ''
  2456. for(var i in sl) {
  2457. for(var j in sl[i].worktimeList){
  2458. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  2459. var date2 = '2021/12/12 ' + sl[i].worktimeList[j].endTime +':00'
  2460. var date1 = '2021/12/12 ' + sl[i].worktimeList[j].startTime +':00'
  2461. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  2462. var leave1=date3%(24*3600*1000)
  2463. var hours=Math.floor(leave1/(3600*1000))
  2464. var leave2=leave1%(3600*1000)
  2465. var minutes=Math.floor(leave2/(60*1000))
  2466. var shi = hours+'.'+ minutes
  2467. var sll = +shi + 0
  2468. zhi = this.jsDay * sll
  2469. quanbu = +quanbu + zhi
  2470. }
  2471. }
  2472. }
  2473. this.jsTime = quanbu
  2474. },
  2475. removeTimeItem(item, index) {
  2476. item.worktimeList.splice(index, 1);
  2477. this.iptChangs()
  2478. },
  2479. //添加工时
  2480. addNewWorktime(index, item) {
  2481. if(item.worktimeList == null ) {
  2482. item.worktimeList = []
  2483. }
  2484. item.worktimeList.push({});
  2485. },
  2486. //复制项目
  2487. copyProject(index) {
  2488. var leftProgress = 10;
  2489. if (this.reportTimeType.type == 3) {
  2490. //计算已经待分配工时比例
  2491. let array = this.workForm.domains;
  2492. let totalProgress = 0;
  2493. for (var i=0;i<array.length; i++) {
  2494. totalProgress += array[i].progress;
  2495. }
  2496. if (totalProgress < 100) {
  2497. leftProgress = 100 - totalProgress;
  2498. }
  2499. }
  2500. var newIndex = index+1;
  2501. var itemDomain = {
  2502. projectId: this.workForm.domains[index].projectId,
  2503. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):"",
  2504. content: "",
  2505. progress:leftProgress,
  2506. state:2,//2-表示待提交
  2507. };
  2508. this.workForm.domains.splice(newIndex, 0,itemDomain);
  2509. if (this.reportTimeType.type == 0) {
  2510. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  2511. var length = this.workForm.domains.length;
  2512. if (length == 2) {
  2513. this.showAddMore = false;
  2514. }
  2515. }
  2516. this.selectProject(itemDomain, newIndex);
  2517. },
  2518. showWorkTime(){
  2519. this.monthWorkTimeDialog = true;
  2520. this.searchKeyword = ''
  2521. this.WorktimeDatepickValue = this.istoMonth()
  2522. if(this.WorktimeDatepickValue.length == 0){
  2523. let newdate = new Date();
  2524. let nowdate = newdate.toLocaleDateString();
  2525. let getauto = this.getAutoWeekDate(nowdate)
  2526. let nowwd = [getauto[0],getauto[6]]
  2527. this.WorktimeDatepickValue = nowwd
  2528. }
  2529. this.showMonthWorkTime()
  2530. },
  2531. handleClick(t,e){
  2532. if (t.name == "first") {
  2533. this.showMonthWorkTime()
  2534. }else{
  2535. this.showMonthNotWorkTime()
  2536. }
  2537. },
  2538. //导出员工每日填报工时数
  2539. exportMembWorkHours() {
  2540. this.http.post(
  2541. "/report/exportUserDailyWorkTime",
  2542. {
  2543. // month: this.date,
  2544. startDate: this.WorktimeDatepickValue[0],
  2545. endDate: this.WorktimeDatepickValue[1],
  2546. },
  2547. (res) => {
  2548. if (res.code == "ok") {
  2549. let url = res.data;
  2550. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xls', url);
  2551. }
  2552. },
  2553. (error) => {
  2554. this.$message({
  2555. message: error,
  2556. type: "error",
  2557. });
  2558. }
  2559. );
  2560. },
  2561. exportMembNotWorkHours() {
  2562. this.http.post(
  2563. "/report/exportNoReportUserList",
  2564. {
  2565. // month: this.date,
  2566. startDate: this.WorktimeDatepickValue[0],
  2567. endDate: this.WorktimeDatepickValue[1],
  2568. },
  2569. (res) => {
  2570. if (res.code == "ok") {
  2571. let url = res.data;
  2572. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xls', url);
  2573. }
  2574. },
  2575. (error) => {
  2576. this.$message({
  2577. message: error,
  2578. type: "error",
  2579. });
  2580. }
  2581. );
  2582. },
  2583. downloadByA(name, url) {
  2584. const a = document.createElement("a"); // 创建a标签
  2585. a.setAttribute("download", name); // download属性
  2586. a.setAttribute("href", url); // href链接
  2587. a.click(); // 自执行点击事件
  2588. a.remove();
  2589. },
  2590. // 是否本月判断
  2591. istoMonth(){
  2592. let todate = new Date()
  2593. let tomonth = todate.getMonth() + 1
  2594. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  2595. if(this.date == adate){
  2596. return []
  2597. }else{
  2598. let sedate = new Date(this.date)
  2599. let semonth = sedate.getMonth() + 1
  2600. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  2601. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  2602. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  2603. return [sedates1, sedates2]
  2604. }
  2605. },
  2606. showMonthWorkTime() {
  2607. this.monthTotalPage = 0,
  2608. this.tbload = true
  2609. this.http.post(
  2610. "/report/getUserDailyWorkTime",
  2611. // "/report/getNoReportUserList",
  2612. {
  2613. // month: this.date,
  2614. startDate: this.WorktimeDatepickValue[0],
  2615. endDate: this.WorktimeDatepickValue[1],
  2616. },
  2617. (res) => {
  2618. if (res.code == "ok") {
  2619. this.tbload = false;
  2620. this.pickDateArray = res.data.days;
  2621. // console.log('dataarray',res.data.days);
  2622. this.monthWorkData = res.data.list;
  2623. // this.monthWorkDataS = this.monthWorkData
  2624. // this.monthWorkDataS1 = res.data.list
  2625. this.monthTotal = res.data.list.length
  2626. if (this.monthWorkData.length > 50) {
  2627. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  2628. }else{
  2629. this.monthWorkDataS = this.monthWorkData
  2630. }
  2631. this.searchScreen(0)
  2632. // this.monthWorkDataS = infoList
  2633. // 判断
  2634. // if (this.monthWorkDataS1.length > 0) {
  2635. // setTimeout(() => {
  2636. // this.tableListener()
  2637. // }, 1000);
  2638. // }
  2639. this.$nextTick(function(){
  2640. this.$refs.hasworkTbl.doLayout();
  2641. });
  2642. // this.$forceUpdate()
  2643. }
  2644. },
  2645. (error) => {
  2646. this.tbload = false
  2647. this.$message({
  2648. message: error,
  2649. type: "error",
  2650. });
  2651. }
  2652. );
  2653. },
  2654. // tableListener(){
  2655. // let that = this;
  2656. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  2657. // // 添加scroll监听事件
  2658. // dom.addEventListener("scroll", function () {
  2659. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  2660. // if (scrollDistance < 2) {
  2661. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  2662. // that.monthTotalPage++; //当前页数自增
  2663. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  2664. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  2665. // var infoList = arrList.splice(
  2666. // that.monthTotalPage * that.monthTotalLages,
  2667. // that.monthTotalLages
  2668. // );
  2669. // // 数据添加
  2670. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  2671. // }
  2672. // }
  2673. // })
  2674. // },
  2675. showMonthNotWorkTime() {
  2676. this.monthTotalPage = 0,
  2677. this.tbload = true
  2678. this.http.post(
  2679. "/report/getNoReportUserList",
  2680. {
  2681. startDate: this.WorktimeDatepickValue[0],
  2682. endDate: this.WorktimeDatepickValue[1],
  2683. },
  2684. (res) => {
  2685. if (res.code == "ok") {
  2686. this.tbload = false
  2687. this.monthNotWorkDate = res.data;
  2688. // this.monthNotWorkDateS1 = res.data
  2689. this.monthnotTotal = res.data.length
  2690. // 2222111
  2691. if (this.monthNotWorkDate.length > 50) {
  2692. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  2693. } else {
  2694. this.monthNotWorkDateS = this.monthNotWorkDate
  2695. }
  2696. this.searchScreen(1)
  2697. // 判断
  2698. // if (this.monthnotworkDateS1.length > 0) {
  2699. // setTimeout(() => {
  2700. // this.tableListenernot()
  2701. // }, 1000);
  2702. // }
  2703. this.$nextTick(function(){
  2704. this.$refs.hasworkTbl2.doLayout();
  2705. });
  2706. }
  2707. },
  2708. (error) => {
  2709. this.tbload = false
  2710. this.$message({
  2711. message: error,
  2712. type: "error",
  2713. });
  2714. }
  2715. );
  2716. },
  2717. // tableListenernot(){
  2718. // let that = this;
  2719. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  2720. // dom.addEventListener("scroll", function () {
  2721. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  2722. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  2723. // if (scrollDistance2 < 2) {
  2724. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  2725. // that.monthnotTotalPage++; //当前页数自增
  2726. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  2727. // var infoList = arrList.splice(
  2728. // that.monthnotTotalPage * that.monthnotTotalLages,
  2729. // that.monthnotTotalLages
  2730. // );
  2731. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  2732. // }
  2733. // }
  2734. // })
  2735. // },
  2736. listScroll(){
  2737. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  2738. this.isMore = true
  2739. setTimeout(()=>{
  2740. this.isMore = false
  2741. },1000)
  2742. }else {
  2743. this.isFlag = true
  2744. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  2745. this.monthWorkDataS = datalist
  2746. setTimeout(()=>{
  2747. this.isFlag = false
  2748. },300)
  2749. }
  2750. },
  2751. notListScroll(){
  2752. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  2753. this.isMore = true
  2754. setTimeout(()=>{
  2755. this.isMore = false
  2756. },1000)
  2757. }else {
  2758. this.isFlag = true
  2759. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  2760. this.monthNotWorkDateS = datalist
  2761. // console.log('length',this.monthNotWorkDateS.length)
  2762. setTimeout(()=>{
  2763. this.isFlag = false
  2764. },300)
  2765. }
  2766. },
  2767. // 获取默认这zhou日期参数 222
  2768. getLastWeek(e){
  2769. let newdate = new Date()
  2770. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  2771. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  2772. if(e){
  2773. this.WorktimeDatepickValue = lastwd
  2774. this.showMonthWorkTime()
  2775. }else{
  2776. this.WorktimeDatepickValue = lastwd
  2777. this.showMonthNotWorkTime()
  2778. }
  2779. },
  2780. getThisWeek(e){
  2781. let newdate = new Date();
  2782. let nowdate = newdate.toLocaleDateString();
  2783. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  2784. if(e){
  2785. this.WorktimeDatepickValue = nowwd
  2786. this.showMonthWorkTime()
  2787. }else{
  2788. this.WorktimeDatepickValue = nowwd
  2789. this.showMonthNotWorkTime()
  2790. }
  2791. },
  2792. getDoubleLastWeek(e){
  2793. let newdate = new Date()
  2794. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  2795. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  2796. if(e){
  2797. this.WorktimeDatepickValue = nextwd
  2798. this.showMonthWorkTime()
  2799. }else{
  2800. this.WorktimeDatepickValue = nextwd
  2801. this.showMonthNotWorkTime()
  2802. }
  2803. },
  2804. alreadyAllDate(stime,etime){
  2805. let diffdate = new Array();
  2806. let i=0;
  2807. while(stime<=etime){
  2808. let dateArray = stime.split("-");
  2809. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2810. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  2811. let stimewk = this.weekDay[date.getDay()]
  2812. 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')
  2813. 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])
  2814. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  2815. let stime_ts = new Date(stime).getTime();
  2816. let next_date = stime_ts + (24*60*60*1000);
  2817. let next_dates_y = new Date(next_date).getFullYear()+'-';
  2818. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  2819. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  2820. stime = next_dates_y+next_dates_m+next_dates_d;
  2821. i++;
  2822. }
  2823. return diffdate
  2824. },
  2825. getAutoWeekDate(e) {
  2826. let dateString = e;
  2827. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  2828. if (dateString.match(dateStringReg)) {
  2829. let presentDate = new Date(dateString),
  2830. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  2831. return Array.from(new Array(7), function (val, index) {
  2832. let formatDate = new Date(
  2833. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  2834. );
  2835. return (
  2836. formatDate.getFullYear() +
  2837. "-" +
  2838. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  2839. "-" +
  2840. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  2841. );
  2842. });
  2843. } else {
  2844. throw new Error(
  2845. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  2846. );
  2847. }
  2848. },
  2849. onProgressChange() {
  2850. this.$forceUpdate();
  2851. },
  2852. showChooseMembTree() {
  2853. this.chosenMembCount = this.participator.length;
  2854. this.chooseParticipVisible = true;
  2855. },
  2856. onTreeItemChange() {
  2857. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  2858. var list = chosenList.filter(item=>item.isUser == 1);
  2859. this.chosenMembCount = list.length;
  2860. },
  2861. findUserInTree() {
  2862. if (this.filterName == '') {
  2863. this.deptMembData = this.allMembData;
  2864. } else {
  2865. var list = this.findRecursively(this.filterName, this.allMembData);
  2866. this.deptMembData = list;
  2867. }
  2868. },
  2869. findRecursively(username, list) {
  2870. var filterList = [];
  2871. for (var i=0;i<list.length; i++) {
  2872. if (list[i].isUser == 1) {
  2873. if (list[i].label.indexOf(username) >= 0) {
  2874. //匹配上了
  2875. filterList.push(list[i]);
  2876. }
  2877. } else if (list[i].children != null && list[i].children.length > 0) {
  2878. var subList = this.findRecursively(username, list[i].children);
  2879. if (subList.length > 0) {
  2880. subList.forEach(s=>filterList.push(s));
  2881. }
  2882. }
  2883. }
  2884. return filterList;
  2885. },
  2886. //确定选择参与人
  2887. chooseParticip() {
  2888. this.chooseParticipVisible = false;
  2889. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  2890. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  2891. this.workForm.userNames = '';
  2892. this.workForm.userId = [];
  2893. this.participator = [];
  2894. for (var i=0;i<this.chosenMembList.length; i++) {
  2895. this.workForm.userId.push(this.chosenMembList[i].id);
  2896. this.workForm.userNames += this.chosenMembList[i].label+',';
  2897. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  2898. this.participator.push(item);
  2899. }
  2900. if (this.workForm.userNames.length > 0) {
  2901. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  2902. }
  2903. if(this.user.userNameNeedTranslate == 1) {
  2904. if(this.workForm.userNames) {
  2905. this.workForm.userNames = this.workForm.userNames.split(',')
  2906. }
  2907. }
  2908. },
  2909. notifySel(sel){
  2910. // console.log(sel);
  2911. this.notifySelList = sel
  2912. },
  2913. //微信通知人员填写
  2914. Notify(code) {
  2915. if (this.notifySelList.length == 0) return;
  2916. var ids = '';
  2917. this.notifySelList.forEach(f=>{
  2918. ids += f.id+',';
  2919. })
  2920. this.http.post('/user/pushFillReport',{
  2921. ids: ids, date: this.curDate,
  2922. code: code
  2923. },
  2924. res => {
  2925. if (res.code == "ok") {
  2926. this.$message({
  2927. message: this.$t('message.sentSuccessfully'),
  2928. type: "success"
  2929. });
  2930. }
  2931. },
  2932. error => {
  2933. this.$message({
  2934. message: error,
  2935. type: "error"
  2936. });
  2937. }
  2938. );
  2939. },
  2940. //导出人员列表
  2941. exportMemb() {
  2942. if (this.fillMembList.length == 0) return;
  2943. var ids = '';
  2944. this.fillMembList.forEach(f=>{
  2945. ids += f.id+',';
  2946. })
  2947. this.http.post('/user/exportMembList',{
  2948. ids: ids,isFill: this.isFill, date: this.curDate
  2949. },
  2950. res => {
  2951. if (res.code == "ok") {
  2952. var aTag = document.createElement('a');
  2953. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  2954. aTag.href = res.data;
  2955. aTag.click();
  2956. }
  2957. },
  2958. error => {
  2959. this.$message({
  2960. message: error,
  2961. type: "error"
  2962. });
  2963. }
  2964. );
  2965. },
  2966. showMembList(fill) {
  2967. this.membListVisible = true;
  2968. if (fill == 0) {
  2969. this.fillMembList = this.unFillList;
  2970. this.isFill = false;
  2971. let leaveList = []
  2972. let unleaveList = []
  2973. for(let i in this.fillMembList){
  2974. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  2975. leaveList.push(this.fillMembList[i])
  2976. }else{
  2977. unleaveList.push(this.fillMembList[i])
  2978. }
  2979. }
  2980. this.fillMembList = unleaveList
  2981. this.fillMembList_leave = leaveList
  2982. } else if(fill == 1){
  2983. this.fillMembList = this.fillList.filter(item => item.state != 3);
  2984. this.isFill = true;
  2985. }else{
  2986. this.fillMembList = this.fillList.filter(item => item.state == 3);
  2987. this.isFill = true;
  2988. }
  2989. },
  2990. //获取自己填写的日报状态
  2991. getReportFillStatus() {
  2992. this.http.post('/report/getReportFillStatus',{
  2993. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  2994. },
  2995. res => {
  2996. if (res.code == "ok") {
  2997. this.fillStatusList = res.data;
  2998. this.allDate.forEach(d=>{
  2999. var fillInfo = null;
  3000. d.state = null;
  3001. this.fillStatusList.forEach(s=>{
  3002. // console.log(d)
  3003. var d1 = s.createDate.split('-')[2];
  3004. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  3005. // console.log(d2, '我被执行了')
  3006. if (d1.indexOf('0') == 0) {
  3007. d1 = d1.substring(1,d1.length);
  3008. }
  3009. if (d1 == d2) {
  3010. d.state = s.state;
  3011. }
  3012. })
  3013. })
  3014. this.$forceUpdate();
  3015. }
  3016. },
  3017. error => {
  3018. this.$message({
  3019. message: error,
  3020. type: "error"
  3021. });
  3022. }
  3023. );
  3024. },
  3025. scrollFunction () {
  3026. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  3027. if (this.domObj.attachEvent) { // IE
  3028. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  3029. } else if (this.domObj.addEventListener) {
  3030. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  3031. }
  3032. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  3033. },
  3034. mouseScroll(event) { // google 浏览器下
  3035. let detail = event.wheelDelta || event.detail
  3036. let moveForwardStep = -1
  3037. let moveBackStep = 1
  3038. let step = 0
  3039. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  3040. event.preventDefault() // 阻止浏览器默认事件
  3041. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  3042. },
  3043. // //左右滚动
  3044. // wheel(e){
  3045. // var a = document.getElementById("dateScroll");
  3046. // var scroll_width = 80; //滚动一下的距离
  3047. // var e = e || window.event, v;
  3048. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  3049. // if(v>3||-v>3) v=-v;
  3050. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  3051. // e.preventDefault(); //阻止浏览器的默认滚动
  3052. // },
  3053. showExportDialog() {
  3054. this.exportDialog = true;
  3055. },
  3056. showExportTimeDialog() {
  3057. this.exportTimeDialog = true;
  3058. },
  3059. changeAllTime() {
  3060. //总时长发生改变,自动按比例计算
  3061. this.workForm.domains.forEach(d=>{
  3062. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  3063. });
  3064. },
  3065. // 是否加班的单机事件
  3066. check() {
  3067. this.selected = !this.selected
  3068. this.isNew = this.selected
  3069. },
  3070. updateSubProject() {
  3071. this.$forceUpdate();
  3072. },
  3073. //项目选中了, 加载子项目
  3074. selectProject(domain, index) {
  3075. if(!domain.projectId){
  3076. return;
  3077. }
  3078. // console.log('projectId===',domain.projectId);
  3079. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  3080. this.http.post('/sub-project/list',{
  3081. projectId: domain.projectId
  3082. },
  3083. res => {
  3084. //清空之前选中的子项目
  3085. // this.workForm.domains[index].subProjectId = 0;
  3086. if (res.code == "ok") {
  3087. this.workForm.domains[index].subProjectList = res.data;
  3088. this.workForm.domains[index].subProjectId = null;
  3089. this.$forceUpdate();
  3090. }
  3091. },
  3092. error => {
  3093. this.$message({
  3094. message: error,
  3095. type: "error"
  3096. });
  3097. }
  3098. );
  3099. //项目相关的近期任务
  3100. if (this.user.company.packageProject == 1) {
  3101. this.http.post('/task/getRecentTask',{
  3102. projectId: domain.projectId,
  3103. isSubstitude:this.isSubstitude?1:0
  3104. },
  3105. res => {
  3106. if (res.code == "ok") {
  3107. this.workForm.domains[index].allTaskList = res.data;
  3108. this.workForm.domains[index].taskList = res.data;
  3109. this.$forceUpdate();
  3110. }
  3111. },
  3112. error => {
  3113. this.$message({
  3114. message: error,
  3115. type: "error"
  3116. });
  3117. }
  3118. );
  3119. }
  3120. //获取项目相关专业
  3121. if (this.user.company.packageEngineering == 1) {
  3122. this.getProjectProfessions(domain, index);
  3123. }
  3124. // 获取项目相关的维度
  3125. // domain.degreeId = null
  3126. this.$set(domain,'degreeId',null)
  3127. this.dimension(domain, index);
  3128. //获取项目下的任务分组
  3129. this.getTaskGroups(domain, index);
  3130. //获取项目审核人
  3131. if (this.user.timeType.reportAuditType == 0) {
  3132. this.getProjectAuditorList(domain, index);
  3133. } else {
  3134. //按分组的负责人来审核
  3135. domain.projectAuditorId = null;
  3136. domain.projectAuditorName = null;
  3137. domain.auditUserList = null;
  3138. }
  3139. },
  3140. //获取项目审核人
  3141. getProjectAuditorList(domainItem, index) {
  3142. if(domainItem.projectId == '') {
  3143. return
  3144. }
  3145. domainItem.projectAuditorId = null;
  3146. domainItem.projectAuditorName = null;
  3147. this.http.post('/project-auditor/getList',{
  3148. projectId: domainItem.projectId,
  3149. },
  3150. res => {
  3151. if (res.code == "ok") {
  3152. domainItem.auditUserList = res.data;
  3153. if (res.data.length==0) {
  3154. this.$message({
  3155. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  3156. type: "error"
  3157. });
  3158. } else if (res.data.length==1) {
  3159. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  3160. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  3161. }
  3162. this.$forceUpdate();
  3163. }
  3164. },
  3165. error => {
  3166. this.$message({
  3167. message: error,
  3168. type: "error"
  3169. });
  3170. }
  3171. );
  3172. },
  3173. // 获取维度数据
  3174. dimension(domain, index) {
  3175. if(domain.projectId == '') {
  3176. return
  3177. }
  3178. this.http.post('/project/getDegreeList',{
  3179. projectId: domain.projectId,
  3180. },
  3181. res => {
  3182. if (res.code == "ok") {
  3183. // console.log("维度数据",res.data);
  3184. this.workForm.domains[index].wuduList = res.data
  3185. // this.workForm = this.workForm
  3186. this.$forceUpdate()
  3187. }
  3188. },
  3189. error => {
  3190. this.$message({
  3191. message: error,
  3192. type: "error"
  3193. });
  3194. }
  3195. );
  3196. },
  3197. //切换任务阶段
  3198. changeStages(domain, index) {
  3199. if (domain.stage == null || domain.stage == '') {
  3200. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  3201. } else {
  3202. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  3203. }
  3204. this.$forceUpdate();
  3205. },
  3206. getGroupStages(domain, index, keepStage) {
  3207. // console.log(domain);
  3208. if(!domain.groupId){
  3209. domain.projectAuditorId = ''
  3210. domain.stages = []
  3211. if(this.user.timeType.reportAuditType >= 1){
  3212. domain.auditUserList = []
  3213. }
  3214. this.$forceUpdate();
  3215. return
  3216. }
  3217. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  3218. res => {
  3219. if (res.code == "ok") {
  3220. if (!keepStage) {
  3221. domain.stage = '';
  3222. }
  3223. domain.stages = res.data;
  3224. this.$forceUpdate();
  3225. }
  3226. },
  3227. error => {
  3228. this.$message({
  3229. message: error,
  3230. type: "error"
  3231. });
  3232. });
  3233. //检查当前的项目是否需要获取分组的负责人
  3234. if (this.user.timeType.reportAuditType >= 1 && this.user.timeType.reportAuditType != 3) {
  3235. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  3236. res => {
  3237. if (res.code == "ok") {
  3238. domain.getProjectAuditorList = res.data;
  3239. domain.auditUserList = res.data;
  3240. if (res.data.length==1) {
  3241. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  3242. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  3243. } else if (res.data.length==0) {
  3244. domain.projectAuditorId = null;
  3245. domain.projectAuditorName = null;
  3246. }
  3247. this.$forceUpdate();
  3248. }
  3249. },
  3250. error => {
  3251. this.$message({
  3252. message: error,
  3253. type: "error"
  3254. });
  3255. });
  3256. }
  3257. },
  3258. getProjectProfessions(domain, index) {
  3259. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  3260. res => {
  3261. if (res.code == "ok") {
  3262. this.workForm.domains[index].professionProgress = res.data;
  3263. this.$forceUpdate();
  3264. }
  3265. },
  3266. error => {
  3267. this.$message({
  3268. message: error,
  3269. type: "error"
  3270. });
  3271. });
  3272. },
  3273. //删除自己的日报
  3274. deleteReport() {
  3275. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  3276. confirmButtonText: this.$t('btn.determine'),
  3277. cancelButtonText: this.$t('btn.cancel'),
  3278. type: "warning"
  3279. })
  3280. .then(() => {
  3281. this.listLoading = true;
  3282. this.http.post('/report/delete',{
  3283. userId: this.user.id,
  3284. date: this.workForm.createDate
  3285. },
  3286. res => {
  3287. this.listLoading = false;
  3288. if (res.code == "ok") {
  3289. this.$message({
  3290. message: this.$t('message.successfullyDeleted'),
  3291. type: "success"
  3292. });
  3293. this.getReportList();
  3294. this.getDepartment();
  3295. this.dialogVisible = false;
  3296. } else {
  3297. this.$message({
  3298. message: res.msg,
  3299. type: "error"
  3300. });
  3301. }
  3302. },
  3303. error => {
  3304. this.listLoading = false;
  3305. this.$message({
  3306. message: error,
  3307. type: "error"
  3308. });
  3309. }
  3310. );
  3311. })
  3312. .catch(() => {});
  3313. },
  3314. // 管理员删除日报
  3315. guanli(item) {
  3316. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3317. let param = {date: this.date + day, userId: item.id};
  3318. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  3319. confirmButtonText: this.$t('btn.determine'),
  3320. cancelButtonText: this.$t('btn.cancel'),
  3321. type: "warning"
  3322. })
  3323. .then(() => {
  3324. this.listLoading = true;
  3325. this.http.post('/report/delete',param,
  3326. res => {
  3327. this.listLoading = false;
  3328. if (res.code == "ok") {
  3329. this.$message({
  3330. message: this.$t('message.successfullyDeleted'),
  3331. type: "success"
  3332. });
  3333. this.getReportList();
  3334. this.getDepartment();
  3335. this.dialogVisible = false;
  3336. } else {
  3337. this.$message({
  3338. message: res.msg,
  3339. type: "error"
  3340. });
  3341. }
  3342. },
  3343. error => {
  3344. this.listLoading = false;
  3345. this.$message({
  3346. message: error,
  3347. type: "error"
  3348. });
  3349. }
  3350. );
  3351. })
  3352. .catch(() => {});
  3353. },
  3354. //提交批量审核数据
  3355. submitBatchApprove() {
  3356. var data = this.$refs.approveTree.getCheckedNodes();
  3357. var ids = '';
  3358. if (data.length == 0) {
  3359. this.$message({
  3360. message: this.$t('message.Pleaseselectthepersontoreview'),
  3361. type: "error"
  3362. });
  3363. return;
  3364. }
  3365. for (var i=0;i<data.length; i++) {
  3366. ids += data[i].id;
  3367. if (i < data.length-1) {
  3368. ids += ',';
  3369. }
  3370. }
  3371. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3372. this.http.post("/report/batchApproveReport", {ids:ids, date:this.date + day},
  3373. res => {
  3374. if (res.code == "ok") {
  3375. this.$message({
  3376. message: this.$t('message.Reviewsucceeded'),
  3377. type: "success"
  3378. });
  3379. this.getReportList();
  3380. this.getDepartment();
  3381. this.approveDialogVisible = false;
  3382. } else {
  3383. this.$message({
  3384. message: res.msg,
  3385. type: "error"
  3386. });
  3387. }
  3388. },
  3389. error => {
  3390. this.$message({
  3391. message: error,
  3392. type: "error"
  3393. });
  3394. });
  3395. },
  3396. selectAll() {
  3397. if (this.isAllSelect) {
  3398. var keys = [];
  3399. this.reportNames.forEach(b=>{
  3400. keys.push(b.id);
  3401. })
  3402. this.$refs.approveTree.setCheckedKeys(keys);
  3403. } else {
  3404. this.$refs.approveTree.setCheckedKeys([]);
  3405. }
  3406. },
  3407. //批量审核
  3408. batchApprove() {
  3409. this.approveDialogVisible = true;
  3410. this.reportNames = [];
  3411. for (var i=0;i<this.reportList.length; i++) {
  3412. var report = this.reportList[i];
  3413. var hasUnChecked =false;
  3414. var id = '';
  3415. for (var j=0;j<report.data.length; j++) {
  3416. if (report.data[j].state == 0
  3417. && (this.user.company.packageEngineering==0 || (this.user.company.packageEngineering==1 && report.data[j].departmentAuditState == 1))
  3418. && (permissions.projectReportReview || report.data[j].projectAuditorId == this.user.id)) {
  3419. hasUnChecked = true;
  3420. id += report.data[j].id+',';
  3421. }
  3422. }
  3423. if (hasUnChecked) {
  3424. this.reportNames.push({id:id, label: report.name});
  3425. }
  3426. }
  3427. },
  3428. removeEmptyNode(list) {
  3429. for (var i=0;i<list.length;i++) {
  3430. var cnt = 0;
  3431. if (list[i].membCount == 0) {
  3432. list.splice(i, 1);
  3433. i--;
  3434. } else if (list[i].children != null) {
  3435. this.removeEmptyNode(list[i].children);
  3436. }
  3437. }
  3438. },
  3439. calculateMembCount(list) {
  3440. for (var i in list) {
  3441. var cnt = 0;
  3442. if (list[i].children != null) {
  3443. this.calculateMembCount(list[i].children);
  3444. for (var m in list[i].children) {
  3445. cnt += list[i].children[m].membCount;
  3446. }
  3447. }
  3448. if (list[i].isUser == 1) {
  3449. cnt++;
  3450. this.membCount++;
  3451. }
  3452. list[i].membCount = cnt;
  3453. }
  3454. },
  3455. stateChange() {
  3456. // console.log(this.allData,'alldate');
  3457. this.membCount = 0;
  3458. if (this.selectState == -1) {
  3459. //全部状态
  3460. this.data = this.allData;
  3461. } else {
  3462. //未填报
  3463. this.seluserText = ''
  3464. var newData = JSON.parse(JSON.stringify(this.allData));
  3465. this.filterState(this.selectState, newData);
  3466. this.data = newData;
  3467. }
  3468. this.calculateMembCount(this.data);
  3469. this.data[0].membCount = this.membCount;//总人数
  3470. },
  3471. //按状态过滤部门人员
  3472. filterState(state, list) {
  3473. for (var i =0;i<list.length; i++) {
  3474. var obj = list[i];
  3475. if (obj.isUser == 1) {
  3476. var match = false;
  3477. if (state == -2) {
  3478. if (obj.state == null) {
  3479. match = true;
  3480. }
  3481. } else {
  3482. if (obj.state == state) {
  3483. match = true;
  3484. }
  3485. }
  3486. if (!match) {
  3487. list.splice(i, 1);
  3488. i--;
  3489. } else {
  3490. }
  3491. } else {
  3492. if (obj.children != null) {
  3493. this.filterState(state, obj.children);
  3494. }
  3495. }
  3496. }
  3497. },
  3498. //a按名称过滤部门人员
  3499. seluserforText(){
  3500. this.membCount = 0;
  3501. var newData = JSON.parse(JSON.stringify(this.allData));
  3502. this.seluserforTextin(this.seluserText, newData)
  3503. this.data = newData;
  3504. this.calculateMembCount(this.data);
  3505. this.data[0].membCount = this.membCount;//总人数
  3506. },
  3507. seluserforTextin(text, list){
  3508. for (var i =0;i<list.length; i++) {
  3509. var obj = list[i];
  3510. if (obj.isUser == 1) {
  3511. var match = false;
  3512. if (obj.label.indexOf(text) != -1) {
  3513. match = true
  3514. }
  3515. if (!match) {
  3516. list.splice(i, 1);
  3517. i--;
  3518. } else {
  3519. }
  3520. } else {
  3521. if (obj.children != null) {
  3522. this.seluserforTextin(text, obj.children);
  3523. }
  3524. }
  3525. }
  3526. },
  3527. // 部门列表点击
  3528. handleNodeClick(data) {
  3529. // this.dealList = data
  3530. this.theValues(data.id, this.allData)
  3531. // this.depData = data;
  3532. var list = [];
  3533. if (data.id == -1) {
  3534. this.deptId = null;
  3535. this.targetUid = null;
  3536. list = this.data;
  3537. } else if (data.isUser == 1) {
  3538. this.deptId = null;
  3539. this.targetUid = data.id;
  3540. } else {
  3541. this.deptId = data.id;
  3542. this.targetUid = null;
  3543. list.push(data);
  3544. }
  3545. this.getReportList();
  3546. if (list.length > 0) {
  3547. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  3548. this.fillList = this.getUserMembListFromDeptList(list, 1)
  3549. }
  3550. },
  3551. theValues(id, item) {
  3552. for(var i in item) {
  3553. if(item[i].id == id) {
  3554. this.depData = item[i]
  3555. if(id == '-1') {
  3556. this.translation = '1'
  3557. } else {
  3558. if(item[i].children) {
  3559. this.translation = '2'
  3560. } else {
  3561. this.translation = '3'
  3562. }
  3563. }
  3564. return
  3565. } else {
  3566. if(item[i].children) {
  3567. this.theValues(id, item[i].children)
  3568. }
  3569. }
  3570. }
  3571. },
  3572. //获取可以选择的代填的人员列表
  3573. getSubstitudeUserDeptList() {
  3574. if (this.deptMembData.length == 0) {
  3575. this.http.post("/department/listMyMembs", {},
  3576. res => {
  3577. if (res.code == "ok") {
  3578. let noAllData = JSON.parse(JSON.stringify(res.data));
  3579. if (noAllData.length > 0) {
  3580. // if (noAllData[0].label == '全部人员') {
  3581. if (noAllData[0].label == this.$t('lable.allStaff')) {
  3582. noAllData.splice(0,1);
  3583. }
  3584. }
  3585. this.setUserToDept(noAllData);
  3586. this.deptMembData = noAllData;
  3587. } else {
  3588. this.$message({
  3589. message: res.msg,
  3590. type: "error"
  3591. });
  3592. }
  3593. },
  3594. error => {
  3595. this.$message({
  3596. message: error,
  3597. type: "error"
  3598. });
  3599. });
  3600. }
  3601. },
  3602. // 获取部门列表
  3603. getDepartment() {
  3604. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3605. var param = {date:this.date + day};
  3606. this.http.post("/report/getMembList", param,
  3607. res => {
  3608. if (res.code == "ok") {
  3609. if(res.data.length == 0){
  3610. // this.$message({
  3611. // message: '请联系管理员设置负责部门',
  3612. // type: 'error'
  3613. // })
  3614. return
  3615. }
  3616. this.departmentList = JSON.parse(JSON.stringify(res.data))
  3617. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  3618. // let noAllData = JSON.parse(JSON.stringify(res.data));
  3619. // if (this.user.role > 0) {
  3620. // }
  3621. list.splice(0,0,{
  3622. id: -1,
  3623. label: this.$t('lable.allStaff'),
  3624. })
  3625. this.membCount = 0;
  3626. //设置员工到部门下面
  3627. this.setUserToDept(list);
  3628. this.data = list;
  3629. // console.log('data',this.data);
  3630. this.expandDate = [this.data[1].id]
  3631. this.allData = list;
  3632. // if (noAllData.length > 0) {
  3633. // if (noAllData[0].label == '全部人员') {
  3634. // noAllData.splice(0,1);
  3635. // }
  3636. // }
  3637. // this.setUserToDept(noAllData);
  3638. // this.deptMembData = noAllData;
  3639. this.option = this.changeArr(list1);
  3640. list[0].membCount = this.membCount;
  3641. if (this.depData.id == -1) {
  3642. this.depData.membCount = this.membCount;
  3643. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  3644. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  3645. } else {
  3646. if (this.depData.isUser == null) {
  3647. var dep = this.findTargetDept(this.data, this.depData.id);
  3648. var membDeptList = [];
  3649. membDeptList.push(dep);
  3650. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  3651. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  3652. }
  3653. }
  3654. if (this.depData.isUser == null) {
  3655. if (this.isFill) {
  3656. this.fillMembList = this.fillList;
  3657. } else {
  3658. this.fillMembList = this.unFillList;
  3659. }
  3660. }
  3661. this.leaveAllNum = 0
  3662. for(let i in this.unFillList){
  3663. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  3664. this.leaveAllNum += 1
  3665. }
  3666. }
  3667. this.stateChange()
  3668. } else {
  3669. this.$message({
  3670. message: res.msg,
  3671. type: "error"
  3672. });
  3673. }
  3674. },
  3675. error => {
  3676. this.$message({
  3677. message: error,
  3678. type: "error"
  3679. });
  3680. });
  3681. this.getReportFillStatus();
  3682. },
  3683. findTargetDept(list, deptId) {
  3684. var t = null;
  3685. for (var i=0;i<list.length; i++) {
  3686. if (list[i].isUser == null && list[i].id == deptId) {
  3687. t = list[i];
  3688. break;
  3689. }
  3690. }
  3691. if (t == null) {
  3692. for (var i=0;i<list.length; i++) {
  3693. if (list[i].children != null && list[i].children.length > 0) {
  3694. t = this.findTargetDept(list[i].children, deptId);
  3695. if (t != null) {
  3696. break;
  3697. }
  3698. }
  3699. }
  3700. }
  3701. return t;
  3702. },
  3703. getUserMembListFromDeptList(list, isFill) {
  3704. var membList = [];
  3705. for (var i in list) {
  3706. var deptName = list[i].label;
  3707. if (list[i].userList != null) {
  3708. list[i].userList.forEach(element => {
  3709. if (isFill == 0) {
  3710. //获取未填的
  3711. if (element.state == null) {
  3712. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  3713. membList.push(obj);
  3714. }
  3715. } else {
  3716. if (element.state != null) {
  3717. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  3718. membList.push(obj);
  3719. }
  3720. }
  3721. });
  3722. }
  3723. if (list[i].children != null) {
  3724. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  3725. }
  3726. }
  3727. return membList;
  3728. },
  3729. setUserToDept(list) {
  3730. for (var i in list) {
  3731. var cnt = 0;
  3732. if (list[i].children != null) {
  3733. this.setUserToDept(list[i].children);
  3734. for (var m in list[i].children) {
  3735. cnt += list[i].children[m].membCount;
  3736. }
  3737. }
  3738. if (list[i].userList != null) {
  3739. if (list[i].children == null) {
  3740. list[i].children = [];
  3741. }
  3742. list[i].userList.forEach(element => {
  3743. var obj = {
  3744. id: element.id,
  3745. label:element.name,
  3746. state:element.state,
  3747. parentId:element.departmentId,
  3748. isUser:1,
  3749. workingTime: element.workingTime,
  3750. leaveDays: element.leaveDays,
  3751. leaveTimes: element.leaveTimes
  3752. };
  3753. list[i].children.push(obj);
  3754. this.membCount++;
  3755. cnt++;
  3756. });
  3757. }
  3758. list[i].membCount = cnt;
  3759. }
  3760. },
  3761. // 修改数组
  3762. changeArr(arr) {
  3763. for (var i = 0; i < arr.length; i++) {
  3764. if(arr[i].id != -1 && arr[i].id != 0) {
  3765. if (arr[i].children != null && arr[i].children.length>0) {
  3766. arr[i].children = this.changeArr(arr[i].children);
  3767. }
  3768. arr[i].id && (arr[i].value = arr[i].id);
  3769. delete arr[i].id;
  3770. }
  3771. }
  3772. for(var i in arr) {
  3773. if(arr[i].id == -1 || arr[i].id == 0) {
  3774. arr.splice(i,1)
  3775. }
  3776. }
  3777. return arr;
  3778. },
  3779. //时间段范围设置改动,监听
  3780. onTimeTypeChange(timeType) {
  3781. this.seleChn(1)
  3782. this.showAddMore = true;
  3783. for(var i in this.workForm.domains) {
  3784. if (this.workForm.domains[i].timeType == 0) {
  3785. this.showAddMore = false;
  3786. break;
  3787. }
  3788. }
  3789. if (this.showAddMore) {
  3790. //检测数量
  3791. if (this.workForm.domains.length == 2) {
  3792. this.showAddMore = false;
  3793. } else {
  3794. this.showAddMore = true;
  3795. }
  3796. }
  3797. },
  3798. getTimeType() {
  3799. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  3800. res => {
  3801. if (res.code == "ok") {
  3802. var t = res.data;
  3803. this.reportTimeType = t;
  3804. if (this.reportTimeType.type > 0) {
  3805. this.showAddMore = true;
  3806. }
  3807. //转化时间格式
  3808. if (t.allday != null) {
  3809. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  3810. }
  3811. if (t.am != null) {
  3812. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  3813. }
  3814. if (t.pm != null) {
  3815. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  3816. }
  3817. } else {
  3818. this.$message({
  3819. message: res.msg,
  3820. type: "error"
  3821. });
  3822. }
  3823. },
  3824. error => {
  3825. this.listLoading = false;
  3826. this.$message({
  3827. message: error,
  3828. type: "error"
  3829. });
  3830. });
  3831. },
  3832. // 改变月份 -------
  3833. changeMonthOut() {
  3834. this.getAllDate();
  3835. this.getReportList();
  3836. this.getDepartment();
  3837. },
  3838. // 选择日期
  3839. choseDate(i, item) {
  3840. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  3841. return
  3842. }
  3843. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  3844. this.choseDay = i;
  3845. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3846. sessionStorage.msg = this.date + day,
  3847. this.getReportList();
  3848. this.getDepartment();
  3849. this.curDate = item.date;
  3850. },
  3851. canClick(i, item){
  3852. let nowDate = new Date()
  3853. let nowDateYear = nowDate.getFullYear()
  3854. let itemYear = parseInt(this.date.split('-')[0])
  3855. let nowDateMonth = nowDate.getMonth() + 1
  3856. let itemMonth = parseInt(this.date.split('-')[1])
  3857. let nowDateDay = nowDate.getDate()
  3858. let itemDay = parseInt(item.showDate.split('.')[1])
  3859. if(nowDateYear < itemYear){
  3860. return false
  3861. }else if(nowDateYear == itemYear){
  3862. if(nowDateMonth < itemMonth){
  3863. return false
  3864. }else if(nowDateMonth == itemMonth){
  3865. if(nowDateDay < itemDay){
  3866. return false
  3867. }
  3868. }
  3869. }
  3870. },
  3871. // 获取日期列表
  3872. getAllDate(e) {
  3873. var dayArry = [];
  3874. var day = this.getCountDays();
  3875. let curMonthDay = null;
  3876. for (var k = 1; k <= day; k++) {
  3877. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  3878. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  3879. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  3880. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  3881. if(sessionStorage.msg) {
  3882. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  3883. this.choseDay = k - 1;
  3884. curMonthDay = str;
  3885. }
  3886. } else {
  3887. if (new Date().getDate() == k) {
  3888. this.choseDay = k - 1;
  3889. }
  3890. }
  3891. } else {
  3892. this.choseDay = 0;
  3893. }
  3894. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  3895. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  3896. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  3897. }
  3898. this.allDate = dayArry;
  3899. //不能超过最大日期
  3900. if (this.choseDay > day-1) {
  3901. this.choseDay = day-1;
  3902. }
  3903. if(sessionStorage.from != 1){
  3904. let nowmonth = new Date().getMonth() + 1
  3905. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  3906. let nowdate = new Date().getDate()
  3907. if(nowd == this.date){
  3908. if(e && sessionStorage.msg){
  3909. }else{
  3910. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  3911. }
  3912. let nowday = new Date(sessionStorage.msg).getDate()
  3913. this.choseDay = nowday - 1
  3914. let monthdate = new Date(sessionStorage.msg)
  3915. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  3916. }else{
  3917. if(e && sessionStorage.msg){
  3918. }else{
  3919. sessionStorage.msg = this.date + '-01'
  3920. }
  3921. let monthdate = new Date(sessionStorage.msg)
  3922. this.choseDay = monthdate.getDate() - 1
  3923. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  3924. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  3925. }
  3926. }else{
  3927. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  3928. }
  3929. //从消息点击跳转过来的,直接加载指定日期
  3930. if (sessionStorage.from == 1 && sessionStorage.msg) {
  3931. this.curDate = sessionStorage.msg;
  3932. sessionStorage.from = 0;
  3933. } else {
  3934. // if (curMonthDay != null) {
  3935. // // this.curDate = curMonthDay;
  3936. // let d = new Date(sessionStorage.msg)
  3937. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  3938. // } else {
  3939. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  3940. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  3941. // }
  3942. }
  3943. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  3944. // if(!sessionStorage.msg){
  3945. // let msgday = this.choseDay + 1
  3946. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  3947. // }
  3948. this.getReportFillStatus();
  3949. },
  3950. getCountDays() {
  3951. var newstr = this.date.replace(/-/g, "/");
  3952. var curDate = new Date(newstr+'/01');
  3953. var curMonth = curDate.getMonth();
  3954. curDate.setMonth(curMonth + 1);
  3955. curDate.setDate(0);
  3956. return curDate.getDate();
  3957. },
  3958. //获取日报列表
  3959. getReportList() {
  3960. this.listLoading = true;
  3961. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3962. let param = {date: this.date + day};
  3963. if (this.deptId) {
  3964. param.deptId = this.deptId;
  3965. }
  3966. if (this.targetUid) {
  3967. param.userId = this.targetUid;
  3968. }
  3969. this.http.post( this.port.report.list, param,
  3970. res => {
  3971. this.listLoading = false;
  3972. if (res.code == "ok") {
  3973. this.reportList = res.data;
  3974. if(document.querySelector("#day"+this.choseDay)){
  3975. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  3976. }
  3977. } else {
  3978. this.$message({
  3979. message: res.msg,
  3980. type: "error"
  3981. });
  3982. }
  3983. },
  3984. error => {
  3985. this.listLoading = false;
  3986. this.$message({
  3987. message: error,
  3988. type: "error"
  3989. });
  3990. });
  3991. },
  3992. // 处理数据
  3993. // dealWith() {
  3994. // var tianxie = 0
  3995. // var weixtianxie = 0
  3996. // if(this.selectState == -1) {
  3997. // } else {
  3998. // var arr = []
  3999. // for (var i in this.reportList) {
  4000. // arr.push(this.reportList[i].id)
  4001. // }
  4002. // this.getDealWith(this.dealList.children, tianxie, weixtianxie, arr)
  4003. // }
  4004. // },
  4005. // getDealWith(item, tx, wtx, arr) {
  4006. // for(var i in item) {
  4007. // if(item[i].children) {
  4008. // this.getDealWith(item[i].children, tx, wtx, arr)
  4009. // } else {
  4010. // if(arr.indexOf(item[i].id) != '-1') {
  4011. // tx = +tx + 1
  4012. // }
  4013. // }
  4014. // }
  4015. // },
  4016. //导出员工工时统计
  4017. exportUserTime() {
  4018. this.listLoading = true;
  4019. var param = {};
  4020. if (this.exportParam.dateRange != null) {
  4021. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  4022. }
  4023. this.http.post('/department/exportDeptStatistic', param,
  4024. res => {
  4025. this.listLoading = false;
  4026. if (res.code == "ok") {
  4027. location.href = res.data;
  4028. this.exportTimeDialog = false;
  4029. } else {
  4030. this.$message({
  4031. message: res.msg,
  4032. type: "error"
  4033. });
  4034. }
  4035. },
  4036. error => {
  4037. this.listLoading = false;
  4038. this.$message({
  4039. message: error,
  4040. type: "error"
  4041. });
  4042. });
  4043. },
  4044. //导出日报
  4045. exportReport() {
  4046. this.listLoading = true;
  4047. var param = {};
  4048. if (this.exportParam.dateRange != null) {
  4049. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  4050. }
  4051. if (this.exportParam.projectId != null) {
  4052. param.projectId = this.exportParam.projectId;
  4053. }
  4054. if (this.exportParam.departmentId != null) {
  4055. param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  4056. }
  4057. param.stateKey = this.stateKey
  4058. // param.departmentId = this.user.departmentId
  4059. this.http.post( this.port.report.export, param,
  4060. res => {
  4061. this.listLoading = false;
  4062. if (res.code == "ok") {
  4063. location.href = res.data;
  4064. this.exportDialog = false;
  4065. } else {
  4066. this.$message({
  4067. message: res.msg,
  4068. type: "error"
  4069. });
  4070. }
  4071. },
  4072. error => {
  4073. this.listLoading = false;
  4074. this.$message({
  4075. message: error,
  4076. type: "error"
  4077. });
  4078. });
  4079. },
  4080. //获取项目列表
  4081. getProjectList() {
  4082. this.listLoading = true;
  4083. this.http.post( this.port.project.list, {},
  4084. res => {
  4085. this.listLoading = false;
  4086. if (res.code == "ok") {
  4087. for(var i in res.data) {
  4088. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  4089. res.data[i].projectCode = ''
  4090. }
  4091. }
  4092. this.projectList = res.data;
  4093. // console.log("项目列表",this.projectList);
  4094. } else {
  4095. this.$message({
  4096. message: res.msg,
  4097. type: "error"
  4098. });
  4099. }
  4100. },
  4101. error => {
  4102. this.listLoading = false;
  4103. this.$message({
  4104. message: error,
  4105. type: "error"
  4106. });
  4107. });
  4108. },
  4109. // 获取填报日报的项目下拉列表
  4110. getFillProjectList() {
  4111. this.http.post( this.port.project.list, {
  4112. forReport: 1
  4113. },res => {
  4114. if (res.code == "ok") {
  4115. for(var i in res.data) {
  4116. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  4117. res.data[i].projectCode = ''
  4118. }
  4119. }
  4120. this.fillProjectList = res.data;
  4121. } else {
  4122. this.$message({
  4123. message: res.msg,
  4124. type: "error"
  4125. });
  4126. }
  4127. },
  4128. error => {
  4129. this.$message({
  4130. message: error,
  4131. type: "error"
  4132. });
  4133. });
  4134. },
  4135. getBasecostItemList() {
  4136. this.http.post('/project-basecost-setting/getReportBasecostList', {
  4137. companyId: this.user.companyId
  4138. },
  4139. res => {
  4140. if (res.code == "ok") {
  4141. this.timeBasecostList = res.data;
  4142. }
  4143. });
  4144. },
  4145. // 获取个人某天的日报 111111
  4146. getReport() {
  4147. this.http.post( this.port.report.getPort, {
  4148. date: this.workForm.createDate
  4149. },
  4150. res => {
  4151. if (res.code == "ok") {
  4152. var quanbu = 0
  4153. this.jsDay = 1
  4154. var zhi = ''
  4155. var slp = res.data.report
  4156. for(var i in slp) {
  4157. var sp = +slp[i].workingTime + 0
  4158. zhi = this.jsDay * sp
  4159. quanbu = +quanbu + zhi
  4160. }
  4161. this.jsTime = quanbu
  4162. var list = res.data;
  4163. this.report = list;
  4164. this.reportTimeType = this.report.timeType;
  4165. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  4166. this.isWeekend = !this.report.isWorkDay;
  4167. this.canCancelInDialog = false
  4168. if(list.report.length != 0) {
  4169. var arr = [];
  4170. this.canEdit = false;
  4171. let candelete = true
  4172. for(var i in list.report) {
  4173. var flg = null
  4174. list.report[i].isOvertime == 1 ? flg = true : flg = false
  4175. arr.push({
  4176. id: list.report[i].id,
  4177. projectId: list.report[i].projectId,
  4178. workingTime: list.report[i].workingTime,
  4179. content: list.report[i].content,
  4180. state: list.report[i].state,
  4181. timeType: list.report[i].timeType,
  4182. subProjectList: list.report[i].subProjectList,
  4183. taskList: list.report[i].taskList,
  4184. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  4185. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  4186. taskId: list.report[i].taskId,
  4187. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  4188. startTime: list.report[i].startTime,
  4189. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  4190. endTime: list.report[i].endTime,
  4191. isOvertime: flg,
  4192. progress:list.report[i].progress,
  4193. professionProgress: list.report[i].professionProgressList,
  4194. stages:list.report[i].stages,
  4195. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  4196. pics: list.report[i].pics,
  4197. multiWorktime: list.report[i].multiWorktime,
  4198. worktimeList: list.report[i].worktimeList,
  4199. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  4200. wuduList: list.report[i].degreeList,
  4201. taskGroups:list.report[i].taskGroups,
  4202. customData: list.report[i].customData,//自定义的数值
  4203. auditUserList: list.report[i].auditUserList,
  4204. projectAuditorId: list.report[i].projectAuditorId,
  4205. projectAuditorName: list.report[i].projectAuditorName,
  4206. overtimeHours: list.report[i].overtimeHours,
  4207. customText: list.report[i].customText,
  4208. basecostId: list.report[i].basecostId,
  4209. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  4210. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  4211. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  4212. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  4213. canEdit: list.report[i].state >= 2 ? true : false
  4214. })
  4215. if (list.report[i].state >= 2) {
  4216. this.canEdit = true;
  4217. }
  4218. if(list.report[i].state < 2){
  4219. candelete = false
  4220. }
  4221. if (list.report[i].state == 0){
  4222. this.canCancelInDialog = true
  4223. }
  4224. }
  4225. this.reportCanDelete = candelete
  4226. this.workForm = {
  4227. createDate: this.workForm.createDate,
  4228. domains: arr,
  4229. userNames:null,
  4230. userId:null,
  4231. time: list.time
  4232. }
  4233. } else {
  4234. this.workForm = {
  4235. createDate: this.workForm.createDate,
  4236. domains: [{
  4237. id: null,
  4238. projectId: "",
  4239. workingTime: this.reportTimeType.type==3?(this.reportTimeType.allday).toFixed(1):"",
  4240. content: "",
  4241. progress:100,
  4242. state: 2,
  4243. timeType:0,
  4244. multiWorktime: this.reportTimeType.multiWorktime,
  4245. worktimeList:[{}],
  4246. canEdit: true,
  4247. auditorFirst: '',
  4248. auditorSec: '',
  4249. auditorThird: '',
  4250. ccUserid: ''
  4251. }],
  4252. userId:null,
  4253. userNames:null,
  4254. time: this.report.time
  4255. }
  4256. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  4257. this.$set(this.workForm.domains[0],'isOvertime',true)
  4258. if(this.reportTimeType.type != 2){
  4259. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  4260. }
  4261. }
  4262. if(this.user.timeType.type == 1) {
  4263. var shuzhi = this.user.timeType.allday + ''
  4264. // console.log('执行一次', shuzhi.indexOf('.'))
  4265. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  4266. }
  4267. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  4268. //默认给第一个,必填字段
  4269. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  4270. }
  4271. this.canEdit = true;
  4272. }
  4273. } else {
  4274. this.$message({
  4275. message: res.msg,
  4276. type: "error"
  4277. });
  4278. }
  4279. },
  4280. error => {
  4281. this.$message({
  4282. message: error,
  4283. type: "error"
  4284. });
  4285. });
  4286. },
  4287. guanbi() {
  4288. this.falsss = false
  4289. },
  4290. // 打开日报填写
  4291. fillInReport(i, isBatch) {
  4292. this.isWeekend = false
  4293. this.reportCanDelete = false
  4294. // console.log(this.user.timeType.type, '选择时长')
  4295. if(i != 1) {
  4296. this.falsss = false
  4297. } else {
  4298. this.falsss = true
  4299. }
  4300. if (this.isSubstitude) {
  4301. this.getSubstitudeUserDeptList();
  4302. }
  4303. if(i == -1 || this.isSubstitude) {
  4304. this.isDisable = false;
  4305. } else {
  4306. this.isDisable = true;
  4307. }
  4308. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4309. this.isBatch = isBatch;
  4310. if (this.isBatch == 0 && !this.isSubstitude) {
  4311. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  4312. let weekday = new Date(this.workForm.createDate).getDay()
  4313. if(this.user.companyId == 817){
  4314. if(weekday == 0){
  4315. this.isWeekend = true
  4316. }
  4317. }else{
  4318. if(weekday == 0 || weekday == 6){
  4319. this.isWeekend = true
  4320. }
  4321. }
  4322. this.getReport(i);
  4323. } else {
  4324. // console.log('执行到了这里')
  4325. this.jsTime = 0
  4326. this.jsDay = 0
  4327. this.workForm = {
  4328. createDate: null,//批量填报没有日期
  4329. domains: [{
  4330. id: null,
  4331. projectId: "",
  4332. workingTime: this.reportTimeType.type==3?(this.reportTimeType.allday).toFixed(1):"",
  4333. content: "",
  4334. progress:100,
  4335. state: 2,
  4336. timeType:0,
  4337. multiWorktime: this.reportTimeType.multiWorktime,
  4338. worktimeList:[{}],
  4339. canEdit: true
  4340. }],
  4341. }
  4342. if(this.user.timeType.type == 1) {
  4343. var shuzhi = this.user.timeType.allday + ''
  4344. // console.log('执行二次')
  4345. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  4346. }
  4347. // console.log(this.workForm)
  4348. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  4349. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  4350. }
  4351. this.canEdit = true;
  4352. }
  4353. this.dialogVisible = true;
  4354. },
  4355. // 按周填报里内容的填写
  4356. tianxies(item, i, names, row) {
  4357. if(this.user.timeType.notAllowedNoAttendance == 1){
  4358. if(this.zhoData[i].corpTime){
  4359. if(this.zhoData[i].corpTime.workHours == 0){
  4360. this.$message({
  4361. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  4362. type: 'error'
  4363. })
  4364. return
  4365. }
  4366. }else{
  4367. this.$message({
  4368. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  4369. type: 'error'
  4370. })
  4371. return
  4372. }
  4373. }
  4374. var idd = ''
  4375. var obj = {}
  4376. for(var l in this.projectList) {
  4377. if(this.projectList[l].projectName == names) idd = this.projectList[l].id
  4378. }
  4379. obj.projectId = idd
  4380. this.selectProject(obj, 0)
  4381. // console.log(this.workForm.domains[0], '打印出来的')
  4382. this.tianxieDialogVisible = true
  4383. this.scopess = item
  4384. var sss = {}
  4385. sss.projectId = idd;
  4386. sss.con = item.con
  4387. sss.progress = item.progress
  4388. sss.time = item.time
  4389. sss.groupId = item.groupId
  4390. sss.stage = item.stage;
  4391. sss.workingTime = item.workingTime
  4392. sss.projectAuditorId = item.projectAuditorId;
  4393. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  4394. //默认选中第一个
  4395. sss.basecostId = this.timeBasecostList[0].id;
  4396. }
  4397. var that = this
  4398. setTimeout(() =>{
  4399. var isFirstEdit = false;
  4400. if(Object.keys(item).length < 5) {
  4401. //首次点开当前的这个cell,初始化数据
  4402. isFirstEdit = true;
  4403. sss.subProjectId = that.workForm.domains[0].subProjectId
  4404. sss.stage = that.workForm.domains[0].stage
  4405. sss.subProjectList = that.workForm.domains[0].subProjectList
  4406. sss.stages = that.workForm.domains[0].stages
  4407. sss.taskGroups = that.workForm.domains[0].taskGroups;
  4408. sss.auditUserList = obj.auditUserList;
  4409. } else {
  4410. sss.subProjectId = item.subProjectId
  4411. sss.stage = item.stage
  4412. sss.subProjectList = item.subProjectList
  4413. sss.stages = item.stages
  4414. sss.taskGroups = item.taskGroups;
  4415. sss.auditUserList = obj.auditUserList;
  4416. sss.degreeId = item.degreeId;
  4417. sss.customData = item.customData;
  4418. }
  4419. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  4420. //只有一个审核人,自动设置上去
  4421. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  4422. }
  4423. sss.wuduList = row[0].wuduList
  4424. // console.log(sss, '数据')
  4425. that.zhoBaoIdx = i
  4426. that.zhoBaoName = names
  4427. that.zhoBao = sss
  4428. that.zhis = row
  4429. if (sss.groupId) {
  4430. //最后一个参数表示是否保留stage的值,不要重置为空
  4431. this.getGroupStages(that.zhoBao, 0, !isFirstEdit)
  4432. }
  4433. that.$forceUpdate();
  4434. },600);
  4435. },
  4436. // 按周填报里内容的填写点击确定
  4437. btnTianxiaes() {
  4438. if (!this.zhoBao.projectAuditorId && this.user.timeType.reportAuditType != 3) {
  4439. this.$message({
  4440. message: this.$t('message.Pleaseselectareviewer'),
  4441. type: "error"
  4442. });
  4443. return
  4444. }
  4445. if(this.user.timeType.reportAuditType == 3){
  4446. let auditTips = ''
  4447. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  4448. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  4449. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  4450. if(auditTips){
  4451. auditTips = auditTips.substring(0,auditTips.length - 1)
  4452. this.$message({
  4453. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  4454. type: 'warning'
  4455. })
  4456. return
  4457. }
  4458. }
  4459. let errtips = ''
  4460. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0 && !this.zhoBao.degreeId) {
  4461. errtips += this.user.timeType.customDegreeName + '、'
  4462. }
  4463. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  4464. errtips += this.user.timeType.customDataName + '、'
  4465. }
  4466. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  4467. errtips += this.user.timeType.customTextName + '、'
  4468. }
  4469. if(this.user.timeType.workContentState == 1 && !this.zhoBao.con){
  4470. errtips += this.user.companyId==781?this.$t('other.specificcontentandresults')+'、': this.$t('other.workMatters') +'、'
  4471. }
  4472. if(errtips){
  4473. errtips = errtips.substring(0,errtips.length - 1)
  4474. this.$message({
  4475. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  4476. type: 'warning'
  4477. })
  4478. return
  4479. }
  4480. this.tianxieDialogVisible = false
  4481. var zhong = this.zhoData
  4482. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  4483. this.zhoData = zhong
  4484. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  4485. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  4486. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  4487. },
  4488. // 获取本周
  4489. getCurrentWeek() {
  4490. const currentDate = new Date()
  4491. const week = currentDate.getDay()
  4492. const millisecond = 1000 * 60 * 60 * 24
  4493. const minusDay = week != 0 ? week - 1 : 4
  4494. const monday = new Date(currentDate.getTime() - minusDay * millisecond)
  4495. var stat = this.dealdate(monday)
  4496. var end
  4497. if(this.user.timeType.fillAhead == 1){
  4498. const endDay = week == 0 || week == 6 ? 0 : 5 - week
  4499. const endDate = new Date(currentDate.getTime() + endDay * millisecond)
  4500. end = this.dealdate(endDate)
  4501. }else{
  4502. end = this.dealdate(currentDate)
  4503. }
  4504. this.zhoRqi = [stat, end]
  4505. // console.log('date',currentDate,this.zhoRqi);
  4506. this.zhoRqis()
  4507. // this.jiazai()
  4508. },
  4509. // 获取上周
  4510. handleGetPrevWeek() {
  4511. const Time = new Date(this.zhoRqi[0])
  4512. let weekNum = Time.getDay()
  4513. weekNum = weekNum == 0 ? 7 : weekNum
  4514. let lastDate = new Date(Time.getTime() - weekNum * 24 * 60 * 60 * 1000)
  4515. let fitstDate = new Date(
  4516. Time.getTime() - (weekNum + 6) * 24 * 60 * 60 * 1000
  4517. )
  4518. let startDate = `${fitstDate.getFullYear()}-${
  4519. fitstDate.getMonth() + 1 < 10
  4520. ? '0' + (fitstDate.getMonth() + 1)
  4521. : fitstDate.getMonth() + 1
  4522. }-${
  4523. fitstDate.getDate() < 10
  4524. ? '0' + fitstDate.getDate()
  4525. : fitstDate.getDate()
  4526. }`
  4527. let endDate = `${lastDate.getFullYear()}-${
  4528. lastDate.getMonth() + 1 < 10
  4529. ? '0' + (lastDate.getMonth() + 1)
  4530. : lastDate.getMonth() + 1
  4531. }-${
  4532. lastDate.getDate() < 10 ? '0' + lastDate.getDate() : lastDate.getDate()
  4533. }`
  4534. var stat = this.dealdate(startDate)
  4535. var ends = this.dealdate(endDate)
  4536. var end = this.dateChange(-2, ends)
  4537. this.zhoRqi = [stat, end]
  4538. this.zhoRqis()
  4539. // this.jiazai()
  4540. },
  4541. // 获取下周
  4542. handleGetNextvWeek() {
  4543. const Time = new Date(this.zhoRqi[1])
  4544. let weekNum = Time.getDay()
  4545. weekNum = weekNum == 0 ? 7 : weekNum
  4546. let fitstDate = new Date(
  4547. Time.getTime() + (7 - weekNum + 1) * 24 * 60 * 60 * 1000
  4548. )
  4549. let lastDate = new Date(
  4550. Time.getTime() + (7 - weekNum + 7) * 24 * 60 * 60 * 1000
  4551. )
  4552. let startDate = `${fitstDate.getFullYear()}-${
  4553. fitstDate.getMonth() + 1 < 10
  4554. ? '0' + (fitstDate.getMonth() + 1)
  4555. : fitstDate.getMonth() + 1
  4556. }-${
  4557. fitstDate.getDate() < 10
  4558. ? '0' + fitstDate.getDate()
  4559. : fitstDate.getDate()
  4560. }`
  4561. let endDate = `${lastDate.getFullYear()}-${
  4562. lastDate.getMonth() + 1 < 10
  4563. ? '0' + (lastDate.getMonth() + 1)
  4564. : lastDate.getMonth() + 1
  4565. }-${
  4566. lastDate.getDate() < 10 ? '0' + lastDate.getDate() : lastDate.getDate()
  4567. }`
  4568. var stat = this.dealdate(startDate)
  4569. var ends = this.dealdate(endDate)
  4570. var end = this.dateChange(-2, ends)
  4571. this.zhoRqi = [stat, end]
  4572. this.zhoRqis()
  4573. // this.jiazai()
  4574. },
  4575. // 新增日期
  4576. newDates() {
  4577. // console.log(this.zhoRqi, '看卡')
  4578. let edate = new Date(this.zhoRqi[1])
  4579. let nowdate = new Date()
  4580. let nowdate2
  4581. if(this.user.timeType.fillAhead == 1){
  4582. let week = nowdate.getDay()
  4583. const endDay = week > 5 ? 0 : 5 - week
  4584. const endDate = new Date(nowdate.getTime() + endDay * millisecond)
  4585. nowdate2 = this.dealdate(endDate)
  4586. }else{
  4587. nowdate2 = new Date(nowdate.getFullYear(),nowdate.getMonth(),nowdate.getDate())
  4588. }
  4589. if(edate >= nowdate2){
  4590. return
  4591. }
  4592. this.zhoRqi[1] = this.dateChange(1, this.zhoRqi[1])
  4593. var obj = {}
  4594. obj.zhoDataTime = this.zhoRqi[1]
  4595. obj.he = 0
  4596. for(var j in this.projectList) {
  4597. var xinzhi = this.projectList[j].projectName
  4598. obj[xinzhi] = {}
  4599. obj[xinzhi].time = ''
  4600. obj[xinzhi].con = ''
  4601. obj[xinzhi].progress = 0
  4602. obj[xinzhi].workingTime = 0
  4603. }
  4604. this.zhoData.push(obj)
  4605. if(this.user.timeType.showDdCardtime == 1 || this.user.timeType.showCorpwxCardtime == 1){
  4606. this.getWeeklyCardTime();
  4607. }
  4608. this.getWeeklyWorkTime();
  4609. },
  4610. // 减去时间
  4611. dateChange(num = 1,date = false) {
  4612. if (!date) {
  4613. date = new Date();//没有传入值时,默认是当前日期
  4614. date = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
  4615. }
  4616. date += " 00:00:00";//设置为当天凌晨12点
  4617. date = Date.parse(new Date(date))/1000;//转换为时间戳
  4618. date += (86400) * num;//修改后的时间戳
  4619. var newDate = new Date(parseInt(date) * 1000);//转换为时间
  4620. var nian = newDate.getFullYear()
  4621. var yue = ''
  4622. var ri = ''
  4623. var yues = (newDate.getMonth() + 1)
  4624. var ris = newDate.getDate()
  4625. yues > 9 ? yue = yues : yue = '0' + yues
  4626. ris > 9 ? ri = ris : ri = '0' + ris
  4627. return nian +'-'+yue+'-'+ri
  4628. },
  4629. // 加载动画
  4630. jiazai() {
  4631. this.zhoLoading = true
  4632. var that = this
  4633. setTimeout(() =>{
  4634. that.zhoLoading = false
  4635. },1000);
  4636. },
  4637. // 转时间格式
  4638. dealdate(date) {
  4639. const dt = new Date(date)
  4640. const y = dt.getFullYear()
  4641. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  4642. const d = (dt.getDate() + '').padStart(2, '0')
  4643. return `${y}-${m}-${d}`
  4644. },
  4645. // 按周填报
  4646. fillInReportss() {
  4647. window.addEventListener('scroll', this.handleScroll, true)
  4648. // this.jiazai()
  4649. this.diasZho = true
  4650. this.getCurrentWeek()
  4651. // 项目数量判断 <=5
  4652. if(this.projectList.length < 5){
  4653. this.selProjectList = this.projectList
  4654. this.selConShow = false
  4655. }
  4656. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  4657. //重新获取工时预警类型的预算项
  4658. this.http.post('/project-basecost-setting/getReportBasecostList', {
  4659. companyId: this.user.companyId
  4660. },
  4661. res => {
  4662. if (res.code == "ok") {
  4663. this.timeBasecostList = res.data;
  4664. }
  4665. });
  4666. }
  4667. },
  4668. // 按周填报的项目筛选
  4669. selListFun(){
  4670. this.selProjectList = []
  4671. if(this.selCon.length){
  4672. for (let i = 0; i < this.selCon.length; i++) {
  4673. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  4674. }
  4675. this.selConShow = false
  4676. }else{
  4677. this.$message({
  4678. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  4679. type:'error'
  4680. })
  4681. }
  4682. },
  4683. getWeeklyCardTime(){ //按周填报获取考勤信息
  4684. let dateStr = []
  4685. for(let i in this.zhoData){
  4686. dateStr.push(this.zhoData[i].zhoDataTime)
  4687. }
  4688. this.http.post('/report/getWeeklyCardTime',{
  4689. dateStr: JSON.stringify(dateStr)
  4690. },res => {
  4691. if(res.code == 'ok'){
  4692. for(let i in res.data){
  4693. let datei = '';
  4694. if (this.user.timeType.showDdCardtime == 1) {
  4695. datei = res.data[i].workDate.split('-');
  4696. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  4697. datei = res.data[i].createDate.split('-');
  4698. }
  4699. for(let m in this.zhoData){
  4700. let datem = new Date(this.zhoData[m].zhoDataTime)
  4701. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  4702. let item = {
  4703. startTime: res.data[i].startTime,
  4704. endTime: res.data[i].endTime,
  4705. workHours: res.data[i].workHours
  4706. }
  4707. this.$set(this.zhoData[m],'corpTime',item)
  4708. }
  4709. }
  4710. }
  4711. }else{
  4712. this.$message({
  4713. message: res.msg,
  4714. type: 'error'
  4715. })
  4716. }
  4717. },err => {
  4718. this.$message({
  4719. message: err,
  4720. type: 'error'
  4721. })
  4722. })
  4723. },
  4724. getWeeklyWorkTime(){ //按周填报获取已填工时
  4725. let dateStr = []
  4726. for(let i in this.zhoData){
  4727. dateStr.push(this.zhoData[i].zhoDataTime)
  4728. }
  4729. this.http.post('/report/getWeeklyWorkTime',{
  4730. dateStr: JSON.stringify(dateStr)
  4731. },res => {
  4732. if(res.code == 'ok'){
  4733. for(let n in this.zhoData){
  4734. delete this.zhoData[n].filledTime
  4735. }
  4736. for(let i in res.data){
  4737. let datei = res.data[i].createDate.split('-');
  4738. for(let m in this.zhoData){
  4739. let datem = new Date(this.zhoData[m].zhoDataTime)
  4740. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  4741. this.$set(this.zhoData[m],'filledTime',res.data[i].workingTime)
  4742. let reportTimes = [];
  4743. if (res.data[i].startTime != null) {
  4744. reportTimes = res.data[i].startTime.split(',')
  4745. }
  4746. this.$set(this.zhoData[m],'reportTimes',reportTimes)
  4747. }
  4748. }
  4749. }
  4750. // console.log('zhodata',this.zhoData);
  4751. }else{
  4752. this.$message({
  4753. message: res.msg,
  4754. type: 'error'
  4755. })
  4756. }
  4757. },err => {
  4758. this.$message({
  4759. message: err,
  4760. type: 'error'
  4761. })
  4762. })
  4763. },
  4764. selListqx(){
  4765. this.diasZho = false
  4766. this.selProjectList = []
  4767. this.selCon = []
  4768. },
  4769. handleScroll() {
  4770. this.changdu = this.projectList.length + 1
  4771. },
  4772. // 自动选择时间点的事件
  4773. zhoTimes(item, i, ims, event) {
  4774. var iss = i
  4775. if(item.time == null) {
  4776. return
  4777. } else {
  4778. var zhi = this.zhoData[iss]
  4779. var he = 0
  4780. for(var i in zhi) {
  4781. if(zhi[i].time && zhi[i].time.length > 0 && i != 'zhoDataTime' && i != 'he') {
  4782. var date2 = '2021/12/12 ' + zhi[i].time[1] +':00'
  4783. var date1 = '2021/12/12 ' + zhi[i].time[0] +':00'
  4784. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  4785. var leave1=date3%(24*3600*1000)
  4786. var hours=Math.floor(leave1/(3600*1000))
  4787. var leave2=leave1%(3600*1000)
  4788. var minutes=Math.floor(leave2/(60*1000))
  4789. var shi = hours+'.'+ minutes
  4790. he += +shi
  4791. }
  4792. }
  4793. zhi.he = he + 'h'
  4794. }
  4795. },
  4796. // 自动选择事件长度的事件
  4797. zhoXuan(item, i) {
  4798. var iss = i
  4799. if(item.time == null) {
  4800. return
  4801. } else {
  4802. var zhi = this.zhoData[iss]
  4803. var he = 0
  4804. for(var i in zhi) {
  4805. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  4806. he += +zhi[i].workingTime
  4807. }
  4808. }
  4809. zhi.he = he + 'h'
  4810. }
  4811. },
  4812. // 按时间比例
  4813. addBli(item, i) {
  4814. var iss = i
  4815. if(item.time == null) {
  4816. return
  4817. } else {
  4818. var zhi = this.zhoData[iss]
  4819. var he = 0
  4820. for(var i in zhi) {
  4821. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  4822. he += +zhi[i].workingTime
  4823. }
  4824. }
  4825. zhi.he = he.toFixed(1) + 'h'
  4826. }
  4827. },
  4828. zhoRqis() {
  4829. let nowdate = new Date()
  4830. let nowdate2
  4831. if(this.user.timeType.fillAhead == 1){
  4832. const millisecond = 1000 * 60 * 60 * 24
  4833. let week = nowdate.getDay()
  4834. const endDay = week == 0 || week == 6 ? 0 : 5 - week
  4835. const endDate = new Date(nowdate.getTime() + endDay * millisecond)
  4836. nowdate2 = this.dealdate(endDate)
  4837. }else{
  4838. nowdate2 = new Date(nowdate.getFullYear(),nowdate.getMonth(),nowdate.getDate())
  4839. }
  4840. let edate = new Date(this.zhoRqi[1])
  4841. if(edate >= nowdate2){
  4842. let emon = nowdate2.getMonth() + 1
  4843. let eday = nowdate2.getDate()
  4844. let edate2 = nowdate2.getFullYear() + '-' + (emon < 10 ? '0' + emon : emon) + '-' + (eday < 10 ? '0' + eday : eday)
  4845. this.zhoRqi[1] = edate2
  4846. }
  4847. this.zhoData = []
  4848. if(this.zhoRqi) {
  4849. var stime = this.zhoRqi[0]
  4850. var etime = this.zhoRqi[1]
  4851. var zhi = this.getdiffdate(stime, etime)
  4852. var arrst = []
  4853. for(var i in zhi) {
  4854. var obj = {}
  4855. obj.zhoDataTime = zhi[i]
  4856. obj.he = 0
  4857. for(var j in this.projectList) {
  4858. var xinzhi = this.projectList[j].projectName
  4859. obj[xinzhi] = {}
  4860. obj[xinzhi].time = ''
  4861. obj[xinzhi].con = ''
  4862. obj[xinzhi].progress = 0
  4863. obj[xinzhi].workingTime = 0
  4864. }
  4865. arrst.push(obj)
  4866. }
  4867. this.zhoData = arrst
  4868. }
  4869. if(this.zhoData.length && (this.user.timeType.showDdCardtime == 1 || this.user.timeType.showCorpwxCardtime == 1)){
  4870. this.getWeeklyCardTime()
  4871. // this.getWeeklyFilledTime()
  4872. }
  4873. if (this.zhoData.length) {
  4874. this.getWeeklyWorkTime();
  4875. }
  4876. },
  4877. zhoZhi(res, i) {
  4878. var zhi = 0
  4879. for(var i in res) {
  4880. if(i != 'zhoDataTime' && i != 'he') {
  4881. zhi += +res[i]
  4882. }
  4883. }
  4884. res.he = zhi
  4885. },
  4886. zhoBtn(i) {
  4887. // this.zhoData.split(i, 1)
  4888. var arr = this.zhoData
  4889. arr.splice(i, 1)
  4890. },
  4891. zhoAddlast(){
  4892. this.selConShow = true
  4893. },
  4894. zhoAddqx(){
  4895. this.diasZho = false
  4896. this.selConShow = true
  4897. this.selProjectList = []
  4898. this.selCon = []
  4899. },
  4900. // 提交按周填报
  4901. zhoAdd() {
  4902. var zhi = this.zhoData
  4903. var ll = 0
  4904. if(this.reportTimeType.type == 2) {
  4905. for(var i in zhi) {
  4906. this.dateAr = []
  4907. var alp = []
  4908. var zhis = zhi[i]
  4909. for(var j in zhis) {
  4910. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  4911. let objs = {}
  4912. objs.s = zhis[j].time[0]
  4913. objs.e = zhis[j].time[1]
  4914. alp.push(objs)
  4915. }
  4916. }
  4917. if(zhis.reportTimes){
  4918. for(let k in zhis.reportTimes){
  4919. let objs = {}
  4920. objs.s = zhis.reportTimes[k].split('-')[0]
  4921. objs.e = zhis.reportTimes[k].split('-')[1]
  4922. alp.push(objs)
  4923. }
  4924. }
  4925. this.dateAr = alp
  4926. if(this.dateAr.length > 0) {
  4927. let trus = this.fns()
  4928. ll += 1
  4929. if(!trus) {
  4930. this.$message({
  4931. message: this.$t('message.Filledtimeperiodsoverlap'),
  4932. type: 'error'
  4933. })
  4934. return false
  4935. }
  4936. }
  4937. }
  4938. if(ll == 0) {
  4939. this.$message({
  4940. message: this.$t('message.Pleasefillinthetime'),
  4941. type: 'error'
  4942. })
  4943. return false
  4944. }
  4945. } else if(this.reportTimeType.type == 1){
  4946. for(var i in zhi) {
  4947. var zhis = zhi[i]
  4948. for(var j in zhis) {
  4949. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  4950. ll += 1
  4951. }
  4952. }
  4953. }
  4954. if(ll == 0) {
  4955. this.$message({
  4956. message: this.$t('message.Pleaseselectatime'),
  4957. type: 'error'
  4958. })
  4959. return false
  4960. }
  4961. let overcorp = ''
  4962. for(let n in zhi){
  4963. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  4964. overcorp += zhi[n].zhoDataTime + ','
  4965. }
  4966. }
  4967. if(overcorp != ''){
  4968. overcorp = overcorp.substring(0,overcorp.length - 1)
  4969. this.$message({
  4970. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  4971. type: 'error'
  4972. })
  4973. return
  4974. }
  4975. }
  4976. var submits = []
  4977. let formData = new FormData();
  4978. if(this.reportTimeType.multiWorktime == 1){
  4979. for (var i in this.zhoData) {
  4980. var zhoD = this.zhoData[i]
  4981. var flgs = false
  4982. for(var j in zhoD) {
  4983. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  4984. flgs = true
  4985. // formData.append("degreeId", "-1");
  4986. formData.append("id", '-1');
  4987. for(var s in this.projectList) {
  4988. if(j == this.projectList[s].projectName) {
  4989. formData.append("projectId", this.projectList[s].id);
  4990. }
  4991. }
  4992. if(this.user.timeType.reportAuditType == 3){
  4993. let audItem = {}
  4994. if(this.user.timeType.auditLevel > 0){
  4995. audItem.auditorFirst = zhoD[j].auditorFirst
  4996. }
  4997. if(this.user.timeType.auditLevel > 1){
  4998. audItem.auditorSec = zhoD[j].auditorSec
  4999. }
  5000. if(this.user.timeType.auditLevel > 2){
  5001. audItem.auditorThird = zhoD[j].auditorThird
  5002. }
  5003. if(zhoD[j].ccUserid){
  5004. audItem.ccUserid = zhoD[j].ccUserid
  5005. }
  5006. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  5007. }
  5008. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  5009. formData.append("taskId", 0);
  5010. formData.append("reportTimeType", this.reportTimeType.type);
  5011. formData.append("endTime", '');
  5012. formData.append("startTime", '');
  5013. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  5014. var lix = []
  5015. var objjs = {}
  5016. objjs.startTime = zhoD[j].time[0]
  5017. objjs.endTime = zhoD[j].time[1]
  5018. if (zhoD[j].con == null || zhoD[j].con == '') {
  5019. zhoD[j].con == '-'
  5020. }
  5021. objjs.content = zhoD[j].con
  5022. lix.push(objjs)
  5023. var zhiZhi = JSON.stringify(lix)
  5024. zhiZhi = zhiZhi.replace(/,/g,"@");
  5025. formData.append("content", zhiZhi)
  5026. formData.append("isOvertime", 0)
  5027. formData.append("professionProgress", "[]")
  5028. if (zhoD[j].groupId) {
  5029. formData.append("groupId",zhoD[j].groupId)
  5030. } else {
  5031. //解决后台groupId数组越界的问题
  5032. formData.append("groupId",0)
  5033. }
  5034. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  5035. formData.append("createDate",zhoD.zhoDataTime)
  5036. if (zhoD[j].projectAuditorId) {
  5037. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  5038. }
  5039. if(zhoD[j].basecostId) {
  5040. formData.append("basecostId", zhoD[j].basecostId);
  5041. } else {
  5042. formData.append("basecostId", 0);
  5043. }
  5044. if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
  5045. formData.append('degreeId',zhoD[j].degreeId)
  5046. }else{
  5047. formData.append("degreeId", "-1");
  5048. }
  5049. if(this.user.timeType.customDataActive && zhoD[j].customData){
  5050. formData.append('customData',zhoD[j].customData)
  5051. }else if(this.user.timeType.customDataActive){
  5052. formData.append('customData',0)
  5053. }
  5054. if(this.user.timeType.customTextActive && zhoD[j].customText){
  5055. formData.append('customText',zhoD[j].customText)
  5056. }else if(this.user.timeType.customTextActive){
  5057. formData.append('customText','-')
  5058. }
  5059. }
  5060. }
  5061. }
  5062. } else {
  5063. for (var i in this.zhoData) {
  5064. var zhoD = this.zhoData[i]
  5065. var flgs = false
  5066. if(this.reportTimeType.type == 2) {
  5067. for(var j in zhoD) {
  5068. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  5069. flgs = true
  5070. // formData.append("degreeId", "-1");
  5071. formData.append("id", '-1');
  5072. for(var s in this.projectList) {
  5073. if(j == this.projectList[s].projectName) {
  5074. formData.append("projectId", this.projectList[s].id);
  5075. }
  5076. }
  5077. if(this.user.timeType.reportAuditType == 3){
  5078. let audItem = {}
  5079. if(this.user.timeType.auditLevel > 0){
  5080. audItem.auditorFirst = zhoD[j].auditorFirst
  5081. }
  5082. if(this.user.timeType.auditLevel > 1){
  5083. audItem.auditorSec = zhoD[j].auditorSec
  5084. }
  5085. if(this.user.timeType.auditLevel > 2){
  5086. audItem.auditorThird = zhoD[j].auditorThird
  5087. }
  5088. if(zhoD[j].ccUserid){
  5089. audItem.ccUserid = zhoD[j].ccUserid
  5090. }
  5091. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  5092. }
  5093. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  5094. formData.append("taskId", 0);
  5095. formData.append("reportTimeType", this.reportTimeType.type);
  5096. formData.append("endTime", zhoD[j].time[1]);
  5097. formData.append("startTime", zhoD[j].time[0]);
  5098. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  5099. zhoD[j].con == '' || zhoD[j].con == null ? formData.append("content", '-') : formData.append("content", zhoD[j].con)
  5100. formData.append("isOvertime", 0)
  5101. formData.append("professionProgress", "[]")
  5102. if (zhoD[j].groupId) {
  5103. formData.append("groupId",zhoD[j].groupId)
  5104. } else {
  5105. //解决后台groupId数组越界的问题
  5106. formData.append("groupId",0)
  5107. }
  5108. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  5109. formData.append("createDate",zhoD.zhoDataTime)
  5110. if (zhoD[j].projectAuditorId) {
  5111. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  5112. }
  5113. if(zhoD[j].basecostId) {
  5114. formData.append("basecostId", zhoD[j].basecostId);
  5115. } else {
  5116. formData.append("basecostId", 0);
  5117. }
  5118. if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
  5119. formData.append('degreeId',zhoD[j].degreeId)
  5120. }else{
  5121. formData.append("degreeId", "-1");
  5122. }
  5123. if(this.user.timeType.customDataActive && zhoD[j].customData){
  5124. formData.append('customData',zhoD[j].customData)
  5125. }else if(this.user.timeType.customDataActive){
  5126. formData.append('customData',0)
  5127. }
  5128. if(this.user.timeType.customTextActive && zhoD[j].customText){
  5129. formData.append('customText',zhoD[j].customText)
  5130. }else if(this.user.timeType.customTextActive){
  5131. formData.append('customText','-')
  5132. }
  5133. }
  5134. }
  5135. } else {
  5136. for(var j in zhoD) {
  5137. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].workingTime && zhoD[j].workingTime.length > 0 && zhoD[j].workingTime > 0 && zhoD[j].workingTime != null && zhoD[j].workingTime != 'null') {
  5138. flgs = true
  5139. // formData.append("degreeId", "-1");
  5140. formData.append("id", '-1');
  5141. for(var s in this.projectList) {
  5142. if(j == this.projectList[s].projectName) {
  5143. formData.append("projectId", this.projectList[s].id);
  5144. }
  5145. }
  5146. if(this.user.timeType.reportAuditType == 3){
  5147. let audItem = {}
  5148. if(this.user.timeType.auditLevel > 0){
  5149. audItem.auditorFirst = zhoD[j].auditorFirst
  5150. }
  5151. if(this.user.timeType.auditLevel > 1){
  5152. audItem.auditorSec = zhoD[j].auditorSec
  5153. }
  5154. if(this.user.timeType.auditLevel > 2){
  5155. audItem.auditorThird = zhoD[j].auditorThird
  5156. }
  5157. if(zhoD[j].ccUserid){
  5158. audItem.ccUserid = zhoD[j].ccUserid
  5159. }
  5160. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  5161. }
  5162. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  5163. // formData.append("subProjectId", zhoD[j].subProjectId);
  5164. formData.append("taskId", 0);
  5165. formData.append("reportTimeType", this.reportTimeType.type);
  5166. if(this.reportTimeType.type == 1) {
  5167. formData.append("workingTime", zhoD[j].workingTime);
  5168. } else if(this.reportTimeType.type == 2) {
  5169. formData.append("endTime", zhoD[j].time[1]);
  5170. formData.append("startTime", zhoD[j].time[0]);
  5171. } else if(this.reportTimeType.type == 3) {
  5172. formData.append("progress", zhoD[j].progress);
  5173. formData.append("workingTime", zhoD[j].workingTime);
  5174. }
  5175. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  5176. zhoD[j].con == '' || zhoD[j].con == null ? formData.append("content", '-') : formData.append("content", zhoD[j].con)
  5177. formData.append("isOvertime", 0)
  5178. formData.append("professionProgress", "[]")
  5179. if (zhoD[j].groupId) {
  5180. formData.append("groupId",zhoD[j].groupId)
  5181. } else {
  5182. //解决后台groupId数组越界的问题
  5183. formData.append("groupId",0)
  5184. }
  5185. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  5186. formData.append("createDate",zhoD.zhoDataTime)
  5187. if (zhoD[j].projectAuditorId) {
  5188. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  5189. }
  5190. if(zhoD[j].basecostId) {
  5191. formData.append("basecostId", zhoD[j].basecostId);
  5192. } else {
  5193. formData.append("basecostId", 0);
  5194. }
  5195. if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
  5196. formData.append('degreeId',zhoD[j].degreeId)
  5197. }else{
  5198. formData.append("degreeId", "-1");
  5199. }
  5200. if(this.user.timeType.customDataActive && zhoD[j].customData){
  5201. formData.append('customData',zhoD[j].customData)
  5202. }else if(this.user.timeType.customDataActive){
  5203. formData.append('customData',0)
  5204. }
  5205. if(this.user.timeType.customTextActive && zhoD[j].customText){
  5206. formData.append('customText',zhoD[j].customText)
  5207. }else if(this.user.timeType.customTextActive){
  5208. formData.append('customText','-')
  5209. }
  5210. }
  5211. }
  5212. }
  5213. }
  5214. }
  5215. // 自定义维度
  5216. this.submitingReport = true;
  5217. this.http.uploadFile( this.port.report.editPort, formData,
  5218. res => {
  5219. // this.listLoading = false;
  5220. this.submitingReport = false;
  5221. if (res.code == "ok") {
  5222. this.$message({
  5223. message: this.$t('message.fillinsuccessfully'),
  5224. type: "success"
  5225. });
  5226. this.diasZho = false
  5227. this.selConShow = true
  5228. this.zhoData = []
  5229. this.zhoRqi = ''
  5230. this.getReportList();
  5231. this.getDepartment();
  5232. // 关闭弹窗 并 清空
  5233. this.selProjectList = []
  5234. this.selCon = []
  5235. } else {
  5236. this.$message({
  5237. message: res.msg,
  5238. type: "error"
  5239. });
  5240. }
  5241. },
  5242. error => {
  5243. this.submitingReport = false;
  5244. this.$message({
  5245. message: error,
  5246. type: "error"
  5247. });
  5248. });
  5249. },
  5250. ChangeHourMinutestr (str) {
  5251. if (str !== "0" && str !== "" && str !== null) {
  5252. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  5253. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  5254. } else {
  5255. return "";
  5256. }
  5257. },
  5258. // 得到两个日期中间的日期
  5259. getdiffdate(stime,etime){
  5260. //初始化日期列表,数组
  5261. var diffdate = new Array();
  5262. var i=0;
  5263. //开始日期小于等于结束日期,并循环
  5264. while(stime<=etime){
  5265. diffdate[i] = stime;
  5266. //获取开始日期时间戳
  5267. var stime_ts = new Date(stime).getTime();
  5268. //增加一天时间戳后的日期
  5269. var next_date = stime_ts + (24*60*60*1000);
  5270. //拼接年月日,这里的月份会返回(0-11),所以要+1
  5271. var next_dates_y = new Date(next_date).getFullYear()+'-';
  5272. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  5273. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  5274. stime = next_dates_y+next_dates_m+next_dates_d;
  5275. //增加数组key
  5276. i++;
  5277. }
  5278. return diffdate;
  5279. },
  5280. // 添加模块
  5281. addDomain(i) {
  5282. var leftProgress = 10;
  5283. if (this.reportTimeType.type == 3) {
  5284. //计算已经待分配工时比例
  5285. let array = this.workForm.domains;
  5286. let totalProgress = 0;
  5287. for (var i=0;i<array.length; i++) {
  5288. totalProgress += array[i].progress;
  5289. }
  5290. if (totalProgress < 100) {
  5291. leftProgress = 100 - totalProgress;
  5292. }
  5293. }
  5294. var addItem = {
  5295. projectId: "",
  5296. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):"",
  5297. content: "",
  5298. progress:leftProgress,
  5299. state:2,//2-表示待提交
  5300. multiWorktime: this.reportTimeType.multiWorktime,
  5301. worktimeList:[{}],
  5302. canEdit: true,
  5303. auditorFirst: '',
  5304. auditorSec: '',
  5305. auditorThird: '',
  5306. ccUserid: ''
  5307. // degreeId: '',
  5308. };
  5309. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  5310. this.$set(addItem,'isOvertime',true)
  5311. if(this.reportTimeType.type == 3){
  5312. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  5313. }
  5314. }
  5315. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5316. //默认给第一个,必填字段
  5317. addItem.basecostId = this.timeBasecostList[0].id;
  5318. }
  5319. this.workForm.domains.push(addItem);
  5320. document.getElementById('workFormsItemBottom').scrollIntoView()
  5321. this.canEdit = true
  5322. if (this.reportTimeType.type == 0) {
  5323. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  5324. var length = this.workForm.domains.length;
  5325. if (length == 2) {
  5326. this.showAddMore = false;
  5327. }
  5328. }
  5329. this.chuji()
  5330. },
  5331. // 移除模块
  5332. delDomain(i) {
  5333. this.workForm.domains.splice(i,1)
  5334. let iscan = false
  5335. for(let i in this.workForm.domains){
  5336. if(this.workForm.domains[i].canEdit){
  5337. iscan = true
  5338. }
  5339. }
  5340. this.canEdit = iscan
  5341. //检测当前剩下的一个,时间类型是否是全天
  5342. if (this.reportTimeType.type == 0) {
  5343. if (this.workForm.domains[0].timeType == 0) {
  5344. this.showAddMore = false;
  5345. } else {
  5346. this.showAddMore = true;
  5347. }
  5348. }
  5349. if(this.user.timeType.multiWorktime == 1) {
  5350. this.iptChangs()
  5351. } else {
  5352. this.seleChn(0)
  5353. }
  5354. },
  5355. // 改变月份
  5356. changeMonth() {
  5357. this.isWeekend = false
  5358. let date = new Date()
  5359. let nowmon = date.getMonth() + 1
  5360. let nowday = date.getDate()
  5361. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  5362. if (this.isBatch == 0) {
  5363. if(this.user.timeType.fillAhead == 0){
  5364. let date_a = new Date(this.workForm.createDate)
  5365. if(date_a.getTime() > date.getTime()){
  5366. this.workForm.createDate = nowdate
  5367. }
  5368. }
  5369. //只有按天填报才能获取当天的日报
  5370. if(!this.isSubstitude){
  5371. let weekday = new Date(this.workForm.createDate).getDay()
  5372. if(this.user.companyId == 817){
  5373. if(weekday == 0){
  5374. this.isWeekend = true
  5375. }
  5376. }else{
  5377. if(weekday == 0 || weekday == 6){
  5378. this.isWeekend = true
  5379. }
  5380. }
  5381. this.getReport()
  5382. }
  5383. }else {
  5384. if(this.user.timeType.fillAhead == 0){
  5385. let date_a = new Date(this.workForm.createDate[1])
  5386. if(date_a.getTime() > date.getTime()){
  5387. this.workForm.createDate[1] = nowdate
  5388. let sdate = new Date(this.workForm.createDate[0])
  5389. let edate = new Date(this.workForm.createDate[1])
  5390. if(sdate > edate){
  5391. this.workForm.createDate[0] = this.workForm.createDate[1]
  5392. }
  5393. }
  5394. }
  5395. }
  5396. },
  5397. // 判断时间段
  5398. fns() {
  5399. for (let k in this.dateAr) {
  5400. if (!this.judege(k)) {
  5401. return false
  5402. }
  5403. }
  5404. return true
  5405. },
  5406. judege(idx){
  5407. for (let k in this.dateAr) {
  5408. if (idx !== k) {
  5409. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  5410. return false
  5411. }
  5412. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  5413. return false
  5414. }
  5415. }
  5416. }
  5417. return true
  5418. },
  5419. // 保存日报111111
  5420. submitReport(isDraft) {
  5421. this.isDraft = isDraft;
  5422. this.$refs.workForm.validate(valid => {
  5423. if (valid) {
  5424. if(this.totalReportHours < this.user.timeType.allday){
  5425. this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
  5426. confirmButtonText: '确定',
  5427. cancelButtonText: '取消',
  5428. type: 'warning'
  5429. }).then(() => {
  5430. this.submitReportSon()
  5431. }).catch(() => {
  5432. });
  5433. }else{
  5434. this.submitReportSon()
  5435. }
  5436. }
  5437. });
  5438. },
  5439. submitReportSon() {
  5440. this.dateAr = []
  5441. let alp = []
  5442. if(this.user.timeType.multiWorktime != 1) {
  5443. for(var p in this.workForm.domains) {
  5444. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  5445. let objs = {}
  5446. objs.s = this.workForm.domains[p].startTime
  5447. objs.e = this.workForm.domains[p].endTime
  5448. alp.push(objs)
  5449. }
  5450. }
  5451. this.dateAr = alp
  5452. if(this.dateAr.length > 0) {
  5453. let trus = this.fns()
  5454. if(!trus) {
  5455. this.$message({
  5456. message: this.$t('message.Filledtimeperiodsoverlap'),
  5457. type: "error"
  5458. });
  5459. return
  5460. }
  5461. }
  5462. } else {
  5463. for(var p in this.workForm.domains) {
  5464. var slll = this.workForm.domains[p]
  5465. for(var o in slll.worktimeList) {
  5466. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  5467. let objs = {}
  5468. objs.s = slll.worktimeList[o].startTime
  5469. objs.e = slll.worktimeList[o].endTime
  5470. alp.push(objs)
  5471. }
  5472. }
  5473. }
  5474. this.dateAr = alp
  5475. if(this.dateAr.length > 0) {
  5476. let trus = this.fns()
  5477. if(!trus) {
  5478. this.$message({
  5479. message: this.$t('message.Filledtimeperiodsoverlap'),
  5480. type: "error"
  5481. });
  5482. return
  5483. }
  5484. }
  5485. }
  5486. // return
  5487. //代填的情况,检查人员是否已经选择
  5488. if (this.isSubstitude) {
  5489. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  5490. this.$message({
  5491. message: this.$t('message.pleaseselectthepersontofillin'),
  5492. type: "error"
  5493. });
  5494. return;
  5495. }
  5496. }
  5497. //检查时间,全天和上下午不能同时存在
  5498. if (this.reportTimeType.type == 0) {
  5499. var alldayNum = 0;
  5500. var amNum = 0;
  5501. var pmNum = 0;
  5502. for(var i in this.workForm.domains) {
  5503. if (this.workForm.domains[i].timeType == 0) {
  5504. alldayNum ++;
  5505. } else if (this.workForm.domains[i].timeType == 1) {
  5506. amNum++;
  5507. } else if (this.workForm.domains[i].timeType == 2) {
  5508. pmNum++;
  5509. }
  5510. }
  5511. if (alldayNum > 1) {
  5512. this.$message({
  5513. // message: "工作时间-全天,只能选择一次",
  5514. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  5515. type: "error"
  5516. });
  5517. return;
  5518. }
  5519. if (amNum > 1) {
  5520. this.$message({
  5521. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  5522. type: "error"
  5523. });
  5524. return;
  5525. }
  5526. if (pmNum > 1) {
  5527. this.$message({
  5528. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  5529. type: "error"
  5530. });
  5531. return;
  5532. }
  5533. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  5534. this.$message({
  5535. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  5536. type: "error"
  5537. });
  5538. return;
  5539. }
  5540. } else if (this.reportTimeType.type == 3) {
  5541. //总百分比不能超过100%
  5542. let total = 0;
  5543. this.workForm.domains.forEach(w=>{total += w.progress});
  5544. if (total > 100) {
  5545. this.$message({
  5546. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  5547. type: "error"
  5548. });
  5549. return;
  5550. } else if (total < 100) {
  5551. this.$message({
  5552. message: this.$t('message.cannotbesubmitted'),
  5553. type: "error"
  5554. });
  5555. return;
  5556. }
  5557. }
  5558. this.listLoading = true;
  5559. let formData = new FormData();
  5560. formData.append("draft", this.isDraft);
  5561. var totalTime = 0;
  5562. for (var t=0;t<this.workForm.domains.length; t++) {
  5563. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  5564. }
  5565. //批量填报不校验考勤时长,交给后台校验
  5566. if (!this.isBatch) {
  5567. if(this.user.timeType.notAllowedNoAttendance == 1){
  5568. if (this.workForm.time){
  5569. if (this.workForm.time.workHours == 0){
  5570. this.$message({
  5571. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5572. type: 'error'
  5573. })
  5574. return
  5575. }
  5576. }else{
  5577. this.$message({
  5578. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5579. type: 'error'
  5580. })
  5581. return
  5582. }
  5583. }
  5584. }
  5585. if (this.reportTimeType.type == 1 && this.workForm.time) {
  5586. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  5587. this.$message({
  5588. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  5589. type: "error"
  5590. });
  5591. return;
  5592. }
  5593. }
  5594. for(var i in this.workForm.domains) {
  5595. if(this.user.timeType.reportAuditType == 3){
  5596. let audItem = {}
  5597. let auditRule = ''
  5598. if(this.workForm.domains[i].id){
  5599. audItem.reportId = this.workForm.domains[i].id
  5600. }
  5601. if(this.user.timeType.auditLevel > 0){
  5602. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  5603. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  5604. }
  5605. if(this.user.timeType.auditLevel > 1){
  5606. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  5607. audItem.auditorSec = this.workForm.domains[i].auditorSec
  5608. }
  5609. if(this.user.timeType.auditLevel > 2){
  5610. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  5611. audItem.auditorThird = this.workForm.domains[i].auditorThird
  5612. }
  5613. if(this.workForm.domains[i].ccUserid){
  5614. audItem.ccUserid = this.workForm.domains[i].ccUserid
  5615. }
  5616. if(auditRule){
  5617. auditRule = auditRule.substring(0,auditRule.length - 1)
  5618. this.$message({
  5619. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  5620. type: 'error'
  5621. })
  5622. return
  5623. }
  5624. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  5625. }
  5626. if(this.workForm.domains[i].degreeId) {
  5627. // var sss = this.workForm.domains[i].degreeId.toString()
  5628. formData.append("degreeId", this.workForm.domains[i].degreeId);
  5629. } else {
  5630. formData.append("degreeId", -1);
  5631. }
  5632. if(this.workForm.domains[i].customData) {
  5633. // var sss = this.workForm.domains[i].degreeId.toString()
  5634. formData.append("customData", this.workForm.domains[i].customData);
  5635. } else {
  5636. formData.append("customData", 0);
  5637. }
  5638. if(this.workForm.domains[i].customText) {
  5639. formData.append("customText", this.workForm.domains[i].customText);
  5640. } else {
  5641. formData.append("customText", '-');
  5642. }
  5643. if (this.workForm.domains[i].id) {
  5644. formData.append("id", this.workForm.domains[i].id);
  5645. } else {
  5646. formData.append("id", -1);
  5647. }
  5648. formData.append("projectId", this.workForm.domains[i].projectId);
  5649. if (this.workForm.domains[i].subProjectId) {
  5650. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  5651. } else {
  5652. formData.append("subProjectId", 0);
  5653. }
  5654. if (this.workForm.domains[i].groupId) {
  5655. formData.append("groupId", this.workForm.domains[i].groupId);
  5656. } else {
  5657. formData.append("groupId", 0);
  5658. }
  5659. if (this.workForm.domains[i].taskId) {
  5660. formData.append("taskId", this.workForm.domains[i].taskId);
  5661. } else {
  5662. formData.append("taskId", 0);
  5663. }
  5664. if (this.workForm.domains[i].taskFinish == true) {
  5665. formData.append("taskFinish", 1);
  5666. } else {
  5667. formData.append("taskFinish", 0);
  5668. }
  5669. formData.append("reportTimeType", this.reportTimeType.type);
  5670. if (this.reportTimeType.type == 0) {
  5671. formData.append("timeType", this.workForm.domains[i].timeType);
  5672. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  5673. formData.append("workingTime", workingTime);
  5674. } else if (this.reportTimeType.type == 1){
  5675. formData.append("workingTime", this.workForm.domains[i].workingTime);
  5676. } else if (this.reportTimeType.type == 2) {
  5677. formData.append("endTime", this.workForm.domains[i].endTime);
  5678. formData.append("startTime", this.workForm.domains[i].startTime);
  5679. } else if (this.reportTimeType.type == 3) {
  5680. //按比例分配
  5681. formData.append("progress", this.workForm.domains[i].progress);
  5682. formData.append("workingTime", this.workForm.domains[i].workingTime);
  5683. }
  5684. //处理多个时间事项
  5685. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  5686. if (this.reportTimeType.multiWorktime == 1) {
  5687. //检查时间是否有重叠
  5688. var workList = this.workForm.domains[i].worktimeList;
  5689. for (var j=0;j<workList.length; j++) {
  5690. var curItem = workList[j];
  5691. //检查开始时间是否大于结束时间
  5692. if (curItem.startTime >= curItem.endTime) {
  5693. this.$message({
  5694. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  5695. this.$t('message.Endtimemustbegreaterthanstarttime'),
  5696. type: "error"
  5697. });
  5698. return;
  5699. }
  5700. for (var p = j+1;p<workList.length; p++) {
  5701. var jItem = workList[p];
  5702. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  5703. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  5704. this.$message({
  5705. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  5706. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  5707. type: "error"
  5708. });
  5709. return;
  5710. }
  5711. }
  5712. }
  5713. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  5714. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  5715. formData.append("content", m);
  5716. } else {
  5717. if (this.workForm.domains[i].content) {
  5718. formData.append("content", this.workForm.domains[i].content);
  5719. } else {
  5720. formData.append("content", '-');
  5721. }
  5722. }
  5723. if (this.isBatch == 0) {
  5724. formData.append("createDate", this.workForm.createDate);
  5725. } else {
  5726. //批量填报,时间范围
  5727. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  5728. }
  5729. if(this.workForm.domains[i].isOvertime) {
  5730. formData.append("isOvertime", 1);
  5731. } else {
  5732. formData.append("isOvertime", 0);
  5733. }
  5734. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  5735. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  5736. } else {
  5737. formData.append("overtimeHours", 0);
  5738. }
  5739. if(this.workForm.domains[i].basecostId) {
  5740. formData.append("basecostId", this.workForm.domains[i].basecostId);
  5741. } else {
  5742. formData.append("basecostId", 0);
  5743. }
  5744. if (this.workForm.userId != null) {
  5745. var targetUids = '';
  5746. this.workForm.userId.forEach(u=>{
  5747. targetUids += u + '@';
  5748. });
  5749. if (targetUids.length > 0) {
  5750. targetUids = targetUids.substring(0, targetUids.length -1);
  5751. formData.append("targetUids", targetUids);
  5752. }
  5753. }
  5754. //项目专业进度
  5755. if (this.workForm.domains[i].professionProgress) {
  5756. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  5757. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  5758. formData.append("professionProgress", m);
  5759. } else {
  5760. formData.append("professionProgress", "[]");
  5761. }
  5762. if (this.workForm.domains[i].stage) {
  5763. formData.append("stage", this.workForm.domains[i].stage);
  5764. } else {
  5765. formData.append("stage", "-");
  5766. }
  5767. // console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
  5768. if (this.workForm.domains[i].projectAuditorId) {
  5769. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  5770. } else {
  5771. // console.log('执行到了这里')
  5772. // console.log(this.user.timeType.reportAuditType)
  5773. if (this.user.timeType.reportAuditType == 0) {
  5774. this.$message({
  5775. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  5776. type: "error"
  5777. });
  5778. return;
  5779. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
  5780. //分组负责人先审核, 确定是选择了任务分组
  5781. if (this.workForm.domains[i].taskGroups.length == 0) {
  5782. this.$message({
  5783. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  5784. type: "error"
  5785. });
  5786. } else if (!this.workForm.domains[i].groupId) {
  5787. // console.log(this.workForm.domains[i]);
  5788. this.$message({
  5789. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  5790. type: "error"
  5791. });
  5792. } else {
  5793. this.$message({
  5794. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  5795. type: "error"
  5796. });
  5797. }
  5798. return;
  5799. }
  5800. }
  5801. }
  5802. this.submitingReport = true;
  5803. this.http.uploadFile( this.port.report.editPort, formData,
  5804. res => {
  5805. this.listLoading = false;
  5806. this.submitingReport = false;
  5807. if (res.code == "ok") {
  5808. this.$message({
  5809. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  5810. type: "success"
  5811. });
  5812. this.dialogVisible = false;
  5813. this.jsDay = 0
  5814. this.jsTime = 0
  5815. this.getReportList();
  5816. this.getDepartment();
  5817. } else {
  5818. this.$message({
  5819. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  5820. type: "error"
  5821. });
  5822. }
  5823. },
  5824. error => {
  5825. this.listLoading = false;
  5826. this.submitingReport = false;
  5827. this.$message({
  5828. message: error,
  5829. type: "error"
  5830. });
  5831. });
  5832. },
  5833. // 判断是展示那个工时导入
  5834. imports() {
  5835. if(this.user.timeType.syncCorpwxTime == 0) {
  5836. this.importDialog = true
  5837. } else {
  5838. this.importWxDialog = true
  5839. }
  5840. },
  5841. // 跳转
  5842. junpToDeskTop(id) {
  5843. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5844. this.$router.push("/desktop/" + id + "/" + this.date +day);
  5845. },
  5846. // 通过日报
  5847. approve(id, item) {
  5848. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5849. this.approveinData = {
  5850. id: id,
  5851. date: this.date +day,
  5852. reportIds: item.id
  5853. }
  5854. if(this.user.timeType.needEvaluate == 1){
  5855. this.$set(this.approveinData,'evaluate','')
  5856. this.approveinDialog = true
  5857. }else{
  5858. this.logining = true;
  5859. this.approveinfun()
  5860. }
  5861. },
  5862. approveinfun(){
  5863. this.http.post( this.port.report.approve, this.approveinData,
  5864. res => {
  5865. this.logining = false;
  5866. if (res.code == "ok") {
  5867. this.approveinDialog = false
  5868. this.$message({
  5869. message: this.$t('message.Reviewsucceeded'),
  5870. type: "success"
  5871. });
  5872. this.getReportList();
  5873. this.getDepartment();
  5874. } else {
  5875. this.$message({
  5876. message: res.msg,
  5877. type: "error"
  5878. });
  5879. }
  5880. },
  5881. error => {
  5882. this.logining = false;
  5883. this.$message({
  5884. message: error,
  5885. type: "error"
  5886. });
  5887. });
  5888. },
  5889. //撤回日报
  5890. cancel(item,e) {
  5891. // console.log('can can need',item);
  5892. this.logining = true;
  5893. var ids = '';
  5894. var data = e ? item : item.data;
  5895. data.forEach(element => {
  5896. if(element.id){
  5897. ids +=(element.id+',');
  5898. }
  5899. });
  5900. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  5901. res => {
  5902. this.logining = false;
  5903. if (res.code == "ok") {
  5904. this.$message({
  5905. message:this.$t('message.Withdrawalsucceeded'),
  5906. type: "success"
  5907. });
  5908. this.getReportList();
  5909. if(e){this.getReport()}
  5910. this.getDepartment();
  5911. } else {
  5912. this.$message({
  5913. message: res.msg,
  5914. type: "error"
  5915. });
  5916. }
  5917. },
  5918. error => {
  5919. this.logining = false;
  5920. this.$message({
  5921. message: error,
  5922. type: "error"
  5923. });
  5924. });
  5925. },
  5926. showDenyDialog(id,i, item) {
  5927. this.denyReasonDialog = true;
  5928. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5929. var ids = item.id;
  5930. // var data = item.data;
  5931. // data.forEach(element => {
  5932. // ids +=(element.id+',');
  5933. // });
  5934. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  5935. },
  5936. // 未通过日报
  5937. deny() {
  5938. this.logining = true;
  5939. this.http.post( this.port.report.deny, this.denyForm,
  5940. res => {
  5941. this.logining = false;
  5942. if (res.code == "ok") {
  5943. this.$message({
  5944. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  5945. type: "success"
  5946. });
  5947. this.getReportList();
  5948. this.getDepartment();
  5949. this.denyReasonDialog = false;
  5950. } else {
  5951. this.$message({
  5952. message: res.msg,
  5953. type: "error"
  5954. });
  5955. }
  5956. },
  5957. error => {
  5958. this.logining = false;
  5959. this.$message({
  5960. message: error,
  5961. type: "error"
  5962. });
  5963. });
  5964. },
  5965. // 查看工时记录弹窗
  5966. toView() {
  5967. this.toViewDialogVisible = true
  5968. this.toViewloading = true
  5969. this.getToView()
  5970. },
  5971. getToView() {
  5972. this.http.post( '/report-import-log/getList', this.toViewForm,
  5973. res => {
  5974. this.toViewloading = false;
  5975. if (res.code == "ok") {
  5976. // console.log(res.data, '数据数据')
  5977. this.toViewList = res.data.records
  5978. this.toViewForm.total = res.data.total
  5979. } else {
  5980. this.toViewloading = false;
  5981. this.$message({
  5982. message: res.msg,
  5983. type: "error"
  5984. });
  5985. }
  5986. })
  5987. },
  5988. // 触发 selectCat 组件更改他的值
  5989. selectCatCli(obj) {
  5990. // console.log(obj, '看看')
  5991. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  5992. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  5993. },
  5994. vueCasader(obj) {
  5995. // console.log(obj, '看看值')
  5996. if(obj.distinction == 1) {
  5997. let arr = []
  5998. arr.push(obj.item.id)
  5999. this.exportParam.departmentId = arr
  6000. }
  6001. },
  6002. //分页
  6003. handleCurrentChange(val) {
  6004. this.toViewForm.pageIndex = val;
  6005. this.getToView();
  6006. },
  6007. handleSizeChange(val) {
  6008. this.toViewForm.pageSize = val;
  6009. this.getToView();
  6010. },
  6011. getAllUsersList(){
  6012. this.http.post('/user/getSimpleActiveUserList',{
  6013. },res => {
  6014. if(res.code == 'ok'){
  6015. this.allUsersList = res.data
  6016. }else{
  6017. this.$message({
  6018. message: res.msg,
  6019. type: 'error'
  6020. })
  6021. }
  6022. },err => {
  6023. this.$message({
  6024. message: err,
  6025. type: 'error'
  6026. })
  6027. })
  6028. }
  6029. },
  6030. created() {
  6031. let height = window.innerHeight;
  6032. this.tableHeight = height - 178;
  6033. const that = this;
  6034. window.onresize = function temp() {
  6035. that.tableHeight = window.innerHeight - 178;
  6036. };
  6037. this.toViewForm.companyId = this.user.companyId
  6038. this.initDrag([{
  6039. type: "LR",
  6040. domClass: {
  6041. // 中间分割线的名字
  6042. resize: "line-line",
  6043. // 左侧盒子的名字
  6044. left: "box-left",
  6045. // 右侧盒子的名字
  6046. right: "box-right",
  6047. // 父级的名字
  6048. box: "box-father",
  6049. },
  6050. otherInfo: {
  6051. // 限制左边栏最低宽度
  6052. leftWidth: 120,
  6053. },
  6054. },
  6055. {
  6056. type: "LR",
  6057. domClass: {
  6058. // 中间分割线的名字
  6059. resize: "line-second",
  6060. // 左侧盒子的名字
  6061. left: "left-laowang",
  6062. // 右侧盒子的名字
  6063. right: "box-second-father",
  6064. // 父级的名字
  6065. box: "grand",
  6066. },
  6067. otherInfo: {
  6068. // 限制左边栏最低宽度
  6069. leftWidth: 120,
  6070. },
  6071. },
  6072. ]);
  6073. },
  6074. // 自定义事件
  6075. selectCal(obj) {
  6076. if(obj.distinction == '1') {
  6077. this.zhoBao.projectAuditorId = obj.id
  6078. } else if(obj.distinction == '2') {
  6079. this.zhoBao.auditorFirst = obj.id
  6080. } else if(obj.distinction == '3') {
  6081. this.zhoBao.auditorSec = obj.id
  6082. } else if(obj.distinction == '4') {
  6083. this.zhoBao.auditorThird = obj.id
  6084. } else if(obj.distinction == '5') {
  6085. this.zhoBao.ccUserid = obj.id
  6086. }
  6087. }
  6088. };
  6089. </script>
  6090. <style lang="scss" scoped>
  6091. .paginatis {
  6092. padding: 10px 10px;
  6093. background: #f2f2f2;
  6094. }
  6095. .waiting {
  6096. color:orange;
  6097. }
  6098. .filledReportStyle {
  6099. color:#32CD32;
  6100. }
  6101. .RejectStyle {
  6102. color:red;
  6103. }
  6104. .waitSubmitStyle{
  6105. color: #409eff;
  6106. }
  6107. .chooseDate {
  6108. .waiting {
  6109. color: #20a0ff;
  6110. }
  6111. .filledReportStyle {
  6112. color:#20a0ff;
  6113. }
  6114. .RejectStyle {
  6115. color: #20a0ff;
  6116. }
  6117. .waitSubmitStyle{
  6118. color: #20a0ff;
  6119. }
  6120. }
  6121. .allDaily {
  6122. width:100%;
  6123. }
  6124. .report_title {
  6125. padding:10px 0;
  6126. color:#666;
  6127. }
  6128. .clearfix {
  6129. overflow-x: auto;
  6130. white-space: nowrap;
  6131. padding: 15px 0 10px 0;
  6132. // overflow-y: hidden;
  6133. .date_item {
  6134. padding: 0 3px;
  6135. cursor: pointer;
  6136. position: relative;
  6137. }
  6138. .chooseDate {
  6139. position: absolute;
  6140. bottom: -3px;
  6141. width: 37px;
  6142. height: 2px;
  6143. left: 14px;
  6144. background: #20a0ff;
  6145. }
  6146. }
  6147. .one_daily {
  6148. i {
  6149. color: #9ed0ff;
  6150. margin-right: 5px;
  6151. }
  6152. .one_daily_body {
  6153. padding: 10px 0px;
  6154. p {
  6155. margin: 0;
  6156. line-height: 30px;
  6157. }
  6158. }
  6159. ul {
  6160. padding: 0;
  6161. }
  6162. }
  6163. .checkbtn {
  6164. float: right;
  6165. margin-top: -10px;
  6166. }
  6167. .selConStyle{
  6168. margin-top:9rem;
  6169. margin-bottom:11rem;
  6170. .selConStyle_title{
  6171. height: 3rem;
  6172. text-align: center;
  6173. font-size: 17px;
  6174. }
  6175. .el-select{
  6176. margin: 0 15%;
  6177. width: 70%;
  6178. }
  6179. }
  6180. </style>
  6181. <style lang="scss">
  6182. .daily {
  6183. .el-card__body {
  6184. height: 80%;
  6185. overflow-y: auto;
  6186. }
  6187. .el-card__header {
  6188. padding: 0 20px;
  6189. }
  6190. }
  6191. .membListClass{
  6192. .el-dialog__body{
  6193. padding-top: 10px;
  6194. }
  6195. }
  6196. // .editReportDialog .el-dialog__footer{
  6197. // position: sticky;
  6198. // bottom: 0;
  6199. // background: #fff;
  6200. // height: 70px;
  6201. // z-index: 1010;
  6202. // }
  6203. .editReportDialog{
  6204. min-width: 800px;
  6205. }
  6206. .touruxiangmu{
  6207. max-width: 1000px;
  6208. }
  6209. </style>
  6210. <style scoped>
  6211. /* 项目标签的样式 */
  6212. .el-tag + .el-tag {
  6213. margin-left: 10px;
  6214. }
  6215. .button-new-tag {
  6216. margin-left: 10px;
  6217. height: 32px;
  6218. line-height: 30px;
  6219. padding-top: 0;
  6220. padding-bottom: 0;
  6221. }
  6222. .input-new-tag {
  6223. width: 90px;
  6224. margin-left: 10px;
  6225. vertical-align: bottom;
  6226. }
  6227. .selectworktime .el-table__fixed-body-wrapper{
  6228. top: 48px !important;
  6229. }
  6230. .selectworktime_export .selectworktime_export_l{
  6231. width: 65%;
  6232. float: left;
  6233. height: 42px;
  6234. }
  6235. .approvalProcessBox{
  6236. margin-left: 30px;
  6237. font-size: 14px;
  6238. line-height: 16px;
  6239. cursor: pointer;
  6240. }
  6241. .approvalProcessBox i {
  6242. margin-right: 0;
  6243. height: 16px;
  6244. width: 16px;
  6245. display: inline-block;
  6246. transform: scale(1.2);
  6247. position: relative;
  6248. top: 0.5px;
  6249. color: #409eff;
  6250. }
  6251. .approvalProcessBox .approvalProcessClick{
  6252. cursor: pointer;
  6253. color: #409eff;
  6254. font-size: 14px;
  6255. }
  6256. .approvalProcessBox:hover .approvalProcessClick{
  6257. color: #3485fb;
  6258. }
  6259. </style>
  6260. <style lang="scss" scoped>
  6261. // 加班样式
  6262. .overtime {
  6263. display: inline-block;
  6264. margin-left: 20px;
  6265. input {
  6266. display: inline-block;
  6267. margin-top: 5px;
  6268. }
  6269. }
  6270. .plus {
  6271. display: inline-block;
  6272. }
  6273. // .tages {
  6274. // float: right;
  6275. // }
  6276. .overtime {
  6277. display: inline-block;
  6278. margin-left: 30px;
  6279. }
  6280. .bloks {
  6281. display: inline-block;
  6282. width: 380px;
  6283. }
  6284. .zhiss {
  6285. display: flex;
  6286. justify-content: space-around;
  6287. align-items: center;
  6288. }
  6289. .zhoFel {
  6290. display: flex;
  6291. justify-content: space-between;
  6292. align-items: center;
  6293. }
  6294. // 左右滑动样式
  6295. .line {
  6296. width: 30px;
  6297. /* height: 500px; */
  6298. background: #f2f2f2;
  6299. cursor: w-resize;
  6300. }
  6301. .box-father {
  6302. border: 8px solid #000;
  6303. }
  6304. .line-second {
  6305. width: 10px;
  6306. /* background: red; */
  6307. }
  6308. .flex {
  6309. display: flex;
  6310. width: 100%;
  6311. }
  6312. .box-left {
  6313. flex: 0 0 400px;
  6314. /* height: 600px; */
  6315. /* background: blue; */
  6316. }
  6317. .box-right {
  6318. /* height: 600px; */
  6319. /* background: green; */
  6320. flex: 1;
  6321. }
  6322. .box-postion {
  6323. width: 200px;
  6324. /* height: 400px; */
  6325. background: #ccc;
  6326. }
  6327. .custom-tree-node {
  6328. flex: 1;
  6329. display: flex;
  6330. align-items: center;
  6331. justify-content: space-between;
  6332. font-size: 14px;
  6333. padding-right: 8px;
  6334. }
  6335. .daitianrbao {
  6336. width: 100%;
  6337. box-sizing: border-box;
  6338. height: 40px;
  6339. border-radius: 4px;
  6340. border: 1px solid #DCDFE6;
  6341. overflow: hidden;
  6342. text-overflow: ellipsis;
  6343. display: flex;
  6344. // align-items: center;
  6345. }
  6346. .daitianrbao .spnn {
  6347. display: inline-block;
  6348. box-sizing: border-box;
  6349. padding: 0 15px;
  6350. overflow: hidden;
  6351. text-overflow: ellipsis;
  6352. }
  6353. .daitianrbao .hover {
  6354. color: #DCDFE6 !important;
  6355. }
  6356. </style>