list.vue 78 KB

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