projectInside.vue 215 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405
  1. <template>
  2. <section class="sectionaa">
  3. <div v-loading="!componentFlg" :style="'width: 100%;height:'+tableHeight+'px'" id="components">
  4. <div v-if="componentFlg">
  5. <el-tabs v-model="activeName" @tab-click="handleClick">
  6. <el-tab-pane :label="$t('maincontent')" name="project" @click="null" disabled=true>
  7. <template slot="label">
  8. <i type="default" size="mini" class="el-icon-arrow-left" @click="toList" style="margin-left:10px;cursor:pointer;"></i>
  9. <el-select v-model="curProjectId" size="mini" class="projectCls" @change="onProjectChange" filterable>
  10. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id">
  11. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  12. <span style="float: right;margin-left: 20px">{{ item.projectName }}</span>
  13. </el-option>
  14. </el-select>
  15. <el-dropdown trigger="click" style="margin-right:30px;color:#262626;cursor:pointer;" v-if="projectCreatorId == user.id || projectInchargerId == user.id || permissions.projectManagement || isManageDept">
  16. <i class="iconfont firerock-iconcaidan" ></i>
  17. <el-dropdown-menu slot="dropdown">
  18. <el-dropdown-item v-if="currentProject.status == 1" @click.native="finishPro()">
  19. <i class="iconfont firerock-iconwancheng"></i>{{ $t('completeproject') }}
  20. </el-dropdown-item>
  21. <el-dropdown-item divided v-if="currentProject.status == 1" @click.native="cancelPro()">
  22. <i class="el-icon-refresh-left"></i>{{ $t('cancelproject') }}
  23. </el-dropdown-item>
  24. <el-dropdown-item v-if="currentProject.status == 2 || currentProject.status == 3" @click.native="startPro()">
  25. <i class="iconfont firerock-iconqidong"></i>{{ $t('restarttheproject') }}
  26. </el-dropdown-item>
  27. </el-dropdown-menu>
  28. </el-dropdown>
  29. </template>
  30. </el-tab-pane>
  31. <el-tab-pane :label="$t('taskkanban')" name="projectInside">
  32. <el-container style="padding: 0px;">
  33. <el-aside :style="'overflow:auto;padding-left:10px;padding-right:5px;height:'+tableHeight+'px;width:'+groupWidth+'px;'">
  34. <el-input v-model="groupSearch" size="small" :placeholder="$t('searchgroup')" @input="startSearchGroup" style="margin-top:10px"/>
  35. <p ><span class="heavyTxt">{{ $t('other.taskGroup') }}</span>
  36. <i class="el-icon-plus pull-right" style="color:#666;margin-right:10px;" @click="createGroup" v-if="projectCreatorId == user.id || projectInchargerId == user.id || permissions.projectManagement || isManageDept"></i>
  37. </p>
  38. <p style="color: #ff0b0b;font-size: 18px;font-weight: 700;" v-if="user.companyId == '936'">如需修改,请先联系管理员</p>
  39. <el-menu :default-active="defaultGroupId" ref="defaultMenu" class="el-menu-vertical-demo" @select="groupChange" style="border-right:none;">
  40. <el-menu-item :index="item.id" v-for="item in groupList" :key="item.id" class="group_style">
  41. <div slot="title">
  42. <!-- <span class="taskGroupClass">{{item.name}}</span> -->
  43. <div style="display: inline-block;">
  44. <el-tooltip effect="dark" :content="item.name" placement="top" v-if="item.name.length > 12">
  45. <span class="taskGroupClass">{{item.name}}</span>
  46. </el-tooltip>
  47. <span class="taskGroupClass" v-else>{{item.name}}</span>
  48. </div>
  49. <!-- <el-button size="mini" @click="test(item)">test</el-button> -->
  50. <el-dropdown trigger="click" style="float:right;margin-right:-10px;" :disabled="!(user.id == item.inchargerId || user.id == projectCreatorId || user.id == projectInchargerId || permissions.projectManagement || isManageDept)">
  51. <i class="iconfont firerock-iconcaidan" ></i>
  52. <el-dropdown-menu slot="dropdown">
  53. <el-dropdown-item @click.native="copyGroup(item)" :disabled="!(projectCreatorId == user.id || projectInchargerId == user.id || permissions.projectManagement || isManageDept)">
  54. <i class="el-icon-document-copy"></i>
  55. {{ $t('replicationgroup') }}</el-dropdown-item>
  56. <el-dropdown-item divided @click.native="renameGroup(item)" :disabled="!(projectCreatorId == user.id || projectInchargerId == user.id || permissions.projectManagement || isManageDept)">
  57. <i class="el-icon-edit"></i>
  58. {{ $t('changegroups') }}</el-dropdown-item>
  59. <el-dropdown-item divided @click.native="setManDay(item)" v-if="user.timeType.projectManDay==1" :disabled="!(projectCreatorId == user.id || projectInchargerId == user.id || permissions.projectManagement || isManageDept)">
  60. <i class="el-icon-time"></i>
  61. 预估工时</el-dropdown-item>
  62. <el-dropdown-item divided @click.native="addToTemplate(item)" :disabled="!(projectCreatorId == user.id || projectInchargerId == user.id || permissions.projectManagement || isManageDept)">
  63. <i class="el-icon-plus"></i>
  64. {{ $t('settemplate') }}</el-dropdown-item>
  65. <el-dropdown-item divided @click.native="editIncharger(item)"
  66. :disabled="!(projectCreatorId == user.id || projectInchargerId == user.id || permissions.projectManagement || isManageDept)">
  67. <i class="el-icon-user"></i>
  68. {{ $t('sethead') }} </el-dropdown-item>
  69. <el-dropdown-item divided @click.native="setupParticipants(item)"
  70. :disabled="!(projectCreatorId == user.id || projectInchargerId == user.id || item.inchargerId == user.id || permissions.projectManagement || isManageDept)">
  71. <i class="iconfont firerock-iconusers"></i>
  72. {{ $t('aparticipant') }} </el-dropdown-item>
  73. <el-dropdown-item divided @click.native="deleteGroup(item)" :disabled="!(projectCreatorId == user.id || projectInchargerId == user.id || permissions.projectManagement || isManageDept)">
  74. <i class="el-icon-delete"></i>
  75. {{ $t('deletethegroup') }} </el-dropdown-item>
  76. <el-dropdown-item divided @click.native="getGroupDetails(item)">
  77. <i class="el-icon-tickets"></i>
  78. {{ $t('groupdetails') }} </el-dropdown-item>
  79. </el-dropdown-menu>
  80. </el-dropdown>
  81. </div>
  82. </el-menu-item>
  83. </el-menu>
  84. <!--视图 -->
  85. <p ><span class="heavyTxt">{{ $t('shi-tu') }}</span></p>
  86. <el-menu :default-active="1" class="el-menu-vertical-demo" @select="viewChange" style="border-right:none;">
  87. <el-menu-item :index="item.id" v-for="item in viewList" :key="item.id" class="group_style">
  88. <div slot="title">
  89. <span >{{item.name}}</span>
  90. </div>
  91. </el-menu-item>
  92. </el-menu>
  93. </el-aside>
  94. <!-- 分组详情 -->
  95. <el-dialog :title="groupDetailTil" :visible.sync="groupDetailsShow" width="500px" :before-close="handleClose">
  96. <div>
  97. <el-form label-width="90px">
  98. <el-form-item :label="$t('head') + ':'">
  99. <span v-if="user.userNameNeedTranslate != '1'">{{groupDetailData.incharger}}</span>
  100. <span v-if="user.userNameNeedTranslate == '1'">
  101. <ww-open-data type='userName' :openid='groupDetailData.incharger'></ww-open-data>
  102. </span>
  103. </el-form-item>
  104. <el-form-item :label="$t('participantin') + ':'">
  105. <span v-for="(item, index) in groupDetailData.participators" :key="index">
  106. <span v-if="user.userNameNeedTranslate != '1'">
  107. {{item.userName}}
  108. </span>
  109. <span v-if="user.userNameNeedTranslate == '1'">
  110. <ww-open-data type='userName' :openid='item.userName'></ww-open-data>
  111. </span>
  112. <span v-if="index < groupDetailData.participators.length - 1">、</span>
  113. </span>
  114. </el-form-item>
  115. <el-form-item label="wbsCode:" v-if="user.companyId == 936">
  116. <span>{{groupDetailData.wbsCode}}</span>
  117. </el-form-item>
  118. <el-form-item label="预估工时:" v-if="user.timeType.projectManDay">
  119. <span>{{groupDetailData.manDay}}人天 ({{ (groupDetailData.manDay==null?0:groupDetailData.manDay)*user.timeType.allday }}小时)</span>
  120. </el-form-item>
  121. </el-form>
  122. </div>
  123. <span slot="footer" class="dialog-footer">
  124. <el-button type="primary" @click="groupDetailsShow = false">{{ $t('btn.determine') }}</el-button>
  125. </span>
  126. </el-dialog>
  127. <span :style="'background:#f0f0f0;width:1px;height:'+tableHeight+'px;'" @click="toggleGroup">
  128. </span>
  129. <!-- <span :style="'width:10px;height:'+tableHeight+'px;float:left;text-align:center;vertical-align:middle;'" @click="toggleGroup">
  130. <span :style="'width:1px;background:#20A0FF;height:'+tableHeight+'px;float:left;'"></span>
  131. <i class="el-icon-d-arrow-left" ></i>
  132. </span> -->
  133. <!-- 增加侧边栏的点击效果 -->
  134. <div class="sidebar" @click="retract()">
  135. <div class="etui">
  136. <i class="el-icon-arrow-left" ref="box"></i>
  137. </div>
  138. </div>
  139. <!-- 增加侧边栏的点击效果 -->
  140. <el-main style="background:#f7f7f7;padding:0px;position: relative;">
  141. <el-row style="color:#999;margin-top:10px;padding: 0px 10px;" :gutter="10">
  142. <el-col :span="8">
  143. <el-link @click="toggleGroup"><i v-if="selectedGroup != null" :class="groupWidth==0?'el-icon-d-arrow-right':'el-icon-d-arrow-left'" style="margin-top:10px;">{{selectedGroup.name}}</i></el-link>
  144. </el-col>
  145. <el-col :span="16" style="float:right;" class="hideCompletedFelx">
  146. <!-- 隐藏已完成任务 -->
  147. <el-checkbox v-model="hideCompleted" style="margin-right: 10px" @change="editHideTask">隐藏已完成任务</el-checkbox>
  148. <el-select v-model="order" size="small" style="background:#fff;display:inline-block;" @change="orderChange">
  149. <el-option v-for="item in orderList" :key="item.id" :label="item.name" :value="item.id">
  150. <span>{{item.name}}</span>
  151. </el-option>
  152. </el-select>
  153. <el-button icon="iconfont firerock-icondaochu" style="margin-left:10px" size="mini" @click="showExportDialog">{{ $t('export.export') }}</el-button>
  154. <el-button icon="iconfont firerock-icondaoru" size="mini" @click="importTaskDialog = true;importToStageId = stageList[0].id;">{{ $t('dao-ru') }}</el-button>
  155. </el-col>
  156. </el-row>
  157. <!-- <div style="color:#999;margin-top:10px;">
  158. <i v-if="selectedGroup != null" class="el-icon-arrow-left" style="margin-top:10px;">{{selectedGroup.name}}</i>
  159. </div> -->
  160. <div v-if="!displayTable">
  161. <div style="width: 100%;overflow-x: auto;">
  162. <draggable style="white-space:nowrap;" @update="onMoveStage"
  163. v-model="stageList" group="stage" @start="stageDrag=true" @end="stageDrag=false;" draggable=".taskStage" >
  164. <!--每个阶段的拖拽 -->
  165. <!-- <transition-group > -->
  166. <v-flex class="taskStage" v-for="stage in stageList" :key="stage.id" :style="'height:'+stageListHeight+'px;'">
  167. <div :id="stage.id"
  168. class="taskList" >
  169. <!--头部显示阶段名称,操作 -->
  170. <div slot="header" style="margin:10px 0px;cursor:move;width:300px" role="task">
  171. <span class="stage">{{stage.stagesName}}</span><span style="margin-left:10px;color:#303133;font-size:12px;">{{stage.taskList.length}}</span>
  172. <!-- <i class="el-icon-more" style="float:right;"></i> -->
  173. <el-dropdown trigger="click" style="float:right;cursor:pointer;" v-if="canEditStageList">
  174. <i class="el-icon-more" ></i>
  175. <el-dropdown-menu slot="dropdown">
  176. <el-dropdown-item @click.native="addTask(stage)">
  177. <i class="el-icon-document-add"></i>
  178. {{ $t('createtask ') }}</el-dropdown-item>
  179. <el-dropdown-item @click.native="renameStage(stage)">
  180. <i class="el-icon-edit"></i>
  181. {{ $t('renamingalist') }} </el-dropdown-item>
  182. <el-dropdown-item divided @click.native="deleteStage(stage)">
  183. <i class="el-icon-delete"></i>{{$t('deleteList ')}} </el-dropdown-item>
  184. </el-dropdown-menu>
  185. </el-dropdown>
  186. </div>
  187. <draggable class="taskListin" :style="'max-height:' + taskListinH + 'px;'" @start="drag=true" @end="drag=false" draggable=".taskCard" ghostClass="ghost" @update="onChange" @add="onChange" group="task1" :id="stage.id">
  188. <div v-for="element in stage.taskList" :id="element.id" :key="element.id" class="taskCard" ref="tasks" @click="editTask(element)" :style="element.taskStatus==0?'':'background:#eFeFeF;'">
  189. <!--任务卡片内容显示 -->
  190. <div>
  191. <div v-if="element.taskLevel == 2" class="taskImg hong"><img src="../../assets/image/hong.png" alt=""></div>
  192. <div v-if="element.taskLevel == 1" class="taskImg huang"><img src="../../assets/image/huang.png" alt=""></div>
  193. <div v-if="element.taskLevel == 0" class="taskImg hui"><img src="../../assets/image/hui.png" alt=""></div>
  194. <el-checkbox :disabled="element.taskStatus==2 || element.subTaskList.length > element.subTaskFinishNum" :checked="element.taskStatus==1?true:false" size="large" class="cb"
  195. @change="finishTask(element)"
  196. @click.stop.native=""
  197. ></el-checkbox>
  198. <el-tooltip class="item" effect="dark" :content="element.name" placement="top">
  199. <label class="task_name" :style="'background:'+(element.taskStatus==0?'#ffffff;':'#eFeFeF;')"><span>{{element.name}}</span></label>
  200. </el-tooltip>
  201. <i :class="taskTypeIcon[element.taskType]" :style="'float:right;color:'+taskTypeColor[element.taskType]+';margin-right:8px;margin-top:8px;'" ></i>
  202. </div>
  203. <div style="margin: 10px 0px;color:#666;" @click="timess(element.endDate)">
  204. <span v-if="element.endDate >= times || element.taskStatus == 1"><i v-if="element.endDate != null" class="el-icon-date" style="margin-left:5px">&nbsp;&nbsp;{{element.endDate}}</i></span>
  205. <span v-else><em v-if="element.endDate != null" style="display: inline-block;padding:3px 5px"><i v-if="element.endDate != null" class="el-icon-date"><span class="element_span"> &nbsp;&nbsp;{{element.endDate}}{{ $t('jie-zhi') }}</span></i></em></span>
  206. <span v-if="element.executorName">
  207. <span v-for="(exeItem, exeIndex) in element.executorName.split(',')" :key="exeIndex" :style="element.executorColor ? 'background:' + element.executorColor.split(',')[exeIndex] : ''" class="user_name_icon">
  208. <span v-if="user.userNameNeedTranslate != '1'">
  209. {{exeItem.length>2?exeItem.substring(exeItem.length-2, exeItem.length):exeItem}}
  210. </span>
  211. <span v-if="user.userNameNeedTranslate == '1'">
  212. <ww-open-data type='userName' :openid='exeItem'></ww-open-data>
  213. </span>
  214. </span>
  215. </span>
  216. <el-button v-if="!element.executorName" type="primary" @click.stop.native="addAsMyTask(element)" size="mini" style="float:right;width:38px;padding:5px;position: absolute;z-index: 5;right: 5px;">{{ $t('ren-ling') }}</el-button>
  217. </div>
  218. <!--子任务 -->
  219. <div v-if="element.subTaskList.length > 0" class="taskCardCircleBox">
  220. <el-progress type="circle" :percentage="(element.subTaskFinishNum/element.subTaskList.length) * 100" width="16" :show-text="false" stroke-linecap="butt" stroke-width="8"></el-progress><span style="margin-left:5px;font-size:12px;">{{element.subTaskFinishNum}}/{{element.subTaskList.length}}</span>
  221. </div>
  222. <!-- <div v-if="element.taskType == 1 && element.refTaskList != null">
  223. <el-tooltip class="item" effect="dark" content="查看关联任务" placement="top">
  224. <el-link class="sub_task_num" @click.stop.native="showSubTaskList(element)"><i class="iconfont firerock-icontree" ></i><span style="margin-left:5px;">{{element.finishRefTaskCount}}/{{element.refTaskList.length}}</span></el-link>
  225. </el-tooltip>
  226. </div> -->
  227. <div v-if="element.taskType == 1 && !(element.refTaskList == null || element.refTaskList.length == 0)" class="taskCardCircleBox">
  228. <el-progress type="circle" :percentage="(element.finishRefTaskCount/(element.refTaskList ? element.refTaskList.length : 0)) * 100" width="16" :show-text="false" stroke-linecap="butt" stroke-width="8"></el-progress>
  229. <span style="margin-left:5px;font-size:12px">{{element.finishRefTaskCount}}/{{(element.refTaskList ? element.refTaskList.length : 0)}}</span>
  230. </div>
  231. </div>
  232. </draggable>
  233. <el-button v-if="canAddTask" slot="footer" role="people" @click="addTask(stage)" style="width:300px;" size="small" icon="el-icon-plus"></el-button>
  234. <el-label v-if="!canAddTask && (stage.taskList.length == 0)" style="width:300px;color:#666;">{{ $t('zan-wu-ren-wu') }}</el-label>
  235. </div>
  236. </v-flex>
  237. <!-- </transition-group > -->
  238. <el-button slot="footer" v-if="(selectedGroup != null && canEditStageList)" @click="addStage" class="taskList" icon="el-icon-plus" style="margin-top:30px;">{{ $t('creatingTaskList') }}</el-button>
  239. </draggable>
  240. </div>
  241. </div>
  242. <!--列表-->
  243. <el-table v-if="displayTable" :data="taskDataList"
  244. :header-cell-style="{'font-weight':'normal'}" border
  245. highlight-current-row v-loading="listLoading" :height="tableHeight - 85" style="width: 100%;margin-top:10px;" @row-click="taskLineClick">
  246. <el-table-column fixed :label="$t('wan-cheng')" width="50">
  247. <template slot-scope="scope">
  248. <el-checkbox :disabled="scope.row.taskStatus==2" v-model="scope.row.isFinish" size="large" class="cb"
  249. @change="finishTask(scope.row)"
  250. @click.stop.native=""
  251. ></el-checkbox>
  252. </template>
  253. </el-table-column>
  254. <el-table-column prop="name" fixed :label="$t('biao-ti')" width="250">
  255. <template slot-scope="scope">
  256. <el-tooltip class="item" effect="dark" :content="scope.row.name" placement="top">
  257. <span class="single_line" > {{scope.row.name}}</span>
  258. </el-tooltip>
  259. </template>
  260. </el-table-column>
  261. <el-table-column prop="taskType" :label="$t('ren-wu-lei-xing')" width="100">
  262. <template slot-scope="scope">
  263. {{taskTypeList[scope.row.taskType].name}}
  264. </template>
  265. </el-table-column>
  266. <el-table-column prop="taskStatus" :label="$t('taskstatus')" width="100" >
  267. <template slot-scope="scope">
  268. {{taskStatusList[scope.row.taskStatus]}}
  269. </template>
  270. </el-table-column>
  271. <el-table-column prop="parentName" :label="$t('parentsstask')" width="250">
  272. <template slot-scope="scope">
  273. <span style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;"> {{scope.row.parentTname}}</span>
  274. </template>
  275. </el-table-column>
  276. <el-table-column prop="stagesName" :label="$t('tasklist')" width="100" >
  277. </el-table-column>
  278. <el-table-column prop="executorName" :label="$t('zhi-hang-ren')" width="100" >
  279. <template slot-scope="scope">
  280. <span v-if="user.userNameNeedTranslate != '1'">
  281. <!-- {{scope.row.executorName == null?$t('dai-fen-pei'):scope.row.executorName}} -->
  282. <span v-if="scope.row.executorName == null">{{$t('dai-fen-pei')}}</span>
  283. <span v-else>
  284. <span v-for="(item, index) in scope.row.executorName" :key="index">
  285. {{item}}
  286. <span v-if="index < scope.row.executorName.length - 1">,</span>
  287. </span>
  288. </span>
  289. </span>
  290. <span v-if="user.userNameNeedTranslate == '1'">
  291. <span v-if="scope.row.executorName == null">
  292. {{$t('dai-fen-pei')}}
  293. </span>
  294. <span v-else>
  295. <span v-for="(item, index) in scope.row.executorName" :key="index">
  296. <ww-open-data type='userName' :openid='item'></ww-open-data>
  297. <span v-if="index < scope.row.executorName.length - 1">,</span>
  298. </span>
  299. </span>
  300. </span>
  301. </template>
  302. </el-table-column>
  303. <!-- <el-table-column prop="endDate" label="截止时间" width="100" ></el-table-column> -->
  304. <el-table-column prop="startDate" :label="$t('starttimes')" width="100" >
  305. <template slot-scope="scope">
  306. <!-- <p v-if="scope.row.startDate >= times || scope.row.taskStatus != 0">{{scope.row.startDate}}</p>
  307. <p style="border-radius: 3px; text-align: center;background: #e62412; color: #fff;" v-else><span>{{scope.row.startDate}}</span></p> -->
  308. <p>{{scope.row.startDate}}</p>
  309. </template>
  310. </el-table-column>
  311. <el-table-column prop="endDate" :label="$t('deadline')" width="100" >
  312. <template slot-scope="scope">
  313. <p v-if="scope.row.endDate >= times || scope.row.taskStatus != 0">{{scope.row.endDate}}</p>
  314. <p style="border-radius: 3px; text-align: center;background: #e62412; color: #fff;" v-else><span>{{scope.row.endDate}}</span></p>
  315. </template>
  316. </el-table-column>
  317. <el-table-column prop="createDate" :label="$t('creationtime')" width="100" ></el-table-column>
  318. <el-table-column prop="taskLevel" :label="$t('priority')" width="100" >
  319. <template slot-scope="scope">
  320. {{importanceList[scope.row.taskLevel].name}}
  321. </template>
  322. </el-table-column>
  323. </el-table>
  324. <el-col :span="24" class="toolbar" v-if="displayTable">
  325. <el-pagination
  326. @size-change="taskListSizeChange"
  327. @current-change="taskListPageChange"
  328. :page-sizes="[20 , 50 , 80 , 100]"
  329. :page-size="taskListSize"
  330. layout="total, sizes, prev, pager, next"
  331. :total="taskListTotal"
  332. style="float:right;"
  333. ></el-pagination>
  334. </el-col>
  335. </el-main>
  336. </el-container>
  337. </el-tab-pane>
  338. <el-tab-pane :label="$t('fileCenter')" name="files"><FileCenter ref="fileCenter"></FileCenter></el-tab-pane>
  339. <el-tab-pane :label="$t('overviewoftheproject')" name="info"><ProjectInfo ref="projectInfo" @basecost-change="changeBase"></ProjectInfo></el-tab-pane>
  340. <el-tab-pane :label="$t('datastatistics')" name="summary"><Summary ref="summary"></Summary></el-tab-pane>
  341. <el-tab-pane :label="$t('costmanagement')" name="costbaseline" v-if="permissions.projectBaseline"><CostBaseline ref="costbaseline"></CostBaseline></el-tab-pane>
  342. <!--去掉挣值分析模块-->
  343. <!-- <el-tab-pane :label="$t('valueanalysis')" name="earning" v-if="user.id == currentProject.creator || user.id == currentProject.incharger_id ||permissions.projectBaseline"><Earning ref="earning"></Earning></el-tab-pane> -->
  344. </el-tabs>
  345. <!-- 设置参与人员界面 -->
  346. <el-dialog :title="$t('selectingParticipants')" v-if="participantsDialog" :visible.sync="participantsDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  347. <div class="tree" style="height:400px">
  348. <el-scrollbar style="height:100%">
  349. <el-input v-if="user.userNameNeedTranslate != 1"
  350. :placeholder="$t('keywordfiltering')"
  351. v-model="participantsFilterText">
  352. </el-input>
  353. <div v-if="user.userNameNeedTranslate == '1' && false">
  354. <el-input placeholder="请输入内容" v-model.trim="wxFilterText" class="input-with-select">
  355. <el-button slot="append" icon="el-icon-search" @click="echartDepartment()"></el-button>
  356. </el-input>
  357. </div>
  358. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id"
  359. ref="chooseMembTree2" @check-change="onTreeItemChange" :default-checked-keys="alreadyPartArray"
  360. highlight-current :filter-node-method="filterNode">
  361. <span class="custom-tree-node" slot-scope="{ node, data }">
  362. <span v-if="user.userNameNeedTranslate == '1'">
  363. <span v-if="node.data.children">
  364. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  365. </span>
  366. <span v-else>
  367. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  368. </span>
  369. </span>
  370. <span v-if="user.userNameNeedTranslate != '1'">
  371. {{ node.label }}
  372. </span>
  373. </span>
  374. </el-tree>
  375. </el-scrollbar>
  376. </div>
  377. <div>{{ $t('btn.choose') }}&nbsp;{{chosenMembCount}}&nbsp;{{ $t('other.people') }}</div>
  378. <div slot="footer" class="dialog-footer">
  379. <el-button @click="participantsDialog = false">{{ $t('btn.cancel') }}</el-button>
  380. <el-button type="primary" @click="setParticipants()">{{ $t('btn.determine') }}</el-button>
  381. </div>
  382. </el-dialog>
  383. <!--新增任务界面-->
  384. <el-dialog :class="addForm.id==null?'':'jm'" :title="title" v-if="addFormVisible" :visible.sync="addFormVisible"
  385. :close-on-click-modal="false" customClass="customWidth" width="840px" ref="addDialog" :top="'6vh'">
  386. <!-- 整合 -->
  387. <taskComponent ref="thskComponents" :integrationTask="integrationTask" @closeBounced="closeBounced"></taskComponent>
  388. <div slot="title" v-if="addForm.parentTid != null || isRelationItem" >
  389. <!-- <el-link @click="backToParentTask"><i class="el-icon-arrow-left single_line">返回父级任务</i> | {{addForm.parentTname}}</el-link> -->
  390. <el-page-header @back="backToParentTask" :title="timelabel ? $t('returnmilestone') : $t('parenttask')" :content="timelabel ? relationPar.name : addForm.parentTname"></el-page-header>
  391. </div>
  392. <!-- 未整合 -->
  393. <div v-if="false">
  394. <div style="height: 72vh;overflow: auto;">
  395. <el-form ref="form1" :model="addForm" :rules="taskRules" label-width="100px">
  396. <!--子任务需要选择任务列表 -->
  397. <el-form-item :label="$t('tasklist')" prop="stages" v-if="addForm.parentTid != null">
  398. <el-select v-model="addForm.stagesId" style="width:100%;" >
  399. <el-option v-for="item in stageList" :key="item.id" :label="item.stagesName" :value="item.id"></el-option>
  400. </el-select>
  401. </el-form-item>
  402. <el-form-item :label="$t('types')">
  403. <!-- <el-button @click="test">test</el-button> -->
  404. <!-- 0011 -->
  405. <!-- {{groupResponsibleId == user.id}} -->
  406. <el-select v-model="addForm.taskType" style="width:100%;" :disabled="((this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement) && !(groupResponsibleId == user.id)" @change="selchg()">
  407. <el-option v-for="item in taskTypeList" :key="item.id" :label="item.name" :value="item.id">
  408. <i :class="item.icon" ></i>
  409. <span>{{item.name}}</span>
  410. </el-option>
  411. </el-select>
  412. </el-form-item>
  413. <el-form-item :label="$t('taskdefinition')" prop="name">
  414. <el-input v-model="addForm.name" :maxlength="40" :disabled="(this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" :placeholder="$t('enterthetaskcontent')" clearable></el-input>
  415. </el-form-item>
  416. <!-- {{timelabel}}{{mileageCup}} -->
  417. <el-form-item :label="!timelabel ? $t('starttimes') : $t('jie-zhi-shi-jian')" prop="startDate">
  418. <el-date-picker v-model="addForm.startDate" type="date" style="width:40%;" value-format="yyyy-MM-dd"
  419. :placeholder="$t('pleaseselectadate')" :disabled="(this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" @change="DateChange()" v-if="!timelabel"></el-date-picker>
  420. <span style="margin-left:30px;margin-right:10px;" v-if="!timelabel">{{ $t('deadline') }}</span>
  421. <el-date-picker style="width:40%;" v-model="addForm.endDate" type="date" value-format="yyyy-MM-dd"
  422. :placeholder="$t('pleaseselectadate')" :disabled="(this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" @change="DateChange()"></el-date-picker>
  423. <span style="margin-left:30px;margin-right:10px;" v-if="timelabel && mileageCup">{{ $t('wan-cheng-shi-jian') }}</span>
  424. <el-date-picker style="width:40%;" v-if="timelabel && mileageCup" v-model="addForm.finishDate" type="date" value-format="yyyy-MM-dd"
  425. :placeholder="$t('pleaseselectadate')" :disabled="(this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" @change="DateChange()"></el-date-picker>
  426. </el-form-item>
  427. <div style="border: 1px solid #ddd;margin:5px 0;padding:5px 0;">
  428. <el-form-item :label="$t('zhi-hang-ren') + (index+1)" v-for="(executorItem, index) in addForm.executorListFront" :key="index">
  429. <el-select v-if="user.userNameNeedTranslate != 1" v-model="executorItem.executorId" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" size="small" filterable clearable :placeholder="$t('pleaseselectanexecutor')" style="width:40%;" @change="$forceUpdate()">
  430. <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id">
  431. <span style="float: left">{{ item.name }}</span>
  432. <span style="float: right; color: #8492a6; font-size: 13px;margin-left: 20px" v-if="item.jobNumber">{{ item.jobNumber }}</span>
  433. </el-option>
  434. </el-select>
  435. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'mini'" :subject="users" :subjectId="executorItem.executorId" :distinction="'1'" @selectCal="selectCal" :index="index" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)"></selectCat>
  436. <!-- <selectCat v-if="user.userNameNeedTranslate == '1'" :wxCope="true" :size="'size'" :subjectId="executorItem.executorId" :distinction="'1'" :subject="users" @selectCal="selectCal" :index="index" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)"></selectCat> -->
  437. <span style="margin-left:30px;margin-right:10px;">{{ $t('plantime') }} {{gstimday}} {{gstimhour}} {{index}}</span>
  438. <el-input-number size="small" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" v-model="gstimday[index]" style="width:16%;" :min="1" :max="100" :placeholder="$t('danweitian')" @change="chggstim(0,index)"></el-input-number ><span style="margin-left:5px;">{{ $t('time.day') }}</span>
  439. <el-input-number size="small" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" v-model="gstimhour[index]" style="width:16%;" :min="1" :max="100" :placeholder="$t('pleaseentertheplannedworking')" @change="chggstim(1,index)"></el-input-number ><span style="margin-left:5px;">{{ $t('time.hour') }}</span>
  440. <!--移除执行人 -->
  441. <i class="el-icon-delete" v-if="index>0 && (addForm.id == null|| user.id == addForm.createrId || currentProject.inchargerId == user.id|| permissions.projectManagement || groupResponsibleId == user.id)" style="margin-left:5px" @click="removeExecutorLine(index)"></i>
  442. </el-form-item>
  443. <el-link type="primary" v-if="(((addForm.executorListFront == null || addForm.executorListFront.length<10) &&
  444. (addForm.id == null|| user.id == addForm.createrId || currentProject.inchargerId == user.id || permissions.projectManagement)) ||
  445. groupResponsibleId == user.id)"
  446. style="margin-left:35px;" @click="addExecutorLine">{{ $t('addinganexecutor') }}</el-link>
  447. </div>
  448. <el-form-item :label="$t('priority')">
  449. <el-select v-model="addForm.taskLevel" style="width:100%;" >
  450. <el-option v-for="item in importanceList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  451. </el-select>
  452. </el-form-item>
  453. <!-- 富文本 -->
  454. <el-form-item :label="$t('detaileddescription')" style="height: 200px">
  455. <!-- <Editor id="tinymce" v-model="tinymceHtml" :init="editorInit"></Editor> -->
  456. <!-- <el-input type="textarea" v-model="addForm.taskDesc" :rows="3"></el-input> -->
  457. <!-- <quill-edito v-model="addForm.taskDesc"></quill-edito> -->
  458. <quill-editor style="height: 150px" ref="text" v-model="addForm.taskDesc" class="myQuillEditor" :options="editorOption" @blur="onEditorBlur($event)" @focus="onEditorFocus($event)"/>
  459. </el-form-item>
  460. <!-- 富文本 -->
  461. <div v-if="addForm.id != null">
  462. <el-divider ></el-divider>
  463. <!-- 任务进展 -->
  464. <template v-if="!timelabel || isRelationItem">
  465. <p ><i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">{{ $t('taskprogress') }}</i>
  466. <span ref="addPro" style="display: block; float:right;"><el-link @click="addprogress">{{ $t('addtaskprogress') }}</el-link></span>
  467. </p>
  468. <!-- 任务进展展示 -->
  469. <div style="display: none;" ref="proBox" class="progress">
  470. <!-- <el-form :model="> -->
  471. <el-radio-group v-model="radio">
  472. <el-radio :label="0" class="rala1">{{ $t('normals') }}</el-radio>
  473. <el-radio :label="1" class="rala2">{{ $t('atrisk') }}</el-radio>
  474. <el-radio :label="2" class="rala3">{{ $t('withinthetimelimit') }}</el-radio>
  475. </el-radio-group>
  476. <el-input
  477. type="textarea"
  478. border="0"
  479. :autosize="{ minRows: 2, maxRows: 6}"
  480. :placeholder="$t('detailedprogressdescription')"
  481. v-model="text2"
  482. style="margin:10px 0 0 0">
  483. </el-input>
  484. <h4 style="font-weight: normal;">{{ $t('tixiang') }}{{checkLists.length}}</h4>
  485. <i class="el-icon-circle-plus pron_i" style="font-size: 28px;color: #409EFF;" @click="addI(0)"></i>
  486. <div class="remind" ref="addRem" style="display: none">
  487. <el-checkbox-group v-model="checkboxGrounp" v-for="item in users" :key="item.id">
  488. <p>
  489. <el-checkbox :label="item.name" @change="kkk(item)">
  490. <span>
  491. <span v-if="user.userNameNeedTranslate != '1'">
  492. {{item.name}}
  493. </span>
  494. <span v-if="user.userNameNeedTranslate == '1'">
  495. <ww-open-data type='userName' :openid='item.name'></ww-open-data>
  496. </span>
  497. </span>
  498. </el-checkbox>
  499. </p>
  500. </el-checkbox-group>
  501. </div>
  502. <div class="ssp" @click="sss"></div>
  503. <!-- </el-form> -->
  504. <div class="pro_btn">
  505. <el-button size="mini" @click="shutPro">{{ $t('btn.cancel') }}</el-button>
  506. <el-button size="mini" type="primary" @click="addTaskProgress">{{ $t('fa-bu') }}</el-button>
  507. </div>
  508. </div>
  509. <div class="ddl" v-if="recentProgressInfo != null && recentProgressInfo.id != null">
  510. <div class="elCard" style="margin-bottom: 10px; height:" >
  511. <i class="el-icon-success" style="color: #43d14f;" v-if="recentProgressInfo.status == 0"></i>
  512. <i class="el-icon-success" style="color: #fd7624;" v-else-if="recentProgressInfo.status == 1"></i>
  513. <i class="el-icon-success" style="color: #fd4d47;" v-else></i>
  514. <span v-if="recentProgressInfo.status == 0">{{ $t('normals') }}</span>
  515. <span v-else-if="recentProgressInfo.status == 1">{{ $t('normals') }}</span>
  516. <span v-else>{{ $t('withinthetimelimit') }}</span>
  517. <el-dropdown trigger="click" style="float:right;cursor:pointer; float: right;">
  518. <i class="el-icon-more" ></i>
  519. <el-dropdown-menu slot="dropdown">
  520. <el-dropdown-item divided>
  521. <span @click="deleteTaskProgress(recentProgressInfo.id)"><i class="el-icon-delete"></i>{{ $t('deleteList ') }}</span></el-dropdown-item>
  522. </el-dropdown-menu>
  523. </el-dropdown>
  524. <!-- <div class="elCard_qu">{{recentProgressInfo.creatorName}}{{ $t('geng-xin-yu') }}{{recentProgressInfo.indate | relativeTime}}</div> -->
  525. <div class="elCard_qu">
  526. <span>
  527. <span v-if="user.userNameNeedTranslate != '1'">
  528. {{recentProgressInfo.creatorName}}
  529. </span>
  530. <span v-if="user.userNameNeedTranslate == '1'">
  531. <ww-open-data type='userName' :openid='recentProgressInfo.creatorName'></ww-open-data>
  532. </span>
  533. </span>
  534. {{ $t('geng-xin-yu') }}{{recentProgressInfo.indate | relativeTime}}
  535. </div>
  536. <p style="padding-left: 20px;">{{recentProgressInfo.content}}</p>
  537. <div class="examine"><el-button type="text" @click="innerVisibless = true" style="color: #8F87A3;">{{ $t('viewingHistory') }}</el-button></div>
  538. </div>
  539. </div>
  540. <!-- 任务列表没有数据的时候展示 -->
  541. <div class="nones" v-if="ProgressList.length <= 0">
  542. {{ $t('nodata') }}
  543. </div>
  544. <!-- 任务进展完整状态 -->
  545. <el-dialog :title="$t('other.prompts')" :visible.sync="innerVisibless" append-to-body width="500px">
  546. <div class="integrity">
  547. <h3 style="font-weight: normal;display: inline-block;margin: 0 0 20px 0;">{{ $t('taskprogress') }} :{{ProgressList.length}}</h3>
  548. <!-- <span class="write"><i class="el-icon-circle-plus"></i>填写进展</span> -->
  549. <el-divider></el-divider>
  550. <!-- -->
  551. <div class="block" style="height: 200px;">
  552. <el-timeline style="padding:20px 0 0 0;">
  553. <el-timeline-item
  554. v-for="(activity, index) in ProgressList"
  555. :key="index">
  556. <div class="tb">
  557. <span v-if="activity.status == 0" style="color: #43D14F" class="icon"></span>
  558. <span v-if="activity.status == 1" style="color: #FD7624" class="icon"></span>
  559. <span v-if="activity.status == 2" style="color: red" class="icon"></span>
  560. <div>
  561. <span v-if="activity.status == 0" style="color: #43D14F">{{ $t('normals') }}</span>
  562. <span v-if="activity.status == 1" style="color: #FD7624">{{ $t('atrisk') }}</span>
  563. <span v-if="activity.status == 2" style="color: red">{{ $t('withinthetimelimit') }}</span>
  564. <span style="display: inline-block; float: right; color: #8C8C8C">{{activity.indate | relativeTime}}</span>
  565. </div>
  566. <p style="color: #8C8C8C">{{activity.content}}</p>
  567. </div>
  568. </el-timeline-item>
  569. </el-timeline>
  570. </div>
  571. <!-- -->
  572. </div>
  573. <span slot="footer" class="dialog-footer">
  574. <el-button type="primary" @click="innerVisibless = false">{{ $t('Shutdown') }}</el-button>
  575. </span>
  576. </el-dialog>
  577. </template>
  578. <!-- 子任务/关联任务 -->
  579. <p ><i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">{{timelabel && !isRelationItem ? $t('guanlian') : $t('zirwu')}}</i>
  580. <el-link style="float:right;" @click="addRelation" v-if="timelabel && !isRelationItem">{{ $t('associatedTask') }}</el-link>
  581. <el-link style="float:right;" @click="addSubTask" v-else>{{ $t('addingsubtask') }}</el-link>
  582. </p>
  583. <!-- 关联任务列表 -->
  584. <el-table key="guanlian" :data="relationSubTaskList" v-if="timelabel && !isRelationItem"
  585. :header-cell-style="{'font-weight':'normal'}"
  586. highlight-current-row
  587. v-loading="listLoading"
  588. style="width: 100%;margin-top:10px;"
  589. @row-click="relationTaskClick">
  590. <el-table-column prop="taskStatus" :label="$t('wan-cheng')" width="50" >
  591. <template slot-scope="scope">
  592. <el-checkbox :disabled="scope.row.taskStatus==2" :checked="scope.row.taskStatus==1?true:false" size="large" class="cb" @change="relationFinishTask(scope.row)" @click.stop.native=""></el-checkbox>
  593. </template>
  594. </el-table-column>
  595. <el-table-column prop="taskName" :label="$t('biao-ti')" >
  596. <template slot-scope="scope">
  597. <el-tooltip class="item" effect="dark" :content="scope.row.taskName" placement="top" style="cursor:pointer;color:#409eff;">
  598. <span style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;" > {{scope.row.taskName}}</span>
  599. </el-tooltip>
  600. </template>
  601. </el-table-column>
  602. <el-table-column :label="$t('operation')" width="130" align="left">
  603. <template slot-scope="scope">
  604. <el-button @click.stop.native="deleteRelationItem(scope.row.id)" size="mini">{{ $t('dissociated') }}</el-button>
  605. </template>
  606. </el-table-column>
  607. </el-table>
  608. <!--子任务列表 -->
  609. <el-table key="zi" :data="addForm.subTaskList" v-else
  610. :header-cell-style="{'font-weight':'normal'}"
  611. highlight-current-row v-loading="listLoading" style="width: 100%;margin-top:10px;" @row-click="taskLineClick">
  612. <el-table-column prop="taskStatus" :label="$t('wan-cheng')" width="50" >
  613. <template slot-scope="scope">
  614. <el-checkbox :disabled="scope.row.taskStatus==2" :checked="scope.row.taskStatus==1?true:false" size="large" class="cb"
  615. @click.stop.native=""
  616. @change="finishTask(scope.row)"
  617. ></el-checkbox>
  618. </template>
  619. </el-table-column>
  620. <el-table-column prop="name" :label="$t('biao-ti')" >
  621. <template slot-scope="scope">
  622. <el-tooltip class="item" effect="dark" :content="scope.row.name" placement="top">
  623. <span style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;" > {{scope.row.name}}</span>
  624. </el-tooltip>
  625. </template>
  626. </el-table-column>
  627. <el-table-column prop="executorName" :label="$t('zhi-hang-ren')" width="100" >
  628. <template slot-scope="scope">
  629. <span v-if="user.userNameNeedTranslate != 1">
  630. {{scope.row.executorName == null?$t('dai-fen-pei'):scope.row.executorName}}
  631. </span>
  632. <span v-if="user.userNameNeedTranslate == 1">
  633. <span v-if="scope.row.executorName == null">
  634. {{$t('dai-fen-pei')}}
  635. </span>
  636. <span v-else>
  637. <span v-for="item,index in scope.row.executorName" :key="index">
  638. <ww-open-data type='userName' :openid='item'></ww-open-data>
  639. <span v-if="index < scope.row.executorName.length - 1">,</span>
  640. </span>
  641. </span>
  642. </span>
  643. </template>
  644. </el-table-column>
  645. <el-table-column prop="endDate" :label="$t('deadline')" width="100" >
  646. <template slot-scope="scope">
  647. <p v-if="scope.row.endDate >= times">{{scope.row.endDate}}</p>
  648. <p v-else style="background: #e62412; color: #fff;text-align: center; border-radius: 3px;">{{scope.row.endDate}}</p>
  649. </template>
  650. </el-table-column>
  651. </el-table>
  652. </div>
  653. </el-form>
  654. <!-- 关联文件列表 -->
  655. <template v-if="isEditFile">
  656. <div style="width:100%;margin:1em 0;">
  657. <i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">{{ $t('jiafuchengguo') }}</i>
  658. <el-link @click="relationFileClick()" style="float:right;margin-left:10px">{{ $t('associatedfiles') }}</el-link>
  659. <el-upload style="float:right;" action="#" :http-request="uploadFileClick" :show-file-list="false" :multiple="false">
  660. <el-link>{{ $t('uoloadFiles') }}</el-link>
  661. </el-upload>
  662. </div>
  663. <el-table
  664. v-loading="fileListLoading"
  665. ref="filetable"
  666. :data="taskFileList"
  667. :header-cell-style="{'font-weight':'normal'}"
  668. highlight-current-row
  669. max-height="240"
  670. style="width: 100%;margin-top:10px;margin-bottom:15px">
  671. <el-table-column :label="$t('headerTop.serialNumber')" prop="documentType" min-width="40" align="center">
  672. <template slot-scope="scope">
  673. <div>
  674. {{scope.$index + 1}}
  675. </div>
  676. </template>
  677. </el-table-column>
  678. <el-table-column :label="$t('filenames')" prop="documentName" min-width="180"></el-table-column>
  679. <el-table-column :label="$t('filesize')" prop="size" min-width="60" align="center"></el-table-column>
  680. <el-table-column :label="$t('founder')" prop="creatorName" min-width="60" align="center">
  681. <template slot-scope="scope">
  682. <div>
  683. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.creatorName}}</span>
  684. <span v-if="user.userNameNeedTranslate == 1">
  685. <ww-open-data type='userName' :openid='scope.row.creatorName'></ww-open-data>
  686. </span>
  687. </div>
  688. </template>
  689. </el-table-column>
  690. <el-table-column :label="$t('creationtime')" prop="indate" min-width="120" align="center">
  691. <template slot-scope="scope">
  692. <span>{{scope.row.indate[0] + '-' + scope.row.indate[1] + '-' + scope.row.indate[2] + '\u0020\u0020' + scope.row.indate[3] + ':' + scope.row.indate[4] + ':' + scope.row.indate[5]}}</span>
  693. </template>
  694. </el-table-column>
  695. <el-table-column :label="$t('operation')" min-width="90">
  696. <template slot-scope="scope">
  697. <el-link :href="scope.row.url" :download="scope.row.documentName" type="primary" style="margin-right:7px">{{ $t('other.download') }}</el-link>
  698. <el-link @click="taskFileDelete(scope.row.id)">{{ $t('btn.delete') }}</el-link>
  699. </template>
  700. </el-table-column>
  701. </el-table>
  702. </template>
  703. <!-- 关联文件dialog -->
  704. <el-dialog v-if="relationFileDialog" :visible.sync="relationFileDialog" :title="$t('associatedfiles')" append-to-body>
  705. <span>{{ $t('wenjian1guanli') }}</span>
  706. <div>
  707. <span>{{ $t('xuanzwenjian') }}</span>
  708. <el-select v-model="addFileId" filterable >
  709. <el-option
  710. v-for="item in projectFileList"
  711. :key="item.id"
  712. :label="item.documentName"
  713. :value="item.id"
  714. ></el-option>
  715. </el-select>
  716. <el-button @click="addTaskFile()">{{ $t('btn.determine') }}</el-button>
  717. <!-- <el-button @click="relationFileDialog = false">取消</el-button> -->
  718. </div>
  719. </el-dialog>
  720. <el-dialog v-if="isRelationTab" :visible.sync="isRelationTab" :title="$t('associatedTask')" width="800px" append-to-body>
  721. <el-form ref="relationItemForm" label-width="100px">
  722. <el-form-item :label="$t('selecttask')" prop="taskType">
  723. <el-select v-model="relationvalue" multiple style="width:80%">
  724. <el-option
  725. v-for="item in relationdata"
  726. :key="item.id"
  727. :label="item.name"
  728. :value="item.id"
  729. ></el-option>
  730. </el-select>
  731. </el-form-item>
  732. </el-form>
  733. <div slot="footer" class="dialog-footer">
  734. <el-button @click="isRelationTab = false">{{ $t('btn.cancel') }}</el-button>
  735. <el-button type="primary" @click="addRelationTask()">{{ $t('btn.determine') }}</el-button>
  736. </div>
  737. </el-dialog>
  738. </div>
  739. <div slot="footer" class="dialog-footer">
  740. <el-button v-if="(user.id == addForm.createrId || currentProject.inchargerId == user.id || currentProject.creatorId == user.id || permissions.projectManagement) && canAddTask" @click.native="deleteTask()" style="float:left;">{{ $t('btn.delete') }}</el-button>
  741. <el-button @click.native="addFormVisible = false">{{ $t('btn.cancel') }}</el-button>
  742. <el-button type="primary" @click="submitInsert" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  743. </div>
  744. <div slot="title" v-if="addForm.parentTid != null || isRelationItem" >
  745. <!-- <el-link @click="backToParentTask"><i class="el-icon-arrow-left single_line">返回父级任务</i> | {{addForm.parentTname}}</el-link> -->
  746. <el-page-header @back="backToParentTask" :title="timelabel ? $t('returnmilestone') : $t('parenttask')" :content="timelabel ? relationPar.name : addForm.parentTname"></el-page-header>
  747. </div>
  748. <!-- 评论 -->
  749. <div class="remark" v-show="addForm.id != null">
  750. <span class="zh">
  751. <div class="player">
  752. <p>{{ $t('participantin') }}</p>
  753. <div class="bj">
  754. <span v-for="(pl, i) in critic" :key="i">
  755. <span style="background: #778899" v-if="user.userNameNeedTranslate != 1">{{pl.length > 2 ? pl.substring(pl.length - 2, pl.length) : pl}}</span>
  756. <span v-if="user.userNameNeedTranslate == 1">
  757. <ww-open-data type='userName' :openid='pl'></ww-open-data>
  758. </span>
  759. </span>
  760. <!-- <span style="background: #778899">{{pl.length}}</span> -->
  761. </div>
  762. </div>
  763. <div class="subject">
  764. <div class="sub-all">
  765. <div :class="dynamicTab ? 'subOn' : ''" @click="dynamicTab = true">{{ $t('alldynamic') }}</div>
  766. <div :class="dynamicTab ? '' : 'subOn'" @click="dynamicTab = false">{{ $t('xiang-guan-ri-bao') }}</div>
  767. </div>
  768. <div class="sub-details" ref="main" v-if="dynamicTab">
  769. <ul class="infinite-list" v-infinite-scroll="load" ref="contRoll">
  770. <div style="width: 100%" v-if="commentList.length <= 0">
  771. <img src="../../assets/image/xiao.png" alt="">
  772. </div>
  773. <li v-for="i in count" class="infinite-list-item counli" :key="i">
  774. <p><i class="el-icon-s-fold"></i> <em>{{ $t('managerQucompletedthedependencytask') }}</em><span>{{ $t('onApril20') }}</span></p>
  775. </li>
  776. <li class="carts" v-for="item in commentList" :key="item.id">
  777. <!-- <el-image style="width: 30px; height: 30px" :src="url" :fit="fit"></el-image> -->
  778. <!-- <i :style="'background' + item.userColor"> -->
  779. <i :style="'background' + item.userColor">
  780. <i v-if="user.userNameNeedTranslate != 1">
  781. {{item.userName.length > 2 ? item.userName.substring(item.userName.length - 2, item.userName.length) : item.userName}}
  782. </i>
  783. <i v-if="user.userNameNeedTranslate == 1">
  784. <ww-open-data type='userName' :openid='item.userName'></ww-open-data>
  785. </i>
  786. </i>
  787. <div>
  788. <!-- <p>{{item.userName}}</p> -->
  789. <!-- <p> -->
  790. <p v-if="user.userNameNeedTranslate != 1">
  791. {{item.userName}}
  792. </p>
  793. <p v-if="user.userNameNeedTranslate == 1">
  794. <ww-open-data type='userName' :openid='item.userName'></ww-open-data>
  795. </p>
  796. <!-- </p> -->
  797. <em>
  798. <!-- {{item.content}} -->
  799. <p style="display: inline-block;padding: 0;margin: 0;" v-if="user.userNameNeedTranslate == 1">
  800. {{item.content.msg1}}
  801. <ww-open-data type='userName' :openid='item.content.msg2'></ww-open-data>
  802. {{item.content.msg3}}
  803. </p>
  804. <p style="display: inline-block;padding: 0;margin: 0;" v-if="user.userNameNeedTranslate != 1">{{item.content}}</p>
  805. </em>
  806. </div>
  807. <span>{{item.createTime | relativeTime}}</span>
  808. </li>
  809. </ul>
  810. </div>
  811. <div class="Daily" v-if="!dynamicTab">
  812. <div class="one_daily_body DailyBody">
  813. <el-card shadow="never" v-for="(item2,index2) in dailyList" :key="index2" style="margin-bottom: 20px;">
  814. <p>
  815. {{ $t('tian-bao-ren') }}: <span v-if="user.userNameNeedTranslate != 1">{{item2.userName}}</span>
  816. <span v-if="user.userNameNeedTranslate == 1">
  817. <ww-open-data type='userName' :openid='item2.userName'></ww-open-data>
  818. </span>
  819. <span style="float: right;">{{item2.createDate}}</span>
  820. </p>
  821. <p>{{ $t('other.approvalStatus') }}:
  822. <span v-if="user.company.packageEngineering == 0">
  823. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">
  824. <span v-if="item2.isDeptAudit==0">
  825. <span v-if="item2.projectAuditState==0">
  826. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  827. <span v-if="item2.projectAuditorName != null">(
  828. <span v-if="user.userNameNeedTranslate == '1'">
  829. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  830. </span>
  831. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  832. )</span>
  833. <!-- 审核 --> {{$t('other.audit')}}
  834. </span>
  835. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  836. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  837. <span v-if="item2.projectAuditorName != null">(
  838. <!-- {{item2.projectAuditorName}} -->
  839. <span v-if="user.userNameNeedTranslate == '1'">
  840. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  841. </span>
  842. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  843. )</span>
  844. <!-- 审核通过 --> {{$t('state.approved')}}
  845. </span>
  846. </span>
  847. <span v-else-if="item2.isDeptAudit==1">
  848. ({{$t('other.await')}}
  849. <span v-if="user.userNameNeedTranslate == '1'">
  850. <ww-open-data type='departmentName' :openid='item2.auditDeptName'></ww-open-data>
  851. </span>
  852. <span v-if="user.userNameNeedTranslate != '1'">{{item2.auditDeptName}}</span>
  853. {{$t('other.audit')}})
  854. </span>
  855. </span>
  856. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">{{$t('other.importWaitingForReview')}}</span>
  857. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">{{$t('state.alreadyPassed')}}
  858. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1">{{$t('other.automaticReview')}}</span>
  859. </span>
  860. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">{{$t('state.rejected')}} {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  861. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">{{$t('state.waitingsubmit')}}</span>
  862. </span>
  863. <span v-if="user.company.packageEngineering == 1">
  864. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">{{$t('other.importWaitingForReview')}}</span>
  865. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">{{$t('other.waitingForProfessionalReview')}}</span>
  866. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">{{$t('other.waitingForDepartmentReview')}}</span>
  867. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">{{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  868. (
  869. <span v-if="user.userNameNeedTranslate != 1">
  870. {{item2.projectAuditorName}}
  871. </span>
  872. <span v-if="user.userNameNeedTranslate == 1">
  873. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  874. </span>
  875. )
  876. </span>{{$t('other.audit')}}</span>
  877. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">{{$t('state.alreadyPassed')}}</span>
  878. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">{{$t('state.rejected')}} {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  879. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">{{$t('state.waitingsubmit')}}</span>
  880. </span>
  881. </p>
  882. <p v-if="user.timeType.customDegreeActive==1 && item2.degree_id != null && item2.degree_id != -1">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  883. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  884. <!-- 自定义日报文本 -->
  885. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  886. <p v-if="user.company.packageEngineering == 1">
  887. {{$t('other.professionalProgress')}}:
  888. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  889. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  890. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  891. </el-tooltip>
  892. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  893. <i class="iconfont firerock-iconshenhetongguo"></i>
  894. </el-tooltip>
  895. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  896. <i class="iconfont firerock-iconshenhebohui"></i>
  897. </el-tooltip>
  898. </span>
  899. </p>
  900. <div v-if="item2.multiWorktime==0">
  901. <p style="display: inline-block;">{{$t('time.duration')}}:
  902. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  903. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  904. {{item2.time.toFixed(1)}}h
  905. <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{$t('other.WorkOvertime')}}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag>
  906. </p>
  907. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  908. </div>
  909. <div v-if="item2.multiWorktime==1" >
  910. <p>{{$t('other.projectDuration')}}:{{item2.time.toFixed(1)}}h <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{ $t('other.WorkOvertime') }}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag></p>
  911. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  912. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  913. <p style="display: inline-block;">{{$t('time.duration')}}:
  914. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  915. {{timeItem.time.toFixed(1)}}h
  916. </p>
  917. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  918. </div>
  919. </div>
  920. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  921. <!--照片的显示 -->
  922. <p v-if="item2.pics != null && item2.pics.length > 0">
  923. <el-image v-for="(pic, index) in item2.pics" :key="index"
  924. style="width: 100px; height: 100px; margin-right:10px;"
  925. :src="pic"
  926. :preview-src-list="item2.pics">
  927. </el-image>
  928. </p>
  929. </el-card>
  930. </div>
  931. </div>
  932. </div>
  933. <div class="issue" v-if="dynamicTab">
  934. <!-- <el-input type="textarea" class="textareays" label-width="100%" label-height="140px"></el-input> -->
  935. <div class="issue_fixation">
  936. <div class="inputDeep"><el-input
  937. type="textarea"
  938. :placeholder="$t('pleaseentercontent')"
  939. :autosize="{ minRows: 6, maxRows: 6}"
  940. v-model="textarea2"
  941. class="inputDeeps"
  942. >
  943. </el-input></div>
  944. <el-button class="issue-button" type="primary" @click="release()">{{ $t('fa-bu') }}</el-button>
  945. </div>
  946. </div>
  947. </span>
  948. </div>
  949. </div>
  950. </el-dialog>
  951. <!-- 子任务列表 -->
  952. <el-dialog :title="addForm.taskType == 1 ? $t('cha-kan-guan-lian-ren-wu') : $t('cha-kan-zi-ren-wu')" v-if="subTaskVisible" :visible.sync="subTaskVisible" :close-on-click-modal="false" customClass="customWidth" width="800px">
  953. <el-table :data="addForm.subTaskList"
  954. :header-cell-style="{'font-weight':'normal'}"
  955. highlight-current-row v-loading="listLoading" style="width: 100%;margin-top:10px;" @row-click="taskLineClick">
  956. <el-table-column prop="taskStatus" label="$t('wan-cheng')" width="50" >
  957. <template slot-scope="scope">
  958. <el-checkbox :disabled="scope.row.taskStatus==2" :checked="scope.row.taskStatus==1?true:false" size="large" class="cb"
  959. @click.stop.native="finishTask(scope.row)"
  960. ></el-checkbox>
  961. </template>
  962. </el-table-column>
  963. <el-table-column prop="name" :label="$t('biao-ti')" >
  964. <template slot-scope="scope">
  965. <el-tooltip class="item" effect="dark" :content="scope.row.name" placement="top">
  966. <span style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;" > {{scope.row.name}}</span>
  967. </el-tooltip>
  968. </template>
  969. </el-table-column>
  970. <el-table-column prop="executorName" :label="$t('zhi-hang-ren')" width="100" >
  971. <template slot-scope="scope">
  972. <span v-if="user.userNameNeedTranslate != 1">
  973. {{scope.row.executorName == null?$t('dai-fen-pei'):scope.row.executorName}}
  974. </span>
  975. <span v-if="user.userNameNeedTranslate == 1">
  976. <span v-if="scope.row.executorName == null">
  977. {{$t('dai-fen-pei')}}
  978. </span>
  979. <span v-else>
  980. <ww-open-data type='userName' :openid='scope.row.executorName'></ww-open-data>
  981. </span>
  982. </span>
  983. </template>
  984. </el-table-column>
  985. <el-table-column prop="endDate" :label="$t('deadline')" width="100" ></el-table-column>
  986. </el-table>
  987. </el-dialog>
  988. <!--用户详细信息弹出框-->
  989. <el-dialog :title="$t('Checkthedetails')" v-if="userDetailVisible" :visible.sync="userDetailVisible" :close-on-click-modal="false" customClass="customWidth" width="400px">
  990. <div class="line"><span>{{ $t('lable.name') }}</span>
  991. <span v-if="user.userNameNeedTranslate != 1">{{userDetail.name}}</span>
  992. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='userDetail.name'></ww-open-data></span>
  993. </div>
  994. <div class="line"><span>{{ $t('Worknumber') }}</span><span>{{userDetail.jobNumber}}</span></div>
  995. <div class="line"><span>{{ $t('lable.phone') }}</span><span>{{userDetail.phone}}</span></div>
  996. <div class="line"><span>{{ $t('lable.department') }}</span>
  997. <span v-if="user.userNameNeedTranslate != 1">{{userDetail.departmentName}}</span>
  998. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='userDetail.departmentName'></ww-open-data></span>
  999. </div>
  1000. <div class="line"><span>{{ $t('costof') }}</span><span>{{userDetail.cost}}{{ $t('Yuananhour') }}</span></div>
  1001. <div slot="footer" class="dialog-footer">
  1002. <el-button type="primary" @click="userDetailVisible = false" >{{ $t('btn.determine') }}</el-button>
  1003. </div>
  1004. </el-dialog>
  1005. <!-- 新增任务分组弹出框 -->
  1006. <el-dialog v-if="addGroupDialog" :visible.sync="addGroupDialog" :close-on-click-modal="false" customClass="customWidth" width="600px">
  1007. <div slot="title" >
  1008. <el-tabs v-model="createGroupWay">
  1009. <el-tab-pane :label="$t('newgrouping')" name="new">
  1010. <el-form ref="formGrouping" :model="groupForm" :rules="formGrouping" style="margin-top:40px;">
  1011. <el-form-item prop="name">
  1012. <el-input v-model.trim="groupForm.name" :placeholder="$t('pleaseenteragroupname')" maxlength="50"
  1013. show-word-limit clearable></el-input>
  1014. </el-form-item>
  1015. <el-button type="primary" @click="addGroup('formGrouping')" style="width:100%;" >{{ $t('create') }}</el-button>
  1016. </el-form>
  1017. </el-tab-pane>
  1018. <el-tab-pane :label="$t('creatintemplate')" name="template">
  1019. <el-card class="template_box" :style="t.selected?'border: 1px solid #409eff;':''" v-for="(t,tIndex) in groupTemplateList" :key="t.id" @click.native="choseTemplate(tIndex)">
  1020. <div>
  1021. <el-row >
  1022. <el-col :span="22">
  1023. <div><span>{{t.name}}</span>
  1024. <el-link :underline="false" type="primary" style="color:#aaa;margin-left:10px;"
  1025. @click="setTemplate(t)"><i class="el-icon-setting" v-show="t.isSystem == 0" ></i>
  1026. </el-link>
  1027. <el-link :underline="false" type="primary" style="color:#aaa;margin-left:10px;"
  1028. @click="deleteTemplate(t)"><i class="el-icon-delete" v-show="t.isSystem == 0" ></i>
  1029. </el-link>
  1030. </div>
  1031. <div style="margin-top:10px;">
  1032. <span style="color:#8c8c8c;font-size:12px;" v-for="(s,index) in t.stagesList" :key="s.id">
  1033. <i class="el-icon-arrow-right" v-if="index>0"></i>
  1034. {{s.stagesName}}</span>
  1035. </div>
  1036. </el-col>
  1037. <el-col :span="2">
  1038. <i class="el-icon-check" v-show="t.selected" style="font-size:20px;color:#409eff;margin-top:12px;"></i>
  1039. </el-col>
  1040. </el-row>
  1041. </div>
  1042. </el-card>
  1043. <el-button type="primary" @click="addTemplateGroup" style="width:100%;" >{{ $t('create') }}</el-button>
  1044. </el-tab-pane>
  1045. </el-tabs>
  1046. </div>
  1047. <el-dialog :title="$t('bian-ji-mo-ban')" append-to-body v-if="setTemplateDialog" :visible.sync="setTemplateDialog" width="500px">
  1048. <el-form label-width="20%">
  1049. <el-form-item :label="$t('mo-ban-ming-cheng')"><el-input v-model="setTemplateData.name" style="width:80%" clearable></el-input></el-form-item>
  1050. <el-form-item label=""><el-checkbox v-model="setTemplateData.creWithPro">{{ $t('suixiangmuzidongchuangjian') }}</el-checkbox></el-form-item>
  1051. <el-form-item v-for="item,index in setTemplateData.stagesList" :key="item.id" :label="index == 0 ? '任务列表' : ''">
  1052. <el-input v-model="item.stagesName" style="width:70%" clearable></el-input>
  1053. <el-link :underline="false" type="primary" style="color:#aaa;" @click="deleteStages(item,index)" v-if="index != 0">
  1054. <i class="el-icon-delete"></i>
  1055. </el-link>
  1056. </el-form-item>
  1057. <el-link style="margin-left:20%" :underline="false" type="primary" @click="addStages()">{{ $t('xin-zeng-ren-wu-lie-biao') }}</el-link>
  1058. </el-form>
  1059. <div slot="footer" class="dialog-footer">
  1060. <el-button type="primary" @click="setTemplateDialog = false">{{ $t('btn.cancel') }}</el-button>
  1061. <el-button type="primary" @click="setTemplateSave()">{{ $t('save') }}</el-button>
  1062. </div>
  1063. </el-dialog>
  1064. </el-dialog>
  1065. <el-dialog :title="$t('taskgroupleader')" v-if="setInchargerDialog" :visible.sync="setInchargerDialog" :close-on-click-modal="false" customClass="customWidth" width="300px">
  1066. <el-form ref="formIncharger" :model="groupForm" :rules="rules" style="margin-top:10px;">
  1067. <el-form-item prop="taskGpIncharge">
  1068. <el-select v-if="user.userNameNeedTranslate != 1" v-model="groupForm.inchargerId" :placeholder="$t('defaultText.pleaseChoose')" style="width:100%;" clearable filterable>
  1069. <el-option v-for="item in joinMembList" :key="item.id" :value="item.id" :label="item.name">
  1070. <span style="float: left">{{ item.name }}</span>
  1071. <span style="float: right; color: #8492a6; font-size: 13px">{{ item.jobNumber }}</span>
  1072. </el-option>
  1073. </el-select>
  1074. <selectCat v-if="user.userNameNeedTranslate == 1" :filterable="true" :size="'mini'" @selectCal="selectCal" :subject="joinMembList" :subjectId="groupForm.inchargerId" :clearable="true" :distinction="'2'"></selectCat>
  1075. </el-form-item>
  1076. </el-form>
  1077. <div slot="footer" class="dialog-footer">
  1078. <el-button type="primary" @click="saveGroupIncharger" style="width:100%;" >{{ $t('save') }}</el-button>
  1079. </div>
  1080. </el-dialog>
  1081. <el-dialog :title="$t('modifyingTaskGroup')" v-if="modGroupDialog" :visible.sync="modGroupDialog" :close-on-click-modal="false" customClass="customWidth" width="450px">
  1082. <el-form ref="form2" :model="groupForm" :rules="rules" style="margin-top:10px;">
  1083. <el-form-item :label="$t('bian-hao')" label-width="50px">
  1084. <el-input v-model="groupForm.taskGroupCode" :placeholder="$t('peaseenterthe')" maxlength="20"
  1085. show-word-limit clearable></el-input>
  1086. </el-form-item>
  1087. <el-form-item prop="name" :label="$t('names')" label-width="50px">
  1088. <el-input type="textarea" :rows="3" v-model="groupForm.name" :placeholder="$t('peaseenterthe')" maxlength="50"
  1089. show-word-limit clearable></el-input>
  1090. </el-form-item>
  1091. </el-form>
  1092. <div slot="footer" class="dialog-footer">
  1093. <el-button type="primary" @click="addGroup('form2')" style="width:100%;" >{{ $t('save') }}</el-button>
  1094. </div>
  1095. </el-dialog>
  1096. <el-dialog title="设置分组预估工时" v-if="modGroupManDayDialog" :visible.sync="modGroupManDayDialog" :close-on-click-modal="false" customClass="customWidth" width="450px">
  1097. <el-table :data="groupList" size="small" :key="Math.random()" :height="'400px'" show-summary="true">
  1098. <el-table-column prop="name" label="分组名称">
  1099. </el-table-column>
  1100. <el-table-column prop="manDay" width="200" label="预估工时" >
  1101. <template slot-scope="scope">
  1102. <el-input v-model="scope.row.manDay" type="number" :placeholder="$t('peaseenterthe')" maxlength="10" :max="99999" style="width:120px;"></el-input>&nbsp;人天
  1103. </template>
  1104. </el-table-column>
  1105. </el-table>
  1106. <p style="text-align:center;">当前项目预估工时为:{{ currentProject.manDay == null? 0:currentProject.manDay }}人天</p>
  1107. <div slot="footer" class="dialog-footer">
  1108. <el-button type="primary" @click="setManDayData()" style="width:100%;" >{{ $t('save') }}</el-button>
  1109. </div>
  1110. </el-dialog>
  1111. <el-dialog :title="$t('addtemplate')" v-if="addToTmpDialog" :visible.sync="addToTmpDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1112. <el-form ref="formTmp" :model="templateForm" :rules="rules" style="margin-top:10px;">
  1113. <el-form-item prop="name">
  1114. <el-input v-model="templateForm.name" :placeholder="$t('entertemplatename')" maxlength="12"
  1115. show-word-limit clearable></el-input>
  1116. <div>
  1117. <span style="margin-right:20px">{{ $t('sametimetosave') }}</span>
  1118. <el-checkbox v-model="templateForm.saveTask" :label="$t('other.task')"></el-checkbox>
  1119. <el-checkbox v-model="templateForm.saveMileStone" :label="$t('other.milestone')"></el-checkbox>
  1120. <el-checkbox v-model="templateForm.saveRisk" :label="$t('risk')"></el-checkbox>
  1121. <el-checkbox v-model="templateForm.automatically" :label="$t('suixiangmuzidongchuangjian')"></el-checkbox>
  1122. </div>
  1123. </el-form-item>
  1124. </el-form>
  1125. <div slot="footer" class="dialog-footer">
  1126. <el-button type="primary" @click="createTemplate" style="width:100%;" :loading="saveTemplateLoading">{{ $t('savetemplate') }}</el-button>
  1127. </div>
  1128. </el-dialog>
  1129. <!-- 新增任务列表弹出框 -->
  1130. <el-dialog :title="$t('modifyingtheTaskList')" v-if="addStageDialog" :visible.sync="addStageDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1131. <el-form ref="form2" :model="stageForm" :rules="rules2" >
  1132. <el-form-item prop="stagesName">
  1133. <el-input v-model="stageForm.stagesName" :placeholder="$t('pleaseenteratasklistname')" maxlength="60"
  1134. show-word-limit clearable>
  1135. <template slot="prepend">
  1136. <div style="width:90px">{{ $t('ren-wu-lie-biao-ming-cheng') }}</div>
  1137. </template></el-input>
  1138. <el-input v-if="user.timeType.stageHasEvtime == 1" id="stageForm_ysgs" v-model="stageForm.stagesTime" style="margin-top:5px" @keyup.native="restrictNumber('stageForm_ysgs')">
  1139. <template slot="prepend">
  1140. <div style="width:90px">{{ $t('yu-suan-gong-shi') }}<span>(h)</span></div>
  1141. </template>
  1142. </el-input>
  1143. </el-form-item>
  1144. </el-form>
  1145. <div slot="footer" class="dialog-footer">
  1146. <el-button type="primary" @click="addStagePost" style="width:100%;" >{{ $t('save') }}</el-button>
  1147. </div>
  1148. </el-dialog>
  1149. <!--导出数据条件选择 -->
  1150. <el-dialog :title="$t('workplanexport')" v-if="exportDialog" :visible.sync="exportDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1151. <el-form ref="form3" >
  1152. <el-form-item :label="$t('choosetype')">
  1153. <el-select v-model="exportTaskType" :placeholder="$t('typesof')" clearable style="width:350px;">
  1154. <el-option :label="$t('other.task')" value="0"></el-option>
  1155. <el-option :label="$t('other.milestone')" value="1"></el-option>
  1156. <el-option :label="$t('risk')" value="2"></el-option>
  1157. </el-select>
  1158. </el-form-item>
  1159. </el-form>
  1160. <div slot="footer" class="dialog-footer">
  1161. <el-button type="primary" @click="exportTask" style="width:100%;" :loading="loadingExport">{{ $t('export.export') }}</el-button>
  1162. </div>
  1163. </el-dialog>
  1164. <!--导入数据,下载模板 -->
  1165. <el-dialog :title="$t('wdorkplanimport')" v-if="importTaskDialog" :visible.sync="importTaskDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1166. <el-form ref="form4" >
  1167. <el-form-item :label="'1. '+$t('qing-xian-xia-zai-mo-ban-bing-tian-xie-hou-shang-chuan')" >
  1168. <el-link type="primary" :underline="false" href="./upload/项目任务导入模板.xlsx" :download="$t('projectTaskTemplate') + '.xlsx'">{{ $t('projecttasktemplatedownload') }}</el-link>
  1169. </el-form-item>
  1170. <!-- <el-form-item label="2. 选择要导入的任务列表" v-if="false">
  1171. <el-select v-model="importToStageId" placeholder="任务列表" style="width:350px;">
  1172. <el-option v-for="item in stageList" :label="item.stagesName" :value="item.id" :key="item.id"></el-option>
  1173. </el-select>
  1174. </el-form-item> -->
  1175. <div><span style="font-size:12px;color:#999;">{{ $t('faoesgfavsbxjs') }}</span></div>
  1176. </el-form>
  1177. <div slot="footer" class="dialog-footer">
  1178. <el-upload ref="upload" action="#" :limit="1" :http-request="importTask" :show-file-list="false">
  1179. <el-button type="primary" :underline="false" style="width:100%;" :loading="loadingExport">{{ $t('uoloadFiles') }}</el-button>
  1180. </el-upload>
  1181. </div>
  1182. </el-dialog>
  1183. </div>
  1184. </div>
  1185. </section>
  1186. </template>
  1187. <script>
  1188. // 自定义select组件
  1189. import selectCat from "@/components/select.vue"
  1190. import util from "../../common/js/util";
  1191. import draggable from 'vuedraggable';
  1192. import tinymce from 'tinymce/tinymce'
  1193. import 'tinymce/themes/silver/theme'
  1194. import 'tinymce/skins/ui/oxide/skin.css';
  1195. import FileCenter from './fileCenter.vue';
  1196. import ProjectInfo from './info.vue';
  1197. import Summary from './summary.vue';
  1198. import Earning from './earning.vue';
  1199. import CostBaseline from './CostBaseline.vue'
  1200. import taskComponent from "@/components/taskComponent.vue"
  1201. // import editor from '@tinymce/tinymce-vue'
  1202. // 富文本样式
  1203. import 'quill/dist/quill.core.css'
  1204. import 'quill/dist/quill.snow.css'
  1205. import 'quill/dist/quill.bubble.css'
  1206. // 导入富文本
  1207. import { quillEditor } from 'vue-quill-editor'
  1208. import { error } from 'dingtalk-jsapi';
  1209. import delete$ from 'dingtalk-jsapi/api/biz/cspace/delete';
  1210. let id=1;
  1211. export default {
  1212. name: "two-list-headerslots",
  1213. display: "Two list header slot",
  1214. order: 14,
  1215. components: {
  1216. draggable,
  1217. // editor,
  1218. FileCenter,
  1219. ProjectInfo,
  1220. Summary,
  1221. CostBaseline,
  1222. Earning,
  1223. quillEditor, // 富文本
  1224. selectCat,
  1225. taskComponent
  1226. },
  1227. data() {
  1228. return {
  1229. modGroupManDayDialog: false,
  1230. isManageDept: false,
  1231. componentFlg: false,
  1232. mileageCup: false,
  1233. loadingExport : false,
  1234. saveTemplateLoading: false,
  1235. joinMembList:[],
  1236. setInchargerDialog: false,
  1237. recentProgressInfo:{},
  1238. addToTmpDialog:false,
  1239. templateForm:{},
  1240. importTaskDialog:false,
  1241. importToStageId:null,
  1242. exportDialog: false,
  1243. exportTaskType:null,
  1244. groupTemplateList:[],
  1245. createGroupWay:'new',
  1246. modGroupDialog:false,
  1247. subTaskVisible:false,
  1248. orderList:[{id:"seq",name:this.$t('manuallydragthesequence'),isDesc:false},{id:"create_date",name:this.$t('creationtimeisthelatest'),isDesc:true},
  1249. {id:"end_date",name:this.$t('deadlineisthelatest'),isDesc:true},
  1250. {id:"task_level",name:this.$t('highestpriority'),isDesc:true}],
  1251. order:"seq",
  1252. isDesc:false,
  1253. taskDataList:[],
  1254. displayTable: false,
  1255. viewList: [{id:1,name:this.$t('alltaskss')},{id:2,name:this.$t('taskinprogress')},{id:3,name:this.$t('missionscompleted')},{id:4,name:this.$t('taskscheduled')},
  1256. {id:5,name:this.$t('createdthetask')},{id:6,name:this.$t('missionIwason')},{id:7,name:this.$t('todaytask')},{id:8,name:this.$t('taskthatisoverdue')}],
  1257. importanceList:[{id:0,name:this.$t('yi-ban')},{id:1,name:this.$t('zhong-yao')},{id:2,name:this.$t('jin-ji')},],
  1258. taskTypeList:[{id:0,name:this.$t('other.task'), icon:"iconfont firerock-iconrenwu"},{id:1,name:this.$t('other.milestone'),icon:"iconfont firerock-iconicon-"},{id:2,name:this.$t('risk'),icon:"iconfont firerock-iconfengxian"}],
  1259. taskTypeColor:['#20A0FF','#8613ad','#bf0404'],
  1260. taskTypeIcon:['iconfont firerock-iconrenwu','iconfont firerock-iconicon-','iconfont firerock-iconfengxian'],
  1261. taskStatusList:[this.$t('ongoing'),this.$t('state.completed'),this.$t('state.undone')],
  1262. //优先级
  1263. taskLevelColor:['#262626','#E6A23C','#F56C6C'],
  1264. stageListHeight:0,
  1265. taskListinH:0,
  1266. groupWidth:260,
  1267. drag: false,
  1268. stageDrag: false,
  1269. dragging: false,
  1270. stageList:[],
  1271. selectedGroup:{},
  1272. allGroupData:[],
  1273. defaultGroupId:null,
  1274. addGroupDialog: false,
  1275. addStageDialog: false,
  1276. groupSearch:null,
  1277. groupType:0,//0-分组,1-视图
  1278. groupList: [],
  1279. groupForm:{},
  1280. stageForm:[],
  1281. curProjectId:null,
  1282. projectList:null,
  1283. activeIndex:"1",
  1284. activeName:"projectInside",
  1285. searchField:null,
  1286. keyword:null,
  1287. user: JSON.parse(sessionStorage.getItem("user")),
  1288. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  1289. userDetailVisible: false,
  1290. userDetail:{},
  1291. date: new Date(),
  1292. users: [],
  1293. tableHeight: 0,
  1294. listLoading: false,
  1295. subProjectVisible: false,
  1296. subProjectList: [],//子项目列表
  1297. currentProject:{},
  1298. addSubProject: false,
  1299. addFormVisible: false,
  1300. addLoading: false,
  1301. title: "",
  1302. addForm: {
  1303. name: '',
  1304. },
  1305. rules: {
  1306. name: [{ required: true, message: this.$t('pleaseenteragroupname'), trigger: "blur" }],
  1307. },
  1308. rulesManDay: {
  1309. manDay: [{ required: true, message: '请输入预估工时', trigger: "blur" }],
  1310. },
  1311. rules2: {
  1312. stagesName: [{ required: true, message: this.$t('pleaseenteratasklistname'), trigger: "blur" }],
  1313. },
  1314. taskRules : {
  1315. name: [{ required: true, message: this.$t('enterthetaskcontent'), trigger: "blur" }],
  1316. },
  1317. formGrouping: {
  1318. name: [{ required: true, message: this.$t('pleaseenteragroupname'), trigger: "blur" }],
  1319. },
  1320. sleectId: null,
  1321. sleectProjectId: null,
  1322. sidebarIndex: 0, // 侧边栏索引
  1323. url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
  1324. count: 0,
  1325. textarea2: '',
  1326. taskId: null,
  1327. commentList: [],
  1328. radio: 0,
  1329. critic: [], // 评论头像的数组
  1330. editorOption: { // 富文本框里面的默认值
  1331. placeholder: this.$t('pleaseentethetext'),
  1332. modules: {
  1333. toolbar:[
  1334. ['bold', 'italic', 'underline', 'strike'], //加粗,斜体,下划线,删除线
  1335. // ['blockquote', 'code-block'], //引用,代码块
  1336. [{ 'header': 1 }, { 'header': 2 }], // 标题,键值对的形式;1、2表示字体大小
  1337. // [{ 'list': 'ordered'}, { 'list': 'bullet' }], //列表
  1338. // [{ 'script': 'sub'}, { 'script': 'super' }], // 上下标
  1339. // [{ 'indent': '-1'}, { 'indent': '+1' }], // 缩进
  1340. // [{ 'direction': 'rtl' }], // 文本方向
  1341. [{ 'size': ['small', false, 'large', 'huge'] }], // 字体大小
  1342. [{ 'header': [1, 2, 3, 4, 5, 6, false] }], //几级标题
  1343. [{ 'color': [] }, { 'background': [] }], // 字体颜色,字体背景颜色
  1344. // [{ 'font': [] }], //字体
  1345. [{ 'align': [] }], //对齐方式
  1346. ['clean'], //清除字体样式
  1347. // ['image','video'] //上传图片、上传视频
  1348. ['image'] //上传图片、上传视频
  1349. ], //工具栏设置
  1350. },
  1351. theme: 'snow',
  1352. },
  1353. textContent: true, // 控制提交
  1354. times: null,
  1355. text2: '',
  1356. innerVisibless: false, // 任务展示弹出层
  1357. activities: [{
  1358. content: this.$t('normals'),
  1359. timestamp: this.$t('hoursago'),
  1360. size: 'large',
  1361. type: 'primary',
  1362. icon: 'el-icon-circle-check',
  1363. color: '#409EFF'
  1364. }, {
  1365. content: this.$t('withinthetimelimit'),
  1366. timestamp: this.$t('hoursago8'),
  1367. color: '#F87872'
  1368. }],
  1369. ProgressList: [],
  1370. checkboxGrounp: [], // 选中人的数据
  1371. checkLists: [], // 选中人数据的ID
  1372. taskIid: null,
  1373. gstimday:[],
  1374. gstimhour:[],
  1375. timelabel: false,
  1376. relationdata: [],
  1377. isRelationTab: false,
  1378. relationvalue:[],
  1379. relationSubTaskList:[],
  1380. relationItemData: null,
  1381. relationPar:{name: ''},
  1382. isRelationItem: false,
  1383. // 关联文件
  1384. fileListLoading:false,
  1385. projectFileList:[],
  1386. taskFileList:[],
  1387. relationFileDialog: false,
  1388. addFileId: null,
  1389. isEditFile: false,
  1390. // 设置项目参与人
  1391. participantsDialog: false,
  1392. participantsFilterText: '',
  1393. deptMembData: [
  1394. {
  1395. id: 0,
  1396. label: this.$t('lable.unassigned'),
  1397. }
  1398. ],
  1399. defaultProps: {
  1400. children: 'children',
  1401. label: 'label'
  1402. },
  1403. chosenMembCount: 0,
  1404. ididid:null,
  1405. alreadyPartArray: [],
  1406. projectCreatorId: null,
  1407. projectInchargerId: null,
  1408. canAddTask: false, // 是否可创建任务的判断标志
  1409. canEditStageList: false, //是否可编辑列表的判断标志
  1410. groupResponsibleId: '', // 分组负责人的id
  1411. groupDetailsShow: false,
  1412. groupDetailData: {},
  1413. groupDetailTil: '',
  1414. setTemplateData: {},
  1415. setTemplateDialog: false,
  1416. taskListPage: 1,
  1417. taskListSize: 20,
  1418. taskListTotal: 0,
  1419. dynamicTab: true,
  1420. dailyList: [],
  1421. taskComponentFlg: false,
  1422. integrationTask: {},
  1423. integrationTaskNingwai: {},
  1424. hideCompleted: false,
  1425. wxFilterText: ''
  1426. };
  1427. },
  1428. watch: {
  1429. participantsFilterText(val) {
  1430. this.$refs.chooseMembTree2.filter(val);
  1431. }
  1432. },
  1433. methods: {
  1434. closeBounced(obj) {
  1435. console.log('触发了')
  1436. if(!obj.backToParentTaskSub) {
  1437. this.addFormVisible = false
  1438. this.taskComponentFlg = false
  1439. if(obj.submitInsert) {
  1440. if (this.groupType == 0) {
  1441. this.getStageList();
  1442. } else {
  1443. this.getViewTaskList();
  1444. }
  1445. }
  1446. if(obj.addSubTask) {
  1447. this.addSubTask()
  1448. }
  1449. if(obj.deleteTask) {
  1450. this.getStageList();
  1451. }
  1452. if(obj.taskLineClickAbs) {
  1453. this.taskLineClick(obj.items)
  1454. }
  1455. } else {
  1456. this.backToParentTask()
  1457. }
  1458. },
  1459. // 获取来自日报
  1460. getDailyList(id) {
  1461. this.http.post('/report/getTaskReportList',{
  1462. // taskId: '22131'
  1463. taskId: id
  1464. },
  1465. res => {
  1466. if (res.code == "ok") {
  1467. this.dailyList = res.data
  1468. } else {
  1469. this.$message({
  1470. message: res.msg,
  1471. type: "error"
  1472. });
  1473. }
  1474. },
  1475. error => {
  1476. this.$message({
  1477. message: error,
  1478. type: "error"
  1479. });
  1480. });
  1481. },
  1482. restrictNumber(targetId) {
  1483. let inpu = document.getElementById(targetId)
  1484. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  1485. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  1486. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  1487. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  1488. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  1489. inpu.value = parseFloat(inpu.value);
  1490. }
  1491. },
  1492. test(item){
  1493. // let pro = this.$route
  1494. console.log('test',this.projectList);
  1495. },
  1496. setParticipants(){
  1497. let chosenList = this.$refs.chooseMembTree2.getCheckedNodes();
  1498. let chose2 = chosenList.filter(item=>item.isUser == 1)
  1499. let chose3 = []
  1500. for(let i=0;i<chose2.length;i++){chose3.push(chose2[i].id)}
  1501. console.log('test',chose2,chose3);
  1502. this.http.post('/group-participator/save',{
  1503. groupId: this.ididid,
  1504. idsJson: JSON.stringify(chose3)
  1505. },res => {
  1506. if(res.code == 'ok'){
  1507. this.participantsDialog = false
  1508. this.$message({
  1509. message: this.$t('setupthesuccess'),
  1510. type: 'success'
  1511. })
  1512. }else {
  1513. this.$message({
  1514. message: res.msg,
  1515. type: 'error'
  1516. })
  1517. }
  1518. },error => {
  1519. this.$message({
  1520. message: error,
  1521. type: 'error'
  1522. })
  1523. })
  1524. },
  1525. // 设置项目参与人
  1526. setupParticipants(item){
  1527. this.ididid = item.id
  1528. this.participantsFilterText = ''
  1529. this.wxFilterText = ''
  1530. console.log(item);
  1531. this.participantsDialog = true
  1532. this.getAlreadyPartArray(item.id)
  1533. this.getDepartmentList()
  1534. },
  1535. // 获取用于设置参与人的列表
  1536. getDepartmentList(){
  1537. this.http.post('/department/listAllMemb',{
  1538. },res => {
  1539. if(res.code == 'ok'){
  1540. let list = res.data
  1541. this.haveUsersList(list)
  1542. this.deptMembData = JSON.parse(JSON.stringify(list))
  1543. console.log('123',this.deptMembData);
  1544. }else {
  1545. this.$message({
  1546. message: res.msg,
  1547. type: 'error'
  1548. })
  1549. }
  1550. },error => {
  1551. this.$message({
  1552. message: error,
  1553. type: 'error'
  1554. })
  1555. })
  1556. },
  1557. haveUsersList(list){
  1558. for (var i in list) {
  1559. if (list[i].children != null) {
  1560. this.haveUsersList(list[i].children);
  1561. }
  1562. if (list[i].userList != null) {
  1563. if (list[i].children == null) {
  1564. list[i].children = [];
  1565. }
  1566. list[i].userList.forEach(element => {
  1567. var obj = {id: element.id, label:element.name, parentId:element.departmentId, isUser:1};
  1568. list[i].children.push(obj);
  1569. });
  1570. }
  1571. }
  1572. },
  1573. // 获取已参与人员
  1574. getAlreadyPartArray(eid){
  1575. this.http.post('/group-participator/get',{
  1576. groupId: eid
  1577. },res => {
  1578. if(res.code == 'ok'){
  1579. this.alreadyPartArray = res.data
  1580. this.chosenMembCount = res.data.length
  1581. // console.log('get',res.data, this.alreadyPartArray)
  1582. }else {
  1583. this.$message({
  1584. message: res.msg,
  1585. type: 'error'
  1586. })
  1587. }
  1588. },error => {
  1589. this.$message({
  1590. message: error,
  1591. type: 'error'
  1592. })
  1593. })
  1594. },
  1595. // 筛选逻辑
  1596. filterNode(value, data) {
  1597. if (!value) return true;
  1598. return data.label.indexOf(value) !== -1;
  1599. },
  1600. // 选中改变
  1601. onTreeItemChange() {
  1602. var chosenList = this.$refs.chooseMembTree2.getCheckedNodes();
  1603. var list = chosenList.filter(item=>item.isUser == 1);
  1604. this.chosenMembCount = list.length;
  1605. },
  1606. // 关联文件按钮
  1607. relationFileClick(){
  1608. this.relationFileDialog = true
  1609. this.addFileId = null
  1610. this.getProjectFileList()
  1611. },
  1612. // 确认关联文件
  1613. addTaskFile(){
  1614. if(this.addFileId == null){
  1615. this.$message({message: this.$t('xuanzguanlianwenjian') , type: 'warning'})
  1616. return
  1617. }
  1618. this.http.post('/task-files/addDocumentRef',{
  1619. documentId: this.addFileId,
  1620. taskId: this.addForm.id,
  1621. projectId: this.curProjectId
  1622. },res => {
  1623. if(res.code == 'ok'){
  1624. this.$message({
  1625. message: this.$t('guan-lian-cheng-gong'),
  1626. type: 'success'
  1627. })
  1628. this.relationFileDialog = false
  1629. this.getTaskFileList()
  1630. }else {
  1631. this.$message({
  1632. message: res.msg,
  1633. type: 'error'
  1634. })
  1635. }
  1636. },error => {
  1637. this.$message({
  1638. message: error,
  1639. type: 'error'
  1640. })
  1641. })
  1642. },
  1643. // 获取项目下的文档列表
  1644. getProjectFileList(){
  1645. this.http.post('/task-files/getDocumentList',{
  1646. projectId: this.curProjectId
  1647. },res => {
  1648. if(res.code == 'ok'){
  1649. this.projectFileList = res.data
  1650. console.log('list',res.data);
  1651. }else {
  1652. this.$message({
  1653. message: res.msg,
  1654. type: 'error'
  1655. })
  1656. }
  1657. },error => {
  1658. this.$message({
  1659. message: error,
  1660. type: 'error'
  1661. })
  1662. })
  1663. },
  1664. // 获取任务下的文档列表
  1665. getTaskFileList(e,eid){
  1666. let etaskId
  1667. if(e == 1){etaskId = eid}
  1668. else{etaskId = this.addForm.id}
  1669. this.fileListLoading = true
  1670. this.http.post('/task-files/getTaskFiles',{
  1671. taskId: etaskId
  1672. },res => {
  1673. if(res.code == 'ok'){
  1674. this.fileListLoading = false
  1675. this.taskFileList = res.data
  1676. console.log('taskFileList',res.data);
  1677. }else {
  1678. this.fileListLoading = false
  1679. this.$message({
  1680. message: res.msg,
  1681. type: 'error'
  1682. })
  1683. }
  1684. },error => {
  1685. this.fileListLoading = false
  1686. this.$message({
  1687. message: error,
  1688. type: 'error'
  1689. })
  1690. })
  1691. },
  1692. // 列表的删除按钮
  1693. taskFileDelete(eid){
  1694. this.$confirm('是否移除此文件?', this.$t('other.prompts'), {
  1695. confirmButtonText: this.$t('btn.determine'),
  1696. cancelButtonText: this.$t('btn.cancel'),
  1697. type: 'warning'
  1698. }).then(()=>{
  1699. this.http.post('/task-files/delete',{
  1700. id: eid
  1701. },res => {
  1702. if(res.code == 'ok'){
  1703. this.$message({
  1704. message: res.data,
  1705. type: 'success'
  1706. })
  1707. this.getTaskFileList()
  1708. }else {
  1709. this.$message({
  1710. message: res.msg,
  1711. type: 'error'
  1712. })
  1713. }
  1714. },error => {
  1715. this.$message({
  1716. message: error,
  1717. type: 'error'
  1718. })
  1719. })
  1720. }).catch(()=>{
  1721. this.$message({
  1722. message: this.$t('thedeletionhasbeencancelled'),
  1723. type: 'info'
  1724. })
  1725. })
  1726. },
  1727. // 列表的上传按钮
  1728. uploadFileClick(item){
  1729. console.log("upload",item.file);
  1730. let files = new FormData()
  1731. files.append("projectId",this.curProjectId);
  1732. files.append("taskId", this.addForm.id);
  1733. files.append("file", item.file);
  1734. this.http.uploadFile('/task-files/uploadFile',files,
  1735. res => {
  1736. if(res.code == 'ok'){
  1737. console.log(res);
  1738. this.$message({
  1739. message: this.$t('yi-shang-chuan'),
  1740. type: 'success'
  1741. })
  1742. this.getTaskFileList()
  1743. }else {
  1744. this.$message({
  1745. message: res.msg,
  1746. type: 'error'
  1747. })
  1748. }
  1749. },error => {
  1750. this.$message({
  1751. message: error,
  1752. type: 'error'
  1753. })
  1754. })
  1755. },
  1756. selchg(){ //类型切换
  1757. if(this.addForm.taskType == 1){
  1758. this.timelabel = true
  1759. if(!this.addForm.executorListFront[0].executorId) {
  1760. console.log(this.currentProject)
  1761. this.addForm.executorListFront[0].executorId = this.currentProject.inchargerId
  1762. }
  1763. }else{
  1764. this.timelabel = false
  1765. }
  1766. },
  1767. addRelation(){ //关联任务卡片
  1768. this.relationvalue = []
  1769. this.isRelationTab = true
  1770. this.getrelation()
  1771. },
  1772. addRelationTask(){ //添加关联任务
  1773. this.http.post('/task/addMileStoneTask',{
  1774. milestoneId: this.addForm.id,
  1775. taskIds: JSON.stringify(this.relationvalue)
  1776. },
  1777. res =>{
  1778. if(res.code == "ok") {
  1779. this.isRelationTab = false
  1780. this.$message({
  1781. message: this.$t('addsuccessful'),
  1782. type: 'success'
  1783. })
  1784. this.getRelationTaskList()
  1785. this.$forceUpdate()
  1786. }else {
  1787. this.$message({
  1788. message: res.msg,
  1789. type: 'error'
  1790. })
  1791. }
  1792. },
  1793. error => {
  1794. this.$message({
  1795. message: error,
  1796. type: 'error'
  1797. })
  1798. })
  1799. },
  1800. getRelationTaskList(i,e){ //获取关联任务列表
  1801. let eid = null
  1802. if(i){
  1803. eid = e
  1804. }else{
  1805. eid = this.addForm.id
  1806. }
  1807. this.http.post('/task/getMilestoneTaskList',{
  1808. milestoneId: eid
  1809. },res => {
  1810. if(res.code == 'ok') {
  1811. this.relationSubTaskList = res.data
  1812. // console.log('res',res.data);
  1813. }else {
  1814. this.$message({
  1815. message: res.msg,
  1816. type: 'error'
  1817. })
  1818. }
  1819. },error => {
  1820. this.$message({
  1821. message: error,
  1822. type: 'error'
  1823. })
  1824. })
  1825. },
  1826. getrelation(){ //获取选择关联列表
  1827. this.http.post('/task/getTaskOnlyList',{
  1828. projectId: this.curProjectId
  1829. },
  1830. res => {
  1831. if (res.code == "ok") {
  1832. this.relationdata = []
  1833. res.data.forEach( (item) =>{
  1834. if(item.taskType != 1){
  1835. this.relationdata.push(item)
  1836. }
  1837. })
  1838. // console.log('map',this.relationdata);
  1839. } else {
  1840. this.$message({
  1841. message: res.msg,
  1842. type: "error"
  1843. });
  1844. }
  1845. },
  1846. error => {
  1847. this.$message({
  1848. message: error,
  1849. type: "error"
  1850. });
  1851. });
  1852. },
  1853. // 里程碑关联任务列表
  1854. // 解除关联
  1855. deleteRelationItem(eid){
  1856. this.listLoading = true
  1857. this.http.post('/task/removeMileStoneTask',{
  1858. id: eid
  1859. },res => {
  1860. if(res.code == 'ok') {
  1861. this.getRelationTaskList()
  1862. this.listLoading = false
  1863. this.$message({
  1864. message: this.$t('jie-chu-cheng-gong'),
  1865. type: 'success'
  1866. })
  1867. }else {
  1868. this.listLoading = false
  1869. this.$message({
  1870. message: res.msg,
  1871. type: 'error'
  1872. })
  1873. }
  1874. },error => {
  1875. this.listLoading = false
  1876. this.$message({
  1877. message: error,
  1878. type: 'error'
  1879. })
  1880. })
  1881. },
  1882. // 关联任务列表是否完成修改
  1883. relationFinishTask(row){
  1884. this.http.post('/task/finish',{
  1885. id: row.taskId,
  1886. taskStatus: row.taskStatus
  1887. },res => {
  1888. if(res.code == 'ok'){
  1889. if(this.groupType == 0){
  1890. this.getStageList();
  1891. }else {
  1892. this.getViewTaskList();
  1893. }
  1894. }else{
  1895. this.$message({
  1896. message: res.msg,
  1897. type: 'error'
  1898. })
  1899. }
  1900. },error => {
  1901. this.$message({
  1902. message: error,
  1903. type: 'error'
  1904. })
  1905. })
  1906. },
  1907. //保存分组负责人
  1908. saveGroupIncharger() {
  1909. this.http.post('/task-group/saveGroupIncharger', {id: this.groupForm.id, inchargerId: this.groupForm.inchargerId, projectId: this.curProjectId},
  1910. res => {
  1911. this.setInchargerDialog = false;
  1912. if (res.code == "ok") {
  1913. this.$message({
  1914. message: this.$t('setupthesuccess'),
  1915. type: "success"
  1916. });
  1917. //更新原始分组数据
  1918. this.groupList.filter(g=>g.id == this.groupForm.id)[0].inchargerId = this.groupForm.inchargerId;
  1919. } else {
  1920. this.$message({
  1921. message: res.msg,
  1922. type: "error"
  1923. });
  1924. }
  1925. }
  1926. );
  1927. },
  1928. // 编辑模板
  1929. setTemplate(t){
  1930. console.log(t);
  1931. this.setTemplateData = t
  1932. this.setTemplateData.needDelete = []
  1933. this.setTemplateDialog = true
  1934. },
  1935. setTemplateSave(){
  1936. if(this.setTemplateData.name == '' || this.setTemplateData.name == null){
  1937. this.$message({
  1938. message: this.$t('mo-ban-ming-cheng-bu-neng-wei-kong'),
  1939. type: 'error'
  1940. })
  1941. return
  1942. }
  1943. for(let i in this.setTemplateData.stagesList){
  1944. if(this.setTemplateData.stagesList[i].stagesName == '' || this.setTemplateData.stagesList[i].stagesName == null){
  1945. this.$message({
  1946. message: this.$t('ren-wu-lie-biao-ming-cheng-bu-neng-wei-kong'),
  1947. type: 'error'
  1948. })
  1949. return
  1950. }
  1951. }
  1952. this.http.post('/task-group/setTemplate',this.setTemplateData,
  1953. res => {
  1954. if(res.code == 'ok'){
  1955. this.$message({
  1956. message: this.$t('message.modifyTheSuccess'),
  1957. type: 'success'
  1958. })
  1959. this.getGroupTemplate()
  1960. this.setTemplateDialog = false
  1961. }else{
  1962. this.$message({
  1963. message: res.msg,
  1964. type: 'error'
  1965. })
  1966. }
  1967. },err => {
  1968. this.$message({
  1969. message: err,
  1970. type: 'error'
  1971. })
  1972. })
  1973. },
  1974. deleteStages(item,index){
  1975. this.setTemplateData.needDelete.push(item.id)
  1976. this.setTemplateData.stagesList.splice(index,1)
  1977. console.log('deletestages',item.id);
  1978. },
  1979. addStages(){
  1980. this.setTemplateData.stagesList.push({
  1981. stagesName: '',
  1982. templateId: this.setTemplateData.id
  1983. })
  1984. },
  1985. //删除模板
  1986. deleteTemplate(t) {
  1987. var that = this;
  1988. this.$confirm(this.$t('que-ren-yao-shan-chu')+"["+t.name+"]"+this.$t('ma'), this.$t('other.prompts'), {
  1989. //type: 'warning'
  1990. }).then(() => {
  1991. this.http.post('/group-template/deleteTemplate', {id: t.id},
  1992. res => {
  1993. if (res.code == "ok") {
  1994. this.getGroupTemplate();
  1995. this.$message({
  1996. message: this.$t('deletingTemplateSuccessfully'),
  1997. type: "success"
  1998. });
  1999. } else {
  2000. this.$message({
  2001. message: res.msg,
  2002. type: "error"
  2003. });
  2004. }
  2005. }
  2006. );
  2007. });
  2008. },
  2009. //创建模板
  2010. createTemplate() {
  2011. this.saveTemplateLoading = true;
  2012. this.http.post('/group-template/addTemplate', this.templateForm,
  2013. res => {
  2014. this.saveTemplateLoading = false;
  2015. if (res.code == "ok") {
  2016. this.addToTmpDialog = false;
  2017. this.getGroupTemplate();
  2018. this.$message({
  2019. message: this.$t('addTemplateSuccessfully'),
  2020. type: "success"
  2021. });
  2022. } else {
  2023. this.$message({
  2024. message: res.msg,
  2025. type: "error"
  2026. });
  2027. }
  2028. }
  2029. );
  2030. },
  2031. addToTemplate(item) {
  2032. this.addToTmpDialog = true;
  2033. this.templateForm = {groupId: item.id, name:item.name, saveTask:false, saveMileStone:false, saveRisk:false};
  2034. },
  2035. changeBase() {
  2036. // this.$refs.earning.refreshPage();
  2037. },
  2038. // 批量导入人员
  2039. importTask(item) {
  2040. //首先判断文件类型
  2041. this.loadingExport = true
  2042. let str = item.file.name.split(".");
  2043. let format = str[str.length - 1];
  2044. if (format != "xls" && format != "xlsx") {
  2045. this.loadingExport = false
  2046. this.$message({
  2047. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  2048. type: "error"
  2049. });
  2050. } else {
  2051. this.listLoading = true;
  2052. let formData = new FormData();
  2053. formData.append("file", item.file);
  2054. formData.append("projectId", this.curProjectId);
  2055. formData.append("groupId", this.selectedGroup.id);
  2056. // formData.append("stagesId", this.importToStageId);
  2057. this.http.uploadFile('/task/importTask', formData,
  2058. res => {
  2059. this.$refs.upload.clearFiles();
  2060. this.listLoading = false;
  2061. this.loadingExport = false
  2062. if (res.code == "ok") {
  2063. this.$message({
  2064. message: this.$t('other.importSuccess'),
  2065. type: "success"
  2066. });
  2067. //重新读取列表
  2068. this.getStageList();
  2069. this.importTaskDialog = false;
  2070. } else {
  2071. this.$message({
  2072. message: res.msg,
  2073. type: "error"
  2074. });
  2075. }
  2076. },
  2077. error => {
  2078. this.$refs.upload.clearFiles();
  2079. this.listLoading = false;
  2080. this.loadingExport = false
  2081. this.$message({
  2082. message: error,
  2083. type: "error"
  2084. });
  2085. });
  2086. }
  2087. },
  2088. //删除任务进展
  2089. deleteTaskProgress(id) {
  2090. this.http.post('/task-progress/deleteProgress', {id: id},
  2091. res => {
  2092. if (res.code == "ok") {
  2093. this.getTaskProgressList(this.taskIid)
  2094. this.$message({
  2095. message: this.$t('message.successfullyDeleted'),
  2096. type: "success"
  2097. });
  2098. } else {
  2099. this.$message({
  2100. message: res.msg,
  2101. type: "error"
  2102. });
  2103. }
  2104. }
  2105. );
  2106. },
  2107. //创建任务进展
  2108. addTaskProgress() {
  2109. var param = {
  2110. taskId: this.taskIid,
  2111. status: this.radio,
  2112. content: this.text2,
  2113. participatorIds: this.checkLists.toString()
  2114. };
  2115. this.http.post('/task-progress/addProgress', param,
  2116. res => {
  2117. if (res.code == "ok") {
  2118. this.shutPro()
  2119. this.getTaskProgressList(this.taskIid)
  2120. this.$message({
  2121. message: this.$t('releasesuccess'),
  2122. type: "success"
  2123. });
  2124. this.checkboxGrounp = [],
  2125. this.checkLists = [],
  2126. this.text2 = '',
  2127. this.radio = 0
  2128. let obj = {
  2129. id: this.taskIid
  2130. }
  2131. this.gain(obj)
  2132. } else {
  2133. this.$message({
  2134. message: res.msg,
  2135. type: "error"
  2136. });
  2137. }
  2138. }
  2139. );
  2140. },
  2141. //获取任务进展列表
  2142. getTaskProgressList(taskId) {
  2143. this.taskIid = taskId
  2144. this.http.post('/task-progress/list', {taskId: taskId},
  2145. res => {
  2146. if (res.code == "ok") {
  2147. this.ProgressList = res.data;
  2148. this.recentProgressInfo = res.data[0]
  2149. } else {
  2150. this.$message({
  2151. message: res.msg,
  2152. type: "error"
  2153. });
  2154. }
  2155. }
  2156. );
  2157. },
  2158. kkk(el){
  2159. var k = this.checkLists.indexOf(el.id)
  2160. if (k == -1) {
  2161. this.checkLists.push(el.id)
  2162. } else {
  2163. this.checkLists.splice(k, 1)
  2164. }
  2165. },
  2166. showExportDialog() {
  2167. this.exportDialog = true;
  2168. },
  2169. exportTask() {
  2170. let _this = this;
  2171. this.loadingExport = true
  2172. this.http.post('/task/exportTask', {projectId: this.curProjectId, taskType: this.exportTaskType},
  2173. res => {
  2174. this.loadingExport = false
  2175. if (res.code == "ok") {
  2176. location.href = res.data;
  2177. } else {
  2178. this.$message({
  2179. message: res.msg,
  2180. type: "error"
  2181. });
  2182. }
  2183. }
  2184. );
  2185. },
  2186. sss(){
  2187. this.$refs.addRem.style.display="none"
  2188. },
  2189. addprogress(){ // 添加子任务进展事件
  2190. this.$refs.proBox.style.display="block"
  2191. this.$refs.addPro.style.display="none"
  2192. },
  2193. shutPro() { // 关闭任务进展
  2194. this.$refs.addPro.style.display="block"
  2195. this.$refs.addRem.style.display="none"
  2196. this.$refs.proBox.style.display="none"
  2197. },
  2198. addI() { // 打开选择查看
  2199. this.$refs.addRem.style.display="block"
  2200. },
  2201. load() {
  2202. if(this.count >= 0) return
  2203. this.count += 2
  2204. },
  2205. onEditorFocus() {
  2206. this.onEditorBlur()
  2207. },
  2208. subMission() { // 添加
  2209. },
  2210. handleCheckedCitiesChange(value) {
  2211. let checkedCount = value.length;
  2212. this.checkAll = checkedCount === this.cities.length;
  2213. this.isIndeterminate = checkedCount > 0 && checkedCount < this.cities.length;
  2214. },
  2215. // 获得焦点时触发
  2216. onEditorBlur(){
  2217. let theEle = this.$refs.text; // 获取元素
  2218. var img = theEle.value.match(/<img[^>]+>/g); // 赛选 img 标签
  2219. var arrImg = ''
  2220. for (var j = 0; j < img.length; j++) {
  2221. // 正则匹配,摘出img标签下的src里的内容,即capture
  2222. img[j].replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, function(match, capture) {
  2223. arrImg += capture
  2224. });
  2225. }
  2226. // 原来的字符流大小,单位为字节
  2227. var strLen = arrImg.length;
  2228. // 计算后得到的文件流大小,单位为字节
  2229. var fileSize=parseInt(strLen-(strLen/8)*2);
  2230. var size = "";
  2231. size = (fileSize/1024/1024).toFixed(2);
  2232. if (size > 2){
  2233. this.textContent = false
  2234. this.$message({
  2235. showClose: true,
  2236. message: this.$t('imageexceeds2MBpleaseuploaditagain'),
  2237. type: 'warning'
  2238. });
  2239. }
  2240. this.textContent = true
  2241. },
  2242. // 侧边栏的点击事件
  2243. retract() {
  2244. if (this.$refs.box.className == 'el-icon-arrow-left') {
  2245. this.$refs.box.className = 'el-icon-arrow-right'
  2246. } else {
  2247. this.$refs.box.className = 'el-icon-arrow-left'
  2248. }
  2249. // this.$refs.box.className === 'el-icon-arrow-left' ? this.$refs.box.className = 'el-icon-arrow-right' || this.$refs.box.className = 'el-icon-arrow-left'
  2250. this.toggleGroup()
  2251. },
  2252. //
  2253. choseTemplate(tIndex) {
  2254. // this.groupTemplateList.forEach((g)=>{
  2255. // g.selected = false;
  2256. // })
  2257. this.sidebarIndex = tIndex
  2258. // this.groupTemplateList[tIndex].selected = true;
  2259. this.groupTemplateList.forEach((g, i)=>{
  2260. if(tIndex == i) {
  2261. g.selected = !g.selected;
  2262. }
  2263. })
  2264. },
  2265. //获取分组模板列表
  2266. getGroupTemplate() {
  2267. this.http.post('/group-template/getList',{},
  2268. res => {
  2269. if (res.code == "ok") {
  2270. this.groupTemplateList = res.data;
  2271. this.groupTemplateList[0].selected = true;
  2272. } else {
  2273. this.$message({
  2274. message: res.msg,
  2275. type: "error"
  2276. });
  2277. }
  2278. },
  2279. error => {
  2280. this.$message({
  2281. message: error,
  2282. type: "error"
  2283. });
  2284. });
  2285. },
  2286. copyGroup(item) {
  2287. this.http.post('/task-group/copy',{id: item.id},
  2288. res => {
  2289. if (res.code == "ok") {
  2290. this.getTaskGroups();
  2291. } else {
  2292. this.$message({
  2293. message: res.msg,
  2294. type: "error"
  2295. });
  2296. }
  2297. },
  2298. error => {
  2299. this.$message({
  2300. message: error,
  2301. type: "error"
  2302. });
  2303. });
  2304. },
  2305. //重启项目
  2306. startPro() {
  2307. this.http.post('/project/start',{id: this.curProjectId},
  2308. res => {
  2309. if (res.code == "ok") {
  2310. this.$message({
  2311. message: this.$t('restartthesuccess'),
  2312. type: "success"
  2313. });
  2314. this.currentProject.status = 1;
  2315. } else {
  2316. this.$message({
  2317. message: res.msg,
  2318. type: "error"
  2319. });
  2320. }
  2321. },
  2322. error => {
  2323. this.$message({
  2324. message: error,
  2325. type: "error"
  2326. });
  2327. });
  2328. },
  2329. //撤销项目
  2330. cancelPro() {
  2331. this.http.post('/project/cancel',{id: this.curProjectId},
  2332. res => {
  2333. if (res.code == "ok") {
  2334. this.$message({
  2335. message: this.$t('Revocationofsuccess'),
  2336. type: "success"
  2337. });
  2338. this.currentProject.status = 3;
  2339. } else {
  2340. this.$message({
  2341. message: res.msg,
  2342. type: "error"
  2343. });
  2344. }
  2345. },
  2346. error => {
  2347. this.$message({
  2348. message: error,
  2349. type: "error"
  2350. });
  2351. });
  2352. },
  2353. //完成项目
  2354. finishPro() {
  2355. this.http.post('/project/finish',{id: this.curProjectId},
  2356. res => {
  2357. if (res.code == "ok") {
  2358. this.$message({
  2359. message: this.$t('projectcompletion'),
  2360. type: "success"
  2361. });
  2362. this.currentProject.status = 2;
  2363. } else {
  2364. this.$message({
  2365. message: res.msg,
  2366. type: "error"
  2367. });
  2368. }
  2369. },
  2370. error => {
  2371. this.$message({
  2372. message: error,
  2373. type: "error"
  2374. });
  2375. });
  2376. },
  2377. //删除当前编辑的任务
  2378. deleteTask() {
  2379. var warning='';
  2380. if (this.addForm.subTaskList.length > 0) {
  2381. warning=this.$t('currenttaskanditssubtasks');
  2382. } else {
  2383. warning=this.$t('wanttodeletethecurrent task');
  2384. }
  2385. this.$confirm(warning, this.$t('other.prompts'), {
  2386. //type: 'warning'
  2387. }).then(() => {
  2388. this.http.post('/task/delete',{id: this.addForm.id},
  2389. res => {
  2390. if (res.code == "ok") {
  2391. this.addFormVisible = false;
  2392. this.getStageList();
  2393. } else {
  2394. this.$message({
  2395. message: res.msg,
  2396. type: "error"
  2397. });
  2398. }
  2399. },
  2400. error => {
  2401. this.$message({
  2402. message: error,
  2403. type: "error"
  2404. });
  2405. });
  2406. });
  2407. },
  2408. //tab页签切换
  2409. handleClick(tab, event) {
  2410. let pathModel = tab.name;
  2411. this.$router.push('/'+pathModel+'/'+this.curProjectId);
  2412. if(tab.name == 'costbaseline'){
  2413. this.$refs.costbaseline.refreshPage();
  2414. }
  2415. if(tab.name == 'info') {
  2416. this.$refs.projectInfo.getMileStoneList()
  2417. }
  2418. },
  2419. showSubTaskList(task) {
  2420. this.subTaskVisible = true;
  2421. this.addForm = task;
  2422. // console.log('click',task.subTaskList);
  2423. },
  2424. backToParentTask() {
  2425. // this.getTaskDetail(this.addForm.parentTid);
  2426. this.getTaskDetail(this.timelabel ? this.relationPar.id : this.addForm.parentTid);
  2427. this.isEditFile = true;
  2428. this.$refs.thskComponents.backToParentTask()
  2429. if(this.timelabel){
  2430. this.isRelationItem = false
  2431. // this.relationPar = {name: ''}
  2432. this.getRelationTaskList(1, this.relationPar.id)
  2433. this.gain(this.relationPar)
  2434. }
  2435. },
  2436. //显示子任务创建卡片
  2437. addSubTask() {
  2438. if(this.isRelationItem){return}
  2439. this.addFormVisible = true;
  2440. this.addForm = {parentTname: this.addForm.name,parentTid: this.addForm.id,projectId: this.addForm.projectId, groupId: this.addForm.groupId, taskLevel:0, planHours: 8, taskType: 0};
  2441. this.addForm.executorListFront = [{executorId:null, planHours:8}];
  2442. this.addLoading = false;
  2443. //创建子任务,非编辑状态
  2444. this.isEditFile = false;
  2445. },
  2446. //认领任务
  2447. addAsMyTask(task) {
  2448. this.http.post('/task/addAsMyTask',{id: task.id},
  2449. res => {
  2450. if (res.code == "ok") {
  2451. this.getStageList();
  2452. } else {
  2453. this.$message({
  2454. message: res.msg,
  2455. type: "error"
  2456. });
  2457. }
  2458. },
  2459. error => {
  2460. this.$message({
  2461. message: error,
  2462. type: "error"
  2463. });
  2464. });
  2465. },
  2466. taskLineClick(row, column, event) {
  2467. if(this.isRelationItem){return}
  2468. this.editTask(row);
  2469. },
  2470. //排序发生改变
  2471. orderChange() {
  2472. this.isDesc = this.orderList.filter(o=>o.id == this.order)[0].isDesc;
  2473. if (this.groupType == 0) {
  2474. this.getStageList();
  2475. } else {
  2476. this.getViewTaskList();
  2477. }
  2478. },
  2479. taskListPageChange(val){
  2480. this.taskListPage = val
  2481. this.getViewTaskList()
  2482. },
  2483. taskListSizeChange(val){
  2484. this.taskListSize = val
  2485. this.taskListPage = 1
  2486. this.getViewTaskList()
  2487. },
  2488. //加载视图任务列表
  2489. getViewTaskList() {
  2490. this.http.post('/task/list',{projectId: this.curProjectId, viewId: this.selectedGroup.id, order: this.order, isDesc: this.isDesc,pageIndex: this.taskListPage,pageSize:this.taskListSize},
  2491. res => {
  2492. if (res.code == "ok") {
  2493. // this.taskDataList = res.data;
  2494. // console.log(this.taskDataList, '任务视图的列表')
  2495. for(var i in res.data.records) {
  2496. if(res.data.records[i].executorName != null) {
  2497. res.data.records[i].executorName = res.data.records[i].executorName.split(',')
  2498. }
  2499. }
  2500. this.taskDataList = res.data.records;
  2501. this.taskListTotal = res.data.total
  2502. console.log(this.taskDataList, '任务视图的列表')
  2503. this.taskDataList.forEach(t=>{
  2504. t.isFinish = t.taskStatus==1?true:false;
  2505. });
  2506. } else {
  2507. this.$message({
  2508. message: res.msg,
  2509. type: "error"
  2510. });
  2511. }
  2512. },
  2513. error => {
  2514. this.$message({
  2515. message: error,
  2516. type: "error"
  2517. });
  2518. });
  2519. },
  2520. //阶段拖拽
  2521. onMoveStage(e) {
  2522. var data = {
  2523. groupId:this.selectedGroup.id,
  2524. oldIndex: e.oldIndex,
  2525. newIndex: e.newIndex,};
  2526. this.http.post('/stages/changeStageOrder',data,
  2527. res => {
  2528. if (res.code == "ok") {
  2529. this.getStageList();
  2530. } else {
  2531. this.$message({
  2532. message: res.msg,
  2533. type: "error"
  2534. });
  2535. }
  2536. },
  2537. error => {
  2538. this.$message({
  2539. message: error,
  2540. type: "error"
  2541. });
  2542. });
  2543. },
  2544. onChange(e) {
  2545. var data = {
  2546. id:e.item.id,
  2547. oldIndex: e.oldIndex ,
  2548. newIndex: e.newIndex ,
  2549. oldStagesId: e.from.id,
  2550. newStagesId: e.to.id};
  2551. this.http.post('/task/changeOrder',data,
  2552. res => {
  2553. if (res.code == "ok") {
  2554. this.getStageList();
  2555. } else {
  2556. this.$message({
  2557. message: res.msg,
  2558. type: "error"
  2559. });
  2560. }
  2561. },
  2562. error => {
  2563. this.$message({
  2564. message: error,
  2565. type: "error"
  2566. });
  2567. });
  2568. },
  2569. toggleGroup() {
  2570. if (this.groupWidth == 0) {
  2571. this.groupWidth = 260;
  2572. } else {
  2573. this.groupWidth = 0;
  2574. }
  2575. },
  2576. finishTask(task) {
  2577. this.http.post('/task/finish',{id: task.id, taskStatus: task.taskStatus},
  2578. res => {
  2579. if (res.code == "ok") {
  2580. if (this.groupType == 0) {
  2581. this.getStageList();
  2582. } else {
  2583. this.getViewTaskList();
  2584. }
  2585. } else {
  2586. this.$message({
  2587. message: res.msg,
  2588. type: "error"
  2589. });
  2590. }
  2591. },
  2592. error => {
  2593. this.$message({
  2594. message: error,
  2595. type: "error"
  2596. });
  2597. });
  2598. },
  2599. // 点击卡片事件
  2600. editTask(task) {
  2601. this.mileageCup = true
  2602. // console.log('editTask',task)
  2603. if(task.taskType == 1){
  2604. this.timelabel = true
  2605. this.isRelationItem = false
  2606. }else{
  2607. this.timelabel = false
  2608. }
  2609. this.addFormVisible = true;
  2610. this.isEditFile = true;
  2611. this.addLoading = false;
  2612. this.title = this.$t('editingtasks');
  2613. // 自定义组件
  2614. this.integrationTask = {
  2615. id: task.id,
  2616. task: task,
  2617. num: 1,
  2618. curProjectId: this.curProjectId,
  2619. create: false,
  2620. integrationTaskNingwai: this.integrationTaskNingwai
  2621. }
  2622. this.taskComponentFlg = true
  2623. this.getTaskDetail(task.id);
  2624. this.getTaskProgressList(task.id); // 获取任务进展列表
  2625. this.getUsers(); // 获取名单数据
  2626. this.gain(task); // 获取评论列表
  2627. this.getDailyList(task.id) // 获取来自日报
  2628. this.getRelationTaskList(1, task.id)
  2629. this.getTaskFileList(1,task.id)
  2630. },
  2631. // 关联任务点击事件
  2632. relationTaskClick(row,column,event){
  2633. // console.log('relationTaskClick',row);
  2634. this.relationPar = JSON.parse(JSON.stringify(this.addForm))
  2635. // console.log(this.relationPar);
  2636. this.addFormVisible = true;
  2637. this.addLoading = false;
  2638. this.isRelationItem = true;
  2639. this.isEditFile = true;
  2640. this.title = this.$t('editingtasks');
  2641. this.getTaskDetail(row.taskId);
  2642. this.getUsers();
  2643. this.gain(row,1);
  2644. this.getRelationTaskList(1, row.taskId)
  2645. this.getTaskFileList(1,row.taskId)
  2646. },
  2647. // 获取评论列表
  2648. gain (task,e) {
  2649. this.commentList = [];
  2650. this.taskId = e == 1 ? task.taskId : task.id;
  2651. this.http.post('/task-comment/getList', {taskId: e == 1 ? task.taskId : task.id},
  2652. res => {
  2653. if (res.code == "ok") {
  2654. for(var i in res.data) {
  2655. if(res.data[i].content.indexOf('$userName=') != '-1') {
  2656. let obj = {
  2657. msg1: res.data[i].content.split('$')[0],
  2658. msg2: res.data[i].content.split('$')[1].split('=')[1],
  2659. msg3: res.data[i].content.split('$')[2]
  2660. }
  2661. res.data[i].content = obj
  2662. } else {
  2663. if(this.user.userNameNeedTranslate == 1) {
  2664. let obj = {
  2665. msg1: res.data[i].content,
  2666. msg2: '',
  2667. msg3: ''
  2668. }
  2669. res.data[i].content = obj
  2670. }
  2671. }
  2672. }
  2673. this.commentList = res.data
  2674. this.sppk(this.commentList) // 获取参与人的方法
  2675. } else {
  2676. this.$message({
  2677. message: res.msg,
  2678. type: "error"
  2679. });
  2680. }
  2681. },
  2682. error => {
  2683. this.$message({
  2684. message: error,
  2685. type: "error"
  2686. });
  2687. });
  2688. },
  2689. // 获取评论参与人
  2690. sppk(comit) {
  2691. var sk = []
  2692. comit.forEach(function(e){
  2693. sk.push(e.userName)
  2694. })
  2695. this.critic = new Set(sk)
  2696. console.log(this.critic, '参与人',this.critic.length)
  2697. },
  2698. // 点击发布
  2699. release() {
  2700. if(this.textarea2.length <= 0) return this.$message({message: this.$t('pleaseentercontent'), type: "error"})
  2701. this.http.post('/task-comment/add', {taskId: this.taskId, userId: this.user.id, content: this.textarea2},
  2702. res => {
  2703. if(res.code == "ok"){
  2704. if(res.data.content.indexOf('$userName=') != '-1') {
  2705. let obj = {
  2706. msg1: res.data.content.split('$')[0],
  2707. msg2: res.data.content.split('$')[1].split('=')[1],
  2708. msg3: res.data.content.split('$')[2]
  2709. }
  2710. res.data.content = obj
  2711. } else {
  2712. if(this.user.userNameNeedTranslate == 1) {
  2713. let obj = {
  2714. msg1: res.data.content,
  2715. msg2: '',
  2716. msg3: ''
  2717. }
  2718. res.data.content = obj
  2719. }
  2720. }
  2721. this.commentList.push(res.data)
  2722. this.sppk(this.commentList)
  2723. this.textarea2 = ""
  2724. this.contRoll() // 滚动到底部
  2725. } else {
  2726. this.$message({
  2727. message: res.msg,
  2728. type: "error"
  2729. });
  2730. }
  2731. },
  2732. error => {
  2733. this.$message({
  2734. message: error,
  2735. type: "error"
  2736. });
  2737. })
  2738. },
  2739. // 滚动到底部
  2740. contRoll(){
  2741. this.$nextTick(() => {
  2742. this.$refs.main.scrollTop = this.$refs.contRoll.scrollHeight;
  2743. })
  2744. },
  2745. chggstim(e,i){
  2746. if(e){
  2747. this.gstimday[i] = Math.ceil(this.gstimhour[i] / this.user.timeType.allday)
  2748. }else{
  2749. this.gstimhour[i] = this.gstimday[i] * this.user.timeType.allday
  2750. }
  2751. },
  2752. getTaskDetail(id) {
  2753. this.http.post('/task/getTask',{id: id},
  2754. res => {
  2755. if (res.code == "ok") {
  2756. if(this.user.userNameNeedTranslate == 1) {
  2757. for(var i in res.data.subTaskList) {
  2758. if(res.data.subTaskList[i].executorName) {
  2759. res.data.subTaskList[i].executorName = res.data.subTaskList[i].executorName.split(',')
  2760. }
  2761. }
  2762. }
  2763. this.addForm = res.data;
  2764. this.addForm.createDate = null;
  2765. this.addForm.indate = null;
  2766. this.addLoading = false;
  2767. this.recentProgressInfo = this.addForm.progress;
  2768. this.addForm.executorListFront = this.addForm.executorList;
  2769. this.gstimday = []
  2770. this.gstimhour = []
  2771. for(let i=0;i<this.addForm.executorListFront.length;i++){
  2772. this.gstimhour.push(this.addForm.executorListFront[i].planHours),
  2773. this.gstimday.push(Math.ceil(this.addForm.executorListFront[i].planHours / this.user.timeType.allday))
  2774. }
  2775. //删除中间传值的变量数组
  2776. delete this.addForm.executorList;
  2777. } else {
  2778. this.$message({
  2779. message: res.msg,
  2780. type: "error"
  2781. });
  2782. }
  2783. },
  2784. error => {
  2785. this.$message({
  2786. message: error,
  2787. type: "error"
  2788. });
  2789. });
  2790. },
  2791. addTask(stage) {
  2792. this.mileageCup = false
  2793. this.addFormVisible = true;
  2794. this.addForm = {projectId: stage.projectId, groupId: stage.groupId, stagesId: stage.id, taskLevel:0, planHours: 8, taskType: 0};
  2795. this.addForm.executorListFront = [{executorId:null, planHours:this.user.timeType.allday}];
  2796. this.gstimhour = [this.user.timeType.allday]
  2797. this.gstimday = [1]
  2798. this.addLoading = false;
  2799. this.isEditFile = false;
  2800. this.title=this.$t('createtask ');
  2801. this.commentList = [];
  2802. this.timelabel = false
  2803. let obj = {
  2804. create: true,
  2805. addForm: this.addForm,
  2806. executorListFront: [{executorId:null, planHours:8}],
  2807. stage: stage,
  2808. integrationTaskNingwai: this.integrationTaskNingwai
  2809. }
  2810. this.integrationTask = obj
  2811. this.taskComponentFlg = true
  2812. },
  2813. addExecutorLine(e) {
  2814. if(e == 1){
  2815. if (this.relationItemData.executorList == null) {
  2816. this.relationItemData.executorList = [];//初始化
  2817. }
  2818. this.relationItemData.executorList.push({executorId:null, planHours:this.user.timeType.allday});
  2819. this.gstimday.push(1)
  2820. this.gstimhour.push(this.user.timeType.allday)
  2821. this.$forceUpdate();
  2822. }else{
  2823. if (this.addForm.executorListFront == null) {
  2824. this.addForm.executorListFront = [];//初始化
  2825. }
  2826. this.addForm.executorListFront.push({executorId:null, planHours:this.user.timeType.allday});
  2827. this.gstimday.push(1)
  2828. this.gstimhour.push(this.user.timeType.allday)
  2829. this.$forceUpdate();
  2830. }
  2831. },
  2832. removeExecutorLine(index,e) {
  2833. if(e == 1){
  2834. this.relationItemData.executorList.splice(index,1);
  2835. this.gstimday.splice(index,1)
  2836. this.gstimhour.splice(index,1)
  2837. this.$forceUpdate();
  2838. }else{
  2839. this.addForm.executorListFront.splice(index,1);
  2840. this.gstimday.splice(index,1)
  2841. this.gstimhour.splice(index,1)
  2842. this.$forceUpdate();
  2843. }
  2844. },
  2845. renameStage(item) {
  2846. this.stageForm = JSON.parse(JSON.stringify(item));
  2847. this.addStageDialog = true;
  2848. },
  2849. deleteStage(item) {
  2850. var _this = this;
  2851. var param = {id:item.id, groupId: item.groupId};
  2852. this.$confirm(this.$t('detelecesTask'), this.$t('other.prompts'), {
  2853. //type: 'warning'
  2854. }).then(() => {
  2855. this.http.post('/stages/delete',param,
  2856. res => {
  2857. if (res.code == "ok") {
  2858. // this.stageList = res.data;
  2859. this.getStageList();
  2860. } else {
  2861. this.$message({
  2862. message: res.msg,
  2863. type: "error"
  2864. });
  2865. }
  2866. },
  2867. error => {
  2868. this.$message({
  2869. message: error,
  2870. type: "error"
  2871. });
  2872. });
  2873. });
  2874. },
  2875. //加载项目内的任务列表
  2876. getStageList() {
  2877. this.integrationTaskNingwai = {
  2878. groupId: this.selectedGroup.id,
  2879. projectId: this.selectedGroupprojectId,
  2880. order: this.order,
  2881. isDesc: this.isDesc
  2882. }
  2883. this.http.post('/stages/list',{groupId: this.selectedGroup.id, projectId: this.selectedGroup.projectId, order: this.order, isDesc: this.isDesc,hideCompleted: this.hideCompleted},
  2884. res => {
  2885. if (res.code == "ok") {
  2886. this.stageList = res.data.list;
  2887. this.canAddTask = res.data.canAddTask
  2888. this.canEditStageList = res.data.canEditStageList
  2889. this.timess() // 处理时间的方法
  2890. } else {
  2891. this.$message({
  2892. message: res.msg,
  2893. type: "error"
  2894. });
  2895. }
  2896. },
  2897. error => {
  2898. this.$message({
  2899. message: error,
  2900. type: "error"
  2901. });
  2902. });
  2903. },
  2904. timess(){
  2905. // console.log('timess');
  2906. var date = new Date()
  2907. let Y = date.getFullYear()
  2908. let M = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : (date.getMonth() + 1)
  2909. let D = date.getDate() < 10 ? ('0' + date.getDate()) : date.getDate()
  2910. this.times = `${Y}-${M}-${D}`
  2911. },
  2912. addStagePost() {
  2913. console.log('新增任务列表');
  2914. let param = JSON.parse(JSON.stringify(this.stageForm));
  2915. param.taskList = [];
  2916. this.http.post('/stages/save',param,
  2917. res => {
  2918. if (res.code == "ok") {
  2919. this.addStageDialog = false;
  2920. this.stageList = res.data;
  2921. } else {
  2922. this.$message({
  2923. message: res.msg,
  2924. type: "error"
  2925. });
  2926. }
  2927. },
  2928. error => {
  2929. this.$message({
  2930. message: error,
  2931. type: "error"
  2932. });
  2933. });
  2934. },
  2935. addStage() {
  2936. this.addStageDialog = true;
  2937. this.stageForm = {groupId: this.selectedGroup.id, projectId: this.curProjectId, stagesTime: 0};
  2938. },
  2939. viewChange(index, indexPath) {
  2940. this.groupType = 1;
  2941. this.order = "create_date";
  2942. this.isDesc = true;
  2943. this.selectedGroup = this.viewList.filter(g=>g.id == index)[0];
  2944. this.getViewTaskList();
  2945. this.displayTable = true;
  2946. this.taskListPage = 1
  2947. } ,
  2948. groupChange(index, indexPath) {
  2949. console.log('店家了')
  2950. this.groupType = 0;
  2951. this.order = "seq";
  2952. this.isDesc = false;
  2953. this.selectedGroup = this.groupList.filter(g=>g.id == index)[0];
  2954. this.groupResponsibleId = this.selectedGroup.inchargerId
  2955. this.getStageList();
  2956. this.displayTable = false;
  2957. this.$forceUpdate()
  2958. },
  2959. //本地搜索组
  2960. startSearchGroup() {
  2961. if (this.groupSearch != null || this.groupSearch.length > 0) {
  2962. this.groupList = this.allGroupData.filter(g=>g.name.indexOf(this.groupSearch) >= 0);
  2963. } else {
  2964. this.groupList = this.allGroupData;
  2965. }
  2966. },
  2967. editIncharger(item) {
  2968. this.groupForm = JSON.parse(JSON.stringify(item));
  2969. this.setInchargerDialog = true;
  2970. },
  2971. setManDay(item) {
  2972. this.groupForm = JSON.parse(JSON.stringify(item));
  2973. this.modGroupManDayDialog = true;
  2974. },
  2975. renameGroup(item) {
  2976. this.groupForm = JSON.parse(JSON.stringify(item));
  2977. this.modGroupDialog = true;
  2978. },
  2979. deleteGroup(item) {
  2980. var _this = this;
  2981. this.$confirm(this.$t('tasksgroupsDetalses'), this.$t('other.prompts'), {
  2982. type: 'warning'
  2983. }).then(() => {
  2984. this.http.post('/task-group/delete',item,
  2985. res => {
  2986. if (res.code == "ok") {
  2987. this.groupList = res.data;
  2988. if (item.id == this.selectedGroup.id) {
  2989. //之前选中的分组被删除了
  2990. if (this.groupList.length > 0) {
  2991. this.defaultGroupId = this.groupList[0].id;
  2992. this.selectedGroup = this.groupList[0];
  2993. this.groupChange(this.defaultGroupId)
  2994. } else {
  2995. this.selectedGroup = {};
  2996. }
  2997. }
  2998. } else {
  2999. this.$message({
  3000. message: res.msg,
  3001. type: "error"
  3002. });
  3003. }
  3004. },
  3005. error => {
  3006. this.$message({
  3007. message: error,
  3008. type: "error"
  3009. });
  3010. });
  3011. });
  3012. },
  3013. getGroupDetails(obj) {
  3014. this.http.post('/task-group/detail',{
  3015. groupId: obj.id
  3016. },
  3017. res => {
  3018. if (res.code == "ok") {
  3019. this.groupDetailsShow = true
  3020. this.groupDetailData = res.data
  3021. this.groupDetailTil = obj.name + ' - '+this.$t('groupdetails')
  3022. } else {
  3023. this.$message({
  3024. message: res.msg,
  3025. type: "error"
  3026. });
  3027. }
  3028. },
  3029. error => {
  3030. this.$message({
  3031. message: error,
  3032. type: "error"
  3033. });
  3034. });
  3035. },
  3036. addTemplateGroup() {
  3037. // var param = JSON.parse(JSON.stringify(this.groupTemplateList.filter(g=>g.selected)[0]));
  3038. // delete param.stagesList;
  3039. // param.projectId = this.curProjectId;
  3040. // var k = this.groupTemplateList[this.sidebarIndex].name
  3041. // var s = null;
  3042. // var xmz = this.groupList.forEach(function(a, b, c){
  3043. // if (a.name == k) {
  3044. // s = true
  3045. // return
  3046. // }
  3047. // })
  3048. // if (s){
  3049. // this.addGroupDialog = false;
  3050. // this.$message({
  3051. // message: '当前项目已存在分组['+k+'],请修改组名后重试。',
  3052. // type: "error"
  3053. // });
  3054. // return
  3055. // }
  3056. var param = JSON.parse(JSON.stringify(this.groupTemplateList.filter(g=>g.selected)))
  3057. console.log(param, '你看看啊')
  3058. for(var i in param) {
  3059. delete param[i].stagesList
  3060. }
  3061. if(param.length < 1) {
  3062. this.$message({
  3063. message: this.$t('qngxuanz'),
  3064. type: "error"
  3065. });
  3066. return
  3067. }
  3068. console.log(this.groupList)
  3069. var s = null
  3070. var k = ''
  3071. var xmz = this.groupList.forEach(function(a, b, c){
  3072. param.forEach((g, i) =>{
  3073. if(a.name == g.name) {
  3074. s = true
  3075. k = g.name
  3076. return
  3077. }
  3078. })
  3079. })
  3080. if (s){
  3081. this.addGroupDialog = false;
  3082. this.$message({
  3083. message: this.$t('projectalreadyhasgroup')+'['+k+'],'+this.$t('changethegroupname'),
  3084. type: "error"
  3085. });
  3086. return
  3087. }
  3088. console.log('将要闯过去的值', param)
  3089. // return
  3090. // this.http.post('/task-group/createFromTemplate',param,
  3091. this.http.post('/task-group/createFromTemplate',{
  3092. templateJson: JSON.stringify(param),
  3093. projectId: this.curProjectId
  3094. },
  3095. res => {
  3096. if (res.code == "ok") {
  3097. this.selectedGroup = res.data
  3098. this.sleectId = res.data.id
  3099. this.sleectProjectId = res.data.projectId
  3100. this.addGroupDialog = false;
  3101. // this.getTaskGroups();
  3102. this.getTaskGroup();
  3103. } else {
  3104. this.$message({
  3105. message: res.msg,
  3106. type: "error"
  3107. });
  3108. }
  3109. },
  3110. error => {
  3111. this.$message({
  3112. message: error,
  3113. type: "error"
  3114. });
  3115. });
  3116. },
  3117. setManDayData() {
  3118. this.http.post('/task-group/saveManDay',{data:JSON.stringify(this.groupList)},
  3119. res => {
  3120. if (res.code == "ok") {
  3121. this.modGroupManDayDialog = false;
  3122. this.groupList = res.data;
  3123. } else {
  3124. this.$message({
  3125. message: res.msg,
  3126. type: "error"
  3127. });
  3128. }
  3129. },
  3130. error => {
  3131. this.$message({
  3132. message: error,
  3133. type: "error"
  3134. });
  3135. });
  3136. },
  3137. // 重新定义了 addGroup 方法
  3138. addGroup(formName) {
  3139. // return
  3140. this.$refs[formName].validate((valid) => {
  3141. if (valid) {
  3142. this.http.post('/task-group/save',this.groupForm,
  3143. res => {
  3144. if (res.code == "ok") {
  3145. this.groupList = res.data;
  3146. this.addGroupDialog = false;
  3147. this.modGroupDialog = false;
  3148. if (this.selectedGroup.id !== this.groupForm.id) {
  3149. this.selectedGroup = this.groupList.filter(g=>g.new)[0];
  3150. }
  3151. this.defaultGroupId = this.groupList[this.groupList.length - 1].id
  3152. // this.getTaskGroup();
  3153. this.getStageList()
  3154. } else {
  3155. this.$message({
  3156. message: res.msg,
  3157. type: "error"
  3158. });
  3159. }
  3160. },
  3161. error => {
  3162. this.$message({
  3163. message: error,
  3164. type: "error"
  3165. });
  3166. });
  3167. } else {
  3168. console.log('error submit!!');
  3169. return false;
  3170. }
  3171. });
  3172. },
  3173. createGroup() {
  3174. this.addGroupDialog = true;
  3175. this.groupForm = {projectId: this.curProjectId};
  3176. },
  3177. getInsideData() {
  3178. this.getTaskGroups();
  3179. },
  3180. //加载项目内的任务分组
  3181. getTaskGroups() {
  3182. this.http.post('/task-group/list',{projectId: this.curProjectId},
  3183. res => {
  3184. if (res.code == "ok") {
  3185. this.allGroupData = res.data;
  3186. this.groupList = res.data;
  3187. console.log(this.groupList,'grouplist');
  3188. if (this.groupList.length > 0) {
  3189. this.defaultGroupId = this.groupList[0].id;
  3190. this.selectedGroup = this.groupList[0];
  3191. this.groupResponsibleId = this.groupList[0].inchargerId;
  3192. this.getUserConfig();
  3193. } else {
  3194. //清空任务列表
  3195. this.defaultGroupId = null;
  3196. this.selectedGroup = null;
  3197. this.stageList = [];
  3198. }
  3199. } else {
  3200. this.$message({
  3201. message: res.msg,
  3202. type: "error"
  3203. });
  3204. }
  3205. },
  3206. error => {
  3207. this.$message({
  3208. message: error,
  3209. type: "error"
  3210. });
  3211. });
  3212. },
  3213. // 获取用户配置
  3214. getUserConfig() {
  3215. this.http.post('/user-config/getUserConfig',{},
  3216. res => {
  3217. if (res.code == "ok") {
  3218. if(res.data != undefined){
  3219. if(res.data.hideCompletedTask == 0){
  3220. this.hideCompleted = false;
  3221. }else if(res.data.hideCompletedTask == 1){
  3222. this.hideCompleted = true;
  3223. }
  3224. }
  3225. this.getStageList();
  3226. }
  3227. },
  3228. error => {
  3229. this.$message({
  3230. message: error,
  3231. type: "error"
  3232. });
  3233. });
  3234. },
  3235. //更改隐藏已完成任务选项
  3236. editHideTask() {
  3237. this.getStageList();
  3238. var hideSwitch;
  3239. if(this.hideCompleted == false){
  3240. hideSwitch = 0;
  3241. }else if(this.hideCompleted == true){
  3242. hideSwitch = 1;
  3243. }
  3244. this.http.post('/user-config/editUserConfig',{hideCompletedTask: hideSwitch},
  3245. res => {
  3246. },
  3247. error => {
  3248. this.$message({
  3249. message: error,
  3250. type: "error"
  3251. });
  3252. });
  3253. },
  3254. // 额外加的
  3255. getTaskGroup() {
  3256. this.http.post('/task-group/list',{projectId: this.curProjectId},
  3257. res => {
  3258. if (res.code == "ok") {
  3259. this.allGroupData = res.data;
  3260. this.groupList = res.data;
  3261. if (this.groupList.length > 0) {
  3262. this.defaultGroupId = this.sleectId;
  3263. this.selectedGroup = this.groupList[res.data.length - 1];
  3264. this.getStageList();
  3265. } else {
  3266. //清空任务列表
  3267. this.defaultGroupId = null;
  3268. this.selectedGroup = null;
  3269. this.stageList = [];
  3270. }
  3271. } else {
  3272. this.$message({
  3273. message: res.msg,
  3274. type: "error"
  3275. });
  3276. }
  3277. },
  3278. error => {
  3279. this.$message({
  3280. message: error,
  3281. type: "error"
  3282. });
  3283. });
  3284. },
  3285. //切换项目
  3286. onProjectChange() {
  3287. let path = this.$route.path;
  3288. path = path.substring(0,path.lastIndexOf('/'))+'/'+this.curProjectId;
  3289. this.$router.push(path);
  3290. this.getTaskGroups();
  3291. this.getDetail()
  3292. this.$refs.fileCenter.refreshPage();
  3293. this.$refs.projectInfo.refreshPage();
  3294. this.$refs.summary.refreshPage();
  3295. this.$refs.costbaseline.refreshPage();
  3296. // this.$refs.earning.refreshPage();
  3297. if(this.user.companyId == '936') {
  3298. this.$refs.projectInfo.getKeyNodes()
  3299. }
  3300. },
  3301. //获取我的项目列表
  3302. getMyProjectList() {
  3303. this.http.post('/project/getProjectList', {
  3304. },
  3305. res => {
  3306. if (res.code == "ok") {
  3307. this.projectList = res.data;
  3308. console.log('getprojectlist',res.data);
  3309. } else {
  3310. this.$message({
  3311. message: res.msg,
  3312. type: "error"
  3313. });
  3314. }
  3315. },
  3316. error => {
  3317. this.$message({
  3318. message: error,
  3319. type: "error"
  3320. });
  3321. });
  3322. },
  3323. menuSelect() {
  3324. },
  3325. toList() {
  3326. this.$router.push("/list");
  3327. },
  3328. searchList() {
  3329. this.page = 1;
  3330. this.getList();
  3331. },
  3332. //显示用户详情
  3333. showUser(userId) {
  3334. this.userDetailVisible = true;
  3335. this.http.post(this.port.manage.userDetail, {
  3336. userId: userId
  3337. },
  3338. res => {
  3339. if (res.code == "ok") {
  3340. this.userDetail = res.data;
  3341. } else {
  3342. this.$message({
  3343. message: res.msg,
  3344. type: "error"
  3345. });
  3346. }
  3347. },
  3348. error => {
  3349. this.$message({
  3350. message: error,
  3351. type: "error"
  3352. });
  3353. });
  3354. },
  3355. getUsers() {
  3356. // this.http.post(this.port.manage.list, {
  3357. // departmentId: -1,
  3358. // pageIndex: 1,
  3359. // pageSize: -1
  3360. // },
  3361. this.http.post('/user/getSimpleActiveUserList', {},
  3362. res => {
  3363. if (res.code == "ok") {
  3364. this.users = res.data;
  3365. } else {
  3366. this.$message({
  3367. message: res.msg,
  3368. type: "error"
  3369. });
  3370. }
  3371. },
  3372. error => {
  3373. this.$message({
  3374. message: error,
  3375. type: "error"
  3376. });
  3377. });
  3378. },
  3379. //获取项目列表
  3380. getList() {
  3381. this.listLoading = true;
  3382. this.http.post(this.port.project.listPage, {
  3383. pageIndex: this.page,
  3384. pageSize: this.size,
  3385. keyword:this.keyword,
  3386. searchField: this.searchField,
  3387. },
  3388. res => {
  3389. this.listLoading = false;
  3390. if (res.code == "ok") {
  3391. var list = res.data.records;
  3392. for(var i in list) {
  3393. var participator = list[i].participator , str = "";
  3394. for(var j in participator) {
  3395. if(j == participator.length-1) {
  3396. str += participator[j].name
  3397. } else {
  3398. str += participator[j].name + ','
  3399. }
  3400. }
  3401. list[i].userNames = str;
  3402. }
  3403. this.list = list;
  3404. this.total = res.data.total;
  3405. } else {
  3406. this.$message({
  3407. message: res.msg,
  3408. type: "error"
  3409. });
  3410. }
  3411. },
  3412. error => {
  3413. this.listLoading = false;
  3414. this.$message({
  3415. message: error,
  3416. type: "error"
  3417. });
  3418. });
  3419. },
  3420. submitInsert() {
  3421. if (this.textContent !== true) return this.$message({
  3422. showClose: true,
  3423. message: this.$t('pictureistoolargepleaseuploaditagain'),
  3424. type: 'warning'
  3425. });
  3426. //检查是有重名的执行人
  3427. var exeList = this.addForm.executorListFront;
  3428. // for(let i=0;i<this.gstimhour.length;i++){
  3429. // exeList[i].planHours = this.gstimhour[i]
  3430. // }
  3431. for (var i=0;i<exeList.length;i++) {
  3432. var findSameUser = false;
  3433. exeList[i].planHours = this.gstimhour[i]
  3434. for (var j=i+1;j<exeList.length; j++) {
  3435. if (exeList[i].executorId && exeList[j].executorId && exeList[i].executorId == exeList[j].executorId) {
  3436. findSameUser = true;
  3437. break;
  3438. }
  3439. }
  3440. if (findSameUser) {
  3441. return this.$message({
  3442. showClose: true,
  3443. message: this.$t('executorhasduplication'),
  3444. type: 'error'
  3445. });
  3446. }
  3447. }
  3448. if(this.addForm.startDate && this.addForm.endDate) {
  3449. if(this.addForm.endDate < this.addForm.startDate) {
  3450. return this.$message({
  3451. showClose: true,
  3452. message: this.$t('ren-wu-jie-zhi-shi-jian-bu-neng-xiao-yu-kai-shi-shi-jian'),
  3453. type: 'error'
  3454. });
  3455. }
  3456. }
  3457. this.$refs.form1.validate(valid => {
  3458. if (valid) {
  3459. delete this.addForm.subTaskList;
  3460. delete this.addForm.refTaskList;
  3461. delete this.addForm.progress;
  3462. //去掉没有执行人的.(因为要有计划工时,执行人可以暂不设置)
  3463. // this.addForm.executorListFront = this.addForm.executorListFront.filter(exe=>exe.executorId);
  3464. this.addForm.executorListStr = JSON.stringify(this.addForm.executorListFront);
  3465. this.addLoading = true;
  3466. this.http.post('/task/save',this.addForm,
  3467. res => {
  3468. this.addLoading = false;
  3469. if (res.code == "ok") {
  3470. this.$message({
  3471. message: this.$t('message.submittedSuccessfully'),
  3472. type: "success"
  3473. });
  3474. if (this.addForm.parentTid == null) {
  3475. this.addFormVisible = false;
  3476. if (this.groupType == 0) {
  3477. this.getStageList();
  3478. } else {
  3479. this.getViewTaskList();
  3480. }
  3481. } else {
  3482. this.backToParentTask();
  3483. }
  3484. } else {
  3485. this.$message({
  3486. message: res.msg,
  3487. type: "error"
  3488. });
  3489. }
  3490. },
  3491. error => {
  3492. this.$message({
  3493. message: error,
  3494. type: "error"
  3495. });
  3496. }
  3497. );
  3498. }
  3499. });
  3500. },
  3501. DateChange(){
  3502. if(this.addForm.startDate != undefined && this.addForm.endDate != undefined){
  3503. let stdate = Date.parse(this.addForm.startDate)
  3504. let eddate = Date.parse(this.addForm.endDate)
  3505. if(stdate <= eddate){
  3506. let days = (eddate - stdate) / (1*24*60*60*1000) + 1
  3507. for (let i=0;i<this.gstimday.length;i++) {
  3508. this.gstimday[i] = days
  3509. this.gstimhour[i] = days * this.user.timeType.allday
  3510. }
  3511. this.$forceUpdate()
  3512. }
  3513. // console.log("gstimday",this.gstimday);
  3514. }
  3515. },
  3516. // 删除
  3517. deletePro(i, item) {
  3518. this.$confirm(this.$t('identifytheproject') + item.projectName + this.$t('ma'),this.$t('deletetheproject'), {
  3519. confirmButtonText: this.$t('btn.determine'),
  3520. cancelButtonText: this.$t('btn.cancel'),
  3521. type: "warning"
  3522. })
  3523. .then(() => {
  3524. this.listLoading = true;
  3525. this.http.post(this.port.project.delete,{
  3526. id: item.id
  3527. },
  3528. res => {
  3529. this.listLoading = false;
  3530. if (res.code == "ok") {
  3531. this.$message({
  3532. message: this.$t('message.successfullyDeleted'),
  3533. type: "success"
  3534. });
  3535. this.getList();
  3536. } else {
  3537. this.$message({
  3538. message: res.msg,
  3539. type: "error"
  3540. });
  3541. }
  3542. },
  3543. error => {
  3544. this.listLoading = false;
  3545. this.$message({
  3546. message: error,
  3547. type: "error"
  3548. });
  3549. }
  3550. );
  3551. })
  3552. .catch(() => {});
  3553. },
  3554. detail(i) {
  3555. this.$router.push("/list/" + this.list[i].id + "/" + this.list[i].projectName);
  3556. },
  3557. getDetail() {
  3558. this.http.post('/project/detail',{
  3559. id: this.curProjectId
  3560. },
  3561. res => {
  3562. if (res.code == "ok") {
  3563. this.currentProject = res.data;
  3564. this.getjurisdictionIds(this.currentProject)
  3565. this.joinMembList = this.currentProject.participationList;
  3566. this.isManageDept = this.currentProject.manageDept;
  3567. } else {
  3568. }
  3569. },
  3570. error => {
  3571. this.$message({
  3572. message: error,
  3573. type: "error"
  3574. });
  3575. }
  3576. );
  3577. },
  3578. getjurisdictionIds(pro){
  3579. console.log('pro',pro.creatorId);
  3580. this.projectCreatorId = pro.creatorId
  3581. this.projectInchargerId = pro.inchargerId
  3582. },
  3583. // 自定义组件事件
  3584. selectCal(obj) {
  3585. if(obj.distinction == '1') {
  3586. this.addForm.executorListFront[obj.index].executorId = obj.id
  3587. } else if(obj.distinction == '2') {
  3588. this.groupForm.inchargerId = obj.id
  3589. }
  3590. },
  3591. // 企业微信搜索
  3592. echartDepartment() {
  3593. console.log('我点击了搜索')
  3594. if(this.wxFilterText != '') {
  3595. this.http.post("/department/listAllMemb", {
  3596. keyword: this.wxFilterText,
  3597. cursor: ''
  3598. },
  3599. res => {
  3600. if (res.code == "ok") {
  3601. var list = res.data.data;
  3602. this.setUserToDept(list);
  3603. this.deptMembData = list;
  3604. this.$forceUpdate()
  3605. } else {
  3606. this.$message({
  3607. message: res.msg,
  3608. type: "error"
  3609. });
  3610. }
  3611. },
  3612. error => {
  3613. this.$message({
  3614. message: error,
  3615. type: "error"
  3616. });
  3617. });
  3618. }
  3619. },
  3620. setUserToDept(list) {
  3621. for (var i in list) {
  3622. if (list[i].children != null) {
  3623. this.setUserToDept(list[i].children);
  3624. }
  3625. if (list[i].userList != null) {
  3626. if (list[i].children == null) {
  3627. list[i].children = [];
  3628. }
  3629. list[i].userList.forEach(element => {
  3630. var obj = {id: element.id, label:element.name, parentId:element.departmentId, isUser:1};
  3631. list[i].children.push(obj);
  3632. });
  3633. }
  3634. }
  3635. }
  3636. },
  3637. created() {
  3638. let height = window.innerHeight;
  3639. this.tableHeight = height - 135;
  3640. this.stageListHeight = this.tableHeight - 45;
  3641. this.taskListinH = this.stageListHeight - 75;
  3642. const that = this;
  3643. window.onresize = function temp() {
  3644. that.tableHeight = window.innerHeight - 135;
  3645. that.stageListHeight = that.tableHeight - 45;
  3646. that.taskListinH = that.stageListHeight - 75;
  3647. };
  3648. setTimeout(function(){
  3649. that.componentFlg = true
  3650. }, 1000)
  3651. },
  3652. mounted() {
  3653. this.curProjectId = parseInt(this.$route.params.id);
  3654. this.activeName = this.$route.path.split("/")[1];
  3655. this.getDetail();
  3656. this.getUsers();
  3657. this.getMyProjectList();
  3658. this.getInsideData();
  3659. this.getGroupTemplate();
  3660. }
  3661. };
  3662. </script>
  3663. <style lang="scss" scoped>
  3664. .hideCompletedFelx {
  3665. display: flex;
  3666. align-items: center;
  3667. justify-content: flex-end;
  3668. }
  3669. .Daily p {
  3670. margin: 0 !important;
  3671. padding: 0 0 10px 0 !important;
  3672. }
  3673. .sub-all {
  3674. div {
  3675. display: inline-block;
  3676. padding: 0 20px;
  3677. font-size: 20px;
  3678. cursor: pointer;
  3679. }
  3680. .subOn {
  3681. color: #66b1ff;
  3682. }
  3683. }
  3684. .DailyBody {
  3685. margin: 0 20px;
  3686. }
  3687. .Daily{
  3688. height: 120%;
  3689. overflow: auto;
  3690. }
  3691. </style>
  3692. <style >
  3693. .taskCardCircleBox{
  3694. padding-left: 5px;
  3695. display: flex;
  3696. justify-content: left;
  3697. align-items: center;
  3698. }
  3699. .flip-list-move {
  3700. transition: transform 0.5s;
  3701. }
  3702. .no-move {
  3703. transition: transform 0s;
  3704. }
  3705. .taskStage {
  3706. margin:10px;
  3707. display:inline-block;
  3708. vertical-align:top;
  3709. width: 331px;
  3710. }
  3711. .taskList {
  3712. padding:7px;
  3713. width:331px;
  3714. }
  3715. .taskListin{
  3716. width: 317px;
  3717. overflow: auto;
  3718. }
  3719. .taskList .stage {
  3720. font-weight:bold;
  3721. display:block;
  3722. float:left;
  3723. width:260px;
  3724. overflow: auto;
  3725. }
  3726. .taskGroupClass {
  3727. width: 180px;
  3728. display: inline-block;
  3729. text-overflow: ellipsis;
  3730. overflow: hidden;
  3731. white-space: nowrap;
  3732. }
  3733. .taskCard {
  3734. background: #fff;
  3735. margin: 5px 0px;
  3736. padding:5px;
  3737. border: 1px solid #e6e6e6;
  3738. border-radius: 3px;
  3739. box-shadow: 3px 3px 3px #e6e6e6;
  3740. min-height:60px;
  3741. position: relative;
  3742. border-radius: 3px;
  3743. overflow: hidden;
  3744. width: 288px;
  3745. }
  3746. .taskImg {
  3747. position: absolute;
  3748. box-sizing: border-box;
  3749. width: 100%;
  3750. height: 100%;
  3751. top: 0;
  3752. left: 0;
  3753. }
  3754. .taskImg img{
  3755. position: absolute;
  3756. top: -1px;
  3757. }
  3758. .hong:hover {
  3759. border-top: 1px solid #ff0000;
  3760. }
  3761. .huang:hover {
  3762. border-top: 1px solid #ff9600;
  3763. }
  3764. .hui:hover {
  3765. border-top: 1px solid #c9c9c9;
  3766. }
  3767. .taskCard:hover {
  3768. cursor: move;
  3769. }
  3770. .chosen {
  3771. background-color: #000 !important;
  3772. color: #fff;
  3773. }
  3774. .ghost {
  3775. background-color: #fafafa !important;
  3776. }
  3777. .taskCard .cb {
  3778. margin-right:5px;
  3779. }
  3780. .item {
  3781. background:#fff;
  3782. }
  3783. .input-with-select .el-input-group__prepend {
  3784. background-color: #fff;
  3785. }
  3786. .el-tabs__item {
  3787. height:45px ;
  3788. }
  3789. .projectCls {
  3790. margin-left:10px;margin-right:10px;
  3791. }
  3792. .heavyTxt {
  3793. font-weight:bold;
  3794. }
  3795. .el-tabs__nav-wrap::after {
  3796. height:0.5px;
  3797. }
  3798. .user_name_icon {
  3799. text-align: right;
  3800. border-radius: 50%;
  3801. color: #fff;
  3802. float: right;
  3803. font-size: 10px;
  3804. width: 30px;
  3805. height: 30px;
  3806. line-height: 30px;
  3807. transform: scale(.8);
  3808. overflow: hidden;
  3809. letter-spacing: 1px;
  3810. box-sizing: border-box;
  3811. padding-right: 1.5px;
  3812. direction: rtl;
  3813. letter-spacing: 1.5px;
  3814. }
  3815. .task_name {
  3816. color:#262626;
  3817. display:inline-block;
  3818. max-width: 235px;
  3819. height: 25px;
  3820. overflow: hidden;
  3821. white-space: nowrap;
  3822. text-overflow: ellipsis;
  3823. }
  3824. .task_name span{
  3825. position: relative;
  3826. top: 8px;
  3827. }
  3828. .cb {
  3829. position: relative;
  3830. top: -2px;
  3831. }
  3832. .group_style {
  3833. border-radius: 5px;margin:2px 0px 2px 0px;height:40px;line-height:40px;
  3834. }
  3835. .el-tabs__nav-wrap::after {
  3836. height:1px;
  3837. }
  3838. .el-tabs__header {
  3839. margin:0 !important;
  3840. }
  3841. .single_line {
  3842. overflow: hidden;text-overflow:ellipsis;white-space: nowrap;
  3843. }
  3844. .sub_task_num {
  3845. font-size:10px;
  3846. color:#666;
  3847. }
  3848. .template_box {
  3849. margin:20px 0px;
  3850. }
  3851. /* 项目阶段侧边栏样式 */
  3852. .sidebar {
  3853. width: 2px;
  3854. background: #dddddd;
  3855. position: relative;
  3856. }
  3857. .sidebar:hover {
  3858. background: #20a0ff;
  3859. }
  3860. .sidebar:hover .etui {
  3861. background: #20a0ff;
  3862. border: #20a0ff;
  3863. color: #fff;
  3864. }
  3865. .etui {
  3866. width: 15px;
  3867. height: 40px;
  3868. background: #fff;
  3869. border: 1px solid #dddddd;
  3870. position: absolute;
  3871. top: 50%;
  3872. left: 0%;
  3873. transform: translate(6%, -50%);
  3874. color: rgb(192, 191, 191);
  3875. box-sizing: border-box;
  3876. }
  3877. .etui i {
  3878. display: inline-block;
  3879. padding-top: 90%;
  3880. /* padding-left: 15%; */
  3881. font-weight: bold;
  3882. }
  3883. /* bug问题 */
  3884. .task {
  3885. box-sizing: border-box;
  3886. padding-left: 10px;
  3887. padding-right: 5px;
  3888. }
  3889. /* 评论部分 */
  3890. .remark {
  3891. width: 500px;
  3892. height: 100%;
  3893. background: #fff;
  3894. position: absolute;
  3895. top: 0;
  3896. right: -500px;
  3897. border-left: 3px solid #dddddd;
  3898. }
  3899. .jm {
  3900. margin-left: -500px;
  3901. }
  3902. .bj {
  3903. float: left;
  3904. width: 90%;
  3905. overflow: hidden;
  3906. height: 65px;
  3907. white-space: nowrap;
  3908. text-overflow: ellipsis;
  3909. }
  3910. .bj span {
  3911. width: 50px;
  3912. height: 50px;
  3913. display: inline-block;
  3914. border-radius: 50%;
  3915. color: #fff;
  3916. text-align: center;
  3917. float: left;
  3918. margin-right: 20px;
  3919. /* margin-top: 10px; */
  3920. line-height: 50px;
  3921. }
  3922. .player {
  3923. height: 15%;
  3924. box-sizing: border-box;
  3925. padding-left: 15px;
  3926. border-bottom: 1px solid #dddddd;
  3927. }
  3928. .player p {
  3929. margin: 0;
  3930. padding: 2% 0;
  3931. font-size: 18px;
  3932. }
  3933. .player .el-image {
  3934. border-radius: 50%;
  3935. margin-right: 10px;
  3936. }
  3937. .subject {
  3938. height: 60%;
  3939. box-sizing: border-box;
  3940. }
  3941. .sub-all {
  3942. font-size: 20px;
  3943. padding: 15px 0 15px 15px;
  3944. }
  3945. .sub-details {
  3946. width: 100%;
  3947. height: 38vh;
  3948. padding-right: 15px;
  3949. box-sizing: border-box;
  3950. overflow: hidden;
  3951. overflow-y: scroll
  3952. }
  3953. .sub-details li {
  3954. list-style:none
  3955. }
  3956. /* 红色背景显示日期 */
  3957. .element_span {
  3958. display: inline-block;
  3959. background: #e62412;
  3960. color: #fff;
  3961. border-radius: 3px;
  3962. padding: 3px;
  3963. /* text-align: center; */
  3964. font-size: 12px;
  3965. margin-left: 5px;
  3966. }
  3967. .pro_btn{
  3968. display: inline-block;
  3969. float: right;
  3970. }
  3971. </style>
  3972. <style lang="scss" scoped>
  3973. .counli {
  3974. em {
  3975. font-style: normal;
  3976. display: inline-block;
  3977. margin-left: 9%;
  3978. }
  3979. span {
  3980. float: right;
  3981. }
  3982. }
  3983. .carts {
  3984. position: relative;
  3985. .el-image{
  3986. border-radius: 50%;
  3987. float: left;
  3988. width: 20%;
  3989. }
  3990. i {
  3991. width: 30px;
  3992. height: 30px;
  3993. // background: #778899;
  3994. display: inline-block;
  3995. float: left;
  3996. border-radius:50%;
  3997. font-style:normal;
  3998. font-size: 12px;
  3999. line-height: 30px;
  4000. text-align: center;
  4001. color: #fff;
  4002. background: #778899;
  4003. overflow: hidden;
  4004. direction: rtl;
  4005. }
  4006. div {
  4007. text-align: left;
  4008. p {
  4009. text-align: left;
  4010. margin-left: 10px;
  4011. margin-left: 13%;
  4012. }
  4013. em {
  4014. display: block;
  4015. font-style: normal;
  4016. margin-left: 13%;
  4017. }
  4018. }
  4019. span {
  4020. font-size: 10px;
  4021. float: right;
  4022. margin-top: -40px;
  4023. }
  4024. }
  4025. .issue {
  4026. // height: 20%;
  4027. // position: relative;
  4028. // z-index: 4;
  4029. .zh{
  4030. position: relative;
  4031. width: 100%;
  4032. height: 100%;
  4033. }
  4034. .textareays {
  4035. background: #000;
  4036. height: 140px;
  4037. border: 0;
  4038. .el-textarea__inner {
  4039. height: 85%;
  4040. }
  4041. }
  4042. .issue-button {
  4043. position: absolute;
  4044. bottom: 20px;
  4045. right: 20px;
  4046. }
  4047. }
  4048. .inputDeep {
  4049. position: absolute;
  4050. bottom: 85px;
  4051. width: 95%;
  4052. margin: 0 12px;
  4053. }
  4054. .inputDeep .el-textarea .el-textarea__inner{
  4055. border: 0 !important;
  4056. resize: none !important;
  4057. }
  4058. .inputDeeps .el-textarea__inner {
  4059. border: 0 !important;
  4060. resize: none !important;
  4061. }
  4062. .scop_span {
  4063. display: inline-block;
  4064. padding: 2px 5px;
  4065. }
  4066. </style>
  4067. <style>
  4068. .ql-snow .ql-picker.ql-size .ql-picker-label::before,
  4069. .ql-snow .ql-picker.ql-size .ql-picker-item::before {
  4070. content: "14px" !important;
  4071. position: relative;
  4072. top: -8px;
  4073. }
  4074. .ql-snow .ql-picker.ql-size .ql-picker-label[data-value="small"]::before,
  4075. .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="small"]::before {
  4076. content: "10px" !important;
  4077. }
  4078. .ql-snow .ql-picker.ql-size .ql-picker-label[data-value="large"]::before,
  4079. .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="large"]::before {
  4080. content: "18px" !important;
  4081. }
  4082. .ql-snow .ql-picker.ql-size .ql-picker-label[data-value="huge"]::before,
  4083. .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="huge"]::before {
  4084. content: "32px" !important;
  4085. }
  4086. .ql-snow .ql-picker.ql-header .ql-picker-label::before,
  4087. .ql-snow .ql-picker.ql-header .ql-picker-item::before {
  4088. content: "文本" !important;
  4089. position: relative;
  4090. top: -8px;
  4091. }
  4092. .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before,
  4093. .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before {
  4094. content: "标题1" !important;
  4095. }
  4096. .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before,
  4097. .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before {
  4098. content: "标题2" !important;
  4099. }
  4100. .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before,
  4101. .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before {
  4102. content: "标题3" !important;
  4103. }
  4104. .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="4"]::before,
  4105. .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before {
  4106. content: "标题4" !important;
  4107. }
  4108. .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="5"]::before,
  4109. .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before {
  4110. content: "标题5" !important;
  4111. }
  4112. .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="6"]::before,
  4113. .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="6"]::before {
  4114. content: "标题6" !important;
  4115. }
  4116. .ql-snow .ql-picker.ql-font .ql-picker-label::before,
  4117. .ql-snow .ql-picker.ql-font .ql-picker-item::before {
  4118. content: "标准字体" !important;
  4119. }
  4120. .ql-snow .ql-picker.ql-font .ql-picker-label[data-value="serif"]::before,
  4121. .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="serif"]::before {
  4122. content: "衬线字体" !important;
  4123. }
  4124. .ql-snow .ql-picker.ql-font .ql-picker-label[data-value="monospace"]::before,
  4125. .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="monospace"]::before {
  4126. content: "等宽字体" !important;
  4127. }
  4128. /* .ql-picker-label {
  4129. position: relative;
  4130. } */
  4131. .ql-picker-label svg {
  4132. position: relative;
  4133. top: -6px;
  4134. }
  4135. /* 任务进展 */
  4136. .progress {
  4137. border: 1px solid #ddd;
  4138. border-radius: 5px;
  4139. width: 100%;
  4140. box-sizing: border-box;
  4141. padding: 15px;
  4142. position: relative;
  4143. margin-bottom: 20px;
  4144. }
  4145. .remind {
  4146. width: 95px;
  4147. height: 60%;
  4148. overflow-y:auto;
  4149. position: absolute;
  4150. background: #fff;
  4151. padding: 10px;
  4152. left: 0;
  4153. top: 0;
  4154. border: 1px solid #ddd;
  4155. z-index: 999999;
  4156. }
  4157. .rala1 .el-radio__input.is-checked + .el-radio__label {
  4158. color: #43d14f !important;
  4159. }
  4160. .rala1 .el-radio__input.is-checked .el-radio__inner {
  4161. background: #43d14f !important;
  4162. border-color: #43d14f !important;
  4163. }
  4164. .rala2 .el-radio__input.is-checked + .el-radio__label {
  4165. color: #fd7624 !important;
  4166. }
  4167. .rala2 .el-radio__input.is-checked .el-radio__inner {
  4168. background: #fd7624 !important;
  4169. border-color: #fd7624 !important;
  4170. }
  4171. .rala3 .el-radio__input.is-checked + .el-radio__label {
  4172. color: #fd4d47 !important;
  4173. }
  4174. .rala3 .el-radio__input.is-checked .el-radio__inner {
  4175. background: #fd4d47 !important;
  4176. border-color: #fd4d47 !important;
  4177. }
  4178. /* 任务进展列表 */
  4179. .elCard {
  4180. width: 100%;
  4181. padding: 15px;
  4182. box-sizing: border-box;
  4183. border: 1px solid #EBEEF5;
  4184. }
  4185. .elCard_qu {
  4186. float: right;
  4187. margin-right: 15px;
  4188. }
  4189. .integrity {
  4190. padding: 15px;
  4191. overflow-y: auto;
  4192. max-height: 300px;
  4193. }
  4194. .write {
  4195. float: right;
  4196. color: #1B9AEE;
  4197. }
  4198. .ssp {
  4199. position: absolute;
  4200. right: 140px;
  4201. top: 95px;
  4202. width: 66%;
  4203. height: 80%;
  4204. }
  4205. .examine {
  4206. width: 100%;
  4207. text-align: center;
  4208. }
  4209. .nones {
  4210. width: 100%;
  4211. height: 50px;
  4212. text-align: center;
  4213. color: #909399;
  4214. line-height: 50px;
  4215. border-top: 1px solid #EBEEF5;
  4216. border-bottom: 1px solid #EBEEF5;
  4217. font-size: 16px;
  4218. }
  4219. .icon {
  4220. /* color: rgb(67, 209, 79); */
  4221. display: block;
  4222. width: 12px;
  4223. height: 12px;
  4224. background: #fff;
  4225. position: absolute;
  4226. top: 0;
  4227. left: -33px;
  4228. border-radius: 50%;
  4229. border: 4px solid;
  4230. }
  4231. /* ddl */
  4232. .ddl {
  4233. height: 136px;
  4234. overflow: hidden;
  4235. border: 1px solid #EBEEF5
  4236. }
  4237. .tb{
  4238. position: relative;
  4239. }
  4240. .dpl{
  4241. position: absolute;
  4242. font-size: 20px;
  4243. left: -32px;
  4244. top: 0px;
  4245. }
  4246. </style>