projectInside.vue 151 KB

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