projectInside.vue 158 KB

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