projectInside.vue 158 KB

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