daily.vue 222 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600
  1. <template>
  2. <section v-loading="zhoLoading">
  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:fixed;top:70px;background:#fff;left:250px;"> -->
  8. <div class="jjk" style="display:inline-block;position:absolute;top:10px;background:#fff;left:0px;">
  9. <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
  10. style="width:190px;"
  11. @change="changeMonthOut" :clearable="false" type="month" placeholder="选择月份"></el-date-picker>
  12. <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showWorkTime"></el-button>
  13. </div>
  14. <div slot="header" class="clearfix" id="clearfix" style="padding-left: 255px;">
  15. <!-- <div class="jjk" style="display:inline-block;position:fixed;top:70px;background:#fff;left:250px;">
  16. <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
  17. style="width:190px;"
  18. @change="changeMonthOut" :clearable="false" type="month" placeholder="选择月份"></el-date-picker>
  19. <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showWorkTime"></el-button>
  20. </div> -->
  21. <span v-for="(item,index) in allDate" :id="'day'+index" :class="index==choseDay?'chooseDate date_item':'date_item'"
  22. @click="choseDate(index, item)" :key="index" >
  23. <div :style="'display:inline-block;'+(item.state == null?'padding:0px 6px;':'')" >
  24. <div><span>{{item.showDate}}</span>
  25. <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
  26. </div>
  27. </div>
  28. <i v-if="item.state != null" class="iconfont firerock-icondot" :class="statusStyle[item.state]"></i>
  29. </span>
  30. </div>
  31. </div>
  32. <div style="display:flex;">
  33. <div v-if="permissions.reportsCompany || user.manageDeptId != 0" >
  34. <div style="width:190px;">
  35. <el-select v-model="selectState" size="small" @change="stateChange" >
  36. <el-option value="-1" label="全部状态" >全部状态</el-option>
  37. <el-option value="-2" label="未填报">未填报</el-option>
  38. <el-option value="1" label="已通过">已通过</el-option>
  39. <el-option value="0" label="待审核">待审核</el-option>
  40. <el-option value="2" label="不通过">不通过</el-option>
  41. <el-option value="3" label="待提交">待提交</el-option>
  42. </el-select></div>
  43. <div>
  44. <el-tree :data="data" @node-click="handleNodeClick" >
  45. <span class="custom-tree-node" slot-scope="{ node, data}">
  46. <span>{{ node.label }}</span>
  47. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  48. <div style="width:0%;float:right;">
  49. <span v-if="data.isUser == 1 && data.state == null" style="color:red;">
  50. 未填报
  51. </span>
  52. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;">
  53. 待审核
  54. </span>
  55. <span v-if="data.isUser == 1 && data.state == 1" style="color:green;">
  56. 已通过
  57. </span>
  58. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;">
  59. 未通过
  60. </span>
  61. <span v-if="data.isUser == 1 && data.state == 3" style="color:red;">
  62. 待提交
  63. </span>
  64. </div>
  65. </span>
  66. </el-tree>
  67. </div>
  68. </div>
  69. <div :style="'height:'+tableHeight+'px;width:0.5px;background:#eee;margin-right:10px;margin-left:10px;'" ></div>
  70. <div class="allDaily" style="float:left;flex-grow:1">
  71. <!--系统管理员和部门负责人 -->
  72. <div class="report_title" >
  73. <span>工作日报 </span>
  74. <span v-if="permissions.reportsCompany||user.manageDeptId != 0">| {{depData != null ?depData.label:""}}
  75. <span v-if="targetUid == null">
  76. - 已填写
  77. <el-link :underline="false" @click="showMembList(1)"><span style="margin-left:5px;margin-right:5px;color:green;">{{reportList.length}}</span></el-link>人,
  78. 未填写<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>人
  79. </span>
  80. </span>
  81. <span style="float:right;">
  82. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">填写日报</el-link>
  83. <el-link v-if="reportTimeType.type != 0" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">按周填报</el-link>
  84. <el-link type="primary" v-if="permissions.reportsFillOut" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,0)">代填日报</el-link>
  85. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">批量填报</el-link>
  86. <el-link type="primary" v-if="permissions.importReport || user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="imports()">工时导入</el-link>
  87. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog">导出日报</el-link>
  88. <!--部门负责人给个导出工时的功能 -->
  89. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">导出工时统计</el-link>
  90. </span>
  91. </div>
  92. <!--普通员工,含项目经理 -->
  93. <!-- <div class="report_title" v-if="(user.role==0||user.role==3||user.role==5) && user.manageDeptId == 0"><span>日报列表</span>
  94. <span style="float:right;" v-if="(user.role==0||user.role==3||user.role==5) && user.manageDeptId == 0">
  95. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">填写日报</el-link>
  96. <el-link v-if="reportTimeType.type != 0" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">按周填报</el-link>
  97. <el-link type="primary" v-if="user.leader" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,0)">代填日报</el-link>
  98. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">批量填报</el-link>
  99. </span> -->
  100. <!-- </div> -->
  101. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  102. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  103. <i class="fa fa-circle"></i>{{item1.name}}
  104. <span style="margin-left:30px;">
  105. <span style="margin-right:20px;">
  106. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  107. 工作总时长:
  108. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  109. <span >{{item1.reportTime}}</span>h
  110. </span>
  111. </span>
  112. <div class="checkbtn" style="padding-right:20px;">
  113. <el-button v-if="item1.state >= 2 && user.id == item1.id" type="primary" size="small" @click="isSubstitude=false; fillInReport(index1,0)">编辑日报</el-button>
  114. <el-button v-if="(permissions.reportsDeleteAll || user.manageDeptId != 0) && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">删除</el-button>
  115. </div>
  116. <div class="one_daily_body">
  117. <el-timeline>
  118. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  119. <el-card shadow="never">
  120. <p>项目:<b>{{item2.project}}</b><span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  121. <span v-if="user.company.packageEngineering == 0">
  122. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  123. <span v-if="item2.isDeptAudit==0">
  124. <span v-if="item2.projectAuditState==0">
  125. 待项目审核人<span v-if="item2.projectAuditorName != null">({{item2.projectAuditorName}})</span>审核
  126. </span>
  127. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  128. 项目审核人<span v-if="item2.projectAuditorName != null">({{item2.projectAuditorName}})</span>审核通过
  129. </span>
  130. </span>
  131. <span v-else-if="item2.isDeptAudit==1">
  132. {{('待'+item2.auditDeptName+'审核')}}
  133. </span>
  134. ]</span>
  135. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ 导入待审核 ]</span>
  136. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ 已通过 ]</span>
  137. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ 已驳回 ] 原因:{{item2.rejectReason}}</span>
  138. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ 待提交 ]</span>
  139. </span>
  140. <!-- <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> -->
  141. <span v-if="user.company.packageEngineering == 1">
  142. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ 导入待审核 ]</span>
  143. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ 待专业审核 ]</span>
  144. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ 待部门审核 ]</span>
  145. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ 待项目经理审核 ]</span>
  146. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ 已通过 ]</span>
  147. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ 已驳回 ] 原因:{{item2.rejectReason}}</span>
  148. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ 待提交 ]</span>
  149. </span>
  150. <!--每个项目上单独审核 -->
  151. <span style="float:right;">
  152. <el-button v-if="(permissions.projectReportReview || user.id == item2.projectAuditorId) && item2.state == 0 && item2.isDeptAudit==0 && item2.projectAuditState==0" type="primary" :loading="logining"
  153. size="small" @click="approve(item1.id, item2)">通过</el-button>
  154. <el-button v-if="(permissions.projectReportReview ||user.id == item2.projectAuditorId) && item2.state == 0 && item2.isDeptAudit==0 && item2.projectAuditState==0" type="danger" :loading="logining"
  155. size="small" @click="showDenyDialog(item1.id,0, item2)">驳回</el-button>
  156. <el-button v-if="(permissions.projectReportReview ||user.id == item2.projectAuditorId) && item2.state == 1" type="normal" :loading="logining" size="small"
  157. @click="showDenyDialog(item1.id,1, item2)">撤销</el-button>
  158. <!--自己可以撤回待审核状态的报告 -->
  159. <el-button v-if="user.id == item1.id && (item2.state == 0 || item2.state == -1)" type="normal" :loading="logining" size="small" @click="cancel(item1)">撤回</el-button>
  160. </span>
  161. </p>
  162. <!--任务分组和阶段 -->
  163. <p v-if="item2.groupId != 0">任务分组:{{item2.groupName}} <span v-if="item2.stage != null && item2.stage != '-'" style="margin-left:10px;">投入阶段:{{item2.stage}}</span></p>
  164. <p v-if="user.timeType.customDegreeActive==1 && item2.degree_id != null && item2.degree_id != -1">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  165. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  166. <p v-if="user.company.packageEngineering == 1">
  167. 专业进度:
  168. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  169. <el-tooltip v-if="progressItem.auditState == 0" content="待审核" effect="light" placement="top">
  170. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  171. </el-tooltip>
  172. <el-tooltip v-if="progressItem.auditState == 1" content="已通过" effect="light" placement="top">
  173. <i class="iconfont firerock-iconshenhetongguo"></i>
  174. </el-tooltip>
  175. <el-tooltip v-if="progressItem.auditState == 2" content="不通过" effect="light" placement="top">
  176. <i class="iconfont firerock-iconshenhebohui"></i>
  177. </el-tooltip>
  178. </span>
  179. </p>
  180. <p v-if="item2.taskId != null">任务:{{item2.taskName}}
  181. </p>
  182. <div v-if="item2.multiWorktime==0">
  183. <p style="display: inline-block;">时长:
  184. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  185. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  186. {{item2.time.toFixed(1)}}h
  187. <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">加班</el-tag>
  188. </p>
  189. <p>事项:<span v-html="item2.content"></span></p>
  190. </div>
  191. <div v-if="item2.multiWorktime==1" >
  192. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  193. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  194. <p style="display: inline-block;">时长:
  195. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  196. {{timeItem.time.toFixed(1)}}h
  197. <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">加班</el-tag>
  198. </p>
  199. <p>事项:<span v-html="timeItem.content"></span></p>
  200. </div>
  201. </div>
  202. <!--照片的显示 -->
  203. <p v-if="item2.pics != null && item2.pics.length > 0">
  204. <el-image v-for="(pic, index) in item2.pics" :key="index"
  205. style="width: 100px; height: 100px; margin-right:10px;"
  206. :src="pic"
  207. :preview-src-list="item2.pics">
  208. </el-image>
  209. </p>
  210. </el-card>
  211. </el-timeline-item>
  212. </el-timeline>
  213. </div>
  214. </div>
  215. <!-- 简陋的无报告提示 -->
  216. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}暂无报告</div>
  217. </div>
  218. </div>
  219. </div>
  220. </el-card>
  221. </div>
  222. <!-- 填写日报的dialog -->
  223. <el-dialog :title="isBatch==0?'填写日报':'批量填报'" :visible.sync="dialogVisible" width="60%" :close-on-click-modal="false" @closed="guanbi()">
  224. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="100px">
  225. <el-form-item label="选择人员" v-if="isSubstitude">
  226. <el-input @focus="showChooseMembTree" v-model="workForm.userNames"
  227. placeholder="请选择代填人员" ></el-input>
  228. </el-form-item>
  229. <el-form-item label="工作日期" prop="createDate">
  230. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  231. :style="'width:'+(isBatch==0?'200':'280')+'px;'" :type="isBatch==0?'date':'daterange'"
  232. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" placeholder="选择工作日期" :disabled="isDisable"></el-date-picker>
  233. <div v-if="falsss" style="display: inline-block;">总{{jsDay}} 天, 共{{jsTime}} 小时</div>
  234. <div v-if="isBatch!=0" style="display: inline-block;">总{{jsDay}} 天, 共{{jsTime}} 小时</div>
  235. <span v-if="reportTimeType.type == 3" style="margin-left:30px;">{{isBatch==0?'总':'每日'}}时长:</span>
  236. <el-input-number :disabled="!canEdit" v-if="reportTimeType.type == 3" style="margin-left:10px;" @change="changeAllTime"
  237. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  238. <span v-if="reportTimeType.type == 3">小时</span>
  239. </el-form-item>
  240. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  241. <div v-if="reportTimeType.multiWorktime==0">
  242. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?'工作时间':'工作时长'" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  243. :rules="{ required: true, message: '请选择工作时长', trigger: 'blur' }">
  244. <el-select v-model="domain.timeType" style="width:200px;"
  245. v-if="reportTimeType.type == 0"
  246. placeholder="请选择工作时长"
  247. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  248. @change="onTimeTypeChange(domain.timeType)">
  249. <el-option
  250. v-for="item in timeType"
  251. :key="item.value"
  252. :label="item.label"
  253. :value="item.value">
  254. </el-option>
  255. </el-select>
  256. <!-- 数字时长选择 -->
  257. <el-select v-model="domain.workingTime" style="width:200px;"
  258. v-if="reportTimeType.type == 1"
  259. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  260. placeholder="请选择工作时长"
  261. @change="seleChn(0)">
  262. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  263. </el-select>
  264. <span v-if="reportTimeType.type == 1">小时</span>
  265. <span v-if="reportTimeType.type == 2">
  266. <!--时间范围选择 -->
  267. <el-time-picker
  268. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  269. v-model="domain.startTime"
  270. placeholder="起始时间"
  271. style="width:120px;"
  272. format="HH:mm"
  273. value-format="HH:mm"
  274. :picker-options="{
  275. start: '08:00',
  276. end: '23:30'
  277. }"
  278. @change="iptChang()">
  279. </el-time-picker> - <el-time-picker
  280. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  281. v-model="domain.endTime"
  282. placeholder="结束时间"
  283. style="width:120px;"
  284. format="HH:mm"
  285. value-format="HH:mm"
  286. :picker-options="{
  287. start: '08:00',
  288. end: '23:30',
  289. minTime: domain.startTime
  290. }"
  291. @change="iptChang()">
  292. </el-time-picker>
  293. </span>
  294. <div class="overtime"><el-checkbox :disabled="!canEdit" v-model="domain.isOvertime">加班</el-checkbox></div>
  295. </el-form-item>
  296. <el-form-item label="投入项目" :prop="'domains.' + index + '.projectId'"
  297. :rules="{ required: true, message: '请选择投入项目', trigger: ['change','blur'] }">
  298. <el-select v-model="domain.projectId" placeholder="请选择项目" style="width:200px;" clearable="true" filterable="true"
  299. @change="selectProject(domain, index)"
  300. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  301. <el-option v-for="item in projectList" :disabled="item.status>=2" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  302. </el-select>
  303. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0"
  304. style="margin-left:45px;">子项目</span>
  305. <!--子项目 -->
  306. <el-select v-model="domain.subProjectId" placeholder="请选择子项目" style="width:200px;margin-left:10px;" clearable="true"
  307. v-if="domain.subProjectList != null && domain.subProjectList.length> 0"
  308. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  309. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  310. </el-select>
  311. <el-link v-if="index >= 1" type="primary" :underline="false" @click="delDomain(index)" style="float:right;margin-right:10px;"
  312. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  313. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  314. </el-link>
  315. <el-link type="primary" v-if="workForm.domains[index].state == 0 || workForm.domains[index].state == 2"
  316. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link>
  317. </el-form-item>
  318. <el-form-item label="项目审核人" >
  319. <el-select v-model="domain.projectAuditorId" :disabled="!canEdit" @change="$forceUpdate()">
  320. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id"></el-option>
  321. </el-select>
  322. </el-form-item>
  323. <el-form-item label="任务分组" v-if="user.company.packageProject == 1">
  324. <!-- 任务分组 -->
  325. <el-select v-model="domain.groupId" placeholder="请选择任务分组" style="width:200px;" clearable="true"
  326. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  327. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  328. </el-select>
  329. <!-- 项目的阶段 -->
  330. <span v-if="domain.stages != null && domain.stages.length> 0"
  331. style="margin-left:30px;">投入阶段</span>
  332. <el-select v-model="domain.stage" placeholder="请选择" style="width:200px;margin-left:10px;"
  333. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  334. @change="changeStages(domain, index)"
  335. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  336. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  337. </el-select>
  338. </el-form-item>
  339. <!-- 相关维度 -->
  340. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1">
  341. <el-select v-model="domain.degreeId" clearable placeholder="请选择" :disabled="!canEdit">
  342. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  343. </el-option>
  344. </el-select>
  345. </el-form-item>
  346. <!-- 相关数值 -->
  347. <el-form-item :label="yonghuUser.customDataName" v-if="domain.projectId && yonghuUser.customDataActive == 1">
  348. <el-input-number :id="'numberData_'+index" :disabled="!canEdit" v-model="domain.customData" style="width:200px;" @keyup.native="restrictNumber('numberData_'+index)"></el-input-number>
  349. </el-form-item>
  350. <el-form-item v-if="reportTimeType.type == 3" label="用时占比" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  351. :rules="{ required: true, message: '请设置用时占比', trigger: 'blur' }">
  352. <div style="width:300px;">
  353. <el-col span="14"><el-slider :disabled="!canEdit" v-model="domain.progress" :min="10" :show-tooltip="false" :step="10" style="width:180px;" @input="domain.workingTime = (reportTimeType.allday*domain.progress/100).toFixed(1)" @change="seleChn(0)"></el-slider></el-col>
  354. <el-col span="10"><span style="margin-left:10px;float:right;"><span style="margin-right:10px;">{{domain.progress}}%</span>{{domain.workingTime}}小时</span></el-col>
  355. </div>
  356. <div class="overtime"><el-checkbox :disabled="!canEdit" v-model="domain.isOvertime">加班</el-checkbox></div>
  357. </el-form-item>
  358. <!--工程专业版本模式下, 各个专业的进度填报 -->
  359. <el-form-item label="专业进度" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  360. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  361. <span>{{item.professionName}}</span> / 进度:
  362. <el-input size="mini" style="width:60px;" v-model="item.progress"
  363. @keyup.native="onProgressChange"
  364. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  365. </span>
  366. </el-form-item>
  367. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  368. <el-form-item label="相关任务" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  369. <el-select v-model="domain.taskId" placeholder="请选择" style="width:100%;" filterable="true"
  370. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  371. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  372. </el-select>
  373. </el-form-item>
  374. <el-form-item label="工作事项" :prop="'domains.' + index + '.content'" >
  375. <el-input v-model="domain.content" type="textarea" :rows="4" placeholder="请填写工作事项" clearable
  376. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  377. </el-form-item>
  378. </div>
  379. <!--多个工作事项填报的情况 -->
  380. <div v-if="reportTimeType.multiWorktime==1">
  381. <el-form-item label="投入项目" :prop="'domains.' + index + '.projectId'"
  382. :rules="{ required: true, message: '请选择投入项目', trigger: ['change','blur'] }">
  383. <el-select v-model="domain.projectId" placeholder="请选择项目" style="width:200px;" clearable="true" filterable="true"
  384. @change="selectProject(domain, index)"
  385. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  386. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  387. </el-select>
  388. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0"
  389. style="margin-left:45px;">子项目</span>
  390. <!--子项目 -->
  391. <el-select v-model="domain.subProjectId" placeholder="请选择子项目" style="width:200px;margin-left:10px;" clearable="true"
  392. v-if="domain.subProjectList != null && domain.subProjectList.length> 0"
  393. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  394. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  395. </el-select>
  396. <el-link v-if="index >= 1" type="primary" :underline="false" @click="delDomain(index)" style="float:right;margin-right:10px;"
  397. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  398. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  399. </el-link>
  400. <div class="overtime"><el-checkbox :disabled="!canEdit" v-model="domain.isOvertime">加班</el-checkbox></div>
  401. <el-link type="primary" v-if="workForm.domains[index].state == 0 || workForm.domains[index].state == 2"
  402. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link>
  403. </el-form-item>
  404. <el-form-item label="项目审核人" >
  405. <el-select v-model="domain.projectAuditorId" :disabled="!canEdit" @change="$forceUpdate()">
  406. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id"></el-option>
  407. </el-select>
  408. </el-form-item>
  409. <el-form-item label="任务分组" v-if="user.company.packageProject == 1">
  410. <!-- 任务分组 -->
  411. <el-select v-model="domain.groupId" placeholder="请选择任务分组" style="width:200px;" clearable="true"
  412. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  413. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  414. </el-select>
  415. <!-- 项目的阶段 -->
  416. <span v-if="domain.stages != null && domain.stages.length> 0"
  417. style="margin-left:30px;">投入阶段</span>
  418. <el-select v-model="domain.stage" placeholder="请选择" style="width:200px;margin-left:10px;"
  419. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  420. @change="changeStages(domain, index)"
  421. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  422. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  423. </el-select>
  424. </el-form-item>
  425. <!--工程专业版本模式下, 各个专业的进度填报 -->
  426. <el-form-item label="专业进度" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  427. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  428. <span>{{item.professionName}}</span> / 进度:
  429. <el-input size="mini" style="width:60px;" v-model="item.progress"
  430. @keyup.native="onProgressChange"
  431. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  432. </span>
  433. </el-form-item>
  434. <!-- 相关维度 -->
  435. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1">
  436. <el-select v-model="domain.degreeId" clearable placeholder="请选择">
  437. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  438. </el-option>
  439. </el-select>
  440. </el-form-item>
  441. <!-- 相关数值 -->
  442. <el-form-item :label="yonghuUser.customDataName" v-if="domain.projectId && yonghuUser.customDataActive == 1">
  443. <el-input-number :id="'numberData_'+index" v-model="domain.customData" style="width:200px;" @keyup.native="restrictNumber('numberData_'+index)"></el-input-number>
  444. </el-form-item>
  445. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  446. <el-form-item label="相关任务" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  447. <el-select v-model="domain.taskId" placeholder="请选择" style="width:100%;" filterable="true"
  448. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  449. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  450. </el-select>
  451. </el-form-item>
  452. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  453. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  454. <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>
  455. <el-form-item label="工作时间" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  456. :rules="{ required: true, message: '请选择工作时间', trigger: 'blur' }">
  457. <span v-if="reportTimeType.type == 2">
  458. <!-- <span> -->
  459. <!--时间范围选择 -->
  460. <el-time-picker
  461. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  462. v-model="timeItem.startTime"
  463. placeholder="起始时间"
  464. style="width:120px;"
  465. format="HH:mm"
  466. value-format="HH:mm"
  467. :picker-options="{
  468. start: '00:00',
  469. end: '23:59',
  470. }"
  471. @change="iptChangs()">
  472. </el-time-picker> - <el-time-picker
  473. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  474. v-model="timeItem.endTime"
  475. placeholder="结束时间"
  476. style="width:120px;"
  477. format="HH:mm"
  478. value-format="HH:mm"
  479. :picker-options="{
  480. start: '00:00',
  481. end: '23:59',
  482. minTime: timeItem.startTime
  483. }"
  484. @change="iptChangs()">
  485. </el-time-picker>
  486. </span>
  487. </el-form-item>
  488. <el-form-item label="工作事项" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  489. :rules="{ required: true, message: '填写工作事项', trigger: 'blur' }">
  490. <el-input v-model="timeItem.content" type="textarea" :rows="2" placeholder="请填写工作事项" clearable
  491. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  492. ></el-input>
  493. </el-form-item>
  494. </div>
  495. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">添加工时</el-link>
  496. </div>
  497. <!--照片的显示 -->
  498. <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  499. <el-image v-for="(pic, index) in domain.pics" :key="index"
  500. style="width: 100px; height: 100px; margin-right:10px;"
  501. :src="pic"
  502. :preview-src-list="domain.pics">
  503. </el-image>
  504. </p>
  505. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider>
  506. </div>
  507. <el-link v-if="showAddMore" :disabled="!canEdit" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px">添加更多</el-link>
  508. </el-form>
  509. <span slot="footer" class="dialog-footer">
  510. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null">删除</el-button>
  511. <el-button @click="dialogVisible = false">取消</el-button>
  512. <el-button v-if="!isSubstitude" @click="submitReport(1)" :loading="submitingReport" :disabled="workForm.domains.length==0?true:(canEdit?false:true)">暂存</el-button>
  513. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  514. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >提交</el-button>
  515. </span>
  516. </el-dialog>
  517. <!-- 按周填报 -->
  518. <el-dialog title="按周填报" :visible.sync="diasZho" width="60%" :close-on-click-modal="false" @closed="guanbi(),zhoAddqx()">
  519. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!selConShow">
  520. <el-form-item label="工作日期" prop="createDate">
  521. <el-date-picker v-model="zhoRqi" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="zhoRqis()" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="margin-right: 18px"></el-date-picker>
  522. <el-button @click="handleGetPrevWeek()">上周</el-button>
  523. <el-button @click="getCurrentWeek()">本周</el-button>
  524. <el-button @click="handleGetNextvWeek()">下周</el-button>
  525. <el-button @click="newDates()">新增日期</el-button>
  526. </el-form-item>
  527. <el-table :data="zhoData" style="width: 100%" v-loading="zhoLoading">
  528. <el-table-column fixed="left" prop="zhoDataTime" label="日期" width="160">
  529. <template slot-scope="scope">
  530. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTime | zhoData}})
  531. </template>
  532. </el-table-column>
  533. <!-- <el-table-column align="center" v-for="(item, index) in projectList" :key="item.id" :label="item.projectName" width="200"> -->
  534. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" width="200">
  535. <template slot-scope="scope">
  536. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  537. <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>
  538. <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>
  539. <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>
  540. <el-button v-else type="text" >请填写</el-button>
  541. </div>
  542. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  543. <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>
  544. <el-button v-else type="text" >请填写</el-button>
  545. </div>
  546. </template>
  547. </el-table-column>
  548. <el-table-column fixed="right" prop="he" label="合计(h)" width="120">
  549. <template slot-scope="scope">
  550. <div class="zhiss">
  551. <p>{{scope.row.he}}</p>
  552. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  553. </div>
  554. </template>
  555. </el-table-column>
  556. </el-table>
  557. </el-form>
  558. <!-- 按周填报项目筛选 -->
  559. <div v-if="selConShow" class="selConStyle">
  560. <div class="selConStyle_title">请选择要填报的项目</div>
  561. <el-select v-model="selCon" multiple placeholder="请选择" filterable>
  562. <el-option
  563. v-for="item in projectList"
  564. :key="item.id"
  565. :label="item.projectName"
  566. :value="item.id">
  567. </el-option>
  568. </el-select>
  569. </div>
  570. <span slot="footer" class="dialog-footer" v-if="selConShow">
  571. <el-button @click="selListqx()">取 消</el-button>
  572. <el-button type="primary" @click="selListFun()">下一步</el-button>
  573. <!-- :loading="submitingReport" -->
  574. </span>
  575. <span slot="footer" class="dialog-footer" v-if="!selConShow">
  576. <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">选择项目</el-button>
  577. <el-button @click="zhoAddqx()">取 消</el-button>
  578. <el-button type="primary" @click="zhoAdd()" :loading="submitingReport">提 交</el-button>
  579. </span>
  580. </el-dialog>
  581. <!-- 选择时间 -->
  582. <el-dialog title="时间选择" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  583. <span>这是一段信息</span>
  584. <span slot="footer" class="dialog-footer">
  585. <el-button @click="btnZho = false">取 消</el-button>
  586. <el-button type="primary" @click="btnZho = false">确 定</el-button>
  587. </span>
  588. </el-dialog>
  589. <!-- 按周填报弹窗 -->
  590. <el-dialog title="请填写" :visible.sync="tianxieDialogVisible" width="30%" :before-close="handleClose">
  591. <div>
  592. <div class="zhoFel" v-if="zhoBao.auditUserList != null && zhoBao.auditUserList.length > 0">
  593. <p>审核人</p>
  594. <el-select v-model="zhoBao.projectAuditorId" placeholder="请选择" clearable="true" style="width: 355px">
  595. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  596. </el-select>
  597. </div>
  598. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0">
  599. <p>子项目</p>
  600. <el-select v-model="zhoBao.subProjectId" placeholder="请选择" clearable="true" style="width: 355px">
  601. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  602. </el-select>
  603. </div>
  604. <div class="zhoFel" v-if="user.company.packageProject == 1 && zhoBao.stages != null && zhoBao.stages.length> 0">
  605. <p>投入阶段</p>
  606. <el-select v-model="zhoBao.stage" placeholder="请选择" style="width: 355px" clearable="true">
  607. <el-option v-for="item in zhoBao.stages" :key="item" :label="item" :value="item"></el-option>
  608. </el-select>
  609. </div>
  610. <div class="zhoFel" v-if="reportTimeType.type == 2">
  611. <p>选择时间</p>
  612. <el-time-picker style="width: 355px" is-range v-model="zhoBao.time" format="HH:mm" value-format="HH:mm" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" placeholder="选择时间范围"></el-time-picker>
  613. </div>
  614. <div class="zhoFel" v-if="reportTimeType.type == 1">
  615. <p>选择时长</p>
  616. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" placeholder="请选择工作时长">
  617. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  618. </el-select>
  619. </div>
  620. <div class="zhoFel" v-if="reportTimeType.type == 3">
  621. <p>用时占比</p>
  622. <div style="width:355px;display: flex;align-items: center;">
  623. <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>
  624. <el-col span="10"><span style="float:right;"><span style="margin-right:10px;">{{zhoBao.progress || 0}}%</span>{{zhoBao.workingTime | amounts}}小时</span></el-col>
  625. </div>
  626. </div>
  627. <div class="zhoFel">
  628. <p>工作事项</p>
  629. <el-input type="textarea" v-model="zhoBao.con" placeholder="请输入工作事项" style="width: 355px" clearable></el-input>
  630. </div>
  631. </div>
  632. <span slot="footer" class="dialog-footer">
  633. <el-button @click="tianxieDialogVisible = false">取 消</el-button>
  634. <el-button type="primary" @click="btnTianxiaes()">确 定</el-button>
  635. </span>
  636. </el-dialog>
  637. <!-- 批量日报审核 -->
  638. <el-dialog title="批量项目报告审核" :visible.sync="approveDialogVisible" width="500px" >
  639. <el-checkbox v-model="isAllSelect" label="全选" style="margin-left:24px;" @change="selectAll" v-if="reportNames.length > 0"></el-checkbox>
  640. <el-tree ref="approveTree" node-key="id" :data="reportNames" show-checkbox="true" @check-change="handleCheckChange" >
  641. </el-tree>
  642. <div style="margin-left:30px;color:#999;" v-if="user.company.packageEngineering==1">仅能看到自己负责的待项目审核的日报填写人员</div>
  643. <span slot="footer" class="dialog-footer">
  644. <el-button @click="approveDialogVisible = false">取消</el-button>
  645. <el-button type="primary" @click="submitBatchApprove" :disabled="batchShowData.length == 0">审核通过</el-button>
  646. </span>
  647. </el-dialog>
  648. <!--导出报表条件选择 -->
  649. <el-dialog title="日报导出" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  650. <el-form ref="form3" :model="exportParam" >
  651. <el-form-item prop="projectId" label="选择项目">
  652. <el-select v-model="exportParam.projectId" placeholder="全部项目" clearable filterable style="width:350px;">
  653. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  654. </el-select>
  655. </el-form-item>
  656. <el-form-item prop="projectId" label="日期范围">
  657. <el-date-picker
  658. v-model="exportParam.dateRange" :editable="false"
  659. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  660. :clearable="true"
  661. range-separator="至"
  662. type="daterange"
  663. start-placeholder="开始日期"
  664. end-placeholder="结束日期"
  665. ></el-date-picker>
  666. </el-form-item>
  667. </el-form>
  668. <div slot="footer" class="dialog-footer">
  669. <el-button type="primary" @click="exportReport" style="width:100%;" >导出</el-button>
  670. </div>
  671. </el-dialog>
  672. <!--导出报表条件选择 -->
  673. <el-dialog title="工时统计导出" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  674. <el-form ref="form3" :model="exportParam" >
  675. <el-form-item prop="range" label="日期范围">
  676. <el-date-picker
  677. v-model="exportParam.dateRange" :editable="false"
  678. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  679. :clearable="true"
  680. range-separator="至"
  681. type="daterange"
  682. start-placeholder="开始日期"
  683. end-placeholder="结束日期"
  684. ></el-date-picker>
  685. </el-form-item>
  686. </el-form>
  687. <div slot="footer" class="dialog-footer">
  688. <el-button type="primary" @click="exportUserTime" style="width:100%;" >导出</el-button>
  689. </div>
  690. </el-dialog>
  691. <!--人员列表 -->
  692. <el-dialog :title="(isFill?'已填':'未填')+'人员列表'" v-if="membListVisible" :visible.sync="membListVisible" width="500px">
  693. <el-table :show-header="false" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;">
  694. <el-table-column type="index" width="60">
  695. <template slot-scope="scope" >
  696. {{scope.$index+1}}
  697. </template>
  698. </el-table-column>
  699. <el-table-column prop="label" label="姓名" ></el-table-column>
  700. <el-table-column prop="deptName" label="部门" >
  701. </el-table-column>
  702. </el-table>
  703. <div slot="footer" class="dialog-footer">
  704. <el-button type="primary" @click="weixinNotify" v-if="!isFill" :disabled="fillMembList == 0">微信催填</el-button>
  705. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">导出</el-button>
  706. </div>
  707. </el-dialog>
  708. <!-- 按部门选择人员 -->
  709. <el-dialog title="选择需要代填报的人员" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  710. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  711. <div class="tree" style="height:400px">
  712. <el-scrollbar style="height:100%">
  713. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id"
  714. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  715. highlight-current ></el-tree>
  716. </el-scrollbar>
  717. </div>
  718. <div>已选中&nbsp;{{chosenMembCount}}&nbsp;人</div>
  719. <div slot="footer" class="dialog-footer">
  720. <el-button @click="chooseParticipVisible = false" >取消</el-button>
  721. <el-button type="primary" @click="chooseParticip()" >确定</el-button>
  722. </div>
  723. </el-dialog>
  724. <el-dialog
  725. v-if="monthWorkTimeDialog"
  726. :visible.sync="monthWorkTimeDialog"
  727. :close-on-click-modal="false"
  728. customClass="customWidth selectworktime"
  729. width="63%"
  730. title=""
  731. >
  732. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  733. <el-tabs v-model="activeName" @tab-click="handleClick">
  734. <el-tab-pane label="已填工时情况" name="first">
  735. <div class="selectworktime_export" style="margin-top:10px;">
  736. <div class="selectworktime_export_l">
  737. <el-date-picker
  738. class="selecteworktime_datapick"
  739. v-model="WorktimeDatepickValue1"
  740. value-format="yyyy-MM-dd"
  741. type="daterange"
  742. align="right"
  743. unlink-panels
  744. range-separator="至"
  745. start-placeholder="开始日期"
  746. end-placeholder="结束日期"
  747. :default-time="['12:00:00', '12:00:00']"
  748. size="small"
  749. popper-class="selecteorktime_datapick_popper"
  750. @change="showMonthWorkTime()"
  751. >
  752. </el-date-picker>
  753. <el-button size="small" @click="getDoubleLastWeek(1)">上上周</el-button>
  754. <el-button size="small" @click="getLastWeek(1)">上周</el-button>
  755. <el-button size="small" @click="getThisWeek(1)">本周</el-button>
  756. <!-- 222 -->
  757. </div>
  758. <div>
  759. <el-input style="float:left;width:22%" v-model="searchKeyword1" class="input-with-select" placeholder="请输入人员搜索" clearable="true" size="small">
  760. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  761. </el-input>
  762. </div>
  763. <el-link
  764. type="primary"
  765. style="float: right; vertical-align: middle;height:32px"
  766. @click="exportMembWorkHours()"
  767. >导出数据</el-link
  768. >
  769. </div>
  770. <el-table ref="hasworkTbl"
  771. :data="monthworkDateS"
  772. border
  773. :height="500"
  774. highlight-current-row
  775. style="width: 100%"
  776. >
  777. <el-table-column width="75" type="index" fixed="left" label="序号">
  778. <template slot-scope="scope">
  779. {{ scope.$index + 1 }}
  780. </template>
  781. </el-table-column>
  782. <el-table-column width="105" prop="name" fixed="left" label="姓名">
  783. <template slot-scope="scope">
  784. <span :style="scope.row.worktimeList.length==0?'color:red':''">{{scope.row.name}}</span>
  785. </template>
  786. </el-table-column>
  787. <el-table-column prop="departmentName" fixed="left" label="部门">
  788. </el-table-column>
  789. <el-table-column
  790. min-width="105"
  791. v-for="(item, index) in pickDateArray"
  792. :key="index"
  793. :label="item.label"
  794. align="center"
  795. >
  796. <template slot-scope="scope">
  797. <div
  798. style="color: red"
  799. v-if="
  800. scope.row.worktimeList.filter(
  801. (w) =>
  802. w.createDate==item.date
  803. ).length > 0 &&
  804. scope.row.worktimeList.filter(
  805. (w) =>w.createDate==item.date
  806. )[0].workingTime < reportTimeType.allday
  807. "
  808. >
  809. {{
  810. scope.row.worktimeList.filter(
  811. (w) =>w.createDate==item.date
  812. )[0].workingTime
  813. }}
  814. </div>
  815. <div
  816. style="color: #20a0ff"
  817. v-if="
  818. scope.row.worktimeList.filter(
  819. (w) =>w.createDate==item.date
  820. ).length > 0 &&
  821. scope.row.worktimeList.filter(
  822. (w) =>w.createDate==item.date
  823. )[0].workingTime > reportTimeType.allday
  824. "
  825. >
  826. {{
  827. scope.row.worktimeList.filter(
  828. (w) =>w.createDate==item.date
  829. )[0].workingTime
  830. }}
  831. </div>
  832. <div
  833. v-if="
  834. scope.row.worktimeList.filter(
  835. (w) =>w.createDate==item.date
  836. ).length > 0 &&
  837. scope.row.worktimeList.filter(
  838. (w) =>w.createDate==item.date
  839. )[0].workingTime == reportTimeType.allday
  840. "
  841. >
  842. {{
  843. scope.row.worktimeList.filter(
  844. (w) =>w.createDate==item.date
  845. )[0].workingTime
  846. }}
  847. </div>
  848. <div
  849. v-if="
  850. scope.row.worktimeList.filter(
  851. (w) =>w.createDate==item.date
  852. ).length == 0
  853. "
  854. >
  855. 0
  856. </div>
  857. </template>
  858. </el-table-column>
  859. </el-table>
  860. <!-- <div slot="title" class="dialog-title selectworktime_title">
  861. <label style="font-size: 16px">员工每日已填报工时数</label>
  862. <el-link
  863. type="primary"
  864. style="float: right; margin-right: 60px"
  865. @click="exportMembWorkHours()"
  866. >导出已填报数据</el-link
  867. > -->
  868. <!-- <el-button >导出</el-button> -->
  869. <!-- </div> -->
  870. </el-tab-pane>
  871. <el-tab-pane label="未填人员列表" name="second" >
  872. <div class="selectworktime_export" style="margin-top:10px">
  873. <div class="selectworktime_export_l">
  874. <el-date-picker
  875. class="selecteworktime_datapick"
  876. v-model="WorktimeDatepickValue2"
  877. value-format="yyyy-MM-dd"
  878. type="daterange"
  879. align="right"
  880. unlink-panels
  881. range-separator="至"
  882. start-placeholder="开始日期"
  883. end-placeholder="结束日期"
  884. :default-time="['12:00:00', '12:00:00']"
  885. size="small"
  886. popper-class="selecteorktime_datapick_popper"
  887. @change="showMonthNotWorkTime()"
  888. >
  889. </el-date-picker>
  890. <el-button size="small" @click="getDoubleLastWeek()">上上周</el-button>
  891. <el-button size="small" @click="getLastWeek()">上周</el-button>
  892. <el-button size="small" @click="getThisWeek()">本周</el-button>
  893. </div>
  894. <div>
  895. <el-input style="float:left;width:22%" v-model="searchKeyword2" class="input-with-select" placeholder="请输入人员搜索" clearable="true" size="small">
  896. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  897. </el-input>
  898. </div>
  899. <el-link
  900. type="primary"
  901. style="float: right; vertical-align: middle;height:32px"
  902. @click="exportMembNotWorkHours()"
  903. >导出数据</el-link
  904. >
  905. </div>
  906. <el-table
  907. ref="hasworkTbl2"
  908. :data="monthNotWorkDateS"
  909. border
  910. :height="500"
  911. highlight-current-row
  912. style="width: 100%"
  913. >
  914. <el-table-column min-width="300" fixed="left" label="部门" prop="department">
  915. </el-table-column>
  916. <el-table-column min-width="300" prop="name" fixed="left" label="姓名" >
  917. </el-table-column>
  918. <el-table-column
  919. min-width="300"
  920. label="未填日期"
  921. align="center"
  922. prop="createDate"
  923. >
  924. </el-table-column>
  925. </el-table>
  926. </el-tab-pane>
  927. </el-tabs>
  928. </el-dialog>
  929. <!--驳回弹出框 -->
  930. <el-dialog title="请输入原因" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  931. <div>
  932. <el-input type="textarea" v-model="denyForm.reason" rows="2" :placeholder="'请输入您决定'+(denyForm.i==0?'驳回':'撤销')+'的原因'" />
  933. </div>
  934. <div slot="footer" class="dialog-footer">
  935. <el-button @click="denyReasonDialog = false" >取消</el-button>
  936. <el-button type="primary" @click="deny()" >确定</el-button>
  937. </div>
  938. </el-dialog>
  939. <!--批量导入日报 -->
  940. <el-dialog title="工时批量导入" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  941. <p>1. 下载
  942. <el-link type="primary" style="margin-left:5px;" :underline="false" href="./upload/员工工时统计模板2.xlsx" download="员工工时导入模板.xlsx">员工工时统计模板.xlsx</el-link>
  943. </p>
  944. <p>2. 填写excel模板,请确保模板中的项目和人员已添加到系统中。</p>
  945. <p style="display: flex;justify-content: center;">
  946. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  947. <el-button type="primary" :underline="false" :loading="importingData">开始导入</el-button>
  948. </el-upload>
  949. </p>
  950. <div style="display: flex;justify-content: end;">
  951. <el-link type="primary" @click="toView()">查看工时导入记录</el-link>
  952. </div>
  953. </el-dialog>
  954. <!-- 工时导入记录弹窗 -->
  955. <el-dialog title="工时导入记录" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  956. <div style="height: 452px">
  957. <el-table :data="toViewList" stripe style="width: 100%;" height="400">
  958. <el-table-column prop="indate" label="导入时间"> </el-table-column>
  959. <el-table-column prop="userName" label="操作人"> </el-table-column>
  960. <el-table-column prop="datel" label="文件">
  961. <template slot-scope="scope">
  962. <div>
  963. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  964. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  965. </div>
  966. </template>
  967. </el-table-column>
  968. </el-table>
  969. <el-col :span="24" class="paginatis">
  970. <el-pagination
  971. @size-change="handleSizeChange"
  972. @current-change="handleCurrentChange"
  973. :page-sizes="[20 , 50 , 80 , 100]"
  974. :page-size="20"
  975. layout="total, sizes, prev, pager, next"
  976. :total="toViewForm.total"
  977. style="float:right;"
  978. ></el-pagination>
  979. </el-col>
  980. </div>
  981. </el-dialog>
  982. <!--基于企业微信考勤数据的工时导入 -->
  983. <el-dialog title="工时批量导入" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  984. <el-steps :active="active" finish-status="success">
  985. <el-step title="选择要导入工时的日期范围">
  986. </el-step>
  987. <el-step title="下载带考勤数据的模板"></el-step>
  988. <el-step title="填写模板,上传数据"></el-step>
  989. </el-steps>
  990. <div v-if="active==0" style="padding:30px;height:360px;">
  991. <div style="margin-top:50px;margin-left:280px;">
  992. <el-date-picker
  993. v-model="importWxParam.date" :editable="false"
  994. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  995. :clearable="true"
  996. range-separator="至"
  997. type="daterange"
  998. start-placeholder="开始日期"
  999. end-placeholder="结束日期"
  1000. @change="loadCheckInData"
  1001. ></el-date-picker>
  1002. </div>
  1003. </div>
  1004. <div v-if="active==1" style="padding:10px;">
  1005. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1006. style="width: 100%;margin-top:5px;" >
  1007. <el-table-column prop="hasPassed" label="审核状态" width="100px">
  1008. <template slot-scope="scope">
  1009. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">已审</span>
  1010. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">未审</span>
  1011. </template>
  1012. </el-table-column>
  1013. <el-table-column prop="createDate" label="工作日期" >
  1014. </el-table-column>
  1015. <el-table-column prop="weekDayTxt" label="星期" ></el-table-column>
  1016. <el-table-column prop="username" label="员工姓名" ></el-table-column>
  1017. <el-table-column prop="startTime" label="上班时间" ></el-table-column>
  1018. <el-table-column prop="endTime" label="下班时间" ></el-table-column>
  1019. <el-table-column prop="workHours" label="实际工作时长" align="right">
  1020. <template slot-scope="scope">
  1021. {{scope.row.workHours.toFixed(1)}}h
  1022. </template>
  1023. </el-table-column>
  1024. </el-table>
  1025. </div>
  1026. <div v-if="active==2" >
  1027. <p style="display: flex;justify-content: center;height:390px;">
  1028. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1029. <el-button type="primary" :underline="false" :loading="importingData">选择文件并上传</el-button>
  1030. </el-upload>
  1031. </p>
  1032. </div>
  1033. <el-button style="margin: 0 auto;" @click="pre">上一步</el-button>
  1034. <div style="display: inline-block;width: 80%;text-align: center;" v-if="active==0">
  1035. <el-link type="primary" @click="toView()">查看工时导入记录</el-link>
  1036. </div>
  1037. <el-button style="float:right;" @click="next" :disabled="importWxParam.date==null" v-if="active<2">下一步</el-button>
  1038. <el-link v-if="active==1" style="float:right;margin-right:350px;margin-top:10px;"
  1039. type="primary" @click="downloadCheckInExcel">下载员工工时统计模板.xlsx</el-link>
  1040. </el-dialog>
  1041. <!--基于企业微信考勤数据的工时导入 -->
  1042. <el-dialog title="工时批量代填" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  1043. <div>
  1044. <span>选择日期范围:</span><el-date-picker
  1045. v-model="importWxParam.date" :editable="false"
  1046. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1047. :clearable="true"
  1048. range-separator="至"
  1049. type="daterange"
  1050. start-placeholder="开始日期"
  1051. end-placeholder="结束日期"
  1052. @change="loadCheckInData"
  1053. ></el-date-picker>
  1054. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">提交</el-button>
  1055. </div>
  1056. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  1057. :key="timeStamp"
  1058. style="width: 100%;margin-top:5px;" ref="tab">
  1059. <el-table-column prop="createDate" label="工作日期" width="100px" fixed="left"></el-table-column>
  1060. <el-table-column prop="username" label="员工姓名" width="80px" fixed="left"></el-table-column>
  1061. <el-table-column prop="startTime" label="上班时间" width="80px" fixed="left"></el-table-column>
  1062. <el-table-column prop="endTime" label="下班时间" width="80px" fixed="left"></el-table-column>
  1063. <el-table-column prop="workHours" label="工作时长" width="80px" align="right" fixed="left">
  1064. <template slot-scope="scope">
  1065. {{scope.row.workHours.toFixed(1)}}h
  1066. </template>
  1067. </el-table-column>
  1068. <!--项目名称列表 -->
  1069. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  1070. <template slot-scope="scope">
  1071. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  1072. </template>
  1073. </el-table-column>
  1074. <el-table-column prop="totalFillTime" label="总工时" fixed="right">
  1075. <template slot-scope="scope">
  1076. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  1077. </template>
  1078. </el-table-column>
  1079. </el-table>
  1080. </el-dialog>
  1081. <!--基于企业微信考勤数据的工时导入 -->
  1082. <el-dialog title="工时导入结果" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  1083. <div>
  1084. <span>{{importResultMsg}}</span>
  1085. </div>
  1086. <span slot="footer" class="dialog-footer">
  1087. <el-button type="primary" @click="showImportResult=false">确定</el-button>
  1088. </span>
  1089. </el-dialog>
  1090. </section>
  1091. </template>
  1092. <script>
  1093. import util from "../../common/js/util";
  1094. export default {
  1095. data() {
  1096. return {
  1097. exportTimeDialog: false,
  1098. searchKeyword1: '',
  1099. searchKeyword2: '',
  1100. monthworkDateS: [],
  1101. monthNotWorkDateS: [],
  1102. pickDateArray:[],
  1103. WorktimeDatepickValue1: [],
  1104. WorktimeDatepickValue2: [],
  1105. activeName:"first",
  1106. submitingReport: false,
  1107. importResultMsg:null,
  1108. showImportResult:false,
  1109. importingData: false,
  1110. isDraft: 0,
  1111. timeStamp: 0,
  1112. projectColumns:[],
  1113. checkinLoading:false,
  1114. importWxParam:{date:null,},
  1115. active:0,
  1116. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  1117. importWxDialog:false,
  1118. importDialog:false,
  1119. denyForm:null,
  1120. denyReasonDialog:false,
  1121. monthWorkTimeDialog: false,
  1122. isSubstitude:false,
  1123. isFill:false,
  1124. unFillList:[],
  1125. fillList:[],
  1126. fillMembList:[],
  1127. membListVisible: false,
  1128. isBatch:0,//是否是批量填报
  1129. weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  1130. statusStyle:["waiting", "filledReportStyle", "RejectStyle", ""],
  1131. fillStatusList: [],
  1132. exportParam:{projectId: null, dateRange:[]},
  1133. exportDialog:false,
  1134. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  1135. subProjectList:[],
  1136. canEdit: true,
  1137. 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],
  1138. selectTime:null,
  1139. reportTimeType:{},
  1140. curDate:'',
  1141. isAllSelect: false,
  1142. approveDialogVisible:false,
  1143. deptId:null,
  1144. targetUid: null,
  1145. membCount:0,
  1146. selectState:"-1",
  1147. user: JSON.parse(sessionStorage.getItem("user")),
  1148. showAddMore:false,
  1149. allDate: [],
  1150. typeList:['全天','上午','下午'],
  1151. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  1152. choseDay: 0,
  1153. tableHeight: 0,
  1154. listLoading: false,
  1155. projectList: [], //项目列表
  1156. reportList: [], //日报列表
  1157. reportNames:[], //批量审批列表
  1158. selCon:[], //筛选条件
  1159. selProjectList:[], //筛选后项目列表
  1160. selConShow: true,
  1161. dialogVisible: false, //项目弹窗
  1162. report: '',
  1163. workForm: {
  1164. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  1165. domains: [{
  1166. id: null,
  1167. projectId: "",
  1168. workingTime: "",
  1169. timeType:0,
  1170. content: "",
  1171. state: 2,
  1172. multiWorktime:0,
  1173. worktimeList:[],
  1174. degreeId: null
  1175. }],
  1176. },
  1177. workRules: {
  1178. createDate: [{ required: true, message: "请选择工作日期", trigger: "change" }],
  1179. },
  1180. chooseParticipVisible: false,
  1181. logining: false,
  1182. isDisable: false,
  1183. timeType:[],
  1184. deptMembData: [
  1185. ],
  1186. //部门人员树状结构
  1187. data: [
  1188. {
  1189. id: -1,
  1190. label: '全部人员',
  1191. membCount:0
  1192. },
  1193. {
  1194. id: 0,
  1195. label: '未分配',
  1196. }
  1197. ],
  1198. allData:{},
  1199. batchShowData:{},
  1200. option: [],
  1201. depData: {
  1202. id: -1,
  1203. label: '全部人员',
  1204. },
  1205. defaultProps: {
  1206. children: 'children',
  1207. label: 'label'
  1208. },
  1209. isNew: false,
  1210. selected: false,
  1211. valuet: new Date(),
  1212. domObj: null,
  1213. participator:[],
  1214. chosenMembCount:0,
  1215. jsDay: 0,
  1216. jsTime: 0,
  1217. falsss: false,
  1218. weidu: [],
  1219. weiduList: [],
  1220. yonghuUser: [],
  1221. dateAr: [],
  1222. batchSubFillDialog: false,
  1223. isSubstiS: false,
  1224. diasZho: false,
  1225. zhoData: [],
  1226. zhoRqi: [],
  1227. btnZho: false,
  1228. zhoLoading: false,
  1229. changdu: 6,
  1230. tianxieDialogVisible: false,
  1231. scopess: {},
  1232. zhoBao: {
  1233. time: '',
  1234. workingTime: '',
  1235. progress: '',
  1236. con: '',
  1237. subProjectId: '',
  1238. stage: '',
  1239. subProjectList: [],
  1240. stages: [],
  1241. },
  1242. zhoBaoIdx: '',
  1243. zhoBaoName: '',
  1244. zhis: {},
  1245. dealList: [],
  1246. toViewDialogVisible: false,
  1247. toViewList: [],
  1248. toViewloading: true,
  1249. toViewForm: {
  1250. pageIndex: '1',
  1251. pageSize: '20',
  1252. total: 0,
  1253. },
  1254. toViewloadings: false,
  1255. tabPositionss: 'top'
  1256. };
  1257. },
  1258. filters: {
  1259. // 过滤
  1260. amounts(value) {
  1261. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  1262. return 0
  1263. }
  1264. var zhi = +value + 0
  1265. return zhi.toFixed(1)
  1266. },
  1267. // zhoData
  1268. zhoData(value) {
  1269. var dateArray = value.split("-");
  1270. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  1271. return "周" + "日一二三四五六".charAt(date.getDay());
  1272. },
  1273. // 过滤数字
  1274. numbers(value) {
  1275. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  1276. return 0
  1277. }
  1278. return value
  1279. },
  1280. },
  1281. methods: {
  1282. searchScreen(e){
  1283. if(e){
  1284. this.monthNotWorkDateS = []
  1285. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  1286. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword2) != -1){
  1287. this.monthNotWorkDateS.push(this.monthNotWorkDate[i])
  1288. }
  1289. }
  1290. // this.$nextTick(()=>{
  1291. // this.$refs.hasworkTbl2.doLayout();
  1292. // });
  1293. }else{
  1294. this.monthworkDateS = []
  1295. for (let i = 0; i < this.monthworkDate.length; i++) {
  1296. if(this.monthworkDate[i].name.indexOf(this.searchKeyword1) != -1){
  1297. this.monthworkDateS.push(this.monthworkDate[i])
  1298. }
  1299. }
  1300. // this.$nextTick(()=>{
  1301. // this.$refs.hasworkTbl.doLayout();
  1302. // });
  1303. }
  1304. // console.log("keyword",this.monthNotWorkDateS);
  1305. },
  1306. addUpload(data) {
  1307. // var zhi = data.fileName.split('.')[0]
  1308. // var sss = zhi + '.xlsx'
  1309. // console.log(sss, data)
  1310. // return
  1311. var filePath = '/upload/' + data.serverName;
  1312. const a = document.createElement('a'); // 创建a标签
  1313. a.setAttribute('download', data.fileName);// download属性
  1314. a.setAttribute('href', filePath);// href链接
  1315. a.click(); //自执行点击事件
  1316. a.remove();
  1317. },
  1318. restrictNumber(targetId) {
  1319. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  1320. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  1321. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  1322. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  1323. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  1324. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  1325. inpu.value = parseFloat(inpu.value);
  1326. }
  1327. },
  1328. //获取项目下的任务分组
  1329. getTaskGroups(domain, index) {
  1330. this.workForm.domains[index].groupId=null;
  1331. this.http.post('/task-group/list',{
  1332. projectId: domain.projectId
  1333. },
  1334. res => {
  1335. if (res.code == "ok") {
  1336. this.workForm.domains[index].taskGroups = res.data;
  1337. this.$forceUpdate();
  1338. }
  1339. },
  1340. error => {
  1341. this.$message({
  1342. message: error,
  1343. type: "error"
  1344. });
  1345. }
  1346. );
  1347. },
  1348. //下载带企业微信考勤数据的工时统计模板
  1349. downloadCheckInExcel() {
  1350. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  1351. startDate: this.importWxParam.date[0],
  1352. endDate: this.importWxParam.date[1],
  1353. },
  1354. res => {
  1355. if (res.code == "ok") {
  1356. var filePath = res.data;
  1357. const a = document.createElement('a'); // 创建a标签
  1358. var data = filePath.split("/");
  1359. a.setAttribute('download', data[data.length-1]);// download属性
  1360. a.setAttribute('href', filePath);// href链接
  1361. a.click(); //自执行点击事件
  1362. a.remove();
  1363. } else {
  1364. this.$message({
  1365. message: res.msg,
  1366. type: "error"
  1367. });
  1368. }
  1369. },
  1370. error => {
  1371. this.checkinLoading = false;
  1372. this.$message({
  1373. message: error,
  1374. type: "error"
  1375. });
  1376. }
  1377. );
  1378. },
  1379. pre() {
  1380. if (this.active == 0) return;
  1381. this.active--;
  1382. },
  1383. next() {
  1384. this.active++;
  1385. },
  1386. triggerTotalTime(index) {
  1387. var item = this.checkinList[index];
  1388. var total = 0.0;
  1389. for (var i=0;i<this.projectColumns.length; i++) {
  1390. var key = this.projectColumns[i];
  1391. if (item[key] != null && item[key] != '') {
  1392. total += parseFloat(item[key]);
  1393. }
  1394. }
  1395. item.totalFillTime = total;
  1396. },
  1397. //提交批量代填的数据
  1398. submitBatchSubFillData() {
  1399. var data = JSON.stringify(this.checkinList);
  1400. this.http.post('/user-corpwx-time/submitProjectTime',{
  1401. json: data,
  1402. projectColumns: JSON.stringify(this.projectColumns)
  1403. },
  1404. res => {
  1405. if (res.code == "ok") {
  1406. this.$message({message:'提交成功', type:'success'});
  1407. this.importWxDialog = false;
  1408. }
  1409. },
  1410. error => {
  1411. this.checkinLoading = false;
  1412. this.$message({
  1413. message: error,
  1414. type: "error"
  1415. });
  1416. }
  1417. );
  1418. },
  1419. loadCheckInData() {
  1420. if (this.importWxParam.date == null) {
  1421. this.checkinList = [];
  1422. return;
  1423. }
  1424. this.checkinLoading = true;
  1425. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  1426. startDate: this.importWxParam.date[0],
  1427. endDate: this.importWxParam.date[1],
  1428. },
  1429. res => {
  1430. if (res.code == "ok") {
  1431. this.checkinLoading = false;
  1432. this.checkinList = res.data.list;
  1433. this.projectColumns = res.data.projects;
  1434. // 自定义表格会导致表格错乱,需重新计算表格
  1435. this.$nextTick(()=>{
  1436. this.$refs.tab.doLayout()
  1437. })
  1438. }
  1439. },
  1440. error => {
  1441. this.checkinLoading = false;
  1442. this.$message({
  1443. message: error,
  1444. type: "error"
  1445. });
  1446. }
  1447. );
  1448. },
  1449. batchImportWxData(item) {
  1450. //首先判断文件类型
  1451. let str = item.file.name.split(".");
  1452. let format = str[str.length - 1];
  1453. if (format != "xls" && format != "xlsx") {
  1454. this.$message({
  1455. message: "请选择.xls或.xlsx文件",
  1456. type: "error"
  1457. });
  1458. } else {
  1459. this.importingData = true;
  1460. let formData = new FormData();
  1461. formData.append("file", item.file);
  1462. formData.append("companyId", this.user.companyId);
  1463. formData.append("withCheckIn", 1);
  1464. this.http.uploadFile('/report/importData', formData,
  1465. res => {
  1466. this.$refs.upload.clearFiles();
  1467. this.showImportResult = true;
  1468. this.importingData = false;
  1469. if (res.code == "ok") {
  1470. //换成弹出框,以免有人等了半天回来啥也没看到
  1471. this.importResultMsg = "导入成功:成功导入"+res.data+"条工时数据。"+(res.msg?res.msg:"");
  1472. this.getReportList();
  1473. this.importWxDialog = false;
  1474. } else {
  1475. this.importResultMsg = "导入失败:"+res.msg;
  1476. }
  1477. },
  1478. error => {
  1479. this.$refs.upload.clearFiles();
  1480. this.listLoading = false;
  1481. this.$message({
  1482. message: error,
  1483. type: "error"
  1484. });
  1485. });
  1486. }
  1487. },
  1488. batchImportData(item) {
  1489. //首先判断文件类型
  1490. let str = item.file.name.split(".");
  1491. let format = str[str.length - 1];
  1492. if (format != "xls" && format != "xlsx") {
  1493. this.$message({
  1494. message: "请选择.xls或.xlsx文件",
  1495. type: "error"
  1496. });
  1497. } else {
  1498. this.importingData = true;
  1499. let formData = new FormData();
  1500. formData.append("file", item.file);
  1501. formData.append("companyId", this.user.companyId);
  1502. this.http.uploadFile('/report/importData', formData,
  1503. res => {
  1504. this.$refs.upload.clearFiles();
  1505. this.importingData = false;
  1506. this.showImportResult = true;
  1507. if (res.code == "ok") {
  1508. //换成弹出框,以免有人等了半天回来啥也没看到
  1509. this.importResultMsg = "成功导入"+res.data+"条工时数据。"+(res.msg?res.msg:"");;
  1510. this.getReportList();
  1511. this.importWXDialog = false;
  1512. } else {
  1513. this.importResultMsg = "导入失败:"+res.msg;
  1514. }
  1515. },
  1516. error => {
  1517. this.$refs.upload.clearFiles();
  1518. this.importingData = false;
  1519. this.$message({
  1520. message: error,
  1521. type: "error"
  1522. });
  1523. });
  1524. }
  1525. },
  1526. userssHu() {
  1527. this.http.post('/time-type/getCompanyTimeSetting',{
  1528. companyId: this.user.companyId
  1529. },
  1530. res => {
  1531. if (res.code == "ok") {
  1532. this.yonghuUser = res.data
  1533. }
  1534. },
  1535. error => {
  1536. this.$message({
  1537. message: error,
  1538. type: "error"
  1539. });
  1540. }
  1541. );
  1542. },
  1543. iptBlur(i) {
  1544. if(this.isBatch == 0) {
  1545. return
  1546. }
  1547. var stat = this.workForm.createDate[0]
  1548. var end = this.workForm.createDate[1]
  1549. // this.jsDay = 10
  1550. this.http.post('/report/getWorkDays',{
  1551. startDate: stat,
  1552. endDate: end
  1553. },
  1554. res => {
  1555. if (res.code == "ok") {
  1556. this.jsDay = res.data
  1557. this.chuji(i)
  1558. }
  1559. },
  1560. error => {
  1561. this.$message({
  1562. message: error,
  1563. type: "error"
  1564. });
  1565. }
  1566. );
  1567. var sl = this.workForm.domains
  1568. this.chuji(i)
  1569. },
  1570. chuji(i) {
  1571. if(i == 0) {
  1572. this.seleChn(1)
  1573. } else if(i == 1) {
  1574. this.seleChn(0)
  1575. } else if(i == 2) {
  1576. if(this.workForm.domains[0].multiWorktime > 0) {
  1577. this.iptChangs()
  1578. } else {
  1579. this.iptChang()
  1580. }
  1581. } else if(i == 3) {
  1582. this.seleChn(0)
  1583. }
  1584. },
  1585. seleChn(e) {
  1586. if(e == 1) {
  1587. for(var i in this.workForm.domains) {
  1588. if(this.workForm.domains[i].timeType == 0) {
  1589. this.workForm.domains[i].workingTime = 8
  1590. } else {
  1591. this.workForm.domains[i].workingTime = 4
  1592. }
  1593. }
  1594. }
  1595. var quanbu = 0
  1596. var spl = this.workForm.domains
  1597. var zhi = ''
  1598. for(var i in spl) {
  1599. var sp = +spl[i].workingTime + 0
  1600. zhi = this.jsDay * sp
  1601. quanbu = +quanbu + zhi
  1602. }
  1603. this.jsTime = quanbu
  1604. },
  1605. iptChang() {
  1606. var sl = this.workForm.domains
  1607. var quanbu = 0
  1608. var zhi = ''
  1609. for(var i in sl) {
  1610. if(sl[i].startTime && sl[i].endTime) {
  1611. var date2 = '2021/12/12 ' + sl[i].endTime +':00'
  1612. var date1 = '2021/12/12 ' + sl[i].startTime +':00'
  1613. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  1614. var leave1=date3%(24*3600*1000)
  1615. var hours=Math.floor(leave1/(3600*1000))
  1616. var leave2=leave1%(3600*1000)
  1617. var minutes=Math.floor(leave2/(60*1000))
  1618. var shi = hours+'.'+ minutes
  1619. var sll = +shi + 0
  1620. zhi = this.jsDay * sll
  1621. quanbu = +quanbu + zhi
  1622. }
  1623. }
  1624. this.jsTime = quanbu
  1625. },
  1626. iptChangs() {
  1627. var sl = this.workForm.domains
  1628. var quanbu = 0
  1629. var zhi = ''
  1630. for(var i in sl) {
  1631. for(var j in sl[i].worktimeList){
  1632. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  1633. var date2 = '2021/12/12 ' + sl[i].worktimeList[j].endTime +':00'
  1634. var date1 = '2021/12/12 ' + sl[i].worktimeList[j].startTime +':00'
  1635. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  1636. var leave1=date3%(24*3600*1000)
  1637. var hours=Math.floor(leave1/(3600*1000))
  1638. var leave2=leave1%(3600*1000)
  1639. var minutes=Math.floor(leave2/(60*1000))
  1640. var shi = hours+'.'+ minutes
  1641. var sll = +shi + 0
  1642. zhi = this.jsDay * sll
  1643. quanbu = +quanbu + zhi
  1644. }
  1645. }
  1646. }
  1647. this.jsTime = quanbu
  1648. },
  1649. removeTimeItem(item, index) {
  1650. item.worktimeList.splice(index, 1);
  1651. this.iptChangs()
  1652. },
  1653. //添加工时
  1654. addNewWorktime(index, item) {
  1655. if(item.worktimeList == null ) {
  1656. item.worktimeList = []
  1657. }
  1658. item.worktimeList.push({});
  1659. },
  1660. //复制项目
  1661. copyProject(index) {
  1662. var leftProgress = 10;
  1663. if (this.reportTimeType.type == 3) {
  1664. //计算已经待分配工时比例
  1665. let array = this.workForm.domains;
  1666. let totalProgress = 0;
  1667. for (var i=0;i<array.length; i++) {
  1668. totalProgress += array[i].progress;
  1669. }
  1670. if (totalProgress < 100) {
  1671. leftProgress = 100 - totalProgress;
  1672. }
  1673. }
  1674. var newIndex = index+1;
  1675. var itemDomain = {
  1676. projectId: this.workForm.domains[index].projectId,
  1677. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):"",
  1678. content: "",
  1679. progress:leftProgress,
  1680. state:2,//2-表示待提交
  1681. };
  1682. this.workForm.domains.splice(newIndex, 0,itemDomain);
  1683. if (this.reportTimeType.type == 0) {
  1684. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  1685. var length = this.workForm.domains.length;
  1686. if (length == 2) {
  1687. this.showAddMore = false;
  1688. }
  1689. }
  1690. this.selectProject(itemDomain, newIndex);
  1691. },
  1692. // tabupdata(){
  1693. // if(this.WorktimeDatepickValue2.length == 0){
  1694. // this.WorktimeDatepickValue2 = [this.getAutoWeekDate()[0],this.getAutoWeekDate()[6]];
  1695. // // this.showMonthNotWorkTime()
  1696. // }
  1697. // },
  1698. showWorkTime(){
  1699. this.monthWorkTimeDialog = true;
  1700. this.showMonthWorkTime()
  1701. },
  1702. handleClick(t,e){
  1703. console.log("tabname",t.name);
  1704. if (t.name == "first") {
  1705. this.showMonthWorkTime()
  1706. }else{
  1707. this.showMonthNotWorkTime()
  1708. }
  1709. },
  1710. //导出员工每日填报工时数
  1711. exportMembWorkHours() {
  1712. console.log("exportMembWorkHours",this.WorktimeDatepickValue1);
  1713. this.http.post(
  1714. "/report/exportUserDailyWorkTime",
  1715. {
  1716. // month: this.date,
  1717. startDate: this.WorktimeDatepickValue1[0],
  1718. endDate: this.WorktimeDatepickValue1[1],
  1719. },
  1720. (res) => {
  1721. if (res.code == "ok") {
  1722. let url = res.data;
  1723. console.log(res);
  1724. this.downloadByA("人员每日工时统计.xls", url);
  1725. }
  1726. },
  1727. (error) => {
  1728. this.$message({
  1729. message: error,
  1730. type: "error",
  1731. });
  1732. }
  1733. );
  1734. },
  1735. exportMembNotWorkHours() {
  1736. this.http.post(
  1737. "/report/exportNoReportUserList",
  1738. {
  1739. // month: this.date,
  1740. startDate: this.WorktimeDatepickValue2[0],
  1741. endDate: this.WorktimeDatepickValue2[1],
  1742. },
  1743. (res) => {
  1744. if (res.code == "ok") {
  1745. let url = res.data;
  1746. // console.log(res.data);
  1747. this.downloadByA("人员每日工时统计.xls", url);
  1748. console.log(url);
  1749. }
  1750. },
  1751. (error) => {
  1752. this.$message({
  1753. message: error,
  1754. type: "error",
  1755. });
  1756. }
  1757. );
  1758. },
  1759. downloadByA(name, url) {
  1760. console.log(name,url);
  1761. const a = document.createElement("a"); // 创建a标签
  1762. a.setAttribute("download", name); // download属性
  1763. a.setAttribute("href", url); // href链接
  1764. a.click(); // 自执行点击事件
  1765. a.remove();
  1766. },
  1767. // 111
  1768. showMonthWorkTime() {
  1769. this.searchKeyword1 = ''
  1770. if(this.WorktimeDatepickValue1.length == 0){
  1771. let newdate = new Date();
  1772. let nowdate = newdate.toLocaleDateString();
  1773. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  1774. this.WorktimeDatepickValue1 = nowwd
  1775. }
  1776. // this.allDate = this.alreadyAllDate(this.WorktimeDatepickValue1[0],this.WorktimeDatepickValue1[1])
  1777. this.http.post(
  1778. "/report/getUserDailyWorkTime",
  1779. // "/report/getNoReportUserList",
  1780. {
  1781. // month: this.date,
  1782. startDate: this.WorktimeDatepickValue1[0],
  1783. endDate: this.WorktimeDatepickValue1[1],
  1784. },
  1785. (res) => {
  1786. if (res.code == "ok") {
  1787. this.pickDateArray = res.data.days;
  1788. this.monthworkDate = res.data.list;
  1789. this.monthworkDateS = this.monthworkDate
  1790. this.$nextTick(function(){
  1791. this.$refs.hasworkTbl.doLayout();
  1792. });
  1793. }
  1794. },
  1795. (error) => {
  1796. this.$message({
  1797. message: error,
  1798. type: "error",
  1799. });
  1800. }
  1801. );
  1802. },
  1803. showMonthNotWorkTime() {
  1804. this.searchKeyword2 = ''
  1805. if(this.WorktimeDatepickValue2.length == 0){
  1806. let newdate = new Date();
  1807. let nowdate = newdate.toLocaleDateString();
  1808. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  1809. this.WorktimeDatepickValue2 = nowwd
  1810. }
  1811. console.log("exportMembNotWorkHours",this.WorktimeDatepickValue2);
  1812. this.http.post(
  1813. // "/report/getUserDailyWorkTime",
  1814. "/report/getNoReportUserList",
  1815. {
  1816. // month: this.date,
  1817. startDate: this.WorktimeDatepickValue2[0],
  1818. endDate: this.WorktimeDatepickValue2[1],
  1819. },
  1820. (res) => {
  1821. if (res.code == "ok") {
  1822. this.monthNotWorkDate = res.data;
  1823. this.monthNotWorkDateS = this.monthNotWorkDate
  1824. this.$forceUpdate();
  1825. // console.log("monthNotWorkDate", this.monthNotWorkDate);
  1826. }
  1827. },
  1828. (error) => {
  1829. this.$message({
  1830. message: error,
  1831. type: "error",
  1832. });
  1833. }
  1834. );
  1835. },
  1836. // 获取默认这zhou日期参数 222
  1837. getLastWeek(e){
  1838. let newdate = new Date()
  1839. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  1840. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  1841. if(e){
  1842. this.WorktimeDatepickValue1 = lastwd
  1843. this.showMonthWorkTime()
  1844. }else{
  1845. this.WorktimeDatepickValue2 = lastwd
  1846. this.showMonthNotWorkTime()
  1847. }
  1848. },
  1849. getThisWeek(e){
  1850. let newdate = new Date();
  1851. let nowdate = newdate.toLocaleDateString();
  1852. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  1853. if(e){
  1854. this.WorktimeDatepickValue1 = nowwd
  1855. this.showMonthWorkTime()
  1856. }else{
  1857. this.WorktimeDatepickValue2 = nowwd
  1858. this.showMonthNotWorkTime()
  1859. }
  1860. },
  1861. getDoubleLastWeek(e){
  1862. let newdate = new Date()
  1863. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  1864. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  1865. if(e){
  1866. this.WorktimeDatepickValue1 = nextwd
  1867. this.showMonthWorkTime()
  1868. }else{
  1869. this.WorktimeDatepickValue2 = nextwd
  1870. this.showMonthNotWorkTime()
  1871. }
  1872. },
  1873. alreadyAllDate(stime,etime){
  1874. let diffdate = new Array();
  1875. let i=0;
  1876. while(stime<=etime){
  1877. let dateArray = stime.split("-");
  1878. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  1879. let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  1880. 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]) + "日"
  1881. 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])
  1882. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  1883. let stime_ts = new Date(stime).getTime();
  1884. let next_date = stime_ts + (24*60*60*1000);
  1885. let next_dates_y = new Date(next_date).getFullYear()+'-';
  1886. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  1887. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  1888. stime = next_dates_y+next_dates_m+next_dates_d;
  1889. i++;
  1890. }
  1891. return diffdate
  1892. },
  1893. getAutoWeekDate(e) {
  1894. let dateString = e;
  1895. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  1896. if (dateString.match(dateStringReg)) {
  1897. let presentDate = new Date(dateString),
  1898. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  1899. return Array.from(new Array(7), function (val, index) {
  1900. let formatDate = new Date(
  1901. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  1902. );
  1903. return (
  1904. formatDate.getFullYear() +
  1905. "-" +
  1906. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  1907. "-" +
  1908. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  1909. );
  1910. });
  1911. } else {
  1912. throw new Error(
  1913. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  1914. );
  1915. }
  1916. },
  1917. onProgressChange() {
  1918. this.$forceUpdate();
  1919. },
  1920. showChooseMembTree() {
  1921. this.chosenMembCount = this.participator.length;
  1922. this.chooseParticipVisible = true;
  1923. },
  1924. onTreeItemChange() {
  1925. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  1926. var list = chosenList.filter(item=>item.isUser == 1);
  1927. this.chosenMembCount = list.length;
  1928. },
  1929. findUserInTree() {
  1930. if (this.filterName == '') {
  1931. this.deptMembData = this.allMembData;
  1932. } else {
  1933. var list = this.findRecursively(this.filterName, this.allMembData);
  1934. this.deptMembData = list;
  1935. }
  1936. },
  1937. findRecursively(username, list) {
  1938. var filterList = [];
  1939. for (var i=0;i<list.length; i++) {
  1940. if (list[i].isUser == 1) {
  1941. if (list[i].label.indexOf(username) >= 0) {
  1942. //匹配上了
  1943. filterList.push(list[i]);
  1944. }
  1945. } else if (list[i].children != null && list[i].children.length > 0) {
  1946. var subList = this.findRecursively(username, list[i].children);
  1947. if (subList.length > 0) {
  1948. subList.forEach(s=>filterList.push(s));
  1949. }
  1950. }
  1951. }
  1952. return filterList;
  1953. },
  1954. //确定选择参与人
  1955. chooseParticip() {
  1956. this.chooseParticipVisible = false;
  1957. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  1958. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  1959. this.workForm.userNames = '';
  1960. this.workForm.userId = [];
  1961. this.participator = [];
  1962. for (var i=0;i<this.chosenMembList.length; i++) {
  1963. this.workForm.userId.push(this.chosenMembList[i].id);
  1964. this.workForm.userNames += this.chosenMembList[i].label+',';
  1965. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  1966. this.participator.push(item);
  1967. }
  1968. if (this.workForm.userNames.length > 0) {
  1969. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  1970. }
  1971. },
  1972. //微信通知人员填写
  1973. weixinNotify() {
  1974. if (this.fillMembList.length == 0) return;
  1975. var ids = '';
  1976. this.fillMembList.forEach(f=>{
  1977. ids += f.id+',';
  1978. })
  1979. this.http.post('/user/pushFillReport',{
  1980. ids: ids, date: this.curDate
  1981. },
  1982. res => {
  1983. if (res.code == "ok") {
  1984. this.$message({
  1985. message: '已发送成功',
  1986. type: "success"
  1987. });
  1988. }
  1989. },
  1990. error => {
  1991. this.$message({
  1992. message: error,
  1993. type: "error"
  1994. });
  1995. }
  1996. );
  1997. },
  1998. //导出人员列表
  1999. exportMemb() {
  2000. if (this.fillMembList.length == 0) return;
  2001. var ids = '';
  2002. this.fillMembList.forEach(f=>{
  2003. ids += f.id+',';
  2004. })
  2005. this.http.post('/user/exportMembList',{
  2006. ids: ids,isFill: this.isFill, date: this.curDate
  2007. },
  2008. res => {
  2009. if (res.code == "ok") {
  2010. var aTag = document.createElement('a');
  2011. aTag.download = this.curDate+(this.isFill?"已填":"未填")+"人员列表.xls";
  2012. aTag.href = res.data;
  2013. aTag.click();
  2014. }
  2015. },
  2016. error => {
  2017. this.$message({
  2018. message: error,
  2019. type: "error"
  2020. });
  2021. }
  2022. );
  2023. },
  2024. showMembList(fill) {
  2025. this.membListVisible = true;
  2026. if (fill == 0) {
  2027. this.fillMembList = this.unFillList;
  2028. this.isFill = false;
  2029. } else {
  2030. this.fillMembList = this.fillList;
  2031. this.isFill = true;
  2032. }
  2033. },
  2034. //获取自己填写的日报状态
  2035. getReportFillStatus() {
  2036. this.http.post('/report/getReportFillStatus',{
  2037. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  2038. },
  2039. res => {
  2040. if (res.code == "ok") {
  2041. this.fillStatusList = res.data;
  2042. this.allDate.forEach(d=>{
  2043. var fillInfo = null;
  2044. d.state = null;
  2045. this.fillStatusList.forEach(s=>{
  2046. var d1 = s.createDate.split('-')[2];
  2047. var d2 = d.date.split('月')[1].split('日')[0];
  2048. if (d1.indexOf('0') == 0) {
  2049. d1 = d1.substring(1,d1.length);
  2050. }
  2051. if (d1 == d2) {
  2052. d.state = s.state;
  2053. }
  2054. })
  2055. })
  2056. this.$forceUpdate();
  2057. }
  2058. },
  2059. error => {
  2060. this.$message({
  2061. message: error,
  2062. type: "error"
  2063. });
  2064. }
  2065. );
  2066. },
  2067. scrollFunction () {
  2068. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  2069. if (this.domObj.attachEvent) { // IE
  2070. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  2071. } else if (this.domObj.addEventListener) {
  2072. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  2073. }
  2074. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  2075. },
  2076. mouseScroll(event) { // google 浏览器下
  2077. let detail = event.wheelDelta || event.detail
  2078. let moveForwardStep = -1
  2079. let moveBackStep = 1
  2080. let step = 0
  2081. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  2082. event.preventDefault() // 阻止浏览器默认事件
  2083. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  2084. },
  2085. // //左右滚动
  2086. // wheel(e){
  2087. // var a = document.getElementById("dateScroll");
  2088. // var scroll_width = 80; //滚动一下的距离
  2089. // var e = e || window.event, v;
  2090. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  2091. // if(v>3||-v>3) v=-v;
  2092. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  2093. // e.preventDefault(); //阻止浏览器的默认滚动
  2094. // },
  2095. showExportDialog() {
  2096. this.exportDialog = true;
  2097. },
  2098. showExportTimeDialog() {
  2099. this.exportTimeDialog = true;
  2100. },
  2101. changeAllTime() {
  2102. //总时长发生改变,自动按比例计算
  2103. this.workForm.domains.forEach(d=>{
  2104. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2105. });
  2106. },
  2107. // 是否加班的单机事件
  2108. check() {
  2109. this.selected = !this.selected
  2110. this.isNew = this.selected
  2111. },
  2112. updateSubProject() {
  2113. this.$forceUpdate();
  2114. },
  2115. //项目选中了, 加载子项目
  2116. selectProject(domain, index) {
  2117. console.log(domain, index, '加载')
  2118. this.http.post('/sub-project/list',{
  2119. projectId: domain.projectId
  2120. },
  2121. res => {
  2122. //清空之前选中的子项目
  2123. // this.workForm.domains[index].subProjectId = 0;
  2124. if (res.code == "ok") {
  2125. this.workForm.domains[index].subProjectList = res.data;
  2126. this.workForm.domains[index].subProjectId = null;
  2127. this.$forceUpdate();
  2128. }
  2129. },
  2130. error => {
  2131. this.$message({
  2132. message: error,
  2133. type: "error"
  2134. });
  2135. }
  2136. );
  2137. //项目相关的近期任务
  2138. if (this.user.company.packageProject == 1) {
  2139. this.http.post('/task/getRecentTask',{
  2140. projectId: domain.projectId,
  2141. isSubstitude:this.isSubstitude?1:0
  2142. },
  2143. res => {
  2144. if (res.code == "ok") {
  2145. this.workForm.domains[index].allTaskList = res.data;
  2146. this.workForm.domains[index].taskList = res.data;
  2147. this.$forceUpdate();
  2148. }
  2149. },
  2150. error => {
  2151. this.$message({
  2152. message: error,
  2153. type: "error"
  2154. });
  2155. }
  2156. );
  2157. }
  2158. //获取项目相关专业
  2159. if (this.user.company.packageEngineering == 1) {
  2160. this.getProjectProfessions(domain, index);
  2161. }
  2162. // 获取项目相关的维度
  2163. this.dimension(domain, index);
  2164. //获取项目下的任务分组
  2165. this.getTaskGroups(domain, index);
  2166. //获取项目审核人
  2167. this.getProjectAuditorList(domain, index);
  2168. },
  2169. //获取项目审核人
  2170. getProjectAuditorList(domainItem, index) {
  2171. if(domainItem.projectId == '') {
  2172. return
  2173. }
  2174. domainItem.projectAuditorId = null;
  2175. domainItem.projectAuditorName = null;
  2176. this.http.post('/project-auditor/getList',{
  2177. projectId: domainItem.projectId,
  2178. },
  2179. res => {
  2180. if (res.code == "ok") {
  2181. domainItem.auditUserList = res.data;
  2182. if (res.data.length==1) {
  2183. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  2184. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  2185. }
  2186. this.$forceUpdate();
  2187. }
  2188. },
  2189. error => {
  2190. this.$message({
  2191. message: error,
  2192. type: "error"
  2193. });
  2194. }
  2195. );
  2196. },
  2197. // 获取维度数据
  2198. dimension(domain, index) {
  2199. if(domain.projectId == '') {
  2200. return
  2201. }
  2202. this.http.post('/project/getDegreeList',{
  2203. projectId: domain.projectId,
  2204. },
  2205. res => {
  2206. if (res.code == "ok") {
  2207. this.workForm.domains[index].wuduList = res.data
  2208. // this.workForm = this.workForm
  2209. this.$forceUpdate()
  2210. }
  2211. },
  2212. error => {
  2213. this.$message({
  2214. message: error,
  2215. type: "error"
  2216. });
  2217. }
  2218. );
  2219. },
  2220. //切换任务阶段
  2221. changeStages(domain, index) {
  2222. if (domain.stage == null || domain.stage == '') {
  2223. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  2224. } else {
  2225. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  2226. }
  2227. this.$forceUpdate();
  2228. },
  2229. getGroupStages(domain, index) {
  2230. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  2231. res => {
  2232. if (res.code == "ok") {
  2233. this.workForm.domains[index].stage = '';
  2234. this.workForm.domains[index].stages = res.data;
  2235. this.$forceUpdate();
  2236. }
  2237. },
  2238. error => {
  2239. this.$message({
  2240. message: error,
  2241. type: "error"
  2242. });
  2243. });
  2244. },
  2245. getProjectProfessions(domain, index) {
  2246. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  2247. res => {
  2248. if (res.code == "ok") {
  2249. this.workForm.domains[index].professionProgress = res.data;
  2250. this.$forceUpdate();
  2251. }
  2252. },
  2253. error => {
  2254. this.$message({
  2255. message: error,
  2256. type: "error"
  2257. });
  2258. });
  2259. },
  2260. //删除自己的日报
  2261. deleteReport() {
  2262. this.$confirm("确定要删除该日报吗?","提示", {
  2263. confirmButtonText: "确定",
  2264. cancelButtonText: "取消",
  2265. type: "warning"
  2266. })
  2267. .then(() => {
  2268. this.listLoading = true;
  2269. this.http.post('/report/delete',{
  2270. userId: this.user.id,
  2271. date: this.workForm.createDate
  2272. },
  2273. res => {
  2274. this.listLoading = false;
  2275. if (res.code == "ok") {
  2276. this.$message({
  2277. message: "删除成功",
  2278. type: "success"
  2279. });
  2280. this.getReportList();
  2281. this.getDepartment();
  2282. this.dialogVisible = false;
  2283. } else {
  2284. this.$message({
  2285. message: res.msg,
  2286. type: "error"
  2287. });
  2288. }
  2289. },
  2290. error => {
  2291. this.listLoading = false;
  2292. this.$message({
  2293. message: error,
  2294. type: "error"
  2295. });
  2296. }
  2297. );
  2298. })
  2299. .catch(() => {});
  2300. },
  2301. // 管理员删除日报
  2302. guanli(item) {
  2303. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  2304. let param = {date: this.date + day, userId: item.id};
  2305. this.$confirm("确定要删除该日报吗?","提示", {
  2306. confirmButtonText: "确定",
  2307. cancelButtonText: "取消",
  2308. type: "warning"
  2309. })
  2310. .then(() => {
  2311. this.listLoading = true;
  2312. this.http.post('/report/delete',param,
  2313. res => {
  2314. this.listLoading = false;
  2315. if (res.code == "ok") {
  2316. this.$message({
  2317. message: "删除成功",
  2318. type: "success"
  2319. });
  2320. this.getReportList();
  2321. this.getDepartment();
  2322. this.dialogVisible = false;
  2323. } else {
  2324. this.$message({
  2325. message: res.msg,
  2326. type: "error"
  2327. });
  2328. }
  2329. },
  2330. error => {
  2331. this.listLoading = false;
  2332. this.$message({
  2333. message: error,
  2334. type: "error"
  2335. });
  2336. }
  2337. );
  2338. })
  2339. .catch(() => {});
  2340. },
  2341. //提交批量审核数据
  2342. submitBatchApprove() {
  2343. var data = this.$refs.approveTree.getCheckedNodes();
  2344. var ids = '';
  2345. if (data.length == 0) {
  2346. this.$message({
  2347. message: '请选择要审核的人员',
  2348. type: "error"
  2349. });
  2350. return;
  2351. }
  2352. for (var i=0;i<data.length; i++) {
  2353. ids += data[i].id;
  2354. if (i < data.length-1) {
  2355. ids += ',';
  2356. }
  2357. }
  2358. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  2359. this.http.post("/report/batchApproveReport", {ids:ids, date:this.date + day},
  2360. res => {
  2361. if (res.code == "ok") {
  2362. this.$message({
  2363. message: '审核成功',
  2364. type: "success"
  2365. });
  2366. this.getReportList();
  2367. this.getDepartment();
  2368. this.approveDialogVisible = false;
  2369. } else {
  2370. this.$message({
  2371. message: res.msg,
  2372. type: "error"
  2373. });
  2374. }
  2375. },
  2376. error => {
  2377. this.$message({
  2378. message: error,
  2379. type: "error"
  2380. });
  2381. });
  2382. },
  2383. selectAll() {
  2384. if (this.isAllSelect) {
  2385. var keys = [];
  2386. this.reportNames.forEach(b=>{
  2387. keys.push(b.id);
  2388. })
  2389. this.$refs.approveTree.setCheckedKeys(keys);
  2390. } else {
  2391. this.$refs.approveTree.setCheckedKeys([]);
  2392. }
  2393. },
  2394. //批量审核
  2395. batchApprove() {
  2396. this.approveDialogVisible = true;
  2397. this.reportNames = [];
  2398. for (var i=0;i<this.reportList.length; i++) {
  2399. var report = this.reportList[i];
  2400. var hasUnChecked =false;
  2401. var id = '';
  2402. for (var j=0;j<report.data.length; j++) {
  2403. if (report.data[j].state == 0
  2404. && (this.user.company.packageEngineering==0 || (this.user.company.packageEngineering==1 && report.data[j].departmentAuditState == 1))
  2405. && (permissions.projectReportReview || report.data[j].projectAuditorId == this.user.id)) {
  2406. hasUnChecked = true;
  2407. id += report.data[j].id+',';
  2408. }
  2409. }
  2410. if (hasUnChecked) {
  2411. this.reportNames.push({id:id, label: report.name});
  2412. }
  2413. }
  2414. },
  2415. removeEmptyNode(list) {
  2416. for (var i=0;i<list.length;i++) {
  2417. var cnt = 0;
  2418. if (list[i].membCount == 0) {
  2419. list.splice(i, 1);
  2420. i--;
  2421. } else if (list[i].children != null) {
  2422. this.removeEmptyNode(list[i].children);
  2423. }
  2424. }
  2425. },
  2426. calculateMembCount(list) {
  2427. for (var i in list) {
  2428. var cnt = 0;
  2429. if (list[i].children != null) {
  2430. this.calculateMembCount(list[i].children);
  2431. for (var m in list[i].children) {
  2432. cnt += list[i].children[m].membCount;
  2433. }
  2434. }
  2435. if (list[i].isUser == 1) {
  2436. cnt++;
  2437. this.membCount++;
  2438. }
  2439. list[i].membCount = cnt;
  2440. }
  2441. },
  2442. stateChange() {
  2443. this.membCount = 0;
  2444. if (this.selectState == -1) {
  2445. //全部状态
  2446. this.data = this.allData;
  2447. } else {
  2448. //未填报
  2449. var newData = JSON.parse(JSON.stringify(this.allData));
  2450. this.filterState(this.selectState, newData);
  2451. this.data = newData;
  2452. }
  2453. this.calculateMembCount(this.data);
  2454. this.data[0].membCount = this.membCount;//总人数
  2455. },
  2456. //按状态过滤部门人员
  2457. filterState(state, list) {
  2458. for (var i =0;i<list.length; i++) {
  2459. var obj = list[i];
  2460. if (obj.isUser == 1) {
  2461. var match = false;
  2462. if (state == -2) {
  2463. if (obj.state == null) {
  2464. match = true;
  2465. }
  2466. } else {
  2467. if (obj.state == state) {
  2468. match = true;
  2469. }
  2470. }
  2471. if (!match) {
  2472. list.splice(i, 1);
  2473. i--;
  2474. } else {
  2475. }
  2476. } else {
  2477. if (obj.children != null) {
  2478. this.filterState(state, obj.children);
  2479. }
  2480. }
  2481. }
  2482. },
  2483. // 部门列表点击
  2484. handleNodeClick(data) {
  2485. // this.dealList = data
  2486. this.theValues(data.id, this.allData)
  2487. // this.depData = data;
  2488. var list = [];
  2489. if (data.id == -1) {
  2490. this.deptId = null;
  2491. this.targetUid = null;
  2492. list = this.data;
  2493. } else if (data.isUser == 1) {
  2494. this.deptId = null;
  2495. this.targetUid = data.id;
  2496. } else {
  2497. this.deptId = data.id;
  2498. this.targetUid = null;
  2499. list.push(data);
  2500. }
  2501. this.getReportList();
  2502. if (list.length > 0) {
  2503. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  2504. this.fillList = this.getUserMembListFromDeptList(list, 1)
  2505. }
  2506. console.log(this.depData.isUser)
  2507. console.log(this.depData.membCount)
  2508. console.log(this.depData)
  2509. },
  2510. theValues(id, item) {
  2511. for(var i in item) {
  2512. if(item[i].id == id) {
  2513. this.depData = item[i]
  2514. return
  2515. } else {
  2516. if(item[i].children) {
  2517. this.theValues(id, item[i].children)
  2518. }
  2519. }
  2520. }
  2521. },
  2522. //获取可以选择的代填的人员列表
  2523. getSubstitudeUserDeptList() {
  2524. if (this.deptMembData.length == 0) {
  2525. this.http.post("/department/listMyMembs", {},
  2526. res => {
  2527. if (res.code == "ok") {
  2528. let noAllData = JSON.parse(JSON.stringify(res.data));
  2529. if (noAllData.length > 0) {
  2530. if (noAllData[0].label == '全部人员') {
  2531. noAllData.splice(0,1);
  2532. }
  2533. }
  2534. this.setUserToDept(noAllData);
  2535. this.deptMembData = noAllData;
  2536. } else {
  2537. this.$message({
  2538. message: res.msg,
  2539. type: "error"
  2540. });
  2541. }
  2542. },
  2543. error => {
  2544. this.$message({
  2545. message: error,
  2546. type: "error"
  2547. });
  2548. });
  2549. }
  2550. },
  2551. // 获取部门列表
  2552. getDepartment() {
  2553. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  2554. var param = {date:this.date + day};
  2555. if (this.user.manageDeptId != 0 && !this.permissions.reportsCompany) {
  2556. param.manageDeptId = this.user.manageDeptId;
  2557. }
  2558. this.http.post("/report/getMembList", param,
  2559. res => {
  2560. if (res.code == "ok") {
  2561. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  2562. // let noAllData = JSON.parse(JSON.stringify(res.data));
  2563. // if (this.user.role > 0) {
  2564. // }
  2565. list.splice(0,0,{
  2566. id: -1,
  2567. label: '全部人员',
  2568. })
  2569. this.membCount = 0;
  2570. //设置员工到部门下面
  2571. this.setUserToDept(list);
  2572. this.data = list;
  2573. this.allData = list;
  2574. // if (noAllData.length > 0) {
  2575. // if (noAllData[0].label == '全部人员') {
  2576. // noAllData.splice(0,1);
  2577. // }
  2578. // }
  2579. // this.setUserToDept(noAllData);
  2580. // this.deptMembData = noAllData;
  2581. this.option = this.changeArr(list1);
  2582. list[0].membCount = this.membCount;
  2583. if (this.depData.id == -1) {
  2584. this.depData.membCount = this.membCount;
  2585. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  2586. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  2587. } else {
  2588. if (this.depData.isUser == null) {
  2589. var dep = this.findTargetDept(this.data, this.depData.id);
  2590. var membDeptList = [];
  2591. membDeptList.push(dep);
  2592. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  2593. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  2594. }
  2595. }
  2596. if (this.depData.isUser == null) {
  2597. if (this.isFill) {
  2598. this.fillMembList = this.fillList;
  2599. } else {
  2600. this.fillMembList = this.unFillList;
  2601. }
  2602. }
  2603. this.stateChange()
  2604. } else {
  2605. this.$message({
  2606. message: res.msg,
  2607. type: "error"
  2608. });
  2609. }
  2610. },
  2611. error => {
  2612. this.$message({
  2613. message: error,
  2614. type: "error"
  2615. });
  2616. });
  2617. this.getReportFillStatus();
  2618. },
  2619. findTargetDept(list, deptId) {
  2620. var t = null;
  2621. for (var i=0;i<list.length; i++) {
  2622. if (list[i].isUser == null && list[i].id == deptId) {
  2623. t = list[i];
  2624. break;
  2625. }
  2626. }
  2627. if (t == null) {
  2628. for (var i=0;i<list.length; i++) {
  2629. if (list[i].children != null && list[i].children.length > 0) {
  2630. t = this.findTargetDept(list[i].children, deptId);
  2631. if (t != null) {
  2632. break;
  2633. }
  2634. }
  2635. }
  2636. }
  2637. return t;
  2638. },
  2639. getUserMembListFromDeptList(list, isFill) {
  2640. var membList = [];
  2641. for (var i in list) {
  2642. var deptName = list[i].label;
  2643. if (list[i].userList != null) {
  2644. list[i].userList.forEach(element => {
  2645. if (isFill == 0) {
  2646. //获取未填的
  2647. if (element.state == null) {
  2648. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName};
  2649. membList.push(obj);
  2650. }
  2651. } else {
  2652. if (element.state != null) {
  2653. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName};
  2654. membList.push(obj);
  2655. }
  2656. }
  2657. });
  2658. }
  2659. if (list[i].children != null) {
  2660. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  2661. }
  2662. }
  2663. return membList;
  2664. },
  2665. setUserToDept(list) {
  2666. for (var i in list) {
  2667. var cnt = 0;
  2668. if (list[i].children != null) {
  2669. this.setUserToDept(list[i].children);
  2670. for (var m in list[i].children) {
  2671. cnt += list[i].children[m].membCount;
  2672. }
  2673. }
  2674. if (list[i].userList != null) {
  2675. if (list[i].children == null) {
  2676. list[i].children = [];
  2677. }
  2678. list[i].userList.forEach(element => {
  2679. var obj = {id: element.id, label:element.name, state:element.state, parentId:element.departmentId, isUser:1};
  2680. list[i].children.push(obj);
  2681. this.membCount++;
  2682. cnt++;
  2683. });
  2684. }
  2685. list[i].membCount = cnt;
  2686. }
  2687. },
  2688. // 修改数组
  2689. changeArr(arr) {
  2690. for (var i = 0; i < arr.length; i++) {
  2691. if(arr[i].id != -1 && arr[i].id != 0) {
  2692. if (arr[i].children != null && arr[i].children.length>0) {
  2693. arr[i].children = this.changeArr(arr[i].children);
  2694. }
  2695. arr[i].id && (arr[i].value = arr[i].id);
  2696. delete arr[i].id;
  2697. }
  2698. }
  2699. for(var i in arr) {
  2700. if(arr[i].id == -1 || arr[i].id == 0) {
  2701. arr.splice(i,1)
  2702. }
  2703. }
  2704. return arr;
  2705. },
  2706. //时间段范围设置改动,监听
  2707. onTimeTypeChange(timeType) {
  2708. this.seleChn(1)
  2709. this.showAddMore = true;
  2710. for(var i in this.workForm.domains) {
  2711. if (this.workForm.domains[i].timeType == 0) {
  2712. this.showAddMore = false;
  2713. break;
  2714. }
  2715. }
  2716. if (this.showAddMore) {
  2717. //检测数量
  2718. if (this.workForm.domains.length == 2) {
  2719. this.showAddMore = false;
  2720. } else {
  2721. this.showAddMore = true;
  2722. }
  2723. }
  2724. },
  2725. getTimeType() {
  2726. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  2727. res => {
  2728. if (res.code == "ok") {
  2729. var t = res.data;
  2730. this.reportTimeType = t;
  2731. if (this.reportTimeType.type > 0) {
  2732. this.showAddMore = true;
  2733. }
  2734. //转化时间格式
  2735. if (t.allday != null) {
  2736. this.timeType.push({value:0, label:'全天 - '+t.allday+'小时', hours:t.allday});
  2737. }
  2738. if (t.am != null) {
  2739. this.timeType.push({value:1, label:'上午 - '+t.am+'小时', hours: t.am});
  2740. }
  2741. if (t.pm != null) {
  2742. this.timeType.push({value:2, label:'下午 - '+t.pm+'小时', hours: t.pm});
  2743. }
  2744. } else {
  2745. this.$message({
  2746. message: res.msg,
  2747. type: "error"
  2748. });
  2749. }
  2750. },
  2751. error => {
  2752. this.listLoading = false;
  2753. this.$message({
  2754. message: error,
  2755. type: "error"
  2756. });
  2757. });
  2758. },
  2759. // 改变月份
  2760. changeMonthOut() {
  2761. this.getAllDate();
  2762. this.getReportList();
  2763. this.getDepartment();
  2764. },
  2765. // 选择日期
  2766. choseDate(i, item) {
  2767. this.choseDay = i;
  2768. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  2769. sessionStorage.msg = this.date + day,
  2770. this.getReportList();
  2771. this.getDepartment();
  2772. this.curDate = item.date;
  2773. },
  2774. // 获取日期列表
  2775. getAllDate() {
  2776. var dayArry = [];
  2777. var day = this.getCountDays();
  2778. let curMonthDay = null;
  2779. for (var k = 1; k <= day; k++) {
  2780. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + "月" + k+'日';
  2781. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  2782. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  2783. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  2784. if(sessionStorage.msg) {
  2785. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  2786. this.choseDay = k - 1;
  2787. curMonthDay = str;
  2788. }
  2789. } else {
  2790. if (new Date().getDate() == k) {
  2791. this.choseDay = k - 1;
  2792. }
  2793. }
  2794. } else {
  2795. this.choseDay = 0;
  2796. }
  2797. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  2798. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  2799. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  2800. }
  2801. this.allDate = dayArry;
  2802. //不能超过最大日期
  2803. if (this.choseDay > day-1) {
  2804. this.choseDay = day-1;
  2805. }
  2806. //从消息点击跳转过来的,直接加载指定日期
  2807. if (sessionStorage.from == 1 && sessionStorage.msg) {
  2808. this.curDate = sessionStorage.msg;
  2809. sessionStorage.from = 0;
  2810. } else {
  2811. if (curMonthDay != null) {
  2812. this.curDate = curMonthDay;
  2813. } else {
  2814. var d = new Date(this.date.replace(/-/g, "/")+'/01')
  2815. this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  2816. }
  2817. }
  2818. this.getReportFillStatus();
  2819. },
  2820. getCountDays() {
  2821. var newstr = this.date.replace(/-/g, "/");
  2822. var curDate = new Date(newstr+'/01');
  2823. var curMonth = curDate.getMonth();
  2824. curDate.setMonth(curMonth + 1);
  2825. curDate.setDate(0);
  2826. return curDate.getDate();
  2827. },
  2828. //获取日报列表
  2829. getReportList() {
  2830. this.listLoading = true;
  2831. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  2832. let param = {date: this.date + day};
  2833. if (this.deptId != null) {
  2834. param.deptId = this.deptId;
  2835. }
  2836. if (this.targetUid != null) {
  2837. param.userId = this.targetUid;
  2838. }
  2839. this.http.post( this.port.report.list, param,
  2840. res => {
  2841. this.listLoading = false;
  2842. if (res.code == "ok") {
  2843. this.reportList = res.data;
  2844. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  2845. // this.dealWith()
  2846. } else {
  2847. this.$message({
  2848. message: res.msg,
  2849. type: "error"
  2850. });
  2851. }
  2852. },
  2853. error => {
  2854. this.listLoading = false;
  2855. this.$message({
  2856. message: error,
  2857. type: "error"
  2858. });
  2859. });
  2860. },
  2861. // 处理数据
  2862. // dealWith() {
  2863. // var tianxie = 0
  2864. // var weixtianxie = 0
  2865. // if(this.selectState == -1) {
  2866. // } else {
  2867. // var arr = []
  2868. // for (var i in this.reportList) {
  2869. // arr.push(this.reportList[i].id)
  2870. // }
  2871. // this.getDealWith(this.dealList.children, tianxie, weixtianxie, arr)
  2872. // }
  2873. // },
  2874. // getDealWith(item, tx, wtx, arr) {
  2875. // // console.log(item,12345)
  2876. // for(var i in item) {
  2877. // if(item[i].children) {
  2878. // this.getDealWith(item[i].children, tx, wtx, arr)
  2879. // } else {
  2880. // console.log(arr.indexOf(item[i].id))
  2881. // console.log(arr)
  2882. // console.log(item[i].id)
  2883. // if(arr.indexOf(item[i].id) != '-1') {
  2884. // tx = +tx + 1
  2885. // }
  2886. // }
  2887. // }
  2888. // console.log(tx, '看看值')
  2889. // },
  2890. //导出员工工时统计
  2891. exportUserTime() {
  2892. this.listLoading = true;
  2893. var param = {};
  2894. if (this.exportParam.dateRange != null) {
  2895. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  2896. }
  2897. this.http.post('/department/exportDeptStatistic', param,
  2898. res => {
  2899. this.listLoading = false;
  2900. if (res.code == "ok") {
  2901. location.href = res.data;
  2902. this.exportTimeDialog = false;
  2903. } else {
  2904. this.$message({
  2905. message: res.msg,
  2906. type: "error"
  2907. });
  2908. }
  2909. },
  2910. error => {
  2911. this.listLoading = false;
  2912. this.$message({
  2913. message: error,
  2914. type: "error"
  2915. });
  2916. });
  2917. },
  2918. //导出日报
  2919. exportReport() {
  2920. this.listLoading = true;
  2921. var param = {};
  2922. if (this.exportParam.dateRange != null) {
  2923. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  2924. }
  2925. if (this.exportParam.projectId != null) {
  2926. param.projectId = this.exportParam.projectId;
  2927. }
  2928. this.http.post( this.port.report.export, param,
  2929. res => {
  2930. this.listLoading = false;
  2931. if (res.code == "ok") {
  2932. location.href = res.data;
  2933. this.exportDialog = false;
  2934. } else {
  2935. this.$message({
  2936. message: res.msg,
  2937. type: "error"
  2938. });
  2939. }
  2940. },
  2941. error => {
  2942. this.listLoading = false;
  2943. this.$message({
  2944. message: error,
  2945. type: "error"
  2946. });
  2947. });
  2948. },
  2949. //获取项目列表
  2950. getProjectList() {
  2951. this.listLoading = true;
  2952. this.http.post( this.port.project.list, {},
  2953. res => {
  2954. this.listLoading = false;
  2955. if (res.code == "ok") {
  2956. this.projectList = res.data;
  2957. // console.log("项目列表",this.projectList);
  2958. } else {
  2959. this.$message({
  2960. message: res.msg,
  2961. type: "error"
  2962. });
  2963. }
  2964. },
  2965. error => {
  2966. this.listLoading = false;
  2967. this.$message({
  2968. message: error,
  2969. type: "error"
  2970. });
  2971. });
  2972. },
  2973. // 获取个人某天的日报
  2974. getReport() {
  2975. this.http.post( this.port.report.getPort, {
  2976. date: this.workForm.createDate
  2977. },
  2978. res => {
  2979. if (res.code == "ok") {
  2980. var quanbu = 0
  2981. this.jsDay = 1
  2982. var zhi = ''
  2983. var slp = res.data.report
  2984. for(var i in slp) {
  2985. var sp = +slp[i].workingTime + 0
  2986. zhi = this.jsDay * sp
  2987. quanbu = +quanbu + zhi
  2988. }
  2989. this.jsTime = quanbu
  2990. var list = res.data;
  2991. this.report = list;
  2992. if(list.report.length != 0) {
  2993. var arr = [];
  2994. this.canEdit = false;
  2995. for(var i in list.report) {
  2996. var flg = null
  2997. list.report[i].isOvertime == 1 ? flg = true : flg = false
  2998. arr.push({
  2999. id: list.report[i].id,
  3000. projectId: list.report[i].projectId,
  3001. workingTime: list.report[i].workingTime,
  3002. content: list.report[i].content,
  3003. state: list.report[i].state,
  3004. timeType: list.report[i].timeType,
  3005. subProjectList: list.report[i].subProjectList,
  3006. taskList: list.report[i].taskList,
  3007. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  3008. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  3009. taskId: list.report[i].taskId,
  3010. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  3011. startTime: list.report[i].startTime,
  3012. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  3013. endTime: list.report[i].endTime,
  3014. isOvertime: flg,
  3015. progress:list.report[i].progress,
  3016. professionProgress: list.report[i].professionProgressList,
  3017. stages:list.report[i].stages,
  3018. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  3019. pics: list.report[i].pics,
  3020. multiWorktime: list.report[i].multiWorktime,
  3021. worktimeList: list.report[i].worktimeList,
  3022. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  3023. wuduList: list.report[i].degreeList,
  3024. taskGroups:list.report[i].taskGroups,
  3025. customData: list.report[i].customData,//自定义的数值
  3026. auditUserList: list.report[i].auditUserList,
  3027. projectAuditorId: list.report[i].projectAuditorId,
  3028. projectAuditorName: list.report[i].projectAuditorName,
  3029. })
  3030. if (list.report[i].state >= 2) {
  3031. this.canEdit = true;
  3032. }
  3033. }
  3034. this.workForm = {
  3035. createDate: this.workForm.createDate,
  3036. domains: arr,
  3037. userNames:null,
  3038. userId:null,
  3039. }
  3040. } else {
  3041. this.workForm = {
  3042. createDate: this.workForm.createDate,
  3043. domains: [{
  3044. id: null,
  3045. projectId: "",
  3046. workingTime: this.reportTimeType.type==3?(this.reportTimeType.allday).toFixed(1):"",
  3047. content: "",
  3048. progress:100,
  3049. state: 2,
  3050. timeType:0,
  3051. multiWorktime: this.reportTimeType.multiWorktime,
  3052. worktimeList:[{}],
  3053. }],
  3054. userId:null,
  3055. userNames:null,
  3056. }
  3057. this.canEdit = true;
  3058. }
  3059. } else {
  3060. this.$message({
  3061. message: res.msg,
  3062. type: "error"
  3063. });
  3064. }
  3065. },
  3066. error => {
  3067. this.$message({
  3068. message: error,
  3069. type: "error"
  3070. });
  3071. });
  3072. },
  3073. guanbi() {
  3074. this.falsss = false
  3075. },
  3076. // wuduLists(id) {
  3077. // this.http.post('/project/getDegreeList',{
  3078. // projectId: id,
  3079. // },
  3080. // res => {
  3081. // if (res.code == "ok") {
  3082. // return res.data
  3083. // }
  3084. // },
  3085. // error => {
  3086. // this.$message({
  3087. // message: error,
  3088. // type: "error"
  3089. // });
  3090. // }
  3091. // );
  3092. // },
  3093. // 打开日报填写
  3094. fillInReport(i, isBatch) {
  3095. if(i != 1) {
  3096. this.falsss = false
  3097. } else {
  3098. this.falsss = true
  3099. }
  3100. if (this.isSubstitude) {
  3101. this.getSubstitudeUserDeptList();
  3102. }
  3103. if(i == -1 || this.isSubstitude) {
  3104. this.isDisable = false;
  3105. } else {
  3106. this.isDisable = true;
  3107. }
  3108. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3109. this.isBatch = isBatch;
  3110. if (this.isBatch == 0 && !this.isSubstitude) {
  3111. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  3112. this.getReport(i);
  3113. } else {
  3114. this.workForm = {
  3115. createDate: null,//批量填报没有日期
  3116. domains: [{
  3117. id: null,
  3118. projectId: "",
  3119. workingTime: this.reportTimeType.type==3?(this.reportTimeType.allday).toFixed(1):"",
  3120. content: "",
  3121. progress:100,
  3122. state: 2,
  3123. timeType:0,
  3124. multiWorktime: this.reportTimeType.multiWorktime,
  3125. worktimeList:[{}],
  3126. }],
  3127. }
  3128. this.canEdit = true;
  3129. }
  3130. this.dialogVisible = true;
  3131. },
  3132. // 按周填报里内容的填写
  3133. tianxies(item, i, names, row) {
  3134. console.log(item, i, names, row[0], '你好')
  3135. var idd = ''
  3136. var obj = {}
  3137. for(var l in this.projectList) {
  3138. if(this.projectList[l].projectName == names) idd = this.projectList[l].id
  3139. }
  3140. obj.projectId = idd
  3141. this.selectProject(obj, 0)
  3142. console.log(this.workForm.domains[0], '打印出来的')
  3143. this.tianxieDialogVisible = true
  3144. this.scopess = item
  3145. var sss = {}
  3146. sss.con = item.con
  3147. sss.progress = item.progress
  3148. sss.time = item.time
  3149. sss.workingTime = item.workingTime
  3150. sss.projectAuditorId = item.projectAuditorId;
  3151. var that = this
  3152. setTimeout(() =>{
  3153. if(Object.keys(item).length < 5) {
  3154. console.log(456)
  3155. sss.subProjectId = that.workForm.domains[0].subProjectId
  3156. sss.stage = that.workForm.domains[0].stage
  3157. sss.subProjectList = that.workForm.domains[0].subProjectList
  3158. sss.stages = that.workForm.domains[0].stages
  3159. sss.auditUserList = obj.auditUserList;
  3160. } else {
  3161. sss.subProjectId = item.subProjectId
  3162. sss.stage = item.stage
  3163. sss.subProjectList = item.subProjectList
  3164. sss.stages = item.stages
  3165. sss.auditUserList = obj.auditUserList;
  3166. }
  3167. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  3168. //只有一个审核人,自动设置上去
  3169. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  3170. }
  3171. console.log(sss, '数据')
  3172. that.zhoBaoIdx = i
  3173. that.zhoBaoName = names
  3174. that.zhoBao = sss
  3175. that.zhis = row
  3176. that.$forceUpdate();
  3177. },500);
  3178. // if(Object.keys(sss).length <= 4) {
  3179. // sss.subProjectId = this.workForm.domains[0].subProjectId
  3180. // sss.stage = this.workForm.domains[0].stage
  3181. // sss.subProjectList = this.workForm.domains[0].subProjectList
  3182. // sss.stages = this.workForm.domains[0].stages
  3183. // } else {
  3184. // sss.subProjectId = item.subProjectId
  3185. // sss.stage = item.stage
  3186. // sss.subProjectList = item.subProjectList
  3187. // sss.stages = item.stages
  3188. // }
  3189. // console.log(sss, '数据')
  3190. // this.zhoBaoIdx = i
  3191. // this.zhoBaoName = names
  3192. // this.zhoBao = sss
  3193. // this.zhis = row
  3194. // this.selectProject(row[0], i)
  3195. },
  3196. // 按周填报里内容的填写点击确定
  3197. btnTianxiaes() {
  3198. if (this.zhoBao.projectAuditorId) {
  3199. this.tianxieDialogVisible = false
  3200. var zhong = this.zhoData
  3201. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  3202. this.zhoData = zhong
  3203. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  3204. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  3205. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  3206. } else {
  3207. this.$message({
  3208. message: '请选择审核人',
  3209. type: "error"
  3210. });
  3211. }
  3212. },
  3213. // 获取本周
  3214. getCurrentWeek() {
  3215. const currentDate = new Date()
  3216. const week = currentDate.getDay()
  3217. const millisecond = 1000 * 60 * 60 * 24
  3218. const minusDay = week != 0 ? week - 1 : 4
  3219. const monday = new Date(currentDate.getTime() - minusDay * millisecond)
  3220. const sunday = new Date(monday.getTime() + 4 * millisecond)
  3221. var stat = this.dealdate(monday)
  3222. var end = this.dealdate(sunday)
  3223. this.zhoRqi = [stat, end]
  3224. this.zhoRqis()
  3225. this.jiazai()
  3226. },
  3227. // 获取上周
  3228. handleGetPrevWeek() {
  3229. const Time = new Date(this.zhoRqi[0])
  3230. let weekNum = Time.getDay()
  3231. weekNum = weekNum == 0 ? 7 : weekNum
  3232. let lastDate = new Date(Time.getTime() - weekNum * 24 * 60 * 60 * 1000)
  3233. let fitstDate = new Date(
  3234. Time.getTime() - (weekNum + 6) * 24 * 60 * 60 * 1000
  3235. )
  3236. let startDate = `${fitstDate.getFullYear()}-${
  3237. fitstDate.getMonth() + 1 < 10
  3238. ? '0' + (fitstDate.getMonth() + 1)
  3239. : fitstDate.getMonth() + 1
  3240. }-${
  3241. fitstDate.getDate() < 10
  3242. ? '0' + fitstDate.getDate()
  3243. : fitstDate.getDate()
  3244. }`
  3245. let endDate = `${lastDate.getFullYear()}-${
  3246. lastDate.getMonth() + 1 < 10
  3247. ? '0' + (lastDate.getMonth() + 1)
  3248. : lastDate.getMonth() + 1
  3249. }-${
  3250. lastDate.getDate() < 10 ? '0' + lastDate.getDate() : lastDate.getDate()
  3251. }`
  3252. var stat = this.dealdate(startDate)
  3253. var ends = this.dealdate(endDate)
  3254. var end = this.dateChange(-2, ends)
  3255. this.zhoRqi = [stat, end]
  3256. this.zhoRqis()
  3257. this.jiazai()
  3258. },
  3259. // 获取下周
  3260. handleGetNextvWeek() {
  3261. const Time = new Date(this.zhoRqi[1])
  3262. let weekNum = Time.getDay()
  3263. weekNum = weekNum == 0 ? 7 : weekNum
  3264. let fitstDate = new Date(
  3265. Time.getTime() + (7 - weekNum + 1) * 24 * 60 * 60 * 1000
  3266. )
  3267. let lastDate = new Date(
  3268. Time.getTime() + (7 - weekNum + 7) * 24 * 60 * 60 * 1000
  3269. )
  3270. let startDate = `${fitstDate.getFullYear()}-${
  3271. fitstDate.getMonth() + 1 < 10
  3272. ? '0' + (fitstDate.getMonth() + 1)
  3273. : fitstDate.getMonth() + 1
  3274. }-${
  3275. fitstDate.getDate() < 10
  3276. ? '0' + fitstDate.getDate()
  3277. : fitstDate.getDate()
  3278. }`
  3279. let endDate = `${lastDate.getFullYear()}-${
  3280. lastDate.getMonth() + 1 < 10
  3281. ? '0' + (lastDate.getMonth() + 1)
  3282. : lastDate.getMonth() + 1
  3283. }-${
  3284. lastDate.getDate() < 10 ? '0' + lastDate.getDate() : lastDate.getDate()
  3285. }`
  3286. var stat = this.dealdate(startDate)
  3287. var ends = this.dealdate(endDate)
  3288. var end = this.dateChange(-2, ends)
  3289. this.zhoRqi = [stat, end]
  3290. this.zhoRqis()
  3291. this.jiazai()
  3292. },
  3293. // 新增日期
  3294. newDates() {
  3295. console.log(this.zhoRqi, '看卡')
  3296. this.zhoRqi[1] = this.dateChange(1, this.zhoRqi[1])
  3297. console.log(this.zhoRqi[1])
  3298. var obj = {}
  3299. obj.zhoDataTime = this.zhoRqi[1]
  3300. obj.he = 0
  3301. for(var j in this.projectList) {
  3302. var xinzhi = this.projectList[j].projectName
  3303. obj[xinzhi] = {}
  3304. obj[xinzhi].time = ''
  3305. obj[xinzhi].con = ''
  3306. obj[xinzhi].progress = 0
  3307. obj[xinzhi].workingTime = 0
  3308. }
  3309. this.zhoData.push(obj)
  3310. },
  3311. // 减去时间
  3312. dateChange(num = 1,date = false) {
  3313.   if (!date) {
  3314.     date = new Date();//没有传入值时,默认是当前日期
  3315.     date = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
  3316.   }
  3317.   date += " 00:00:00";//设置为当天凌晨12点
  3318.   date = Date.parse(new Date(date))/1000;//转换为时间戳
  3319.   date += (86400) * num;//修改后的时间戳
  3320.   var newDate = new Date(parseInt(date) * 1000);//转换为时间
  3321. var nian = newDate.getFullYear()
  3322. var yue = ''
  3323. var ri = ''
  3324. var yues = (newDate.getMonth() + 1)
  3325. var ris = newDate.getDate()
  3326. yues > 9 ? yue = yues : yue = '0' + yues
  3327. ris > 9 ? ri = ris : ri = '0' + ris
  3328. return nian +'-'+yue+'-'+ri
  3329. },
  3330. // 加载动画
  3331. jiazai() {
  3332. this.zhoLoading = true
  3333. var that = this
  3334. setTimeout(() =>{
  3335. that.zhoLoading = false
  3336. },1000);
  3337. },
  3338. // 转时间格式
  3339. dealdate(date) {
  3340. const dt = new Date(date)
  3341. const y = dt.getFullYear()
  3342. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  3343. const d = (dt.getDate() + '').padStart(2, '0')
  3344. return `${y}-${m}-${d}`
  3345. },
  3346. // 按周填报
  3347. fillInReportss() {
  3348. window.addEventListener('scroll', this.handleScroll, true)
  3349. this.jiazai()
  3350. this.diasZho = true
  3351. this.getCurrentWeek()
  3352. // 项目数量判断 <=5
  3353. if(this.projectList.length < 5){
  3354. this.selProjectList = this.projectList
  3355. this.selConShow = false
  3356. }
  3357. },
  3358. // 按周填报的项目筛选
  3359. selListFun(){
  3360. this.selProjectList = []
  3361. if(this.selCon.length){
  3362. for (let i = 0; i < this.selCon.length; i++) {
  3363. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  3364. }
  3365. // console.log("已筛选列表",this.selProjectList);
  3366. this.selConShow = false
  3367. }else{
  3368. this.$message({
  3369. message:'请选择要填报的项目',
  3370. type:'error'
  3371. })
  3372. }
  3373. },
  3374. selListqx(){
  3375. this.diasZho = false
  3376. this.selProjectList = []
  3377. this.selCon = []
  3378. },
  3379. handleScroll() {
  3380. this.changdu = this.projectList.length + 1
  3381. },
  3382. // 自动选择时间点的事件
  3383. zhoTimes(item, i, ims, event) {
  3384. var iss = i
  3385. if(item.time == null) {
  3386. return
  3387. } else {
  3388. var zhi = this.zhoData[iss]
  3389. var he = 0
  3390. for(var i in zhi) {
  3391. if(zhi[i].time && zhi[i].time.length > 0 && i != 'zhoDataTime' && i != 'he') {
  3392. var date2 = '2021/12/12 ' + zhi[i].time[1] +':00'
  3393. var date1 = '2021/12/12 ' + zhi[i].time[0] +':00'
  3394. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  3395. var leave1=date3%(24*3600*1000)
  3396. var hours=Math.floor(leave1/(3600*1000))
  3397. var leave2=leave1%(3600*1000)
  3398. var minutes=Math.floor(leave2/(60*1000))
  3399. var shi = hours+'.'+ minutes
  3400. he += +shi
  3401. }
  3402. }
  3403. zhi.he = he + 'h'
  3404. }
  3405. },
  3406. // 自动选择事件长度的事件
  3407. zhoXuan(item, i) {
  3408. var iss = i
  3409. if(item.time == null) {
  3410. return
  3411. } else {
  3412. var zhi = this.zhoData[iss]
  3413. var he = 0
  3414. for(var i in zhi) {
  3415. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  3416. he += +zhi[i].workingTime
  3417. }
  3418. }
  3419. zhi.he = he + 'h'
  3420. }
  3421. },
  3422. // 按时间比例
  3423. addBli(item, i) {
  3424. var iss = i
  3425. if(item.time == null) {
  3426. return
  3427. } else {
  3428. var zhi = this.zhoData[iss]
  3429. var he = 0
  3430. for(var i in zhi) {
  3431. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  3432. he += +zhi[i].workingTime
  3433. }
  3434. }
  3435. zhi.he = he.toFixed(1) + 'h'
  3436. }
  3437. },
  3438. zhoRqis() {
  3439. this.zhoData = []
  3440. if(this.zhoRqi) {
  3441. var stime = this.zhoRqi[0]
  3442. var etime = this.zhoRqi[1]
  3443. var zhi = this.getdiffdate(stime, etime)
  3444. var arrst = []
  3445. for(var i in zhi) {
  3446. var obj = {}
  3447. obj.zhoDataTime = zhi[i]
  3448. obj.he = 0
  3449. for(var j in this.projectList) {
  3450. var xinzhi = this.projectList[j].projectName
  3451. obj[xinzhi] = {}
  3452. obj[xinzhi].time = ''
  3453. obj[xinzhi].con = ''
  3454. obj[xinzhi].progress = 0
  3455. obj[xinzhi].workingTime = 0
  3456. }
  3457. arrst.push(obj)
  3458. }
  3459. this.zhoData = arrst
  3460. }
  3461. },
  3462. zhoZhi(res, i) {
  3463. var zhi = 0
  3464. for(var i in res) {
  3465. if(i != 'zhoDataTime' && i != 'he') {
  3466. zhi += +res[i]
  3467. }
  3468. }
  3469. res.he = zhi
  3470. },
  3471. zhoBtn(i) {
  3472. // this.zhoData.split(i, 1)
  3473. var arr = this.zhoData
  3474. arr.splice(i, 1)
  3475. },
  3476. zhoAddlast(){
  3477. this.selConShow = true
  3478. },
  3479. zhoAddqx(){
  3480. this.diasZho = false
  3481. this.selConShow = true
  3482. this.selProjectList = []
  3483. this.selCon = []
  3484. },
  3485. // 提交按周填报
  3486. zhoAdd() {
  3487. var zhi = this.zhoData
  3488. var ll = 0
  3489. console.log(this.reportTimeType.type)
  3490. console.log(this.reportTimeType.multiWorktime)
  3491. if(this.reportTimeType.type == 2) {
  3492. for(var i in zhi) {
  3493. this.dateAr = []
  3494. var alp = []
  3495. var zhis = zhi[i]
  3496. for(var j in zhis) {
  3497. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  3498. let objs = {}
  3499. objs.s = zhis[j].time[0]
  3500. objs.e = zhis[j].time[1]
  3501. alp.push(objs)
  3502. }
  3503. }
  3504. this.dateAr = alp
  3505. if(this.dateAr.length > 0) {
  3506. let trus = this.fns()
  3507. ll += 1
  3508. if(!trus) {
  3509. this.$message({
  3510. message: '填写的时间段重叠',
  3511. type: 'error'
  3512. })
  3513. return false
  3514. }
  3515. }
  3516. }
  3517. if(ll == 0) {
  3518. this.$message({
  3519. message: '请填写时间',
  3520. type: 'error'
  3521. })
  3522. return false
  3523. }
  3524. } else if(this.reportTimeType.type == 1){
  3525. for(var i in zhi) {
  3526. var zhis = zhi[i]
  3527. for(var j in zhis) {
  3528. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  3529. ll += 1
  3530. }
  3531. }
  3532. }
  3533. if(ll == 0) {
  3534. this.$message({
  3535. message: '请选择时间',
  3536. type: 'error'
  3537. })
  3538. return false
  3539. }
  3540. }
  3541. var submits = []
  3542. let formData = new FormData();
  3543. if(this.reportTimeType.multiWorktime == 1){
  3544. for (var i in this.zhoData) {
  3545. var zhoD = this.zhoData[i]
  3546. var flgs = false
  3547. for(var j in zhoD) {
  3548. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  3549. flgs = true
  3550. formData.append("degreeId", "-1");
  3551. formData.append("id", '-1');
  3552. for(var s in this.projectList) {
  3553. if(j == this.projectList[s].projectName) {
  3554. formData.append("projectId", this.projectList[s].id);
  3555. }
  3556. }
  3557. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  3558. formData.append("taskId", 0);
  3559. formData.append("reportTimeType", this.reportTimeType.type);
  3560. formData.append("endTime", '');
  3561. formData.append("startTime", '');
  3562. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  3563. var lix = []
  3564. var objjs = {}
  3565. objjs.startTime = zhoD[j].time[0]
  3566. objjs.endTime = zhoD[j].time[1]
  3567. if (zhoD[j].con == null || zhoD[j].con == '') {
  3568. zhoD[j].con == '-'
  3569. }
  3570. objjs.content = zhoD[j].con
  3571. lix.push(objjs)
  3572. var zhiZhi = JSON.stringify(lix)
  3573. zhiZhi = zhiZhi.replace(/,/g,"@");
  3574. formData.append("content", zhiZhi)
  3575. formData.append("isOvertime", 0)
  3576. formData.append("professionProgress", "[]")
  3577. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  3578. formData.append("createDate",zhoD.zhoDataTime)
  3579. if (zhoD[j].projectAuditorId) {
  3580. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  3581. }
  3582. }
  3583. }
  3584. }
  3585. } else {
  3586. for (var i in this.zhoData) {
  3587. var zhoD = this.zhoData[i]
  3588. var flgs = false
  3589. if(this.reportTimeType.type == 2) {
  3590. for(var j in zhoD) {
  3591. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  3592. flgs = true
  3593. formData.append("degreeId", "-1");
  3594. formData.append("id", '-1');
  3595. for(var s in this.projectList) {
  3596. if(j == this.projectList[s].projectName) {
  3597. formData.append("projectId", this.projectList[s].id);
  3598. }
  3599. }
  3600. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  3601. formData.append("taskId", 0);
  3602. formData.append("reportTimeType", this.reportTimeType.type);
  3603. formData.append("endTime", zhoD[j].time[1]);
  3604. formData.append("startTime", zhoD[j].time[0]);
  3605. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  3606. zhoD[j].con == '' || zhoD[j].con == null ? formData.append("content", '-') : formData.append("content", zhoD[j].con)
  3607. formData.append("isOvertime", 0)
  3608. formData.append("professionProgress", "[]")
  3609. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  3610. formData.append("createDate",zhoD.zhoDataTime)
  3611. if (zhoD[j].projectAuditorId) {
  3612. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  3613. }
  3614. }
  3615. }
  3616. } else {
  3617. for(var j in zhoD) {
  3618. 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') {
  3619. flgs = true
  3620. formData.append("degreeId", "-1");
  3621. formData.append("id", '-1');
  3622. for(var s in this.projectList) {
  3623. if(j == this.projectList[s].projectName) {
  3624. formData.append("projectId", this.projectList[s].id);
  3625. }
  3626. }
  3627. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  3628. // formData.append("subProjectId", zhoD[j].subProjectId);
  3629. formData.append("taskId", 0);
  3630. formData.append("reportTimeType", this.reportTimeType.type);
  3631. if(this.reportTimeType.type == 1) {
  3632. formData.append("workingTime", zhoD[j].workingTime);
  3633. } else if(this.reportTimeType.type == 2) {
  3634. formData.append("endTime", zhoD[j].time[1]);
  3635. formData.append("startTime", zhoD[j].time[0]);
  3636. } else if(this.reportTimeType.type == 3) {
  3637. formData.append("progress", zhoD[j].progress);
  3638. formData.append("workingTime", zhoD[j].workingTime);
  3639. }
  3640. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  3641. zhoD[j].con == '' || zhoD[j].con == null ? formData.append("content", '-') : formData.append("content", zhoD[j].con)
  3642. formData.append("isOvertime", 0)
  3643. formData.append("professionProgress", "[]")
  3644. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  3645. formData.append("createDate",zhoD.zhoDataTime)
  3646. if (zhoD[j].projectAuditorId) {
  3647. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  3648. }
  3649. }
  3650. }
  3651. }
  3652. }
  3653. }
  3654. // else {
  3655. // for (var i in this.zhoData) {
  3656. // var zhoD = this.zhoData[i]
  3657. // var flgs = false
  3658. // for(var j in zhoD) {
  3659. // 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') {
  3660. // flgs = true
  3661. // formData.append("degreeId", "-1");
  3662. // formData.append("id", '-1');
  3663. // for(var s in this.projectList) {
  3664. // if(j == this.projectList[s].projectName) {
  3665. // formData.append("projectId", this.projectList[s].id);
  3666. // }
  3667. // }
  3668. // formData.append("subProjectId", '0');
  3669. // formData.append("taskId", 0);
  3670. // formData.append("reportTimeType", this.reportTimeType.type);
  3671. // formData.append("progress", zhoD[j].progress);
  3672. // formData.append("workingTime", zhoD[j].workingTime);
  3673. // formData.append("content", zhoD[j].con);
  3674. // formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  3675. // formData.append("isOvertime", 0)
  3676. // formData.append("professionProgress", "[]")
  3677. // formData.append("stage", "");
  3678. // formData.append("createDate",zhoD.zhoDataTime)
  3679. // }
  3680. // }
  3681. // }
  3682. // }
  3683. this.http.uploadFile( this.port.report.editPort, formData,
  3684. res => {
  3685. this.listLoading = false;
  3686. if (res.code == "ok") {
  3687. this.$message({
  3688. message: "填报成功",
  3689. type: "success"
  3690. });
  3691. this.diasZho = false
  3692. this.selConShow = true
  3693. this.zhoData = []
  3694. this.zhoRqi = ''
  3695. this.getReportList();
  3696. this.getDepartment();
  3697. } else {
  3698. this.$message({
  3699. message: res.msg,
  3700. type: "error"
  3701. });
  3702. }
  3703. },
  3704. error => {
  3705. this.listLoading = false;
  3706. this.$message({
  3707. message: error,
  3708. type: "error"
  3709. });
  3710. });
  3711. // 关闭弹窗 并 清空
  3712. // this.diasZho = false
  3713. // this.zhoData = []
  3714. // this.zhoRqi = ''
  3715. this.selProjectList = []
  3716. this.selCon = []
  3717. },
  3718. ChangeHourMinutestr (str) {
  3719. if (str !== "0" && str !== "" && str !== null) {
  3720. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  3721. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  3722. } else {
  3723. return "";
  3724. }
  3725. },
  3726. // 得到两个日期中间的日期
  3727. getdiffdate(stime,etime){
  3728. //初始化日期列表,数组
  3729. var diffdate = new Array();
  3730. var i=0;
  3731. //开始日期小于等于结束日期,并循环
  3732. while(stime<=etime){
  3733. diffdate[i] = stime;
  3734. //获取开始日期时间戳
  3735. var stime_ts = new Date(stime).getTime();
  3736. //增加一天时间戳后的日期
  3737. var next_date = stime_ts + (24*60*60*1000);
  3738. //拼接年月日,这里的月份会返回(0-11),所以要+1
  3739. var next_dates_y = new Date(next_date).getFullYear()+'-';
  3740. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  3741. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  3742. stime = next_dates_y+next_dates_m+next_dates_d;
  3743. //增加数组key
  3744. i++;
  3745. }
  3746. return diffdate;
  3747. },
  3748. // 添加模块
  3749. addDomain(i) {
  3750. var leftProgress = 10;
  3751. if (this.reportTimeType.type == 3) {
  3752. //计算已经待分配工时比例
  3753. let array = this.workForm.domains;
  3754. let totalProgress = 0;
  3755. for (var i=0;i<array.length; i++) {
  3756. totalProgress += array[i].progress;
  3757. }
  3758. if (totalProgress < 100) {
  3759. leftProgress = 100 - totalProgress;
  3760. }
  3761. }
  3762. this.workForm.domains.push({
  3763. projectId: "",
  3764. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):"",
  3765. content: "",
  3766. progress:leftProgress,
  3767. state:2,//2-表示待提交
  3768. multiWorktime: this.reportTimeType.multiWorktime,
  3769. worktimeList:[{}],
  3770. // degreeId: '',
  3771. });
  3772. if (this.reportTimeType.type == 0) {
  3773. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3774. var length = this.workForm.domains.length;
  3775. if (length == 2) {
  3776. this.showAddMore = false;
  3777. }
  3778. }
  3779. this.chuji()
  3780. },
  3781. // 移除模块
  3782. delDomain(i) {
  3783. this.workForm.domains.splice(i,1)
  3784. //检测当前剩下的一个,时间类型是否是全天
  3785. if (this.reportTimeType.type == 0) {
  3786. if (this.workForm.domains[0].timeType == 0) {
  3787. this.showAddMore = false;
  3788. } else {
  3789. this.showAddMore = true;
  3790. }
  3791. }
  3792. if(this.user.timeType.multiWorktime == 1) {
  3793. this.iptChangs()
  3794. } else {
  3795. this.seleChn(0)
  3796. }
  3797. },
  3798. // 改变月份
  3799. changeMonth() {
  3800. if (this.isBatch == 0 && !this.isSubstitude) {
  3801. //只有按天填报才能获取当天的日报
  3802. this.getReport()
  3803. }
  3804. },
  3805. // 判断时间段
  3806. fns() {
  3807. for (let k in this.dateAr) {
  3808. if (!this.judege(k)) {
  3809. return false
  3810. }
  3811. }
  3812. return true
  3813. },
  3814. judege(idx){
  3815. for (let k in this.dateAr) {
  3816. if (idx !== k) {
  3817. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  3818. return false
  3819. }
  3820. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  3821. return false
  3822. }
  3823. }
  3824. }
  3825. return true
  3826. },
  3827. // 保存日报
  3828. submitReport(isDraft) {
  3829. this.isDraft = isDraft;
  3830. this.$refs.workForm.validate(valid => {
  3831. if (valid) {
  3832. this.dateAr = []
  3833. let alp = []
  3834. if(this.user.timeType.multiWorktime != 1) {
  3835. for(var p in this.workForm.domains) {
  3836. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  3837. let objs = {}
  3838. objs.s = this.workForm.domains[p].startTime
  3839. objs.e = this.workForm.domains[p].endTime
  3840. alp.push(objs)
  3841. }
  3842. }
  3843. this.dateAr = alp
  3844. if(this.dateAr.length > 0) {
  3845. let trus = this.fns()
  3846. if(!trus) {
  3847. this.$message({
  3848. message: '填写的时间段重叠',
  3849. type: "error"
  3850. });
  3851. return
  3852. }
  3853. }
  3854. } else {
  3855. for(var p in this.workForm.domains) {
  3856. var slll = this.workForm.domains[p]
  3857. for(var o in slll.worktimeList) {
  3858. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  3859. let objs = {}
  3860. objs.s = slll.worktimeList[o].startTime
  3861. objs.e = slll.worktimeList[o].endTime
  3862. alp.push(objs)
  3863. }
  3864. }
  3865. }
  3866. this.dateAr = alp
  3867. if(this.dateAr.length > 0) {
  3868. let trus = this.fns()
  3869. if(!trus) {
  3870. this.$message({
  3871. message: '填写的时间段重叠',
  3872. type: "error"
  3873. });
  3874. return
  3875. }
  3876. }
  3877. }
  3878. // return
  3879. //代填的情况,检查人员是否已经选择
  3880. if (this.isSubstitude) {
  3881. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  3882. this.$message({
  3883. message: "请选择代填的人员",
  3884. type: "error"
  3885. });
  3886. return;
  3887. }
  3888. }
  3889. //检查时间,全天和上下午不能同时存在
  3890. if (this.reportTimeType.type == 0) {
  3891. var alldayNum = 0;
  3892. var amNum = 0;
  3893. var pmNum = 0;
  3894. for(var i in this.workForm.domains) {
  3895. if (this.workForm.domains[i].timeType == 0) {
  3896. alldayNum ++;
  3897. } else if (this.workForm.domains[i].timeType == 1) {
  3898. amNum++;
  3899. } else if (this.workForm.domains[i].timeType == 2) {
  3900. pmNum++;
  3901. }
  3902. }
  3903. if (alldayNum > 1) {
  3904. this.$message({
  3905. message: "工作时间-全天,只能选择一次",
  3906. type: "error"
  3907. });
  3908. return;
  3909. }
  3910. if (amNum > 1) {
  3911. this.$message({
  3912. message: "工作时间-上午,只能选择一次",
  3913. type: "error"
  3914. });
  3915. return;
  3916. }
  3917. if (pmNum > 1) {
  3918. this.$message({
  3919. message: "工作时间-下午,只能选择一次",
  3920. type: "error"
  3921. });
  3922. return;
  3923. }
  3924. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  3925. this.$message({
  3926. message: "工作时间-全天,不能和上下午同时存在",
  3927. type: "error"
  3928. });
  3929. return;
  3930. }
  3931. } else if (this.reportTimeType.type == 3) {
  3932. //总百分比不能超过100%
  3933. let total = 0;
  3934. this.workForm.domains.forEach(w=>{total += w.progress});
  3935. if (total > 100) {
  3936. this.$message({
  3937. message: "用时比例之和不能超过100%",
  3938. type: "error"
  3939. });
  3940. return;
  3941. } else if (total < 100) {
  3942. this.$message({
  3943. message: "工时尚未完全分配,无法提交",
  3944. type: "error"
  3945. });
  3946. return;
  3947. }
  3948. }
  3949. this.listLoading = true;
  3950. let formData = new FormData();
  3951. formData.append("draft", this.isDraft);
  3952. for(var i in this.workForm.domains) {
  3953. if(this.workForm.domains[i].degreeId) {
  3954. // var sss = this.workForm.domains[i].degreeId.toString()
  3955. formData.append("degreeId", this.workForm.domains[i].degreeId);
  3956. } else {
  3957. formData.append("degreeId", -1);
  3958. }
  3959. if(this.workForm.domains[i].customData) {
  3960. // var sss = this.workForm.domains[i].degreeId.toString()
  3961. formData.append("customData", this.workForm.domains[i].customData);
  3962. } else {
  3963. formData.append("customData", 0);
  3964. }
  3965. if (this.workForm.domains[i].id) {
  3966. formData.append("id", this.workForm.domains[i].id);
  3967. } else {
  3968. formData.append("id", -1);
  3969. }
  3970. formData.append("projectId", this.workForm.domains[i].projectId);
  3971. if (this.workForm.domains[i].subProjectId) {
  3972. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  3973. } else {
  3974. formData.append("subProjectId", 0);
  3975. }
  3976. if (this.workForm.domains[i].groupId) {
  3977. formData.append("groupId", this.workForm.domains[i].groupId);
  3978. } else {
  3979. formData.append("groupId", 0);
  3980. }
  3981. if (this.workForm.domains[i].taskId) {
  3982. formData.append("taskId", this.workForm.domains[i].taskId);
  3983. } else {
  3984. formData.append("taskId", 0);
  3985. }
  3986. formData.append("reportTimeType", this.reportTimeType.type);
  3987. if (this.reportTimeType.type == 0) {
  3988. formData.append("timeType", this.workForm.domains[i].timeType);
  3989. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  3990. formData.append("workingTime", workingTime);
  3991. } else if (this.reportTimeType.type == 1){
  3992. formData.append("workingTime", this.workForm.domains[i].workingTime);
  3993. } else if (this.reportTimeType.type == 2) {
  3994. formData.append("endTime", this.workForm.domains[i].endTime);
  3995. formData.append("startTime", this.workForm.domains[i].startTime);
  3996. } else if (this.reportTimeType.type == 3) {
  3997. //按比例分配
  3998. formData.append("progress", this.workForm.domains[i].progress);
  3999. formData.append("workingTime", this.workForm.domains[i].workingTime);
  4000. }
  4001. //处理多个时间事项
  4002. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  4003. if (this.reportTimeType.multiWorktime == 1) {
  4004. //检查时间是否有重叠
  4005. var workList = this.workForm.domains[i].worktimeList;
  4006. for (var j=0;j<workList.length; j++) {
  4007. var curItem = workList[j];
  4008. //检查开始时间是否大于结束时间
  4009. if (curItem.startTime >= curItem.endTime) {
  4010. this.$message({
  4011. message: "时间段"+curItem.startTime+'-'+curItem.endTime+"有误:"+
  4012. "结束时间必须大于开始时间",
  4013. type: "error"
  4014. });
  4015. return;
  4016. }
  4017. for (var p = j+1;p<workList.length; p++) {
  4018. var jItem = workList[p];
  4019. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  4020. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  4021. this.$message({
  4022. message: "时间段"+curItem.startTime+'-'+curItem.endTime+"与"+
  4023. jItem.startTime+'-'+jItem.endTime+ "存在重叠,请修改。",
  4024. type: "error"
  4025. });
  4026. return;
  4027. }
  4028. }
  4029. }
  4030. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  4031. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  4032. formData.append("content", m);
  4033. } else {
  4034. if (this.workForm.domains[i].content) {
  4035. formData.append("content", this.workForm.domains[i].content);
  4036. } else {
  4037. formData.append("content", '-');
  4038. }
  4039. }
  4040. if (this.isBatch == 0) {
  4041. formData.append("createDate", this.workForm.createDate);
  4042. } else {
  4043. //批量填报,时间范围
  4044. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  4045. }
  4046. if(this.workForm.domains[i].isOvertime) {
  4047. formData.append("isOvertime", 1);
  4048. } else {
  4049. formData.append("isOvertime", 0);
  4050. }
  4051. if (this.workForm.userId != null) {
  4052. var targetUids = '';
  4053. this.workForm.userId.forEach(u=>{
  4054. targetUids += u + '@';
  4055. });
  4056. if (targetUids.length > 0) {
  4057. targetUids = targetUids.substring(0, targetUids.length -1);
  4058. formData.append("targetUids", targetUids);
  4059. }
  4060. }
  4061. //项目专业进度
  4062. if (this.workForm.domains[i].professionProgress) {
  4063. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  4064. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  4065. formData.append("professionProgress", m);
  4066. } else {
  4067. formData.append("professionProgress", "[]");
  4068. }
  4069. if (this.workForm.domains[i].stage) {
  4070. formData.append("stage", this.workForm.domains[i].stage);
  4071. } else {
  4072. formData.append("stage", "-");
  4073. }
  4074. if (this.workForm.domains[i].projectAuditorId) {
  4075. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  4076. } else {
  4077. this.$message({
  4078. message: "请指定项目审核人",
  4079. type: "error"
  4080. });
  4081. return;
  4082. }
  4083. }
  4084. this.submitingReport = true;
  4085. this.http.uploadFile( this.port.report.editPort, formData,
  4086. res => {
  4087. this.listLoading = false;
  4088. this.submitingReport = false;
  4089. if (res.code == "ok") {
  4090. this.$message({
  4091. message: this.isDraft==0?"提交成功":"暂存成功",
  4092. type: "success"
  4093. });
  4094. this.dialogVisible = false;
  4095. this.jsDay = 0
  4096. this.jsTime = 0
  4097. this.getReportList();
  4098. this.getDepartment();
  4099. } else {
  4100. this.$message({
  4101. message: (this.isDraft==0?'提交失败:':'暂存失败:')+res.msg,
  4102. type: "error"
  4103. });
  4104. }
  4105. },
  4106. error => {
  4107. this.listLoading = false;
  4108. this.submitingReport = false;
  4109. this.$message({
  4110. message: error,
  4111. type: "error"
  4112. });
  4113. });
  4114. }
  4115. });
  4116. },
  4117. cli() {
  4118. },
  4119. // 判断是展示那个工时导入
  4120. imports() {
  4121. if(this.user.timeType.syncCorpwxTime == 0) {
  4122. this.importDialog = true
  4123. } else {
  4124. this.importWxDialog = true
  4125. }
  4126. },
  4127. // 跳转
  4128. junpToDeskTop(id) {
  4129. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4130. this.$router.push("/desktop/" + id + "/" + this.date +day);
  4131. },
  4132. // 通过日报
  4133. approve(id, item) {
  4134. this.logining = true;
  4135. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4136. var ids = item.id;
  4137. // var data = item.data;
  4138. // data.forEach(element => {
  4139. // ids +=(element.id+',');
  4140. // });
  4141. this.http.post( this.port.report.approve, {id: id , date: this.date +day, reportIds: ids},
  4142. res => {
  4143. this.logining = false;
  4144. if (res.code == "ok") {
  4145. this.$message({
  4146. message: "审核成功",
  4147. type: "success"
  4148. });
  4149. this.getReportList();
  4150. this.getDepartment();
  4151. } else {
  4152. this.$message({
  4153. message: res.msg,
  4154. type: "error"
  4155. });
  4156. }
  4157. },
  4158. error => {
  4159. this.logining = false;
  4160. this.$message({
  4161. message: error,
  4162. type: "error"
  4163. });
  4164. });
  4165. },
  4166. //撤回日报
  4167. cancel(item) {
  4168. this.logining = true;
  4169. var ids = '';
  4170. var data = item.data;
  4171. data.forEach(element => {
  4172. ids +=(element.id+',');
  4173. });
  4174. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  4175. res => {
  4176. this.logining = false;
  4177. if (res.code == "ok") {
  4178. this.$message({
  4179. message:"撤回成功",
  4180. type: "success"
  4181. });
  4182. this.getReportList();
  4183. this.getDepartment();
  4184. } else {
  4185. this.$message({
  4186. message: res.msg,
  4187. type: "error"
  4188. });
  4189. }
  4190. },
  4191. error => {
  4192. this.logining = false;
  4193. this.$message({
  4194. message: error,
  4195. type: "error"
  4196. });
  4197. });
  4198. },
  4199. showDenyDialog(id,i, item) {
  4200. this.denyReasonDialog = true;
  4201. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4202. var ids = item.id;
  4203. // var data = item.data;
  4204. // data.forEach(element => {
  4205. // ids +=(element.id+',');
  4206. // });
  4207. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  4208. },
  4209. // 未通过日报
  4210. deny() {
  4211. this.logining = true;
  4212. this.http.post( this.port.report.deny, this.denyForm,
  4213. res => {
  4214. this.logining = false;
  4215. if (res.code == "ok") {
  4216. this.$message({
  4217. message: this.denyForm.i==0?"驳回成功":"撤销成功",
  4218. type: "success"
  4219. });
  4220. this.getReportList();
  4221. this.getDepartment();
  4222. this.denyReasonDialog = false;
  4223. } else {
  4224. this.$message({
  4225. message: res.msg,
  4226. type: "error"
  4227. });
  4228. }
  4229. },
  4230. error => {
  4231. this.logining = false;
  4232. this.$message({
  4233. message: error,
  4234. type: "error"
  4235. });
  4236. });
  4237. },
  4238. // 查看工时记录弹窗
  4239. toView() {
  4240. this.toViewDialogVisible = true
  4241. this.toViewloading = true
  4242. this.getToView()
  4243. },
  4244. getToView() {
  4245. this.http.post( '/report-import-log/getList', this.toViewForm,
  4246. res => {
  4247. this.toViewloading = false;
  4248. if (res.code == "ok") {
  4249. console.log(res.data, '数据数据')
  4250. this.toViewList = res.data.records
  4251. this.toViewForm.total = res.data.total
  4252. } else {
  4253. this.toViewloading = false;
  4254. this.$message({
  4255. message: res.msg,
  4256. type: "error"
  4257. });
  4258. }
  4259. })
  4260. },
  4261. //分页
  4262. handleCurrentChange(val) {
  4263. this.toViewForm.pageIndex = val;
  4264. this.getToView();
  4265. },
  4266. handleSizeChange(val) {
  4267. this.toViewForm.pageSize = val;
  4268. this.getToView();
  4269. },
  4270. },
  4271. created() {
  4272. let height = window.innerHeight;
  4273. this.tableHeight = height - 178;
  4274. const that = this;
  4275. window.onresize = function temp() {
  4276. that.tableHeight = window.innerHeight - 178;
  4277. };
  4278. this.toViewForm.companyId = this.user.companyId
  4279. },
  4280. mounted() {
  4281. var now = new Date();
  4282. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  4283. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  4284. this.exportParam.dateRange = [startStr,t];
  4285. this.getAllDate();
  4286. this.getReportList();
  4287. this.getProjectList();
  4288. this.getTimeType();
  4289. this.getDepartment();
  4290. this.scrollFunction()
  4291. this.userssHu();
  4292. }
  4293. };
  4294. </script>
  4295. <style lang="scss" scoped>
  4296. .paginatis {
  4297. padding: 10px 10px;
  4298. background: #f2f2f2;
  4299. }
  4300. .waiting {
  4301. color:orange;
  4302. }
  4303. .filledReportStyle {
  4304. color:#32CD32;
  4305. }
  4306. .RejectStyle {
  4307. color:red;
  4308. }
  4309. .allDaily {
  4310. width:82%;
  4311. }
  4312. .report_title {
  4313. padding:10px 0;
  4314. color:#666;
  4315. }
  4316. .clearfix {
  4317. overflow-x: auto;
  4318. white-space: nowrap;
  4319. padding: 15px 0;
  4320. // overflow-y: hidden;
  4321. .date_item {
  4322. padding: 0 3px;
  4323. cursor: pointer;
  4324. }
  4325. .chooseDate {
  4326. color: #20a0ff;
  4327. }
  4328. }
  4329. .one_daily {
  4330. i {
  4331. color: #9ed0ff;
  4332. margin-right: 5px;
  4333. }
  4334. .one_daily_body {
  4335. padding: 15px 0px;
  4336. p {
  4337. margin: 0;
  4338. line-height: 30px;
  4339. }
  4340. }
  4341. ul {
  4342. padding: 0;
  4343. }
  4344. }
  4345. .checkbtn {
  4346. float: right;
  4347. margin-top: -10px;
  4348. }
  4349. .selConStyle{
  4350. margin-top:9rem;
  4351. margin-bottom:11rem;
  4352. .selConStyle_title{
  4353. height: 3rem;
  4354. text-align: center;
  4355. font-size: 17px;
  4356. }
  4357. .el-select{
  4358. margin: 0 15%;
  4359. width: 70%;
  4360. }
  4361. }
  4362. </style>
  4363. <style lang="scss">
  4364. .daily {
  4365. .el-card__body {
  4366. height: 80%;
  4367. overflow-y: auto;
  4368. }
  4369. .el-card__header {
  4370. padding: 0 20px;
  4371. }
  4372. }
  4373. </style>
  4374. <style scoped>
  4375. /* 项目标签的样式 */
  4376. .el-tag + .el-tag {
  4377. margin-left: 10px;
  4378. }
  4379. .button-new-tag {
  4380. margin-left: 10px;
  4381. height: 32px;
  4382. line-height: 30px;
  4383. padding-top: 0;
  4384. padding-bottom: 0;
  4385. }
  4386. .input-new-tag {
  4387. width: 90px;
  4388. margin-left: 10px;
  4389. vertical-align: bottom;
  4390. }
  4391. .selectworktime .el-table__fixed-body-wrapper{
  4392. top: 48px !important;
  4393. }
  4394. .selectworktime_export .selectworktime_export_l{
  4395. width: 65%;
  4396. float: left;
  4397. height: 42px;
  4398. }
  4399. </style>
  4400. <style lang="scss" scoped>
  4401. // 加班样式
  4402. .overtime {
  4403. display: inline-block;
  4404. margin-left: 20px;
  4405. input {
  4406. display: inline-block;
  4407. margin-top: 5px;
  4408. }
  4409. }
  4410. .plus {
  4411. display: inline-block;
  4412. }
  4413. // .tages {
  4414. // float: right;
  4415. // }
  4416. .overtime {
  4417. display: inline-block;
  4418. margin-left: 30px;
  4419. }
  4420. .bloks {
  4421. display: inline-block;
  4422. width: 380px;
  4423. }
  4424. .zhiss {
  4425. display: flex;
  4426. justify-content: space-around;
  4427. align-items: center;
  4428. }
  4429. .zhoFel {
  4430. display: flex;
  4431. justify-content: space-between;
  4432. align-items: center;
  4433. }
  4434. </style>