list.vue 80 KB

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