taskComponent.vue 94 KB

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