list.vue 76 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730
  1. <template>
  2. <section>
  3. <!--工具条-->
  4. <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
  5. <el-form :inline="true">
  6. <div style="margin-left: 20px;display: inline-block">
  7. <el-form-item label="任务列表">
  8. </el-form-item>
  9. </div>
  10. <el-form-item >
  11. <div style="margin-left: 8px">
  12. <!-- <el-input style="float:left;" v-model="keyword" class="input-with-select" placeholder="请输入项目名称关键字" clearable="true"> -->
  13. <el-select v-model="searchField" style="width:120px;" slot="prepend" placeholder="请选择">
  14. <el-option label="进行中" value="0" @click.native="hiddens()"></el-option>
  15. <el-option label="已完成" value="1" @click.native="hiddens()"></el-option>
  16. </el-select>
  17. <!-- <el-button slot="append" @click="searchList" icon="el-icon-search"></el-button> -->
  18. <!-- </el-input> -->
  19. </div>
  20. </el-form-item>
  21. <!-- <el-form-item style="float:right;">
  22. <el-link type="primary" :underline="false" @click="handleAdd(-1,null)">新增任务</el-link>
  23. </el-form-item> -->
  24. <div style="margin-left: 40px;display: inline-block">
  25. <el-form-item label="类型">
  26. </el-form-item>
  27. </div>
  28. <el-form-item >
  29. <div style="margin-left: 8px">
  30. <!-- <el-input style="float:left;" v-model="keyword" class="input-with-select" placeholder="请输入项目名称关键字" clearable="true"> -->
  31. <el-select v-model="typeField" style="width:120px;" slot="prepend" placeholder="请选择" clearable @change="hiddens()">
  32. <!-- <el-option label="任务" value="0" @click.native="hiddens()"></el-option>
  33. <el-option label="里程碑" value="1" @click.native="hiddens()"></el-option>
  34. <el-option label="风险" value="2" @click.native="hiddens()"></el-option> -->
  35. <el-option label="任务" value="0"></el-option>
  36. <el-option label="里程碑" value="1"></el-option>
  37. <el-option label="风险" value="2"></el-option>
  38. </el-select>
  39. <!-- <el-button slot="append" @click="searchList" icon="el-icon-search"></el-button> -->
  40. <!-- </el-input> -->
  41. </div>
  42. </el-form-item>
  43. <el-form-item >
  44. <div style="margin-left: 80px">
  45. <el-select v-model="dateType" style="width:120px;" slot="prepend" placeholder="请选择">
  46. <el-option label="开始时间" :value="0" @click.native="hiddens()"></el-option>
  47. <el-option label="截至时间" :value="1" @click.native="hiddens()"></el-option>
  48. </el-select>
  49. </div>
  50. </el-form-item>
  51. <el-form-item >
  52. <div style="margin-left: 8px">
  53. <el-date-picker
  54. v-model="dateSelect"
  55. type="daterange"
  56. range-separator="-"
  57. start-placeholder="区间"
  58. end-placeholder="区间"
  59. value-format="yyyy-MM-dd"
  60. clearable
  61. @change="hiddens()">
  62. </el-date-picker>
  63. </div>
  64. </el-form-item>
  65. </el-form>
  66. </el-col>
  67. <div style="display: flex;width: 100%;">
  68. <div class="classification">
  69. <div>
  70. <p :class="idx == 0 ? 'on' : ''" @click="switchs(0)" v-if="permissions.projectView || permissions.projectManagement">全部任务</p>
  71. <p :class="idx == 1 ? 'on' : ''" @click="switchs(1)">我执行的</p>
  72. <p :class="idx == 2 ? 'on' : ''" @click="switchs(2)">我创建的</p>
  73. </div>
  74. </div>
  75. <div style="max-width: 94%;min-width: 90%">
  76. <!--列表-->
  77. <el-table :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
  78. <el-table-column type="index" width="60">
  79. <template slot-scope="scope" >
  80. {{scope.$index+1+(page-1)*size}}
  81. </template>
  82. </el-table-column>
  83. <el-table-column prop="stagesName" label="任务阶段" sortable width="180" @mouseover="mouseOver">
  84. </el-table-column>
  85. <el-table-column prop="name" label="任务名称" sortable width="330">
  86. <template slot-scope="scope">
  87. <div v-if="scope.row.name.length > 20">
  88. <el-popover trigger="hover" placement="top" width="330" v-if="scope.row.name">
  89. <p id="caseContent">{{scope.row.name}}</p>
  90. <div slot="reference" class="name-wrapper">
  91. <div class="cal" >
  92. <el-link type="primary" @click="editTask(scope.row)">{{scope.row.name}}</el-link>
  93. </div>
  94. </div>
  95. </el-popover>
  96. </div>
  97. <div v-else>
  98. <div class="cal">
  99. <el-link type="primary" @click="editTask(scope.row)">{{scope.row.name}}</el-link>
  100. </div>
  101. </div>
  102. </template>
  103. </el-table-column>
  104. <el-table-column prop="projectName" label="项目名称" sortable width="260" show-overflow-tooltip>
  105. <template slot-scope="scope">
  106. <el-link type="primary" :href="'#/projectInside/'+scope.row.projectId">{{scope.row.projectName}}</el-link>
  107. </template>
  108. </el-table-column>
  109. <el-table-column prop="executorName" label="执行人" sortable width="130">
  110. <template slot-scope="scope">
  111. <!-- <el-link type="primary" @click="showUser(scope.row.executorId)">{{scope.row.executorName}}</el-link> -->
  112. <span>{{scope.row.executorName}}</span>
  113. </template>
  114. </el-table-column>
  115. <el-table-column prop="startDate" label="开始时间" sortable width="180"></el-table-column>
  116. <el-table-column prop="endDate" label="截止时间" width="260" fixed="right" sortable>
  117. <template slot-scope="scope">
  118. <div style="display: flex;justify-content: space-between;padding-right: 40px">
  119. <span style="display: inline-block;margin-right: 55px">
  120. <span :class="judgedate(scope.row.endDate) && searchField == '0' && scope.row.taskStatus == 0 ? 'redwarningspan autodatespan' : 'autodatespan'">{{scope.row.endDate}}</span>
  121. </span>
  122. <el-button v-if="searchField == 0" size="small" type="primary" @click="completes(scope.row.id, 0)">完成</el-button>
  123. <el-button v-if="searchField == 1" size="small" type="warning" @click="completes(scope.row.id, 1)">重启</el-button>
  124. </div>
  125. </template>
  126. </el-table-column>
  127. </el-table>
  128. <!--工具条-->
  129. <el-col :span="24" class="toolbar">
  130. <el-pagination
  131. @size-change="handleSizeChange"
  132. @current-change="handleCurrentChange"
  133. :page-sizes="[20, 50 , 80 , 100]"
  134. :page-size="20"
  135. :current-page="page"
  136. layout="total, sizes, prev, pager, next"
  137. :total="total"
  138. style="float:right;"
  139. ></el-pagination>
  140. </el-col>
  141. </div>
  142. </div>
  143. <!--新增界面-->
  144. <!-- <el-dialog :title="title" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth" width="600px">
  145. <el-form ref="form1" :model="addForm" :rules="rules" label-width="100px">
  146. <el-form-item label="任务名称" >
  147. <el-input v-model="addForm.code" :disabled="user.role==0" placeholder="请输入项目编号" clearable></el-input>
  148. </el-form-item>
  149. <el-form-item label="项目名称" prop="name">
  150. <el-input v-model="addForm.name" :disabled="user.role==0" placeholder="请输入项目名称" clearable></el-input>
  151. </el-form-item>
  152. <el-form-item label="全部参与者">
  153. <el-select v-model="addForm.userId" multiple filterable placeholder="请选择参与者" style="width:100%;" @change="changeParticipator">
  154. <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id"></el-option>
  155. </el-select>
  156. </el-form-item>
  157. <el-form-item label="主要负责人" >
  158. <el-select v-model="addForm.inchargerId" :disabled="addForm.userId.length==0 || user.role==0" filterable placeholder="请选择负责人" style="width:100%;" @change="changeIncharger">
  159. <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id"></el-option>
  160. </el-select>
  161. </el-form-item>
  162. </el-form>
  163. <div slot="footer" class="dialog-footer">
  164. <el-button @click.native="addFormVisible = false">取消</el-button>
  165. <el-button type="primary" @click="submitInsert" :loading="addLoading">提交</el-button>
  166. </div>
  167. </el-dialog> -->
  168. <!--用户详细信息弹出框-->
  169. <el-dialog title="查看详情" v-if="userDetailVisible" :visible.sync="userDetailVisible" :close-on-click-modal="false" customClass="customWidth" width="400px">
  170. <div class="line"><span>姓名</span><span>{{userDetail.name}}</span></div>
  171. <div class="line"><span>手机号码</span><span>{{userDetail.phone}}</span></div>
  172. <div class="line"><span>部门</span><span>{{userDetail.departmentName}}</span></div>
  173. <div class="line"><span>成本</span><span>{{userDetail.cost}}元/小时</span></div>
  174. <div slot="footer" class="dialog-footer">
  175. <el-button type="primary" @click="userDetailVisible = false" >确定</el-button>
  176. </div>
  177. </el-dialog>
  178. <!-- 子项目列表 -->
  179. <el-dialog title="子项目列表" show-header="false" v-if="subProjectVisible" :visible.sync="subProjectVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  180. <el-table :data="subProjectList" highlight-current-row height="400" style="width: 100%;">
  181. <el-table-column type="index" width="60" label="序号">
  182. <template slot-scope="scope" >
  183. {{scope.$index+1+(page-1)*size}}
  184. </template>
  185. </el-table-column>
  186. <el-table-column prop="name" label="名称" ></el-table-column>
  187. <el-table-column label="操作" width="150">
  188. <template slot-scope="scope" >
  189. <el-button size="small" type="primary" @click="addNewSubProject(scope.row)">编辑</el-button>
  190. <el-button size="small" type="danger" @click="deleteSubPro(scope.row)">删除</el-button>
  191. </template>
  192. </el-table-column>
  193. </el-table>
  194. <div slot="footer" class="dialog-footer">
  195. <el-button type="primary" @click="subProjectVisible = false" >关闭</el-button>
  196. <el-button type="primary" @click="addNewSubProject()" >新增子项目</el-button>
  197. </div>
  198. </el-dialog>
  199. <!-- 新增子项目弹出框 -->
  200. <!-- <el-dialog title="新增/修改子项目" v-if="addSubProject" :visible.sync="addSubProject" :close-on-click-modal="false" customClass="customWidth" width="500px">
  201. <el-form ref="form2" :model="addForm" :rules="rules" label-width="100px">
  202. <el-form-item label="项目名称" prop="name">
  203. <el-input v-model="addForm.name" placeholder="请输入项目名称" clearable></el-input>
  204. </el-form-item>
  205. </el-form>
  206. <div slot="footer" class="dialog-footer">
  207. <el-button @click.native="addSubProject = false">取消</el-button>
  208. <el-button type="primary" @click="submitInsertSubProject" :loading="addLoading">提交456</el-button>
  209. </div>
  210. </el-dialog> -->
  211. <!-- 任务详情信息弹出框 -->
  212. <el-dialog :class="addForm.id==null?'':'jm'" :title="title" v-if="addFormVisible" :visible.sync="addFormVisible"
  213. :close-on-click-modal="false" customClass="customWidth" width="800px">
  214. <!-- <div style="width: 200%;height:80%;position: absolute;right:-100%;top:0;background:#000;opacity: 0;" @click="sss"></div> -->
  215. <el-form ref="form1" :model="addForm" :rules="taskRules" label-width="100px">
  216. <!--子任务需要选择任务列表 -->
  217. <el-form-item label="任务列表" prop="stages" v-if="addForm.parentTid != null">
  218. <el-select v-model="addForm.stagesId" style="width:100%;" >
  219. <el-option v-for="item in stageList" :key="item.id" :label="item.stagesName" :value="item.id"></el-option>
  220. </el-select>
  221. </el-form-item>
  222. <el-form-item label="类型">
  223. <el-select v-model="addForm.taskType" style="width:100%;" :disabled="this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id">
  224. <el-option v-for="item in taskTypeList" :key="item.id" :label="item.name" :value="item.id">
  225. <i :class="item.icon" ></i>
  226. <span>{{item.name}}</span>
  227. </el-option>
  228. </el-select>
  229. </el-form-item>
  230. <el-form-item label="任务内容" prop="name">
  231. <el-input v-model="addForm.name" :maxlength="40" :disabled="this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id" placeholder="请输入任务内容" clearable></el-input>
  232. </el-form-item>
  233. <el-form-item :label="addForm.taskType == 1 ? '截至时间' : '开始时间'" :prop="addForm.taskType == 1 ? 'endDate' : 'startDate'">
  234. <el-date-picker v-model="addForm.startDate" type="date" style="width:40%;" value-format="yyyy-MM-dd"
  235. placeholder="请选择日期" :disabled="this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id" v-if="addForm.taskType != 1"></el-date-picker>
  236. <span style="margin-left:30px;margin-right:10px;" v-if="addForm.taskType != 1">截止时间</span>
  237. <el-date-picker v-model="addForm.endDate" type="date" value-format="yyyy-MM-dd"
  238. placeholder="请选择日期" :disabled="this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id"></el-date-picker>
  239. </el-form-item>
  240. <div style="border: 1px solid #ddd;margin:5px 0;padding:5px 0;">
  241. <el-form-item :label="'执行人'+(index+1)" v-for="(executorItem, index) in addForm.executorListFront" :key="index">
  242. <el-select v-model="executorItem.executorId" :disabled="addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id" size="small" filterable clearable placeholder="请选择执行人" style="width:40%;" @change="$forceUpdate()">
  243. <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id"></el-option>
  244. </el-select>
  245. <span style="margin-left:30px;margin-right:10px;">计划工时</span>
  246. <el-input-number size="small" :disabled="addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id" v-model="executorItem.planHours" style="width:30%;" :min="1" :max="100" placeholder="请输入计划工作时长,单位小时" ></el-input-number ><span style="margin-left:10px;">小时</span>
  247. <!--移除执行人 -->
  248. <i class="el-icon-delete" v-if="index>0 && (addForm.id == null|| user.id == addForm.createrId || currentProject.inchargerId == user.id)" style="margin-left:5px" @click="removeExecutorLine(index)"></i>
  249. </el-form-item>
  250. <el-link type="primary" v-if="addForm.executorListFront.length<10&& (addForm.id == null|| user.id == addForm.createrId || currentProject.inchargerId == user.id)" style="margin-left:35px;" @click="addExecutorLine">添加执行人</el-link>
  251. </div>
  252. <el-form-item label="优先级">
  253. <el-select v-model="addForm.taskLevel" style="width:100%;" >
  254. <el-option v-for="item in importanceList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  255. </el-select>
  256. </el-form-item>
  257. <!-- 富文本 -->
  258. <el-form-item label="详细描述" style="height: 200px">
  259. <!-- <Editor id="tinymce" v-model="tinymceHtml" :init="editorInit"></Editor> -->
  260. <!-- <el-input type="textarea" v-model="addForm.taskDesc" :rows="3"></el-input> -->
  261. <!-- <quill-edito v-model="addForm.taskDesc"></quill-edito> -->
  262. <quill-editor style="height: 150px" ref="text" v-model="addForm.taskDesc" class="myQuillEditor" :options="editorOption" @blur="onEditorBlur($event)" @focus="onEditorFocus($event)"/>
  263. </el-form-item>
  264. <!-- 富文本 -->
  265. <div v-if="addForm.id != null">
  266. <el-divider ></el-divider>
  267. <!-- 任务进展 -->
  268. <p ><i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">任务进展</i>
  269. <span ref="addPro" style="display: block; float:right;"><el-link @click="addprogress">添加任务进展</el-link></span>
  270. </p>
  271. <!-- 任务进展展示 -->
  272. <div style="display: none;" ref="proBox" class="progress">
  273. <!-- <el-form :model="> -->
  274. <el-radio-group v-model="radio">
  275. <el-radio :label="0" class="rala1">状态正常</el-radio>
  276. <el-radio :label="1" class="rala2">存在风险</el-radio>
  277. <el-radio :label="2" class="rala3">进展逾期</el-radio>
  278. </el-radio-group>
  279. <el-input
  280. type="textarea"
  281. border="0"
  282. :autosize="{ minRows: 2, maxRows: 6}"
  283. placeholder="请输入详细进展描述"
  284. v-model.trim="text2"
  285. style="margin:10px 0 0 0">
  286. </el-input>
  287. <h4 style="font-weight: normal;">提醒谁查看:{{checkLists.length}}</h4>
  288. <i class="el-icon-circle-plus pron_i" style="font-size: 28px;color: #409EFF;" @click="addI(0)"></i>
  289. <div class="remind" ref="addRem" style="display: none">
  290. <el-checkbox-group v-model="checkboxGrounp" v-for="item in users" :key="item.id">
  291. <p><el-checkbox :label="item.name" @change="kkk(item)"></el-checkbox></p>
  292. </el-checkbox-group>
  293. </div>
  294. <div class="ssp" @click="sss"></div>
  295. <!-- </el-form> -->
  296. <div class="pro_btn">
  297. <el-button size="mini" @click="shutPro">取消</el-button>
  298. <el-button size="mini" type="primary" @click="addTaskProgress">发布</el-button>
  299. </div>
  300. </div>
  301. <div class="ddl" v-if="recentProgressInfo != null && recentProgressInfo.id != null">
  302. <div class="elCard" style="margin-bottom: 10px; height:" >
  303. <i class="el-icon-success" style="color: #43d14f;" v-if="recentProgressInfo.status == 0"></i>
  304. <i class="el-icon-success" style="color: #fd7624;" v-else-if="recentProgressInfo.status == 1"></i>
  305. <i class="el-icon-success" style="color: #fd4d47;" v-else></i>
  306. <span v-if="recentProgressInfo.status == 0">状态正常</span>
  307. <span v-else-if="recentProgressInfo.status == 1">状态正常</span>
  308. <span v-else>进展逾期</span>
  309. <el-dropdown trigger="click" style="float:right;cursor:pointer; float: right;">
  310. <i class="el-icon-more" ></i>
  311. <el-dropdown-menu slot="dropdown">
  312. <el-dropdown-item divided>
  313. <span @click="deleteTaskProgress(recentProgressInfo.id)"><i class="el-icon-delete"></i>删除列表</span></el-dropdown-item>
  314. </el-dropdown-menu>
  315. </el-dropdown>
  316. <div class="elCard_qu">{{recentProgressInfo.creatorName}}更新于{{recentProgressInfo.indate | relativeTime}}</div>
  317. <p style="padding-left: 20px;">{{recentProgressInfo.content}}</p>
  318. <div class="examine"><el-button type="text" @click="innerVisibless = true" style="color: #8F87A3;">查看历史记录</el-button></div>
  319. </div>
  320. </div>
  321. <!-- 任务列表没有数据的时候展示 -->
  322. <div class="nones" v-if="ProgressList.length <= 0">
  323. 暂无数据
  324. </div>
  325. <!-- 任务进展完整状态 -->
  326. <el-dialog title="提示" :visible.sync="innerVisibless" append-to-body width="500px">
  327. <div class="integrity">
  328. <h3 style="font-weight: normal;display: inline-block;margin: 0 0 20px 0;">任务进展:{{ProgressList.length}}</h3>
  329. <!-- <span class="write"><i class="el-icon-circle-plus"></i>填写进展</span> -->
  330. <el-divider></el-divider>
  331. <!-- -->
  332. <div class="block" style="height: 200px;">
  333. <el-timeline style="padding:20px 0 0 0;">
  334. <el-timeline-item
  335. v-for="(activity, index) in ProgressList"
  336. :key="index">
  337. <div class="tb">
  338. <span v-if="activity.status == 0" style="color: #43D14F" class="icon"></span>
  339. <span v-if="activity.status == 1" style="color: #FD7624" class="icon"></span>
  340. <span v-if="activity.status == 2" style="color: red" class="icon"></span>
  341. <div>
  342. <span v-if="activity.status == 0" style="color: #43D14F">状态正常</span>
  343. <span v-if="activity.status == 1" style="color: #FD7624">存在风险</span>
  344. <span v-if="activity.status == 2" style="color: red">进展逾期</span>
  345. <span style="display: inline-block; float: right; color: #8C8C8C">{{activity.indate | relativeTime}}</span>
  346. </div>
  347. <p style="color: #8C8C8C">{{activity.content}}</p>
  348. </div>
  349. </el-timeline-item>
  350. </el-timeline>
  351. </div>
  352. <!-- -->
  353. </div>
  354. <span slot="footer" class="dialog-footer">
  355. <el-button type="primary" @click="innerVisibless = false">关闭</el-button>
  356. </span>
  357. </el-dialog>
  358. <!-- 子任务 -->
  359. <!-- <p ><i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">子任务</i>
  360. <el-link style="float:right;" @click="addSubTask">添加子任务</el-link>
  361. </p> -->
  362. <!--子任务列表 -->
  363. <!-- <el-table :data="addForm.subTaskList"
  364. :header-cell-style="{'font-weight':'normal'}"
  365. highlight-current-row v-loading="listLoading" style="width: 100%;margin-top:10px;" @row-click="taskLineClick">
  366. <el-table-column prop="taskStatus" label="完成" width="50" >
  367. <template slot-scope="scope">
  368. <el-checkbox :disabled="scope.row.taskStatus==2" :checked="scope.row.taskStatus==1?true:false" size="large" class="cb"
  369. @click.stop.native=""
  370. @change="finishTask(scope.row)"
  371. ></el-checkbox>
  372. </template>
  373. </el-table-column>
  374. <el-table-column prop="name" label="标题" >
  375. <template slot-scope="scope">
  376. <el-tooltip class="item" effect="dark" :content="scope.row.name" placement="top">
  377. <span style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;" > {{scope.row.name}}</span>
  378. </el-tooltip>
  379. </template>
  380. </el-table-column>
  381. <el-table-column prop="executorName" label="执行人" width="100" >
  382. <template slot-scope="scope">
  383. {{scope.row.executorName == null?"待分配":scope.row.executorName}}
  384. </template>
  385. </el-table-column>
  386. <el-table-column prop="endDate" label="截止时间" width="100" >
  387. <template slot-scope="scope">
  388. <p v-if="scope.row.endDate >= times">{{scope.row.endDate}}</p>
  389. <p v-else style="background: #e62412; color: #fff;text-align: center; border-radius: 3px;">{{scope.row.endDate}}</p>
  390. </template>
  391. </el-table-column>
  392. </el-table> -->
  393. </div>
  394. </el-form>
  395. <div slot="footer" class="dialog-footer">
  396. <el-button v-if="user.id == this.addForm.createrId || currentProject.inchargerId == user.id" @click.native="deleteTask" style="float:left;">删除</el-button>
  397. <el-button @click.native="addFormVisible = false">取消</el-button>
  398. <el-button type="primary" @click="submitInsert" :loading="addLoading">提交</el-button>
  399. </div>
  400. <div slot="title" v-if="addForm.parentTid != null" >
  401. <!-- <el-link @click="backToParentTask"><i class="el-icon-arrow-left single_line">返回父级任务</i> | {{addForm.parentTname}}</el-link> -->
  402. <el-page-header @back="backToParentTask" title="返回父任务" :content="addForm.parentTname"></el-page-header>
  403. </div>
  404. <!-- 评论 -->
  405. <div class="remark" v-show="addForm.id != null">
  406. <span class="zh">
  407. <!-- <span v-for="(pl, i) in critic" :key="i"> -->
  408. <!-- <div class="player" v-if="pl"> -->
  409. <div class="player">
  410. <p @click="chan">参与人</p>
  411. <span v-for="(pl, i) in critic" :key="i">
  412. <div class="bj" style="width: 14%">
  413. <span style="background: #778899">{{pl.length > 2 ? pl.substring(pl.length - 2, pl.length) : pl}}</span>
  414. <!-- <span style="background: #778899">{{pl.length}}</span> -->
  415. </div>
  416. </span>
  417. </div>
  418. <!-- </span> -->
  419. <div class="subject">
  420. <div class="sub-all">所有动态</div>
  421. <div class="sub-details" ref="main">
  422. <ul class="infinite-list" v-infinite-scroll="load" style="overflow:auto" ref="contRoll">
  423. <div style="width: 100%" v-if="commentList.length <= 0">
  424. <img src="../../assets/image/xiao.png" alt="">
  425. </div>
  426. <li v-for="i in count" class="infinite-list-item counli" :key="i">
  427. <p><i class="el-icon-s-fold"></i> <em>屈经理完成了依赖任务</em><span>4月20日</span></p>
  428. </li>
  429. <li class="carts" v-for="item in commentList" :key="item.id">
  430. <!-- <el-image style="width: 30px; height: 30px" :src="url" :fit="fit"></el-image> -->
  431. <!-- <i :style="'background' + item.userColor"> -->
  432. <i :style="'background' + item.userColor">
  433. {{item.userName.length > 2 ? item.userName.substring(item.userName.length - 2, item.userName.length) : item.userName}}
  434. </i>
  435. <div>
  436. <!-- <p>{{item.userName}}</p> -->
  437. <p>{{item.userName}}</p>
  438. <em>{{item.content}}</em>
  439. </div>
  440. <span>{{item.createTime | relativeTime}}</span>
  441. </li>
  442. </ul>
  443. </div>
  444. </div>
  445. <div class="issue">
  446. <!-- <el-input type="textarea" class="textareays" label-width="100%" label-height="140px"></el-input> -->
  447. <div class="issue_fixation">
  448. <div class="inputDeep"><el-input
  449. type="textarea"
  450. placeholder="请输入内容"
  451. :autosize="{ minRows: 6, maxRows: 6}"
  452. v-model.trim="textarea2"
  453. class="inputDeeps"
  454. >
  455. </el-input></div>
  456. <el-button class="issue-button" type="primary" @click="release()">发布</el-button>
  457. </div>
  458. </div>
  459. </span>
  460. </div>
  461. <!-- 评论 -->
  462. </el-dialog>
  463. </section>
  464. </template>
  465. <style scoped>
  466. .input-with-select .el-input-group__prepend {
  467. background-color: #fff;
  468. }
  469. .line {
  470. padding:10px;
  471. }
  472. .line span{
  473. font-size:18px;
  474. }
  475. .line span:nth-child(even){
  476. float:right;
  477. }
  478. .classification {
  479. width: 120px;
  480. border-right: 1px solid #f2f2f2;
  481. display: flex;
  482. flex-wrap: wrap;
  483. padding-top: 20px;
  484. }
  485. .classification p{
  486. width: 120px;
  487. text-align: center;
  488. line-height: 50px;
  489. margin: 0;
  490. cursor: pointer;
  491. }
  492. .classification p:hover {
  493. background: #dddddd;
  494. }
  495. .on {
  496. color: #409EFF;
  497. }
  498. .acl{
  499. display: inline-block;
  500. width: 300px;
  501. height: 22px;
  502. overflow: hidden;
  503. white-space: nowrap;
  504. text-overflow: ellipsis;
  505. display: flex;
  506. align-items: center;
  507. margin: 0;
  508. padding: 0;
  509. line-height: 0;
  510. }
  511. .cal {
  512. color: #409EFF;
  513. width: 300px;
  514. overflow: hidden;
  515. white-space: nowrap;
  516. text-overflow: ellipsis;
  517. }
  518. .autodatespan{
  519. padding: 1.5px 2.5px;
  520. width: 73px;
  521. height: 16px;
  522. line-height: 16px;
  523. text-align: center;
  524. display: block;
  525. }
  526. .redwarningspan{
  527. background: #e62412;
  528. color: #fff;
  529. border-radius: 3px;
  530. }
  531. /* p {
  532. margin: 0 !important;
  533. } */
  534. </style>
  535. <style lang="scss" scoped>
  536. .counli {
  537. em {
  538. font-style: normal;
  539. display: inline-block;
  540. margin-left: 9%;
  541. }
  542. span {
  543. float: right;
  544. }
  545. }
  546. .carts {
  547. position: relative;
  548. .el-image{
  549. border-radius: 50%;
  550. float: left;
  551. width: 20%;
  552. }
  553. i {
  554. width: 30px;
  555. height: 30px;
  556. // background: #778899;
  557. display: inline-block;
  558. float: left;
  559. border-radius:50%;
  560. font-style:normal;
  561. font-size: 12px;
  562. line-height: 30px;
  563. text-align: center;
  564. color: #fff;
  565. background: #778899;
  566. }
  567. div {
  568. text-align: left;
  569. p {
  570. text-align: left;
  571. margin-left: 10px;
  572. margin-left: 13%;
  573. }
  574. em {
  575. display: block;
  576. font-style: normal;
  577. margin-left: 13%;
  578. }
  579. }
  580. span {
  581. font-size: 10px;
  582. float: right;
  583. margin-top: -40px;
  584. }
  585. }
  586. .issue {
  587. // height: 20%;
  588. // position: relative;
  589. // z-index: 4;
  590. .zh{
  591. position: relative;
  592. width: 100%;
  593. height: 100%;
  594. }
  595. .textareays {
  596. background: #000;
  597. height: 140px;
  598. border: 0;
  599. .el-textarea__inner {
  600. height: 85%;
  601. }
  602. }
  603. .issue-button {
  604. position: absolute;
  605. bottom: 20px;
  606. right: 20px;
  607. }
  608. }
  609. .inputDeep {
  610. position: absolute;
  611. bottom: 85px;
  612. width: 95%;
  613. margin: 0 12px;
  614. }
  615. .inputDeep .el-textarea .el-textarea__inner{
  616. border: 0 !important;
  617. resize: none !important;
  618. }
  619. .inputDeeps .el-textarea__inner {
  620. border: 0 !important;
  621. resize: none !important;
  622. }
  623. .scop_span {
  624. display: inline-block;
  625. padding: 2px 5px;
  626. }
  627. </style>
  628. <script>
  629. import { error } from 'dingtalk-jsapi';
  630. import util from "../../common/js/util";
  631. // 富文本样式
  632. import 'quill/dist/quill.core.css'
  633. import 'quill/dist/quill.snow.css'
  634. import 'quill/dist/quill.bubble.css'
  635. // 导入富文本
  636. import { quillEditor } from 'vue-quill-editor'
  637. export default {
  638. name: "two-list-headerslots",
  639. display: "Two list header slot",
  640. order: 14,
  641. components: {
  642. // draggable,
  643. // // editor,
  644. // FileCenter,
  645. // ProjectInfo,
  646. // Summary,
  647. // Earning,
  648. quillEditor // 富文本
  649. },
  650. data() {
  651. return {
  652. typeField: null,
  653. searchField: '0',
  654. keyword:null,
  655. user: JSON.parse(sessionStorage.getItem("user")),
  656. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  657. userDetailVisible: false,
  658. userDetail:{},
  659. date: new Date(),
  660. users: [],
  661. participator:[],
  662. tableHeight: 0,
  663. listLoading: false,
  664. total: 0,
  665. page: 1,
  666. size: 20,
  667. list: [],
  668. subProjectVisible: false,
  669. subProjectList: [],//子项目列表
  670. currentProject:{},
  671. addSubProject: false,
  672. addFormVisible: false,
  673. addLoading: false,
  674. title: "",
  675. addForm: {
  676. name: '',
  677. userId: [],
  678. },
  679. rules: {
  680. name: [{ required: true, message: "请输入项目名称", trigger: "blur" }],
  681. },
  682. idx: 1,
  683. taskDetails: false,
  684. addForm: {
  685. name: '',
  686. },
  687. rules: {
  688. name: [{ required: true, message: "请输入分组名称", trigger: "blur" }],
  689. },
  690. rules2: {
  691. stagesName: [{ required: true, message: "请输入任务列表名称", trigger: "blur" }],
  692. },
  693. taskRules : {
  694. name: [{ required: true, message: "请输入任务内容", trigger: "blur" }],
  695. },
  696. sleectId: null,
  697. sleectProjectId: null,
  698. sidebarIndex: null, // 侧边栏索引
  699. url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
  700. count: 0,
  701. textarea2: '',
  702. taskId: null,
  703. commentList: [],
  704. radio: 0,
  705. critic: [], // 评论头像的数组
  706. editorOption: { // 富文本框里面的默认值
  707. placeholder: '请输入文本...',
  708. modules: {
  709. toolbar:[
  710. ['bold', 'italic', 'underline', 'strike'], //加粗,斜体,下划线,删除线
  711. // ['blockquote', 'code-block'], //引用,代码块
  712. [{ 'header': 1 }, { 'header': 2 }], // 标题,键值对的形式;1、2表示字体大小
  713. // [{ 'list': 'ordered'}, { 'list': 'bullet' }], //列表
  714. // [{ 'script': 'sub'}, { 'script': 'super' }], // 上下标
  715. // [{ 'indent': '-1'}, { 'indent': '+1' }], // 缩进
  716. // [{ 'direction': 'rtl' }], // 文本方向
  717. [{ 'size': ['small', false, 'large', 'huge'] }], // 字体大小
  718. [{ 'header': [1, 2, 3, 4, 5, 6, false] }], //几级标题
  719. [{ 'color': [] }, { 'background': [] }], // 字体颜色,字体背景颜色
  720. // [{ 'font': [] }], //字体
  721. [{ 'align': [] }], //对齐方式
  722. ['clean'], //清除字体样式
  723. // ['image','video'] //上传图片、上传视频
  724. ['image'] //上传图片、上传视频
  725. ], //工具栏设置
  726. },
  727. theme: 'snow',
  728. },
  729. textContent: true, // 控制提交
  730. times: null,
  731. text2: '',
  732. innerVisibless: false, // 任务展示弹出层
  733. activities: [{
  734. content: '状态正常',
  735. timestamp: '7小时前',
  736. size: 'large',
  737. type: 'primary',
  738. icon: 'el-icon-circle-check',
  739. color: '#409EFF'
  740. }, {
  741. content: '进展逾期',
  742. timestamp: '八小时前',
  743. color: '#F87872'
  744. }],
  745. ProgressList: [],
  746. checkboxGrounp: [], // 选中人的数据
  747. checkLists: [], // 选中人数据的ID
  748. taskIid: null,
  749. viewList: [{id:1,name:"全部任务"},{id:2,name:"进行中的任务"},{id:3,name:"已完成的任务"},{id:4,name:"待安排任务"},
  750. {id:5,name:"我创建的任务"},{id:6,name:"我执行的任务"},{id:7,name:"今天的任务"},{id:8,name:"已超期的任务"}],
  751. importanceList:[{id:0,name:"一般"},{id:1,name:"重要"},{id:2,name:"紧急"},],
  752. taskTypeList:[{id:0,name:"任务", icon:"iconfont firerock-iconrenwu"},{id:1,name:"里程碑",icon:"iconfont firerock-iconicon-"},{id:2,name:"风险",icon:"iconfont firerock-iconfengxian"}],
  753. taskTypeColor:['#20A0FF','#8613ad','#bf0404'],
  754. taskTypeIcon:['iconfont firerock-iconrenwu','iconfont firerock-iconicon-','iconfont firerock-iconfengxian'],
  755. taskStatusList:['进行中','已完成','已撤销'],
  756. //优先级
  757. taskLevelColor:['#262626','#E6A23C','#F56C6C'],
  758. stageList: '',
  759. selectedGroup:{},
  760. dateClass: true,
  761. dateType: 0,
  762. dateSelect: []
  763. };
  764. },
  765. methods: {
  766. judgedate(itemD){
  767. let nowdate = new Date()
  768. let idate = new Date(itemD + " 23:59:59")
  769. return nowdate > idate ? true : false
  770. },
  771. deleteSubPro(subProject) {
  772. this.$confirm("确定要删除子项目" + subProject.name + "吗?","删除子项目", {
  773. confirmButtonText: "确定",
  774. cancelButtonText: "取消",
  775. type: "warning"
  776. })
  777. .then(() => {
  778. this.listLoading = true;
  779. this.http.post('/sub-project/deleteProject',{
  780. id: subProject.id
  781. },
  782. res => {
  783. this.listLoading = false;
  784. if (res.code == "ok") {
  785. this.$message({
  786. message: "删除成功",
  787. type: "success"
  788. });
  789. this.subProject(this.currentProject);
  790. } else {
  791. this.$message({
  792. message: res.msg,
  793. type: "error"
  794. });
  795. }
  796. },
  797. error => {
  798. this.listLoading = false;
  799. this.$message({
  800. message: error,
  801. type: "error"
  802. });
  803. }
  804. );
  805. })
  806. .catch(() => {});
  807. },
  808. searchList() {
  809. this.page = 1;
  810. this.getList();
  811. },
  812. addNewSubProject(subProject) {
  813. if (subProject == null) {
  814. this.addForm = {projectId: this.currentProject.id}
  815. } else {
  816. this.addForm = subProject;
  817. }
  818. this.addSubProject = true;
  819. },
  820. //显示子项目
  821. subProject(item) {
  822. this.subProjectVisible = true;
  823. this.currentProject = item;
  824. this.http.post('/sub-project/list', {
  825. projectId: item.id
  826. },
  827. res => {
  828. if (res.code == "ok") {
  829. this.subProjectList = res.data;
  830. } else {
  831. this.$message({
  832. message: res.msg,
  833. type: "error"
  834. });
  835. }
  836. },
  837. error => {
  838. this.$message({
  839. message: error,
  840. type: "error"
  841. });
  842. });
  843. },
  844. //显示用户详情
  845. showUser(userId) {
  846. this.userDetailVisible = true;
  847. this.http.post(this.port.manage.userDetail, {
  848. userId: userId
  849. },
  850. res => {
  851. if (res.code == "ok") {
  852. this.userDetail = res.data;
  853. } else {
  854. this.$message({
  855. message: res.msg,
  856. type: "error"
  857. });
  858. }
  859. },
  860. error => {
  861. this.$message({
  862. message: error,
  863. type: "error"
  864. });
  865. });
  866. },
  867. //选择参与人
  868. changeParticipator() {
  869. //检查是否在参与人中,如果没有需要加入到参与人中
  870. // console.log(this.addForm.userId);
  871. var find = false;
  872. this.participator = [];
  873. this.addForm.userId.forEach(u=>{
  874. var findUser = this.users.filter(au=>au.id == u)[0];
  875. this.participator.push(findUser);
  876. })
  877. },
  878. getUsers() {
  879. this.http.post(this.port.manage.list, {
  880. departmentId: -1,
  881. pageIndex: 1,
  882. // pageSize: 99999
  883. pageSize: -1
  884. },
  885. res => {
  886. if (res.code == "ok") {
  887. this.users = res.data.records;
  888. } else {
  889. this.$message({
  890. message: res.msg,
  891. type: "error"
  892. });
  893. }
  894. },
  895. error => {
  896. this.$message({
  897. message: error,
  898. type: "error"
  899. });
  900. });
  901. },
  902. addStagePost() {
  903. let param = JSON.parse(JSON.stringify(this.stageForm));
  904. param.taskList = [];
  905. this.http.post('/stages/save',param,
  906. res => {
  907. if (res.code == "ok") {
  908. this.stageList = res.data;
  909. this.addStageDialog = false;
  910. } else {
  911. this.$message({
  912. message: res.msg,
  913. type: "error"
  914. });
  915. }
  916. },
  917. error => {
  918. this.$message({
  919. message: error,
  920. type: "error"
  921. });
  922. });
  923. },
  924. //分页
  925. handleCurrentChange(val) {
  926. this.page = val;
  927. this.getList();
  928. },
  929. handleSizeChange(val) {
  930. this.size = val;
  931. this.getList();
  932. },
  933. //获取项目列表
  934. getList() {
  935. this.listLoading = true;
  936. let parameter = {
  937. status: this.searchField,
  938. viewId: this.idx,
  939. pageIndex: this.page,
  940. pageSize: this.size,
  941. // type: this.typeField
  942. }
  943. if(this.typeField != 'null' && this.typeField != null && this.typeField != '') {
  944. parameter.type = this.typeField
  945. }
  946. if(this.dateSelect.length != 0){
  947. parameter.dateType = this.dateType
  948. parameter.startDate = this.dateSelect[0]
  949. parameter.endDate = this.dateSelect[1]
  950. }
  951. this.http.post('/task/listByPage', parameter,
  952. res => {
  953. this.listLoading = false;
  954. if(res.code == 'ok') {
  955. this.list = res.data.records
  956. this.total = res.data.total
  957. } else {
  958. this.$message({
  959. message: res.msg,
  960. type: "error"
  961. });
  962. }
  963. // console.log(res)
  964. },
  965. error => {
  966. this.listLoading = false;
  967. this.$message({
  968. message: error,
  969. type: "error"
  970. });
  971. })
  972. },
  973. //显示新增界面
  974. handleAdd(i, item) {
  975. if(i == -1) {
  976. this.title = "新增任务";
  977. this.addForm = {
  978. name: '',
  979. userId: [],
  980. code:'',
  981. inchargerId:null,
  982. }
  983. } else {
  984. this.title = "修改项目";
  985. var list = item.participator , arr = [];
  986. for(var j in list) {
  987. arr.push(list[j].id)
  988. }
  989. this.addForm = {
  990. id: item.id,
  991. name: item.projectName,
  992. userId: arr,
  993. code:item.projectCode,
  994. inchargerId: item.inchargerId
  995. }
  996. this.changeParticipator();
  997. }
  998. this.addFormVisible = true;
  999. },
  1000. //提交子项目创建修改请求
  1001. submitInsertSubProject () {
  1002. this.$refs.form2.validate(valid => {
  1003. if (valid) {
  1004. this.http.post('/sub-project/saveOrUpdate',this.addForm,
  1005. res => {
  1006. if (res.code == "ok") {
  1007. this.$message({
  1008. message: "操作成功",
  1009. type: "success"
  1010. });
  1011. this.subProject(this.currentProject);
  1012. this.addSubProject = false;
  1013. } else {
  1014. this.$message({
  1015. message: res.msg,
  1016. type: "error"
  1017. });
  1018. }
  1019. },
  1020. error => {
  1021. this.listLoading = false;
  1022. this.$message({
  1023. message: error,
  1024. type: "error"
  1025. });
  1026. }
  1027. );
  1028. }
  1029. });
  1030. },
  1031. // submitInsert() {
  1032. // console.log("111");
  1033. // this.$refs.form1.validate(valid => {
  1034. // if (valid) {
  1035. // this.addLoading = true;
  1036. // let formData = new FormData();
  1037. // formData.append("name", this.addForm.name);
  1038. // if(this.addForm.id != null) {
  1039. // formData.append("id", this.addForm.id);
  1040. // }
  1041. // if(this.addForm.userId.length != 0) {
  1042. // for(var j in this.addForm.userId) {
  1043. // formData.append("userId", this.addForm.userId[j]);
  1044. // }
  1045. // }
  1046. // if(this.addForm.inchargerId != null) {
  1047. // formData.append("inchargerId", this.addForm.inchargerId);
  1048. // }
  1049. // if(this.addForm.code != null) {
  1050. // formData.append("code", this.addForm.code);
  1051. // }
  1052. // formData.delete("refTaskList")
  1053. // console.log('走了')
  1054. // this.http.uploadFile(this.port.project.add,formData,
  1055. // res => {
  1056. // this.addLoading = false;
  1057. // if (res.code == "ok") {
  1058. // this.$message({
  1059. // message: this.addForm.id!=null?'修改':'创建'+"成功",
  1060. // type: "success"
  1061. // });
  1062. // this.addFormVisible = false;
  1063. // this.getList();
  1064. // } else {
  1065. // this.$message({
  1066. // message: res.msg,
  1067. // type: "error"
  1068. // });
  1069. // }
  1070. // },
  1071. // error => {
  1072. // this.addLoading = false;
  1073. // this.$message({
  1074. // message: error,
  1075. // type: "error"
  1076. // });
  1077. // });
  1078. // }
  1079. // });
  1080. // },
  1081. // 删除
  1082. deletePro(i, item) {
  1083. this.$confirm("确定要项目" + item.projectName + "吗?","删除项目", {
  1084. confirmButtonText: "确定",
  1085. cancelButtonText: "取消",
  1086. type: "warning"
  1087. })
  1088. .then(() => {
  1089. this.listLoading = true;
  1090. this.http.post(this.port.project.delete,{
  1091. id: item.id
  1092. },
  1093. res => {
  1094. this.listLoading = false;
  1095. if (res.code == "ok") {
  1096. this.$message({
  1097. message: "删除成功",
  1098. type: "success"
  1099. });
  1100. this.getList();
  1101. } else {
  1102. this.$message({
  1103. message: res.msg,
  1104. type: "error"
  1105. });
  1106. }
  1107. },
  1108. error => {
  1109. this.listLoading = false;
  1110. this.$message({
  1111. message: error,
  1112. type: "error"
  1113. });
  1114. }
  1115. );
  1116. })
  1117. .catch(() => {});
  1118. },
  1119. detail(i) {
  1120. this.$router.push("/list/" + this.list[i].id + "/" + this.list[i].projectName);
  1121. },
  1122. // 切换当前选项的索引
  1123. switchs(e) {
  1124. this.idx = e
  1125. this.page = 1
  1126. // console.log(this.searchField)
  1127. this.getList()
  1128. },
  1129. // 下拉框选择
  1130. hiddens() {
  1131. // console.log(this.searchField)
  1132. this.page = 1
  1133. this.getList()
  1134. },
  1135. // 完成
  1136. completes(e, el) {
  1137. this.http.post('/task/finish', {
  1138. id: e,
  1139. taskStatus: el
  1140. },
  1141. res => {
  1142. if (res.code == "ok") {
  1143. this.$message({
  1144. message: "操作成功",
  1145. type: "success"
  1146. });
  1147. this.getList();
  1148. } else {
  1149. this.$message({
  1150. message: res.msg,
  1151. type: "error"
  1152. });
  1153. }
  1154. },
  1155. error => {
  1156. this.listLoading = false;
  1157. this.$message({
  1158. message: error,
  1159. type: "error"
  1160. });
  1161. }
  1162. )
  1163. },
  1164. // 点击任务事件
  1165. editTask(task) {
  1166. // console.log(task)
  1167. this.addFormVisible = true;
  1168. // this.addLoading = false;
  1169. this.title = "编辑任务";
  1170. this.getTaskDetail(task.id);
  1171. this.getTaskProgressList(task.id); // 获取任务进展列表
  1172. this.getUsers(); // 获取名单数据
  1173. this.gain(task); // 获取评论列表
  1174. // this.getStageList()
  1175. },
  1176. addExecutorLine() {
  1177. this.addForm.executorListFront.push({executorId:null, planHours:8});
  1178. this.$forceUpdate();
  1179. },
  1180. removeExecutorLine(index) {
  1181. this.addForm.executorListFront.splice(index,1);
  1182. this.$forceUpdate();
  1183. },
  1184. getTaskDetail(id) {
  1185. this.http.post('/task/getTask',{id: id},
  1186. res => {
  1187. if (res.code == "ok") {
  1188. this.addForm = res.data;
  1189. this.addForm.createDate = null;
  1190. this.addForm.indate = null;
  1191. this.addLoading = false;
  1192. this.recentProgressInfo = this.addForm.progress;
  1193. this.addForm.executorListFront = this.addForm.executorList;
  1194. //删除中间传值的变量数组
  1195. delete this.addForm.executorList;
  1196. } else {
  1197. this.$message({
  1198. message: res.msg,
  1199. type: "error"
  1200. });
  1201. }
  1202. },
  1203. error => {
  1204. this.$message({
  1205. message: error,
  1206. type: "error"
  1207. });
  1208. });
  1209. },
  1210. //获取任务进展列表
  1211. getTaskProgressList(taskId) {
  1212. this.taskIid = taskId
  1213. this.http.post('/task-progress/list', {taskId: taskId},
  1214. res => {
  1215. if (res.code == "ok") {
  1216. this.ProgressList = res.data;
  1217. this.recentProgressInfo = res.data[0]
  1218. } else {
  1219. this.$message({
  1220. message: res.msg,
  1221. type: "error"
  1222. });
  1223. }
  1224. }
  1225. );
  1226. },
  1227. getUsers() {
  1228. // console.log(this.port.manage.list)
  1229. this.http.post(this.port.manage.list, {
  1230. departmentId: -1,
  1231. pageIndex: 1,
  1232. pageSize: 99999
  1233. },
  1234. res => {
  1235. if (res.code == "ok") {
  1236. this.users = res.data.records;
  1237. } else {
  1238. this.$message({
  1239. message: res.msg,
  1240. type: "error"
  1241. });
  1242. }
  1243. },
  1244. error => {
  1245. this.$message({
  1246. message: error,
  1247. type: "error"
  1248. });
  1249. });
  1250. },
  1251. // 获取评论列表
  1252. gain (task) {
  1253. this.commentList = [];
  1254. this.taskId = task.id;
  1255. this.http.post('/task-comment/getList', {taskId: task.id},
  1256. res => {
  1257. if (res.code == "ok") {
  1258. this.commentList = res.data
  1259. this.sppk(this.commentList) // 获取参与人的方法
  1260. } else {
  1261. this.$message({
  1262. message: res.msg,
  1263. type: "error"
  1264. });
  1265. }
  1266. },
  1267. error => {
  1268. this.$message({
  1269. message: error,
  1270. type: "error"
  1271. });
  1272. });
  1273. },
  1274. // 获取评论参与人
  1275. sppk(comit) {
  1276. var sk = []
  1277. comit.forEach(function(e){
  1278. sk.push(e.userName)
  1279. })
  1280. this.critic = new Set(sk)
  1281. },
  1282. sss(){
  1283. this.$refs.addRem.style.display="none"
  1284. },
  1285. addprogress(){ // 添加子任务进展事件
  1286. this.$refs.proBox.style.display="block"
  1287. this.$refs.addPro.style.display="none"
  1288. },
  1289. shutPro() { // 关闭任务进展
  1290. this.$refs.addPro.style.display="block"
  1291. this.$refs.addRem.style.display="none"
  1292. this.$refs.proBox.style.display="none"
  1293. },
  1294. addI() { // 打开选择查看
  1295. this.$refs.addRem.style.display="block"
  1296. },
  1297. load() {
  1298. if(this.count >= 0) return
  1299. this.count += 2
  1300. },
  1301. onEditorFocus() {
  1302. this.onEditorBlur()
  1303. },
  1304. kkk(el){
  1305. var k = this.checkLists.indexOf(el.id)
  1306. if (k == -1) {
  1307. this.checkLists.push(el.id)
  1308. } else {
  1309. this.checkLists.splice(k, 1)
  1310. }
  1311. },
  1312. shutPro() { // 关闭任务进展
  1313. this.$refs.addPro.style.display="block"
  1314. this.$refs.addRem.style.display="none"
  1315. this.$refs.proBox.style.display="none"
  1316. },
  1317. addTaskProgress() { //创建任务进展
  1318. var param = {
  1319. taskId: this.taskIid,
  1320. status: this.radio,
  1321. content: this.text2,
  1322. participatorIds: this.checkLists.toString()
  1323. };
  1324. this.http.post('/task-progress/addProgress', param,
  1325. res => {
  1326. if (res.code == "ok") {
  1327. this.shutPro()
  1328. this.getTaskProgressList(this.taskIid)
  1329. this.$message({
  1330. message: '发布成功',
  1331. type: "success"
  1332. });
  1333. this.checkboxGrounp = [],
  1334. this.checkLists = [],
  1335. this.text2 = '',
  1336. this.radio = 0
  1337. } else {
  1338. this.$message({
  1339. message: res.msg,
  1340. type: "error"
  1341. });
  1342. }
  1343. }
  1344. );
  1345. },
  1346. //删除任务进展
  1347. deleteTaskProgress(id) {
  1348. this.http.post('/task-progress/deleteProgress', {id: id},
  1349. res => {
  1350. if (res.code == "ok") {
  1351. this.getTaskProgressList(this.taskIid)
  1352. this.$message({
  1353. message: '删除成功',
  1354. type: "success"
  1355. });
  1356. } else {
  1357. this.$message({
  1358. message: res.msg,
  1359. type: "error"
  1360. });
  1361. }
  1362. }
  1363. );
  1364. },
  1365. //显示子任务创建卡片
  1366. addSubTask() {
  1367. this.addFormVisible = true;
  1368. this.addForm = {parentTname: this.addForm.name,parentTid: this.addForm.id,projectId: this.addForm.projectId, groupId: this.addForm.groupId, taskLevel:0, planHours: 8, taskType: 0};
  1369. this.addLoading = false;
  1370. },
  1371. taskLineClick(row, column, event) {
  1372. this.editTask(row);
  1373. },
  1374. finishTask(task) {
  1375. this.http.post('/task/finish',{id: task.id, taskStatus: task.taskStatus},
  1376. res => {
  1377. if (res.code == "ok") {
  1378. if (this.groupType == 0) {
  1379. this.getStageList();
  1380. } else {
  1381. // this.getViewTaskList();
  1382. }
  1383. } else {
  1384. this.$message({
  1385. message: res.msg,
  1386. type: "error"
  1387. });
  1388. }
  1389. },
  1390. error => {
  1391. this.$message({
  1392. message: error,
  1393. type: "error"
  1394. });
  1395. });
  1396. },
  1397. //认领任务
  1398. addAsMyTask(task) {
  1399. this.http.post('/task/addAsMyTask',{id: task.id},
  1400. res => {
  1401. if (res.code == "ok") {
  1402. this.getStageList();
  1403. } else {
  1404. this.$message({
  1405. message: res.msg,
  1406. type: "error"
  1407. });
  1408. }
  1409. },
  1410. error => {
  1411. this.$message({
  1412. message: error,
  1413. type: "error"
  1414. });
  1415. });
  1416. },
  1417. timess(){
  1418. var date = new Date()
  1419. let Y = date.getFullYear()
  1420. let M = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : (date.getMonth() + 1)
  1421. let D = date.getDate() < 10 ? ('0' + date.getDate()) : date.getDate()
  1422. this.times = `${Y}-${M}-${D}`
  1423. },
  1424. showSubTaskList(task) {
  1425. this.subTaskVisible = true;
  1426. this.addForm = task;
  1427. },
  1428. addTask(stage) {
  1429. this.addFormVisible = true;
  1430. this.addForm = {projectId: stage.projectId, groupId: stage.groupId, stagesId: stage.id, taskLevel:0, planHours: 8, taskType: 0};
  1431. this.addLoading = false;
  1432. this.title="创建任务";
  1433. this.commentList = [];
  1434. },
  1435. addStage() {
  1436. this.addStageDialog = true;
  1437. this.stageForm = {groupId: this.selectedGroup.id, projectId: this.curProjectId};
  1438. },
  1439. // 获得焦点时触发
  1440. onEditorBlur(){
  1441. let theEle = this.$refs.text; // 获取元素
  1442. var img = theEle.value.match(/<img[^>]+>/g); // 赛选 img 标签
  1443. var arrImg = ''
  1444. for (var j = 0; j < img.length; j++) {
  1445. // 正则匹配,摘出img标签下的src里的内容,即capture
  1446. img[j].replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, function(match, capture) {
  1447. arrImg += capture
  1448. });
  1449. }
  1450. // 原来的字符流大小,单位为字节
  1451. var strLen = arrImg.length;
  1452. // 计算后得到的文件流大小,单位为字节
  1453. var fileSize=parseInt(strLen-(strLen/8)*2);
  1454. var size = "";
  1455. size = (fileSize/1024/1024).toFixed(2);
  1456. if (size > 2){
  1457. this.textContent = false
  1458. this.$message({
  1459. showClose: true,
  1460. message: '图片超过了2MB,请重新上传',
  1461. type: 'warning'
  1462. });
  1463. }
  1464. this.textContent = true
  1465. },
  1466. backToParentTask() {
  1467. this.getTaskDetail(this.addForm.parentTid);
  1468. },
  1469. // 点击发布
  1470. release() {
  1471. if(this.textarea2.length <= 0) return this.$message({message: "请输入内容", type: "error"})
  1472. this.http.post('/task-comment/add', {taskId: this.taskId, userId: this.user.id, content: this.textarea2},
  1473. res => {
  1474. if(res.code == "ok"){
  1475. this.commentList.push(res.data)
  1476. this.sppk(this.commentList)
  1477. this.textarea2 = ""
  1478. this.contRoll() // 滚动到底部
  1479. } else {
  1480. this.$message({
  1481. message: res.msg,
  1482. type: "error"
  1483. });
  1484. }
  1485. },
  1486. error => {
  1487. this.$message({
  1488. message: error,
  1489. type: "error"
  1490. });
  1491. })
  1492. },
  1493. // 滚动到底部
  1494. contRoll(){
  1495. this.$nextTick(() => {
  1496. this.$refs.main.scrollTop = this.$refs.contRoll.scrollHeight;
  1497. })
  1498. },
  1499. submitInsert() {
  1500. if (this.textContent !== true) return this.$message({
  1501. showClose: true,
  1502. message: '图片太大,请重新上传',
  1503. type: 'warning'
  1504. });
  1505. //检查是有重名的执行人
  1506. var exeList = this.addForm.executorListFront;
  1507. for (var i=0;i<exeList.length;i++) {
  1508. var findSameUser = false;
  1509. for (var j=i+1;j<exeList.length; j++) {
  1510. if (exeList[i].executorId && exeList[j].executorId && exeList[i].executorId == exeList[j].executorId) {
  1511. findSameUser = true;
  1512. break;
  1513. }
  1514. }
  1515. if (findSameUser) {
  1516. return this.$message({
  1517. showClose: true,
  1518. message: '执行人存在重复',
  1519. type: 'error'
  1520. });
  1521. }
  1522. }
  1523. this.$refs.form1.validate(valid => {
  1524. if (valid) {
  1525. delete this.addForm.subTaskList;
  1526. delete this.addForm.progress;
  1527. delete this.addForm.refTaskList;
  1528. this.addForm.executorListStr = JSON.stringify(this.addForm.executorListFront);
  1529. this.http.post('/task/save',this.addForm,
  1530. res => {
  1531. if (res.code == "ok") {
  1532. this.$message({
  1533. message: "提交成功",
  1534. type: "success"
  1535. });
  1536. if (this.addForm.parentTid == null) {
  1537. this.addFormVisible = false;
  1538. if (this.groupType == 0) {
  1539. this.getStageList();
  1540. } else {
  1541. // this.getViewTaskList();
  1542. }
  1543. } else {
  1544. this.backToParentTask();
  1545. }
  1546. this.getList()
  1547. } else {
  1548. this.$message({
  1549. message: res.msg,
  1550. type: "error"
  1551. });
  1552. }
  1553. },
  1554. error => {
  1555. this.$message({
  1556. message: error,
  1557. type: "error"
  1558. });
  1559. }
  1560. );
  1561. }
  1562. });
  1563. },
  1564. //加载项目内的任务列表
  1565. getStageList() {
  1566. // console.log('进来了')
  1567. this.http.post('/stages/list',{groupId: this.selectedGroup.id, projectId: this.selectedGroup.projectId, order: this.order, isDesc: this.isDesc},
  1568. res => {
  1569. if (res.code == "ok") {
  1570. this.stageList = res.data;
  1571. // console.log('触发获取任务列表函数')
  1572. this.timess() // 处理时间的方法
  1573. } else {
  1574. this.$message({
  1575. message: res.msg,
  1576. type: "error"
  1577. });
  1578. }
  1579. },
  1580. error => {
  1581. this.$message({
  1582. message: error,
  1583. type: "error"
  1584. });
  1585. });
  1586. },
  1587. //删除当前编辑的任务
  1588. deleteTask() {
  1589. var warning='';
  1590. if (this.addForm.subTaskList.length > 0) {
  1591. warning='您确定要删除当前任务及其子任务吗?';
  1592. } else {
  1593. warning='您确定要删除当前任务吗?';
  1594. }
  1595. this.$confirm(warning, "提示", {
  1596. //type: 'warning'
  1597. }).then(() => {
  1598. this.http.post('/task/delete',{id: this.addForm.id},
  1599. res => {
  1600. if (res.code == "ok") {
  1601. this.addFormVisible = false;
  1602. // this.getStageList();
  1603. this.getList();
  1604. } else {
  1605. this.$message({
  1606. message: res.msg,
  1607. type: "error"
  1608. });
  1609. }
  1610. },
  1611. error => {
  1612. this.$message({
  1613. message: error,
  1614. type: "error"
  1615. });
  1616. });
  1617. });
  1618. },
  1619. chan() {
  1620. // console.log(this.critic)
  1621. }
  1622. },
  1623. created() {
  1624. let height = window.innerHeight;
  1625. this.tableHeight = height - 195;
  1626. const that = this;
  1627. window.onresize = function temp() {
  1628. that.tableHeight = window.innerHeight - 195;
  1629. };
  1630. },
  1631. mounted() {
  1632. this.getList();
  1633. this.getUsers();
  1634. },
  1635. };
  1636. </script>
  1637. <style lang="scss" scoped>
  1638. // .classification {
  1639. // width: 120px;
  1640. // // height: 100%;
  1641. // border-right: 1px solid #f2f2f2;
  1642. // display: flex;
  1643. // flex-wrap: wrap;
  1644. // // align-items: center;
  1645. // // justify-content: center;
  1646. // padding-top: 20px;
  1647. // }
  1648. // .classification p{
  1649. // width: 120px;
  1650. // text-align: center;
  1651. // line-height: 50px;
  1652. // margin: 0;
  1653. // cursor: pointer;
  1654. // }
  1655. // .classification p:hover {
  1656. // background: #dddddd;
  1657. // }
  1658. // .on {
  1659. // // background: #dddddd;
  1660. // color: #409EFF;
  1661. // }
  1662. // .acl{
  1663. // display: inline-block;
  1664. // width: 300px;
  1665. // height: 22px;
  1666. // // line-height: 22px;
  1667. // overflow: hidden;
  1668. // white-space: nowrap;
  1669. // text-overflow: ellipsis;
  1670. // margin: 0;
  1671. // padding: 0;
  1672. // line-height: 0;
  1673. // }
  1674. // .cal {
  1675. // width: 300px;
  1676. // overflow: hidden;
  1677. // white-space: nowrap;
  1678. // text-overflow: ellipsis;
  1679. // cursor: pointer;
  1680. // }
  1681. </style>