list.vue 104 KB

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