projectInside.vue 157 KB

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