taskComponent.vue 92 KB

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