list.vue 99 KB

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