list.vue 102 KB

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