list.vue 77 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732
  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 == addForm.createrId || currentProject.inchargerId == user.id || currentProject.creatorId == user.id || permissions.projectManagement" @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. this.http.post('/user/getSimpleActiveUserList', {},
  886. res => {
  887. if (res.code == "ok") {
  888. this.users = res.data;
  889. } else {
  890. this.$message({
  891. message: res.msg,
  892. type: "error"
  893. });
  894. }
  895. },
  896. error => {
  897. this.$message({
  898. message: error,
  899. type: "error"
  900. });
  901. });
  902. },
  903. addStagePost() {
  904. let param = JSON.parse(JSON.stringify(this.stageForm));
  905. param.taskList = [];
  906. this.http.post('/stages/save',param,
  907. res => {
  908. if (res.code == "ok") {
  909. this.stageList = res.data;
  910. this.addStageDialog = false;
  911. } else {
  912. this.$message({
  913. message: res.msg,
  914. type: "error"
  915. });
  916. }
  917. },
  918. error => {
  919. this.$message({
  920. message: error,
  921. type: "error"
  922. });
  923. });
  924. },
  925. //分页
  926. handleCurrentChange(val) {
  927. this.page = val;
  928. this.getList();
  929. },
  930. handleSizeChange(val) {
  931. this.size = val;
  932. this.getList();
  933. },
  934. //获取项目列表
  935. getList() {
  936. this.listLoading = true;
  937. let parameter = {
  938. status: this.searchField,
  939. viewId: this.idx,
  940. pageIndex: this.page,
  941. pageSize: this.size,
  942. // type: this.typeField
  943. }
  944. if(this.typeField != 'null' && this.typeField != null && this.typeField != '') {
  945. parameter.type = this.typeField
  946. }
  947. if(this.dateSelect.length != 0){
  948. parameter.dateType = this.dateType
  949. parameter.startDate = this.dateSelect[0]
  950. parameter.endDate = this.dateSelect[1]
  951. }
  952. this.http.post('/task/listByPage', parameter,
  953. res => {
  954. this.listLoading = false;
  955. if(res.code == 'ok') {
  956. this.list = res.data.records
  957. this.total = res.data.total
  958. } else {
  959. this.$message({
  960. message: res.msg,
  961. type: "error"
  962. });
  963. }
  964. // console.log(res)
  965. },
  966. error => {
  967. this.listLoading = false;
  968. this.$message({
  969. message: error,
  970. type: "error"
  971. });
  972. })
  973. },
  974. //显示新增界面
  975. handleAdd(i, item) {
  976. if(i == -1) {
  977. this.title = "新增任务";
  978. this.addForm = {
  979. name: '',
  980. userId: [],
  981. code:'',
  982. inchargerId:null,
  983. }
  984. } else {
  985. this.title = "修改项目";
  986. var list = item.participator , arr = [];
  987. for(var j in list) {
  988. arr.push(list[j].id)
  989. }
  990. this.addForm = {
  991. id: item.id,
  992. name: item.projectName,
  993. userId: arr,
  994. code:item.projectCode,
  995. inchargerId: item.inchargerId
  996. }
  997. this.changeParticipator();
  998. }
  999. this.addFormVisible = true;
  1000. },
  1001. //提交子项目创建修改请求
  1002. submitInsertSubProject () {
  1003. this.$refs.form2.validate(valid => {
  1004. if (valid) {
  1005. this.http.post('/sub-project/saveOrUpdate',this.addForm,
  1006. res => {
  1007. if (res.code == "ok") {
  1008. this.$message({
  1009. message: "操作成功",
  1010. type: "success"
  1011. });
  1012. this.subProject(this.currentProject);
  1013. this.addSubProject = false;
  1014. } else {
  1015. this.$message({
  1016. message: res.msg,
  1017. type: "error"
  1018. });
  1019. }
  1020. },
  1021. error => {
  1022. this.listLoading = false;
  1023. this.$message({
  1024. message: error,
  1025. type: "error"
  1026. });
  1027. }
  1028. );
  1029. }
  1030. });
  1031. },
  1032. // submitInsert() {
  1033. // console.log("111");
  1034. // this.$refs.form1.validate(valid => {
  1035. // if (valid) {
  1036. // this.addLoading = true;
  1037. // let formData = new FormData();
  1038. // formData.append("name", this.addForm.name);
  1039. // if(this.addForm.id != null) {
  1040. // formData.append("id", this.addForm.id);
  1041. // }
  1042. // if(this.addForm.userId.length != 0) {
  1043. // for(var j in this.addForm.userId) {
  1044. // formData.append("userId", this.addForm.userId[j]);
  1045. // }
  1046. // }
  1047. // if(this.addForm.inchargerId != null) {
  1048. // formData.append("inchargerId", this.addForm.inchargerId);
  1049. // }
  1050. // if(this.addForm.code != null) {
  1051. // formData.append("code", this.addForm.code);
  1052. // }
  1053. // formData.delete("refTaskList")
  1054. // console.log('走了')
  1055. // this.http.uploadFile(this.port.project.add,formData,
  1056. // res => {
  1057. // this.addLoading = false;
  1058. // if (res.code == "ok") {
  1059. // this.$message({
  1060. // message: this.addForm.id!=null?'修改':'创建'+"成功",
  1061. // type: "success"
  1062. // });
  1063. // this.addFormVisible = false;
  1064. // this.getList();
  1065. // } else {
  1066. // this.$message({
  1067. // message: res.msg,
  1068. // type: "error"
  1069. // });
  1070. // }
  1071. // },
  1072. // error => {
  1073. // this.addLoading = false;
  1074. // this.$message({
  1075. // message: error,
  1076. // type: "error"
  1077. // });
  1078. // });
  1079. // }
  1080. // });
  1081. // },
  1082. // 删除
  1083. deletePro(i, item) {
  1084. this.$confirm("确定要项目" + item.projectName + "吗?","删除项目", {
  1085. confirmButtonText: "确定",
  1086. cancelButtonText: "取消",
  1087. type: "warning"
  1088. })
  1089. .then(() => {
  1090. this.listLoading = true;
  1091. this.http.post(this.port.project.delete,{
  1092. id: item.id
  1093. },
  1094. res => {
  1095. this.listLoading = false;
  1096. if (res.code == "ok") {
  1097. this.$message({
  1098. message: "删除成功",
  1099. type: "success"
  1100. });
  1101. this.getList();
  1102. } else {
  1103. this.$message({
  1104. message: res.msg,
  1105. type: "error"
  1106. });
  1107. }
  1108. },
  1109. error => {
  1110. this.listLoading = false;
  1111. this.$message({
  1112. message: error,
  1113. type: "error"
  1114. });
  1115. }
  1116. );
  1117. })
  1118. .catch(() => {});
  1119. },
  1120. detail(i) {
  1121. this.$router.push("/list/" + this.list[i].id + "/" + this.list[i].projectName);
  1122. },
  1123. // 切换当前选项的索引
  1124. switchs(e) {
  1125. this.idx = e
  1126. this.page = 1
  1127. // console.log(this.searchField)
  1128. this.getList()
  1129. },
  1130. // 下拉框选择
  1131. hiddens() {
  1132. // console.log(this.searchField)
  1133. this.page = 1
  1134. this.getList()
  1135. },
  1136. // 完成
  1137. completes(e, el) {
  1138. this.http.post('/task/finish', {
  1139. id: e,
  1140. taskStatus: el
  1141. },
  1142. res => {
  1143. if (res.code == "ok") {
  1144. this.$message({
  1145. message: "操作成功",
  1146. type: "success"
  1147. });
  1148. this.getList();
  1149. } else {
  1150. this.$message({
  1151. message: res.msg,
  1152. type: "error"
  1153. });
  1154. }
  1155. },
  1156. error => {
  1157. this.listLoading = false;
  1158. this.$message({
  1159. message: error,
  1160. type: "error"
  1161. });
  1162. }
  1163. )
  1164. },
  1165. // 点击任务事件
  1166. editTask(task) {
  1167. // console.log(task)
  1168. this.addFormVisible = true;
  1169. // this.addLoading = false;
  1170. this.title = "编辑任务";
  1171. this.getTaskDetail(task.id);
  1172. this.getTaskProgressList(task.id); // 获取任务进展列表
  1173. this.getUsers(); // 获取名单数据
  1174. this.gain(task); // 获取评论列表
  1175. // this.getStageList()
  1176. },
  1177. addExecutorLine() {
  1178. this.addForm.executorListFront.push({executorId:null, planHours:8});
  1179. this.$forceUpdate();
  1180. },
  1181. removeExecutorLine(index) {
  1182. this.addForm.executorListFront.splice(index,1);
  1183. this.$forceUpdate();
  1184. },
  1185. getTaskDetail(id) {
  1186. this.http.post('/task/getTask',{id: id},
  1187. res => {
  1188. if (res.code == "ok") {
  1189. this.addForm = res.data;
  1190. this.addForm.createDate = null;
  1191. this.addForm.indate = null;
  1192. this.addLoading = false;
  1193. this.recentProgressInfo = this.addForm.progress;
  1194. this.addForm.executorListFront = this.addForm.executorList;
  1195. //删除中间传值的变量数组
  1196. delete this.addForm.executorList;
  1197. } else {
  1198. this.$message({
  1199. message: res.msg,
  1200. type: "error"
  1201. });
  1202. }
  1203. },
  1204. error => {
  1205. this.$message({
  1206. message: error,
  1207. type: "error"
  1208. });
  1209. });
  1210. },
  1211. //获取任务进展列表
  1212. getTaskProgressList(taskId) {
  1213. this.taskIid = taskId
  1214. this.http.post('/task-progress/list', {taskId: taskId},
  1215. res => {
  1216. if (res.code == "ok") {
  1217. this.ProgressList = res.data;
  1218. this.recentProgressInfo = res.data[0]
  1219. } else {
  1220. this.$message({
  1221. message: res.msg,
  1222. type: "error"
  1223. });
  1224. }
  1225. }
  1226. );
  1227. },
  1228. getUsers() {
  1229. // console.log(this.port.manage.list)
  1230. // this.http.post(this.port.manage.list, {
  1231. // departmentId: -1,
  1232. // pageIndex: 1,
  1233. // pageSize: 99999
  1234. // },
  1235. this.http.post('/user/getSimpleActiveUserList', {},
  1236. res => {
  1237. if (res.code == "ok") {
  1238. this.users = res.data;
  1239. } else {
  1240. this.$message({
  1241. message: res.msg,
  1242. type: "error"
  1243. });
  1244. }
  1245. },
  1246. error => {
  1247. this.$message({
  1248. message: error,
  1249. type: "error"
  1250. });
  1251. });
  1252. },
  1253. // 获取评论列表
  1254. gain (task) {
  1255. this.commentList = [];
  1256. this.taskId = task.id;
  1257. this.http.post('/task-comment/getList', {taskId: task.id},
  1258. res => {
  1259. if (res.code == "ok") {
  1260. this.commentList = res.data
  1261. this.sppk(this.commentList) // 获取参与人的方法
  1262. } else {
  1263. this.$message({
  1264. message: res.msg,
  1265. type: "error"
  1266. });
  1267. }
  1268. },
  1269. error => {
  1270. this.$message({
  1271. message: error,
  1272. type: "error"
  1273. });
  1274. });
  1275. },
  1276. // 获取评论参与人
  1277. sppk(comit) {
  1278. var sk = []
  1279. comit.forEach(function(e){
  1280. sk.push(e.userName)
  1281. })
  1282. this.critic = new Set(sk)
  1283. },
  1284. sss(){
  1285. this.$refs.addRem.style.display="none"
  1286. },
  1287. addprogress(){ // 添加子任务进展事件
  1288. this.$refs.proBox.style.display="block"
  1289. this.$refs.addPro.style.display="none"
  1290. },
  1291. shutPro() { // 关闭任务进展
  1292. this.$refs.addPro.style.display="block"
  1293. this.$refs.addRem.style.display="none"
  1294. this.$refs.proBox.style.display="none"
  1295. },
  1296. addI() { // 打开选择查看
  1297. this.$refs.addRem.style.display="block"
  1298. },
  1299. load() {
  1300. if(this.count >= 0) return
  1301. this.count += 2
  1302. },
  1303. onEditorFocus() {
  1304. this.onEditorBlur()
  1305. },
  1306. kkk(el){
  1307. var k = this.checkLists.indexOf(el.id)
  1308. if (k == -1) {
  1309. this.checkLists.push(el.id)
  1310. } else {
  1311. this.checkLists.splice(k, 1)
  1312. }
  1313. },
  1314. shutPro() { // 关闭任务进展
  1315. this.$refs.addPro.style.display="block"
  1316. this.$refs.addRem.style.display="none"
  1317. this.$refs.proBox.style.display="none"
  1318. },
  1319. addTaskProgress() { //创建任务进展
  1320. var param = {
  1321. taskId: this.taskIid,
  1322. status: this.radio,
  1323. content: this.text2,
  1324. participatorIds: this.checkLists.toString()
  1325. };
  1326. this.http.post('/task-progress/addProgress', param,
  1327. res => {
  1328. if (res.code == "ok") {
  1329. this.shutPro()
  1330. this.getTaskProgressList(this.taskIid)
  1331. this.$message({
  1332. message: '发布成功',
  1333. type: "success"
  1334. });
  1335. this.checkboxGrounp = [],
  1336. this.checkLists = [],
  1337. this.text2 = '',
  1338. this.radio = 0
  1339. } else {
  1340. this.$message({
  1341. message: res.msg,
  1342. type: "error"
  1343. });
  1344. }
  1345. }
  1346. );
  1347. },
  1348. //删除任务进展
  1349. deleteTaskProgress(id) {
  1350. this.http.post('/task-progress/deleteProgress', {id: id},
  1351. res => {
  1352. if (res.code == "ok") {
  1353. this.getTaskProgressList(this.taskIid)
  1354. this.$message({
  1355. message: '删除成功',
  1356. type: "success"
  1357. });
  1358. } else {
  1359. this.$message({
  1360. message: res.msg,
  1361. type: "error"
  1362. });
  1363. }
  1364. }
  1365. );
  1366. },
  1367. //显示子任务创建卡片
  1368. addSubTask() {
  1369. this.addFormVisible = true;
  1370. this.addForm = {parentTname: this.addForm.name,parentTid: this.addForm.id,projectId: this.addForm.projectId, groupId: this.addForm.groupId, taskLevel:0, planHours: 8, taskType: 0};
  1371. this.addLoading = false;
  1372. },
  1373. taskLineClick(row, column, event) {
  1374. this.editTask(row);
  1375. },
  1376. finishTask(task) {
  1377. this.http.post('/task/finish',{id: task.id, taskStatus: task.taskStatus},
  1378. res => {
  1379. if (res.code == "ok") {
  1380. if (this.groupType == 0) {
  1381. this.getStageList();
  1382. } else {
  1383. // this.getViewTaskList();
  1384. }
  1385. } else {
  1386. this.$message({
  1387. message: res.msg,
  1388. type: "error"
  1389. });
  1390. }
  1391. },
  1392. error => {
  1393. this.$message({
  1394. message: error,
  1395. type: "error"
  1396. });
  1397. });
  1398. },
  1399. //认领任务
  1400. addAsMyTask(task) {
  1401. this.http.post('/task/addAsMyTask',{id: task.id},
  1402. res => {
  1403. if (res.code == "ok") {
  1404. this.getStageList();
  1405. } else {
  1406. this.$message({
  1407. message: res.msg,
  1408. type: "error"
  1409. });
  1410. }
  1411. },
  1412. error => {
  1413. this.$message({
  1414. message: error,
  1415. type: "error"
  1416. });
  1417. });
  1418. },
  1419. timess(){
  1420. var date = new Date()
  1421. let Y = date.getFullYear()
  1422. let M = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : (date.getMonth() + 1)
  1423. let D = date.getDate() < 10 ? ('0' + date.getDate()) : date.getDate()
  1424. this.times = `${Y}-${M}-${D}`
  1425. },
  1426. showSubTaskList(task) {
  1427. this.subTaskVisible = true;
  1428. this.addForm = task;
  1429. },
  1430. addTask(stage) {
  1431. this.addFormVisible = true;
  1432. this.addForm = {projectId: stage.projectId, groupId: stage.groupId, stagesId: stage.id, taskLevel:0, planHours: 8, taskType: 0};
  1433. this.addLoading = false;
  1434. this.title="创建任务";
  1435. this.commentList = [];
  1436. },
  1437. addStage() {
  1438. this.addStageDialog = true;
  1439. this.stageForm = {groupId: this.selectedGroup.id, projectId: this.curProjectId};
  1440. },
  1441. // 获得焦点时触发
  1442. onEditorBlur(){
  1443. let theEle = this.$refs.text; // 获取元素
  1444. var img = theEle.value.match(/<img[^>]+>/g); // 赛选 img 标签
  1445. var arrImg = ''
  1446. for (var j = 0; j < img.length; j++) {
  1447. // 正则匹配,摘出img标签下的src里的内容,即capture
  1448. img[j].replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, function(match, capture) {
  1449. arrImg += capture
  1450. });
  1451. }
  1452. // 原来的字符流大小,单位为字节
  1453. var strLen = arrImg.length;
  1454. // 计算后得到的文件流大小,单位为字节
  1455. var fileSize=parseInt(strLen-(strLen/8)*2);
  1456. var size = "";
  1457. size = (fileSize/1024/1024).toFixed(2);
  1458. if (size > 2){
  1459. this.textContent = false
  1460. this.$message({
  1461. showClose: true,
  1462. message: '图片超过了2MB,请重新上传',
  1463. type: 'warning'
  1464. });
  1465. }
  1466. this.textContent = true
  1467. },
  1468. backToParentTask() {
  1469. this.getTaskDetail(this.addForm.parentTid);
  1470. },
  1471. // 点击发布
  1472. release() {
  1473. if(this.textarea2.length <= 0) return this.$message({message: "请输入内容", type: "error"})
  1474. this.http.post('/task-comment/add', {taskId: this.taskId, userId: this.user.id, content: this.textarea2},
  1475. res => {
  1476. if(res.code == "ok"){
  1477. this.commentList.push(res.data)
  1478. this.sppk(this.commentList)
  1479. this.textarea2 = ""
  1480. this.contRoll() // 滚动到底部
  1481. } else {
  1482. this.$message({
  1483. message: res.msg,
  1484. type: "error"
  1485. });
  1486. }
  1487. },
  1488. error => {
  1489. this.$message({
  1490. message: error,
  1491. type: "error"
  1492. });
  1493. })
  1494. },
  1495. // 滚动到底部
  1496. contRoll(){
  1497. this.$nextTick(() => {
  1498. this.$refs.main.scrollTop = this.$refs.contRoll.scrollHeight;
  1499. })
  1500. },
  1501. submitInsert() {
  1502. if (this.textContent !== true) return this.$message({
  1503. showClose: true,
  1504. message: '图片太大,请重新上传',
  1505. type: 'warning'
  1506. });
  1507. //检查是有重名的执行人
  1508. var exeList = this.addForm.executorListFront;
  1509. for (var i=0;i<exeList.length;i++) {
  1510. var findSameUser = false;
  1511. for (var j=i+1;j<exeList.length; j++) {
  1512. if (exeList[i].executorId && exeList[j].executorId && exeList[i].executorId == exeList[j].executorId) {
  1513. findSameUser = true;
  1514. break;
  1515. }
  1516. }
  1517. if (findSameUser) {
  1518. return this.$message({
  1519. showClose: true,
  1520. message: '执行人存在重复',
  1521. type: 'error'
  1522. });
  1523. }
  1524. }
  1525. this.$refs.form1.validate(valid => {
  1526. if (valid) {
  1527. delete this.addForm.subTaskList;
  1528. delete this.addForm.progress;
  1529. delete this.addForm.refTaskList;
  1530. this.addForm.executorListStr = JSON.stringify(this.addForm.executorListFront);
  1531. this.http.post('/task/save',this.addForm,
  1532. res => {
  1533. if (res.code == "ok") {
  1534. this.$message({
  1535. message: "提交成功",
  1536. type: "success"
  1537. });
  1538. if (this.addForm.parentTid == null) {
  1539. this.addFormVisible = false;
  1540. if (this.groupType == 0) {
  1541. this.getStageList();
  1542. } else {
  1543. // this.getViewTaskList();
  1544. }
  1545. } else {
  1546. this.backToParentTask();
  1547. }
  1548. this.getList()
  1549. } else {
  1550. this.$message({
  1551. message: res.msg,
  1552. type: "error"
  1553. });
  1554. }
  1555. },
  1556. error => {
  1557. this.$message({
  1558. message: error,
  1559. type: "error"
  1560. });
  1561. }
  1562. );
  1563. }
  1564. });
  1565. },
  1566. //加载项目内的任务列表
  1567. getStageList() {
  1568. // console.log('进来了')
  1569. this.http.post('/stages/list',{groupId: this.selectedGroup.id, projectId: this.selectedGroup.projectId, order: this.order, isDesc: this.isDesc},
  1570. res => {
  1571. if (res.code == "ok") {
  1572. this.stageList = res.data.list;
  1573. // console.log('触发获取任务列表函数')
  1574. this.timess() // 处理时间的方法
  1575. } else {
  1576. this.$message({
  1577. message: res.msg,
  1578. type: "error"
  1579. });
  1580. }
  1581. },
  1582. error => {
  1583. this.$message({
  1584. message: error,
  1585. type: "error"
  1586. });
  1587. });
  1588. },
  1589. //删除当前编辑的任务
  1590. deleteTask() {
  1591. var warning='';
  1592. if (this.addForm.subTaskList.length > 0) {
  1593. warning='您确定要删除当前任务及其子任务吗?';
  1594. } else {
  1595. warning='您确定要删除当前任务吗?';
  1596. }
  1597. this.$confirm(warning, "提示", {
  1598. //type: 'warning'
  1599. }).then(() => {
  1600. this.http.post('/task/delete',{id: this.addForm.id},
  1601. res => {
  1602. if (res.code == "ok") {
  1603. this.addFormVisible = false;
  1604. // this.getStageList();
  1605. this.getList();
  1606. } else {
  1607. this.$message({
  1608. message: res.msg,
  1609. type: "error"
  1610. });
  1611. }
  1612. },
  1613. error => {
  1614. this.$message({
  1615. message: error,
  1616. type: "error"
  1617. });
  1618. });
  1619. });
  1620. },
  1621. chan() {
  1622. // console.log(this.critic)
  1623. }
  1624. },
  1625. created() {
  1626. let height = window.innerHeight;
  1627. this.tableHeight = height - 195;
  1628. const that = this;
  1629. window.onresize = function temp() {
  1630. that.tableHeight = window.innerHeight - 195;
  1631. };
  1632. },
  1633. mounted() {
  1634. this.getList();
  1635. this.getUsers();
  1636. },
  1637. };
  1638. </script>
  1639. <style lang="scss" scoped>
  1640. // .classification {
  1641. // width: 120px;
  1642. // // height: 100%;
  1643. // border-right: 1px solid #f2f2f2;
  1644. // display: flex;
  1645. // flex-wrap: wrap;
  1646. // // align-items: center;
  1647. // // justify-content: center;
  1648. // padding-top: 20px;
  1649. // }
  1650. // .classification p{
  1651. // width: 120px;
  1652. // text-align: center;
  1653. // line-height: 50px;
  1654. // margin: 0;
  1655. // cursor: pointer;
  1656. // }
  1657. // .classification p:hover {
  1658. // background: #dddddd;
  1659. // }
  1660. // .on {
  1661. // // background: #dddddd;
  1662. // color: #409EFF;
  1663. // }
  1664. // .acl{
  1665. // display: inline-block;
  1666. // width: 300px;
  1667. // height: 22px;
  1668. // // line-height: 22px;
  1669. // overflow: hidden;
  1670. // white-space: nowrap;
  1671. // text-overflow: ellipsis;
  1672. // margin: 0;
  1673. // padding: 0;
  1674. // line-height: 0;
  1675. // }
  1676. // .cal {
  1677. // width: 300px;
  1678. // overflow: hidden;
  1679. // white-space: nowrap;
  1680. // text-overflow: ellipsis;
  1681. // cursor: pointer;
  1682. // }
  1683. </style>