projectInside.vue 181 KB

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