projectInside.vue 184 KB

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