list.vue 102 KB

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