daily.vue 304 KB

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