list.vue 112 KB

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