projectInside.vue 183 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900
  1. <template>
  2. <section class="sectionaa">
  3. <div v-loading="!componentFlg" :style="'width: 100%;height:'+tableHeight+'px'" id="components">
  4. <div v-if="componentFlg">
  5. <el-tabs v-model="activeName" @tab-click="handleClick">
  6. <el-tab-pane :label="$t('maincontent')" name="project" @click="null" disabled=true>
  7. <template slot="label">
  8. <i type="default" size="mini" class="el-icon-arrow-left" @click="toList" style="margin-left:10px;cursor:pointer;"></i>
  9. <el-select v-model="curProjectId" size="mini" class="projectCls" @change="onProjectChange" filterable>
  10. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id">
  11. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  12. <span style="float: right;margin-left: 20px">{{ item.projectName }}</span>
  13. </el-option>
  14. </el-select>
  15. <el-dropdown trigger="click" style="margin-right:30px;color:#262626;cursor:pointer;">
  16. <i class="iconfont firerock-iconcaidan" ></i>
  17. <el-dropdown-menu slot="dropdown">
  18. <el-dropdown-item v-if="currentProject.status == 1" @click.native="finishPro()">
  19. <i class="iconfont firerock-iconwancheng"></i>{{ $t('completeproject') }}
  20. </el-dropdown-item>
  21. <el-dropdown-item divided v-if="currentProject.status == 1" @click.native="cancelPro()">
  22. <i class="el-icon-refresh-left"></i>{{ $t('cancelproject') }}
  23. </el-dropdown-item>
  24. <el-dropdown-item v-if="currentProject.status == 2 || currentProject.status == 3" @click.native="startPro()">
  25. <i class="iconfont firerock-iconqidong"></i>{{ $t('restarttheproject') }}
  26. </el-dropdown-item>
  27. </el-dropdown-menu>
  28. </el-dropdown>
  29. </template>
  30. </el-tab-pane>
  31. <el-tab-pane :label="$t('taskkanban')" name="projectInside">
  32. <el-container style="padding: 0px;">
  33. <el-aside :style="'overflow:auto;padding-left:10px;padding-right:5px;height:'+tableHeight+'px;width:'+groupWidth+'px;'">
  34. <el-input v-model="groupSearch" size="small" :placeholder="$t('searchgroup')" @input="startSearchGroup" style="margin-top:10px"/>
  35. <p ><span class="heavyTxt">{{ $t('other.taskGroup') }}</span>
  36. <i class="el-icon-plus pull-right" style="color:#666;margin-right:10px;" @click="createGroup" v-if="projectCreatorId == user.id || projectInchargerId == user.id || permissions.projectManagement"></i>
  37. </p>
  38. <el-menu :default-active="defaultGroupId" ref="defaultMenu" class="el-menu-vertical-demo" @select="groupChange" style="border-right:none;">
  39. <el-menu-item :index="item.id" v-for="item in groupList" :key="item.id" class="group_style">
  40. <div slot="title">
  41. <!-- <span class="taskGroupClass">{{item.name}}</span> -->
  42. <div style="display: inline-block;">
  43. <el-tooltip effect="dark" :content="item.name" placement="top" v-if="item.name.length > 12">
  44. <span class="taskGroupClass">{{item.name}}</span>
  45. </el-tooltip>
  46. <span class="taskGroupClass" v-else>{{item.name}}</span>
  47. </div>
  48. <!-- <el-button size="mini" @click="test(item)">test</el-button> -->
  49. <el-dropdown trigger="click" style="float:right;margin-right:-10px;" :disabled="!(user.id == item.inchargerId || user.id == projectCreatorId || user.id == projectInchargerId || permissions.projectManagement)">
  50. <i class="iconfont firerock-iconcaidan" ></i>
  51. <el-dropdown-menu slot="dropdown">
  52. <el-dropdown-item @click.native="copyGroup(item)" :disabled="!(projectCreatorId == user.id || projectInchargerId == user.id || permissions.projectManagement)">
  53. <i class="el-icon-document-copy"></i>
  54. {{ $t('replicationgroup') }}</el-dropdown-item>
  55. <el-dropdown-item divided @click.native="renameGroup(item)" :disabled="!(projectCreatorId == user.id || projectInchargerId == user.id || permissions.projectManagement)">
  56. <i class="el-icon-edit"></i>
  57. {{ $t('changegroups') }}</el-dropdown-item>
  58. <el-dropdown-item divided @click.native="addToTemplate(item)" :disabled="!(projectCreatorId == user.id || projectInchargerId == user.id || permissions.projectManagement)">
  59. <i class="el-icon-plus"></i>
  60. {{ $t('settemplate') }}</el-dropdown-item>
  61. <el-dropdown-item divided @click.native="editIncharger(item)"
  62. :disabled="!(projectCreatorId == user.id || projectInchargerId == user.id || permissions.projectManagement)">
  63. <i class="el-icon-user"></i>
  64. {{ $t('sethead') }} </el-dropdown-item>
  65. <el-dropdown-item divided @click.native="setupParticipants(item)"
  66. :disabled="!(projectCreatorId == user.id || projectInchargerId == user.id || item.inchargerId == user.id || permissions.projectManagement)">
  67. <i class="iconfont firerock-iconusers"></i>
  68. {{ $t('aparticipant') }} </el-dropdown-item>
  69. <el-dropdown-item divided @click.native="deleteGroup(item)" :disabled="!(projectCreatorId == user.id || projectInchargerId == user.id || permissions.projectManagement)">
  70. <i class="el-icon-delete"></i>
  71. {{ $t('deletethegroup') }} </el-dropdown-item>
  72. <!-- 设置参与人 0000 -->
  73. <el-dropdown-item divided @click.native="getGroupDetails(item)">
  74. <i class="el-icon-tickets"></i>
  75. {{ $t('groupdetails') }} </el-dropdown-item>
  76. </el-dropdown-menu>
  77. </el-dropdown>
  78. </div>
  79. </el-menu-item>
  80. </el-menu>
  81. <!--视图 -->
  82. <p ><span class="heavyTxt">{{ $t('shi-tu') }}</span></p>
  83. <el-menu :default-active="1" class="el-menu-vertical-demo" @select="viewChange" style="border-right:none;">
  84. <el-menu-item :index="item.id" v-for="item in viewList" :key="item.id" class="group_style">
  85. <div slot="title">
  86. <span >{{item.name}}</span>
  87. </div>
  88. </el-menu-item>
  89. </el-menu>
  90. </el-aside>
  91. <!-- 分组详情 -->
  92. <el-dialog :title="groupDetailTil" :visible.sync="groupDetailsShow" width="500px" :before-close="handleClose">
  93. <div>
  94. <el-form label-width="80px">
  95. <el-form-item :label="$t('head') + ':'">
  96. <span v-if="user.userNameNeedTranslate != '1'">{{groupDetailData.incharger}}</span>
  97. <span v-if="user.userNameNeedTranslate == '1'">
  98. <ww-open-data type='userName' :openid='groupDetailData.incharger'></ww-open-data>
  99. </span>
  100. </el-form-item>
  101. <el-form-item :label="$t('participantin') + ':'">
  102. <span v-for="(item, index) in groupDetailData.participators" :key="index">
  103. <span v-if="user.userNameNeedTranslate != '1'">
  104. {{item.userName}}
  105. </span>
  106. <span v-if="user.userNameNeedTranslate == '1'">
  107. <ww-open-data type='userName' :openid='item.userName'></ww-open-data>
  108. </span>
  109. <span v-if="index < groupDetailData.participators.length - 1">、</span>
  110. </span>
  111. </el-form-item>
  112. <el-form-item label="wbsCode" v-if="user.companyId == 936">
  113. <span>{{groupDetailData.wbsCode}}</span>
  114. </el-form-item>
  115. </el-form>
  116. </div>
  117. <span slot="footer" class="dialog-footer">
  118. <el-button type="primary" @click="groupDetailsShow = false">{{ $t('btn.determine') }}</el-button>
  119. </span>
  120. </el-dialog>
  121. <span :style="'background:#f0f0f0;width:1px;height:'+tableHeight+'px;'" @click="toggleGroup">
  122. </span>
  123. <!-- <span :style="'width:10px;height:'+tableHeight+'px;float:left;text-align:center;vertical-align:middle;'" @click="toggleGroup">
  124. <span :style="'width:1px;background:#20A0FF;height:'+tableHeight+'px;float:left;'"></span>
  125. <i class="el-icon-d-arrow-left" ></i>
  126. </span> -->
  127. <!-- 增加侧边栏的点击效果 -->
  128. <div class="sidebar" @click="retract()">
  129. <div class="etui">
  130. <i class="el-icon-arrow-left" ref="box"></i>
  131. </div>
  132. </div>
  133. <!-- 增加侧边栏的点击效果 -->
  134. <el-main style="background:#f7f7f7;padding:0px;position: relative;">
  135. <el-row style="color:#999;margin-top:10px;padding: 0px 10px;" :gutter="10">
  136. <el-col :span="12">
  137. <el-link @click="toggleGroup"><i v-if="selectedGroup != null" :class="groupWidth==0?'el-icon-d-arrow-right':'el-icon-d-arrow-left'" style="margin-top:10px;">{{selectedGroup.name}}</i></el-link>
  138. </el-col>
  139. <el-col :span="8" style="float:right;width:420px">
  140. <el-select v-model="order" size="small" style="background:#fff;display:inline-block;" @change="orderChange">
  141. <el-option v-for="item in orderList" :key="item.id" :label="item.name" :value="item.id">
  142. <span>{{item.name}}</span>
  143. </el-option>
  144. </el-select>
  145. <el-button icon="iconfont firerock-icondaochu" style="margin-left:10px" size="mini" @click="showExportDialog">{{ $t('export.export') }}</el-button>
  146. <el-button icon="iconfont firerock-icondaoru" size="mini" @click="importTaskDialog = true;importToStageId = stageList[0].id;">{{ $t('dao-ru') }}</el-button>
  147. </el-col>
  148. </el-row>
  149. <!-- <div style="color:#999;margin-top:10px;">
  150. <i v-if="selectedGroup != null" class="el-icon-arrow-left" style="margin-top:10px;">{{selectedGroup.name}}</i>
  151. </div> -->
  152. <div v-if="!displayTable">
  153. <div style="width: 100%;overflow-x: auto;">
  154. <draggable style="white-space:nowrap;" @update="onMoveStage"
  155. v-model="stageList" group="stage" @start="stageDrag=true" @end="stageDrag=false;" draggable=".taskStage" >
  156. <!--每个阶段的拖拽 -->
  157. <!-- <transition-group > -->
  158. <v-flex class="taskStage" v-for="stage in stageList" :key="stage.id" :style="'height:'+stageListHeight+'px;'">
  159. <div :id="stage.id"
  160. class="taskList" >
  161. <!--头部显示阶段名称,操作 -->
  162. <div slot="header" style="margin:10px 0px;cursor:move;width:300px" role="task">
  163. <span class="stage">{{stage.stagesName}}</span><span style="margin-left:10px;color:#303133;font-size:12px;">{{stage.taskList.length}}</span>
  164. <!-- <i class="el-icon-more" style="float:right;"></i> -->
  165. <el-dropdown trigger="click" style="float:right;cursor:pointer;">
  166. <i class="el-icon-more" ></i>
  167. <el-dropdown-menu slot="dropdown">
  168. <el-dropdown-item @click.native="addTask(stage)">
  169. <i class="el-icon-document-add"></i>
  170. {{ $t('createtask ') }}</el-dropdown-item>
  171. <el-dropdown-item @click.native="renameStage(stage)">
  172. <i class="el-icon-edit"></i>
  173. {{ $t('renamingalist') }} </el-dropdown-item>
  174. <el-dropdown-item divided @click.native="deleteStage(stage)">
  175. <i class="el-icon-delete"></i>{{$t('deleteList ')}} </el-dropdown-item>
  176. </el-dropdown-menu>
  177. </el-dropdown>
  178. </div>
  179. <draggable class="taskListin" :style="'max-height:' + taskListinH + 'px;'" @start="drag=true" @end="drag=false" draggable=".taskCard" ghostClass="ghost" @update="onChange" @add="onChange" group="task1" :id="stage.id">
  180. <div v-for="element in stage.taskList" :id="element.id" :key="element.id" class="taskCard" ref="tasks" @click="editTask(element)" :style="element.taskStatus==0?'':'background:#eFeFeF;'">
  181. <!--任务卡片内容显示 -->
  182. <div>
  183. <div v-if="element.taskLevel == 2" class="taskImg hong"><img src="../../assets/image/hong.png" alt=""></div>
  184. <div v-if="element.taskLevel == 1" class="taskImg huang"><img src="../../assets/image/huang.png" alt=""></div>
  185. <div v-if="element.taskLevel == 0" class="taskImg hui"><img src="../../assets/image/hui.png" alt=""></div>
  186. <el-checkbox :disabled="element.taskStatus==2 || element.subTaskList.length > element.subTaskFinishNum" :checked="element.taskStatus==1?true:false" size="large" class="cb"
  187. @change="finishTask(element)"
  188. @click.stop.native=""
  189. ></el-checkbox>
  190. <el-tooltip class="item" effect="dark" :content="element.name" placement="top">
  191. <label class="task_name" :style="'background:'+(element.taskStatus==0?'#ffffff;':'#eFeFeF;')"><span>{{element.name}}</span></label>
  192. </el-tooltip>
  193. <i :class="taskTypeIcon[element.taskType]" :style="'float:right;color:'+taskTypeColor[element.taskType]+';margin-right:8px;margin-top:8px;'" ></i>
  194. </div>
  195. <div style="margin: 10px 0px;color:#666;" @click="timess(element.endDate)">
  196. <span v-if="element.endDate >= times || element.taskStatus == 1"><i v-if="element.endDate != null" class="el-icon-date" style="margin-left:5px">&nbsp;&nbsp;{{element.endDate}}</i></span>
  197. <span v-else><em v-if="element.endDate != null" style="display: inline-block;padding:3px 5px"><i v-if="element.endDate != null" class="el-icon-date"><span class="element_span"> &nbsp;&nbsp;{{element.endDate}}{{ $t('jie-zhi') }}</span></i></em></span>
  198. <span v-if="element.executorName">
  199. <span v-for="(exeItem, exeIndex) in element.executorName.split(',')" :key="exeIndex" :style="element.executorColor ? 'background:' + element.executorColor.split(',')[exeIndex] : ''" class="user_name_icon">
  200. <span v-if="user.userNameNeedTranslate != '1'">
  201. {{exeItem.length>2?exeItem.substring(exeItem.length-2, exeItem.length):exeItem}}
  202. </span>
  203. <span v-if="user.userNameNeedTranslate == '1'">
  204. <ww-open-data type='userName' :openid='exeItem'></ww-open-data>
  205. </span>
  206. </span>
  207. </span>
  208. <el-button v-if="!element.executorName" type="primary" @click.stop.native="addAsMyTask(element)" size="mini" style="float:right;width:38px;padding:5px;position: absolute;z-index: 5;right: 5px;">{{ $t('ren-ling') }}</el-button>
  209. </div>
  210. <!--子任务 -->
  211. <div v-if="element.subTaskList.length > 0" class="taskCardCircleBox">
  212. <el-progress type="circle" :percentage="(element.subTaskFinishNum/element.subTaskList.length) * 100" width="16" :show-text="false" stroke-linecap="butt" stroke-width="8"></el-progress><span style="margin-left:5px;font-size:12px;">{{element.subTaskFinishNum}}/{{element.subTaskList.length}}</span>
  213. </div>
  214. <!-- <div v-if="element.taskType == 1 && element.refTaskList != null">
  215. <el-tooltip class="item" effect="dark" content="查看关联任务" placement="top">
  216. <el-link class="sub_task_num" @click.stop.native="showSubTaskList(element)"><i class="iconfont firerock-icontree" ></i><span style="margin-left:5px;">{{element.finishRefTaskCount}}/{{element.refTaskList.length}}</span></el-link>
  217. </el-tooltip>
  218. </div> -->
  219. <div v-if="element.taskType == 1 && !(element.refTaskList == null || element.refTaskList.length == 0)" class="taskCardCircleBox">
  220. <el-progress type="circle" :percentage="(element.finishRefTaskCount/(element.refTaskList ? element.refTaskList.length : 0)) * 100" width="16" :show-text="false" stroke-linecap="butt" stroke-width="8"></el-progress>
  221. <span style="margin-left:5px;font-size:12px">{{element.finishRefTaskCount}}/{{(element.refTaskList ? element.refTaskList.length : 0)}}</span>
  222. </div>
  223. </div>
  224. </draggable>
  225. <el-button v-if="canAddTask" slot="footer" role="people" @click="addTask(stage)" style="width:300px;" size="small" icon="el-icon-plus"></el-button>
  226. </div>
  227. </v-flex>
  228. <!-- </transition-group > -->
  229. <el-button slot="footer" v-if="selectedGroup != null" @click="addStage" class="taskList" icon="el-icon-plus" style="margin-top:30px;">{{ $t('creatingTaskList') }}</el-button>
  230. </draggable>
  231. </div>
  232. </div>
  233. <!--列表-->
  234. <el-table v-if="displayTable" :data="taskDataList"
  235. :header-cell-style="{'font-weight':'normal'}"
  236. highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;margin-top:10px;" @row-click="taskLineClick">
  237. <el-table-column fixed :label="$t('wan-cheng')" width="50">
  238. <template slot-scope="scope">
  239. <el-checkbox :disabled="scope.row.taskStatus==2" v-model="scope.row.isFinish" size="large" class="cb"
  240. @change="finishTask(scope.row)"
  241. @click.stop.native=""
  242. ></el-checkbox>
  243. </template>
  244. </el-table-column>
  245. <el-table-column prop="name" fixed :label="$t('biao-ti')" width="250">
  246. <template slot-scope="scope">
  247. <el-tooltip class="item" effect="dark" :content="scope.row.name" placement="top">
  248. <span class="single_line" > {{scope.row.name}}</span>
  249. </el-tooltip>
  250. </template>
  251. </el-table-column>
  252. <el-table-column prop="taskType" :label="$t('ren-wu-lei-xing')" width="100">
  253. <template slot-scope="scope">
  254. {{taskTypeList[scope.row.taskType].name}}
  255. </template>
  256. </el-table-column>
  257. <el-table-column prop="taskStatus" :label="$t('taskstatus')" width="100" >
  258. <template slot-scope="scope">
  259. {{taskStatusList[scope.row.taskStatus]}}
  260. </template>
  261. </el-table-column>
  262. <el-table-column prop="parentName" :label="$t('parentsstask')" width="250">
  263. <template slot-scope="scope">
  264. <span style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;"> {{scope.row.parentTname}}</span>
  265. </template>
  266. </el-table-column>
  267. <el-table-column prop="stagesName" :label="$t('tasklist')" width="100" >
  268. </el-table-column>
  269. <el-table-column prop="executorName" :label="$t('zhi-hang-ren')" width="100" >
  270. <template slot-scope="scope">
  271. <span v-if="user.userNameNeedTranslate != '1'">
  272. <!-- {{scope.row.executorName == null?$t('dai-fen-pei'):scope.row.executorName}} -->
  273. <span v-if="scope.row.executorName == null">{{$t('dai-fen-pei')}}</span>
  274. <span v-else>
  275. <span v-for="(item, index) in scope.row.executorName" :key="index">
  276. {{item}}
  277. <span v-if="index < scope.row.executorName.length - 1">,</span>
  278. </span>
  279. </span>
  280. </span>
  281. <span v-if="user.userNameNeedTranslate == '1'">
  282. <span v-if="scope.row.executorName == null">
  283. {{$t('dai-fen-pei')}}
  284. </span>
  285. <span v-else>
  286. <span v-for="(item, index) in scope.row.executorName" :key="index">
  287. <ww-open-data type='userName' :openid='item'></ww-open-data>
  288. <span v-if="index < scope.row.executorName.length - 1">,</span>
  289. </span>
  290. </span>
  291. </span>
  292. </template>
  293. </el-table-column>
  294. <!-- <el-table-column prop="endDate" label="截止时间" width="100" ></el-table-column> -->
  295. <el-table-column prop="startDate" :label="$t('starttimes')" width="100" >
  296. <template slot-scope="scope">
  297. <!-- <p v-if="scope.row.startDate >= times || scope.row.taskStatus != 0">{{scope.row.startDate}}</p>
  298. <p style="border-radius: 3px; text-align: center;background: #e62412; color: #fff;" v-else><span>{{scope.row.startDate}}</span></p> -->
  299. <p>{{scope.row.startDate}}</p>
  300. </template>
  301. </el-table-column>
  302. <el-table-column prop="endDate" :label="$t('deadline')" width="100" >
  303. <template slot-scope="scope">
  304. <p v-if="scope.row.endDate >= times || scope.row.taskStatus != 0">{{scope.row.endDate}}</p>
  305. <p style="border-radius: 3px; text-align: center;background: #e62412; color: #fff;" v-else><span>{{scope.row.endDate}}</span></p>
  306. </template>
  307. </el-table-column>
  308. <el-table-column prop="createDate" :label="$t('creationtime')" width="100" ></el-table-column>
  309. <el-table-column prop="taskLevel" :label="$t('priority')" width="100" >
  310. <template slot-scope="scope">
  311. {{importanceList[scope.row.taskLevel].name}}
  312. </template>
  313. </el-table-column>
  314. </el-table>
  315. </el-main>
  316. </el-container>
  317. </el-tab-pane>
  318. <el-tab-pane :label="$t('fileCenter')" name="files"><FileCenter ref="fileCenter"></FileCenter></el-tab-pane>
  319. <el-tab-pane :label="$t('overviewoftheproject')" name="info"><ProjectInfo ref="projectInfo" @basecost-change="changeBase"></ProjectInfo></el-tab-pane>
  320. <el-tab-pane :label="$t('datastatistics')" name="summary"><Summary ref="summary"></Summary></el-tab-pane>
  321. <el-tab-pane :label="$t('costmanagement')" name="costbaseline" v-if="permissions.projectBaseline"><CostBaseline ref="costbaseline"></CostBaseline></el-tab-pane>
  322. <el-tab-pane :label="$t('valueanalysis')" name="earning" v-if="user.id == currentProject.creator || user.id == currentProject.incharger_id ||permissions.projectBaseline"><Earning ref="earning"></Earning></el-tab-pane>
  323. </el-tabs>
  324. <!-- 设置参与人员界面 -->
  325. <el-dialog :title="$t('selectingParticipants')" v-if="participantsDialog" :visible.sync="participantsDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  326. <div class="tree" style="height:400px">
  327. <el-scrollbar style="height:100%">
  328. <el-input v-if="user.userNameNeedTranslate != 1"
  329. :placeholder="$t('keywordfiltering')"
  330. v-model="participantsFilterText">
  331. </el-input>
  332. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id"
  333. ref="chooseMembTree2" @check-change="onTreeItemChange" :default-checked-keys="alreadyPartArray"
  334. highlight-current :filter-node-method="filterNode">
  335. <span class="custom-tree-node" slot-scope="{ node, data }">
  336. <span v-if="user.userNameNeedTranslate == '1'">
  337. <span v-if="node.data.children">
  338. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  339. </span>
  340. <span v-else>
  341. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  342. </span>
  343. </span>
  344. <span v-if="user.userNameNeedTranslate != '1'">
  345. {{ node.label }}
  346. </span>
  347. </span>
  348. </el-tree>
  349. </el-scrollbar>
  350. </div>
  351. <div>{{ $t('btn.choose') }}&nbsp;{{chosenMembCount}}&nbsp;{{ $t('other.people') }}</div>
  352. <div slot="footer" class="dialog-footer">
  353. <el-button @click="participantsDialog = false">{{ $t('btn.cancel') }}</el-button>
  354. <el-button type="primary" @click="setParticipants()">{{ $t('btn.determine') }}</el-button>
  355. </div>
  356. </el-dialog>
  357. <!--新增任务界面-->
  358. <el-dialog :class="addForm.id==null?'':'jm'" :title="title" v-if="addFormVisible" :visible.sync="addFormVisible"
  359. :close-on-click-modal="false" customClass="customWidth" width="800px" ref="addDialog" :top="'6vh'">
  360. <!-- <div style="width: 200%;height:80%;position: absolute;right:-100%;top:0;background:#000;opacity: 0;" @click="sss"></div> -->
  361. <div style="height: 72vh;overflow: auto;">
  362. <el-form ref="form1" :model="addForm" :rules="taskRules" label-width="100px">
  363. <!--子任务需要选择任务列表 -->
  364. <el-form-item :label="$t('tasklist')" prop="stages" v-if="addForm.parentTid != null">
  365. <el-select v-model="addForm.stagesId" style="width:100%;" >
  366. <el-option v-for="item in stageList" :key="item.id" :label="item.stagesName" :value="item.id"></el-option>
  367. </el-select>
  368. </el-form-item>
  369. <el-form-item :label="$t('types')">
  370. <!-- <el-button @click="test">test</el-button> -->
  371. <!-- 0011 -->
  372. <!-- {{groupResponsibleId == user.id}} -->
  373. <el-select v-model="addForm.taskType" style="width:100%;" :disabled="((this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement) && !(groupResponsibleId == user.id)" @change="selchg()">
  374. <el-option v-for="item in taskTypeList" :key="item.id" :label="item.name" :value="item.id">
  375. <i :class="item.icon" ></i>
  376. <span>{{item.name}}</span>
  377. </el-option>
  378. </el-select>
  379. </el-form-item>
  380. <el-form-item :label="$t('taskdefinition')" prop="name">
  381. <el-input v-model="addForm.name" :maxlength="40" :disabled="(this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" :placeholder="$t('enterthetaskcontent')" clearable></el-input>
  382. </el-form-item>
  383. <!-- {{timelabel}}{{mileageCup}} -->
  384. <el-form-item :label="!timelabel ? $t('starttimes') : $t('jie-zhi-shi-jian')" prop="startDate">
  385. <el-date-picker v-model="addForm.startDate" type="date" style="width:40%;" value-format="yyyy-MM-dd"
  386. :placeholder="$t('pleaseselectadate')" :disabled="(this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" @change="DateChange()" v-if="!timelabel"></el-date-picker>
  387. <span style="margin-left:30px;margin-right:10px;" v-if="!timelabel">{{ $t('deadline') }}</span>
  388. <el-date-picker style="width:40%;" v-model="addForm.endDate" type="date" value-format="yyyy-MM-dd"
  389. :placeholder="$t('pleaseselectadate')" :disabled="(this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" @change="DateChange()"></el-date-picker>
  390. <span style="margin-left:30px;margin-right:10px;" v-if="timelabel && mileageCup">{{ $t('wan-cheng-shi-jian') }}</span>
  391. <el-date-picker style="width:40%;" v-if="timelabel && mileageCup" v-model="addForm.finishDate" type="date" value-format="yyyy-MM-dd"
  392. :placeholder="$t('pleaseselectadate')" :disabled="(this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" @change="DateChange()"></el-date-picker>
  393. </el-form-item>
  394. <div style="border: 1px solid #ddd;margin:5px 0;padding:5px 0;">
  395. <el-form-item :label="$t('zhi-hang-ren') + (index+1)" v-for="(executorItem, index) in addForm.executorListFront" :key="index">
  396. <el-select v-if="user.userNameNeedTranslate != 1" v-model="executorItem.executorId" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" size="small" filterable clearable :placeholder="$t('pleaseselectanexecutor')" style="width:40%;" @change="$forceUpdate()">
  397. <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id">
  398. <span style="float: left">{{ item.name }}</span>
  399. <span style="float: right; color: #8492a6; font-size: 13px;margin-left: 20px" v-if="item.jobNumber">{{ item.jobNumber }}</span>
  400. </el-option>
  401. </el-select>
  402. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'mini'" :subject="users" :subjectId="executorItem.executorId" :distinction="'1'" @selectCal="selectCal" :index="index" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)"></selectCat>
  403. <span style="margin-left:30px;margin-right:10px;">{{ $t('plantime') }}</span>
  404. <el-input-number size="small" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" v-model="gstimday[index]" style="width:16%;" :min="1" :max="100" :placeholder="$t('danweitian')" @change="chggstim(0,index)"></el-input-number ><span style="margin-left:5px;">{{ $t('time.day') }}</span>
  405. <el-input-number size="small" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" v-model="gstimhour[index]" style="width:16%;" :min="1" :max="100" :placeholder="$t('pleaseentertheplannedworking')" @change="chggstim(1,index)"></el-input-number ><span style="margin-left:5px;">{{ $t('time.hour') }}</span>
  406. <!--移除执行人 -->
  407. <i class="el-icon-delete" v-if="index>0 && (addForm.id == null|| user.id == addForm.createrId || currentProject.inchargerId == user.id|| permissions.projectManagement || groupResponsibleId == user.id)" style="margin-left:5px" @click="removeExecutorLine(index)"></i>
  408. </el-form-item>
  409. <el-link type="primary" v-if="(((addForm.executorListFront == null || addForm.executorListFront.length<10) &&
  410. (addForm.id == null|| user.id == addForm.createrId || currentProject.inchargerId == user.id || permissions.projectManagement)) ||
  411. groupResponsibleId == user.id)"
  412. style="margin-left:35px;" @click="addExecutorLine">{{ $t('addinganexecutor') }}</el-link>
  413. </div>
  414. <el-form-item :label="$t('priority')">
  415. <el-select v-model="addForm.taskLevel" style="width:100%;" >
  416. <el-option v-for="item in importanceList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  417. </el-select>
  418. </el-form-item>
  419. <!-- 富文本 -->
  420. <el-form-item :label="$t('detaileddescription')" style="height: 200px">
  421. <!-- <Editor id="tinymce" v-model="tinymceHtml" :init="editorInit"></Editor> -->
  422. <!-- <el-input type="textarea" v-model="addForm.taskDesc" :rows="3"></el-input> -->
  423. <!-- <quill-edito v-model="addForm.taskDesc"></quill-edito> -->
  424. <quill-editor style="height: 150px" ref="text" v-model="addForm.taskDesc" class="myQuillEditor" :options="editorOption" @blur="onEditorBlur($event)" @focus="onEditorFocus($event)"/>
  425. </el-form-item>
  426. <!-- 富文本 -->
  427. <div v-if="addForm.id != null">
  428. <el-divider ></el-divider>
  429. <!-- 任务进展 -->
  430. <template v-if="!timelabel || isRelationItem">
  431. <p ><i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">{{ $t('taskprogress') }}</i>
  432. <span ref="addPro" style="display: block; float:right;"><el-link @click="addprogress">{{ $t('addtaskprogress') }}</el-link></span>
  433. </p>
  434. <!-- 任务进展展示 -->
  435. <div style="display: none;" ref="proBox" class="progress">
  436. <!-- <el-form :model="> -->
  437. <el-radio-group v-model="radio">
  438. <el-radio :label="0" class="rala1">{{ $t('normals') }}</el-radio>
  439. <el-radio :label="1" class="rala2">{{ $t('atrisk') }}</el-radio>
  440. <el-radio :label="2" class="rala3">{{ $t('withinthetimelimit') }}</el-radio>
  441. </el-radio-group>
  442. <el-input
  443. type="textarea"
  444. border="0"
  445. :autosize="{ minRows: 2, maxRows: 6}"
  446. :placeholder="$t('detailedprogressdescription')"
  447. v-model="text2"
  448. style="margin:10px 0 0 0">
  449. </el-input>
  450. <h4 style="font-weight: normal;">{{ $t('tixiang') }}{{checkLists.length}}</h4>
  451. <i class="el-icon-circle-plus pron_i" style="font-size: 28px;color: #409EFF;" @click="addI(0)"></i>
  452. <div class="remind" ref="addRem" style="display: none">
  453. <el-checkbox-group v-model="checkboxGrounp" v-for="item in users" :key="item.id">
  454. <p>
  455. <el-checkbox :label="item.name" @change="kkk(item)">
  456. <span>
  457. <span v-if="user.userNameNeedTranslate != '1'">
  458. {{item.name}}
  459. </span>
  460. <span v-if="user.userNameNeedTranslate == '1'">
  461. <ww-open-data type='userName' :openid='item.name'></ww-open-data>
  462. </span>
  463. </span>
  464. </el-checkbox>
  465. </p>
  466. </el-checkbox-group>
  467. </div>
  468. <div class="ssp" @click="sss"></div>
  469. <!-- </el-form> -->
  470. <div class="pro_btn">
  471. <el-button size="mini" @click="shutPro">{{ $t('btn.cancel') }}</el-button>
  472. <el-button size="mini" type="primary" @click="addTaskProgress">{{ $t('fa-bu') }}</el-button>
  473. </div>
  474. </div>
  475. <div class="ddl" v-if="recentProgressInfo != null && recentProgressInfo.id != null">
  476. <div class="elCard" style="margin-bottom: 10px; height:" >
  477. <i class="el-icon-success" style="color: #43d14f;" v-if="recentProgressInfo.status == 0"></i>
  478. <i class="el-icon-success" style="color: #fd7624;" v-else-if="recentProgressInfo.status == 1"></i>
  479. <i class="el-icon-success" style="color: #fd4d47;" v-else></i>
  480. <span v-if="recentProgressInfo.status == 0">{{ $t('normals') }}</span>
  481. <span v-else-if="recentProgressInfo.status == 1">{{ $t('normals') }}</span>
  482. <span v-else>{{ $t('withinthetimelimit') }}</span>
  483. <el-dropdown trigger="click" style="float:right;cursor:pointer; float: right;">
  484. <i class="el-icon-more" ></i>
  485. <el-dropdown-menu slot="dropdown">
  486. <el-dropdown-item divided>
  487. <span @click="deleteTaskProgress(recentProgressInfo.id)"><i class="el-icon-delete"></i>{{ $t('deleteList ') }}</span></el-dropdown-item>
  488. </el-dropdown-menu>
  489. </el-dropdown>
  490. <div class="elCard_qu">{{recentProgressInfo.creatorName}}{{ $t('geng-xin-yu') }}{{recentProgressInfo.indate | relativeTime}}</div>
  491. <p style="padding-left: 20px;">{{recentProgressInfo.content}}</p>
  492. <div class="examine"><el-button type="text" @click="innerVisibless = true" style="color: #8F87A3;">{{ $t('viewingHistory') }}</el-button></div>
  493. </div>
  494. </div>
  495. <!-- 任务列表没有数据的时候展示 -->
  496. <div class="nones" v-if="ProgressList.length <= 0">
  497. {{ $t('nodata') }}
  498. </div>
  499. <!-- 任务进展完整状态 -->
  500. <el-dialog :title="$t('other.prompts')" :visible.sync="innerVisibless" append-to-body width="500px">
  501. <div class="integrity">
  502. <h3 style="font-weight: normal;display: inline-block;margin: 0 0 20px 0;">{{ $t('taskprogress') }} :{{ProgressList.length}}</h3>
  503. <!-- <span class="write"><i class="el-icon-circle-plus"></i>填写进展</span> -->
  504. <el-divider></el-divider>
  505. <!-- -->
  506. <div class="block" style="height: 200px;">
  507. <el-timeline style="padding:20px 0 0 0;">
  508. <el-timeline-item
  509. v-for="(activity, index) in ProgressList"
  510. :key="index">
  511. <div class="tb">
  512. <span v-if="activity.status == 0" style="color: #43D14F" class="icon"></span>
  513. <span v-if="activity.status == 1" style="color: #FD7624" class="icon"></span>
  514. <span v-if="activity.status == 2" style="color: red" class="icon"></span>
  515. <div>
  516. <span v-if="activity.status == 0" style="color: #43D14F">{{ $t('normals') }}</span>
  517. <span v-if="activity.status == 1" style="color: #FD7624">{{ $t('atrisk') }}</span>
  518. <span v-if="activity.status == 2" style="color: red">{{ $t('withinthetimelimit') }}</span>
  519. <span style="display: inline-block; float: right; color: #8C8C8C">{{activity.indate | relativeTime}}</span>
  520. </div>
  521. <p style="color: #8C8C8C">{{activity.content}}</p>
  522. </div>
  523. </el-timeline-item>
  524. </el-timeline>
  525. </div>
  526. <!-- -->
  527. </div>
  528. <span slot="footer" class="dialog-footer">
  529. <el-button type="primary" @click="innerVisibless = false">{{ $t('Shutdown') }}</el-button>
  530. </span>
  531. </el-dialog>
  532. </template>
  533. <!-- 子任务/关联任务 -->
  534. <p ><i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">{{timelabel && !isRelationItem ? $t('guanlian') : $t('zirwu')}}</i>
  535. <el-link style="float:right;" @click="addRelation" v-if="timelabel && !isRelationItem">{{ $t('associatedTask') }}</el-link>
  536. <el-link style="float:right;" @click="addSubTask" v-else>{{ $t('addingsubtask') }}</el-link>
  537. </p>
  538. <!-- 关联任务列表 -->
  539. <el-table key="guanlian" :data="relationSubTaskList" v-if="timelabel && !isRelationItem"
  540. :header-cell-style="{'font-weight':'normal'}"
  541. highlight-current-row
  542. v-loading="listLoading"
  543. style="width: 100%;margin-top:10px;"
  544. @row-click="relationTaskClick">
  545. <el-table-column prop="taskStatus" :label="$t('wan-cheng')" width="50" >
  546. <template slot-scope="scope">
  547. <el-checkbox :disabled="scope.row.taskStatus==2" :checked="scope.row.taskStatus==1?true:false" size="large" class="cb" @change="relationFinishTask(scope.row)" @click.stop.native=""></el-checkbox>
  548. </template>
  549. </el-table-column>
  550. <el-table-column prop="taskName" :label="$t('biao-ti')" >
  551. <template slot-scope="scope">
  552. <el-tooltip class="item" effect="dark" :content="scope.row.taskName" placement="top" style="cursor:pointer;color:#409eff;">
  553. <span style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;" > {{scope.row.taskName}}</span>
  554. </el-tooltip>
  555. </template>
  556. </el-table-column>
  557. <el-table-column :label="$t('operation')" width="130" align="left">
  558. <template slot-scope="scope">
  559. <el-button @click.stop.native="deleteRelationItem(scope.row.id)" size="mini">{{ $t('dissociated') }}</el-button>
  560. </template>
  561. </el-table-column>
  562. </el-table>
  563. <!--子任务列表 -->
  564. <el-table key="zi" :data="addForm.subTaskList" v-else
  565. :header-cell-style="{'font-weight':'normal'}"
  566. highlight-current-row v-loading="listLoading" style="width: 100%;margin-top:10px;" @row-click="taskLineClick">
  567. <el-table-column prop="taskStatus" :label="$t('wan-cheng')" width="50" >
  568. <template slot-scope="scope">
  569. <el-checkbox :disabled="scope.row.taskStatus==2" :checked="scope.row.taskStatus==1?true:false" size="large" class="cb"
  570. @click.stop.native=""
  571. @change="finishTask(scope.row)"
  572. ></el-checkbox>
  573. </template>
  574. </el-table-column>
  575. <el-table-column prop="name" :label="$t('biao-ti')" >
  576. <template slot-scope="scope">
  577. <el-tooltip class="item" effect="dark" :content="scope.row.name" placement="top">
  578. <span style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;" > {{scope.row.name}}</span>
  579. </el-tooltip>
  580. </template>
  581. </el-table-column>
  582. <el-table-column prop="executorName" :label="$t('zhi-hang-ren')" width="100" >
  583. <template slot-scope="scope">
  584. <span v-if="user.userNameNeedTranslate != 1">
  585. {{scope.row.executorName == null?$t('dai-fen-pei'):scope.row.executorName}}
  586. </span>
  587. <span v-if="user.userNameNeedTranslate == 1">
  588. <span v-if="scope.row.executorName == null">
  589. {{$t('dai-fen-pei')}}
  590. </span>
  591. <span v-else>
  592. <ww-open-data type='userName' :openid='scope.row.executorName'></ww-open-data>
  593. </span>
  594. </span>
  595. </template>
  596. </el-table-column>
  597. <el-table-column prop="endDate" :label="$t('deadline')" width="100" >
  598. <template slot-scope="scope">
  599. <p v-if="scope.row.endDate >= times">{{scope.row.endDate}}</p>
  600. <p v-else style="background: #e62412; color: #fff;text-align: center; border-radius: 3px;">{{scope.row.endDate}}</p>
  601. </template>
  602. </el-table-column>
  603. </el-table>
  604. </div>
  605. </el-form>
  606. <!-- 关联文件列表 -->
  607. <template v-if="isEditFile">
  608. <div style="width:100%;margin:1em 0;">
  609. <i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">{{ $t('jiafuchengguo') }}</i>
  610. <el-link @click="relationFileClick()" style="float:right;margin-left:10px">{{ $t('associatedfiles') }}</el-link>
  611. <el-upload style="float:right;" action="#" :http-request="uploadFileClick" :show-file-list="false" :multiple="false">
  612. <el-link>{{ $t('uoloadFiles') }}</el-link>
  613. </el-upload>
  614. </div>
  615. <el-table
  616. v-loading="fileListLoading"
  617. ref="filetable"
  618. :data="taskFileList"
  619. :header-cell-style="{'font-weight':'normal'}"
  620. highlight-current-row
  621. max-height="240"
  622. style="width: 100%;margin-top:10px;margin-bottom:15px">
  623. <el-table-column :label="$t('headerTop.serialNumber')" prop="documentType" min-width="40" align="center">
  624. <template slot-scope="scope">
  625. <div>
  626. {{scope.$index + 1}}
  627. </div>
  628. </template>
  629. </el-table-column>
  630. <el-table-column :label="$t('filenames')" prop="documentName" min-width="180"></el-table-column>
  631. <el-table-column :label="$t('filesize')" prop="size" min-width="60" align="center"></el-table-column>
  632. <el-table-column :label="$t('founder')" prop="creatorName" min-width="60" align="center">
  633. <template slot-scope="scope">
  634. <div>
  635. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.creatorName}}</span>
  636. <span v-if="user.userNameNeedTranslate == 1">
  637. <ww-open-data type='userName' :openid='scope.row.creatorName'></ww-open-data>
  638. </span>
  639. </div>
  640. </template>
  641. </el-table-column>
  642. <el-table-column :label="$t('creationtime')" prop="indate" min-width="120" align="center">
  643. <template slot-scope="scope">
  644. <span>{{scope.row.indate[0] + '-' + scope.row.indate[1] + '-' + scope.row.indate[2] + '\u0020\u0020' + scope.row.indate[3] + ':' + scope.row.indate[4] + ':' + scope.row.indate[5]}}</span>
  645. </template>
  646. </el-table-column>
  647. <el-table-column :label="$t('operation')" min-width="90">
  648. <template slot-scope="scope">
  649. <el-link :href="scope.row.url" :download="scope.row.documentName" type="primary" style="margin-right:7px">{{ $t('other.download') }}</el-link>
  650. <el-link @click="taskFileDelete(scope.row.id)">{{ $t('btn.delete') }}</el-link>
  651. </template>
  652. </el-table-column>
  653. </el-table>
  654. </template>
  655. <!-- 关联文件dialog -->
  656. <el-dialog v-if="relationFileDialog" :visible.sync="relationFileDialog" :title="$t('associatedfiles')" append-to-body>
  657. <span>{{ $t('wenjian1guanli') }}</span>
  658. <div>
  659. <span>{{ $t('xuanzwenjian') }}</span>
  660. <el-select v-model="addFileId">
  661. <el-option
  662. v-for="item in projectFileList"
  663. :key="item.id"
  664. :label="item.documentName"
  665. :value="item.id"
  666. ></el-option>
  667. </el-select>
  668. <el-button @click="addTaskFile()">{{ $t('btn.determine') }}</el-button>
  669. <!-- <el-button @click="relationFileDialog = false">取消</el-button> -->
  670. </div>
  671. </el-dialog>
  672. <el-dialog v-if="isRelationTab" :visible.sync="isRelationTab" :title="$t('associatedTask')" width="800px" append-to-body>
  673. <el-form ref="relationItemForm" label-width="100px">
  674. <el-form-item :label="$t('selecttask')" prop="taskType">
  675. <el-select v-model="relationvalue" multiple style="width:80%">
  676. <el-option
  677. v-for="item in relationdata"
  678. :key="item.id"
  679. :label="item.name"
  680. :value="item.id"
  681. ></el-option>
  682. </el-select>
  683. </el-form-item>
  684. </el-form>
  685. <div slot="footer" class="dialog-footer">
  686. <el-button @click="isRelationTab = false">{{ $t('btn.cancel') }}</el-button>
  687. <el-button type="primary" @click="addRelationTask()">{{ $t('btn.determine') }}</el-button>
  688. </div>
  689. </el-dialog>
  690. </div>
  691. <div slot="footer" class="dialog-footer">
  692. <el-button v-if="(user.id == addForm.createrId || currentProject.inchargerId == user.id || currentProject.creatorId == user.id || permissions.projectManagement) && canAddTask" @click.native="deleteTask()" style="float:left;">{{ $t('btn.delete') }}</el-button>
  693. <el-button @click.native="addFormVisible = false">{{ $t('btn.cancel') }}</el-button>
  694. <el-button type="primary" @click="submitInsert" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  695. </div>
  696. <div slot="title" v-if="addForm.parentTid != null || isRelationItem" >
  697. <!-- <el-link @click="backToParentTask"><i class="el-icon-arrow-left single_line">返回父级任务</i> | {{addForm.parentTname}}</el-link> -->
  698. <el-page-header @back="backToParentTask" :title="timelabel ? $t('returnmilestone') : $t('parenttask')" :content="timelabel ? relationPar.name : addForm.parentTname"></el-page-header>
  699. </div>
  700. <!-- 评论 -->
  701. <div class="remark" v-show="addForm.id != null">
  702. <span class="zh">
  703. <div class="player" v-if="critic.length > 0">
  704. <p>{{ $t('participantin') }}</p>
  705. <div class="bj">
  706. <span v-for="(pl, i) in critic" :key="i">
  707. <span style="background: #778899" v-if="user.userNameNeedTranslate != 1">{{pl.length > 2 ? pl.substring(pl.length - 2, pl.length) : pl}}</span>
  708. <span v-if="user.userNameNeedTranslate == 1">
  709. <ww-open-data type='userName' :openid='pl'></ww-open-data>
  710. </span>
  711. </span>
  712. <!-- <span style="background: #778899">{{pl.length}}</span> -->
  713. </div>
  714. </div>
  715. <div class="subject">
  716. <div class="sub-all">{{ $t('alldynamic') }}</div>
  717. <div class="sub-details" ref="main">
  718. <ul class="infinite-list" v-infinite-scroll="load" style="overflow:auto" ref="contRoll">
  719. <div style="width: 100%" v-if="commentList.length <= 0">
  720. <img src="../../assets/image/xiao.png" alt="">
  721. </div>
  722. <li v-for="i in count" class="infinite-list-item counli" :key="i">
  723. <p><i class="el-icon-s-fold"></i> <em>{{ $t('managerQucompletedthedependencytask') }}</em><span>{{ $t('onApril20') }}</span></p>
  724. </li>
  725. <li class="carts" v-for="item in commentList" :key="item.id">
  726. <!-- <el-image style="width: 30px; height: 30px" :src="url" :fit="fit"></el-image> -->
  727. <!-- <i :style="'background' + item.userColor"> -->
  728. <i :style="'background' + item.userColor">
  729. <i v-if="user.userNameNeedTranslate != 1">
  730. {{item.userName.length > 2 ? item.userName.substring(item.userName.length - 2, item.userName.length) : item.userName}}
  731. </i>
  732. <i v-if="user.userNameNeedTranslate == 1">
  733. <ww-open-data type='userName' :openid='item.userName'></ww-open-data>
  734. </i>
  735. </i>
  736. <div>
  737. <!-- <p>{{item.userName}}</p> -->
  738. <!-- <p> -->
  739. <p v-if="user.userNameNeedTranslate != 1">
  740. {{item.userName}}
  741. </p>
  742. <p v-if="user.userNameNeedTranslate == 1">
  743. <ww-open-data type='userName' :openid='item.userName'></ww-open-data>
  744. </p>
  745. <!-- </p> -->
  746. <em>
  747. <!-- {{item.content}} -->
  748. <p style="display: inline-block;padding: 0;margin: 0;" v-if="user.userNameNeedTranslate == 1">
  749. {{item.content.msg1}}
  750. <ww-open-data type='userName' :openid='item.content.msg2'></ww-open-data>
  751. {{item.content.msg3}}
  752. </p>
  753. <p style="display: inline-block;padding: 0;margin: 0;" v-if="user.userNameNeedTranslate != 1">{{item.content}}</p>
  754. </em>
  755. </div>
  756. <span>{{item.createTime | relativeTime}}</span>
  757. </li>
  758. </ul>
  759. </div>
  760. </div>
  761. <div class="issue">
  762. <!-- <el-input type="textarea" class="textareays" label-width="100%" label-height="140px"></el-input> -->
  763. <div class="issue_fixation">
  764. <div class="inputDeep"><el-input
  765. type="textarea"
  766. :placeholder="$t('pleaseentercontent')"
  767. :autosize="{ minRows: 6, maxRows: 6}"
  768. v-model="textarea2"
  769. class="inputDeeps"
  770. >
  771. </el-input></div>
  772. <el-button class="issue-button" type="primary" @click="release()">{{ $t('fa-bu') }}</el-button>
  773. </div>
  774. </div>
  775. </span>
  776. </div>
  777. <!-- 评论 -->
  778. </el-dialog>
  779. <!-- 子任务列表 -->
  780. <el-dialog :title="addForm.taskType == 1 ? $t('cha-kan-guan-lian-ren-wu') : $t('cha-kan-zi-ren-wu')" v-if="subTaskVisible" :visible.sync="subTaskVisible" :close-on-click-modal="false" customClass="customWidth" width="800px">
  781. <el-table :data="addForm.subTaskList"
  782. :header-cell-style="{'font-weight':'normal'}"
  783. highlight-current-row v-loading="listLoading" style="width: 100%;margin-top:10px;" @row-click="taskLineClick">
  784. <el-table-column prop="taskStatus" label="$t('wan-cheng')" width="50" >
  785. <template slot-scope="scope">
  786. <el-checkbox :disabled="scope.row.taskStatus==2" :checked="scope.row.taskStatus==1?true:false" size="large" class="cb"
  787. @click.stop.native="finishTask(scope.row)"
  788. ></el-checkbox>
  789. </template>
  790. </el-table-column>
  791. <el-table-column prop="name" :label="$t('biao-ti')" >
  792. <template slot-scope="scope">
  793. <el-tooltip class="item" effect="dark" :content="scope.row.name" placement="top">
  794. <span style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;" > {{scope.row.name}}</span>
  795. </el-tooltip>
  796. </template>
  797. </el-table-column>
  798. <el-table-column prop="executorName" :label="$t('zhi-hang-ren')" width="100" >
  799. <template slot-scope="scope">
  800. <span v-if="user.userNameNeedTranslate != 1">
  801. {{scope.row.executorName == null?$t('dai-fen-pei'):scope.row.executorName}}
  802. </span>
  803. <span v-if="user.userNameNeedTranslate == 1">
  804. <span v-if="scope.row.executorName == null">
  805. {{$t('dai-fen-pei')}}
  806. </span>
  807. <span v-else>
  808. <ww-open-data type='userName' :openid='scope.row.executorName'></ww-open-data>
  809. </span>
  810. </span>
  811. </template>
  812. </el-table-column>
  813. <el-table-column prop="endDate" :label="$t('deadline')" width="100" ></el-table-column>
  814. </el-table>
  815. </el-dialog>
  816. <!--用户详细信息弹出框-->
  817. <el-dialog :title="$t('Checkthedetails')" v-if="userDetailVisible" :visible.sync="userDetailVisible" :close-on-click-modal="false" customClass="customWidth" width="400px">
  818. <div class="line"><span>{{ $t('lable.name') }}</span>
  819. <span v-if="user.userNameNeedTranslate != 1">{{userDetail.name}}</span>
  820. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='userDetail.name'></ww-open-data></span>
  821. </div>
  822. <div class="line"><span>{{ $t('Worknumber') }}</span><span>{{userDetail.jobNumber}}</span></div>
  823. <div class="line"><span>{{ $t('lable.phone') }}</span><span>{{userDetail.phone}}</span></div>
  824. <div class="line"><span>{{ $t('lable.department') }}</span>
  825. <span v-if="user.userNameNeedTranslate != 1">{{userDetail.departmentName}}</span>
  826. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='userDetail.departmentName'></ww-open-data></span>
  827. </div>
  828. <div class="line"><span>{{ $t('costof') }}</span><span>{{userDetail.cost}}{{ $t('Yuananhour') }}</span></div>
  829. <div slot="footer" class="dialog-footer">
  830. <el-button type="primary" @click="userDetailVisible = false" >{{ $t('btn.determine') }}</el-button>
  831. </div>
  832. </el-dialog>
  833. <!-- 新增任务分组弹出框 -->
  834. <el-dialog v-if="addGroupDialog" :visible.sync="addGroupDialog" :close-on-click-modal="false" customClass="customWidth" width="600px">
  835. <div slot="title" >
  836. <el-tabs v-model="createGroupWay">
  837. <el-tab-pane :label="$t('newgrouping')" name="new">
  838. <el-form ref="formGrouping" :model="groupForm" :rules="formGrouping" style="margin-top:40px;">
  839. <el-form-item prop="name">
  840. <el-input v-model.trim="groupForm.name" :placeholder="$t('pleaseenteragroupname')" maxlength="50"
  841. show-word-limit clearable></el-input>
  842. </el-form-item>
  843. <el-button type="primary" @click="addGroup('formGrouping')" style="width:100%;" >{{ $t('create') }}</el-button>
  844. </el-form>
  845. </el-tab-pane>
  846. <el-tab-pane :label="$t('creatintemplate')" name="template">
  847. <el-card class="template_box" :style="t.selected?'border: 1px solid #409eff;':''" v-for="(t,tIndex) in groupTemplateList" :key="t.id" @click.native="choseTemplate(tIndex)">
  848. <div>
  849. <el-row >
  850. <el-col :span="22">
  851. <div><span>{{t.name}}</span>
  852. <el-link :underline="false" type="primary" style="color:#aaa;margin-left:10px;"
  853. @click="setTemplate(t)"><i class="el-icon-setting" v-show="t.isSystem == 0" ></i>
  854. </el-link>
  855. <el-link :underline="false" type="primary" style="color:#aaa;margin-left:10px;"
  856. @click="deleteTemplate(t)"><i class="el-icon-delete" v-show="t.isSystem == 0" ></i>
  857. </el-link>
  858. </div>
  859. <div style="margin-top:10px;">
  860. <span style="color:#8c8c8c;font-size:12px;" v-for="(s,index) in t.stagesList" :key="s.id">
  861. <i class="el-icon-arrow-right" v-if="index>0"></i>
  862. {{s.stagesName}}</span>
  863. </div>
  864. </el-col>
  865. <el-col :span="2">
  866. <i class="el-icon-check" v-show="t.selected" style="font-size:20px;color:#409eff;margin-top:12px;"></i>
  867. </el-col>
  868. </el-row>
  869. </div>
  870. </el-card>
  871. <el-button type="primary" @click="addTemplateGroup" style="width:100%;" >{{ $t('create') }}</el-button>
  872. </el-tab-pane>
  873. </el-tabs>
  874. </div>
  875. <el-dialog title="编辑模板" append-to-body v-if="setTemplateDialog" :visible.sync="setTemplateDialog" width="500px">
  876. <el-form label-width="20%">
  877. <el-form-item label="模板名称"><el-input v-model="setTemplateData.name" style="width:80%" clearable></el-input></el-form-item>
  878. <el-form-item label=""><el-checkbox v-model="setTemplateData.creWithPro">随项目自动创建</el-checkbox></el-form-item>
  879. <el-form-item v-for="item,index in setTemplateData.stagesList" :key="item.id" :label="index == 0 ? '任务列表' : ''">
  880. <el-input v-model="item.stagesName" style="width:70%" clearable></el-input>
  881. <el-link :underline="false" type="primary" style="color:#aaa;" @click="deleteStages(item,index)" v-if="index != 0">
  882. <i class="el-icon-delete"></i>
  883. </el-link>
  884. </el-form-item>
  885. <el-link style="margin-left:20%" :underline="false" type="primary" @click="addStages()">新增任务列表</el-link>
  886. </el-form>
  887. <div slot="footer" class="dialog-footer">
  888. <el-button type="primary" @click="setTemplateDialog = false">取消</el-button>
  889. <el-button type="primary" @click="setTemplateSave()">{{ $t('save') }}</el-button>
  890. </div>
  891. </el-dialog>
  892. </el-dialog>
  893. <el-dialog :title="$t('taskgroupleader')" v-if="setInchargerDialog" :visible.sync="setInchargerDialog" :close-on-click-modal="false" customClass="customWidth" width="300px">
  894. <el-form ref="formIncharger" :model="groupForm" :rules="rules" style="margin-top:10px;">
  895. <el-form-item prop="taskGpIncharge">
  896. <el-select v-if="user.userNameNeedTranslate != 1" v-model="groupForm.inchargerId" :placeholder="$t('defaultText.pleaseChoose')" style="width:100%;" clearable filterable>
  897. <el-option v-for="item in joinMembList" :key="item.id" :value="item.id" :label="item.name">
  898. <span style="float: left">{{ item.name }}</span>
  899. <span style="float: right; color: #8492a6; font-size: 13px">{{ item.jobNumber }}</span>
  900. </el-option>
  901. </el-select>
  902. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'mini'" @selectCal="selectCal" :subject="joinMembList" :subjectId="groupForm.inchargerId" :clearable="true" :distinction="'2'"></selectCat>
  903. </el-form-item>
  904. </el-form>
  905. <div slot="footer" class="dialog-footer">
  906. <el-button type="primary" @click="saveGroupIncharger" style="width:100%;" >{{ $t('save') }}</el-button>
  907. </div>
  908. </el-dialog>
  909. <el-dialog :title="$t('modifyingTaskGroup')" v-if="modGroupDialog" :visible.sync="modGroupDialog" :close-on-click-modal="false" customClass="customWidth" width="450px">
  910. <el-form ref="form2" :model="groupForm" :rules="rules" style="margin-top:10px;">
  911. <el-form-item :label="$t('bian-hao')" label-width="50px">
  912. <el-input v-model="groupForm.taskGroupCode" :placeholder="$t('peaseenterthe')" maxlength="20"
  913. show-word-limit clearable></el-input>
  914. </el-form-item>
  915. <el-form-item prop="name" :label="$t('names')" label-width="50px">
  916. <el-input type="textarea" :rows="3" v-model="groupForm.name" :placeholder="$t('peaseenterthe')" maxlength="50"
  917. show-word-limit clearable></el-input>
  918. </el-form-item>
  919. </el-form>
  920. <div slot="footer" class="dialog-footer">
  921. <el-button type="primary" @click="addGroup('form2')" style="width:100%;" >{{ $t('save') }}</el-button>
  922. </div>
  923. </el-dialog>
  924. <el-dialog :title="$t('addtemplate')" v-if="addToTmpDialog" :visible.sync="addToTmpDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  925. <el-form ref="formTmp" :model="templateForm" :rules="rules" style="margin-top:10px;">
  926. <el-form-item prop="name">
  927. <el-input v-model="templateForm.name" :placeholder="$t('entertemplatename')" maxlength="12"
  928. show-word-limit clearable></el-input>
  929. <div>
  930. <span style="margin-right:20px">{{ $t('sametimetosave') }}</span>
  931. <el-checkbox v-model="templateForm.saveTask" :label="$t('other.task')"></el-checkbox>
  932. <el-checkbox v-model="templateForm.saveMileStone" :label="$t('other.milestone')"></el-checkbox>
  933. <el-checkbox v-model="templateForm.saveRisk" :label="$t('risk')"></el-checkbox>
  934. <el-checkbox v-model="templateForm.automatically" :label="$t('suixiangmuzidongchuangjian')"></el-checkbox>
  935. </div>
  936. </el-form-item>
  937. </el-form>
  938. <div slot="footer" class="dialog-footer">
  939. <el-button type="primary" @click="createTemplate" style="width:100%;" :loading="saveTemplateLoading">{{ $t('savetemplate') }}</el-button>
  940. </div>
  941. </el-dialog>
  942. <!-- 新增任务列表弹出框 -->
  943. <el-dialog :title="$t('modifyingtheTaskList')" v-if="addStageDialog" :visible.sync="addStageDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  944. <el-form ref="form2" :model="stageForm" :rules="rules2" >
  945. <el-form-item prop="stagesName">
  946. <el-input v-model="stageForm.stagesName" :placeholder="$t('pleaseenteratasklistname')" maxlength="60"
  947. show-word-limit clearable>
  948. <template slot="prepend">
  949. <div style="width:90px">{{ $t('ren-wu-lie-biao-ming-cheng') }}</div>
  950. </template></el-input>
  951. <el-input v-if="user.timeType.stageHasEvtime == 1" id="stageForm_ysgs" v-model="stageForm.stagesTime" style="margin-top:5px" @keyup.native="restrictNumber('stageForm_ysgs')">
  952. <template slot="prepend">
  953. <div style="width:90px">{{ $t('yu-suan-gong-shi') }}<span>(h)</span></div>
  954. </template>
  955. </el-input>
  956. </el-form-item>
  957. </el-form>
  958. <div slot="footer" class="dialog-footer">
  959. <el-button type="primary" @click="addStagePost" style="width:100%;" >{{ $t('save') }}</el-button>
  960. </div>
  961. </el-dialog>
  962. <!--导出数据条件选择 -->
  963. <el-dialog :title="$t('workplanexport')" v-if="exportDialog" :visible.sync="exportDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  964. <el-form ref="form3" >
  965. <el-form-item :label="$t('choosetype')">
  966. <el-select v-model="exportTaskType" :placeholder="$t('typesof')" clearable style="width:350px;">
  967. <el-option :label="$t('other.task')" value="0"></el-option>
  968. <el-option :label="$t('other.milestone')" value="1"></el-option>
  969. <el-option :label="$t('risk')" value="2"></el-option>
  970. </el-select>
  971. </el-form-item>
  972. </el-form>
  973. <div slot="footer" class="dialog-footer">
  974. <el-button type="primary" @click="exportTask" style="width:100%;" :loading="loadingExport">{{ $t('export.export') }}</el-button>
  975. </div>
  976. </el-dialog>
  977. <!--导入数据,下载模板 -->
  978. <el-dialog :title="$t('wdorkplanimport')" v-if="importTaskDialog" :visible.sync="importTaskDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  979. <el-form ref="form4" >
  980. <el-form-item :label="'1. '+$t('qing-xian-xia-zai-mo-ban-bing-tian-xie-hou-shang-chuan')" >
  981. <el-link type="primary" :underline="false" href="./upload/项目任务导入模板.xlsx" :download="$t('projectTaskTemplate') + '.xlsx'">{{ $t('projecttasktemplatedownload') }}</el-link>
  982. </el-form-item>
  983. <!-- <el-form-item label="2. 选择要导入的任务列表" v-if="false">
  984. <el-select v-model="importToStageId" placeholder="任务列表" style="width:350px;">
  985. <el-option v-for="item in stageList" :label="item.stagesName" :value="item.id" :key="item.id"></el-option>
  986. </el-select>
  987. </el-form-item> -->
  988. <div><span style="font-size:12px;color:#999;">{{ $t('faoesgfavsbxjs') }}</span></div>
  989. </el-form>
  990. <div slot="footer" class="dialog-footer">
  991. <el-upload ref="upload" action="#" :limit="1" :http-request="importTask" :show-file-list="false">
  992. <el-button type="primary" :underline="false" style="width:100%;" :loading="loadingExport">{{ $t('uoloadFiles') }}</el-button>
  993. </el-upload>
  994. </div>
  995. </el-dialog>
  996. </div>
  997. </div>
  998. </section>
  999. </template>
  1000. <script>
  1001. // 自定义select组件
  1002. import selectCat from "@/components/select.vue"
  1003. import util from "../../common/js/util";
  1004. import draggable from 'vuedraggable';
  1005. import tinymce from 'tinymce/tinymce'
  1006. import 'tinymce/themes/silver/theme'
  1007. import 'tinymce/skins/ui/oxide/skin.css';
  1008. import FileCenter from './fileCenter.vue';
  1009. import ProjectInfo from './info.vue';
  1010. import Summary from './summary.vue';
  1011. import Earning from './earning.vue';
  1012. import CostBaseline from './CostBaseline.vue'
  1013. // import editor from '@tinymce/tinymce-vue'
  1014. // 富文本样式
  1015. import 'quill/dist/quill.core.css'
  1016. import 'quill/dist/quill.snow.css'
  1017. import 'quill/dist/quill.bubble.css'
  1018. // 导入富文本
  1019. import { quillEditor } from 'vue-quill-editor'
  1020. import { error } from 'dingtalk-jsapi';
  1021. import delete$ from 'dingtalk-jsapi/api/biz/cspace/delete';
  1022. let id=1;
  1023. export default {
  1024. name: "two-list-headerslots",
  1025. display: "Two list header slot",
  1026. order: 14,
  1027. components: {
  1028. draggable,
  1029. // editor,
  1030. FileCenter,
  1031. ProjectInfo,
  1032. Summary,
  1033. CostBaseline,
  1034. Earning,
  1035. quillEditor, // 富文本
  1036. selectCat
  1037. },
  1038. data() {
  1039. return {
  1040. componentFlg: false,
  1041. mileageCup: false,
  1042. loadingExport : false,
  1043. saveTemplateLoading: false,
  1044. joinMembList:[],
  1045. setInchargerDialog: false,
  1046. recentProgressInfo:{},
  1047. addToTmpDialog:false,
  1048. templateForm:{},
  1049. importTaskDialog:false,
  1050. importToStageId:null,
  1051. exportDialog: false,
  1052. exportTaskType:null,
  1053. groupTemplateList:[],
  1054. createGroupWay:'new',
  1055. modGroupDialog:false,
  1056. subTaskVisible:false,
  1057. orderList:[{id:"seq",name:this.$t('manuallydragthesequence'),isDesc:false},{id:"create_date",name:this.$t('creationtimeisthelatest'),isDesc:true},
  1058. {id:"end_date",name:this.$t('deadlineisthelatest'),isDesc:true},
  1059. {id:"task_level",name:this.$t('highestpriority'),isDesc:true}],
  1060. order:"seq",
  1061. isDesc:false,
  1062. taskDataList:[],
  1063. displayTable: false,
  1064. 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')},
  1065. {id:5,name:this.$t('createdthetask')},{id:6,name:this.$t('missionIwason')},{id:7,name:this.$t('todaytask')},{id:8,name:this.$t('taskthatisoverdue')}],
  1066. importanceList:[{id:0,name:this.$t('yi-ban')},{id:1,name:this.$t('zhong-yao')},{id:2,name:this.$t('jin-ji')},],
  1067. 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"}],
  1068. taskTypeColor:['#20A0FF','#8613ad','#bf0404'],
  1069. taskTypeIcon:['iconfont firerock-iconrenwu','iconfont firerock-iconicon-','iconfont firerock-iconfengxian'],
  1070. taskStatusList:[this.$t('ongoing'),this.$t('state.completed'),this.$t('state.undone')],
  1071. //优先级
  1072. taskLevelColor:['#262626','#E6A23C','#F56C6C'],
  1073. stageListHeight:0,
  1074. taskListinH:0,
  1075. groupWidth:260,
  1076. drag: false,
  1077. stageDrag: false,
  1078. dragging: false,
  1079. stageList:[],
  1080. selectedGroup:{},
  1081. allGroupData:[],
  1082. defaultGroupId:null,
  1083. addGroupDialog: false,
  1084. addStageDialog: false,
  1085. groupSearch:null,
  1086. groupType:0,//0-分组,1-视图
  1087. groupList: [],
  1088. groupForm:{},
  1089. stageForm:[],
  1090. curProjectId:null,
  1091. projectList:null,
  1092. activeIndex:"1",
  1093. activeName:"projectInside",
  1094. searchField:null,
  1095. keyword:null,
  1096. user: JSON.parse(sessionStorage.getItem("user")),
  1097. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  1098. userDetailVisible: false,
  1099. userDetail:{},
  1100. date: new Date(),
  1101. users: [],
  1102. tableHeight: 0,
  1103. listLoading: false,
  1104. subProjectVisible: false,
  1105. subProjectList: [],//子项目列表
  1106. currentProject:{},
  1107. addSubProject: false,
  1108. addFormVisible: false,
  1109. addLoading: false,
  1110. title: "",
  1111. addForm: {
  1112. name: '',
  1113. },
  1114. rules: {
  1115. name: [{ required: true, message: this.$t('pleaseenteragroupname'), trigger: "blur" }],
  1116. },
  1117. rules2: {
  1118. stagesName: [{ required: true, message: this.$t('pleaseenteratasklistname'), trigger: "blur" }],
  1119. },
  1120. taskRules : {
  1121. name: [{ required: true, message: this.$t('enterthetaskcontent'), trigger: "blur" }],
  1122. },
  1123. formGrouping: {
  1124. name: [{ required: true, message: this.$t('pleaseenteragroupname'), trigger: "blur" }],
  1125. },
  1126. sleectId: null,
  1127. sleectProjectId: null,
  1128. sidebarIndex: 0, // 侧边栏索引
  1129. url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
  1130. count: 0,
  1131. textarea2: '',
  1132. taskId: null,
  1133. commentList: [],
  1134. radio: 0,
  1135. critic: [], // 评论头像的数组
  1136. editorOption: { // 富文本框里面的默认值
  1137. placeholder: this.$t('pleaseentethetext'),
  1138. modules: {
  1139. toolbar:[
  1140. ['bold', 'italic', 'underline', 'strike'], //加粗,斜体,下划线,删除线
  1141. // ['blockquote', 'code-block'], //引用,代码块
  1142. [{ 'header': 1 }, { 'header': 2 }], // 标题,键值对的形式;1、2表示字体大小
  1143. // [{ 'list': 'ordered'}, { 'list': 'bullet' }], //列表
  1144. // [{ 'script': 'sub'}, { 'script': 'super' }], // 上下标
  1145. // [{ 'indent': '-1'}, { 'indent': '+1' }], // 缩进
  1146. // [{ 'direction': 'rtl' }], // 文本方向
  1147. [{ 'size': ['small', false, 'large', 'huge'] }], // 字体大小
  1148. [{ 'header': [1, 2, 3, 4, 5, 6, false] }], //几级标题
  1149. [{ 'color': [] }, { 'background': [] }], // 字体颜色,字体背景颜色
  1150. // [{ 'font': [] }], //字体
  1151. [{ 'align': [] }], //对齐方式
  1152. ['clean'], //清除字体样式
  1153. // ['image','video'] //上传图片、上传视频
  1154. ['image'] //上传图片、上传视频
  1155. ], //工具栏设置
  1156. },
  1157. theme: 'snow',
  1158. },
  1159. textContent: true, // 控制提交
  1160. times: null,
  1161. text2: '',
  1162. innerVisibless: false, // 任务展示弹出层
  1163. activities: [{
  1164. content: this.$t('normals'),
  1165. timestamp: this.$t('hoursago'),
  1166. size: 'large',
  1167. type: 'primary',
  1168. icon: 'el-icon-circle-check',
  1169. color: '#409EFF'
  1170. }, {
  1171. content: this.$t('withinthetimelimit'),
  1172. timestamp: this.$t('hoursago8'),
  1173. color: '#F87872'
  1174. }],
  1175. ProgressList: [],
  1176. checkboxGrounp: [], // 选中人的数据
  1177. checkLists: [], // 选中人数据的ID
  1178. taskIid: null,
  1179. gstimday:[],
  1180. gstimhour:[],
  1181. timelabel: false,
  1182. relationdata: [],
  1183. isRelationTab: false,
  1184. relationvalue:[],
  1185. relationSubTaskList:[],
  1186. relationItemData: null,
  1187. relationPar:{name: ''},
  1188. isRelationItem: false,
  1189. // 关联文件
  1190. fileListLoading:false,
  1191. projectFileList:[],
  1192. taskFileList:[],
  1193. relationFileDialog: false,
  1194. addFileId: null,
  1195. isEditFile: false,
  1196. // 设置项目参与人
  1197. participantsDialog: false,
  1198. participantsFilterText: '',
  1199. deptMembData: [
  1200. {
  1201. id: 0,
  1202. label: this.$t('lable.unassigned'),
  1203. }
  1204. ],
  1205. defaultProps: {
  1206. children: 'children',
  1207. label: 'label'
  1208. },
  1209. chosenMembCount: 0,
  1210. ididid:null,
  1211. alreadyPartArray: [],
  1212. projectCreatorId: null,
  1213. projectInchargerId: null,
  1214. canAddTask: false, // 分组创建任务的判断
  1215. groupResponsibleId: '', // 分组负责人的id
  1216. groupDetailsShow: false,
  1217. groupDetailData: {},
  1218. groupDetailTil: '',
  1219. setTemplateData: {},
  1220. setTemplateDialog: false
  1221. };
  1222. },
  1223. watch: {
  1224. participantsFilterText(val) {
  1225. this.$refs.chooseMembTree2.filter(val);
  1226. }
  1227. },
  1228. methods: {
  1229. restrictNumber(targetId) {
  1230. let inpu = document.getElementById(targetId)
  1231. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  1232. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  1233. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  1234. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  1235. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  1236. inpu.value = parseFloat(inpu.value);
  1237. }
  1238. },
  1239. test(item){
  1240. // let pro = this.$route
  1241. console.log('test',this.projectList);
  1242. },
  1243. setParticipants(){
  1244. let chosenList = this.$refs.chooseMembTree2.getCheckedNodes();
  1245. let chose2 = chosenList.filter(item=>item.isUser == 1)
  1246. let chose3 = []
  1247. for(let i=0;i<chose2.length;i++){chose3.push(chose2[i].id)}
  1248. console.log('test',chose2,chose3);
  1249. this.http.post('/group-participator/save',{
  1250. groupId: this.ididid,
  1251. idsJson: JSON.stringify(chose3)
  1252. },res => {
  1253. if(res.code == 'ok'){
  1254. this.participantsDialog = false
  1255. this.$message({
  1256. message: this.$t('setupthesuccess'),
  1257. type: 'success'
  1258. })
  1259. }else {
  1260. this.$message({
  1261. message: res.msg,
  1262. type: 'error'
  1263. })
  1264. }
  1265. },error => {
  1266. this.$message({
  1267. message: error,
  1268. type: 'error'
  1269. })
  1270. })
  1271. },
  1272. // 设置项目参与人
  1273. setupParticipants(item){
  1274. this.ididid = item.id
  1275. this.participantsFilterText = ''
  1276. console.log(item);
  1277. this.participantsDialog = true
  1278. this.getAlreadyPartArray(item.id)
  1279. this.getDepartmentList()
  1280. },
  1281. // 获取用于设置参与人的列表
  1282. getDepartmentList(){
  1283. this.http.post('/department/listAllMemb',{
  1284. },res => {
  1285. if(res.code == 'ok'){
  1286. let list = res.data
  1287. this.haveUsersList(list)
  1288. this.deptMembData = JSON.parse(JSON.stringify(list))
  1289. console.log('123',this.deptMembData);
  1290. }else {
  1291. this.$message({
  1292. message: res.msg,
  1293. type: 'error'
  1294. })
  1295. }
  1296. },error => {
  1297. this.$message({
  1298. message: error,
  1299. type: 'error'
  1300. })
  1301. })
  1302. },
  1303. haveUsersList(list){
  1304. for (var i in list) {
  1305. if (list[i].children != null) {
  1306. this.haveUsersList(list[i].children);
  1307. }
  1308. if (list[i].userList != null) {
  1309. if (list[i].children == null) {
  1310. list[i].children = [];
  1311. }
  1312. list[i].userList.forEach(element => {
  1313. var obj = {id: element.id, label:element.name, parentId:element.departmentId, isUser:1};
  1314. list[i].children.push(obj);
  1315. });
  1316. }
  1317. }
  1318. },
  1319. // 获取已参与人员
  1320. getAlreadyPartArray(eid){
  1321. this.http.post('/group-participator/get',{
  1322. groupId: eid
  1323. },res => {
  1324. if(res.code == 'ok'){
  1325. this.alreadyPartArray = res.data
  1326. this.chosenMembCount = res.data.length
  1327. // console.log('get',res.data, this.alreadyPartArray)
  1328. }else {
  1329. this.$message({
  1330. message: res.msg,
  1331. type: 'error'
  1332. })
  1333. }
  1334. },error => {
  1335. this.$message({
  1336. message: error,
  1337. type: 'error'
  1338. })
  1339. })
  1340. },
  1341. // 筛选逻辑
  1342. filterNode(value, data) {
  1343. if (!value) return true;
  1344. return data.label.indexOf(value) !== -1;
  1345. },
  1346. // 选中改变
  1347. onTreeItemChange() {
  1348. var chosenList = this.$refs.chooseMembTree2.getCheckedNodes();
  1349. var list = chosenList.filter(item=>item.isUser == 1);
  1350. this.chosenMembCount = list.length;
  1351. },
  1352. // 关联文件按钮
  1353. relationFileClick(){
  1354. this.relationFileDialog = true
  1355. this.addFileId = null
  1356. this.getProjectFileList()
  1357. },
  1358. // 确认关联文件
  1359. addTaskFile(){
  1360. if(this.addFileId == null){
  1361. this.$message({message: this.$t('xuanzguanlianwenjian') , type: 'warning'})
  1362. return
  1363. }
  1364. this.http.post('/task-files/addDocumentRef',{
  1365. documentId: this.addFileId,
  1366. taskId: this.addForm.id,
  1367. projectId: this.curProjectId
  1368. },res => {
  1369. if(res.code == 'ok'){
  1370. this.$message({
  1371. message: this.$t('guan-lian-cheng-gong'),
  1372. type: 'success'
  1373. })
  1374. this.relationFileDialog = false
  1375. this.getTaskFileList()
  1376. }else {
  1377. this.$message({
  1378. message: res.msg,
  1379. type: 'error'
  1380. })
  1381. }
  1382. },error => {
  1383. this.$message({
  1384. message: error,
  1385. type: 'error'
  1386. })
  1387. })
  1388. },
  1389. // 获取项目下的文档列表
  1390. getProjectFileList(){
  1391. this.http.post('/task-files/getDocumentList',{
  1392. projectId: this.curProjectId
  1393. },res => {
  1394. if(res.code == 'ok'){
  1395. this.projectFileList = res.data
  1396. console.log('list',res.data);
  1397. }else {
  1398. this.$message({
  1399. message: res.msg,
  1400. type: 'error'
  1401. })
  1402. }
  1403. },error => {
  1404. this.$message({
  1405. message: error,
  1406. type: 'error'
  1407. })
  1408. })
  1409. },
  1410. // 获取任务下的文档列表
  1411. getTaskFileList(e,eid){
  1412. let etaskId
  1413. if(e == 1){etaskId = eid}
  1414. else{etaskId = this.addForm.id}
  1415. this.fileListLoading = true
  1416. this.http.post('/task-files/getTaskFiles',{
  1417. taskId: etaskId
  1418. },res => {
  1419. if(res.code == 'ok'){
  1420. this.fileListLoading = false
  1421. this.taskFileList = res.data
  1422. console.log('taskFileList',res.data);
  1423. }else {
  1424. this.fileListLoading = false
  1425. this.$message({
  1426. message: res.msg,
  1427. type: 'error'
  1428. })
  1429. }
  1430. },error => {
  1431. this.fileListLoading = false
  1432. this.$message({
  1433. message: error,
  1434. type: 'error'
  1435. })
  1436. })
  1437. },
  1438. // 列表的删除按钮
  1439. taskFileDelete(eid){
  1440. this.$confirm(this.$t('quxiaoguanlan'), this.$t('other.prompts'), {
  1441. confirmButtonText: this.$t('btn.determine'),
  1442. cancelButtonText: this.$t('btn.cancel'),
  1443. type: 'warning'
  1444. }).then(()=>{
  1445. this.http.post('/task-files/delete',{
  1446. id: eid
  1447. },res => {
  1448. if(res.code == 'ok'){
  1449. this.$message({
  1450. message: res.data,
  1451. type: 'success'
  1452. })
  1453. this.getTaskFileList()
  1454. }else {
  1455. this.$message({
  1456. message: res.msg,
  1457. type: 'error'
  1458. })
  1459. }
  1460. },error => {
  1461. this.$message({
  1462. message: error,
  1463. type: 'error'
  1464. })
  1465. })
  1466. }).catch(()=>{
  1467. this.$message({
  1468. message: this.$t('thedeletionhasbeencancelled'),
  1469. type: 'info'
  1470. })
  1471. })
  1472. },
  1473. // 列表的上传按钮
  1474. uploadFileClick(item){
  1475. console.log("upload",item.file);
  1476. let files = new FormData()
  1477. files.append("projectId",this.curProjectId);
  1478. files.append("taskId", this.addForm.id);
  1479. files.append("file", item.file);
  1480. this.http.uploadFile('/task-files/uploadFile',files,
  1481. res => {
  1482. if(res.code == 'ok'){
  1483. console.log(res);
  1484. this.$message({
  1485. message: this.$t('yi-shang-chuan'),
  1486. type: 'success'
  1487. })
  1488. this.getTaskFileList()
  1489. }else {
  1490. this.$message({
  1491. message: res.msg,
  1492. type: 'error'
  1493. })
  1494. }
  1495. },error => {
  1496. this.$message({
  1497. message: error,
  1498. type: 'error'
  1499. })
  1500. })
  1501. },
  1502. selchg(){ //类型切换
  1503. if(this.addForm.taskType == 1){
  1504. this.timelabel = true
  1505. if(!this.addForm.executorListFront[0].executorId) {
  1506. console.log(this.currentProject)
  1507. this.addForm.executorListFront[0].executorId = this.currentProject.inchargerId
  1508. }
  1509. }else{
  1510. this.timelabel = false
  1511. }
  1512. },
  1513. addRelation(){ //关联任务卡片
  1514. this.relationvalue = []
  1515. this.isRelationTab = true
  1516. this.getrelation()
  1517. },
  1518. addRelationTask(){ //添加关联任务
  1519. this.http.post('/task/addMileStoneTask',{
  1520. milestoneId: this.addForm.id,
  1521. taskIds: JSON.stringify(this.relationvalue)
  1522. },
  1523. res =>{
  1524. if(res.code == "ok") {
  1525. this.isRelationTab = false
  1526. this.$message({
  1527. message: this.$t('addsuccessful'),
  1528. type: 'success'
  1529. })
  1530. this.getRelationTaskList()
  1531. this.$forceUpdate()
  1532. }else {
  1533. this.$message({
  1534. message: res.msg,
  1535. type: 'error'
  1536. })
  1537. }
  1538. },
  1539. error => {
  1540. this.$message({
  1541. message: error,
  1542. type: 'error'
  1543. })
  1544. })
  1545. },
  1546. getRelationTaskList(i,e){ //获取关联任务列表
  1547. let eid = null
  1548. if(i){
  1549. eid = e
  1550. }else{
  1551. eid = this.addForm.id
  1552. }
  1553. this.http.post('/task/getMilestoneTaskList',{
  1554. milestoneId: eid
  1555. },res => {
  1556. if(res.code == 'ok') {
  1557. this.relationSubTaskList = res.data
  1558. // console.log('res',res.data);
  1559. }else {
  1560. this.$message({
  1561. message: res.msg,
  1562. type: 'error'
  1563. })
  1564. }
  1565. },error => {
  1566. this.$message({
  1567. message: error,
  1568. type: 'error'
  1569. })
  1570. })
  1571. },
  1572. getrelation(){ //获取选择关联列表
  1573. this.http.post('/task/getTaskOnlyList',{
  1574. projectId: this.curProjectId
  1575. },
  1576. res => {
  1577. if (res.code == "ok") {
  1578. this.relationdata = []
  1579. res.data.forEach( (item) =>{
  1580. if(item.taskType != 1){
  1581. this.relationdata.push(item)
  1582. }
  1583. })
  1584. // console.log('map',this.relationdata);
  1585. } else {
  1586. this.$message({
  1587. message: res.msg,
  1588. type: "error"
  1589. });
  1590. }
  1591. },
  1592. error => {
  1593. this.$message({
  1594. message: error,
  1595. type: "error"
  1596. });
  1597. });
  1598. },
  1599. // 里程碑关联任务列表
  1600. // 解除关联
  1601. deleteRelationItem(eid){
  1602. this.listLoading = true
  1603. this.http.post('/task/removeMileStoneTask',{
  1604. id: eid
  1605. },res => {
  1606. if(res.code == 'ok') {
  1607. this.getRelationTaskList()
  1608. this.listLoading = false
  1609. this.$message({
  1610. message: this.$t('jie-chu-cheng-gong'),
  1611. type: 'success'
  1612. })
  1613. }else {
  1614. this.listLoading = false
  1615. this.$message({
  1616. message: res.msg,
  1617. type: 'error'
  1618. })
  1619. }
  1620. },error => {
  1621. this.listLoading = false
  1622. this.$message({
  1623. message: error,
  1624. type: 'error'
  1625. })
  1626. })
  1627. },
  1628. // 关联任务列表是否完成修改
  1629. relationFinishTask(row){
  1630. this.http.post('/task/finish',{
  1631. id: row.taskId,
  1632. taskStatus: row.taskStatus
  1633. },res => {
  1634. if(res.code == 'ok'){
  1635. if(this.groupType == 0){
  1636. this.getStageList();
  1637. }else {
  1638. this.getViewTaskList();
  1639. }
  1640. }else{
  1641. this.$message({
  1642. message: res.msg,
  1643. type: 'error'
  1644. })
  1645. }
  1646. },error => {
  1647. this.$message({
  1648. message: error,
  1649. type: 'error'
  1650. })
  1651. })
  1652. },
  1653. //保存分组负责人
  1654. saveGroupIncharger() {
  1655. this.http.post('/task-group/saveGroupIncharger', {id: this.groupForm.id, inchargerId: this.groupForm.inchargerId, projectId: this.curProjectId},
  1656. res => {
  1657. this.setInchargerDialog = false;
  1658. if (res.code == "ok") {
  1659. this.$message({
  1660. message: this.$t('setupthesuccess'),
  1661. type: "success"
  1662. });
  1663. //更新原始分组数据
  1664. this.groupList.filter(g=>g.id == this.groupForm.id)[0].inchargerId = this.groupForm.inchargerId;
  1665. } else {
  1666. this.$message({
  1667. message: res.msg,
  1668. type: "error"
  1669. });
  1670. }
  1671. }
  1672. );
  1673. },
  1674. // 编辑模板
  1675. setTemplate(t){
  1676. console.log(t);
  1677. this.setTemplateData = t
  1678. this.setTemplateData.needDelete = []
  1679. this.setTemplateDialog = true
  1680. },
  1681. setTemplateSave(){
  1682. if(this.setTemplateData.name == '' || this.setTemplateData.name == null){
  1683. this.$message({
  1684. message: '模板名称不能为空',
  1685. type: 'error'
  1686. })
  1687. return
  1688. }
  1689. for(let i in this.setTemplateData.stagesList){
  1690. if(this.setTemplateData.stagesList[i].stagesName == '' || this.setTemplateData.stagesList[i].stagesName == null){
  1691. this.$message({
  1692. message: '任务列表名称不能为空',
  1693. type: 'error'
  1694. })
  1695. return
  1696. }
  1697. }
  1698. this.http.post('/task-group/setTemplate',this.setTemplateData,
  1699. res => {
  1700. if(res.code == 'ok'){
  1701. this.$message({
  1702. message: '修改成功',
  1703. type: 'success'
  1704. })
  1705. this.getGroupTemplate()
  1706. this.setTemplateDialog = false
  1707. }else{
  1708. this.$message({
  1709. message: res.msg,
  1710. type: 'error'
  1711. })
  1712. }
  1713. },err => {
  1714. this.$message({
  1715. message: err,
  1716. type: 'error'
  1717. })
  1718. })
  1719. },
  1720. deleteStages(item,index){
  1721. this.setTemplateData.needDelete.push(item.id)
  1722. this.setTemplateData.stagesList.splice(index,1)
  1723. console.log('deletestages',item.id);
  1724. },
  1725. addStages(){
  1726. this.setTemplateData.stagesList.push({
  1727. stagesName: '',
  1728. templateId: this.setTemplateData.id
  1729. })
  1730. },
  1731. //删除模板
  1732. deleteTemplate(t) {
  1733. var that = this;
  1734. this.$confirm(this.$t('que-ren-yao-shan-chu')+"["+t.name+"]"+this.$t('ma'), this.$t('other.prompts'), {
  1735. //type: 'warning'
  1736. }).then(() => {
  1737. this.http.post('/group-template/deleteTemplate', {id: t.id},
  1738. res => {
  1739. if (res.code == "ok") {
  1740. this.getGroupTemplate();
  1741. this.$message({
  1742. message: this.$t('deletingTemplateSuccessfully'),
  1743. type: "success"
  1744. });
  1745. } else {
  1746. this.$message({
  1747. message: res.msg,
  1748. type: "error"
  1749. });
  1750. }
  1751. }
  1752. );
  1753. });
  1754. },
  1755. //创建模板
  1756. createTemplate() {
  1757. this.saveTemplateLoading = true;
  1758. this.http.post('/group-template/addTemplate', this.templateForm,
  1759. res => {
  1760. this.saveTemplateLoading = false;
  1761. if (res.code == "ok") {
  1762. this.addToTmpDialog = false;
  1763. this.getGroupTemplate();
  1764. this.$message({
  1765. message: this.$t('addTemplateSuccessfully'),
  1766. type: "success"
  1767. });
  1768. } else {
  1769. this.$message({
  1770. message: res.msg,
  1771. type: "error"
  1772. });
  1773. }
  1774. }
  1775. );
  1776. },
  1777. addToTemplate(item) {
  1778. this.addToTmpDialog = true;
  1779. this.templateForm = {groupId: item.id, name:item.name, saveTask:false, saveMileStone:false, saveRisk:false};
  1780. },
  1781. changeBase() {
  1782. this.$refs.earning.refreshPage();
  1783. },
  1784. // 批量导入人员
  1785. importTask(item) {
  1786. //首先判断文件类型
  1787. this.loadingExport = true
  1788. let str = item.file.name.split(".");
  1789. let format = str[str.length - 1];
  1790. if (format != "xls" && format != "xlsx") {
  1791. this.loadingExport = false
  1792. this.$message({
  1793. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  1794. type: "error"
  1795. });
  1796. } else {
  1797. this.listLoading = true;
  1798. let formData = new FormData();
  1799. formData.append("file", item.file);
  1800. formData.append("projectId", this.curProjectId);
  1801. formData.append("groupId", this.selectedGroup.id);
  1802. // formData.append("stagesId", this.importToStageId);
  1803. this.http.uploadFile('/task/importTask', formData,
  1804. res => {
  1805. this.$refs.upload.clearFiles();
  1806. this.listLoading = false;
  1807. this.loadingExport = false
  1808. if (res.code == "ok") {
  1809. this.$message({
  1810. message: this.$t('other.importSuccess'),
  1811. type: "success"
  1812. });
  1813. //重新读取列表
  1814. this.getStageList();
  1815. this.importTaskDialog = false;
  1816. } else {
  1817. this.$message({
  1818. message: res.msg,
  1819. type: "error"
  1820. });
  1821. }
  1822. },
  1823. error => {
  1824. this.$refs.upload.clearFiles();
  1825. this.listLoading = false;
  1826. this.loadingExport = false
  1827. this.$message({
  1828. message: error,
  1829. type: "error"
  1830. });
  1831. });
  1832. }
  1833. },
  1834. //删除任务进展
  1835. deleteTaskProgress(id) {
  1836. this.http.post('/task-progress/deleteProgress', {id: id},
  1837. res => {
  1838. if (res.code == "ok") {
  1839. this.getTaskProgressList(this.taskIid)
  1840. this.$message({
  1841. message: this.$t('message.successfullyDeleted'),
  1842. type: "success"
  1843. });
  1844. } else {
  1845. this.$message({
  1846. message: res.msg,
  1847. type: "error"
  1848. });
  1849. }
  1850. }
  1851. );
  1852. },
  1853. //创建任务进展
  1854. addTaskProgress() {
  1855. var param = {
  1856. taskId: this.taskIid,
  1857. status: this.radio,
  1858. content: this.text2,
  1859. participatorIds: this.checkLists.toString()
  1860. };
  1861. this.http.post('/task-progress/addProgress', param,
  1862. res => {
  1863. if (res.code == "ok") {
  1864. this.shutPro()
  1865. this.getTaskProgressList(this.taskIid)
  1866. this.$message({
  1867. message: this.$t('releasesuccess'),
  1868. type: "success"
  1869. });
  1870. this.checkboxGrounp = [],
  1871. this.checkLists = [],
  1872. this.text2 = '',
  1873. this.radio = 0
  1874. } else {
  1875. this.$message({
  1876. message: res.msg,
  1877. type: "error"
  1878. });
  1879. }
  1880. }
  1881. );
  1882. },
  1883. //获取任务进展列表
  1884. getTaskProgressList(taskId) {
  1885. this.taskIid = taskId
  1886. this.http.post('/task-progress/list', {taskId: taskId},
  1887. res => {
  1888. if (res.code == "ok") {
  1889. this.ProgressList = res.data;
  1890. this.recentProgressInfo = res.data[0]
  1891. } else {
  1892. this.$message({
  1893. message: res.msg,
  1894. type: "error"
  1895. });
  1896. }
  1897. }
  1898. );
  1899. },
  1900. kkk(el){
  1901. var k = this.checkLists.indexOf(el.id)
  1902. if (k == -1) {
  1903. this.checkLists.push(el.id)
  1904. } else {
  1905. this.checkLists.splice(k, 1)
  1906. }
  1907. },
  1908. showExportDialog() {
  1909. this.exportDialog = true;
  1910. },
  1911. exportTask() {
  1912. let _this = this;
  1913. this.loadingExport = true
  1914. this.http.post('/task/exportTask', {projectId: this.curProjectId, taskType: this.exportTaskType},
  1915. res => {
  1916. this.loadingExport = false
  1917. if (res.code == "ok") {
  1918. location.href = res.data;
  1919. } else {
  1920. this.$message({
  1921. message: res.msg,
  1922. type: "error"
  1923. });
  1924. }
  1925. }
  1926. );
  1927. },
  1928. sss(){
  1929. this.$refs.addRem.style.display="none"
  1930. },
  1931. addprogress(){ // 添加子任务进展事件
  1932. this.$refs.proBox.style.display="block"
  1933. this.$refs.addPro.style.display="none"
  1934. },
  1935. shutPro() { // 关闭任务进展
  1936. this.$refs.addPro.style.display="block"
  1937. this.$refs.addRem.style.display="none"
  1938. this.$refs.proBox.style.display="none"
  1939. },
  1940. addI() { // 打开选择查看
  1941. this.$refs.addRem.style.display="block"
  1942. },
  1943. load() {
  1944. if(this.count >= 0) return
  1945. this.count += 2
  1946. },
  1947. onEditorFocus() {
  1948. this.onEditorBlur()
  1949. },
  1950. subMission() { // 添加
  1951. },
  1952. handleCheckedCitiesChange(value) {
  1953. let checkedCount = value.length;
  1954. this.checkAll = checkedCount === this.cities.length;
  1955. this.isIndeterminate = checkedCount > 0 && checkedCount < this.cities.length;
  1956. },
  1957. // 获得焦点时触发
  1958. onEditorBlur(){
  1959. let theEle = this.$refs.text; // 获取元素
  1960. var img = theEle.value.match(/<img[^>]+>/g); // 赛选 img 标签
  1961. var arrImg = ''
  1962. for (var j = 0; j < img.length; j++) {
  1963. // 正则匹配,摘出img标签下的src里的内容,即capture
  1964. img[j].replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, function(match, capture) {
  1965. arrImg += capture
  1966. });
  1967. }
  1968. // 原来的字符流大小,单位为字节
  1969. var strLen = arrImg.length;
  1970. // 计算后得到的文件流大小,单位为字节
  1971. var fileSize=parseInt(strLen-(strLen/8)*2);
  1972. var size = "";
  1973. size = (fileSize/1024/1024).toFixed(2);
  1974. if (size > 2){
  1975. this.textContent = false
  1976. this.$message({
  1977. showClose: true,
  1978. message: this.$t('imageexceeds2MBpleaseuploaditagain'),
  1979. type: 'warning'
  1980. });
  1981. }
  1982. this.textContent = true
  1983. },
  1984. // 侧边栏的点击事件
  1985. retract() {
  1986. if (this.$refs.box.className == 'el-icon-arrow-left') {
  1987. this.$refs.box.className = 'el-icon-arrow-right'
  1988. } else {
  1989. this.$refs.box.className = 'el-icon-arrow-left'
  1990. }
  1991. // this.$refs.box.className === 'el-icon-arrow-left' ? this.$refs.box.className = 'el-icon-arrow-right' || this.$refs.box.className = 'el-icon-arrow-left'
  1992. this.toggleGroup()
  1993. },
  1994. //
  1995. choseTemplate(tIndex) {
  1996. // this.groupTemplateList.forEach((g)=>{
  1997. // g.selected = false;
  1998. // })
  1999. this.sidebarIndex = tIndex
  2000. // this.groupTemplateList[tIndex].selected = true;
  2001. this.groupTemplateList.forEach((g, i)=>{
  2002. if(tIndex == i) {
  2003. g.selected = !g.selected;
  2004. }
  2005. })
  2006. },
  2007. //获取分组模板列表
  2008. getGroupTemplate() {
  2009. this.http.post('/group-template/getList',{},
  2010. res => {
  2011. if (res.code == "ok") {
  2012. this.groupTemplateList = res.data;
  2013. this.groupTemplateList[0].selected = true;
  2014. } else {
  2015. this.$message({
  2016. message: res.msg,
  2017. type: "error"
  2018. });
  2019. }
  2020. },
  2021. error => {
  2022. this.$message({
  2023. message: error,
  2024. type: "error"
  2025. });
  2026. });
  2027. },
  2028. copyGroup(item) {
  2029. this.http.post('/task-group/copy',{id: item.id},
  2030. res => {
  2031. if (res.code == "ok") {
  2032. this.getTaskGroups();
  2033. } else {
  2034. this.$message({
  2035. message: res.msg,
  2036. type: "error"
  2037. });
  2038. }
  2039. },
  2040. error => {
  2041. this.$message({
  2042. message: error,
  2043. type: "error"
  2044. });
  2045. });
  2046. },
  2047. //重启项目
  2048. startPro() {
  2049. this.http.post('/project/start',{id: this.curProjectId},
  2050. res => {
  2051. if (res.code == "ok") {
  2052. this.$message({
  2053. message: this.$t('restartthesuccess'),
  2054. type: "success"
  2055. });
  2056. this.currentProject.status = 1;
  2057. } else {
  2058. this.$message({
  2059. message: res.msg,
  2060. type: "error"
  2061. });
  2062. }
  2063. },
  2064. error => {
  2065. this.$message({
  2066. message: error,
  2067. type: "error"
  2068. });
  2069. });
  2070. },
  2071. //撤销项目
  2072. cancelPro() {
  2073. this.http.post('/project/cancel',{id: this.curProjectId},
  2074. res => {
  2075. if (res.code == "ok") {
  2076. this.$message({
  2077. message: this.$t('Revocationofsuccess'),
  2078. type: "success"
  2079. });
  2080. this.currentProject.status = 3;
  2081. } else {
  2082. this.$message({
  2083. message: res.msg,
  2084. type: "error"
  2085. });
  2086. }
  2087. },
  2088. error => {
  2089. this.$message({
  2090. message: error,
  2091. type: "error"
  2092. });
  2093. });
  2094. },
  2095. //完成项目
  2096. finishPro() {
  2097. this.http.post('/project/finish',{id: this.curProjectId},
  2098. res => {
  2099. if (res.code == "ok") {
  2100. this.$message({
  2101. message: this.$t('projectcompletion'),
  2102. type: "success"
  2103. });
  2104. this.currentProject.status = 2;
  2105. } else {
  2106. this.$message({
  2107. message: res.msg,
  2108. type: "error"
  2109. });
  2110. }
  2111. },
  2112. error => {
  2113. this.$message({
  2114. message: error,
  2115. type: "error"
  2116. });
  2117. });
  2118. },
  2119. //删除当前编辑的任务
  2120. deleteTask() {
  2121. var warning='';
  2122. if (this.addForm.subTaskList.length > 0) {
  2123. warning=this.$t('currenttaskanditssubtasks');
  2124. } else {
  2125. warning=this.$t('wanttodeletethecurrent task');
  2126. }
  2127. this.$confirm(warning, this.$t('other.prompts'), {
  2128. //type: 'warning'
  2129. }).then(() => {
  2130. this.http.post('/task/delete',{id: this.addForm.id},
  2131. res => {
  2132. if (res.code == "ok") {
  2133. this.addFormVisible = false;
  2134. this.getStageList();
  2135. } else {
  2136. this.$message({
  2137. message: res.msg,
  2138. type: "error"
  2139. });
  2140. }
  2141. },
  2142. error => {
  2143. this.$message({
  2144. message: error,
  2145. type: "error"
  2146. });
  2147. });
  2148. });
  2149. },
  2150. //tab页签切换
  2151. handleClick(tab, event) {
  2152. let pathModel = tab.name;
  2153. this.$router.push('/'+pathModel+'/'+this.curProjectId);
  2154. if(tab.name == 'costbaseline'){
  2155. this.$refs.costbaseline.refreshPage();
  2156. }
  2157. if(tab.name == 'info') {
  2158. this.$refs.projectInfo.getMileStoneList()
  2159. }
  2160. },
  2161. showSubTaskList(task) {
  2162. this.subTaskVisible = true;
  2163. this.addForm = task;
  2164. // console.log('click',task.subTaskList);
  2165. },
  2166. backToParentTask() {
  2167. // this.getTaskDetail(this.addForm.parentTid);
  2168. this.getTaskDetail(this.timelabel ? this.relationPar.id : this.addForm.parentTid);
  2169. if(this.timelabel){
  2170. this.isRelationItem = false
  2171. // this.relationPar = {name: ''}
  2172. this.getRelationTaskList(1, this.relationPar.id)
  2173. this.gain(this.relationPar)
  2174. }
  2175. },
  2176. //显示子任务创建卡片
  2177. addSubTask() {
  2178. if(this.isRelationItem){return}
  2179. this.addFormVisible = true;
  2180. this.addForm = {parentTname: this.addForm.name,parentTid: this.addForm.id,projectId: this.addForm.projectId, groupId: this.addForm.groupId, taskLevel:0, planHours: 8, taskType: 0};
  2181. this.addForm.executorListFront = [{executorId:null, planHours:8}];
  2182. this.addLoading = false;
  2183. },
  2184. //认领任务
  2185. addAsMyTask(task) {
  2186. this.http.post('/task/addAsMyTask',{id: task.id},
  2187. res => {
  2188. if (res.code == "ok") {
  2189. this.getStageList();
  2190. } else {
  2191. this.$message({
  2192. message: res.msg,
  2193. type: "error"
  2194. });
  2195. }
  2196. },
  2197. error => {
  2198. this.$message({
  2199. message: error,
  2200. type: "error"
  2201. });
  2202. });
  2203. },
  2204. taskLineClick(row, column, event) {
  2205. if(this.isRelationItem){return}
  2206. this.editTask(row);
  2207. },
  2208. //排序发生改变
  2209. orderChange() {
  2210. this.isDesc = this.orderList.filter(o=>o.id == this.order)[0].isDesc;
  2211. if (this.groupType == 0) {
  2212. this.getStageList();
  2213. } else {
  2214. this.getViewTaskList();
  2215. }
  2216. },
  2217. //加载视图任务列表
  2218. getViewTaskList() {
  2219. this.http.post('/task/list',{projectId: this.curProjectId, viewId: this.selectedGroup.id, order: this.order, isDesc: this.isDesc},
  2220. res => {
  2221. if (res.code == "ok") {
  2222. // this.taskDataList = res.data;
  2223. // console.log(this.taskDataList, '任务视图的列表')
  2224. for(var i in res.data) {
  2225. if(res.data[i].executorName != null) {
  2226. res.data[i].executorName = res.data[i].executorName.split(',')
  2227. }
  2228. }
  2229. this.taskDataList = res.data;
  2230. console.log(this.taskDataList, '任务视图的列表')
  2231. this.taskDataList.forEach(t=>{
  2232. t.isFinish = t.taskStatus==1?true:false;
  2233. });
  2234. } else {
  2235. this.$message({
  2236. message: res.msg,
  2237. type: "error"
  2238. });
  2239. }
  2240. },
  2241. error => {
  2242. this.$message({
  2243. message: error,
  2244. type: "error"
  2245. });
  2246. });
  2247. },
  2248. //阶段拖拽
  2249. onMoveStage(e) {
  2250. var data = {
  2251. groupId:this.selectedGroup.id,
  2252. oldIndex: e.oldIndex,
  2253. newIndex: e.newIndex,};
  2254. this.http.post('/stages/changeStageOrder',data,
  2255. res => {
  2256. if (res.code == "ok") {
  2257. this.getStageList();
  2258. } else {
  2259. this.$message({
  2260. message: res.msg,
  2261. type: "error"
  2262. });
  2263. }
  2264. },
  2265. error => {
  2266. this.$message({
  2267. message: error,
  2268. type: "error"
  2269. });
  2270. });
  2271. },
  2272. onChange(e) {
  2273. var data = {
  2274. id:e.item.id,
  2275. oldIndex: e.oldIndex ,
  2276. newIndex: e.newIndex ,
  2277. oldStagesId: e.from.id,
  2278. newStagesId: e.to.id};
  2279. this.http.post('/task/changeOrder',data,
  2280. res => {
  2281. if (res.code == "ok") {
  2282. this.getStageList();
  2283. } else {
  2284. this.$message({
  2285. message: res.msg,
  2286. type: "error"
  2287. });
  2288. }
  2289. },
  2290. error => {
  2291. this.$message({
  2292. message: error,
  2293. type: "error"
  2294. });
  2295. });
  2296. },
  2297. toggleGroup() {
  2298. if (this.groupWidth == 0) {
  2299. this.groupWidth = 260;
  2300. } else {
  2301. this.groupWidth = 0;
  2302. }
  2303. },
  2304. finishTask(task) {
  2305. console.log(123)
  2306. this.http.post('/task/finish',{id: task.id, taskStatus: task.taskStatus},
  2307. res => {
  2308. if (res.code == "ok") {
  2309. if (this.groupType == 0) {
  2310. this.getStageList();
  2311. } else {
  2312. this.getViewTaskList();
  2313. }
  2314. } else {
  2315. this.$message({
  2316. message: res.msg,
  2317. type: "error"
  2318. });
  2319. }
  2320. },
  2321. error => {
  2322. this.$message({
  2323. message: error,
  2324. type: "error"
  2325. });
  2326. });
  2327. },
  2328. // 点击卡片事件
  2329. editTask(task) {
  2330. this.mileageCup = true
  2331. // console.log('editTask',task)
  2332. if(task.taskType == 1){
  2333. this.timelabel = true
  2334. this.isRelationItem = false
  2335. }else{
  2336. this.timelabel = false
  2337. }
  2338. this.addFormVisible = true;
  2339. this.isEditFile = true;
  2340. this.addLoading = false;
  2341. this.title = this.$t('editingtasks');
  2342. this.getTaskDetail(task.id);
  2343. this.getTaskProgressList(task.id); // 获取任务进展列表
  2344. this.getUsers(); // 获取名单数据
  2345. this.gain(task); // 获取评论列表
  2346. this.getRelationTaskList(1, task.id)
  2347. this.getTaskFileList(1,task.id)
  2348. },
  2349. // 关联任务点击事件
  2350. relationTaskClick(row,column,event){
  2351. // console.log('relationTaskClick',row);
  2352. this.relationPar = JSON.parse(JSON.stringify(this.addForm))
  2353. // console.log(this.relationPar);
  2354. this.addFormVisible = true;
  2355. this.addLoading = false;
  2356. this.isRelationItem = true;
  2357. this.isEditFile = true;
  2358. this.title = this.$t('editingtasks');
  2359. this.getTaskDetail(row.taskId);
  2360. this.getUsers();
  2361. this.gain(row,1);
  2362. this.getRelationTaskList(1, row.taskId)
  2363. this.getTaskFileList(1,row.taskId)
  2364. },
  2365. // 获取评论列表
  2366. gain (task,e) {
  2367. this.commentList = [];
  2368. this.taskId = e == 1 ? task.taskId : task.id;
  2369. this.http.post('/task-comment/getList', {taskId: e == 1 ? task.taskId : task.id},
  2370. res => {
  2371. if (res.code == "ok") {
  2372. for(var i in res.data) {
  2373. if(res.data[i].content.indexOf('$userName=') != '-1') {
  2374. let obj = {
  2375. msg1: res.data[i].content.split('$')[0],
  2376. msg2: res.data[i].content.split('$')[1].split('=')[1],
  2377. msg3: res.data[i].content.split('$')[2]
  2378. }
  2379. res.data[i].content = obj
  2380. } else {
  2381. if(this.user.userNameNeedTranslate == 1) {
  2382. let obj = {
  2383. msg1: res.data[i].content,
  2384. msg2: '',
  2385. msg3: ''
  2386. }
  2387. res.data[i].content = obj
  2388. }
  2389. }
  2390. }
  2391. this.commentList = res.data
  2392. this.sppk(this.commentList) // 获取参与人的方法
  2393. } else {
  2394. this.$message({
  2395. message: res.msg,
  2396. type: "error"
  2397. });
  2398. }
  2399. },
  2400. error => {
  2401. this.$message({
  2402. message: error,
  2403. type: "error"
  2404. });
  2405. });
  2406. },
  2407. // 获取评论参与人
  2408. sppk(comit) {
  2409. var sk = []
  2410. comit.forEach(function(e){
  2411. sk.push(e.userName)
  2412. })
  2413. this.critic = new Set(sk)
  2414. },
  2415. // 点击发布
  2416. release() {
  2417. if(this.textarea2.length <= 0) return this.$message({message: this.$t('pleaseentercontent'), type: "error"})
  2418. this.http.post('/task-comment/add', {taskId: this.taskId, userId: this.user.id, content: this.textarea2},
  2419. res => {
  2420. if(res.code == "ok"){
  2421. this.commentList.push(res.data)
  2422. this.sppk(this.commentList)
  2423. this.textarea2 = ""
  2424. this.contRoll() // 滚动到底部
  2425. } else {
  2426. this.$message({
  2427. message: res.msg,
  2428. type: "error"
  2429. });
  2430. }
  2431. },
  2432. error => {
  2433. this.$message({
  2434. message: error,
  2435. type: "error"
  2436. });
  2437. })
  2438. },
  2439. // 滚动到底部
  2440. contRoll(){
  2441. this.$nextTick(() => {
  2442. this.$refs.main.scrollTop = this.$refs.contRoll.scrollHeight;
  2443. })
  2444. },
  2445. chggstim(e,i){
  2446. if(e){
  2447. this.gstimday[i] = Math.ceil(this.gstimhour[i] / this.user.timeType.allday)
  2448. }else{
  2449. this.gstimhour[i] = this.gstimday[i] * this.user.timeType.allday
  2450. }
  2451. },
  2452. getTaskDetail(id) {
  2453. this.http.post('/task/getTask',{id: id},
  2454. res => {
  2455. if (res.code == "ok") {
  2456. this.addForm = res.data;
  2457. this.addForm.createDate = null;
  2458. this.addForm.indate = null;
  2459. this.addLoading = false;
  2460. this.recentProgressInfo = this.addForm.progress;
  2461. this.addForm.executorListFront = this.addForm.executorList;
  2462. this.gstimday = []
  2463. this.gstimhour = []
  2464. for(let i=0;i<this.addForm.executorListFront.length;i++){
  2465. this.gstimhour.push(this.addForm.executorListFront[i].planHours),
  2466. this.gstimday.push(Math.ceil(this.addForm.executorListFront[i].planHours / this.user.timeType.allday))
  2467. }
  2468. //删除中间传值的变量数组
  2469. delete this.addForm.executorList;
  2470. } else {
  2471. this.$message({
  2472. message: res.msg,
  2473. type: "error"
  2474. });
  2475. }
  2476. },
  2477. error => {
  2478. this.$message({
  2479. message: error,
  2480. type: "error"
  2481. });
  2482. });
  2483. },
  2484. addTask(stage) {
  2485. this.mileageCup = false
  2486. this.addFormVisible = true;
  2487. this.addForm = {projectId: stage.projectId, groupId: stage.groupId, stagesId: stage.id, taskLevel:0, planHours: 8, taskType: 0};
  2488. this.addForm.executorListFront = [{executorId:null, planHours:this.user.timeType.allday}];
  2489. this.gstimhour = [this.user.timeType.allday]
  2490. this.gstimday = [1]
  2491. this.addLoading = false;
  2492. this.isEditFile = false;
  2493. this.title=this.$t('createtask ');
  2494. this.commentList = [];
  2495. this.timelabel = false
  2496. },
  2497. addExecutorLine(e) {
  2498. if(e == 1){
  2499. if (this.relationItemData.executorList == null) {
  2500. this.relationItemData.executorList = [];//初始化
  2501. }
  2502. this.relationItemData.executorList.push({executorId:null, planHours:this.user.timeType.allday});
  2503. this.gstimday.push(1)
  2504. this.gstimhour.push(this.user.timeType.allday)
  2505. this.$forceUpdate();
  2506. }else{
  2507. if (this.addForm.executorListFront == null) {
  2508. this.addForm.executorListFront = [];//初始化
  2509. }
  2510. this.addForm.executorListFront.push({executorId:null, planHours:this.user.timeType.allday});
  2511. this.gstimday.push(1)
  2512. this.gstimhour.push(this.user.timeType.allday)
  2513. this.$forceUpdate();
  2514. }
  2515. },
  2516. removeExecutorLine(index,e) {
  2517. if(e == 1){
  2518. this.relationItemData.executorList.splice(index,1);
  2519. this.gstimday.splice(index,1)
  2520. this.gstimhour.splice(index,1)
  2521. this.$forceUpdate();
  2522. }else{
  2523. this.addForm.executorListFront.splice(index,1);
  2524. this.gstimday.splice(index,1)
  2525. this.gstimhour.splice(index,1)
  2526. this.$forceUpdate();
  2527. }
  2528. },
  2529. renameStage(item) {
  2530. this.stageForm = JSON.parse(JSON.stringify(item));
  2531. this.addStageDialog = true;
  2532. },
  2533. deleteStage(item) {
  2534. var _this = this;
  2535. var param = {id:item.id, groupId: item.groupId};
  2536. this.$confirm(this.$t('detelecesTask'), this.$t('other.prompts'), {
  2537. //type: 'warning'
  2538. }).then(() => {
  2539. this.http.post('/stages/delete',param,
  2540. res => {
  2541. if (res.code == "ok") {
  2542. // this.stageList = res.data;
  2543. this.getStageList();
  2544. } else {
  2545. this.$message({
  2546. message: res.msg,
  2547. type: "error"
  2548. });
  2549. }
  2550. },
  2551. error => {
  2552. this.$message({
  2553. message: error,
  2554. type: "error"
  2555. });
  2556. });
  2557. });
  2558. },
  2559. //加载项目内的任务列表
  2560. getStageList() {
  2561. this.http.post('/stages/list',{groupId: this.selectedGroup.id, projectId: this.selectedGroup.projectId, order: this.order, isDesc: this.isDesc},
  2562. res => {
  2563. if (res.code == "ok") {
  2564. this.stageList = res.data.list;
  2565. this.canAddTask = res.data.canAddTask
  2566. this.timess() // 处理时间的方法
  2567. } else {
  2568. this.$message({
  2569. message: res.msg,
  2570. type: "error"
  2571. });
  2572. }
  2573. },
  2574. error => {
  2575. this.$message({
  2576. message: error,
  2577. type: "error"
  2578. });
  2579. });
  2580. },
  2581. timess(){
  2582. // console.log('timess');
  2583. var date = new Date()
  2584. let Y = date.getFullYear()
  2585. let M = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : (date.getMonth() + 1)
  2586. let D = date.getDate() < 10 ? ('0' + date.getDate()) : date.getDate()
  2587. this.times = `${Y}-${M}-${D}`
  2588. },
  2589. addStagePost() {
  2590. console.log('新增任务列表');
  2591. let param = JSON.parse(JSON.stringify(this.stageForm));
  2592. param.taskList = [];
  2593. this.http.post('/stages/save',param,
  2594. res => {
  2595. if (res.code == "ok") {
  2596. this.addStageDialog = false;
  2597. this.stageList = res.data;
  2598. } else {
  2599. this.$message({
  2600. message: res.msg,
  2601. type: "error"
  2602. });
  2603. }
  2604. },
  2605. error => {
  2606. this.$message({
  2607. message: error,
  2608. type: "error"
  2609. });
  2610. });
  2611. },
  2612. addStage() {
  2613. this.addStageDialog = true;
  2614. this.stageForm = {groupId: this.selectedGroup.id, projectId: this.curProjectId, stagesTime: 0};
  2615. },
  2616. viewChange(index, indexPath) {
  2617. this.groupType = 1;
  2618. this.order = "create_date";
  2619. this.isDesc = true;
  2620. this.selectedGroup = this.viewList.filter(g=>g.id == index)[0];
  2621. this.getViewTaskList();
  2622. this.displayTable = true;
  2623. } ,
  2624. groupChange(index, indexPath) {
  2625. console.log('店家了')
  2626. this.groupType = 0;
  2627. this.order = "seq";
  2628. this.isDesc = false;
  2629. this.selectedGroup = this.groupList.filter(g=>g.id == index)[0];
  2630. this.groupResponsibleId = this.selectedGroup.inchargerId
  2631. this.getStageList();
  2632. this.displayTable = false;
  2633. this.$forceUpdate()
  2634. },
  2635. //本地搜索组
  2636. startSearchGroup() {
  2637. if (this.groupSearch != null || this.groupSearch.length > 0) {
  2638. this.groupList = this.allGroupData.filter(g=>g.name.indexOf(this.groupSearch) >= 0);
  2639. } else {
  2640. this.groupList = this.allGroupData;
  2641. }
  2642. },
  2643. editIncharger(item) {
  2644. this.groupForm = JSON.parse(JSON.stringify(item));
  2645. this.setInchargerDialog = true;
  2646. },
  2647. renameGroup(item) {
  2648. this.groupForm = JSON.parse(JSON.stringify(item));
  2649. this.modGroupDialog = true;
  2650. },
  2651. deleteGroup(item) {
  2652. var _this = this;
  2653. this.$confirm(this.$t('tasksgroupsDetalses'), this.$t('other.prompts'), {
  2654. type: 'warning'
  2655. }).then(() => {
  2656. this.http.post('/task-group/delete',item,
  2657. res => {
  2658. if (res.code == "ok") {
  2659. this.groupList = res.data;
  2660. if (item.id == this.selectedGroup.id) {
  2661. //之前选中的分组被删除了
  2662. if (this.groupList.length > 0) {
  2663. this.defaultGroupId = this.groupList[0].id;
  2664. this.selectedGroup = this.groupList[0];
  2665. this.groupChange(this.defaultGroupId)
  2666. } else {
  2667. this.selectedGroup = {};
  2668. }
  2669. }
  2670. } else {
  2671. this.$message({
  2672. message: res.msg,
  2673. type: "error"
  2674. });
  2675. }
  2676. },
  2677. error => {
  2678. this.$message({
  2679. message: error,
  2680. type: "error"
  2681. });
  2682. });
  2683. });
  2684. },
  2685. getGroupDetails(obj) {
  2686. this.http.post('/task-group/detail',{
  2687. groupId: obj.id
  2688. },
  2689. res => {
  2690. if (res.code == "ok") {
  2691. this.groupDetailsShow = true
  2692. this.groupDetailData = res.data
  2693. this.groupDetailTil = obj.name + ' - '+this.$t('groupdetails')
  2694. } else {
  2695. this.$message({
  2696. message: res.msg,
  2697. type: "error"
  2698. });
  2699. }
  2700. },
  2701. error => {
  2702. this.$message({
  2703. message: error,
  2704. type: "error"
  2705. });
  2706. });
  2707. },
  2708. addTemplateGroup() {
  2709. // var param = JSON.parse(JSON.stringify(this.groupTemplateList.filter(g=>g.selected)[0]));
  2710. // delete param.stagesList;
  2711. // param.projectId = this.curProjectId;
  2712. // var k = this.groupTemplateList[this.sidebarIndex].name
  2713. // var s = null;
  2714. // var xmz = this.groupList.forEach(function(a, b, c){
  2715. // if (a.name == k) {
  2716. // s = true
  2717. // return
  2718. // }
  2719. // })
  2720. // if (s){
  2721. // this.addGroupDialog = false;
  2722. // this.$message({
  2723. // message: '当前项目已存在分组['+k+'],请修改组名后重试。',
  2724. // type: "error"
  2725. // });
  2726. // return
  2727. // }
  2728. var param = JSON.parse(JSON.stringify(this.groupTemplateList.filter(g=>g.selected)))
  2729. console.log(param, '你看看啊')
  2730. for(var i in param) {
  2731. delete param[i].stagesList
  2732. }
  2733. if(param.length < 1) {
  2734. this.$message({
  2735. message: this.$t('qngxuanz'),
  2736. type: "error"
  2737. });
  2738. return
  2739. }
  2740. console.log(this.groupList)
  2741. var s = null
  2742. var k = ''
  2743. var xmz = this.groupList.forEach(function(a, b, c){
  2744. param.forEach((g, i) =>{
  2745. if(a.name == g.name) {
  2746. s = true
  2747. k = g.name
  2748. return
  2749. }
  2750. })
  2751. })
  2752. if (s){
  2753. this.addGroupDialog = false;
  2754. this.$message({
  2755. message: this.$t('projectalreadyhasgroup')+'['+k+'],'+this.$t('changethegroupname'),
  2756. type: "error"
  2757. });
  2758. return
  2759. }
  2760. console.log('将要闯过去的值', param)
  2761. // return
  2762. // this.http.post('/task-group/createFromTemplate',param,
  2763. this.http.post('/task-group/createFromTemplate',{
  2764. templateJson: JSON.stringify(param),
  2765. projectId: this.curProjectId
  2766. },
  2767. res => {
  2768. if (res.code == "ok") {
  2769. this.selectedGroup = res.data
  2770. this.sleectId = res.data.id
  2771. this.sleectProjectId = res.data.projectId
  2772. this.addGroupDialog = false;
  2773. // this.getTaskGroups();
  2774. this.getTaskGroup();
  2775. } else {
  2776. this.$message({
  2777. message: res.msg,
  2778. type: "error"
  2779. });
  2780. }
  2781. },
  2782. error => {
  2783. this.$message({
  2784. message: error,
  2785. type: "error"
  2786. });
  2787. });
  2788. },
  2789. // 重新定义了 addGroup 方法
  2790. addGroup(formName) {
  2791. // return
  2792. this.$refs[formName].validate((valid) => {
  2793. if (valid) {
  2794. this.http.post('/task-group/save',this.groupForm,
  2795. res => {
  2796. if (res.code == "ok") {
  2797. this.groupList = res.data;
  2798. this.addGroupDialog = false;
  2799. this.modGroupDialog = false;
  2800. if (this.selectedGroup.id !== this.groupForm.id) {
  2801. this.selectedGroup = this.groupList.filter(g=>g.new)[0];
  2802. }
  2803. this.defaultGroupId = this.groupList[this.groupList.length - 1].id
  2804. // this.getTaskGroup();
  2805. this.getStageList()
  2806. } else {
  2807. this.$message({
  2808. message: res.msg,
  2809. type: "error"
  2810. });
  2811. }
  2812. },
  2813. error => {
  2814. this.$message({
  2815. message: error,
  2816. type: "error"
  2817. });
  2818. });
  2819. } else {
  2820. console.log('error submit!!');
  2821. return false;
  2822. }
  2823. });
  2824. },
  2825. createGroup() {
  2826. this.addGroupDialog = true;
  2827. this.groupForm = {projectId: this.curProjectId};
  2828. },
  2829. getInsideData() {
  2830. this.getTaskGroups();
  2831. },
  2832. //加载项目内的任务分组
  2833. getTaskGroups() {
  2834. this.http.post('/task-group/list',{projectId: this.curProjectId},
  2835. res => {
  2836. if (res.code == "ok") {
  2837. this.allGroupData = res.data;
  2838. this.groupList = res.data;
  2839. console.log(this.groupList,'grouplist');
  2840. if (this.groupList.length > 0) {
  2841. this.defaultGroupId = this.groupList[0].id;
  2842. this.selectedGroup = this.groupList[0];
  2843. this.groupResponsibleId = this.groupList[0].inchargerId;
  2844. this.getStageList();
  2845. } else {
  2846. //清空任务列表
  2847. this.defaultGroupId = null;
  2848. this.selectedGroup = null;
  2849. this.stageList = [];
  2850. }
  2851. } else {
  2852. this.$message({
  2853. message: res.msg,
  2854. type: "error"
  2855. });
  2856. }
  2857. },
  2858. error => {
  2859. this.$message({
  2860. message: error,
  2861. type: "error"
  2862. });
  2863. });
  2864. },
  2865. // 额外加的
  2866. getTaskGroup() {
  2867. this.http.post('/task-group/list',{projectId: this.curProjectId},
  2868. res => {
  2869. if (res.code == "ok") {
  2870. this.allGroupData = res.data;
  2871. this.groupList = res.data;
  2872. if (this.groupList.length > 0) {
  2873. this.defaultGroupId = this.sleectId;
  2874. this.selectedGroup = this.groupList[res.data.length - 1];
  2875. this.getStageList();
  2876. } else {
  2877. //清空任务列表
  2878. this.defaultGroupId = null;
  2879. this.selectedGroup = null;
  2880. this.stageList = [];
  2881. }
  2882. } else {
  2883. this.$message({
  2884. message: res.msg,
  2885. type: "error"
  2886. });
  2887. }
  2888. },
  2889. error => {
  2890. this.$message({
  2891. message: error,
  2892. type: "error"
  2893. });
  2894. });
  2895. },
  2896. //切换项目
  2897. onProjectChange() {
  2898. let path = this.$route.path;
  2899. path = path.substring(0,path.lastIndexOf('/'))+'/'+this.curProjectId;
  2900. this.$router.push(path);
  2901. this.getTaskGroups();
  2902. this.getDetail()
  2903. this.$refs.fileCenter.refreshPage();
  2904. this.$refs.projectInfo.refreshPage();
  2905. this.$refs.summary.refreshPage();
  2906. this.$refs.costbaseline.refreshPage();
  2907. this.$refs.earning.refreshPage();
  2908. if(this.user.companyId == '936') {
  2909. this.$refs.projectInfo.getKeyNodes()
  2910. }
  2911. },
  2912. //获取我的项目列表
  2913. getMyProjectList() {
  2914. this.http.post('/project/getProjectList', {
  2915. },
  2916. res => {
  2917. if (res.code == "ok") {
  2918. this.projectList = res.data;
  2919. console.log('getprojectlist',res.data);
  2920. } else {
  2921. this.$message({
  2922. message: res.msg,
  2923. type: "error"
  2924. });
  2925. }
  2926. },
  2927. error => {
  2928. this.$message({
  2929. message: error,
  2930. type: "error"
  2931. });
  2932. });
  2933. },
  2934. menuSelect() {
  2935. },
  2936. toList() {
  2937. this.$router.push("/list");
  2938. },
  2939. searchList() {
  2940. this.page = 1;
  2941. this.getList();
  2942. },
  2943. //显示用户详情
  2944. showUser(userId) {
  2945. this.userDetailVisible = true;
  2946. this.http.post(this.port.manage.userDetail, {
  2947. userId: userId
  2948. },
  2949. res => {
  2950. if (res.code == "ok") {
  2951. this.userDetail = res.data;
  2952. } else {
  2953. this.$message({
  2954. message: res.msg,
  2955. type: "error"
  2956. });
  2957. }
  2958. },
  2959. error => {
  2960. this.$message({
  2961. message: error,
  2962. type: "error"
  2963. });
  2964. });
  2965. },
  2966. getUsers() {
  2967. // this.http.post(this.port.manage.list, {
  2968. // departmentId: -1,
  2969. // pageIndex: 1,
  2970. // pageSize: -1
  2971. // },
  2972. this.http.post('/user/getSimpleActiveUserList', {},
  2973. res => {
  2974. if (res.code == "ok") {
  2975. this.users = res.data;
  2976. } else {
  2977. this.$message({
  2978. message: res.msg,
  2979. type: "error"
  2980. });
  2981. }
  2982. },
  2983. error => {
  2984. this.$message({
  2985. message: error,
  2986. type: "error"
  2987. });
  2988. });
  2989. },
  2990. //获取项目列表
  2991. getList() {
  2992. this.listLoading = true;
  2993. this.http.post(this.port.project.listPage, {
  2994. pageIndex: this.page,
  2995. pageSize: this.size,
  2996. keyword:this.keyword,
  2997. searchField: this.searchField,
  2998. },
  2999. res => {
  3000. this.listLoading = false;
  3001. if (res.code == "ok") {
  3002. var list = res.data.records;
  3003. for(var i in list) {
  3004. var participator = list[i].participator , str = "";
  3005. for(var j in participator) {
  3006. if(j == participator.length-1) {
  3007. str += participator[j].name
  3008. } else {
  3009. str += participator[j].name + ','
  3010. }
  3011. }
  3012. list[i].userNames = str;
  3013. }
  3014. this.list = list;
  3015. this.total = res.data.total;
  3016. } else {
  3017. this.$message({
  3018. message: res.msg,
  3019. type: "error"
  3020. });
  3021. }
  3022. },
  3023. error => {
  3024. this.listLoading = false;
  3025. this.$message({
  3026. message: error,
  3027. type: "error"
  3028. });
  3029. });
  3030. },
  3031. submitInsert() {
  3032. if (this.textContent !== true) return this.$message({
  3033. showClose: true,
  3034. message: this.$t('pictureistoolargepleaseuploaditagain'),
  3035. type: 'warning'
  3036. });
  3037. //检查是有重名的执行人
  3038. var exeList = this.addForm.executorListFront;
  3039. // for(let i=0;i<this.gstimhour.length;i++){
  3040. // exeList[i].planHours = this.gstimhour[i]
  3041. // }
  3042. for (var i=0;i<exeList.length;i++) {
  3043. var findSameUser = false;
  3044. exeList[i].planHours = this.gstimhour[i]
  3045. for (var j=i+1;j<exeList.length; j++) {
  3046. if (exeList[i].executorId && exeList[j].executorId && exeList[i].executorId == exeList[j].executorId) {
  3047. findSameUser = true;
  3048. break;
  3049. }
  3050. }
  3051. if (findSameUser) {
  3052. return this.$message({
  3053. showClose: true,
  3054. message: this.$t('executorhasduplication'),
  3055. type: 'error'
  3056. });
  3057. }
  3058. }
  3059. this.$refs.form1.validate(valid => {
  3060. if (valid) {
  3061. delete this.addForm.subTaskList;
  3062. delete this.addForm.refTaskList;
  3063. delete this.addForm.progress;
  3064. //去掉没有执行人的.(因为要有计划工时,执行人可以暂不设置)
  3065. // this.addForm.executorListFront = this.addForm.executorListFront.filter(exe=>exe.executorId);
  3066. this.addForm.executorListStr = JSON.stringify(this.addForm.executorListFront);
  3067. this.addLoading = true;
  3068. this.http.post('/task/save',this.addForm,
  3069. res => {
  3070. this.addLoading = false;
  3071. if (res.code == "ok") {
  3072. this.$message({
  3073. message: this.$t('message.submittedSuccessfully'),
  3074. type: "success"
  3075. });
  3076. if (this.addForm.parentTid == null) {
  3077. this.addFormVisible = false;
  3078. if (this.groupType == 0) {
  3079. this.getStageList();
  3080. } else {
  3081. this.getViewTaskList();
  3082. }
  3083. } else {
  3084. this.backToParentTask();
  3085. }
  3086. } else {
  3087. this.$message({
  3088. message: res.msg,
  3089. type: "error"
  3090. });
  3091. }
  3092. },
  3093. error => {
  3094. this.$message({
  3095. message: error,
  3096. type: "error"
  3097. });
  3098. }
  3099. );
  3100. }
  3101. });
  3102. },
  3103. DateChange(){
  3104. if(this.addForm.startDate != undefined && this.addForm.endDate != undefined){
  3105. let stdate = Date.parse(this.addForm.startDate)
  3106. let eddate = Date.parse(this.addForm.endDate)
  3107. if(stdate <= eddate){
  3108. let days = (eddate - stdate) / (1*24*60*60*1000) + 1
  3109. for (let i=0;i<this.gstimday.length;i++) {
  3110. this.gstimday[i] = days
  3111. this.gstimhour[i] = days * this.user.timeType.allday
  3112. }
  3113. this.$forceUpdate()
  3114. }
  3115. // console.log("gstimday",this.gstimday);
  3116. }
  3117. },
  3118. // 删除
  3119. deletePro(i, item) {
  3120. this.$confirm(this.$t('identifytheproject') + item.projectName + this.$t('ma'),this.$t('deletetheproject'), {
  3121. confirmButtonText: this.$t('btn.determine'),
  3122. cancelButtonText: this.$t('btn.cancel'),
  3123. type: "warning"
  3124. })
  3125. .then(() => {
  3126. this.listLoading = true;
  3127. this.http.post(this.port.project.delete,{
  3128. id: item.id
  3129. },
  3130. res => {
  3131. this.listLoading = false;
  3132. if (res.code == "ok") {
  3133. this.$message({
  3134. message: this.$t('message.successfullyDeleted'),
  3135. type: "success"
  3136. });
  3137. this.getList();
  3138. } else {
  3139. this.$message({
  3140. message: res.msg,
  3141. type: "error"
  3142. });
  3143. }
  3144. },
  3145. error => {
  3146. this.listLoading = false;
  3147. this.$message({
  3148. message: error,
  3149. type: "error"
  3150. });
  3151. }
  3152. );
  3153. })
  3154. .catch(() => {});
  3155. },
  3156. detail(i) {
  3157. this.$router.push("/list/" + this.list[i].id + "/" + this.list[i].projectName);
  3158. },
  3159. getDetail() {
  3160. this.http.post('/project/detail',{
  3161. id: this.curProjectId
  3162. },
  3163. res => {
  3164. if (res.code == "ok") {
  3165. console.log('触发更新试一下')
  3166. this.currentProject = res.data;
  3167. this.getjurisdictionIds(this.currentProject)
  3168. this.joinMembList = this.currentProject.participationList;
  3169. } else {
  3170. }
  3171. },
  3172. error => {
  3173. this.$message({
  3174. message: error,
  3175. type: "error"
  3176. });
  3177. }
  3178. );
  3179. },
  3180. getjurisdictionIds(pro){
  3181. console.log('pro',pro.creatorId);
  3182. this.projectCreatorId = pro.creatorId
  3183. this.projectInchargerId = pro.inchargerId
  3184. },
  3185. // 自定义组件事件
  3186. selectCal(obj) {
  3187. if(obj.distinction == '1') {
  3188. this.addForm.executorListFront[obj.index].executorId = obj.id
  3189. } else if(obj.distinction == '2') {
  3190. this.groupForm.inchargerId = obj.id
  3191. }
  3192. }
  3193. },
  3194. created() {
  3195. let height = window.innerHeight;
  3196. this.tableHeight = height - 135;
  3197. this.stageListHeight = this.tableHeight - 45;
  3198. this.taskListinH = this.stageListHeight - 75;
  3199. const that = this;
  3200. window.onresize = function temp() {
  3201. that.tableHeight = window.innerHeight - 135;
  3202. that.stageListHeight = that.tableHeight - 45;
  3203. that.taskListinH = that.stageListHeight - 75;
  3204. };
  3205. setTimeout(function(){
  3206. that.componentFlg = true
  3207. }, 1000)
  3208. },
  3209. mounted() {
  3210. this.curProjectId = parseInt(this.$route.params.id);
  3211. this.activeName = this.$route.path.split("/")[1];
  3212. this.getDetail();
  3213. this.getUsers();
  3214. this.getMyProjectList();
  3215. this.getInsideData();
  3216. this.getGroupTemplate();
  3217. }
  3218. };
  3219. </script>
  3220. <style >
  3221. .taskCardCircleBox{
  3222. padding-left: 5px;
  3223. display: flex;
  3224. justify-content: left;
  3225. align-items: center;
  3226. }
  3227. .flip-list-move {
  3228. transition: transform 0.5s;
  3229. }
  3230. .no-move {
  3231. transition: transform 0s;
  3232. }
  3233. .taskStage {
  3234. margin:10px;
  3235. display:inline-block;
  3236. vertical-align:top;
  3237. width: 331px;
  3238. }
  3239. .taskList {
  3240. padding:7px;
  3241. width:331px;
  3242. }
  3243. .taskListin{
  3244. width: 317px;
  3245. overflow: auto;
  3246. }
  3247. .taskList .stage {
  3248. font-weight:bold;
  3249. display:block;
  3250. float:left;
  3251. width:260px;
  3252. overflow: auto;
  3253. }
  3254. .taskGroupClass {
  3255. width: 180px;
  3256. display: inline-block;
  3257. text-overflow: ellipsis;
  3258. overflow: hidden;
  3259. white-space: nowrap;
  3260. }
  3261. .taskCard {
  3262. background: #fff;
  3263. margin: 5px 0px;
  3264. padding:5px;
  3265. border: 1px solid #e6e6e6;
  3266. border-radius: 3px;
  3267. box-shadow: 3px 3px 3px #e6e6e6;
  3268. min-height:60px;
  3269. position: relative;
  3270. border-radius: 3px;
  3271. overflow: hidden;
  3272. width: 288px;
  3273. }
  3274. .taskImg {
  3275. position: absolute;
  3276. box-sizing: border-box;
  3277. width: 100%;
  3278. height: 100%;
  3279. top: 0;
  3280. left: 0;
  3281. }
  3282. .taskImg img{
  3283. position: absolute;
  3284. top: -1px;
  3285. }
  3286. .hong:hover {
  3287. border-top: 1px solid #ff0000;
  3288. }
  3289. .huang:hover {
  3290. border-top: 1px solid #ff9600;
  3291. }
  3292. .hui:hover {
  3293. border-top: 1px solid #c9c9c9;
  3294. }
  3295. .taskCard:hover {
  3296. cursor: move;
  3297. }
  3298. .chosen {
  3299. background-color: #000 !important;
  3300. color: #fff;
  3301. }
  3302. .ghost {
  3303. background-color: #fafafa !important;
  3304. }
  3305. .taskCard .cb {
  3306. margin-right:5px;
  3307. }
  3308. .item {
  3309. background:#fff;
  3310. }
  3311. .input-with-select .el-input-group__prepend {
  3312. background-color: #fff;
  3313. }
  3314. .el-tabs__item {
  3315. height:45px ;
  3316. }
  3317. .projectCls {
  3318. margin-left:10px;margin-right:10px;
  3319. }
  3320. .heavyTxt {
  3321. font-weight:bold;
  3322. }
  3323. .el-tabs__nav-wrap::after {
  3324. height:0.5px;
  3325. }
  3326. .user_name_icon {
  3327. text-align:center;border-radius:50%;color:white;float:right;font-size:10px;width:30px;height:30px;line-height:30px;
  3328. transform: scale(0.8);
  3329. }
  3330. .task_name {
  3331. color:#262626;
  3332. display:inline-block;
  3333. max-width: 235px;
  3334. height: 25px;
  3335. overflow: hidden;
  3336. white-space: nowrap;
  3337. text-overflow: ellipsis;
  3338. }
  3339. .task_name span{
  3340. position: relative;
  3341. top: 8px;
  3342. }
  3343. .cb {
  3344. position: relative;
  3345. top: -2px;
  3346. }
  3347. .group_style {
  3348. border-radius: 5px;margin:2px 0px 2px 0px;height:40px;line-height:40px;
  3349. }
  3350. .el-tabs__nav-wrap::after {
  3351. height:1px;
  3352. }
  3353. .el-tabs__header {
  3354. margin:0 !important;
  3355. }
  3356. .single_line {
  3357. overflow: hidden;text-overflow:ellipsis;white-space: nowrap;
  3358. }
  3359. .sub_task_num {
  3360. font-size:10px;
  3361. color:#666;
  3362. }
  3363. .template_box {
  3364. margin:20px 0px;
  3365. }
  3366. /* 项目阶段侧边栏样式 */
  3367. .sidebar {
  3368. width: 2px;
  3369. background: #dddddd;
  3370. position: relative;
  3371. }
  3372. .sidebar:hover {
  3373. background: #20a0ff;
  3374. }
  3375. .sidebar:hover .etui {
  3376. background: #20a0ff;
  3377. border: #20a0ff;
  3378. color: #fff;
  3379. }
  3380. .etui {
  3381. width: 15px;
  3382. height: 40px;
  3383. background: #fff;
  3384. border: 1px solid #dddddd;
  3385. position: absolute;
  3386. top: 50%;
  3387. left: 0%;
  3388. transform: translate(6%, -50%);
  3389. color: rgb(192, 191, 191);
  3390. box-sizing: border-box;
  3391. }
  3392. .etui i {
  3393. display: inline-block;
  3394. padding-top: 90%;
  3395. /* padding-left: 15%; */
  3396. font-weight: bold;
  3397. }
  3398. /* bug问题 */
  3399. .task {
  3400. box-sizing: border-box;
  3401. padding-left: 10px;
  3402. padding-right: 5px;
  3403. }
  3404. /* 评论部分 */
  3405. .remark {
  3406. width: 500px;
  3407. height: 100%;
  3408. background: #fff;
  3409. position: absolute;
  3410. top: 0;
  3411. right: -500px;
  3412. border-left: 3px solid #dddddd;
  3413. }
  3414. .jm {
  3415. margin-left: -500px;
  3416. }
  3417. .bj {
  3418. float: left;
  3419. width: 90%;
  3420. overflow: hidden;
  3421. height: 65px;
  3422. white-space: nowrap;
  3423. text-overflow: ellipsis;
  3424. }
  3425. .bj span {
  3426. width: 50px;
  3427. height: 50px;
  3428. display: inline-block;
  3429. border-radius: 50%;
  3430. color: #fff;
  3431. text-align: center;
  3432. float: left;
  3433. margin-right: 20px;
  3434. /* margin-top: 10px; */
  3435. line-height: 50px;
  3436. }
  3437. .player {
  3438. height: 15%;
  3439. box-sizing: border-box;
  3440. padding-left: 15px;
  3441. border-bottom: 1px solid #dddddd;
  3442. }
  3443. .player p {
  3444. margin: 0;
  3445. padding: 2% 0;
  3446. font-size: 18px;
  3447. }
  3448. .player .el-image {
  3449. border-radius: 50%;
  3450. margin-right: 10px;
  3451. }
  3452. .subject {
  3453. height: 60%;
  3454. box-sizing: border-box;
  3455. }
  3456. .sub-all {
  3457. font-size: 20px;
  3458. padding: 15px 0 15px 15px;
  3459. }
  3460. .sub-details {
  3461. width: 100%;
  3462. height: 38vh;
  3463. padding-right: 15px;
  3464. box-sizing: border-box;
  3465. overflow: hidden;
  3466. overflow-y: scroll
  3467. }
  3468. .sub-details li {
  3469. list-style:none
  3470. }
  3471. /* 红色背景显示日期 */
  3472. .element_span {
  3473. display: inline-block;
  3474. background: #e62412;
  3475. color: #fff;
  3476. border-radius: 3px;
  3477. padding: 3px;
  3478. /* text-align: center; */
  3479. font-size: 12px;
  3480. margin-left: 5px;
  3481. }
  3482. .pro_btn{
  3483. display: inline-block;
  3484. float: right;
  3485. }
  3486. </style>
  3487. <style lang="scss" scoped>
  3488. .counli {
  3489. em {
  3490. font-style: normal;
  3491. display: inline-block;
  3492. margin-left: 9%;
  3493. }
  3494. span {
  3495. float: right;
  3496. }
  3497. }
  3498. .carts {
  3499. position: relative;
  3500. .el-image{
  3501. border-radius: 50%;
  3502. float: left;
  3503. width: 20%;
  3504. }
  3505. i {
  3506. width: 30px;
  3507. height: 30px;
  3508. // background: #778899;
  3509. display: inline-block;
  3510. float: left;
  3511. border-radius:50%;
  3512. font-style:normal;
  3513. font-size: 12px;
  3514. line-height: 30px;
  3515. text-align: center;
  3516. color: #fff;
  3517. background: #778899;
  3518. }
  3519. div {
  3520. text-align: left;
  3521. p {
  3522. text-align: left;
  3523. margin-left: 10px;
  3524. margin-left: 13%;
  3525. }
  3526. em {
  3527. display: block;
  3528. font-style: normal;
  3529. margin-left: 13%;
  3530. }
  3531. }
  3532. span {
  3533. font-size: 10px;
  3534. float: right;
  3535. margin-top: -40px;
  3536. }
  3537. }
  3538. .issue {
  3539. // height: 20%;
  3540. // position: relative;
  3541. // z-index: 4;
  3542. .zh{
  3543. position: relative;
  3544. width: 100%;
  3545. height: 100%;
  3546. }
  3547. .textareays {
  3548. background: #000;
  3549. height: 140px;
  3550. border: 0;
  3551. .el-textarea__inner {
  3552. height: 85%;
  3553. }
  3554. }
  3555. .issue-button {
  3556. position: absolute;
  3557. bottom: 20px;
  3558. right: 20px;
  3559. }
  3560. }
  3561. .inputDeep {
  3562. position: absolute;
  3563. bottom: 85px;
  3564. width: 95%;
  3565. margin: 0 12px;
  3566. }
  3567. .inputDeep .el-textarea .el-textarea__inner{
  3568. border: 0 !important;
  3569. resize: none !important;
  3570. }
  3571. .inputDeeps .el-textarea__inner {
  3572. border: 0 !important;
  3573. resize: none !important;
  3574. }
  3575. .scop_span {
  3576. display: inline-block;
  3577. padding: 2px 5px;
  3578. }
  3579. </style>
  3580. <style>
  3581. .ql-snow .ql-picker.ql-size .ql-picker-label::before,
  3582. .ql-snow .ql-picker.ql-size .ql-picker-item::before {
  3583. content: "14px" !important;
  3584. position: relative;
  3585. top: -8px;
  3586. }
  3587. .ql-snow .ql-picker.ql-size .ql-picker-label[data-value="small"]::before,
  3588. .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="small"]::before {
  3589. content: "10px" !important;
  3590. }
  3591. .ql-snow .ql-picker.ql-size .ql-picker-label[data-value="large"]::before,
  3592. .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="large"]::before {
  3593. content: "18px" !important;
  3594. }
  3595. .ql-snow .ql-picker.ql-size .ql-picker-label[data-value="huge"]::before,
  3596. .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="huge"]::before {
  3597. content: "32px" !important;
  3598. }
  3599. .ql-snow .ql-picker.ql-header .ql-picker-label::before,
  3600. .ql-snow .ql-picker.ql-header .ql-picker-item::before {
  3601. content: "文本" !important;
  3602. position: relative;
  3603. top: -8px;
  3604. }
  3605. .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before,
  3606. .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before {
  3607. content: "标题1" !important;
  3608. }
  3609. .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before,
  3610. .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before {
  3611. content: "标题2" !important;
  3612. }
  3613. .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before,
  3614. .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before {
  3615. content: "标题3" !important;
  3616. }
  3617. .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="4"]::before,
  3618. .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before {
  3619. content: "标题4" !important;
  3620. }
  3621. .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="5"]::before,
  3622. .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before {
  3623. content: "标题5" !important;
  3624. }
  3625. .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="6"]::before,
  3626. .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="6"]::before {
  3627. content: "标题6" !important;
  3628. }
  3629. .ql-snow .ql-picker.ql-font .ql-picker-label::before,
  3630. .ql-snow .ql-picker.ql-font .ql-picker-item::before {
  3631. content: "标准字体" !important;
  3632. }
  3633. .ql-snow .ql-picker.ql-font .ql-picker-label[data-value="serif"]::before,
  3634. .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="serif"]::before {
  3635. content: "衬线字体" !important;
  3636. }
  3637. .ql-snow .ql-picker.ql-font .ql-picker-label[data-value="monospace"]::before,
  3638. .ql-snow .ql-picker.ql-font .ql-picker-item[data-value="monospace"]::before {
  3639. content: "等宽字体" !important;
  3640. }
  3641. /* .ql-picker-label {
  3642. position: relative;
  3643. } */
  3644. .ql-picker-label svg {
  3645. position: relative;
  3646. top: -6px;
  3647. }
  3648. /* 任务进展 */
  3649. .progress {
  3650. border: 1px solid #ddd;
  3651. border-radius: 5px;
  3652. width: 100%;
  3653. box-sizing: border-box;
  3654. padding: 15px;
  3655. position: relative;
  3656. margin-bottom: 20px;
  3657. }
  3658. .remind {
  3659. width: 95px;
  3660. height: 60%;
  3661. overflow-y:auto;
  3662. position: absolute;
  3663. background: #fff;
  3664. padding: 10px;
  3665. left: 0;
  3666. top: 0;
  3667. border: 1px solid #ddd;
  3668. z-index: 999999;
  3669. }
  3670. .rala1 .el-radio__input.is-checked + .el-radio__label {
  3671. color: #43d14f !important;
  3672. }
  3673. .rala1 .el-radio__input.is-checked .el-radio__inner {
  3674. background: #43d14f !important;
  3675. border-color: #43d14f !important;
  3676. }
  3677. .rala2 .el-radio__input.is-checked + .el-radio__label {
  3678. color: #fd7624 !important;
  3679. }
  3680. .rala2 .el-radio__input.is-checked .el-radio__inner {
  3681. background: #fd7624 !important;
  3682. border-color: #fd7624 !important;
  3683. }
  3684. .rala3 .el-radio__input.is-checked + .el-radio__label {
  3685. color: #fd4d47 !important;
  3686. }
  3687. .rala3 .el-radio__input.is-checked .el-radio__inner {
  3688. background: #fd4d47 !important;
  3689. border-color: #fd4d47 !important;
  3690. }
  3691. /* 任务进展列表 */
  3692. .elCard {
  3693. width: 100%;
  3694. padding: 15px;
  3695. box-sizing: border-box;
  3696. border: 1px solid #EBEEF5;
  3697. }
  3698. .elCard_qu {
  3699. float: right;
  3700. margin-right: 15px;
  3701. }
  3702. .integrity {
  3703. padding: 15px;
  3704. }
  3705. .write {
  3706. float: right;
  3707. color: #1B9AEE;
  3708. }
  3709. .ssp {
  3710. position: absolute;
  3711. right: 140px;
  3712. top: 95px;
  3713. width: 66%;
  3714. height: 80%;
  3715. }
  3716. .examine {
  3717. width: 100%;
  3718. text-align: center;
  3719. }
  3720. .nones {
  3721. width: 100%;
  3722. height: 50px;
  3723. text-align: center;
  3724. color: #909399;
  3725. line-height: 50px;
  3726. border-top: 1px solid #EBEEF5;
  3727. border-bottom: 1px solid #EBEEF5;
  3728. font-size: 16px;
  3729. }
  3730. .icon {
  3731. /* color: rgb(67, 209, 79); */
  3732. display: block;
  3733. width: 12px;
  3734. height: 12px;
  3735. background: #fff;
  3736. position: absolute;
  3737. top: 0;
  3738. left: -33px;
  3739. border-radius: 50%;
  3740. border: 4px solid;
  3741. }
  3742. /* ddl */
  3743. .ddl {
  3744. height: 136px;
  3745. overflow: hidden;
  3746. border: 1px solid #EBEEF5
  3747. }
  3748. .tb{
  3749. position: relative;
  3750. }
  3751. .dpl{
  3752. position: absolute;
  3753. font-size: 20px;
  3754. left: -32px;
  3755. top: 0px;
  3756. }
  3757. </style>