list.vue 102 KB

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