taskComponent.vue 104 KB

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