daily.vue 372 KB

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