daily.vue 416 KB

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