projectInside.vue 156 KB

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