list.vue 76 KB

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