taskComponent.vue 103 KB

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