list.vue 87 KB

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