list.vue 107 KB

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