taskComponent.vue 108 KB

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