taskComponent.vue 94 KB

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