list.vue 80 KB

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