list.vue 77 KB

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