projectInside.vue 156 KB

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