taskComponent.vue 107 KB

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