taskComponent.vue 117 KB

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