daily.vue 349 KB

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