projectInside.vue 99 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325
  1. <template>
  2. <section>
  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. <el-button type="default" size="mini" icon="el-icon-arrow-left" @click="toList" style="margin-left:10px;">项目列表</el-button>
  7. <el-select v-model="curProjectId" size="mini" class="projectCls" @change="onProjectChange">
  8. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  9. </el-select>
  10. <el-dropdown trigger="click" style="margin-right:30px;color:#262626;cursor:pointer;">
  11. <i class="iconfont firerock-iconcaidan" ></i>
  12. <el-dropdown-menu slot="dropdown">
  13. <el-dropdown-item v-if="currentProject.status == 1" @click.native="finishPro()">
  14. <i class="iconfont firerock-iconwancheng"></i>完成项目
  15. </el-dropdown-item>
  16. <el-dropdown-item divided v-if="currentProject.status == 1" @click.native="cancelPro()">
  17. <i class="el-icon-refresh-left"></i>撤销项目
  18. </el-dropdown-item>
  19. <el-dropdown-item v-if="currentProject.status == 2 || currentProject.status == 3" @click.native="startPro()">
  20. <i class="iconfont firerock-iconqidong"></i>重启项目
  21. </el-dropdown-item>
  22. </el-dropdown-menu>
  23. </el-dropdown>
  24. </template>
  25. </el-tab-pane>
  26. <el-tab-pane label="任务看板" name="projectInside">
  27. <el-container style="padding: 0px;">
  28. <el-aside :style="'padding-left:10px;padding-right:5px;height:'+tableHeight+'px;width:'+groupWidth+'px;'">
  29. <el-input v-model="groupSearch" size="small" placeholder="搜索分组" @input="startSearchGroup" style="margin-top:10px"/>
  30. <p ><span class="heavyTxt">任务分组</span> <i class="el-icon-plus pull-right" style="color:#666;margin-right:10px;" @click="createGroup"></i></p>
  31. <el-menu :default-active="defaultGroupId" class="el-menu-vertical-demo" @select="groupChange" style="border-right:none;">
  32. <el-menu-item :index="item.id" v-for="item in groupList" :key="item.id" class="group_style">
  33. <div slot="title">
  34. <span >{{item.name}}</span>
  35. <el-dropdown trigger="click" style="float:right;margin-right:-10px;">
  36. <i class="iconfont firerock-iconcaidan" ></i>
  37. <el-dropdown-menu slot="dropdown">
  38. <el-dropdown-item @click.native="copyGroup(item)">
  39. <i class="el-icon-document-copy"></i>
  40. 复制分组</el-dropdown-item>
  41. <el-dropdown-item divided @click.native="renameGroup(item)">
  42. <i class="el-icon-edit"></i>
  43. 修改组名</el-dropdown-item>
  44. <el-dropdown-item divided @click.native="deleteGroup(item)">
  45. <i class="el-icon-delete"></i>删除分组</el-dropdown-item>
  46. </el-dropdown-menu>
  47. </el-dropdown>
  48. </div>
  49. </el-menu-item>
  50. </el-menu>
  51. <!--视图 -->
  52. <p ><span class="heavyTxt">视图</span></p>
  53. <el-menu :default-active="1" class="el-menu-vertical-demo" @select="viewChange" style="border-right:none;">
  54. <el-menu-item :index="item.id" v-for="item in viewList" :key="item.id" class="group_style">
  55. <div slot="title">
  56. <span >{{item.name}}</span>
  57. </div>
  58. </el-menu-item>
  59. </el-menu>
  60. </el-aside>
  61. <span :style="'background:#f0f0f0;width:1px;height:'+tableHeight+'px;'" @click="toggleGroup">
  62. </span>
  63. <!-- <span :style="'width:10px;height:'+tableHeight+'px;float:left;text-align:center;vertical-align:middle;'" @click="toggleGroup">
  64. <span :style="'width:1px;background:#20A0FF;height:'+tableHeight+'px;float:left;'"></span>
  65. <i class="el-icon-d-arrow-left" ></i>
  66. </span> -->
  67. <!-- 增加侧边栏的点击效果 -->
  68. <div class="sidebar" @click="retract()">
  69. <div class="etui">
  70. <i class="el-icon-arrow-left" ref="box"></i>
  71. </div>
  72. </div>
  73. <!-- 增加侧边栏的点击效果 -->
  74. <el-main style="background:#f7f7f7;padding:0px;">
  75. <el-row style="color:#999;margin-top:10px;padding: 0px 10px;" :gutter="10">
  76. <el-col :span="18">
  77. <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>
  78. </el-col>
  79. <el-col :span="4">
  80. <el-select v-model="order" size="small" style="background:#fff;display:inline-block;" @change="orderChange">
  81. <el-option v-for="item in orderList" :key="item.id" :label="item.name" :value="item.id">
  82. <span>{{item.name}}</span>
  83. </el-option>
  84. </el-select>
  85. </el-col>
  86. <el-col :span="2">
  87. <el-button icon="iconfont firerock-iconexport" size="mini" @click="showExportDialog">导出</el-button>
  88. </el-col>
  89. </el-row>
  90. <!-- <div style="color:#999;margin-top:10px;">
  91. <i v-if="selectedGroup != null" class="el-icon-arrow-left" style="margin-top:10px;">{{selectedGroup.name}}</i>
  92. </div> -->
  93. <div v-if="!displayTable">
  94. <draggable style="overflow-x:auto;white-space:nowrap;" @update="onMoveStage"
  95. v-model="stageList" group="stage" @start="stageDrag=true" @end="stageDrag=false;" draggable=".taskStage" >
  96. <!--每个阶段的拖拽 -->
  97. <!-- <transition-group > -->
  98. <v-flex class="taskStage" v-for="stage in stageList" :key="stage.id" :style="'height:'+stageListHeight+'px;'">
  99. <draggable group="task"
  100. class="taskList"
  101. :id="stage.id"
  102. dragClass="dragClass"
  103. ghostClass="ghost"
  104. @start="drag=true" @end="drag=false"
  105. @update="onChange" @add="onChange"
  106. draggable=".taskCard">
  107. <!--头部显示阶段名称,操作 -->
  108. <div slot="header" style="margin:10px 0px;cursor:move;" role="task">
  109. <span class="stage">{{stage.stagesName}}</span><span style="margin-left:10px;color:#303133;font-size:12px;">{{stage.taskList.length}}</span>
  110. <!-- <i class="el-icon-more" style="float:right;"></i> -->
  111. <el-dropdown trigger="click" style="float:right;cursor:pointer;">
  112. <i class="el-icon-more" ></i>
  113. <el-dropdown-menu slot="dropdown">
  114. <el-dropdown-item @click.native="renameStage(stage)">
  115. <i class="el-icon-edit"></i>
  116. 重命名列表</el-dropdown-item>
  117. <el-dropdown-item divided @click.native="deleteStage(stage)">
  118. <i class="el-icon-delete"></i>删除列表</el-dropdown-item>
  119. </el-dropdown-menu>
  120. </el-dropdown>
  121. </div>
  122. <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;'">
  123. <!--任务卡片内容显示 -->
  124. <div>
  125. <div v-if="element.taskLevel == 2" class="taskImg hong"><img src="../../assets/image/hong.png" alt=""></div>
  126. <div v-if="element.taskLevel == 1" class="taskImg huang"><img src="../../assets/image/huang.png" alt=""></div>
  127. <div v-if="element.taskLevel == 0" class="taskImg hui"><img src="../../assets/image/hui.png" alt=""></div>
  128. <el-checkbox :disabled="element.taskStatus==2 || element.subTaskList.length > element.subTaskFinishNum" :checked="element.taskStatus==1?true:false" size="large" class="cb"
  129. @change="finishTask(element)"
  130. @click.stop.native=""
  131. ></el-checkbox>
  132. <el-tooltip class="item" effect="dark" :content="element.name" placement="top">
  133. <label class="task_name" :style="'background:'+(element.taskStatus==0?'#ffffff;':'#eFeFeF;')"><span>{{element.name}}</span></label>
  134. </el-tooltip>
  135. <span v-if="element.executorName != null" :style="'background:'+element.executorColor" class="user_name_icon">{{element.executorName.length>2?element.executorName.substring(element.executorName.length-2, element.executorName.length):element.executorName}}</span>
  136. <el-button v-if="element.executorName == null" type="primary" @click.stop.native="addAsMyTask(element)" size="mini" style="float:right;width:38px;padding:5px;">认领</el-button>
  137. </div>
  138. <div style="margin: 10px 0px;color:#666;" @click="timess(element.endDate)">
  139. <span v-if="element.endDate >= times || element.taskStatus == 1"><i v-if="element.endDate != null" class="el-icon-date">&nbsp;&nbsp;{{element.endDate}}</i></span>
  140. <span v-else class="element_span"><em v-if="element.endDate != null" style="display: inline-block;padding:3px 5px"><i v-if="element.endDate != null" class="el-icon-date">&nbsp;&nbsp;{{element.endDate}} 截止</i></em></span>
  141. <i :class="taskTypeIcon[element.taskType]" :style="'float:right;color:'+taskTypeColor[element.taskType]+';margin-right:8px;'" ></i>
  142. </div>
  143. <!--子任务 -->
  144. <div v-if="element.subTaskList.length > 0">
  145. <el-tooltip class="item" effect="dark" content="查看子任务" placement="top">
  146. <el-link class="sub_task_num" @click.stop.native="showSubTaskList(element)"><i class="iconfont firerock-icontree" ></i><span style="margin-left:5px;">{{element.subTaskFinishNum}}/{{element.subTaskList.length}}</span></el-link>
  147. </el-tooltip>
  148. </div>
  149. </div>
  150. <el-button slot="footer" role="people" @click="addTask(stage)" style="width:100%;" size="small" icon="el-icon-plus"></el-button>
  151. </draggable>
  152. </v-flex>
  153. <!-- </transition-group > -->
  154. <el-button slot="footer" v-if="selectedGroup != null" @click="addStage" class="taskList" icon="el-icon-plus" style="margin-top:30px;">新建任务列表</el-button>
  155. </draggable>
  156. </div>
  157. <!--列表-->
  158. <el-table v-if="displayTable" :data="taskDataList"
  159. :header-cell-style="{'font-weight':'normal'}"
  160. highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;margin-top:10px;" @row-click="taskLineClick">
  161. <el-table-column fixed label="完成" width="50">
  162. <template slot-scope="scope">
  163. <el-checkbox :disabled="scope.row.taskStatus==2" v-model="scope.row.isFinish" size="large" class="cb"
  164. @change="finishTask(scope.row)"
  165. @click.stop.native=""
  166. ></el-checkbox>
  167. </template>
  168. </el-table-column>
  169. <el-table-column prop="name" fixed label="标题" width="250">
  170. <template slot-scope="scope">
  171. <el-tooltip class="item" effect="dark" :content="scope.row.name" placement="top">
  172. <span class="single_line" > {{scope.row.name}}</span>
  173. </el-tooltip>
  174. </template>
  175. </el-table-column>
  176. <el-table-column prop="taskType" label="任务类型" width="100">
  177. <template slot-scope="scope">
  178. {{taskTypeList[scope.row.taskType].name}}
  179. </template>
  180. </el-table-column>
  181. <el-table-column prop="taskStatus" label="任务状态" width="100" >
  182. <template slot-scope="scope">
  183. {{taskStatusList[scope.row.taskStatus]}}
  184. </template>
  185. </el-table-column>
  186. <el-table-column prop="parentName" label="父任务" width="250">
  187. <template slot-scope="scope">
  188. <span style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;"> {{scope.row.parentTname}}</span>
  189. </template>
  190. </el-table-column>
  191. <el-table-column prop="stagesName" label="任务列表" width="100" >
  192. </el-table-column>
  193. <el-table-column prop="executorName" label="执行人" width="100" >
  194. <template slot-scope="scope">
  195. {{scope.row.executorName == null?"待分配":scope.row.executorName}}
  196. </template>
  197. </el-table-column>
  198. <!-- <el-table-column prop="endDate" label="截止时间" width="100" ></el-table-column> -->
  199. <el-table-column prop="endDate" label="截止时间" width="100" >
  200. <template slot-scope="scope">
  201. <p v-if="scope.row.endDate >= times">{{scope.row.endDate}}</p>
  202. <p style="border-radius: 3px; text-align: center;background: #e62412; color: #fff;" v-else><span>{{scope.row.endDate}}</span></p>
  203. </template>
  204. </el-table-column>
  205. <el-table-column prop="createDate" label="创建时间" width="100" ></el-table-column>
  206. <el-table-column prop="taskLevel" label="优先级" width="100" >
  207. <template slot-scope="scope">
  208. {{importanceList[scope.row.taskLevel].name}}
  209. </template>
  210. </el-table-column>
  211. </el-table>
  212. </el-main>
  213. </el-container>
  214. </el-tab-pane>
  215. <el-tab-pane label="文件中心" name="files"><FileCenter ref="fileCenter"></FileCenter></el-tab-pane>
  216. <el-tab-pane label="项目概览" name="info"><ProjectInfo ref="projectInfo"></ProjectInfo></el-tab-pane>
  217. <el-tab-pane label="数据统计" name="summary"><Summary ref="summary"></Summary></el-tab-pane>
  218. <el-tab-pane label="挣值分析" name="earning"><Earning ref="earning"></Earning></el-tab-pane>
  219. </el-tabs>
  220. <!--新增任务界面-->
  221. <el-dialog class="jm" :title="title" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth" width="800px">
  222. <!-- <div style="width: 200%;height:80%;position: absolute;right:-100%;top:0;background:#000;opacity: 0;" @click="sss"></div> -->
  223. <el-form ref="form1" :model="addForm" :rules="taskRules" label-width="100px">
  224. <!--子任务需要选择任务列表 -->
  225. <el-form-item label="任务列表" prop="stages" v-if="addForm.parentTid != null">
  226. <el-select v-model="addForm.stagesId" style="width:100%;" >
  227. <el-option v-for="item in stageList" :key="item.id" :label="item.stagesName" :value="item.id"></el-option>
  228. </el-select>
  229. </el-form-item>
  230. <el-form-item label="类型">
  231. <el-select v-model="addForm.taskType" style="width:100%;" >
  232. <el-option v-for="item in taskTypeList" :key="item.id" :label="item.name" :value="item.id">
  233. <i :class="item.icon" ></i>
  234. <span>{{item.name}}</span>
  235. </el-option>
  236. </el-select>
  237. </el-form-item>
  238. <el-form-item label="任务内容" prop="name">
  239. <el-input v-model="addForm.name" placeholder="请输入任务内容" clearable></el-input>
  240. </el-form-item>
  241. <el-form-item label="执行人">
  242. <el-select v-model="addForm.executorId" filterable placeholder="请选择执行人" style="width:100%;" >
  243. <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id"></el-option>
  244. </el-select>
  245. </el-form-item>
  246. <el-form-item label="截止时间" prop="endDate">
  247. <el-date-picker v-model="addForm.endDate" type="date" style="width:40%;" value-format="yyyy-MM-dd" placeholder="请选择日期" ></el-date-picker>
  248. <span style="margin-left:30px;margin-right:10px;">计划工时</span><el-input-number v-model="addForm.planHours" style="width:30%;" :min="1" :max="100" placeholder="请输入计划工作时长,单位小时" ></el-input-number ><span style="margin-left:10px;">小时</span>
  249. </el-form-item>
  250. <el-form-item label="优先级">
  251. <el-select v-model="addForm.taskLevel" style="width:100%;" >
  252. <el-option v-for="item in importanceList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  253. </el-select>
  254. </el-form-item>
  255. <!-- 富文本 -->
  256. <el-form-item label="详细描述" style="height: 200px">
  257. <!-- <Editor id="tinymce" v-model="tinymceHtml" :init="editorInit"></Editor> -->
  258. <!-- <el-input type="textarea" v-model="addForm.taskDesc" :rows="3"></el-input> -->
  259. <!-- <quill-edito v-model="addForm.taskDesc"></quill-edito> -->
  260. <quill-editor style="height: 150px" ref="text" v-model="addForm.taskDesc" class="myQuillEditor" :options="editorOption" @blur="onEditorBlur($event)" @focus="onEditorFocus($event)"/>
  261. </el-form-item>
  262. <!-- 富文本 -->
  263. <div v-if="addForm.id != null">
  264. <el-divider ></el-divider>
  265. <!-- 任务进展 -->
  266. <p ><i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">任务进展</i>
  267. <span ref="addPro" style="display: block; float:right;"><el-link @click="addprogress">添加任务进展</el-link></span>
  268. </p>
  269. <!-- 任务进展展示 -->
  270. <div style="display: none;" ref="proBox" class="progress">
  271. <!-- <el-form :model="> -->
  272. <el-radio-group v-model="radio">
  273. <el-radio :label="0" class="rala1">状态正常</el-radio>
  274. <el-radio :label="1" class="rala2">风险提示</el-radio>
  275. <el-radio :label="2" class="rala3">高度危险</el-radio>
  276. </el-radio-group>
  277. <el-input
  278. type="textarea"
  279. border="0"
  280. :autosize="{ minRows: 2, maxRows: 6}"
  281. placeholder="请输入详细进展描述"
  282. v-model="text2"
  283. style="margin:10px 0 0 0">
  284. </el-input>
  285. <h4 style="font-weight: normal;">提醒谁查看:0</h4>
  286. <i class="el-icon-circle-plus pron_i" style="font-size: 28px;color: #409EFF;" @click="addI(0)"></i>
  287. <div class="remind" ref="addRem" style="display: none">
  288. <el-checkbox-group v-model="checkList">
  289. <p><el-checkbox label="小名"></el-checkbox></p>
  290. <p><el-checkbox label="小红"></el-checkbox></p>
  291. <p><el-checkbox label="小紫"></el-checkbox></p>
  292. <p><el-checkbox label="小蓝"></el-checkbox></p>
  293. <p><el-checkbox label="小绿"></el-checkbox></p>
  294. <p><el-checkbox label="小黄"></el-checkbox></p>
  295. </el-checkbox-group>
  296. </div>
  297. <!-- </el-form> -->
  298. <div class="pro_btn">
  299. <el-button size="mini" @click="shutPro">取消</el-button>
  300. <el-button size="mini" type="primary" @click="subMission">发布</el-button>
  301. </div>
  302. </div>
  303. <!-- 任务进展列表 -->
  304. <div class="elCard">
  305. <i class="el-icon-success" style="color: #5ECE67;"></i>
  306. <span>状态正常</span>
  307. <!-- <div class="elCard_qu">屈经理更新于7小时前</div> -->
  308. <el-dropdown trigger="click" style="float:right;cursor:pointer; float: right;">
  309. <i class="el-icon-more" ></i>
  310. <el-dropdown-menu slot="dropdown">
  311. <!-- <el-dropdown-item divided @click.native="deleteStage(stage)"> -->
  312. <el-dropdown-item divided>
  313. <i class="el-icon-delete"></i>删除列表</el-dropdown-item>
  314. </el-dropdown-menu>
  315. </el-dropdown>
  316. <div class="elCard_qu">屈经理更新于7小时前</div>
  317. <p style="padding-left: 20px;">文本框输入的内容</p>
  318. <!-- <el-button type="text" @click="open" style="text-align: center;color:#dddddd;">查看完整状态</el-button> -->
  319. <!-- <p style="text-align: center;">查看完整状态</p> -->
  320. <el-button type="text" @click="innerVisible = true">查看完整状态</el-button>
  321. </div>
  322. <!-- 任务进展完整状态 -->
  323. <el-dialog title="提示" :visible.sync="innerVisible" width="300px">
  324. <div class="integrity">
  325. <h3 style="font-weight: normal;">任务进展:2</h3>
  326. <span class=""><i class="el-icon-circle-plus"></i>填写进展</span>
  327. </div>
  328. <span slot="footer" class="dialog-footer">
  329. <el-button @click="innerVisible = false">取 消</el-button>
  330. <el-button type="primary" @click="innerVisible = false">确 定</el-button>
  331. </span>
  332. </el-dialog>
  333. <!-- 子任务 -->
  334. <p ><i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">子任务</i>
  335. <el-link style="float:right;" @click="addSubTask">添加子任务</el-link>
  336. </p>
  337. <!--子任务列表 -->
  338. <el-table :data="addForm.subTaskList"
  339. :header-cell-style="{'font-weight':'normal'}"
  340. highlight-current-row v-loading="listLoading" style="width: 100%;margin-top:10px;" @row-click="taskLineClick">
  341. <el-table-column prop="taskStatus" label="完成" width="50" >
  342. <template slot-scope="scope">
  343. <el-checkbox :disabled="scope.row.taskStatus==2" :checked="scope.row.taskStatus==1?true:false" size="large" class="cb"
  344. @click.stop.native=""
  345. @change="finishTask(scope.row)"
  346. ></el-checkbox>
  347. </template>
  348. </el-table-column>
  349. <el-table-column prop="name" label="标题" >
  350. <template slot-scope="scope">
  351. <el-tooltip class="item" effect="dark" :content="scope.row.name" placement="top">
  352. <span style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;" > {{scope.row.name}}</span>
  353. </el-tooltip>
  354. </template>
  355. </el-table-column>
  356. <el-table-column prop="executorName" label="执行人" width="100" >
  357. <template slot-scope="scope">
  358. {{scope.row.executorName == null?"待分配":scope.row.executorName}}
  359. </template>
  360. </el-table-column>
  361. <el-table-column prop="endDate" label="截止时间" width="100" >
  362. <template slot-scope="scope">
  363. <p v-if="scope.row.endDate >= times">{{scope.row.endDate}}</p>
  364. <p v-else style="background: #e62412; color: #fff;text-align: center; border-radius: 3px;">{{scope.row.endDate}}</p>
  365. </template>
  366. </el-table-column>
  367. </el-table>
  368. </div>
  369. </el-form>
  370. <div slot="footer" class="dialog-footer">
  371. <el-button @click.native="deleteTask" style="float:left;">删除</el-button>
  372. <el-button @click.native="addFormVisible = false">取消</el-button>
  373. <el-button type="primary" @click="submitInsert" :loading="addLoading">提交</el-button>
  374. </div>
  375. <div slot="title" v-if="addForm.parentTid != null" >
  376. <!-- <el-link @click="backToParentTask"><i class="el-icon-arrow-left single_line">返回父级任务</i> | {{addForm.parentTname}}</el-link> -->
  377. <el-page-header @back="backToParentTask" title="返回父任务" :content="addForm.parentTname"></el-page-header>
  378. </div>
  379. <!-- 评论 -->
  380. <div class="remark">
  381. <span class="zh">
  382. <span v-for="(pl, i) in critic" :key="i">
  383. <div class="player" v-if="pl">
  384. <p>参与人</p>
  385. <div class="bj">
  386. <span style="background: #778899">{{pl.length > 2 ? pl.substring(pl.length - 2, pl.length) : pl}}</span>
  387. <!-- <span style="background: #778899">{{pl.length}}</span> -->
  388. </div>
  389. </div>
  390. </span>
  391. <div class="subject">
  392. <div class="sub-all">所有动态</div>
  393. <div class="sub-details" ref="main">
  394. <ul class="infinite-list" v-infinite-scroll="load" style="overflow:auto" ref="contRoll">
  395. <div style="width: 100%" v-if="commentList.length <= 0">
  396. <img src="../../assets/image/xiao.png" alt="">
  397. </div>
  398. <li v-for="i in count" class="infinite-list-item counli" :key="i">
  399. <p><i class="el-icon-s-fold"></i> <em>屈经理完成了依赖任务</em><span>4月20日</span></p>
  400. </li>
  401. <li class="carts" v-for="item in commentList" :key="item.id">
  402. <!-- <el-image style="width: 30px; height: 30px" :src="url" :fit="fit"></el-image> -->
  403. <!-- <i :style="'background' + item.userColor"> -->
  404. <i :style="'background' + item.userColor">
  405. {{item.userName.length > 2 ? item.userName.substring(item.userName.length - 2, item.userName.length) : item.userName}}
  406. </i>
  407. <div>
  408. <!-- <p>{{item.userName}}</p> -->
  409. <p>{{item.userName}}</p>
  410. <em>{{item.content}}</em>
  411. </div>
  412. <span>{{item.createTime | relativeTime}}</span>
  413. </li>
  414. </ul>
  415. </div>
  416. </div>
  417. <div class="issue">
  418. <!-- <el-input type="textarea" class="textareays" label-width="100%" label-height="140px"></el-input> -->
  419. <div class="issue_fixation">
  420. <el-input
  421. class="issue-input"
  422. type="textarea"
  423. placeholder="请输入内容"
  424. :autosize="{ minRows: 6, maxRows: 6}"
  425. v-model.trim="textarea2"
  426. >
  427. </el-input>
  428. <el-button class="issue-button" type="primary" @click="release()">发布</el-button>
  429. </div>
  430. </div>
  431. </span>
  432. </div>
  433. <!-- 评论 -->
  434. </el-dialog>
  435. <!-- 子任务列表 -->
  436. <el-dialog title="查看子任务" v-if="subTaskVisible" :visible.sync="subTaskVisible" :close-on-click-modal="false" customClass="customWidth" width="800px">
  437. <el-table :data="addForm.subTaskList"
  438. :header-cell-style="{'font-weight':'normal'}"
  439. highlight-current-row v-loading="listLoading" style="width: 100%;margin-top:10px;" @row-click="taskLineClick">
  440. <el-table-column prop="taskStatus" label="完成" width="50" >
  441. <template slot-scope="scope">
  442. <el-checkbox :disabled="scope.row.taskStatus==2" :checked="scope.row.taskStatus==1?true:false" size="large" class="cb"
  443. @click.stop.native="finishTask(scope.row)"
  444. ></el-checkbox>
  445. </template>
  446. </el-table-column>
  447. <el-table-column prop="name" label="标题" >
  448. <template slot-scope="scope">
  449. <el-tooltip class="item" effect="dark" :content="scope.row.name" placement="top">
  450. <span style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;" > {{scope.row.name}}</span>
  451. </el-tooltip>
  452. </template>
  453. </el-table-column>
  454. <el-table-column prop="executorName" label="执行人" width="100" >
  455. <template slot-scope="scope">
  456. {{scope.row.executorName == null?"待分配":scope.row.executorName}}
  457. </template>
  458. </el-table-column>
  459. <el-table-column prop="endDate" label="截止时间" width="100" ></el-table-column>
  460. </el-table>
  461. </el-dialog>
  462. <!--用户详细信息弹出框-->
  463. <el-dialog title="查看详情" v-if="userDetailVisible" :visible.sync="userDetailVisible" :close-on-click-modal="false" customClass="customWidth" width="400px">
  464. <div class="line"><span>姓名</span><span>{{userDetail.name}}</span></div>
  465. <div class="line"><span>手机号码</span><span>{{userDetail.phone}}</span></div>
  466. <div class="line"><span>部门</span><span>{{userDetail.departmentName}}</span></div>
  467. <div class="line"><span>成本</span><span>{{userDetail.cost}}元/小时</span></div>
  468. <div slot="footer" class="dialog-footer">
  469. <el-button type="primary" @click="userDetailVisible = false" >确定</el-button>
  470. </div>
  471. </el-dialog>
  472. <!-- 新增任务分组弹出框 -->
  473. <el-dialog v-if="addGroupDialog" :visible.sync="addGroupDialog" :close-on-click-modal="false" customClass="customWidth" width="600px">
  474. <div slot="title" >
  475. <el-tabs v-model="createGroupWay">
  476. <el-tab-pane label="新建分组" name="new">
  477. <el-form ref="form2" :model="groupForm" :rules="rules" style="margin-top:40px;">
  478. <el-form-item prop="name">
  479. <el-input v-model="groupForm.name" placeholder="请输入分组名称" maxlength="12"
  480. show-word-limit clearable></el-input>
  481. </el-form-item>
  482. <el-button type="primary" @click="addGroup" style="width:100%;" >创建</el-button>
  483. </el-form>
  484. </el-tab-pane>
  485. <el-tab-pane label="从模板创建" name="template">
  486. <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)">
  487. <el-row >
  488. <el-col :span="22">
  489. <div >{{t.name}}</div>
  490. <div style="margin-top:10px;"><span style="color:#8c8c8c;font-size:12px;" v-for="(s,index) in t.stagesList" :key="s.id">
  491. <i class="el-icon-arrow-right" v-if="index>0"></i>
  492. {{s.stagesName}}</span></div>
  493. </el-col>
  494. <el-col :span="2">
  495. <i class="el-icon-check" v-if="t.selected" style="font-size:20px;color:#409eff;margin-top:12px;"></i>
  496. </el-col>
  497. </el-row>
  498. </el-card>
  499. <el-button type="primary" @click="addTemplateGroup" style="width:100%;" >创建</el-button>
  500. </el-tab-pane>
  501. </el-tabs>
  502. </div>
  503. </el-dialog>
  504. <el-dialog title="修改任务分组" v-if="modGroupDialog" :visible.sync="modGroupDialog" :close-on-click-modal="false" customClass="customWidth" width="300px">
  505. <el-form ref="form2" :model="groupForm" :rules="rules" style="margin-top:10px;">
  506. <el-form-item prop="name">
  507. <el-input v-model="groupForm.name" placeholder="请输入分组名称" maxlength="12"
  508. show-word-limit clearable></el-input>
  509. </el-form-item>
  510. </el-form>
  511. <div slot="footer" class="dialog-footer">
  512. <el-button type="primary" @click="addGroup" style="width:100%;" >保存</el-button>
  513. </div>
  514. </el-dialog>
  515. <!-- 新增任务列表弹出框 -->
  516. <el-dialog title="新增/修改任务列表" v-if="addStageDialog" :visible.sync="addStageDialog" :close-on-click-modal="false" customClass="customWidth" width="300px">
  517. <el-form ref="form2" :model="stageForm" :rules="rules2" >
  518. <el-form-item prop="stagesName">
  519. <el-input v-model="stageForm.stagesName" placeholder="请输入任务列表名称" maxlength="12"
  520. show-word-limit clearable></el-input>
  521. </el-form-item>
  522. </el-form>
  523. <div slot="footer" class="dialog-footer">
  524. <el-button type="primary" @click="addStagePost" style="width:100%;" >保存</el-button>
  525. </div>
  526. </el-dialog>
  527. <!--导出数据条件选择 -->
  528. <el-dialog title="工作计划导出" v-if="exportDialog" :visible.sync="exportDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  529. <el-form ref="form3" >
  530. <el-form-item label="选择类型">
  531. <el-select v-model="exportTaskType" placeholder="全部类型" clearable style="width:350px;">
  532. <el-option label="任务" value="0"></el-option>
  533. <el-option label="里程碑" value="1"></el-option>
  534. <el-option label="风险" value="2"></el-option>
  535. </el-select>
  536. </el-form-item>
  537. </el-form>
  538. <div slot="footer" class="dialog-footer">
  539. <el-button type="primary" @click="exportTask" style="width:100%;" >导出</el-button>
  540. </div>
  541. </el-dialog>
  542. </section>
  543. </template>
  544. <script>
  545. import util from "../../common/js/util";
  546. import draggable from 'vuedraggable';
  547. import tinymce from 'tinymce/tinymce'
  548. import 'tinymce/themes/silver/theme'
  549. import 'tinymce/skins/ui/oxide/skin.css';
  550. import FileCenter from './fileCenter.vue';
  551. import ProjectInfo from './info.vue';
  552. import Summary from './summary.vue';
  553. import Earning from './earning.vue';
  554. // import editor from '@tinymce/tinymce-vue'
  555. // 富文本样式
  556. import 'quill/dist/quill.core.css'
  557. import 'quill/dist/quill.snow.css'
  558. import 'quill/dist/quill.bubble.css'
  559. // 导入富文本
  560. import { quillEditor } from 'vue-quill-editor'
  561. let id=1;
  562. export default {
  563. name: "two-list-headerslots",
  564. display: "Two list header slot",
  565. order: 14,
  566. components: {
  567. draggable,
  568. // editor,
  569. FileCenter,
  570. ProjectInfo,
  571. Summary,
  572. Earning,
  573. quillEditor // 富文本
  574. },
  575. data() {
  576. return {
  577. exportDialog: false,
  578. exportTaskType:null,
  579. groupTemplateList:[],
  580. createGroupWay:'new',
  581. modGroupDialog:false,
  582. subTaskVisible:false,
  583. orderList:[{id:"seq",name:"手动拖拽顺序",isDesc:false},{id:"create_date",name:"创建时间最晚",isDesc:true},
  584. {id:"end_date",name:"截止时间最晚",isDesc:true},
  585. {id:"task_level",name:"优先级最高",isDesc:true}],
  586. order:"seq",
  587. isDesc:false,
  588. taskDataList:[],
  589. displayTable: false,
  590. viewList: [{id:1,name:"全部任务"},{id:2,name:"进行中的任务"},{id:3,name:"已完成的任务"},{id:4,name:"待安排任务"},
  591. {id:5,name:"我创建的任务"},{id:6,name:"我执行的任务"},{id:7,name:"今天的任务"},{id:8,name:"已超期的任务"}],
  592. importanceList:[{id:0,name:"一般"},{id:1,name:"重要"},{id:2,name:"紧急"},],
  593. taskTypeList:[{id:0,name:"任务", icon:"iconfont firerock-iconrenwu"},{id:1,name:"里程碑",icon:"iconfont firerock-iconicon-"},{id:2,name:"风险",icon:"iconfont firerock-iconfengxian"}],
  594. taskTypeColor:['#20A0FF','#8613ad','#bf0404'],
  595. taskTypeIcon:['iconfont firerock-iconrenwu','iconfont firerock-iconicon-','iconfont firerock-iconfengxian'],
  596. taskStatusList:['进行中','已完成','已撤销'],
  597. //优先级
  598. taskLevelColor:['#262626','#E6A23C','#F56C6C'],
  599. stageListHeight:0,
  600. groupWidth:260,
  601. drag: false,
  602. stageDrag: false,
  603. dragging: false,
  604. stageList:[],
  605. selectedGroup:{},
  606. allGroupData:[],
  607. defaultGroupId:null,
  608. addGroupDialog: false,
  609. addStageDialog: false,
  610. groupSearch:null,
  611. groupType:0,//0-分组,1-视图
  612. groupList: [],
  613. groupForm:{},
  614. stageForm:[],
  615. curProjectId:null,
  616. projectList:null,
  617. activeIndex:"1",
  618. activeName:"projectInside",
  619. searchField:null,
  620. keyword:null,
  621. user: JSON.parse(sessionStorage.getItem("user")),
  622. userDetailVisible: false,
  623. userDetail:{},
  624. date: new Date(),
  625. users: [],
  626. tableHeight: 0,
  627. listLoading: false,
  628. subProjectVisible: false,
  629. subProjectList: [],//子项目列表
  630. currentProject:{},
  631. addSubProject: false,
  632. addFormVisible: false,
  633. addLoading: false,
  634. title: "",
  635. addForm: {
  636. name: '',
  637. },
  638. rules: {
  639. name: [{ required: true, message: "请输入分组名称", trigger: "blur" }],
  640. },
  641. rules2: {
  642. stagesName: [{ required: true, message: "请输入任务列表名称", trigger: "blur" }],
  643. },
  644. taskRules : {
  645. name: [{ required: true, message: "请输入任务内容", trigger: "blur" }],
  646. },
  647. sleectId: null,
  648. sleectProjectId: null,
  649. sidebarIndex: null, // 侧边栏索引
  650. url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
  651. count: 0,
  652. textarea2: '',
  653. taskId: null,
  654. commentList: [],
  655. radio: 0,
  656. critic: [], // 评论头像的数组
  657. editorOption: { // 富文本框里面的默认值
  658. placeholder: '请输入文本...',
  659. modules: {
  660. toolbar:[
  661. ['bold', 'italic', 'underline', 'strike'], //加粗,斜体,下划线,删除线
  662. // ['blockquote', 'code-block'], //引用,代码块
  663. [{ 'header': 1 }, { 'header': 2 }], // 标题,键值对的形式;1、2表示字体大小
  664. // [{ 'list': 'ordered'}, { 'list': 'bullet' }], //列表
  665. // [{ 'script': 'sub'}, { 'script': 'super' }], // 上下标
  666. // [{ 'indent': '-1'}, { 'indent': '+1' }], // 缩进
  667. // [{ 'direction': 'rtl' }], // 文本方向
  668. [{ 'size': ['small', false, 'large', 'huge'] }], // 字体大小
  669. [{ 'header': [1, 2, 3, 4, 5, 6, false] }], //几级标题
  670. [{ 'color': [] }, { 'background': [] }], // 字体颜色,字体背景颜色
  671. // [{ 'font': [] }], //字体
  672. [{ 'align': [] }], //对齐方式
  673. ['clean'], //清除字体样式
  674. // ['image','video'] //上传图片、上传视频
  675. ['image'] //上传图片、上传视频
  676. ], //工具栏设置
  677. },
  678. theme: 'snow',
  679. },
  680. textContent: true, // 控制提交
  681. times: null,
  682. text2: '',
  683. // cityOptions : ['渣渣灰', '小小', '嘿嘿', '嘀嘀','版本', '更新', '快速', '欧克'],
  684. // checkedCities: []
  685. checkList: ['小红'],
  686. innerVisible: false // 任务展示弹出层
  687. };
  688. },
  689. methods: {
  690. //删除任务进展
  691. deleteTaskProgress() {
  692. this.http.post('/task-progress/deleteProgress', {id:1},
  693. res => {
  694. if (res.code == "ok") {
  695. } else {
  696. this.$message({
  697. message: res.msg,
  698. type: "error"
  699. });
  700. }
  701. }
  702. );
  703. },
  704. //创建任务进展
  705. addTaskProgress() {
  706. var param = {taskId:0,status:0,content:'输入进展内容',participatorIds:'1,2,3,4,5'};
  707. this.http.post('/task-progress/addProgress', param,
  708. res => {
  709. if (res.code == "ok") {
  710. } else {
  711. this.$message({
  712. message: res.msg,
  713. type: "error"
  714. });
  715. }
  716. }
  717. );
  718. },
  719. //获取任务进展列表
  720. getTaskProgressList(taskId) {
  721. this.http.post('/task-progress/list', {taskId: taskId},
  722. res => {
  723. if (res.code == "ok") {
  724. var list = res.data;
  725. } else {
  726. this.$message({
  727. message: res.msg,
  728. type: "error"
  729. });
  730. }
  731. }
  732. );
  733. },
  734. showExportDialog() {
  735. this.exportDialog = true;
  736. },
  737. exportTask() {
  738. let _this = this;
  739. this.http.post('/task/exportTask', {projectId: this.curProjectId, taskType: this.exportTaskType},
  740. res => {
  741. if (res.code == "ok") {
  742. location.href = res.data;
  743. } else {
  744. this.$message({
  745. message: res.msg,
  746. type: "error"
  747. });
  748. }
  749. }
  750. );
  751. },
  752. sss(){
  753. this.$refs.addRem.style.display="none"
  754. },
  755. addprogress(){ // 添加子任务进展事件
  756. this.$refs.proBox.style.display="block"
  757. this.$refs.addPro.style.display="none"
  758. },
  759. shutPro() { // 关闭任务进展
  760. this.$refs.addPro.style.display="block"
  761. this.$refs.addRem.style.display="none"
  762. this.$refs.proBox.style.display="none"
  763. },
  764. addI() { // 打开选择查看
  765. this.$refs.addRem.style.display="block"
  766. },
  767. load() {
  768. if(this.count >= 0) return
  769. this.count += 2
  770. },
  771. onEditorFocus() {
  772. this.onEditorBlur()
  773. },
  774. subMission() { // 添加
  775. },
  776. handleCheckedCitiesChange(value) {
  777. let checkedCount = value.length;
  778. this.checkAll = checkedCount === this.cities.length;
  779. this.isIndeterminate = checkedCount > 0 && checkedCount < this.cities.length;
  780. },
  781. // 获得焦点时触发
  782. onEditorBlur(){
  783. let theEle = this.$refs.text; // 获取元素
  784. console.log(theEle.value); // 获取到富文本内容
  785. var img = theEle.value.match(/<img[^>]+>/g); // 赛选 img 标签
  786. console.log(img);
  787. var arrImg = ''
  788. for (var j = 0; j < img.length; j++) {
  789. // 正则匹配,摘出img标签下的src里的内容,即capture
  790. img[j].replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, function(match, capture) {
  791. arrImg += capture
  792. });
  793. }
  794. // 原来的字符流大小,单位为字节
  795. var strLen = arrImg.length;
  796. // 计算后得到的文件流大小,单位为字节
  797. var fileSize=parseInt(strLen-(strLen/8)*2);
  798. console.log(fileSize,"字节");
  799. var size = "";
  800. size = (fileSize/1024/1024).toFixed(2);
  801. if (size > 2){
  802. this.textContent = false
  803. this.$message({
  804. showClose: true,
  805. message: '图片超过了2MB,请重新上传',
  806. type: 'warning'
  807. });
  808. }
  809. this.textContent = true
  810. },
  811. // 侧边栏的点击事件
  812. retract() {
  813. if (this.$refs.box.className == 'el-icon-arrow-left') {
  814. this.$refs.box.className = 'el-icon-arrow-right'
  815. } else {
  816. this.$refs.box.className = 'el-icon-arrow-left'
  817. }
  818. // this.$refs.box.className === 'el-icon-arrow-left' ? this.$refs.box.className = 'el-icon-arrow-right' || this.$refs.box.className = 'el-icon-arrow-left'
  819. this.toggleGroup()
  820. },
  821. //
  822. choseTemplate(tIndex) {
  823. this.groupTemplateList.forEach(g=>{
  824. g.selected = false;
  825. })
  826. this.sidebarIndex = tIndex
  827. this.groupTemplateList[tIndex].selected = true;
  828. },
  829. //获取分组模板列表
  830. getGroupTemplate() {
  831. this.http.post('/group-template/getList',{},
  832. res => {
  833. if (res.code == "ok") {
  834. this.groupTemplateList = res.data;
  835. this.groupTemplateList[0].selected = true;
  836. } else {
  837. this.$message({
  838. message: res.msg,
  839. type: "error"
  840. });
  841. }
  842. },
  843. error => {
  844. this.$message({
  845. message: error,
  846. type: "error"
  847. });
  848. });
  849. },
  850. copyGroup(item) {
  851. this.http.post('/task-group/copy',{id: item.id},
  852. res => {
  853. if (res.code == "ok") {
  854. this.getTaskGroups();
  855. } else {
  856. this.$message({
  857. message: res.msg,
  858. type: "error"
  859. });
  860. }
  861. },
  862. error => {
  863. this.$message({
  864. message: error,
  865. type: "error"
  866. });
  867. });
  868. },
  869. //重启项目
  870. startPro() {
  871. this.http.post('/project/start',{id: this.curProjectId},
  872. res => {
  873. if (res.code == "ok") {
  874. this.$message({
  875. message: '重启成功',
  876. type: "success"
  877. });
  878. this.currentProject.status = 1;
  879. } else {
  880. this.$message({
  881. message: res.msg,
  882. type: "error"
  883. });
  884. }
  885. },
  886. error => {
  887. this.$message({
  888. message: error,
  889. type: "error"
  890. });
  891. });
  892. },
  893. //撤销项目
  894. cancelPro() {
  895. this.http.post('/project/cancel',{id: this.curProjectId},
  896. res => {
  897. if (res.code == "ok") {
  898. this.$message({
  899. message: '撤销成功',
  900. type: "success"
  901. });
  902. this.currentProject.status = 3;
  903. } else {
  904. this.$message({
  905. message: res.msg,
  906. type: "error"
  907. });
  908. }
  909. },
  910. error => {
  911. this.$message({
  912. message: error,
  913. type: "error"
  914. });
  915. });
  916. },
  917. //完成项目
  918. finishPro() {
  919. this.http.post('/project/finish',{id: this.curProjectId},
  920. res => {
  921. if (res.code == "ok") {
  922. this.$message({
  923. message: '项目完成',
  924. type: "success"
  925. });
  926. this.currentProject.status = 2;
  927. } else {
  928. this.$message({
  929. message: res.msg,
  930. type: "error"
  931. });
  932. }
  933. },
  934. error => {
  935. this.$message({
  936. message: error,
  937. type: "error"
  938. });
  939. });
  940. },
  941. //删除当前编辑的任务
  942. deleteTask() {
  943. var warning='';
  944. if (this.addForm.subTaskList.length > 0) {
  945. warning='您确定要删除当前任务及其子任务吗?';
  946. } else {
  947. warning='您确定要删除当前任务吗?';
  948. }
  949. this.$confirm(warning, "提示", {
  950. //type: 'warning'
  951. }).then(() => {
  952. this.http.post('/task/delete',{id: this.addForm.id},
  953. res => {
  954. if (res.code == "ok") {
  955. this.addFormVisible = false;
  956. this.getStageList();
  957. } else {
  958. this.$message({
  959. message: res.msg,
  960. type: "error"
  961. });
  962. }
  963. },
  964. error => {
  965. this.$message({
  966. message: error,
  967. type: "error"
  968. });
  969. });
  970. });
  971. },
  972. //tab页签切换
  973. handleClick(tab, event) {
  974. let pathModel = tab.name;
  975. this.$router.push('/'+pathModel+'/'+this.curProjectId);
  976. if (pathModel == 'summary') {
  977. //刷新页面
  978. this.$router.go(0);
  979. }
  980. },
  981. showSubTaskList(task) {
  982. this.subTaskVisible = true;
  983. this.addForm = task;
  984. },
  985. backToParentTask() {
  986. this.getTaskDetail(this.addForm.parentTid);
  987. },
  988. //显示子任务创建卡片
  989. addSubTask() {
  990. this.addFormVisible = true;
  991. this.addForm = {parentTname: this.addForm.name,parentTid: this.addForm.id,projectId: this.addForm.projectId, groupId: this.addForm.groupId, taskLevel:0, planHours: 8, taskType: 0};
  992. this.addLoading = false;
  993. },
  994. //认领任务
  995. addAsMyTask(task) {
  996. this.http.post('/task/addAsMyTask',{id: task.id},
  997. res => {
  998. if (res.code == "ok") {
  999. this.getStageList();
  1000. } else {
  1001. this.$message({
  1002. message: res.msg,
  1003. type: "error"
  1004. });
  1005. }
  1006. },
  1007. error => {
  1008. this.$message({
  1009. message: error,
  1010. type: "error"
  1011. });
  1012. });
  1013. },
  1014. taskLineClick(row, column, event) {
  1015. this.editTask(row);
  1016. },
  1017. //排序发生改变
  1018. orderChange() {
  1019. this.isDesc = this.orderList.filter(o=>o.id == this.order)[0].isDesc;
  1020. if (this.groupType == 0) {
  1021. this.getStageList();
  1022. } else {
  1023. this.getViewTaskList();
  1024. }
  1025. },
  1026. //加载视图任务列表
  1027. getViewTaskList() {
  1028. this.http.post('/task/list',{projectId: this.curProjectId, viewId: this.selectedGroup.id, order: this.order, isDesc: this.isDesc},
  1029. res => {
  1030. if (res.code == "ok") {
  1031. this.taskDataList = res.data;
  1032. console.log(this.taskDataList, '视图任务列表');
  1033. this.taskDataList.forEach(t=>{
  1034. t.isFinish = t.taskStatus==1?true:false;
  1035. });
  1036. } else {
  1037. this.$message({
  1038. message: res.msg,
  1039. type: "error"
  1040. });
  1041. }
  1042. },
  1043. error => {
  1044. this.$message({
  1045. message: error,
  1046. type: "error"
  1047. });
  1048. });
  1049. },
  1050. //阶段拖拽
  1051. onMoveStage(e) {
  1052. var data = {
  1053. groupId:this.selectedGroup.id,
  1054. oldIndex: e.oldIndex,
  1055. newIndex: e.newIndex,};
  1056. this.http.post('/stages/changeStageOrder',data,
  1057. res => {
  1058. if (res.code == "ok") {
  1059. this.getStageList();
  1060. } else {
  1061. this.$message({
  1062. message: res.msg,
  1063. type: "error"
  1064. });
  1065. }
  1066. },
  1067. error => {
  1068. this.$message({
  1069. message: error,
  1070. type: "error"
  1071. });
  1072. });
  1073. },
  1074. onChange(e) {
  1075. var data = {
  1076. id:e.item.id,
  1077. oldIndex: e.oldIndex -1,
  1078. newIndex: e.newIndex -1,
  1079. oldStagesId: e.from.id,
  1080. newStagesId: e.to.id};
  1081. this.http.post('/task/changeOrder',data,
  1082. res => {
  1083. if (res.code == "ok") {
  1084. this.getStageList();
  1085. } else {
  1086. this.$message({
  1087. message: res.msg,
  1088. type: "error"
  1089. });
  1090. }
  1091. },
  1092. error => {
  1093. this.$message({
  1094. message: error,
  1095. type: "error"
  1096. });
  1097. });
  1098. },
  1099. toggleGroup() {
  1100. if (this.groupWidth == 0) {
  1101. this.groupWidth = 260;
  1102. } else {
  1103. this.groupWidth = 0;
  1104. }
  1105. },
  1106. finishTask(task) {
  1107. this.http.post('/task/finish',{id: task.id, taskStatus: task.taskStatus},
  1108. res => {
  1109. if (res.code == "ok") {
  1110. if (this.groupType == 0) {
  1111. this.getStageList();
  1112. } else {
  1113. this.getViewTaskList();
  1114. }
  1115. } else {
  1116. this.$message({
  1117. message: res.msg,
  1118. type: "error"
  1119. });
  1120. }
  1121. },
  1122. error => {
  1123. this.$message({
  1124. message: error,
  1125. type: "error"
  1126. });
  1127. });
  1128. },
  1129. // 点击卡片事件
  1130. editTask(task) {
  1131. console.log(task);
  1132. // this.addForm = JSON.parse(JSON.stringify(task));
  1133. this.addFormVisible = true;
  1134. this.addLoading = false;
  1135. this.title = "编辑任务";
  1136. this.getTaskDetail(task.id);
  1137. this.gain(task); // 获取评论列表
  1138. },
  1139. // 获取评论列表
  1140. gain (task) {
  1141. this.taskId = task.id
  1142. this.http.post('/task-comment/getList', {taskId: task.id},
  1143. res => {
  1144. if (res.code == "ok") {
  1145. this.commentList = res.data
  1146. this.sppk(this.commentList) // 获取参与人的方法
  1147. } else {
  1148. this.$message({
  1149. message: res.msg,
  1150. type: "error"
  1151. });
  1152. }
  1153. },
  1154. error => {
  1155. this.$message({
  1156. message: error,
  1157. type: "error"
  1158. });
  1159. });
  1160. },
  1161. // 获取评论参与人
  1162. sppk(comit) {
  1163. var sk = []
  1164. comit.forEach(function(e){
  1165. sk.push(e.userName)
  1166. })
  1167. this.critic = new Set(sk)
  1168. },
  1169. // 点击发布
  1170. release() {
  1171. if(this.textarea2.length <= 0) return this.$message({message: "请输入内容", type: "error"})
  1172. // console.log(this.taskId);
  1173. this.http.post('/task-comment/add', {taskId: this.taskId, userId: this.user.id, content: this.textarea2},
  1174. res => {
  1175. if(res.code == "ok"){
  1176. this.commentList.push(res.data)
  1177. this.sppk(this.commentList)
  1178. this.textarea2 = ""
  1179. this.contRoll() // 滚动到底部
  1180. } else {
  1181. this.$message({
  1182. message: res.msg,
  1183. type: "error"
  1184. });
  1185. }
  1186. },
  1187. error => {
  1188. this.$message({
  1189. message: error,
  1190. type: "error"
  1191. });
  1192. })
  1193. },
  1194. // 滚动到底部
  1195. contRoll(){
  1196. // console.log("滚动到底部");
  1197. this.$nextTick(() => {
  1198. this.$refs.main.scrollTop = this.$refs.contRoll.scrollHeight;
  1199. })
  1200. },
  1201. getTaskDetail(id) {
  1202. this.http.post('/task/getTask',{id: id},
  1203. res => {
  1204. if (res.code == "ok") {
  1205. this.addForm = res.data;
  1206. this.addForm.createDate = null;
  1207. this.addForm.indate = null;
  1208. this.addLoading = false;
  1209. } else {
  1210. this.$message({
  1211. message: res.msg,
  1212. type: "error"
  1213. });
  1214. }
  1215. },
  1216. error => {
  1217. this.$message({
  1218. message: error,
  1219. type: "error"
  1220. });
  1221. });
  1222. },
  1223. addTask(stage) {
  1224. this.addFormVisible = true;
  1225. this.addForm = {projectId: stage.projectId, groupId: stage.groupId, stagesId: stage.id, taskLevel:0, planHours: 8, taskType: 0};
  1226. this.addLoading = false;
  1227. this.title="创建任务";
  1228. },
  1229. renameStage(item) {
  1230. this.stageForm = JSON.parse(JSON.stringify(item));
  1231. this.addStageDialog = true;
  1232. },
  1233. deleteStage(item) {
  1234. var _this = this;
  1235. var param = {id:item.id, groupId: item.groupId};
  1236. this.$confirm("确认删除吗?", "提示", {
  1237. //type: 'warning'
  1238. }).then(() => {
  1239. this.http.post('/stages/delete',param,
  1240. res => {
  1241. if (res.code == "ok") {
  1242. this.stageList = res.data;
  1243. } else {
  1244. this.$message({
  1245. message: res.msg,
  1246. type: "error"
  1247. });
  1248. }
  1249. },
  1250. error => {
  1251. this.$message({
  1252. message: error,
  1253. type: "error"
  1254. });
  1255. });
  1256. });
  1257. },
  1258. //加载项目内的任务列表
  1259. getStageList() {
  1260. this.http.post('/stages/list',{groupId: this.selectedGroup.id, projectId: this.selectedGroup.projectId, order: this.order, isDesc: this.isDesc},
  1261. res => {
  1262. if (res.code == "ok") {
  1263. this.stageList = res.data;
  1264. this.timess() // 处理时间的方法
  1265. } else {
  1266. this.$message({
  1267. message: res.msg,
  1268. type: "error"
  1269. });
  1270. }
  1271. },
  1272. error => {
  1273. this.$message({
  1274. message: error,
  1275. type: "error"
  1276. });
  1277. });
  1278. },
  1279. timess(){
  1280. var date = new Date()
  1281. let Y = date.getFullYear()
  1282. let M = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : (date.getMonth() + 1)
  1283. let D = date.getDate() < 10 ? ('0' + date.getDate()) : date.getDate()
  1284. this.times = `${Y}-${M}-${D}`
  1285. },
  1286. addStagePost() {
  1287. let param = JSON.parse(JSON.stringify(this.stageForm));
  1288. param.taskList = [];
  1289. this.http.post('/stages/save',param,
  1290. res => {
  1291. if (res.code == "ok") {
  1292. this.stageList = res.data;
  1293. this.addStageDialog = false;
  1294. } else {
  1295. this.$message({
  1296. message: res.msg,
  1297. type: "error"
  1298. });
  1299. }
  1300. },
  1301. error => {
  1302. this.$message({
  1303. message: error,
  1304. type: "error"
  1305. });
  1306. });
  1307. },
  1308. addStage() {
  1309. this.addStageDialog = true;
  1310. this.stageForm = {groupId: this.selectedGroup.id, projectId: this.curProjectId};
  1311. },
  1312. viewChange(index, indexPath) {
  1313. console.log(index);
  1314. this.groupType = 1;
  1315. this.order = "create_date";
  1316. this.isDesc = true;
  1317. this.selectedGroup = this.viewList.filter(g=>g.id == index)[0];
  1318. this.getViewTaskList();
  1319. this.displayTable = true;
  1320. } ,
  1321. groupChange(index, indexPath) {
  1322. console.log(index);
  1323. this.groupType = 0;
  1324. this.order = "seq";
  1325. this.isDesc = false;
  1326. this.selectedGroup = this.groupList.filter(g=>g.id == index)[0];
  1327. this.getStageList();
  1328. this.displayTable = false;
  1329. },
  1330. //本地搜索组
  1331. startSearchGroup() {
  1332. if (this.groupSearch != null || this.groupSearch.length > 0) {
  1333. this.groupList = this.allGroupData.filter(g=>g.name.indexOf(this.groupSearch) >= 0);
  1334. } else {
  1335. this.groupList = this.allGroupData;
  1336. }
  1337. },
  1338. renameGroup(item) {
  1339. this.groupForm = JSON.parse(JSON.stringify(item));
  1340. this.modGroupDialog = true;
  1341. },
  1342. deleteGroup(item) {
  1343. var _this = this;
  1344. this.$confirm("确认删除吗?", "提示", {
  1345. //type: 'warning'
  1346. }).then(() => {
  1347. this.http.post('/task-group/delete',item,
  1348. res => {
  1349. if (res.code == "ok") {
  1350. this.groupList = res.data;
  1351. if (item.id == this.selectedGroup.id) {
  1352. //之前选中的分组被删除了
  1353. if (this.groupList.length > 0) {
  1354. this.defaultGroupId = this.groupList[0].id;
  1355. this.selectedGroup = this.groupList[0];
  1356. } else {
  1357. this.selectedGroup = {};
  1358. }
  1359. }
  1360. } else {
  1361. this.$message({
  1362. message: res.msg,
  1363. type: "error"
  1364. });
  1365. }
  1366. },
  1367. error => {
  1368. this.$message({
  1369. message: error,
  1370. type: "error"
  1371. });
  1372. });
  1373. });
  1374. },
  1375. addTemplateGroup() {
  1376. var param = JSON.parse(JSON.stringify(this.groupTemplateList.filter(g=>g.selected)[0]));
  1377. delete param.stagesList;
  1378. param.projectId = this.curProjectId;
  1379. //
  1380. var k = this.groupTemplateList[this.sidebarIndex].name
  1381. var s = null;
  1382. var xmz = this.groupList.forEach(function(a, b, c){
  1383. if (a.name == k) {
  1384. s = true
  1385. return
  1386. }
  1387. })
  1388. if (s){
  1389. this.addGroupDialog = false;
  1390. return
  1391. }
  1392. //
  1393. this.http.post('/task-group/createFromTemplate',param,
  1394. res => {
  1395. if (res.code == "ok") {
  1396. this.selectedGroup = res.data
  1397. this.sleectId = res.data.id
  1398. this.sleectProjectId = res.data.projectId
  1399. this.addGroupDialog = false;
  1400. // this.getTaskGroups();
  1401. this.getTaskGroup();
  1402. } else {
  1403. this.$message({
  1404. message: res.msg,
  1405. type: "error"
  1406. });
  1407. }
  1408. },
  1409. error => {
  1410. this.$message({
  1411. message: error,
  1412. type: "error"
  1413. });
  1414. });
  1415. },
  1416. // addGroup() {
  1417. // this.http.post('/task-group/save',this.groupForm,
  1418. // res => {
  1419. // if (res.code == "ok") {
  1420. // this.groupList = res.data;
  1421. // this.addGroupDialog = false;
  1422. // this.modGroupDialog = false;
  1423. // if (this.selectedGroup.id == this.groupForm.id) {
  1424. // this.selectedGroup = this.groupForm;
  1425. // }
  1426. // } else {
  1427. // this.$message({
  1428. // message: res.msg,
  1429. // type: "error"
  1430. // });
  1431. // }
  1432. // },
  1433. // error => {
  1434. // this.$message({
  1435. // message: error,
  1436. // type: "error"
  1437. // });
  1438. // });
  1439. // },
  1440. // 重新定义了 addGroup 方法
  1441. addGroup() {
  1442. this.http.post('/task-group/save',this.groupForm,
  1443. res => {
  1444. if (res.code == "ok") {
  1445. this.groupList = res.data;
  1446. this.addGroupDialog = false;
  1447. this.modGroupDialog = false;
  1448. console.log(this.selectedGroup.id);
  1449. if (this.selectedGroup.id !== this.groupForm.id) {
  1450. this.selectedGroup = this.groupForm;
  1451. }
  1452. this.defaultGroupId = this.groupList[this.groupList.length - 1].id
  1453. // this.getTaskGroup();
  1454. this.getStageList()
  1455. } else {
  1456. this.$message({
  1457. message: res.msg,
  1458. type: "error"
  1459. });
  1460. }
  1461. },
  1462. error => {
  1463. this.$message({
  1464. message: error,
  1465. type: "error"
  1466. });
  1467. });
  1468. },
  1469. createGroup() {
  1470. this.addGroupDialog = true;
  1471. this.groupForm = {projectId: this.curProjectId};
  1472. },
  1473. getInsideData() {
  1474. this.getTaskGroups();
  1475. },
  1476. //加载项目内的任务分组
  1477. getTaskGroups() {
  1478. this.http.post('/task-group/list',{projectId: this.curProjectId},
  1479. res => {
  1480. if (res.code == "ok") {
  1481. this.allGroupData = res.data;
  1482. this.groupList = res.data;
  1483. if (this.groupList.length > 0) {
  1484. this.defaultGroupId = this.groupList[0].id;
  1485. this.selectedGroup = this.groupList[0];
  1486. this.getStageList();
  1487. } else {
  1488. //清空任务列表
  1489. this.defaultGroupId = null;
  1490. this.selectedGroup = null;
  1491. this.stageList = [];
  1492. }
  1493. } else {
  1494. this.$message({
  1495. message: res.msg,
  1496. type: "error"
  1497. });
  1498. }
  1499. },
  1500. error => {
  1501. this.$message({
  1502. message: error,
  1503. type: "error"
  1504. });
  1505. });
  1506. },
  1507. // 额外加的
  1508. getTaskGroup() {
  1509. this.http.post('/task-group/list',{projectId: this.curProjectId},
  1510. res => {
  1511. if (res.code == "ok") {
  1512. console.log(res);
  1513. console.log(res.data.length)
  1514. this.allGroupData = res.data;
  1515. this.groupList = res.data;
  1516. if (this.groupList.length > 0) {
  1517. this.defaultGroupId = this.sleectId;
  1518. this.selectedGroup = this.groupList[res.data.length - 1];
  1519. this.getStageList();
  1520. } else {
  1521. //清空任务列表
  1522. this.defaultGroupId = null;
  1523. this.selectedGroup = null;
  1524. this.stageList = [];
  1525. }
  1526. } else {
  1527. this.$message({
  1528. message: res.msg,
  1529. type: "error"
  1530. });
  1531. }
  1532. },
  1533. error => {
  1534. this.$message({
  1535. message: error,
  1536. type: "error"
  1537. });
  1538. });
  1539. },
  1540. //切换项目
  1541. onProjectChange() {
  1542. let path = this.$route.path;
  1543. path = path.substring(0,path.lastIndexOf('/'))+'/'+this.curProjectId;
  1544. this.$router.push(path);
  1545. console.log('this.activeName=='+this.activeName);
  1546. this.getTaskGroups();
  1547. this.$refs.fileCenter.refreshPage();
  1548. this.$refs.projectInfo.refreshPage();
  1549. this.$refs.summary.refreshPage();
  1550. },
  1551. //获取我的项目列表
  1552. getMyProjectList() {
  1553. this.http.post('/project/getProjectList', {
  1554. },
  1555. res => {
  1556. if (res.code == "ok") {
  1557. this.projectList = res.data;
  1558. } else {
  1559. this.$message({
  1560. message: res.msg,
  1561. type: "error"
  1562. });
  1563. }
  1564. },
  1565. error => {
  1566. this.$message({
  1567. message: error,
  1568. type: "error"
  1569. });
  1570. });
  1571. },
  1572. menuSelect() {
  1573. },
  1574. toList() {
  1575. this.$router.push("/list");
  1576. },
  1577. searchList() {
  1578. this.page = 1;
  1579. this.getList();
  1580. },
  1581. //显示用户详情
  1582. showUser(userId) {
  1583. this.userDetailVisible = true;
  1584. this.http.post(this.port.manage.userDetail, {
  1585. userId: userId
  1586. },
  1587. res => {
  1588. if (res.code == "ok") {
  1589. this.userDetail = res.data;
  1590. } else {
  1591. this.$message({
  1592. message: res.msg,
  1593. type: "error"
  1594. });
  1595. }
  1596. },
  1597. error => {
  1598. this.$message({
  1599. message: error,
  1600. type: "error"
  1601. });
  1602. });
  1603. },
  1604. getUsers() {
  1605. this.http.post(this.port.manage.list, {
  1606. departmentId: -1,
  1607. pageIndex: 1,
  1608. pageSize: 99999
  1609. },
  1610. res => {
  1611. if (res.code == "ok") {
  1612. this.users = res.data.records;
  1613. } else {
  1614. this.$message({
  1615. message: res.msg,
  1616. type: "error"
  1617. });
  1618. }
  1619. },
  1620. error => {
  1621. this.$message({
  1622. message: error,
  1623. type: "error"
  1624. });
  1625. });
  1626. },
  1627. //获取项目列表
  1628. getList() {
  1629. this.listLoading = true;
  1630. this.http.post(this.port.project.listPage, {
  1631. pageIndex: this.page,
  1632. pageSize: this.size,
  1633. keyword:this.keyword,
  1634. searchField: this.searchField,
  1635. },
  1636. res => {
  1637. this.listLoading = false;
  1638. if (res.code == "ok") {
  1639. var list = res.data.records;
  1640. for(var i in list) {
  1641. var participator = list[i].participator , str = "";
  1642. for(var j in participator) {
  1643. if(j == participator.length-1) {
  1644. str += participator[j].name
  1645. } else {
  1646. str += participator[j].name + ','
  1647. }
  1648. }
  1649. list[i].userNames = str;
  1650. }
  1651. this.list = list;
  1652. this.total = res.data.total;
  1653. } else {
  1654. this.$message({
  1655. message: res.msg,
  1656. type: "error"
  1657. });
  1658. }
  1659. },
  1660. error => {
  1661. this.listLoading = false;
  1662. this.$message({
  1663. message: error,
  1664. type: "error"
  1665. });
  1666. });
  1667. },
  1668. submitInsert() {
  1669. if (this.textContent !== true) return this.$message({
  1670. showClose: true,
  1671. message: '图片太大,请重新上传',
  1672. type: 'warning'
  1673. });
  1674. this.$refs.form1.validate(valid => {
  1675. if (valid) {
  1676. delete this.addForm.subTaskList;
  1677. this.http.post('/task/save',this.addForm,
  1678. res => {
  1679. if (res.code == "ok") {
  1680. this.$message({
  1681. message: "提交成功",
  1682. type: "success"
  1683. });
  1684. if (this.addForm.parentTid == null) {
  1685. this.addFormVisible = false;
  1686. if (this.groupType == 0) {
  1687. this.getStageList();
  1688. } else {
  1689. this.getViewTaskList();
  1690. }
  1691. } else {
  1692. this.backToParentTask();
  1693. }
  1694. } else {
  1695. this.$message({
  1696. message: res.msg,
  1697. type: "error"
  1698. });
  1699. }
  1700. },
  1701. error => {
  1702. this.$message({
  1703. message: error,
  1704. type: "error"
  1705. });
  1706. }
  1707. );
  1708. }
  1709. });
  1710. },
  1711. // 删除
  1712. deletePro(i, item) {
  1713. this.$confirm("确定要项目" + item.projectName + "吗?","删除项目", {
  1714. confirmButtonText: "确定",
  1715. cancelButtonText: "取消",
  1716. type: "warning"
  1717. })
  1718. .then(() => {
  1719. this.listLoading = true;
  1720. this.http.post(this.port.project.delete,{
  1721. id: item.id
  1722. },
  1723. res => {
  1724. this.listLoading = false;
  1725. if (res.code == "ok") {
  1726. this.$message({
  1727. message: "删除成功",
  1728. type: "success"
  1729. });
  1730. this.getList();
  1731. } else {
  1732. this.$message({
  1733. message: res.msg,
  1734. type: "error"
  1735. });
  1736. }
  1737. },
  1738. error => {
  1739. this.listLoading = false;
  1740. this.$message({
  1741. message: error,
  1742. type: "error"
  1743. });
  1744. }
  1745. );
  1746. })
  1747. .catch(() => {});
  1748. },
  1749. detail(i) {
  1750. this.$router.push("/list/" + this.list[i].id + "/" + this.list[i].projectName);
  1751. },
  1752. getDetail() {
  1753. this.http.post('/project/detail',{
  1754. id: this.curProjectId
  1755. },
  1756. res => {
  1757. if (res.code == "ok") {
  1758. this.currentProject = res.data;
  1759. } else {
  1760. }
  1761. },
  1762. error => {
  1763. this.$message({
  1764. message: error,
  1765. type: "error"
  1766. });
  1767. }
  1768. );
  1769. },
  1770. },
  1771. created() {
  1772. let height = window.innerHeight;
  1773. this.tableHeight = height - 135;
  1774. this.stageListHeight = this.tableHeight - 45;
  1775. const that = this;
  1776. window.onresize = function temp() {
  1777. that.tableHeight = window.innerHeight - 135;
  1778. that.stageListHeight = that.tableHeight - 45;
  1779. console.log('stageList height=='+that.stageListHeight);
  1780. };
  1781. },
  1782. mounted() {
  1783. this.curProjectId = parseInt(this.$route.params.id);
  1784. this.activeName = this.$route.path.split("/")[1];
  1785. this.getDetail();
  1786. this.getUsers();
  1787. this.getMyProjectList();
  1788. this.getInsideData();
  1789. this.getGroupTemplate();
  1790. // tinymce.init({});
  1791. }
  1792. };
  1793. </script>
  1794. <style >
  1795. .flip-list-move {
  1796. transition: transform 0.5s;
  1797. }
  1798. .no-move {
  1799. transition: transform 0s;
  1800. }
  1801. .taskStage {
  1802. margin:10px;
  1803. display:inline-block;
  1804. vertical-align:top;
  1805. }
  1806. .taskList {
  1807. padding:7px;
  1808. width:300px;
  1809. }
  1810. .taskList .stage {
  1811. font-weight:bold;
  1812. }
  1813. .taskCard {
  1814. background: #fff;
  1815. margin: 5px 0px;
  1816. padding:5px;
  1817. border: 1px solid #e6e6e6;
  1818. border-radius: 3px;
  1819. box-shadow: 3px 3px 3px #e6e6e6;
  1820. min-height:60px;
  1821. position: relative;
  1822. border-radius: 3px;
  1823. overflow: hidden;
  1824. }
  1825. .taskImg {
  1826. position: absolute;
  1827. box-sizing: border-box;
  1828. width: 100%;
  1829. height: 100%;
  1830. top: 0;
  1831. left: 0;
  1832. }
  1833. .taskImg img{
  1834. position: absolute;
  1835. top: -1px;
  1836. }
  1837. .hong:hover {
  1838. border-top: 1px solid #ff0000;
  1839. }
  1840. .huang:hover {
  1841. border-top: 1px solid #ff9600;
  1842. }
  1843. .hui:hover {
  1844. border-top: 1px solid #c9c9c9;
  1845. }
  1846. .taskCard:hover {
  1847. cursor: move;
  1848. }
  1849. .chosen {
  1850. background-color: #000 !important;
  1851. color: #fff;
  1852. }
  1853. .ghost {
  1854. background-color: #fafafa !important;
  1855. }
  1856. .taskCard .cb {
  1857. margin-right:5px;
  1858. }
  1859. .item {
  1860. background:#fff;
  1861. }
  1862. .input-with-select .el-input-group__prepend {
  1863. background-color: #fff;
  1864. }
  1865. .el-tabs__item {
  1866. height:45px ;
  1867. }
  1868. .projectCls {
  1869. margin-left:10px;margin-right:10px;
  1870. }
  1871. .heavyTxt {
  1872. font-weight:bold;
  1873. }
  1874. .el-tabs__nav-wrap::after {
  1875. height:0.5px;
  1876. }
  1877. .user_name_icon {
  1878. text-align:center;border-radius:50%;color:white;float:right;font-size:10px;width:30px;height:30px;line-height:30px;
  1879. transform: scale(0.8);
  1880. }
  1881. .task_name {
  1882. color:#262626;
  1883. display:inline-block;
  1884. max-width: 235px;
  1885. height: 25px;
  1886. overflow: hidden;
  1887. white-space: nowrap;
  1888. text-overflow: ellipsis;
  1889. }
  1890. .task_name span{
  1891. position: relative;
  1892. top: 8px;
  1893. }
  1894. .cb {
  1895. position: relative;
  1896. top: -2px;
  1897. }
  1898. .group_style {
  1899. border-radius: 5px;margin:2px 0px 2px 0px;height:40px;line-height:40px;
  1900. }
  1901. .el-tabs__nav-wrap::after {
  1902. height:1px;
  1903. }
  1904. .el-tabs__header {
  1905. margin:0 !important;
  1906. }
  1907. .single_line {
  1908. overflow: hidden;text-overflow:ellipsis;white-space: nowrap;
  1909. }
  1910. .sub_task_num {
  1911. font-size:10px;
  1912. color:#666;
  1913. }
  1914. .template_box {
  1915. margin:20px 0px;
  1916. }
  1917. /* 项目阶段侧边栏样式 */
  1918. .sidebar {
  1919. width: 2px;
  1920. background: #dddddd;
  1921. position: relative;
  1922. }
  1923. .sidebar:hover {
  1924. background: #20a0ff;
  1925. }
  1926. .sidebar:hover .etui {
  1927. background: #20a0ff;
  1928. border: #20a0ff;
  1929. color: #fff;
  1930. }
  1931. .etui {
  1932. width: 15px;
  1933. height: 40px;
  1934. background: #fff;
  1935. border: 1px solid #dddddd;
  1936. position: absolute;
  1937. top: 50%;
  1938. left: 0%;
  1939. transform: translate(6%, -50%);
  1940. color: rgb(192, 191, 191);
  1941. box-sizing: border-box;
  1942. }
  1943. .etui i {
  1944. display: inline-block;
  1945. padding-top: 90%;
  1946. /* padding-left: 15%; */
  1947. font-weight: bold;
  1948. }
  1949. /* bug问题 */
  1950. .task {
  1951. box-sizing: border-box;
  1952. padding-left: 10px;
  1953. padding-right: 5px;
  1954. }
  1955. /* 评论部分 */
  1956. .remark {
  1957. width: 500px;
  1958. height: 100%;
  1959. background: #fff;
  1960. position: absolute;
  1961. top: 0;
  1962. right: -500px;
  1963. border-left: 3px solid #dddddd;
  1964. }
  1965. .jm {
  1966. margin-left: -500px;
  1967. }
  1968. .bj {
  1969. float: left;
  1970. width: 90%;
  1971. overflow: hidden;
  1972. height: 65px;
  1973. white-space: nowrap;
  1974. text-overflow: ellipsis;
  1975. }
  1976. .bj span {
  1977. width: 50px;
  1978. height: 50px;
  1979. display: inline-block;
  1980. border-radius: 50%;
  1981. color: #fff;
  1982. text-align: center;
  1983. float: left;
  1984. margin-right: 20px;
  1985. margin-top: 10px;
  1986. line-height: 50px;
  1987. }
  1988. .player {
  1989. height: 15%;
  1990. box-sizing: border-box;
  1991. padding-left: 15px;
  1992. border-bottom: 1px solid #dddddd;
  1993. }
  1994. .player p {
  1995. margin: 0;
  1996. padding: 2% 0;
  1997. font-size: 18px;
  1998. }
  1999. .player .el-image {
  2000. border-radius: 50%;
  2001. margin-right: 10px;
  2002. }
  2003. .subject {
  2004. height: 60%;
  2005. box-sizing: border-box;
  2006. }
  2007. .sub-all {
  2008. font-size: 20px;
  2009. padding: 15px 0 15px 15px;
  2010. }
  2011. .sub-details {
  2012. width: 100%;
  2013. height: 87%;
  2014. padding-right: 15px;
  2015. box-sizing: border-box;
  2016. overflow: hidden;
  2017. overflow-y: scroll
  2018. }
  2019. .sub-details li {
  2020. list-style:none
  2021. }
  2022. /* 红色背景显示日期 */
  2023. .element_span {
  2024. display: inline-block;
  2025. background: #e62412;
  2026. color: #fff;
  2027. border-radius: 5px;
  2028. }
  2029. .pro_btn{
  2030. display: inline-block;
  2031. float: right;
  2032. }
  2033. </style>
  2034. <style lang="scss" scoped>
  2035. .counli {
  2036. em {
  2037. font-style: normal;
  2038. display: inline-block;
  2039. margin-left: 9%;
  2040. }
  2041. span {
  2042. float: right;
  2043. }
  2044. }
  2045. .carts {
  2046. position: relative;
  2047. .el-image{
  2048. border-radius: 50%;
  2049. float: left;
  2050. width: 20%;
  2051. }
  2052. i {
  2053. width: 30px;
  2054. height: 30px;
  2055. // background: #778899;
  2056. display: inline-block;
  2057. float: left;
  2058. border-radius:50%;
  2059. font-style:normal;
  2060. font-size: 12px;
  2061. line-height: 30px;
  2062. text-align: center;
  2063. color: #fff;
  2064. background: #778899;
  2065. }
  2066. div {
  2067. text-align: left;
  2068. p {
  2069. text-align: left;
  2070. margin-left: 10px;
  2071. margin-left: 13%;
  2072. }
  2073. em {
  2074. display: block;
  2075. font-style: normal;
  2076. margin-left: 13%;
  2077. }
  2078. }
  2079. span {
  2080. font-size: 10px;
  2081. float: right;
  2082. margin-top: -40px;
  2083. }
  2084. }
  2085. .issue {
  2086. // height: 20%;
  2087. // position: relative;
  2088. // z-index: 4;
  2089. .zh{
  2090. position: relative;
  2091. width: 100%;
  2092. height: 100%;
  2093. }
  2094. .textareays {
  2095. background: #000;
  2096. height: 140px;
  2097. border: 0;
  2098. .el-textarea__inner {
  2099. height: 85%;
  2100. }
  2101. }
  2102. .issue-button {
  2103. position: absolute;
  2104. bottom: 20px ;
  2105. right: 0;
  2106. }
  2107. }
  2108. .issue-input {
  2109. position: absolute;
  2110. bottom: 85px;
  2111. }
  2112. .scop_span {
  2113. display: inline-block;
  2114. padding: 2px 5px;
  2115. }
  2116. </style>
  2117. <style>
  2118. .ql-snow .ql-picker.ql-size .ql-picker-label::before,
  2119. .ql-snow .ql-picker.ql-size .ql-picker-item::before {
  2120. content: "14px" !important;
  2121. position: relative;
  2122. top: -8px;
  2123. }
  2124. .ql-snow .ql-picker.ql-size .ql-picker-label[data-value="small"]::before,
  2125. .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="small"]::before {
  2126. content: "10px" !important;
  2127. }
  2128. .ql-snow .ql-picker.ql-size .ql-picker-label[data-value="large"]::before,
  2129. .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="large"]::before {
  2130. content: "18px" !important;
  2131. }
  2132. .ql-snow .ql-picker.ql-size .ql-picker-label[data-value="huge"]::before,
  2133. .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="huge"]::before {
  2134. content: "32px" !important;
  2135. }
  2136. .ql-snow .ql-picker.ql-header .ql-picker-label::before,
  2137. .ql-snow .ql-picker.ql-header .ql-picker-item::before {
  2138. content: "文本" !important;
  2139. position: relative;
  2140. top: -8px;
  2141. }
  2142. .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before,
  2143. .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before {
  2144. content: "标题1" !important;
  2145. }
  2146. .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before,
  2147. .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before {
  2148. content: "标题2" !important;
  2149. }
  2150. .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before,
  2151. .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before {
  2152. content: "标题3" !important;
  2153. }
  2154. .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="4"]::before,
  2155. .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before {
  2156. content: "标题4" !important;
  2157. }
  2158. .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="5"]::before,
  2159. .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before {
  2160. content: "标题5" !important;
  2161. }
  2162. .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="6"]::before,
  2163. .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="6"]::before {
  2164. content: "标题6" !important;
  2165. }
  2166. .ql-snow .ql-picker.ql-font .ql-picker-label::before,
  2167. .ql-snow .ql-picker.ql-font .ql-picker-item::before {
  2168. content: "标准字体" !important;
  2169. }
  2170. .ql-snow .ql-picker.ql-font .ql-picker-label[data-value="serif"]::before,
  2171. .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="serif"]::before {
  2172. content: "衬线字体" !important;
  2173. }
  2174. .ql-snow .ql-picker.ql-font .ql-picker-label[data-value="monospace"]::before,
  2175. .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="monospace"]::before {
  2176. content: "等宽字体" !important;
  2177. }
  2178. /* .ql-picker-label {
  2179. position: relative;
  2180. } */
  2181. .ql-picker-label svg {
  2182. position: relative;
  2183. top: -6px;
  2184. }
  2185. /* 任务进展 */
  2186. .progress {
  2187. border: 1px solid #ddd;
  2188. border-radius: 5px;
  2189. width: 100%;
  2190. box-sizing: border-box;
  2191. padding: 15px;
  2192. position: relative;
  2193. }
  2194. .remind {
  2195. width: 95px;
  2196. height: 60%;
  2197. overflow-y:auto;
  2198. position: absolute;
  2199. background: #fff;
  2200. padding: 10px;
  2201. left: 0;
  2202. top: 0;
  2203. border: 1px solid #ddd;
  2204. z-index: 999999;
  2205. }
  2206. .rala1 .el-radio__input.is-checked + .el-radio__label {
  2207. color: #43d14f !important;
  2208. }
  2209. .rala1 .el-radio__input.is-checked .el-radio__inner {
  2210. background: #43d14f !important;
  2211. border-color: #43d14f !important;
  2212. }
  2213. .rala2 .el-radio__input.is-checked + .el-radio__label {
  2214. color: #fd7624 !important;
  2215. }
  2216. .rala2 .el-radio__input.is-checked .el-radio__inner {
  2217. background: #fd7624 !important;
  2218. border-color: #fd7624 !important;
  2219. }
  2220. .rala3 .el-radio__input.is-checked + .el-radio__label {
  2221. color: #fd4d47 !important;
  2222. }
  2223. .rala3 .el-radio__input.is-checked .el-radio__inner {
  2224. background: #fd4d47 !important;
  2225. border-color: #fd4d47 !important;
  2226. }
  2227. /* 任务进展列表 */
  2228. .elCard {
  2229. width: 100%;
  2230. padding: 15px;
  2231. box-sizing: border-box;
  2232. border: 1px solid #EBEEF5;
  2233. }
  2234. .elCard_qu {
  2235. float: right;
  2236. margin-right: 15px;
  2237. }
  2238. .integrity {
  2239. padding: 15px;
  2240. }
  2241. .write {}
  2242. </style>