taskComponent.vue 138 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194
  1. <template>
  2. <div>
  3. <div style="height: 72vh;overflow: auto;">
  4. <el-form ref="form1" :model="addForm" :rules="taskRules" label-width="120px">
  5. <el-form-item label="状态" v-if="addForm.id > 0">
  6. <span :style="'color:'+taskStatusColorList[addForm.taskStatus]">{{ taskStatusList[addForm.taskStatus] }}</span>
  7. </el-form-item>
  8. <el-form-item :label="'类型'" prop="taskPlanType">
  9. <el-select v-model="addForm.taskPlanType" :placeholder="$t('defaultText.pleaseChoose')" style="width:100%;" :disabled="doYouWantToDisableAll" @change="onTypeChange($event)">
  10. <el-option v-for="item in typeList" :label="item.name" :value="item.id" :key="item.id">
  11. <div style="display: flex;justify-content: space-between;align-items: center;">
  12. <!--左边是文字,右边是色块(有color的话)-->
  13. <div style="float: left; ">{{ item.name }}</div>
  14. <div v-if="item.color" :style="'width:80px;height:20px;background-color:'+item.color"></div>
  15. </div>
  16. </el-option>
  17. </el-select>
  18. </el-form-item>
  19. <template v-if="selectType.needAudit">
  20. <el-form-item :label="$t('subordinatetotheproject')" v-if="showOrNot" prop="projectId">
  21. <el-select v-model="addForm.projectId" :placeholder="$t('defaultText.pleaseChoose')" @change="agentCreatesEvents(1)" filterable="true" style="width:100%;"
  22. :disabled="doYouWantToDisableAll" no-data-text="您尚无担任LA的相关项目">
  23. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  24. <el-option v-for="item in group.peojectList" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id">
  25. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  26. <span style="float: right;">{{ item.projectName }}</span>
  27. </el-option>
  28. </el-option-group>
  29. </el-select>
  30. </el-form-item>
  31. <el-form-item label="研究中心" v-if="showOrNot" prop="centerId">
  32. <el-select v-model="addForm.centerId" :placeholder="$t('defaultText.pleaseChoose')" filterable="true" style="width:100%;" :disabled="doYouWantToDisableAll" clearable="true">
  33. <el-option v-for="item in degreeList" :key="item.id" :label="item.name" :value="item.id">
  34. </el-option>
  35. </el-select>
  36. </el-form-item>
  37. <el-form-item :label="$t('suoShuRenWuFenZu')" v-if="showOrNot" prop="groupId">
  38. <el-select v-model="addForm.groupId" :placeholder="$t('defaultText.pleaseChoose')" @change="agentCreatesEvents(2)" filterable="true" style="width:100%;" :disabled="doYouWantToDisableAll">
  39. <el-option v-for="item in groupList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  40. </el-select>
  41. </el-form-item>
  42. <el-form-item :label="$t('suoShuRenWuLieBiao')" v-if="showOrNot" prop="stagesId">
  43. <el-select v-model="addForm.stagesId" :placeholder="$t('defaultText.pleaseChoose')" filterable="true" style="width:100%;" :disabled="doYouWantToDisableAll">
  44. <el-option v-for="item in stageList" :key="item.id" :label="item.stagesName" :value="item.id"></el-option>
  45. </el-select>
  46. </el-form-item>
  47. <!--子任务需要选择任务列表 -->
  48. <el-form-item :label="$t('tasklist')" prop="stages" v-if="addForm.parentTid != null">
  49. <el-select v-model="addForm.stagesId" style="width:100%;" >
  50. <el-option v-for="item in stageList" :key="item.id" :label="item.stagesName" :value="item.id"></el-option>
  51. </el-select>
  52. </el-form-item>
  53. <el-form-item :label="$t('qianZhiRenWu')" prop="aheadTidList" >
  54. <el-select v-model="addForm.aheadTidList" style="width:100%;" multiple filterable @change="$forceUpdate()" :disabled="doYouWantToDisableAll">
  55. <el-option v-for="item in relationdata" :key="item.id" :label="item.name" :value="item.id"></el-option>
  56. </el-select>
  57. </el-form-item>
  58. <!-- <el-form-item :label="$t('types')" v-if="!showMmeiLaiDe">
  59. <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()">
  60. <el-option v-for="item in taskTypeList" :key="item.id" :label="item.name" :value="item.id">
  61. <i :class="item.icon" ></i>
  62. <span>{{item.name}}</span>
  63. </el-option>
  64. </el-select>
  65. </el-form-item> -->
  66. <el-form-item label="任务完成校验" v-if="user.timeType.taskFileCharge">
  67. <el-checkbox v-model="addForm.attachFileRequired" >是否必须上传成果文件</el-checkbox>
  68. </el-form-item>
  69. <el-form-item label="任务内容" prop="name">
  70. <!-- <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> -->
  71. <el-input type="textarea" :rows="4" placeholder="请输入内容" v-model="addForm.name" :maxlength="500" :disabled="(this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !permissions.editAnyTask && !(groupResponsibleId == user.id)" clearable show-word-limit></el-input>
  72. </el-form-item>
  73. <el-form-item :label="$t('planCost')" prop="planCost" v-if="user.timeType.taskPlanCost">
  74. <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>
  75. </el-form-item>
  76. </template>
  77. <!-- {{timelabel}}{{mileageCup}} -->
  78. <el-form-item :label="!timelabel ? $t('starttimes') : $t('jie-zhi-shi-jian')" prop="startDate">
  79. <el-date-picker v-model="addForm.startDate" type="datetime" style="width:40%;" value-format="yyyy-MM-dd HH:mm:ss"
  80. default-time="09:00:00" :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>
  81. <span style="margin-left:30px;margin-right:10px;" v-if="!timelabel">{{ $t('deadline') }}</span>
  82. <el-date-picker style="width:40%;" v-model="addForm.endDate" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
  83. default-time="17:30:00" :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>
  84. <span style="margin-left:30px;margin-right:10px;" v-if="timelabel && mileageCup">{{ $t('wan-cheng-shi-jian') }}</span>
  85. <el-date-picker style="width:40%;" v-if="timelabel && mileageCup" v-model="addForm.finishDate" type="date" value-format="yyyy-MM-dd"
  86. :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>
  87. </el-form-item>
  88. <div class="executorBox" style="margin-bottom: 20px;" v-if="addForm.startDate && addForm.endDate">
  89. <div style="margin-left: 50px;">计划天数: </div>
  90. <div>{{ addForm.plannedDays }} 天</div>
  91. <div style="margin-left: 50px;">计划工时: </div>
  92. <div>{{ addForm.planHours }} H</div>
  93. </div>
  94. <div style="border: 1px solid #ddd;margin:5px 0;padding:5px 0;">
  95. <div class="container" :style="{ height: containerHeight }" @scroll="handleScroll" ref="container">
  96. <div class="list" :style="{ top: listTop }">
  97. <el-form-item :label="$t('zhi-hang-ren') + (executorItem.indexList + 1)" v-for="(executorItem, index) in showData" :key="index">
  98. <div class="editingTask">
  99. <div style="margin-right: 30px">
  100. <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()">
  101. <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id">
  102. <span style="float: left">{{ item.name }}</span>
  103. <span style="float: right; color: #8492a6; font-size: 13px;margin-left: 20px" v-if="item.jobNumber">{{ item.jobNumber }}</span>
  104. </el-option>
  105. </el-select>
  106. <!-- <el-link v-if="executorItem.executorId && addForm.startDate && addForm.endDate" style="margin-left:5px;" @click.stop="viewTaskTimeList(executorItem.executorId, executorItem.indexList)" type="primary" :underline="false">查看/修改</el-link> -->
  107. </div>
  108. <!-- 计划工时 -->
  109. <div class="executorBox">
  110. <!-- <span style="margin-right:10px;">{{ $t('plantime') }}</span>
  111. <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" :placeholder="$t('danweitian')" @change="chggstim(0,executorItem.indexList)"></el-input-number ><span style="margin-left:5px;">{{ $t('time.day') }}</span>
  112. <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" :placeholder="$t('pleaseentertheplannedworking')" @change="chggstim(1,executorItem.indexList)"></el-input-number ><span style="margin-left:5px;">{{ $t('time.hour') }}</span>
  113. <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> -->
  114. 计划总工时: {{ executorItem.planHours }} H
  115. <el-link type="primary" :underline="false" v-if="executorItem.executorId && addForm.startDate && addForm.endDate" style="margin-left: 30px;" @click="allocateDailyWorkingHoursCli(executorItem, executorItem.indexList)">分配每日工时</el-link>
  116. <el-link type="danger" icon="el-icon-delete" :underline="false" 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: 20px" @click="removeExecutorLineNew(executorItem)"></el-link>
  117. </div>
  118. </div>
  119. </el-form-item>
  120. </div>
  121. <div class="bar" :style="{ height: barHeight }"></div>
  122. </div>
  123. <el-link type="primary" v-if="(((addForm.executorListFront == null || addForm.executorListFront.length<100) &&
  124. (addForm.id == null|| user.id == addForm.createrId || currentProject.inchargerId == user.id || permissions.projectManagement || permissions.editAnyTask)) ||
  125. groupResponsibleId == user.id)"
  126. style="margin:0 0 10px 35px;position: relative;z-index: 999;" @click.stop="addExecutorLine">{{ $t('addinganexecutor') }}</el-link>
  127. </div>
  128. <template v-if="selectType.needAudit">
  129. <el-form-item :label="$t('priority')">
  130. <el-select v-model="addForm.taskLevel" style="width:100%;" :disabled="doYouWantToDisableAll">
  131. <el-option v-for="item in importanceList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  132. </el-select>
  133. </el-form-item>
  134. <!-- 富文本 -->
  135. <el-form-item :label="$t('detaileddescription')" style="height: 200px">
  136. <!-- <Editor id="tinymce" v-model="tinymceHtml" :init="editorInit"></Editor> -->
  137. <!-- <el-input type="textarea" v-model="addForm.taskDesc" :rows="3"></el-input> -->
  138. <!-- <quill-edito v-model="addForm.taskDesc"></quill-edito> -->
  139. <quill-editor style="height: 150px" ref="text" v-model="addForm.taskDesc" class="myQuillEditor" :options="editorOption" @blur="onEditorBlur($event)" @focus="onEditorFocus($event)" :disabled="doYouWantToDisableAll"/>
  140. </el-form-item>
  141. <!-- 富文本 -->
  142. <div v-if="addForm.id != null && addForm.taskStatus == 0">
  143. <el-divider ></el-divider>
  144. <!-- 任务进展 -->
  145. <template v-if="!timelabel || isRelationItem">
  146. <p ><i class="iconfont firerock-icontree themeFontColor" style="margin-left:10px;">{{ $t('taskprogress') }}</i>
  147. <span ref="addPro" style="display: block; float:right;"><el-link @click="addprogress">{{ $t('addtaskprogress') }}</el-link></span>
  148. </p>
  149. <!-- 任务进展展示 -->
  150. <div style="display: none;" ref="proBox" class="progress">
  151. <!-- <el-form :model="> -->
  152. <el-radio-group v-model="radio">
  153. <el-radio :label="0" class="rala1">{{ $t('normals') }}</el-radio>
  154. <el-radio :label="1" class="rala2">{{ $t('atrisk') }}</el-radio>
  155. <el-radio :label="2" class="rala3">{{ $t('withinthetimelimit') }}</el-radio>
  156. </el-radio-group>
  157. <el-input
  158. type="textarea"
  159. border="0"
  160. :autosize="{ minRows: 2, maxRows: 6}"
  161. :placeholder="$t('detailedprogressdescription')"
  162. v-model="text2"
  163. style="margin:10px 0 0 0">
  164. </el-input>
  165. <h4 style="font-weight: normal;">{{ $t('tixiang') }}{{checkLists.length}}</h4>
  166. <i class="el-icon-circle-plus pron_i themeFontColor" style="font-size: 28px;" @click="addI(0)"></i>
  167. <div class="remind" ref="addRem" style="display: none">
  168. <el-checkbox-group v-model="checkboxGrounp" v-for="item in users" :key="item.id">
  169. <p>
  170. <el-checkbox :label="item.name" @change="kkk(item)">
  171. <span>
  172. <span v-if="user.userNameNeedTranslate != '1'">
  173. {{item.name}}
  174. </span>
  175. <span v-if="user.userNameNeedTranslate == '1'">
  176. <TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText>
  177. </span>
  178. </span>
  179. </el-checkbox>
  180. </p>
  181. </el-checkbox-group>
  182. </div>
  183. <div class="ssp" @click="sss"></div>
  184. <!-- </el-form> -->
  185. <div class="pro_btn">
  186. <el-button size="mini" @click="shutPro">{{ $t('btn.cancel') }}</el-button>
  187. <el-button size="mini" type="primary" @click="addTaskProgress">{{ $t('fa-bu') }}</el-button>
  188. </div>
  189. </div>
  190. <div class="ddl" v-if="recentProgressInfo != null && recentProgressInfo.id != null">
  191. <div class="elCard" style="margin-bottom: 10px; height:" >
  192. <i class="el-icon-success" style="color: #43d14f;" v-if="recentProgressInfo.status == 0"></i>
  193. <i class="el-icon-success" style="color: #fd7624;" v-else-if="recentProgressInfo.status == 1"></i>
  194. <i class="el-icon-success" style="color: #fd4d47;" v-else></i>
  195. <span v-if="recentProgressInfo.status == 0">{{ $t('normals') }}</span>
  196. <span v-else-if="recentProgressInfo.status == 1">{{ $t('normals') }}</span>
  197. <span v-else>{{ $t('withinthetimelimit') }}</span>
  198. <el-dropdown trigger="click" style="float:right;cursor:pointer; float: right;">
  199. <i class="el-icon-more" ></i>
  200. <el-dropdown-menu slot="dropdown">
  201. <el-dropdown-item divided>
  202. <span @click="deleteTaskProgress(recentProgressInfo.id)"><i class="el-icon-delete"></i>{{ $t('deleteList ') }}</span></el-dropdown-item>
  203. </el-dropdown-menu>
  204. </el-dropdown>
  205. <!-- <div class="elCard_qu">{{recentProgressInfo.creatorName}}{{ $t('geng-xin-yu') }}{{recentProgressInfo.indate | relativeTime}}</div> -->
  206. <div class="elCard_qu">
  207. <span>
  208. <span v-if="user.userNameNeedTranslate != '1'">
  209. {{recentProgressInfo.creatorName}}
  210. </span>
  211. <span v-if="user.userNameNeedTranslate == '1'">
  212. <TranslationOpenDataText type='userName' :openid='recentProgressInfo.creatorName'></TranslationOpenDataText>
  213. </span>
  214. </span>
  215. {{ $t('geng-xin-yu') }}{{recentProgressInfo.indate | relativeTime}}
  216. </div>
  217. <p style="padding-left: 20px;">{{recentProgressInfo.content}}</p>
  218. <div class="examine"><el-button type="text" @click="innerVisibless = true" style="color: #8F87A3;">{{ $t('viewingHistory') }}</el-button></div>
  219. </div>
  220. </div>
  221. <!-- 任务列表没有数据的时候展示 -->
  222. <div class="nones" v-if="ProgressList.length <= 0">
  223. {{ $t('nodata') }}
  224. </div>
  225. <!-- 任务进展完整状态 -->
  226. <el-dialog :title="$t('other.prompts')" :visible.sync="innerVisibless" append-to-body width="500px">
  227. <div class="integrity">
  228. <h3 style="font-weight: normal;display: inline-block;margin: 0 0 20px 0;">{{ $t('taskprogress') }} :{{ProgressList.length}}</h3>
  229. <!-- <span class="write"><i class="el-icon-circle-plus"></i>填写进展</span> -->
  230. <el-divider></el-divider>
  231. <!-- -->
  232. <div class="block" style="height: 200px;">
  233. <el-timeline style="padding:20px 0 0 0;">
  234. <el-timeline-item
  235. v-for="(activity, index) in ProgressList"
  236. :key="index">
  237. <div class="tb">
  238. <span v-if="activity.status == 0" style="color: #43D14F" class="icon"></span>
  239. <span v-if="activity.status == 1" style="color: #FD7624" class="icon"></span>
  240. <span v-if="activity.status == 2" style="color: red" class="icon"></span>
  241. <div>
  242. <span v-if="activity.status == 0" style="color: #43D14F">{{ $t('normals') }}</span>
  243. <span v-if="activity.status == 1" style="color: #FD7624">{{ $t('atrisk') }}</span>
  244. <span v-if="activity.status == 2" style="color: red">{{ $t('withinthetimelimit') }}</span>
  245. <span style="display: inline-block; float: right; color: #8C8C8C">{{activity.indate | relativeTime}}</span>
  246. </div>
  247. <p style="color: #8C8C8C">{{activity.content}}</p>
  248. </div>
  249. </el-timeline-item>
  250. </el-timeline>
  251. </div>
  252. <!-- -->
  253. </div>
  254. <span slot="footer" class="dialog-footer foooot">
  255. <el-button type="primary" @click="innerVisibless = false">{{ $t('Shutdown') }}</el-button>
  256. </span>
  257. </el-dialog>
  258. </template>
  259. </div>
  260. </template>
  261. </el-form>
  262. <!-- 关联文件列表 -->
  263. <template v-if="isEditFile && addForm.needAudit && addForm.taskStatus == 0">
  264. <div style="width:100%;margin:1em 0;">
  265. <i class="iconfont firerock-icontree themeFontColor" style="margin-left:10px;">{{ $t('jiafuchengguo') }}</i>
  266. <el-link @click="relationFileClick()" style="float:right;margin-left:10px">{{ $t('associatedfiles') }}</el-link>
  267. <el-upload style="float:right;" action="#" :http-request="uploadFileClick" :show-file-list="false" :multiple="false">
  268. <el-link>{{ $t('uoloadFiles') }}</el-link>
  269. </el-upload>
  270. </div>
  271. <el-table
  272. v-loading="fileListLoading"
  273. ref="filetable"
  274. :data="taskFileList"
  275. :header-cell-style="{'font-weight':'normal'}"
  276. highlight-current-row
  277. max-height="240"
  278. style="width: 100%;margin-top:10px;margin-bottom:15px">
  279. <el-table-column :label="$t('headerTop.serialNumber')" prop="documentType" min-width="60" align="center">
  280. <template slot-scope="scope">
  281. <div>
  282. {{scope.$index + 1}}
  283. </div>
  284. </template>
  285. </el-table-column>
  286. <el-table-column :label="$t('filenames')" prop="documentName" min-width="180">
  287. <template slot-scope="scope">
  288. <el-link @click.stop.native="viewOnline(scope.row)">
  289. {{scope.row.documentName}}
  290. </el-link>
  291. </template>
  292. </el-table-column>
  293. <el-table-column :label="$t('filesize')" prop="size" min-width="80" align="center"></el-table-column>
  294. <el-table-column :label="$t('founder')" prop="creatorName" min-width="60" align="center">
  295. <template slot-scope="scope">
  296. <div>
  297. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.creatorName}}</span>
  298. <span v-if="user.userNameNeedTranslate == 1">
  299. <TranslationOpenDataText type='userName' :openid='scope.row.creatorName'></TranslationOpenDataText>
  300. </span>
  301. </div>
  302. </template>
  303. </el-table-column>
  304. <el-table-column :label="$t('creationtime')" prop="indate" min-width="150" align="center">
  305. <template slot-scope="scope">
  306. <span>{{scope.row.indate}}</span>
  307. </template>
  308. </el-table-column>
  309. <el-table-column :label="$t('operation')" min-width="150" fixed="right">
  310. <template slot-scope="scope">
  311. <el-link :href="scope.row.url" :download="scope.row.documentName" type="primary" style="margin-right:7px">{{ $t('other.download') }}</el-link>
  312. <el-link @click="taskFileDelete(scope.row.id)">{{ $t('btn.delete') }}</el-link>
  313. <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">
  314. <el-link type="primary">重新上传</el-link>
  315. </el-upload>
  316. </template>
  317. </el-table-column>
  318. <el-table-column label="状态" min-width="140" v-if="user.timeType.taskFileCharge == 1 || user.timeType.taskFileCharge == 2" fixed="right">
  319. <template slot-scope="scope">
  320. <template v-if="scope.row.fileChargeStatus != 2">
  321. <el-link :type="{'0': 'warning', '1': 'info', '2': 'danger'}[scope.row.fileChargeStatus]" :underline="false">
  322. {{ scope.row.fileChargeStatusTextList[0] || '' }}
  323. <template v-if="(scope.row.fileChargeStatusTextList || []).length > 1">
  324. <TranslationOpenDataText :openid='scope.row.fileChargeStatusTextList[1]'></TranslationOpenDataText>
  325. {{ scope.row.fileChargeStatusTextList[2] || '' }}
  326. </template>
  327. </el-link>
  328. </template>
  329. <template v-else>
  330. <el-tooltip class="item" effect="dark" content="点击查看" placement="top">
  331. <el-link :type="'danger'" :underline="false" @click="showReasonForRejection(scope.row)">
  332. {{ scope.row.fileChargeStatusTextList[0] || '' }}
  333. <template v-if="(scope.row.fileChargeStatusTextList || []).length > 1">
  334. <TranslationOpenDataText :openid='scope.row.fileChargeStatusTextList[1]'></TranslationOpenDataText>
  335. {{ scope.row.fileChargeStatusTextList[2] || '' }}
  336. </template>
  337. </el-link>
  338. </el-tooltip>
  339. </template>
  340. </template>
  341. </el-table-column>
  342. </el-table>
  343. </template>
  344. <!-- 关联文件dialog -->
  345. <el-dialog v-if="relationFileDialog" :visible.sync="relationFileDialog" :title="$t('associatedfiles')" append-to-body>
  346. <span>{{ $t('wenjian1guanli') }}</span>
  347. <div>
  348. <span>{{ $t('xuanzwenjian') }}</span>
  349. <el-select v-model="addFileId" filterable >
  350. <el-option
  351. v-for="item in projectFileList"
  352. :key="item.id"
  353. :label="item.documentName"
  354. :value="item.id"
  355. ></el-option>
  356. </el-select>
  357. <el-button @click="addTaskFile()">{{ $t('btn.determine') }}</el-button>
  358. </div>
  359. </el-dialog>
  360. <el-dialog v-if="isRelationTab" :visible.sync="isRelationTab" :title="$t('associatedTask')" width="800px" append-to-body>
  361. <el-form ref="relationItemForm" label-width="100px">
  362. <el-form-item :label="$t('selecttask')" prop="taskType">
  363. <el-select v-model="relationvalue" multiple style="width:80%">
  364. <el-option
  365. v-for="item in relationdata"
  366. :key="item.id"
  367. :label="item.name"
  368. :value="item.id"
  369. ></el-option>
  370. </el-select>
  371. </el-form-item>
  372. </el-form>
  373. <div slot="footer" class="dialog-footer foooot">
  374. <el-button @click="isRelationTab = false">{{ $t('btn.cancel') }}</el-button>
  375. <el-button type="primary" @click="addRelationTask()">{{ $t('btn.determine') }}</el-button>
  376. </div>
  377. </el-dialog>
  378. </div>
  379. <div slot="footer" class="dialog-footer foooot">
  380. <!-- <el-button v-if="(user.id == showMmeiLaiDeData.checkFirstId && showMmeiLaiDeData.taskStatus == 3) || (user.id == showMmeiLaiDeData.checkSecondId && [4, '4', '1', 1].includes(showMmeiLaiDeData.taskStatus))" @click.native="deleteTask()" style="float:left;">{{ $t('btn.delete') }}</el-button>
  381. <el-button v-if="showMmeiLaiDeData.taskPlan && showMmeiLaiDeData.taskStatus == 2" @click.native="deleteTask()" style="float:left;">删除</el-button> -->
  382. <el-button v-if="addForm.createrId == user.id && addForm.taskStatus == 2" @click.native="deleteTask()" style="float:left;">删除</el-button>
  383. <el-button @click.native="closeBounceds()">{{ $t('btn.cancel') }}</el-button>
  384. <template v-if="addForm.taskStatus == 3 && addForm.createrId == user.id">
  385. <el-button @click.native="planToWithdraw()">撤回</el-button>
  386. </template>
  387. <template v-if="addForm.id && millerSReviewer.includes(user.id) && [3, 4].includes(showMmeiLaiDeData.taskStatus)">
  388. <template v-if="(showMmeiLaiDeData.taskStatus == 3 && user.id == showMmeiLaiDeData.checkFirstId) || (showMmeiLaiDeData.taskStatus == 4 && user.id == showMmeiLaiDeData.checkSecondId)">
  389. <el-button type="danger" @click="planOperation(false)" :loading="addLoading">驳回</el-button>
  390. <el-button type="success" @click="planOperation(true)" :loading="addLoading">通过</el-button>
  391. </template>
  392. </template>
  393. <template>
  394. <el-button type="primary" @click="submitInsert()" :loading="addLoading" v-if="addForm.canEditTask || !addForm.id">
  395. 提交
  396. </el-button>
  397. <!--对于需要审核的情况-->
  398. <!-- <el-button type="primary" @click="submitInsert(1)" :loading="addLoading" v-if="selectType.needAudit && (showMmeiLaiDeData.taskStatus == 2 || showMmeiLaiDeData.taskStatus == 5 || showMmeiLaiDeData.taskStatus == 6)">
  399. 保存并提交审核
  400. </el-button> -->
  401. </template>
  402. </div>
  403. <!-- <div slot="title" v-if="addForm.parentTid != null || isRelationItem" >
  404. <el-page-header @back="backToParentTask" :title="timelabel ? $t('returnmilestone') : $t('parenttask')" :content="timelabel ? relationPar.name : addForm.parentTname"></el-page-header>
  405. </div> -->
  406. <!-- 评论 -->
  407. <div class="remark" v-show="addForm.id != null && !showMmeiLaiDe">
  408. <span class="zh">
  409. <div class="player">
  410. <p>{{ $t('participantin') }}</p>
  411. <div class="bj">
  412. <span v-for="(pl, i) in critic" :key="i">
  413. <span style="background: #778899" v-if="user.userNameNeedTranslate != 1">{{pl.length > 2 ? pl.substring(pl.length - 2, pl.length) : pl}}</span>
  414. <span v-if="user.userNameNeedTranslate == 1">
  415. <TranslationOpenDataText type='userName' :openid='pl'></TranslationOpenDataText>
  416. </span>
  417. </span>
  418. <!-- <span style="background: #778899">{{pl.length}}</span> -->
  419. </div>
  420. </div>
  421. <div class="subject">
  422. <div class="sub-all">
  423. <div :class="dynamicTab ? 'subOn' : ''" @click="dynamicTab = true">{{ $t('alldynamic') }}</div>
  424. <div :class="dynamicTab ? '' : 'subOn'" @click="dynamicTab = false">{{ $t('xiang-guan-ri-bao') }}</div>
  425. </div>
  426. <div class="sub-details" ref="main" v-if="dynamicTab">
  427. <ul class="infinite-list" v-infinite-scroll="load" ref="contRoll">
  428. <div style="width: 100%" v-if="commentList.length <= 0">
  429. <img src="../assets/image/xiao.png" alt="">
  430. </div>
  431. <li v-for="i in count" class="infinite-list-item counli" :key="i">
  432. <p><i class="el-icon-s-fold"></i> <em>{{ $t('managerQucompletedthedependencytask') }}</em><span>{{ $t('onApril20') }}</span></p>
  433. </li>
  434. <li class="carts" v-for="item in commentList" :key="item.id">
  435. <!-- <el-image style="width: 30px; height: 30px" :src="url" :fit="fit"></el-image> -->
  436. <!-- <i :style="'background' + item.userColor"> -->
  437. <i :style="'background' + item.userColor">
  438. <i v-if="user.userNameNeedTranslate != 1">
  439. {{item.userName.length > 2 ? item.userName.substring(item.userName.length - 2, item.userName.length) : item.userName}}
  440. </i>
  441. <i v-if="user.userNameNeedTranslate == 1">
  442. <TranslationOpenDataText type='userName' :openid='item.userName'></TranslationOpenDataText>
  443. </i>
  444. </i>
  445. <div>
  446. <!-- <p>{{item.userName}}</p> -->
  447. <!-- <p> -->
  448. <p v-if="user.userNameNeedTranslate != 1">
  449. {{item.userName}}
  450. </p>
  451. <p v-if="user.userNameNeedTranslate == 1">
  452. <TranslationOpenDataText type='userName' :openid='item.userName'></TranslationOpenDataText>
  453. </p>
  454. <!-- </p> -->
  455. <em>
  456. <p style="display: inline-block;padding: 0;margin: 0;" v-if="user.userNameNeedTranslate == 1">
  457. <template v-for="listItem in item.newContent">
  458. <template v-if="listItem.type == 'user'">
  459. <TranslationOpenDataText type='userName' :openid='listItem.value'></TranslationOpenDataText>
  460. </template>
  461. <template v-if="listItem.type == 'text'">{{ listItem.value }}</template>
  462. </template>
  463. </p>
  464. <p style="display: inline-block;padding: 0;margin: 0;" v-if="user.userNameNeedTranslate != 1">{{item.content}}</p>
  465. <!-- 重启原因和责任人 -->
  466. <span class="commentSpan" v-if="user.timeType.restartTaskNeedReason == 1 && item.reason != ''">{{ $t('zhongQiYuanYin') }}:{{item.reason}}</span>
  467. <span class="commentSpan" v-if="user.timeType.restartTaskNeedReason == 1 && item.taskPersonLiableList.length > 0">{{ $t('zeRenRen') }}
  468. <span v-for="responsibility, responsibilityIndex in item.taskPersonLiableList" :key="responsibilityIndex">
  469. <span v-if="user.userNameNeedTranslate == 1">
  470. <TranslationOpenDataText type='userName' :openid='responsibility.userName'></TranslationOpenDataText>
  471. </span>
  472. <span v-if="user.userNameNeedTranslate != 1">{{responsibility.userName}}</span>
  473. <span v-if="responsibilityIndex < item.taskPersonLiableList.length - 1">,</span>
  474. </span>
  475. </span>
  476. </em>
  477. </div>
  478. <span>{{item.createTime | relativeTime}}</span>
  479. </li>
  480. </ul>
  481. </div>
  482. <div class="Daily" v-if="!dynamicTab">
  483. <div class="one_daily_body DailyBody">
  484. <el-card shadow="never" v-for="(item2,index2) in dailyList" :key="index2" style="margin-bottom: 20px;">
  485. <p>
  486. {{ $t('tian-bao-ren') }}: <span v-if="user.userNameNeedTranslate != 1">{{item2.userName}}</span>
  487. <span v-if="user.userNameNeedTranslate == 1">
  488. <TranslationOpenDataText type='userName' :openid='item2.userName'></TranslationOpenDataText>
  489. </span>
  490. <span style="float: right;">{{item2.createDate}}</span>
  491. </p>
  492. <p>{{ $t('other.approvalStatus') }}:
  493. <span v-if="user.company.packageEngineering == 0">
  494. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">
  495. <span v-if="item2.isDeptAudit==0">
  496. <span v-if="item2.projectAuditState==0">
  497. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  498. <span v-if="item2.projectAuditorName != null">(
  499. <span v-if="user.userNameNeedTranslate == '1'">
  500. <TranslationOpenDataText type='userName' :openid='item2.projectAuditorName'></TranslationOpenDataText>
  501. </span>
  502. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  503. )</span>
  504. <!-- 审核 --> {{$t('other.audit')}}
  505. </span>
  506. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  507. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  508. <span v-if="item2.projectAuditorName != null">(
  509. <!-- {{item2.projectAuditorName}} -->
  510. <span v-if="user.userNameNeedTranslate == '1'">
  511. <TranslationOpenDataText type='userName' :openid='item2.projectAuditorName'></TranslationOpenDataText>
  512. </span>
  513. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  514. )</span>
  515. <!-- 审核通过 --> {{$t('state.approved')}}
  516. </span>
  517. </span>
  518. <span v-else-if="item2.isDeptAudit==1">
  519. ({{$t('other.await')}}
  520. <span v-if="user.userNameNeedTranslate == '1'">
  521. <TranslationOpenDataText type='departmentName' :openid='item2.auditDeptName'></TranslationOpenDataText>
  522. </span>
  523. <span v-if="user.userNameNeedTranslate != '1'">{{item2.auditDeptName}}</span>
  524. {{$t('other.audit')}})
  525. </span>
  526. </span>
  527. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">{{$t('other.importWaitingForReview')}}</span>
  528. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">{{$t('state.alreadyPassed')}}
  529. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1">{{$t('other.automaticReview')}}</span>
  530. </span>
  531. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">{{$t('state.rejected')}} {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  532. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">{{$t('state.waitingsubmit')}}</span>
  533. </span>
  534. <span v-if="user.company.packageEngineering == 1">
  535. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">{{$t('other.importWaitingForReview')}}</span>
  536. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">{{$t('other.waitingForProfessionalReview')}}</span>
  537. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">{{$t('other.waitingForDepartmentReview')}}</span>
  538. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">{{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  539. (
  540. <span v-if="user.userNameNeedTranslate != 1">
  541. {{item2.projectAuditorName}}
  542. </span>
  543. <span v-if="user.userNameNeedTranslate == 1">
  544. <TranslationOpenDataText type='userName' :openid='item2.projectAuditorName'></TranslationOpenDataText>
  545. </span>
  546. )
  547. </span>{{$t('other.audit')}}</span>
  548. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">{{$t('state.alreadyPassed')}}</span>
  549. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">{{$t('state.rejected')}} {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  550. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">{{$t('state.waitingsubmit')}}</span>
  551. </span>
  552. </p>
  553. <p v-if="user.timeType.customDegreeActive==1 && item2.degree_id != null && item2.degree_id != -1">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  554. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  555. <!-- 自定义日报文本 -->
  556. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  557. <div v-if="item2.multiWorktime==0">
  558. <p style="display: inline-block;">{{$t('time.duration')}}:
  559. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  560. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  561. {{item2.time.toFixed(1)}}h
  562. <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>
  563. </p>
  564. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  565. </div>
  566. <div v-if="item2.multiWorktime==1" >
  567. <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>
  568. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  569. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  570. <p style="display: inline-block;">{{$t('time.duration')}}:
  571. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  572. {{timeItem.time.toFixed(1)}}h
  573. </p>
  574. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  575. </div>
  576. </div>
  577. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  578. <!--照片的显示 -->
  579. <p v-if="item2.pics != null && item2.pics.length > 0">
  580. <el-image v-for="(pic, index) in item2.pics" :key="index"
  581. style="width: 100px; height: 100px; margin-right:10px;"
  582. :src="pic"
  583. :preview-src-list="item2.pics">
  584. </el-image>
  585. </p>
  586. </el-card>
  587. </div>
  588. </div>
  589. </div>
  590. <div class="issue" v-if="dynamicTab">
  591. <!-- <el-input type="textarea" class="textareays" label-width="100%" label-height="140px"></el-input> -->
  592. <div class="issue_fixation">
  593. <div class="inputDeep"><el-input
  594. type="textarea"
  595. :placeholder="$t('pleaseentercontent')"
  596. :autosize="{ minRows: 6, maxRows: 6}"
  597. v-model="textarea2"
  598. class="inputDeeps"
  599. >
  600. </el-input></div>
  601. <el-button class="issue-button" type="primary" @click="release()">{{ $t('fa-bu') }}</el-button>
  602. </div>
  603. </div>
  604. </span>
  605. </div>
  606. <!-- 修改工时弹窗 -->
  607. <el-dialog title="查看已有计划" :visible.sync="modifyWorkingHoursRowVisable" width="840px" top="6.5vh" :before-close="handleClose" append-to-body>
  608. <div>
  609. <div class="modifyPlanTitle">
  610. <div class="modifyPlanTitle-item">
  611. <div>执行人:</div>
  612. <el-select v-model="modifyWorkingHoursRow.userId" placeholder="请选择" filterable size="small" style="width: 180px;" @change="getViewTaskTimeList()" disabled>
  613. <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id">
  614. <span style="float: left">{{ item.name }}</span>
  615. <span style="float: right; color: #8492a6; font-size: 13px;margin-left: 20px" v-if="item.jobNumber">{{ item.jobNumber }}</span>
  616. </el-option>
  617. </el-select>
  618. </div>
  619. <div class="modifyPlanTitle-item">
  620. <div>时间段:</div>
  621. <el-date-picker v-model="modifyWorkingHoursRow.startDate" type="datetime" style="width: 200px;" value-format="yyyy-MM-dd HH:mm:ss"
  622. default-time="09:00:00" :placeholder="$t('pleaseselectadate')" size="small" @change="getViewTaskTimeList()" :clearable="false" :disabled="true"></el-date-picker>
  623. <span style="margin:0 10px;">至</span>
  624. <el-date-picker style="width: 200px;" v-model="modifyWorkingHoursRow.endDate" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
  625. default-time="17:30:00" :placeholder="$t('pleaseselectadate')" size="small" @change="getViewTaskTimeList()" :clearable="false" :disabled="true"></el-date-picker>
  626. </div>
  627. </div>
  628. <el-table :data="modifyWorkingHoursList" style="width: 100%" border v-loading="modifyWorkingHoursListLoading" height="58vh">
  629. <el-table-column prop="name" label="项目名称"></el-table-column>
  630. <el-table-column prop="typeName" label="计划名称"></el-table-column>
  631. <el-table-column prop="startDate" label="开始时间" width="180"></el-table-column>
  632. <el-table-column prop="endDate" label="截止时间" width="180"></el-table-column>
  633. </el-table>
  634. </div>
  635. <span slot="footer" class="dialog-footer">
  636. <el-button @click="modifyWorkingHoursRowVisable = false">取 消</el-button>
  637. <!-- <el-button type="primary" @click="confirmArrangement()">确认安排</el-button> -->
  638. </span>
  639. </el-dialog>
  640. <!-- 分配每日工时 -->
  641. <el-dialog :visible.sync="allocateDailyWorkingHoursVisable" width="900px" top="6.5vh" :before-close="handleClose" append-to-body>
  642. <div slot="title" class="allocateDailyWorkingHoursClass">
  643. <div class="allocate-title">分配每日工时</div>
  644. <div class="allocate-title">{{ addForm.startDate }} - {{ addForm.endDate }}</div>
  645. <el-link type="primary" :underline="false" @click="viewExistingPlans()">查看已有计划</el-link>
  646. </div>
  647. <div class="allocateDailyWorkingHoursClass-table">
  648. <el-table ref="allocateTableRef" :data="allocateDailyWorkingHoursList" tooltip-effect="dark" border style="width: 100%" height="60vh" @selection-change="allocateTableSelectionChange" :span-method="allocateTableObjectSpanMethod">
  649. <el-table-column type="selection" width="55"></el-table-column>
  650. <el-table-column prop="allocateDate" label="日期" width="100px" align="center"></el-table-column>
  651. <el-table-column label="开始时间" width="180px" align="center">
  652. <template slot-scope="scope">
  653. <el-time-picker v-model="scope.row.startTime" value-format="HH:mm:ss" :clearable="false" size="small" @change="calculateWorkingHours(scope.row, scope.$index)" style="width: 120px;"></el-time-picker>
  654. </template>
  655. </el-table-column>
  656. <el-table-column label="截止时间" width="180px" align="center">
  657. <template slot-scope="scope">
  658. <el-time-picker v-model="scope.row.endTime" value-format="HH:mm:ss" :clearable="false" size="small" @change="calculateWorkingHours(scope.row, scope.$index)" style="width: 120px;"></el-time-picker>
  659. </template>
  660. </el-table-column>
  661. <el-table-column prop="workHour" label="总工时" align="center"></el-table-column>
  662. <el-table-column prop="overWorkHour" label="含加班" align="center"></el-table-column>
  663. <el-table-column label="操作" width="160px">
  664. <template slot-scope="scope">
  665. <el-button type="danger" size="small" @click="deleteASingleDateSchedule(scope.$index)">删除</el-button>
  666. <el-button type="primary" size="small" @click="addSingleDateSchedule(scope.row, scope.$index)">添加</el-button>
  667. </template>
  668. </el-table-column>
  669. </el-table>
  670. </div>
  671. <div slot="footer" class="allocateDailyWorkingHoursClass-footer">
  672. <div class="footer-left">
  673. <el-time-picker v-model="startingTimePeriod" value-format="HH:mm:ss" :clearable="false" size="small" :disabled="!tableSelection.length" style="width: 120px;margin-right: 14px"></el-time-picker>
  674. -
  675. <el-time-picker v-model="endTimePeriod" value-format="HH:mm:ss" :clearable="false" size="small" :disabled="!tableSelection.length" style="width: 120px;margin: 0 14px"></el-time-picker>
  676. <el-button size="small" :disabled="startingTimePeriod > endTimePeriod || !tableSelection.length" @click="batchSetTimePeriod()">批量设置</el-button>
  677. <el-select v-model="dateDropdownMenuSelectionVal" clearable filterable size="small" placeholder="请选择添加日期" :disabled="!dateDropdownMenuSelection.length" style="width: 140px;margin: 0 14px">
  678. <el-option v-for="(item, index) in dateDropdownMenuSelection" :key="index" :label="item" :value="item"></el-option>
  679. </el-select>
  680. <el-button size="small" :disabled="!dateDropdownMenuSelectionVal" @click="addASingleDate()">添加日期</el-button>
  681. </div>
  682. <div>
  683. <el-button @click="allocateDailyWorkingHoursVisable = false" size="small">取 消</el-button>
  684. <el-button type="primary" :disabled="!allocateDailyWorkingHoursList.length" @click="determineWorkingHours()" size="small" :loading="allocateDailyWorkingHoursLoading">确认工时</el-button>
  685. </div>
  686. </div>
  687. </el-dialog>
  688. </div>
  689. </template>
  690. <script>
  691. import selectCat from "@/components/select.vue"
  692. import selectPersonnel from "@/components/selectPersonnel.vue"
  693. // 富文本样式
  694. import 'quill/dist/quill.core.css'
  695. import 'quill/dist/quill.snow.css'
  696. import 'quill/dist/quill.bubble.css'
  697. // 导入富文本
  698. import { quillEditor } from 'vue-quill-editor'
  699. import { getThemeColor } from '@/utils/commonMethod.js'
  700. // 工时计算
  701. import { calculateWorkHours, generateUUID } from './taskComponent'
  702. export default {
  703. props: {
  704. integrationTask:{
  705. type: Object,
  706. default: {}
  707. },
  708. // 是否显示选择任务
  709. showOrNot: {
  710. type: Boolean,
  711. default: false
  712. },
  713. // 是否属于美莱得定制化的工作计划
  714. showMmeiLaiDe: {
  715. type: Boolean,
  716. default: false
  717. },
  718. showMmeiLaiDeData: {
  719. type: Object,
  720. default: {}
  721. }
  722. },
  723. components: {
  724. quillEditor, // 富文本
  725. selectCat,
  726. selectPersonnel
  727. },
  728. data() {
  729. return {
  730. restPeriod: [], // 休息时间段
  731. selectType: {},
  732. degreeList:[],
  733. doYouWantToDisableAll: false,
  734. startNum: 0,
  735. endNum: 5,
  736. shownumber: 5,
  737. sizeNum: 65,
  738. meeting: false,
  739. numnnumnum: 2,
  740. componentFlg: false,
  741. mileageCup: false,
  742. loadingExport : false,
  743. saveTemplateLoading: false,
  744. joinMembList:[],
  745. setInchargerDialog: false,
  746. recentProgressInfo:{},
  747. addToTmpDialog:false,
  748. templateForm:{},
  749. importTaskDialog:false,
  750. importToStageId:null,
  751. exportDialog: false,
  752. exportTaskType:null,
  753. groupTemplateList:[],
  754. createGroupWay:'new',
  755. modGroupDialog:false,
  756. subTaskVisible:false,
  757. orderList:[{id:"seq",name:this.$t('manuallydragthesequence'),isDesc:false},{id:"create_date",name:this.$t('creationtimeisthelatest'),isDesc:true},
  758. {id:"end_date",name:this.$t('deadlineisthelatest'),isDesc:true},
  759. {id:"task_level",name:this.$t('highestpriority'),isDesc:true}],
  760. order:"seq",
  761. isDesc:false,
  762. taskDataList:[],
  763. displayTable: false,
  764. 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')},
  765. {id:5,name:this.$t('createdthetask')},{id:6,name:this.$t('missionIwason')},{id:7,name:this.$t('todaytask')},{id:8,name:this.$t('taskthatisoverdue')}],
  766. importanceList:[{id:0,name:this.$t('yi-ban')},{id:1,name:this.$t('zhong-yao')},{id:2,name:this.$t('jin-ji')},],
  767. 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"}],
  768. taskTypeColor:[getThemeColor(),'#8613ad','#bf0404'],
  769. taskTypeIcon:['iconfont firerock-iconrenwu','iconfont firerock-iconicon-','iconfont firerock-iconfengxian'],
  770. taskStatusList:[this.$t('ongoing'),this.$t('state.completed'),this.$t('state.undone'),'待第一审核人审核','待第二审核人审核','第一审核人驳回','第二审核人驳回'],
  771. taskStatusColorList:['#20a0ff','#E6A23C','#a0a0a0','#f7863b','#262626','#FF0000','#FF0000'],
  772. //优先级
  773. taskLevelColor:['#262626','#E6A23C','#F56C6C'],
  774. stageListHeight:0,
  775. taskListinH:0,
  776. groupWidth:260,
  777. drag: false,
  778. stageDrag: false,
  779. dragging: false,
  780. stageList:[],
  781. selectedGroup:{},
  782. allGroupData:[],
  783. defaultGroupId:null,
  784. addGroupDialog: false,
  785. addStageDialog: false,
  786. groupSearch:null,
  787. groupType:0,//0-分组,1-视图
  788. groupList: [],
  789. groupForm:{},
  790. stageForm:[],
  791. curProjectId:null,
  792. projectList:null,
  793. activeIndex:"1",
  794. activeName:"projectInside",
  795. searchField:null,
  796. keyword:null,
  797. user: JSON.parse(sessionStorage.getItem("user")),
  798. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  799. userDetailVisible: false,
  800. userDetail:{},
  801. date: new Date(),
  802. users: [],
  803. tableHeight: 0,
  804. listLoading: false,
  805. subProjectVisible: false,
  806. subProjectList: [],//子项目列表
  807. currentProject:{},
  808. addSubProject: false,
  809. addFormVisible: false,
  810. typeList:[],
  811. addLoading: false,
  812. title: "",
  813. addForm: {
  814. name: '',
  815. executorListFront: [
  816. {
  817. executorId:null
  818. }
  819. ]
  820. },
  821. rules: {
  822. name: [{ required: true, message: this.$t('pleaseenteragroupname'), trigger: "blur" }],
  823. },
  824. rules2: {
  825. stagesName: [{ required: true, message: this.$t('pleaseenteratasklistname'), trigger: "blur" }],
  826. },
  827. taskRules : {
  828. name: [{ required: true, message: this.$t('enterthetaskcontent'), trigger: "blur" }],
  829. serviceId: [{ required: true, message: this.$t('qingXuanZeFuWu'), trigger: "blur" }],
  830. projectId: [{ required: true, message: this.$t('qingXuanZeSuoShuXiangMu'), trigger: "blur" }],
  831. groupId: [{ required: true, message: this.$t('qingXuanZeSuoShuRenWuFenZu'), trigger: "blur" }],
  832. stagesId: [{ required: true, message: this.$t('qingXuanZeSuoShuRenWuLieBiao'), trigger: "blur" }],
  833. planCost: [{ required: true, message: this.$t('planCostHint'), trigger: "blur" }],
  834. taskPlanType: [{ required: true, message: '请选择类型', trigger: "blur" }],
  835. checkSecondId: [{ required: true, message: '请选择审核人', trigger: "blur" }],
  836. // centerId: [{ required: true, message: '请选择研究中心', trigger: "blur" }]
  837. },
  838. formGrouping: {
  839. name: [{ required: true, message: this.$t('pleaseenteragroupname'), trigger: "blur" }],
  840. },
  841. sleectId: null,
  842. sleectProjectId: null,
  843. sidebarIndex: 0, // 侧边栏索引
  844. url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
  845. count: 0,
  846. textarea2: '',
  847. taskId: null,
  848. commentList: [],
  849. radio: 0,
  850. critic: [], // 评论头像的数组
  851. editorOption: { // 富文本框里面的默认值
  852. placeholder: this.$t('pleaseentethetext'),
  853. modules: {
  854. toolbar:[
  855. ['bold', 'italic', 'underline', 'strike'], //加粗,斜体,下划线,删除线
  856. // ['blockquote', 'code-block'], //引用,代码块
  857. [{ 'header': 1 }, { 'header': 2 }], // 标题,键值对的形式;1、2表示字体大小
  858. // [{ 'list': 'ordered'}, { 'list': 'bullet' }], //列表
  859. // [{ 'script': 'sub'}, { 'script': 'super' }], // 上下标
  860. // [{ 'indent': '-1'}, { 'indent': '+1' }], // 缩进
  861. // [{ 'direction': 'rtl' }], // 文本方向
  862. [{ 'size': ['small', false, 'large', 'huge'] }], // 字体大小
  863. [{ 'header': [1, 2, 3, 4, 5, 6, false] }], //几级标题
  864. [{ 'color': [] }, { 'background': [] }], // 字体颜色,字体背景颜色
  865. // [{ 'font': [] }], //字体
  866. [{ 'align': [] }], //对齐方式
  867. ['clean'], //清除字体样式
  868. // ['image','video'] //上传图片、上传视频
  869. ['image'] //上传图片、上传视频
  870. ], //工具栏设置
  871. },
  872. theme: 'snow',
  873. },
  874. textContent: true, // 控制提交
  875. times: null,
  876. text2: '',
  877. innerVisibless: false, // 任务展示弹出层
  878. activities: [{
  879. content: this.$t('normals'),
  880. timestamp: this.$t('hoursago'),
  881. size: 'large',
  882. type: 'primary',
  883. icon: 'el-icon-circle-check',
  884. color: '#409EFF'
  885. }, {
  886. content: this.$t('withinthetimelimit'),
  887. timestamp: this.$t('hoursago8'),
  888. color: '#F87872'
  889. }],
  890. ProgressList: [],
  891. checkboxGrounp: [], // 选中人的数据
  892. checkLists: [], // 选中人数据的ID
  893. taskIid: null,
  894. gstimday:[1],
  895. gstimhour:[8],
  896. timelabel: false,
  897. relationdata: [],
  898. isRelationTab: false,
  899. relationvalue:[],
  900. relationSubTaskList:[],
  901. relationItemData: null,
  902. relationPar:{name: ''},
  903. isRelationItem: false,
  904. // 关联文件
  905. fileListLoading:false,
  906. projectFileList:[],
  907. taskFileList:[],
  908. relationFileDialog: false,
  909. addFileId: null,
  910. isEditFile: false,
  911. // 设置项目参与人
  912. participantsDialog: false,
  913. participantsFilterText: '',
  914. deptMembData: [
  915. {
  916. id: 0,
  917. label: this.$t('lable.unassigned'),
  918. }
  919. ],
  920. defaultProps: {
  921. children: 'children',
  922. label: 'label'
  923. },
  924. chosenMembCount: 0,
  925. ididid:null,
  926. alreadyPartArray: [],
  927. projectCreatorId: null,
  928. projectInchargerId: null,
  929. canEditTask: false, // 是否可创建任务的判断标志
  930. canEditStageList: false, //是否可编辑列表的判断标志
  931. groupResponsibleId: '', // 分组负责人的id
  932. groupDetailsShow: false,
  933. groupDetailData: {},
  934. groupDetailTil: '',
  935. setTemplateData: {},
  936. setTemplateDialog: false,
  937. taskListPage: 1,
  938. taskListSize: 20,
  939. taskListTotal: 0,
  940. dynamicTab: true,
  941. dailyList: [],
  942. meetingId: '',
  943. integrationProjectList: [],
  944. sapServiceList:[],
  945. meetingVisable: false,
  946. initiateAMeetingForm: {
  947. startTime: '',
  948. endTime: '',
  949. taskId: ''
  950. },
  951. pmUserList: [],
  952. millerSReviewer: [],
  953. modifyWorkingHoursRow: {},
  954. modifyWorkingHoursList: [],
  955. modifyWorkingHoursListLoading: false,
  956. modifyWorkingHoursRowVisable: false,
  957. allocateDailyWorkingHoursVisable: false,
  958. allocateDailyWorkingHoursLoading: false,
  959. allocateDailyWorkingIndex: 0,
  960. allocateDailyWorkingHoursList: [],
  961. tableSelection: [],
  962. dateDropdownMenuSelection: [],
  963. dateDropdownMenuSelectionVal: '',
  964. startingTimePeriod: '', // 开始时间段
  965. endTimePeriod: '', // 结束时间段
  966. };
  967. },
  968. computed: {
  969. showData() {
  970. // return this.addForm.executorListFront.slice(this.startNum, this.endNum)
  971. let newList = this.addForm.executorListFront
  972. newList.forEach((item, index) => {
  973. item.indexList = index
  974. })
  975. // console.log(newList.slice(this.startNum, this.endNum), '<==== newList')
  976. return newList.slice(this.startNum, this.endNum)
  977. },
  978. containerHeight() {
  979. if(this.addForm.executorListFront.length < this.shownumber) {
  980. return this.sizeNum * this.addForm.executorListFront.length + 'px'
  981. } else {
  982. return (this.sizeNum * this.shownumber) - 20 + 'px'
  983. }
  984. },
  985. barHeight() {
  986. return this.sizeNum * (this.addForm.executorListFront || []).length + 'px'
  987. },
  988. listTop() {
  989. return this.startNum * this.sizeNum + 'px'
  990. },
  991. },
  992. watch: {},
  993. created() {},
  994. mounted() {
  995. console.log('我获取到的数据', this.integrationTask, this.showOrNot)
  996. this.triggerEvent(this.integrationTask)
  997. this.gstimhour = [this.user.timeType.allday]
  998. this.gstimday = [1]
  999. this.getTaskTypeList();
  1000. this.getSapServiceList()
  1001. this.timess();
  1002. if(this.showMmeiLaiDe) {
  1003. this.getPmUserList()
  1004. this.setDisabledPermission()
  1005. }
  1006. this.getRestPeriod()
  1007. },
  1008. methods: {
  1009. allocateDailyWorkingHoursCli(item, index) {
  1010. this.startingTimePeriod = '09:00:00'
  1011. this.endTimePeriod = '17:30:00'
  1012. this.allocateDailyWorkingIndex = index
  1013. this.tableSelection = []
  1014. console.log(item, '<==== allocateDailyWorkingHoursCli')
  1015. this.allocateDailyWorkingHoursList = (item.dailyAllocateList || []).map(item => {
  1016. return {
  1017. ...item,
  1018. uuID: generateUUID()
  1019. }
  1020. })
  1021. this.retrieveMissingDates(item.dailyAllocateList)
  1022. this.allocateDailyWorkingHoursVisable = true
  1023. },
  1024. onTypeChange(e) {
  1025. this.selectType = this.typeList.filter(a=>a.id == e)[0];
  1026. },
  1027. confirmArrangement() {
  1028. const { index, userId, startDate, endDate } = this.modifyWorkingHoursRow
  1029. const userList = (this.addForm.executorListFront || []).filter(item => item.executorId == userId)
  1030. const row = this.addForm.executorListFront[index].executorId
  1031. if(userList.length > 0 && row != userId) {
  1032. this.$message({ message: '执行人已存在', type: "error" });
  1033. return
  1034. }
  1035. const name = this.users.find(item => item.id == userId).name
  1036. this.addForm.executorListFront[index].executorId = userId
  1037. this.addForm.executorListFront[index].executorName = name
  1038. this.addForm.startDate = startDate
  1039. this.addForm.endDate = endDate
  1040. this.modifyWorkingHoursRowVisable = false
  1041. this.$message({ message: '修改成功', type: "success" });
  1042. },
  1043. viewTaskTimeList(executorId, index) {
  1044. this.modifyWorkingHoursRow = { taskId: this.addForm.id, userId: executorId, startDate: this.addForm.startDate, endDate: this.addForm.endDate, index}
  1045. this.modifyWorkingHoursRowVisable = true
  1046. this.getViewTaskTimeList()
  1047. },
  1048. getViewTaskTimeList() {
  1049. this.modifyWorkingHoursListLoading = true
  1050. let obj = { ...this.modifyWorkingHoursRow }
  1051. delete obj.index
  1052. this.http.post('/task/viewUserTaskSchedule', { ...obj },
  1053. res => {
  1054. this.modifyWorkingHoursListLoading = false
  1055. if (res.code == "ok") {
  1056. this.modifyWorkingHoursList = res.data;
  1057. } else {
  1058. this.$message({ message: res.msg, type: "error" });
  1059. }
  1060. },
  1061. error => {
  1062. this.modifyWorkingHoursListLoading = false
  1063. this.$message({ message: error, type: "error" });
  1064. });
  1065. },
  1066. getTaskTypeList() {
  1067. this.http.post('/task-type/list', { companyId: this.user.companyId },
  1068. res => {
  1069. if (res.code == "ok") {
  1070. this.typeList = res.data;
  1071. if (!this.isEditFile) {
  1072. //创建新任务,默认第一个类型
  1073. this.$set(this.addForm,'taskPlanType',this.typeList[0].id);
  1074. this.selectType = this.typeList[0];
  1075. } else {
  1076. //编辑任务,有类型
  1077. const curType = this.integrationTask.task.taskPlanType;
  1078. this.selectType = this.typeList.filter(a=>a.id == curType)[0];
  1079. }
  1080. } else {
  1081. this.$message({ message: res.msg, type: "error" });
  1082. }
  1083. },
  1084. error => {
  1085. this.$message({ message: error, type: "error" });
  1086. });
  1087. },
  1088. planToWithdraw() {
  1089. this.$confirm(`确定撤回该计划吗?`, {
  1090. type: 'warning'
  1091. }).then(() => {
  1092. this.http.post('/task/withdrawalTaskPlan',{taskId: this.addForm.id},
  1093. res => {
  1094. if (res.code == "ok") {
  1095. this.$message({
  1096. message: '撤回成功',
  1097. type: 'success'
  1098. });
  1099. let obj = {
  1100. submitInsert: true,
  1101. showOrNot: this.showOrNot
  1102. }
  1103. this.$emit('closeBounced', obj)
  1104. } else {
  1105. this.$message({
  1106. message: res.msg,
  1107. type: "error"
  1108. });
  1109. }
  1110. },
  1111. error => {
  1112. this.$message({
  1113. message: error,
  1114. type: "error"
  1115. });
  1116. });
  1117. })
  1118. },
  1119. setDisabledPermission() {
  1120. const { taskStatus } = this.showMmeiLaiDeData
  1121. this.doYouWantToDisableAll = taskStatus == 3 || taskStatus == 4
  1122. if(this.millerSReviewer.includes(this.user.id)) {
  1123. this.doYouWantToDisableAll = false
  1124. }
  1125. },
  1126. viewOnline(row) {
  1127. sessionStorage.setItem("fileName",row.documentName);
  1128. sessionStorage.setItem("fileUrl",row.url);
  1129. let routeUrl;
  1130. if (row.documentName.endsWith('.doc') || row.documentName.endsWith('.docx')) {
  1131. routeUrl = this.$router.resolve({
  1132. path: "/viewWord",
  1133. params: {}
  1134. });
  1135. } else if (row.documentName.endsWith('.xls') || row.documentName.endsWith('.xlsx')) {
  1136. routeUrl = this.$router.resolve({
  1137. path: "/viewExcel",
  1138. params: {}
  1139. });
  1140. }
  1141. if (routeUrl != null) {
  1142. console.log(routeUrl.href);
  1143. window.open(routeUrl.href, '_blank');
  1144. } else {
  1145. window.open(row.url, '_blank');
  1146. }
  1147. },
  1148. // 容器的滚动事件
  1149. handleScroll() {
  1150. const scrollTop = this.$refs.container.scrollTop
  1151. this.startNum = Math.floor(scrollTop / this.sizeNum)
  1152. console.log(this.startNum, this.shownumber, '<==== 计算')
  1153. this.endNum = this.startNum + this.shownumber
  1154. },
  1155. bottomScrollClick(val) {
  1156. this.$nextTick(() => {
  1157. let scrollEl = this.$refs.container;
  1158. let bum = scrollEl.scrollHeight
  1159. let current = scrollEl.scrollTop + 1
  1160. scrollEl.scrollTo({ top: val ? current : bum, behavior: 'smooth' });
  1161. });
  1162. },
  1163. // 刷新数据
  1164. refreshData() {
  1165. this.$forceUpdate()
  1166. },
  1167. serviceIdChange() {
  1168. this.refreshData()
  1169. },
  1170. confirmMeeting() {
  1171. this.http.post('/task/operateMeeting',{...this.initiateAMeetingForm},
  1172. res => {
  1173. if (res.code == "ok") {
  1174. this.meetingVisable=false,
  1175. this.$message({
  1176. message: this.$t('chengGongFaQiHuiYi'),
  1177. type: "success"
  1178. });
  1179. } else {
  1180. this.meetingVisable=false,
  1181. this.$message({
  1182. message: res.msg,
  1183. type: "error"
  1184. });
  1185. }
  1186. },
  1187. error => {
  1188. this.meetingVisable=false,
  1189. this.$message({
  1190. message: error,
  1191. type: "error"
  1192. });
  1193. });
  1194. },
  1195. planOperation(type) {
  1196. this.$confirm(`确定${type ? '通过' : '驳回'}该计划吗?`, {
  1197. type: 'warning'
  1198. }).then(() => {
  1199. this.http.post('/task/taskPlanPassOrReject', {
  1200. taskId: this.addForm.id, type
  1201. },
  1202. res => {
  1203. if (res.code == "ok") {
  1204. this.$message({
  1205. message: '操作成功',
  1206. type: "success"
  1207. });
  1208. let obj = {
  1209. submitInsert: true,
  1210. showOrNot: this.showOrNot
  1211. }
  1212. this.$emit('closeBounced', obj)
  1213. } else {
  1214. this.$message({
  1215. message: res.msg,
  1216. type: "error"
  1217. });
  1218. }
  1219. },
  1220. error => {
  1221. this.$message({
  1222. message: error,
  1223. type: "error"
  1224. });
  1225. });
  1226. })
  1227. },
  1228. // 触发外层的会议
  1229. meetingCli() {
  1230. // this.$parent.$parent.parentMeetingCli(this.integrationTask.id)
  1231. this.initiateAMeetingForm = {
  1232. startTime: '',
  1233. endTime: '',
  1234. taskId: this.integrationTask.id
  1235. }
  1236. this.meetingVisable = true
  1237. },
  1238. // 触发事件
  1239. triggerEvent(obj) {
  1240. console.log(obj, '触发事件')
  1241. this.curProjectId = obj.curProjectId
  1242. this.getProjectListTwo()
  1243. if(!obj.taskVue) {
  1244. this.getStageList(obj.integrationTaskNingwai)
  1245. }
  1246. if(obj.create) {
  1247. console.log(obj, '<=== 双击获取的')
  1248. this.getUsers(); // 获取名单数据
  1249. this.mileageCup = false
  1250. this.addFormVisible = true;
  1251. this.curProjectId = obj.stage.projectId;
  1252. const startDates = obj.addForm.startDate ? obj.addForm.startDate + ' 09:00:00' : ''
  1253. this.addForm = {
  1254. projectId: obj.stage.projectId,
  1255. groupId: obj.stage.groupId,
  1256. stagesId: obj.stage.id,
  1257. startDate: startDates,
  1258. taskLevel:0,
  1259. planHours: 8,
  1260. taskType: 0,
  1261. plannedDays: 0,
  1262. planHours: 0
  1263. };
  1264. // this.addForm.executorListFront = [
  1265. // {executorId:obj.executorListFront[0] && obj.executorListFront[0].executorId, planHours:this.user.timeType.allday}
  1266. // ];
  1267. this.addForm.executorListFront = (obj.executorListFront || []).map(em => {
  1268. return {
  1269. executorId: em.executorId,
  1270. planHours: this.user.timeType.allday,
  1271. dailyAllocateList: []
  1272. }
  1273. })
  1274. this.gstimhour = [this.user.timeType.allday]
  1275. this.gstimday = [1]
  1276. this.addLoading = false;
  1277. this.isEditFile = false;
  1278. this.title=this.$t('createtask ');
  1279. this.commentList = [];
  1280. this.timelabel = false
  1281. console.log(this.addForm, '<====== this.addForm')
  1282. } else {
  1283. console.log('1111',obj)
  1284. if(!obj.taskVue) {
  1285. this.isEditFile = true;
  1286. this.getDetail(obj.curProjectId)
  1287. }
  1288. this.curProjectId = obj.task.projectId;
  1289. // this.getTaskDetail(obj.id);
  1290. this.getTaskProgressList(obj.id); // 获取任务进展列表
  1291. this.gain(obj.task); // 获取评论列表
  1292. this.getDailyList(obj.id) // 获取来自日报
  1293. this.getRelationTaskList(obj.num, obj.id)
  1294. this.getTaskFileList(obj.num,obj.id)
  1295. const { integrationTaskNingwai = {} } = obj
  1296. if(integrationTaskNingwai.groupId) {
  1297. this.getTaskGrouping(obj.curProjectId)
  1298. }
  1299. setTimeout(() => {
  1300. this.getTaskDetail(obj.id);
  1301. }, 200)
  1302. }
  1303. this.getrelation();
  1304. },
  1305. // 代办任务创建事件
  1306. agentCreatesEvents(num) {
  1307. if(num == 1) {
  1308. this.addForm.groupId = ''
  1309. this.addForm.stagesId = ''
  1310. this.getTaskGrouping()
  1311. this.getrelation();
  1312. this.getDegreeList();
  1313. if(this.showMmeiLaiDe) {
  1314. this.getProjectManager()
  1315. }
  1316. this.getUsers();
  1317. } else if(num == 2) {
  1318. this.addForm.stagesId = ''
  1319. this.getTaskList()
  1320. }
  1321. },
  1322. // 获取维度数据
  1323. getDegreeList() {
  1324. if(this.addForm.projectId == '') {
  1325. return
  1326. }
  1327. this.http.post('/project/getDegreeList',{
  1328. projectId: this.addForm.projectId,
  1329. },
  1330. res => {
  1331. if (res.code == "ok") {
  1332. this.degreeList = res.data;
  1333. this.$forceUpdate();
  1334. }
  1335. },
  1336. error => {
  1337. this.$message({
  1338. message: error,
  1339. type: "error"
  1340. });
  1341. }
  1342. );
  1343. },
  1344. getProjectManager() {
  1345. const { projectId } = this.addForm
  1346. this.http.post('/user/getChargeUserByProjectId', { projectId },
  1347. res => {
  1348. if (res.code == "ok") {
  1349. if(!res.data.id) {
  1350. this.$message({
  1351. message: '当前项目没有项目经理',
  1352. type: "warning"
  1353. });
  1354. return
  1355. }
  1356. this.addForm.checkFirstId = res.data.id || '';
  1357. } else {
  1358. this.$message({
  1359. message: res.msg,
  1360. type: "error"
  1361. });
  1362. }
  1363. },
  1364. error => {
  1365. this.$message({
  1366. message: error,
  1367. type: "error"
  1368. });
  1369. });
  1370. },
  1371. getPmUserList() {
  1372. this.http.post('/user/getSecondCheckUser', { },
  1373. res => {
  1374. if (res.code == "ok") {
  1375. this.pmUserList = res.data || [];
  1376. } else {
  1377. this.$message({
  1378. message: res.msg,
  1379. type: "error"
  1380. });
  1381. }
  1382. },
  1383. error => {
  1384. this.$message({
  1385. message: error,
  1386. type: "error"
  1387. });
  1388. });
  1389. },
  1390. //获取项目列表
  1391. getProjectList() {
  1392. this.http.post(this.port.project.list, {},
  1393. res => {
  1394. if (res.code == "ok") {
  1395. this.projectList = res.data;
  1396. this.getRecentlyProject()
  1397. } else {
  1398. this.$message({
  1399. message: res.msg,
  1400. type: "error"
  1401. });
  1402. }
  1403. },
  1404. error => {
  1405. this.$message({
  1406. message: error,
  1407. type: "error"
  1408. });
  1409. });
  1410. },
  1411. getProjectListTwo() {
  1412. let obj = {}
  1413. if(this.curProjectId) {
  1414. obj.projectId = this.curProjectId
  1415. }
  1416. this.http.post(`/project/getProjectByLeader`, {
  1417. ...obj
  1418. },
  1419. res => {
  1420. if (res.code == "ok") {
  1421. this.projectList = res.data;
  1422. this.integrationProjectList = [
  1423. { label: '相关项目', peojectList: res.data }
  1424. ]
  1425. } else {
  1426. this.$message({
  1427. message: res.msg,
  1428. type: "error"
  1429. });
  1430. }
  1431. },
  1432. error => {
  1433. this.$message({
  1434. message: error,
  1435. type: "error"
  1436. });
  1437. });
  1438. },
  1439. // 获取最近项目列表
  1440. getRecentlyProject() {
  1441. this.http.post('/project/nearProject',{},res => {
  1442. if(res.code == 'ok'){
  1443. let topObj = {
  1444. label: this.$t('zuiJinXuanZeXiangMu'),
  1445. peojectList: res.data
  1446. }
  1447. let botomObj = {
  1448. label: this.$t('other.allProject'),
  1449. peojectList: this.projectList
  1450. }
  1451. this.integrationProjectList = [topObj, botomObj]
  1452. console.log(this.integrationProjectList, '整合')
  1453. }else {
  1454. this.$message({
  1455. message: res.msg,
  1456. type: 'error'
  1457. })
  1458. }
  1459. },err => {
  1460. this.$message({
  1461. message: err,
  1462. type: 'error'
  1463. })
  1464. })
  1465. },
  1466. // 获取任务分组
  1467. getTaskGrouping(projectId) {
  1468. this.http.post('/task-group/list', {projectId: projectId ? projectId : this.addForm.projectId},
  1469. res => {
  1470. if (res.code == "ok") {
  1471. this.groupList = res.data;
  1472. } else {
  1473. this.$message({
  1474. message: res.msg,
  1475. type: "error"
  1476. });
  1477. }
  1478. },
  1479. error => {
  1480. this.$message({
  1481. message: error,
  1482. type: "error"
  1483. });
  1484. });
  1485. },
  1486. getTaskList() {
  1487. let obj = {
  1488. groupId: this.addForm.groupId,
  1489. projectId: this.addForm.projectId,
  1490. order: 'seq',
  1491. isDesc: false
  1492. }
  1493. this.getStageList(obj)
  1494. },
  1495. // 关闭最外层弹窗
  1496. closeBounceds() {
  1497. console.log('我被触发了')
  1498. this.$emit('closeBounced', {})
  1499. },
  1500. chggstim(e,i){
  1501. if(e){
  1502. this.gstimday[i] = Math.ceil(this.gstimhour[i] / this.user.timeType.allday)
  1503. }else{
  1504. this.gstimhour[i] = this.gstimday[i] * this.user.timeType.allday
  1505. }
  1506. },
  1507. removeExecutorLine(index,e) {
  1508. if(e == 1){
  1509. this.relationItemData.executorList.splice(index,1);
  1510. this.gstimday.splice(index,1)
  1511. this.gstimhour.splice(index,1)
  1512. this.$forceUpdate();
  1513. }else{
  1514. this.addForm.executorListFront.splice(index,1);
  1515. this.gstimday.splice(index,1)
  1516. this.gstimhour.splice(index,1)
  1517. this.$forceUpdate();
  1518. }
  1519. },
  1520. removeExecutorLineNew(item, e) {
  1521. let index = item.indexList
  1522. if(e == 1){
  1523. this.relationItemData.executorList.splice(index,1);
  1524. this.gstimday.splice(index,1)
  1525. this.gstimhour.splice(index,1)
  1526. this.$forceUpdate();
  1527. }else{
  1528. this.addForm.executorListFront.splice(index,1);
  1529. this.gstimday.splice(index,1)
  1530. this.gstimhour.splice(index,1)
  1531. this.$forceUpdate();
  1532. }
  1533. this.replacementResult()
  1534. setTimeout(() => {
  1535. this.bottomScrollClick(true)
  1536. }, 100)
  1537. },
  1538. addExecutorLine(e) {
  1539. if(e == 1){
  1540. if (this.relationItemData.executorList == null) {
  1541. this.relationItemData.executorList = [];//初始化
  1542. }
  1543. this.relationItemData.executorList.push({
  1544. executorId:null, planHours: this.addForm.planHours || this.user.timeType.allday,
  1545. dailyAllocateList: this.setDateDataBasedOnTime()
  1546. });
  1547. this.gstimday.push(1)
  1548. this.gstimhour.push(this.user.timeType.allday)
  1549. this.$forceUpdate();
  1550. }else{
  1551. if (this.addForm.executorListFront == null) {
  1552. this.addForm.executorListFront = [];//初始化
  1553. }
  1554. this.addForm.executorListFront.push({
  1555. executorId:null, planHours: this.addForm.planHours || this.user.timeType.allday,
  1556. dailyAllocateList: this.setDateDataBasedOnTime()
  1557. });
  1558. this.gstimday.push(1)
  1559. this.gstimhour.push(this.user.timeType.allday)
  1560. this.$forceUpdate();
  1561. this.replacementResult()
  1562. setTimeout(() => {
  1563. this.bottomScrollClick()
  1564. }, 100)
  1565. }
  1566. },
  1567. replacementResult() {
  1568. let lengths = (this.addForm.executorListFront || []).length
  1569. if(lengths > this.shownumber) {
  1570. this.startNum = lengths - this.shownumber
  1571. this.endNum = lengths
  1572. } else {
  1573. this.startNum = 0
  1574. this.endNum = lengths
  1575. }
  1576. this.sizeNum = typeof this.sizeNum == 'number' ? this.sizeNum+'' : +this.sizeNum
  1577. },
  1578. getTaskDetail(id) {
  1579. this.http.post('/task/getTask',{id: id},
  1580. res => {
  1581. if (res.code == "ok") {
  1582. this.millerSReviewer = [res.data.checkFirstId, res.data.checkSecondId]
  1583. if(this.showMmeiLaiDe) {
  1584. this.setDisabledPermission()
  1585. }
  1586. this.meetingId = res.data.meetingId
  1587. this.addForm = res.data;
  1588. if (this.addForm.aheadTid) {
  1589. this.addForm.aheadTidList = JSON.parse(this.addForm.aheadTid);
  1590. } else {
  1591. this.addForm.aheadTidList = [];
  1592. }
  1593. this.selectType = {id:this.addForm.taskPlanType, needAudit: this.addForm.needAudit};
  1594. this.addForm.createDate = null;
  1595. this.addForm.indate = null;
  1596. this.addLoading = false;
  1597. this.canEditTask = res.data.canEditTask
  1598. this.recentProgressInfo = res.data.progress;
  1599. if(res.data.executorList.length > 0) {
  1600. for(var i in res.data.executorList){
  1601. if(res.data.executorList[i].serviceId) {
  1602. res.data.executorList[i].serviceId = JSON.parse(res.data.executorList[i].serviceId)
  1603. }
  1604. }
  1605. console.log("==================",res.data.executorList)
  1606. this.addForm.executorListFront = res.data.executorList;
  1607. } else {
  1608. this.addForm.executorListFront = [{executorId: null, planHours: 8}];
  1609. }
  1610. this.gstimday = []
  1611. this.gstimhour = []
  1612. for(let i=0;i<this.addForm.executorListFront.length;i++){
  1613. this.gstimhour.push(this.addForm.executorListFront[i].planHours)
  1614. this.gstimday.push(Math.ceil(this.addForm.executorListFront[i].planHours / this.user.timeType.allday))
  1615. }
  1616. console.log(this.gstimday, this.gstimhour)
  1617. // //删除中间传值的变量数组
  1618. delete this.addForm.executorList;
  1619. //人员处理
  1620. this.users = res.data.userList;
  1621. // 触发类型切换事件
  1622. this.selchg()
  1623. //加载研究中心
  1624. this.degreeList = res.data.degreeList;
  1625. // this.$set(this.addForm,'centerId', this.addForm.centerId);
  1626. } else {
  1627. this.$message({
  1628. message: res.msg,
  1629. type: "error"
  1630. });
  1631. }
  1632. },
  1633. error => {
  1634. this.$message({
  1635. message: error,
  1636. type: "error"
  1637. });
  1638. });
  1639. },
  1640. //获取任务进展列表
  1641. getTaskProgressList(taskId) {
  1642. this.taskIid = taskId
  1643. this.http.post('/task-progress/list', {taskId: taskId},
  1644. res => {
  1645. if (res.code == "ok") {
  1646. this.ProgressList = res.data;
  1647. this.recentProgressInfo = res.data[0]
  1648. } else {
  1649. this.$message({
  1650. message: res.msg,
  1651. type: "error"
  1652. });
  1653. }
  1654. }
  1655. );
  1656. },
  1657. getUsers() {
  1658. this.http.post('/participation/getByProjectId', {projectId: this.addForm.projectId},
  1659. res => {
  1660. if (res.code == "ok") {
  1661. this.users = res.data;
  1662. } else {
  1663. this.$message({
  1664. message: res.msg,
  1665. type: "error"
  1666. });
  1667. }
  1668. },
  1669. error => {
  1670. this.$message({
  1671. message: error,
  1672. type: "error"
  1673. });
  1674. });
  1675. },
  1676. // 获取评论列表
  1677. gain(task,e) {
  1678. this.commentList = [];
  1679. this.taskId = e == 1 ? task.taskId : task.id;
  1680. this.http.post('/task-comment/getList', {taskId: e == 1 ? task.taskId : task.id},
  1681. res => {
  1682. if (res.code == "ok") {
  1683. if(this.user.userNameNeedTranslate == 1) {
  1684. for (let i = 0; i < res.data.length; i++) {
  1685. const originalString = res.data[i].content;
  1686. const regex = /\$userName=[^$]*\$|[^$]+/g;
  1687. const parts = originalString.match(regex);
  1688. let newArrList = [];
  1689. for (let j = 0; j < parts.length; j++) {
  1690. const newStr = parts[j];
  1691. if (newStr.startsWith('$userName=')) {
  1692. const userName = newStr.slice(10, -1);
  1693. newArrList.push({ type: 'user', value: userName });
  1694. } else {
  1695. newArrList.push({ type: 'text', value: newStr });
  1696. }
  1697. }
  1698. res.data[i].newContent = newArrList;
  1699. }
  1700. }
  1701. this.commentList = res.data
  1702. this.sppk(this.commentList) // 获取参与人的方法
  1703. this.contRoll()
  1704. } else {
  1705. this.$message({
  1706. message: res.msg,
  1707. type: "error"
  1708. });
  1709. }
  1710. },
  1711. error => {
  1712. this.$message({
  1713. message: error,
  1714. type: "error"
  1715. });
  1716. });
  1717. },
  1718. // 获取评论参与人
  1719. sppk(comit) {
  1720. var sk = []
  1721. comit.forEach(function(e){
  1722. sk.push(e.userName)
  1723. })
  1724. this.critic = new Set(sk)
  1725. },
  1726. getRelationTaskList(i,e){ //获取关联任务列表
  1727. let eid = null
  1728. if(i){
  1729. eid = e
  1730. }else{
  1731. eid = this.addForm.id
  1732. }
  1733. this.http.post('/task/getMilestoneTaskList',{
  1734. milestoneId: eid
  1735. },res => {
  1736. if(res.code == 'ok') {
  1737. this.relationSubTaskList = res.data
  1738. // console.log('res',res.data);
  1739. }else {
  1740. this.$message({
  1741. message: res.msg,
  1742. type: 'error'
  1743. })
  1744. }
  1745. },error => {
  1746. this.$message({
  1747. message: error,
  1748. type: 'error'
  1749. })
  1750. })
  1751. },
  1752. // 获取来自日报
  1753. getDailyList(id) {
  1754. this.http.post('/report/getTaskReportList',{
  1755. // taskId: '22131'
  1756. taskId: id
  1757. },
  1758. res => {
  1759. if (res.code == "ok") {
  1760. this.dailyList = res.data
  1761. } else {
  1762. this.$message({
  1763. message: res.msg,
  1764. type: "error"
  1765. });
  1766. }
  1767. },
  1768. error => {
  1769. this.$message({
  1770. message: error,
  1771. type: "error"
  1772. });
  1773. });
  1774. },
  1775. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  1776. const { timeType } = this.user
  1777. if (columnIndex === 6 && timeType.taskFileCharge == 1) {
  1778. return [this.taskFileList.length, 1];
  1779. }
  1780. return [1, 1];
  1781. },
  1782. // 获取任务下的文档列表
  1783. getTaskFileList(e,eid){
  1784. let etaskId
  1785. if(e == 1){etaskId = eid}
  1786. else{etaskId = this.addForm.id}
  1787. this.fileListLoading = true
  1788. this.http.post('/task-files/getTaskFiles',{
  1789. taskId: etaskId
  1790. },res => {
  1791. if(res.code == 'ok'){
  1792. this.fileListLoading = false
  1793. this.taskFileList = res.data.map(item => {
  1794. let str = item.fileChargeStatusText || ''
  1795. let arr = str.split(/\$|=/).filter(item => item && item !== 'userName');
  1796. return {
  1797. ...item,
  1798. fileChargeStatusTextList: arr || []
  1799. }
  1800. })
  1801. console.log(this.taskFileList, '<+======this.taskFileList')
  1802. }else {
  1803. this.fileListLoading = false
  1804. this.$message({
  1805. message: res.msg,
  1806. type: 'error'
  1807. })
  1808. }
  1809. },error => {
  1810. this.fileListLoading = false
  1811. this.$message({
  1812. message: error,
  1813. type: 'error'
  1814. })
  1815. })
  1816. },
  1817. DateChange(){
  1818. const { startDate, endDate } = this.addForm
  1819. if(startDate && endDate){
  1820. const listData = this.setDateDataBasedOnTime()
  1821. const totalHours = listData.reduce((sum, item) => sum + item.workHour, 0);
  1822. const start = this.dayjs(startDate)
  1823. const end = this.dayjs(endDate)
  1824. const diffInDays = end.diff(start, 'hour') / 24
  1825. const result = Math.ceil(diffInDays)
  1826. this.addForm.plannedDays = result
  1827. this.addForm.planHours = totalHours
  1828. for(let i in (this.addForm.executorListFront || [])) {
  1829. this.addForm.executorListFront[i].planHours = totalHours
  1830. this.addForm.executorListFront[i].dailyAllocateList = listData
  1831. }
  1832. console.log(startDate, endDate)
  1833. console.log(this.addForm)
  1834. }
  1835. },
  1836. // 自定义组件事件
  1837. selectCal(obj) {
  1838. if(obj.distinction == '1') {
  1839. this.addForm.executorListFront[obj.index].executorId = obj.id
  1840. } else if(obj.distinction == '2') {
  1841. this.groupForm.inchargerId = obj.id
  1842. } else if(obj.distinction == '101') {
  1843. this.addForm.executorListFront[obj.index].fileChargeOneId = obj.id
  1844. } else if(obj.distinction == '102') {
  1845. this.addForm.executorListFront[obj.index].fileChargeTwoId = obj.id
  1846. }
  1847. },
  1848. getDetail(id) {
  1849. this.http.post('/project/detail',{
  1850. id: id
  1851. },
  1852. res => {
  1853. if (res.code == "ok") {
  1854. console.log('触发更新试一下')
  1855. this.currentProject = res.data;
  1856. this.getjurisdictionIds(this.currentProject)
  1857. this.joinMembList = this.currentProject.participationList;
  1858. } else {
  1859. }
  1860. },
  1861. error => {
  1862. this.$message({
  1863. message: error,
  1864. type: "error"
  1865. });
  1866. }
  1867. );
  1868. },
  1869. getjurisdictionIds(pro){
  1870. console.log('pro',pro.creatorId);
  1871. this.projectCreatorId = pro.creatorId
  1872. this.projectInchargerId = pro.inchargerId
  1873. },
  1874. //加载项目内的任务列表
  1875. getStageList(obj) {
  1876. this.http.post('/stages/list', {
  1877. groupId: obj.groupId,
  1878. projectId: obj.projectId,
  1879. order: obj.order,
  1880. isDesc: obj.isDesc
  1881. },
  1882. res => {
  1883. if (res.code == "ok") {
  1884. this.stageList = res.data.list;
  1885. this.canEditTask = res.data.canEditTask
  1886. this.canEditStageList = res.data.canEditStageList
  1887. this.timess() // 处理时间的方法
  1888. } else {
  1889. this.$message({
  1890. message: res.msg,
  1891. type: "error"
  1892. });
  1893. }
  1894. },
  1895. error => {
  1896. this.$message({
  1897. message: error,
  1898. type: "error"
  1899. });
  1900. });
  1901. },
  1902. timess(){
  1903. // console.log('timess');
  1904. var date = new Date()
  1905. let Y = date.getFullYear()
  1906. let M = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : (date.getMonth() + 1)
  1907. let D = date.getDate() < 10 ? ('0' + date.getDate()) : date.getDate()
  1908. this.times = `${Y}-${M}-${D}`
  1909. console.log(this.times, '时间')
  1910. },
  1911. // 提交按钮
  1912. submitInsert() {
  1913. if (this.textContent !== true) return this.$message({
  1914. showClose: true,
  1915. message: this.$t('pictureistoolargepleaseuploaditagain'),
  1916. type: 'warning'
  1917. });
  1918. //检查是有重名的执行人
  1919. var exeList = this.addForm.executorListFront;
  1920. console.log(this.addForm.executorListFront)
  1921. for (var i=0;i<exeList.length;i++) {
  1922. var findSameUser = false;
  1923. for (var j=i+1;j<exeList.length; j++) {
  1924. if (exeList[i].executorId && exeList[j].executorId && exeList[i].executorId == exeList[j].executorId) {
  1925. findSameUser = true;
  1926. break;
  1927. }
  1928. }
  1929. if (findSameUser) {
  1930. return this.$message({
  1931. showClose: true,
  1932. message: this.$t('executorhasduplication'),
  1933. type: 'error'
  1934. });
  1935. }
  1936. }
  1937. if(this.addForm.startDate && this.addForm.endDate) {
  1938. if(this.addForm.endDate < this.addForm.startDate) {
  1939. return this.$message({
  1940. showClose: true,
  1941. message: this.$t('ren-wu-jie-zhi-shi-jian-bu-neng-xiao-yu-kai-shi-shi-jian'),
  1942. type: 'error'
  1943. });
  1944. }
  1945. }
  1946. if(this.showMmeiLaiDe && !this.addForm.endDate) {
  1947. return this.$message({
  1948. showClose: true,
  1949. message: '请选择截止时间',
  1950. type: 'warning'
  1951. });
  1952. }
  1953. this.$refs.form1.validate(valid => {
  1954. if (valid) {
  1955. delete this.addForm.subTaskList;
  1956. delete this.addForm.refTaskList;
  1957. delete this.addForm.progress;
  1958. delete this.addForm.userList;
  1959. let executorListFrontExtraList = JSON.parse(JSON.stringify(this.addForm.executorListFront))
  1960. console.log(JSON.parse(JSON.stringify(this.addForm)) , '<==== this.addForm')
  1961. // 针对执行人的分配工时配置值
  1962. for(let userIndex in this.addForm.executorListFront) {
  1963. const executeList = this.addForm.executorListFront[userIndex].dailyAllocateList
  1964. const list = executeList.map(item => {
  1965. const { startTime, endTime, workHour, overWorkHour, allocateDate, id } = item
  1966. return {
  1967. id: id || '',
  1968. startTime, endTime, workHour, overWorkHour, allocateDate,
  1969. taskId: this.addForm.id,
  1970. userId: this.addForm.executorListFront[userIndex].executorId
  1971. }
  1972. })
  1973. executorListFrontExtraList[userIndex].dailyAllocateListStr = JSON.stringify(list)
  1974. delete executorListFrontExtraList[userIndex].dailyAllocateList
  1975. }
  1976. //去掉没有执行人的.(因为要有计划工时,执行人可以暂不设置)
  1977. // this.addForm.executorListFront = this.addForm.executorListFront.filter(exe=>exe.executorId);
  1978. if(this.addForm.executorListFront.serviceId){
  1979. this.addForm.executorListFront.serviceId= this.addForm.executorListFront.serviceId;
  1980. }
  1981. // this.addForm.executorListStr = JSON.stringify(this.addForm.executorListFront);
  1982. // this.addForm.executorList = this.addForm.aheadTidList;
  1983. this.addForm.aheadTid = JSON.stringify(this.addForm.aheadTidList);
  1984. if (this.addForm.centerId) {
  1985. this.addForm.centerName = this.degreeList.filter(a=>a.id == this.addForm.centerId)[0].name;
  1986. }
  1987. let addFormData = {
  1988. ...this.addForm,
  1989. executorListFront: executorListFrontExtraList,
  1990. executorListStr: JSON.stringify(executorListFrontExtraList)
  1991. }
  1992. //不需要审核,简化字段
  1993. if(!this.selectType.needAudit) {
  1994. addFormData = {
  1995. id: this.addForm.id,
  1996. name: this.addForm.name,
  1997. taskPlanType: this.addForm.taskPlanType,
  1998. startDate: this.addForm.startDate,
  1999. endDate: this.addForm.endDate,
  2000. executorListFront: executorListFrontExtraList,
  2001. executorListStr: JSON.stringify(executorListFrontExtraList)
  2002. // executorListStr: this.addForm.executorListStr
  2003. }
  2004. }
  2005. console.log({ ...addFormData, isTaskPlan: this.showMmeiLaiDe ? 1 : 0}, '<==== 将要提交的数据')
  2006. this.addLoading = true;
  2007. this.http.post('/task/save',{ ...addFormData, isTaskPlan: this.showMmeiLaiDe ? 1 : 0},
  2008. res => {
  2009. this.addLoading = false;
  2010. if (res.code == "ok") {
  2011. this.$message({
  2012. message: this.$t('message.submittedSuccessfully'),
  2013. type: "success"
  2014. });
  2015. if (this.addForm.parentTid == null) {
  2016. let obj = {
  2017. submitInsert: true,
  2018. showOrNot: this.showOrNot
  2019. }
  2020. // if(!addFormData.id) {
  2021. // obj.dateList = [addFormData.startDate, addFormData.endDate]
  2022. // }
  2023. if(!addFormData.id) {
  2024. localStorage.setItem('ganttChartTaskId', JSON.stringify(res.data || []))
  2025. }
  2026. this.$emit('closeBounced', obj)
  2027. } else {
  2028. // this.backToParentTask();
  2029. // if(!addFormData.id) {
  2030. // this.$emit('closeBounced', {
  2031. // backToParentTaskSub: true,
  2032. // dateList: [addFormData.startDate, addFormData.endDate]
  2033. // })
  2034. // } else {
  2035. if(!addFormData.id) {
  2036. localStorage.setItem('ganttChartTaskId', JSON.stringify(res.data || []))
  2037. }
  2038. this.$emit('closeBounced', {backToParentTaskSub: true})
  2039. // }
  2040. }
  2041. } else {
  2042. this.$message({
  2043. message: res.msg,
  2044. type: "error"
  2045. });
  2046. }
  2047. },
  2048. error => {
  2049. this.$message({
  2050. message: error,
  2051. type: "error"
  2052. });
  2053. }
  2054. );
  2055. }
  2056. });
  2057. },
  2058. backToParentTask() {
  2059. this.getTaskDetail(this.timelabel ? this.relationPar.id : this.addForm.parentTid);
  2060. this.isEditFile = true;
  2061. if(this.timelabel){
  2062. this.isRelationItem = false
  2063. this.getRelationTaskList(1, this.relationPar.id)
  2064. this.gain(this.relationPar)
  2065. }
  2066. },
  2067. onEditorFocus() {
  2068. this.onEditorBlur()
  2069. },
  2070. // 获得焦点时触发
  2071. onEditorBlur(){
  2072. let theEle = this.$refs.text; // 获取元素
  2073. if(!theEle.value) {
  2074. return
  2075. }
  2076. var img = theEle.value.match(/<img[^>]+>/g); // 赛选 img 标签
  2077. var arrImg = ''
  2078. for (var j = 0; j < img.length; j++) {
  2079. // 正则匹配,摘出img标签下的src里的内容,即capture
  2080. img[j].replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, function(match, capture) {
  2081. arrImg += capture
  2082. });
  2083. }
  2084. // 原来的字符流大小,单位为字节
  2085. var strLen = arrImg.length;
  2086. // 计算后得到的文件流大小,单位为字节
  2087. var fileSize=parseInt(strLen-(strLen/8)*2);
  2088. var size = "";
  2089. size = (fileSize/1024/1024).toFixed(2);
  2090. if (size > 2){
  2091. this.textContent = false
  2092. this.$message({
  2093. showClose: true,
  2094. message: this.$t('imageexceeds2MBpleaseuploaditagain'),
  2095. type: 'warning'
  2096. });
  2097. }
  2098. this.textContent = true
  2099. },
  2100. //删除当前编辑的任务
  2101. deleteTask() {
  2102. var warning='';
  2103. if (this.addForm.subTaskList.length > 0) {
  2104. warning=this.$t('currenttaskanditssubtasks');
  2105. } else {
  2106. warning=this.$t('wanttodeletethecurrent task');
  2107. }
  2108. this.$confirm(warning, this.$t('other.prompts'), {
  2109. //type: 'warning'
  2110. }).then(() => {
  2111. this.http.post('/task/delete',{id: this.addForm.id},
  2112. res => {
  2113. if (res.code == "ok") {
  2114. this.$message({
  2115. message: '删除成功',
  2116. type: 'success'
  2117. });
  2118. this.$emit('closeBounced', {deleteTask: true})
  2119. } else {
  2120. this.$message({
  2121. message: res.msg,
  2122. type: "error"
  2123. });
  2124. }
  2125. },
  2126. error => {
  2127. this.$message({
  2128. message: error,
  2129. type: "error"
  2130. });
  2131. });
  2132. });
  2133. },
  2134. addprogress(){ // 添加子任务进展事件
  2135. this.$refs.proBox.style.display="block"
  2136. this.$refs.addPro.style.display="none"
  2137. },
  2138. shutPro() { // 关闭任务进展
  2139. this.$refs.addPro.style.display="block"
  2140. this.$refs.addRem.style.display="none"
  2141. this.$refs.proBox.style.display="none"
  2142. },
  2143. //创建任务进展
  2144. addTaskProgress() {
  2145. var param = {
  2146. taskId: this.taskIid,
  2147. status: this.radio,
  2148. content: this.text2,
  2149. participatorIds: this.checkLists.toString()
  2150. };
  2151. this.http.post('/task-progress/addProgress', param,
  2152. res => {
  2153. if (res.code == "ok") {
  2154. this.shutPro()
  2155. this.getTaskProgressList(this.taskIid)
  2156. this.$message({
  2157. message: this.$t('releasesuccess'),
  2158. type: "success"
  2159. });
  2160. this.checkboxGrounp = [],
  2161. this.checkLists = [],
  2162. this.text2 = '',
  2163. this.radio = 0
  2164. let obj = {
  2165. id: this.taskIid
  2166. }
  2167. this.gain(obj)
  2168. } else {
  2169. this.$message({
  2170. message: res.msg,
  2171. type: "error"
  2172. });
  2173. }
  2174. }
  2175. );
  2176. },
  2177. addI() { // 打开选择查看
  2178. this.$refs.addRem.style.display="block"
  2179. },
  2180. selchg(){ //类型切换
  2181. if(this.addForm.taskType == 1){
  2182. this.timelabel = true
  2183. if(!this.addForm.executorListFront[0].executorId) {
  2184. console.log(this.currentProject)
  2185. this.addForm.executorListFront[0].executorId = this.currentProject.inchargerId
  2186. }
  2187. }else{
  2188. this.timelabel = false
  2189. }
  2190. },
  2191. kkk(el){
  2192. var k = this.checkLists.indexOf(el.id)
  2193. if (k == -1) {
  2194. this.checkLists.push(el.id)
  2195. } else {
  2196. this.checkLists.splice(k, 1)
  2197. }
  2198. },
  2199. //删除任务进展
  2200. deleteTaskProgress(id) {
  2201. this.http.post('/task-progress/deleteProgress', {id: id},
  2202. res => {
  2203. if (res.code == "ok") {
  2204. this.getTaskProgressList(this.taskIid)
  2205. this.$message({
  2206. message: this.$t('message.successfullyDeleted'),
  2207. type: "success"
  2208. });
  2209. } else {
  2210. this.$message({
  2211. message: res.msg,
  2212. type: "error"
  2213. });
  2214. }
  2215. }
  2216. );
  2217. },
  2218. addRelation(){ //关联任务卡片
  2219. this.relationvalue = []
  2220. this.isRelationTab = true
  2221. this.getrelation()
  2222. },
  2223. getrelation(){
  2224. //获取选择关联列表
  2225. this.http.post('/task/getTaskOnlyList',{
  2226. projectId: this.curProjectId?this.curProjectId:this.addForm.projectId
  2227. },
  2228. res => {
  2229. if (res.code == "ok") {
  2230. this.relationdata = []
  2231. res.data.forEach( (item) =>{
  2232. if(item.taskType != 1){
  2233. if (item.id != this.addForm.id) {
  2234. this.relationdata.push(item)
  2235. }
  2236. }
  2237. })
  2238. // console.log('map',this.relationdata);
  2239. } else {
  2240. this.$message({
  2241. message: res.msg,
  2242. type: "error"
  2243. });
  2244. }
  2245. },
  2246. error => {
  2247. this.$message({
  2248. message: error,
  2249. type: "error"
  2250. });
  2251. });
  2252. },
  2253. //显示子任务创建卡片
  2254. addSubTask() {
  2255. if(this.isRelationItem){return}
  2256. this.addFormVisible = true;
  2257. this.addForm = {parentTname: this.addForm.name,parentTid: this.addForm.id,projectId: this.addForm.projectId, groupId: this.addForm.groupId, taskLevel:0, planHours: 8, taskType: 0};
  2258. // this.addForm.executorListFront = [{executorId:null, planHours:8}];
  2259. this.addForm.executorListFront = [{executorId:null, planHours:8, serviceId: null}];
  2260. this.addLoading = false;
  2261. //创建子任务,非编辑状态
  2262. this.isEditFile = false;
  2263. // 触发外界子任务事件
  2264. this.$emit('closeBounced', {addSubTask: true, addForms: this.addForm})
  2265. },
  2266. // 关联任务点击事件
  2267. relationTaskClick(row,column,event){
  2268. // console.log('relationTaskClick',row);
  2269. this.relationPar = JSON.parse(JSON.stringify(this.addForm))
  2270. // console.log(this.relationPar);
  2271. this.addFormVisible = true;
  2272. this.addLoading = false;
  2273. this.isRelationItem = true;
  2274. this.isEditFile = true;
  2275. this.title = this.$t('editingtasks');
  2276. this.getTaskDetail(row.taskId);
  2277. // this.getUsers();
  2278. this.gain(row,1);
  2279. this.getRelationTaskList(1, row.taskId)
  2280. this.getTaskFileList(1,row.taskId)
  2281. },
  2282. // 解除关联
  2283. deleteRelationItem(eid){
  2284. this.listLoading = true
  2285. this.http.post('/task/removeMileStoneTask',{
  2286. id: eid
  2287. },res => {
  2288. if(res.code == 'ok') {
  2289. this.getRelationTaskList()
  2290. this.listLoading = false
  2291. this.$message({
  2292. message: this.$t('jie-chu-cheng-gong'),
  2293. type: 'success'
  2294. })
  2295. }else {
  2296. this.listLoading = false
  2297. this.$message({
  2298. message: res.msg,
  2299. type: 'error'
  2300. })
  2301. }
  2302. },error => {
  2303. this.listLoading = false
  2304. this.$message({
  2305. message: error,
  2306. type: 'error'
  2307. })
  2308. })
  2309. },
  2310. // 关联任务列表是否完成修改
  2311. relationFinishTask(row){
  2312. this.http.post('/task/finish',{
  2313. id: row.taskId,
  2314. taskStatus: row.taskStatus
  2315. },res => {
  2316. if(res.code == 'ok'){
  2317. // if(this.groupType == 0){
  2318. // this.getStageList();
  2319. // }else {
  2320. // this.getViewTaskList();
  2321. let obj = {
  2322. submitInsert: true
  2323. }
  2324. this.$emit('closeBounced', obj)
  2325. // }
  2326. }else{
  2327. this.$message({
  2328. message: res.msg,
  2329. type: 'error'
  2330. })
  2331. }
  2332. },error => {
  2333. this.$message({
  2334. message: error,
  2335. type: 'error'
  2336. })
  2337. })
  2338. },
  2339. finishTask(task) {
  2340. this.http.post('/task/finish',{id: task.id, taskStatus: task.taskStatus},
  2341. res => {
  2342. if (res.code == "ok") {
  2343. // if (this.groupType == 0) {
  2344. // this.getStageList();
  2345. // } else {
  2346. // this.getViewTaskList();
  2347. // }
  2348. let obj = {
  2349. submitInsert: true
  2350. }
  2351. this.$emit('closeBounced', obj)
  2352. } else {
  2353. this.$message({
  2354. message: res.msg,
  2355. type: "error"
  2356. });
  2357. }
  2358. },
  2359. error => {
  2360. this.$message({
  2361. message: error,
  2362. type: "error"
  2363. });
  2364. });
  2365. },
  2366. // 关联文件按钮
  2367. relationFileClick(){
  2368. this.relationFileDialog = true
  2369. this.addFileId = null
  2370. this.getProjectFileList()
  2371. },
  2372. // 获取项目下的文档列表
  2373. getProjectFileList(){
  2374. this.http.post('/task-files/getDocumentList',{
  2375. projectId: this.curProjectId
  2376. },res => {
  2377. if(res.code == 'ok'){
  2378. this.projectFileList = res.data
  2379. console.log('list',res.data);
  2380. }else {
  2381. this.$message({
  2382. message: res.msg,
  2383. type: 'error'
  2384. })
  2385. }
  2386. },error => {
  2387. this.$message({
  2388. message: error,
  2389. type: 'error'
  2390. })
  2391. })
  2392. },
  2393. // 列表的删除按钮
  2394. taskFileDelete(eid){
  2395. this.$confirm(this.$t('shiFouYiChuCiWenJian'), this.$t('other.prompts'), {
  2396. confirmButtonText: this.$t('btn.determine'),
  2397. cancelButtonText: this.$t('btn.cancel'),
  2398. type: 'warning'
  2399. }).then(()=>{
  2400. this.http.post('/task-files/delete',{
  2401. id: eid
  2402. },res => {
  2403. if(res.code == 'ok'){
  2404. this.$message({
  2405. message: res.data,
  2406. type: 'success'
  2407. })
  2408. this.getTaskFileList()
  2409. this.gain({ taskId: this.taskId }, 1)
  2410. }else {
  2411. this.$message({
  2412. message: res.msg,
  2413. type: 'error'
  2414. })
  2415. }
  2416. },error => {
  2417. this.$message({
  2418. message: error,
  2419. type: 'error'
  2420. })
  2421. })
  2422. }).catch(()=>{
  2423. this.$message({
  2424. message: this.$t('thedeletionhasbeencancelled'),
  2425. type: 'info'
  2426. })
  2427. })
  2428. },
  2429. showReasonForRejection(item) {
  2430. const taskId = this.taskId
  2431. const {id} = item
  2432. this.http.post('/task/getFileRejectReason',{
  2433. taskId
  2434. },res => {
  2435. if(res.code == 'ok'){
  2436. let text = res.data.find(item => item.id == id)
  2437. console.log(text)
  2438. this.$alert(text.fileRejectReason, '驳回原因');
  2439. }else {
  2440. this.$message.error(res.msg)
  2441. }
  2442. },error => { this.$message.error(error) })
  2443. },
  2444. // 确认关联文件
  2445. addTaskFile(){
  2446. if(this.addFileId == null){
  2447. this.$message({message: this.$t('xuanzguanlianwenjian') , type: 'warning'})
  2448. return
  2449. }
  2450. this.http.post('/task-files/addDocumentRef',{
  2451. documentId: this.addFileId,
  2452. taskId: this.addForm.id,
  2453. projectId: this.curProjectId
  2454. },res => {
  2455. if(res.code == 'ok'){
  2456. this.$message({
  2457. message: this.$t('guan-lian-cheng-gong'),
  2458. type: 'success'
  2459. })
  2460. this.relationFileDialog = false
  2461. this.getTaskFileList()
  2462. }else {
  2463. this.$message({
  2464. message: res.msg,
  2465. type: 'error'
  2466. })
  2467. }
  2468. },error => {
  2469. this.$message({
  2470. message: error,
  2471. type: 'error'
  2472. })
  2473. })
  2474. },
  2475. addRelationTask(){ //添加关联任务
  2476. this.http.post('/task/addMileStoneTask',{
  2477. milestoneId: this.addForm.id,
  2478. taskIds: JSON.stringify(this.relationvalue)
  2479. },
  2480. res =>{
  2481. if(res.code == "ok") {
  2482. this.isRelationTab = false
  2483. this.$message({
  2484. message: this.$t('addsuccessful'),
  2485. type: 'success'
  2486. })
  2487. this.getRelationTaskList()
  2488. this.$forceUpdate()
  2489. }else {
  2490. this.$message({
  2491. message: res.msg,
  2492. type: 'error'
  2493. })
  2494. }
  2495. },
  2496. error => {
  2497. this.$message({
  2498. message: error,
  2499. type: 'error'
  2500. })
  2501. })
  2502. },
  2503. backToParentTask() {
  2504. // this.getTaskDetail(this.addForm.parentTid);
  2505. this.getTaskDetail(this.timelabel ? this.relationPar.id : this.addForm.parentTid);
  2506. this.isEditFile = true;
  2507. if(this.timelabel){
  2508. this.isRelationItem = false
  2509. // this.relationPar = {name: ''}
  2510. this.getRelationTaskList(1, this.relationPar.id)
  2511. this.gain(this.relationPar)
  2512. }
  2513. },
  2514. // 点击评论发布
  2515. release() {
  2516. if(this.textarea2.length <= 0) return this.$message({message: this.$t('pleaseentercontent'), type: "error"})
  2517. this.http.post('/task-comment/add', {taskId: this.taskId, userId: this.user.id, content: this.textarea2},
  2518. res => {
  2519. if(res.code == "ok"){
  2520. if(res.data.content.indexOf('$userName=') != '-1') {
  2521. let obj = {
  2522. msg1: res.data.content.split('$')[0],
  2523. msg2: res.data.content.split('$')[1].split('=')[1],
  2524. msg3: res.data.content.split('$')[2]
  2525. }
  2526. res.data.content = obj
  2527. } else {
  2528. if(this.user.userNameNeedTranslate == 1) {
  2529. let obj = {
  2530. msg1: res.data.content,
  2531. msg2: '',
  2532. msg3: ''
  2533. }
  2534. res.data.content = obj
  2535. }
  2536. }
  2537. this.commentList.push(res.data)
  2538. console.log(this.commentList, '值☞')
  2539. this.sppk(this.commentList)
  2540. let obj = {
  2541. id: this.taskIid
  2542. }
  2543. this.gain(obj)
  2544. this.textarea2 = ""
  2545. // this.contRoll() // 滚动到底部
  2546. } else {
  2547. this.$message({
  2548. message: res.msg,
  2549. type: "error"
  2550. });
  2551. }
  2552. },
  2553. error => {
  2554. this.$message({
  2555. message: error,
  2556. type: "error"
  2557. });
  2558. })
  2559. },
  2560. // 滚动到底部
  2561. contRoll(){
  2562. // this.$nextTick(() => {
  2563. // this.$refs.main.scrollTop = this.$refs.contRoll.scrollHeight;
  2564. // })
  2565. this.$nextTick(() => {
  2566. let scrollElem = this.$refs.main;
  2567. scrollElem.scrollTo({ top: scrollElem.scrollHeight});
  2568. });
  2569. console.log('最后执行')
  2570. },
  2571. sss(){
  2572. this.$refs.addRem.style.display="none"
  2573. },
  2574. taskLineClick(row, column, event) {
  2575. if(this.isRelationItem){return}
  2576. this.mileageCup = true
  2577. if(row.taskType == 1){
  2578. this.timelabel = true
  2579. this.isRelationItem = false
  2580. }else{
  2581. this.timelabel = false
  2582. }
  2583. this.addFormVisible = true;
  2584. this.isEditFile = true;
  2585. this.addLoading = false;
  2586. this.getTaskDetail(row.id);
  2587. this.getTaskProgressList(row.id); // 获取任务进展列表
  2588. // this.getUsers(); // 获取名单数据
  2589. this.gain(row); // 获取评论列表
  2590. this.getDailyList(row.id) // 获取来自日报
  2591. this.getRelationTaskList(1, row.id)
  2592. this.getTaskFileList(1,row.id)
  2593. this.$emit('closeBounced', {taskLineClickAbs: true, items: row})
  2594. },
  2595. //获取SAP项目服务数据列表
  2596. getSapServiceList(){
  2597. this.http.post('/sap-project-service/sapServiceList', {},
  2598. res => {
  2599. if(res.code == "ok"){
  2600. this.sapServiceList=res.data
  2601. } else {
  2602. this.$message({
  2603. message: res.msg,
  2604. type: "error"
  2605. });
  2606. }
  2607. },
  2608. error => {
  2609. this.$message({
  2610. message: error,
  2611. type: "error"
  2612. });
  2613. })
  2614. },
  2615. // 列表的上传按钮
  2616. uploadFileClick(item){
  2617. console.log("upload",item.file);
  2618. let files = new FormData()
  2619. files.append("projectId",this.curProjectId);
  2620. files.append("taskId", this.addForm.id);
  2621. files.append("file", item.file);
  2622. this.http.uploadFile('/task-files/uploadFile', files,
  2623. res => {
  2624. if(res.code == 'ok'){
  2625. console.log(res);
  2626. this.$message({
  2627. message: this.$t('yi-shang-chuan'),
  2628. type: 'success'
  2629. })
  2630. this.gain({ taskId: this.taskId }, 1)
  2631. this.getTaskFileList()
  2632. }else {
  2633. this.$message({
  2634. message: res.msg,
  2635. type: 'error'
  2636. })
  2637. }
  2638. },error => {
  2639. this.$message({
  2640. message: error,
  2641. type: 'error'
  2642. })
  2643. })
  2644. },
  2645. uploadFileClickTwo(item, row) {
  2646. let files = new FormData()
  2647. files.append("projectId",this.curProjectId);
  2648. files.append("taskId", this.addForm.id);
  2649. files.append("taskFileId", row.id);
  2650. files.append("file", item.file);
  2651. this.http.uploadFile('/task-files/reUploadFile', files,
  2652. res => {
  2653. if(res.code == 'ok'){
  2654. console.log(res);
  2655. this.$message({
  2656. message: this.$t('yi-shang-chuan'),
  2657. type: 'success'
  2658. })
  2659. this.gain({ taskId: this.taskId }, 1)
  2660. this.getTaskFileList()
  2661. }else {
  2662. this.$message({
  2663. message: res.msg,
  2664. type: 'error'
  2665. })
  2666. }
  2667. },error => {
  2668. this.$message({
  2669. message: error,
  2670. type: 'error'
  2671. })
  2672. })
  2673. },
  2674. // 获取休息时间段
  2675. getRestPeriod() {
  2676. this.http.post('/time-auto-exclude/list', {},
  2677. res => {
  2678. if(res.code == "ok"){
  2679. this.restPeriod = (res.data || []).map(item => {
  2680. return {
  2681. start: `${item.startTime}:00`,
  2682. end: `${item.endTime}:00`
  2683. }
  2684. })
  2685. }
  2686. },)
  2687. },
  2688. // 查看已有计划
  2689. viewExistingPlans() {
  2690. const index = this.allocateDailyWorkingIndex
  2691. const { executorId } = this.addForm.executorListFront[index]
  2692. this.viewTaskTimeList(executorId, index)
  2693. },
  2694. // 表格选中
  2695. allocateTableSelectionChange(val) {
  2696. this.tableSelection = val || []
  2697. },
  2698. // 根据开始时间和截止时间设置执行人的分配每日工时数据
  2699. setDateDataBasedOnTime() {
  2700. const { startDate = '', endDate = '' } = this.addForm;
  2701. if (!startDate || !endDate) return [];
  2702. const dayjs = this.dayjs;
  2703. const start = dayjs(startDate);
  2704. const end = dayjs(endDate);
  2705. const result = [];
  2706. let current = start.startOf('day');
  2707. while (current.isBefore(end, 'day') || current.isSame(end, 'day')) {
  2708. const currentDate = current.format('YYYY-MM-DD');
  2709. let startTime = '09:00:00';
  2710. let endTime = '17:30:00';
  2711. if (current.isSame(start, 'day')) {
  2712. startTime = start.format('HH:mm:ss');
  2713. }
  2714. if (current.isSame(end, 'day')) {
  2715. endTime = end.format('HH:mm:ss');
  2716. }
  2717. const fullStart = `${currentDate} ${startTime}`;
  2718. const fullEnd = `${currentDate} ${endTime}`;
  2719. const { workHours = 0, overtimeHours = 0, totalHours = 0 } = calculateWorkHours(fullStart, fullEnd, this.restPeriod)
  2720. result.push({
  2721. allocateDate: currentDate,
  2722. startTime,
  2723. endTime,
  2724. workHour: totalHours,
  2725. overWorkHour: overtimeHours,
  2726. taskId: this.addForm.id || '',
  2727. });
  2728. current = current.add(1, 'day');
  2729. }
  2730. return result;
  2731. },
  2732. // 获取缺失的日期
  2733. retrieveMissingDates(list) {
  2734. const { startDate, endDate } = this.addForm;
  2735. const dateLst = list.map(item => item.allocateDate);
  2736. const missingDates = [];
  2737. const current = new Date(startDate);
  2738. const last = new Date(endDate);
  2739. const dateSet = new Set(dateLst);
  2740. while (current <= last) {
  2741. const dateStr = current.toISOString().split('T')[0]; // 格式化为 YYYY-MM-DD
  2742. if (!dateSet.has(dateStr)) {
  2743. missingDates.push(dateStr);
  2744. }
  2745. current.setDate(current.getDate() + 1);
  2746. }
  2747. this.dateDropdownMenuSelection = missingDates || []
  2748. },
  2749. // 删除单个日期计划
  2750. deleteASingleDateSchedule(index) {
  2751. this.$confirm(`确定删除当前日期?`, '删除', {
  2752. confirmButtonText: '确定',
  2753. cancelButtonText: '取消',
  2754. type: 'warning'
  2755. }).then(() => {
  2756. this.allocateDailyWorkingHoursList.splice(index, 1)
  2757. this.retrieveMissingDates(this.allocateDailyWorkingHoursList)
  2758. })
  2759. },
  2760. addSingleDateSchedule(item, index) {
  2761. const { taskId, userId, allocateDate } = item
  2762. const singleObject = {
  2763. startTime: '09:00:00',
  2764. endTime: '17:30:00',
  2765. workHour: 7.5,
  2766. overWorkHour: 0,
  2767. taskId, userId, allocateDate,
  2768. uuID: generateUUID()
  2769. }
  2770. this.allocateDailyWorkingHoursList.splice(index, 0, singleObject)
  2771. },
  2772. // 日期工时重新计算
  2773. calculateWorkingHours(item, index) {
  2774. const { allocateDate, startTime, endTime } = item
  2775. if(startTime > endTime) {
  2776. this.$message({
  2777. message: `${allocateDate}日期的开始时间小于截止时间,请调整!`,
  2778. type: 'warning'
  2779. });
  2780. return
  2781. }
  2782. const fullStart = `${allocateDate} ${startTime}`;
  2783. const fullEnd = `${allocateDate} ${endTime}`;
  2784. const { workHours = 0, overtimeHours = 0, totalHours = 0 } = calculateWorkHours(fullStart, fullEnd, this.restPeriod)
  2785. this.allocateDailyWorkingHoursList[index].workHour = totalHours
  2786. this.allocateDailyWorkingHoursList[index].overWorkHour = overtimeHours
  2787. },
  2788. // 批量设置时间段
  2789. batchSetTimePeriod() {
  2790. this.$confirm(`确定将选择的日期的时间段设置为【${this.startingTimePeriod} - ${this.endTimePeriod}】?`, '批量操作', {
  2791. confirmButtonText: '确定',
  2792. cancelButtonText: '取消',
  2793. type: 'warning'
  2794. }).then(() => {
  2795. const uuIDList = this.tableSelection.map(item => item.uuID)
  2796. this.allocateDailyWorkingHoursList = this.allocateDailyWorkingHoursList.map(item => {
  2797. if(uuIDList.includes(item.uuID)) {
  2798. const { allocateDate, startTime, endTime } = item
  2799. const fullStart = `${allocateDate} ${this.startingTimePeriod}`;
  2800. const fullEnd = `${allocateDate} ${this.endTimePeriod}`;
  2801. const { workHours = 0, overtimeHours = 0, totalHours = 0 } = calculateWorkHours(fullStart, fullEnd, this.restPeriod)
  2802. return {
  2803. ...item,
  2804. startTime: this.startingTimePeriod,
  2805. endTime: this.endTimePeriod,
  2806. workHour: totalHours,
  2807. overWorkHour: overtimeHours
  2808. }
  2809. } else {
  2810. return {
  2811. ...item,
  2812. }
  2813. }
  2814. })
  2815. })
  2816. },
  2817. // 添加单个日期
  2818. addASingleDate() {
  2819. const singleObject = {
  2820. startTime: '09:00:00',
  2821. endTime: '17:30:00',
  2822. workHour: 7.5,
  2823. overWorkHour: 0,
  2824. taskId: '',
  2825. userId: '',
  2826. allocateDate: this.dateDropdownMenuSelectionVal,
  2827. uuID: generateUUID()
  2828. }
  2829. this.allocateDailyWorkingHoursList.push(singleObject)
  2830. this.dateDropdownMenuSelectionVal = ''
  2831. this.retrieveMissingDates(this.allocateDailyWorkingHoursList)
  2832. },
  2833. // 合并执行人计划单元格
  2834. allocateTableObjectSpanMethod({ row, column, rowIndex, columnIndex }) {
  2835. if (columnIndex === 1) {
  2836. // 只合并第一列
  2837. const _rowSpanArr = this.getSpanArr(this.allocateDailyWorkingHoursList, 'allocateDate');
  2838. return {
  2839. rowspan: _rowSpanArr[rowIndex],
  2840. colspan: 1
  2841. };
  2842. }
  2843. },
  2844. getSpanArr(data, field) {
  2845. const spanArr = [];
  2846. let pos = 0;
  2847. data.forEach((item, index) => {
  2848. if (index === 0) {
  2849. spanArr.push(1);
  2850. pos = 0;
  2851. } else {
  2852. if (item[field] === data[index - 1][field]) {
  2853. spanArr[pos] += 1;
  2854. spanArr.push(0);
  2855. } else {
  2856. spanArr.push(1);
  2857. pos = index;
  2858. }
  2859. }
  2860. });
  2861. return spanArr;
  2862. },
  2863. // 确定工时
  2864. determineWorkingHours() {
  2865. this.allocateDailyWorkingHoursLoading = true
  2866. const userId = this.addForm.executorListFront[this.allocateDailyWorkingIndex].executorId
  2867. let list = this.allocateDailyWorkingHoursList.map(item => {
  2868. return { ...item, userId }
  2869. })
  2870. this.http.post('/task-daily-allocate/getConflict', {
  2871. jsonStr: JSON.stringify(list)
  2872. },
  2873. res => {
  2874. this.allocateDailyWorkingHoursLoading = false
  2875. if(res.code == "ok"){
  2876. const list = this.allocateDailyWorkingHoursList.map(item => {
  2877. let singleObject = { ...item }
  2878. delete singleObject.uuID
  2879. return singleObject
  2880. })
  2881. const totalPlanHours = this.allocateDailyWorkingHoursList.reduce((sum, item) => sum + item.workHour, 0)
  2882. this.addForm.executorListFront[this.allocateDailyWorkingIndex].planHours = totalPlanHours
  2883. this.addForm.executorListFront[this.allocateDailyWorkingIndex].dailyAllocateList = list
  2884. this.allocateDailyWorkingHoursVisable = false
  2885. } else {
  2886. this.$message({
  2887. message: res.msg,
  2888. type: "error"
  2889. });
  2890. }
  2891. },
  2892. error => {
  2893. this.allocateDailyWorkingHoursLoading = false
  2894. this.$message({
  2895. message: error,
  2896. type: "error"
  2897. });
  2898. })
  2899. }
  2900. },
  2901. };
  2902. </script>
  2903. <style lang="scss" scoped>
  2904. @import "../assets/scss/handle";
  2905. .reviewImages {
  2906. display: flex;
  2907. align-items: center;
  2908. margin: 0 25px;
  2909. img {
  2910. width: 100px
  2911. }
  2912. }
  2913. .themeFontColor {
  2914. @include font_color("color");
  2915. }
  2916. .customizedReviewer {
  2917. display: flex;
  2918. align-items: center;
  2919. }
  2920. .editingTask {
  2921. display: flex;
  2922. flex-wrap: wrap;
  2923. }
  2924. .carts .commentSpan {
  2925. float: none;
  2926. display: block;
  2927. margin-top: 0;
  2928. font-size: 14px;
  2929. span {
  2930. float: none;
  2931. display: inline-block;
  2932. margin-top: 0;
  2933. font-size: 14px;
  2934. }
  2935. }
  2936. .foooot {
  2937. padding: 10px 20px 20px;
  2938. text-align: right;
  2939. -webkit-box-sizing: border-box;
  2940. box-sizing: border-box;
  2941. }
  2942. .Daily p {
  2943. margin: 0 !important;
  2944. padding: 0 0 10px 0 !important;
  2945. }
  2946. .sub-all {
  2947. div {
  2948. display: inline-block;
  2949. padding: 0 20px;
  2950. font-size: 20px;
  2951. cursor: pointer;
  2952. }
  2953. .subOn {
  2954. color: #66b1ff;
  2955. }
  2956. }
  2957. .DailyBody {
  2958. margin: 0 20px;
  2959. }
  2960. .Daily{
  2961. height: 120%;
  2962. overflow: auto;
  2963. }
  2964. .inputDeep {
  2965. position: absolute;
  2966. bottom: 85px;
  2967. width: 95%;
  2968. margin: 0 12px;
  2969. }
  2970. .inputDeep .el-textarea .el-textarea__inner{
  2971. border: 0 !important;
  2972. resize: none !important;
  2973. }
  2974. .inputDeeps .el-textarea__inner {
  2975. border: 0 !important;
  2976. resize: none !important;
  2977. }
  2978. .scop_span {
  2979. display: inline-block;
  2980. padding: 2px 5px;
  2981. }
  2982. .counli {
  2983. em {
  2984. font-style: normal;
  2985. display: inline-block;
  2986. margin-left: 9%;
  2987. }
  2988. span {
  2989. float: right;
  2990. }
  2991. }
  2992. .carts {
  2993. position: relative;
  2994. .el-image{
  2995. border-radius: 50%;
  2996. float: left;
  2997. width: 20%;
  2998. }
  2999. i {
  3000. width: 30px;
  3001. height: 30px;
  3002. // background: #778899;
  3003. display: inline-block;
  3004. float: left;
  3005. border-radius:50%;
  3006. font-style:normal;
  3007. font-size: 12px;
  3008. line-height: 30px;
  3009. text-align: center;
  3010. color: #fff;
  3011. background: #778899;
  3012. overflow: hidden;
  3013. direction: rtl;
  3014. }
  3015. div {
  3016. text-align: left;
  3017. p {
  3018. text-align: left;
  3019. margin-left: 10px;
  3020. margin-left: 13%;
  3021. }
  3022. em {
  3023. display: block;
  3024. font-style: normal;
  3025. margin-left: 13%;
  3026. }
  3027. }
  3028. span {
  3029. font-size: 10px;
  3030. float: right;
  3031. margin-top: -40px;
  3032. }
  3033. }
  3034. .issue {
  3035. // height: 20%;
  3036. // position: relative;
  3037. // z-index: 4;
  3038. .zh{
  3039. position: relative;
  3040. width: 100%;
  3041. height: 100%;
  3042. }
  3043. .textareays {
  3044. background: #000;
  3045. height: 140px;
  3046. border: 0;
  3047. .el-textarea__inner {
  3048. height: 85%;
  3049. }
  3050. }
  3051. .issue-button {
  3052. position: absolute;
  3053. bottom: 20px;
  3054. right: 20px;
  3055. }
  3056. }
  3057. .inputDeep {
  3058. position: absolute;
  3059. bottom: 85px;
  3060. width: 95%;
  3061. margin: 0 12px;
  3062. }
  3063. .inputDeep .el-textarea .el-textarea__inner{
  3064. border: 0 !important;
  3065. resize: none !important;
  3066. }
  3067. .inputDeeps .el-textarea__inner {
  3068. border: 0 !important;
  3069. resize: none !important;
  3070. }
  3071. .scop_span {
  3072. display: inline-block;
  3073. padding: 2px 5px;
  3074. }
  3075. .container {
  3076. position: relative;
  3077. overflow-y: scroll;
  3078. }
  3079. .list {
  3080. position: absolute;
  3081. top: 0;
  3082. width: 100%;
  3083. }
  3084. .reviewerClass {
  3085. display: flex;
  3086. align-items: center;
  3087. margin-right: 20px;
  3088. .reviewerTitles {
  3089. margin-right: 10px;
  3090. }
  3091. }
  3092. .modifyPlanTitle {
  3093. display: flex;
  3094. align-items: center;
  3095. margin-bottom: 20px;
  3096. }
  3097. .modifyPlanTitle-item {
  3098. display: flex;
  3099. align-items: center;
  3100. margin-right: 20px;
  3101. }
  3102. .executorBox {
  3103. display: flex;
  3104. align-items: center;
  3105. }
  3106. .allocateDailyWorkingHoursClass {
  3107. display: flex;
  3108. align-items: center;
  3109. color: #303133;
  3110. font-size: 18px;
  3111. .allocate-title {
  3112. font-size: 18px;
  3113. margin-right: 24px;
  3114. }
  3115. }
  3116. .allocateDailyWorkingHoursClass-footer {
  3117. display: flex;
  3118. justify-content: space-between;
  3119. align-items: center;
  3120. width: 100%;
  3121. .footer-left {
  3122. display: flex;
  3123. align-items: center;
  3124. }
  3125. }
  3126. </style>