projectInside.vue 156 KB

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