daily.vue 512 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640
  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;">
  18. <span v-if="item.missReport" class="RejectStyle">{{item.showDate}}</span>
  19. <span v-else :class="statusStyle[item.state]">{{item.showDate}}</span>
  20. <br>
  21. <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
  22. <span class="chooseDate" v-if="index == choseDay"></span>
  23. <!--针对景昱-->
  24. <el-tooltip v-if="user.companyId == 5978 && item.exceedCardTime == 1" effect="dark" content="填报时长异常" placement="top-start">
  25. <i class="el-icon-warning" style="color:red;"></i>
  26. </el-tooltip>
  27. <el-tooltip v-if="item.missReport" effect="dark" content="漏填" placement="top-start">
  28. <i class="el-icon-warning" style="color:red;"></i>
  29. </el-tooltip>
  30. </div>
  31. </div>
  32. </span>
  33. </div>
  34. </div>
  35. <div style="display:flex;">
  36. <div class="grand flex">
  37. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  38. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  39. <!-- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;margin-bottom:10px">
  40. </div> -->
  41. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  42. <el-input :placeholder="$t('defaultText.PleaseEnterYourName')" size="small" v-model="seluserText" @keyup.enter.native="seluserforText()" style="width:100%;margin-bottom:10px" clearable>
  43. <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
  44. </el-input>
  45. <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
  46. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  47. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  48. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  49. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  50. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  51. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  52. </el-select>
  53. </div>
  54. <div>
  55. <el-tree class="el-tree-resetStyles" :data="data" @node-click="handleNodeClick" @node-collapse="nodeChangeCollapse" @node-expand="nodeChangeExpand" ref="treeDataRef" :default-expanded-keys="nodeModelData" node-key="id" v-loading="dataLoading">
  56. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  57. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  58. <TranslationOpenData :configurationItems="{ openType: node.data.children ? 'departmentName' : 'userName', openId: node.label, renderIndex: 0 }"/>
  59. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  60. </span>
  61. <div style="position: absolute;right: 15px;">
  62. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  63. <!-- 未填报 -->
  64. {{$t('state.DidNotFillIn')}}
  65. </span>
  66. <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'">
  67. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  68. {{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)')}}
  69. </span>
  70. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  71. <!-- 待审核 -->
  72. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  73. </span>
  74. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  75. <!-- 已通过 -->
  76. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  77. </span>
  78. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  79. <!-- 未通过 -->
  80. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  81. </span>
  82. <span v-if="data.isUser == 1 && data.state == 3" style="font-size:13px" class="themeFontColor">
  83. <!-- 待提交 -->
  84. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  85. </span>
  86. </div>
  87. </span>
  88. </el-tree>
  89. </div>
  90. </div>
  91. </div>
  92. <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">
  93. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  94. -
  95. -
  96. -
  97. </div>
  98. </div>
  99. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  100. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  101. <div class="allDaily" style="float:left;flex-grow:1">
  102. <!--系统管理员和部门负责人 -->
  103. <div class="report_title" style="display:flex;justify-content: space-between;">
  104. <span>
  105. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  106. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  107. <!-- {{depData != null ?depData.label:""}} -->
  108. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  109. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'">
  110. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: depData.label, renderIndex: 0 }" />
  111. </span>
  112. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'">
  113. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: depData.label, renderIndex: 0 }" />
  114. </span>
  115. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  116. <span v-if="targetUid == null">
  117. <!-- - 已提交 -->
  118. -{{$t('state.hasBeenSubmitted')}}
  119. <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')}},
  120. <!-- 待提交 -->
  121. {{$t('state.waitingsubmit')}}
  122. <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')}},
  123. <!-- 漏填 -->
  124. <!-- {{$t('state.missFillReport')}} -->
  125. {{ $t('other.unfilled') }}
  126. <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')}}
  127. <span v-if="leaveAllNum">{{','+ $t('other.takeDayOff') + leaveAllNum + $t('other.people')}}</span></el-link>
  128. </span>
  129. </span>
  130. </span>
  131. <span style="float:right;">
  132. <el-link type="primary" v-if="user.timeType.enableNewWeeklyfill != 1 && user.timeType.weeklyChargeFilter != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
  133. <el-link v-if="reportTimeType.type != 0 && user.companyId != yuzhongCompId && user.companyId != 469 && user.timeType.enableNewWeeklyfill != 1 && user.companyId != 3092 && user.timeType.enableNewWeeklyfill != 2" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
  134. <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">{{ $t('textLink.fillInAWeek') }}</el-link>
  135. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报123</el-link> -->
  136. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;weekIndex++,fillWeekDialogVisiCustomTwo=true" v-if="user.timeType.enableNewWeeklyfill==2">按周填报</el-link>
  137. <el-link type="primary" v-if="user.companyId != 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1 && user.timeType.weeklyChargeFilter != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,(user.companyId == 5814||user.companyId==5693 || user.companyId==4407 || user.companyId == 7812 || user.companyId == 481)?2:0)">{{$t('textLink.helpToFillIn')}}</el-link>
  138. <!-- 苏州景昱,按周填报的模式进行代填日报 -->
  139. <el-link type="primary" v-if="user.companyId == 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1 && user.timeType.weeklyChargeFilter != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReportss();">{{$t('textLink.helpToFillIn')}}</el-link>
  140. <el-link type="primary" v-if="permissions.reportBatch && user.timeType.enableNewWeeklyfill != 1 && user.companyId != 469" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">{{$t('textLink.batchFillIn')}}</el-link>
  141. <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>
  142. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  143. <!--部门负责人给个导出工时的功能 -->
  144. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  145. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">{{ $t('tuiSongGongShi') }}</el-link>
  146. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">{{ $t('gongShiTuiSongRiZhi') }}</el-link>
  147. <el-link type="primary" v-if="user.roleName == $t('role.superAdministrator') && user.companyId==839" :underline="false" @click="reportLogCheckDialog=true">{{ $t('riBaoShenHeXiuGai') }}</el-link>
  148. <el-link type="primary" v-if="(user.roleName == $t('role.superAdministrator') || user.roleName == $t('role.systemAdministrator')) && user.companyId==936" :underline="false" @click="transferWorkingHoursVisable=true">{{ $t('zhuanYIGongShi') }}</el-link>
  149. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  150. </span>
  151. </div>
  152. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  153. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  154. <i class="fa fa-circle"></i>
  155. <!-- {{item1.name}} -->
  156. <span v-if="user.userNameNeedTranslate == '1'">
  157. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item1.name, renderIndex: 0 }" />
  158. </span>
  159. <span v-if="user.userNameNeedTranslate != '1'">
  160. {{item1.name}}
  161. </span>
  162. <span style="margin-left:30px;">
  163. <span style="margin-right:20px;" v-if="user.timeType.onlyShowPercent==0">
  164. <span v-if="user.timeType.showCorpwxCardtime" :style="item1.cardTime !=item1.reportTime?'color:#ff0000;':''">考勤时长:{{item1.cardTime | amounts}}h</span>
  165. <span style="margin-left:10px;">{{$t('other.totalWorkingHours')}}:{{item1.reportTime | amounts}}h</span>
  166. </span>
  167. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  168. <i class="iconfont firerock-iconliucheng1"></i>
  169. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  170. <!-- 审批流程 -->
  171. {{$t('other.approvalProcess')}}
  172. </span>
  173. </span>
  174. </span>
  175. <div class="checkbtn" style="padding-right:20px;">
  176. <!--编辑和删除日报-->
  177. <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>
  178. <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>
  179. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  180. </div>
  181. <div v-if="user.timeType.enableNewWeeklyfill == 1" style="margin-left:20px;">
  182. <p v-if="item1.summary != null" v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  183. <p v-if="item1.attachment != null" >附件
  184. <a v-for="file in JSON.parse(item1.attachment)" style="margin-right:5px;" :href="'/upload/'+file.serverName" :download="file.originName">{{ file.originName }}</a>
  185. </p>
  186. </div>
  187. <div class="one_daily_body">
  188. <el-timeline>
  189. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  190. <el-card shadow="never">
  191. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  192. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  193. <span v-if="user.company.packageEngineering == 0">
  194. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0">[
  195. <span v-if="user.timeType.reportAuditType == 7" >
  196. {{$t('other.reviewer')}}:<TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" /><span v-if="item2.projectAuditState==1">√</span>
  197. <span v-if="item2.deptAuditorName">、</span>
  198. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.deptAuditorName, renderIndex: 0 }" /><span v-if="item2.departmentAuditState==1">√</span>
  199. </span>
  200. <span v-else>
  201. <span v-if="item2.isDeptAudit==0">
  202. <span v-if="item2.projectAuditState==0">
  203. <!-- 待项目审核人 --> {{user.companyId == 469?(item2.projectAuditorName=='程君健'?('待总经办'):"待部门主管"):$t('other.waitForTheProjectReviewer')}}
  204. <span v-if="item2.projectAuditorName != null">(
  205. <!-- {{item2.projectAuditorName}} -->
  206. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  207. )</span>
  208. <!-- 审核 --> {{$t('other.audit')}}
  209. </span>
  210. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  211. <!-- 项目审核人 --> {{user.companyId == 469?(item2.projectAuditorName=='程君健'?('待总经办'):"待部门主管"):$t('other.projectAuditor')}}
  212. <span v-if="item2.projectAuditorName != null">(
  213. <!-- {{item2.projectAuditorName}} -->
  214. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  215. )</span>
  216. <!-- 审核通过 --> {{$t('state.approved')}}
  217. </span>
  218. </span>
  219. <span v-else-if="item2.isDeptAudit==1">
  220. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  221. ({{$t('other.await')}}
  222. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName, renderIndex: 0 }" />
  223. {{$t('other.audit')}})
  224. </span>
  225. </span>
  226. ]</span>
  227. <span style="margin-left:15px;color:#FFA500;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  228. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  229. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1 && user.companyId != '3511'">{{$t('other.automaticReview')}}</span>
  230. </span>
  231. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  232. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  233. </span>
  234. <!-- <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> -->
  235. <span v-if="user.company.packageEngineering == 1">
  236. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  237. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  238. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  239. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  240. (
  241. <!-- <span v-if="user.userNameNeedTranslate != 1">
  242. {{item2.projectAuditorName}}
  243. </span>
  244. <span v-if="user.userNameNeedTranslate == 1">
  245. <TranslationOpenDataText type='userName' :openid='item2.projectAuditorName'></TranslationOpenDataText>
  246. </span> -->
  247. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  248. )
  249. </span>{{$t('other.audit')}} ]</span>
  250. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  251. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  252. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  253. </span>
  254. <!--每个项目上单独审核 -->
  255. <span style="float:right;">
  256. <el-button type="primary" size="small" v-if="item2.state == 1&&user.companyId==3092&&user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime(item2.id)">{{'推送'}}</el-button>
  257. <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"
  258. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  259. <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"
  260. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  261. <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"
  262. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  263. <!--自己可以撤回待审核状态的报告 -->
  264. <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>
  265. </span>
  266. </p>
  267. <p v-if="user.companyId == yuzhongCompId">
  268. <span>{{ $t('jiao-se') }} :{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  269. <span style="margin-left:10px;">{{ $t('gongZuoZhiZe') }} :{{ item2.extraField2? item2.extraField2Name:''}}</span>
  270. <span style="margin-left:10px;">{{ $t('gongZuoNeiRong') }} :{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  271. <!--任务分组和阶段 -->
  272. <p v-if="item2.groupId != 0">
  273. {{$t('other.taskGroup')}}:{{item2.groupName}}
  274. <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>
  275. </p>
  276. <!-- 工单号,行号 -->
  277. <p v-if="user.timeType.reportExtraField4Name">{{ user.timeType.reportExtraField4Name }}: {{ item2.extraField4 }}</p>
  278. <p v-if="user.timeType.reportExtraField5Name">{{ user.timeType.reportExtraField5Name }}: {{ item2.extraField5 }}</p>
  279. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  280. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  281. <!-- 自定义日报文本 -->
  282. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  283. <p v-if="user.company.packageEngineering == 1">
  284. {{$t('other.professionalProgress')}}:
  285. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  286. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  287. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  288. </el-tooltip>
  289. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  290. <i class="iconfont firerock-iconshenhetongguo"></i>
  291. </el-tooltip>
  292. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  293. <i class="iconfont firerock-iconshenhebohui"></i>
  294. </el-tooltip>
  295. </span>
  296. </p>
  297. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  298. <span style="margin-left:10px;" v-if="user.companyId==3092">-- {{ $t('fuWu') }} :{{ item2.sapServiceName }}</span>
  299. </p>
  300. <div v-if="item2.multiWorktime==0">
  301. <p style="display: inline-block;" v-if="user.timeType.onlyShowPercent==0">{{$t('time.duration')}}:
  302. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  303. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  304. {{item2.time.toFixed(1)}}h
  305. <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>
  306. </p>
  307. <p style="display: inline-block;" v-else>{{$t('lable.percentageOfTime')}}:
  308. <span style="margin-right:10px;">{{item2.progress}}%</span>
  309. </p>
  310. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  311. </div>
  312. <div v-if="item2.multiWorktime==1" >
  313. <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>
  314. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  315. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  316. <p style="display: inline-block;">{{$t('time.duration')}}:
  317. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  318. {{timeItem.time.toFixed(1)}}h
  319. <span v-if="timeItem.detail" style="margin-left:10px;">
  320. {{timeItem.detail}}
  321. </span>
  322. </p>
  323. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  324. </div>
  325. </div>
  326. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  327. <!--照片的显示 -->
  328. <p v-if="item2.pics != null && item2.pics.length > 0">
  329. <el-image v-for="(pic, index) in item2.pics" :key="index"
  330. style="width: 100px; height: 100px; margin-right:10px;"
  331. :src="pic"
  332. :preview-src-list="item2.pics">
  333. </el-image>
  334. </p>
  335. </el-card>
  336. </el-timeline-item>
  337. </el-timeline>
  338. </div>
  339. </div>
  340. <div v-if="hasMore && !listLoading" style="width:100%;font-size:17px;text-align:center;padding-bottom:15px;"><el-link @click="reqMore" :underline=false class="themeFontColor">{{ $t('jiaZaiGengDuoRiBao') }}</el-link></div>
  341. <!-- 简陋的无报告提示 -->
  342. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  343. </div>
  344. </div>
  345. </div>
  346. </div>
  347. </div>
  348. </el-card>
  349. </div>
  350. <!-- 工时推送日志弹窗 -->
  351. <el-dialog :title="$t('gongShiTuiSongRiZhi')" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  352. <template>
  353. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">{{ $t('export.export') }}</el-button>
  354. </template>
  355. <template>
  356. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  357. <el-table-column prop="syncTime" :label="$t('tuiSongShiJian')" width="150"></el-table-column>
  358. <el-table-column prop="remark" :label="$t('tuiSongMingCheng')" width="180"></el-table-column>
  359. <el-table-column prop="operator" :label="$t('caozuo')" width="150"></el-table-column>
  360. <el-table-column prop="syncType" :label="$t('tuiSongFangShi')" width="150"></el-table-column>
  361. <el-table-column prop="result" :label="$t('tuiSongJieGuo')" width="250">
  362. <template slot-scope="scope">
  363. <span style="color:green;" v-if="scope.row.result.includes($t('other.successful'))">{{scope.row.result}}</span>
  364. <span style="color:red;" v-if="scope.row.result.includes($t('shiBai'))">{{scope.row.result}}</span>
  365. </template>
  366. </el-table-column>
  367. <el-table-column prop="resultRemark" :label="$t('bei-zhu')" width="400"></el-table-column>
  368. </el-table>
  369. </template>
  370. <span slot="footer" class="dialog-footer">
  371. <el-button type="primary" @click="pushWorkTimeLogDig = false">{{ $t('guanBi') }}</el-button>
  372. </span>
  373. </el-dialog>
  374. <!-- 填写日报的dialog -->
  375. <el-dialog :title="isSubstitude?$t('textLink.helpToFillIn'):editTitle[isBatch]" :visible.sync="dialogVisible" width="60%" :close-on-click-modal="false" @closed="guanbi()" :top="'5.5vh'" custom-class="editReportDialog" ref="editReportDialog">
  376. <div style="height: 65vh;overflow: auto;">
  377. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  378. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  379. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  380. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" style="width:200px;"></el-input>
  381. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1" style="width:200px;">
  382. <span class="spnn" v-if="workForm.userNames">
  383. <span v-for="(item, index) in workForm.userNames" :key="index">
  384. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  385. <span v-if="index < workForm.userNames.length - 1">,</span>
  386. </span>
  387. </span>
  388. <span class="spnn hover" v-else>
  389. {{$t('defaultText.pleaseSelectAsubstitute')}}
  390. </span>
  391. </div>
  392. </el-form-item>
  393. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  394. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  395. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  396. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  397. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  398. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  399. <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>
  400. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  401. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  402. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  403. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  404. <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>
  405. <!-- AI智能填报 -->
  406. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >{{ $t('zhiNengTianBao') }}</el-button>
  407. </el-form-item>
  408. <!--考勤时长显示-->
  409. <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.showRefresh || user.companyId == 5978">
  410. <span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}}, {{workForm.time.isOffiBusiness?'出差':'工作'}}{{workForm.time.workHours}}{{$t('time.hour')}}
  411. <span v-if="workForm.time.askLeaveTime">|&nbsp;{{ $t('other.AskForLeave') }}{{ workForm.time.askLeaveTime }}{{$t('time.hour')}}</span>
  412. <span v-if="workForm.time.otTime" style="color:#FFA500;">|&nbsp;加班{{ workForm.time.otTime }}{{$t('time.hour')}}</span>
  413. </span>
  414. <!--批量填报不显示考勤记录-->
  415. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  416. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  417. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">,{{ $t('workAttendance') }}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  418. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  419. v-if="!isBatch && user.timeType.syncCorpwxTime==1 && !isSubstitude" icon="el-icon-refresh"
  420. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  421. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  422. v-if="!isBatch && user.timeType.syncDingding==1 && !isSubstitude" icon="el-icon-refresh"
  423. @click="refreshDDCardTime(workForm.createDate)"></el-button>
  424. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  425. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  426. @click="refreshAttendance(workForm.createDate)"></el-button>
  427. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  428. v-if="!isBatch && user.companyId === 5978" icon="el-icon-refresh"
  429. @click="refreshBeiSengAttendance(workForm.createDate)"></el-button>
  430. <span v-if="user.companyId==5978" style="margin-left:5px;" class="themeFontColor"><i class="el-icon-warning"></i>{{$t('other.kaoqingTimeTip')}}</span>
  431. </el-form-item>
  432. <!-- 000000 -->
  433. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  434. <div v-if="reportTimeType.multiWorktime==0">
  435. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  436. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  437. <el-select v-model="domain.timeType" style="width:200px;"
  438. v-if="reportTimeType.type == 0"
  439. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  440. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  441. @change="onTimeTypeChange(domain.timeType)">
  442. <el-option
  443. v-for="item in timeType"
  444. :key="item.value"
  445. :label="item.label"
  446. :value="item.value">
  447. </el-option>
  448. </el-select>
  449. <!-- 数字时长选择 -->
  450. <el-select v-model="domain.workingTime" style="width:200px;"
  451. v-if="reportTimeType.type == 1"
  452. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  453. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  454. @change="seleChn(0,domain)">
  455. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  456. </el-select>
  457. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  458. <span v-if="reportTimeType.type == 2">
  459. <!--时间范围选择 -->
  460. <el-time-picker
  461. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  462. v-model="domain.startTime"
  463. :placeholder="$t('time.startTime')"
  464. style="width:120px;"
  465. format="HH:mm"
  466. value-format="HH:mm"
  467. :picker-options="{
  468. start: '08:00',
  469. end: '23:30'
  470. }"
  471. @change="iptChang()">
  472. </el-time-picker> - <el-time-picker
  473. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  474. v-model="domain.endTime"
  475. :placeholder="$t('time.endTime')"
  476. style="width:120px;"
  477. format="HH:mm"
  478. value-format="HH:mm"
  479. :picker-options="{
  480. start: '08:00',
  481. end: '23:30',
  482. minTime: domain.startTime
  483. }"
  484. @change="iptChang()">
  485. </el-time-picker>
  486. </span>
  487. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  488. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  489. <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>
  490. </div>
  491. </el-form-item>
  492. <el-form-item :label="$t('tianBaoBuMen')" v-if="user.timeType.userWithMultiDept == 1 && userReportDeptList.length > 0"
  493. :prop="'domains.' + index + '.reportTargetDeptId'"
  494. :rules="{ required: true, message: $t('qing-xuan-ze-bu-men'), trigger: ['change','blur'] }">
  495. <el-select v-model="domain.reportTargetDeptId" :placeholder="$t('qing-xuan-ze-bu-men')" style="width:200px;" :clearable="true" v-if="user.userNameNeedTranslate == 0">
  496. <el-option v-for="depts in userReportDeptList" :key="depts.departmentId" :value="depts.departmentId" :label="depts.departmentName">
  497. <span style="float: left">
  498. <TranslationOpenDataText type='departmentName' :openid='depts.departmentName'></TranslationOpenDataText>
  499. </span>
  500. </el-option>
  501. </el-select>
  502. <vueCascader :size="'medium'" :widthStr="'200'" :clearable="true" :other="index" :subjectId="[domain.reportTargetDeptId]" :subject="userReportDeptList" :radios="false" :distinction="'10'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  503. </el-form-item>
  504. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  505. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  506. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  507. @change="selectProject(domain, index)"
  508. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  509. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  510. <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">
  511. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  512. <span style="float: right;">{{ item.projectName }}</span>
  513. </el-option>
  514. </el-option-group>
  515. </el-select>
  516. <!--昱众不显示子项目-->
  517. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  518. <span style="margin-left:45px;">
  519. {{$t('lable.subproject')}}</span>
  520. <!--子项目 -->
  521. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  522. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  523. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  524. </el-select>
  525. </template>
  526. <template v-if="user.companyId == yuzhongCompId">
  527. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">{{ $t('jiaoSeXuanZe') }}</span>
  528. <!--角色选择 -->
  529. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  530. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  531. <el-option
  532. v-for="item in roleList"
  533. :key="item.value"
  534. :label="item.label"
  535. :value="item.value">
  536. </el-option>
  537. </el-select>
  538. </template>
  539. <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%;"
  540. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  541. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  542. </el-link>
  543. <!-- <el-link type="primary" v-if="canEdit"
  544. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  545. </el-form-item>
  546. <el-form-item :label="$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">
  547. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  548. </el-form-item>
  549. <!--如果设置了工时成本预警的预算成本项-->
  550. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  551. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  552. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  553. </el-select>
  554. </el-form-item>
  555. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  556. <template slot="label">
  557. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1 || user.timeType.reportAuditType == 1 || user.timeType.reportAuditType == 2 || user.timeType.reportAuditType == 9">*</span>
  558. <span >{{$t('lable.taskGrouping')}}</span>
  559. </template>
  560. <!-- 任务分组 -->
  561. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  562. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  563. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  564. </el-select>
  565. <template v-if="user.companyId == yuzhongCompId">
  566. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>{{ $t('gongZuoZhiZe') }}</span>
  567. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" :placeHolder="$t('defaultText.pleaseChoose')"
  568. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  569. <el-option
  570. v-for="item in domain.filteredRespList"
  571. :key="item.id"
  572. :label="item.jobRespon"
  573. :value="item.id">
  574. </el-option>
  575. </el-select>
  576. </template>
  577. <template v-else-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
  578. <span v-if="domain.stages != null && domain.stages.length> 0" style="margin-left:45px;"><span v-if="user.companyId == 3092" style="color:red;margin-right: 4px">*</span>{{$t('other.inputStage')}}</span>
  579. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  580. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  581. @change="changeStages(domain, index)"
  582. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  583. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  584. </el-select>
  585. </template>
  586. </el-form-item>
  587. <!-- 工单号,行号 -->
  588. <el-form-item :label="user.timeType.reportExtraField4Name" v-if="user.timeType.reportExtraField4Name">
  589. <el-select v-model="domain.extraField4" placeholder="请选择" @change="onProgressChange" :disabled="!domain.canEdit" filterable clearable >
  590. <el-option v-for="lin in (domain.reportExtraField4List || [])" :key="lin" :label="lin" :value="lin">
  591. </el-option>
  592. </el-select>
  593. </el-form-item>
  594. <el-form-item :label="user.timeType.reportExtraField5Name" v-if="user.timeType.reportExtraField5Name">
  595. <el-select v-model="domain.extraField5" placeholder="请选择" @change="onProgressChange" :disabled="!domain.canEdit" filterable clearable>
  596. <el-option v-for="lin in (domain.reportExtraField5List || [])" :key="lin" :label="lin" :value="lin">
  597. </el-option>
  598. </el-select>
  599. </el-form-item>
  600. <div v-if="user.timeType.reportAuditType != 1 && user.timeType.reportAuditType != 2 && user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && user.timeType.reportAuditType != 9 && user.timeType.reportAuditType != 10 && domain.auditUserList">
  601. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  602. <template slot="label">
  603. <span style="color:#FF0000;">*</span>
  604. <span >{{$t('other.projectAuditor')}}</span>
  605. </template>
  606. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  607. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  608. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  609. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  610. </el-option>
  611. </el-select>
  612. <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>
  613. </el-form-item>
  614. </div>
  615. <el-form-item v-if="user.companyId == yuzhongCompId">
  616. <template slot="label">
  617. <span style="color:#FF0000;">*</span>
  618. <span >{{ $t('gongZuoNeiRong') }}</span>
  619. </template>
  620. <el-select v-model="domain.extraField3" style="width:200px;" :placeHolder="$t('defaultText.pleaseChoose')" @change="$forceUpdate()"
  621. :disabled="(workForm.domains[index].state>=2?false:true)" >
  622. <el-option
  623. v-for="item in domain.workContentList"
  624. :key="item.id"
  625. :label="item.workContext"
  626. :value="item.id">
  627. </el-option>
  628. </el-select>
  629. </el-form-item>
  630. <!-- 111111 -->
  631. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  632. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  633. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  634. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  635. <span v-else>{{item.name}}</span>
  636. </el-option>
  637. </el-select>
  638. <template v-if="user.timeType.auditLevel > 1">
  639. <i class="el-icon-right"></i>
  640. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  641. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  642. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  643. <span v-else>{{item.name}}</span>
  644. </el-option>
  645. </el-select>
  646. </template>
  647. <template v-if="user.timeType.auditLevel > 2">
  648. <i class="el-icon-right"></i>
  649. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  650. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  651. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  652. <span v-else>{{item.name}}</span>
  653. </el-option>
  654. </el-select>
  655. </template>
  656. </el-form-item>
  657. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  658. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  659. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  660. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  661. <span v-else>{{item.name}}</span>
  662. </el-option>
  663. </el-select>
  664. </el-form-item>
  665. <!-- 相关维度/自定义维度 -->
  666. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1 && !yonghuUser.customDegreeMultiple" :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'">
  667. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  668. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  669. </el-option>
  670. </el-select>
  671. </el-form-item>
  672. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1 && yonghuUser.customDegreeMultiple" :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 + '.multiDegrIdArray'">
  673. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  674. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  675. </el-option>
  676. </el-select>
  677. </el-form-item>
  678. <!-- 相关数值 -->
  679. <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">
  680. <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>
  681. </el-form-item>
  682. <!-- 自定义文本 -->
  683. <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">
  684. <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>
  685. </el-form-item>
  686. <!--按比例填报-->
  687. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  688. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  689. <div style="width:400px;">
  690. <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>
  691. <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>
  692. </div>
  693. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  694. <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>
  695. </div>
  696. </el-form-item>
  697. <!--工程专业版本模式下, 各个专业的进度填报 -->
  698. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  699. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  700. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  701. <el-input size="mini" style="width:60px;" v-model="item.progress"
  702. @keyup.native="onProgressChange"
  703. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  704. </span>
  705. </el-form-item>
  706. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  707. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1&& !user.timeType.hideTask && (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic!=1))" >
  708. <template slot="label" v-if="user.timeType.taskRequired == 1">
  709. <span style="color:#FF0000;">*</span>
  710. <span >{{ $t('other.task') }}</span>
  711. </template>
  712. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  713. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  714. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  715. </el-select>
  716. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  717. </el-form-item>
  718. <!--针对依斯贝的SAP服务-->
  719. <el-form-item v-if="user.companyId==3092" :label="$t('fuWu')" :prop="'domains.' + index + '.sapServiceId'"
  720. :rules=" { required: true, message: $t('qingXuanZeFuWu'), trigger: 'blur' }">
  721. <el-select v-model="domain.sapServiceId" :placeholder="$t('qingXuanZeFuWu')" style="width:75%;margin-right:7%" filterable="true"
  722. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  723. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  724. </el-select>
  725. </el-form-item>
  726. <!--工作事项-->
  727. <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
  728. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  729. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  730. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  731. </el-form-item>
  732. <!-- 拍照上传 -->
  733. <el-form-item :label="$t('tuPianShangChuan')" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  734. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: $t('pleaseselectpictures'), trigger: 'blur' } : null">
  735. <div class="photos">
  736. <div>
  737. <el-upload
  738. list-type="picture-card"
  739. :http-request="(file) => {return addImg(file, index)}"
  740. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  741. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  742. :file-list="domain.imgListUrl" :limit="9"
  743. :disabled="workForm.domains[index].state>=2?false:true">
  744. <i class="el-icon-plus"></i>
  745. </el-upload>
  746. </div>
  747. </div>
  748. </el-form-item>
  749. </div>
  750. <!--多个工作事项填报的情况 -->
  751. <div v-if="reportTimeType.multiWorktime==1">
  752. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  753. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  754. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  755. @change="selectProject(domain, index)"
  756. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  757. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  758. <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">
  759. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  760. <span style="float: right;">{{ item.projectName }}</span>
  761. </el-option>
  762. </el-option-group>
  763. </el-select>
  764. <template v-if="user.timeType.mainProjectState != 1">
  765. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  766. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  767. <!--子项目 -->
  768. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  769. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  770. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  771. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  772. </el-select>
  773. </template>
  774. <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;"
  775. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  776. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  777. </el-link>
  778. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  779. <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>
  780. </div>
  781. <!-- <el-link type="primary" v-if="canEdit"
  782. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  783. </el-form-item>
  784. <el-form-item :label="$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">
  785. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  786. </el-form-item>
  787. <!--如果设置了工时成本预警的预算成本项-->
  788. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  789. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  790. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  791. </el-select>
  792. </el-form-item>
  793. <el-form-item v-if="user.company.packageProject == 1">
  794. <template slot="label">
  795. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1">*</span>
  796. <span >{{$t('lable.taskGrouping')}}</span>
  797. </template>
  798. <!-- 任务分组 -->
  799. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  800. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  801. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  802. </el-select>
  803. <!-- 项目的阶段 -->
  804. <span v-if="domain.stages != null && domain.stages.length> 0"
  805. style="margin-left:30px;"> {{$t('other.inputStage')}}</span>
  806. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  807. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  808. @change="changeStages(domain, index)"
  809. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  810. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  811. </el-select>
  812. </el-form-item>
  813. <el-form-item :label="$t('other.projectAuditor')" >
  814. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  815. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  816. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  817. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  818. </el-option>
  819. </el-select>
  820. <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>
  821. </el-form-item>
  822. <!--工程专业版本模式下, 各个专业的进度填报 -->
  823. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  824. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  825. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  826. <el-input size="mini" style="width:60px;" v-model="item.progress"
  827. @keyup.native="onProgressChange"
  828. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  829. </span>
  830. </el-form-item>
  831. <!-- 相关维度 -->
  832. <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'">
  833. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  834. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  835. </el-option>
  836. </el-select>
  837. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  838. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  839. </el-option>
  840. </el-select>
  841. </el-form-item>
  842. <!-- 相关数值 -->
  843. <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">
  844. <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>
  845. </el-form-item>
  846. <!-- 自定义文本 -->
  847. <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">
  848. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  849. </el-form-item>
  850. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  851. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  852. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  853. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  854. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  855. </el-select>
  856. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  857. </el-form-item>
  858. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  859. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  860. <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>
  861. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  862. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  863. <span v-if="reportTimeType.type == 2">
  864. <!-- <span> -->
  865. <!--时间范围选择 -->
  866. <el-time-picker
  867. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  868. v-model="timeItem.startTime"
  869. :placeholder="$t('time.startTime')"
  870. style="width:120px;"
  871. format="HH:mm"
  872. value-format="HH:mm"
  873. :picker-options="{
  874. start: '00:00',
  875. end: '23:59',
  876. }"
  877. @change="iptChangs()">
  878. </el-time-picker> - <el-time-picker
  879. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  880. v-model="timeItem.endTime"
  881. :placeholder="$t('time.endTime')"
  882. style="width:120px;"
  883. format="HH:mm"
  884. value-format="HH:mm"
  885. :picker-options="{
  886. start: '00:00',
  887. end: '23:59',
  888. minTime: timeItem.startTime
  889. }"
  890. @change="iptChangs()">
  891. </el-time-picker>
  892. </span>
  893. <!--工作细项-->
  894. <el-select v-model="timeItem.detail" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;" filterable="true" v-if="multiOptionData.length>0 && user.canFillMoreOption"
  895. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  896. <el-option v-for="item in multiOptionData" :key="item.value" :label="item.value" :value="item.value"></el-option>
  897. </el-select>
  898. </el-form-item>
  899. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  900. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  901. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  902. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  903. ></el-input>
  904. </el-form-item>
  905. </div>
  906. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  907. </div>
  908. <!--照片的显示 -->
  909. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  910. <el-image v-for="(pic, index) in domain.pics" :key="index"
  911. style="width: 100px; height: 100px; margin-right:10px;"
  912. :src="pic"
  913. :preview-src-list="domain.pics">
  914. </el-image>
  915. </p>
  916. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  917. </div>
  918. <span id="workFormsItemBottom"></span>
  919. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  920. </el-form>
  921. </div>
  922. <span slot="footer" class="dialog-footer">
  923. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  924. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">{{ $t('heJiGongShi') }}:{{totalReportHours}}{{ $t('time.hour') }}</span>
  925. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  926. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  927. <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>
  928. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  929. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  930. </span>
  931. </el-dialog>
  932. <!-- 按周填报 -->
  933. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1250px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()" top="6.2vh">
  934. <!-- 按周填报-已填工时-点击 -->
  935. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  936. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  937. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  938. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  939. <el-table-column prop="state" :label="$t('state.states')">
  940. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  941. </el-table-column>
  942. </el-table>
  943. <span slot="footer" class="dialog-footer">
  944. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  945. </span>
  946. </el-dialog>
  947. <div v-if="isSubstitude && substitudeStep == 1" style="width:300px;margin:0 auto;" >
  948. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames" size="small"
  949. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  950. <div @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1" >
  951. <span class="spnn" v-if="workForm.userNames">
  952. <span v-for="(item, index) in workForm.userNames" :key="index">
  953. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  954. <span v-if="index < workForm.userNames.length - 1">,</span>
  955. </span>
  956. </span>
  957. <span class="spnn hover" v-else>
  958. {{$t('defaultText.pleaseSelectAsubstitute')}}
  959. </span>
  960. </div>
  961. <el-button @click="substitudeStep = 2; getCurrentWeek();" style="margin-top:10px;margin-left:100px" type="primary">{{ $t('btn.nextStep') }}</el-button>
  962. </div>
  963. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!isSubstitude || (substitudeStep == 2 && isSubstitude && workForm.userNames && workForm.userNames.length>0)">
  964. <el-form-item style="height:30px;margin-top:-72px;">
  965. <!-- <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> -->
  966. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  967. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  968. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  969. <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>
  970. <el-option
  971. v-for="item in fillProjectList"
  972. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  973. :key="item.id"
  974. :label="item.projectName + '\u3000' + item.projectCode"
  975. :value="item.id">
  976. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  977. <span style="float: right">{{ item.projectName }}</span>
  978. </el-option>
  979. </el-select>
  980. <span style="float:right;margin-right:10px;">{{ $t('defaultText.selectProject') }}</span>
  981. </el-form-item>
  982. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  983. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  984. <template slot-scope="scope">
  985. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  986. </template>
  987. </el-table-column>
  988. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  989. <template slot-scope="scope">
  990. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  991. <p v-else></p>
  992. </template>
  993. </el-table-column> -->
  994. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  995. <template slot-scope="scope">
  996. <div v-if="scope.row.canFill == 1">
  997. <template v-if="user.company.packageProject == 0 && user.timeType.type == 1">
  998. <div v-if="reportTimeType.multiWorktime == 0" slot="reference">
  999. <el-input-number v-model="scope.row[item.projectName].workingTime" size="small" :step="0.5" controls-position="right" step-strictly :min="0" :max="20" :disabled="[0, 1, '0', '1'].includes(scope.row[item.projectName].state)" @change="fillInThePedometerOnAWeeklyBasis(scope.$index)"></el-input-number>
  1000. <span v-if="scope.row[item.projectName].state != 3 && workReportStateString[scope.row[item.projectName].state]" :class="statusStyle[scope.row[item.projectName].state]">({{workReportStateString[scope.row[item.projectName].state]}})</span>
  1001. <el-link type="primary" style="margin-left: 10px" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">编辑</el-link>
  1002. </div>
  1003. </template>
  1004. <template v-else>
  1005. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  1006. <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>
  1007. <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>
  1008. <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>
  1009. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  1010. </div>
  1011. </template>
  1012. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  1013. <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>
  1014. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  1015. </div>
  1016. </div>
  1017. <div v-else >
  1018. <span style="color:#999999;">{{ $t('buKeChaoQianTianBao') }}</span>
  1019. </div>
  1020. </template>
  1021. </el-table-column>
  1022. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="160" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  1023. <template slot-scope="scope">
  1024. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}
  1025. <span v-if="scope.row.corpTime.otTime" style="color:#FFA500"><br/>加班:{{scope.row.corpTime.otTime+'h'}}</span>
  1026. </span>
  1027. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  1028. </template>
  1029. </el-table-column>
  1030. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  1031. <template slot-scope="scope">
  1032. <div class="zhiss">
  1033. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  1034. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  1035. </div>
  1036. </template>
  1037. </el-table-column>
  1038. </el-table>
  1039. </el-form>
  1040. <span slot="footer" class="dialog-footer" v-if="!isSubstitude || substitudeStep == 2">
  1041. <span v-if="isSubstitude" style="float:left;color:orange;">{{ $t('zhengZaiWei') }}【{{workForm.userNames}}】{{ $t('daiTian') }}</span>
  1042. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  1043. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  1044. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  1045. <el-button v-if="user.companyId != 5978" type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1046. <!--针对景昱,先检查工时是否存在异常-->
  1047. <el-button v-if="user.companyId == 5978" type="primary" @click="checkDateWorkTime()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1048. </span>
  1049. </el-dialog>
  1050. <!-- 重庆物奇私人定制的按周填报 -->
  1051. <el-dialog :title="$t('textLink.fillInAWeek')" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  1052. <div class="fillWeekDialogVisiCustom">
  1053. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  1054. </div>
  1055. </el-dialog>
  1056. <!-- enableNewWeeklyfill==2 -->
  1057. <el-dialog :title="$t('textLink.fillInAWeek')" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustomTwo" width="1400px" :before-close="handleClose" top="7.5vh">
  1058. <div class="fillWeekDialogVisiCustom">
  1059. <NewWeeklyCustomization @weekClose="fillWeekCustomClneTwo" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></NewWeeklyCustomization>
  1060. </div>
  1061. </el-dialog>
  1062. <!-- 选择时间 -->
  1063. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  1064. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  1065. <span slot="footer" class="dialog-footer">
  1066. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  1067. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  1068. </span>
  1069. </el-dialog>
  1070. <!-- 按周填报弹窗 -->
  1071. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  1072. <div>
  1073. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  1074. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  1075. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1076. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1077. </el-select>
  1078. </div>
  1079. <!--如果设置了工时成本预警的预算成本项-->
  1080. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  1081. <p>{{$t('lable.budgetSource')}}</p>
  1082. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  1083. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  1084. </el-select>
  1085. </div>
  1086. <!-- 任务分组 -->
  1087. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1088. <p>{{$t('lable.taskGrouping')}}</p>
  1089. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1090. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1091. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1092. </el-select>
  1093. </div>
  1094. <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
  1095. <p>{{$t('other.inputStage')}}</p>
  1096. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1097. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1098. </el-select>
  1099. </div>
  1100. <!-- 工单号,行号 -->
  1101. <div class="zhoFel" v-if="user.timeType.reportExtraField4Name">
  1102. <p>{{ user.timeType.reportExtraField4Name }}</p>
  1103. <el-select v-model="zhoBao.extraField4" placeholder="请选择" @change="onProgressChange" filterable style="width: 355px" clearable>
  1104. <el-option v-for="lin in (zhoBao.reportExtraField4List || [])" :key="lin" :label="lin" :value="lin">
  1105. </el-option>
  1106. </el-select>
  1107. </div>
  1108. <div class="zhoFel" v-if="user.timeType.reportExtraField5Name">
  1109. <p>{{ user.timeType.reportExtraField5Name }}</p>
  1110. <el-select v-model="zhoBao.extraField5" placeholder="请选择" @change="onProgressChange" filterable style="width: 355px" clearable>
  1111. <el-option v-for="lin in (zhoBao.reportExtraField5List || [])" :key="lin" :label="lin" :value="lin">
  1112. </el-option>
  1113. </el-select>
  1114. </div>
  1115. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1116. <p>{{$t('other.reviewer')}}</p>
  1117. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1118. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1119. </el-select>
  1120. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1121. </div>
  1122. <template v-if="user.timeType.reportAuditType == 3">
  1123. <div class="zhoFel">
  1124. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1125. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1126. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1127. </el-select>
  1128. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1129. </div>
  1130. <div class="zhoFel">
  1131. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1132. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1133. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1134. </el-select>
  1135. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1136. </div>
  1137. <div class="zhoFel">
  1138. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1139. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1140. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1141. </el-select>
  1142. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1143. </div>
  1144. <div class="zhoFel">
  1145. <p>{{ $t('chao-song-ren') }}</p>
  1146. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1147. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1148. </el-select>
  1149. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1150. </div>
  1151. </template>
  1152. <!-- 自定义维度 -->
  1153. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1154. <p>{{user.timeType.customDegreeName}}</p>
  1155. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1156. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1157. </el-select>
  1158. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1159. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1160. </el-select>
  1161. </div>
  1162. <!-- 自定义数值 -->
  1163. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1164. <p>{{user.timeType.customDataName}}</p>
  1165. <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>
  1166. </div>
  1167. <!-- 自定义文本 -->
  1168. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1169. <p>{{user.timeType.customTextName}}</p>
  1170. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1171. </div>
  1172. <!-- 选择任务 -->
  1173. <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
  1174. <p>{{ $t('renWuLiChengBei') }}</p>
  1175. <el-select v-model="zhoBao.taskId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1176. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1177. </el-select>
  1178. </div>
  1179. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1180. <p>{{$t('other.timeSelection')}}</p>
  1181. <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>
  1182. </div>
  1183. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1184. <p>{{$t('other.chooseDuration')}}</p>
  1185. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1186. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1187. </el-select>
  1188. </div>
  1189. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1190. <p>{{$t('lable.percentageOfTime')}}</p>
  1191. <div style="width:400px;display: flex;align-items: center;">
  1192. <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>
  1193. <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>
  1194. </div>
  1195. </div>
  1196. <div class="zhoFel">
  1197. <p>{{$t('other.workMatters')}}</p>
  1198. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1199. </div>
  1200. </div>
  1201. <span slot="footer" class="dialog-footer">
  1202. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1203. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1204. </span>
  1205. </el-dialog>
  1206. <!--导出报表条件选择 -->
  1207. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1208. <el-form ref="form3" :model="exportParam" >
  1209. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1210. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1211. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1212. </el-select>
  1213. </el-form-item>
  1214. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1215. <!-- <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>
  1216. <vueCascader :size="'medium'" :widthStr="'350'" :clearable="true" :subjectId="exportParam.departmentId" :subject="option" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader> -->
  1217. <vueMultipleDept v-model="exportParam.departmentId" :selectType="'2'"></vueMultipleDept>
  1218. </el-form-item>
  1219. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1220. <el-date-picker
  1221. v-model="exportParam.dateRange" :editable="false"
  1222. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1223. :range-separator="$t('other.to')"
  1224. type="daterange"
  1225. :start-placeholder="$t('time.startDate')"
  1226. :end-placeholder="$t('time.endDate')"
  1227. ></el-date-picker>
  1228. </el-form-item>
  1229. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1230. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1231. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1232. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1233. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1234. </el-select>
  1235. </el-form-item>
  1236. <el-form-item prop="exportType" :label="$t('daoChuFangShi')" v-if="user.companyId == '936'">
  1237. <div class="exportReportRadio">
  1238. <el-radio v-model="exportType" :label="0">{{ $t('wanZhengDaoChu') }}</el-radio>
  1239. <el-radio v-model="exportType" :label="1">{{ $t('jingJianDaoChu') }}</el-radio>
  1240. <el-tooltip effect="dark" :content="$t('jingJianRiBaoBuHanGongZuoShiXiangHeShenPiXinXiShuJuLiangGengXiaoDaoChuGengKuai')" placement="top-start">
  1241. <i class="el-icon-question"></i>
  1242. </el-tooltip>
  1243. </div>
  1244. </el-form-item>
  1245. </el-form>
  1246. <div slot="footer" class="dialog-footer">
  1247. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1248. </div>
  1249. </el-dialog>
  1250. <!--导出报表条件选择 -->
  1251. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1252. <el-form ref="form3" :model="exportParam" >
  1253. <el-form-item prop="range" :label="$t('time.dateRange')">
  1254. <el-date-picker
  1255. v-model="exportParam.dateRange" :editable="false"
  1256. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1257. :clearable="true"
  1258. :range-separator="$t('other.to')"
  1259. type="daterange"
  1260. :start-placeholder="$t('time.startDate')"
  1261. :end-placeholder="$t('time.endDate')"
  1262. ></el-date-picker>
  1263. </el-form-item>
  1264. </el-form>
  1265. <div slot="footer" class="dialog-footer">
  1266. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1267. </div>
  1268. </el-dialog>
  1269. <!--人员列表 -->
  1270. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1271. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1272. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1273. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1274. <el-table-column type="selection"></el-table-column>
  1275. <el-table-column prop="label" :label="$t('lable.name')" >
  1276. <template slot-scope="scope">
  1277. <span>
  1278. <!-- {{(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}} -->
  1279. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1280. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1281. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1282. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1283. </span>
  1284. <span v-else>
  1285. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1286. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1287. </span>
  1288. </span>
  1289. </template>
  1290. </el-table-column>
  1291. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1292. <template slot-scope="scope">
  1293. <div>
  1294. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1295. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1296. </div>
  1297. </template>
  1298. </el-table-column>
  1299. </el-table>
  1300. </el-tab-pane>
  1301. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1302. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1303. <el-table-column prop="label" :label="$t('lable.name')" >
  1304. <template slot-scope="scope">
  1305. <!-- <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> -->
  1306. <!-- <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> -->
  1307. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1308. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1309. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1310. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1311. </span>
  1312. <span v-else>
  1313. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1314. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1315. </span>
  1316. </template>
  1317. </el-table-column>
  1318. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1319. <template slot-scope="scope">
  1320. <div>
  1321. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1322. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1323. </div>
  1324. </template>
  1325. </el-table-column>
  1326. </el-table>
  1327. </el-tab-pane>
  1328. </el-tabs>
  1329. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1330. <el-table-column type="selection"></el-table-column>
  1331. <el-table-column prop="label" :label="$t('lable.name')" >
  1332. <template slot-scope="scope">
  1333. <div>
  1334. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1335. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1336. </div>
  1337. </template>
  1338. </el-table-column>
  1339. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1340. <template slot-scope="scope">
  1341. <div>
  1342. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1343. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1344. </div>
  1345. </template>
  1346. </el-table-column>
  1347. </el-table>
  1348. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1349. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1350. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1351. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1352. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1353. </div>
  1354. </el-dialog>
  1355. <!-- 日报审核修改 -->
  1356. <el-dialog
  1357. :title="$t('riBaoShenHeXiuGai')"
  1358. :visible.sync="reportLogCheckDialog"
  1359. width="30%"
  1360. :before-close="handleClose">
  1361. <el-form ref="form3" :model="exportReportLogParam" >
  1362. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1363. <el-date-picker
  1364. v-model="exportReportLogParam.dateRange" :editable="false"
  1365. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1366. :range-separator="$t('other.to')"
  1367. type="daterange"
  1368. :start-placeholder="$t('time.startDate')"
  1369. :end-placeholder="$t('time.endDate')"
  1370. ></el-date-picker>
  1371. </el-form-item>
  1372. </el-form>
  1373. <el-link type="primary" @click="exportReportLog">{{ $t('daoChuRiBaoShenHeJiLuShuJu') }}</el-link>
  1374. <br>
  1375. <el-upload ref="upload" action="#" :limit="1" :http-request="importReportLog" :show-file-list="false">
  1376. <el-link type="primary" @click="importReportLog">{{ $t('daoRuRiBaoShenHeJiLuXiuGaiShuJu') }}</el-link></el-upload>
  1377. <span slot="footer" class="dialog-footer">
  1378. <el-button type="primary" @click="reportLogCheckDialog = false">{{ $t('Shutdown') }}</el-button>
  1379. </span>
  1380. </el-dialog>
  1381. <!-- 按部门选择人员 -->
  1382. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1383. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1384. <el-input v-if="user.userNameNeedTranslate == 1" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" v-model.trim="nameAearch" @keyup.enter.native="nameAearchSeek(true)" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1385. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1386. </el-input>
  1387. <div class="tree" style="height:400px">
  1388. <el-scrollbar style="height:100%">
  1389. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1390. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1391. highlight-current :filter-node-method="filterNode" :default-expand-all="expandAlltree">
  1392. <span class="custom-tree-node" slot-scope="{ node }">
  1393. <span v-if="user.userNameNeedTranslate == '1'">
  1394. <span v-if="node.data.children">
  1395. <TranslationOpenDataText type='departmentName' :openid='node.label'></TranslationOpenDataText>
  1396. </span>
  1397. <span v-else>
  1398. <TranslationOpenDataText type='userName' :openid='node.label'></TranslationOpenDataText>
  1399. </span>
  1400. </span>
  1401. <span v-if="user.userNameNeedTranslate != '1'">
  1402. {{ node.label }}
  1403. </span>
  1404. <!-- {{ node.label }} -->
  1405. </span>
  1406. </el-tree>
  1407. </el-scrollbar>
  1408. </div>
  1409. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1410. <div slot="footer" class="dialog-footer">
  1411. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1412. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1413. </div>
  1414. </el-dialog>
  1415. <el-dialog
  1416. v-if="monthWorkTimeDialog"
  1417. :visible.sync="monthWorkTimeDialog"
  1418. :close-on-click-modal="false"
  1419. customClass="customWidth selectworktime"
  1420. width="92%"
  1421. top="60px"
  1422. >
  1423. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1424. <el-tabs v-model="activeName" @tab-click="handleClick">
  1425. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1426. <div class="selectworktime_export" style="margin-top:10px;">
  1427. <div class="selectworktime_export_l">
  1428. <el-date-picker
  1429. class="selecteworktime_datapick"
  1430. v-model="WorktimeDatepickValue"
  1431. value-format="yyyy-MM-dd"
  1432. type="daterange"
  1433. align="right"
  1434. unlink-panels
  1435. :range-separator="$t('other.to')"
  1436. :start-placeholder="$t('time.startDate')"
  1437. :end-placeholder="$t('time.endDate')"
  1438. :default-time="['12:00:00', '12:00:00']"
  1439. size="small"
  1440. popper-class="selecteorktime_datapick_popper"
  1441. @change="showMonthWorkTime()"
  1442. >
  1443. </el-date-picker>
  1444. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1445. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1446. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1447. <!-- 222 -->
  1448. </div>
  1449. <div>
  1450. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForHasReport" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthWorkTime()"></el-cascader>
  1451. <vueCascader :subjectId="deptIdForHasReport" :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'14'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1452. <el-input style="float:left;width:22%" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" @keyup.enter.native="searchScreen(0)" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1453. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1454. </el-input>
  1455. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1456. </div>
  1457. <div style="float: left; height:32px; padding-top:10px;">
  1458. <span style="width:20px;height:20px;background-color: orange;padding:5px 8px;">{{ $t('state.WaitingAudit') }}</span>
  1459. <span style="width:20px;height:20px;background-color: #32CD32;padding:5px 8px;margin-left:10px;">{{ $t('state.alreadyPassed') }}</span>
  1460. <span style="width:20px;height:20px;background-color: red;padding:5px 8px;margin-left:10px;">{{ $t('yiBoHuiLouTian') }}</span>
  1461. <span style="width:20px;height:20px;background-color: #E0E0E0;padding:5px 8px;margin-left:10px;">{{ $t('weiTiJiao') }}</span>
  1462. </div>
  1463. <div style="float: right; vertical-align: middle;height:32px">
  1464. <el-link
  1465. type="primary"
  1466. @click="exportMembWorkHours()"
  1467. >{{$t('export.exportData')}}</el-link
  1468. >
  1469. </div>
  1470. </div>
  1471. <el-table ref="hasworkTbl"
  1472. :data="monthWorkDataS"
  1473. v-el-table-infinite-scroll="listScroll"
  1474. border
  1475. :height="'70vh'"
  1476. highlight-current-row
  1477. style="width: 100%"
  1478. v-loading="tbload"
  1479. :lazy="true"
  1480. :cell-style="hasworkTblCellStyle"
  1481. >
  1482. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1483. <template slot-scope="scope">
  1484. {{ scope.$index + 1 }}
  1485. </template>
  1486. </el-table-column>
  1487. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1488. <template slot-scope="scope">
  1489. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1490. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1491. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1492. <!-- {{scope.row.name}} -->
  1493. </span>
  1494. </template>
  1495. </el-table-column>
  1496. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1497. <template slot-scope="scope">
  1498. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1499. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1500. </template>
  1501. </el-table-column>
  1502. <el-table-column
  1503. min-width="60"
  1504. v-for="(item, index) in pickDateArray"
  1505. :key="index"
  1506. :label="item"
  1507. align="center"
  1508. >
  1509. <template slot="header" slot-scope="scope">
  1510. <div>{{ scope.column.label.dateStr }}</div>
  1511. <div>{{ scope.column.label.weekStr }}</div>
  1512. </template>
  1513. <template slot-scope="scope">
  1514. <div
  1515. v-if="
  1516. scope.row.worktimeList.filter(
  1517. (w) =>
  1518. w.createDate==item.date
  1519. ).length > 0 &&
  1520. scope.row.worktimeList.filter(
  1521. (w) =>w.createDate==item.date
  1522. )[0].workingTime < reportTimeType.allday
  1523. "
  1524. >
  1525. {{
  1526. scope.row.worktimeList.filter(
  1527. (w) =>w.createDate==item.date
  1528. )[0].workingTime.toFixed(1)
  1529. }}
  1530. </div>
  1531. <div
  1532. v-if="
  1533. scope.row.worktimeList.filter(
  1534. (w) =>w.createDate==item.date
  1535. ).length > 0 &&
  1536. scope.row.worktimeList.filter(
  1537. (w) =>w.createDate==item.date
  1538. )[0].workingTime > reportTimeType.allday
  1539. "
  1540. >
  1541. {{
  1542. scope.row.worktimeList.filter(
  1543. (w) =>w.createDate==item.date
  1544. )[0].workingTime.toFixed(1)
  1545. }}
  1546. </div>
  1547. <div
  1548. v-if="
  1549. scope.row.worktimeList.filter(
  1550. (w) =>w.createDate==item.date
  1551. ).length > 0 &&
  1552. scope.row.worktimeList.filter(
  1553. (w) =>w.createDate==item.date
  1554. )[0].workingTime == reportTimeType.allday
  1555. "
  1556. >
  1557. {{
  1558. scope.row.worktimeList.filter(
  1559. (w) =>w.createDate==item.date
  1560. )[0].workingTime
  1561. }}
  1562. </div>
  1563. <div
  1564. v-if="
  1565. scope.row.worktimeList.filter(
  1566. (w) =>w.createDate==item.date
  1567. ).length == 0
  1568. "
  1569. >
  1570. 0
  1571. </div>
  1572. <div
  1573. v-if="
  1574. scope.row.worktimeList.filter(
  1575. (w) =>w.createDate==item.date
  1576. ).length > 0 &&
  1577. typeof scope.row.worktimeList.filter(
  1578. (w) =>w.createDate==item.date
  1579. )[0].workingTime == 'string'
  1580. "
  1581. >
  1582. {{
  1583. scope.row.worktimeList.filter(
  1584. (w) =>w.createDate==item.date
  1585. )[0].workingTime
  1586. }}
  1587. </div>
  1588. </template>
  1589. </el-table-column>
  1590. </el-table>
  1591. <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>
  1592. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1593. </el-tab-pane>
  1594. <el-tab-pane :label="$t('weiTiJiaoRenYuanLieBiao')" name="second" >
  1595. <div class="selectworktime_export" style="margin-top:10px">
  1596. <div class="selectworktime_export_l">
  1597. <el-date-picker
  1598. class="selecteworktime_datapick"
  1599. v-model="WorktimeDatepickValue"
  1600. value-format="yyyy-MM-dd"
  1601. type="daterange"
  1602. align="right"
  1603. unlink-panels
  1604. :range-separator="$t('other.to')"
  1605. :start-placeholder="$t('time.startDate')"
  1606. :end-placeholder="$t('time.endDate')"
  1607. :default-time="['12:00:00', '12:00:00']"
  1608. size="small"
  1609. popper-class="selecteorktime_datapick_popper"
  1610. @change="showMonthNotWorkTime()"
  1611. >
  1612. </el-date-picker>
  1613. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1614. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1615. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1616. </div>
  1617. <div>
  1618. <div style="margin-top:10px;">
  1619. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForNoReport" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthNotWorkTime()"></el-cascader>
  1620. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'15'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1621. <el-input style="width:200px;margin-left: 15px" v-if="user.userNameNeedTranslate != '1'" @keyup.enter.native="searchScreen(1)" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1622. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1623. </el-input>
  1624. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1625. <el-checkbox v-model="onlyHaveAttendance" v-if="user.timeType.syncCorpwxTime == 1" style="margin-left:10px;" @change="showMonthNotWorkTime">仅显示有考勤的记录</el-checkbox>
  1626. <el-link
  1627. type="primary"
  1628. style="float: right; vertical-align: middle;height:32px"
  1629. @click="exportMembNotWorkHours()"
  1630. >{{$t('export.exportData')}}</el-link
  1631. >
  1632. </div>
  1633. </div>
  1634. </div>
  1635. <el-table
  1636. ref="hasworkTbl2"
  1637. :data="monthNotWorkDateS"
  1638. v-el-table-infinite-scroll="notListScroll"
  1639. border
  1640. :height="'70vh'"
  1641. highlight-current-row
  1642. style="width: 100%"
  1643. v-loading="tbload"
  1644. lazy
  1645. >
  1646. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1647. <template slot-scope="scope">
  1648. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.department'></TranslationOpenDataText></span>
  1649. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1650. </template>
  1651. </el-table-column>
  1652. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1653. <template slot-scope="scope">
  1654. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1655. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1656. </template>
  1657. </el-table-column>
  1658. <el-table-column
  1659. min-width="200"
  1660. :label="$t('weekDay.date')"
  1661. align="center"
  1662. prop="createDate"
  1663. >
  1664. </el-table-column>
  1665. <el-table-column
  1666. min-width="200"
  1667. :label="$t('state.states')"
  1668. align="center"
  1669. prop="status"
  1670. />
  1671. <el-table-column
  1672. min-width="200"
  1673. :label="$t('other.attendanceData')"
  1674. prop="cardTime"
  1675. align="center"
  1676. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1677. </el-table>
  1678. <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>
  1679. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1680. </el-tab-pane>
  1681. <el-tab-pane :label="$t('cardtimenotfull')" name="fourth" v-if="user.timeType.syncCorpwxTime==1 || user.timeType.syncFanwei == 1">
  1682. <div class="selectworktime_export" style="margin-top:10px">
  1683. <div class="selectworktime_export_l">
  1684. <el-date-picker
  1685. class="selecteworktime_datapick"
  1686. v-model="notfullSelectDateMonth"
  1687. value-format="yyyy-MM"
  1688. type="month"
  1689. align="right"
  1690. unlink-panels
  1691. size="small"
  1692. popper-class="selecteorktime_datapick_popper"
  1693. @change="showReportTimeLessThanCardTimeList()"
  1694. >
  1695. </el-date-picker>
  1696. </div>
  1697. <div>
  1698. <div style="margin-top:10px;">
  1699. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForHasReport" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showReportTimeLessThanCardTimeList()"></el-cascader>
  1700. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'17'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1701. <el-input style="width:200px;margin-left: 15px" v-if="user.userNameNeedTranslate != '1'" @keyup.enter.native="searchScreen(2)" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1702. <el-button slot="append" @click="searchScreen(2)" icon="el-icon-search"></el-button>
  1703. </el-input>
  1704. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'15'" :clearable="true" @selectCal="selectCal"></selectCat>
  1705. <!-- <el-link
  1706. type="primary"
  1707. style="float: right; vertical-align: middle;height:32px"
  1708. @click="exportMembNotWorkHours()"
  1709. >{{$t('export.exportData')}}</el-link
  1710. > -->
  1711. </div>
  1712. </div>
  1713. </div>
  1714. <el-table
  1715. ref="hasworkTbl4"
  1716. :data="notFullData"
  1717. border
  1718. :height="'70vh'"
  1719. highlight-current-row
  1720. style="width: 100%"
  1721. v-loading="tbload"
  1722. lazy
  1723. >
  1724. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1725. <template slot-scope="scope">
  1726. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1727. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1728. </template>
  1729. </el-table-column>
  1730. <el-table-column
  1731. min-width="200"
  1732. :label="$t('weekDay.date')"
  1733. align="center"
  1734. prop="createDate"
  1735. >
  1736. </el-table-column>
  1737. <el-table-column
  1738. min-width="200"
  1739. :label="$t('fillReportTime')"
  1740. align="center"
  1741. prop="reportTime"
  1742. />
  1743. <el-table-column
  1744. min-width="200"
  1745. :label="$t('workAttendance')"
  1746. prop="workHours"
  1747. align="center"></el-table-column>
  1748. </el-table>
  1749. </el-tab-pane>
  1750. <el-tab-pane v-if="user.companyId==5978" :label="$t('gongShiYiChangMingXi')" name="third">
  1751. <div class="selectworktime_export" style="margin-top:10px;">
  1752. <div class="selectworktime_export_l">
  1753. <el-date-picker
  1754. class="selecteworktime_datapick"
  1755. v-model="WorktimeDatepickValue"
  1756. value-format="yyyy-MM-dd"
  1757. type="daterange"
  1758. align="right"
  1759. unlink-panels
  1760. :range-separator="$t('other.to')"
  1761. :start-placeholder="$t('time.startDate')"
  1762. :end-placeholder="$t('time.endDate')"
  1763. :default-time="['12:00:00', '12:00:00']"
  1764. size="small"
  1765. popper-class="selecteorktime_datapick_popper"
  1766. @change="showMonthWorkTimeReminder()"
  1767. >
  1768. </el-date-picker>
  1769. <el-button size="small" @click="getDoubleLastWeek(2)">{{$t('time.twoWeeksAgo')}}</el-button>
  1770. <el-button size="small" @click="getLastWeek(2)">{{$t('time.lastWeek')}}</el-button>
  1771. <el-button size="small" @click="getThisWeek(2)">{{$t('time.nextWeek')}}</el-button>
  1772. </div>
  1773. <div>
  1774. <div style="margin-top:10px;">
  1775. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForReminder" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthWorkTimeReminder()"></el-cascader>
  1776. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'16'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1777. <el-input style="float:left;width:18%" v-if="user.userNameNeedTranslate != '1'" @keyup.enter.native="searchScreen(0)" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1778. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1779. </el-input>
  1780. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1781. <el-checkbox v-model="isReminder" @change="showMonthWorkTimeReminder()">{{ $t('shiFouYiChang') }}</el-checkbox>
  1782. </div>
  1783. </div>
  1784. <div style="float: right; vertical-align: middle;height:32px">
  1785. <el-link
  1786. type="primary" v-loading="remindering"
  1787. @click="changeReminder()"
  1788. >{{ $t('bianGengTiXing') }}</el-link
  1789. >
  1790. <el-link
  1791. type="primary"
  1792. @click="exportMembWorkHoursReminder()"
  1793. >{{$t('export.exportData')}}</el-link
  1794. >
  1795. </div>
  1796. </div>
  1797. <el-table ref="hasworkTbl"
  1798. :data="monthWorkDataS"
  1799. v-el-table-infinite-scroll="listScroll"
  1800. border
  1801. :height="'70vh'"
  1802. highlight-current-row
  1803. style="width: 100%"
  1804. v-loading="tbload"
  1805. :lazy="true"
  1806. >
  1807. <el-table-column width="120" type="index" fixed="left" :label="$t('weekDay.date')">
  1808. <template slot-scope="scope">
  1809. {{ scope.row.createDate}}
  1810. </template>
  1811. </el-table-column>
  1812. <el-table-column width="120" prop="name" fixed="left" :label="$t('lable.name')">
  1813. <template slot-scope="scope">
  1814. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1815. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1816. <!-- {{scope.row.name}} -->
  1817. </template>
  1818. </el-table-column>
  1819. <el-table-column width="100" prop="invokeValue" fixed="left" :label="$t('costtype')">
  1820. <template slot-scope="scope">
  1821. {{scope.row.invokeValue}}
  1822. </template>
  1823. </el-table-column>
  1824. <el-table-column prop="departmentName" width="170" fixed="left" :label="$t('lable.department')">
  1825. <template slot-scope="scope">
  1826. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1827. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1828. </template>
  1829. </el-table-column>
  1830. <el-table-column width="160" type="index" fixed="left" :label="$t('tianBaoGongShi')">
  1831. <template slot-scope="scope">
  1832. {{ scope.row.workingTime}}
  1833. </template>
  1834. </el-table-column>
  1835. <el-table-column width="160" type="index" fixed="left" :label="$t('kaoQinGongShi')">
  1836. <template slot-scope="scope">
  1837. {{ scope.row.cardTime}}
  1838. <i class="el-icon-refresh" @click="restUserCardTime(scope.row)"></i>
  1839. </template>
  1840. </el-table-column>
  1841. <el-table-column width="160" type="index" fixed="left" :label="$t('shiFouYiChang')">
  1842. <template slot-scope="scope">
  1843. {{ scope.row.exceedCardTime==0?$t('state.no'):$t('state.yes')}}
  1844. </template>
  1845. </el-table-column>
  1846. <el-table-column width="160" type="index" fixed="left" :label="$t('cuiBan')">
  1847. <template slot-scope="scope">
  1848. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="changeReminder(scope.row)">{{ $t('bianGengTiXing') }}</el-link>
  1849. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="cancelReminder(scope.row)">{{ $t('quXiaoYiChang') }}</el-link>
  1850. </template>
  1851. </el-table-column>
  1852. </el-table>
  1853. <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>
  1854. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1855. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1856. <label style="font-size: 16px">员工每日已填报工时数</label>
  1857. <el-link
  1858. type="primary"
  1859. style="float: right; margin-right: 60px"
  1860. @click="exportMembWorkHours()"
  1861. >导出已填报数据</el-link
  1862. > -->
  1863. <!-- <el-button >导出</el-button> -->
  1864. <!-- </div> -->
  1865. </el-tab-pane>
  1866. </el-tabs>
  1867. </el-dialog>
  1868. <!--驳回弹出框 -->
  1869. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1870. <div>
  1871. <span style="color:red;">*</span><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')" />
  1872. </div>
  1873. <div slot="footer" class="dialog-footer">
  1874. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1875. <el-button type="primary" :loading="isDenying" @click="deny()" :disabled="user.timeType.forceRejectReason && !denyForm.reason">{{$t('btn.submit')}}</el-button>
  1876. </div>
  1877. </el-dialog>
  1878. <!-- 通过弹出框 -->
  1879. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1880. <div>
  1881. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1882. </div>
  1883. <div slot="footer" class="dialog-footer">
  1884. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1885. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1886. </div>
  1887. </el-dialog>
  1888. <!--批量导入日报 -->
  1889. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1890. <p>1. {{$t('other.download')}}
  1891. <el-link type="primary" style="margin-left:5px;" :underline="false" :href="(user.timeType.enableNewWeeklyfill==1||user.companyId == 936 || user.companyId == 839 || user.timeType.importReportAuditNormal == 1)?('./upload/员工工时导入模板_新版.xlsx'):('./upload/'+$t('template.EmployeeHoursStatisticsTemplate')+'2.xlsx')" :download="((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate'))+'.xlsx'">{{((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate')) + '.xlsx'}}</el-link>
  1892. </p>
  1893. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1894. <p style="display: flex;justify-content: center;">
  1895. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1896. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1897. </el-upload>
  1898. </p>
  1899. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1900. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1901. </div>
  1902. </el-dialog>
  1903. <!-- 工时导入记录弹窗 -->
  1904. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1905. <div style="height: 452px">
  1906. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1907. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1908. <el-table-column prop="userName" :label="$t('other.operator')">
  1909. <template slot-scope="scope">
  1910. <div>
  1911. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.userName'></TranslationOpenDataText></span>
  1912. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1913. </div>
  1914. </template>
  1915. </el-table-column>
  1916. <el-table-column prop="datel" :label="$t('other.document')">
  1917. <template slot-scope="scope">
  1918. <div>
  1919. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1920. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1921. </div>
  1922. </template>
  1923. </el-table-column>
  1924. <el-table-column :label="$t('operation')" v-if="showHidden && user.companyId == 469 && user.roleName=='超级管理员'">
  1925. <template slot-scope="scope">
  1926. <div>
  1927. <el-button type="default" size="small" @click="openModImportTime(scope.row)">{{ $t('xiuGaiDaoRuJiLu') }}</el-button>
  1928. <el-button type="primary" size="small" @click="delImportTime(scope.row)">{{ $t('shan-chu-ji-lu') }}</el-button>
  1929. </div>
  1930. </template>
  1931. </el-table-column>
  1932. </el-table>
  1933. <el-col :span="24" class="paginatis">
  1934. <el-pagination
  1935. @size-change="handleSizeChange"
  1936. @current-change="handleCurrentChange"
  1937. :page-sizes="[20 , 50 , 80 , 100]"
  1938. :page-size="20"
  1939. layout="total, sizes, prev, pager, next"
  1940. :total="toViewForm.total"
  1941. style="float:right;"
  1942. ></el-pagination>
  1943. </el-col>
  1944. </div>
  1945. </el-dialog>
  1946. <!--基于企业微信考勤数据的工时导入 -->
  1947. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1948. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1949. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1950. </el-step>
  1951. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1952. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1953. </el-steps>
  1954. <div v-if="active==0" style="padding:30px;height:360px;">
  1955. <div style="margin-top:50px;margin-left:280px;">
  1956. <el-date-picker
  1957. v-model="importWxParam.date" :editable="false"
  1958. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1959. :clearable="true"
  1960. :range-separator="$t('other.to')"
  1961. type="daterange"
  1962. :start-placeholder="$t('time.startDate')"
  1963. :end-placeholder="$t('time.endDate')"
  1964. @change="loadCheckInData"
  1965. ></el-date-picker>
  1966. </div>
  1967. </div>
  1968. <div v-if="active==1" style="padding:10px;">
  1969. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1970. style="width: 100%;margin-top:5px;" >
  1971. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1972. <template slot-scope="scope">
  1973. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1974. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1975. </template>
  1976. </el-table-column>
  1977. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1978. </el-table-column>
  1979. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1980. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1981. <template slot-scope="scope">
  1982. <div>
  1983. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  1984. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1985. </div>
  1986. </template>
  1987. </el-table-column>
  1988. <el-table-column prop="departmentName" :label="$t('lable.department')" >
  1989. <template slot-scope="scope">
  1990. <div>
  1991. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1992. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1993. </div>
  1994. </template>
  1995. </el-table-column>
  1996. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1997. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1998. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1999. <template slot-scope="scope">
  2000. {{scope.row.workHours.toFixed(1)}}h
  2001. </template>
  2002. </el-table-column>
  2003. </el-table>
  2004. </div>
  2005. <div v-if="active==2" >
  2006. <p style="display: flex;justify-content: center;height:390px;">
  2007. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  2008. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  2009. </el-upload>
  2010. </p>
  2011. </div>
  2012. <div slot="title">
  2013. <span style="font-size:16px;" @click="showHiddenFunction">{{$t('other.Batchimportofworkinghours')}}</span>
  2014. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  2015. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">{{ $t('xiaZaiTianBaoGongShiZhanBiBiao') }}</el-link>
  2016. <el-link v-if="active==0 && showHidden && user.companyId == 469 && user.roleName.indexOf('管理员') > 0" style="float:right;margin-right:100px;" type="primary" @click="importCardTimeVisi = true">{{ $t('daoRuKaoQinShiChang') }}</el-link>
  2017. <el-link v-if="active==0 && showHidden && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchDeleteReport = true; startDeleting = false;">{{ $t('piLiangShanChuRiBao') }}</el-link>
  2018. <el-link v-if="active==0 && showHidden && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchSimpleApproveReport = true; startDeleting = false;getDepartmentForApprove();">{{ $t('piLiangShenHeRiBao') }}</el-link>
  2019. </div>
  2020. <span slot="footer">
  2021. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  2022. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  2023. <el-button @click="refreshWXCardTimeByRange" v-if="active == 1" :loading="refreshingTime">刷新考勤</el-button>
  2024. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  2025. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  2026. </span>
  2027. </el-dialog>
  2028. <el-dialog :title="$t('daoRuKaoQinShiChang')" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  2029. <p style="display: flex;justify-content: center;height:100px;">
  2030. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  2031. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  2032. </el-upload>
  2033. </p>
  2034. </el-dialog>
  2035. <el-dialog :title="$t('piLiangShanChuRiBao')" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  2036. <div>
  2037. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2038. v-model="deleteReportParam.date" :editable="false"
  2039. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2040. :clearable="true"
  2041. :range-separator="$t('other.to')"
  2042. type="daterange"
  2043. :start-placeholder="$t('time.startDate')"
  2044. :end-placeholder="$t('time.endDate')"
  2045. ></el-date-picker>
  2046. </div>
  2047. <div style="margin-top:10px;">
  2048. <span>{{ $t('qing-xuan-ze-bu-men') }}:</span>
  2049. <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="deleteReportParam.deptId" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 350px;"></el-cascader>
  2050. <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>
  2051. </div>
  2052. <div style="margin-top:10px;">
  2053. <span>{{ $t('qingXuanZeYuanGong') }}:</span>
  2054. <el-select v-model="deleteReportParam.userIds" :placeholder="$t('defaultText.pleaseChoose')" style="width:500px;" filterable multiple>
  2055. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  2056. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  2057. <span v-else>{{item.name}}</span>
  2058. </el-option>
  2059. </el-select>
  2060. </div>
  2061. <span slot="footer">
  2062. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >{{ $t('kaiShiShanChu') }}</el-button>
  2063. </span>
  2064. </el-dialog>
  2065. <el-dialog :title="$t('piLiangShenHeRiBao')" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  2066. <div>
  2067. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2068. v-model="deleteReportParam.date" :editable="false"
  2069. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2070. :clearable="true"
  2071. :range-separator="$t('other.to')"
  2072. type="daterange"
  2073. :start-placeholder="$t('time.startDate')"
  2074. :end-placeholder="$t('time.endDate')"
  2075. ></el-date-picker>
  2076. </div>
  2077. <div style="margin-top:15px;">
  2078. <span>{{ $t('other.selectdepartment') }}:</span>
  2079. <el-cascader v-model="deleteReportParam.departmentId" :placeholder="$t('other.allDepartments')" style="width: 350px;margin-left:25px;"
  2080. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  2081. size="small" v-if="user.userNameNeedTranslate != 1"
  2082. ></el-cascader>
  2083. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  2084. </div>
  2085. <span slot="footer">
  2086. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >{{ $t('shenPiTongGuo') }}</el-button>
  2087. </span>
  2088. </el-dialog>
  2089. <el-dialog :title="$t('xiuGaiDaoRuJiLu')" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  2090. <div>
  2091. <span>{{ $t('other.timeSelection') }}:</span><el-date-picker
  2092. v-model="modImportTime"
  2093. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  2094. :clearable="true"
  2095. type="datetime"
  2096. ></el-date-picker>
  2097. <span>{{ $t('xuanZeDaoRuRenYuan') }}</span><el-select
  2098. v-model="modImportUserId"
  2099. >
  2100. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  2101. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  2102. <span v-else>{{item.name}}</span>
  2103. </el-option>
  2104. </el-select>
  2105. </div>
  2106. <span slot="footer">
  2107. <el-button @click="confirmChangeModTime" >{{ $t('queRen') }}</el-button>
  2108. </span>
  2109. </el-dialog>
  2110. <el-dialog :title="$t('daoChuYuanGongTianBaoGongShiZhanBi')" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  2111. <div>
  2112. <span>{{ $t('qingXuanZeNianYue') }}</span>
  2113. <el-date-picker
  2114. v-model="ratioYmonth" :editable="false"
  2115. format="yyyyMM" value-format="yyyyMM"
  2116. type="month"
  2117. ></el-date-picker>
  2118. </div>
  2119. <span slot="footer">
  2120. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">{{ $t('export.export') }}</el-button>
  2121. </span>
  2122. </el-dialog>
  2123. <!--工时批量代填 -->
  2124. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  2125. <div>
  2126. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2127. v-model="importWxParam.date" :editable="false"
  2128. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2129. :clearable="true"
  2130. :range-separator="$t('other.to')"
  2131. type="daterange"
  2132. :start-placeholder="$t('time.startDate')"
  2133. :end-placeholder="$t('time.endDate')"
  2134. @change="loadCheckInData"
  2135. ></el-date-picker>
  2136. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  2137. </div>
  2138. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  2139. :key="timeStamp"
  2140. style="width: 100%;margin-top:5px;" ref="tab">
  2141. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  2142. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  2143. <template slot-scope="scope">
  2144. <div>
  2145. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  2146. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  2147. </div>
  2148. </template>
  2149. </el-table-column>
  2150. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  2151. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  2152. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  2153. <template slot-scope="scope">
  2154. {{scope.row.workHours.toFixed(1)}}h
  2155. </template>
  2156. </el-table-column>
  2157. <!--项目名称列表 -->
  2158. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  2159. <template slot-scope="scope">
  2160. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  2161. </template>
  2162. </el-table-column>
  2163. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  2164. <template slot-scope="scope">
  2165. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  2166. </template>
  2167. </el-table-column>
  2168. </el-table>
  2169. </el-dialog>
  2170. <!--基于企业微信考勤数据的工时导入 -->
  2171. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  2172. <div style="padding-bottom:10px;">
  2173. <p>{{importResultMsg}}</p>
  2174. </div>
  2175. <!-- <span slot="footer" class="dialog-footer">
  2176. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  2177. </span> -->
  2178. </el-dialog>
  2179. <!-- 审核流程展示 -->
  2180. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="500px">
  2181. <div style="padding:20px 40px 20px 0">
  2182. <el-steps :active="curAuditNode" align-center="true" finish-status="success" v-if="user.companyId == 7544">
  2183. <el-step title="待提交"></el-step>
  2184. <el-step title="员工提交"></el-step>
  2185. <el-step title="审核通过"></el-step>
  2186. </el-steps>
  2187. <el-divider v-if="user.companyId == 7544"></el-divider>
  2188. <p style="color:#aaaaaa;" v-if="user.companyId == 7544">审核记录</p>
  2189. <el-timeline :reverse="false" style="margin-top:10px;">
  2190. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  2191. <!-- {{item.msg}} -->
  2192. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  2193. <span v-if="user.userNameNeedTranslate == 1">
  2194. <span><TranslationOpenDataText type='userName' :openid='item.msgCon.one'></TranslationOpenDataText></span>
  2195. <span>{{item.msgCon.two}}</span>
  2196. </span>
  2197. </el-timeline-item>
  2198. </el-timeline>
  2199. </div>
  2200. </el-dialog>
  2201. <!-- 威派格定制 -->
  2202. <TransferWorkingHours v-model="transferWorkingHoursVisable" :projectList="projectList" :userList="usersList"></TransferWorkingHours>
  2203. </section>
  2204. </template>
  2205. <script>
  2206. // 左右滑动
  2207. import dragMixin from "@/common/js/tensile.js";
  2208. import util from "../../common/js/util";
  2209. // 自定义select组件
  2210. import selectCat from "@/components/select.vue"
  2211. // 引入自定义级联组件
  2212. import vueCascader from "@/components/cascader.vue"
  2213. import vueMultipleDept from "@/components/vueMultipleDept.vue"
  2214. // 重庆物奇定制组件
  2215. import WeeklyCustomization from "./weeklyCustomization.vue"
  2216. // 威派格定制转移工时
  2217. import TransferWorkingHours from "./transferWorkingHours.vue"
  2218. // 新的按周填报
  2219. import NewWeeklyCustomization from "./newWeeklyCustomization.vue"
  2220. import { mapMutations } from 'vuex'
  2221. let _that = this
  2222. export default {
  2223. mixins: [dragMixin],
  2224. components: {
  2225. selectCat,
  2226. vueCascader,
  2227. WeeklyCustomization,
  2228. vueMultipleDept,
  2229. TransferWorkingHours,
  2230. NewWeeklyCustomization
  2231. },
  2232. data() {
  2233. return {
  2234. remindering: false,
  2235. onlyHaveAttendance: false,
  2236. notFullData:[],
  2237. notFullOriginList:[],
  2238. singleDate:1,
  2239. subFillProjectList:[],
  2240. curAuditNode: 1,
  2241. refreshingTime: false,
  2242. substitudeStep: 1,
  2243. showHidden: false,
  2244. pageIndex: 0,
  2245. hasMore: true,
  2246. exportType: 0,
  2247. exportingData: false,
  2248. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  2249. jobResponseList:[],
  2250. yisibeiCompId: 3092,
  2251. yuzhongCompId: 3385,
  2252. mingyiName : '成都明夷电子科技有限公司',
  2253. // mingyiName : '明夷',
  2254. modItemDataId: null,
  2255. modImportTime: null,
  2256. modImportUserId: null,
  2257. showModImportTimeDialog: false,
  2258. showBatchSimpleApproveReport: false,
  2259. startDeleting: false,
  2260. showBatchDeleteReport: false,
  2261. deleteReportParam: {date:null, userIds:[]},
  2262. isDenying: false,
  2263. targetWeekDate: null,//填写周报中的周日期
  2264. importCardTimeVisi: false,
  2265. startRatioExporting: false,
  2266. exportUserRatio: false,
  2267. ratioYmonth:null,
  2268. hasWrittenReport: false,
  2269. today:null,
  2270. syncTimeLoading: false,
  2271. seluserText: '',
  2272. translation: '1', // 1、文字, 2、部门, 3、人员
  2273. exportLoad: false,
  2274. getPickerOptions: {
  2275. disabledDate: (time) => {
  2276. var date = new Date();
  2277. var year = date.getFullYear();
  2278. var month = date.getMonth() + 1;
  2279. if (month >= 1 && month <= 9) {
  2280. month = "0" + month;
  2281. }
  2282. var currentdate = year.toString() + month.toString();
  2283. var timeyear = time.getFullYear();
  2284. var timemonth = time.getMonth() + 1;
  2285. if (timemonth >= 1 && timemonth <= 9) {
  2286. timemonth = "0" + timemonth;
  2287. }
  2288. var timedate = timeyear.toString() + timemonth.toString();
  2289. if(this.user.timeType.fillAhead == 0){
  2290. return currentdate < timedate;
  2291. }else{
  2292. return false
  2293. }
  2294. }
  2295. },
  2296. alalal: '8.0',
  2297. timeBasecostList:null,
  2298. tbload: false,
  2299. exportTimeDialog: false,
  2300. searchKeyword: '',
  2301. monthWorkDataS: [],
  2302. monthNotWorkDateS: [],
  2303. pickDateArray:[],
  2304. WorktimeDatepickValue: [],
  2305. activeName:"first",
  2306. isLeave: 0,
  2307. submitingReport: false,
  2308. importResultMsg:null,
  2309. showImportResult:false,
  2310. importingData: false,
  2311. isDraft: 0,
  2312. timeStamp: 0,
  2313. projectColumns:[],
  2314. checkinLoading:false,
  2315. importWxParam:{date:null,},
  2316. active:0,
  2317. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  2318. importWxDialog:false,
  2319. importDialog:false,
  2320. denyForm:null,
  2321. denyReasonDialog:false,
  2322. monthWorkTimeDialog: false,
  2323. notfullSelectDateMonth:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2324. isSubstitude:false,
  2325. isFill:false,
  2326. unFillList:[],
  2327. fillList:[],
  2328. fillMembList:[],
  2329. fillMembList_leave: [],
  2330. membListVisible: false,
  2331. isBatch:0,//是否是批量填报
  2332. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  2333. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  2334. 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')],
  2335. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  2336. fillStatusList: [],
  2337. exportParam:{projectId: null, dateRange:[], departmentId: null},
  2338. exportReportLogParam:{dateRange:[]},
  2339. exportDialog:false,
  2340. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  2341. subProjectList:[],
  2342. canEdit: true,
  2343. originCanEdit: true,
  2344. timeRange:[0.0,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],
  2345. selectTime:null,
  2346. reportTimeType:{},
  2347. curDate:'',
  2348. isAllSelect: false,
  2349. approveDialogVisible:false,
  2350. deptId:null,
  2351. targetUid: null,
  2352. membCount:0,
  2353. selectState:"-1",
  2354. user: JSON.parse(sessionStorage.getItem("user")),
  2355. allUsersList: [],
  2356. showAddMore:false,
  2357. allDate: [],
  2358. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2359. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2360. choseDay: 0,
  2361. tableHeight: 0,
  2362. listLoading: false,
  2363. projectList: [], //项目列表
  2364. fillProjectList: [],
  2365. reportList: [], //日报列表
  2366. reportNames:[], //批量审批列表
  2367. selCon:[], //筛选条件
  2368. selProjectList:[], //筛选后项目列表
  2369. selConShow: true,
  2370. usersList: [], // 全部人员列表
  2371. usersListId: '', // 选中的人员id
  2372. dialogVisible: false, //项目弹窗
  2373. report: '',
  2374. workForm: {
  2375. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2376. domains: [{
  2377. id: null,
  2378. projectId: "",
  2379. workingTime: "",
  2380. timeType:0,
  2381. content: "",
  2382. state: 2,
  2383. multiWorktime:0,
  2384. worktimeList:[],
  2385. degreeId: null,
  2386. auditUserList: [],
  2387. }],
  2388. showRefresh: false,
  2389. },
  2390. workRules: {
  2391. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2392. },
  2393. chooseParticipVisible: false,
  2394. logining: false,
  2395. isDisable: false,
  2396. timeType:[],
  2397. deptMembData: [
  2398. ],
  2399. //部门人员树状结构
  2400. data: [
  2401. {
  2402. id: -1,
  2403. label: this.$t('lable.allStaff'),
  2404. membCount:0
  2405. },
  2406. {
  2407. id: 0,
  2408. label: this.$t('lable.unassigned'),
  2409. }
  2410. ],
  2411. allData:{},
  2412. batchShowData:{},
  2413. option: [],
  2414. deptOptionList: [],
  2415. depData: {
  2416. id: -1,
  2417. label: this.$t('lable.allStaff'),
  2418. },
  2419. defaultProps: {
  2420. children: 'children',
  2421. label: 'label'
  2422. },
  2423. isNew: false,
  2424. selected: false,
  2425. valuet: new Date(),
  2426. domObj: null,
  2427. participator:[],
  2428. chosenMembCount:0,
  2429. jsDay: 0,
  2430. jsTime: 0,
  2431. falsss: false,
  2432. weidu: [],
  2433. weiduList: [],
  2434. yonghuUser: [],
  2435. dateAr: [],
  2436. batchSubFillDialog: false,
  2437. isSubstiS: false,
  2438. fillWeekDialogVisi: false,
  2439. fillWeekDialogVisiCustom: false,
  2440. fillWeekDialogVisiCustomTwo: false,
  2441. zhoData: [],
  2442. weekDateRange: [],
  2443. btnZho: false,
  2444. weekDataLoading: false,
  2445. changdu: 6,
  2446. tianxieDialogVisible: false,
  2447. scopess: {},
  2448. zhoBao: {
  2449. time: '',
  2450. workingTime: '',
  2451. progress: '',
  2452. con: '',
  2453. subProjectId: '',
  2454. stage: '',
  2455. subProjectList: [],
  2456. stages: [],
  2457. },
  2458. zhoBaoIdx: '',
  2459. zhoBaoName: '',
  2460. zhis: {},
  2461. dealList: [],
  2462. toViewDialogVisible: false,
  2463. toViewList: [],
  2464. toViewloading: true,
  2465. toViewForm: {
  2466. pageIndex: '1',
  2467. pageSize: '20',
  2468. total: 0,
  2469. },
  2470. toViewloadings: false,
  2471. tabPositionss: 'top',
  2472. monthTotal: 0,
  2473. monthTotalPage: 0,
  2474. monthTotalLages: 20,
  2475. monthWorkData: [],
  2476. monthNotWorkDate: [],
  2477. monthWorkDataS1: [],
  2478. monthnotTotal: 0,
  2479. monthnotTotalPage: 0,
  2480. monthnotTotalLages: 20,
  2481. monthNotWorkDateS1: [],
  2482. deptMembDataText: '',
  2483. isFlag: false,
  2484. isMore: false,
  2485. stateKey: '0',
  2486. expandDate: [],
  2487. notifySelList:[],
  2488. departmentList: [],
  2489. trandepartmentList:[],
  2490. approvalProcessDialog: false,
  2491. approvalProcessData: [],
  2492. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2493. 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')],
  2494. isWeekend: false,
  2495. canCancelInDialog: false,
  2496. approveinData: {},
  2497. approveinDialog: false,
  2498. reportCanDelete: false,
  2499. weeklyFilledTimeDialog: false,
  2500. weeklyFilledTimeList: [],
  2501. weeklyFilledTimeLoading: false,
  2502. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2503. weeklyFilledTimeCanDelete: false,
  2504. weeklyFilledTimeDate: null,
  2505. leaveAllNum: 0,
  2506. dataLoading: false,
  2507. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2508. vacationTime: {},
  2509. integrationProjectList: [],
  2510. totalReportHours: 0, // 合计的工时
  2511. workTimeForMinYi:0,
  2512. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2513. weekIndex: 1,
  2514. weekParentData: {},
  2515. deptIdForNoReport:[],
  2516. deptIdForReminder:[],
  2517. nameAearch: '', // 企业微信姓名搜索
  2518. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2519. deptMembDataLoading: false,
  2520. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2521. {
  2522. id: 4811,
  2523. // id: 10,
  2524. name: '陕西柘中建设工程有限公司'
  2525. }
  2526. ],
  2527. pushWorkTimeLogDig:false,
  2528. pushWorkTimeLogData:[],
  2529. userReportDeptList: [],
  2530. isReminder:true,
  2531. reportLogCheckDialog:false,
  2532. deptIdForHasReport:[],
  2533. transferWorkingHoursVisable: false,
  2534. multiOptionData:[]
  2535. };
  2536. },
  2537. watch: {
  2538. deptMembDataText(val) {
  2539. this.$refs.chooseMembTree.filter(val);
  2540. }
  2541. },
  2542. filters: {
  2543. // 过滤
  2544. amounts(value) {
  2545. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2546. return 0
  2547. }
  2548. var zhi = +value + 0
  2549. return zhi.toFixed(1)
  2550. },
  2551. // zhoData
  2552. zhoData(value, arr) {
  2553. var dateArray = value.split("-");
  2554. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2555. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2556. // console.log(arr[date.getDay()])
  2557. // return "周" + "日一二三四五六".charAt(date.getDay());
  2558. return arr[date.getDay()]
  2559. },
  2560. // 过滤数字
  2561. numbers(value) {
  2562. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2563. return 0
  2564. }
  2565. return value
  2566. },
  2567. },
  2568. computed: {},
  2569. mounted() {
  2570. var now = new Date();
  2571. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2572. this.today = t;
  2573. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2574. this.exportParam.dateRange = [startStr,t];
  2575. this.exportReportLogParam.dateRange = [startStr,t];
  2576. this.getAllDate(1);
  2577. this.getReportList();
  2578. this.getProjectList();
  2579. this.getFillProjectList();
  2580. this.getTimeType();
  2581. this.getDepartment();
  2582. this.scrollFunction()
  2583. this.userssHu();
  2584. this.getFirstAndLastDay()
  2585. this.getMultiOptionData();
  2586. if(this.user.timeType.reportAuditType == 3){
  2587. this.getAllUsersList()
  2588. }
  2589. if (this.user.company.packageProject == 1) {
  2590. this.getBasecostItemList();
  2591. }
  2592. if(this.user.timeType.userWithMultiDept == 1) {
  2593. this.getDeptMembData();
  2594. }
  2595. if(this.user.timeType.lockWorktime){
  2596. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2597. }
  2598. //设置了下限
  2599. if (this.user.timeType.minReportTime) {
  2600. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2601. }
  2602. const that = this
  2603. if(this.user.userNameNeedTranslate == 1) {
  2604. that.dataLoading = that.$store.state.dataLoading
  2605. this.upDataLoading()
  2606. setTimeout(()=>{
  2607. that.dataLoading = that.$store.state.dataLoading
  2608. }, 1000)
  2609. }
  2610. if (this.user.companyId == this.yuzhongCompId) {
  2611. this.getJobResponList();
  2612. }
  2613. },
  2614. methods: {
  2615. ...mapMutations(['upDataLoading']),
  2616. // 已填工时情况表设置背景色
  2617. hasworkTblCellStyle({ columnIndex, row, column }) {
  2618. if(columnIndex > 2) {
  2619. const dateSingle = this.pickDateArray[columnIndex - 3].date
  2620. const worktimeList = row.worktimeList || []
  2621. const times = this.reportTimeType.allday
  2622. const filterData = worktimeList.filter(item => item.createDate == dateSingle)
  2623. const isWorkDate = filterData[0] && filterData[0].workingTime;
  2624. const missReport = filterData[0] && filterData[0].missReport;
  2625. const state = filterData[0] && filterData[0].state
  2626. if (missReport) {
  2627. return "backgroundColor: red"
  2628. } else {
  2629. if (state == 0 || state == -1) {
  2630. return "backgroundColor: orange"
  2631. } else if (state == 1) {
  2632. //审核通过
  2633. return "backgroundColor: #32CD32"
  2634. } else if (state == 2) {
  2635. return "backgroundColor: red"
  2636. } else {
  2637. return "backgroundColor: #E0E0E0"
  2638. }
  2639. }
  2640. }
  2641. },
  2642. getMultiOptionData() {
  2643. this.http.post('/company-dict/getAll ',{companyId: this.user.companyId, code: 'multiOption'},
  2644. res => {
  2645. if (res.code == "ok") {
  2646. this.multiOptionData = res.data;
  2647. } else {
  2648. this.$message({
  2649. message: res.msg,
  2650. type: "error"
  2651. });
  2652. }
  2653. },
  2654. error => {
  2655. this.$message({
  2656. message: error,
  2657. type: "error"
  2658. });
  2659. }
  2660. );
  2661. },
  2662. showReportTimeLessThanCardTimeList() {
  2663. this.monthTotalPage = 0,
  2664. this.tbload = true,
  2665. this.http.post(
  2666. "/report/getReportTimeLessThanCardTimeList",
  2667. {
  2668. date: this.notfullSelectDateMonth,
  2669. deptId: this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
  2670. userId: this.usersListId
  2671. },
  2672. (res) => {
  2673. if (res.code == "ok") {
  2674. this.tbload = false
  2675. this.notFullData = res.data;
  2676. this.notFullOriginList = res.data;
  2677. }
  2678. },
  2679. (error) => {
  2680. this.tbload = false
  2681. this.$message({
  2682. message: error,
  2683. type: "error",
  2684. });
  2685. }
  2686. );
  2687. },
  2688. //按选择的日期范围刷新考勤
  2689. refreshWXCardTimeByRange() {
  2690. this.refreshingTime = true;
  2691. this.http.post('/wxcorp/getUserCheckInDayData',{
  2692. companyId: this.user.companyId,
  2693. userId: this.user.id,
  2694. startDate: this.importWxParam.date[0],
  2695. endDate: this.importWxParam.date[1],
  2696. },res => {
  2697. this.refreshingTime = false;
  2698. if(res.code == 'ok'){
  2699. this.loadCheckInData();
  2700. }else {
  2701. this.$message({
  2702. message: res.msg,
  2703. type: 'error'
  2704. })
  2705. }
  2706. },err => {
  2707. this.syncTimeLoading = false;
  2708. this.$message({
  2709. message: err,
  2710. type: 'error'
  2711. })
  2712. })
  2713. },
  2714. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2715. isCustomization(userInfo, permissionArray) {
  2716. const { companyId } = userInfo
  2717. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2718. return isReportPictureRequired
  2719. },
  2720. showHiddenFunction() {
  2721. this.showHidden = true;
  2722. },
  2723. // 获取如何信息选的可填写部门
  2724. getDeptMembData() {
  2725. this.http.post('/user/getUserInfo', {userId: this.user.id}, res => {
  2726. if (res.code == "ok") {
  2727. let lists = res.data.userReportDeptList || []
  2728. const optimizedList = lists.map(item => ({
  2729. ...item,
  2730. label: item.departmentName,
  2731. value: item.departmentId,
  2732. }));
  2733. this.$set(this, 'userReportDeptList', optimizedList || []);
  2734. } else {
  2735. this.$message({
  2736. message: res.msg,
  2737. type: "error"
  2738. });
  2739. }
  2740. },error => { });
  2741. },
  2742. //任务被选中
  2743. onTaskSelected(domainItem) {
  2744. //取服务
  2745. if (domainItem.taskId) {
  2746. var that = this;
  2747. var param = {taskId:domainItem.taskId};
  2748. if (this.isSubstitude) {
  2749. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2750. param.userId = this.workForm.userId[0];
  2751. }
  2752. }
  2753. this.http.post('/task/getMyTaskService',param, res => {
  2754. if (res.code == "ok") {
  2755. // domainItem.workContentList = res.data;
  2756. that.$set(domainItem, 'sapServiceId', null);
  2757. that.$set(domainItem, 'serviceList', res.data);
  2758. } else {
  2759. this.$message({
  2760. message: res.msg,
  2761. type: "error"
  2762. });
  2763. }
  2764. },error => {
  2765. this.$message({
  2766. message: error,
  2767. type: "error"
  2768. });
  2769. }
  2770. );
  2771. } else {
  2772. //清空服务
  2773. }
  2774. },
  2775. onBatchTimeChange() {
  2776. //反向计算每日工作时长
  2777. if (this.workForm.createDate) {
  2778. let sdate = new Date(this.workForm.createDate[0]);
  2779. let edate = new Date(this.workForm.createDate[1]);
  2780. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2781. if (days < 0) {
  2782. return;
  2783. }
  2784. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2785. //总时长发生改变,自动按比例计算
  2786. this.workForm.domains.forEach(d=>{
  2787. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2788. });
  2789. }
  2790. },
  2791. //更新工作内容列表
  2792. updateJobContent(domainItem) {
  2793. var that = this;
  2794. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2795. if (res.code == "ok") {
  2796. // domainItem.workContentList = res.data;
  2797. that.$set(domainItem, 'extraField3', null);
  2798. that.$set(domainItem, 'workContentList', res.data);
  2799. } else {
  2800. this.$message({
  2801. message: res.msg,
  2802. type: "error"
  2803. });
  2804. }
  2805. },error => {
  2806. this.$message({
  2807. message: error,
  2808. type: "error"
  2809. });
  2810. }
  2811. );
  2812. },
  2813. updateResponse(domainItem) {
  2814. var that = this;
  2815. var selectPid = domainItem.projectId;
  2816. domainItem.extraField2 = null;
  2817. domainItem.extraField3 = null;
  2818. if (selectPid && domainItem.extraField1) {
  2819. //是否非项目
  2820. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2821. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?this.$t('fei-xiang-mu-gong-shi'):this.$t('xiangMuGongShi')) && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2822. domainItem.filteredRespList = filteredRespList;
  2823. }
  2824. },
  2825. getJobResponList() {
  2826. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2827. if (res.code == "ok") {
  2828. this.jobResponseList = res.data;
  2829. } else {
  2830. this.$message({
  2831. message: res.msg,
  2832. type: "error"
  2833. });
  2834. }
  2835. },error => {
  2836. this.$message({
  2837. message: error,
  2838. type: "error"
  2839. });
  2840. }
  2841. );
  2842. },
  2843. openModImportTime(row) {
  2844. this.showModImportTimeDialog = true;
  2845. this.modItemDataId = row.id;
  2846. },
  2847. delImportTime(row) {
  2848. let rowId = row.id;
  2849. this.$confirm(this.$t('ninQueDingYaoShanChuGaiTiaoJiLuMa'),this.$t('other.prompts'), {
  2850. confirmButtonText: this.$t('btn.determine'),
  2851. cancelButtonText: this.$t('btn.cancel'),
  2852. type: "warning"
  2853. })
  2854. .then(() => {
  2855. this.http.post('/report-import-log/delete',{
  2856. id: rowId
  2857. },res => {
  2858. if (res.code == "ok") {
  2859. this.$message({
  2860. message: this.$t('message.successfullyDeleted'),
  2861. type: "success"
  2862. });
  2863. this.getToView();
  2864. } else {
  2865. this.$message({
  2866. message: res.msg,
  2867. type: "error"
  2868. });
  2869. }
  2870. },error => {
  2871. this.$message({
  2872. message: error,
  2873. type: "error"
  2874. });
  2875. }
  2876. );
  2877. }).catch(() => {this.startDeleting = false});
  2878. },
  2879. confirmChangeModTime() {
  2880. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2881. this.$message({
  2882. message: this.$t('message.Pleaseselectatime'),
  2883. type: "error"
  2884. });
  2885. return;
  2886. }
  2887. this.http.post('/report-import-log/changeTime',{
  2888. modLogDateTime: this.modImportTime,
  2889. modImportUserId: this.modImportUserId,
  2890. id: this.modItemDataId
  2891. },res => {
  2892. if (res.code == "ok") {
  2893. this.$message({
  2894. message: this.$t('message.modifyTheSuccess'),
  2895. type: "success"
  2896. });
  2897. this.getToView();
  2898. this.showModImportTimeDialog = false;
  2899. } else {
  2900. this.$message({
  2901. message: res.msg,
  2902. type: "error"
  2903. });
  2904. }
  2905. },error => {
  2906. this.$message({
  2907. message: error,
  2908. type: "error"
  2909. });
  2910. }
  2911. );
  2912. },
  2913. confirmBatchApproveReport() {
  2914. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2915. this.$message({
  2916. message: this.$t('qingXuanZeRiQiFanWei'),
  2917. type: "error"
  2918. });
  2919. return;
  2920. }
  2921. this.$confirm(this.$t('ninQueDingYaoShenHeTongGuoGaiShiJianDuanNeiQuanBuDeRiBaoMa'),this.$t('other.prompts'), {
  2922. confirmButtonText: this.$t('btn.determine'),
  2923. cancelButtonText: this.$t('btn.cancel'),
  2924. type: "warning"
  2925. })
  2926. .then(() => {
  2927. this.startDeleting = true;
  2928. let obj = {
  2929. startDate: this.deleteReportParam.date[0],
  2930. endDate: this.deleteReportParam.date[1]
  2931. }
  2932. if(this.deleteReportParam.departmentId) {
  2933. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2934. } else {
  2935. obj.departmentId = null
  2936. }
  2937. this.http.post('/report/batchApproveByDate',obj,res => {
  2938. if (res.code == "ok") {
  2939. this.$message({
  2940. message: this.$t('state.approved'),
  2941. type: "success"
  2942. });
  2943. this.getReportList();
  2944. this.getDepartment();
  2945. this.startDeleting = false;
  2946. } else {
  2947. this.$message({
  2948. message: res.msg,
  2949. type: "error"
  2950. });
  2951. }
  2952. },error => {
  2953. this.$message({
  2954. message: error,
  2955. type: "error"
  2956. });
  2957. }
  2958. );
  2959. }).catch(() => {this.startDeleting = false});
  2960. },
  2961. confirmBatchDelReport() {
  2962. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2963. this.$message({
  2964. message: this.$t('qingXuanZeBuMenHuoRenYuan'),
  2965. type: "error"
  2966. });
  2967. return;
  2968. }
  2969. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2970. this.$message({
  2971. message: this.$t('qingXuanZeRiQiFanWei'),
  2972. type: "error"
  2973. });
  2974. return;
  2975. }
  2976. this.$confirm(this.$t('ninQueDingYaoShanChuGaiShiJianDuanNeiDeRiBaoMaShanChuHouJiangBuKeHuiFu'),this.$t('other.prompts'), {
  2977. confirmButtonText: this.$t('btn.determine'),
  2978. cancelButtonText: this.$t('btn.cancel'),
  2979. type: "warning"
  2980. })
  2981. .then(() => {
  2982. this.startDeleting = true;
  2983. this.http.post('/report/batchDelete',{
  2984. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2985. startDate: this.deleteReportParam.date[0],
  2986. endDate: this.deleteReportParam.date[1],
  2987. deptId: this.deleteReportParam.deptId[0]
  2988. },res => {
  2989. if (res.code == "ok") {
  2990. this.$message({
  2991. message: this.$t('message.successfullyDeleted'),
  2992. type: "success"
  2993. });
  2994. this.getReportList();
  2995. this.getDepartment();
  2996. this.startDeleting = false;
  2997. } else {
  2998. this.$message({
  2999. message: res.msg,
  3000. type: "error"
  3001. });
  3002. }
  3003. },error => {
  3004. this.$message({
  3005. message: error,
  3006. type: "error"
  3007. });
  3008. }
  3009. );
  3010. }).catch(() => {this.startDeleting = false});
  3011. },
  3012. getRecentlyProject(userId) {
  3013. this.http.post('/project/nearProject',{userId: userId},res => {
  3014. if(res.code == 'ok'){
  3015. var bottomList = userId == null?this.fillProjectList:this.subFillProjectList;
  3016. let topObj = {
  3017. label: this.$t('zuiJinXuanZeXiangMu'),
  3018. peojectList: res.data
  3019. }
  3020. let botomObj = {
  3021. label: this.$t('other.allProject'),
  3022. peojectList: bottomList
  3023. }
  3024. //最近项目如果在fillProjectList中不存在,需要移除
  3025. topObj.peojectList = topObj.peojectList.filter(top=>bottomList.find(fp=>fp.id==top.id) != null);
  3026. this.integrationProjectList = [topObj, botomObj]
  3027. }else {
  3028. this.$message({
  3029. message: res.msg,
  3030. type: 'error'
  3031. })
  3032. }
  3033. },err => {
  3034. this.$message({
  3035. message: err,
  3036. type: 'error'
  3037. })
  3038. })
  3039. },
  3040. handlePictureCardPreview(file, index) {
  3041. let arr = []
  3042. let imgArr = this.workForm.domains[index].imgListUrl
  3043. for(var i in imgArr) {
  3044. arr.push(imgArr[i].url)
  3045. }
  3046. const $viewer = this.$viewerApi({
  3047. images: arr
  3048. });
  3049. },
  3050. // 图片上传
  3051. addImg(e, index) {
  3052. let formData = new FormData()
  3053. formData.append('multipartFile', e.file)
  3054. this.http.uploadFile('/common/uploadFile', formData,
  3055. res => {
  3056. if (res.code == "ok") {
  3057. this.$message({
  3058. message: this.$t('uploadedsuccessfully'),
  3059. type: "success"
  3060. });
  3061. if(!this.workForm.domains[index].imgList) {
  3062. this.workForm.domains[index].imgList = []
  3063. this.workForm.domains[index].imgListUrl = []
  3064. }
  3065. this.workForm.domains[index].imgList.push(res.data)
  3066. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  3067. } else {
  3068. this.$message({message: res.msg,type: "error"});
  3069. }
  3070. },
  3071. error => {this.$message({message: error,type: "error"});
  3072. });
  3073. },
  3074. // 删除图片
  3075. delImg(file,fileList, index) {
  3076. let idx = 0
  3077. for(let i in fileList) {
  3078. if(fileList[i].uid == file.uid) {
  3079. idx = i
  3080. }
  3081. }
  3082. this.workForm.domains[index].imgList.splice(idx, 1)
  3083. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  3084. },
  3085. test(){
  3086. console.log('test',this.workForm.domains);
  3087. },
  3088. getHour(s1, s2) {
  3089. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  3090. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  3091. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  3092. var ms = s2.getTime() - s1.getTime();
  3093. if (ms < 0) return 0;
  3094. let ma = ms / 1000 / 60 / 60
  3095. return ma; //小时
  3096. },
  3097. refreshDDCardTime(workdate) {
  3098. if (!workdate) return;
  3099. this.syncTimeLoading = true;
  3100. this.http.post('/dingding/refreshUserCardTime',{
  3101. companyId: this.user.companyId,
  3102. userId: this.user.id,
  3103. date: workdate,
  3104. },res => {
  3105. this.syncTimeLoading = false;
  3106. if(res.code == 'ok'){
  3107. if (!res.data) {
  3108. this.$message({
  3109. message: '获取考勤失败',
  3110. type: 'error'
  3111. })
  3112. } else {
  3113. this.workForm.time = res.data;
  3114. }
  3115. }else {
  3116. this.$message({
  3117. message: res.msg,
  3118. type: 'error'
  3119. })
  3120. }
  3121. },err => {
  3122. this.syncTimeLoading = false;
  3123. this.$message({
  3124. message: err,
  3125. type: 'error'
  3126. })
  3127. })
  3128. },
  3129. refreshWXCardTime(workdate) {
  3130. if (!workdate) return;
  3131. this.syncTimeLoading = true;
  3132. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  3133. date: workdate,
  3134. },res => {
  3135. this.syncTimeLoading = false;
  3136. if(res.code == 'ok'){
  3137. this.workForm.time = res.data.time;
  3138. }else {
  3139. this.$message({
  3140. message: res.msg,
  3141. type: 'error'
  3142. })
  3143. }
  3144. },err => {
  3145. this.syncTimeLoading = false;
  3146. this.$message({
  3147. message: err,
  3148. type: 'error'
  3149. })
  3150. })
  3151. },
  3152. refreshAttendance(workdate) {
  3153. if (!workdate) return;
  3154. this.syncTimeLoading = true;
  3155. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  3156. startDate: workdate[0],
  3157. endDate: workdate[1]
  3158. },res => {
  3159. this.syncTimeLoading = false;
  3160. if(res.code == 'ok'){
  3161. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3162. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3163. this.totalReportHours = this.workTimeForMinYi;
  3164. }else {
  3165. this.$message({
  3166. message: res.msg,
  3167. type: 'error'
  3168. })
  3169. }
  3170. },err => {
  3171. this.syncTimeLoading = false;
  3172. this.$message({
  3173. message: err,
  3174. type: 'error'
  3175. })
  3176. })
  3177. },
  3178. refreshBeiSengAttendance(workdate) {
  3179. if (!workdate) return;
  3180. this.syncTimeLoading = true;
  3181. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser',{
  3182. createDate: workdate
  3183. },res => {
  3184. this.syncTimeLoading = false;
  3185. if(res.code == 'ok'){
  3186. this.workForm.time = res.data;
  3187. }else {
  3188. this.$message({
  3189. message: res.msg,
  3190. type: 'error'
  3191. })
  3192. }
  3193. },err => {
  3194. this.syncTimeLoading = false;
  3195. this.$message({
  3196. message: err,
  3197. type: 'error'
  3198. })
  3199. })
  3200. },
  3201. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  3202. this.weeklyFilledTimeDialog = true
  3203. this.weeklyFilledTimeLoading = true
  3204. this.weeklyFilledTimeDate = parameterDate
  3205. this.http.post('/report/getReportList',{
  3206. date: parameterDate,
  3207. userId: this.user.id
  3208. },res => {
  3209. this.weeklyFilledTimeLoading = false
  3210. if(res.code == 'ok'){
  3211. this.weeklyFilledTimeList = res.data[0].data
  3212. let candelete = true
  3213. for(let i in this.weeklyFilledTimeList){
  3214. if(this.weeklyFilledTimeList[i].state < 2){
  3215. candelete = false
  3216. }
  3217. }
  3218. this.weeklyFilledTimeCanDelete = candelete
  3219. }else {
  3220. this.$message({
  3221. message: res.msg,
  3222. type: 'error'
  3223. })
  3224. }
  3225. },err => {
  3226. this.weeklyFilledTimeLoading = false
  3227. this.$message({
  3228. message: err,
  3229. type: 'error'
  3230. })
  3231. })
  3232. },
  3233. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  3234. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  3235. confirmButtonText: this.$t('btn.determine'),
  3236. cancelButtonText: this.$t('btn.cancel'),
  3237. type: "warning"
  3238. })
  3239. .then(() => {
  3240. this.http.post('/report/delete',{
  3241. userId: this.user.id,
  3242. date: this.weeklyFilledTimeDate
  3243. },res => {
  3244. if (res.code == "ok") {
  3245. this.$message({
  3246. message: this.$t('message.successfullyDeleted'),
  3247. type: "success"
  3248. });
  3249. this.getWeeklyWorkTime()
  3250. this.getReportList();
  3251. this.getDepartment();
  3252. this.weeklyFilledTimeDialog = false;
  3253. } else {
  3254. this.$message({
  3255. message: res.msg,
  3256. type: "error"
  3257. });
  3258. }
  3259. },error => {
  3260. this.$message({
  3261. message: error,
  3262. type: "error"
  3263. });
  3264. }
  3265. );
  3266. }).catch(() => {});
  3267. },
  3268. getApprovalProcess(item){
  3269. // console.log('this.date',this.choseDate);
  3270. this.http.post('/report-log/get',{
  3271. creatorId: item.id,
  3272. createDate: sessionStorage.msg
  3273. },res => {
  3274. if(res.code == 'ok'){
  3275. this.approvalProcessDialog = true
  3276. if(this.user.userNameNeedTranslate == 1) {
  3277. for(var i in res.data) {
  3278. let obj = {
  3279. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  3280. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  3281. }
  3282. res.data[i].msgCon = obj
  3283. }
  3284. }
  3285. this.approvalProcessData = res.data
  3286. }else{
  3287. this.$message({
  3288. message: res.msg,
  3289. type: 'error'
  3290. })
  3291. }
  3292. },err => {
  3293. this.$message({
  3294. message: err,
  3295. type: 'error'
  3296. })
  3297. })
  3298. //获取审批节点状态
  3299. if (this.user.companyId == 7544) {
  3300. this.http.post('/report/getCurAuditNode',{
  3301. userId: item.id,
  3302. date: sessionStorage.msg
  3303. },res => {
  3304. if(res.code == 'ok'){
  3305. this.curAuditNode = res.data
  3306. }else{
  3307. }
  3308. },err => {
  3309. this.$message({
  3310. message: err,
  3311. type: 'error'
  3312. })
  3313. })
  3314. }
  3315. },
  3316. filterNode(value, data) {
  3317. if (!value) return true;
  3318. return data.label.indexOf(value) !== -1;
  3319. },
  3320. triggerCalculateOT(index) {
  3321. var str = this.workForm.domains[index].overtimeHours + ''
  3322. if(str.indexOf('.') != '-1') {
  3323. var s = str.split('.')[0]
  3324. var st = str.split('.')[1]
  3325. var sts = st.split('')
  3326. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  3327. }
  3328. },
  3329. searchScreen(e){
  3330. if(e == 1){
  3331. this.monthNotWorkDateS1 = []
  3332. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  3333. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  3334. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  3335. }
  3336. }
  3337. if (this.monthNotWorkDateS1.length > 50) {
  3338. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  3339. }else{
  3340. this.monthNotWorkDateS = this.monthNotWorkDateS1
  3341. }
  3342. } else if (e == 0) {
  3343. this.monthWorkDataS1 = []
  3344. for (let i = 0; i < this.monthWorkData.length; i++) {
  3345. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  3346. this.monthWorkDataS1.push(this.monthWorkData[i])
  3347. }
  3348. }
  3349. if (this.monthWorkDataS1.length > 50) {
  3350. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  3351. }else{
  3352. this.monthWorkDataS = this.monthWorkDataS1
  3353. }
  3354. } else if (e == 2) {
  3355. this.monthWorkDataS1 = []
  3356. for (let i = 0; i < this.notFullOriginList.length; i++) {
  3357. if(this.notFullOriginList[i].name.indexOf(this.searchKeyword) != -1){
  3358. this.monthWorkDataS1.push(this.notFullOriginList[i])
  3359. }
  3360. }
  3361. if (this.monthWorkDataS1.length > 50) {
  3362. this.notFullData = this.monthWorkDataS1.slice(0,50);
  3363. }else{
  3364. this.notFullData = this.monthWorkDataS1
  3365. }
  3366. }
  3367. },
  3368. addUpload(data) {
  3369. // var zhi = data.fileName.split('.')[0]
  3370. // var sss = zhi + '.xlsx'
  3371. // return
  3372. var filePath = '/upload/' + data.serverName;
  3373. const a = document.createElement('a'); // 创建a标签
  3374. a.setAttribute('download', data.fileName);// download属性
  3375. a.setAttribute('href', filePath);// href链接
  3376. a.click(); //自执行点击事件
  3377. a.remove();
  3378. },
  3379. restrictNumber(targetId) {
  3380. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  3381. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  3382. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  3383. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  3384. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  3385. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  3386. inpu.value = parseFloat(inpu.value);
  3387. }
  3388. },
  3389. //获取项目下的任务分组
  3390. getTaskGroups(domain, index) {
  3391. domain.groupId=null;
  3392. this.http.post('/task-group/listMyJoinGroup',{
  3393. projectId: domain.projectId,
  3394. isSubstitude: this.isSubstitude ? 1 : 0
  3395. },
  3396. res => {
  3397. if (res.code == "ok") {
  3398. this.workForm.domains[index].taskGroups = res.data;
  3399. // if (this.workForm.domains[index].taskGroups.length > 0) {
  3400. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  3401. // this.getGroupStages(domain, index);
  3402. // }
  3403. this.$forceUpdate();
  3404. }
  3405. },
  3406. error => {
  3407. this.$message({
  3408. message: error,
  3409. type: "error"
  3410. });
  3411. }
  3412. );
  3413. },
  3414. //下载填报工时占比报表
  3415. downloadProjectRatio() {
  3416. this.exportUserRatio = true;
  3417. // let now = new Date();
  3418. // let month = now.getMonth();//默认看上个月的
  3419. // let monthStr = month<10? ('0'+month): month;
  3420. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  3421. const today = new Date();
  3422. const year = today.getFullYear();
  3423. const month = today.getMonth() + 1;
  3424. let lastMonthYear, lastMonth;
  3425. if (month === 1) {
  3426. lastMonthYear = year - 1;
  3427. lastMonth = 12;
  3428. } else {
  3429. lastMonthYear = year;
  3430. lastMonth = month - 1;
  3431. }
  3432. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  3433. },
  3434. confirmDownloadRatio() {
  3435. this.startRatioExporting = true;
  3436. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  3437. ymonth: this.ratioYmonth
  3438. },
  3439. res => {
  3440. if (res.code == "ok") {
  3441. this.startRatioExporting = false;
  3442. var filePath = res.data;
  3443. const a = document.createElement('a'); // 创建a标签
  3444. var data = filePath.split("/");
  3445. a.setAttribute('download', data[data.length-1]);// download属性
  3446. a.setAttribute('href', filePath);// href链接
  3447. a.click(); //自执行点击事件
  3448. a.remove();
  3449. } else {
  3450. this.startRatioExporting = false;
  3451. this.$message({
  3452. message: res.msg,
  3453. type: "error"
  3454. });
  3455. }
  3456. },
  3457. error => {
  3458. this.checkinLoading = false;
  3459. this.$message({
  3460. message: error,
  3461. type: "error"
  3462. });
  3463. }
  3464. );
  3465. },
  3466. //下载带企业微信考勤数据的工时统计模板
  3467. downloadCheckInExcel() {
  3468. var param = {
  3469. startDate: this.importWxParam.date[0],
  3470. endDate: this.importWxParam.date[1],
  3471. };
  3472. if (this.user.roleName == '超级管理员' || this.user.roleName == '财务管理员') {
  3473. param.onlySelfData = false;
  3474. }
  3475. this.http.post('/user-corpwx-time/exportCheckInExcel',param,
  3476. res => {
  3477. if (res.code == "ok") {
  3478. var filePath = res.data;
  3479. const a = document.createElement('a'); // 创建a标签
  3480. var data = filePath.split("/");
  3481. a.setAttribute('download', data[data.length-1]);// download属性
  3482. a.setAttribute('href', filePath);// href链接
  3483. a.click(); //自执行点击事件
  3484. a.remove();
  3485. } else {
  3486. this.$message({
  3487. message: res.msg,
  3488. type: "error"
  3489. });
  3490. }
  3491. },
  3492. error => {
  3493. this.checkinLoading = false;
  3494. this.$message({
  3495. message: error,
  3496. type: "error"
  3497. });
  3498. }
  3499. );
  3500. },
  3501. pre() {
  3502. if (this.active == 0) return;
  3503. this.active--;
  3504. },
  3505. next() {
  3506. this.active++;
  3507. },
  3508. triggerTotalTime(index) {
  3509. var item = this.checkinList[index];
  3510. var total = 0.0;
  3511. for (var i=0;i<this.projectColumns.length; i++) {
  3512. var key = this.projectColumns[i];
  3513. if (item[key] != null && item[key] != '') {
  3514. total += parseFloat(item[key]);
  3515. }
  3516. }
  3517. item.totalFillTime = total;
  3518. },
  3519. //提交批量代填的数据
  3520. submitBatchSubFillData() {
  3521. var data = JSON.stringify(this.checkinList);
  3522. this.http.post('/user-corpwx-time/submitProjectTime',{
  3523. json: data,
  3524. projectColumns: JSON.stringify(this.projectColumns)
  3525. },
  3526. res => {
  3527. if (res.code == "ok") {
  3528. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  3529. this.importWxDialog = false;
  3530. }
  3531. },
  3532. error => {
  3533. this.checkinLoading = false;
  3534. this.$message({
  3535. message: error,
  3536. type: "error"
  3537. });
  3538. }
  3539. );
  3540. },
  3541. loadCheckInData() {
  3542. if (this.importWxParam.date == null) {
  3543. this.checkinList = [];
  3544. return;
  3545. }
  3546. this.checkinLoading = true;
  3547. this.http.post('/user-corpwx-time/getMyData',{
  3548. startDate: this.importWxParam.date[0],
  3549. endDate: this.importWxParam.date[1],
  3550. },
  3551. res => {
  3552. if (res.code == "ok") {
  3553. this.checkinLoading = false;
  3554. this.checkinList = res.data.list;
  3555. this.projectColumns = res.data.projects;
  3556. // 自定义表格会导致表格错乱,需重新计算表格
  3557. this.$nextTick(()=>{
  3558. this.$refs.tab.doLayout()
  3559. })
  3560. }
  3561. },
  3562. error => {
  3563. this.checkinLoading = false;
  3564. this.$message({
  3565. message: error,
  3566. type: "error"
  3567. });
  3568. }
  3569. );
  3570. },
  3571. importCardTime(item) {
  3572. //首先判断文件类型
  3573. let str = item.file.name.split(".");
  3574. let format = str[str.length - 1];
  3575. if (format != "xls" && format != "xlsx") {
  3576. this.$message({
  3577. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3578. type: "error"
  3579. });
  3580. } else {
  3581. this.importingData = true;
  3582. let formData = new FormData();
  3583. formData.append("multipartFile", item.file);
  3584. formData.append("companyId", this.user.companyId);
  3585. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3586. res => {
  3587. this.$refs.uploadCardTime.clearFiles();
  3588. this.importingData = false;
  3589. if (res.code == "ok") {
  3590. //换成弹出框,以免有人等了半天回来啥也没看到
  3591. this.$message({
  3592. message: this.$t('daoRuKaoQinShiChangChengGong'),
  3593. type: "success"
  3594. });
  3595. } else {
  3596. this.$message({
  3597. message: res.msg,
  3598. type: "error"
  3599. });
  3600. }
  3601. },
  3602. error => {
  3603. this.$refs.upload.clearFiles();
  3604. this.listLoading = false;
  3605. this.$message({
  3606. message: error,
  3607. type: "error"
  3608. });
  3609. });
  3610. }
  3611. },
  3612. batchImportWxData(item) {
  3613. //首先判断文件类型
  3614. let str = item.file.name.split(".");
  3615. let format = str[str.length - 1];
  3616. if (format != "xls" && format != "xlsx") {
  3617. this.$message({
  3618. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3619. type: "error"
  3620. });
  3621. } else {
  3622. this.importingData = true;
  3623. let formData = new FormData();
  3624. formData.append("file", item.file);
  3625. formData.append("companyId", this.user.companyId);
  3626. formData.append("withCheckIn", 1);
  3627. this.http.uploadFile('/report/importData', formData,
  3628. res => {
  3629. this.$refs.upload.clearFiles();
  3630. this.showImportResult = true;
  3631. this.importingData = false;
  3632. if (res.code == "ok") {
  3633. //换成弹出框,以免有人等了半天回来啥也没看到
  3634. this.importResultMsg = this.$t('chengGongDaoRu') +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3635. this.getReportList();
  3636. this.importWxDialog = false;
  3637. } else {
  3638. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3639. }
  3640. },
  3641. error => {
  3642. this.$refs.upload.clearFiles();
  3643. this.listLoading = false;
  3644. this.$message({
  3645. message: error,
  3646. type: "error"
  3647. });
  3648. });
  3649. }
  3650. },
  3651. batchImportData(item) {
  3652. //首先判断文件类型
  3653. let str = item.file.name.split(".");
  3654. let format = str[str.length - 1];
  3655. if (format != "xls" && format != "xlsx") {
  3656. this.$message({
  3657. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3658. type: "error"
  3659. });
  3660. } else {
  3661. this.importingData = true;
  3662. let formData = new FormData();
  3663. formData.append("file", item.file);
  3664. formData.append("companyId", this.user.companyId);
  3665. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936 || this.user.companyId == 839 || this.user.timeType.importReportAuditNormal == 1)?'/report/importNewData':'/report/importData'
  3666. this.http.uploadFile(url, formData,
  3667. res => {
  3668. this.$refs.upload.clearFiles();
  3669. this.importingData = false;
  3670. this.showImportResult = true;
  3671. if (res.code == "ok") {
  3672. //换成弹出框,以免有人等了半天回来啥也没看到
  3673. this.importResultMsg = this.$t('chengGongDaoRu')+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3674. this.getReportList();
  3675. this.importWXDialog = false;
  3676. } else {
  3677. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3678. }
  3679. },
  3680. error => {
  3681. this.$refs.upload.clearFiles();
  3682. this.importingData = false;
  3683. this.$message({
  3684. message: error,
  3685. type: "error"
  3686. });
  3687. });
  3688. }
  3689. },
  3690. userssHu() {
  3691. this.http.post('/time-type/getCompanyTimeSetting',{
  3692. companyId: this.user.companyId
  3693. },
  3694. res => {
  3695. if (res.code == "ok") {
  3696. this.yonghuUser = res.data
  3697. }
  3698. },
  3699. error => {
  3700. this.$message({
  3701. message: error,
  3702. type: "error"
  3703. });
  3704. }
  3705. );
  3706. },
  3707. iptBlur(i) {
  3708. if(this.isBatch == 0) {
  3709. return
  3710. }
  3711. var reqParam = {
  3712. startDate: this.workForm.createDate[0],
  3713. endDate: this.workForm.createDate[1]
  3714. };
  3715. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3716. reqParam.userId = this.workForm.userId[0];
  3717. }
  3718. this.http.post('/report/getWorkDays',reqParam,
  3719. res => {
  3720. if (res.code == "ok") {
  3721. this.jsDay = res.data
  3722. this.chuji(i)
  3723. } else {
  3724. this.$message({
  3725. message: res.msg,
  3726. type: "error"
  3727. });
  3728. }
  3729. },
  3730. error => {
  3731. this.$message({
  3732. message: error,
  3733. type: "error"
  3734. });
  3735. }
  3736. );
  3737. //明夷硬编码获取
  3738. if (this.user.company.companyName == this.mingyiName) {
  3739. this.getWorkTimeForMinYi();
  3740. }
  3741. },
  3742. getWorkTimeForMinYi(){
  3743. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3744. startDate: this.workForm.createDate[0],
  3745. endDate: this.workForm.createDate[1]
  3746. },
  3747. res => {
  3748. if (res.code == "ok") {
  3749. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3750. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3751. this.totalReportHours = this.workTimeForMinYi;
  3752. } else {
  3753. this.$message({
  3754. message: res.msg,
  3755. type: "error"
  3756. });
  3757. this.workForm.createDate = [];
  3758. }
  3759. },
  3760. error => {
  3761. this.$message({
  3762. message: error,
  3763. type: "error"
  3764. });
  3765. }
  3766. );
  3767. },
  3768. chuji(i) {
  3769. if(i == 0) {
  3770. this.seleChn(1)
  3771. } else if(i == 1) {
  3772. this.seleChn(0)
  3773. } else if(i == 2) {
  3774. if(this.workForm.domains[0].multiWorktime > 0) {
  3775. this.iptChangs()
  3776. } else {
  3777. this.iptChang()
  3778. }
  3779. } else if(i == 3) {
  3780. this.seleChn(0)
  3781. }
  3782. },
  3783. seleChn(e,domain) {
  3784. if(e == 1) {
  3785. for(var i in this.workForm.domains) {
  3786. if(this.workForm.domains[i].timeType == 0) {
  3787. this.workForm.domains[i].workingTime = 8
  3788. } else {
  3789. this.workForm.domains[i].workingTime = 4
  3790. }
  3791. }
  3792. }
  3793. var quanbu = 0
  3794. var spl = this.workForm.domains
  3795. var zhi = ''
  3796. for(var i in spl) {
  3797. var sp = +spl[i].workingTime + 0
  3798. zhi = this.jsDay * sp
  3799. quanbu = +quanbu + zhi
  3800. }
  3801. this.jsTime = quanbu
  3802. this.totalReportHours = quanbu
  3803. let worktime = this.jsTime
  3804. // 自动计算加班时长
  3805. if(this.isBatch != 0){
  3806. worktime = this.jsTime / this.jsDay
  3807. }
  3808. if(this.user.timeType.fillOvertime && domain){
  3809. let isover = false
  3810. let alltime = 0
  3811. let allover = 0 //此处alltime同上面的worktime
  3812. for(let d in spl){
  3813. if(spl[d].isOvertime){
  3814. isover = true
  3815. allover += spl[d].overtimeHours*1
  3816. }
  3817. alltime += spl[d].workingTime*1
  3818. }
  3819. if(domain.overtimeHours){
  3820. allover = allover - domain.overtimeHours
  3821. }
  3822. if(worktime*1 > this.user.timeType.allday){
  3823. if(isover){
  3824. if(alltime > (allover + this.user.timeType.allday)){
  3825. this.$set(domain,'isOvertime',true)
  3826. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3827. }else{
  3828. this.$set(domain,'isOvertime',false)
  3829. this.$set(domain,'overtimeHours',null)
  3830. if(alltime < (allover + this.user.timeType.allday)){
  3831. let overtime = allover + this.user.timeType.allday - alltime
  3832. for(let pi in spl){
  3833. if(spl[pi].overtimeHours){
  3834. if((overtime - spl[pi].overtimeHours*1) > 0){
  3835. overtime = overtime - spl[pi].overtimeHours*1
  3836. this.$set(spl[pi],'isOvertime',false)
  3837. this.$set(spl[pi],'overtimeHours',null)
  3838. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3839. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3840. break
  3841. }else{
  3842. this.$set(spl[pi],'isOvertime',false)
  3843. this.$set(spl[pi],'overtimeHours',null)
  3844. break
  3845. }
  3846. }
  3847. }
  3848. }
  3849. }
  3850. }else{
  3851. this.$set(domain,'isOvertime',true)
  3852. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3853. }
  3854. }else{
  3855. for(let di in spl){
  3856. this.$set(spl[di],'isOvertime',false)
  3857. this.$set(spl[di],'overtimeHours',null)
  3858. }
  3859. }
  3860. }
  3861. },
  3862. iptChang() {
  3863. var sl = this.workForm.domains
  3864. let timeArr = []
  3865. for(var i in sl) {
  3866. if(sl[i].startTime && sl[i].endTime) {
  3867. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3868. }
  3869. }
  3870. this.getTimeHours(timeArr)
  3871. },
  3872. iptChangs() {
  3873. var sl = this.workForm.domains
  3874. let timeArr = []
  3875. for(var i in sl) {
  3876. for(var j in sl[i].worktimeList){
  3877. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3878. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3879. }
  3880. }
  3881. }
  3882. this.getTimeHours(timeArr)
  3883. },
  3884. // 调用接口或去数据
  3885. getTimeHours(arr) {
  3886. this.http.post('/report/getHoursByTimeRange',{
  3887. timeJsonStr: JSON.stringify(arr)
  3888. },res => {
  3889. if(res.code === 'ok') {
  3890. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3891. } else {
  3892. this.$message({
  3893. message: res.msg,
  3894. type: 'error'
  3895. })
  3896. }
  3897. },err => {
  3898. this.$message({
  3899. message: err,
  3900. type: 'error'
  3901. })
  3902. })
  3903. },
  3904. // 按周填报调用接口计算时间
  3905. async getWeekHoursByTimeRange(timeRange) {
  3906. const url = '/report/getHoursByTimeRange';
  3907. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3908. var that = this;
  3909. return new Promise((resolve, reject) => {
  3910. this.http.post(url, data, function(res) {
  3911. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3912. }, function(err) {
  3913. reject(err);
  3914. });
  3915. });
  3916. },
  3917. removeTimeItem(item, index) {
  3918. item.worktimeList.splice(index, 1);
  3919. this.iptChangs()
  3920. },
  3921. //添加工时
  3922. addNewWorktime(index, item) {
  3923. if(item.worktimeList == null ) {
  3924. item.worktimeList = []
  3925. }
  3926. item.worktimeList.push({});
  3927. },
  3928. //复制项目
  3929. copyProject(index) {
  3930. var leftProgress = 10;
  3931. if (this.reportTimeType.type == 3) {
  3932. //计算已经待分配工时比例
  3933. let array = this.workForm.domains;
  3934. let totalProgress = 0;
  3935. for (var i=0;i<array.length; i++) {
  3936. totalProgress += array[i].progress;
  3937. }
  3938. if (totalProgress < 100) {
  3939. leftProgress = 100 - totalProgress;
  3940. }
  3941. }
  3942. var newIndex = index+1;
  3943. var itemDomain = {
  3944. projectId: this.workForm.domains[index].projectId,
  3945. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3946. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3947. ),
  3948. content: "",
  3949. progress:leftProgress,
  3950. state:2,//2-表示待提交
  3951. };
  3952. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3953. if (this.reportTimeType.type == 0) {
  3954. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3955. var length = this.workForm.domains.length;
  3956. if (length == 2) {
  3957. this.showAddMore = false;
  3958. }
  3959. }
  3960. this.selectProject(itemDomain, newIndex);
  3961. },
  3962. pushWorkTime(reportId){
  3963. let url=''
  3964. if(this.user.timeType.syncSap == 1){
  3965. url='/report/pushProjectReportToSap'
  3966. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3967. var pushDate = this.date + day;
  3968. this.$confirm(reportId?this.$t('queRenTuiSongDangQianGongShi'):(this.$t('queRenTuiSong')+pushDate+this.$t('deGongShi')), this.$t('other.prompts'), {
  3969. confirmButtonText: this.$t('btn.determine'),
  3970. cancelButtonText: this.$t('btn.cancel'),
  3971. type: 'info'
  3972. }).then(() => {
  3973. const loading = this.$loading({
  3974. lock: true,
  3975. text: this.$t('zhengZaiTuiSongZhongQingNaiXinDengDai'),
  3976. spinner: 'el-icon-loading',
  3977. background: 'rgba(0, 0, 0, 0.7)'
  3978. });
  3979. this.http.post(url,{
  3980. pushDate: pushDate,
  3981. reportId: reportId
  3982. },res => {
  3983. loading.close();
  3984. if(res.code == 'ok'){
  3985. this.$message({
  3986. type: 'success',
  3987. message: res.data
  3988. });
  3989. }else{
  3990. this.$message({
  3991. type: 'error',
  3992. message: res.msg
  3993. })
  3994. }
  3995. },err => {
  3996. loading.close();
  3997. this.$message({
  3998. type: 'error',
  3999. message: err
  4000. })
  4001. })
  4002. }).catch(() => {
  4003. });
  4004. }else{
  4005. url='/report/pushReportDataToThird'
  4006. this.$confirm(this.$t('queRenTuiSong')+this.date+this.$t('yueDeGongShi'), this.$t('other.prompts'), {
  4007. confirmButtonText: this.$t('btn.determine'),
  4008. cancelButtonText: this.$t('btn.cancel'),
  4009. type: 'info'
  4010. }).then(() => {
  4011. const loading = this.$loading({
  4012. lock: true,
  4013. text: this.$t('zhengZaiTuiSongZhongQingNaiXinDengDai'),
  4014. spinner: 'el-icon-loading',
  4015. background: 'rgba(0, 0, 0, 0.7)'
  4016. });
  4017. this.http.post(url,{
  4018. yearMonth: this.date
  4019. },res => {
  4020. loading.close();
  4021. if(res.code == 'ok'){
  4022. this.$message({
  4023. type: 'success',
  4024. message: this.$t('tuiSongChengGong')
  4025. });
  4026. }else{
  4027. this.$message({
  4028. type: 'error',
  4029. message: res.msg
  4030. })
  4031. }
  4032. },err => {
  4033. loading.close();
  4034. this.$message({
  4035. type: 'error',
  4036. message: err
  4037. })
  4038. })
  4039. }).catch(() => {
  4040. });
  4041. }
  4042. },
  4043. showWorkTime(){
  4044. this.monthWorkTimeDialog = true;
  4045. this.searchKeyword = ''
  4046. this.WorktimeDatepickValue = this.istoMonth()
  4047. if(this.WorktimeDatepickValue.length == 0){
  4048. let newdate = new Date();
  4049. let nowdate = newdate.toLocaleDateString();
  4050. let getauto = this.getAutoWeekDate(nowdate)
  4051. let nowwd = [getauto[0],getauto[6]]
  4052. this.WorktimeDatepickValue = nowwd
  4053. }
  4054. this.showMonthWorkTime()
  4055. },
  4056. handleClick(t,e){
  4057. if (t.name == "second") {
  4058. this.showMonthNotWorkTime()
  4059. }else if(t.name == "first"){
  4060. this.showMonthWorkTime()
  4061. }else if(t.name == "third"){
  4062. this.showMonthWorkTimeReminder()
  4063. } else if (t.name == "fourth") {
  4064. this.showReportTimeLessThanCardTimeList();
  4065. }
  4066. },
  4067. //导出员工每日填报工时数
  4068. exportMembWorkHours() {
  4069. this.http.post(
  4070. "/report/exportUserDailyWorkTime",
  4071. {
  4072. // month: this.date,
  4073. startDate: this.WorktimeDatepickValue[0],
  4074. endDate: this.WorktimeDatepickValue[1],
  4075. },
  4076. (res) => {
  4077. if (res.code == "ok") {
  4078. let url = res.data;
  4079. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  4080. }
  4081. },
  4082. (error) => {
  4083. this.$message({
  4084. message: error,
  4085. type: "error",
  4086. });
  4087. }
  4088. );
  4089. },
  4090. exportMembWorkHoursReminder() {
  4091. this.http.post(
  4092. "/report/exportUserDailyWorkTimeReminder",
  4093. {
  4094. // month: this.date,
  4095. startDate: this.WorktimeDatepickValue[0],
  4096. endDate: this.WorktimeDatepickValue[1],
  4097. },
  4098. (res) => {
  4099. if (res.code == "ok") {
  4100. let url = res.data;
  4101. this.downloadByA('工时异常表.xlsx', url);
  4102. }
  4103. },
  4104. (error) => {
  4105. this.$message({
  4106. message: error,
  4107. type: "error",
  4108. });
  4109. }
  4110. );
  4111. },
  4112. exportMembNotWorkHours() {
  4113. this.http.post(
  4114. "/report/exportNoReportUserList",
  4115. {
  4116. // month: this.date,
  4117. startDate: this.WorktimeDatepickValue[0],
  4118. endDate: this.WorktimeDatepickValue[1],
  4119. onlyHaveAttendance: this.onlyHaveAttendance?1:0
  4120. },
  4121. (res) => {
  4122. if (res.code == "ok") {
  4123. let url = res.data;
  4124. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  4125. }
  4126. },
  4127. (error) => {
  4128. this.$message({
  4129. message: error,
  4130. type: "error",
  4131. });
  4132. }
  4133. );
  4134. },
  4135. downloadByA(name, url) {
  4136. const a = document.createElement("a"); // 创建a标签
  4137. a.setAttribute("download", name); // download属性
  4138. a.setAttribute("href", url); // href链接
  4139. a.click(); // 自执行点击事件
  4140. a.remove();
  4141. },
  4142. // 是否本月判断
  4143. istoMonth(){
  4144. let todate = new Date()
  4145. let tomonth = todate.getMonth() + 1
  4146. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  4147. if(this.date == adate){
  4148. return []
  4149. }else{
  4150. let sedate = new Date(this.date)
  4151. let semonth = sedate.getMonth() + 1
  4152. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  4153. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  4154. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  4155. return [sedates1, sedates2]
  4156. }
  4157. },
  4158. showMonthWorkTime() {
  4159. this.monthTotalPage = 0,
  4160. this.tbload = true
  4161. let parameter={
  4162. startDate: this.WorktimeDatepickValue[0],
  4163. endDate: this.WorktimeDatepickValue[1],
  4164. hasReportDeptId:this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
  4165. }
  4166. this.http.post(
  4167. "/report/getUserDailyWorkTime",
  4168. // "/report/getNoReportUserList",
  4169. parameter,
  4170. (res) => {
  4171. if (res.code == "ok") {
  4172. this.tbload = false;
  4173. this.pickDateArray = res.data.days.map(item => {
  4174. return {
  4175. ...item,
  4176. dateStr: item.label.split('/')[0],
  4177. weekStr: item.label.split('/')[1]
  4178. }
  4179. });
  4180. // console.log('dataarray',res.data.days);
  4181. this.monthWorkData = res.data.list;
  4182. // this.monthWorkDataS = this.monthWorkData
  4183. // this.monthWorkDataS1 = res.data.list
  4184. this.monthTotal = res.data.list.length
  4185. if (this.monthWorkData.length > 50) {
  4186. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  4187. }else{
  4188. this.monthWorkDataS = this.monthWorkData
  4189. }
  4190. this.searchScreen(0)
  4191. // this.monthWorkDataS = infoList
  4192. // 判断
  4193. // if (this.monthWorkDataS1.length > 0) {
  4194. // setTimeout(() => {
  4195. // this.tableListener()
  4196. // }, 1000);
  4197. // }
  4198. this.$nextTick(function(){
  4199. this.$refs.hasworkTbl.doLayout();
  4200. });
  4201. // this.$forceUpdate()
  4202. }
  4203. },
  4204. (error) => {
  4205. this.tbload = false
  4206. this.$message({
  4207. message: error,
  4208. type: "error",
  4209. });
  4210. }
  4211. );
  4212. },
  4213. showMonthWorkTimeReminder() {
  4214. this.monthTotalPage = 0,
  4215. this.tbload = true
  4216. let parameter={}
  4217. parameter={
  4218. startDate: this.WorktimeDatepickValue[0],
  4219. endDate: this.WorktimeDatepickValue[1],
  4220. deptId:this.deptIdForReminder.length>0?this.deptIdForReminder[this.deptIdForReminder.length-1]:null,
  4221. viewValue:this.isReminder?1:0
  4222. }
  4223. this.http.post(
  4224. "/report/getUserDailyWorkTimeReminder",
  4225. parameter,
  4226. (res) => {
  4227. if (res.code == "ok") {
  4228. this.tbload = false;
  4229. this.monthWorkData = res.data.list;
  4230. this.monthTotal = res.data.list.length
  4231. if (this.monthWorkData.length > 50) {
  4232. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  4233. }else{
  4234. this.monthWorkDataS = this.monthWorkData
  4235. }
  4236. this.searchScreen(0)
  4237. this.$nextTick(function(){
  4238. this.$refs.hasworkTbl.doLayout();
  4239. });
  4240. }
  4241. },
  4242. (error) => {
  4243. this.tbload = false
  4244. this.$message({
  4245. message: error,
  4246. type: "error",
  4247. });
  4248. }
  4249. );
  4250. },
  4251. showMonthNotWorkTime() {
  4252. this.monthTotalPage = 0,
  4253. this.tbload = true,
  4254. this.http.post(
  4255. "/report/getNoReportUserList",
  4256. {
  4257. startDate: this.WorktimeDatepickValue[0],
  4258. endDate: this.WorktimeDatepickValue[1],
  4259. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null,
  4260. onlyHaveAttendance:this.onlyHaveAttendance?1:0
  4261. },
  4262. (res) => {
  4263. if (res.code == "ok") {
  4264. this.tbload = false
  4265. this.monthNotWorkDate = res.data;
  4266. this.monthnotTotal = res.data.length
  4267. if (this.monthNotWorkDate.length > 50) {
  4268. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  4269. } else {
  4270. this.monthNotWorkDateS = this.monthNotWorkDate
  4271. }
  4272. this.searchScreen(1)
  4273. this.$nextTick(function(){
  4274. this.$refs.hasworkTbl2.doLayout();
  4275. });
  4276. }
  4277. },
  4278. (error) => {
  4279. this.tbload = false
  4280. this.$message({
  4281. message: error,
  4282. type: "error",
  4283. });
  4284. }
  4285. );
  4286. },
  4287. listScroll(){
  4288. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  4289. this.isMore = true
  4290. setTimeout(()=>{
  4291. this.isMore = false
  4292. },1000)
  4293. }else {
  4294. this.isFlag = true
  4295. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  4296. this.monthWorkDataS = datalist
  4297. setTimeout(()=>{
  4298. this.isFlag = false
  4299. },300)
  4300. }
  4301. },
  4302. notListScroll(){
  4303. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  4304. this.isMore = true
  4305. setTimeout(()=>{
  4306. this.isMore = false
  4307. },1000)
  4308. }else {
  4309. this.isFlag = true
  4310. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  4311. this.monthNotWorkDateS = datalist
  4312. // console.log('length',this.monthNotWorkDateS.length)
  4313. setTimeout(()=>{
  4314. this.isFlag = false
  4315. },300)
  4316. }
  4317. },
  4318. getFirstAndLastDay() {
  4319. // 将选定的月份转换为Date对象
  4320. var monthDate = new Date();
  4321. var year = monthDate.getFullYear();
  4322. var month = monthDate.getMonth();
  4323. // 计算起始日和结束日
  4324. var startDay = new Date(year, month, 1);
  4325. var endDay = new Date(year, month + 1, 0);
  4326. let lastmd = [this.formatDate(startDay),this.formatDate(endDay)]
  4327. this.WorktimeDatepickValueForMonth=lastmd
  4328. },
  4329. formatDate(date) {
  4330. var year = date.getFullYear();
  4331. var month = ("0" + (date.getMonth() + 1)).slice(-2);
  4332. var day = ("0" + date.getDate()).slice(-2);
  4333. return year + "-" + month + "-" + day;
  4334. },
  4335. // 获取默认这zhou日期参数 222
  4336. getLastWeek(e){
  4337. let newdate = new Date()
  4338. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  4339. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  4340. if(e==1){
  4341. this.WorktimeDatepickValue = lastwd
  4342. this.showMonthWorkTime()
  4343. }else if(e==2){
  4344. this.WorktimeDatepickValue = lastwd
  4345. this.showMonthWorkTimeReminder()
  4346. }else{
  4347. this.WorktimeDatepickValue = lastwd
  4348. this.showMonthNotWorkTime()
  4349. }
  4350. },
  4351. getThisWeek(e){
  4352. let newdate = new Date();
  4353. let nowdate = newdate.toLocaleDateString();
  4354. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  4355. if(e==1){
  4356. this.WorktimeDatepickValue = nowwd
  4357. this.showMonthWorkTime()
  4358. }else if(e==2){
  4359. this.WorktimeDatepickValue = nowwd
  4360. this.showMonthWorkTimeReminder()
  4361. }else{
  4362. this.WorktimeDatepickValue = nowwd
  4363. this.showMonthNotWorkTime()
  4364. }
  4365. },
  4366. getDoubleLastWeek(e){
  4367. let newdate = new Date()
  4368. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  4369. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  4370. if(e==1){
  4371. this.WorktimeDatepickValue = nextwd
  4372. this.showMonthWorkTime()
  4373. }else if(e==2){
  4374. this.WorktimeDatepickValue = nextwd
  4375. this.showMonthWorkTimeReminder()
  4376. }else{
  4377. this.WorktimeDatepickValue = nextwd
  4378. this.showMonthNotWorkTime()
  4379. }
  4380. },
  4381. alreadyAllDate(stime,etime){
  4382. let diffdate = new Array();
  4383. let i=0;
  4384. while(stime<=etime){
  4385. let dateArray = stime.split("-");
  4386. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  4387. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  4388. let stimewk = this.weekDay[date.getDay()]
  4389. 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')
  4390. 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])
  4391. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  4392. let stime_ts = new Date(stime).getTime();
  4393. let next_date = stime_ts + (24*60*60*1000);
  4394. let next_dates_y = new Date(next_date).getFullYear()+'-';
  4395. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  4396. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  4397. stime = next_dates_y+next_dates_m+next_dates_d;
  4398. i++;
  4399. }
  4400. return diffdate
  4401. },
  4402. getAutoWeekDate(e) {
  4403. let dateString = e;
  4404. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  4405. if (dateString.match(dateStringReg)) {
  4406. let presentDate = new Date(dateString),
  4407. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  4408. return Array.from(new Array(7), function (val, index) {
  4409. let formatDate = new Date(
  4410. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  4411. );
  4412. return (
  4413. formatDate.getFullYear() +
  4414. "-" +
  4415. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  4416. "-" +
  4417. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  4418. );
  4419. });
  4420. } else {
  4421. throw new Error(
  4422. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  4423. );
  4424. }
  4425. },
  4426. onProgressChange() {
  4427. this.$forceUpdate();
  4428. },
  4429. showChooseMembTree() {
  4430. this.chosenMembCount = this.participator.length;
  4431. this.chooseParticipVisible = true;
  4432. },
  4433. onTreeItemChange() {
  4434. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4435. var list = chosenList.filter(item=>item.isUser == 1);
  4436. this.chosenMembCount = list.length;
  4437. },
  4438. findUserInTree() {
  4439. if (this.filterName == '') {
  4440. this.deptMembData = this.allMembData;
  4441. } else {
  4442. var list = this.findRecursively(this.filterName, this.allMembData);
  4443. this.deptMembData = list;
  4444. }
  4445. },
  4446. findRecursively(username, list) {
  4447. var filterList = [];
  4448. for (var i=0;i<list.length; i++) {
  4449. if (list[i].isUser == 1) {
  4450. if (list[i].label.indexOf(username) >= 0) {
  4451. //匹配上了
  4452. filterList.push(list[i]);
  4453. }
  4454. } else if (list[i].children != null && list[i].children.length > 0) {
  4455. var subList = this.findRecursively(username, list[i].children);
  4456. if (subList.length > 0) {
  4457. subList.forEach(s=>filterList.push(s));
  4458. }
  4459. }
  4460. }
  4461. return filterList;
  4462. },
  4463. //确定选择参与人
  4464. chooseParticip() {
  4465. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4466. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  4467. //只能选择一个人进行代填,防止任务有问题
  4468. if (this.chosenMembList.length > 1) {
  4469. this.$message({
  4470. message: this.$t('meiCiJinZhiChiDaiTianYiGeRen'),
  4471. type: "error",
  4472. });
  4473. return;
  4474. }
  4475. this.chooseParticipVisible = false;
  4476. this.workForm.userNames = '';
  4477. this.workForm.userId = [];
  4478. this.participator = [];
  4479. for (var i=0;i<this.chosenMembList.length; i++) {
  4480. this.workForm.userId.push(this.chosenMembList[i].id);
  4481. this.workForm.userNames += this.chosenMembList[i].label+',';
  4482. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  4483. this.participator.push(item);
  4484. }
  4485. if (this.workForm.userNames.length > 0) {
  4486. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  4487. }
  4488. if(this.user.userNameNeedTranslate == 1) {
  4489. if(this.workForm.userNames) {
  4490. this.workForm.userNames = this.workForm.userNames.split(',')
  4491. }
  4492. }
  4493. //加载该人员的可填报项目
  4494. if (this.workForm.userId.length > 0) {
  4495. this.getSubUsersFillProjectList(this.workForm.userId[0]);
  4496. }
  4497. //打通企业微信考勤的情况,获取考勤
  4498. if (this.user.timeType.showCorpwxCardtime) {
  4499. this.getTargetUserCardTime();
  4500. }
  4501. },
  4502. getTargetUserCardTime() {
  4503. if (this.workForm.createDate && this.workForm.userId && this.workForm.userId.length > 0) {
  4504. this.http.post('/user-corpwx-time/getUserCardTime',{
  4505. userId: this.workForm.userId[0], date: this.workForm.createDate,
  4506. },
  4507. res => {
  4508. if (res.code == "ok") {
  4509. this.$set(this.workForm,'time', res.data);
  4510. }
  4511. },
  4512. error => {
  4513. this.$message({
  4514. message: error,
  4515. type: "error"
  4516. });
  4517. }
  4518. );
  4519. }
  4520. },
  4521. notifySel(sel){
  4522. // console.log(sel);
  4523. this.notifySelList = sel
  4524. },
  4525. //微信通知人员填写
  4526. Notify(code) {
  4527. if (this.notifySelList.length == 0) return;
  4528. var ids = '';
  4529. this.notifySelList.forEach(f=>{
  4530. ids += f.id+',';
  4531. })
  4532. this.http.post('/user/pushFillReport',{
  4533. ids: ids, date: this.curDate,
  4534. code: code
  4535. },
  4536. res => {
  4537. if (res.code == "ok") {
  4538. this.$message({
  4539. message: this.$t('message.sentSuccessfully'),
  4540. type: "success"
  4541. });
  4542. }
  4543. },
  4544. error => {
  4545. this.$message({
  4546. message: error,
  4547. type: "error"
  4548. });
  4549. }
  4550. );
  4551. },
  4552. //导出人员列表
  4553. exportMemb() {
  4554. if (this.fillMembList.length == 0) return;
  4555. var ids = '';
  4556. this.fillMembList.forEach(f=>{
  4557. ids += f.id+',';
  4558. })
  4559. this.http.post('/user/exportMembList',{
  4560. ids: ids,isFill: this.isFill, date: this.curDate
  4561. },
  4562. res => {
  4563. if (res.code == "ok") {
  4564. var aTag = document.createElement('a');
  4565. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  4566. aTag.href = res.data;
  4567. aTag.click();
  4568. }
  4569. },
  4570. error => {
  4571. this.$message({
  4572. message: error,
  4573. type: "error"
  4574. });
  4575. }
  4576. );
  4577. },
  4578. showMembList(fill) {
  4579. this.membListVisible = true;
  4580. if (fill == 0) {
  4581. this.fillMembList = this.unFillList;
  4582. this.isFill = false;
  4583. let leaveList = []
  4584. let unleaveList = []
  4585. for(let i in this.fillMembList){
  4586. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  4587. leaveList.push(this.fillMembList[i])
  4588. }else{
  4589. unleaveList.push(this.fillMembList[i])
  4590. }
  4591. }
  4592. this.fillMembList = unleaveList
  4593. this.fillMembList_leave = leaveList
  4594. } else if(fill == 1){
  4595. this.fillMembList = this.fillList.filter(item => item.state != 3);
  4596. this.isFill = true;
  4597. }else{
  4598. this.fillMembList = this.fillList.filter(item => item.state == 3);
  4599. this.isFill = true;
  4600. }
  4601. },
  4602. //获取自己填写的日报状态
  4603. getReportFillStatus() {
  4604. this.http.post('/report/getReportFillStatus',{
  4605. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  4606. },
  4607. res => {
  4608. if (res.code == "ok") {
  4609. this.fillStatusList = res.data;
  4610. this.allDate.forEach(d=>{
  4611. var fillInfo = null;
  4612. d.state = null;
  4613. this.fillStatusList.forEach(s=>{
  4614. var d1 = s.createDate.split('-')[2];
  4615. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4616. if (d1.indexOf('0') == 0) {
  4617. d1 = d1.substring(1,d1.length);
  4618. }
  4619. if (d1 == d2) {
  4620. d.state = s.state;
  4621. d.missReport = s.missReport;//是否漏填
  4622. d.exceedCardTime = s.exceedCardTime
  4623. }
  4624. })
  4625. })
  4626. this.$forceUpdate();
  4627. }
  4628. },
  4629. error => {
  4630. this.$message({
  4631. message: error,
  4632. type: "error"
  4633. });
  4634. }
  4635. );
  4636. },
  4637. scrollFunction () {
  4638. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4639. if (this.domObj.attachEvent) { // IE
  4640. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4641. } else if (this.domObj.addEventListener) {
  4642. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4643. }
  4644. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4645. },
  4646. mouseScroll(event) { // google 浏览器下
  4647. let detail = event.wheelDelta || event.detail
  4648. let moveForwardStep = -1
  4649. let moveBackStep = 1
  4650. let step = 0
  4651. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4652. event.preventDefault() // 阻止浏览器默认事件
  4653. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4654. },
  4655. // //左右滚动
  4656. // wheel(e){
  4657. // var a = document.getElementById("dateScroll");
  4658. // var scroll_width = 80; //滚动一下的距离
  4659. // var e = e || window.event, v;
  4660. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4661. // if(v>3||-v>3) v=-v;
  4662. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4663. // e.preventDefault(); //阻止浏览器的默认滚动
  4664. // },
  4665. showExportDialog() {
  4666. this.exportType = 0
  4667. this.exportDialog = true;
  4668. },
  4669. showExportTimeDialog() {
  4670. this.exportTimeDialog = true;
  4671. },
  4672. changeAllTime() {
  4673. //总时长发生改变,自动按比例计算
  4674. this.workForm.domains.forEach(d=>{
  4675. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4676. });
  4677. //计算jsTime
  4678. if (this.workForm.createDate) {
  4679. let sdate = new Date(this.workForm.createDate[0]);
  4680. let edate = new Date(this.workForm.createDate[1]);
  4681. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4682. if (days < 0) {
  4683. days = 0;
  4684. }
  4685. this.jsTime = this.reportTimeType.allday * days;
  4686. }
  4687. },
  4688. // 是否加班的单机事件
  4689. check() {
  4690. this.selected = !this.selected
  4691. this.isNew = this.selected
  4692. },
  4693. updateSubProject() {
  4694. this.$forceUpdate();
  4695. },
  4696. selectDegreeId(domain, index) {
  4697. this.http.post('/report/defaultDegree',{
  4698. projectId: domain.projectId
  4699. },
  4700. res => {
  4701. if (res.code == "ok") {
  4702. if(res.data) {
  4703. this.workForm.domains[index].degreeId = res.data.id + ''
  4704. this.$forceUpdate();
  4705. }
  4706. }
  4707. },
  4708. error => {
  4709. this.$message({
  4710. message: error,
  4711. type: "error"
  4712. });
  4713. }
  4714. );
  4715. },
  4716. //项目选中了, 加载子项目
  4717. selectProject(domain, index) {
  4718. if(!domain.projectId){
  4719. return;
  4720. }
  4721. // 默认选中上次填写的自定义维度
  4722. if(this.yonghuUser.customDegreeActive == 1) {
  4723. this.selectDegreeId(domain, index)
  4724. }
  4725. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4726. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4727. this.http.post('/sub-project/list',{
  4728. projectId: domain.projectId,
  4729. isReport: true
  4730. },
  4731. res => {
  4732. //清空之前选中的子项目
  4733. // this.workForm.domains[index].subProjectId = 0;
  4734. if (res.code == "ok") {
  4735. this.workForm.domains[index].subProjectList = res.data;
  4736. this.workForm.domains[index].subProjectId = null;
  4737. this.$forceUpdate();
  4738. }
  4739. },
  4740. error => {
  4741. this.$message({
  4742. message: error,
  4743. type: "error"
  4744. });
  4745. }
  4746. );
  4747. //项目相关的近期任务
  4748. if (this.user.company.packageProject == 1) {
  4749. this.getRecentTaskList(domain, index);
  4750. //获取项目相关专业
  4751. if (this.user.company.packageEngineering == 1) {
  4752. this.getProjectProfessions(domain, index);
  4753. }
  4754. //获取项目下的任务分组
  4755. this.getTaskGroups(domain, index);
  4756. }
  4757. // 获取项目相关的维度
  4758. // domain.degreeId = null
  4759. this.$set(domain,'degreeId',null)
  4760. this.$set(domain,'multiDegrIdArray',null)
  4761. this.dimension(domain, index);
  4762. //获取项目审核人
  4763. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4764. this.getProjectAuditorList(domain, index);
  4765. } else {
  4766. //按分组的负责人来审核
  4767. domain.projectAuditorId = null;
  4768. domain.projectAuditorName = null;
  4769. domain.auditUserList = null;
  4770. }
  4771. if (this.reportTimeType.type == 3) {
  4772. //新增项目时,自动计算
  4773. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4774. }
  4775. //加载昱众的工作职责
  4776. if (this.user.companyId == this.yuzhongCompId) {
  4777. this.updateResponse(domain);
  4778. }
  4779. const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
  4780. if(reportExtraField4Name || reportExtraField5Name) {
  4781. this.getInfoByProjectId(domain, index)
  4782. }
  4783. },
  4784. getInfoByProjectId(domain, index, flag = true) {
  4785. const { projectId } = domain
  4786. const projectList = this.fillProjectList || this.subFillProjectList
  4787. const { projectCode = '' } = projectList.find(item => item.id == projectId)
  4788. this.http.post('/erpOrderInfo/getInfoByProjectId',{
  4789. projectId: projectCode
  4790. },
  4791. res => {
  4792. if (res.code == "ok") {
  4793. if(flag) {
  4794. this.workForm.domains[index].extraField4 = ''
  4795. this.workForm.domains[index].extraField5 = ''
  4796. }
  4797. this.workForm.domains[index].reportExtraField4List = res.data.orderIds || []
  4798. this.workForm.domains[index].reportExtraField5List = res.data.lines || []
  4799. this.$forceUpdate();
  4800. }
  4801. },
  4802. error => {
  4803. this.$message({
  4804. message: error,
  4805. type: "error"
  4806. });
  4807. }
  4808. );
  4809. },
  4810. getRecentTaskList(domain, index) {
  4811. //刷新任务时,清空服务
  4812. this.$set(domain, 'sapServiceId', null);
  4813. this.$set(domain, 'taskId', null);
  4814. var param = {
  4815. projectId: domain.projectId,
  4816. isSubstitude:this.isSubstitude?1:0,
  4817. };
  4818. if (domain.groupId) {
  4819. param.groupId = domain.groupId;
  4820. }
  4821. if (domain.stage) {
  4822. param.stage = domain.stage;
  4823. }
  4824. //专业版代填,获取代填员工的任务
  4825. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4826. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4827. this.$message({
  4828. message: this.$t('qingXuanZeDaiTianDeYuanGong'),
  4829. type: "error"
  4830. });
  4831. return;
  4832. } else {
  4833. param.userId = this.workForm.userId[0];
  4834. }
  4835. }
  4836. this.http.post('/task/getRecentTask',param,
  4837. res => {
  4838. if (res.code == "ok") {
  4839. this.workForm.domains[index].allTaskList = res.data;
  4840. this.workForm.domains[index].taskList = res.data;
  4841. this.$forceUpdate();
  4842. }
  4843. },
  4844. error => {
  4845. this.$message({
  4846. message: error,
  4847. type: "error"
  4848. });
  4849. }
  4850. );
  4851. },
  4852. //获取项目审核人
  4853. getProjectAuditorList(domainItem, index) {
  4854. if(domainItem.projectId == '') {
  4855. return
  4856. }
  4857. domainItem.projectAuditorId = null;
  4858. domainItem.projectAuditorName = null;
  4859. var param = { projectId: domainItem.projectId};
  4860. if (this.isSubstitude) {
  4861. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  4862. param.userId = this.workForm.userId[0];
  4863. }
  4864. }
  4865. this.http.post('/project-auditor/getList',param,
  4866. res => {
  4867. if (res.code == "ok") {
  4868. domainItem.auditUserList = res.data;
  4869. if (res.data.length==0) {
  4870. this.$message({
  4871. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4872. type: "error"
  4873. });
  4874. } else if (res.data.length==1) {
  4875. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4876. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4877. }
  4878. this.$forceUpdate();
  4879. }
  4880. },
  4881. error => {
  4882. this.$message({
  4883. message: error,
  4884. type: "error"
  4885. });
  4886. }
  4887. );
  4888. },
  4889. // 获取维度数据
  4890. dimension(domain, index) {
  4891. if(domain.projectId == '') {
  4892. return
  4893. }
  4894. this.http.post('/project/getDegreeList',{
  4895. projectId: domain.projectId,
  4896. },
  4897. res => {
  4898. if (res.code == "ok") {
  4899. // console.log("维度数据",res.data);
  4900. this.workForm.domains[index].wuduList = res.data
  4901. // this.workForm = this.workForm
  4902. this.$forceUpdate()
  4903. }
  4904. },
  4905. error => {
  4906. this.$message({
  4907. message: error,
  4908. type: "error"
  4909. });
  4910. }
  4911. );
  4912. },
  4913. //切换任务阶段
  4914. changeStages(domain, index) {
  4915. if (domain.stage == null || domain.stage == '') {
  4916. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4917. } else {
  4918. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4919. }
  4920. this.getRecentTaskList(domain, index);
  4921. this.$forceUpdate();
  4922. },
  4923. getGroupStages(domain, index, keepStage) {
  4924. // console.log(domain);
  4925. if(!domain.groupId){
  4926. domain.projectAuditorId = ''
  4927. domain.stages = []
  4928. if(this.user.companyId == '3092') { // 针对 公司id为3092的公司清空任务分组时一起清空任务和服务
  4929. domain.taskId = ''
  4930. domain.sapServiceId = ''
  4931. }
  4932. if(this.user.timeType.reportAuditType >= 1){
  4933. domain.auditUserList = []
  4934. }
  4935. this.$forceUpdate();
  4936. return
  4937. }
  4938. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4939. res => {
  4940. if (res.code == "ok") {
  4941. if (!keepStage) {
  4942. domain.stage = '';
  4943. }
  4944. domain.stages = res.data;
  4945. this.getRecentTaskList(domain, index);
  4946. this.$forceUpdate();
  4947. }
  4948. },
  4949. error => {
  4950. this.$message({
  4951. message: error,
  4952. type: "error"
  4953. });
  4954. });
  4955. //检查当前的项目是否需要获取分组的负责人
  4956. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 || this.user.timeType.reportAuditType == 9) {
  4957. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4958. res => {
  4959. if (res.code == "ok") {
  4960. domain.getProjectAuditorList = res.data;
  4961. domain.auditUserList = res.data;
  4962. if (res.data.length==1) {
  4963. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4964. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4965. } else if (res.data.length==0) {
  4966. domain.projectAuditorId = null;
  4967. domain.projectAuditorName = null;
  4968. }
  4969. this.$forceUpdate();
  4970. }
  4971. },
  4972. error => {
  4973. this.$message({
  4974. message: error,
  4975. type: "error"
  4976. });
  4977. });
  4978. }
  4979. },
  4980. getProjectProfessions(domain, index) {
  4981. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4982. res => {
  4983. if (res.code == "ok") {
  4984. this.workForm.domains[index].professionProgress = res.data;
  4985. this.$forceUpdate();
  4986. }
  4987. },
  4988. error => {
  4989. this.$message({
  4990. message: error,
  4991. type: "error"
  4992. });
  4993. });
  4994. },
  4995. //删除自己的日报
  4996. deleteReport() {
  4997. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4998. confirmButtonText: this.$t('btn.determine'),
  4999. cancelButtonText: this.$t('btn.cancel'),
  5000. type: "warning"
  5001. })
  5002. .then(() => {
  5003. this.listLoading = true;
  5004. this.http.post('/report/delete',{
  5005. userId: this.user.id,
  5006. date: this.workForm.createDate
  5007. },
  5008. res => {
  5009. this.listLoading = false;
  5010. if (res.code == "ok") {
  5011. this.$message({
  5012. message: this.$t('message.successfullyDeleted'),
  5013. type: "success"
  5014. });
  5015. this.getReportList();
  5016. this.getDepartment();
  5017. this.dialogVisible = false;
  5018. } else {
  5019. this.$message({
  5020. message: res.msg,
  5021. type: "error"
  5022. });
  5023. }
  5024. },
  5025. error => {
  5026. this.listLoading = false;
  5027. this.$message({
  5028. message: error,
  5029. type: "error"
  5030. });
  5031. }
  5032. );
  5033. })
  5034. .catch(() => {});
  5035. },
  5036. // 管理员删除日报
  5037. guanli(item) {
  5038. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5039. let param = {date: this.date + day, userId: item.id};
  5040. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  5041. confirmButtonText: this.$t('btn.determine'),
  5042. cancelButtonText: this.$t('btn.cancel'),
  5043. type: "warning"
  5044. })
  5045. .then(() => {
  5046. this.listLoading = true;
  5047. this.http.post('/report/delete',param,
  5048. res => {
  5049. this.listLoading = false;
  5050. if (res.code == "ok") {
  5051. this.$message({
  5052. message: this.$t('message.successfullyDeleted'),
  5053. type: "success"
  5054. });
  5055. this.getReportList();
  5056. this.getDepartment();
  5057. this.dialogVisible = false;
  5058. } else {
  5059. this.$message({
  5060. message: res.msg,
  5061. type: "error"
  5062. });
  5063. }
  5064. },
  5065. error => {
  5066. this.listLoading = false;
  5067. this.$message({
  5068. message: error,
  5069. type: "error"
  5070. });
  5071. }
  5072. );
  5073. })
  5074. .catch(() => {});
  5075. },
  5076. selectAll() {
  5077. if (this.isAllSelect) {
  5078. var keys = [];
  5079. this.reportNames.forEach(b=>{
  5080. keys.push(b.id);
  5081. })
  5082. this.$refs.approveTree.setCheckedKeys(keys);
  5083. } else {
  5084. this.$refs.approveTree.setCheckedKeys([]);
  5085. }
  5086. },
  5087. removeEmptyNode(list) {
  5088. for (var i=0;i<list.length;i++) {
  5089. var cnt = 0;
  5090. if (list[i].membCount == 0) {
  5091. list.splice(i, 1);
  5092. i--;
  5093. } else if (list[i].children != null) {
  5094. this.removeEmptyNode(list[i].children);
  5095. }
  5096. }
  5097. },
  5098. calculateMembCount(list) {
  5099. for (var i in list) {
  5100. var cnt = 0;
  5101. if (list[i].children != null) {
  5102. this.calculateMembCount(list[i].children);
  5103. for (var m in list[i].children) {
  5104. cnt += list[i].children[m].membCount;
  5105. }
  5106. }
  5107. if (list[i].isUser == 1) {
  5108. cnt++;
  5109. this.membCount++;
  5110. }
  5111. list[i].membCount = cnt;
  5112. }
  5113. },
  5114. stateChange() {
  5115. // console.log(this.allData,'alldate');
  5116. this.membCount = 0;
  5117. if (this.selectState == -1) {
  5118. //全部状态
  5119. this.data = this.allData;
  5120. } else {
  5121. //未填报
  5122. this.seluserText = ''
  5123. var newData = JSON.parse(JSON.stringify(this.allData));
  5124. this.filterState(this.selectState, newData);
  5125. this.data = newData;
  5126. }
  5127. this.calculateMembCount(this.data);
  5128. this.data[0].membCount = this.membCount;//总人数
  5129. },
  5130. //按状态过滤部门人员
  5131. filterState(state, list) {
  5132. for (var i =0;i<list.length; i++) {
  5133. var obj = list[i];
  5134. if (obj.isUser == 1) {
  5135. var match = false;
  5136. if (state == -2) {
  5137. if (obj.state == null) {
  5138. match = true;
  5139. }
  5140. } else {
  5141. if (obj.state == state) {
  5142. match = true;
  5143. }
  5144. }
  5145. if (!match) {
  5146. list.splice(i, 1);
  5147. i--;
  5148. } else {
  5149. }
  5150. } else {
  5151. if (obj.children != null) {
  5152. this.filterState(state, obj.children);
  5153. }
  5154. }
  5155. }
  5156. },
  5157. //a按名称过滤部门人员
  5158. async seluserforText(){
  5159. const { userNameNeedTranslate } = this.user
  5160. this.membCount = 0;
  5161. var newData = JSON.parse(JSON.stringify(this.allData));
  5162. let textList = [this.seluserText]
  5163. if(userNameNeedTranslate == 1) {
  5164. this.dataLoading = true
  5165. let res = await this.postData('/user/getEmployeeList', {
  5166. keyword: this.seluserText,
  5167. cursor: '',
  5168. departmentId: -1,
  5169. pageIndex: 1,
  5170. pageSize: 1000
  5171. })
  5172. textList = res.data.records.map(item => item.name)
  5173. this.dataLoading = false
  5174. }
  5175. // return
  5176. this.seluserforTextin(this.seluserText, newData, textList)
  5177. this.data = newData;
  5178. this.calculateMembCount(this.data);
  5179. this.data[0].membCount = this.membCount;//总人数
  5180. },
  5181. seluserforTextin(text, list, textList = []){
  5182. for (var i =0;i<list.length; i++) {
  5183. var obj = list[i];
  5184. if (obj.isUser == 1) {
  5185. var match = false;
  5186. // if (obj.label.indexOf(text) != -1) {
  5187. // match = true
  5188. // }
  5189. if(textList.some(item => item.includes(obj.label))) {
  5190. match = true
  5191. }
  5192. if (!match) {
  5193. list.splice(i, 1);
  5194. i--;
  5195. } else {
  5196. }
  5197. } else {
  5198. if (obj.children != null) {
  5199. this.seluserforTextin(text, obj.children, textList);
  5200. }
  5201. }
  5202. }
  5203. },
  5204. // 当节点发生变化时
  5205. nodeChangeExpand(data) {
  5206. // 保存当前展开的节点
  5207. let flag = false
  5208. this.nodeModelData.some(item => {
  5209. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  5210. flag = true
  5211. return true
  5212. }
  5213. })
  5214. if (!flag) { // 不存在则存到数组里
  5215. this.nodeModelData.push(data.id)
  5216. }
  5217. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  5218. },
  5219. nodeChangeCollapse(data) {
  5220. this.nodeModelData.some((item, i) => {
  5221. if (item === data.id) {
  5222. this.nodeModelData.length = i
  5223. }
  5224. })
  5225. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  5226. },
  5227. // 部门列表点击
  5228. handleNodeClick(data) {
  5229. // this.dealList = data
  5230. this.theValues(data.id, this.allData)
  5231. // this.depData = data;
  5232. var list = [];
  5233. if (data.id == -1) {
  5234. this.deptId = null;
  5235. this.targetUid = null;
  5236. list = this.data;
  5237. } else if (data.isUser == 1) {
  5238. this.deptId = null;
  5239. this.targetUid = data.id;
  5240. } else {
  5241. this.deptId = data.id;
  5242. this.targetUid = null;
  5243. list.push(data);
  5244. }
  5245. this.getReportList();
  5246. if (list.length > 0) {
  5247. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  5248. this.fillList = this.getUserMembListFromDeptList(list, 1)
  5249. }
  5250. },
  5251. exportPushLog(){
  5252. this.http.post('/sap-sync-log/export',{},
  5253. res => {
  5254. if (res.code == "ok") {
  5255. var filePath = res.data;
  5256. var fName = '推送日志.xlsx'
  5257. const a = document.createElement('a'); // 创建a标签
  5258. a.setAttribute('download', fName);// download属性
  5259. a.setAttribute('href', filePath);// href链接
  5260. a.click(); //自执行点击事件
  5261. a.remove();
  5262. } else {
  5263. this.$message({
  5264. message: res.msg,
  5265. type: "error"
  5266. });
  5267. }
  5268. },
  5269. error => {
  5270. this.$message({
  5271. message: error,
  5272. type: "error"
  5273. });
  5274. });
  5275. },
  5276. theValues(id, item) {
  5277. for(var i in item) {
  5278. if(item[i].id == id) {
  5279. this.depData = item[i]
  5280. if(id == '-1') {
  5281. this.translation = '1'
  5282. } else {
  5283. if(item[i].children) {
  5284. this.translation = '2'
  5285. } else {
  5286. this.translation = '3'
  5287. }
  5288. }
  5289. return
  5290. } else {
  5291. if(item[i].children) {
  5292. this.theValues(id, item[i].children)
  5293. }
  5294. }
  5295. }
  5296. },
  5297. //获取可以选择的代填的人员列表
  5298. getSubstitudeUserDeptList() {
  5299. if (this.deptMembData.length == 0) {
  5300. this.http.post("/department/listMyMembs", {includeInactiveUser: 1},
  5301. res => {
  5302. if (res.code == "ok") {
  5303. let noAllData = JSON.parse(JSON.stringify(res.data));
  5304. if (noAllData.length > 0) {
  5305. // if (noAllData[0].label == '全部人员') {
  5306. if (noAllData[0].label == this.$t('lable.allStaff')) {
  5307. noAllData.splice(0,1);
  5308. }
  5309. }
  5310. this.setUserToDept(noAllData);
  5311. this.deptMembData = noAllData;
  5312. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  5313. } else {
  5314. this.$message({
  5315. message: res.msg,
  5316. type: "error"
  5317. });
  5318. }
  5319. },
  5320. error => {
  5321. this.$message({
  5322. message: error,
  5323. type: "error"
  5324. });
  5325. });
  5326. }
  5327. },
  5328. // 获取部门列表
  5329. getDepartmentForApprove() {
  5330. this.http.post( this.port.manage.depList, {},
  5331. res => {
  5332. if (res.code == "ok") {
  5333. var list1 = JSON.parse(JSON.stringify(res.data));
  5334. this.deptOptionList = this.changeArr(list1);
  5335. } else {
  5336. this.$message({
  5337. message: res.msg,
  5338. type: "error"
  5339. });
  5340. }
  5341. },
  5342. error => {
  5343. this.$message({
  5344. message: error,
  5345. type: "error"
  5346. });
  5347. });
  5348. },
  5349. // 获取部门列表
  5350. getDepartment() {
  5351. //如果没有权限,就不需要获取
  5352. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  5353. return;
  5354. }
  5355. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5356. var param = {date:this.date + day};
  5357. this.http.post("/report/getMembList", param,
  5358. res => {
  5359. if (res.code == "ok") {
  5360. if(res.data.length == 0){
  5361. return
  5362. }
  5363. this.departmentList = JSON.parse(JSON.stringify(res.data))
  5364. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  5365. this.trandepartmentList=this.changeArr(JSON.parse(JSON.stringify(res.data)))
  5366. // let noAllData = JSON.parse(JSON.stringify(res.data));
  5367. // if (this.user.role > 0) {
  5368. // }
  5369. list.splice(0,0,{
  5370. id: -1,
  5371. label: this.$t('lable.allStaff'),
  5372. })
  5373. this.membCount = 0;
  5374. //设置员工到部门下面
  5375. this.setUserToDept(list);
  5376. this.data = list;
  5377. // console.log('data',this.data);
  5378. this.expandDate = [this.data[1].id]
  5379. this.allData = list;
  5380. // if (noAllData.length > 0) {
  5381. // if (noAllData[0].label == '全部人员') {
  5382. // noAllData.splice(0,1);
  5383. // }
  5384. // }
  5385. // this.setUserToDept(noAllData);
  5386. // this.deptMembData = noAllData;
  5387. this.option = this.changeArr(list1);
  5388. list[0].membCount = this.membCount;
  5389. if (this.depData.id == -1) {
  5390. this.depData.membCount = this.membCount;
  5391. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  5392. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  5393. } else {
  5394. if (this.depData.isUser == null) {
  5395. var dep = this.findTargetDept(this.data, this.depData.id);
  5396. var membDeptList = [];
  5397. membDeptList.push(dep);
  5398. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  5399. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  5400. }
  5401. }
  5402. if (this.depData.isUser == null) {
  5403. if (this.isFill) {
  5404. this.fillMembList = this.fillList;
  5405. } else {
  5406. this.fillMembList = this.unFillList;
  5407. }
  5408. }
  5409. this.leaveAllNum = 0
  5410. for(let i in this.unFillList){
  5411. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  5412. this.leaveAllNum += 1
  5413. }
  5414. }
  5415. this.stateChange()
  5416. } else {
  5417. this.$message({
  5418. message: res.msg,
  5419. type: "error"
  5420. });
  5421. }
  5422. },
  5423. error => {
  5424. this.$message({
  5425. message: error,
  5426. type: "error"
  5427. });
  5428. });
  5429. this.getReportFillStatus();
  5430. },
  5431. findTargetDept(list, deptId) {
  5432. var t = null;
  5433. for (var i=0;i<list.length; i++) {
  5434. if (list[i].isUser == null && list[i].id == deptId) {
  5435. t = list[i];
  5436. break;
  5437. }
  5438. }
  5439. if (t == null) {
  5440. for (var i=0;i<list.length; i++) {
  5441. if (list[i].children != null && list[i].children.length > 0) {
  5442. t = this.findTargetDept(list[i].children, deptId);
  5443. if (t != null) {
  5444. break;
  5445. }
  5446. }
  5447. }
  5448. }
  5449. return t;
  5450. },
  5451. getUserMembListFromDeptList(list, isFill) {
  5452. var membList = [];
  5453. for (var i in list) {
  5454. var deptName = list[i].label;
  5455. if (list[i].userList != null) {
  5456. list[i].userList.forEach(element => {
  5457. if (isFill == 0) {
  5458. //获取未填的
  5459. if (element.state == null) {
  5460. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  5461. membList.push(obj);
  5462. }
  5463. } else {
  5464. if (element.state != null) {
  5465. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  5466. membList.push(obj);
  5467. }
  5468. }
  5469. });
  5470. }
  5471. if (list[i].children != null) {
  5472. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  5473. }
  5474. }
  5475. return membList;
  5476. },
  5477. setUserToDept(list) {
  5478. for (var i in list) {
  5479. var cnt = 0;
  5480. if (list[i].children != null) {
  5481. this.setUserToDept(list[i].children);
  5482. for (var m in list[i].children) {
  5483. cnt += list[i].children[m].membCount;
  5484. }
  5485. }
  5486. if (list[i].userList != null) {
  5487. if (list[i].children == null) {
  5488. list[i].children = [];
  5489. }
  5490. list[i].userList.forEach(element => {
  5491. var obj = {
  5492. id: element.id,
  5493. label:element.name,
  5494. state:element.state,
  5495. parentId:element.departmentId,
  5496. isUser:1,
  5497. workingTime: element.workingTime,
  5498. leaveDays: element.leaveDays,
  5499. leaveTimes: element.leaveTimes
  5500. };
  5501. list[i].children.push(obj);
  5502. this.membCount++;
  5503. cnt++;
  5504. });
  5505. }
  5506. list[i].membCount = cnt;
  5507. }
  5508. },
  5509. // 修改数组
  5510. changeArr(arr) {
  5511. for (var i = 0; i < arr.length; i++) {
  5512. if(arr[i].id != -1 && arr[i].id != 0) {
  5513. if (arr[i].children != null && arr[i].children.length>0) {
  5514. arr[i].children = this.changeArr(arr[i].children);
  5515. }
  5516. arr[i].id && (arr[i].value = arr[i].id);
  5517. delete arr[i].id;
  5518. }
  5519. }
  5520. for(var i in arr) {
  5521. if(arr[i].id == -1 || arr[i].id == 0) {
  5522. arr.splice(i,1)
  5523. }
  5524. }
  5525. return arr;
  5526. },
  5527. //时间段范围设置改动,监听
  5528. onTimeTypeChange(timeType) {
  5529. this.seleChn(1)
  5530. this.showAddMore = true;
  5531. for(var i in this.workForm.domains) {
  5532. if (this.workForm.domains[i].timeType == 0) {
  5533. this.showAddMore = false;
  5534. break;
  5535. }
  5536. }
  5537. if (this.showAddMore) {
  5538. //检测数量
  5539. if (this.workForm.domains.length == 2) {
  5540. this.showAddMore = false;
  5541. } else {
  5542. this.showAddMore = true;
  5543. }
  5544. }
  5545. },
  5546. getTimeType() {
  5547. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  5548. res => {
  5549. if (res.code == "ok") {
  5550. var t = res.data;
  5551. this.reportTimeType = t;
  5552. if (this.reportTimeType.type > 0) {
  5553. this.showAddMore = true;
  5554. }
  5555. //转化时间格式
  5556. if (t.allday != null) {
  5557. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  5558. }
  5559. if (t.am != null) {
  5560. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  5561. }
  5562. if (t.pm != null) {
  5563. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  5564. }
  5565. let arr = []
  5566. for(var i in res.data.excludeTimeList) {
  5567. let obj = {
  5568. s: res.data.excludeTimeList[i].startTime,
  5569. e: res.data.excludeTimeList[i].endTime,
  5570. }
  5571. arr.push(obj)
  5572. }
  5573. this.vacationTime = arr
  5574. } else {
  5575. this.$message({
  5576. message: res.msg,
  5577. type: "error"
  5578. });
  5579. }
  5580. },
  5581. error => {
  5582. this.listLoading = false;
  5583. this.$message({
  5584. message: error,
  5585. type: "error"
  5586. });
  5587. });
  5588. },
  5589. // 改变月份 -------
  5590. changeMonthOut() {
  5591. this.getAllDate();
  5592. this.getReportList();
  5593. this.getDepartment();
  5594. },
  5595. // 选择日期
  5596. choseDate(i, item) {
  5597. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  5598. return
  5599. }
  5600. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  5601. this.choseDay = i;
  5602. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5603. sessionStorage.msg = this.date + day,
  5604. this.getReportList();
  5605. this.getDepartment();
  5606. this.curDate = item.date;
  5607. },
  5608. canClick(i, item){
  5609. let nowDate = new Date()
  5610. let nowDateYear = nowDate.getFullYear()
  5611. let itemYear = parseInt(this.date.split('-')[0])
  5612. let nowDateMonth = nowDate.getMonth() + 1
  5613. let itemMonth = parseInt(this.date.split('-')[1])
  5614. let nowDateDay = nowDate.getDate()
  5615. let itemDay = parseInt(item.showDate.split('.')[1])
  5616. if(nowDateYear < itemYear){
  5617. return false
  5618. }else if(nowDateYear == itemYear){
  5619. if(nowDateMonth < itemMonth){
  5620. return false
  5621. }else if(nowDateMonth == itemMonth){
  5622. if(nowDateDay < itemDay){
  5623. return false
  5624. }
  5625. }
  5626. }
  5627. },
  5628. // 获取日期列表
  5629. getAllDate(e) {
  5630. var dayArry = [];
  5631. var day = this.getCountDays();
  5632. let curMonthDay = null;
  5633. for (var k = 1; k <= day; k++) {
  5634. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  5635. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  5636. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  5637. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5638. if(sessionStorage.msg) {
  5639. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5640. this.choseDay = k - 1;
  5641. curMonthDay = str;
  5642. }
  5643. } else {
  5644. if (new Date().getDate() == k) {
  5645. this.choseDay = k - 1;
  5646. }
  5647. }
  5648. } else {
  5649. this.choseDay = 0;
  5650. }
  5651. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5652. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5653. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5654. }
  5655. this.allDate = dayArry;
  5656. //不能超过最大日期
  5657. if (this.choseDay > day-1) {
  5658. this.choseDay = day-1;
  5659. }
  5660. if(sessionStorage.from != 1){
  5661. let nowmonth = new Date().getMonth() + 1
  5662. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5663. let nowdate = new Date().getDate()
  5664. if(nowd == this.date){
  5665. if(e && sessionStorage.msg){
  5666. }else{
  5667. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5668. }
  5669. let nowday = new Date(sessionStorage.msg).getDate()
  5670. this.choseDay = nowday - 1
  5671. let monthdate = new Date(sessionStorage.msg)
  5672. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5673. }else{
  5674. if(e && sessionStorage.msg){
  5675. }else{
  5676. sessionStorage.msg = this.date + '-01'
  5677. }
  5678. let monthdate = new Date(sessionStorage.msg)
  5679. this.choseDay = monthdate.getDate() - 1
  5680. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5681. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5682. }
  5683. }else{
  5684. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5685. }
  5686. //从消息点击跳转过来的,直接加载指定日期
  5687. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5688. this.curDate = sessionStorage.msg;
  5689. sessionStorage.from = 0;
  5690. } else {
  5691. // if (curMonthDay != null) {
  5692. // // this.curDate = curMonthDay;
  5693. // let d = new Date(sessionStorage.msg)
  5694. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5695. // } else {
  5696. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5697. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5698. // }
  5699. }
  5700. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5701. // if(!sessionStorage.msg){
  5702. // let msgday = this.choseDay + 1
  5703. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5704. // }
  5705. this.getReportFillStatus();
  5706. },
  5707. getCountDays() {
  5708. var newstr = this.date.replace(/-/g, "/");
  5709. var curDate = new Date(newstr+'/01');
  5710. var curMonth = curDate.getMonth();
  5711. curDate.setMonth(curMonth + 1);
  5712. curDate.setDate(0);
  5713. return curDate.getDate();
  5714. },
  5715. reqMore() {
  5716. if (this.hasMore) {
  5717. this.pageIndex++;
  5718. this.requestHttpReports();
  5719. }
  5720. },
  5721. //加载日报数据
  5722. requestHttpReports() {
  5723. //请求数据
  5724. this.listLoading = true;
  5725. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5726. let param = {date: this.date + day};
  5727. if (this.deptId) {
  5728. param.deptId = this.deptId;
  5729. }
  5730. if (this.targetUid) {
  5731. param.userId = this.targetUid;
  5732. }
  5733. //传页码
  5734. if (this.hasMore) {
  5735. param.pageIndex = this.pageIndex;
  5736. }
  5737. this.http.post( this.port.report.list, param,
  5738. res => {
  5739. this.listLoading = false;
  5740. if (res.code == "ok") {
  5741. //扩增
  5742. if (res.data.data.length > 0) {
  5743. this.reportList = this.reportList.concat(res.data.data);
  5744. } else if (this.pageIndex > 1){
  5745. this.$message({
  5746. message: this.$t('meiYouGengDuoShuJuLe'),
  5747. type: "info"
  5748. });
  5749. }
  5750. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5751. if(document.querySelector("#day"+this.choseDay)){
  5752. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5753. }
  5754. } else {
  5755. this.$message({
  5756. message: res.msg,
  5757. type: "error"
  5758. });
  5759. }
  5760. },
  5761. error => {
  5762. this.listLoading = false;
  5763. this.$message({
  5764. message: error,
  5765. type: "error"
  5766. });
  5767. });
  5768. },
  5769. //获取日报列表
  5770. getReportList() {
  5771. //初始化,重置数据
  5772. this.pageIndex = 0;
  5773. this.hasMore = true;
  5774. this.reportList = [];
  5775. this.requestHttpReports();
  5776. },
  5777. //刷新日报状态,用于审核后更新
  5778. refreshReportData(reportId) {
  5779. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5780. res => {
  5781. if (res.code == "ok") {
  5782. for (var m=0;m<this.reportList.length; m++) {
  5783. var d = this.reportList[m].data;
  5784. var find = d.filter(r=>r.id == reportId);
  5785. if (find.length > 0) {
  5786. find[0].state = res.data.state;
  5787. if (find[0].state == 2) {//被驳回,要可以编辑
  5788. this.reportList[m].state = 2;
  5789. }
  5790. find[0].isDeptAudit = res.data.isDeptAudit;
  5791. find[0].departmentAuditState = res.data.departmentAuditState;
  5792. find[0].projectAuditorName = res.data.projectAuditorName;
  5793. find[0].projectAuditorId = res.data.projectAuditorId;
  5794. find[0].projectAuditState = res.data.projectAuditState;
  5795. find[0].rejectUserid = res.data.rejectUserid;
  5796. find[0].rejectUsername = res.data.rejectUsername;
  5797. find[0].rejectReason = res.data.rejectReason;
  5798. this.$forceUpdate();
  5799. break;
  5800. }
  5801. }
  5802. } else {
  5803. this.$message({
  5804. message: res.msg,
  5805. type: "error"
  5806. });
  5807. }
  5808. },
  5809. error => {
  5810. this.listLoading = false;
  5811. this.$message({
  5812. message: error,
  5813. type: "error"
  5814. });
  5815. });
  5816. },
  5817. //导出员工工时统计
  5818. exportUserTime() {
  5819. this.listLoading = true;
  5820. var param = {};
  5821. if (this.exportParam.dateRange != null) {
  5822. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5823. }
  5824. this.http.post('/department/exportDeptStatistic', param,
  5825. res => {
  5826. this.listLoading = false;
  5827. if (res.code == "ok") {
  5828. location.href = res.data;
  5829. this.exportTimeDialog = false;
  5830. } else {
  5831. this.$message({
  5832. message: res.msg,
  5833. type: "error"
  5834. });
  5835. }
  5836. },
  5837. error => {
  5838. this.listLoading = false;
  5839. this.$message({
  5840. message: error,
  5841. type: "error"
  5842. });
  5843. });
  5844. },
  5845. //导出日报
  5846. exportReport() {
  5847. this.exportingData = true;
  5848. var param = {};
  5849. if (this.exportParam.dateRange != null) {
  5850. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5851. }
  5852. if (this.exportParam.projectId != null) {
  5853. param.projectId = this.exportParam.projectId;
  5854. }
  5855. if (this.exportParam.departmentId != null) {
  5856. // param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5857. param.departmentIds = this.exportParam.departmentId.join(',')
  5858. }
  5859. param.stateKey = this.stateKey
  5860. // param.departmentId = this.user.departmentId
  5861. this.http.post(this.port.report.export, param,
  5862. res => {
  5863. this.exportingData = false;
  5864. if (res.code == "ok") {
  5865. var filePath = res.data;
  5866. const a = document.createElement('a'); // 创建a标签
  5867. a.setAttribute('download', this.$t('other.dailyWork') + '.xlsx');// download属性
  5868. a.setAttribute('href', filePath);// href链接
  5869. a.click(); //自执行点击事件
  5870. a.remove();
  5871. this.exportDialog = false;
  5872. } else {
  5873. this.$message({
  5874. message: res.msg,
  5875. type: "error"
  5876. });
  5877. }
  5878. },
  5879. error => {
  5880. this.exportingData = false;
  5881. this.$message({
  5882. message: error,
  5883. type: "error"
  5884. });
  5885. });
  5886. },
  5887. //导出日报审核记录
  5888. exportReportLog() {
  5889. this.exportingData = true;
  5890. var param = {};
  5891. if (this.exportReportLogParam.dateRange != null) {
  5892. param = {startDate:this.exportReportLogParam.dateRange[0], endDate: this.exportReportLogParam.dateRange[1], exportType: this.exportType};
  5893. }
  5894. this.http.post('/report-log/exportReportLog', param,
  5895. res => {
  5896. this.exportingData = false;
  5897. if (res.code == "ok") {
  5898. var filePath = res.data;
  5899. const a = document.createElement('a'); // 创建a标签
  5900. a.setAttribute('download','日报审核记录.xlsx');// download属性
  5901. a.setAttribute('href', filePath);// href链接
  5902. a.click(); //自执行点击事件
  5903. a.remove();
  5904. this.exportDialog = false;
  5905. } else {
  5906. this.$message({
  5907. message: res.msg,
  5908. type: "error"
  5909. });
  5910. }
  5911. },
  5912. error => {
  5913. this.exportingData = false;
  5914. this.$message({
  5915. message: error,
  5916. type: "error"
  5917. });
  5918. });
  5919. },
  5920. restUserCardTime(item){
  5921. let param={}
  5922. param.userId=item.userId
  5923. param.createDate=item.createDate
  5924. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser', param,
  5925. res => {
  5926. if (res.code == "ok") {
  5927. this.showMonthWorkTimeReminder()
  5928. } else {
  5929. this.$message({
  5930. message: res.msg,
  5931. type: "error"
  5932. });
  5933. }
  5934. },
  5935. error => {
  5936. this.$message({
  5937. message: error,
  5938. type: "error"
  5939. });
  5940. });
  5941. },
  5942. importReportLog(item){
  5943. //首先判断文件类型
  5944. let str = item.file.name.split(".");
  5945. let format = str[str.length - 1];
  5946. if (format != "xls" && format != "xlsx") {
  5947. this.$message({
  5948. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  5949. type: "error"
  5950. });
  5951. } else {
  5952. const loading = this.$loading({
  5953. lock: true,
  5954. text: this.$t('zhengZaiDaoRuXiuGaiZhongQingNaiXinDengDai'),
  5955. spinner: 'el-icon-loading',
  5956. background: 'rgba(0, 0, 0, 0.7)'
  5957. });
  5958. let formData = new FormData();
  5959. formData.append("multipartFile", item.file);
  5960. this.http.uploadFile('/report-log/importReportLogChange', formData,
  5961. res => {
  5962. this.$refs.upload.clearFiles();
  5963. loading.close();
  5964. if (res.code == "ok") {
  5965. this.$message({
  5966. message: res.msg,
  5967. type: "success"
  5968. });
  5969. } else {
  5970. this.$message({
  5971. message: res.msg,
  5972. type: "error"
  5973. });
  5974. }
  5975. },
  5976. error => {
  5977. this.$refs.upload.clearFiles();
  5978. loading.close();
  5979. this.$message({
  5980. message: error,
  5981. type: "error"
  5982. });
  5983. });
  5984. }
  5985. },
  5986. //获取项目列表
  5987. getProjectList() {
  5988. this.listLoading = true;
  5989. this.http.post( this.port.project.list, {},
  5990. res => {
  5991. this.listLoading = false;
  5992. if (res.code == "ok") {
  5993. for(var i in res.data) {
  5994. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5995. res.data[i].projectCode = ''
  5996. }
  5997. }
  5998. this.projectList = res.data;
  5999. } else {
  6000. this.$message({
  6001. message: res.msg,
  6002. type: "error"
  6003. });
  6004. }
  6005. },
  6006. error => {
  6007. this.listLoading = false;
  6008. this.$message({
  6009. message: error,
  6010. type: "error"
  6011. });
  6012. });
  6013. },
  6014. getSubUsersFillProjectList(userId) {
  6015. this.http.post( this.port.project.list, {
  6016. forReport: 1,
  6017. userId: userId
  6018. },res => {
  6019. if (res.code == "ok") {
  6020. for(var i in res.data) {
  6021. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  6022. res.data[i].projectCode = ''
  6023. }
  6024. }
  6025. this.subFillProjectList = res.data;
  6026. this.getRecentlyProject(userId)
  6027. } else {
  6028. this.$message({
  6029. message: res.msg,
  6030. type: "error"
  6031. });
  6032. }
  6033. },
  6034. error => {
  6035. this.$message({
  6036. message: error,
  6037. type: "error"
  6038. });
  6039. });
  6040. },
  6041. // 获取填报日报的项目下拉列表
  6042. getFillProjectList() {
  6043. this.http.post( this.port.project.list, {
  6044. forReport: 1
  6045. },res => {
  6046. if (res.code == "ok") {
  6047. for(var i in res.data) {
  6048. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  6049. res.data[i].projectCode = ''
  6050. }
  6051. }
  6052. this.fillProjectList = res.data;
  6053. this.getRecentlyProject()
  6054. } else {
  6055. this.$message({
  6056. message: res.msg,
  6057. type: "error"
  6058. });
  6059. }
  6060. },
  6061. error => {
  6062. this.$message({
  6063. message: error,
  6064. type: "error"
  6065. });
  6066. });
  6067. },
  6068. //自己填写日报时,刷新到自己的可填报日报列表
  6069. refreshToMyReportProjectList() {
  6070. this.getRecentlyProject();
  6071. },
  6072. getBasecostItemList() {
  6073. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6074. companyId: this.user.companyId
  6075. },
  6076. res => {
  6077. if (res.code == "ok") {
  6078. this.timeBasecostList = res.data;
  6079. }
  6080. });
  6081. },
  6082. getAIReport(createDate) {
  6083. this.http.post('/report/getAIReport', {},
  6084. res => {
  6085. if (res.code == "ok") {
  6086. var quanbu = 0
  6087. this.jsDay = 1
  6088. var zhi = ''
  6089. var slp = res.data
  6090. for(var i in slp) {
  6091. var sp = +slp[i].workingTime + 0
  6092. zhi = this.jsDay * sp
  6093. quanbu = +quanbu + zhi
  6094. }
  6095. this.jsTime = quanbu
  6096. var aiReportData = res.data;
  6097. this.canCancelInDialog = false
  6098. if(aiReportData.length != 0) {
  6099. var arr = [];
  6100. for(var i in aiReportData) {
  6101. arr.push({
  6102. id: null,
  6103. projectId: aiReportData[i].projectId,
  6104. workingTime: aiReportData[i].workingTime,
  6105. content: '',
  6106. progress:100,
  6107. state: 2,
  6108. timeType: aiReportData[i].timeType,
  6109. subProjectList: aiReportData[i].subProjectList,
  6110. taskList: aiReportData[i].taskList,
  6111. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  6112. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  6113. taskId: aiReportData[i].taskId,
  6114. startTime: aiReportData[i].startTime,
  6115. endTime: aiReportData[i].endTime,
  6116. isOvertime: 0,
  6117. progress:aiReportData[i].progress,
  6118. professionProgress: aiReportData[i].professionProgressList,
  6119. stages:aiReportData[i].stages,
  6120. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  6121. pics: null,
  6122. multiWorktime: aiReportData[i].multiWorktime || 0,
  6123. worktimeList: [{}],
  6124. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  6125. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  6126. wuduList: aiReportData[i].degreeList,
  6127. taskGroups:aiReportData[i].taskGroups,
  6128. customData: aiReportData[i].customData,//自定义的数值
  6129. auditUserList: aiReportData[i].auditUserList,
  6130. projectAuditorId: aiReportData[i].projectAuditorId,
  6131. projectAuditorName: aiReportData[i].projectAuditorName,
  6132. overtimeHours: aiReportData[i].overtimeHours,
  6133. customText: aiReportData[i].customText,
  6134. basecostId: aiReportData[i].basecostId,
  6135. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  6136. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  6137. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  6138. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  6139. canEdit: true
  6140. })
  6141. }
  6142. this.workForm.domains = arr;
  6143. } else {
  6144. }
  6145. this.canEdit = true;
  6146. this.originCanEdit = true;
  6147. this.seleChn()
  6148. } else {
  6149. this.$message({
  6150. message: res.msg,
  6151. type: "error"
  6152. });
  6153. }
  6154. },
  6155. error => {
  6156. this.$message({
  6157. message: error,
  6158. type: "error"
  6159. });
  6160. });
  6161. },
  6162. // 获取个人某天的日报 111111
  6163. getReport() {
  6164. this.http.post( this.port.report.getPort, {
  6165. date: this.workForm.createDate
  6166. },
  6167. res => {
  6168. if (res.code == "ok") {
  6169. var quanbu = 0
  6170. this.jsDay = 1
  6171. var zhi = ''
  6172. var slp = res.data.report
  6173. for(var i in slp) {
  6174. var sp = +slp[i].workingTime + 0
  6175. zhi = this.jsDay * sp
  6176. quanbu = +quanbu + zhi
  6177. }
  6178. this.jsTime = quanbu
  6179. var list = res.data;
  6180. this.report = list;
  6181. this.reportTimeType = this.report.timeType;
  6182. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  6183. this.isWeekend = !this.report.isWorkDay;
  6184. this.canCancelInDialog = false;
  6185. this.hasWrittenReport = list.report.length != 0;
  6186. if(list.report.length != 0) {
  6187. var arr = [];
  6188. this.canEdit = false;
  6189. let candelete = true
  6190. const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
  6191. for(var i in list.report) {
  6192. var flg = null
  6193. list.report[i].isOvertime == 1 ? flg = true : flg = false
  6194. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  6195. var filteredRespList = null
  6196. if (targetP.length > 0) {
  6197. var isPublic = targetP[0].isPublic;
  6198. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?this.$t('fei-xiang-mu-gong-shi'):this.$t('xiangMuGongShi')) && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  6199. }
  6200. let copyData = {
  6201. id: list.report[i].id,
  6202. projectId: list.report[i].projectId,
  6203. workingTime: list.report[i].workingTime,
  6204. content: list.report[i].content,
  6205. state: list.report[i].state,
  6206. timeType: list.report[i].timeType,
  6207. subProjectList: list.report[i].subProjectList,
  6208. taskList: list.report[i].taskList,
  6209. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  6210. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  6211. taskId: list.report[i].taskId,
  6212. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  6213. startTime: list.report[i].startTime,
  6214. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  6215. endTime: list.report[i].endTime,
  6216. isOvertime: flg,
  6217. progress:list.report[i].progress,
  6218. professionProgress: list.report[i].professionProgressList,
  6219. stages:list.report[i].stages,
  6220. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  6221. pics: list.report[i].pics,
  6222. multiWorktime: list.report[i].multiWorktime,
  6223. worktimeList: list.report[i].worktimeList,
  6224. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  6225. multiDegrIdArray: list.report[i].multiDegrIdList,
  6226. wuduList: list.report[i].degreeList,
  6227. taskGroups:list.report[i].taskGroups,
  6228. customData: list.report[i].customData,//自定义的数值
  6229. auditUserList: list.report[i].auditUserList,
  6230. overtimeHours: list.report[i].overtimeHours,
  6231. customText: list.report[i].customText,
  6232. basecostId: list.report[i].basecostId,
  6233. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  6234. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  6235. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  6236. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  6237. canEdit: list.report[i].state >= 2 ? true : false,
  6238. extraField1: list.report[i].extraField1,
  6239. extraField2: list.report[i].extraField2,
  6240. extraField3: list.report[i].extraField3,
  6241. extraField4: list.report[i].extraField4,
  6242. extraField5: list.report[i].extraField5,
  6243. workContentList: list.report[i].workContentList,
  6244. filteredRespList: filteredRespList,
  6245. serviceList: list.report[i].serviceList,
  6246. sapServiceId: list.report[i].sapServiceId,
  6247. reportTargetDeptId: list.report[i].deptId
  6248. }
  6249. if (this.user.timeType.reportAuditType != 1 && this.user.timeType.reportAuditType != 2 && this.user.timeType.reportAuditType != 9) {
  6250. //分组负责人审核的情况下,前端不需要显示,无需设置
  6251. copyData.projectAuditorId = list.report[i].projectAuditorId;
  6252. copyData.projectAuditorName = list.report[i].projectAuditorName;
  6253. }
  6254. arr.push(copyData);
  6255. if (list.report[i].state >= 2) {
  6256. this.canEdit = true;
  6257. }
  6258. if(list.report[i].state < 2){
  6259. candelete = false
  6260. }
  6261. if (list.report[i].state == 0){
  6262. this.canCancelInDialog = true
  6263. }
  6264. // 加判断
  6265. if(this.user.timeType.choseFromAlbum == 1) {
  6266. let arrList = []
  6267. for(var k in list.report[i].pics) {
  6268. let obj = {
  6269. name: k,
  6270. url: list.report[i].pics[k]
  6271. }
  6272. arrList.push(obj)
  6273. }
  6274. arr[i].imgListUrl = arrList
  6275. arr[i].imgList = list.report[i].pics
  6276. }
  6277. if(reportExtraField4Name || reportExtraField5Name) {
  6278. this.getInfoByProjectId(copyData, i, false)
  6279. }
  6280. }
  6281. this.reportCanDelete = candelete
  6282. this.workForm = {
  6283. createDate: this.workForm.createDate,
  6284. domains: arr,
  6285. userNames:null,
  6286. userId:null,
  6287. time: list.time,
  6288. showRefresh: list.showRefresh
  6289. }
  6290. } else {
  6291. this.workForm = {
  6292. createDate: this.workForm.createDate,
  6293. domains: [{
  6294. id: null,
  6295. projectId: "",
  6296. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6297. content: "",
  6298. progress:100,
  6299. state: 2,
  6300. timeType:0,
  6301. multiWorktime: this.reportTimeType.multiWorktime,
  6302. worktimeList:[{}],
  6303. canEdit: true,
  6304. auditorFirst: '',
  6305. auditorSec: '',
  6306. auditorThird: '',
  6307. ccUserid: ''
  6308. }],
  6309. userId:null,
  6310. userNames:null,
  6311. time: this.report.time,
  6312. showRefresh: list.showRefresh
  6313. }
  6314. // businessTrips 有数据的情况下
  6315. const businessTrips = res.data.businessTrips || []
  6316. if(businessTrips.length > 0) {
  6317. this.workForm.domains = businessTrips.map((item, index) => {
  6318. return {
  6319. id: null,
  6320. projectId: item.projectId,
  6321. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6322. content: "",
  6323. progress:100,
  6324. state: 2,
  6325. timeType:0,
  6326. multiWorktime: this.reportTimeType.multiWorktime,
  6327. worktimeList:[{}],
  6328. canEdit: true,
  6329. auditorFirst: '',
  6330. auditorSec: '',
  6331. auditorThird: '',
  6332. ccUserid: ''
  6333. }
  6334. })
  6335. for(let domainsIndex in this.workForm.domains) {
  6336. this.selectProject(this.workForm.domains[domainsIndex], domainsIndex)
  6337. }
  6338. }
  6339. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  6340. this.$set(this.workForm.domains[0],'isOvertime',true)
  6341. if(this.reportTimeType.type != 2){
  6342. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  6343. }
  6344. }
  6345. if(this.user.timeType.type == 1) {
  6346. var shuzhi = this.user.timeType.allday + ''
  6347. // console.log('执行一次', shuzhi.indexOf('.'))
  6348. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6349. }
  6350. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6351. //默认给第一个,必填字段
  6352. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6353. }
  6354. this.canEdit = true;
  6355. }
  6356. this.originCanEdit = this.canEdit;
  6357. this.seleChn()
  6358. } else {
  6359. this.$message({
  6360. message: res.msg,
  6361. type: "error"
  6362. });
  6363. }
  6364. },
  6365. error => {
  6366. this.$message({
  6367. message: error,
  6368. type: "error"
  6369. });
  6370. });
  6371. },
  6372. guanbi() {
  6373. this.falsss = false,
  6374. this.workTimeForMinYi=0
  6375. },
  6376. // 打开日报填写
  6377. fillInReport(i, isBatch) {
  6378. this.isWeekend = false
  6379. this.reportCanDelete = false
  6380. // console.log(this.user.timeType.type, '选择时长')
  6381. if(i != 1) {
  6382. this.falsss = false
  6383. } else {
  6384. this.falsss = true
  6385. }
  6386. if (this.isSubstitude) {
  6387. this.getSubstitudeUserDeptList();
  6388. } else {
  6389. this.refreshToMyReportProjectList();
  6390. }
  6391. if(i == -1 || this.isSubstitude) {
  6392. this.isDisable = false;
  6393. } else {
  6394. this.isDisable = true;
  6395. }
  6396. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  6397. this.isBatch = isBatch;
  6398. if (this.isBatch == 0 && !this.isSubstitude) {
  6399. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  6400. let weekday = new Date(this.workForm.createDate).getDay()
  6401. if(this.user.companyId == 817){
  6402. if(weekday == 0){
  6403. this.isWeekend = true
  6404. }
  6405. }else{
  6406. if(weekday == 0 || weekday == 6){
  6407. this.isWeekend = true
  6408. }
  6409. }
  6410. this.getReport(i);
  6411. } else {
  6412. this.jsTime = 0
  6413. this.jsDay = 0
  6414. this.workForm = {
  6415. createDate: null,//批量填报没有日期
  6416. domains: [{
  6417. id: null,
  6418. projectId: "",
  6419. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6420. content: "",
  6421. progress:100,
  6422. state: 2,
  6423. timeType:0,
  6424. multiWorktime: this.reportTimeType.multiWorktime,
  6425. worktimeList:[{}],
  6426. canEdit: true,
  6427. }],
  6428. }
  6429. if(this.user.timeType.type == 1) {
  6430. var shuzhi = this.user.timeType.allday + ''
  6431. // console.log('执行二次')
  6432. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6433. }
  6434. if (this.isSubstitude && this.user.timeType.showCorpwxCardtime) {
  6435. this.workForm.showRefresh = true;
  6436. }
  6437. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  6438. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6439. }
  6440. this.canEdit = true;
  6441. }
  6442. if (this.isSubstitude) {
  6443. //代填情况,默认计算合计工时
  6444. this.jsDay = 1
  6445. this.seleChn();
  6446. }
  6447. this.dialogVisible = true;
  6448. },
  6449. //按周填报的弹窗口中编辑单项目相关数据
  6450. setWeekFormReportItem(reportId, i, names, row,sss) {
  6451. const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
  6452. this.http.post('/report/getReportById', {
  6453. reportId: reportId
  6454. },
  6455. res => {
  6456. if (res.code == "ok") {
  6457. var data = res.data.report;
  6458. sss.subProjectId = data.subProjectId
  6459. sss.subProjectList = data.subProjectList;
  6460. sss.stage = data.stage
  6461. sss.subProjectList = data.subProjectList
  6462. sss.stages = data.stages
  6463. sss.taskGroups = data.taskGroups;
  6464. sss.auditUserList = data.auditUserList;
  6465. sss.degreeId = data.degreeId;
  6466. sss.customData = data.customData;
  6467. sss.wuduList = data.degreeList;
  6468. if(reportExtraField4Name || reportExtraField5Name) {
  6469. sss.extraField4 = data.extraField4 || ''
  6470. sss.extraField5 = data.extraField5 || ''
  6471. }
  6472. this.zhoBaoIdx = i
  6473. this.zhoBaoName = names
  6474. this.zhoBao = sss
  6475. this.zhis = row
  6476. if (sss.groupId) {
  6477. //最后一个参数表示是否保留stage的值,不要重置为空
  6478. this.getGroupStages(this.zhoBao, 0, true)
  6479. }
  6480. if(reportExtraField4Name || reportExtraField5Name) {
  6481. this.weekGetInfoByProjectId(sss)
  6482. }
  6483. this.$forceUpdate();
  6484. }
  6485. });
  6486. },
  6487. // 重新计算合计
  6488. fillInThePedometerOnAWeeklyBasis(index) {
  6489. const weeklyItem = this.zhoData[index] || {}
  6490. const dynamicProjectList = this.selProjectList || []
  6491. const collectionArray = dynamicProjectList.map(item => {
  6492. const name = item.projectName
  6493. return Number(weeklyItem[name].workingTime || 0)
  6494. })
  6495. const totalNum = collectionArray.reduce((accumulator, currentValue) => accumulator + currentValue, 0)
  6496. this.zhoData[index].he = totalNum
  6497. },
  6498. // 按周填报里内容的填写
  6499. showWeekItemEdit(item, i, projectId,names, row) {
  6500. if (item.state == 0) {
  6501. this.$message({
  6502. message: this.$t('daiShenHeZhuangTaiBuKeXiuGaiQingFanHuiDaoChaKanRiBaoZhongXianCheHui'),
  6503. type: "error"
  6504. });
  6505. return;
  6506. }
  6507. if (item.state == 1) {
  6508. this.$message({
  6509. message: this.$t('yiTongGuoZhuangTaiBuKeXiuGai'),
  6510. type: "error"
  6511. });
  6512. return;
  6513. }
  6514. if(this.user.timeType.notAllowedNoAttendance == 1){
  6515. if(this.zhoData[i].corpTime){
  6516. if(this.zhoData[i].corpTime.workHours == 0){
  6517. this.$message({
  6518. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6519. type: 'error'
  6520. })
  6521. return
  6522. }
  6523. }else{
  6524. this.$message({
  6525. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6526. type: 'error'
  6527. })
  6528. return
  6529. }
  6530. }
  6531. var obj = {}
  6532. obj.projectId = projectId
  6533. this.tianxieDialogVisible = true
  6534. this.scopess = item
  6535. var sss = {}
  6536. if (item.id != null) {
  6537. sss.id = item.id;
  6538. sss.state = item.state;
  6539. } else {
  6540. sss.id = -1;
  6541. sss.state = 3;
  6542. }
  6543. sss.projectId = projectId;
  6544. sss.progress = item.progress
  6545. sss.time = item.time
  6546. sss.content = item.content;
  6547. if (sss.time == '' && this.reportTimeType.type == 2) {
  6548. //取已填时间范围中最大的一个作为开始时间
  6549. var startTime = '09:00';
  6550. var fillStartTime = '00:00';
  6551. for (var t in this.selProjectList) {
  6552. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  6553. if (fillItem.time) {
  6554. if (fillItem.time[1] > fillStartTime) {
  6555. fillStartTime = fillItem.time[1];
  6556. }
  6557. }
  6558. }
  6559. if (fillStartTime == '00:00') {
  6560. fillStartTime = '09:00';
  6561. }
  6562. var fillEndMax = '18:00';
  6563. if (fillStartTime >= '18:00') {
  6564. fillEndMax = '23:59';
  6565. }
  6566. sss.time = [fillStartTime, fillEndMax];
  6567. }
  6568. sss.groupId = item.groupId
  6569. sss.stage = item.stage;
  6570. sss.workingTime = item.workingTime
  6571. sss.projectAuditorId = item.projectAuditorId;
  6572. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6573. //默认选中第一个
  6574. sss.basecostId = this.timeBasecostList[0].id;
  6575. }
  6576. var hasEdited = this.zhoData[i][names].hasEdited;
  6577. if (hasEdited) {
  6578. console.log('执行到了这个')
  6579. console.log('执行到了这个', { ...item }, obj)
  6580. sss = { ...item }
  6581. //编辑过了
  6582. sss.subProjectId = item.subProjectId
  6583. sss.stage = item.stage
  6584. sss.subProjectList = item.subProjectList
  6585. sss.stages = item.stages
  6586. sss.taskGroups = item.taskGroups;
  6587. // sss.auditUserList = obj.auditUserList ;
  6588. sss.degreeId = item.degreeId;
  6589. sss.customData = item.customData;
  6590. if (sss.auditUserList != null && sss.auditUserList.length == 1) {
  6591. //只有一个审核人,自动设置上去
  6592. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6593. }
  6594. sss.wuduList = item.wuduList;
  6595. this.zhoBaoIdx = i
  6596. this.zhoBaoName = names
  6597. this.zhoBao = sss
  6598. this.zhis = row
  6599. if (sss.groupId) {
  6600. //最后一个参数表示是否保留stage的值,不要重置为空
  6601. this.getGroupStages(this.zhoBao, 0, true)
  6602. }
  6603. this.$forceUpdate();
  6604. this.getWeeklyTaskList(sss)
  6605. } else {
  6606. //第一次打开,获取数据
  6607. if (sss.id == -1) {
  6608. //新填报的
  6609. this.selectProject(obj, 0);
  6610. var that = this
  6611. setTimeout(() =>{
  6612. sss.subProjectId = that.workForm.domains[0].subProjectId
  6613. sss.subProjectList = item.subProjectList;
  6614. sss.stage = that.workForm.domains[0].stage
  6615. sss.subProjectList = that.workForm.domains[0].subProjectList
  6616. sss.stages = that.workForm.domains[0].stages
  6617. sss.taskGroups = that.workForm.domains[0].taskGroups;
  6618. sss.auditUserList = obj.auditUserList;
  6619. sss.degreeId = item.degreeId;
  6620. sss.customData = item.customData;
  6621. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6622. //只有一个审核人,自动设置上去
  6623. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6624. }
  6625. sss.wuduList = row[0].wuduList
  6626. that.zhoBaoIdx = i
  6627. that.zhoBaoName = names
  6628. that.zhoBao = sss
  6629. that.zhis = row
  6630. if (sss.groupId) {
  6631. //最后一个参数表示是否保留stage的值,不要重置为空
  6632. this.getGroupStages(that.zhoBao, 0, false)
  6633. }
  6634. that.$forceUpdate();
  6635. this.getWeeklyTaskList(sss)
  6636. },600);
  6637. } else {
  6638. //编辑填报过的;数据库已经存在的
  6639. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  6640. }
  6641. if(this.user.timeType.reportExtraField4Name || this.user.timeType.reportExtraField5Name) {
  6642. setTimeout(() => {
  6643. this.weekGetInfoByProjectId(sss)
  6644. }, 1000)
  6645. }
  6646. }
  6647. },
  6648. weekGetInfoByProjectId(item) {
  6649. console.log(item, '<=== item')
  6650. const { projectId } = item
  6651. const projectList = this.fillProjectList || this.subFillProjectList
  6652. const { projectCode = '' } = projectList.find(item => item.id == projectId)
  6653. this.http.post('/erpOrderInfo/getInfoByProjectId',{
  6654. projectId: projectCode
  6655. },
  6656. res => {
  6657. if (res.code == "ok") {
  6658. this.zhoBao.reportExtraField4List = res.data.orderIds || []
  6659. this.zhoBao.reportExtraField5List = res.data.lines || []
  6660. console.log(this.zhoBao, '<===== this.zhoBao')
  6661. this.$forceUpdate();
  6662. }
  6663. },
  6664. error => {
  6665. this.$message({
  6666. message: error,
  6667. type: "error"
  6668. });
  6669. });
  6670. // console.log(item)
  6671. // console.log(this.zhoBao)
  6672. },
  6673. // 按周填报里内容的填写点击确定
  6674. setWeekProItemData() {
  6675. //专业版模式下,任务分组和阶段必填
  6676. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  6677. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  6678. this.$message({
  6679. message: this.$t('renWuFenZuHeJieDuanBiTianQingJianCha'),
  6680. type: "error"
  6681. });
  6682. return;
  6683. }
  6684. }
  6685. // 检查任务分组
  6686. if(this.user.timeType.taskGroupRequired == 1 && !this.zhoBao.groupId){
  6687. this.$message({
  6688. message: this.$t('renWuFenZuBiTianQingJianCha'),
  6689. type: "error"
  6690. });
  6691. return
  6692. }
  6693. //检查子项目是否必填
  6694. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  6695. this.$message({
  6696. message: this.$t('ziXiangMuBiTianQingJianCha'),
  6697. type: "error"
  6698. });
  6699. return;
  6700. }
  6701. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  6702. this.$message({
  6703. message: this.$t('message.Pleaseselectareviewer'),
  6704. type: "error"
  6705. });
  6706. return
  6707. }
  6708. if(this.user.timeType.reportAuditType == 3){
  6709. let auditTips = ''
  6710. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  6711. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  6712. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  6713. if(auditTips){
  6714. auditTips = auditTips.substring(0,auditTips.length - 1)
  6715. this.$message({
  6716. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  6717. type: 'error'
  6718. })
  6719. return
  6720. }
  6721. }
  6722. let errtips = ''
  6723. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  6724. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  6725. errtips += this.user.timeType.customDegreeName + '、'
  6726. }
  6727. }
  6728. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  6729. errtips += this.user.timeType.customDataName + '、'
  6730. }
  6731. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  6732. errtips += this.user.timeType.customTextName + '、'
  6733. }
  6734. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  6735. errtips += this.$t('other.workMatters') +'、'
  6736. }
  6737. if(errtips){
  6738. errtips = errtips.substring(0,errtips.length - 1)
  6739. this.$message({
  6740. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  6741. type: 'error'
  6742. })
  6743. return
  6744. }
  6745. this.tianxieDialogVisible = false
  6746. var zhong = this.zhoData
  6747. this.zhoBao.hasEdited = true;
  6748. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  6749. this.zhoData = zhong
  6750. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  6751. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  6752. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  6753. },
  6754. // 获取本周
  6755. getCurrentWeek() {
  6756. //今天
  6757. this.targetWeekDate = new Date();
  6758. this.initWeekFormData();
  6759. // this.jiazai()
  6760. },
  6761. // 获取上周
  6762. handleGetPrevWeek() {
  6763. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  6764. this.initWeekFormData();
  6765. // this.jiazai()
  6766. },
  6767. // 获取下周
  6768. handleGetNextvWeek() {
  6769. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  6770. this.initWeekFormData()
  6771. },
  6772. // 加载动画
  6773. jiazai() {
  6774. this.weekDataLoading = true
  6775. var that = this
  6776. setTimeout(() =>{
  6777. that.weekDataLoading = false
  6778. },1000);
  6779. },
  6780. // 转时间格式
  6781. dealdate(date) {
  6782. const dt = new Date(date)
  6783. const y = dt.getFullYear()
  6784. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  6785. const d = (dt.getDate() + '').padStart(2, '0')
  6786. return `${y}-${m}-${d}`
  6787. },
  6788. // 按周填报
  6789. fillInReportss() {
  6790. window.addEventListener('scroll', this.handleScroll, true)
  6791. // this.jiazai()
  6792. this.fillWeekDialogVisi = true;
  6793. if (this.isSubstitude) {
  6794. this.substitudeStep = 1;
  6795. this.getSubstitudeUserDeptList();
  6796. } else {
  6797. this.getCurrentWeek();
  6798. }
  6799. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  6800. //重新获取工时预警类型的预算项
  6801. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6802. companyId: this.user.companyId
  6803. },
  6804. res => {
  6805. if (res.code == "ok") {
  6806. this.timeBasecostList = res.data;
  6807. }
  6808. });
  6809. }
  6810. },
  6811. fillInReportCustom() {
  6812. this.weekIndex++
  6813. this.weekParentData = {
  6814. isSubstitude: this.isSubstitude
  6815. }
  6816. this.fillWeekDialogVisiCustom = true
  6817. },
  6818. // 按周填报的项目筛选
  6819. selListFun(){
  6820. this.selProjectList = []
  6821. if(this.selCon.length){
  6822. for (let i = 0; i < this.selCon.length; i++) {
  6823. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  6824. }
  6825. this.selConShow = false ;
  6826. for (let i in this.zhoData) {
  6827. var obj = this.zhoData[i];
  6828. for(var j in this.selProjectList) {
  6829. var xinzhi = this.selProjectList[j].projectName
  6830. obj[xinzhi] = {}
  6831. obj[xinzhi].time = ''
  6832. obj[xinzhi].content = ''
  6833. obj[xinzhi].progress = 0
  6834. obj[xinzhi].workingTime = 0
  6835. }
  6836. }
  6837. this.initWeekFormData();
  6838. }else{
  6839. this.$message({
  6840. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  6841. type:'error'
  6842. })
  6843. }
  6844. },
  6845. setWeekCardTimeData(list) {
  6846. for(let i in list){
  6847. let datei = '';
  6848. if (this.user.timeType.showDdCardtime == 1) {
  6849. datei = list[i].workDate;
  6850. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6851. datei = list[i].createDate;
  6852. } else if (this.user.timeType.syncFanwei == 1) {
  6853. datei = list[i].workDate;
  6854. }
  6855. for(let m in this.zhoData) {
  6856. if(datei == this.zhoData[m].zhoDataTime){
  6857. let item = {
  6858. startTime: list[i].startTime,
  6859. endTime: list[i].endTime,
  6860. workHours: list[i].workHours,
  6861. otTime: list[i].otTime
  6862. }
  6863. this.$set(this.zhoData[m],'corpTime',item)
  6864. }
  6865. }
  6866. }
  6867. },
  6868. getWeeklyCardTime(){ //按周填报获取考勤信息
  6869. let dateStr = []
  6870. for(let i in this.zhoData){
  6871. dateStr.push(this.zhoData[i].zhoDataTime)
  6872. }
  6873. this.http.post('/report/getWeeklyCardTime',{
  6874. dateStr: JSON.stringify(dateStr)
  6875. },res => {
  6876. if(res.code == 'ok'){
  6877. for(let i in res.data){
  6878. let datei = '';
  6879. if (this.user.timeType.showDdCardtime == 1) {
  6880. datei = res.data[i].workDate.split('-');
  6881. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6882. datei = res.data[i].createDate.split('-');
  6883. }
  6884. for(let m in this.zhoData){
  6885. let datem = new Date(this.zhoData[m].zhoDataTime)
  6886. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  6887. let item = {
  6888. startTime: res.data[i].startTime,
  6889. endTime: res.data[i].endTime,
  6890. workHours: res.data[i].workHours
  6891. }
  6892. this.$set(this.zhoData[m],'corpTime',item)
  6893. }
  6894. }
  6895. }
  6896. }else{
  6897. this.$message({
  6898. message: res.msg,
  6899. type: 'error'
  6900. })
  6901. }
  6902. },err => {
  6903. this.$message({
  6904. message: err,
  6905. type: 'error'
  6906. })
  6907. })
  6908. },
  6909. selListqx(){
  6910. this.fillWeekDialogVisi = false
  6911. this.selProjectList = []
  6912. this.selCon = []
  6913. },
  6914. handleScroll() {
  6915. this.changdu = this.projectList.length + 1
  6916. },
  6917. // 自动选择时间点的事件
  6918. // async zhoTimes(item, i) {
  6919. // var iss = i
  6920. // if(item.time == null) {
  6921. // return
  6922. // } else {
  6923. // const zhi = this.zhoData[iss];
  6924. // let he = 0;
  6925. // const timeArr = Object.values(zhi)
  6926. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6927. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6928. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6929. // console.log(data, 'data');
  6930. // zhi.he = `${he}h`;
  6931. // }
  6932. // },
  6933. async zhoTimes(item, index) {
  6934. const zho = this.zhoData[index];
  6935. if (!item.time) {
  6936. return;
  6937. }
  6938. const timeArr = Object.values(zho)
  6939. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6940. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6941. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6942. zho.he = `${totalHours[0]}h`;
  6943. },
  6944. // 判断两个时间段是否重叠
  6945. timeOverlap(idx, dateAr) {
  6946. let zhi = 0
  6947. for (let k in dateAr) {
  6948. if (idx !== k) {
  6949. 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))) {
  6950. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6951. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6952. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6953. }
  6954. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6955. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6956. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6957. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6958. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6959. } else {
  6960. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6961. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6962. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6963. }
  6964. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6965. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6966. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6967. }
  6968. }
  6969. }
  6970. }
  6971. }
  6972. return zhi
  6973. },
  6974. // 计算时间
  6975. getHourMinutes(str, end) {
  6976. var he = 0
  6977. var date2 = '2021/12/12 ' + end +':00'
  6978. var date1 = '2021/12/12 ' + str +':00'
  6979. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6980. var leave1=date3%(24*3600*1000)
  6981. var hours=Math.floor(leave1/(3600*1000))
  6982. var leave2=leave1%(3600*1000)
  6983. var minutes=Math.floor(leave2/(60*1000))
  6984. var shi = hours+'.'+ minutes
  6985. return he += +shi
  6986. },
  6987. // 自动选择事件长度的事件
  6988. zhoXuan(item, i) {
  6989. var iss = i
  6990. if(item.time == null) {
  6991. return
  6992. } else {
  6993. var zhi = this.zhoData[iss]
  6994. var he = 0
  6995. for(var i in zhi) {
  6996. const workingTimeStr = zhi[i].workingTime ? zhi[i].workingTime + '' : ''
  6997. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && workingTimeStr.length > 0) {
  6998. console.log('执行')
  6999. he += +zhi[i].workingTime
  7000. }
  7001. }
  7002. zhi.he = he + 'h'
  7003. }
  7004. },
  7005. getPushWorkLogData(){
  7006. this.http.post('/sap-sync-log/list', {},
  7007. res => {
  7008. if (res.code == "ok") {
  7009. this.pushWorkTimeLogData = res.data;
  7010. } else {
  7011. this.$message({
  7012. message: res.msg,
  7013. type: "error"
  7014. });
  7015. }
  7016. },
  7017. error => {
  7018. this.$message({
  7019. message: error,
  7020. type: "error"
  7021. });
  7022. });
  7023. },
  7024. // 获取全部人员
  7025. getUsers() {
  7026. this.http.post('/user/getSimpleActiveUserList', {},
  7027. res => {
  7028. if (res.code == "ok") {
  7029. this.usersList = res.data;
  7030. } else {
  7031. this.$message({
  7032. message: res.msg,
  7033. type: "error"
  7034. });
  7035. }
  7036. },
  7037. error => {
  7038. this.$message({
  7039. message: error,
  7040. type: "error"
  7041. });
  7042. });
  7043. },
  7044. // 按时间比例
  7045. addBli(item, i) {
  7046. var iss = i
  7047. if(item.time == null) {
  7048. return
  7049. } else {
  7050. var zhi = this.zhoData[iss]
  7051. var he = 0
  7052. for(var i in zhi) {
  7053. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  7054. he += +zhi[i].workingTime
  7055. }
  7056. }
  7057. zhi.he = he.toFixed(1) + 'h'
  7058. }
  7059. },
  7060. //按周填报选择的项目发生变化,需要设置列
  7061. onSelProjectChange() {
  7062. for (let i = 0; i < this.selCon.length; i++) {
  7063. var exists = false;
  7064. for (let j = 0; j < this.selProjectList.length; j++) {
  7065. if (this.selProjectList[j].id == this.selCon[i]) {
  7066. exists = true;
  7067. break;
  7068. }
  7069. }
  7070. if (!exists) {
  7071. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  7072. this.selProjectList.push(newProject);
  7073. //添加新项目
  7074. for (var w in this.zhoData) {
  7075. var dayItem = this.zhoData[w];
  7076. var pName = newProject.projectName;
  7077. dayItem[pName] = {};
  7078. dayItem[pName].time = ''
  7079. dayItem[pName].content = ''
  7080. dayItem[pName].progress = 0
  7081. dayItem[pName].workingTime = 0
  7082. }
  7083. }
  7084. }
  7085. //去掉
  7086. for (let j = 0; j < this.selProjectList.length; j++) {
  7087. var exists = false;
  7088. for (let i = 0; i < this.selCon.length; i++) {
  7089. if (this.selProjectList[j].id == this.selCon[i]) {
  7090. exists = true;
  7091. break;
  7092. }
  7093. }
  7094. if (!exists) {
  7095. this.selProjectList.splice(j, 1);
  7096. j--;
  7097. }
  7098. }
  7099. this.loadFilledWeekReportItem();
  7100. //刷新表格
  7101. // this.$refs.weekTable.doLayout();
  7102. },
  7103. //根据选中的项目来刷新填写表格
  7104. loadFilledWeekReportItem() {
  7105. for (var w in this.zhoData) {
  7106. var dayItem = this.zhoData[w];
  7107. for (var i = 0; i < this.selProjectList.length; i++) {
  7108. var curColumnProject = this.selProjectList[i];
  7109. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  7110. for (var t in dayItem.reportList) {
  7111. //有日报的项目,不能取消选择
  7112. for (var p in this.fillProjectList) {
  7113. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  7114. }
  7115. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  7116. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  7117. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  7118. if (this.reportTimeType.type == 2) {
  7119. //时间段模式
  7120. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  7121. }
  7122. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  7123. break;
  7124. }
  7125. }
  7126. // dayItem[curColumnProject.projectName] = matchReportItem;
  7127. }
  7128. }
  7129. this.$nextTick(()=>{
  7130. this.$refs.weekTable.doLayout();
  7131. });
  7132. },
  7133. initWeekFormData() {
  7134. this.weekDataLoading = true;
  7135. for (var p in this.fillProjectList) {
  7136. this.fillProjectList[p].canCancel = 1;
  7137. }
  7138. var param = {
  7139. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  7140. };
  7141. if (this.isSubstitude) {
  7142. //传代填人的userId
  7143. param.targetUserId = this.workForm.userId[0];
  7144. }
  7145. this.http.post('/report/getWeeklyReportData',param,res => {
  7146. this.weekDataLoading = false;
  7147. if(res.code == 'ok'){
  7148. let projectList = res.data.projectList;
  7149. if (projectList.length > 0) {
  7150. //有选择过项目进行填报,直接选中
  7151. this.selProjectList = projectList;
  7152. this.selCon = [];
  7153. for (let i = 0; i < projectList.length; i++) {
  7154. this.selCon.push(projectList[i].id);
  7155. }
  7156. }
  7157. //设置日期
  7158. this.weekDateRange = res.data.dateList;
  7159. this.zhoData = [];
  7160. var arrst = []
  7161. for(var i in this.weekDateRange) {
  7162. var obj = {}
  7163. obj.zhoDataTime = this.weekDateRange[i].date
  7164. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  7165. obj.he = this.weekDateRange[i].filledTime;
  7166. obj.canFill = this.weekDateRange[i].canFill;
  7167. // obj.filledTime = this.weekDateRange[i].filledTime;
  7168. obj.reportList = this.weekDateRange[i].reportList;
  7169. //初始化,防止渲染报错
  7170. for (var j = 0; j < this.selProjectList.length; j++) {
  7171. var pName = this.selProjectList[j].projectName
  7172. obj[pName] = {}
  7173. obj[pName].time = ''
  7174. obj[pName].content = ''
  7175. obj[pName].progress = 0
  7176. obj[pName].workingTime = 0
  7177. }
  7178. arrst.push(obj)
  7179. }
  7180. this.zhoData = arrst
  7181. this.setWeekCardTimeData(res.data.cardTimeList);
  7182. this.loadFilledWeekReportItem();
  7183. }else{
  7184. this.$message({
  7185. message: res.msg,
  7186. type: 'error'
  7187. })
  7188. }
  7189. },err => {
  7190. this.$message({
  7191. message: err,
  7192. type: 'error'
  7193. })
  7194. })
  7195. },
  7196. zhoZhi(res, i) {
  7197. var zhi = 0
  7198. for(var i in res) {
  7199. if(i != 'zhoDataTime' && i != 'he') {
  7200. zhi += +res[i]
  7201. }
  7202. }
  7203. res.he = zhi
  7204. },
  7205. zhoBtn(i) {
  7206. // this.zhoData.split(i, 1)
  7207. var arr = this.zhoData
  7208. arr.splice(i, 1)
  7209. },
  7210. zhoAddlast(){
  7211. this.selConShow = true
  7212. },
  7213. closeAddWeeklyReport(){
  7214. this.fillWeekDialogVisi = false
  7215. this.selConShow = true
  7216. this.selProjectList = []
  7217. this.selCon = []
  7218. },
  7219. checkDateWorkTime() {
  7220. //针对苏州景昱,单独的检查逻辑
  7221. if (this.user.companyId == 5978) {
  7222. //调接口,先检查工时是否存在异常
  7223. var zhi = this.zhoData;
  7224. var array = [];
  7225. for(let n in zhi){
  7226. if(zhi[n].he){
  7227. var workData = {date: zhi[n].zhoDataTime, workingTime: zhi[n].he};
  7228. array.push(workData)
  7229. }
  7230. }
  7231. this.submitingReport = true;
  7232. this.http.post('/report/checkBeiSengCardTime', {userId:this.user.id, dateWorkingTime:JSON.stringify(array)},
  7233. res => {
  7234. this.submitingReport = false;
  7235. if (res.code == "ok") {
  7236. this.submitWeekReport(0)
  7237. } else {
  7238. this.$confirm(res.msg, this.$t('other.prompts'), {
  7239. confirmButtonText: this.$t('huLveBingTiJiao'),
  7240. cancelButtonText: this.$t('btn.cancel'),
  7241. type: 'error'
  7242. }).then(() => {
  7243. this.submitWeekReport(0)
  7244. }).catch(() => {
  7245. });
  7246. }
  7247. },
  7248. error => {
  7249. this.$message({
  7250. message: error,
  7251. type: "error"
  7252. });
  7253. });
  7254. }
  7255. },
  7256. // 提交按周填报
  7257. submitWeekReport(isDraft) {
  7258. var zhi = this.zhoData
  7259. var ll = 0
  7260. const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
  7261. if(this.reportTimeType.type == 2) {
  7262. for(var i in zhi) {
  7263. this.dateAr = []
  7264. var alp = []
  7265. var zhis = zhi[i]
  7266. for(var j in zhis) {
  7267. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  7268. let objs = {}
  7269. objs.s = zhis[j].time[0]
  7270. objs.e = zhis[j].time[1]
  7271. objs.p = j
  7272. alp.push(objs)
  7273. }
  7274. }
  7275. this.dateAr = alp
  7276. if (this.reportTimeType.timeCanOverlap == 0) {
  7277. let str = this.$t('message.Filledtimeperiodsoverlap')
  7278. if(this.dateAr.length > 0) {
  7279. const trus = this.fns();
  7280. const overlapDataTime = this.getOverlapData(alp);
  7281. if (overlapDataTime.length > 0) {
  7282. const arrList = overlapDataTime.map((item) => item.p);
  7283. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  7284. }
  7285. ll += 1
  7286. if(!trus) {
  7287. this.$message({
  7288. message: str,
  7289. type: 'error'
  7290. })
  7291. return false
  7292. }
  7293. }
  7294. } else {
  7295. if(this.dateAr.length > 0) {
  7296. ll +=1 ;
  7297. }
  7298. }
  7299. }
  7300. if(ll == 0) {
  7301. this.$message({
  7302. message: this.$t('message.Pleasefillinthetime'),
  7303. type: 'error'
  7304. })
  7305. return false
  7306. }
  7307. } else if(this.reportTimeType.type == 1){
  7308. for(var i in zhi) {
  7309. var zhis = zhi[i]
  7310. for(var j in zhis) {
  7311. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  7312. ll += 1
  7313. }
  7314. }
  7315. }
  7316. if(ll == 0) {
  7317. this.$message({
  7318. message: this.$t('message.Pleaseselectatime'),
  7319. type: 'error'
  7320. })
  7321. return false
  7322. }
  7323. let overcorp = ''
  7324. for(let n in zhi){
  7325. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  7326. overcorp += zhi[n].zhoDataTime + ','
  7327. }
  7328. }
  7329. if(this.user.companyId != 5978 && overcorp != ''){
  7330. overcorp = overcorp.substring(0,overcorp.length - 1)
  7331. this.$message({
  7332. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  7333. type: 'error'
  7334. })
  7335. return
  7336. }
  7337. }
  7338. var submits = []
  7339. let formData = new FormData();
  7340. formData.append("draft", isDraft);
  7341. if(this.reportTimeType.multiWorktime == 1){
  7342. for (var i in this.zhoData) {
  7343. var zhoD = this.zhoData[i]
  7344. var flgs = false
  7345. for(var j in zhoD) {
  7346. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  7347. flgs = true
  7348. // formData.append("degreeId", "-1");
  7349. formData.append("id", '-1');
  7350. if (this.isSubstitude) {
  7351. formData.append('targetUids',this.workForm.userId[0]);
  7352. }
  7353. for(var s in this.selProjectList) {
  7354. if(j == this.selProjectList[s].projectName) {
  7355. formData.append("projectId", this.selProjectList[s].id);
  7356. break;
  7357. }
  7358. }
  7359. if(this.user.timeType.reportAuditType == 3){
  7360. let audItem = {}
  7361. if(this.user.timeType.auditLevel > 0){
  7362. audItem.auditorFirst = zhoD[j].auditorFirst
  7363. }
  7364. if(this.user.timeType.auditLevel > 1){
  7365. audItem.auditorSec = zhoD[j].auditorSec
  7366. }
  7367. if(this.user.timeType.auditLevel > 2){
  7368. audItem.auditorThird = zhoD[j].auditorThird
  7369. }
  7370. if(zhoD[j].ccUserid){
  7371. audItem.ccUserid = zhoD[j].ccUserid
  7372. }
  7373. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7374. }
  7375. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7376. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7377. formData.append("reportTimeType", this.reportTimeType.type);
  7378. formData.append("endTime", '');
  7379. formData.append("startTime", '');
  7380. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7381. var lix = []
  7382. var objjs = {}
  7383. objjs.startTime = zhoD[j].time[0]
  7384. objjs.endTime = zhoD[j].time[1]
  7385. if (zhoD[j].content == null || zhoD[j].content == '') {
  7386. zhoD[j].content == '-'
  7387. }
  7388. objjs.content = zhoD[j].content
  7389. lix.push(objjs)
  7390. var zhiZhi = JSON.stringify(lix)
  7391. zhiZhi = zhiZhi.replace(/,/g,"@");
  7392. formData.append("content", zhiZhi)
  7393. formData.append("isOvertime", 0)
  7394. formData.append("professionProgress", "[]")
  7395. if (zhoD[j].groupId) {
  7396. formData.append("groupId",zhoD[j].groupId)
  7397. } else {
  7398. //解决后台groupId数组越界的问题
  7399. formData.append("groupId",0)
  7400. }
  7401. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7402. formData.append("createDate",zhoD.zhoDataTime)
  7403. if (zhoD[j].projectAuditorId) {
  7404. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7405. }
  7406. if(zhoD[j].basecostId) {
  7407. formData.append("basecostId", zhoD[j].basecostId);
  7408. } else {
  7409. formData.append("basecostId", 0);
  7410. }
  7411. if(this.user.timeType.customDegreeActive){
  7412. if (this.user.timeType.customDegreeMultiple) {
  7413. if (zhoD[j].multiDegrIdArray) {
  7414. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  7415. } else {
  7416. formData.append('multiDegrId','[]')
  7417. }
  7418. } else {
  7419. if (zhoD[j].degreeId) {
  7420. formData.append('degreeId',zhoD[j].degreeId)
  7421. } else {
  7422. formData.append('degreeId','-1')
  7423. }
  7424. }
  7425. }else{
  7426. formData.append("degreeId", "-1");
  7427. }
  7428. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7429. formData.append('customData',zhoD[j].customData)
  7430. }else if(this.user.timeType.customDataActive){
  7431. formData.append('customData',0)
  7432. }
  7433. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7434. formData.append('customText',zhoD[j].customText)
  7435. }else if(this.user.timeType.customTextActive){
  7436. formData.append('customText','-')
  7437. }
  7438. if(reportExtraField4Name || reportExtraField5Name) {
  7439. formData.append('extraField4', zhoD[j].extraField4 || '')
  7440. formData.append('extraField5', zhoD[j].extraField5 || '')
  7441. }
  7442. }
  7443. }
  7444. }
  7445. } else {
  7446. for (var i in this.zhoData) {
  7447. var zhoD = this.zhoData[i]
  7448. var flgs = false
  7449. if(this.reportTimeType.type == 2) {
  7450. for(var k in this.selProjectList) {
  7451. var pItem = this.selProjectList[k];
  7452. var pName = pItem.projectName;
  7453. var j = pName;
  7454. var pid = pItem.id;
  7455. console.log('j==周报中的项目='+j);
  7456. if(zhoD[j].time && zhoD[j].time != 'null') {
  7457. flgs = true
  7458. // formData.append("degreeId", "-1");
  7459. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7460. if (this.isSubstitude) {
  7461. formData.append('targetUids',this.workForm.userId[0]);
  7462. }
  7463. formData.append("projectId", pid);
  7464. if(this.user.timeType.reportAuditType == 3){
  7465. let audItem = {}
  7466. if(this.user.timeType.auditLevel > 0){
  7467. audItem.auditorFirst = zhoD[j].auditorFirst
  7468. }
  7469. if(this.user.timeType.auditLevel > 1){
  7470. audItem.auditorSec = zhoD[j].auditorSec
  7471. }
  7472. if(this.user.timeType.auditLevel > 2){
  7473. audItem.auditorThird = zhoD[j].auditorThird
  7474. }
  7475. if(zhoD[j].ccUserid){
  7476. audItem.ccUserid = zhoD[j].ccUserid
  7477. }
  7478. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7479. }
  7480. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7481. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7482. formData.append("reportTimeType", this.reportTimeType.type);
  7483. formData.append("endTime", zhoD[j].time[1]);
  7484. formData.append("startTime", zhoD[j].time[0]);
  7485. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7486. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7487. formData.append("isOvertime", 0)
  7488. formData.append("professionProgress", "[]")
  7489. if (zhoD[j].groupId) {
  7490. formData.append("groupId",zhoD[j].groupId)
  7491. } else {
  7492. //解决后台groupId数组越界的问题
  7493. formData.append("groupId",0)
  7494. }
  7495. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7496. formData.append("createDate",zhoD.zhoDataTime)
  7497. if (zhoD[j].projectAuditorId) {
  7498. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7499. }
  7500. if(zhoD[j].basecostId) {
  7501. formData.append("basecostId", zhoD[j].basecostId);
  7502. } else {
  7503. formData.append("basecostId", 0);
  7504. }
  7505. if(this.user.timeType.customDegreeActive){
  7506. if (this.user.timeType.customDegreeMultiple) {
  7507. if (zhoD[j].multiDegrIdArray) {
  7508. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7509. } else {
  7510. formData.append("multiDegrId", "[]");
  7511. }
  7512. } else {
  7513. if (zhoD[j].degreeId) {
  7514. formData.append('degreeId',zhoD[j].degreeId)
  7515. } else {
  7516. formData.append("degreeId", "-1");
  7517. }
  7518. }
  7519. }else{
  7520. formData.append("degreeId", "-1");
  7521. }
  7522. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7523. formData.append('customData',zhoD[j].customData)
  7524. }else if(this.user.timeType.customDataActive){
  7525. formData.append('customData',0)
  7526. }
  7527. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7528. formData.append('customText',zhoD[j].customText)
  7529. }else if(this.user.timeType.customTextActive){
  7530. formData.append('customText','-')
  7531. }
  7532. if(reportExtraField4Name || reportExtraField5Name) {
  7533. formData.append('extraField4', zhoD[j].extraField4 || '')
  7534. formData.append('extraField5', zhoD[j].extraField5 || '')
  7535. }
  7536. }
  7537. }
  7538. } else {
  7539. for(var k in this.selProjectList) {
  7540. var pItem = this.selProjectList[k];
  7541. var pName = pItem.projectName;
  7542. var j = pName;
  7543. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  7544. flgs = true
  7545. // formData.append("degreeId", "-1");
  7546. console.log('进入了workFpppp==='+j);
  7547. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7548. if (this.isSubstitude) {
  7549. formData.append('targetUids',this.workForm.userId[0]);
  7550. }
  7551. formData.append("projectId", pItem.id);
  7552. if(this.user.timeType.reportAuditType == 3){
  7553. let audItem = {}
  7554. if(this.user.timeType.auditLevel > 0){
  7555. audItem.auditorFirst = zhoD[j].auditorFirst
  7556. }
  7557. if(this.user.timeType.auditLevel > 1){
  7558. audItem.auditorSec = zhoD[j].auditorSec
  7559. }
  7560. if(this.user.timeType.auditLevel > 2){
  7561. audItem.auditorThird = zhoD[j].auditorThird
  7562. }
  7563. if(zhoD[j].ccUserid){
  7564. audItem.ccUserid = zhoD[j].ccUserid
  7565. }
  7566. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7567. }
  7568. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  7569. // formData.append("subProjectId", zhoD[j].subProjectId);
  7570. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7571. formData.append("reportTimeType", this.reportTimeType.type);
  7572. if(this.reportTimeType.type == 1) {
  7573. formData.append("workingTime", zhoD[j].workingTime);
  7574. } else if(this.reportTimeType.type == 2) {
  7575. formData.append("endTime", zhoD[j].time[1]);
  7576. formData.append("startTime", zhoD[j].time[0]);
  7577. } else if(this.reportTimeType.type == 3) {
  7578. formData.append("progress", zhoD[j].progress);
  7579. formData.append("workingTime", zhoD[j].workingTime);
  7580. }
  7581. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7582. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7583. formData.append("isOvertime", 0)
  7584. formData.append("professionProgress", "[]")
  7585. if (zhoD[j].groupId) {
  7586. formData.append("groupId",zhoD[j].groupId)
  7587. } else {
  7588. //解决后台groupId数组越界的问题
  7589. formData.append("groupId",0)
  7590. }
  7591. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7592. formData.append("createDate",zhoD.zhoDataTime)
  7593. if (zhoD[j].projectAuditorId) {
  7594. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7595. }
  7596. if(zhoD[j].basecostId) {
  7597. formData.append("basecostId", zhoD[j].basecostId);
  7598. } else {
  7599. formData.append("basecostId", 0);
  7600. }
  7601. if(this.user.timeType.customDegreeActive){
  7602. if (this.user.timeType.customDegreeMultiple) {
  7603. if (zhoD[j].multiDegrIdArray) {
  7604. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7605. } else {
  7606. formData.append("multiDegrId", "[]");
  7607. }
  7608. } else {
  7609. if (zhoD[j].degreeId) {
  7610. formData.append('degreeId',zhoD[j].degreeId)
  7611. } else {
  7612. formData.append("degreeId", "-1");
  7613. }
  7614. }
  7615. }else{
  7616. formData.append("degreeId", "-1");
  7617. }
  7618. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7619. formData.append('customData',zhoD[j].customData)
  7620. }else if(this.user.timeType.customDataActive){
  7621. formData.append('customData',0)
  7622. }
  7623. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7624. formData.append('customText',zhoD[j].customText)
  7625. }else if(this.user.timeType.customTextActive){
  7626. formData.append('customText','-')
  7627. }
  7628. if(reportExtraField4Name || reportExtraField5Name) {
  7629. formData.append('extraField4', zhoD[j].extraField4 || '')
  7630. formData.append('extraField5', zhoD[j].extraField5 || '')
  7631. }
  7632. }
  7633. }
  7634. }
  7635. }
  7636. }
  7637. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  7638. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  7639. if(!next) {
  7640. this.$message({
  7641. message: `【${error.join('、')}】` + this.$t('qingTianXieRenWuFenZu'),
  7642. type: 'error'
  7643. })
  7644. return
  7645. }
  7646. // 自定义维度
  7647. this.submitingReport = true;
  7648. this.http.uploadFile( this.port.report.editPort, formData,
  7649. res => {
  7650. // this.listLoading = false;
  7651. this.submitingReport = false;
  7652. if (res.code == "ok") {
  7653. this.$message({
  7654. message: this.$t('message.fillinsuccessfully'),
  7655. type: "success"
  7656. });
  7657. this.fillWeekDialogVisi = false
  7658. this.selConShow = true
  7659. this.zhoData = []
  7660. this.weekDateRange = ''
  7661. this.getReportList();
  7662. this.getDepartment();
  7663. // 关闭弹窗 并 清空
  7664. this.selProjectList = []
  7665. this.selCon = []
  7666. this.getRecentlyProject()
  7667. } else {
  7668. this.$message({
  7669. message: res.msg,
  7670. type: "error"
  7671. });
  7672. }
  7673. },
  7674. error => {
  7675. this.submitingReport = false;
  7676. this.$message({
  7677. message: error,
  7678. type: "error"
  7679. });
  7680. });
  7681. },
  7682. handleGroupAuditorData(data) {
  7683. const { reportAuditType } = this.user.timeType
  7684. if(reportAuditType != 1 && reportAuditType != 2) {
  7685. return {next: true}
  7686. }
  7687. let arrList = [];
  7688. Object.entries(data).forEach(([key, obj]) => {
  7689. Object.entries(obj).forEach(([projectName, projectData]) => {
  7690. if (projectData.workingTime && !projectData.groupId) {
  7691. arrList.push({
  7692. projectName,
  7693. date: obj.zhoDataTime,
  7694. dateText: obj.zhoDataTimeTxt
  7695. });
  7696. }
  7697. });
  7698. });
  7699. if(arrList.length > 0) {
  7700. return {
  7701. next: false,
  7702. error: arrList.map(item => `【${item.date} ${item.dateText} `+ this.$t('zhongDe')+ `(${item.projectName})` + this.$t('other.project')+ `】`),
  7703. }
  7704. } else {
  7705. return {
  7706. next: true,
  7707. error: [],
  7708. }
  7709. }
  7710. },
  7711. ChangeHourMinutestr (str) {
  7712. if (str !== "0" && str !== "" && str !== null) {
  7713. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  7714. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  7715. } else {
  7716. return "";
  7717. }
  7718. },
  7719. // 得到两个日期中间的日期
  7720. getdiffdate(stime,etime){
  7721. //初始化日期列表,数组
  7722. var diffdate = new Array();
  7723. var i=0;
  7724. //开始日期小于等于结束日期,并循环
  7725. while(stime<=etime){
  7726. diffdate[i] = stime;
  7727. //获取开始日期时间戳
  7728. var stime_ts = new Date(stime).getTime();
  7729. //增加一天时间戳后的日期
  7730. var next_date = stime_ts + (24*60*60*1000);
  7731. //拼接年月日,这里的月份会返回(0-11),所以要+1
  7732. var next_dates_y = new Date(next_date).getFullYear()+'-';
  7733. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  7734. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  7735. stime = next_dates_y+next_dates_m+next_dates_d;
  7736. //增加数组key
  7737. i++;
  7738. }
  7739. return diffdate;
  7740. },
  7741. // 添加模块
  7742. addDomain(i) {
  7743. var leftProgress = 10;
  7744. if (this.reportTimeType.type == 3) {
  7745. //计算已经待分配工时比例
  7746. let array = this.workForm.domains;
  7747. let totalProgress = 0;
  7748. for (var i=0;i<array.length; i++) {
  7749. totalProgress += array[i].progress;
  7750. }
  7751. if (totalProgress < 100) {
  7752. leftProgress = 100 - totalProgress;
  7753. }
  7754. }
  7755. var addItem = {
  7756. projectId: "",
  7757. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  7758. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  7759. ),
  7760. content: "",
  7761. progress:leftProgress,
  7762. state:2,//2-表示待提交
  7763. multiWorktime: this.reportTimeType.multiWorktime,
  7764. worktimeList:[{}],
  7765. canEdit: true,
  7766. auditorFirst: '',
  7767. auditorSec: '',
  7768. auditorThird: '',
  7769. ccUserid: ''
  7770. // degreeId: '',
  7771. };
  7772. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  7773. this.$set(addItem,'isOvertime',true)
  7774. if(this.reportTimeType.type == 3){
  7775. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  7776. }
  7777. }
  7778. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  7779. //默认给第一个,必填字段
  7780. addItem.basecostId = this.timeBasecostList[0].id;
  7781. }
  7782. this.workForm.domains.push(addItem);
  7783. document.getElementById('workFormsItemBottom').scrollIntoView()
  7784. this.canEdit = true
  7785. if (this.reportTimeType.type == 0) {
  7786. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  7787. var length = this.workForm.domains.length;
  7788. if (length == 2) {
  7789. this.showAddMore = false;
  7790. }
  7791. }
  7792. this.chuji()
  7793. this.seleChn()
  7794. },
  7795. // 移除模块
  7796. delDomain(i) {
  7797. this.workForm.domains.splice(i,1)
  7798. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  7799. if (!this.originCanEdit) {
  7800. let iscan = false
  7801. for(let i in this.workForm.domains){
  7802. if(this.workForm.domains[i].canEdit){
  7803. iscan = true
  7804. }
  7805. }
  7806. this.canEdit = iscan
  7807. }
  7808. //检测当前剩下的一个,时间类型是否是全天
  7809. if (this.reportTimeType.type == 0) {
  7810. if (this.workForm.domains[0].timeType == 0) {
  7811. this.showAddMore = false;
  7812. } else {
  7813. this.showAddMore = true;
  7814. }
  7815. }
  7816. if(this.user.timeType.multiWorktime == 1) {
  7817. this.iptChangs()
  7818. } else {
  7819. this.seleChn(0)
  7820. }
  7821. },
  7822. // 改变月份
  7823. changeMonth() {
  7824. this.isWeekend = false
  7825. let date = new Date()
  7826. let nowmon = date.getMonth() + 1
  7827. let nowday = date.getDate()
  7828. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  7829. if (this.isBatch == 0) {
  7830. if(this.user.timeType.fillAhead == 0){
  7831. let date_a = new Date(this.workForm.createDate)
  7832. if(date_a.getTime() > date.getTime()){
  7833. this.workForm.createDate = nowdate
  7834. }
  7835. }
  7836. //只有按天填报才能获取当天的日报
  7837. if(!this.isSubstitude){
  7838. let weekday = new Date(this.workForm.createDate).getDay()
  7839. if(this.user.companyId == 817){
  7840. if(weekday == 0){
  7841. this.isWeekend = true
  7842. }
  7843. }else{
  7844. if(weekday == 0 || weekday == 6){
  7845. this.isWeekend = true
  7846. }
  7847. }
  7848. this.getReport()
  7849. } else {
  7850. //获取代填人员的考勤
  7851. if (this.user.timeType.showCorpwxCardtime == 1) {
  7852. this.getTargetUserCardTime();
  7853. }
  7854. }
  7855. }else {
  7856. if(this.user.timeType.fillAhead == 0){
  7857. let date_a = new Date(this.workForm.createDate[1])
  7858. if(date_a.getTime() > date.getTime()){
  7859. this.workForm.createDate[1] = nowdate
  7860. let sdate = new Date(this.workForm.createDate[0])
  7861. let edate = new Date(this.workForm.createDate[1])
  7862. if(sdate > edate){
  7863. this.workForm.createDate[0] = this.workForm.createDate[1]
  7864. }
  7865. }
  7866. }
  7867. }
  7868. },
  7869. // 判断时间段
  7870. fns() {
  7871. for (let k in this.dateAr) {
  7872. if (!this.judege(k)) {
  7873. return false
  7874. }
  7875. }
  7876. return true
  7877. },
  7878. judege(idx){
  7879. for (let k in this.dateAr) {
  7880. if (idx !== k) {
  7881. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  7882. return false
  7883. }
  7884. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  7885. return false
  7886. }
  7887. }
  7888. }
  7889. return true
  7890. },
  7891. getOverlapData(data) {
  7892. let overlapData = [];
  7893. for (let i = 0; i < data.length; i++) {
  7894. for (let j = i + 1; j < data.length; j++) {
  7895. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  7896. overlapData.push(data[i], data[j]);
  7897. }
  7898. }
  7899. }
  7900. return overlapData;
  7901. },
  7902. // 保存日报111111
  7903. submitReport(isDraft) {
  7904. this.isDraft = isDraft;
  7905. this.$refs.workForm.validate(valid => {
  7906. if (valid) {
  7907. if (!isDraft) {
  7908. //针对苏州景昱,单独的检查逻辑
  7909. if (this.user.companyId == 5978) {
  7910. //调接口,先检查工时是否存在异常
  7911. var totalTime = 0;
  7912. for (var t=0;t<this.workForm.domains.length; t++) {
  7913. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7914. }
  7915. var array = [];
  7916. if (this.isBatch) {
  7917. var startDate = new Date(this.workForm.createDate[0]);
  7918. var endDate = new Date(this.workForm.createDate[1]);
  7919. if (startDate > endDate) {
  7920. this.$message({
  7921. message: this.$t('kaiShiRiQiBuNengDaYuJieShuRiQi'),
  7922. type: "error"
  7923. });
  7924. return
  7925. } else {
  7926. while(true){
  7927. var workData = {date: util.formatDate.format(startDate, "yyyy-MM-dd"), workingTime: totalTime};
  7928. array.push(workData);
  7929. startDate.setDate(startDate.getDate() + 1);
  7930. if (startDate > endDate) {
  7931. break;
  7932. }
  7933. }
  7934. }
  7935. } else {
  7936. var workData = {date: this.workForm.createDate, workingTime: totalTime};
  7937. array.push(workData)
  7938. }
  7939. this.submitingReport = true;
  7940. var passUserId = this.user.id;
  7941. if (this.isSubstitude) {
  7942. passUserId = this.targetUids;
  7943. }
  7944. this.http.post('/report/checkBeiSengCardTime', {userId:passUserId, dateWorkingTime:JSON.stringify(array)},
  7945. res => {
  7946. this.submitingReport = false;
  7947. if (res.code == "ok") {
  7948. this.submitReportSon()
  7949. } else {
  7950. this.$confirm(res.msg, this.$t('other.prompts'), {
  7951. confirmButtonText: this.$t('huLveBingTiJiao'),
  7952. cancelButtonText: this.$t('btn.cancel'),
  7953. type: 'error'
  7954. }).then(() => {
  7955. this.submitReportSon()
  7956. }).catch(() => {
  7957. });
  7958. }
  7959. },
  7960. error => {
  7961. this.$message({
  7962. message: error,
  7963. type: "error"
  7964. });
  7965. });
  7966. } else if (this.user.companyId == 469) {
  7967. //试点,针对赛元微电子校验考勤工时
  7968. if (this.workForm.time && this.workForm.time.workHours) {
  7969. if (this.totalReportHours > this.workForm.time.workHours) {
  7970. this.$message({
  7971. message: '填报工时不得超过考勤时长',
  7972. type: "error"
  7973. });
  7974. } else if (this.totalReportHours < this.workForm.time.workHours) {
  7975. this.$confirm('还剩余'+(this.workForm.time.workHours-this.totalReportHours).toFixed(1)+'h考勤时长尚未分配,是否确定提交', this.$t('other.prompts'), {
  7976. confirmButtonText: this.$t('btn.determine'),
  7977. cancelButtonText: this.$t('btn.cancel'),
  7978. type: 'warning'
  7979. }).then(() => {
  7980. this.submitReportSon()
  7981. }).catch(() => {
  7982. });
  7983. } else {
  7984. this.submitReportSon();
  7985. }
  7986. } else {
  7987. this.$message({
  7988. message: '暂无考勤数据,无法填报。请尝试刷新考勤记录。',
  7989. type: "error"
  7990. });
  7991. }
  7992. } else {
  7993. if(this.totalReportHours < this.user.timeType.allday){
  7994. this.$confirm(this.$t('dangRiGongShiBuZu') + this.user.timeType.allday.toFixed(1) + this.$t('xiaoShiShiFouQueDingTiJiao'), this.$t('other.prompts'), {
  7995. confirmButtonText: this.$t('btn.determine'),
  7996. cancelButtonText: this.$t('btn.cancel'),
  7997. type: 'warning'
  7998. }).then(() => {
  7999. this.submitReportSon()
  8000. }).catch(() => {
  8001. });
  8002. }else{
  8003. this.submitReportSon()
  8004. }
  8005. }
  8006. } else {
  8007. //暂存,不需要检查工时是否超过考勤
  8008. this.submitReportSon()
  8009. }
  8010. }
  8011. });
  8012. },
  8013. submitReportSon() {
  8014. this.dateAr = []
  8015. //检查重叠
  8016. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  8017. let alp = []
  8018. if(this.user.timeType.multiWorktime != 1) {
  8019. for(var p in this.workForm.domains) {
  8020. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  8021. let objs = {}
  8022. objs.s = this.workForm.domains[p].startTime
  8023. objs.e = this.workForm.domains[p].endTime
  8024. alp.push(objs)
  8025. }
  8026. }
  8027. this.dateAr = alp
  8028. if(this.dateAr.length > 0) {
  8029. let trus = this.fns()
  8030. if(!trus) {
  8031. this.$message({
  8032. message: this.$t('message.Filledtimeperiodsoverlap'),
  8033. type: "error"
  8034. });
  8035. return
  8036. }
  8037. }
  8038. } else {
  8039. for(var p in this.workForm.domains) {
  8040. var slll = this.workForm.domains[p]
  8041. for(var o in slll.worktimeList) {
  8042. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  8043. let objs = {}
  8044. objs.s = slll.worktimeList[o].startTime
  8045. objs.e = slll.worktimeList[o].endTime
  8046. alp.push(objs)
  8047. }
  8048. }
  8049. }
  8050. this.dateAr = alp
  8051. if(this.dateAr.length > 0) {
  8052. let trus = this.fns()
  8053. if(!trus) {
  8054. this.$message({
  8055. message: this.$t('message.Filledtimeperiodsoverlap'),
  8056. type: "error"
  8057. });
  8058. return
  8059. }
  8060. }
  8061. }
  8062. }
  8063. //检查子项目
  8064. if (this.user.timeType.subProMustFill == 1) {
  8065. for(var p in this.workForm.domains) {
  8066. var oneProItem = this.workForm.domains[p]
  8067. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  8068. //没有选择子项目
  8069. this.$message({
  8070. message: this.$t('ziXiangMuBiTianQingJianCha'),
  8071. type: "error"
  8072. });
  8073. return
  8074. }
  8075. }
  8076. }
  8077. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  8078. if (this.user.companyId == this.yuzhongCompId) {
  8079. for(var p in this.workForm.domains) {
  8080. var oneProItem = this.workForm.domains[p]
  8081. if (!oneProItem.extraField1) {
  8082. this.$message({
  8083. message: this.$t('jiaoSeBiTianQingJianCha'),
  8084. type: "error"
  8085. });
  8086. return
  8087. }
  8088. if (!oneProItem.extraField2) {
  8089. this.$message({
  8090. message: this.$t('gongZuoZhiZeBiTianQingJianCha'),
  8091. type: "error"
  8092. });
  8093. return
  8094. }
  8095. if (!oneProItem.extraField3) {
  8096. this.$message({
  8097. message: this.$t('gongZuoNeiRongBiTianQingJianCha'),
  8098. type: "error"
  8099. });
  8100. return
  8101. }
  8102. }
  8103. }
  8104. // return
  8105. //代填的情况,检查人员是否已经选择
  8106. if (this.isSubstitude) {
  8107. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  8108. this.$message({
  8109. message: this.$t('message.pleaseselectthepersontofillin'),
  8110. type: "error"
  8111. });
  8112. return;
  8113. }
  8114. }
  8115. //检查时间,全天和上下午不能同时存在
  8116. if (this.reportTimeType.type == 0) {
  8117. var alldayNum = 0;
  8118. var amNum = 0;
  8119. var pmNum = 0;
  8120. for(var i in this.workForm.domains) {
  8121. if (this.workForm.domains[i].timeType == 0) {
  8122. alldayNum ++;
  8123. } else if (this.workForm.domains[i].timeType == 1) {
  8124. amNum++;
  8125. } else if (this.workForm.domains[i].timeType == 2) {
  8126. pmNum++;
  8127. }
  8128. }
  8129. if (alldayNum > 1) {
  8130. this.$message({
  8131. // message: "工作时间-全天,只能选择一次",
  8132. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  8133. type: "error"
  8134. });
  8135. return;
  8136. }
  8137. if (amNum > 1) {
  8138. this.$message({
  8139. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  8140. type: "error"
  8141. });
  8142. return;
  8143. }
  8144. if (pmNum > 1) {
  8145. this.$message({
  8146. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  8147. type: "error"
  8148. });
  8149. return;
  8150. }
  8151. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  8152. this.$message({
  8153. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  8154. type: "error"
  8155. });
  8156. return;
  8157. }
  8158. } else if (this.reportTimeType.type == 3) {
  8159. //总百分比不能超过100%
  8160. let total = 0;
  8161. this.workForm.domains.forEach(w=>{total += w.progress});
  8162. if (total > 100) {
  8163. this.$message({
  8164. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  8165. type: "error"
  8166. });
  8167. return;
  8168. } else if (total < 100) {
  8169. this.$message({
  8170. message: this.$t('message.cannotbesubmitted'),
  8171. type: "error"
  8172. });
  8173. return;
  8174. }
  8175. }
  8176. this.listLoading = true;
  8177. let formData = new FormData();
  8178. formData.append("draft", this.isDraft);
  8179. var totalTime = 0;
  8180. for (var t=0;t<this.workForm.domains.length; t++) {
  8181. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  8182. }
  8183. //批量填报不校验考勤时长,交给后台校验
  8184. if (!this.isBatch) {
  8185. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  8186. if (this.workForm.time){
  8187. if (this.workForm.time.workHours == 0){
  8188. this.$message({
  8189. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  8190. type: 'error'
  8191. })
  8192. return
  8193. }
  8194. }else{
  8195. this.$message({
  8196. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  8197. type: 'error'
  8198. })
  8199. return
  8200. }
  8201. }
  8202. }
  8203. //针对凡己和景昱,苏州博海,此处不校验考勤时长
  8204. if (this.user.companyId != 3918 && this.user.companyId != 5978 && this.user.companyId != 4281 && this.reportTimeType.type == 1 && this.workForm.time) {
  8205. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  8206. this.$message({
  8207. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  8208. type: "error"
  8209. });
  8210. return;
  8211. }
  8212. }
  8213. for(var i in this.workForm.domains) {
  8214. // 检查任务/里程碑是否为必填
  8215. let taskRequired = this.user.timeType.taskRequired
  8216. if(taskRequired == 1) {
  8217. if(!this.workForm.domains[i].taskId) {
  8218. this.$message({
  8219. message: `【${this.workForm.domains[i].projectName}】`+this.$t('qingXuanZeRenWuLiChengBei'),
  8220. type: "error"
  8221. });
  8222. return
  8223. }
  8224. }
  8225. if(this.user.timeType.reportAuditType == 3){
  8226. let audItem = {}
  8227. let auditRule = ''
  8228. if(this.workForm.domains[i].id){
  8229. audItem.reportId = this.workForm.domains[i].id
  8230. }
  8231. if(this.user.timeType.auditLevel > 0){
  8232. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  8233. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  8234. }
  8235. if(this.user.timeType.auditLevel > 1){
  8236. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  8237. audItem.auditorSec = this.workForm.domains[i].auditorSec
  8238. }
  8239. if(this.user.timeType.auditLevel > 2){
  8240. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  8241. audItem.auditorThird = this.workForm.domains[i].auditorThird
  8242. }
  8243. if(this.workForm.domains[i].ccUserid){
  8244. audItem.ccUserid = this.workForm.domains[i].ccUserid
  8245. }
  8246. if(auditRule){
  8247. auditRule = auditRule.substring(0,auditRule.length - 1)
  8248. this.$message({
  8249. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  8250. type: 'error'
  8251. })
  8252. return
  8253. }
  8254. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  8255. }
  8256. if (this.user.timeType.customDegreeActive) {
  8257. if (this.user.timeType.customDegreeMultiple) {
  8258. //多选
  8259. if (this.workForm.domains[i].multiDegrIdArray) {
  8260. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  8261. degreeArray = degreeArray.replace(/,/g,"@");
  8262. formData.append("multiDegrId", degreeArray);
  8263. } else {
  8264. formData.append("multiDegrId", '[]');
  8265. }
  8266. } else {
  8267. //单选
  8268. if (this.workForm.domains[i].degreeId) {
  8269. formData.append("degreeId", this.workForm.domains[i].degreeId);
  8270. } else {
  8271. formData.append("degreeId", -1);
  8272. }
  8273. }
  8274. } else {
  8275. formData.append("degreeId", -1);
  8276. }
  8277. if(this.workForm.domains[i].customData) {
  8278. // var sss = this.workForm.domains[i].degreeId.toString()
  8279. formData.append("customData", this.workForm.domains[i].customData);
  8280. } else {
  8281. formData.append("customData", 0);
  8282. }
  8283. if(this.workForm.domains[i].customText) {
  8284. formData.append("customText", this.workForm.domains[i].customText);
  8285. } else {
  8286. formData.append("customText", '-');
  8287. }
  8288. if (this.workForm.domains[i].id) {
  8289. formData.append("id", this.workForm.domains[i].id);
  8290. } else {
  8291. formData.append("id", -1);
  8292. }
  8293. formData.append("projectId", this.workForm.domains[i].projectId);
  8294. if (this.workForm.domains[i].subProjectId) {
  8295. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  8296. } else {
  8297. formData.append("subProjectId", 0);
  8298. }
  8299. if (this.workForm.domains[i].groupId) {
  8300. formData.append("groupId", this.workForm.domains[i].groupId);
  8301. } else {
  8302. formData.append("groupId", 0);
  8303. }
  8304. if (this.workForm.domains[i].taskId) {
  8305. formData.append("taskId", this.workForm.domains[i].taskId);
  8306. } else {
  8307. formData.append("taskId", 0);
  8308. }
  8309. if (this.workForm.domains[i].taskFinish == true) {
  8310. formData.append("taskFinish", 1);
  8311. } else {
  8312. formData.append("taskFinish", 0);
  8313. }
  8314. formData.append("reportTimeType", this.reportTimeType.type);
  8315. if (this.reportTimeType.type == 0) {
  8316. formData.append("timeType", this.workForm.domains[i].timeType);
  8317. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  8318. formData.append("workingTime", workingTime);
  8319. } else if (this.reportTimeType.type == 1){
  8320. formData.append("workingTime", this.workForm.domains[i].workingTime);
  8321. } else if (this.reportTimeType.type == 2) {
  8322. formData.append("endTime", this.workForm.domains[i].endTime);
  8323. formData.append("startTime", this.workForm.domains[i].startTime);
  8324. } else if (this.reportTimeType.type == 3) {
  8325. //按比例分配
  8326. formData.append("progress", this.workForm.domains[i].progress);
  8327. formData.append("workingTime", this.workForm.domains[i].workingTime);
  8328. }
  8329. if(this.user.timeType.choseFromAlbum == 1 ) {
  8330. console.log(this.workForm.domains[i].imgList)
  8331. if(this.workForm.domains[i].imgList) {
  8332. let imgListFor = this.workForm.domains[i].imgList
  8333. for(var b in imgListFor) {
  8334. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  8335. }
  8336. console.log(imgListFor)
  8337. let m = JSON.stringify(imgListFor);
  8338. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8339. formData.append("picStr", m);
  8340. } else {
  8341. formData.append("picStr", '[]');
  8342. }
  8343. }
  8344. //处理多个时间事项
  8345. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  8346. if (this.reportTimeType.multiWorktime == 1) {
  8347. //检查时间是否有重叠
  8348. var workList = this.workForm.domains[i].worktimeList;
  8349. for (var j=0;j<workList.length; j++) {
  8350. var curItem = workList[j];
  8351. //检查开始时间是否大于结束时间
  8352. if (curItem.startTime >= curItem.endTime) {
  8353. this.$message({
  8354. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  8355. this.$t('message.Endtimemustbegreaterthanstarttime'),
  8356. type: "error"
  8357. });
  8358. return;
  8359. }
  8360. //时间不可重叠
  8361. if (this.reportTimeType.timeCanOverlap == 0) {
  8362. for (var p = j+1;p<workList.length; p++) {
  8363. var jItem = workList[p];
  8364. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  8365. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  8366. this.$message({
  8367. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  8368. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  8369. type: "error"
  8370. });
  8371. return;
  8372. }
  8373. }
  8374. }
  8375. }
  8376. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  8377. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8378. formData.append("content", m);
  8379. } else {
  8380. if (this.workForm.domains[i].content) {
  8381. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  8382. m = m.replace(/,/g,",");
  8383. console.log(m, '需要传值的数据')
  8384. // formData.append("content", this.workForm.domains[i].content);
  8385. formData.append("content", m);
  8386. } else {
  8387. formData.append("content", '-');
  8388. }
  8389. }
  8390. if (this.isBatch == 0) {
  8391. formData.append("createDate", this.workForm.createDate);
  8392. } else {
  8393. //批量填报,时间范围
  8394. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  8395. }
  8396. if(this.workForm.domains[i].isOvertime) {
  8397. formData.append("isOvertime", 1);
  8398. } else {
  8399. formData.append("isOvertime", 0);
  8400. }
  8401. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  8402. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  8403. } else {
  8404. formData.append("overtimeHours", 0);
  8405. }
  8406. if(this.workForm.domains[i].basecostId) {
  8407. formData.append("basecostId", this.workForm.domains[i].basecostId);
  8408. } else {
  8409. formData.append("basecostId", 0);
  8410. }
  8411. if (this.workForm.userId != null) {
  8412. var targetUids = '';
  8413. this.workForm.userId.forEach(u=>{
  8414. targetUids += u + '@';
  8415. });
  8416. if (targetUids.length > 0) {
  8417. targetUids = targetUids.substring(0, targetUids.length -1);
  8418. formData.append("targetUids", targetUids);
  8419. }
  8420. }
  8421. //项目专业进度
  8422. if (this.workForm.domains[i].professionProgress) {
  8423. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  8424. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8425. formData.append("professionProgress", m);
  8426. } else {
  8427. formData.append("professionProgress", "[]");
  8428. }
  8429. if (this.workForm.domains[i].stage) {
  8430. formData.append("stage", this.workForm.domains[i].stage);
  8431. } else {
  8432. formData.append("stage", "-");
  8433. }
  8434. if (this.workForm.domains[i].projectAuditorId) {
  8435. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  8436. } else {
  8437. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  8438. this.$message({
  8439. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  8440. type: "error"
  8441. });
  8442. return;
  8443. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 || this.user.timeType.reportAuditType == 9){
  8444. //分组负责人先审核, 确定是选择了任务分组
  8445. if (this.workForm.domains[i].taskGroups.length == 0) {
  8446. this.$message({
  8447. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  8448. type: "error"
  8449. });
  8450. return;
  8451. } else if (!this.workForm.domains[i].groupId) {
  8452. // console.log(this.workForm.domains[i]);
  8453. this.$message({
  8454. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  8455. type: "error"
  8456. });
  8457. return;
  8458. }
  8459. }
  8460. }
  8461. if (this.user.companyId == this.yuzhongCompId) {
  8462. formData.append('extraField1', this.workForm.domains[i].extraField1);
  8463. formData.append('extraField2', this.workForm.domains[i].extraField2);
  8464. formData.append('extraField3', this.workForm.domains[i].extraField3);
  8465. }
  8466. //依斯贝的服务Id
  8467. if (this.user.companyId == this.yisibeiCompId) {
  8468. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  8469. }
  8470. if(this.user.timeType.taskGroupRequired == 1 && !this.workForm.domains[i].groupId) {
  8471. this.$message({
  8472. message: this.$t('defaultText.pleaseChoose') + `【${this.workForm.domains[i].projectName}】`+ this.$t('xiangMuXiaDeRenWuFenZu'),
  8473. type: "error"
  8474. });
  8475. return
  8476. }
  8477. if(this.user.timeType.userWithMultiDept == 1) {
  8478. formData.append('reportTargetDeptId', this.workForm.domains[i].reportTargetDeptId||-1);
  8479. }
  8480. if(this.user.timeType.reportExtraField4Name) {
  8481. formData.append('extraField4', this.workForm.domains[i].extraField4 || '');
  8482. }
  8483. if(this.user.timeType.reportExtraField5Name) {
  8484. formData.append('extraField5', this.workForm.domains[i].extraField5 || '');
  8485. }
  8486. }
  8487. this.submitingReport = true;
  8488. this.http.uploadFile( this.port.report.editPort, formData,
  8489. res => {
  8490. this.listLoading = false;
  8491. this.submitingReport = false;
  8492. if (res.code == "ok") {
  8493. if(res.msg!=null){
  8494. this.$message({
  8495. dangerouslyUseHTMLString: true,
  8496. message: res.msg,
  8497. type: "warning",
  8498. showClose: true,
  8499. duration: 0
  8500. });
  8501. }else{
  8502. this.$message({
  8503. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  8504. type: "success"
  8505. });
  8506. }
  8507. this.dialogVisible = false;
  8508. this.jsDay = 0
  8509. this.jsTime = 0
  8510. this.getReportList();
  8511. this.getDepartment();
  8512. this.getRecentlyProject()
  8513. } else {
  8514. this.$message({
  8515. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  8516. type: "error"
  8517. });
  8518. }
  8519. },
  8520. error => {
  8521. this.listLoading = false;
  8522. this.submitingReport = false;
  8523. this.$message({
  8524. message: error,
  8525. type: "error"
  8526. });
  8527. });
  8528. },
  8529. // 判断是展示那个工时导入
  8530. imports() {
  8531. if(this.user.timeType.syncCorpwxTime == 0) {
  8532. this.importDialog = true
  8533. } else {
  8534. this.importWxDialog = true
  8535. }
  8536. },
  8537. // 跳转
  8538. junpToDeskTop(id) {
  8539. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8540. this.$router.push("/desktop/" + id + "/" + this.date +day);
  8541. },
  8542. // 通过日报
  8543. approve(id, item) {
  8544. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8545. this.approveinData = {
  8546. id: id,
  8547. date: this.date +day,
  8548. reportIds: item.id
  8549. }
  8550. if(this.user.timeType.needEvaluate == 1){
  8551. this.$set(this.approveinData,'evaluate','')
  8552. this.approveinDialog = true
  8553. }else{
  8554. this.logining = true;
  8555. this.approveinfun()
  8556. }
  8557. },
  8558. approveinfun(){
  8559. this.http.post( this.port.report.approve, this.approveinData,
  8560. res => {
  8561. this.logining = false;
  8562. if (res.code == "ok") {
  8563. this.approveinDialog = false
  8564. this.$message({
  8565. message: this.$t('message.Reviewsucceeded'),
  8566. type: "success"
  8567. });
  8568. this.refreshReportData(this.approveinData.reportIds);
  8569. this.getDepartment();
  8570. } else {
  8571. this.$message({
  8572. message: res.msg,
  8573. type: "error"
  8574. });
  8575. }
  8576. },
  8577. error => {
  8578. this.logining = false;
  8579. this.$message({
  8580. message: error,
  8581. type: "error"
  8582. });
  8583. });
  8584. },
  8585. //撤回日报
  8586. cancel(item,e) {
  8587. // console.log('can can need',item);
  8588. this.logining = true;
  8589. var ids = '';
  8590. var data = e ? item : item.data;
  8591. data.forEach(element => {
  8592. if(element.id){
  8593. ids +=(element.id+',');
  8594. }
  8595. });
  8596. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  8597. res => {
  8598. this.logining = false;
  8599. if (res.code == "ok") {
  8600. this.$message({
  8601. message:this.$t('message.Withdrawalsucceeded'),
  8602. type: "success"
  8603. });
  8604. this.getReportList();
  8605. if(e){this.getReport()}
  8606. this.getDepartment();
  8607. } else {
  8608. this.$message({
  8609. message: res.msg,
  8610. type: "error"
  8611. });
  8612. }
  8613. },
  8614. error => {
  8615. this.logining = false;
  8616. this.$message({
  8617. message: error,
  8618. type: "error"
  8619. });
  8620. });
  8621. },
  8622. showDenyDialog(id,i, item) {
  8623. this.denyReasonDialog = true;
  8624. this.isDenying = false;
  8625. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8626. var ids = item.id;
  8627. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  8628. },
  8629. // 未通过日报
  8630. deny() {
  8631. this.logining = true;
  8632. this.isDenying = true;
  8633. this.http.post( this.port.report.deny, this.denyForm,
  8634. res => {
  8635. this.logining = false;
  8636. this.isDenying = false;
  8637. if (res.code == "ok") {
  8638. this.$message({
  8639. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  8640. type: "success"
  8641. });
  8642. this.refreshReportData(this.denyForm.reportIds);
  8643. this.getDepartment();
  8644. this.denyReasonDialog = false;
  8645. } else {
  8646. this.$message({
  8647. message: res.msg,
  8648. type: "error"
  8649. });
  8650. }
  8651. },
  8652. error => {
  8653. this.logining = false;
  8654. this.$message({
  8655. message: error,
  8656. type: "error"
  8657. });
  8658. });
  8659. },
  8660. // 查看工时记录弹窗
  8661. toView() {
  8662. this.toViewDialogVisible = true
  8663. this.toViewloading = true
  8664. this.getToView()
  8665. },
  8666. getToView() {
  8667. this.http.post( '/report-import-log/getList', this.toViewForm,
  8668. res => {
  8669. this.toViewloading = false;
  8670. if (res.code == "ok") {
  8671. // console.log(res.data, '数据数据')
  8672. this.toViewList = res.data.records
  8673. this.toViewForm.total = res.data.total
  8674. } else {
  8675. this.toViewloading = false;
  8676. this.$message({
  8677. message: res.msg,
  8678. type: "error"
  8679. });
  8680. }
  8681. })
  8682. },
  8683. // 触发 selectCat 组件更改他的值
  8684. selectCatCli(obj) {
  8685. // console.log(obj, '看看')
  8686. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  8687. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  8688. },
  8689. vueCasader(obj) {
  8690. if(obj.distinction == 1 && obj.item) {
  8691. let arr = []
  8692. arr.push(obj.item.value)
  8693. this.exportParam.departmentId = arr
  8694. }
  8695. if(obj.distinction == '10' && obj) {
  8696. const { id, other } = obj
  8697. this.workForm.domains[other].reportTargetDeptId = id
  8698. }
  8699. if(obj.distinction == '14' && obj) {
  8700. let arr = []
  8701. arr.push(obj.id)
  8702. this.deptIdForHasReport = arr
  8703. this.showMonthWorkTime()
  8704. }
  8705. if(obj.distinction == '15' && obj) {
  8706. let arr = []
  8707. arr.push(obj.id)
  8708. this.deptIdForNoReport = arr
  8709. this.showMonthNotWorkTime()
  8710. }
  8711. if(obj.distinction == '16' && obj) {
  8712. let arr = []
  8713. arr.push(obj.id)
  8714. this.deptIdForReminder = arr
  8715. this.showMonthWorkTimeReminder()
  8716. }
  8717. if(obj.distinction == '17' && obj) {
  8718. let arr = []
  8719. arr.push(obj.id)
  8720. this.deptIdForHasReport = arr
  8721. this.showReportTimeLessThanCardTimeList();
  8722. }
  8723. },
  8724. //分页
  8725. handleCurrentChange(val) {
  8726. this.toViewForm.pageIndex = val;
  8727. this.getToView();
  8728. },
  8729. handleSizeChange(val) {
  8730. this.toViewForm.pageSize = val;
  8731. this.getToView();
  8732. },
  8733. getAllUsersList(){
  8734. this.http.post('/user/getSimpleActiveUserList',{
  8735. },res => {
  8736. if(res.code == 'ok'){
  8737. this.allUsersList = res.data
  8738. }else{
  8739. this.$message({
  8740. message: res.msg,
  8741. type: 'error'
  8742. })
  8743. }
  8744. },err => {
  8745. this.$message({
  8746. message: err,
  8747. type: 'error'
  8748. })
  8749. })
  8750. },
  8751. //景昱变更提醒
  8752. changeReminder(item){
  8753. let parameter={
  8754. startDate: this.WorktimeDatepickValue[0],
  8755. endDate: this.WorktimeDatepickValue[1],
  8756. }
  8757. if(item){
  8758. parameter.createDate=item.createDate,
  8759. parameter.userId=item.userId
  8760. }
  8761. this.remindering = true;
  8762. this.http.post('/report/changeReminder',parameter,res => {
  8763. this.remindering = false;
  8764. if(res.code == 'ok'){
  8765. this.$message({
  8766. message: res.msg,
  8767. type: 'success'
  8768. })
  8769. }else{
  8770. this.$message({
  8771. message: res.msg,
  8772. type: 'error'
  8773. })
  8774. }
  8775. },err => {
  8776. this.$message({
  8777. message: err,
  8778. type: 'error'
  8779. })
  8780. })
  8781. },
  8782. //景昱取消异常
  8783. cancelReminder(item){
  8784. let parameter={}
  8785. if(item){
  8786. parameter.createDate=item.createDate,
  8787. parameter.userId=item.userId
  8788. }
  8789. this.http.post('/report/cancelReminder',parameter,res => {
  8790. if(res.code == 'ok'){
  8791. this.$message({
  8792. message: res.msg,
  8793. type: 'success'
  8794. })
  8795. }else{
  8796. this.$message({
  8797. message: res.msg,
  8798. type: 'error'
  8799. })
  8800. }
  8801. },err => {
  8802. this.$message({
  8803. message: err,
  8804. type: 'error'
  8805. })
  8806. })
  8807. this.showMonthWorkTimeReminder()
  8808. },
  8809. // 重庆物奇私人定制的按周填报弹窗关闭事件
  8810. fillWeekCustomClne() {
  8811. this.fillWeekDialogVisiCustom = false
  8812. },
  8813. fillWeekCustomClneTwo() {
  8814. this.fillWeekDialogVisiCustomTwo = false
  8815. },
  8816. fillWeekCustomSubmit() {
  8817. this.getReportList();
  8818. this.getDepartment();
  8819. this.getRecentlyProject()
  8820. },
  8821. // 待填日报姓名搜索
  8822. nameAearchSeek(flg) {
  8823. if(!this.nameAearch) {
  8824. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8825. return
  8826. }
  8827. if(flg) {
  8828. this.enterpriseWechatgetUser()
  8829. }
  8830. },
  8831. handleThreeData(userList) {
  8832. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8833. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  8834. },
  8835. // 过滤树节点
  8836. filterTreeNodes(treeData, filterKeywords) {
  8837. return treeData.filter((node) => {
  8838. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  8839. if (node.children && node.children.length > 0) {
  8840. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8841. }
  8842. return true;
  8843. }
  8844. if (node.children && node.children.length > 0) {
  8845. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8846. return node.children.length > 0;
  8847. }
  8848. return false;
  8849. });
  8850. },
  8851. // 企业微信获取人员
  8852. enterpriseWechatgetUser() {
  8853. this.deptMembDataLoading = true
  8854. this.http.post('/user/getEmployeeList',{
  8855. departmentId: -1,
  8856. pageIndex: 1,
  8857. pageSize: 100,
  8858. keyword: this.nameAearch,
  8859. status: '',
  8860. roleId: '',
  8861. cursor: '',
  8862. onlyDirect: '',
  8863. matchingType: ''
  8864. },res => {
  8865. if(res.code == 'ok'){
  8866. this.deptMembDataLoading = false
  8867. const userListName = res.data.records.map(item => item.name)
  8868. this.handleThreeData(userListName)
  8869. setTimeout(() => {
  8870. this.changeTreeNodeStatus(this.$refs.chooseMembTree.store.root)
  8871. }, 200)
  8872. }else{
  8873. this.deptMembDataLoading = false
  8874. this.$message({
  8875. message: res.msg,
  8876. type: 'error'
  8877. })
  8878. }
  8879. },err => {
  8880. this.deptMembDataLoading = false
  8881. this.$message({
  8882. message: err,
  8883. type: 'error'
  8884. })
  8885. })
  8886. },
  8887. changeTreeNodeStatus(node) {
  8888. let allZt = true
  8889. node.expanded = allZt
  8890. for (let i = 0; i < node.childNodes.length; i++) {
  8891. node.childNodes[i].expanded = allZt
  8892. if (node.childNodes[i].childNodes.length > 0) {
  8893. this.changeTreeNodeStatus(node.childNodes[i])
  8894. }
  8895. }
  8896. },
  8897. // 按周填报获取相关任务
  8898. async getWeeklyTaskList(item) {
  8899. const { projectId, groupId, stage, taskId } = item
  8900. let parms = { projectId, isSubstitude: 0 }
  8901. groupId ? parms.groupId = groupId : ''
  8902. stage ? parms.stage = stage : ''
  8903. const { data } = await this.postData('/task/getRecentTask', parms)
  8904. this.zhoBao.taskId = taskId
  8905. this.$set(this.zhoBao, 'taskList', data)
  8906. },
  8907. // 封装 post 请求
  8908. postData(url, params) {
  8909. return new Promise((resolve, reject) => {
  8910. this.http.post(url, { ...params },
  8911. res => {
  8912. resolve(res)
  8913. },
  8914. error => {
  8915. this.$message({
  8916. message: error,
  8917. type: "error"
  8918. });
  8919. reject(error)
  8920. })
  8921. })
  8922. },
  8923. // 自定义事件
  8924. selectCal(obj) {
  8925. if(obj.distinction == '1') {
  8926. this.zhoBao.projectAuditorId = obj.id
  8927. } else if(obj.distinction == '2') {
  8928. this.zhoBao.auditorFirst = obj.id
  8929. } else if(obj.distinction == '3') {
  8930. this.zhoBao.auditorSec = obj.id
  8931. } else if(obj.distinction == '4') {
  8932. this.zhoBao.auditorThird = obj.id
  8933. } else if(obj.distinction == '5') {
  8934. this.zhoBao.ccUserid = obj.id
  8935. } else if(obj.distinction == '12') {
  8936. this.usersListId = obj.id
  8937. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8938. this.searchKeyword = obj.name
  8939. } else {
  8940. this.searchKeyword = ''
  8941. }
  8942. this.searchScreen(0)
  8943. } else if(obj.distinction == '13') {
  8944. this.usersListId = obj.id
  8945. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8946. this.searchKeyword = obj.name
  8947. } else {
  8948. this.searchKeyword = ''
  8949. }
  8950. this.searchScreen(1)
  8951. } else if(obj.distinction == '15') {
  8952. this.usersListId = obj.id
  8953. this.showReportTimeLessThanCardTimeList();
  8954. }
  8955. }
  8956. },
  8957. created() {
  8958. this.getUsers()
  8959. let height = window.innerHeight;
  8960. this.tableHeight = height - 178;
  8961. const that = this;
  8962. window.onresize = function temp() {
  8963. that.tableHeight = window.innerHeight - 178;
  8964. };
  8965. this.toViewForm.companyId = this.user.companyId
  8966. this.initDrag([{
  8967. type: "LR",
  8968. domClass: {
  8969. // 中间分割线的名字
  8970. resize: "line-line",
  8971. // 左侧盒子的名字
  8972. left: "box-left",
  8973. // 右侧盒子的名字
  8974. right: "box-right",
  8975. // 父级的名字
  8976. box: "box-father",
  8977. },
  8978. otherInfo: {
  8979. // 限制左边栏最低宽度
  8980. leftWidth: 120,
  8981. },
  8982. },
  8983. {
  8984. type: "LR",
  8985. domClass: {
  8986. // 中间分割线的名字
  8987. resize: "line-second",
  8988. // 左侧盒子的名字
  8989. left: "left-laowang",
  8990. // 右侧盒子的名字
  8991. right: "box-second-father",
  8992. // 父级的名字
  8993. box: "grand",
  8994. },
  8995. otherInfo: {
  8996. // 限制左边栏最低宽度
  8997. leftWidth: 120,
  8998. },
  8999. },
  9000. ]);
  9001. }
  9002. };
  9003. </script>
  9004. <style lang="scss" scoped>
  9005. @import "../../assets/scss/handle";
  9006. .themeFontColor {
  9007. @include font_color("color");
  9008. }
  9009. .fillWeekDialogVisiCustom {
  9010. width: 100%;
  9011. height: 70vh;
  9012. }
  9013. .fillWeekCustom {
  9014. .el-dialog__body {
  9015. padding: 20px 20px !important;
  9016. }
  9017. }
  9018. .photos {
  9019. position: relative;
  9020. display: flex;
  9021. flex-wrap: wrap;
  9022. }
  9023. .photos_img {
  9024. width: 120px;
  9025. height: 120px;
  9026. margin-right: 20px;
  9027. margin-bottom: 20px;
  9028. cursor: pointer;
  9029. img {
  9030. width: 100%;
  9031. height: 100%;
  9032. }
  9033. }
  9034. .paginatis {
  9035. padding: 10px 10px;
  9036. background: #f2f2f2;
  9037. }
  9038. .waiting {
  9039. color:orange;
  9040. }
  9041. .filledReportStyle {
  9042. color:#32CD32;
  9043. }
  9044. .RejectStyle {
  9045. color:red;
  9046. }
  9047. .waitSubmitStyle{
  9048. @include font_color("color");
  9049. }
  9050. .chooseDate {
  9051. .waiting {
  9052. @include font_color("color");
  9053. }
  9054. .filledReportStyle {
  9055. @include font_color("color");
  9056. }
  9057. .RejectStyle {
  9058. @include font_color("color");
  9059. }
  9060. .waitSubmitStyle{
  9061. @include font_color("color");
  9062. }
  9063. }
  9064. .allDaily {
  9065. width:100%;
  9066. }
  9067. .report_title {
  9068. padding:10px 0;
  9069. color:#666;
  9070. }
  9071. .clearfix {
  9072. overflow-x: auto;
  9073. white-space: nowrap;
  9074. padding: 15px 0 10px 0;
  9075. // overflow-y: hidden;
  9076. .date_item {
  9077. padding: 0 3px;
  9078. cursor: pointer;
  9079. position: relative;
  9080. }
  9081. .chooseDate {
  9082. position: absolute;
  9083. bottom: -3px;
  9084. width: 37px;
  9085. height: 2px;
  9086. left: 14px;
  9087. @include background_color("background_color");
  9088. }
  9089. }
  9090. .one_daily {
  9091. i {
  9092. @include font_color("color1");
  9093. margin-right: 5px;
  9094. }
  9095. .one_daily_body {
  9096. padding: 10px 0px;
  9097. p {
  9098. margin: 0;
  9099. line-height: 30px;
  9100. }
  9101. }
  9102. ul {
  9103. padding: 0;
  9104. }
  9105. }
  9106. .checkbtn {
  9107. float: right;
  9108. margin-top: -10px;
  9109. }
  9110. .selConStyle{
  9111. margin-top:9rem;
  9112. margin-bottom:11rem;
  9113. .selConStyle_title{
  9114. height: 3rem;
  9115. text-align: center;
  9116. font-size: 17px;
  9117. }
  9118. .el-select{
  9119. margin: 0 15%;
  9120. width: 70%;
  9121. }
  9122. }
  9123. </style>
  9124. <style lang="scss">
  9125. /*去除upload组件过渡效果*/
  9126. .photos .el-upload-list__item {
  9127. transition: none !important;
  9128. }
  9129. .daily {
  9130. .el-card__body {
  9131. height: 80%;
  9132. overflow-y: auto;
  9133. }
  9134. .el-card__header {
  9135. padding: 0 20px;
  9136. }
  9137. }
  9138. .membListClass{
  9139. .el-dialog__body{
  9140. padding-top: 10px;
  9141. }
  9142. }
  9143. // .editReportDialog .el-dialog__footer{
  9144. // position: sticky;
  9145. // bottom: 0;
  9146. // background: #fff;
  9147. // height: 70px;
  9148. // z-index: 1010;
  9149. // }
  9150. .editReportDialog{
  9151. min-width: 800px;
  9152. }
  9153. .touruxiangmu{
  9154. max-width: 1000px;
  9155. }
  9156. </style>
  9157. <style scoped>
  9158. /* 项目标签的样式 */
  9159. .el-tag + .el-tag {
  9160. margin-left: 10px;
  9161. }
  9162. .button-new-tag {
  9163. margin-left: 10px;
  9164. height: 32px;
  9165. line-height: 30px;
  9166. padding-top: 0;
  9167. padding-bottom: 0;
  9168. }
  9169. .input-new-tag {
  9170. width: 90px;
  9171. margin-left: 10px;
  9172. vertical-align: bottom;
  9173. }
  9174. .selectworktime .el-table__fixed-body-wrapper{
  9175. top: 48px !important;
  9176. }
  9177. .selectworktime_export .selectworktime_export_l{
  9178. width: 650px;
  9179. float: left;
  9180. height: 42px;
  9181. }
  9182. .approvalProcessBox{
  9183. margin-left: 30px;
  9184. font-size: 14px;
  9185. line-height: 16px;
  9186. cursor: pointer;
  9187. }
  9188. .approvalProcessBox i {
  9189. margin-right: 0;
  9190. height: 16px;
  9191. width: 16px;
  9192. display: inline-block;
  9193. transform: scale(1.2);
  9194. position: relative;
  9195. top: 0.5px;
  9196. @include font_color("color");
  9197. }
  9198. .approvalProcessBox .approvalProcessClick{
  9199. cursor: pointer;
  9200. @include font_color("color");
  9201. font-size: 14px;
  9202. }
  9203. .approvalProcessBox:hover .approvalProcessClick{
  9204. color: #3485fb;
  9205. }
  9206. </style>
  9207. <style lang="scss" scoped>
  9208. .bionicClass {
  9209. -webkit-appearance: none;
  9210. background-color: #FFF;
  9211. background-image: none;
  9212. border-radius: 4px;
  9213. border: 1px solid #DCDFE6;
  9214. box-sizing: border-box;
  9215. color: #606266;
  9216. display: inline-block;
  9217. height: 40px;
  9218. line-height: 40px;
  9219. outline: 0;
  9220. padding: 0 15px;
  9221. -webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  9222. transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  9223. width: 350px;
  9224. cursor: pointer;
  9225. .bionicClassText {
  9226. color: #C0C4CC;
  9227. }
  9228. }
  9229. // 加班样式
  9230. .overtime {
  9231. display: inline-block;
  9232. margin-left: 20px;
  9233. input {
  9234. display: inline-block;
  9235. margin-top: 5px;
  9236. }
  9237. }
  9238. .plus {
  9239. display: inline-block;
  9240. }
  9241. // .tages {
  9242. // float: right;
  9243. // }
  9244. .overtime {
  9245. display: inline-block;
  9246. margin-left: 30px;
  9247. }
  9248. .bloks {
  9249. display: inline-block;
  9250. width: 380px;
  9251. }
  9252. .zhiss {
  9253. display: flex;
  9254. justify-content: space-around;
  9255. align-items: center;
  9256. }
  9257. .zhoFel {
  9258. display: flex;
  9259. justify-content: space-between;
  9260. align-items: center;
  9261. }
  9262. // 左右滑动样式
  9263. .line {
  9264. width: 30px;
  9265. /* height: 500px; */
  9266. background: #f2f2f2;
  9267. cursor: w-resize;
  9268. }
  9269. .box-father {
  9270. border: 8px solid #000;
  9271. }
  9272. .line-second {
  9273. width: 10px;
  9274. /* background: red; */
  9275. }
  9276. .flex {
  9277. display: flex;
  9278. width: 100%;
  9279. }
  9280. .box-left {
  9281. flex: 0 0 400px;
  9282. /* height: 600px; */
  9283. /* background: blue; */
  9284. }
  9285. .box-right {
  9286. /* height: 600px; */
  9287. /* background: green; */
  9288. flex: 1;
  9289. }
  9290. .box-postion {
  9291. width: 200px;
  9292. /* height: 400px; */
  9293. background: #ccc;
  9294. }
  9295. .custom-tree-node {
  9296. flex: 1;
  9297. display: flex;
  9298. align-items: center;
  9299. justify-content: space-between;
  9300. font-size: 14px;
  9301. padding-right: 8px;
  9302. }
  9303. .daitianrbao {
  9304. width: 100%;
  9305. box-sizing: border-box;
  9306. height: 40px;
  9307. border-radius: 4px;
  9308. border: 1px solid #DCDFE6;
  9309. overflow: hidden;
  9310. text-overflow: ellipsis;
  9311. display: flex;
  9312. // align-items: center;
  9313. }
  9314. .daitianrbao .spnn {
  9315. display: inline-block;
  9316. box-sizing: border-box;
  9317. padding: 0 15px;
  9318. overflow: hidden;
  9319. text-overflow: ellipsis;
  9320. }
  9321. .daitianrbao .hover {
  9322. color: #DCDFE6 !important;
  9323. }
  9324. </style>