taskComponent.vue 107 KB

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