taskComponent.vue 90 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039
  1. <template>
  2. <div>
  3. <div style="height: 72vh;overflow: auto;">
  4. <el-form ref="form1" :model="addForm" :rules="taskRules" label-width="120px">
  5. <el-form-item label="所属项目" v-if="showOrNot" prop="projectId">
  6. <el-select v-model="addForm.projectId" :placeholder="$t('defaultText.pleaseChoose')" @change="agentCreatesEvents(1)" filterable="true" style="width:100%;">
  7. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName + item.projectCode" :value="item.id">
  8. <span style="float: left;color: #8492a6;">{{ item.projectCode }}</span>
  9. <span style="float: right;font-size: 13px;">{{ item.projectName }}</span>
  10. </el-option>
  11. </el-select>
  12. </el-form-item>
  13. <el-form-item label="所属任务分组" v-if="showOrNot" prop="groupId">
  14. <el-select v-model="addForm.groupId" :placeholder="$t('defaultText.pleaseChoose')" @change="agentCreatesEvents(2)" filterable="true" style="width:100%;">
  15. <el-option v-for="item in groupList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  16. </el-select>
  17. </el-form-item>
  18. <el-form-item label="所属任务列表" v-if="showOrNot" prop="stagesId">
  19. <el-select v-model="addForm.stagesId" :placeholder="$t('defaultText.pleaseChoose')" filterable="true" style="width:100%;">
  20. <el-option v-for="item in stageList" :key="item.id" :label="item.stagesName" :value="item.id"></el-option>
  21. </el-select>
  22. </el-form-item>
  23. <!--子任务需要选择任务列表 -->
  24. <el-form-item :label="$t('tasklist')" prop="stages" v-if="addForm.parentTid != null">
  25. <el-select v-model="addForm.stagesId" style="width:100%;" >
  26. <el-option v-for="item in stageList" :key="item.id" :label="item.stagesName" :value="item.id"></el-option>
  27. </el-select>
  28. </el-form-item>
  29. <el-form-item :label="$t('types')">
  30. <el-select v-model="addForm.taskType" style="width:100%;" :disabled="((this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement) && !(groupResponsibleId == user.id)" @change="selchg()">
  31. <el-option v-for="item in taskTypeList" :key="item.id" :label="item.name" :value="item.id">
  32. <i :class="item.icon" ></i>
  33. <span>{{item.name}}</span>
  34. </el-option>
  35. </el-select>
  36. </el-form-item>
  37. <el-form-item :label="$t('taskdefinition')" prop="name">
  38. <el-input v-model="addForm.name" :maxlength="40" :disabled="(this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" :placeholder="$t('enterthetaskcontent')" clearable></el-input>
  39. </el-form-item>
  40. <!-- {{timelabel}}{{mileageCup}} -->
  41. <el-form-item :label="!timelabel ? $t('starttimes') : $t('jie-zhi-shi-jian')" prop="startDate">
  42. <el-date-picker v-model="addForm.startDate" type="date" style="width:40%;" value-format="yyyy-MM-dd"
  43. :placeholder="$t('pleaseselectadate')" :disabled="(this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" @change="DateChange()" v-if="!timelabel"></el-date-picker>
  44. <span style="margin-left:30px;margin-right:10px;" v-if="!timelabel">{{ $t('deadline') }}</span>
  45. <el-date-picker style="width:40%;" v-model="addForm.endDate" type="date" value-format="yyyy-MM-dd"
  46. :placeholder="$t('pleaseselectadate')" :disabled="(this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" @change="DateChange()"></el-date-picker>
  47. <span style="margin-left:30px;margin-right:10px;" v-if="timelabel && mileageCup">{{ $t('wan-cheng-shi-jian') }}</span>
  48. <el-date-picker style="width:40%;" v-if="timelabel && mileageCup" v-model="addForm.finishDate" type="date" value-format="yyyy-MM-dd"
  49. :placeholder="$t('pleaseselectadate')" :disabled="(this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" @change="DateChange()"></el-date-picker>
  50. </el-form-item>
  51. <div style="border: 1px solid #ddd;margin:5px 0;padding:5px 0;">
  52. <el-form-item :label="$t('zhi-hang-ren') + (index+1)" v-for="(executorItem, index) in addForm.executorListFront" :key="index">
  53. <el-select v-if="user.userNameNeedTranslate != 1" v-model="executorItem.executorId" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" size="small" filterable clearable :placeholder="$t('pleaseselectanexecutor')" style="width:40%;" @change="$forceUpdate()">
  54. <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id">
  55. <span style="float: left">{{ item.name }}</span>
  56. <span style="float: right; color: #8492a6; font-size: 13px;margin-left: 20px" v-if="item.jobNumber">{{ item.jobNumber }}</span>
  57. </el-option>
  58. </el-select>
  59. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'mini'" :filterable="true" :subject="users" :subjectId="executorItem.executorId" :distinction="'1'" @selectCal="selectCal" :index="index" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)"></selectCat>
  60. <span style="margin-left:30px;margin-right:10px;">{{ $t('plantime') }}</span>
  61. <el-input-number size="small" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" v-model="gstimday[index]" style="width:16%;" :min="1" :max="100" :placeholder="$t('danweitian')" @change="chggstim(0,index)"></el-input-number ><span style="margin-left:5px;">{{ $t('time.day') }}</span>
  62. <el-input-number size="small" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" v-model="gstimhour[index]" style="width:16%;" :min="1" :max="100" :placeholder="$t('pleaseentertheplannedworking')" @change="chggstim(1,index)"></el-input-number ><span style="margin-left:5px;">{{ $t('time.hour') }}</span>
  63. <!-- <el-input-number v-model="numnnumnum" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number> -->
  64. <!-- 移除执行人 -->
  65. <i class="el-icon-delete" v-if="index>0 && (addForm.id == null|| user.id == addForm.createrId || currentProject.inchargerId == user.id|| permissions.projectManagement || groupResponsibleId == user.id)" style="margin-left:5px" @click="removeExecutorLine(index)"></i>
  66. </el-form-item>
  67. <el-link type="primary" v-if="(((addForm.executorListFront == null || addForm.executorListFront.length<10) &&
  68. (addForm.id == null|| user.id == addForm.createrId || currentProject.inchargerId == user.id || permissions.projectManagement)) ||
  69. groupResponsibleId == user.id)"
  70. style="margin-left:35px;" @click="addExecutorLine">{{ $t('addinganexecutor') }}</el-link>
  71. </div>
  72. <el-form-item :label="$t('priority')">
  73. <el-select v-model="addForm.taskLevel" style="width:100%;" >
  74. <el-option v-for="item in importanceList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  75. </el-select>
  76. </el-form-item>
  77. <!-- 富文本 -->
  78. <el-form-item :label="$t('detaileddescription')" style="height: 200px">
  79. <!-- <Editor id="tinymce" v-model="tinymceHtml" :init="editorInit"></Editor> -->
  80. <!-- <el-input type="textarea" v-model="addForm.taskDesc" :rows="3"></el-input> -->
  81. <!-- <quill-edito v-model="addForm.taskDesc"></quill-edito> -->
  82. <quill-editor style="height: 150px" ref="text" v-model="addForm.taskDesc" class="myQuillEditor" :options="editorOption" @blur="onEditorBlur($event)" @focus="onEditorFocus($event)"/>
  83. </el-form-item>
  84. <!-- 富文本 -->
  85. <div v-if="addForm.id != null">
  86. <el-divider ></el-divider>
  87. <!-- 任务进展 -->
  88. <template v-if="!timelabel || isRelationItem">
  89. <p ><i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">{{ $t('taskprogress') }}</i>
  90. <span ref="addPro" style="display: block; float:right;"><el-link @click="addprogress">{{ $t('addtaskprogress') }}</el-link></span>
  91. </p>
  92. <!-- 任务进展展示 -->
  93. <div style="display: none;" ref="proBox" class="progress">
  94. <!-- <el-form :model="> -->
  95. <el-radio-group v-model="radio">
  96. <el-radio :label="0" class="rala1">{{ $t('normals') }}</el-radio>
  97. <el-radio :label="1" class="rala2">{{ $t('atrisk') }}</el-radio>
  98. <el-radio :label="2" class="rala3">{{ $t('withinthetimelimit') }}</el-radio>
  99. </el-radio-group>
  100. <el-input
  101. type="textarea"
  102. border="0"
  103. :autosize="{ minRows: 2, maxRows: 6}"
  104. :placeholder="$t('detailedprogressdescription')"
  105. v-model="text2"
  106. style="margin:10px 0 0 0">
  107. </el-input>
  108. <h4 style="font-weight: normal;">{{ $t('tixiang') }}{{checkLists.length}}</h4>
  109. <i class="el-icon-circle-plus pron_i" style="font-size: 28px;color: #409EFF;" @click="addI(0)"></i>
  110. <div class="remind" ref="addRem" style="display: none">
  111. <el-checkbox-group v-model="checkboxGrounp" v-for="item in users" :key="item.id">
  112. <p>
  113. <el-checkbox :label="item.name" @change="kkk(item)">
  114. <span>
  115. <span v-if="user.userNameNeedTranslate != '1'">
  116. {{item.name}}
  117. </span>
  118. <span v-if="user.userNameNeedTranslate == '1'">
  119. <ww-open-data type='userName' :openid='item.name'></ww-open-data>
  120. </span>
  121. </span>
  122. </el-checkbox>
  123. </p>
  124. </el-checkbox-group>
  125. </div>
  126. <div class="ssp" @click="sss"></div>
  127. <!-- </el-form> -->
  128. <div class="pro_btn">
  129. <el-button size="mini" @click="shutPro">{{ $t('btn.cancel') }}</el-button>
  130. <el-button size="mini" type="primary" @click="addTaskProgress">{{ $t('fa-bu') }}</el-button>
  131. </div>
  132. </div>
  133. <div class="ddl" v-if="recentProgressInfo != null && recentProgressInfo.id != null">
  134. <div class="elCard" style="margin-bottom: 10px; height:" >
  135. <i class="el-icon-success" style="color: #43d14f;" v-if="recentProgressInfo.status == 0"></i>
  136. <i class="el-icon-success" style="color: #fd7624;" v-else-if="recentProgressInfo.status == 1"></i>
  137. <i class="el-icon-success" style="color: #fd4d47;" v-else></i>
  138. <span v-if="recentProgressInfo.status == 0">{{ $t('normals') }}</span>
  139. <span v-else-if="recentProgressInfo.status == 1">{{ $t('normals') }}</span>
  140. <span v-else>{{ $t('withinthetimelimit') }}</span>
  141. <el-dropdown trigger="click" style="float:right;cursor:pointer; float: right;">
  142. <i class="el-icon-more" ></i>
  143. <el-dropdown-menu slot="dropdown">
  144. <el-dropdown-item divided>
  145. <span @click="deleteTaskProgress(recentProgressInfo.id)"><i class="el-icon-delete"></i>{{ $t('deleteList ') }}</span></el-dropdown-item>
  146. </el-dropdown-menu>
  147. </el-dropdown>
  148. <!-- <div class="elCard_qu">{{recentProgressInfo.creatorName}}{{ $t('geng-xin-yu') }}{{recentProgressInfo.indate | relativeTime}}</div> -->
  149. <div class="elCard_qu">
  150. <span>
  151. <span v-if="user.userNameNeedTranslate != '1'">
  152. {{recentProgressInfo.creatorName}}
  153. </span>
  154. <span v-if="user.userNameNeedTranslate == '1'">
  155. <ww-open-data type='userName' :openid='recentProgressInfo.creatorName'></ww-open-data>
  156. </span>
  157. </span>
  158. {{ $t('geng-xin-yu') }}{{recentProgressInfo.indate | relativeTime}}
  159. </div>
  160. <p style="padding-left: 20px;">{{recentProgressInfo.content}}</p>
  161. <div class="examine"><el-button type="text" @click="innerVisibless = true" style="color: #8F87A3;">{{ $t('viewingHistory') }}</el-button></div>
  162. </div>
  163. </div>
  164. <!-- 任务列表没有数据的时候展示 -->
  165. <div class="nones" v-if="ProgressList.length <= 0">
  166. {{ $t('nodata') }}
  167. </div>
  168. <!-- 任务进展完整状态 -->
  169. <el-dialog :title="$t('other.prompts')" :visible.sync="innerVisibless" append-to-body width="500px">
  170. <div class="integrity">
  171. <h3 style="font-weight: normal;display: inline-block;margin: 0 0 20px 0;">{{ $t('taskprogress') }} :{{ProgressList.length}}</h3>
  172. <!-- <span class="write"><i class="el-icon-circle-plus"></i>填写进展</span> -->
  173. <el-divider></el-divider>
  174. <!-- -->
  175. <div class="block" style="height: 200px;">
  176. <el-timeline style="padding:20px 0 0 0;">
  177. <el-timeline-item
  178. v-for="(activity, index) in ProgressList"
  179. :key="index">
  180. <div class="tb">
  181. <span v-if="activity.status == 0" style="color: #43D14F" class="icon"></span>
  182. <span v-if="activity.status == 1" style="color: #FD7624" class="icon"></span>
  183. <span v-if="activity.status == 2" style="color: red" class="icon"></span>
  184. <div>
  185. <span v-if="activity.status == 0" style="color: #43D14F">{{ $t('normals') }}</span>
  186. <span v-if="activity.status == 1" style="color: #FD7624">{{ $t('atrisk') }}</span>
  187. <span v-if="activity.status == 2" style="color: red">{{ $t('withinthetimelimit') }}</span>
  188. <span style="display: inline-block; float: right; color: #8C8C8C">{{activity.indate | relativeTime}}</span>
  189. </div>
  190. <p style="color: #8C8C8C">{{activity.content}}</p>
  191. </div>
  192. </el-timeline-item>
  193. </el-timeline>
  194. </div>
  195. <!-- -->
  196. </div>
  197. <span slot="footer" class="dialog-footer foooot">
  198. <el-button type="primary" @click="innerVisibless = false">{{ $t('Shutdown') }}</el-button>
  199. </span>
  200. </el-dialog>
  201. </template>
  202. <!-- 子任务/关联任务 -->
  203. <p ><i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">{{timelabel && !isRelationItem ? $t('guanlian') : $t('zirwu')}}</i>
  204. <el-link style="float:right;" @click="addRelation" v-if="timelabel && !isRelationItem">{{ $t('associatedTask') }}</el-link>
  205. <el-link style="float:right;" @click="addSubTask" v-else>{{ $t('addingsubtask') }}</el-link>
  206. </p>
  207. <!-- 关联任务列表 -->
  208. <el-table key="guanlian" :data="relationSubTaskList" v-if="timelabel && !isRelationItem"
  209. :header-cell-style="{'font-weight':'normal'}"
  210. highlight-current-row
  211. v-loading="listLoading"
  212. style="width: 100%;margin-top:10px;"
  213. @row-click="relationTaskClick">
  214. <el-table-column prop="taskStatus" :label="$t('wan-cheng')" width="50" >
  215. <template slot-scope="scope">
  216. <el-checkbox :disabled="scope.row.taskStatus==2" :checked="scope.row.taskStatus==1?true:false" size="large" class="cb" @change="relationFinishTask(scope.row)"></el-checkbox>
  217. </template>
  218. </el-table-column>
  219. <el-table-column prop="taskName" :label="$t('biao-ti')" >
  220. <template slot-scope="scope">
  221. <el-tooltip class="item" effect="dark" :content="scope.row.taskName" placement="top" style="cursor:pointer;color:#409eff;">
  222. <span style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;" > {{scope.row.taskName}}</span>
  223. </el-tooltip>
  224. </template>
  225. </el-table-column>
  226. <el-table-column :label="$t('operation')" width="130" align="left">
  227. <template slot-scope="scope">
  228. <el-button @click.stop.native="deleteRelationItem(scope.row.id)" size="mini">{{ $t('dissociated') }}</el-button>
  229. </template>
  230. </el-table-column>
  231. </el-table>
  232. <!--子任务列表 -->
  233. <el-table key="zi" :data="addForm.subTaskList" v-else
  234. :header-cell-style="{'font-weight':'normal'}"
  235. highlight-current-row v-loading="listLoading" style="width: 100%;margin-top:10px;" @row-click="taskLineClick">
  236. <el-table-column prop="taskStatus" :label="$t('wan-cheng')" width="50" >
  237. <template slot-scope="scope">
  238. <el-checkbox :disabled="scope.row.taskStatus==2" :checked="scope.row.taskStatus==1?true:false" size="large" class="cb"
  239. @change="finishTask(scope.row)"
  240. ></el-checkbox>
  241. </template>
  242. </el-table-column>
  243. <el-table-column prop="name" :label="$t('biao-ti')" >
  244. <template slot-scope="scope">
  245. <el-tooltip class="item" effect="dark" :content="scope.row.name" placement="top">
  246. <span style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;" > {{scope.row.name}}</span>
  247. </el-tooltip>
  248. </template>
  249. </el-table-column>
  250. <el-table-column prop="executorName" :label="$t('zhi-hang-ren')" width="100" >
  251. <template slot-scope="scope">
  252. <span v-if="user.userNameNeedTranslate != 1">
  253. {{scope.row.executorName == null?$t('dai-fen-pei'):scope.row.executorName}}
  254. </span>
  255. <span v-if="user.userNameNeedTranslate == 1">
  256. <span v-if="scope.row.executorName == null">
  257. {{$t('dai-fen-pei')}}
  258. </span>
  259. <span v-else>
  260. <span v-for="item,index in scope.row.executorName" :key="index">
  261. <ww-open-data type='userName' :openid='item'></ww-open-data>
  262. <span v-if="index < scope.row.executorName.length - 1">,</span>
  263. </span>
  264. </span>
  265. </span>
  266. </template>
  267. </el-table-column>
  268. <el-table-column prop="endDate" :label="$t('deadline')" width="100" >
  269. <template slot-scope="scope">
  270. <p v-if="scope.row.endDate >= times">{{scope.row.endDate}}</p>
  271. <p v-else style="background: #e62412; color: #fff;text-align: center; border-radius: 3px;">{{scope.row.endDate}}</p>
  272. </template>
  273. </el-table-column>
  274. </el-table>
  275. </div>
  276. </el-form>
  277. <!-- 关联文件列表 -->
  278. <template v-if="isEditFile">
  279. <div style="width:100%;margin:1em 0;">
  280. <i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">{{ $t('jiafuchengguo') }}</i>
  281. <el-link @click="relationFileClick()" style="float:right;margin-left:10px">{{ $t('associatedfiles') }}</el-link>
  282. <el-upload style="float:right;" action="#" :http-request="uploadFileClick" :show-file-list="false" :multiple="false">
  283. <el-link>{{ $t('uoloadFiles') }}</el-link>
  284. </el-upload>
  285. </div>
  286. <el-table
  287. v-loading="fileListLoading"
  288. ref="filetable"
  289. :data="taskFileList"
  290. :header-cell-style="{'font-weight':'normal'}"
  291. highlight-current-row
  292. max-height="240"
  293. style="width: 100%;margin-top:10px;margin-bottom:15px">
  294. <el-table-column :label="$t('headerTop.serialNumber')" prop="documentType" min-width="40" align="center">
  295. <template slot-scope="scope">
  296. <div>
  297. {{scope.$index + 1}}
  298. </div>
  299. </template>
  300. </el-table-column>
  301. <el-table-column :label="$t('filenames')" prop="documentName" min-width="180"></el-table-column>
  302. <el-table-column :label="$t('filesize')" prop="size" min-width="60" align="center"></el-table-column>
  303. <el-table-column :label="$t('founder')" prop="creatorName" min-width="60" align="center">
  304. <template slot-scope="scope">
  305. <div>
  306. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.creatorName}}</span>
  307. <span v-if="user.userNameNeedTranslate == 1">
  308. <ww-open-data type='userName' :openid='scope.row.creatorName'></ww-open-data>
  309. </span>
  310. </div>
  311. </template>
  312. </el-table-column>
  313. <el-table-column :label="$t('creationtime')" prop="indate" min-width="120" align="center">
  314. <template slot-scope="scope">
  315. <span>{{scope.row.indate[0] + '-' + scope.row.indate[1] + '-' + scope.row.indate[2] + '\u0020\u0020' + scope.row.indate[3] + ':' + scope.row.indate[4] + ':' + scope.row.indate[5]}}</span>
  316. </template>
  317. </el-table-column>
  318. <el-table-column :label="$t('operation')" min-width="90">
  319. <template slot-scope="scope">
  320. <el-link :href="scope.row.url" :download="scope.row.documentName" type="primary" style="margin-right:7px">{{ $t('other.download') }}</el-link>
  321. <el-link @click="taskFileDelete(scope.row.id)">{{ $t('btn.delete') }}</el-link>
  322. </template>
  323. </el-table-column>
  324. </el-table>
  325. </template>
  326. <!-- 关联文件dialog -->
  327. <el-dialog v-if="relationFileDialog" :visible.sync="relationFileDialog" :title="$t('associatedfiles')" append-to-body>
  328. <span>{{ $t('wenjian1guanli') }}</span>
  329. <div>
  330. <span>{{ $t('xuanzwenjian') }}</span>
  331. <el-select v-model="addFileId" filterable >
  332. <el-option
  333. v-for="item in projectFileList"
  334. :key="item.id"
  335. :label="item.documentName"
  336. :value="item.id"
  337. ></el-option>
  338. </el-select>
  339. <el-button @click="addTaskFile()">{{ $t('btn.determine') }}</el-button>
  340. </div>
  341. </el-dialog>
  342. <el-dialog v-if="isRelationTab" :visible.sync="isRelationTab" :title="$t('associatedTask')" width="800px" append-to-body>
  343. <el-form ref="relationItemForm" label-width="100px">
  344. <el-form-item :label="$t('selecttask')" prop="taskType">
  345. <el-select v-model="relationvalue" multiple style="width:80%">
  346. <el-option
  347. v-for="item in relationdata"
  348. :key="item.id"
  349. :label="item.name"
  350. :value="item.id"
  351. ></el-option>
  352. </el-select>
  353. </el-form-item>
  354. </el-form>
  355. <div slot="footer" class="dialog-footer foooot">
  356. <el-button @click="isRelationTab = false">{{ $t('btn.cancel') }}</el-button>
  357. <el-button type="primary" @click="addRelationTask()">{{ $t('btn.determine') }}</el-button>
  358. </div>
  359. </el-dialog>
  360. </div>
  361. <div slot="footer" class="dialog-footer foooot">
  362. <el-button v-if="(user.id == addForm.createrId || currentProject.inchargerId == user.id || currentProject.creatorId == user.id || permissions.projectManagement) && canAddTask" @click.native="deleteTask()" style="float:left;">{{ $t('btn.delete') }}</el-button>
  363. <el-button @click.native="closeBounceds()">{{ $t('btn.cancel') }}</el-button>
  364. <el-button type="primary" @click="submitInsert" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  365. </div>
  366. <!-- <div slot="title" v-if="addForm.parentTid != null || isRelationItem" >
  367. <el-page-header @back="backToParentTask" :title="timelabel ? $t('returnmilestone') : $t('parenttask')" :content="timelabel ? relationPar.name : addForm.parentTname"></el-page-header>
  368. </div> -->
  369. <!-- 评论 -->
  370. <div class="remark" v-show="addForm.id != null">
  371. <span class="zh">
  372. <div class="player">
  373. <p>{{ $t('participantin') }}</p>
  374. <div class="bj">
  375. <span v-for="(pl, i) in critic" :key="i">
  376. <span style="background: #778899" v-if="user.userNameNeedTranslate != 1">{{pl.length > 2 ? pl.substring(pl.length - 2, pl.length) : pl}}</span>
  377. <span v-if="user.userNameNeedTranslate == 1">
  378. <ww-open-data type='userName' :openid='pl'></ww-open-data>
  379. </span>
  380. </span>
  381. <!-- <span style="background: #778899">{{pl.length}}</span> -->
  382. </div>
  383. </div>
  384. <div class="subject">
  385. <div class="sub-all">
  386. <div :class="dynamicTab ? 'subOn' : ''" @click="dynamicTab = true">{{ $t('alldynamic') }}</div>
  387. <div :class="dynamicTab ? '' : 'subOn'" @click="dynamicTab = false">{{ $t('xiang-guan-ri-bao') }}</div>
  388. </div>
  389. <div class="sub-details" ref="main" v-if="dynamicTab">
  390. <ul class="infinite-list" v-infinite-scroll="load" ref="contRoll">
  391. <div style="width: 100%" v-if="commentList.length <= 0">
  392. <img src="../assets/image/xiao.png" alt="">
  393. </div>
  394. <li v-for="i in count" class="infinite-list-item counli" :key="i">
  395. <p><i class="el-icon-s-fold"></i> <em>{{ $t('managerQucompletedthedependencytask') }}</em><span>{{ $t('onApril20') }}</span></p>
  396. </li>
  397. <li class="carts" v-for="item in commentList" :key="item.id">
  398. <!-- <el-image style="width: 30px; height: 30px" :src="url" :fit="fit"></el-image> -->
  399. <!-- <i :style="'background' + item.userColor"> -->
  400. <i :style="'background' + item.userColor">
  401. <i v-if="user.userNameNeedTranslate != 1">
  402. {{item.userName.length > 2 ? item.userName.substring(item.userName.length - 2, item.userName.length) : item.userName}}
  403. </i>
  404. <i v-if="user.userNameNeedTranslate == 1">
  405. <ww-open-data type='userName' :openid='item.userName'></ww-open-data>
  406. </i>
  407. </i>
  408. <div>
  409. <!-- <p>{{item.userName}}</p> -->
  410. <!-- <p> -->
  411. <p v-if="user.userNameNeedTranslate != 1">
  412. {{item.userName}}
  413. </p>
  414. <p v-if="user.userNameNeedTranslate == 1">
  415. <ww-open-data type='userName' :openid='item.userName'></ww-open-data>
  416. </p>
  417. <!-- </p> -->
  418. <em>
  419. <!-- {{item.content}} -->
  420. <p style="display: inline-block;padding: 0;margin: 0;" v-if="user.userNameNeedTranslate == 1">
  421. {{item.content.msg1}}
  422. <ww-open-data type='userName' :openid='item.content.msg2'></ww-open-data>
  423. {{item.content.msg3}}
  424. </p>
  425. <p style="display: inline-block;padding: 0;margin: 0;" v-if="user.userNameNeedTranslate != 1">{{item.content}}</p>
  426. </em>
  427. </div>
  428. <span>{{item.createTime | relativeTime}}</span>
  429. </li>
  430. </ul>
  431. </div>
  432. <div class="Daily" v-if="!dynamicTab">
  433. <div class="one_daily_body DailyBody">
  434. <el-card shadow="never" v-for="(item2,index2) in dailyList" :key="index2" style="margin-bottom: 20px;">
  435. <p>
  436. {{ $t('tian-bao-ren') }}: <span v-if="user.userNameNeedTranslate != 1">{{item2.userName}}</span>
  437. <span v-if="user.userNameNeedTranslate == 1">
  438. <ww-open-data type='userName' :openid='item2.userName'></ww-open-data>
  439. </span>
  440. <span style="float: right;">{{item2.createDate}}</span>
  441. </p>
  442. <p>{{ $t('other.approvalStatus') }}:
  443. <span v-if="user.company.packageEngineering == 0">
  444. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">
  445. <span v-if="item2.isDeptAudit==0">
  446. <span v-if="item2.projectAuditState==0">
  447. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  448. <span v-if="item2.projectAuditorName != null">(
  449. <span v-if="user.userNameNeedTranslate == '1'">
  450. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  451. </span>
  452. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  453. )</span>
  454. <!-- 审核 --> {{$t('other.audit')}}
  455. </span>
  456. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  457. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  458. <span v-if="item2.projectAuditorName != null">(
  459. <!-- {{item2.projectAuditorName}} -->
  460. <span v-if="user.userNameNeedTranslate == '1'">
  461. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  462. </span>
  463. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  464. )</span>
  465. <!-- 审核通过 --> {{$t('state.approved')}}
  466. </span>
  467. </span>
  468. <span v-else-if="item2.isDeptAudit==1">
  469. ({{$t('other.await')}}
  470. <span v-if="user.userNameNeedTranslate == '1'">
  471. <ww-open-data type='departmentName' :openid='item2.auditDeptName'></ww-open-data>
  472. </span>
  473. <span v-if="user.userNameNeedTranslate != '1'">{{item2.auditDeptName}}</span>
  474. {{$t('other.audit')}})
  475. </span>
  476. </span>
  477. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">{{$t('other.importWaitingForReview')}}</span>
  478. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">{{$t('state.alreadyPassed')}}
  479. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1">{{$t('other.automaticReview')}}</span>
  480. </span>
  481. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">{{$t('state.rejected')}} {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  482. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">{{$t('state.waitingsubmit')}}</span>
  483. </span>
  484. <span v-if="user.company.packageEngineering == 1">
  485. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">{{$t('other.importWaitingForReview')}}</span>
  486. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">{{$t('other.waitingForProfessionalReview')}}</span>
  487. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">{{$t('other.waitingForDepartmentReview')}}</span>
  488. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">{{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  489. (
  490. <span v-if="user.userNameNeedTranslate != 1">
  491. {{item2.projectAuditorName}}
  492. </span>
  493. <span v-if="user.userNameNeedTranslate == 1">
  494. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  495. </span>
  496. )
  497. </span>{{$t('other.audit')}}</span>
  498. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">{{$t('state.alreadyPassed')}}</span>
  499. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">{{$t('state.rejected')}} {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  500. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">{{$t('state.waitingsubmit')}}</span>
  501. </span>
  502. </p>
  503. <p v-if="user.timeType.customDegreeActive==1 && item2.degree_id != null && item2.degree_id != -1">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  504. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  505. <!-- 自定义日报文本 -->
  506. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  507. <p v-if="user.company.packageEngineering == 1">
  508. {{$t('other.professionalProgress')}}:
  509. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  510. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  511. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  512. </el-tooltip>
  513. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  514. <i class="iconfont firerock-iconshenhetongguo"></i>
  515. </el-tooltip>
  516. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  517. <i class="iconfont firerock-iconshenhebohui"></i>
  518. </el-tooltip>
  519. </span>
  520. </p>
  521. <div v-if="item2.multiWorktime==0">
  522. <p style="display: inline-block;">{{$t('time.duration')}}:
  523. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  524. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  525. {{item2.time.toFixed(1)}}h
  526. <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{$t('other.WorkOvertime')}}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag>
  527. </p>
  528. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  529. </div>
  530. <div v-if="item2.multiWorktime==1" >
  531. <p>{{$t('other.projectDuration')}}:{{item2.time.toFixed(1)}}h <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{ $t('other.WorkOvertime') }}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag></p>
  532. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  533. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  534. <p style="display: inline-block;">{{$t('time.duration')}}:
  535. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  536. {{timeItem.time.toFixed(1)}}h
  537. </p>
  538. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  539. </div>
  540. </div>
  541. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  542. <!--照片的显示 -->
  543. <p v-if="item2.pics != null && item2.pics.length > 0">
  544. <el-image v-for="(pic, index) in item2.pics" :key="index"
  545. style="width: 100px; height: 100px; margin-right:10px;"
  546. :src="pic"
  547. :preview-src-list="item2.pics">
  548. </el-image>
  549. </p>
  550. </el-card>
  551. </div>
  552. </div>
  553. </div>
  554. <div class="issue" v-if="dynamicTab">
  555. <!-- <el-input type="textarea" class="textareays" label-width="100%" label-height="140px"></el-input> -->
  556. <div class="issue_fixation">
  557. <div class="inputDeep"><el-input
  558. type="textarea"
  559. :placeholder="$t('pleaseentercontent')"
  560. :autosize="{ minRows: 6, maxRows: 6}"
  561. v-model="textarea2"
  562. class="inputDeeps"
  563. >
  564. </el-input></div>
  565. <el-button class="issue-button" type="primary" @click="release()">{{ $t('fa-bu') }}</el-button>
  566. </div>
  567. </div>
  568. </span>
  569. </div>
  570. </div>
  571. </template>
  572. <script>
  573. import selectCat from "@/components/select.vue"
  574. // 富文本样式
  575. import 'quill/dist/quill.core.css'
  576. import 'quill/dist/quill.snow.css'
  577. import 'quill/dist/quill.bubble.css'
  578. // 导入富文本
  579. import { quillEditor } from 'vue-quill-editor'
  580. export default {
  581. props: {
  582. integrationTask:{
  583. type: Object,
  584. default: {}
  585. },
  586. // 是否显示选择任务
  587. showOrNot: {
  588. type: Boolean,
  589. default: false
  590. }
  591. },
  592. components: {
  593. quillEditor, // 富文本
  594. selectCat
  595. },
  596. data() {
  597. return {
  598. numnnumnum: 2,
  599. componentFlg: false,
  600. mileageCup: false,
  601. loadingExport : false,
  602. saveTemplateLoading: false,
  603. joinMembList:[],
  604. setInchargerDialog: false,
  605. recentProgressInfo:{},
  606. addToTmpDialog:false,
  607. templateForm:{},
  608. importTaskDialog:false,
  609. importToStageId:null,
  610. exportDialog: false,
  611. exportTaskType:null,
  612. groupTemplateList:[],
  613. createGroupWay:'new',
  614. modGroupDialog:false,
  615. subTaskVisible:false,
  616. orderList:[{id:"seq",name:this.$t('manuallydragthesequence'),isDesc:false},{id:"create_date",name:this.$t('creationtimeisthelatest'),isDesc:true},
  617. {id:"end_date",name:this.$t('deadlineisthelatest'),isDesc:true},
  618. {id:"task_level",name:this.$t('highestpriority'),isDesc:true}],
  619. order:"seq",
  620. isDesc:false,
  621. taskDataList:[],
  622. displayTable: false,
  623. 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')},
  624. {id:5,name:this.$t('createdthetask')},{id:6,name:this.$t('missionIwason')},{id:7,name:this.$t('todaytask')},{id:8,name:this.$t('taskthatisoverdue')}],
  625. importanceList:[{id:0,name:this.$t('yi-ban')},{id:1,name:this.$t('zhong-yao')},{id:2,name:this.$t('jin-ji')},],
  626. 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"}],
  627. taskTypeColor:['#20A0FF','#8613ad','#bf0404'],
  628. taskTypeIcon:['iconfont firerock-iconrenwu','iconfont firerock-iconicon-','iconfont firerock-iconfengxian'],
  629. taskStatusList:[this.$t('ongoing'),this.$t('state.completed'),this.$t('state.undone')],
  630. //优先级
  631. taskLevelColor:['#262626','#E6A23C','#F56C6C'],
  632. stageListHeight:0,
  633. taskListinH:0,
  634. groupWidth:260,
  635. drag: false,
  636. stageDrag: false,
  637. dragging: false,
  638. stageList:[],
  639. selectedGroup:{},
  640. allGroupData:[],
  641. defaultGroupId:null,
  642. addGroupDialog: false,
  643. addStageDialog: false,
  644. groupSearch:null,
  645. groupType:0,//0-分组,1-视图
  646. groupList: [],
  647. groupForm:{},
  648. stageForm:[],
  649. curProjectId:null,
  650. projectList:null,
  651. activeIndex:"1",
  652. activeName:"projectInside",
  653. searchField:null,
  654. keyword:null,
  655. user: JSON.parse(sessionStorage.getItem("user")),
  656. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  657. userDetailVisible: false,
  658. userDetail:{},
  659. date: new Date(),
  660. users: [],
  661. tableHeight: 0,
  662. listLoading: false,
  663. subProjectVisible: false,
  664. subProjectList: [],//子项目列表
  665. currentProject:{},
  666. addSubProject: false,
  667. addFormVisible: false,
  668. addLoading: false,
  669. title: "",
  670. addForm: {
  671. name: '',
  672. executorListFront: []
  673. },
  674. rules: {
  675. name: [{ required: true, message: this.$t('pleaseenteragroupname'), trigger: "blur" }],
  676. },
  677. rules2: {
  678. stagesName: [{ required: true, message: this.$t('pleaseenteratasklistname'), trigger: "blur" }],
  679. },
  680. taskRules : {
  681. name: [{ required: true, message: this.$t('enterthetaskcontent'), trigger: "blur" }],
  682. projectId: [{ required: true, message: '请选择所属项目', trigger: "blur" }],
  683. groupId: [{ required: true, message: '请选择所属任务分组', trigger: "blur" }],
  684. stagesId: [{ required: true, message: '请选择所属任务列表', trigger: "blur" }],
  685. },
  686. formGrouping: {
  687. name: [{ required: true, message: this.$t('pleaseenteragroupname'), trigger: "blur" }],
  688. },
  689. sleectId: null,
  690. sleectProjectId: null,
  691. sidebarIndex: 0, // 侧边栏索引
  692. url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
  693. count: 0,
  694. textarea2: '',
  695. taskId: null,
  696. commentList: [],
  697. radio: 0,
  698. critic: [], // 评论头像的数组
  699. editorOption: { // 富文本框里面的默认值
  700. placeholder: this.$t('pleaseentethetext'),
  701. modules: {
  702. toolbar:[
  703. ['bold', 'italic', 'underline', 'strike'], //加粗,斜体,下划线,删除线
  704. // ['blockquote', 'code-block'], //引用,代码块
  705. [{ 'header': 1 }, { 'header': 2 }], // 标题,键值对的形式;1、2表示字体大小
  706. // [{ 'list': 'ordered'}, { 'list': 'bullet' }], //列表
  707. // [{ 'script': 'sub'}, { 'script': 'super' }], // 上下标
  708. // [{ 'indent': '-1'}, { 'indent': '+1' }], // 缩进
  709. // [{ 'direction': 'rtl' }], // 文本方向
  710. [{ 'size': ['small', false, 'large', 'huge'] }], // 字体大小
  711. [{ 'header': [1, 2, 3, 4, 5, 6, false] }], //几级标题
  712. [{ 'color': [] }, { 'background': [] }], // 字体颜色,字体背景颜色
  713. // [{ 'font': [] }], //字体
  714. [{ 'align': [] }], //对齐方式
  715. ['clean'], //清除字体样式
  716. // ['image','video'] //上传图片、上传视频
  717. ['image'] //上传图片、上传视频
  718. ], //工具栏设置
  719. },
  720. theme: 'snow',
  721. },
  722. textContent: true, // 控制提交
  723. times: null,
  724. text2: '',
  725. innerVisibless: false, // 任务展示弹出层
  726. activities: [{
  727. content: this.$t('normals'),
  728. timestamp: this.$t('hoursago'),
  729. size: 'large',
  730. type: 'primary',
  731. icon: 'el-icon-circle-check',
  732. color: '#409EFF'
  733. }, {
  734. content: this.$t('withinthetimelimit'),
  735. timestamp: this.$t('hoursago8'),
  736. color: '#F87872'
  737. }],
  738. ProgressList: [],
  739. checkboxGrounp: [], // 选中人的数据
  740. checkLists: [], // 选中人数据的ID
  741. taskIid: null,
  742. gstimday:[1],
  743. gstimhour:[8],
  744. timelabel: false,
  745. relationdata: [],
  746. isRelationTab: false,
  747. relationvalue:[],
  748. relationSubTaskList:[],
  749. relationItemData: null,
  750. relationPar:{name: ''},
  751. isRelationItem: false,
  752. // 关联文件
  753. fileListLoading:false,
  754. projectFileList:[],
  755. taskFileList:[],
  756. relationFileDialog: false,
  757. addFileId: null,
  758. isEditFile: false,
  759. // 设置项目参与人
  760. participantsDialog: false,
  761. participantsFilterText: '',
  762. deptMembData: [
  763. {
  764. id: 0,
  765. label: this.$t('lable.unassigned'),
  766. }
  767. ],
  768. defaultProps: {
  769. children: 'children',
  770. label: 'label'
  771. },
  772. chosenMembCount: 0,
  773. ididid:null,
  774. alreadyPartArray: [],
  775. projectCreatorId: null,
  776. projectInchargerId: null,
  777. canAddTask: false, // 是否可创建任务的判断标志
  778. canEditStageList: false, //是否可编辑列表的判断标志
  779. groupResponsibleId: '', // 分组负责人的id
  780. groupDetailsShow: false,
  781. groupDetailData: {},
  782. groupDetailTil: '',
  783. setTemplateData: {},
  784. setTemplateDialog: false,
  785. taskListPage: 1,
  786. taskListSize: 20,
  787. taskListTotal: 0,
  788. dynamicTab: true,
  789. dailyList: [],
  790. };
  791. },
  792. computed: {},
  793. watch: {},
  794. created() {},
  795. mounted() {
  796. console.log('我获取到的数据', this.integrationTask, this.showOrNot)
  797. this.triggerEvent(this.integrationTask)
  798. this.gstimhour = [this.user.timeType.allday]
  799. this.gstimday = [1]
  800. this.timess()
  801. },
  802. methods: {
  803. // 触发事件
  804. triggerEvent(obj) {
  805. console.log(obj, '触发事件')
  806. this.curProjectId = obj.curProjectId
  807. this.getProjectList()
  808. if(!obj.taskVue) {
  809. this.getStageList(obj.integrationTaskNingwai)
  810. }
  811. this.getUsers(); // 获取名单数据
  812. if(obj.create) {
  813. this.mileageCup = false
  814. this.addFormVisible = true;
  815. this.addForm = {projectId: obj.stage.projectId, groupId: obj.stage.groupId, stagesId: obj.stage.id, taskLevel:0, planHours: 8, taskType: 0};
  816. this.addForm.executorListFront = [{executorId:null, planHours:this.user.timeType.allday}];
  817. this.gstimhour = [this.user.timeType.allday]
  818. this.gstimday = [1]
  819. this.addLoading = false;
  820. this.isEditFile = false;
  821. this.title=this.$t('createtask ');
  822. this.commentList = [];
  823. this.timelabel = false
  824. } else {
  825. if(!obj.taskVue) {
  826. this.isEditFile = true;
  827. this.getDetail(obj.curProjectId)
  828. }
  829. this.getTaskDetail(obj.id);
  830. this.getTaskProgressList(obj.id); // 获取任务进展列表
  831. this.gain(obj.task); // 获取评论列表
  832. this.getDailyList(obj.id) // 获取来自日报
  833. this.getRelationTaskList(obj.num, obj.id)
  834. this.getTaskFileList(obj.num,obj.id)
  835. }
  836. },
  837. // 代办任务创建事件
  838. agentCreatesEvents(num) {
  839. if(num == 1) {
  840. this.addForm.groupId = ''
  841. this.addForm.stagesId = ''
  842. this.getTaskGrouping()
  843. } else if(num == 2) {
  844. this.addForm.stagesId = ''
  845. this.getTaskList()
  846. }
  847. },
  848. //获取项目列表
  849. getProjectList() {
  850. this.http.post(this.port.project.list, {},
  851. res => {
  852. if (res.code == "ok") {
  853. this.projectList = res.data;
  854. } else {
  855. this.$message({
  856. message: res.msg,
  857. type: "error"
  858. });
  859. }
  860. },
  861. error => {
  862. this.$message({
  863. message: error,
  864. type: "error"
  865. });
  866. });
  867. },
  868. // 获取任务分组
  869. getTaskGrouping() {
  870. this.http.post('/task-group/list', {projectId:this.addForm.projectId},
  871. res => {
  872. if (res.code == "ok") {
  873. this.groupList = res.data;
  874. } else {
  875. this.$message({
  876. message: res.msg,
  877. type: "error"
  878. });
  879. }
  880. },
  881. error => {
  882. this.$message({
  883. message: error,
  884. type: "error"
  885. });
  886. });
  887. },
  888. getTaskList() {
  889. let obj = {
  890. groupId: this.addForm.groupId,
  891. projectId: this.addForm.projectId,
  892. order: 'seq',
  893. isDesc: false
  894. }
  895. this.getStageList(obj)
  896. },
  897. // 关闭最外层弹窗
  898. closeBounceds() {
  899. console.log('我被触发了')
  900. this.$emit('closeBounced', {})
  901. },
  902. chggstim(e,i){
  903. if(e){
  904. this.gstimday[i] = Math.ceil(this.gstimhour[i] / this.user.timeType.allday)
  905. }else{
  906. this.gstimhour[i] = this.gstimday[i] * this.user.timeType.allday
  907. }
  908. },
  909. removeExecutorLine(index,e) {
  910. if(e == 1){
  911. this.relationItemData.executorList.splice(index,1);
  912. this.gstimday.splice(index,1)
  913. this.gstimhour.splice(index,1)
  914. this.$forceUpdate();
  915. }else{
  916. this.addForm.executorListFront.splice(index,1);
  917. this.gstimday.splice(index,1)
  918. this.gstimhour.splice(index,1)
  919. this.$forceUpdate();
  920. }
  921. },
  922. addExecutorLine(e) {
  923. if(e == 1){
  924. if (this.relationItemData.executorList == null) {
  925. this.relationItemData.executorList = [];//初始化
  926. }
  927. this.relationItemData.executorList.push({executorId:null, planHours:this.user.timeType.allday});
  928. this.gstimday.push(1)
  929. this.gstimhour.push(this.user.timeType.allday)
  930. this.$forceUpdate();
  931. }else{
  932. if (this.addForm.executorListFront == null) {
  933. this.addForm.executorListFront = [];//初始化
  934. }
  935. this.addForm.executorListFront.push({executorId:null, planHours:this.user.timeType.allday});
  936. this.gstimday.push(1)
  937. this.gstimhour.push(this.user.timeType.allday)
  938. this.$forceUpdate();
  939. }
  940. },
  941. getTaskDetail(id) {
  942. this.http.post('/task/getTask',{id: id},
  943. res => {
  944. if (res.code == "ok") {
  945. if(this.user.userNameNeedTranslate == 1) {
  946. for(var i in res.data.subTaskList) {
  947. if(res.data.subTaskList[i].executorName) {
  948. res.data.subTaskList[i].executorName = res.data.subTaskList[i].executorName.split(',')
  949. }
  950. }
  951. }
  952. this.addForm = res.data;
  953. this.addForm.createDate = null;
  954. this.addForm.indate = null;
  955. this.addLoading = false;
  956. this.canAddTask = res.data.canAddTask
  957. this.recentProgressInfo = res.data.progress;
  958. this.addForm.executorListFront = res.data.executorList;
  959. this.gstimday = []
  960. this.gstimhour = []
  961. for(let i=0;i<this.addForm.executorListFront.length;i++){
  962. this.gstimhour.push(this.addForm.executorListFront[i].planHours)
  963. this.gstimday.push(Math.ceil(this.addForm.executorListFront[i].planHours / this.user.timeType.allday))
  964. }
  965. console.log(this.gstimday, this.gstimhour)
  966. // //删除中间传值的变量数组
  967. delete this.addForm.executorList;
  968. } else {
  969. this.$message({
  970. message: res.msg,
  971. type: "error"
  972. });
  973. }
  974. },
  975. error => {
  976. this.$message({
  977. message: error,
  978. type: "error"
  979. });
  980. });
  981. },
  982. //获取任务进展列表
  983. getTaskProgressList(taskId) {
  984. this.taskIid = taskId
  985. this.http.post('/task-progress/list', {taskId: taskId},
  986. res => {
  987. if (res.code == "ok") {
  988. this.ProgressList = res.data;
  989. this.recentProgressInfo = res.data[0]
  990. } else {
  991. this.$message({
  992. message: res.msg,
  993. type: "error"
  994. });
  995. }
  996. }
  997. );
  998. },
  999. getUsers() {
  1000. this.http.post('/user/getSimpleActiveUserList', {},
  1001. res => {
  1002. if (res.code == "ok") {
  1003. this.users = res.data;
  1004. } else {
  1005. this.$message({
  1006. message: res.msg,
  1007. type: "error"
  1008. });
  1009. }
  1010. },
  1011. error => {
  1012. this.$message({
  1013. message: error,
  1014. type: "error"
  1015. });
  1016. });
  1017. },
  1018. // 获取评论列表
  1019. gain (task,e) {
  1020. this.commentList = [];
  1021. this.taskId = e == 1 ? task.taskId : task.id;
  1022. this.http.post('/task-comment/getList', {taskId: e == 1 ? task.taskId : task.id},
  1023. res => {
  1024. if (res.code == "ok") {
  1025. for(var i in res.data) {
  1026. if(res.data[i].content.indexOf('$userName=') != '-1') {
  1027. let obj = {
  1028. msg1: res.data[i].content.split('$')[0],
  1029. msg2: res.data[i].content.split('$')[1].split('=')[1],
  1030. msg3: res.data[i].content.split('$')[2]
  1031. }
  1032. res.data[i].content = obj
  1033. } else {
  1034. if(this.user.userNameNeedTranslate == 1) {
  1035. let obj = {
  1036. msg1: res.data[i].content,
  1037. msg2: '',
  1038. msg3: ''
  1039. }
  1040. res.data[i].content = obj
  1041. }
  1042. }
  1043. }
  1044. this.commentList = res.data
  1045. this.sppk(this.commentList) // 获取参与人的方法
  1046. } else {
  1047. this.$message({
  1048. message: res.msg,
  1049. type: "error"
  1050. });
  1051. }
  1052. },
  1053. error => {
  1054. this.$message({
  1055. message: error,
  1056. type: "error"
  1057. });
  1058. });
  1059. },
  1060. // 获取评论参与人
  1061. sppk(comit) {
  1062. var sk = []
  1063. comit.forEach(function(e){
  1064. sk.push(e.userName)
  1065. })
  1066. this.critic = new Set(sk)
  1067. console.log(this.critic, '参与人',this.critic.length)
  1068. },
  1069. getRelationTaskList(i,e){ //获取关联任务列表
  1070. let eid = null
  1071. if(i){
  1072. eid = e
  1073. }else{
  1074. eid = this.addForm.id
  1075. }
  1076. this.http.post('/task/getMilestoneTaskList',{
  1077. milestoneId: eid
  1078. },res => {
  1079. if(res.code == 'ok') {
  1080. this.relationSubTaskList = res.data
  1081. // console.log('res',res.data);
  1082. }else {
  1083. this.$message({
  1084. message: res.msg,
  1085. type: 'error'
  1086. })
  1087. }
  1088. },error => {
  1089. this.$message({
  1090. message: error,
  1091. type: 'error'
  1092. })
  1093. })
  1094. },
  1095. // 获取来自日报
  1096. getDailyList(id) {
  1097. this.http.post('/report/getTaskReportList',{
  1098. // taskId: '22131'
  1099. taskId: id
  1100. },
  1101. res => {
  1102. if (res.code == "ok") {
  1103. this.dailyList = res.data
  1104. } else {
  1105. this.$message({
  1106. message: res.msg,
  1107. type: "error"
  1108. });
  1109. }
  1110. },
  1111. error => {
  1112. this.$message({
  1113. message: error,
  1114. type: "error"
  1115. });
  1116. });
  1117. },
  1118. // 获取任务下的文档列表
  1119. getTaskFileList(e,eid){
  1120. let etaskId
  1121. if(e == 1){etaskId = eid}
  1122. else{etaskId = this.addForm.id}
  1123. this.fileListLoading = true
  1124. this.http.post('/task-files/getTaskFiles',{
  1125. taskId: etaskId
  1126. },res => {
  1127. if(res.code == 'ok'){
  1128. this.fileListLoading = false
  1129. this.taskFileList = res.data
  1130. console.log('taskFileList',res.data);
  1131. }else {
  1132. this.fileListLoading = false
  1133. this.$message({
  1134. message: res.msg,
  1135. type: 'error'
  1136. })
  1137. }
  1138. },error => {
  1139. this.fileListLoading = false
  1140. this.$message({
  1141. message: error,
  1142. type: 'error'
  1143. })
  1144. })
  1145. },
  1146. DateChange(){
  1147. if(this.addForm.startDate != undefined && this.addForm.endDate != undefined){
  1148. let stdate = Date.parse(this.addForm.startDate)
  1149. let eddate = Date.parse(this.addForm.endDate)
  1150. if(stdate <= eddate){
  1151. let days = (eddate - stdate) / (1*24*60*60*1000) + 1
  1152. for (let i=0;i<this.gstimday.length;i++) {
  1153. this.gstimday[i] = days
  1154. this.gstimhour[i] = days * this.user.timeType.allday
  1155. }
  1156. this.$forceUpdate()
  1157. }
  1158. }
  1159. },
  1160. // 自定义组件事件
  1161. selectCal(obj) {
  1162. if(obj.distinction == '1') {
  1163. this.addForm.executorListFront[obj.index].executorId = obj.id
  1164. } else if(obj.distinction == '2') {
  1165. this.groupForm.inchargerId = obj.id
  1166. }
  1167. },
  1168. getDetail(id) {
  1169. this.http.post('/project/detail',{
  1170. id: id
  1171. },
  1172. res => {
  1173. if (res.code == "ok") {
  1174. console.log('触发更新试一下')
  1175. this.currentProject = res.data;
  1176. this.getjurisdictionIds(this.currentProject)
  1177. this.joinMembList = this.currentProject.participationList;
  1178. } else {
  1179. }
  1180. },
  1181. error => {
  1182. this.$message({
  1183. message: error,
  1184. type: "error"
  1185. });
  1186. }
  1187. );
  1188. },
  1189. getjurisdictionIds(pro){
  1190. console.log('pro',pro.creatorId);
  1191. this.projectCreatorId = pro.creatorId
  1192. this.projectInchargerId = pro.inchargerId
  1193. },
  1194. //加载项目内的任务列表
  1195. getStageList(obj) {
  1196. this.http.post('/stages/list', {
  1197. groupId: obj.groupId,
  1198. projectId: obj.projectId,
  1199. order: obj.order,
  1200. isDesc: obj.isDesc
  1201. },
  1202. res => {
  1203. if (res.code == "ok") {
  1204. this.stageList = res.data.list;
  1205. this.canAddTask = res.data.canAddTask
  1206. this.canEditStageList = res.data.canEditStageList
  1207. this.timess() // 处理时间的方法
  1208. } else {
  1209. this.$message({
  1210. message: res.msg,
  1211. type: "error"
  1212. });
  1213. }
  1214. },
  1215. error => {
  1216. this.$message({
  1217. message: error,
  1218. type: "error"
  1219. });
  1220. });
  1221. },
  1222. timess(){
  1223. // console.log('timess');
  1224. var date = new Date()
  1225. let Y = date.getFullYear()
  1226. let M = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : (date.getMonth() + 1)
  1227. let D = date.getDate() < 10 ? ('0' + date.getDate()) : date.getDate()
  1228. this.times = `${Y}-${M}-${D}`
  1229. console.log(this.times, '时间')
  1230. },
  1231. // 提交按钮
  1232. submitInsert() {
  1233. if (this.textContent !== true) return this.$message({
  1234. showClose: true,
  1235. message: this.$t('pictureistoolargepleaseuploaditagain'),
  1236. type: 'warning'
  1237. });
  1238. //检查是有重名的执行人
  1239. var exeList = this.addForm.executorListFront;
  1240. // for(let i=0;i<this.gstimhour.length;i++){
  1241. // exeList[i].planHours = this.gstimhour[i]
  1242. // }
  1243. for (var i=0;i<exeList.length;i++) {
  1244. var findSameUser = false;
  1245. exeList[i].planHours = this.gstimhour[i]
  1246. for (var j=i+1;j<exeList.length; j++) {
  1247. if (exeList[i].executorId && exeList[j].executorId && exeList[i].executorId == exeList[j].executorId) {
  1248. findSameUser = true;
  1249. break;
  1250. }
  1251. }
  1252. if (findSameUser) {
  1253. return this.$message({
  1254. showClose: true,
  1255. message: this.$t('executorhasduplication'),
  1256. type: 'error'
  1257. });
  1258. }
  1259. }
  1260. if(this.addForm.startDate && this.addForm.endDate) {
  1261. if(this.addForm.endDate < this.addForm.startDate) {
  1262. return this.$message({
  1263. showClose: true,
  1264. message: this.$t('ren-wu-jie-zhi-shi-jian-bu-neng-xiao-yu-kai-shi-shi-jian'),
  1265. type: 'error'
  1266. });
  1267. }
  1268. }
  1269. this.$refs.form1.validate(valid => {
  1270. if (valid) {
  1271. delete this.addForm.subTaskList;
  1272. delete this.addForm.refTaskList;
  1273. delete this.addForm.progress;
  1274. //去掉没有执行人的.(因为要有计划工时,执行人可以暂不设置)
  1275. // this.addForm.executorListFront = this.addForm.executorListFront.filter(exe=>exe.executorId);
  1276. this.addForm.executorListStr = JSON.stringify(this.addForm.executorListFront);
  1277. this.addLoading = true;
  1278. this.http.post('/task/save',this.addForm,
  1279. res => {
  1280. this.addLoading = false;
  1281. if (res.code == "ok") {
  1282. this.$message({
  1283. message: this.$t('message.submittedSuccessfully'),
  1284. type: "success"
  1285. });
  1286. if (this.addForm.parentTid == null) {
  1287. console.log('我是对的')
  1288. let obj = {
  1289. submitInsert: true,
  1290. showOrNot: this.showOrNot
  1291. }
  1292. this.$emit('closeBounced', obj)
  1293. } else {
  1294. console.log('我也是对的')
  1295. // this.backToParentTask();
  1296. this.$emit('closeBounced', {backToParentTaskSub: true})
  1297. }
  1298. } else {
  1299. this.$message({
  1300. message: res.msg,
  1301. type: "error"
  1302. });
  1303. }
  1304. },
  1305. error => {
  1306. this.$message({
  1307. message: error,
  1308. type: "error"
  1309. });
  1310. }
  1311. );
  1312. }
  1313. });
  1314. },
  1315. backToParentTask() {
  1316. this.getTaskDetail(this.timelabel ? this.relationPar.id : this.addForm.parentTid);
  1317. this.isEditFile = true;
  1318. if(this.timelabel){
  1319. this.isRelationItem = false
  1320. this.getRelationTaskList(1, this.relationPar.id)
  1321. this.gain(this.relationPar)
  1322. }
  1323. },
  1324. onEditorFocus() {
  1325. this.onEditorBlur()
  1326. },
  1327. // 获得焦点时触发
  1328. onEditorBlur(){
  1329. let theEle = this.$refs.text; // 获取元素
  1330. var img = theEle.value.match(/<img[^>]+>/g); // 赛选 img 标签
  1331. var arrImg = ''
  1332. for (var j = 0; j < img.length; j++) {
  1333. // 正则匹配,摘出img标签下的src里的内容,即capture
  1334. img[j].replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, function(match, capture) {
  1335. arrImg += capture
  1336. });
  1337. }
  1338. // 原来的字符流大小,单位为字节
  1339. var strLen = arrImg.length;
  1340. // 计算后得到的文件流大小,单位为字节
  1341. var fileSize=parseInt(strLen-(strLen/8)*2);
  1342. var size = "";
  1343. size = (fileSize/1024/1024).toFixed(2);
  1344. if (size > 2){
  1345. this.textContent = false
  1346. this.$message({
  1347. showClose: true,
  1348. message: this.$t('imageexceeds2MBpleaseuploaditagain'),
  1349. type: 'warning'
  1350. });
  1351. }
  1352. this.textContent = true
  1353. },
  1354. //删除当前编辑的任务
  1355. deleteTask() {
  1356. var warning='';
  1357. if (this.addForm.subTaskList.length > 0) {
  1358. warning=this.$t('currenttaskanditssubtasks');
  1359. } else {
  1360. warning=this.$t('wanttodeletethecurrent task');
  1361. }
  1362. this.$confirm(warning, this.$t('other.prompts'), {
  1363. //type: 'warning'
  1364. }).then(() => {
  1365. this.http.post('/task/delete',{id: this.addForm.id},
  1366. res => {
  1367. if (res.code == "ok") {
  1368. this.$emit('closeBounced', {deleteTask: true})
  1369. } else {
  1370. this.$message({
  1371. message: res.msg,
  1372. type: "error"
  1373. });
  1374. }
  1375. },
  1376. error => {
  1377. this.$message({
  1378. message: error,
  1379. type: "error"
  1380. });
  1381. });
  1382. });
  1383. },
  1384. addprogress(){ // 添加子任务进展事件
  1385. this.$refs.proBox.style.display="block"
  1386. this.$refs.addPro.style.display="none"
  1387. },
  1388. shutPro() { // 关闭任务进展
  1389. this.$refs.addPro.style.display="block"
  1390. this.$refs.addRem.style.display="none"
  1391. this.$refs.proBox.style.display="none"
  1392. },
  1393. //创建任务进展
  1394. addTaskProgress() {
  1395. var param = {
  1396. taskId: this.taskIid,
  1397. status: this.radio,
  1398. content: this.text2,
  1399. participatorIds: this.checkLists.toString()
  1400. };
  1401. this.http.post('/task-progress/addProgress', param,
  1402. res => {
  1403. if (res.code == "ok") {
  1404. this.shutPro()
  1405. this.getTaskProgressList(this.taskIid)
  1406. this.$message({
  1407. message: this.$t('releasesuccess'),
  1408. type: "success"
  1409. });
  1410. this.checkboxGrounp = [],
  1411. this.checkLists = [],
  1412. this.text2 = '',
  1413. this.radio = 0
  1414. let obj = {
  1415. id: this.taskIid
  1416. }
  1417. this.gain(obj)
  1418. } else {
  1419. this.$message({
  1420. message: res.msg,
  1421. type: "error"
  1422. });
  1423. }
  1424. }
  1425. );
  1426. },
  1427. addI() { // 打开选择查看
  1428. this.$refs.addRem.style.display="block"
  1429. },
  1430. selchg(){ //类型切换
  1431. if(this.addForm.taskType == 1){
  1432. this.timelabel = true
  1433. if(!this.addForm.executorListFront[0].executorId) {
  1434. console.log(this.currentProject)
  1435. this.addForm.executorListFront[0].executorId = this.currentProject.inchargerId
  1436. }
  1437. }else{
  1438. this.timelabel = false
  1439. }
  1440. },
  1441. DateChange(){
  1442. if(this.addForm.startDate != undefined && this.addForm.endDate != undefined){
  1443. let stdate = Date.parse(this.addForm.startDate)
  1444. let eddate = Date.parse(this.addForm.endDate)
  1445. if(stdate <= eddate){
  1446. let days = (eddate - stdate) / (1*24*60*60*1000) + 1
  1447. for (let i=0;i<this.gstimday.length;i++) {
  1448. this.gstimday[i] = days
  1449. this.gstimhour[i] = days * this.user.timeType.allday
  1450. }
  1451. this.$forceUpdate()
  1452. }
  1453. // console.log("gstimday",this.gstimday);
  1454. }
  1455. },
  1456. kkk(el){
  1457. var k = this.checkLists.indexOf(el.id)
  1458. if (k == -1) {
  1459. this.checkLists.push(el.id)
  1460. } else {
  1461. this.checkLists.splice(k, 1)
  1462. }
  1463. },
  1464. //删除任务进展
  1465. deleteTaskProgress(id) {
  1466. this.http.post('/task-progress/deleteProgress', {id: id},
  1467. res => {
  1468. if (res.code == "ok") {
  1469. this.getTaskProgressList(this.taskIid)
  1470. this.$message({
  1471. message: this.$t('message.successfullyDeleted'),
  1472. type: "success"
  1473. });
  1474. } else {
  1475. this.$message({
  1476. message: res.msg,
  1477. type: "error"
  1478. });
  1479. }
  1480. }
  1481. );
  1482. },
  1483. addRelation(){ //关联任务卡片
  1484. this.relationvalue = []
  1485. this.isRelationTab = true
  1486. this.getrelation()
  1487. },
  1488. getrelation(){ //获取选择关联列表
  1489. this.http.post('/task/getTaskOnlyList',{
  1490. projectId: this.curProjectId
  1491. },
  1492. res => {
  1493. if (res.code == "ok") {
  1494. this.relationdata = []
  1495. res.data.forEach( (item) =>{
  1496. if(item.taskType != 1){
  1497. this.relationdata.push(item)
  1498. }
  1499. })
  1500. // console.log('map',this.relationdata);
  1501. } else {
  1502. this.$message({
  1503. message: res.msg,
  1504. type: "error"
  1505. });
  1506. }
  1507. },
  1508. error => {
  1509. this.$message({
  1510. message: error,
  1511. type: "error"
  1512. });
  1513. });
  1514. },
  1515. //显示子任务创建卡片
  1516. addSubTask() {
  1517. if(this.isRelationItem){return}
  1518. this.addFormVisible = true;
  1519. this.addForm = {parentTname: this.addForm.name,parentTid: this.addForm.id,projectId: this.addForm.projectId, groupId: this.addForm.groupId, taskLevel:0, planHours: 8, taskType: 0};
  1520. this.addForm.executorListFront = [{executorId:null, planHours:8}];
  1521. this.addLoading = false;
  1522. //创建子任务,非编辑状态
  1523. this.isEditFile = false;
  1524. // 触发外界子任务事件
  1525. this.$emit('closeBounced', {addSubTask: true, addForms: this.addForm})
  1526. },
  1527. // 关联任务点击事件
  1528. relationTaskClick(row,column,event){
  1529. // console.log('relationTaskClick',row);
  1530. this.relationPar = JSON.parse(JSON.stringify(this.addForm))
  1531. // console.log(this.relationPar);
  1532. this.addFormVisible = true;
  1533. this.addLoading = false;
  1534. this.isRelationItem = true;
  1535. this.isEditFile = true;
  1536. this.title = this.$t('editingtasks');
  1537. this.getTaskDetail(row.taskId);
  1538. this.getUsers();
  1539. this.gain(row,1);
  1540. this.getRelationTaskList(1, row.taskId)
  1541. this.getTaskFileList(1,row.taskId)
  1542. },
  1543. // 解除关联
  1544. deleteRelationItem(eid){
  1545. this.listLoading = true
  1546. this.http.post('/task/removeMileStoneTask',{
  1547. id: eid
  1548. },res => {
  1549. if(res.code == 'ok') {
  1550. this.getRelationTaskList()
  1551. this.listLoading = false
  1552. this.$message({
  1553. message: this.$t('jie-chu-cheng-gong'),
  1554. type: 'success'
  1555. })
  1556. }else {
  1557. this.listLoading = false
  1558. this.$message({
  1559. message: res.msg,
  1560. type: 'error'
  1561. })
  1562. }
  1563. },error => {
  1564. this.listLoading = false
  1565. this.$message({
  1566. message: error,
  1567. type: 'error'
  1568. })
  1569. })
  1570. },
  1571. // 关联任务列表是否完成修改
  1572. relationFinishTask(row){
  1573. this.http.post('/task/finish',{
  1574. id: row.taskId,
  1575. taskStatus: row.taskStatus
  1576. },res => {
  1577. if(res.code == 'ok'){
  1578. // if(this.groupType == 0){
  1579. // this.getStageList();
  1580. // }else {
  1581. // this.getViewTaskList();
  1582. let obj = {
  1583. submitInsert: true
  1584. }
  1585. this.$emit('closeBounced', obj)
  1586. // }
  1587. }else{
  1588. this.$message({
  1589. message: res.msg,
  1590. type: 'error'
  1591. })
  1592. }
  1593. },error => {
  1594. this.$message({
  1595. message: error,
  1596. type: 'error'
  1597. })
  1598. })
  1599. },
  1600. finishTask(task) {
  1601. this.http.post('/task/finish',{id: task.id, taskStatus: task.taskStatus},
  1602. res => {
  1603. if (res.code == "ok") {
  1604. // if (this.groupType == 0) {
  1605. // this.getStageList();
  1606. // } else {
  1607. // this.getViewTaskList();
  1608. // }
  1609. let obj = {
  1610. submitInsert: true
  1611. }
  1612. this.$emit('closeBounced', obj)
  1613. } else {
  1614. this.$message({
  1615. message: res.msg,
  1616. type: "error"
  1617. });
  1618. }
  1619. },
  1620. error => {
  1621. this.$message({
  1622. message: error,
  1623. type: "error"
  1624. });
  1625. });
  1626. },
  1627. // 关联文件按钮
  1628. relationFileClick(){
  1629. this.relationFileDialog = true
  1630. this.addFileId = null
  1631. this.getProjectFileList()
  1632. },
  1633. // 获取项目下的文档列表
  1634. getProjectFileList(){
  1635. this.http.post('/task-files/getDocumentList',{
  1636. projectId: this.curProjectId
  1637. },res => {
  1638. if(res.code == 'ok'){
  1639. this.projectFileList = res.data
  1640. console.log('list',res.data);
  1641. }else {
  1642. this.$message({
  1643. message: res.msg,
  1644. type: 'error'
  1645. })
  1646. }
  1647. },error => {
  1648. this.$message({
  1649. message: error,
  1650. type: 'error'
  1651. })
  1652. })
  1653. },
  1654. // 列表的删除按钮
  1655. taskFileDelete(eid){
  1656. this.$confirm('是否移除此文件?', this.$t('other.prompts'), {
  1657. confirmButtonText: this.$t('btn.determine'),
  1658. cancelButtonText: this.$t('btn.cancel'),
  1659. type: 'warning'
  1660. }).then(()=>{
  1661. this.http.post('/task-files/delete',{
  1662. id: eid
  1663. },res => {
  1664. if(res.code == 'ok'){
  1665. this.$message({
  1666. message: res.data,
  1667. type: 'success'
  1668. })
  1669. this.getTaskFileList()
  1670. }else {
  1671. this.$message({
  1672. message: res.msg,
  1673. type: 'error'
  1674. })
  1675. }
  1676. },error => {
  1677. this.$message({
  1678. message: error,
  1679. type: 'error'
  1680. })
  1681. })
  1682. }).catch(()=>{
  1683. this.$message({
  1684. message: this.$t('thedeletionhasbeencancelled'),
  1685. type: 'info'
  1686. })
  1687. })
  1688. },
  1689. // 确认关联文件
  1690. addTaskFile(){
  1691. if(this.addFileId == null){
  1692. this.$message({message: this.$t('xuanzguanlianwenjian') , type: 'warning'})
  1693. return
  1694. }
  1695. this.http.post('/task-files/addDocumentRef',{
  1696. documentId: this.addFileId,
  1697. taskId: this.addForm.id,
  1698. projectId: this.curProjectId
  1699. },res => {
  1700. if(res.code == 'ok'){
  1701. this.$message({
  1702. message: this.$t('guan-lian-cheng-gong'),
  1703. type: 'success'
  1704. })
  1705. this.relationFileDialog = false
  1706. this.getTaskFileList()
  1707. }else {
  1708. this.$message({
  1709. message: res.msg,
  1710. type: 'error'
  1711. })
  1712. }
  1713. },error => {
  1714. this.$message({
  1715. message: error,
  1716. type: 'error'
  1717. })
  1718. })
  1719. },
  1720. addRelationTask(){ //添加关联任务
  1721. this.http.post('/task/addMileStoneTask',{
  1722. milestoneId: this.addForm.id,
  1723. taskIds: JSON.stringify(this.relationvalue)
  1724. },
  1725. res =>{
  1726. if(res.code == "ok") {
  1727. this.isRelationTab = false
  1728. this.$message({
  1729. message: this.$t('addsuccessful'),
  1730. type: 'success'
  1731. })
  1732. this.getRelationTaskList()
  1733. this.$forceUpdate()
  1734. }else {
  1735. this.$message({
  1736. message: res.msg,
  1737. type: 'error'
  1738. })
  1739. }
  1740. },
  1741. error => {
  1742. this.$message({
  1743. message: error,
  1744. type: 'error'
  1745. })
  1746. })
  1747. },
  1748. backToParentTask() {
  1749. // this.getTaskDetail(this.addForm.parentTid);
  1750. this.getTaskDetail(this.timelabel ? this.relationPar.id : this.addForm.parentTid);
  1751. this.isEditFile = true;
  1752. if(this.timelabel){
  1753. this.isRelationItem = false
  1754. // this.relationPar = {name: ''}
  1755. this.getRelationTaskList(1, this.relationPar.id)
  1756. this.gain(this.relationPar)
  1757. }
  1758. },
  1759. // 点击评论发布
  1760. release() {
  1761. if(this.textarea2.length <= 0) return this.$message({message: this.$t('pleaseentercontent'), type: "error"})
  1762. this.http.post('/task-comment/add', {taskId: this.taskId, userId: this.user.id, content: this.textarea2},
  1763. res => {
  1764. if(res.code == "ok"){
  1765. if(res.data.content.indexOf('$userName=') != '-1') {
  1766. let obj = {
  1767. msg1: res.data.content.split('$')[0],
  1768. msg2: res.data.content.split('$')[1].split('=')[1],
  1769. msg3: res.data.content.split('$')[2]
  1770. }
  1771. res.data.content = obj
  1772. } else {
  1773. if(this.user.userNameNeedTranslate == 1) {
  1774. let obj = {
  1775. msg1: res.data.content,
  1776. msg2: '',
  1777. msg3: ''
  1778. }
  1779. res.data.content = obj
  1780. }
  1781. }
  1782. this.commentList.push(res.data)
  1783. this.sppk(this.commentList)
  1784. this.textarea2 = ""
  1785. this.contRoll() // 滚动到底部
  1786. } else {
  1787. this.$message({
  1788. message: res.msg,
  1789. type: "error"
  1790. });
  1791. }
  1792. },
  1793. error => {
  1794. this.$message({
  1795. message: error,
  1796. type: "error"
  1797. });
  1798. })
  1799. },
  1800. // 滚动到底部
  1801. contRoll(){
  1802. this.$nextTick(() => {
  1803. this.$refs.main.scrollTop = this.$refs.contRoll.scrollHeight;
  1804. })
  1805. },
  1806. sss(){
  1807. this.$refs.addRem.style.display="none"
  1808. },
  1809. taskLineClick(row, column, event) {
  1810. if(this.isRelationItem){return}
  1811. this.mileageCup = true
  1812. if(row.taskType == 1){
  1813. this.timelabel = true
  1814. this.isRelationItem = false
  1815. }else{
  1816. this.timelabel = false
  1817. }
  1818. this.addFormVisible = true;
  1819. this.isEditFile = true;
  1820. this.addLoading = false;
  1821. this.getTaskDetail(row.id);
  1822. this.getTaskProgressList(row.id); // 获取任务进展列表
  1823. this.getUsers(); // 获取名单数据
  1824. this.gain(row); // 获取评论列表
  1825. this.getDailyList(row.id) // 获取来自日报
  1826. this.getRelationTaskList(1, row.id)
  1827. this.getTaskFileList(1,row.id)
  1828. this.$emit('closeBounced', {taskLineClickAbs: true, items: row})
  1829. },
  1830. // 列表的上传按钮
  1831. uploadFileClick(item){
  1832. console.log("upload",item.file);
  1833. let files = new FormData()
  1834. files.append("projectId",this.curProjectId);
  1835. files.append("taskId", this.addForm.id);
  1836. files.append("file", item.file);
  1837. this.http.uploadFile('/task-files/uploadFile',files,
  1838. res => {
  1839. if(res.code == 'ok'){
  1840. console.log(res);
  1841. this.$message({
  1842. message: this.$t('yi-shang-chuan'),
  1843. type: 'success'
  1844. })
  1845. this.getTaskFileList()
  1846. }else {
  1847. this.$message({
  1848. message: res.msg,
  1849. type: 'error'
  1850. })
  1851. }
  1852. },error => {
  1853. this.$message({
  1854. message: error,
  1855. type: 'error'
  1856. })
  1857. })
  1858. },
  1859. },
  1860. };
  1861. </script>
  1862. <style lang="scss" scoped>
  1863. .foooot {
  1864. padding: 10px 20px 20px;
  1865. text-align: right;
  1866. -webkit-box-sizing: border-box;
  1867. box-sizing: border-box;
  1868. }
  1869. .Daily p {
  1870. margin: 0 !important;
  1871. padding: 0 0 10px 0 !important;
  1872. }
  1873. .sub-all {
  1874. div {
  1875. display: inline-block;
  1876. padding: 0 20px;
  1877. font-size: 20px;
  1878. cursor: pointer;
  1879. }
  1880. .subOn {
  1881. color: #66b1ff;
  1882. }
  1883. }
  1884. .DailyBody {
  1885. margin: 0 20px;
  1886. }
  1887. .Daily{
  1888. height: 120%;
  1889. overflow: auto;
  1890. }
  1891. .inputDeep {
  1892. position: absolute;
  1893. bottom: 85px;
  1894. width: 95%;
  1895. margin: 0 12px;
  1896. }
  1897. .inputDeep .el-textarea .el-textarea__inner{
  1898. border: 0 !important;
  1899. resize: none !important;
  1900. }
  1901. .inputDeeps .el-textarea__inner {
  1902. border: 0 !important;
  1903. resize: none !important;
  1904. }
  1905. .scop_span {
  1906. display: inline-block;
  1907. padding: 2px 5px;
  1908. }
  1909. .counli {
  1910. em {
  1911. font-style: normal;
  1912. display: inline-block;
  1913. margin-left: 9%;
  1914. }
  1915. span {
  1916. float: right;
  1917. }
  1918. }
  1919. .carts {
  1920. position: relative;
  1921. .el-image{
  1922. border-radius: 50%;
  1923. float: left;
  1924. width: 20%;
  1925. }
  1926. i {
  1927. width: 30px;
  1928. height: 30px;
  1929. // background: #778899;
  1930. display: inline-block;
  1931. float: left;
  1932. border-radius:50%;
  1933. font-style:normal;
  1934. font-size: 12px;
  1935. line-height: 30px;
  1936. text-align: center;
  1937. color: #fff;
  1938. background: #778899;
  1939. overflow: hidden;
  1940. direction: rtl;
  1941. }
  1942. div {
  1943. text-align: left;
  1944. p {
  1945. text-align: left;
  1946. margin-left: 10px;
  1947. margin-left: 13%;
  1948. }
  1949. em {
  1950. display: block;
  1951. font-style: normal;
  1952. margin-left: 13%;
  1953. }
  1954. }
  1955. span {
  1956. font-size: 10px;
  1957. float: right;
  1958. margin-top: -40px;
  1959. }
  1960. }
  1961. .issue {
  1962. // height: 20%;
  1963. // position: relative;
  1964. // z-index: 4;
  1965. .zh{
  1966. position: relative;
  1967. width: 100%;
  1968. height: 100%;
  1969. }
  1970. .textareays {
  1971. background: #000;
  1972. height: 140px;
  1973. border: 0;
  1974. .el-textarea__inner {
  1975. height: 85%;
  1976. }
  1977. }
  1978. .issue-button {
  1979. position: absolute;
  1980. bottom: 20px;
  1981. right: 20px;
  1982. }
  1983. }
  1984. .inputDeep {
  1985. position: absolute;
  1986. bottom: 85px;
  1987. width: 95%;
  1988. margin: 0 12px;
  1989. }
  1990. .inputDeep .el-textarea .el-textarea__inner{
  1991. border: 0 !important;
  1992. resize: none !important;
  1993. }
  1994. .inputDeeps .el-textarea__inner {
  1995. border: 0 !important;
  1996. resize: none !important;
  1997. }
  1998. .scop_span {
  1999. display: inline-block;
  2000. padding: 2px 5px;
  2001. }
  2002. </style>