projectInside.vue 154 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496
  1. <template>
  2. <section class="sectionaa">
  3. <el-tabs v-model="activeName" @tab-click="handleClick">
  4. <el-tab-pane label="主要内容" name="project" @click="null" disabled=true>
  5. <template slot="label">
  6. <i type="default" size="mini" class="el-icon-arrow-left" @click="toList" style="margin-left:10px;cursor:pointer;"></i>
  7. <el-select v-model="curProjectId" size="mini" class="projectCls" @change="onProjectChange">
  8. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  9. </el-select>
  10. <el-dropdown trigger="click" style="margin-right:30px;color:#262626;cursor:pointer;">
  11. <i class="iconfont firerock-iconcaidan" ></i>
  12. <el-dropdown-menu slot="dropdown">
  13. <el-dropdown-item v-if="currentProject.status == 1" @click.native="finishPro()">
  14. <i class="iconfont firerock-iconwancheng"></i>完成项目
  15. </el-dropdown-item>
  16. <el-dropdown-item divided v-if="currentProject.status == 1" @click.native="cancelPro()">
  17. <i class="el-icon-refresh-left"></i>撤销项目
  18. </el-dropdown-item>
  19. <el-dropdown-item v-if="currentProject.status == 2 || currentProject.status == 3" @click.native="startPro()">
  20. <i class="iconfont firerock-iconqidong"></i>重启项目
  21. </el-dropdown-item>
  22. </el-dropdown-menu>
  23. </el-dropdown>
  24. </template>
  25. </el-tab-pane>
  26. <el-tab-pane label="任务看板" name="projectInside">
  27. <el-container style="padding: 0px;">
  28. <el-aside :style="'overflow:auto;padding-left:10px;padding-right:5px;height:'+tableHeight+'px;width:'+groupWidth+'px;'">
  29. <el-input v-model="groupSearch" size="small" placeholder="搜索分组" @input="startSearchGroup" style="margin-top:10px"/>
  30. <p ><span class="heavyTxt">任务分组</span> <i class="el-icon-plus pull-right" style="color:#666;margin-right:10px;" @click="createGroup" v-if="projectCreatorId == user.id || projectInchargerId == user.id || permissions.projectManagement"></i></p>
  31. <el-menu :default-active="defaultGroupId" ref="defaultMenu" class="el-menu-vertical-demo" @select="groupChange" style="border-right:none;">
  32. <el-menu-item :index="item.id" v-for="item in groupList" :key="item.id" class="group_style">
  33. <div slot="title">
  34. <span >{{item.name}}</span>
  35. <!-- <el-button size="mini" @click="test(item)">test</el-button> -->
  36. <el-dropdown trigger="click" style="float:right;margin-right:-10px;" :disabled="!(user.id == item.inchargerId || user.id == projectCreatorId || user.id == projectInchargerId || permissions.projectManagement)">
  37. <i class="iconfont firerock-iconcaidan" ></i>
  38. <el-dropdown-menu slot="dropdown">
  39. <el-dropdown-item @click.native="copyGroup(item)" :disabled="!(projectCreatorId == user.id || projectInchargerId == user.id || permissions.projectManagement)">
  40. <i class="el-icon-document-copy"></i>
  41. 复制分组</el-dropdown-item>
  42. <el-dropdown-item divided @click.native="renameGroup(item)" :disabled="!(projectCreatorId == user.id || projectInchargerId == user.id || permissions.projectManagement)">
  43. <i class="el-icon-edit"></i>
  44. 修改组名</el-dropdown-item>
  45. <el-dropdown-item divided @click.native="addToTemplate(item)" :disabled="!(projectCreatorId == user.id || projectInchargerId == user.id || permissions.projectManagement)">
  46. <i class="el-icon-plus"></i>
  47. 设为模板</el-dropdown-item>
  48. <el-dropdown-item divided @click.native="editIncharger(item)"
  49. :disabled="!(projectCreatorId == user.id || projectInchargerId == user.id || permissions.projectManagement)">
  50. <i class="el-icon-user"></i>
  51. 设负责人</el-dropdown-item>
  52. <el-dropdown-item divided @click.native="setupParticipants(item)"
  53. :disabled="!(projectCreatorId == user.id || projectInchargerId == user.id || item.inchargerId == user.id || permissions.projectManagement)">
  54. <i class="iconfont firerock-iconusers"></i>
  55. 设参与人</el-dropdown-item>
  56. <el-dropdown-item divided @click.native="deleteGroup(item)" :disabled="!(projectCreatorId == user.id || projectInchargerId == user.id || permissions.projectManagement)">
  57. <i class="el-icon-delete"></i>
  58. 删除分组</el-dropdown-item>
  59. <!-- 设置参与人 0000 -->
  60. </el-dropdown-menu>
  61. </el-dropdown>
  62. </div>
  63. </el-menu-item>
  64. </el-menu>
  65. <!--视图 -->
  66. <p ><span class="heavyTxt">视图</span></p>
  67. <el-menu :default-active="1" class="el-menu-vertical-demo" @select="viewChange" style="border-right:none;">
  68. <el-menu-item :index="item.id" v-for="item in viewList" :key="item.id" class="group_style">
  69. <div slot="title">
  70. <span >{{item.name}}</span>
  71. </div>
  72. </el-menu-item>
  73. </el-menu>
  74. </el-aside>
  75. <span :style="'background:#f0f0f0;width:1px;height:'+tableHeight+'px;'" @click="toggleGroup">
  76. </span>
  77. <!-- <span :style="'width:10px;height:'+tableHeight+'px;float:left;text-align:center;vertical-align:middle;'" @click="toggleGroup">
  78. <span :style="'width:1px;background:#20A0FF;height:'+tableHeight+'px;float:left;'"></span>
  79. <i class="el-icon-d-arrow-left" ></i>
  80. </span> -->
  81. <!-- 增加侧边栏的点击效果 -->
  82. <div class="sidebar" @click="retract()">
  83. <div class="etui">
  84. <i class="el-icon-arrow-left" ref="box"></i>
  85. </div>
  86. </div>
  87. <!-- 增加侧边栏的点击效果 -->
  88. <el-main style="background:#f7f7f7;padding:0px;">
  89. <el-row style="color:#999;margin-top:10px;padding: 0px 10px;" :gutter="10">
  90. <el-col :span="16">
  91. <el-link @click="toggleGroup"><i v-if="selectedGroup != null" :class="groupWidth==0?'el-icon-d-arrow-right':'el-icon-d-arrow-left'" style="margin-top:10px;">{{selectedGroup.name}}</i></el-link>
  92. </el-col>
  93. <el-col :span="4">
  94. <el-select v-model="order" size="small" style="background:#fff;display:inline-block;" @change="orderChange">
  95. <el-option v-for="item in orderList" :key="item.id" :label="item.name" :value="item.id">
  96. <span>{{item.name}}</span>
  97. </el-option>
  98. </el-select>
  99. </el-col>
  100. <el-col :span="4">
  101. <el-button icon="iconfont firerock-icondaochu" size="mini" @click="showExportDialog">导出</el-button>
  102. <el-button icon="iconfont firerock-icondaoru" size="mini" @click="importTaskDialog = true;importToStageId = stageList[0].id;">导入</el-button>
  103. </el-col>
  104. </el-row>
  105. <!-- <div style="color:#999;margin-top:10px;">
  106. <i v-if="selectedGroup != null" class="el-icon-arrow-left" style="margin-top:10px;">{{selectedGroup.name}}</i>
  107. </div> -->
  108. <div v-if="!displayTable">
  109. <draggable style="white-space:nowrap;" @update="onMoveStage"
  110. v-model="stageList" group="stage" @start="stageDrag=true" @end="stageDrag=false;" draggable=".taskStage" >
  111. <!--每个阶段的拖拽 -->
  112. <!-- <transition-group > -->
  113. <v-flex class="taskStage" v-for="stage in stageList" :key="stage.id" :style="'height:'+stageListHeight+'px;'">
  114. <div :id="stage.id"
  115. class="taskList" >
  116. <!--头部显示阶段名称,操作 -->
  117. <div slot="header" style="margin:10px 0px;cursor:move;width:300px" role="task">
  118. <span class="stage">{{stage.stagesName}}</span><span style="margin-left:10px;color:#303133;font-size:12px;">{{stage.taskList.length}}</span>
  119. <!-- <i class="el-icon-more" style="float:right;"></i> -->
  120. <el-dropdown trigger="click" style="float:right;cursor:pointer;">
  121. <i class="el-icon-more" ></i>
  122. <el-dropdown-menu slot="dropdown">
  123. <el-dropdown-item @click.native="addTask(stage)">
  124. <i class="el-icon-document-add"></i>
  125. 创建任务</el-dropdown-item>
  126. <el-dropdown-item @click.native="renameStage(stage)">
  127. <i class="el-icon-edit"></i>
  128. 重命名列表</el-dropdown-item>
  129. <el-dropdown-item divided @click.native="deleteStage(stage)">
  130. <i class="el-icon-delete"></i>删除列表</el-dropdown-item>
  131. </el-dropdown-menu>
  132. </el-dropdown>
  133. </div>
  134. <draggable class="taskListin" :style="'max-height:' + taskListinH + 'px;'" @start="drag=true" @end="drag=false" draggable=".taskCard" ghostClass="ghost" @update="onChange" @add="onChange" group="task1" :id="stage.id">
  135. <div v-for="element in stage.taskList" :id="element.id" :key="element.id" class="taskCard" ref="tasks" @click="editTask(element)" :style="element.taskStatus==0?'':'background:#eFeFeF;'">
  136. <!--任务卡片内容显示 -->
  137. <div>
  138. <div v-if="element.taskLevel == 2" class="taskImg hong"><img src="../../assets/image/hong.png" alt=""></div>
  139. <div v-if="element.taskLevel == 1" class="taskImg huang"><img src="../../assets/image/huang.png" alt=""></div>
  140. <div v-if="element.taskLevel == 0" class="taskImg hui"><img src="../../assets/image/hui.png" alt=""></div>
  141. <el-checkbox :disabled="element.taskStatus==2 || element.subTaskList.length > element.subTaskFinishNum" :checked="element.taskStatus==1?true:false" size="large" class="cb"
  142. @change="finishTask(element)"
  143. @click.stop.native=""
  144. ></el-checkbox>
  145. <el-tooltip class="item" effect="dark" :content="element.name" placement="top">
  146. <label class="task_name" :style="'background:'+(element.taskStatus==0?'#ffffff;':'#eFeFeF;')"><span>{{element.name}}</span></label>
  147. </el-tooltip>
  148. <i :class="taskTypeIcon[element.taskType]" :style="'float:right;color:'+taskTypeColor[element.taskType]+';margin-right:8px;margin-top:8px;'" ></i>
  149. </div>
  150. <div style="margin: 10px 0px;color:#666;" @click="timess(element.endDate)">
  151. <span v-if="element.endDate >= times || element.taskStatus == 1"><i v-if="element.endDate != null" class="el-icon-date" style="margin-left:5px">&nbsp;&nbsp;{{element.endDate}}</i></span>
  152. <span v-else><em v-if="element.endDate != null" style="display: inline-block;padding:3px 5px"><i v-if="element.endDate != null" class="el-icon-date"><span class="element_span"> &nbsp;&nbsp;{{element.endDate}} 截止</span></i></em></span>
  153. <span v-if="element.executorName">
  154. <span v-for="(exeItem, exeIndex) in element.executorName.split(',')" :key="exeIndex" :style="'background:'+element.executorColor.split(',')[exeIndex]" class="user_name_icon">{{exeItem.length>2?exeItem.substring(exeItem.length-2, exeItem.length):exeItem}}</span>
  155. </span>
  156. <el-button v-if="!element.executorName" type="primary" @click.stop.native="addAsMyTask(element)" size="mini" style="float:right;width:38px;padding:5px;position: absolute;z-index: 5;right: 5px;">认领</el-button>
  157. </div>
  158. <!--子任务 -->
  159. <div v-if="element.subTaskList.length > 0" class="taskCardCircleBox">
  160. <el-progress type="circle" :percentage="(element.subTaskFinishNum/element.subTaskList.length) * 100" width="16" :show-text="false" stroke-linecap="butt" stroke-width="8"></el-progress><span style="margin-left:5px;font-size:12px;">{{element.subTaskFinishNum}}/{{element.subTaskList.length}}</span>
  161. </div>
  162. <!-- <div v-if="element.taskType == 1 && element.refTaskList != null">
  163. <el-tooltip class="item" effect="dark" content="查看关联任务" placement="top">
  164. <el-link class="sub_task_num" @click.stop.native="showSubTaskList(element)"><i class="iconfont firerock-icontree" ></i><span style="margin-left:5px;">{{element.finishRefTaskCount}}/{{element.refTaskList.length}}</span></el-link>
  165. </el-tooltip>
  166. </div> -->
  167. <div v-if="element.taskType == 1 && element.refTaskList != null" class="taskCardCircleBox">
  168. <el-progress type="circle" :percentage="(element.finishRefTaskCount/element.refTaskList.length) * 100" width="16" :show-text="false" stroke-linecap="butt" stroke-width="8"></el-progress>
  169. <span style="margin-left:5px;font-size:12px">{{element.finishRefTaskCount}}/{{element.refTaskList.length}}</span>
  170. </div>
  171. </div>
  172. </draggable>
  173. <el-button slot="footer" role="people" @click="addTask(stage)" style="width:300px;" size="small" icon="el-icon-plus"></el-button>
  174. </div>
  175. </v-flex>
  176. <!-- </transition-group > -->
  177. <el-button slot="footer" v-if="selectedGroup != null" @click="addStage" class="taskList" icon="el-icon-plus" style="margin-top:30px;">新建任务列表</el-button>
  178. </draggable>
  179. </div>
  180. <!--列表-->
  181. <el-table v-if="displayTable" :data="taskDataList"
  182. :header-cell-style="{'font-weight':'normal'}"
  183. highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;margin-top:10px;" @row-click="taskLineClick">
  184. <el-table-column fixed label="完成" width="50">
  185. <template slot-scope="scope">
  186. <el-checkbox :disabled="scope.row.taskStatus==2" v-model="scope.row.isFinish" size="large" class="cb"
  187. @change="finishTask(scope.row)"
  188. @click.stop.native=""
  189. ></el-checkbox>
  190. </template>
  191. </el-table-column>
  192. <el-table-column prop="name" fixed label="标题" width="250">
  193. <template slot-scope="scope">
  194. <el-tooltip class="item" effect="dark" :content="scope.row.name" placement="top">
  195. <span class="single_line" > {{scope.row.name}}</span>
  196. </el-tooltip>
  197. </template>
  198. </el-table-column>
  199. <el-table-column prop="taskType" label="任务类型" width="100">
  200. <template slot-scope="scope">
  201. {{taskTypeList[scope.row.taskType].name}}
  202. </template>
  203. </el-table-column>
  204. <el-table-column prop="taskStatus" label="任务状态" width="100" >
  205. <template slot-scope="scope">
  206. {{taskStatusList[scope.row.taskStatus]}}
  207. </template>
  208. </el-table-column>
  209. <el-table-column prop="parentName" label="父任务" width="250">
  210. <template slot-scope="scope">
  211. <span style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;"> {{scope.row.parentTname}}</span>
  212. </template>
  213. </el-table-column>
  214. <el-table-column prop="stagesName" label="任务列表" width="100" >
  215. </el-table-column>
  216. <el-table-column prop="executorName" label="执行人" width="100" >
  217. <template slot-scope="scope">
  218. {{scope.row.executorName == null?"待分配":scope.row.executorName}}
  219. </template>
  220. </el-table-column>
  221. <!-- <el-table-column prop="endDate" label="截止时间" width="100" ></el-table-column> -->
  222. <el-table-column prop="startDate" label="开始时间" width="100" >
  223. <template slot-scope="scope">
  224. <!-- <p v-if="scope.row.startDate >= times || scope.row.taskStatus != 0">{{scope.row.startDate}}</p>
  225. <p style="border-radius: 3px; text-align: center;background: #e62412; color: #fff;" v-else><span>{{scope.row.startDate}}</span></p> -->
  226. <p>{{scope.row.startDate}}</p>
  227. </template>
  228. </el-table-column>
  229. <el-table-column prop="endDate" label="截止时间" width="100" >
  230. <template slot-scope="scope">
  231. <p v-if="scope.row.endDate >= times || scope.row.taskStatus != 0">{{scope.row.endDate}}</p>
  232. <p style="border-radius: 3px; text-align: center;background: #e62412; color: #fff;" v-else><span>{{scope.row.endDate}}</span></p>
  233. </template>
  234. </el-table-column>
  235. <el-table-column prop="createDate" label="创建时间" width="100" ></el-table-column>
  236. <el-table-column prop="taskLevel" label="优先级" width="100" >
  237. <template slot-scope="scope">
  238. {{importanceList[scope.row.taskLevel].name}}
  239. </template>
  240. </el-table-column>
  241. </el-table>
  242. </el-main>
  243. </el-container>
  244. </el-tab-pane>
  245. <el-tab-pane label="文件中心" name="files"><FileCenter ref="fileCenter"></FileCenter></el-tab-pane>
  246. <el-tab-pane label="项目概览" name="info"><ProjectInfo ref="projectInfo" @basecost-change="changeBase"></ProjectInfo></el-tab-pane>
  247. <el-tab-pane label="数据统计" name="summary"><Summary ref="summary"></Summary></el-tab-pane>
  248. <el-tab-pane label="成本管理" name="costbaseline" v-if="permissions.projectBaseline"><CostBaseline ref="costbaseline"></CostBaseline></el-tab-pane>
  249. <el-tab-pane label="挣值分析" name="earning" v-if="user.id == currentProject.creator || user.id == currentProject.incharger_id ||permissions.projectBaseline"><Earning ref="earning"></Earning></el-tab-pane>
  250. </el-tabs>
  251. <!-- 设置参与人员界面 -->
  252. <el-dialog title="选择参与人员" v-if="participantsDialog" :visible.sync="participantsDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  253. <div class="tree" style="height:400px">
  254. <el-scrollbar style="height:100%">
  255. <el-input
  256. placeholder="输入关键字进行过滤"
  257. v-model="participantsFilterText">
  258. </el-input>
  259. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id"
  260. ref="chooseMembTree2" @check-change="onTreeItemChange" :default-checked-keys="alreadyPartArray"
  261. highlight-current :filter-node-method="filterNode" default-expand-all></el-tree>
  262. </el-scrollbar>
  263. </div>
  264. <div>已选中&nbsp;{{chosenMembCount}}&nbsp;人</div>
  265. <div slot="footer" class="dialog-footer">
  266. <el-button @click="participantsDialog = false">取消</el-button>
  267. <el-button type="primary" @click="setParticipants()">确定</el-button>
  268. </div>
  269. </el-dialog>
  270. <!--新增任务界面-->
  271. <el-dialog :class="addForm.id==null?'':'jm'" :title="title" v-if="addFormVisible" :visible.sync="addFormVisible"
  272. :close-on-click-modal="false" customClass="customWidth" width="800px" ref="addDialog">
  273. <!-- <div style="width: 200%;height:80%;position: absolute;right:-100%;top:0;background:#000;opacity: 0;" @click="sss"></div> -->
  274. <el-form ref="form1" :model="addForm" :rules="taskRules" label-width="100px">
  275. <!--子任务需要选择任务列表 -->
  276. <el-form-item label="任务列表" prop="stages" v-if="addForm.parentTid != null">
  277. <el-select v-model="addForm.stagesId" style="width:100%;" >
  278. <el-option v-for="item in stageList" :key="item.id" :label="item.stagesName" :value="item.id"></el-option>
  279. </el-select>
  280. </el-form-item>
  281. <el-form-item label="类型">
  282. <!-- <el-button @click="test">test</el-button> -->
  283. <!-- 0011 -->
  284. <el-select v-model="addForm.taskType" style="width:100%;" :disabled="this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id" @change="selchg()">
  285. <el-option v-for="item in taskTypeList" :key="item.id" :label="item.name" :value="item.id">
  286. <i :class="item.icon" ></i>
  287. <span>{{item.name}}</span>
  288. </el-option>
  289. </el-select>
  290. </el-form-item>
  291. <el-form-item label="任务内容" prop="name">
  292. <el-input v-model="addForm.name" :maxlength="40" :disabled="this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id" placeholder="请输入任务内容" clearable></el-input>
  293. </el-form-item>
  294. <el-form-item :label="!timelabel ? '开始时间' : '截至时间'" prop="startDate">
  295. <el-date-picker v-model="addForm.startDate" type="date" style="width:40%;" value-format="yyyy-MM-dd"
  296. placeholder="请选择日期" :disabled="this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id" @change="DateChange()" v-if="!timelabel"></el-date-picker>
  297. <span style="margin-left:30px;margin-right:10px;" v-if="!timelabel">截止时间</span>
  298. <el-date-picker 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" @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" @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" size="small" filterable 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" 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" 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)" 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)" 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. console.log(item);
  1045. this.participantsDialog = true
  1046. this.getAlreadyPartArray(item.id)
  1047. this.getDepartmentList()
  1048. },
  1049. // 获取用于设置参与人的列表
  1050. getDepartmentList(){
  1051. this.http.post('/department/listAllMemb',{
  1052. },res => {
  1053. if(res.code == 'ok'){
  1054. let list = res.data
  1055. this.haveUsersList(list)
  1056. this.deptMembData = JSON.parse(JSON.stringify(list))
  1057. console.log('123',this.deptMembData);
  1058. }else {
  1059. this.$message({
  1060. message: res.msg,
  1061. type: 'error'
  1062. })
  1063. }
  1064. },error => {
  1065. this.$message({
  1066. message: error,
  1067. type: 'error'
  1068. })
  1069. })
  1070. },haveUsersList(list){
  1071. for (var i in list) {
  1072. if (list[i].children != null) {
  1073. this.haveUsersList(list[i].children);
  1074. }
  1075. if (list[i].userList != null) {
  1076. if (list[i].children == null) {
  1077. list[i].children = [];
  1078. }
  1079. list[i].userList.forEach(element => {
  1080. var obj = {id: element.id, label:element.name, parentId:element.departmentId, isUser:1};
  1081. list[i].children.push(obj);
  1082. });
  1083. }
  1084. }
  1085. },
  1086. // 获取已参与人员
  1087. getAlreadyPartArray(eid){
  1088. this.http.post('/group-participator/get',{
  1089. groupId: eid
  1090. },res => {
  1091. if(res.code == 'ok'){
  1092. this.alreadyPartArray = res.data
  1093. this.chosenMembCount = res.data.length
  1094. // console.log('get',res.data, this.alreadyPartArray)
  1095. }else {
  1096. this.$message({
  1097. message: res.msg,
  1098. type: 'error'
  1099. })
  1100. }
  1101. },error => {
  1102. this.$message({
  1103. message: error,
  1104. type: 'error'
  1105. })
  1106. })
  1107. },
  1108. // 筛选逻辑
  1109. filterNode(value, data) {
  1110. if (!value) return true;
  1111. return data.label.indexOf(value) !== -1;
  1112. },
  1113. // 选中改变
  1114. onTreeItemChange() {
  1115. var chosenList = this.$refs.chooseMembTree2.getCheckedNodes();
  1116. var list = chosenList.filter(item=>item.isUser == 1);
  1117. this.chosenMembCount = list.length;
  1118. },
  1119. // 关联文件按钮
  1120. relationFileClick(){
  1121. this.relationFileDialog = true
  1122. this.addFileId = null
  1123. this.getProjectFileList()
  1124. },
  1125. // 确认关联文件
  1126. addTaskFile(){
  1127. if(this.addFileId == null){
  1128. this.$message({message: '请选择关联文件' , type: 'warning'})
  1129. return
  1130. }
  1131. this.http.post('/task-files/addDocumentRef',{
  1132. documentId: this.addFileId,
  1133. taskId: this.addForm.id,
  1134. projectId: this.curProjectId
  1135. },res => {
  1136. if(res.code == 'ok'){
  1137. this.$message({
  1138. message: '关联成功',
  1139. type: 'success'
  1140. })
  1141. this.relationFileDialog = false
  1142. this.getTaskFileList()
  1143. }else {
  1144. this.$message({
  1145. message: res.msg,
  1146. type: 'error'
  1147. })
  1148. }
  1149. },error => {
  1150. this.$message({
  1151. message: error,
  1152. type: 'error'
  1153. })
  1154. })
  1155. },
  1156. // 获取项目下的文档列表
  1157. getProjectFileList(){
  1158. this.http.post('/task-files/getDocumentList',{
  1159. projectId: this.curProjectId
  1160. },res => {
  1161. if(res.code == 'ok'){
  1162. this.projectFileList = res.data
  1163. console.log('list',res.data);
  1164. }else {
  1165. this.$message({
  1166. message: res.msg,
  1167. type: 'error'
  1168. })
  1169. }
  1170. },error => {
  1171. this.$message({
  1172. message: error,
  1173. type: 'error'
  1174. })
  1175. })
  1176. },
  1177. // 获取任务下的文档列表
  1178. getTaskFileList(e,eid){
  1179. let etaskId
  1180. if(e == 1){etaskId = eid}
  1181. else{etaskId = this.addForm.id}
  1182. this.fileListLoading = true
  1183. this.http.post('/task-files/getTaskFiles',{
  1184. taskId: etaskId
  1185. },res => {
  1186. if(res.code == 'ok'){
  1187. this.fileListLoading = false
  1188. this.taskFileList = res.data
  1189. console.log('taskFileList',res.data);
  1190. }else {
  1191. this.fileListLoading = false
  1192. this.$message({
  1193. message: res.msg,
  1194. type: 'error'
  1195. })
  1196. }
  1197. },error => {
  1198. this.fileListLoading = false
  1199. this.$message({
  1200. message: error,
  1201. type: 'error'
  1202. })
  1203. })
  1204. },
  1205. // 列表的删除按钮
  1206. taskFileDelete(eid){
  1207. this.$confirm('是否确定取消关联此文件?', '提示', {
  1208. confirmButtonText: '确定',
  1209. cancelButtonText: '取消',
  1210. type: 'warning'
  1211. }).then(()=>{
  1212. this.http.post('/task-files/delete',{
  1213. id: eid
  1214. },res => {
  1215. if(res.code == 'ok'){
  1216. this.$message({
  1217. message: res.data,
  1218. type: 'success'
  1219. })
  1220. this.getTaskFileList()
  1221. }else {
  1222. this.$message({
  1223. message: res.msg,
  1224. type: 'error'
  1225. })
  1226. }
  1227. },error => {
  1228. this.$message({
  1229. message: error,
  1230. type: 'error'
  1231. })
  1232. })
  1233. }).catch(()=>{
  1234. this.$message({
  1235. message: '已取消删除',
  1236. type: 'info'
  1237. })
  1238. })
  1239. },
  1240. // 列表的上传按钮
  1241. uploadFileClick(item){
  1242. console.log("upload",item.file);
  1243. let files = new FormData()
  1244. files.append("projectId",this.curProjectId);
  1245. files.append("taskId", this.addForm.id);
  1246. files.append("file", item.file);
  1247. this.http.uploadFile('/task-files/uploadFile',files,
  1248. res => {
  1249. if(res.code == 'ok'){
  1250. console.log(res);
  1251. this.$message({
  1252. message: '已上传',
  1253. type: 'success'
  1254. })
  1255. this.getTaskFileList()
  1256. }else {
  1257. this.$message({
  1258. message: res.msg,
  1259. type: 'error'
  1260. })
  1261. }
  1262. },error => {
  1263. this.$message({
  1264. message: error,
  1265. type: 'error'
  1266. })
  1267. })
  1268. },
  1269. selchg(){ //类型切换
  1270. if(this.addForm.taskType == 1){
  1271. this.timelabel = true
  1272. }else{
  1273. this.timelabel = false
  1274. }
  1275. },
  1276. addRelation(){ //关联任务卡片
  1277. this.relationvalue = []
  1278. this.isRelationTab = true
  1279. this.getrelation()
  1280. },
  1281. addRelationTask(){ //添加关联任务
  1282. this.http.post('/task/addMileStoneTask',{
  1283. milestoneId: this.addForm.id,
  1284. taskIds: JSON.stringify(this.relationvalue)
  1285. },
  1286. res =>{
  1287. if(res.code == "ok") {
  1288. this.isRelationTab = false
  1289. this.$message({
  1290. message: '添加成功',
  1291. type: 'success'
  1292. })
  1293. this.getRelationTaskList()
  1294. this.$forceUpdate()
  1295. }else {
  1296. this.$message({
  1297. message: res.msg,
  1298. type: 'error'
  1299. })
  1300. }
  1301. },
  1302. error => {
  1303. this.$message({
  1304. message: error,
  1305. type: 'error'
  1306. })
  1307. })
  1308. },
  1309. getRelationTaskList(i,e){ //获取关联任务列表
  1310. let eid = null
  1311. if(i){
  1312. eid = e
  1313. }else{
  1314. eid = this.addForm.id
  1315. }
  1316. this.http.post('/task/getMilestoneTaskList',{
  1317. milestoneId: eid
  1318. },res => {
  1319. if(res.code == 'ok') {
  1320. this.relationSubTaskList = res.data
  1321. // console.log('res',res.data);
  1322. }else {
  1323. this.$message({
  1324. message: res.msg,
  1325. type: 'error'
  1326. })
  1327. }
  1328. },error => {
  1329. this.$message({
  1330. message: error,
  1331. type: 'error'
  1332. })
  1333. })
  1334. },
  1335. getrelation(){ //获取选择关联列表
  1336. this.http.post('/task/getTaskOnlyList',{
  1337. projectId: this.curProjectId
  1338. },
  1339. res => {
  1340. if (res.code == "ok") {
  1341. this.relationdata = []
  1342. res.data.forEach( (item) =>{
  1343. if(item.taskType != 1){
  1344. this.relationdata.push(item)
  1345. }
  1346. })
  1347. // console.log('map',this.relationdata);
  1348. } else {
  1349. this.$message({
  1350. message: res.msg,
  1351. type: "error"
  1352. });
  1353. }
  1354. },
  1355. error => {
  1356. this.$message({
  1357. message: error,
  1358. type: "error"
  1359. });
  1360. });
  1361. },
  1362. // 里程碑关联任务列表
  1363. // 解除关联
  1364. deleteRelationItem(eid){
  1365. this.listLoading = true
  1366. this.http.post('/task/removeMileStoneTask',{
  1367. id: eid
  1368. },res => {
  1369. if(res.code == 'ok') {
  1370. this.getRelationTaskList()
  1371. this.listLoading = false
  1372. this.$message({
  1373. message: '解除成功',
  1374. type: 'success'
  1375. })
  1376. }else {
  1377. this.listLoading = false
  1378. this.$message({
  1379. message: res.msg,
  1380. type: 'error'
  1381. })
  1382. }
  1383. },error => {
  1384. this.listLoading = false
  1385. this.$message({
  1386. message: error,
  1387. type: 'error'
  1388. })
  1389. })
  1390. },
  1391. // 关联任务列表是否完成修改
  1392. relationFinishTask(row){
  1393. this.http.post('/task/finish',{
  1394. id: row.taskId,
  1395. taskStatus: row.taskStatus
  1396. },res => {
  1397. if(res.code == 'ok'){
  1398. if(this.groupType == 0){
  1399. this.getStageList();
  1400. }else {
  1401. this.getViewTaskList();
  1402. }
  1403. }else{
  1404. this.$message({
  1405. message: res.msg,
  1406. type: 'error'
  1407. })
  1408. }
  1409. },error => {
  1410. this.$message({
  1411. message: error,
  1412. type: 'error'
  1413. })
  1414. })
  1415. },
  1416. //保存分组负责人
  1417. saveGroupIncharger() {
  1418. this.http.post('/task-group/saveGroupIncharger', {id: this.groupForm.id, inchargerId: this.groupForm.inchargerId},
  1419. res => {
  1420. this.setInchargerDialog = false;
  1421. if (res.code == "ok") {
  1422. this.$message({
  1423. message: '设置成功',
  1424. type: "success"
  1425. });
  1426. //更新原始分组数据
  1427. this.groupList.filter(g=>g.id == this.groupForm.id)[0].inchargerId = this.groupForm.inchargerId;
  1428. } else {
  1429. this.$message({
  1430. message: res.msg,
  1431. type: "error"
  1432. });
  1433. }
  1434. }
  1435. );
  1436. },
  1437. //删除模板
  1438. deleteTemplate(t) {
  1439. var that = this;
  1440. this.$confirm("确认要删除["+t.name+"]吗?", "提示", {
  1441. //type: 'warning'
  1442. }).then(() => {
  1443. this.http.post('/group-template/deleteTemplate', {id: t.id},
  1444. res => {
  1445. if (res.code == "ok") {
  1446. this.getGroupTemplate();
  1447. this.$message({
  1448. message: '删除模板成功',
  1449. type: "success"
  1450. });
  1451. } else {
  1452. this.$message({
  1453. message: res.msg,
  1454. type: "error"
  1455. });
  1456. }
  1457. }
  1458. );
  1459. });
  1460. },
  1461. //创建模板
  1462. createTemplate() {
  1463. this.saveTemplateLoading = true;
  1464. this.http.post('/group-template/addTemplate', this.templateForm,
  1465. res => {
  1466. this.saveTemplateLoading = false;
  1467. if (res.code == "ok") {
  1468. this.addToTmpDialog = false;
  1469. this.getGroupTemplate();
  1470. this.$message({
  1471. message: '添加模板成功',
  1472. type: "success"
  1473. });
  1474. } else {
  1475. this.$message({
  1476. message: res.msg,
  1477. type: "error"
  1478. });
  1479. }
  1480. }
  1481. );
  1482. },
  1483. addToTemplate(item) {
  1484. this.addToTmpDialog = true;
  1485. this.templateForm = {groupId: item.id, name:item.name, saveTask:false, saveMileStone:false, saveRisk:false};
  1486. },
  1487. changeBase() {
  1488. this.$refs.earning.refreshPage();
  1489. },
  1490. // 批量导入人员
  1491. importTask(item) {
  1492. //首先判断文件类型
  1493. this.loadingExport = true
  1494. let str = item.file.name.split(".");
  1495. let format = str[str.length - 1];
  1496. if (format != "xls" && format != "xlsx") {
  1497. this.loadingExport = false
  1498. this.$message({
  1499. message: "请选择.xls或.xlsx文件",
  1500. type: "error"
  1501. });
  1502. } else {
  1503. this.listLoading = true;
  1504. let formData = new FormData();
  1505. formData.append("file", item.file);
  1506. formData.append("projectId", this.curProjectId);
  1507. formData.append("groupId", this.selectedGroup.id);
  1508. formData.append("stagesId", this.importToStageId);
  1509. this.http.uploadFile('/task/importTask', formData,
  1510. res => {
  1511. this.$refs.upload.clearFiles();
  1512. this.listLoading = false;
  1513. this.loadingExport = false
  1514. if (res.code == "ok") {
  1515. this.$message({
  1516. message: "导入成功",
  1517. type: "success"
  1518. });
  1519. //重新读取列表
  1520. this.getStageList();
  1521. this.importTaskDialog = false;
  1522. } else {
  1523. this.$message({
  1524. message: res.msg,
  1525. type: "error"
  1526. });
  1527. }
  1528. },
  1529. error => {
  1530. this.$refs.upload.clearFiles();
  1531. this.listLoading = false;
  1532. this.loadingExport = false
  1533. this.$message({
  1534. message: error,
  1535. type: "error"
  1536. });
  1537. });
  1538. }
  1539. },
  1540. //删除任务进展
  1541. deleteTaskProgress(id) {
  1542. this.http.post('/task-progress/deleteProgress', {id: id},
  1543. res => {
  1544. if (res.code == "ok") {
  1545. this.getTaskProgressList(this.taskIid)
  1546. this.$message({
  1547. message: '删除成功',
  1548. type: "success"
  1549. });
  1550. } else {
  1551. this.$message({
  1552. message: res.msg,
  1553. type: "error"
  1554. });
  1555. }
  1556. }
  1557. );
  1558. },
  1559. //创建任务进展
  1560. addTaskProgress() {
  1561. var param = {
  1562. taskId: this.taskIid,
  1563. status: this.radio,
  1564. content: this.text2,
  1565. participatorIds: this.checkLists.toString()
  1566. };
  1567. this.http.post('/task-progress/addProgress', param,
  1568. res => {
  1569. if (res.code == "ok") {
  1570. this.shutPro()
  1571. this.getTaskProgressList(this.taskIid)
  1572. this.$message({
  1573. message: '发布成功',
  1574. type: "success"
  1575. });
  1576. this.checkboxGrounp = [],
  1577. this.checkLists = [],
  1578. this.text2 = '',
  1579. this.radio = 0
  1580. } else {
  1581. this.$message({
  1582. message: res.msg,
  1583. type: "error"
  1584. });
  1585. }
  1586. }
  1587. );
  1588. },
  1589. //获取任务进展列表
  1590. getTaskProgressList(taskId) {
  1591. this.taskIid = taskId
  1592. this.http.post('/task-progress/list', {taskId: taskId},
  1593. res => {
  1594. if (res.code == "ok") {
  1595. this.ProgressList = res.data;
  1596. this.recentProgressInfo = res.data[0]
  1597. } else {
  1598. this.$message({
  1599. message: res.msg,
  1600. type: "error"
  1601. });
  1602. }
  1603. }
  1604. );
  1605. },
  1606. kkk(el){
  1607. var k = this.checkLists.indexOf(el.id)
  1608. if (k == -1) {
  1609. this.checkLists.push(el.id)
  1610. } else {
  1611. this.checkLists.splice(k, 1)
  1612. }
  1613. },
  1614. showExportDialog() {
  1615. this.exportDialog = true;
  1616. },
  1617. exportTask() {
  1618. let _this = this;
  1619. this.loadingExport = true
  1620. this.http.post('/task/exportTask', {projectId: this.curProjectId, taskType: this.exportTaskType},
  1621. res => {
  1622. this.loadingExport = false
  1623. if (res.code == "ok") {
  1624. location.href = res.data;
  1625. } else {
  1626. this.$message({
  1627. message: res.msg,
  1628. type: "error"
  1629. });
  1630. }
  1631. }
  1632. );
  1633. },
  1634. sss(){
  1635. this.$refs.addRem.style.display="none"
  1636. },
  1637. addprogress(){ // 添加子任务进展事件
  1638. this.$refs.proBox.style.display="block"
  1639. this.$refs.addPro.style.display="none"
  1640. },
  1641. shutPro() { // 关闭任务进展
  1642. this.$refs.addPro.style.display="block"
  1643. this.$refs.addRem.style.display="none"
  1644. this.$refs.proBox.style.display="none"
  1645. },
  1646. addI() { // 打开选择查看
  1647. this.$refs.addRem.style.display="block"
  1648. },
  1649. load() {
  1650. if(this.count >= 0) return
  1651. this.count += 2
  1652. },
  1653. onEditorFocus() {
  1654. this.onEditorBlur()
  1655. },
  1656. subMission() { // 添加
  1657. },
  1658. handleCheckedCitiesChange(value) {
  1659. let checkedCount = value.length;
  1660. this.checkAll = checkedCount === this.cities.length;
  1661. this.isIndeterminate = checkedCount > 0 && checkedCount < this.cities.length;
  1662. },
  1663. // 获得焦点时触发
  1664. onEditorBlur(){
  1665. let theEle = this.$refs.text; // 获取元素
  1666. var img = theEle.value.match(/<img[^>]+>/g); // 赛选 img 标签
  1667. var arrImg = ''
  1668. for (var j = 0; j < img.length; j++) {
  1669. // 正则匹配,摘出img标签下的src里的内容,即capture
  1670. img[j].replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, function(match, capture) {
  1671. arrImg += capture
  1672. });
  1673. }
  1674. // 原来的字符流大小,单位为字节
  1675. var strLen = arrImg.length;
  1676. // 计算后得到的文件流大小,单位为字节
  1677. var fileSize=parseInt(strLen-(strLen/8)*2);
  1678. var size = "";
  1679. size = (fileSize/1024/1024).toFixed(2);
  1680. if (size > 2){
  1681. this.textContent = false
  1682. this.$message({
  1683. showClose: true,
  1684. message: '图片超过了2MB,请重新上传',
  1685. type: 'warning'
  1686. });
  1687. }
  1688. this.textContent = true
  1689. },
  1690. // 侧边栏的点击事件
  1691. retract() {
  1692. if (this.$refs.box.className == 'el-icon-arrow-left') {
  1693. this.$refs.box.className = 'el-icon-arrow-right'
  1694. } else {
  1695. this.$refs.box.className = 'el-icon-arrow-left'
  1696. }
  1697. // this.$refs.box.className === 'el-icon-arrow-left' ? this.$refs.box.className = 'el-icon-arrow-right' || this.$refs.box.className = 'el-icon-arrow-left'
  1698. this.toggleGroup()
  1699. },
  1700. //
  1701. choseTemplate(tIndex) {
  1702. // this.groupTemplateList.forEach((g)=>{
  1703. // g.selected = false;
  1704. // })
  1705. this.sidebarIndex = tIndex
  1706. // this.groupTemplateList[tIndex].selected = true;
  1707. this.groupTemplateList.forEach((g, i)=>{
  1708. if(tIndex == i) {
  1709. g.selected = !g.selected;
  1710. }
  1711. })
  1712. },
  1713. //获取分组模板列表
  1714. getGroupTemplate() {
  1715. this.http.post('/group-template/getList',{},
  1716. res => {
  1717. if (res.code == "ok") {
  1718. this.groupTemplateList = res.data;
  1719. this.groupTemplateList[0].selected = true;
  1720. } else {
  1721. this.$message({
  1722. message: res.msg,
  1723. type: "error"
  1724. });
  1725. }
  1726. },
  1727. error => {
  1728. this.$message({
  1729. message: error,
  1730. type: "error"
  1731. });
  1732. });
  1733. },
  1734. copyGroup(item) {
  1735. this.http.post('/task-group/copy',{id: item.id},
  1736. res => {
  1737. if (res.code == "ok") {
  1738. this.getTaskGroups();
  1739. } else {
  1740. this.$message({
  1741. message: res.msg,
  1742. type: "error"
  1743. });
  1744. }
  1745. },
  1746. error => {
  1747. this.$message({
  1748. message: error,
  1749. type: "error"
  1750. });
  1751. });
  1752. },
  1753. //重启项目
  1754. startPro() {
  1755. this.http.post('/project/start',{id: this.curProjectId},
  1756. res => {
  1757. if (res.code == "ok") {
  1758. this.$message({
  1759. message: '重启成功',
  1760. type: "success"
  1761. });
  1762. this.currentProject.status = 1;
  1763. } else {
  1764. this.$message({
  1765. message: res.msg,
  1766. type: "error"
  1767. });
  1768. }
  1769. },
  1770. error => {
  1771. this.$message({
  1772. message: error,
  1773. type: "error"
  1774. });
  1775. });
  1776. },
  1777. //撤销项目
  1778. cancelPro() {
  1779. this.http.post('/project/cancel',{id: this.curProjectId},
  1780. res => {
  1781. if (res.code == "ok") {
  1782. this.$message({
  1783. message: '撤销成功',
  1784. type: "success"
  1785. });
  1786. this.currentProject.status = 3;
  1787. } else {
  1788. this.$message({
  1789. message: res.msg,
  1790. type: "error"
  1791. });
  1792. }
  1793. },
  1794. error => {
  1795. this.$message({
  1796. message: error,
  1797. type: "error"
  1798. });
  1799. });
  1800. },
  1801. //完成项目
  1802. finishPro() {
  1803. this.http.post('/project/finish',{id: this.curProjectId},
  1804. res => {
  1805. if (res.code == "ok") {
  1806. this.$message({
  1807. message: '项目完成',
  1808. type: "success"
  1809. });
  1810. this.currentProject.status = 2;
  1811. } else {
  1812. this.$message({
  1813. message: res.msg,
  1814. type: "error"
  1815. });
  1816. }
  1817. },
  1818. error => {
  1819. this.$message({
  1820. message: error,
  1821. type: "error"
  1822. });
  1823. });
  1824. },
  1825. //删除当前编辑的任务
  1826. deleteTask() {
  1827. var warning='';
  1828. if (this.addForm.subTaskList.length > 0) {
  1829. warning='您确定要删除当前任务及其子任务吗?';
  1830. } else {
  1831. warning='您确定要删除当前任务吗?';
  1832. }
  1833. this.$confirm(warning, "提示", {
  1834. //type: 'warning'
  1835. }).then(() => {
  1836. this.http.post('/task/delete',{id: this.addForm.id},
  1837. res => {
  1838. if (res.code == "ok") {
  1839. this.addFormVisible = false;
  1840. this.getStageList();
  1841. } else {
  1842. this.$message({
  1843. message: res.msg,
  1844. type: "error"
  1845. });
  1846. }
  1847. },
  1848. error => {
  1849. this.$message({
  1850. message: error,
  1851. type: "error"
  1852. });
  1853. });
  1854. });
  1855. },
  1856. //tab页签切换
  1857. handleClick(tab, event) {
  1858. let pathModel = tab.name;
  1859. this.$router.push('/'+pathModel+'/'+this.curProjectId);
  1860. },
  1861. showSubTaskList(task) {
  1862. this.subTaskVisible = true;
  1863. this.addForm = task;
  1864. // console.log('click',task.subTaskList);
  1865. },
  1866. backToParentTask() {
  1867. // this.getTaskDetail(this.addForm.parentTid);
  1868. this.getTaskDetail(this.timelabel ? this.relationPar.id : this.addForm.parentTid);
  1869. if(this.timelabel){
  1870. this.isRelationItem = false
  1871. // this.relationPar = {name: ''}
  1872. this.getRelationTaskList(1, this.relationPar.id)
  1873. this.gain(this.relationPar)
  1874. }
  1875. },
  1876. //显示子任务创建卡片
  1877. addSubTask() {
  1878. if(this.isRelationItem){return}
  1879. this.addFormVisible = true;
  1880. this.addForm = {parentTname: this.addForm.name,parentTid: this.addForm.id,projectId: this.addForm.projectId, groupId: this.addForm.groupId, taskLevel:0, planHours: 8, taskType: 0};
  1881. this.addForm.executorListFront = [{executorId:null, planHours:8}];
  1882. this.addLoading = false;
  1883. },
  1884. //认领任务
  1885. addAsMyTask(task) {
  1886. this.http.post('/task/addAsMyTask',{id: task.id},
  1887. res => {
  1888. if (res.code == "ok") {
  1889. this.getStageList();
  1890. } else {
  1891. this.$message({
  1892. message: res.msg,
  1893. type: "error"
  1894. });
  1895. }
  1896. },
  1897. error => {
  1898. this.$message({
  1899. message: error,
  1900. type: "error"
  1901. });
  1902. });
  1903. },
  1904. taskLineClick(row, column, event) {
  1905. if(this.isRelationItem){return}
  1906. this.editTask(row);
  1907. },
  1908. //排序发生改变
  1909. orderChange() {
  1910. this.isDesc = this.orderList.filter(o=>o.id == this.order)[0].isDesc;
  1911. if (this.groupType == 0) {
  1912. this.getStageList();
  1913. } else {
  1914. this.getViewTaskList();
  1915. }
  1916. },
  1917. //加载视图任务列表
  1918. getViewTaskList() {
  1919. this.http.post('/task/list',{projectId: this.curProjectId, viewId: this.selectedGroup.id, order: this.order, isDesc: this.isDesc},
  1920. res => {
  1921. if (res.code == "ok") {
  1922. this.taskDataList = res.data;
  1923. this.taskDataList.forEach(t=>{
  1924. t.isFinish = t.taskStatus==1?true:false;
  1925. });
  1926. } else {
  1927. this.$message({
  1928. message: res.msg,
  1929. type: "error"
  1930. });
  1931. }
  1932. },
  1933. error => {
  1934. this.$message({
  1935. message: error,
  1936. type: "error"
  1937. });
  1938. });
  1939. },
  1940. //阶段拖拽
  1941. onMoveStage(e) {
  1942. var data = {
  1943. groupId:this.selectedGroup.id,
  1944. oldIndex: e.oldIndex,
  1945. newIndex: e.newIndex,};
  1946. this.http.post('/stages/changeStageOrder',data,
  1947. res => {
  1948. if (res.code == "ok") {
  1949. this.getStageList();
  1950. } else {
  1951. this.$message({
  1952. message: res.msg,
  1953. type: "error"
  1954. });
  1955. }
  1956. },
  1957. error => {
  1958. this.$message({
  1959. message: error,
  1960. type: "error"
  1961. });
  1962. });
  1963. },
  1964. onChange(e) {
  1965. var data = {
  1966. id:e.item.id,
  1967. oldIndex: e.oldIndex ,
  1968. newIndex: e.newIndex ,
  1969. oldStagesId: e.from.id,
  1970. newStagesId: e.to.id};
  1971. this.http.post('/task/changeOrder',data,
  1972. res => {
  1973. if (res.code == "ok") {
  1974. this.getStageList();
  1975. } else {
  1976. this.$message({
  1977. message: res.msg,
  1978. type: "error"
  1979. });
  1980. }
  1981. },
  1982. error => {
  1983. this.$message({
  1984. message: error,
  1985. type: "error"
  1986. });
  1987. });
  1988. },
  1989. toggleGroup() {
  1990. if (this.groupWidth == 0) {
  1991. this.groupWidth = 260;
  1992. } else {
  1993. this.groupWidth = 0;
  1994. }
  1995. },
  1996. finishTask(task) {
  1997. this.http.post('/task/finish',{id: task.id, taskStatus: task.taskStatus},
  1998. res => {
  1999. if (res.code == "ok") {
  2000. if (this.groupType == 0) {
  2001. this.getStageList();
  2002. } else {
  2003. this.getViewTaskList();
  2004. }
  2005. } else {
  2006. this.$message({
  2007. message: res.msg,
  2008. type: "error"
  2009. });
  2010. }
  2011. },
  2012. error => {
  2013. this.$message({
  2014. message: error,
  2015. type: "error"
  2016. });
  2017. });
  2018. },
  2019. // 点击卡片事件
  2020. editTask(task) {
  2021. this.mileageCup = true
  2022. // console.log('editTask',task)
  2023. if(task.taskType == 1){
  2024. this.timelabel = true
  2025. this.isRelationItem = false
  2026. }else{
  2027. this.timelabel = false
  2028. }
  2029. this.addFormVisible = true;
  2030. this.isEditFile = true;
  2031. this.addLoading = false;
  2032. this.title = "编辑任务";
  2033. this.getTaskDetail(task.id);
  2034. this.getTaskProgressList(task.id); // 获取任务进展列表
  2035. this.getUsers(); // 获取名单数据
  2036. this.gain(task); // 获取评论列表
  2037. this.getRelationTaskList(1, task.id)
  2038. this.getTaskFileList(1,task.id)
  2039. },
  2040. // 关联任务点击事件
  2041. relationTaskClick(row,column,event){
  2042. // console.log('relationTaskClick',row);
  2043. this.relationPar = JSON.parse(JSON.stringify(this.addForm))
  2044. // console.log(this.relationPar);
  2045. this.addFormVisible = true;
  2046. this.addLoading = false;
  2047. this.isRelationItem = true;
  2048. this.isEditFile = true;
  2049. this.title = "编辑任务";
  2050. this.getTaskDetail(row.taskId);
  2051. this.getUsers();
  2052. this.gain(row,1);
  2053. this.getRelationTaskList(1, row.taskId)
  2054. this.getTaskFileList(1,row.taskId)
  2055. },
  2056. // 获取评论列表
  2057. gain (task,e) {
  2058. this.commentList = [];
  2059. this.taskId = e == 1 ? task.taskId : task.id;
  2060. this.http.post('/task-comment/getList', {taskId: e == 1 ? task.taskId : task.id},
  2061. res => {
  2062. if (res.code == "ok") {
  2063. this.commentList = res.data
  2064. this.sppk(this.commentList) // 获取参与人的方法
  2065. } else {
  2066. this.$message({
  2067. message: res.msg,
  2068. type: "error"
  2069. });
  2070. }
  2071. },
  2072. error => {
  2073. this.$message({
  2074. message: error,
  2075. type: "error"
  2076. });
  2077. });
  2078. },
  2079. // 获取评论参与人
  2080. sppk(comit) {
  2081. var sk = []
  2082. comit.forEach(function(e){
  2083. sk.push(e.userName)
  2084. })
  2085. this.critic = new Set(sk)
  2086. },
  2087. // 点击发布
  2088. release() {
  2089. if(this.textarea2.length <= 0) return this.$message({message: "请输入内容", type: "error"})
  2090. this.http.post('/task-comment/add', {taskId: this.taskId, userId: this.user.id, content: this.textarea2},
  2091. res => {
  2092. if(res.code == "ok"){
  2093. this.commentList.push(res.data)
  2094. this.sppk(this.commentList)
  2095. this.textarea2 = ""
  2096. this.contRoll() // 滚动到底部
  2097. } else {
  2098. this.$message({
  2099. message: res.msg,
  2100. type: "error"
  2101. });
  2102. }
  2103. },
  2104. error => {
  2105. this.$message({
  2106. message: error,
  2107. type: "error"
  2108. });
  2109. })
  2110. },
  2111. // 滚动到底部
  2112. contRoll(){
  2113. this.$nextTick(() => {
  2114. this.$refs.main.scrollTop = this.$refs.contRoll.scrollHeight;
  2115. })
  2116. },
  2117. chggstim(e,i){
  2118. if(e){
  2119. this.gstimday[i] = Math.ceil(this.gstimhour[i] / this.user.timeType.allday)
  2120. }else{
  2121. this.gstimhour[i] = this.gstimday[i] * this.user.timeType.allday
  2122. }
  2123. },
  2124. getTaskDetail(id) {
  2125. this.http.post('/task/getTask',{id: id},
  2126. res => {
  2127. if (res.code == "ok") {
  2128. this.addForm = res.data;
  2129. this.addForm.createDate = null;
  2130. this.addForm.indate = null;
  2131. this.addLoading = false;
  2132. this.recentProgressInfo = this.addForm.progress;
  2133. this.addForm.executorListFront = this.addForm.executorList;
  2134. this.gstimday = []
  2135. this.gstimhour = []
  2136. for(let i=0;i<this.addForm.executorListFront.length;i++){
  2137. this.gstimhour.push(this.addForm.executorListFront[i].planHours),
  2138. this.gstimday.push(Math.ceil(this.addForm.executorListFront[i].planHours / this.user.timeType.allday))
  2139. }
  2140. //删除中间传值的变量数组
  2141. delete this.addForm.executorList;
  2142. } else {
  2143. this.$message({
  2144. message: res.msg,
  2145. type: "error"
  2146. });
  2147. }
  2148. },
  2149. error => {
  2150. this.$message({
  2151. message: error,
  2152. type: "error"
  2153. });
  2154. });
  2155. },
  2156. addTask(stage) {
  2157. this.mileageCup = false
  2158. this.addFormVisible = true;
  2159. this.addForm = {projectId: stage.projectId, groupId: stage.groupId, stagesId: stage.id, taskLevel:0, planHours: 8, taskType: 0};
  2160. this.addForm.executorListFront = [{executorId:null, planHours:this.user.timeType.allday}];
  2161. this.gstimhour = [this.user.timeType.allday]
  2162. this.gstimday = [1]
  2163. this.addLoading = false;
  2164. this.isEditFile = false;
  2165. this.title="创建任务";
  2166. this.commentList = [];
  2167. },
  2168. addExecutorLine(e) {
  2169. if(e == 1){
  2170. if (this.relationItemData.executorList == null) {
  2171. this.relationItemData.executorList = [];//初始化
  2172. }
  2173. this.relationItemData.executorList.push({executorId:null, planHours:this.user.timeType.allday});
  2174. this.gstimday.push(1)
  2175. this.gstimhour.push(this.user.timeType.allday)
  2176. this.$forceUpdate();
  2177. }else{
  2178. if (this.addForm.executorListFront == null) {
  2179. this.addForm.executorListFront = [];//初始化
  2180. }
  2181. this.addForm.executorListFront.push({executorId:null, planHours:this.user.timeType.allday});
  2182. this.gstimday.push(1)
  2183. this.gstimhour.push(this.user.timeType.allday)
  2184. this.$forceUpdate();
  2185. }
  2186. },
  2187. removeExecutorLine(index,e) {
  2188. if(e == 1){
  2189. this.relationItemData.executorList.splice(index,1);
  2190. this.gstimday.splice(index,1)
  2191. this.gstimhour.splice(index,1)
  2192. this.$forceUpdate();
  2193. }else{
  2194. this.addForm.executorListFront.splice(index,1);
  2195. this.gstimday.splice(index,1)
  2196. this.gstimhour.splice(index,1)
  2197. this.$forceUpdate();
  2198. }
  2199. },
  2200. renameStage(item) {
  2201. this.stageForm = JSON.parse(JSON.stringify(item));
  2202. this.addStageDialog = true;
  2203. },
  2204. deleteStage(item) {
  2205. var _this = this;
  2206. var param = {id:item.id, groupId: item.groupId};
  2207. this.$confirm("确认删除吗?", "提示", {
  2208. //type: 'warning'
  2209. }).then(() => {
  2210. this.http.post('/stages/delete',param,
  2211. res => {
  2212. if (res.code == "ok") {
  2213. // this.stageList = res.data;
  2214. this.getStageList();
  2215. } else {
  2216. this.$message({
  2217. message: res.msg,
  2218. type: "error"
  2219. });
  2220. }
  2221. },
  2222. error => {
  2223. this.$message({
  2224. message: error,
  2225. type: "error"
  2226. });
  2227. });
  2228. });
  2229. },
  2230. //加载项目内的任务列表
  2231. getStageList() {
  2232. this.http.post('/stages/list',{groupId: this.selectedGroup.id, projectId: this.selectedGroup.projectId, order: this.order, isDesc: this.isDesc},
  2233. res => {
  2234. if (res.code == "ok") {
  2235. this.stageList = res.data;
  2236. this.timess() // 处理时间的方法
  2237. } else {
  2238. this.$message({
  2239. message: res.msg,
  2240. type: "error"
  2241. });
  2242. }
  2243. },
  2244. error => {
  2245. this.$message({
  2246. message: error,
  2247. type: "error"
  2248. });
  2249. });
  2250. },
  2251. timess(){
  2252. // console.log('timess');
  2253. var date = new Date()
  2254. let Y = date.getFullYear()
  2255. let M = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : (date.getMonth() + 1)
  2256. let D = date.getDate() < 10 ? ('0' + date.getDate()) : date.getDate()
  2257. this.times = `${Y}-${M}-${D}`
  2258. },
  2259. addStagePost() {
  2260. let param = JSON.parse(JSON.stringify(this.stageForm));
  2261. param.taskList = [];
  2262. this.http.post('/stages/save',param,
  2263. res => {
  2264. if (res.code == "ok") {
  2265. this.stageList = res.data;
  2266. this.addStageDialog = false;
  2267. } else {
  2268. this.$message({
  2269. message: res.msg,
  2270. type: "error"
  2271. });
  2272. }
  2273. },
  2274. error => {
  2275. this.$message({
  2276. message: error,
  2277. type: "error"
  2278. });
  2279. });
  2280. },
  2281. addStage() {
  2282. this.addStageDialog = true;
  2283. this.stageForm = {groupId: this.selectedGroup.id, projectId: this.curProjectId};
  2284. },
  2285. viewChange(index, indexPath) {
  2286. this.groupType = 1;
  2287. this.order = "create_date";
  2288. this.isDesc = true;
  2289. this.selectedGroup = this.viewList.filter(g=>g.id == index)[0];
  2290. this.getViewTaskList();
  2291. this.displayTable = true;
  2292. } ,
  2293. groupChange(index, indexPath) {
  2294. this.groupType = 0;
  2295. this.order = "seq";
  2296. this.isDesc = false;
  2297. this.selectedGroup = this.groupList.filter(g=>g.id == index)[0];
  2298. this.getStageList();
  2299. this.displayTable = false;
  2300. // console.log("1223");
  2301. this.$forceUpdate()
  2302. },
  2303. //本地搜索组
  2304. startSearchGroup() {
  2305. if (this.groupSearch != null || this.groupSearch.length > 0) {
  2306. this.groupList = this.allGroupData.filter(g=>g.name.indexOf(this.groupSearch) >= 0);
  2307. } else {
  2308. this.groupList = this.allGroupData;
  2309. }
  2310. },
  2311. editIncharger(item) {
  2312. this.groupForm = JSON.parse(JSON.stringify(item));
  2313. this.setInchargerDialog = true;
  2314. },
  2315. renameGroup(item) {
  2316. this.groupForm = JSON.parse(JSON.stringify(item));
  2317. this.modGroupDialog = true;
  2318. },
  2319. deleteGroup(item) {
  2320. var _this = this;
  2321. this.$confirm("分组下的任务也将一同删除,您确认删除该分组吗?", "提示", {
  2322. type: 'warning'
  2323. }).then(() => {
  2324. this.http.post('/task-group/delete',item,
  2325. res => {
  2326. if (res.code == "ok") {
  2327. this.groupList = res.data;
  2328. if (item.id == this.selectedGroup.id) {
  2329. //之前选中的分组被删除了
  2330. if (this.groupList.length > 0) {
  2331. this.defaultGroupId = this.groupList[0].id;
  2332. this.selectedGroup = this.groupList[0];
  2333. this.groupChange(this.defaultGroupId)
  2334. } else {
  2335. this.selectedGroup = {};
  2336. }
  2337. }
  2338. } else {
  2339. this.$message({
  2340. message: res.msg,
  2341. type: "error"
  2342. });
  2343. }
  2344. },
  2345. error => {
  2346. this.$message({
  2347. message: error,
  2348. type: "error"
  2349. });
  2350. });
  2351. });
  2352. },
  2353. addTemplateGroup() {
  2354. // var param = JSON.parse(JSON.stringify(this.groupTemplateList.filter(g=>g.selected)[0]));
  2355. // delete param.stagesList;
  2356. // param.projectId = this.curProjectId;
  2357. // var k = this.groupTemplateList[this.sidebarIndex].name
  2358. // var s = null;
  2359. // var xmz = this.groupList.forEach(function(a, b, c){
  2360. // if (a.name == k) {
  2361. // s = true
  2362. // return
  2363. // }
  2364. // })
  2365. // if (s){
  2366. // this.addGroupDialog = false;
  2367. // this.$message({
  2368. // message: '当前项目已存在分组['+k+'],请修改组名后重试。',
  2369. // type: "error"
  2370. // });
  2371. // return
  2372. // }
  2373. var param = JSON.parse(JSON.stringify(this.groupTemplateList.filter(g=>g.selected)))
  2374. console.log(param)
  2375. for(var i in param) {
  2376. delete param[i].stagesList
  2377. }
  2378. console.log(this.groupList)
  2379. var s = null
  2380. var k = ''
  2381. var xmz = this.groupList.forEach(function(a, b, c){
  2382. param.forEach((g, i) =>{
  2383. if(a.name == g.name) {
  2384. s = true
  2385. k = g.name
  2386. return
  2387. }
  2388. })
  2389. })
  2390. if (s){
  2391. this.addGroupDialog = false;
  2392. this.$message({
  2393. message: '当前项目已存在分组['+k+'],请修改组名后重试。',
  2394. type: "error"
  2395. });
  2396. return
  2397. }
  2398. console.log('将要闯过去的值', param)
  2399. // return
  2400. // this.http.post('/task-group/createFromTemplate',param,
  2401. this.http.post('/task-group/createFromTemplate',{
  2402. templateJson: JSON.stringify(param),
  2403. projectId: this.curProjectId
  2404. },
  2405. res => {
  2406. if (res.code == "ok") {
  2407. this.selectedGroup = res.data
  2408. this.sleectId = res.data.id
  2409. this.sleectProjectId = res.data.projectId
  2410. this.addGroupDialog = false;
  2411. // this.getTaskGroups();
  2412. this.getTaskGroup();
  2413. } else {
  2414. this.$message({
  2415. message: res.msg,
  2416. type: "error"
  2417. });
  2418. }
  2419. },
  2420. error => {
  2421. this.$message({
  2422. message: error,
  2423. type: "error"
  2424. });
  2425. });
  2426. },
  2427. // 重新定义了 addGroup 方法
  2428. addGroup() {
  2429. this.http.post('/task-group/save',this.groupForm,
  2430. res => {
  2431. if (res.code == "ok") {
  2432. this.groupList = res.data;
  2433. this.addGroupDialog = false;
  2434. this.modGroupDialog = false;
  2435. if (this.selectedGroup.id !== this.groupForm.id) {
  2436. this.selectedGroup = this.groupList.filter(g=>g.new)[0];
  2437. }
  2438. this.defaultGroupId = this.groupList[this.groupList.length - 1].id
  2439. // this.getTaskGroup();
  2440. this.getStageList()
  2441. } else {
  2442. this.$message({
  2443. message: res.msg,
  2444. type: "error"
  2445. });
  2446. }
  2447. },
  2448. error => {
  2449. this.$message({
  2450. message: error,
  2451. type: "error"
  2452. });
  2453. });
  2454. },
  2455. createGroup() {
  2456. this.addGroupDialog = true;
  2457. this.groupForm = {projectId: this.curProjectId};
  2458. },
  2459. getInsideData() {
  2460. this.getTaskGroups();
  2461. },
  2462. //加载项目内的任务分组
  2463. getTaskGroups() {
  2464. this.http.post('/task-group/list',{projectId: this.curProjectId},
  2465. res => {
  2466. if (res.code == "ok") {
  2467. this.allGroupData = res.data;
  2468. this.groupList = res.data;
  2469. console.log(this.groupList,'grouplist');
  2470. if (this.groupList.length > 0) {
  2471. this.defaultGroupId = this.groupList[0].id;
  2472. this.selectedGroup = this.groupList[0];
  2473. this.getStageList();
  2474. } else {
  2475. //清空任务列表
  2476. this.defaultGroupId = null;
  2477. this.selectedGroup = null;
  2478. this.stageList = [];
  2479. }
  2480. } else {
  2481. this.$message({
  2482. message: res.msg,
  2483. type: "error"
  2484. });
  2485. }
  2486. },
  2487. error => {
  2488. this.$message({
  2489. message: error,
  2490. type: "error"
  2491. });
  2492. });
  2493. },
  2494. // 额外加的
  2495. getTaskGroup() {
  2496. this.http.post('/task-group/list',{projectId: this.curProjectId},
  2497. res => {
  2498. if (res.code == "ok") {
  2499. this.allGroupData = res.data;
  2500. this.groupList = res.data;
  2501. if (this.groupList.length > 0) {
  2502. this.defaultGroupId = this.sleectId;
  2503. this.selectedGroup = this.groupList[res.data.length - 1];
  2504. this.getStageList();
  2505. } else {
  2506. //清空任务列表
  2507. this.defaultGroupId = null;
  2508. this.selectedGroup = null;
  2509. this.stageList = [];
  2510. }
  2511. } else {
  2512. this.$message({
  2513. message: res.msg,
  2514. type: "error"
  2515. });
  2516. }
  2517. },
  2518. error => {
  2519. this.$message({
  2520. message: error,
  2521. type: "error"
  2522. });
  2523. });
  2524. },
  2525. //切换项目
  2526. onProjectChange() {
  2527. let path = this.$route.path;
  2528. path = path.substring(0,path.lastIndexOf('/'))+'/'+this.curProjectId;
  2529. this.$router.push(path);
  2530. this.getTaskGroups();
  2531. this.$refs.fileCenter.refreshPage();
  2532. this.$refs.projectInfo.refreshPage();
  2533. this.$refs.summary.refreshPage();
  2534. this.$refs.costbaseline.refreshPage();
  2535. this.$refs.earning.refreshPage();
  2536. },
  2537. //获取我的项目列表
  2538. getMyProjectList() {
  2539. this.http.post('/project/getProjectList', {
  2540. },
  2541. res => {
  2542. if (res.code == "ok") {
  2543. this.projectList = res.data;
  2544. console.log('getprojectlist',res.data);
  2545. } else {
  2546. this.$message({
  2547. message: res.msg,
  2548. type: "error"
  2549. });
  2550. }
  2551. },
  2552. error => {
  2553. this.$message({
  2554. message: error,
  2555. type: "error"
  2556. });
  2557. });
  2558. },
  2559. menuSelect() {
  2560. },
  2561. toList() {
  2562. this.$router.push("/list");
  2563. },
  2564. searchList() {
  2565. this.page = 1;
  2566. this.getList();
  2567. },
  2568. //显示用户详情
  2569. showUser(userId) {
  2570. this.userDetailVisible = true;
  2571. this.http.post(this.port.manage.userDetail, {
  2572. userId: userId
  2573. },
  2574. res => {
  2575. if (res.code == "ok") {
  2576. this.userDetail = res.data;
  2577. } else {
  2578. this.$message({
  2579. message: res.msg,
  2580. type: "error"
  2581. });
  2582. }
  2583. },
  2584. error => {
  2585. this.$message({
  2586. message: error,
  2587. type: "error"
  2588. });
  2589. });
  2590. },
  2591. getUsers() {
  2592. this.http.post(this.port.manage.list, {
  2593. departmentId: -1,
  2594. pageIndex: 1,
  2595. pageSize: 99999
  2596. },
  2597. res => {
  2598. if (res.code == "ok") {
  2599. this.users = res.data.records;
  2600. } else {
  2601. this.$message({
  2602. message: res.msg,
  2603. type: "error"
  2604. });
  2605. }
  2606. },
  2607. error => {
  2608. this.$message({
  2609. message: error,
  2610. type: "error"
  2611. });
  2612. });
  2613. },
  2614. //获取项目列表
  2615. getList() {
  2616. this.listLoading = true;
  2617. this.http.post(this.port.project.listPage, {
  2618. pageIndex: this.page,
  2619. pageSize: this.size,
  2620. keyword:this.keyword,
  2621. searchField: this.searchField,
  2622. },
  2623. res => {
  2624. this.listLoading = false;
  2625. if (res.code == "ok") {
  2626. var list = res.data.records;
  2627. for(var i in list) {
  2628. var participator = list[i].participator , str = "";
  2629. for(var j in participator) {
  2630. if(j == participator.length-1) {
  2631. str += participator[j].name
  2632. } else {
  2633. str += participator[j].name + ','
  2634. }
  2635. }
  2636. list[i].userNames = str;
  2637. }
  2638. this.list = list;
  2639. this.total = res.data.total;
  2640. } else {
  2641. this.$message({
  2642. message: res.msg,
  2643. type: "error"
  2644. });
  2645. }
  2646. },
  2647. error => {
  2648. this.listLoading = false;
  2649. this.$message({
  2650. message: error,
  2651. type: "error"
  2652. });
  2653. });
  2654. },
  2655. submitInsert() {
  2656. if (this.textContent !== true) return this.$message({
  2657. showClose: true,
  2658. message: '图片太大,请重新上传',
  2659. type: 'warning'
  2660. });
  2661. //检查是有重名的执行人
  2662. var exeList = this.addForm.executorListFront;
  2663. // for(let i=0;i<this.gstimhour.length;i++){
  2664. // exeList[i].planHours = this.gstimhour[i]
  2665. // }
  2666. for (var i=0;i<exeList.length;i++) {
  2667. var findSameUser = false;
  2668. exeList[i].planHours = this.gstimhour[i]
  2669. for (var j=i+1;j<exeList.length; j++) {
  2670. if (exeList[i].executorId && exeList[j].executorId && exeList[i].executorId == exeList[j].executorId) {
  2671. findSameUser = true;
  2672. break;
  2673. }
  2674. }
  2675. if (findSameUser) {
  2676. return this.$message({
  2677. showClose: true,
  2678. message: '执行人存在重复',
  2679. type: 'error'
  2680. });
  2681. }
  2682. }
  2683. this.$refs.form1.validate(valid => {
  2684. if (valid) {
  2685. delete this.addForm.subTaskList;
  2686. delete this.addForm.refTaskList;
  2687. delete this.addForm.progress;
  2688. //去掉没有执行人的
  2689. this.addForm.executorListFront = this.addForm.executorListFront.filter(exe=>exe.executorId);
  2690. this.addForm.executorListStr = JSON.stringify(this.addForm.executorListFront);
  2691. this.addLoading = true;
  2692. this.http.post('/task/save',this.addForm,
  2693. res => {
  2694. this.addLoading = false;
  2695. if (res.code == "ok") {
  2696. this.$message({
  2697. message: "提交成功",
  2698. type: "success"
  2699. });
  2700. if (this.addForm.parentTid == null) {
  2701. this.addFormVisible = false;
  2702. if (this.groupType == 0) {
  2703. this.getStageList();
  2704. } else {
  2705. this.getViewTaskList();
  2706. }
  2707. } else {
  2708. this.backToParentTask();
  2709. }
  2710. } else {
  2711. this.$message({
  2712. message: res.msg,
  2713. type: "error"
  2714. });
  2715. }
  2716. },
  2717. error => {
  2718. this.$message({
  2719. message: error,
  2720. type: "error"
  2721. });
  2722. }
  2723. );
  2724. }
  2725. });
  2726. },
  2727. DateChange(){
  2728. if(this.addForm.startDate != undefined && this.addForm.endDate != undefined){
  2729. let stdate = Date.parse(this.addForm.startDate)
  2730. let eddate = Date.parse(this.addForm.endDate)
  2731. if(stdate <= eddate){
  2732. let days = (eddate - stdate) / (1*24*60*60*1000) + 1
  2733. for (let i=0;i<this.gstimday.length;i++) {
  2734. this.gstimday[i] = days
  2735. this.gstimhour[i] = days * this.user.timeType.allday
  2736. }
  2737. this.$forceUpdate()
  2738. }
  2739. // console.log("gstimday",this.gstimday);
  2740. }
  2741. },
  2742. // 删除
  2743. deletePro(i, item) {
  2744. this.$confirm("确定要项目" + item.projectName + "吗?","删除项目", {
  2745. confirmButtonText: "确定",
  2746. cancelButtonText: "取消",
  2747. type: "warning"
  2748. })
  2749. .then(() => {
  2750. this.listLoading = true;
  2751. this.http.post(this.port.project.delete,{
  2752. id: item.id
  2753. },
  2754. res => {
  2755. this.listLoading = false;
  2756. if (res.code == "ok") {
  2757. this.$message({
  2758. message: "删除成功",
  2759. type: "success"
  2760. });
  2761. this.getList();
  2762. } else {
  2763. this.$message({
  2764. message: res.msg,
  2765. type: "error"
  2766. });
  2767. }
  2768. },
  2769. error => {
  2770. this.listLoading = false;
  2771. this.$message({
  2772. message: error,
  2773. type: "error"
  2774. });
  2775. }
  2776. );
  2777. })
  2778. .catch(() => {});
  2779. },
  2780. detail(i) {
  2781. this.$router.push("/list/" + this.list[i].id + "/" + this.list[i].projectName);
  2782. },
  2783. getDetail() {
  2784. this.http.post('/project/detail',{
  2785. id: this.curProjectId
  2786. },
  2787. res => {
  2788. if (res.code == "ok") {
  2789. this.currentProject = res.data;
  2790. this.getjurisdictionIds(this.currentProject)
  2791. this.joinMembList = this.currentProject.participationList;
  2792. } else {
  2793. }
  2794. },
  2795. error => {
  2796. this.$message({
  2797. message: error,
  2798. type: "error"
  2799. });
  2800. }
  2801. );
  2802. },
  2803. getjurisdictionIds(pro){
  2804. console.log('pro',pro.creatorId);
  2805. this.projectCreatorId = pro.creatorId
  2806. this.projectInchargerId = pro.inchargerId
  2807. }
  2808. },
  2809. created() {
  2810. let height = window.innerHeight;
  2811. this.tableHeight = height - 135;
  2812. this.stageListHeight = this.tableHeight - 45;
  2813. this.taskListinH = this.stageListHeight - 75;
  2814. const that = this;
  2815. window.onresize = function temp() {
  2816. that.tableHeight = window.innerHeight - 135;
  2817. that.stageListHeight = that.tableHeight - 45;
  2818. that.taskListinH = that.stageListHeight - 75;
  2819. };
  2820. },
  2821. mounted() {
  2822. this.curProjectId = parseInt(this.$route.params.id);
  2823. this.activeName = this.$route.path.split("/")[1];
  2824. this.getDetail();
  2825. this.getUsers();
  2826. this.getMyProjectList();
  2827. this.getInsideData();
  2828. this.getGroupTemplate();
  2829. }
  2830. };
  2831. </script>
  2832. <style >
  2833. .taskCardCircleBox{
  2834. padding-left: 5px;
  2835. display: flex;
  2836. justify-content: left;
  2837. align-items: center;
  2838. }
  2839. .flip-list-move {
  2840. transition: transform 0.5s;
  2841. }
  2842. .no-move {
  2843. transition: transform 0s;
  2844. }
  2845. .taskStage {
  2846. margin:10px;
  2847. display:inline-block;
  2848. vertical-align:top;
  2849. width: 331px;
  2850. }
  2851. .taskList {
  2852. padding:7px;
  2853. width:331px;
  2854. }
  2855. .taskListin{
  2856. width: 317px;
  2857. overflow: auto;
  2858. }
  2859. .taskList .stage {
  2860. font-weight:bold;
  2861. display:block;
  2862. float:left;
  2863. width:260px;
  2864. overflow: auto;
  2865. }
  2866. .taskCard {
  2867. background: #fff;
  2868. margin: 5px 0px;
  2869. padding:5px;
  2870. border: 1px solid #e6e6e6;
  2871. border-radius: 3px;
  2872. box-shadow: 3px 3px 3px #e6e6e6;
  2873. min-height:60px;
  2874. position: relative;
  2875. border-radius: 3px;
  2876. overflow: hidden;
  2877. width: 288px;
  2878. }
  2879. .taskImg {
  2880. position: absolute;
  2881. box-sizing: border-box;
  2882. width: 100%;
  2883. height: 100%;
  2884. top: 0;
  2885. left: 0;
  2886. }
  2887. .taskImg img{
  2888. position: absolute;
  2889. top: -1px;
  2890. }
  2891. .hong:hover {
  2892. border-top: 1px solid #ff0000;
  2893. }
  2894. .huang:hover {
  2895. border-top: 1px solid #ff9600;
  2896. }
  2897. .hui:hover {
  2898. border-top: 1px solid #c9c9c9;
  2899. }
  2900. .taskCard:hover {
  2901. cursor: move;
  2902. }
  2903. .chosen {
  2904. background-color: #000 !important;
  2905. color: #fff;
  2906. }
  2907. .ghost {
  2908. background-color: #fafafa !important;
  2909. }
  2910. .taskCard .cb {
  2911. margin-right:5px;
  2912. }
  2913. .item {
  2914. background:#fff;
  2915. }
  2916. .input-with-select .el-input-group__prepend {
  2917. background-color: #fff;
  2918. }
  2919. .el-tabs__item {
  2920. height:45px ;
  2921. }
  2922. .projectCls {
  2923. margin-left:10px;margin-right:10px;
  2924. }
  2925. .heavyTxt {
  2926. font-weight:bold;
  2927. }
  2928. .el-tabs__nav-wrap::after {
  2929. height:0.5px;
  2930. }
  2931. .user_name_icon {
  2932. text-align:center;border-radius:50%;color:white;float:right;font-size:10px;width:30px;height:30px;line-height:30px;
  2933. transform: scale(0.8);
  2934. }
  2935. .task_name {
  2936. color:#262626;
  2937. display:inline-block;
  2938. max-width: 235px;
  2939. height: 25px;
  2940. overflow: hidden;
  2941. white-space: nowrap;
  2942. text-overflow: ellipsis;
  2943. }
  2944. .task_name span{
  2945. position: relative;
  2946. top: 8px;
  2947. }
  2948. .cb {
  2949. position: relative;
  2950. top: -2px;
  2951. }
  2952. .group_style {
  2953. border-radius: 5px;margin:2px 0px 2px 0px;height:40px;line-height:40px;
  2954. }
  2955. .el-tabs__nav-wrap::after {
  2956. height:1px;
  2957. }
  2958. .el-tabs__header {
  2959. margin:0 !important;
  2960. }
  2961. .single_line {
  2962. overflow: hidden;text-overflow:ellipsis;white-space: nowrap;
  2963. }
  2964. .sub_task_num {
  2965. font-size:10px;
  2966. color:#666;
  2967. }
  2968. .template_box {
  2969. margin:20px 0px;
  2970. }
  2971. /* 项目阶段侧边栏样式 */
  2972. .sidebar {
  2973. width: 2px;
  2974. background: #dddddd;
  2975. position: relative;
  2976. }
  2977. .sidebar:hover {
  2978. background: #20a0ff;
  2979. }
  2980. .sidebar:hover .etui {
  2981. background: #20a0ff;
  2982. border: #20a0ff;
  2983. color: #fff;
  2984. }
  2985. .etui {
  2986. width: 15px;
  2987. height: 40px;
  2988. background: #fff;
  2989. border: 1px solid #dddddd;
  2990. position: absolute;
  2991. top: 50%;
  2992. left: 0%;
  2993. transform: translate(6%, -50%);
  2994. color: rgb(192, 191, 191);
  2995. box-sizing: border-box;
  2996. }
  2997. .etui i {
  2998. display: inline-block;
  2999. padding-top: 90%;
  3000. /* padding-left: 15%; */
  3001. font-weight: bold;
  3002. }
  3003. /* bug问题 */
  3004. .task {
  3005. box-sizing: border-box;
  3006. padding-left: 10px;
  3007. padding-right: 5px;
  3008. }
  3009. /* 评论部分 */
  3010. .remark {
  3011. width: 500px;
  3012. height: 100%;
  3013. background: #fff;
  3014. position: absolute;
  3015. top: 0;
  3016. right: -500px;
  3017. border-left: 3px solid #dddddd;
  3018. }
  3019. .jm {
  3020. margin-left: -500px;
  3021. }
  3022. .bj {
  3023. float: left;
  3024. width: 90%;
  3025. overflow: hidden;
  3026. height: 65px;
  3027. white-space: nowrap;
  3028. text-overflow: ellipsis;
  3029. }
  3030. .bj span {
  3031. width: 50px;
  3032. height: 50px;
  3033. display: inline-block;
  3034. border-radius: 50%;
  3035. color: #fff;
  3036. text-align: center;
  3037. float: left;
  3038. margin-right: 20px;
  3039. margin-top: 10px;
  3040. line-height: 50px;
  3041. }
  3042. .player {
  3043. height: 15%;
  3044. box-sizing: border-box;
  3045. padding-left: 15px;
  3046. border-bottom: 1px solid #dddddd;
  3047. }
  3048. .player p {
  3049. margin: 0;
  3050. padding: 2% 0;
  3051. font-size: 18px;
  3052. }
  3053. .player .el-image {
  3054. border-radius: 50%;
  3055. margin-right: 10px;
  3056. }
  3057. .subject {
  3058. height: 60%;
  3059. box-sizing: border-box;
  3060. }
  3061. .sub-all {
  3062. font-size: 20px;
  3063. padding: 15px 0 15px 15px;
  3064. }
  3065. .sub-details {
  3066. width: 100%;
  3067. height: 87%;
  3068. padding-right: 15px;
  3069. box-sizing: border-box;
  3070. overflow: hidden;
  3071. overflow-y: scroll
  3072. }
  3073. .sub-details li {
  3074. list-style:none
  3075. }
  3076. /* 红色背景显示日期 */
  3077. .element_span {
  3078. display: inline-block;
  3079. background: #e62412;
  3080. color: #fff;
  3081. border-radius: 3px;
  3082. padding: 3px;
  3083. /* text-align: center; */
  3084. font-size: 12px;
  3085. margin-left: 5px;
  3086. }
  3087. .pro_btn{
  3088. display: inline-block;
  3089. float: right;
  3090. }
  3091. </style>
  3092. <style lang="scss" scoped>
  3093. .counli {
  3094. em {
  3095. font-style: normal;
  3096. display: inline-block;
  3097. margin-left: 9%;
  3098. }
  3099. span {
  3100. float: right;
  3101. }
  3102. }
  3103. .carts {
  3104. position: relative;
  3105. .el-image{
  3106. border-radius: 50%;
  3107. float: left;
  3108. width: 20%;
  3109. }
  3110. i {
  3111. width: 30px;
  3112. height: 30px;
  3113. // background: #778899;
  3114. display: inline-block;
  3115. float: left;
  3116. border-radius:50%;
  3117. font-style:normal;
  3118. font-size: 12px;
  3119. line-height: 30px;
  3120. text-align: center;
  3121. color: #fff;
  3122. background: #778899;
  3123. }
  3124. div {
  3125. text-align: left;
  3126. p {
  3127. text-align: left;
  3128. margin-left: 10px;
  3129. margin-left: 13%;
  3130. }
  3131. em {
  3132. display: block;
  3133. font-style: normal;
  3134. margin-left: 13%;
  3135. }
  3136. }
  3137. span {
  3138. font-size: 10px;
  3139. float: right;
  3140. margin-top: -40px;
  3141. }
  3142. }
  3143. .issue {
  3144. // height: 20%;
  3145. // position: relative;
  3146. // z-index: 4;
  3147. .zh{
  3148. position: relative;
  3149. width: 100%;
  3150. height: 100%;
  3151. }
  3152. .textareays {
  3153. background: #000;
  3154. height: 140px;
  3155. border: 0;
  3156. .el-textarea__inner {
  3157. height: 85%;
  3158. }
  3159. }
  3160. .issue-button {
  3161. position: absolute;
  3162. bottom: 20px;
  3163. right: 20px;
  3164. }
  3165. }
  3166. .inputDeep {
  3167. position: absolute;
  3168. bottom: 85px;
  3169. width: 95%;
  3170. margin: 0 12px;
  3171. }
  3172. .inputDeep .el-textarea .el-textarea__inner{
  3173. border: 0 !important;
  3174. resize: none !important;
  3175. }
  3176. .inputDeeps .el-textarea__inner {
  3177. border: 0 !important;
  3178. resize: none !important;
  3179. }
  3180. .scop_span {
  3181. display: inline-block;
  3182. padding: 2px 5px;
  3183. }
  3184. </style>
  3185. <style>
  3186. .ql-snow .ql-picker.ql-size .ql-picker-label::before,
  3187. .ql-snow .ql-picker.ql-size .ql-picker-item::before {
  3188. content: "14px" !important;
  3189. position: relative;
  3190. top: -8px;
  3191. }
  3192. .ql-snow .ql-picker.ql-size .ql-picker-label[data-value="small"]::before,
  3193. .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="small"]::before {
  3194. content: "10px" !important;
  3195. }
  3196. .ql-snow .ql-picker.ql-size .ql-picker-label[data-value="large"]::before,
  3197. .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="large"]::before {
  3198. content: "18px" !important;
  3199. }
  3200. .ql-snow .ql-picker.ql-size .ql-picker-label[data-value="huge"]::before,
  3201. .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="huge"]::before {
  3202. content: "32px" !important;
  3203. }
  3204. .ql-snow .ql-picker.ql-header .ql-picker-label::before,
  3205. .ql-snow .ql-picker.ql-header .ql-picker-item::before {
  3206. content: "文本" !important;
  3207. position: relative;
  3208. top: -8px;
  3209. }
  3210. .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before,
  3211. .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before {
  3212. content: "标题1" !important;
  3213. }
  3214. .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before,
  3215. .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before {
  3216. content: "标题2" !important;
  3217. }
  3218. .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before,
  3219. .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before {
  3220. content: "标题3" !important;
  3221. }
  3222. .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="4"]::before,
  3223. .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before {
  3224. content: "标题4" !important;
  3225. }
  3226. .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="5"]::before,
  3227. .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before {
  3228. content: "标题5" !important;
  3229. }
  3230. .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="6"]::before,
  3231. .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="6"]::before {
  3232. content: "标题6" !important;
  3233. }
  3234. .ql-snow .ql-picker.ql-font .ql-picker-label::before,
  3235. .ql-snow .ql-picker.ql-font .ql-picker-item::before {
  3236. content: "标准字体" !important;
  3237. }
  3238. .ql-snow .ql-picker.ql-font .ql-picker-label[data-value="serif"]::before,
  3239. .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="serif"]::before {
  3240. content: "衬线字体" !important;
  3241. }
  3242. .ql-snow .ql-picker.ql-font .ql-picker-label[data-value="monospace"]::before,
  3243. .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="monospace"]::before {
  3244. content: "等宽字体" !important;
  3245. }
  3246. /* .ql-picker-label {
  3247. position: relative;
  3248. } */
  3249. .ql-picker-label svg {
  3250. position: relative;
  3251. top: -6px;
  3252. }
  3253. /* 任务进展 */
  3254. .progress {
  3255. border: 1px solid #ddd;
  3256. border-radius: 5px;
  3257. width: 100%;
  3258. box-sizing: border-box;
  3259. padding: 15px;
  3260. position: relative;
  3261. margin-bottom: 20px;
  3262. }
  3263. .remind {
  3264. width: 95px;
  3265. height: 60%;
  3266. overflow-y:auto;
  3267. position: absolute;
  3268. background: #fff;
  3269. padding: 10px;
  3270. left: 0;
  3271. top: 0;
  3272. border: 1px solid #ddd;
  3273. z-index: 999999;
  3274. }
  3275. .rala1 .el-radio__input.is-checked + .el-radio__label {
  3276. color: #43d14f !important;
  3277. }
  3278. .rala1 .el-radio__input.is-checked .el-radio__inner {
  3279. background: #43d14f !important;
  3280. border-color: #43d14f !important;
  3281. }
  3282. .rala2 .el-radio__input.is-checked + .el-radio__label {
  3283. color: #fd7624 !important;
  3284. }
  3285. .rala2 .el-radio__input.is-checked .el-radio__inner {
  3286. background: #fd7624 !important;
  3287. border-color: #fd7624 !important;
  3288. }
  3289. .rala3 .el-radio__input.is-checked + .el-radio__label {
  3290. color: #fd4d47 !important;
  3291. }
  3292. .rala3 .el-radio__input.is-checked .el-radio__inner {
  3293. background: #fd4d47 !important;
  3294. border-color: #fd4d47 !important;
  3295. }
  3296. /* 任务进展列表 */
  3297. .elCard {
  3298. width: 100%;
  3299. padding: 15px;
  3300. box-sizing: border-box;
  3301. border: 1px solid #EBEEF5;
  3302. }
  3303. .elCard_qu {
  3304. float: right;
  3305. margin-right: 15px;
  3306. }
  3307. .integrity {
  3308. padding: 15px;
  3309. }
  3310. .write {
  3311. float: right;
  3312. color: #1B9AEE;
  3313. }
  3314. .ssp {
  3315. position: absolute;
  3316. right: 140px;
  3317. top: 95px;
  3318. width: 66%;
  3319. height: 80%;
  3320. }
  3321. .examine {
  3322. width: 100%;
  3323. text-align: center;
  3324. }
  3325. .nones {
  3326. width: 100%;
  3327. height: 50px;
  3328. text-align: center;
  3329. color: #909399;
  3330. line-height: 50px;
  3331. border-top: 1px solid #EBEEF5;
  3332. border-bottom: 1px solid #EBEEF5;
  3333. font-size: 16px;
  3334. }
  3335. .icon {
  3336. /* color: rgb(67, 209, 79); */
  3337. display: block;
  3338. width: 12px;
  3339. height: 12px;
  3340. background: #fff;
  3341. position: absolute;
  3342. top: 0;
  3343. left: -33px;
  3344. border-radius: 50%;
  3345. border: 4px solid;
  3346. }
  3347. /* ddl */
  3348. .ddl {
  3349. height: 136px;
  3350. overflow: hidden;
  3351. border: 1px solid #EBEEF5
  3352. }
  3353. .tb{
  3354. position: relative;
  3355. }
  3356. .dpl{
  3357. position: absolute;
  3358. font-size: 20px;
  3359. left: -32px;
  3360. top: 0px;
  3361. }
  3362. </style>