projectInside.vue 177 KB

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