daily.vue 396 KB

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