taskComponent.vue 95 KB

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