projectInside.vue 154 KB

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