list.vue 223 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497
  1. <template>
  2. <section>
  3. <!--工具条-->
  4. <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
  5. <el-form :inline="true">
  6. <el-form-item :label="$t('listofitems')" class="toolbar_formitem_n1">
  7. </el-form-item>
  8. <el-form-item >
  9. <!-- <div style="display: flex;align-items: center;height: 40px;"> -->
  10. <div v-if="true" style="display: flex;align-items: center;height: 40px;">
  11. <el-input v-model="keyword" class="input-with-select" :placeholder="searchField == '1' ? $t('peaseenterthe') : $t('peaseenterthe')" clearable="true" size="small">
  12. <el-select v-model="searchField" style="width:120px;" slot="prepend" :placeholder="$t('defaultText.pleaseChoose')">
  13. <el-option :label="$t('headerTop.projectName')" value=1 ></el-option>
  14. <el-option :label="$t('Itemno')" value=2 ></el-option>
  15. </el-select>
  16. <el-button slot="append" @click="searchList" icon="el-icon-search"></el-button>
  17. </el-input>
  18. </div>
  19. </el-form-item>
  20. <el-form-item >
  21. <span style="margin-left:5px;margin-right:5px;color:#606266;">{{ $t('state.states') }}</span>
  22. <el-select v-model="status" style="width:120px;" :placeholder="$t('defaultText.pleaseChoose')" @change="searchList" size="small">
  23. <el-option :label="$t('all')" value=0 ></el-option>
  24. <el-option :label="$t('ongoing')" value=1 ></el-option>
  25. <el-option :label="$t('state.completed')" value=2 ></el-option>
  26. <el-option :label="$t('state.undone')" value=3 ></el-option>
  27. <el-option :label="$t('paused')" value=4 ></el-option>
  28. </el-select>
  29. </el-form-item>
  30. <!-- 主项目筛选 -->
  31. <el-form-item v-if="user.timeType.mainProjectState == '1'">
  32. <span style="margin-left:5px;margin-right:5px;color:#606266;">{{ $t('zhu-xiang-mu') }}</span>
  33. <el-select v-model="projectMainId" style="width:110px;" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="searchClfList" size="small">
  34. <el-option v-for="item in mainProjectList" :key="item.id" :label="item.name" :value="item.id" ></el-option>
  35. </el-select>
  36. </el-form-item>
  37. <!-- 分类筛选 -->
  38. <el-form-item >
  39. <span style="margin-left:5px;margin-right:5px;color:#606266;">{{ $t('fen-lei') }}</span>
  40. <el-select v-model="statusClf" style="width:140px;" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="searchClfList" size="small">
  41. <el-option v-for="item in baseClfList" :key="item.id" :label="item.name" :value="item.id" ></el-option>
  42. </el-select>
  43. </el-form-item>
  44. <el-form-item style="float:right;" v-if="permissions.projectImport || permissions.projectExport || permissions.projectClassification || (user.company.packageProject == 1 && permissions.projectCostOfItems)">
  45. <el-dropdown>
  46. <el-link type="primary" :underline="false">{{ $t('viewmore') }}<i class="el-icon-arrow-down el-icon--right"></i></el-link>
  47. <el-dropdown-menu slot="dropdown">
  48. <el-dropdown-item v-if="permissions.projectImport">
  49. <el-link type="primary" :underline="false" @click="importProjectBefore">{{ $t('importproject') }}</el-link>
  50. <!-- <el-upload ref="upload" action="#" :limit="1" :http-request="importProject" :show-file-list="false">
  51. <el-link type="primary" :underline="false" >{{ $t('importproject') }}</el-link>
  52. </el-upload> -->
  53. </el-dropdown-item>
  54. <el-dropdown-item v-if="permissions.projectImport">
  55. <el-link type="primary" :underline="false" @click="downloadmb" v-if="user.company.packageCustomer == 1 || user.company.packageProvider == 1 || user.timeType.mainProjectState == 1 || user.companyId == '936'">{{ $t('Downloadthetemplate') }}</el-link>
  56. <el-link type="primary" :underline="false" href="./upload/项目导入模板.xlsx" :download="$t('importtemplateproject') + '.xlsx'" v-else>{{ $t('Downloadthetemplate') }}</el-link>
  57. </el-dropdown-item>
  58. <el-dropdown-item v-if="permissions.projectExport" :disabled="exportDisabled">
  59. <el-link type="primary" :underline="false" @click="exportProjectData" :download="$t('exportProject') + '.xlsx'">{{ $t('exportProject') }}</el-link>
  60. </el-dropdown-item>
  61. <el-dropdown-item v-if="user.company.packageProject == 1 && permissions.projectExport">
  62. <el-link type="primary" :underline="false" @click="exportProjectGroup" :download="$t('exportingTaskGroups') +'.xlsx'">{{ $t('exportingTaskGroups') }}</el-link>
  63. </el-dropdown-item>
  64. <el-dropdown-item v-if="user.company.packageProject == 1 && permissions.projectCostOfItems">
  65. <el-link type="primary" :underline="false" @click="showBaseCostItemDialog">{{ $t('baselinecostitem') }}</el-link>
  66. </el-dropdown-item>
  67. <!-- <el-dropdown-item v-if="user.company.packageProject == 1 && user.companyId == '936'"> -->
  68. <!-- <el-dropdown-item >
  69. <el-link type="primary" :underline="false" @click="keyNodesIsShow = true">关键节点项</el-link>
  70. </el-dropdown-item> -->
  71. <el-dropdown-item v-if="permissions.projectClassification">
  72. <el-link type="primary" :underline="false" @click="showClfDialog = true">{{ $t('classificationmanagement') }}</el-link>
  73. </el-dropdown-item>
  74. <!-- <el-dropdown-item v-if="user.timeType.mainProjectState == 1 && !permissions.projectClassification"> -->
  75. <el-dropdown-item v-if="user.timeType.mainProjectState == 1">
  76. <el-link type="primary" :underline="false" @click="mainProjectDialog = true">{{ $t('masterprojectmanagement') }}</el-link>
  77. </el-dropdown-item>
  78. <el-dropdown-item v-if="permissions.projectPhase && user.company.packageProject == 1">
  79. <el-link type="primary" :underline="false" @click="phaseProjectDialog = true">{{ $t('projectstagemanagement') }}</el-link>
  80. </el-dropdown-item>
  81. <el-dropdown-item v-if="user.timeType.projectLevelState == 1">
  82. <el-link type="primary" :underline="false" @click="projectLevelDialog = true">{{ $t('projectlevelmanagement') }}</el-link>
  83. </el-dropdown-item>
  84. </el-dropdown-menu>
  85. </el-dropdown>
  86. </el-form-item>
  87. <!-- <el-form-item style="float:right;" v-if="user.role == 1||user.role == 2||user.role == 5"> -->
  88. <el-form-item style="float:right;" v-if="permissions.projectNew">
  89. <el-link type="primary" :underline="false" @click="handleAdd(-1,null)">{{ $t('newproject') }}</el-link>
  90. </el-form-item>
  91. <el-form-item style="float:right;" v-if="permissions.projectResources">
  92. <!-- <router-link to="/projectGantt"> -->
  93. <el-link type="primary" :underline="false" @click="isganttshow = true">{{ $t('resourceallocation') }}</el-link>
  94. <!-- </router-link> -->
  95. <el-dialog v-if="isganttshow" :visible.sync="isganttshow" width="90vw" top="3vh" style="height:96%" class="ganttdialog">
  96. <projectgantt></projectgantt>
  97. </el-dialog>
  98. </el-form-item>
  99. <br/>
  100. <br v-if="user.companyId == 936">
  101. <!-- 时间段筛选 -->
  102. <el-form-item>
  103. <span style="margin-left:15px;margin-right:5px;color:#606266;">时间段</span>
  104. <el-date-picker v-model="createDate" type="daterange" :range-separator="$t('other.to')" :start-placeholder="$t('time.startDate')" :end-placeholder="$t('time.endDate')" @change="manageSelect()" value-format="yyyy-MM-dd" :placeholder="$t('optiondate')" size="small" clearable style="width:290px;margin-left:5px"></el-date-picker>
  105. </el-form-item>
  106. <!-- 项目经理筛选 -->
  107. <el-form-item>
  108. <span style="margin-left:5px;margin-right:5px;color:#606266;">{{ $t('projectmanager') }}</span>
  109. <el-select v-if="user.userNameNeedTranslate != 1" v-model="inchagerId" style="width:140px;" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="manageSelect" size="small" filterable popper-class="managePopperClass">
  110. <el-option v-for="item in users" :key="item.id" :label="user.companyId == 936 ? item.name + '\u3000' + item.jobNumber : item.name" :value="item.id">
  111. <span style="float: left">{{ item.name }}</span>
  112. <span style="float: right; color: #8492a6;" v-if="user.companyId == 936">{{ item.jobNumber }}</span>
  113. </el-option>
  114. </el-select>
  115. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'mini'" :subject="users" :subjectId="inchagerId" :distinction="'1'" :clearable="true" @selectCal="selectCal"></selectCat>
  116. </el-form-item>
  117. <el-form-item>
  118. <span style="margin-left:25px;margin-right:5px;color:#606266;">{{ $t('participantin') }}</span>
  119. <el-select v-if="user.userNameNeedTranslate != 1" v-model="participationId" style="width:140px;" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="participationSelect" size="small" filterable popper-class="managePopperClass">
  120. <el-option v-for="item in users" :key="item.id" :label="user.companyId == 936 ? item.name + '\u3000' + item.jobNumber : item.name" :value="item.id">
  121. <span style="float: left">{{ item.name }}</span>
  122. <span style="float: right; color: #8492a6;" v-if="user.companyId == 936">{{ item.jobNumber }}</span>
  123. </el-option>
  124. </el-select>
  125. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'mini'" :subject="users" :subjectId="participationId" :distinction="'2'" :clearable="true" @selectCal="selectCal"></selectCat>
  126. </el-form-item>
  127. <!-- 部门筛选 -->
  128. <el-form-item v-if="user.timeType.projectWithDept">
  129. <span style="margin-left:5px;margin-right:5px;color:#606266;">{{ $t('lable.department') }}</span>
  130. <el-cascader v-model="deptId" style="width:140px;" :options="departmentList" :placeholder="$t('qing-xuan-ze-bu-men')"
  131. :props="{ checkStrictly: true, expandTrigger: 'hover' }" :show-all-levels="false" clearable filterable @change="searchClfList" size="small"
  132. ></el-cascader>
  133. </el-form-item>
  134. </el-form>
  135. </el-col>
  136. <!--列表-->
  137. <el-table ref="projectlistOfWudulist" border @cell-mouse-enter="hoverCall" @cell-mouse-leave="handCall" :cell-class-name="tableCellClassName" :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;" @selection-change="checkedWudulist" @sort-change="tableSort">
  138. <el-table-column type="selection" width="60" :selectable="isSelectable">
  139. <!-- creator 项目创建人 incharger 项目负责人 -->
  140. </el-table-column>
  141. <!-- <el-table-column type="index" width="60" v-else>
  142. <template slot-scope="scope" >
  143. {{scope.$index+1+(page-1)*size}}
  144. </template>
  145. </el-table-column> -->
  146. <el-table-column prop="projectCode" :label="$t('Itemno')" sortable="custom" width="150"></el-table-column>
  147. <el-table-column prop="contractCode" :label="$t('contractno')" width="200" v-if="user.companyId == '936'">
  148. <template slot-scope="scope">
  149. <!-- <div v-if="scope.row.projectSeparate">
  150. {{scope.row.projectSeparate.contractCode}}
  151. </div> -->
  152. <div v-if="scope.row.projectSeparate">
  153. <div v-if="scope.row.projectSeparate.contractCode">
  154. <el-popover placement="top" width="400" trigger="hover" v-if="scope.row.projectSeparate.contractCode.length > 15">
  155. <div>
  156. <span>{{scope.row.projectSeparate.contractCode}}</span>
  157. </div>
  158. <div slot="reference" class="kans">
  159. <span>{{scope.row.projectSeparate.contractCode}}...</span>
  160. </div>
  161. </el-popover>
  162. <div v-else>
  163. <span>{{scope.row.projectSeparate.contractCode}}</span>
  164. </div>
  165. </div>
  166. </div>
  167. </template>
  168. </el-table-column>
  169. <!-- <el-table-column prop="projectCategorySub" label="项目分组" width="200" v-if="user.companyId == '428'">
  170. <template slot-scope="scope">
  171. <div v-if="scope.row.projectSeparate">
  172. <div v-if="scope.row.projectSeparate.projectCategorySub">
  173. <el-popover placement="top" width="400" trigger="hover" v-if="scope.row.projectSeparate.projectCategorySub.length > 15">
  174. <div>
  175. <span>{{scope.row.projectSeparate.projectCategorySub}}</span>
  176. </div>
  177. <div slot="reference" class="kans">
  178. <span>{{scope.row.projectSeparate.projectCategorySub}}...</span>
  179. </div>
  180. </el-popover>
  181. <div v-else>
  182. <span>{{scope.row.projectSeparate.projectCategorySub}}</span>
  183. </div>
  184. </div>
  185. </div>
  186. </template>
  187. </el-table-column> -->
  188. <el-table-column prop="categoryName" :label="$t('projectclassification')" sortable="custom" width="140"></el-table-column>
  189. <el-table-column prop="projectName" :label="$t('headerTop.projectName')" min-width="250" sortable="custom">
  190. <template slot-scope="scope">
  191. <!-- <el-popover placement="top" width="400" trigger="hover" v-if="scope.row.projectName.length > 15">
  192. <div>
  193. <el-link type="primary" v-if="user.company.packageProject==1" :underline="false" :href="'#/projectInside/'+scope.row.id">{{scope.row.projectName}}</el-link>
  194. <span v-if="user.company.packageProject==0" >{{scope.row.projectName}}</span>
  195. </div>
  196. <div slot="reference" class="kans">
  197. <el-link type="primary" v-if="user.company.packageProject==1" :underline="false" :href="'#/projectInside/'+scope.row.id">{{scope.row.projectName.substring(0,15)}}...</el-link>
  198. <span v-if="user.company.packageProject==0" >{{scope.row.projectName.substring(0,15)}}...</span>
  199. </div>
  200. </el-popover>
  201. <div v-else>
  202. <el-link type="primary" v-if="user.company.packageProject==1" :underline="false" :href="'#/projectInside/'+scope.row.id">{{scope.row.projectName}}</el-link>
  203. <span v-if="user.company.packageProject==0" >{{scope.row.projectName}}</span>
  204. </div> -->
  205. <div>
  206. <el-link type="primary" v-if="user.company.packageProject==1" :underline="false" :href="'#/projectInside/'+scope.row.id">{{scope.row.projectName}}</el-link>
  207. <span v-if="user.company.packageProject==0" >{{scope.row.projectName}}</span>
  208. </div>
  209. </template>
  210. </el-table-column>
  211. <el-table-column prop="departmentName" :label="$t('subordinatedepartments')" sortable="custom" width="200" v-if="user.timeType.projectWithDept"></el-table-column>
  212. <el-table-column prop="projectMainName" :label="$t('zhu-xiang-mu')" sortable="custom" min-width="250" v-if="user.timeType.mainProjectState == '1'">
  213. </el-table-column>
  214. <el-table-column prop="inchargerName" :label="$t('projectmanager')" sortable="custom" min-width="150">
  215. <template slot-scope="scope">
  216. <el-link type="primary" :underline="false" @click="showUser(scope.row.inchargerId)">
  217. <span v-if="user.userNameNeedTranslate != 1">
  218. {{scope.row.inchargerName}}
  219. </span>
  220. <span v-if="user.userNameNeedTranslate == 1">
  221. <ww-open-data type='userName' :openid='scope.row.inchargerName'></ww-open-data>
  222. </span>
  223. </el-link>
  224. </template>
  225. </el-table-column>
  226. <!-- 项目阶段 -->
  227. <!-- 换位置之前看下项目阶段发起的请求 -->
  228. <el-table-column prop="currentStage" :label="$t('projectphase')" sortable="custom" min-width="150" width="220" v-if="user.company.packageProject == 1">
  229. <template slot-scope="scope">
  230. {{scope.row.currentStageId == null ? $t('nostage') : scope.row.currentStageName}}
  231. <el-link v-if="(permissions.projectManagement || user.id==scope.row.inchargerId || user.id==scope.row.creatorId)" type="primary" :underline="false" @click="showChangeStageDialog(scope.row.id, scope.row.currentStageId)">
  232. <i class="el-icon-edit"></i>
  233. </el-link>
  234. </template>
  235. </el-table-column>
  236. <el-table-column prop="participator" :label="$t('participants')" :min-width="user.company.packageCustomer != 1 ? '100' : '300'" sortable v-if="user.company.packageProject==0">
  237. <template slot-scope="scope">
  238. <!-- <v-for v-for="par in scope.row.participator" :key="par.id" >
  239. <el-link style="margin-right:10px;" type="primary" @click="showUser(par.id)">{{par.name}}</el-link>
  240. </v-for> -->
  241. <div v-if="scope.row.participator.length > 5">
  242. <el-popover placement="top" width="500" trigger="hover" v-if="scope.row.participator.length > 0">
  243. <span v-for="par in scope.row.participator" :key="par.id">
  244. <el-link style="margin-right:10px;" :underline="false" type="primary" @click="showUser(par.id)">
  245. <span v-if="user.userNameNeedTranslate != 1">
  246. {{par.name}}
  247. </span>
  248. <span v-if="user.userNameNeedTranslate == 1">
  249. <ww-open-data type='userName' :openid='par.name'></ww-open-data>
  250. </span>
  251. </el-link>
  252. </span>
  253. <div slot="reference" class="addss">
  254. <span v-for="par in scope.row.participator" :key="par.id">
  255. <el-link style="margin-right:10px;" :underline="false" type="primary" @click="showUser(par.id)">
  256. <span v-if="user.userNameNeedTranslate != 1">
  257. {{par.name}}
  258. </span>
  259. <span v-if="user.userNameNeedTranslate == 1">
  260. <ww-open-data type='userName' :openid='par.name'></ww-open-data>
  261. </span>
  262. </el-link>
  263. </span>
  264. </div>
  265. </el-popover>
  266. </div>
  267. <div v-else>
  268. <span v-for="par in scope.row.participator" :key="par.id" >
  269. <el-link style="margin-right:10px;" type="primary" :underline="false" @click="showUser(par.id)" v-if="user.userNameNeedTranslate != 1">
  270. {{par.name}}
  271. </el-link>
  272. <el-link style="margin-right:10px;" type="primary" :underline="false" @click="showUser(par.id)" v-if="user.userNameNeedTranslate == 1">
  273. <ww-open-data type='userName' :openid='par.name'></ww-open-data>
  274. </el-link>
  275. </span>
  276. </div>
  277. </template>
  278. </el-table-column>
  279. <!-- 客户管理 -->
  280. <el-table-column prop="customerName" :label="$t('ke-hu')" min-width="190" v-if="user.company.packageCustomer == 1" sortable="custom">
  281. <template slot-scope="scope">
  282. <el-popover placement="top" width="250" trigger="hover" v-if="scope.row.customerName&&scope.row.customerName.length > 12">
  283. <div slot="reference" class="kans">
  284. <span >{{scope.row.customerName.substring(0,12)}}...</span>
  285. </div>
  286. <span >{{scope.row.customerName}}</span>
  287. </el-popover>
  288. <div v-else>
  289. <span >{{scope.row.customerName}}</span>
  290. </div>
  291. </template>
  292. </el-table-column>
  293. <!-- 研究中心 -->
  294. <el-table-column prop="associateDegreeNames" :label="centerNameDegree" min-width="190" v-if="user.timeType.isCro == 1" sortable="custom">
  295. <template slot-scope="scope">
  296. <!-- <div>
  297. {{scope.row.associateDegreeNames}}
  298. </div> -->
  299. <el-popover placement="top" width="300" trigger="hover" v-if="scope.row.associateDegreeNames&&scope.row.associateDegreeNames.length > 12">
  300. <div slot="reference" class="kans">
  301. <span >{{scope.row.associateDegreeNames.substring(0,12)}}...</span>
  302. </div>
  303. <span >{{scope.row.associateDegreeNames}}</span>
  304. </el-popover>
  305. <div v-else>
  306. <span >{{scope.row.associateDegreeNames}}</span>
  307. </div>
  308. </template>
  309. </el-table-column>
  310. <!-- 级别 -->
  311. <el-table-column :prop="user.timeType.projectLevelState == 1 ? 'levelName' : 'level'" :label="$t('ji-bie')" min-width="190" v-if="user.company.packageProject == 1">
  312. <template slot-scope="scope">
  313. <span v-if="user.timeType.projectLevelState == 1">{{scope.row.levelName}}</span>
  314. <span v-else>{{importanceListLable[scope.row.level - 1]}}</span>
  315. </template>
  316. </el-table-column>
  317. <!-- 供应商 -->
  318. <!-- <el-table-column prop="providerNames" label="供应商" min-width="190" v-if="user.company.packageProvider">
  319. </el-table-column> -->
  320. <!-- <div v-if="user.company.packageProvider"> -->
  321. <template>
  322. <div v-for="(item, index) in listHeader" :key="index">
  323. <el-table-column prop="providerNames" :label="item" min-width="190" v-if="user.company.packageProvider">
  324. <template slot-scope="scope">
  325. <div>
  326. {{item | mobans(scope.row.providerInfoList)}}
  327. </div>
  328. </template>
  329. </el-table-column>
  330. </div>
  331. </template>
  332. <el-table-column prop="status" :label="$t('state.states')" min-width="100" sortable="custom">
  333. <template slot-scope="scope">
  334. {{scope.row.status == null?"-":statusTxt[scope.row.status]}}
  335. </template>
  336. </el-table-column>
  337. <!--专业项目协作-->
  338. <el-table-column prop="planStartDate" :label="$t('time.startDate')" min-width="96" >
  339. </el-table-column>
  340. <el-table-column prop="planEndDate" :label="$t('expirationdate')" min-width="96" >
  341. </el-table-column>
  342. <el-table-column prop="progress" :label="$t('completeness')" min-width="100" v-if="user.company.packageProject == 1">
  343. <template slot-scope="scope">
  344. {{scope.row.progress==null?"-":scope.row.progress}}%
  345. </template>
  346. </el-table-column>
  347. <el-table-column :label="$t('operation')" :width="showColumnWidth" align="left" fixed="right" v-if="showColumnWidth != '0' || permissions.projectManagement">
  348. <template slot-scope="scope">
  349. <el-button v-if="(permissions.projectManagement || user.id==scope.row.creatorId) && user.timeType.mainProjectState != '1'" size="mini" @click="subProject(scope.row)">{{ $t('lable.subproject') }}</el-button>
  350. <el-button size="mini" v-if="permissions.projectParticipator || permissions.projectManagement || user.id==scope.row.inchargerId || user.id==scope.row.creatorId" type="primary" @click="handleAdd(scope.$index, scope.row)">{{ $t('bian-ji') }}</el-button>
  351. <!-- <el-button v-if="permissions.projectManagement || user.id==scope.row.creatorId" size="mini" @click="deletePro(scope.$index, scope.row)">删除</el-button> -->
  352. <el-dropdown class="customdropdown" split-button size="mini" @click="finishPro(scope.row)" v-if="(permissions.projectManagement || user.id==scope.row.creatorId || user.id==scope.row.inchargerId) && scope.row.status == 1" placement="bottom-start">
  353. {{ $t('wan-cheng') }}
  354. <el-dropdown-menu slot="dropdown" class="customdropdown_menu">
  355. <el-button size="mini" @click="cancelPro(scope.row)" class="customdropdown_menu_btn">{{ $t('btn.undo') }}</el-button><br>
  356. <el-button size="mini" @click="suspendPro(scope.row)" class="customdropdown_menu_btn">{{ $t('zan-ting') }}</el-button><br>
  357. </el-dropdown-menu>
  358. </el-dropdown>
  359. <el-button v-if="(permissions.projectManagement || user.id==scope.row.inchargerId || user.id==scope.row.creatorId) && scope.row.status >= 2" size="mini" @click="restartPro(scope.row)">{{ $t('zhong-qi') }}</el-button>
  360. </template>
  361. </el-table-column>
  362. </el-table>
  363. <!--工具条-->
  364. <el-col :span="24" class="toolbar">
  365. <el-button size="small" @click="batchSetWudulistBtn1" v-if="(user.timeType.customDegreeActive || user.company.packageProject) && (showColumnWidth != '0' || permissions.projectManagement)">{{ $t('btn.cancel') }}</el-button>
  366. <template v-if="user.timeType.customDegreeActive && (showColumnWidth != '0' || permissions.projectManagement)">
  367. <el-button size="small" type="primary" @click="batchSetWudulistBtn2(true)">{{ $t('volumeset') }} {{user.timeType.customDegreeName}}</el-button>
  368. <el-button size="small" type="primary" @click="batchSetWudulistBtn2(false)">{{ $t('pi-liang-tian-jia') }} {{user.timeType.customDegreeName}}</el-button>
  369. </template>
  370. <template v-if="user.company.packageProject && (showColumnWidth != '0' || permissions.projectManagement)">
  371. <el-button size="small" type="primary" @click="addGroupPerson()" :loading="addGroupPersonBtnLoading">{{ $t('groupparticipantsinbatches') }}</el-button>
  372. </template>
  373. <template v-if="(showColumnWidth != '0' || permissions.projectManagement)">
  374. <el-button size="small" type="primary" @click="addProPreson()">{{ $t('projectparticipantsinbatches') }}</el-button>
  375. <el-button size="small" type="primary" @click="batchIncharger()">{{ $t('projectmanagersinbatches') }}</el-button>
  376. <!-- <el-button size="small" type="primary" @click="batchDelete()">批量删除</el-button> -->
  377. </template>
  378. <el-pagination
  379. @size-change="handleSizeChange"
  380. @current-change="handleCurrentChange"
  381. :page-sizes="[20 , 50 , 80 , 100]"
  382. :page-size="size"
  383. layout="total, sizes, prev, pager, next"
  384. :total="total"
  385. style="float:right;"
  386. ></el-pagination>
  387. </el-col>
  388. <!--新增界面-->
  389. <el-dialog :title="title" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth" width="960px" :top="'6vh'">
  390. <div style="height: 72vh;overflow-y: auto;overflow-x: hidden;">
  391. <el-form ref="form1" :model="addForm" :rules="rules" label-width="120px">
  392. <el-form-item :label="$t('Itemno')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''">
  393. <!-- <el-input v-model="addForm.code" :disabled="!permissions.projectManagement && addForm.creatorId != user.id" placeholder="请输入项目编号" clearable></el-input> -->
  394. <el-input v-model="addForm.code" :placeholder="$t('peaseenterthe')" clearable :disabled="canOnlyModParticipator || (!permissions.projectManagement && addForm.creatorId != user.id && !permissions.projectCodeAndName)"></el-input>
  395. </el-form-item>
  396. <el-form-item :label="$t('zhu-xiang-mu')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''" v-if="user.timeType.mainProjectState == '1'">
  397. <!-- <el-select v-model="addForm.projectMainId" clearable :disabled="!permissions.projectManagement && addForm.creatorId != user.id" @change="projectManagementChange"> -->
  398. <el-select v-model="addForm.projectMainId" clearable @change="projectManagementChange">
  399. <el-option v-for="(item) in mainProjectList" :key="item.id" :value="item.id" :label="item.name + '\u3000' + item.code">
  400. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.code }}</span>
  401. <span style="float: right;margin-left: 20px">{{ item.name }}</span>
  402. </el-option>
  403. </el-select>
  404. </el-form-item>
  405. <el-form-item :label="$t('projectclassification')" v-if="user.timeType.mainProjectState != '1'">
  406. <!-- <el-select v-model="addForm.category" style="width:32%;" clearable :disabled="!permissions.projectManagement && addForm.creatorId != user.id"> -->
  407. <el-select v-model="addForm.category" style="width:32%;" clearable filterable :disabled="canOnlyModParticipator">
  408. <el-option v-for="(item) in baseClfList" :key="item.id" :value="item.id" :label="item.name"></el-option>
  409. </el-select>
  410. </el-form-item>
  411. <el-form-item :label="$t('headerTop.projectName')" prop="name">
  412. <!-- <el-input v-model="addForm.name" :disabled="!permissions.projectManagement && addForm.creatorId != user.id" placeholder="请输入项目名称" clearable></el-input> -->
  413. <el-input v-model="addForm.name" :placeholder="$t('peaseenterthe')" clearable :disabled="canOnlyModParticipator || (!permissions.projectManagement && addForm.creatorId != user.id && !permissions.projectCodeAndName)"></el-input>
  414. </el-form-item>
  415. <el-form-item :label="$t('other.projectDescription')" prop="projectDesc">
  416. <!-- <el-input v-model="addForm.projectDesc" :disabled="!permissions.projectManagement && addForm.creatorId != user.id" placeholder="请输入项目描述" clearable maxlength="4000"></el-input> -->
  417. <el-input v-model="addForm.projectDesc" :placeholder="$t('peaseenterthe')" clearable maxlength="4000" :disabled="canOnlyModParticipator"></el-input>
  418. </el-form-item>
  419. <el-form-item :label="$t('projecttype')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''" prop="isPublic">
  420. <!-- <el-select v-model="addForm.isPublic" style="width:32%;" @change="selectPublic" :disabled="!permissions.projectManagement && addForm.creatorId != user.id"> -->
  421. <el-select v-model="addForm.isPublic" style="width:32%;" @change="selectPublic" :disabled="canOnlyModParticipator">
  422. <!-- <el-option :value="0" :label="$t('commonproject')"></el-option>
  423. <el-option :value="1" :label="$t('publicprojects')"></el-option> -->
  424. <el-option :value="0" :label="$t('zheng-shi-xiang-mu')"></el-option>
  425. <el-option :value="1" :label="$t('fei-xiang-mu')"></el-option>
  426. </el-select>
  427. <el-tooltip effect="dark" :content="$t('zheng-shi-xiang-mu-zhi-dui-can-yu-ren-kai-fang-fei-xiang-mu-dui-suo-you-cheng-yuan-kai-fang')" placement="top-start">
  428. <i class="el-icon-question"></i>
  429. </el-tooltip>
  430. <div v-if="user.company.packageCustomer == 1" style="display: inline-block;width: 50%">
  431. <span style="margin-left:63px;margin-right:10px;" >{{ $t('ke-hu') }}</span>
  432. <el-select v-model="addForm.customerId" clearable="true" filterable :placeholder="$t('defaultText.pleaseChoose')" style="width:70%;" :disabled="canOnlyModParticipator">
  433. <el-option v-for="item in customerList" :key="item.id" :label="item.customerName" :value="item.id"></el-option>
  434. </el-select>
  435. </div>
  436. </el-form-item>
  437. <el-form-item :label="$t('subordinatedepartments')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''" v-if="user.timeType.projectWithDept">
  438. <el-cascader v-model="addForm.deptId" :options="departmentList" :placeholder="$t('defaultText.pleaseChoose')" :disabled="canOnlyModParticipator"
  439. :props="{ checkStrictly: true, expandTrigger: 'hover' }" clearable filterable @change="cascaderChange" style="width: 100%"
  440. ></el-cascader>
  441. </el-form-item>
  442. <!-- 供应商 -->
  443. <!-- <el-form-item label="供应商" v-if="user.company.packageProvider">
  444. <el-select v-model="addForm.supplierId" multiple collapse-tags style="width:32%;" placeholder="请选择供应商">
  445. <el-option v-for="item in supplierList" :key="item.id" :label="item.providerName" :value="item.id">
  446. </el-option>
  447. </el-select>
  448. </el-form-item> -->
  449. <el-form-item :label="$t('supplier')" v-if="user.company.packageProvider">
  450. <el-select v-model="addForm.supplierId" multiple :placeholder="$t('defaultText.pleaseChoose')" filterable="true" style="width: 100%" :disabled="canOnlyModParticipator">
  451. <span v-for="(item, index) in supplierList" :key="index">
  452. <el-option :label="item.providerName" :value="item.id"></el-option>
  453. </span>
  454. </el-select>
  455. </el-form-item>
  456. <el-form-item :label="yonghuUser.customDegreeName" v-if="yonghuUser.customDegreeActive == 1">
  457. <el-select v-model="auseList" multiple :placeholder="$t('defaultText.pleaseChoose')" filterable="true" style="width: 100%" :disabled="canOnlyModParticipator">
  458. <span v-for="(item, index) in ause" :key="index">
  459. <el-option :label="item.name" :value="item.id"></el-option>
  460. </span>
  461. </el-select>
  462. </el-form-item>
  463. <!-- <el-form-item label="客户" v-if="user.company.packageCustomer == 1">
  464. <el-select v-model="addForm.customerId" clearable="true" filterable placeholder="请选择客户" style="width:100%;" >
  465. <el-option v-for="item in customerList" :key="item.id" :label="item.customerName" :value="item.id"></el-option>
  466. </el-select>
  467. </el-form-item> -->
  468. <el-form-item :label="$t('Allparticipants')" v-show="addForm.isPublic == 0" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''">
  469. <el-tooltip placement="top" effect="light" v-if="user.userNameNeedTranslate != 1">
  470. <div slot="content" style="width:780px">{{addForm.userNames}}</div>
  471. <el-input @focus="showChooseMembTree" v-model="addForm.userNames"></el-input>
  472. </el-tooltip>
  473. <el-tooltip placement="top" effect="light" v-if="user.userNameNeedTranslate == 1">
  474. <div slot="content" style="width:780px">
  475. <span v-for="(item, index) in addFormUserNames" :key="index">
  476. <!-- {{item}} -->
  477. <ww-open-data type='userName' :openid='item'></ww-open-data>
  478. <span v-if="index < addFormUserNames.length - 1">,</span>
  479. </span>
  480. </div>
  481. <div @click="showChooseMembTree" style="width: 800px;overflow:hidden;white-space:nowrap;height:40px;border: 1px solid #DCDFE6;border-radius: 4px;box-sizing: border-box;padding: 0 10px">
  482. <span v-for="(item, index) in addFormUserNames" :key="index">
  483. <!-- {{item}} -->
  484. <ww-open-data type='userName' :openid='item'></ww-open-data>
  485. <span v-if="index < addFormUserNames.length - 1">,</span>
  486. </span>
  487. </div>
  488. </el-tooltip>
  489. </el-form-item>
  490. <el-form-item :label="$t('projectmanager')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''">
  491. <el-select v-if="user.userNameNeedTranslate != 1" v-model="addForm.inchargerId" filterable :placeholder="$t('defaultText.pleaseChoose')" style="width:32%;" :disabled="canOnlyModParticipator">
  492. <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id">
  493. <span style="float: left">{{ item.name }}</span>
  494. <span style="float: right; color: #8492a6;" v-if="user.companyId == 936">{{ item.jobNumber }}</span>
  495. </el-option>
  496. </el-select>
  497. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :subject="participator" :subjectId="addForm.inchargerId" :distinction="'3'" @selectCal="selectCal"></selectCat>
  498. </el-form-item>
  499. <el-form-item :label="$t('newspaperauditor')" v-show="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  500. <el-select v-if="user.userNameNeedTranslate != '1'" v-model="addForm.auditUserIds" multiple="true" :disabled=" permissions.projectParticipator || (!(permissions.projectManagement|| user.id == addForm.inchargerId || user.id == addForm.creatorId))" filterable :placeholder="$t('defaultistheprojectleader')" style="width:100%;" >
  501. <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id"></el-option>
  502. </el-select>
  503. <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :tile="true" :widthStr="'800'" :disabled="!(permissions.projectManagement|| user.id == addForm.inchargerId || user.id == addForm.creatorId)" :subjectId="addForm.auditUserIds" :subject="participator" :clearable="false" :distinction="'10'" :multiSelect="true" @selectCal="selectCal"></selectCat>
  504. </el-form-item>
  505. <!--专业项目协作版本功能 -->
  506. <el-form-item :label="$t('ji-bie')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''" v-if="user.company.packageProject==1">
  507. <el-select v-model="addForm.level" :placeholder="$t('defaultText.pleaseChoose')" style="width:32%;" v-if="user.timeType.projectLevelState == 1" :disabled="canOnlyModParticipator">
  508. <el-option v-for="item in levelList" :key="item.id" :label="item.projectLevelName" :value="item.id"></el-option>
  509. </el-select>
  510. <el-select v-model="addForm.level" :placeholder="this.$t('defaultText.pleaseChoose')" style="width:32%;" :disabled="canOnlyModParticipator" v-else>
  511. <el-option v-for="item in importanceList" :key="item.id" :label="item.label" :value="item.id"></el-option>
  512. </el-select>
  513. <!-- 增加合同金额字段 -->
  514. <!-- <span style="margin-left:63px;margin-right:10px;" v-if="user.company.packageProject==1">合同金额</span>
  515. <el-input id="contractAmount" v-model="addForm.contractAmount" style="width:33%;" @blur="contractAmountChange(addForm.contractAmount)"
  516. placeholder="整数" clearable @keyup.native="restrictNumber('contractAmount')" :disabled="title == '新增项目' ? false : false"></el-input><span style="margin-left:10px;">元</span> -->
  517. </el-form-item>
  518. <!-- 增加合同金额字段 -->
  519. <el-form-item :label="$t('contractamount')" v-if="user.company.packageProject==1">
  520. <el-input id="contractAmount" v-model="addForm.contractAmount" :disabled="canOnlyModParticipator" style="width:32%;" @input="contractAmountChange(addForm.contractAmount)" :placeholder="$t('zheng-shu')" clearable @keyup.native="restrictNumber('contractAmount')"></el-input><span style="margin-left:10px;position:absolute;">{{ $t('yuan') }}</span>
  521. <template v-if="title == $t('modifytheproject') && contractAmountReasonShow">
  522. <span style="margin-left:63px;margin-right:10px;">{{ $t('modifythereason') }}</span>
  523. <el-input v-model="addForm.changeContractReason" style="width:33%" clearable :placeholder="$t('contractamountasd')"></el-input>
  524. </template>
  525. </el-form-item>
  526. <el-form-item :label="$t('ommencementDate')" prop="planStartDate" >
  527. <el-date-picker v-model="addForm.planStartDate" :disabled="canOnlyModParticipator"
  528. :editable="false" style="width:32%;"
  529. format="yyyy-MM-dd"
  530. value-format="yyyy-MM-dd"
  531. :clearable="false" type="date"
  532. :placeholder="$t('optiondate')"></el-date-picker>
  533. <span style="margin-left:63px;margin-right:10px;" >{{ $t('ji-hua-jie-shu-ri-qi') }}</span>
  534. <el-date-picker v-model="addForm.planEndDate" style="width:33%;"
  535. :editable="false" :disabled="canOnlyModParticipator"
  536. format="yyyy-MM-dd"
  537. value-format="yyyy-MM-dd"
  538. :clearable="false" type="date"
  539. :placeholder="$t('optiondate')"></el-date-picker>
  540. </el-form-item>
  541. <!-- 增加BU字段 绎维固定字段 -->
  542. <el-form-item label="BU" v-if="user.companyId == '862'">
  543. <el-cascader ref="deptCascader" v-model="addForm.bu" style="width: 250px" :show-all-levels="false" :disabled="canOnlyModParticipator"
  544. :options="buOption" :props="{ checkStrictly: true, expandTrigger: 'hover' }" clearable v-show="user.userNameNeedTranslate != 1"></el-cascader>
  545. <vueCascader :size="'small'" :subjectId="addForm.bu" :widthStr="'200'" :clearable="true" :subject="buOption" :radios="true" :distinction="'32'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  546. </el-form-item>
  547. <el-form-item :label="$t('projectoutput')" prop="outputValue" v-if="user.timeType.outputValueStatus == 1">
  548. <el-input id="outputValue" v-model="addForm.outputValue" style="width:32%;" :disabled="canOnlyModParticipator"
  549. placeholder="" clearable @keyup.native="restrictNumber('outputValue')">
  550. </el-input><span style="margin-left:10px;">{{ $t('yuan') }}</span>
  551. </el-form-item>
  552. <!-- 单个公司的固定字段 -->
  553. <div v-if="user.companyId == '936'">
  554. <el-form-item :label="$t('contractno')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''">
  555. <el-input v-model="addForm.contractCode" maxlength="50" show-word-limit :placeholder="$t('peaseenterthe')" clearable :disabled="canOnlyModParticipator"></el-input>
  556. </el-form-item>
  557. <el-form-item :label="$t('warrantystartime')">
  558. <el-date-picker v-model="addForm.warrantyStartDate"
  559. :editable="false" style="width:32%;" :disabled="canOnlyModParticipator"
  560. format="yyyy-MM-dd"
  561. value-format="yyyy-MM-dd"
  562. :clearable="false" type="date"
  563. :placeholder="$t('optiondate')"></el-date-picker>
  564. <span style="margin-left:63px;margin-right:10px;" >{{ $t('warrantyexpirationtime') }}</span>
  565. <el-date-picker v-model="addForm.warrantyEndDate" style="width:33%;" :disabled="canOnlyModParticipator"
  566. :editable="false"
  567. format="yyyy-MM-dd"
  568. value-format="yyyy-MM-dd"
  569. :clearable="false" type="date"
  570. placeholder="$t('optiondate')"></el-date-picker>
  571. </el-form-item>
  572. <el-form-item :label="$t('IndependentProject')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''">
  573. <!-- <el-input v-model="addForm.projectCategorySub" placeholder="请输入自主项目类别" clearable></el-input> -->
  574. <el-select v-model="addForm.projectCategorySub" :placeholder="$t('defaultText.pleaseChoose')" clearable :disabled="canOnlyModParticipator">
  575. <el-option :value="$t('softwareproject')" :label="$t('softwareproject')"></el-option>
  576. <el-option :value="$t('hardwareproject')" :label="$t('hardwareproject')"></el-option>
  577. <el-option :value="$t('integrationproject')" :label="$t('integrationproject')"></el-option>
  578. <el-option :value="$t('fu-wu-xiang-mu')" :label="$t('fu-wu-xiang-mu')"></el-option>
  579. </el-select>
  580. </el-form-item>
  581. <el-form-item :label="$t('region')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''">
  582. <el-input v-model="addForm.region" :placeholder="$t('peaseenterthe')" clearable :disabled="canOnlyModParticipator"></el-input>
  583. </el-form-item>
  584. <el-form-item :label="$t('subordinateBU')" >
  585. <el-input v-model="addForm.bu" :placeholder="$t('subordinateBU')" clearable :disabled="canOnlyModParticipator"></el-input>
  586. </el-form-item>
  587. </div>
  588. <!-- <div v-if="user.companyId == '428'">
  589. <el-form-item :label="$t('projectgroup')" >
  590. <el-input v-model="addForm.projectCategorySub" maxlength="50" show-word-limit :placeholder="$t('peaseenterthe')" clearable></el-input>
  591. </el-form-item>
  592. </div> -->
  593. <!-- 项目基线 -->
  594. <div style="margin: 10px 0 30px 0;min-height:200px;" v-if="user.company.packageProject == 1 && !canOnlyModParticipator">
  595. <el-tabs v-model="activeName" @tab-click="handleClick">
  596. <el-tab-pane :label="$t('costbaseline')" name="baseCostPanel" >
  597. <div style="padding-top:10px;">
  598. <!--新版 -->
  599. <span class="rg_span" v-for="(item, index) in projectBaseCostData" :key="item.id">
  600. <span style="width:120px;display: inline-block;" v-if="user.company.packageProject==1">{{item.baseName}}</span>
  601. <el-input :id="'baseCost'+index" @input="addUpfun()" v-model="item.baseAmount" style="width:200px; margin-bottom: 20px"
  602. :placeholder="$t('zheng-shu')" clearable @keyup.native="restrictNumber('baseCost'+index)"></el-input><span style="margin-left:10px;">{{ $t('yuan') }}</span>
  603. </span>
  604. <!-- 合计 -->
  605. <div style="margin-top: 10px;float:right;">
  606. <span style="margin-right:50px;margin-right:10px;" v-if="user.company.packageProject==1">{{ $t('other.totals') }}</span>
  607. <span v-if="addForm.budget <= 0 || addForm.budget == undefined">0</span>
  608. <span v-else>{{addForm.budget | numberToCurrency}}</span>
  609. <span style="margin-right:50px;margin-left:10px;">{{ $t('yuan') }}</span>
  610. </div>
  611. </div>
  612. </el-tab-pane>
  613. <el-tab-pane :label="$t('keynodes')" name="baseCostPanep" v-if="user.companyId == '936'">
  614. <div style="padding-top:10px;">
  615. <!--新版 -->
  616. <div class="keyNodes">
  617. <div class="keyNodesName">{{ $t('nameofthenode') }}</div>
  618. <div class="keyNodesTime">{{ $t('plannedcompletiontime') }}</div>
  619. <div class="keyNodesTime">{{ $t('actualcompletiontime') }}</div>
  620. <div class="keyNodesTime">{{ $t('state.states') }}</div>
  621. </div>
  622. <div class="keyNodes" v-for="item in projectKeyNodesData" :key="item.nodesId">
  623. <div class="keyNodesName">{{item.nodesName}}</div>
  624. <div class="keyNodesTime">
  625. <el-date-picker v-model="item.planCompleteDate" clearable style="width: 80%" size="small" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd" type="date" :placeholder="$t('optiondate')"></el-date-picker>
  626. </div>
  627. <div class="keyNodesTime">
  628. <el-date-picker v-model="item.actualCompleteDate" clearable style="width: 80%" size="small" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd" type="date" :placeholder="$t('optiondate')"></el-date-picker>
  629. </div>
  630. <div class="keyNodesTime">
  631. <el-select v-model="item.states" :placeholder="$t('defaultText.pleaseChoose')" style="width: 80%" size="small">
  632. <el-option :label="$t('zheng-chang')" value="0"></el-option>
  633. <el-option :label="$t('yan-qi')" value="1"></el-option>
  634. <el-option :label="$t('wan-cheng')" value="2"></el-option>
  635. </el-select>
  636. </div>
  637. </div>
  638. </div>
  639. </el-tab-pane>
  640. <el-tab-pane :label="$t('engineering')" name="engineeringProfession" v-if="user.company.packageEngineering == 1">
  641. <div style="padding-top:10px;" class="gongcheng">
  642. <el-table :data="projectProfessionList" size="small" :key="Math.random()" :height="'400px'">
  643. <el-table-column prop="professionId" width="200">
  644. <template slot-scope="scope">
  645. <el-select v-model="scope.row.professionId" >
  646. <el-option v-for="item in professionList" :key="item.id" :label="item.name" :value="item.id"/>
  647. </el-select>
  648. </template>
  649. <template slot="header" >
  650. <span style="font-size:14px;font-weight:normal;">{{ $t('nameprofessional') }}</span>
  651. </template>
  652. </el-table-column>
  653. <el-table-column prop="percentage" width="120" :label="$t('zhan-bi')">
  654. <template slot-scope="scope">
  655. <div><el-input type="number" v-model="scope.row.percentage"></el-input></div>
  656. </template>
  657. </el-table-column>
  658. <el-table-column prop="membNames" :label="$t('personnelproportion')">
  659. <template slot-scope="scope">
  660. <span style="margin:0 5px;" v-for="item in scope.row.membList" :key="item.membId">
  661. <span v-if="user.userNameNeedTranslate != 1">{{item.membName}}({{item.percentage}}%)</span>
  662. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.membName'></ww-open-data>({{item.percentage}}%)</span>
  663. </span>
  664. <el-link @click="showEditPpMembs(scope.row)">{{(scope.row.membList == null || scope.row.membList.length == 0)?$t('professionalparticipants'):$t('setup')}}</el-link>
  665. </template>
  666. </el-table-column>
  667. <el-table-column prop="inchargerName" width="200" :label="$t('head')">
  668. <template slot-scope="scope">
  669. <el-select v-model="scope.row.inchargerId" v-if="user.userNameNeedTranslate != 1">
  670. <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id"></el-option>
  671. </el-select>
  672. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'mini'" :subject="participator" :subjectId="scope.row.inchargerId" :other="scope.$index" :distinction="'4'" @selectCal="selectCal"></selectCat>
  673. </template>
  674. </el-table-column>
  675. <el-table-column width="80">
  676. <template slot-scope="scope">
  677. <el-button icon="el-icon-delete" size="mini" style="margin-left:10px;" @click.stop.native="deleteItem(scope.$index)"></el-button>
  678. </template>
  679. <template slot="header" >
  680. <el-link type="primary" :underline="false" @click="addItem">{{ $t('addTian') }}</el-link>
  681. </template>
  682. </el-table-column>
  683. </el-table>
  684. </div>
  685. </el-tab-pane>
  686. <!-- <el-tab-pane label="相关领导" name="leaders" >
  687. <div style="padding-top:10px;">
  688. <el-input @focus="showChooseLeaderTree" v-model="addForm.notifyUserNames" placeholder="请选择需要接收审核通知的相关领导"></el-input>
  689. </div>
  690. </el-tab-pane> -->
  691. </el-tabs>
  692. </div>
  693. </el-form>
  694. </div>
  695. <div slot="footer" class="dialog-footer;">
  696. <el-button @click.native="deletePro(1, addForm)" v-if="(permissions.projectManagement || user.id==deleteVif) && addForm.id" style="float:left">{{ $t('btn.delete') }}</el-button>
  697. <el-button @click.native="addFormVisible = false">{{ $t('btn.cancel') }}</el-button>
  698. <el-button type="primary" @click="submitInsert" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  699. </div>
  700. </el-dialog>
  701. <!--用户详细信息弹出框-->
  702. <el-dialog :title="$t('Checkthedetails')" v-if="userDetailVisible" :visible.sync="userDetailVisible" :close-on-click-modal="false" customClass="customWidth" width="400px">
  703. <div class="line"><span>{{ $t('lable.name') }}</span>
  704. <span v-if="user.userNameNeedTranslate != 1">{{userDetail.name}}</span>
  705. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='userDetail.name'></ww-open-data></span>
  706. </div>
  707. <div class="line"><span>{{ $t('Worknumber') }}</span><span>{{userDetail.jobNumber}}</span></div>
  708. <div class="line"><span>{{ $t('lable.phone') }}</span><span>{{userDetail.phone}}</span></div>
  709. <div class="line"><span>{{ $t('jiao-se') }}</span><span>{{userDetail.roleName}}</span></div>
  710. <div class="line"><span>{{ $t('lable.department') }}</span>
  711. <span v-if="user.userNameNeedTranslate != 1">{{userDetail.departmentName}}</span>
  712. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='userDetail.departmentName'></ww-open-data></span>
  713. </div>
  714. <div slot="footer" class="dialog-footer">
  715. <el-button type="primary" @click="userDetailVisible = false" >{{ $t('btn.determine') }}</el-button>
  716. </div>
  717. </el-dialog>
  718. <!-- 子项目列表 -->
  719. <el-dialog :title="$t('listofsubitems')" show-header="false" v-if="subProjectVisible" :visible.sync="subProjectVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  720. <el-table :data="subProjectList" highlight-current-row height="400" style="width: 100%;">
  721. <!-- <el-table-column type="index" width="60" label="序号">
  722. <template slot-scope="scope" >
  723. {{scope.$index+1+(page-1)*size}}
  724. </template>
  725. </el-table-column> -->
  726. <el-table-column width="120" :label="$t('subprojectno')" prop="code"></el-table-column>
  727. <el-table-column prop="name" :label="$t('names')" ></el-table-column>
  728. <el-table-column :label="$t('operation')" width="150">
  729. <template slot-scope="scope" >
  730. <el-button size="small" type="primary" @click="addNewSubProject(scope.row)">{{ $t('bian-ji') }}</el-button>
  731. <el-button size="small" type="danger" @click="deleteSubPro(scope.row)">{{ $t('btn.delete') }}</el-button>
  732. </template>
  733. </el-table-column>
  734. </el-table>
  735. <div slot="footer" class="dialog-footer">
  736. <el-button type="primary" @click="subProjectVisible = false" >{{ $t('Shutdown') }}</el-button>
  737. <el-button type="primary" @click="addNewSubProject()" >{{ $t('addsubitems') }}</el-button>
  738. </div>
  739. </el-dialog>
  740. <!-- 新增子项目弹出框 -->
  741. <el-dialog :title="$t('modifysubproject')" v-if="addSubProject" :visible.sync="addSubProject" :close-on-click-modal="false" customClass="customWidth" width="500px">
  742. <el-form ref="form2" :model="temaddForm" :rules="rules" label-width="100px">
  743. <!-- <el-form-item label="项目编号" prop="code"> -->
  744. <el-form-item :label="$t('Itemno')">
  745. <el-input v-model="temaddForm.code" :placeholder="$t('peaseenterthe')" clearable></el-input>
  746. </el-form-item>
  747. <el-form-item :label="$t('headerTop.projectName')" prop="name">
  748. <el-input v-model="temaddForm.name" :placeholder="$t('peaseenterthe')" clearable></el-input>
  749. </el-form-item>
  750. </el-form>
  751. <div slot="footer" class="dialog-footer">
  752. <el-button @click.native="addSubProject = false">{{ $t('btn.cancel') }}</el-button>
  753. <el-button type="primary" @click="submitInsertSubProject" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  754. </div>
  755. </el-dialog>
  756. <!-- 项目基线成本项配置弹出框 -->
  757. <el-dialog :title="$t('baselinecostitemmanagement')" show-header="false" v-if="showBaseConfig" :visible.sync="showBaseConfig" :close-on-click-modal="false" customClass="customWidth" width="600px">
  758. <el-table :data="baseCostItemList" highlight-current-row height="400" style="width: 100%;">
  759. <el-table-column type="index" width="60" :label="$t('headerTop.serialNumber')">
  760. <template slot-scope="scope" >
  761. {{scope.$index+1+(page-1)*size}}
  762. </template>
  763. </el-table-column>
  764. <el-table-column prop="name" :label="$t('names')" ></el-table-column>
  765. <el-table-column prop="alarmType" :label="$t('yu-jing')">
  766. <template slot-scope="scope">
  767. <span>{{scope.row.alarmType ? $t('hourscostwarning') : $t('wu-yu-jing')}}</span>
  768. </template>
  769. </el-table-column>
  770. <el-table-column :label="$t('operation')" width="150">
  771. <template slot-scope="scope" >
  772. <el-button size="small" type="primary" @click="addNewBaseItem(scope.row)">{{ $t('bian-ji') }}</el-button>
  773. <el-button size="small" type="danger" @click="deleteBaseItem(scope.row)">{{ $t('btn.delete') }}</el-button>
  774. </template>
  775. </el-table-column>
  776. </el-table>
  777. <div slot="footer" class="dialog-footer">
  778. <el-button type="primary" @click="showBaseConfig = false" >{{ $t('Shutdown') }}</el-button>
  779. <el-button type="primary" @click="addNewBaseItem()" >{{ $t('newcostitem') }}</el-button>
  780. </div>
  781. </el-dialog>
  782. <!-- 项目关键节点配置弹出框 -->
  783. <el-dialog :title="$t('keyprojectnodes')" show-header="false" v-if="keyNodesIsShow" :visible.sync="keyNodesIsShow" :close-on-click-modal="false" customClass="customWidth" width="600px">
  784. <el-table :data="keyNodesList" highlight-current-row height="400" style="width: 100%;">
  785. <el-table-column type="index" width="60" :label="$t('headerTop.serialNumber')">
  786. <template slot-scope="scope" >
  787. {{scope.$index+1+(page-1)*size}}
  788. </template>
  789. </el-table-column>
  790. <el-table-column prop="name" :label="$t('names')" ></el-table-column>
  791. <el-table-column :label="$t('operation')" width="150">
  792. <template slot-scope="scope" >
  793. <el-button size="small" type="primary" @click="addNewkeyNodes(scope.row)">{{ $t('bian-ji') }}</el-button>
  794. <el-button size="small" type="danger" @click="deletekeyNodes(scope.row)">{{ $t('btn.delete') }}</el-button>
  795. </template>
  796. </el-table-column>
  797. </el-table>
  798. <div slot="footer" class="dialog-footer">
  799. <el-button type="primary" @click="keyNodesIsShow = false" >{{ $t('Shutdown') }}</el-button>
  800. <el-button type="primary" @click="addNewkeyNodes()" >{{$t('addingKeyNodes')}}</el-button>
  801. </div>
  802. </el-dialog>
  803. <!-- 分类条目配置 -->
  804. <el-dialog :title="$t('projectclassificationqwe')" show-header="false" v-if="showClfDialog" :visible.sync="showClfDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  805. <el-table :data="baseClfList" highlight-current-row height="400" style="width: 100%;">
  806. <el-table-column type="index" width="60" :label="$t('headerTop.serialNumber')">
  807. <template slot-scope="scope" >
  808. {{scope.$index+1}}
  809. </template>
  810. </el-table-column>
  811. <el-table-column prop="name" :label="$t('names')" ></el-table-column>
  812. <el-table-column :label="$t('operation')" :width="user.companyId == '862' ? '300px' : '180px'">
  813. <template slot-scope="scope" >
  814. <el-button size="small" type="primary" @click="auditProcess(scope.row)" v-if="user.companyId == '862'" >{{ $t('AuditProcess') }}</el-button>
  815. <el-button size="small" type="primary" @click="addNewClf(scope.row)">{{ $t('bian-ji') }}</el-button>
  816. <el-button size="small" type="danger" @click="deleteClf(scope.row)">{{ $t('btn.delete') }}</el-button>
  817. </template>
  818. </el-table-column>
  819. </el-table>
  820. <div slot="footer" class="dialog-footer">
  821. <el-button type="primary" @click="showClfDialog = false" >{{ $t('Shutdown') }}</el-button>
  822. <el-button type="primary" @click="addNewClf()" >{{ $t('newCategoryItem') }}</el-button>
  823. </div>
  824. </el-dialog>
  825. <!-- 主项目配置 -->
  826. <el-dialog :title="$t('masterprojectmanagement')" show-header="false" v-if="mainProjectDialog" :visible.sync="mainProjectDialog" :close-on-click-modal="false" customClass="customWidth" width="800px">
  827. <el-table :data="mainProjectList" highlight-current-row height="400" style="width: 100%;">
  828. <el-table-column type="index" width="60" :label="$t('headerTop.serialNumber')">
  829. <template slot-scope="scope" >
  830. {{scope.$index+1+(page-1)*size}}
  831. </template>
  832. </el-table-column>
  833. <el-table-column prop="code" :label="$t('bian-hao')" ></el-table-column>
  834. <el-table-column prop="name" :label="$t('names')" ></el-table-column>
  835. <el-table-column prop="categoryName" :label="$t('fen-lei-ming-cheng')" ></el-table-column>
  836. <el-table-column :label="$t('operation')" width="150">
  837. <template slot-scope="scope" >
  838. <el-button size="small" type="primary" @click="addManPro(scope.row)">{{ $t('bian-ji') }}</el-button>
  839. <el-button size="small" type="danger" @click="deleteManPro(scope.row)">{{ $t('btn.delete') }}</el-button>
  840. </template>
  841. </el-table-column>
  842. </el-table>
  843. <div slot="footer" class="dialog-footer">
  844. <el-button type="primary" @click="mainProjectDialog = false" >{{ $t('Shutdown') }}</el-button>
  845. <el-button type="primary" @click="addManPro()" >{{ $t('addzhuxiang') }}</el-button>
  846. </div>
  847. </el-dialog>
  848. <!-- 项目阶段配置 -->
  849. <el-dialog :title="$t('projectstagemanagement')" show-header="false" v-if="phaseProjectDialog" :visible.sync="phaseProjectDialog" :close-on-click-modal="false" customClass="customWidth" width="600px">
  850. <el-table :data="phaseList" highlight-current-row height="400" style="width: 100%;">
  851. <el-table-column type="index" width="60" :label="$t('headerTop.serialNumber')">
  852. <template slot-scope="scope" >
  853. {{scope.$index+1+(page-1)*size}}
  854. </template>
  855. </el-table-column>
  856. <el-table-column prop="projectStageName" :label="$t('phasename')" ></el-table-column>
  857. <el-table-column :label="$t('operation')" width="150">
  858. <template slot-scope="scope" >
  859. <el-button size="small" type="primary" @click="addPanthPro(scope.row)">{{ $t('bian-ji') }}</el-button>
  860. <el-button size="small" type="danger" @click="deletePanthPro(scope.row)">{{ $t('btn.delete') }}</el-button>
  861. </template>
  862. </el-table-column>
  863. </el-table>
  864. <div slot="footer" class="dialog-footer">
  865. <el-button type="primary" @click="phaseProjectDialog = false" >{{ $t('Shutdown') }}</el-button>
  866. <el-button type="primary" @click="addPanthPro()" >{{ $t('newprojectstage') }}</el-button>
  867. </div>
  868. </el-dialog>
  869. <!-- 项目级别管理 -->
  870. <el-dialog :title="$t('projectlevelmanagement')" show-header="false" v-if="projectLevelDialog" :visible.sync="projectLevelDialog" :close-on-click-modal="false" customClass="customWidth" width="600px">
  871. <el-table :data="levelList" highlight-current-row height="400" style="width: 100%;" >
  872. <el-table-column type="index" width="60" :label="$t('headerTop.serialNumber')">
  873. <template slot-scope="scope" >
  874. {{scope.$index+1+(page-1)*size}}
  875. </template>
  876. </el-table-column>
  877. <el-table-column prop="projectLevelName" :label="$t('levelnames')" ></el-table-column>
  878. <el-table-column :label="$t('operation')" width="150">
  879. <template slot-scope="scope" >
  880. <el-button size="small" type="primary" @click="addProjectLevel(scope.row)">{{ $t('bian-ji') }}</el-button>
  881. <el-button size="small" type="danger" @click="deleteProjectLevel(scope.row)">{{ $t('btn.delete') }}</el-button>
  882. </template>
  883. </el-table-column>
  884. </el-table>
  885. <div slot="footer" class="dialog-footer">
  886. <el-button type="primary" @click="projectLevelDialog = false" >{{ $t('Shutdown') }}</el-button>
  887. <el-button type="primary" @click="addProjectLevel()" >{{ $t('newProjectLevel') }}</el-button>
  888. </div>
  889. </el-dialog>
  890. <!-- 新增/编辑项目级别 -->
  891. <el-dialog :title="$t('modifyingtheprojectLevel')" v-if="addProjectLevelDialog" :visible.sync="addProjectLevelDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  892. <el-form ref="form2" :model="addLevelForm" :rules="rules" label-width="120px">
  893. <el-form-item :label="$t('projectLevelName')" prop="projectLevelName">
  894. <el-input v-model="addLevelForm.projectLevelName" :placeholder="$t('peaseenterthe')" clearable></el-input>
  895. </el-form-item>
  896. </el-form>
  897. <div slot="footer" class="dialog-footer">
  898. <el-button @click="addProjectLevelDialog = false">{{ $t('btn.cancel') }}</el-button>
  899. <el-button type="primary" @click="submitLevelPro" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  900. </div>
  901. </el-dialog>
  902. <!-- 新增/编辑 分类条目 -->
  903. <el-dialog :title="$t('addmodifycategoryentry')" v-if="addClfDialog" :visible.sync="addClfDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  904. <el-form ref="form2" :model="addClf" :rules="rules" label-width="100px">
  905. <!-- <el-form-item :label="$t('mainProjectName')" prop="name"> -->
  906. <el-form-item :label="$t('fen-lei-ming-cheng')" prop="name">
  907. <el-input v-model="addClf.name" :placeholder="$t('peaseenterthe')" clearable></el-input>
  908. </el-form-item>
  909. </el-form>
  910. <div slot="footer" class="dialog-footer">
  911. <el-button @click.native="addClfDialog = false">{{ $t('btn.cancel') }}</el-button>
  912. <el-button type="primary" @click="submitClf" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  913. </div>
  914. </el-dialog>
  915. <!-- 分类条目有关审核流程设置 -->
  916. <el-dialog :title="$t('AuditProcess')" v-if="auditProcessDialog" :visible.sync="auditProcessDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  917. <el-form ref="form2" :model="auditProcess" :rules="rules" label-width="150px">
  918. <!-- <el-form-item :label="$t('mainProjectName')" prop="name"> -->
  919. <el-form-item :label="$t('AuditProcess')" prop="name">
  920. <template>
  921. <el-checkbox v-model="addClf.proInchargerAudit" >项目审核人审核</el-checkbox>
  922. <div style="width: 120px ; text-align: center;"><i class="el-icon-bottom"></i></div>
  923. <el-checkbox v-model="addClf.proBuAudit" >项目所属BU负责人审核</el-checkbox>
  924. </template>
  925. </el-form-item>
  926. </el-form>
  927. <div slot="footer" class="dialog-footer">
  928. <el-button @click.native="auditProcessDialog = false">{{ $t('btn.cancel') }}</el-button>
  929. <el-button type="primary" @click="submitClf" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  930. </div>
  931. </el-dialog>
  932. <!-- 新增/编辑主项目 -->
  933. <el-dialog :title="$t('modifythemainproject')" v-if="addFlgmainProjectDialog" :visible.sync="addFlgmainProjectDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  934. <el-form ref="form2" :model="addMainForm" :rules="rules" label-width="100px">
  935. <!-- <el-form-item label="主项目编号" prop="code"> -->
  936. <el-form-item :label="$t('mainProjectNo')">
  937. <el-input v-model="addMainForm.code" :placeholder="$t('peaseenterthe')" clearable></el-input>
  938. </el-form-item>
  939. <el-form-item :label="$t('mainProjectName')" prop="name">
  940. <el-input v-model="addMainForm.name" :placeholder="$t('peaseenterthe')" clearable></el-input>
  941. </el-form-item>
  942. <el-form-item :label="$t('projectclassification')">
  943. <el-select v-model="addMainForm.categoryId" :placeholder="$t('defaultText.pleaseChoose')" clearable >
  944. <el-option v-for="item in baseClfList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  945. </el-select>
  946. </el-form-item>
  947. </el-form>
  948. <div slot="footer" class="dialog-footer">
  949. <el-button @click.native="addFlgmainProjectDialog = false">{{ $t('btn.cancel') }}</el-button>
  950. <el-button type="primary" @click="submitManPro" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  951. </div>
  952. </el-dialog>
  953. <!-- 新增/编辑项目阶段 -->
  954. <el-dialog :title="$t('modifyingtheprojectphase')" v-if="addFlgPanthProjectDialog" :visible.sync="addFlgPanthProjectDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  955. <el-form ref="form2" :model="addPanthForm" :rules="rules" label-width="120px">
  956. <el-form-item :label="$t('projectStageName')" prop="name">
  957. <el-input v-model="addPanthForm.projectStageName" :placeholder="$t('peaseenterthe')" clearable></el-input>
  958. </el-form-item>
  959. </el-form>
  960. <div slot="footer" class="dialog-footer">
  961. <el-button @click.native="addFlgPanthProjectDialog = false">{{ $t('btn.cancel') }}</el-button>
  962. <el-button type="primary" @click="submitPanthPro" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  963. </div>
  964. </el-dialog>
  965. <el-dialog :title="$t('modificationcostitem')" v-if="addBaseItemDialog" :visible.sync="addBaseItemDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  966. <el-form ref="form2" :model="addForm" :rules="rules" label-width="100px">
  967. <el-form-item :label="$t('nameofcostitem')" prop="name">
  968. <el-input v-model="addForm.name" :placeholder="$t('peaseenterthe')" clearable></el-input>
  969. </el-form-item>
  970. <el-form-item :label="$t('yu-jing')" prop="alarmType">
  971. <el-radio v-model="addForm.alarmType" :label="0">{{ $t('wu-yu-jing') }}</el-radio>
  972. <el-radio v-model="addForm.alarmType" :label="1">{{ $t('hourscostwarning') }}</el-radio>
  973. </el-form-item>
  974. </el-form>
  975. <div slot="footer" class="dialog-footer">
  976. <el-button @click.native="addBaseItemDialog = false">{{ $t('btn.cancel') }}</el-button>
  977. <el-button type="primary" @click="submitInsertBaseItem" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  978. </div>
  979. </el-dialog>
  980. <el-dialog :title="$t('modifyingKeyNodesn')" v-if="addBasekeyNodesialog" :visible.sync="addBasekeyNodesialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  981. <el-form ref="form2" :model="addFormkeyNodes" :rules="rules" label-width="120px">
  982. <el-form-item :label="$t('keyNodeNames')" prop="name">
  983. <el-input v-model.trim="addFormkeyNodes.name" :placeholder="$t('peaseenterthe')" clearable></el-input>
  984. </el-form-item>
  985. </el-form>
  986. <div slot="footer" class="dialog-footer">
  987. <el-button @click.native="addBasekeyNodesialog = false">{{ $t('btn.cancel') }}</el-button>
  988. <el-button type="primary" @click="submitkeyNodes" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  989. </div>
  990. </el-dialog>
  991. <!-- 按部门选择人员 -->
  992. <el-dialog :title="$t('selectingParticipants')" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  993. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  994. <div v-if="user.userNameNeedTranslate == '1'">
  995. <el-input placeholder="请输入内容" v-model.trim="wxFilterText" class="input-with-select">
  996. <el-button slot="append" icon="el-icon-search" @click="echartDepartment()"></el-button>
  997. </el-input>
  998. </div>
  999. <div class="tree" style="height:400px">
  1000. <el-scrollbar style="height:100%">
  1001. <el-input
  1002. :placeholder="$t('keywordfiltering')"
  1003. v-model="filterText" v-if="user.userNameNeedTranslate != '1'">
  1004. </el-input>
  1005. <el-tree :data="deptMembData" :key="searchPersonnelFlgnum" show-checkbox :default-expand-all="searchPersonnelFlg" :props="defaultProps" node-key="id"
  1006. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="addForm.userId"
  1007. highlight-current :filter-node-method="filterNode">
  1008. <span class="custom-tree-node" slot-scope="{ node, data }">
  1009. <span v-if="user.userNameNeedTranslate == '1'">
  1010. <span v-if="node.data.children">
  1011. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  1012. </span>
  1013. <span v-else>
  1014. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  1015. </span>
  1016. </span>
  1017. <span v-if="user.userNameNeedTranslate != '1'">
  1018. {{ node.label }}
  1019. </span>
  1020. </span>
  1021. </el-tree>
  1022. </el-scrollbar>
  1023. </div>
  1024. <div>{{ $t('btn.choose') }}&nbsp;{{chosenMembCount}}&nbsp;{{ $t('other.people') }}</div>
  1025. <div slot="footer" class="dialog-footer">
  1026. <el-button @click="chooseParticipVisible = false" >{{ $t('btn.cancel') }}</el-button>
  1027. <el-button type="primary" @click="chooseParticip()" >{{ $t('btn.determine') }}</el-button>
  1028. </div>
  1029. </el-dialog>
  1030. <!-- 按部门选择相关领导,弃用 -->
  1031. <!-- <el-dialog title="选择相关领导" v-if="chooseLeaderVisible" :visible.sync="chooseLeaderVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1032. <div class="tree" style="height:400px">
  1033. <el-scrollbar style="height:100%">
  1034. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id"
  1035. ref="chooseLeaderTree" @check-change="onLeaderTreeItemChange" :default-checked-keys="addForm.notifyUserIds"
  1036. highlight-current ></el-tree>
  1037. </el-scrollbar>
  1038. </div>
  1039. <div>已选中&nbsp;{{chosenMembCount}}&nbsp;人</div>
  1040. <div slot="footer" class="dialog-footer">
  1041. <el-button @click="chooseLeaderVisible = false" >取消</el-button>
  1042. <el-button type="primary" @click="chooseLeader()" >确定</el-button>
  1043. </div>
  1044. </el-dialog> -->
  1045. <!-- 项目专业人员的设置 -->
  1046. <el-dialog :title="$t('setupprojectprofessionals')" v-if="editPpMembDialog" :visible.sync="editPpMembDialog" :close-on-click-modal="false" customClass="customWidth" width="600px">
  1047. <div class="gongcheng">
  1048. <el-table :data="curProfessionRow.membList" height="400">
  1049. <el-table-column prop="name" :label="$t('professionals')">
  1050. <template slot-scope="scope">
  1051. <el-select v-model="scope.row.membId" v-if="user.userNameNeedTranslate != 1" filterable :placeholder="$t('professionaladdsparticipant')" style="width:100%;" >
  1052. <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id">
  1053. </el-option>
  1054. </el-select>
  1055. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :subject="participator" :subjectId="scope.row.membId" :distinction="'11'" :other="scope.$index" @selectCal="selectCal"></selectCat>
  1056. </template>
  1057. </el-table-column>
  1058. <el-table-column prop="percentage" width="120" :label="$t('zhan-bi')">
  1059. <template slot-scope="scope">
  1060. <el-input type="number" v-model="scope.row.percentage"></el-input>
  1061. </template>
  1062. </el-table-column>
  1063. <el-table-column width="80">
  1064. <template slot-scope="scope">
  1065. <el-button icon="el-icon-delete" size="mini" style="margin-left:10px;" @click.stop.native="deleteMembItem(scope.$index)"></el-button>
  1066. </template>
  1067. <template slot="header" >
  1068. <el-link @click="addMembItem">{{ $t('addTian') }}</el-link>
  1069. </template>
  1070. </el-table-column>
  1071. </el-table>
  1072. <div slot="footer" class="dialog-footer">
  1073. <el-button @click="editPpMembDialog = false" >{{ $t('btn.cancel') }}</el-button>
  1074. <el-button type="primary" @click="addPpMemb" >{{ $t('btn.determine') }}</el-button>
  1075. </div>
  1076. </div>
  1077. </el-dialog>
  1078. <!-- 批量修改自定义维度 -->
  1079. <el-dialog :title="checkoradd ? $t('changes') : $t('pi-liang-tian-jia')" :visible.sync="checkedWuduDialog" v-if="checkedWuduDialog" width="40%">
  1080. <el-form model="" label-width="20%">
  1081. <el-form-item :label="$t('setup') + user.timeType.customDegreeName">
  1082. <el-select v-model="checkedWuduArr" value-key="id" :placeholder="$t('defaultText.pleaseChoose') + user.timeType.customDegreeName" multiple style="width: 100%">
  1083. <el-option v-for="item in ause" :key="item.id" :label="item.name" :value="item"></el-option>
  1084. </el-select>
  1085. </el-form-item>
  1086. </el-form>
  1087. <div slot="footer" class="dialog-footer">
  1088. <el-button @click="checkedWuduDialog = false">{{ $t('btn.cancel') }}</el-button>
  1089. <el-button type="primary" @click="batchSetWudulistBtn3" v-if="checkoradd">{{ $t('btn.determine') }}</el-button>
  1090. <el-button type="primary" @click="batchSetWudulistBtn4" v-if="!checkoradd">{{ $t('btn.determine') }}</el-button>
  1091. </div>
  1092. </el-dialog>
  1093. <!-- 批量添加参与人 -->
  1094. <el-dialog :title="isAddGroupPerson ? $t('groupparticipantsinbatches') : $t('projectparticipantsinbatches')" v-if="addGroupPersonDialog" :visible.sync="addGroupPersonDialog" width="600px">
  1095. <el-form label-width="20%">
  1096. <el-form-item :label="$t('screening.selectPeople')">
  1097. <el-tooltip placement="top" effect="light" v-if="user.userNameNeedTranslate != '1'">
  1098. <div slot="content" style="width:450px">{{addGroupPersonData.personNames}}</div>
  1099. <el-input @focus="addGroupPersonP" v-model="addGroupPersonData.personNames"></el-input>
  1100. </el-tooltip>
  1101. <el-tooltip placement="top" effect="light" v-if="user.userNameNeedTranslate == '1'">
  1102. <div slot="content" style="width:580px">
  1103. <span v-for="(item, index) in addGroupPersonDataPersonNames" :key="index">
  1104. <!-- {{item}} -->
  1105. <ww-open-data type='userName' :openid='item'></ww-open-data>
  1106. <span v-if="index < addGroupPersonDataPersonNames.length - 1">,</span>
  1107. </span>
  1108. </div>
  1109. <div @click="addGroupPersonP" style="width: 450px;overflow:hidden;white-space:nowrap;height:40px;border: 1px solid #DCDFE6;border-radius: 4px;box-sizing: border-box;padding: 0 10px">
  1110. <span v-for="(item, index) in addGroupPersonDataPersonNames" :key="index">
  1111. <!-- {{item}} -->
  1112. <ww-open-data type='userName' :openid='item'></ww-open-data>
  1113. <span v-if="index < addGroupPersonDataPersonNames.length - 1">,</span>
  1114. </span>
  1115. </div>
  1116. </el-tooltip>
  1117. </el-form-item>
  1118. <el-form-item :label="$t('xuan-ze-fen-zu')" v-if="isAddGroupPerson">
  1119. <el-select v-model="addGroupPersonData.group" multiple :placeholder="$t('selectagroup')" style="width:100%">
  1120. <el-option v-for="item in addGroupList"
  1121. :key="item.groupIds"
  1122. :label="item.name"
  1123. :value="item.groupIds"></el-option>
  1124. </el-select>
  1125. </el-form-item>
  1126. </el-form>
  1127. <div slot="footer" class="dialog-footer">
  1128. <el-button @click="addGroupPersonDialog = false" >{{ $t('btn.cancel') }}</el-button>
  1129. <el-button type="primary" @click="addGroupPersonSure()" v-if="isAddGroupPerson">{{ $t('btn.determine') }}</el-button>
  1130. <el-button type="primary" @click="addProPersonSure()" v-else>{{ $t('btn.determine') }}</el-button>
  1131. </div>
  1132. <el-dialog append-to-body :title="$t('screening.selectPeople')" v-if="addGroupPersonPdialog" :visible.sync="addGroupPersonPdialog" width="40%">
  1133. <div class="tree" style="height:300px">
  1134. <el-scrollbar style="height:100%">
  1135. <el-input
  1136. :placeholder="$t('keywordfiltering')"
  1137. v-model="filterText2"
  1138. v-if="user.userNameNeedTranslate != 1">
  1139. </el-input>
  1140. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id"
  1141. ref="chooseMembTree2" @check-change="addPersonCheck"
  1142. highlight-current :filter-node-method="filterNode" :default-checked-keys="addGroupPersonData.person">
  1143. <span class="custom-tree-node" slot-scope="{ node, data }">
  1144. <span v-if="user.userNameNeedTranslate == '1'">
  1145. <span v-if="node.data.children">
  1146. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  1147. </span>
  1148. <span v-else>
  1149. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  1150. </span>
  1151. </span>
  1152. <span v-if="user.userNameNeedTranslate != '1'">
  1153. {{ node.label }}
  1154. </span>
  1155. </span>
  1156. </el-tree>
  1157. </el-scrollbar>
  1158. </div>
  1159. <div>{{ $t('btn.choose') }}&nbsp;{{chosenMembCount}}&nbsp;{{ $t('other.people') }}</div>
  1160. <div slot="footer" class="dialog-footer">
  1161. <el-button @click="addGroupPersonPdialog = false" >{{ $t('btn.cancel') }}</el-button>
  1162. <el-button type="primary" @click="addPersonSure()" >{{ $t('btn.determine') }}</el-button>
  1163. </div>
  1164. </el-dialog>
  1165. </el-dialog>
  1166. <!-- 批量设置项目经理 -->
  1167. <el-dialog :title="$t('projectmanagersinbatches')" v-if="batchInchargerDialog" :visible.sync="batchInchargerDialog" width="500px">
  1168. <el-form model="" label-width="120px">
  1169. <el-form-item :label="$t('setupprojectmanager')">
  1170. <el-select v-if="user.userNameNeedTranslate != '1'" v-model="paramInchargerId" :placeholder="$t('defaultText.pleaseChoose')" style="width: 80%" filterable clearable>
  1171. <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id">
  1172. <span style="float: left">{{item.name}}</span>
  1173. <span style="float: right; color: #8492a6;" v-if="user.companyId == 936">{{ item.jobNumber }}</span>
  1174. </el-option>
  1175. </el-select>
  1176. <selectCat :size="'small'" :widthStr="'272'" v-if="user.userNameNeedTranslate == '1'" :subject="users" :subjectId="paramInchargerId" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1177. </el-form-item>
  1178. </el-form>
  1179. <div slot="footer" class="dialog-footer">
  1180. <el-button @click="batchInchargerDialog = false" >{{ $t('btn.cancel') }}</el-button>
  1181. <el-button type="primary" @click="batchInchargerSure()">{{ $t('btn.determine') }}</el-button>
  1182. </div>
  1183. </el-dialog>
  1184. <el-dialog :title="$t('importproject')" v-if="importProjectBeforeDialog" :visible.sync="importProjectBeforeDialog" width="30%">
  1185. <el-checkbox v-model="paramData1" style="margin-left:10px">{{ $t('dui-yi-you-xiang-mu-jin-hang-xin-xi-geng-xin') }}</el-checkbox>
  1186. <div slot="footer" class="dialog-footer" style="text-algin:center;">
  1187. <el-upload ref="upload" action="#" :limit="1" :http-request="importProject" :show-file-list="false">
  1188. <el-button type="primary">{{ $t('importproject') }}</el-button>
  1189. </el-upload>
  1190. </div>
  1191. </el-dialog>
  1192. <el-dialog :title="$t('xiu-gai-xiang-mu-dang-qian-jie-duan')" v-if="changeStageDialogVisible" :visible.sync="changeStageDialogVisible" width="300px">
  1193. <el-select v-model="curChangeProject.curStageId" filterable :placeholder="$t('pleaseselecttheprojectphase')" style="margin: 0 auto;">
  1194. <el-option v-for="(item, index) in phaseList" :key="index" :label="item.projectStageName" :value="item.id"> </el-option>
  1195. </el-select>
  1196. <div slot="footer" class="dialog-footer" style="text-algin:center;">
  1197. <el-button type="primary" @click="confirmChangeStage">{{ $t('btn.determine') }}</el-button>
  1198. </div>
  1199. </el-dialog>
  1200. <el-dialog append-to-body :title="$t('projectimportresult')" v-if="showImportResult" :visible.sync="showImportResult" width="40%">
  1201. <div >
  1202. {{importResultMsg}}
  1203. </div>
  1204. </el-dialog>
  1205. </section>
  1206. </template>
  1207. <style scoped>
  1208. .input-with-select .el-input-group__prepend {
  1209. background-color: #fff;
  1210. }
  1211. .line {
  1212. padding:10px;
  1213. }
  1214. .line span{
  1215. font-size:15px;
  1216. }
  1217. .line span:nth-child(even){
  1218. float:right;
  1219. }
  1220. .kans {
  1221. width: 230px;
  1222. overflow:hidden;
  1223. white-space:nowrap;
  1224. text-overflow: ellipsis;
  1225. }
  1226. a {
  1227. text-decoration: none;
  1228. }
  1229. .router-link-active {
  1230. text-decoration: none;
  1231. }
  1232. </style>
  1233. <script>
  1234. import util from "../../common/js/util";
  1235. import projectgantt from "./project_gantt.vue"
  1236. // 自定义select组件
  1237. import selectCat from "@/components/select.vue"
  1238. export default {
  1239. components:{
  1240. projectgantt,
  1241. selectCat
  1242. },
  1243. data() {
  1244. return {
  1245. canOnlyModParticipator: false,
  1246. curChangeProject:null,
  1247. changeStageDialogVisible: false,
  1248. addFlgmainProjectDialog: false,
  1249. addFlgPanthProjectDialog: false,
  1250. addProjectLevelDialog: false,
  1251. mainProjectList: [],
  1252. mainProjectDialog: false,
  1253. projectLevelDialog: false,
  1254. showImportResult: false,
  1255. importResultMsg:null,
  1256. isganttshow: false,
  1257. deleteAlertMsg: null,
  1258. chosenLeaders:[],
  1259. baseClfList:[],
  1260. chooseLeaderVisible:false,
  1261. projectProfessionItem:null,
  1262. curProfessionRow:null,
  1263. editPpMembDialog:false,
  1264. professionList:[],
  1265. projectProfessionList:[],
  1266. activeName:"baseCostPanel",
  1267. chosenMembCount:0,
  1268. chosenMembList:[],//选中的人员
  1269. allMembData:[],
  1270. auditProcessDialog: false,
  1271. deptMembData: [
  1272. {
  1273. id: 0,
  1274. label: this.$t('lable.unassigned'),
  1275. }
  1276. ],
  1277. option: [],
  1278. depData: {
  1279. id: -1,
  1280. label: this.$t('lable.allStaff'),
  1281. },
  1282. defaultProps: {
  1283. children: 'children',
  1284. label: 'label'
  1285. },
  1286. wxFilterText: '',
  1287. filterName:null,
  1288. chooseParticipVisible: false,
  1289. projectBaseCostData:[],
  1290. addBaseItemDialog:false,
  1291. showBaseConfig:false,
  1292. customerList:[],
  1293. roleArray:[this.$t('role.ordinaryEmployees'),this.$t('role.superAdministrator'), this.$t('role.systemAdministrator'), this.$t('role.companyTop'),this.$t('role.financialAdministrator'), this.$t('role.projectManager')],
  1294. status:"1",
  1295. statusTxt:["-",this.$t('ongoing'),this.$t('state.completed'),this.$t('state.undone'),this.$t('paused')],
  1296. importanceList:[{id:1,label:this.$t('zheng-chang')},{id:2,label:this.$t('jin-ji')},{id:3,label:this.$t('zhong-yao')},{id:4,label:this.$t('zhong-yao-qie-jin-ji')}],
  1297. importanceListLable:[this.$t('zheng-chang'), this.$t('jin-ji'), this.$t('zhong-yao'), this.$t('zhong-yao-qie-jin-ji'), this.$t('di-feng-xian'), this.$t('zhong-feng-xian'), this.$t('gao-feng-xian')],
  1298. searchField:'1',
  1299. keyword:null,
  1300. user: JSON.parse(sessionStorage.getItem("user")),
  1301. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  1302. userDetailVisible: false,
  1303. userDetail:{},
  1304. date: new Date(),
  1305. users: [],
  1306. participator:[],
  1307. tableHeight: 0,
  1308. listLoading: false,
  1309. total: 0,
  1310. page: 1,
  1311. size: localStorage.getItem("projectPageSize")==null?20:parseInt(localStorage.getItem("projectPageSize")),
  1312. list: [],
  1313. subProjectVisible: false,
  1314. subProjectList: [],//子项目列表
  1315. currentProject:{},
  1316. addSubProject: false,
  1317. addFormVisible: false,
  1318. addLoading: false,
  1319. addUp: 0, // 合计
  1320. title: "",
  1321. addForm: {
  1322. name: '',
  1323. userId: [],
  1324. level:1,
  1325. // bu:'',
  1326. bu: ['50'],
  1327. id: '',
  1328. code: '',
  1329. projectDesc: '',
  1330. alarmType: 0
  1331. },
  1332. addFormUserNames: [],
  1333. temaddForm: {},
  1334. rules: {
  1335. name: [{ required: true, message: this.$t('pleaseentername'), trigger: "blur" }],
  1336. code: [{ required: true, message: this.$t('qing-shu-ru-bian-hao'), trigger: "blur" }],
  1337. projectStageName: [{ required: true, message: this.$t('pleaseentername'), trigger: "blur" }],
  1338. projectLevelName: [{ required: true, message: this.$t('pleaseentername'), trigger: "blur" }],
  1339. },
  1340. ause: [],
  1341. auseList: [],
  1342. yonghuUser: [],
  1343. filterText: '',
  1344. filterText2: '',
  1345. showClfDialog: false,
  1346. addClfDialog:false,
  1347. addClf:{name:'',id:''},
  1348. addMainForm:{
  1349. name:'',
  1350. id:'',
  1351. code: '',
  1352. categoryId: ''
  1353. },
  1354. addPanthForm: {
  1355. id: '',
  1356. projectStageName: ''
  1357. },
  1358. addLevelForm: {
  1359. id: '',
  1360. projectStageName: ''
  1361. },
  1362. statusClf:null,
  1363. permissionsObj: {},
  1364. checkedProjectArr: [],
  1365. checkedWuduDialog: false,
  1366. checkedWuduArr: [],
  1367. checkoradd: true,
  1368. addGroupPersonBtnLoading: false,
  1369. addGroupPersonDialog: false,
  1370. addGroupList: [],
  1371. addGroupPersonData: {
  1372. group: [],
  1373. person: null,
  1374. personNames: ''
  1375. },
  1376. addGroupPersonPdialog: false,
  1377. showColumnWidth: '300',
  1378. deleteVif: null,
  1379. isAddGroupPerson: true,
  1380. projectMainId: '',
  1381. supplierList: '',
  1382. sortProp: '',
  1383. sortOrder: null,
  1384. currentCell: null, // 当前单击的是哪一个单元格
  1385. phaseList: [],
  1386. phaseProjectId: '', // 阶段项目id
  1387. phaseProjectValie: null, // 阶段项目值
  1388. listHeader: [], // 列表表头
  1389. rowid: '',
  1390. phaseProjectDialog: false, // 项目阶段
  1391. levelList: [], // 项目级别
  1392. departmentList: [],
  1393. deptId: [],
  1394. buOption:[],
  1395. contractAmountOld: 0,
  1396. contractAmountReasonShow: false,
  1397. centerNameDegree: '',
  1398. batchInchargerDialog: false,
  1399. paramInchargerId: '',
  1400. inchagerId: '',
  1401. keyNodesIsShow: false,
  1402. keyNodesList: [],
  1403. projectKeyNodesData: [],
  1404. addBasekeyNodesialog: false,
  1405. addFormkeyNodes: {
  1406. name: ''
  1407. },
  1408. participationId: '',
  1409. importProjectBeforeDialog: false,
  1410. paramData1: false,
  1411. chosenListBackup: [], // 备份
  1412. searchPersonnelFlg: false,
  1413. searchPersonnelFlgnum: 1,
  1414. createDate: [], // 项目筛选时间段
  1415. exportDisabled: false,
  1416. exportNotification: null,
  1417. };
  1418. },
  1419. // 过滤器
  1420. filters: {
  1421. numberToCurrency(value) {
  1422. if (!value) return '0.00'
  1423. // 将数值截取,保留两位小数
  1424. value = value.toFixed(2)
  1425. // 获取整数部分
  1426. const intPart = Math.trunc(value)
  1427. // 整数部分处理,增加,
  1428. const intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
  1429. // 预定义小数部分
  1430. let floatPart = '.00'
  1431. // 将数值截取为小数部分和整数部分
  1432. const valueArray = value.toString().split('.')
  1433. if (valueArray.length === 2) { // 有小数部分
  1434. floatPart = valueArray[1].toString() // 取得小数部分
  1435. return intPartFormat + '.' + floatPart
  1436. }
  1437. return intPartFormat + floatPart
  1438. },
  1439. mobans(value, valueList) {
  1440. for(var i in valueList) {
  1441. if(valueList[i].providerCateGoryName == value) {
  1442. return valueList[i].providerInfoName
  1443. }
  1444. }
  1445. },
  1446. },
  1447. watch: {
  1448. filterText(val) {
  1449. this.$refs.chooseMembTree.filter(val);
  1450. },
  1451. filterText2(val) {
  1452. this.$refs.chooseMembTree2.filter(val);
  1453. }
  1454. },
  1455. updated () {
  1456. // console.log('执行upload生命周期')
  1457. this.$nextTick(()=>{
  1458. this.$refs.projectlistOfWudulist.doLayout();
  1459. })
  1460. },
  1461. methods: {
  1462. confirmChangeStage() {
  1463. let currentStageName = ''
  1464. for(var i in this.phaseList) {
  1465. if(this.phaseList[i].id == this.curChangeProject.curStageId) {
  1466. currentStageName = this.phaseList[i].projectStageName
  1467. }
  1468. }
  1469. this.http.post('/project/changeCurrentStage', {
  1470. projectId: this.curChangeProject.projectId,
  1471. currentStageId: this.curChangeProject.curStageId,
  1472. currentStageName: currentStageName
  1473. },
  1474. res => {
  1475. if (res.code == "ok") {
  1476. this.getList()
  1477. this.changeStageDialogVisible = false;
  1478. } else {
  1479. this.$message({
  1480. message: res.msg,
  1481. type: "error"
  1482. });
  1483. }
  1484. },
  1485. error => {
  1486. this.$message({
  1487. message: error,
  1488. type: "error"
  1489. });
  1490. });
  1491. },
  1492. showChangeStageDialog(projectId, curStageId) {
  1493. this.curChangeProject = {projectId: projectId, curStageId: curStageId};
  1494. this.changeStageDialogVisible = true;
  1495. },
  1496. addNewkeyNodes(row) {
  1497. this.addBasekeyNodesialog = true
  1498. if(row) {
  1499. this.addFormkeyNodes = row
  1500. } else {
  1501. this.addFormkeyNodes = {
  1502. name: ''
  1503. }
  1504. }
  1505. },
  1506. // 获取关键节点
  1507. getkeyNodes() {
  1508. this.http.post('/project-key-nodes-setting/list', {},
  1509. res => {
  1510. if (res.code == "ok") {
  1511. // this.keyNodesIsShow = true
  1512. this.keyNodesList = res.data
  1513. } else {
  1514. this.$message({
  1515. message: res.msg,
  1516. type: "error"
  1517. });
  1518. }
  1519. },
  1520. error => {
  1521. this.$message({
  1522. message: error,
  1523. type: "error"
  1524. });
  1525. });
  1526. },
  1527. hoverCall(row) {
  1528. this.rowid=row.id
  1529. },
  1530. handCall() {
  1531. this.rowid = ''
  1532. },
  1533. // 获取阶段
  1534. obtainPhase(item) {
  1535. this.http.post('/project-stage/list', {},
  1536. res => {
  1537. if (res.code == "ok") {
  1538. // this.phaseList = res.data
  1539. this.$set(this, 'phaseList', res.data)
  1540. } else {
  1541. this.$message({
  1542. message: res.msg,
  1543. type: "error"
  1544. });
  1545. }
  1546. },
  1547. error => {
  1548. this.$message({
  1549. message: error,
  1550. type: "error"
  1551. });
  1552. });
  1553. },
  1554. // 获取级别
  1555. getProjectLevel(){
  1556. this.http.post('/project-level/list', {},
  1557. res => {
  1558. if (res.code == "ok") {
  1559. this.levelList = res.data
  1560. // this.$set(this, 'levelList', res.data)
  1561. } else {
  1562. this.$message({
  1563. message: res.msg,
  1564. type: "error"
  1565. });
  1566. }
  1567. },
  1568. error => {
  1569. this.$message({
  1570. message: error,
  1571. type: "error"
  1572. });
  1573. });
  1574. },
  1575. addProjectLevel(row){
  1576. this.addProjectLevelDialog = true
  1577. if(!row) {
  1578. this.addLevelForm = {
  1579. projectLevelName: '',
  1580. id: ''
  1581. // companyId:''
  1582. }
  1583. } else {
  1584. this.addLevelForm = {
  1585. id: row.id,
  1586. projectLevelName: row.projectLevelName
  1587. // companyId: row.companyId
  1588. }
  1589. }
  1590. },
  1591. deleteProjectLevel(row) {
  1592. this.$confirm($t('operationmaycausedatalossAreyousuredeletethedata'),this.$t('deletingprojectlevels'), {
  1593. confirmButtonText: this.$t('btn.determine'),
  1594. cancelButtonText: this.$t('btn.cancel'),
  1595. type: "warning"
  1596. })
  1597. .then(() => {
  1598. this.listLoading = true;
  1599. this.http.post('/project-level/delete',{
  1600. id: row.id
  1601. },
  1602. res => {
  1603. this.listLoading = false;
  1604. if (res.code == "ok") {
  1605. this.$message({
  1606. message: this.$t('message.successfullyDeleted'),
  1607. type: "success"
  1608. });
  1609. this.getProjectLevel();
  1610. } else {
  1611. this.$message({
  1612. message: res.msg,
  1613. type: "error"
  1614. });
  1615. }
  1616. },
  1617. error => {
  1618. this.listLoading = false;
  1619. this.$message({
  1620. message: error,
  1621. type: "error"
  1622. });
  1623. }
  1624. );
  1625. })
  1626. .catch(() => {});
  1627. },
  1628. submitLevelPro(){
  1629. this.http.post('/project-level/addOrMod',this.addLevelForm,
  1630. res => {
  1631. if (res.code == "ok") {
  1632. this.addProjectLevelDialog = false;
  1633. this.getProjectLevel()
  1634. } else {
  1635. this.$message({
  1636. message: res.msg,
  1637. type: "error"
  1638. });
  1639. }
  1640. },
  1641. error => {
  1642. this.$message({
  1643. message: error,
  1644. type: "error"
  1645. });
  1646. }
  1647. );
  1648. },
  1649. // 表格点击
  1650. tableCellClassName({row, column, rowIndex, columnIndex}) {
  1651. row.index=rowIndex;
  1652. column.index=columnIndex;
  1653. },
  1654. // clickCell(row,column) {
  1655. // // console.log('can can need',row,column)
  1656. // this.currentCell = row.index + ',' + column.index;
  1657. // this.phaseProjectValie = row.currentStageId ? row.currentStageId : ''
  1658. // if(this.permissions.projectManagement || this.user.id==row.inchargerId || this.user.id==row.creatorId) {
  1659. // this.phaseProjectId = row.id
  1660. // setTimeout(() => {
  1661. // // 获得焦点
  1662. // this.$refs[row.index + ',' + column.index].focus();
  1663. // })
  1664. // }
  1665. // },
  1666. // selectChange() {
  1667. // let currentStageName = ''
  1668. // for(var i in this.phaseList) {
  1669. // if(this.phaseList[i].id == this.phaseProjectValie) {
  1670. // currentStageName = this.phaseList[i].projectStageName
  1671. // }
  1672. // }
  1673. // this.http.post('/project/changeCurrentStage', {
  1674. // projectId: this.phaseProjectId,
  1675. // currentStageId: this.phaseProjectValie,
  1676. // currentStageName: currentStageName
  1677. // },
  1678. // res => {
  1679. // if (res.code == "ok") {
  1680. // this.getList()
  1681. // } else {
  1682. // this.$message({
  1683. // message: res.msg,
  1684. // type: "error"
  1685. // });
  1686. // }
  1687. // },
  1688. // error => {
  1689. // this.$message({
  1690. // message: error,
  1691. // type: "error"
  1692. // });
  1693. // });
  1694. // },
  1695. // hideSelect() {
  1696. // var that = this
  1697. // setTimeout(() => {
  1698. // that.currentCell = null
  1699. // }, 500)
  1700. // },
  1701. // 点击主项目事件
  1702. projectManagementChange() {
  1703. let categoryId = ''
  1704. for(var i in this.mainProjectList) {
  1705. if(this.mainProjectList[i].id == this.addForm.projectMainId) {
  1706. categoryId = this.mainProjectList[i].categoryId
  1707. }
  1708. }
  1709. categoryId == '' ? '' : this.addForm.category = categoryId
  1710. // console.log(this.addForm)
  1711. },
  1712. tableSort({column, prop, order}){
  1713. if(prop == 'inchargerName' || prop == 'customerName' || prop == 'projectCode' || prop == 'categoryName' || prop == 'projectName' || prop == 'status' || prop == 'currentStage' || prop == 'departmentName' || prop == 'associateDegreeNames'){
  1714. this.sortOrder = order
  1715. this.sortProp = prop
  1716. this.getList()
  1717. }
  1718. },
  1719. //获取项目列表
  1720. getSupplierList() {
  1721. this.http.post('/provider-info/list', {
  1722. pageIndex: 1,
  1723. // pageSize: 999,
  1724. pageSize: -1,
  1725. keyword: ''
  1726. },
  1727. res => {
  1728. if (res.code == "ok") {
  1729. this.supplierList = res.data.records;
  1730. } else {
  1731. this.$message({
  1732. message: res.msg,
  1733. type: "error"
  1734. });
  1735. }
  1736. },
  1737. error => {
  1738. this.$message({
  1739. message: error,
  1740. type: "error"
  1741. });
  1742. });
  1743. },
  1744. addManPro(row) {
  1745. this.addFlgmainProjectDialog = true
  1746. if(!row) {
  1747. this.addMainForm = {
  1748. name: '',
  1749. id: '',
  1750. code: '',
  1751. categoryId: ''
  1752. }
  1753. } else {
  1754. this.addMainForm = {
  1755. id: row.id,
  1756. code: row.code,
  1757. name: row.name,
  1758. categoryId: row.categoryId,
  1759. }
  1760. }
  1761. },
  1762. addPanthPro(row) {
  1763. this.addFlgPanthProjectDialog = true
  1764. if(!row) {
  1765. this.addPanthForm = {
  1766. projectStageName: '',
  1767. id: '',
  1768. companyId:''
  1769. }
  1770. } else {
  1771. this.addPanthForm = {
  1772. id: row.id,
  1773. projectStageName: row.projectStageName,
  1774. companyId: row.companyId
  1775. }
  1776. }
  1777. },
  1778. // 获取主项目
  1779. getMainProject() {
  1780. this.http.post('/project-main/list',{},res => {
  1781. if(res.code == 'ok'){
  1782. this.mainProjectList = res.data
  1783. }else {
  1784. this.$message({
  1785. message: res.msg,
  1786. type: 'error'
  1787. })
  1788. }
  1789. },err => {
  1790. this.$message({
  1791. message: err,
  1792. type: 'error'
  1793. })
  1794. })
  1795. },
  1796. // 批量修改自定义维度
  1797. checkedWudulist(e){
  1798. // console.log(e);
  1799. this.checkedProjectArr = e
  1800. },
  1801. batchSetWudulistBtn1(){
  1802. this.$refs.projectlistOfWudulist.clearSelection()
  1803. this.checkedWuduArr = [],
  1804. this.addGroupPersonData = {
  1805. group: null,
  1806. person: null,
  1807. personNames: ''
  1808. }
  1809. },
  1810. batchSetWudulistBtn2(e){
  1811. if(this.checkedProjectArr.length == 0){
  1812. this.$message(this.$t('defaultText.pleaseSelectSnItem'))
  1813. return
  1814. }
  1815. this.checkoradd = e
  1816. this.checkedWuduDialog = true
  1817. },
  1818. batchSetWudulistBtn3(){
  1819. if(this.checkedWuduArr.length == 0){
  1820. this.$message(this.$t('defaultText.pleaseChoose') + this.user.timeType.customDegreeName)
  1821. return
  1822. }
  1823. let projectIds = []
  1824. for(let i=0; i<this.checkedProjectArr.length; i++){
  1825. projectIds.push(this.checkedProjectArr[i].id)
  1826. }
  1827. let degreeIds = []
  1828. let degreeNames = []
  1829. for(let s=0; s<this.checkedWuduArr.length; s++){
  1830. degreeIds.push(this.checkedWuduArr[s].id)
  1831. degreeNames.push(this.checkedWuduArr[s].name)
  1832. }
  1833. this.http.post('/project/saveBatchAccoDegrees',{
  1834. ids: JSON.stringify(projectIds),
  1835. associateDegrees: degreeIds.toString(),
  1836. associateDegreeNames: degreeNames.toString()
  1837. },res => {
  1838. if(res.code == 'ok'){
  1839. this.checkedWuduDialog = false
  1840. this.batchSetWudulistBtn1()
  1841. this.$message({
  1842. message: this.$t('setupthesuccess'),
  1843. type: 'success'
  1844. })
  1845. this.getList()
  1846. }else {
  1847. this.$message({
  1848. message: res.msg,
  1849. type: 'error'
  1850. })
  1851. }
  1852. },err => {
  1853. this.$message({
  1854. message: err,
  1855. type: 'error'
  1856. })
  1857. })
  1858. },
  1859. batchSetWudulistBtn4(){
  1860. if(this.checkedWuduArr.length == 0){
  1861. this.$message(this.$t('defaultText.pleaseChoose') + this.user.timeType.customDegreeName)
  1862. return
  1863. }
  1864. let projectIds = []
  1865. for(let i=0; i<this.checkedProjectArr.length; i++){
  1866. projectIds.push(this.checkedProjectArr[i].id)
  1867. }
  1868. let degreeIds = []
  1869. let degreeNames = []
  1870. for(let s=0; s<this.checkedWuduArr.length; s++){
  1871. degreeIds.push(this.checkedWuduArr[s].id)
  1872. degreeNames.push(this.checkedWuduArr[s].name)
  1873. }
  1874. this.http.post('/project/addBatchAccoDegrees',{
  1875. ids: JSON.stringify(projectIds),
  1876. associateDegrees: degreeIds.toString(),
  1877. associateDegreeNames: degreeNames.toString()
  1878. },res => {
  1879. if(res.code == 'ok'){
  1880. this.checkedWuduDialog = false
  1881. this.batchSetWudulistBtn1()
  1882. this.$message({
  1883. message: this.$t('addsuccessful'),
  1884. type: 'success'
  1885. })
  1886. this.getList()
  1887. }else {
  1888. this.$message({
  1889. message: res.msg,
  1890. type: 'error'
  1891. })
  1892. }
  1893. },err => {
  1894. this.$message({
  1895. message: err,
  1896. type: 'error'
  1897. })
  1898. })
  1899. },
  1900. isSelectable(row,index){
  1901. if(row.creatorId == this.user.id || row.inchargerId == this.user.id || this.permissions.projectManagement){
  1902. return true
  1903. }else{
  1904. return false
  1905. }
  1906. },
  1907. test(row){
  1908. // console.log(row);
  1909. },
  1910. // 批量添加分组参与人员
  1911. addGroupPerson(){
  1912. let proArr = []
  1913. if(this.checkedProjectArr.length == 0){
  1914. this.$message(this.$t('defaultText.pleaseSelectSnItem'))
  1915. return
  1916. }
  1917. this.addGroupPersonBtnLoading = true
  1918. for(let i=0;i<this.checkedProjectArr.length;i++){
  1919. proArr.push(this.checkedProjectArr[i].id)
  1920. }
  1921. this.http.post('/project/getProjectsGroups',{
  1922. projectIdArray: JSON.stringify(proArr)
  1923. },res => {
  1924. if(res.code == 'ok'){
  1925. // console.log('分组',res.data);
  1926. this.addGroupList = res.data
  1927. this.addGroupPersonBtnLoading = false
  1928. this.addGroupPersonDialog = true
  1929. }else {
  1930. this.$message({
  1931. message: res.msg,
  1932. type: 'error'
  1933. })
  1934. }
  1935. },err => {
  1936. this.$message({
  1937. message: err,
  1938. type: 'error'
  1939. })
  1940. })
  1941. },
  1942. addGroupPersonP(){
  1943. this.filterText2 = ''
  1944. this.addGroupPersonPdialog = true
  1945. },
  1946. addPersonCheck(){
  1947. var chosenList = this.$refs.chooseMembTree2.getCheckedNodes();
  1948. var list = chosenList.filter(item=>item.isUser == 1);
  1949. this.chosenMembCount = list.length;
  1950. // console.log(list);
  1951. },
  1952. addPersonSure(){
  1953. this.addGroupPersonPdialog = false
  1954. let chosenList = this.$refs.chooseMembTree2.getCheckedNodes();
  1955. let list = chosenList.filter(item=>item.isUser == 1);
  1956. let listIDs = []
  1957. let listNames = ''
  1958. let listNamesList = []
  1959. for(let i=0;i<list.length;i++){
  1960. listIDs.push(list[i].id)
  1961. listNames += list[i].label + ','
  1962. listNamesList.push(list[i].label)
  1963. }
  1964. this.addGroupPersonData.person = listIDs
  1965. this.addGroupPersonData.personNames = listNames
  1966. this.addGroupPersonDataPersonNames = listNamesList
  1967. console.log('触发', this.addGroupPersonDataPersonNames)
  1968. },
  1969. addGroupPersonSure(){
  1970. if(this.addGroupPersonData.group.length == 0 || this.addGroupPersonData.person == null){
  1971. this.$message({
  1972. message: this.$t('pleaseselectpersonnelasd'),
  1973. type: 'warning'
  1974. })
  1975. return
  1976. }
  1977. let groupList = []
  1978. for(let i=0;i<this.addGroupPersonData.group.length;i++){
  1979. groupList = [...groupList,...this.addGroupPersonData.group[i]]
  1980. }
  1981. this.http.post('/project/batchAddMembToGroup',{
  1982. membIdArray: JSON.stringify(this.addGroupPersonData.person),
  1983. groupIds: JSON.stringify(groupList)
  1984. },res => {
  1985. if(res.code == 'ok'){
  1986. this.addGroupPersonDialog = false,
  1987. this.batchSetWudulistBtn1()
  1988. this.$message({
  1989. message: this.$t('addsuccessful'),
  1990. type: 'success'
  1991. })
  1992. this.getList()
  1993. }else {
  1994. this.$message({
  1995. message: res.msg,
  1996. type: 'error'
  1997. })
  1998. }
  1999. },err => {
  2000. this.$message({
  2001. message: err,
  2002. type: 'error'
  2003. })
  2004. })
  2005. },
  2006. batchDelete(){
  2007. if(this.checkedProjectArr.length == 0){
  2008. this.$message(this.$t('defaultText.pleaseSelectSnItem'))
  2009. return
  2010. }
  2011. let proArr = []
  2012. for(let i=0;i<this.checkedProjectArr.length;i++){
  2013. proArr.push(this.checkedProjectArr[i].id)
  2014. // proArr += this.checkedProjectArr[i].id + ','
  2015. }
  2016. // proArr = proArr.substring(0,proArr.length - 1)
  2017. this.http.post('/project/batchDeleteProject',{
  2018. projectIdArray: JSON.stringify(proArr)
  2019. },res => {
  2020. if(res.code == 'ok'){
  2021. this.$message({
  2022. message: this.$t('message.successfullyDeleted'),
  2023. type: 'success'
  2024. })
  2025. this.getList()
  2026. }else {
  2027. this.$message({
  2028. message: res.msg,
  2029. type: 'error'
  2030. })
  2031. }
  2032. },err => {
  2033. this.$message({
  2034. message: err,
  2035. type: 'error'
  2036. })
  2037. })
  2038. },
  2039. // 批量设置项目经理
  2040. batchIncharger(){
  2041. if(this.checkedProjectArr.length == 0){
  2042. this.$message(this.$t('defaultText.pleaseSelectSnItem'))
  2043. return
  2044. }
  2045. this.batchInchargerDialog = true
  2046. this.paramInchargerId = ''
  2047. },
  2048. batchInchargerSure(){
  2049. if(!this.paramInchargerId){
  2050. this.$message({
  2051. message: this.$t('pleaseselecttheprojectmanager'),
  2052. type: 'warning'
  2053. })
  2054. return
  2055. }
  2056. let proArr = ''
  2057. for(let i=0;i<this.checkedProjectArr.length;i++){
  2058. // proArr.push(this.checkedProjectArr[i].id)
  2059. proArr += this.checkedProjectArr[i].id + ','
  2060. }
  2061. proArr = proArr.substring(0,proArr.length - 1)
  2062. this.http.post('/project/batchExchangeIncharger',{
  2063. inchargerId: this.paramInchargerId,
  2064. projectIds: proArr
  2065. },res => {
  2066. if(res.code == 'ok'){
  2067. this.batchInchargerDialog = false
  2068. this.$message({
  2069. message: this.$t('setupthesuccess'),
  2070. type: 'success'
  2071. })
  2072. this.getList()
  2073. }else {
  2074. this.$message({
  2075. message: res.msg,
  2076. type: 'error'
  2077. })
  2078. }
  2079. },err => {
  2080. this.$message({
  2081. message: err,
  2082. type: 'error'
  2083. })
  2084. })
  2085. },
  2086. // 批量添加项目参与人
  2087. addProPreson(){
  2088. if(this.checkedProjectArr.length == 0){
  2089. this.$message(this.$t('defaultText.pleaseSelectSnItem'))
  2090. return
  2091. }
  2092. this.addGroupPersonDialog = true
  2093. this.isAddGroupPerson = false
  2094. },
  2095. addProPersonSure(){
  2096. if(this.addGroupPersonData.person == null){
  2097. this.$message({
  2098. message: this.$t('pleaseselectpersonnel'),
  2099. type: 'warning'
  2100. })
  2101. return
  2102. }
  2103. let proArr = []
  2104. for(let i=0;i<this.checkedProjectArr.length;i++){
  2105. proArr.push(this.checkedProjectArr[i].id)
  2106. // proArr += this.checkedProjectArr[i].id + ','
  2107. }
  2108. // proArr = proArr.substring(0,proArr.length - 1)
  2109. this.http.post('/project/batchSetParticipation',{
  2110. userIds: JSON.stringify(this.addGroupPersonData.person),
  2111. projectIdArray: JSON.stringify(proArr)
  2112. },res => {
  2113. if(res.code == 'ok'){
  2114. this.addGroupPersonDialog = false,
  2115. this.batchSetWudulistBtn1()
  2116. this.$message({
  2117. message: this.$t('addsuccessful'),
  2118. type: 'success'
  2119. })
  2120. this.getList()
  2121. }else {
  2122. this.$message({
  2123. message: res.msg,
  2124. type: 'error'
  2125. })
  2126. }
  2127. },err => {
  2128. this.$message({
  2129. message: err,
  2130. type: 'error'
  2131. })
  2132. })
  2133. },
  2134. filterNode(value, data) {
  2135. if (!value) return true;
  2136. return data.label.indexOf(value) !== -1;
  2137. },
  2138. //重启项目
  2139. restartPro(row) {
  2140. this.http.post('/project/start',{id: row.id},
  2141. res => {
  2142. if (res.code == "ok") {
  2143. this.$message({
  2144. message: this.$t('restartthesuccess'),
  2145. type: "success"
  2146. });
  2147. row.status = 1;
  2148. } else {
  2149. this.$message({
  2150. message: res.msg,
  2151. type: "error"
  2152. });
  2153. }
  2154. },
  2155. error => {
  2156. this.$message({
  2157. message: error,
  2158. type: "error"
  2159. });
  2160. });
  2161. },
  2162. //撤销项目
  2163. cancelPro(row) {
  2164. this.http.post('/project/cancel',{id: row.id},
  2165. res => {
  2166. if (res.code == "ok") {
  2167. this.$message({
  2168. message: this.$t('Revocationofsuccess'),
  2169. type: "success"
  2170. });
  2171. row.status = 3;
  2172. } else {
  2173. this.$message({
  2174. message: res.msg,
  2175. type: "error"
  2176. });
  2177. }
  2178. },
  2179. error => {
  2180. this.$message({
  2181. message: error,
  2182. type: "error"
  2183. });
  2184. });
  2185. },
  2186. // 暂停项目
  2187. suspendPro(row) {
  2188. this.http.post('/project/suspend',{id: row.id},
  2189. res => {
  2190. if (res.code == "ok") {
  2191. this.$message({
  2192. message: this.$t('suspensionofsuccess'),
  2193. type: "success"
  2194. });
  2195. row.status = 4;
  2196. } else {
  2197. this.$message({
  2198. message: res.msg,
  2199. type: "error"
  2200. });
  2201. }
  2202. },
  2203. error => {
  2204. this.$message({
  2205. message: error,
  2206. type: "error"
  2207. });
  2208. });
  2209. },
  2210. //完成项目
  2211. finishPro(row) {
  2212. this.http.post('/project/finish',{id: row.id},
  2213. res => {
  2214. if (res.code == "ok") {
  2215. this.$message({
  2216. message: this.$t('projectcompletion'),
  2217. type: "success"
  2218. });
  2219. row.status = 2;
  2220. } else {
  2221. this.$message({
  2222. message: res.msg,
  2223. type: "error"
  2224. });
  2225. }
  2226. },
  2227. error => {
  2228. this.$message({
  2229. message: error,
  2230. type: "error"
  2231. });
  2232. });
  2233. },
  2234. exportProjectData() {
  2235. let param = {
  2236. status: this.status,
  2237. }
  2238. if(this.keyword){param.searchField = this.searchField;param.keyword = this.keyword}
  2239. if(this.projectMainId){param.projectMainId = this.projectMainId}
  2240. if(this.statusClf){param.category = this.statusClf}
  2241. if(this.deptId.length){param.deptId = this.deptId[this.deptId.length-1]}
  2242. if(this.inchagerId){param.inchagerId = this.inchagerId}
  2243. if(this.participationId){param.participation = this.participationId}
  2244. this.exportDisabled = true
  2245. this.exportNotification = this.$notify({
  2246. title: '导出项目',
  2247. message: '项目导出中、请稍后...',
  2248. duration: 0,
  2249. showClose: false
  2250. });
  2251. //导出项目
  2252. this.http.post('/project/exportData',param,
  2253. res => {
  2254. this.exportDisabled = false
  2255. this.exportNotification.close()
  2256. if (res.code == "ok") {
  2257. var filePath = res.data;
  2258. const a = document.createElement('a'); // 创建a标签
  2259. a.setAttribute('download', this.$t('projectexport') + '.xlsx');// download属性
  2260. a.setAttribute('href', filePath);// href链接
  2261. a.click(); //自执行点击事件
  2262. a.remove();
  2263. }
  2264. },
  2265. error => {
  2266. this.exportDisabled = false
  2267. this.exportNotification.close()
  2268. this.$message({
  2269. message: error,
  2270. type: "error"
  2271. });
  2272. }
  2273. );
  2274. },
  2275. exportProjectGroup() {
  2276. //导出项目分组
  2277. this.http.post('/project/exportGroupData',{},
  2278. res => {
  2279. if (res.code == "ok") {
  2280. var filePath = res.data;
  2281. const a = document.createElement('a'); // 创建a标签
  2282. a.setAttribute('download', this.$t('projecttaskgroupexport') + '.xlsx');// download属性
  2283. a.setAttribute('href', filePath);// href链接
  2284. a.click(); //自执行点击事件
  2285. a.remove();
  2286. }
  2287. },
  2288. error => {
  2289. this.$message({
  2290. message: error,
  2291. type: "error"
  2292. });
  2293. }
  2294. );
  2295. },
  2296. userssHu() {
  2297. this.http.post('/time-type/getCompanyTimeSetting',{
  2298. companyId: this.user.companyId
  2299. },
  2300. res => {
  2301. if (res.code == "ok") {
  2302. this.yonghuUser = res.data
  2303. // console.log(this.yonghuUser)
  2304. }
  2305. },
  2306. error => {
  2307. this.$message({
  2308. message: error,
  2309. type: "error"
  2310. });
  2311. }
  2312. );
  2313. },
  2314. yanjiuzx() {
  2315. this.http.post('/report-extra-degree/getAll ',{},
  2316. res => {
  2317. if (res.code == "ok") {
  2318. // console.log(res, '过来的数据')
  2319. this.ause = res.data
  2320. } else {
  2321. this.$message({
  2322. message: res.msg,
  2323. type: "error"
  2324. });
  2325. }
  2326. },
  2327. error => {
  2328. this.$message({
  2329. message: error,
  2330. type: "error"
  2331. });
  2332. }
  2333. );
  2334. },
  2335. selectPublic() {
  2336. if (this.addForm.isPublic == 1) {
  2337. this.participator = this.users;
  2338. } else {
  2339. this.participator = [];
  2340. }
  2341. },
  2342. addPpMemb() {
  2343. //检查合计比例是否到达100%
  2344. let p = 0;
  2345. let hasNoMemb = false;
  2346. this.curProfessionRow.membList.forEach(m=>{
  2347. p += parseInt(m.percentage);
  2348. //检查人员是否选择
  2349. if (m.membId == null) {
  2350. hasNoMemb = true;
  2351. }
  2352. });
  2353. if (hasNoMemb) {
  2354. this.$message({
  2355. message: this.$t('professionalscannotbeempty'),
  2356. type: "error"
  2357. });
  2358. return;
  2359. }
  2360. //检查人员不能重复
  2361. let hasDuplicate = false;
  2362. this.curProfessionRow.membList.forEach(m=>{
  2363. if (this.curProfessionRow.membList.filter(innerM=>innerM.membId == m.membId).length>1) {
  2364. hasDuplicate = true;
  2365. }
  2366. });
  2367. if (hasDuplicate) {
  2368. this.$message({
  2369. message: this.$t('professionalscannotrepeat'),
  2370. type: "error"
  2371. });
  2372. return;
  2373. }
  2374. if (p != 100) {
  2375. this.$message({
  2376. message: this.$t('totalproportionmust'),
  2377. type: "error"
  2378. });
  2379. return;
  2380. }
  2381. this.editPpMembDialog = false;
  2382. this.curProfessionRow.membList.forEach(m=>{
  2383. m.membName = this.participator.filter(p=>p.id == m.membId)[0].name;
  2384. });
  2385. this.projectProfessionItem.membList = JSON.parse(JSON.stringify(this.curProfessionRow.membList));
  2386. },
  2387. //删除专业人员
  2388. deleteMembItem(index) {
  2389. this.curProfessionRow.membList.splice(index,1);
  2390. },
  2391. //添加专业人员
  2392. addMembItem() {
  2393. if (this.curProfessionRow.membList == null) {
  2394. this.curProfessionRow.membList = [{membId:null, percentage:100}];
  2395. } else {
  2396. let p = 0;
  2397. this.curProfessionRow.membList.forEach(m=>{
  2398. p += parseInt(m.percentage);
  2399. });
  2400. this.curProfessionRow.membList.push({membId:null, percentage:100-p});
  2401. }
  2402. this.$forceUpdate();
  2403. },
  2404. showEditPpMembs(row) {
  2405. this.projectProfessionItem = row;
  2406. this.curProfessionRow = JSON.parse(JSON.stringify(row));
  2407. if (this.curProfessionRow.membList == null || this.curProfessionRow.membList.length == 0) {
  2408. this.curProfessionRow.membList = [{membId:null, percentage:100}];
  2409. }
  2410. this.editPpMembDialog = true;
  2411. },
  2412. getProjectNotifyUserList(projectId) {
  2413. this.http.post("/project-notify-user/get", {projectId: projectId},
  2414. res => {
  2415. if (res.code == "ok") {
  2416. var chosenLeaderIds = [];
  2417. var chosenLeaderNames = '';
  2418. var leaderList = res.data;
  2419. this.chosenLeaders = leaderList;
  2420. for(var j in leaderList) {
  2421. chosenLeaderIds.push(leaderList[j].userId)
  2422. chosenLeaderNames += leaderList[j].userName+',';
  2423. }
  2424. if (chosenLeaderNames.length > 0) {
  2425. chosenLeaderNames = chosenLeaderNames.substring(0, chosenLeaderNames.length -1);
  2426. }
  2427. this.addForm.notifyUserIds = chosenLeaderIds;
  2428. this.addForm.notifyUserNames = chosenLeaderNames;
  2429. } else {
  2430. this.$message({
  2431. message: res.msg,
  2432. type: "error"
  2433. });
  2434. }
  2435. },
  2436. error => {
  2437. this.$message({
  2438. message: error,
  2439. type: "error"
  2440. });
  2441. });
  2442. },
  2443. getProjectProfessions(projectId) {
  2444. this.http.post("/project-profession/get", {projectId: projectId},
  2445. res => {
  2446. if (res.code == "ok") {
  2447. this.projectProfessionList = res.data;
  2448. } else {
  2449. this.$message({
  2450. message: res.msg,
  2451. type: "error"
  2452. });
  2453. }
  2454. },
  2455. error => {
  2456. this.$message({
  2457. message: error,
  2458. type: "error"
  2459. });
  2460. });
  2461. },
  2462. checkProjectProfession() {
  2463. //检查合计比例是否到达100%
  2464. let p = 0;
  2465. let hasNoMemb = false;
  2466. let hasNoProfession = false;
  2467. let hasNoMembList = false;
  2468. this.projectProfessionList.forEach(m=>{
  2469. p += parseInt(m.percentage);
  2470. //检查人员是否选择
  2471. if (m.inchargerId == null) {
  2472. hasNoMemb = true;
  2473. }
  2474. if (m.professionId == null) {
  2475. hasNoProfession = true;
  2476. }
  2477. if (m.membList == null) {
  2478. hasNoMembList = true;
  2479. }
  2480. });
  2481. if (hasNoProfession) {
  2482. this.$message({
  2483. message: this.$t('majorcannotbeempty'),
  2484. type: "error"
  2485. });
  2486. return false;
  2487. }
  2488. if (hasNoMembList) {
  2489. this.$message({
  2490. message: this.$t('personnelcannotbeleftblank'),
  2491. type: "error"
  2492. });
  2493. return false;
  2494. }
  2495. if (hasNoMemb) {
  2496. this.$message({
  2497. message: this.$t('leadercannotbeblank'),
  2498. type: "error"
  2499. });
  2500. return false;
  2501. }
  2502. //检查专业不能重复
  2503. let hasDuplicate = false;
  2504. this.projectProfessionList.forEach(m=>{
  2505. if (this.projectProfessionList.filter(innerM=>innerM.professionId == m.professionId).length>1) {
  2506. hasDuplicate = true;
  2507. }
  2508. });
  2509. if (hasDuplicate) {
  2510. this.$message({
  2511. message: this.$t('shouldnotberepeated'),
  2512. type: "error"
  2513. });
  2514. return false;
  2515. }
  2516. if (this.projectProfessionList.length > 0 && p != 100) {
  2517. this.$message({
  2518. message: this.$t('numberomajorsmust'),
  2519. type: "error"
  2520. });
  2521. return false;
  2522. }
  2523. return true;
  2524. },
  2525. //保存项目专业
  2526. saveProjectProfessions(projectId) {
  2527. var list = this.projectProfessionList.filter(p=>p.professionId != null);
  2528. list.forEach(p=>p.inchargerName = this.participator.filter(m=>m.id == p.inchargerId)[0].name);
  2529. list.forEach(p=>p.professionName = this.professionList.filter(m=>m.id == p.professionId)[0].name);
  2530. this.http.post("/project-profession/modify", {projectId: projectId, json: JSON.stringify(list)},
  2531. res => {
  2532. if (res.code == "ok") {
  2533. return false;
  2534. } else {
  2535. this.$message({
  2536. message: res.msg,
  2537. type: "error"
  2538. });
  2539. }
  2540. },
  2541. error => {
  2542. this.$message({
  2543. message: error,
  2544. type: "error"
  2545. });
  2546. });
  2547. },
  2548. //删除项目专业
  2549. deleteItem(index) {
  2550. this.projectProfessionList.splice(index,1);
  2551. },
  2552. //添加项目专业
  2553. addItem() {
  2554. let p = 0;
  2555. this.projectProfessionList.forEach(m=>{
  2556. p += parseInt(m.percentage);
  2557. });
  2558. this.projectProfessionList.push( { professionId:null, inchargerId:null,membIds:[], percentage: 100-p});
  2559. },
  2560. getProfessionList() {
  2561. this.http.post("/profession/getAll", {},
  2562. res => {
  2563. if (res.code == "ok") {
  2564. var list = res.data;
  2565. this.professionList = list;
  2566. } else {
  2567. this.$message({
  2568. message: res.msg,
  2569. type: "error"
  2570. });
  2571. }
  2572. },
  2573. error => {
  2574. this.$message({
  2575. message: error,
  2576. type: "error"
  2577. });
  2578. });
  2579. },
  2580. restrictNumber(targetId) {
  2581. let inpu = document.getElementById(targetId);
  2582. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  2583. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  2584. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  2585. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  2586. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  2587. inpu.value = parseFloat(inpu.value);
  2588. }
  2589. },
  2590. showChooseLeaderTree() {
  2591. this.chosenMembCount = this.chosenLeaders.length;
  2592. this.chooseLeaderVisible = true;
  2593. },
  2594. onLeaderTreeItemChange() {
  2595. var chosenList = this.$refs.chooseLeaderTree.getCheckedNodes();
  2596. var list = chosenList.filter(item=>item.isUser == 1);
  2597. this.chosenMembCount = list.length;
  2598. },
  2599. showChooseMembTree() {
  2600. this.deptMembData = JSON.parse(JSON.stringify(this.allMembData))
  2601. this.chosenMembCount = this.participator.length;
  2602. this.chooseParticipVisible = true;
  2603. this.filterText = ''
  2604. this.wxFilterText = ''
  2605. if(this.user.userNameNeedTranslate == 1) {
  2606. this.getDepartment()
  2607. }
  2608. let that = this
  2609. setTimeout(()=>{
  2610. that.chosenListBackup = that.$refs.chooseMembTree.getCheckedNodes();
  2611. }, 500)
  2612. console.log(this.chosenListBackup, '备份的数据')
  2613. },
  2614. onTreeItemChange() {
  2615. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  2616. var list = chosenList.filter(item=>item.isUser == 1);
  2617. this.chosenMembCount = list.length;
  2618. },
  2619. findUserInTree() {
  2620. if (this.filterName == '') {
  2621. this.deptMembData = this.allMembData;
  2622. } else {
  2623. var list = this.findRecursively(this.filterName, this.allMembData);
  2624. this.deptMembData = list;
  2625. }
  2626. },
  2627. findRecursively(username, list) {
  2628. var filterList = [];
  2629. for (var i=0;i<list.length; i++) {
  2630. if (list[i].isUser == 1) {
  2631. if (list[i].label.indexOf(username) >= 0) {
  2632. //匹配上了
  2633. filterList.push(list[i]);
  2634. }
  2635. } else if (list[i].children != null && list[i].children.length > 0) {
  2636. var subList = this.findRecursively(username, list[i].children);
  2637. if (subList.length > 0) {
  2638. subList.forEach(s=>filterList.push(s));
  2639. }
  2640. }
  2641. }
  2642. return filterList;
  2643. },
  2644. //确定选择参与人
  2645. chooseParticip() {
  2646. this.chooseParticipVisible = false;
  2647. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  2648. if(this.searchPersonnelFlg) {
  2649. chosenList = [...chosenList, ...this.chosenListBackup]
  2650. }
  2651. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  2652. this.addForm.userNames = '';
  2653. this.addFormUserNames = []
  2654. this.addForm.userId = [];
  2655. this.participator = [];
  2656. for (var i=0;i<this.chosenMembList.length; i++) {
  2657. this.addForm.userId.push(this.chosenMembList[i].id);
  2658. this.addForm.userNames += this.chosenMembList[i].label+',';
  2659. this.addFormUserNames.push(this.chosenMembList[i].label)
  2660. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  2661. this.participator.push(item);
  2662. }
  2663. if (this.addForm.userNames.length > 0) {
  2664. this.addForm.userNames = this.addForm.userNames.substring(0, this.addForm.userNames.length-1);
  2665. // this.addFormUserNames = this.addFormUserNames.substring(0, this.addFormUserNames.length-1);
  2666. }
  2667. console.log(this.addForm.userId)
  2668. console.log(this.addForm.userNames)
  2669. console.log(this.addFormUserNames)
  2670. },
  2671. //选中相关领导
  2672. // chooseLeader() {
  2673. // this.chooseLeaderVisible = false;
  2674. // var chosenList = this.$refs.chooseLeaderTree.getCheckedNodes();
  2675. // var chosenMembList = chosenList.filter(item=>item.isUser == 1);
  2676. // this.addForm.notifyUserNames = '';
  2677. // this.addForm.notifyUserIds = [];
  2678. // this.chosenLeaders = [];
  2679. // for (var i=0;i<chosenMembList.length; i++) {
  2680. // this.addForm.notifyUserIds.push(chosenMembList[i].id);
  2681. // this.addForm.notifyUserNames += chosenMembList[i].label+',';
  2682. // var item = {userId:chosenMembList[i].id, userName:chosenMembList[i].label};
  2683. // this.chosenLeaders.push(item);
  2684. // }
  2685. // if (this.addForm.notifyUserNames.length > 0) {
  2686. // this.addForm.notifyUserNames = this.addForm.notifyUserNames.substring(0, this.addForm.notifyUserNames.length-1);
  2687. // }
  2688. // },
  2689. // 获取部门列表
  2690. getDepartment() {
  2691. this.http.post("/department/listAllMemb", {},
  2692. res => {
  2693. if (res.code == "ok") {
  2694. var list = res.data;
  2695. //设置员工到部门下面
  2696. this.setUserToDept(list);
  2697. this.deptMembData = list;
  2698. console.log(this.deptMembData, '看看数据')
  2699. //用于筛选过滤
  2700. this.allMembData = JSON.parse(JSON.stringify(this.deptMembData));
  2701. } else {
  2702. this.$message({
  2703. message: res.msg,
  2704. type: "error"
  2705. });
  2706. }
  2707. },
  2708. error => {
  2709. this.$message({
  2710. message: error,
  2711. type: "error"
  2712. });
  2713. });
  2714. },
  2715. // 获取部门列表
  2716. getDepartment2() {
  2717. this.http.post(
  2718. this.port.manage.depList,{},
  2719. (res) => {
  2720. if (res.code == "ok") {
  2721. var list = res.data
  2722. this.buOption = this.changeArr(JSON.parse(JSON.stringify(list)));
  2723. } else {
  2724. this.$message({
  2725. message: res.msg,
  2726. type: "error",
  2727. });
  2728. }
  2729. },
  2730. (error) => {
  2731. this.$message({
  2732. message: error,
  2733. type: "error",
  2734. });
  2735. }
  2736. );
  2737. },
  2738. // 修改数组
  2739. changeArr(arr) {
  2740. for (var i = 0; i < arr.length; i++) {
  2741. if(arr[i].id != -1 && arr[i].id != 0) {
  2742. // if(arr[i].userList) {
  2743. // if(arr[i].userList.length > 0) {
  2744. // arr[i].children = arr[i].userList
  2745. // }
  2746. // }
  2747. if (arr[i].children != null && arr[i].children.length>0) {
  2748. arr[i].children = this.changeArr(arr[i].children);
  2749. }
  2750. arr[i].id && (arr[i].value = arr[i].id);
  2751. delete arr[i].id;
  2752. }
  2753. }
  2754. for(var i in arr) {
  2755. if(arr[i].id == -1 || arr[i].id == 0) {
  2756. arr.splice(i,1)
  2757. }
  2758. }
  2759. return arr;
  2760. },
  2761. // 企业微信搜索
  2762. echartDepartment() {
  2763. console.log('我点击了搜索')
  2764. if(this.wxFilterText != '') {
  2765. this.http.post("/department/listAllMemb", {
  2766. keyword: this.wxFilterText,
  2767. cursor: ''
  2768. },
  2769. res => {
  2770. if (res.code == "ok") {
  2771. var list = res.data.data;
  2772. this.setUserToDept(list);
  2773. this.deptMembData = list;
  2774. this.$forceUpdate()
  2775. this.searchPersonnelFlgnum = +this.searchPersonnelFlgnum +1
  2776. this.searchPersonnelFlg = true
  2777. } else {
  2778. this.$message({
  2779. message: res.msg,
  2780. type: "error"
  2781. });
  2782. }
  2783. },
  2784. error => {
  2785. this.$message({
  2786. message: error,
  2787. type: "error"
  2788. });
  2789. });
  2790. } else {
  2791. this.searchPersonnelFlgnum = +this.searchPersonnelFlgnum +1
  2792. this.searchPersonnelFlg = false
  2793. this.getDepartment()
  2794. }
  2795. },
  2796. setUserToDept(list) {
  2797. for (var i in list) {
  2798. if (list[i].children != null) {
  2799. this.setUserToDept(list[i].children);
  2800. }
  2801. if (list[i].userList != null) {
  2802. if (list[i].children == null) {
  2803. list[i].children = [];
  2804. }
  2805. list[i].userList.forEach(element => {
  2806. var obj = {id: element.id, label:element.name, parentId:element.departmentId, isUser:1};
  2807. list[i].children.push(obj);
  2808. });
  2809. }
  2810. }
  2811. },
  2812. // 获取分类条目
  2813. getClfConfigList() {
  2814. this.http.get('/project-category/list',
  2815. res => {
  2816. if (res.code == "ok") {
  2817. this.baseClfList = res.data;
  2818. // console.log("获取分类条目",res.data);
  2819. this.$forceUpdate();
  2820. } else {
  2821. this.$message({
  2822. message: res.msg,
  2823. type: "error"
  2824. });
  2825. }
  2826. },
  2827. error => {
  2828. this.$message({
  2829. message: error,
  2830. type: "error"
  2831. });
  2832. }
  2833. );
  2834. },
  2835. // 新增/编辑 分类条目
  2836. addNewClf(row) {
  2837. this.addClfDialog = true;
  2838. if (row == null) {
  2839. this.addClf = {}
  2840. } else {
  2841. this.addClf = row;
  2842. }
  2843. },
  2844. // 提交
  2845. submitClf() {
  2846. this.addClf.proBuAudit ? this.addClf.proBuAudit =1 : this.addClf.proBuAudit = 0
  2847. this.addClf.proInchargerAudit ? this.addClf.proInchargerAudit = 1 : this.addClf.proInchargerAudit = 0
  2848. this.http.post('/project-category/addOrMod',this.addClf,
  2849. res => {
  2850. if (res.code == "ok") {
  2851. this.addClfDialog = false;
  2852. this.auditProcessDialog=false;
  2853. this.baseClfList = res.data;
  2854. // this.$forceUpdate();
  2855. // console.log(res.data);
  2856. } else {
  2857. this.$message({
  2858. message: res.msg,
  2859. type: "error"
  2860. });
  2861. }
  2862. },
  2863. error => {
  2864. this.$message({
  2865. message: error,
  2866. type: "error"
  2867. });
  2868. }
  2869. );
  2870. },
  2871. // 提交
  2872. submitManPro() {
  2873. this.http.post('/project-main/addOrMod',this.addMainForm,
  2874. res => {
  2875. if (res.code == "ok") {
  2876. this.addFlgmainProjectDialog = false;
  2877. this.getMainProject()
  2878. } else {
  2879. this.$message({
  2880. message: res.msg,
  2881. type: "error"
  2882. });
  2883. }
  2884. },
  2885. error => {
  2886. this.$message({
  2887. message: error,
  2888. type: "error"
  2889. });
  2890. }
  2891. );
  2892. },
  2893. // 分类绑定审核流程设置
  2894. auditProcess(row) {
  2895. this.auditProcessDialog = true;
  2896. row.proBuAudit ? row.proBuAudit = true : row.proBuAudit = false
  2897. row.proInchargerAudit ? row.proInchargerAudit = true : row.proInchargerAudit = false
  2898. if (row == null) {
  2899. this.addClf = {}
  2900. } else {
  2901. this.addClf = row;
  2902. }
  2903. },
  2904. // 提交项目阶段
  2905. submitPanthPro() {
  2906. this.http.post('/project-stage/addOrMod',this.addPanthForm,
  2907. res => {
  2908. if (res.code == "ok") {
  2909. this.addFlgPanthProjectDialog = false;
  2910. this.obtainPhase()
  2911. } else {
  2912. this.$message({
  2913. message: res.msg,
  2914. type: "error"
  2915. });
  2916. }
  2917. },
  2918. error => {
  2919. this.$message({
  2920. message: error,
  2921. type: "error"
  2922. });
  2923. }
  2924. );
  2925. },
  2926. // 删除
  2927. deleteClf(row) {
  2928. this.$confirm(this.$t('operationmaycausedatalossAreyousuredeletethedata'),this.$t('deletingCategoryEntry'), {
  2929. confirmButtonText: this.$t('btn.determine'),
  2930. cancelButtonText: this.$t('btn.cancel'),
  2931. type: "warning"
  2932. })
  2933. .then(() => {
  2934. this.listLoading = true;
  2935. this.http.post('/project-category/delete',{
  2936. id: row.id
  2937. },
  2938. res => {
  2939. this.listLoading = false;
  2940. if (res.code == "ok") {
  2941. this.$message({
  2942. message: this.$t('message.successfullyDeleted'),
  2943. type: "success"
  2944. });
  2945. this.getClfConfigList();
  2946. } else {
  2947. this.$message({
  2948. message: res.msg,
  2949. type: "error"
  2950. });
  2951. }
  2952. },
  2953. error => {
  2954. this.listLoading = false;
  2955. this.$message({
  2956. message: error,
  2957. type: "error"
  2958. });
  2959. }
  2960. );
  2961. })
  2962. .catch(() => {});
  2963. },
  2964. // 删除主项目
  2965. deleteManPro(row) {
  2966. this.$confirm(this.$t('operationmaycausedatalossAreyousuredeletethedata'),this.$t('deletethemainproject'), {
  2967. confirmButtonText: this.$t('btn.determine'),
  2968. cancelButtonText: this.$t('btn.cancel'),
  2969. type: "warning"
  2970. })
  2971. .then(() => {
  2972. this.listLoading = true;
  2973. this.http.post('/project-main/delete',{
  2974. id: row.id
  2975. },
  2976. res => {
  2977. this.listLoading = false;
  2978. if (res.code == "ok") {
  2979. this.$message({
  2980. message: this.$t('message.successfullyDeleted'),
  2981. type: "success"
  2982. });
  2983. this.getMainProject();
  2984. } else {
  2985. this.$message({
  2986. message: res.msg,
  2987. type: "error"
  2988. });
  2989. }
  2990. },
  2991. error => {
  2992. this.listLoading = false;
  2993. this.$message({
  2994. message: error,
  2995. type: "error"
  2996. });
  2997. }
  2998. );
  2999. })
  3000. .catch(() => {});
  3001. },
  3002. // 删除项目阶段
  3003. deletePanthPro(row) {
  3004. this.$confirm(this.$t('operationmaycausedatalossAreyousuredeletethedata'),this.$t('deletingprojectphases'), {
  3005. confirmButtonText: this.$t('btn.determine'),
  3006. cancelButtonText: this.$t('btn.cancel'),
  3007. type: "warning"
  3008. })
  3009. .then(() => {
  3010. this.listLoading = true;
  3011. this.http.post('/project-stage/delete ',{
  3012. id: row.id
  3013. },
  3014. res => {
  3015. this.listLoading = false;
  3016. if (res.code == "ok") {
  3017. this.$message({
  3018. message: this.$t('message.successfullyDeleted'),
  3019. type: "success"
  3020. });
  3021. this.obtainPhase();
  3022. } else {
  3023. this.$message({
  3024. message: res.msg,
  3025. type: "error"
  3026. });
  3027. }
  3028. },
  3029. error => {
  3030. this.listLoading = false;
  3031. this.$message({
  3032. message: error,
  3033. type: "error"
  3034. });
  3035. }
  3036. );
  3037. })
  3038. .catch(() => {});
  3039. },
  3040. // 分类筛选
  3041. searchClfList(){
  3042. this.page = 1;
  3043. this.getList();
  3044. },
  3045. manageSelect(){
  3046. this.page = 1
  3047. this.getList()
  3048. },
  3049. getProjectBaseConfigList() {
  3050. this.http.post('/project-basecost-setting/list',{},
  3051. res => {
  3052. if (res.code == "ok") {
  3053. this.baseCostItemList = res.data;
  3054. this.$forceUpdate();
  3055. } else {
  3056. this.$message({
  3057. message: res.msg,
  3058. type: "error"
  3059. });
  3060. }
  3061. },
  3062. error => {
  3063. this.$message({
  3064. message: error,
  3065. type: "error"
  3066. });
  3067. }
  3068. );
  3069. },
  3070. deletekeyNodes(row) {
  3071. this.$confirm(this.$t('operationmaycausedatalossAreyousuredeletethedata'),this.$t('deletingKeyNode'), {
  3072. confirmButtonText: this.$t('btn.determine'),
  3073. cancelButtonText: this.$t('btn.cancel'),
  3074. type: "warning"
  3075. })
  3076. .then(() => {
  3077. this.listLoading = true;
  3078. this.http.post('/project-key-nodes-setting/delete',{
  3079. id: row.id
  3080. },
  3081. res => {
  3082. this.listLoading = false;
  3083. if (res.code == "ok") {
  3084. this.$message({
  3085. message: this.$t('message.successfullyDeleted'),
  3086. type: "success"
  3087. });
  3088. this.getkeyNodes();
  3089. } else {
  3090. this.$message({
  3091. message: res.msg,
  3092. type: "error"
  3093. });
  3094. }
  3095. },
  3096. error => {
  3097. this.listLoading = false;
  3098. this.$message({
  3099. message: error,
  3100. type: "error"
  3101. });
  3102. }
  3103. );
  3104. })
  3105. .catch(() => {});
  3106. },
  3107. deleteBaseItem(row) {
  3108. this.$confirm(this.$t('operationmaycausedatalossAreyousuredeletethedata'),this.$t('deletethecostbaselineitem'), {
  3109. confirmButtonText: this.$t('btn.determine'),
  3110. cancelButtonText: this.$t('btn.cancel'),
  3111. type: "warning"
  3112. })
  3113. .then(() => {
  3114. this.listLoading = true;
  3115. this.http.post('/project-basecost-setting/delete',{
  3116. id: row.id
  3117. },
  3118. res => {
  3119. this.listLoading = false;
  3120. if (res.code == "ok") {
  3121. this.$message({
  3122. message: this.$t('message.successfullyDeleted'),
  3123. type: "success"
  3124. });
  3125. this.getProjectBaseConfigList();
  3126. } else {
  3127. this.$message({
  3128. message: res.msg,
  3129. type: "error"
  3130. });
  3131. }
  3132. },
  3133. error => {
  3134. this.listLoading = false;
  3135. this.$message({
  3136. message: error,
  3137. type: "error"
  3138. });
  3139. }
  3140. );
  3141. })
  3142. .catch(() => {});
  3143. },
  3144. submitInsertBaseItem() {
  3145. this.http.post('/project-basecost-setting/addOrMod',this.addForm,
  3146. res => {
  3147. if (res.code == "ok") {
  3148. this.addBaseItemDialog = false;
  3149. this.baseCostItemList = res.data;
  3150. this.$forceUpdate();
  3151. } else {
  3152. this.$message({
  3153. message: res.msg,
  3154. type: "error"
  3155. });
  3156. }
  3157. },
  3158. error => {
  3159. this.$message({
  3160. message: error,
  3161. type: "error"
  3162. });
  3163. }
  3164. );
  3165. },
  3166. submitkeyNodes() {
  3167. // console.log(this.addForm, '提交的参数')
  3168. // return
  3169. this.http.post('/project-key-nodes-setting/addOrMod',this.addFormkeyNodes,
  3170. res => {
  3171. if (res.code == "ok") {
  3172. this.addBasekeyNodesialog = false;
  3173. this.keyNodesList = res.data;
  3174. this.$forceUpdate();
  3175. } else {
  3176. this.$message({
  3177. message: res.msg,
  3178. type: "error"
  3179. });
  3180. }
  3181. },
  3182. error => {
  3183. this.$message({
  3184. message: error,
  3185. type: "error"
  3186. });
  3187. }
  3188. );
  3189. },
  3190. showBaseCostItemDialog() {
  3191. this.showBaseConfig = true;
  3192. },
  3193. addNewBaseItem(row) {
  3194. this.addBaseItemDialog = true;
  3195. if (row == null) {
  3196. this.addForm = {alarmType: 0}
  3197. } else {
  3198. this.addForm = row;
  3199. }
  3200. },
  3201. //获取客户列表
  3202. getCustomerList() {
  3203. this.http.post('/customer-info/getAll', {
  3204. },
  3205. res => {
  3206. if (res.code == "ok") {
  3207. this.customerList = res.data;
  3208. } else {
  3209. this.$message({
  3210. message: res.msg,
  3211. type: "error"
  3212. });
  3213. }
  3214. },
  3215. error => {
  3216. this.$message({
  3217. message: error,
  3218. type: "error"
  3219. });
  3220. });
  3221. },
  3222. importProjectBefore(){
  3223. this.paramData1 = false
  3224. this.importProjectBeforeDialog = true
  3225. },
  3226. importProject(item) {
  3227. //首先判断文件类型
  3228. let str = item.file.name.split(".");
  3229. let format = str[str.length - 1];
  3230. if (format != "xls" && format != "xlsx") {
  3231. this.$message({
  3232. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3233. type: "error"
  3234. });
  3235. } else {
  3236. this.listLoading = true;
  3237. let formData = new FormData();
  3238. formData.append("file", item.file);
  3239. formData.append("userId", this.user.id);
  3240. formData.append('key',this.paramData1 ? 1 : 0)
  3241. this.http.uploadFile('/project/importData', formData,
  3242. res => {
  3243. this.$refs.upload.clearFiles();
  3244. this.listLoading = false;
  3245. if (res.code == "ok") {
  3246. // this.$message({
  3247. // message: res.data,
  3248. // type: "success"
  3249. // },5000);
  3250. //弹窗显示
  3251. this.showImportResult = true;
  3252. this.importProjectBeforeDialog = false
  3253. this.importResultMsg = res.data;
  3254. this.getList();
  3255. } else {
  3256. this.$message({
  3257. message: res.msg,
  3258. type: "error"
  3259. });
  3260. }
  3261. },
  3262. error => {
  3263. this.$refs.upload.clearFiles();
  3264. this.listLoading = false;
  3265. this.$message({
  3266. message: error,
  3267. type: "error"
  3268. });
  3269. });
  3270. }
  3271. },
  3272. number(){
  3273. //     this.addForm.budget = this.addForm.budget.replace(/[^\.\d]/g,'');
  3274. // this.addForm.budget = this.addForm.budget.replace('.','');
  3275. },
  3276. deleteSubPro(subProject) {
  3277. this.$confirm(this.$t('makesuretodeletethesubproject') + subProject.name + this.$t('ma'),this.$t('deletesubproject'), {
  3278. confirmButtonText: this.$t('btn.determine'),
  3279. cancelButtonText: this.$t('btn.cancel'),
  3280. type: "warning"
  3281. })
  3282. .then(() => {
  3283. this.listLoading = true;
  3284. this.http.post('/sub-project/deleteProject',{
  3285. id: subProject.id
  3286. },
  3287. res => {
  3288. this.listLoading = false;
  3289. if (res.code == "ok") {
  3290. this.$message({
  3291. message: this.$t('message.successfullyDeleted'),
  3292. type: "success"
  3293. });
  3294. this.subProject(this.currentProject);
  3295. } else {
  3296. this.$message({
  3297. message: res.msg,
  3298. type: "error"
  3299. });
  3300. }
  3301. },
  3302. error => {
  3303. this.listLoading = false;
  3304. this.$message({
  3305. message: error,
  3306. type: "error"
  3307. });
  3308. }
  3309. );
  3310. })
  3311. .catch(() => {});
  3312. },
  3313. searchList() {
  3314. this.page = 1;
  3315. this.getList();
  3316. },
  3317. addNewSubProject(subProject) {
  3318. if (subProject == null) {
  3319. this.temaddForm = {projectId: this.currentProject.id, level:1}
  3320. } else {
  3321. this.temaddForm = JSON.parse(JSON.stringify(subProject));
  3322. }
  3323. this.addSubProject = true;
  3324. },
  3325. //显示子项目
  3326. subProject(item) {
  3327. this.subProjectVisible = true;
  3328. this.currentProject = item;
  3329. this.http.post('/sub-project/list', {
  3330. projectId: item.id
  3331. },
  3332. res => {
  3333. if (res.code == "ok") {
  3334. this.subProjectList = res.data;
  3335. } else {
  3336. this.$message({
  3337. message: res.msg,
  3338. type: "error"
  3339. });
  3340. }
  3341. },
  3342. error => {
  3343. this.$message({
  3344. message: error,
  3345. type: "error"
  3346. });
  3347. });
  3348. },
  3349. //显示用户详情
  3350. showUser(userId) {
  3351. this.userDetailVisible = true;
  3352. this.http.post(this.port.manage.userDetail, {
  3353. userId: userId
  3354. },
  3355. res => {
  3356. if (res.code == "ok") {
  3357. this.userDetail = res.data;
  3358. } else {
  3359. this.$message({
  3360. message: res.msg,
  3361. type: "error"
  3362. });
  3363. }
  3364. },
  3365. error => {
  3366. this.$message({
  3367. message: error,
  3368. type: "error"
  3369. });
  3370. });
  3371. },
  3372. //选择参与人
  3373. changeParticipator() {
  3374. //检查是否在参与人中,如果没有需要加入到参与人中
  3375. // console.log('addform',this.addForm.userId,this.users);
  3376. this.participator = [];
  3377. this.addForm.userId.forEach(u=>{
  3378. var list = this.users.filter(au=>au.id == u);
  3379. if (list.length > 0) {
  3380. var findUser = list[0];
  3381. this.participator.push(findUser);
  3382. } else {
  3383. console.log('未找到用户: '+u);
  3384. }
  3385. })
  3386. },
  3387. getUsers() {
  3388. // this.http.post(this.port.manage.list, {
  3389. // departmentId: -1,
  3390. // pageIndex: 1,
  3391. // // pageSize: 99999
  3392. // pageSize: -1
  3393. // },
  3394. this.http.post('/user/getSimpleActiveUserList', {},
  3395. res => {
  3396. if (res.code == "ok") {
  3397. this.users = res.data;
  3398. } else {
  3399. this.$message({
  3400. message: res.msg,
  3401. type: "error"
  3402. });
  3403. }
  3404. },
  3405. error => {
  3406. this.$message({
  3407. message: error,
  3408. type: "error"
  3409. });
  3410. });
  3411. },
  3412. //分页
  3413. handleCurrentChange(val) {
  3414. this.page = val;
  3415. this.getList();
  3416. },
  3417. handleSizeChange(val) {
  3418. this.size = val;
  3419. localStorage.projectPageSize = this.size;
  3420. this.page = 1
  3421. this.getList();
  3422. },
  3423. participationSelect(){
  3424. this.page = 1
  3425. this.getList()
  3426. },
  3427. //获取项目列表
  3428. getList() {
  3429. this.listLoading = true;
  3430. let parameter = {
  3431. pageIndex: this.page,
  3432. pageSize: this.size,
  3433. keyword:this.keyword,
  3434. searchField: this.searchField,
  3435. status: this.status,
  3436. category: this.statusClf,
  3437. projectMainId: this.projectMainId,
  3438. inchagerId: this.inchagerId,
  3439. participation: this.participationId,
  3440. }
  3441. if(this.createDate) {
  3442. parameter.startDate = this.createDate[0]
  3443. parameter.endDate = this.createDate[1]
  3444. }
  3445. if(this.sortOrder){
  3446. if(this.sortProp == 'inchargerName'){
  3447. parameter.sortProp = "incharger_id"
  3448. }else if(this.sortProp == 'customerName'){
  3449. parameter.sortProp = "customer_id"
  3450. }else if(this.sortProp == 'projectCode'){
  3451. parameter.sortProp = 'project_code'
  3452. }else if(this.sortProp == 'categoryName'){
  3453. parameter.sortProp = 'category'
  3454. }else if(this.sortProp == 'projectName'){
  3455. parameter.sortProp = 'project_name'
  3456. }else if(this.sortProp == 'status'){
  3457. parameter.sortProp = 'status'
  3458. }else if(this.sortProp == 'currentStage'){
  3459. parameter.sortProp = 'current_stage_name'
  3460. }else if(this.sortProp == 'departmentName'){
  3461. parameter.sortProp = 'dept_id'
  3462. }else if(this.sortProp == 'associateDegreeNames'){
  3463. parameter.sortProp = 'associate_degrees'
  3464. }
  3465. if(this.sortOrder == 'descending'){
  3466. parameter.sortOrder = 0
  3467. }else if(this.sortOrder == 'ascending'){
  3468. parameter.sortOrder = 1
  3469. }
  3470. }
  3471. if(this.deptId.length > 0) {
  3472. parameter.deptId = this.deptId[this.deptId.length - 1]
  3473. } else {
  3474. parameter.deptId = ''
  3475. }
  3476. this.http.post(this.port.project.listPage, parameter,
  3477. res => {
  3478. this.listLoading = false;
  3479. if (res.code == "ok") {
  3480. var list = res.data.records;
  3481. for(var i in list) {
  3482. var participator = list[i].participator , str = "";
  3483. for(var j in participator) {
  3484. if(j == participator.length-1) {
  3485. str += participator[j].name
  3486. } else {
  3487. str += participator[j].name + ','
  3488. }
  3489. }
  3490. list[i].userNames = str;
  3491. }
  3492. this.centerNameDegree = res.data.degrees
  3493. this.showColumnWidth = this.showColumn(list)
  3494. this.list = list;
  3495. this.total = res.data.total;
  3496. // this.$nextTick(()=>{
  3497. // this.$refs.projectlistOfWudulist.doLayout();
  3498. // })
  3499. this.listHeader = res.data.nameList
  3500. } else {
  3501. this.$message({
  3502. message: res.msg,
  3503. type: "error"
  3504. });
  3505. }
  3506. },
  3507. error => {
  3508. this.listLoading = false;
  3509. this.$message({
  3510. message: error,
  3511. type: "error"
  3512. });
  3513. });
  3514. },
  3515. showColumn(list){
  3516. if(!this.permissions.projectManagement){
  3517. let creat = false
  3518. let incha = false
  3519. for(let i in list){
  3520. if(this.user.id == list[i].creatorId){
  3521. creat = true
  3522. }
  3523. if(this.user.id == list[i].inchargerId){
  3524. incha = true
  3525. }
  3526. }
  3527. if(creat){
  3528. return '300'
  3529. }else {
  3530. if(incha){
  3531. return '210'
  3532. } else if (this.permissions.projectParticipator) {//编辑参与人权限
  3533. return '110'
  3534. } else {
  3535. return '0'
  3536. }
  3537. }
  3538. }else {
  3539. return '300'
  3540. }
  3541. },
  3542. // 合同金额发生改变,需弹出修改原因的输入框
  3543. contractAmountChange(value){
  3544. if(this.contractAmountOld != value){
  3545. this.contractAmountReasonShow = true
  3546. }else{
  3547. this.contractAmountReasonShow = false
  3548. this.addForm.changeContractReason = ''
  3549. }
  3550. },
  3551. //显示新增界面
  3552. handleAdd(i, item) {
  3553. this.canOnlyModParticipator = false;
  3554. this.contractAmountReasonShow = false
  3555. if(i == -1) {
  3556. this.title = this.$t('newproject');
  3557. this.addForm = {
  3558. name: '',
  3559. isPublic:0,
  3560. userId: [],
  3561. userNames:'',
  3562. code:'',
  3563. inchargerId:null,
  3564. level: this.user.timeType.projectLevelState == 1 ? (this.levelList.length > 0 ? this.levelList[0].id : null) : 1,
  3565. customerId:null,
  3566. notifyUserNames:'',
  3567. chosenLeaders:[],
  3568. category:null,
  3569. creatorId: this.user.id,
  3570. projectMainId: '',
  3571. outputValue: '',
  3572. bu: []
  3573. // deptId: []
  3574. }
  3575. if(this.user.timeType.projectWithDept) {
  3576. this.$set(this.addForm, 'deptId', [])
  3577. }
  3578. if(this.user.companyId == '936') {
  3579. this.$set(this.addForm, 'contractCode', '')
  3580. this.$set(this.addForm, 'warrantyStartDate', '')
  3581. this.$set(this.addForm, 'warrantyEndDate', '')
  3582. this.$set(this.addForm, 'projectCategorySub', '')
  3583. this.$set(this.addForm, 'region', '')
  3584. this.$set(this.addForm, 'bu', '')
  3585. }
  3586. // if(this.user.companyId == '428') {
  3587. // this.$set(this.addForm, 'projectCategorySub', '')
  3588. // }
  3589. this.projectBaseCostData = [];
  3590. this.auseList = [];
  3591. for (var m=0;m<this.baseCostItemList.length; m++) {
  3592. this.projectBaseCostData.push({baseId: this.baseCostItemList[m].id, baseName:this.baseCostItemList[m].name, baseAmount:0});
  3593. }
  3594. // 关键节点
  3595. if(this.user.companyId == '936') {
  3596. this.projectKeyNodesData = []
  3597. for (var m=0;m<this.keyNodesList.length; m++) {
  3598. this.projectKeyNodesData.push({nodesId: this.keyNodesList[m].id, nodesName:this.keyNodesList[m].name, planCompleteDate: null, actualCompleteDate: null, states: '0'});
  3599. }
  3600. // console.log(this.projectKeyNodesData, '节点值')
  3601. }
  3602. } else {
  3603. //编辑时,非 (管理全部项目,项目创建人,项目经理),有编辑项目参与人权限的人,可以进行参与人的修改
  3604. if (!(this.permissions.projectManagement || this.user.id==item.inchargerId || this.user.id == item.creatorId) && this.permissions.projectParticipator) {
  3605. this.canOnlyModParticipator = true;
  3606. }
  3607. this.title = this.$t('modifytheproject');
  3608. var list = item.participator;
  3609. if (item.isPublic == 1) {
  3610. list = this.users;
  3611. }
  3612. var arr = [];
  3613. var names = '';
  3614. let namesLiss = [] // 企业微信用到的参与者
  3615. for(var j in list) {
  3616. arr.push(list[j].id)
  3617. names += list[j].name+',';
  3618. namesLiss.push(list[j].name)
  3619. }
  3620. if (names.length > 0) {
  3621. names = names.substring(0, names.length -1);
  3622. }
  3623. this.addFormUserNames = namesLiss
  3624. var listList = JSON.parse(JSON.stringify(item)),
  3625. arrList = [],
  3626. array = [];
  3627. if (listList.deptCascade != "0" && listList.deptCascade != null) {
  3628. if (listList.deptCascade.indexOf(",") > -1) {
  3629. arrList = listList.deptCascade.split(",");
  3630. } else {
  3631. arrList = [].concat(listList.deptCascade);
  3632. }
  3633. }
  3634. for (var i in arrList) {
  3635. array.push(parseInt(arrList[i]));
  3636. }
  3637. let buascaderList = []
  3638. if(item.buId) {
  3639. let buArrList = item.buId.split(',')
  3640. for(var i in buArrList) {
  3641. buArrList[i] = +buArrList[i]
  3642. }
  3643. buascaderList = buArrList
  3644. }
  3645. // console.log(array, '转换', listList)
  3646. this.addForm = {
  3647. id: item.id,
  3648. name: item.projectName,
  3649. isPublic: item.isPublic,
  3650. userId: arr,
  3651. userNames:names,
  3652. code:item.projectCode,
  3653. inchargerId: item.inchargerId,
  3654. level: item.level,
  3655. planStartDate: item.planStartDate,
  3656. planEndDate: item.planEndDate,
  3657. budget: item.budget,
  3658. baseMan: item.baseMan,
  3659. contractAmount: item.contractAmount,
  3660. baseFee: item.baseFee,
  3661. baseRisk1: item.baseRisk1,
  3662. baseRisk2: item.baseRisk2,
  3663. baseOutsourcing: item.baseOutsourcing,
  3664. customerId:item.customerId==0?null:item.customerId,
  3665. category:item.category,
  3666. projectDesc: item.projectDesc,
  3667. projectMainId: item.projectMainId,
  3668. creatorId: item.creatorId,
  3669. outputValue: item.outputValue,
  3670. // deptId: array.reverse(),
  3671. changeContractReason: '',
  3672. bu: buascaderList
  3673. }
  3674. this.contractAmountOld = item.contractAmount ? item.contractAmount : 0
  3675. // console.log(this.addForm, '数据')
  3676. if(this.user.timeType.projectWithDept) {
  3677. this.$set(this.addForm, 'deptId', array.reverse())
  3678. }
  3679. // 判断公司id是否等于936
  3680. if(this.user.companyId == '936') {
  3681. if(item.projectSeparate) {
  3682. this.$set(this.addForm, 'contractCode', item.projectSeparate.contractCode)
  3683. this.$set(this.addForm, 'warrantyStartDate', item.projectSeparate.warrantyStartDate)
  3684. this.$set(this.addForm, 'warrantyEndDate', item.projectSeparate.warrantyEndDate)
  3685. this.$set(this.addForm, 'projectCategorySub', item.projectSeparate.projectCategorySub)
  3686. this.$set(this.addForm, 'region', item.projectSeparate.region)
  3687. this.$set(this.addForm, 'bu', item.projectSeparate.bu)
  3688. } else {
  3689. this.$set(this.addForm, 'contractCode', '')
  3690. this.$set(this.addForm, 'warrantyStartDate', '')
  3691. this.$set(this.addForm, 'warrantyEndDate', '')
  3692. this.$set(this.addForm, 'projectCategorySub', '')
  3693. this.$set(this.addForm, 'region', '')
  3694. this.$set(this.addForm, 'bu', '')
  3695. }
  3696. }
  3697. // if(this.user.companyId == '428') {
  3698. // if(item.projectSeparate) {
  3699. // this.$set(this.addForm, 'projectCategorySub', item.projectSeparate.projectCategorySub)
  3700. // } else {
  3701. // this.$set(this.addForm, 'projectCategorySub', '')
  3702. // }
  3703. // }
  3704. // 判断是否有供应商
  3705. if(this.user.company.packageProvider) {
  3706. // this.addForm.supplierId = item.providerIds.split(',')
  3707. if(item.providerIds) {
  3708. let arr = []
  3709. let zhhi = item.providerIds.split(',')
  3710. for(let i in zhhi) {
  3711. arr.push(+zhhi[i] + 0)
  3712. }
  3713. this.$set(this.addForm, 'supplierId', arr)
  3714. // console.log( this.addForm.supplierId)
  3715. } else {
  3716. this.$set(this.addForm, 'supplierId', [])
  3717. }
  3718. }
  3719. // 判断是否有供应商结尾
  3720. this.deleteVif = item.creatorId
  3721. // console.log("handleadd",this.deleteVif,this.addForm)
  3722. if(item.associateDegrees != null && item.associateDegrees != 'null' && item.associateDegrees != '') {
  3723. var spli = item.associateDegrees.split(',')
  3724. var sl = []
  3725. for(var i in spli) {
  3726. var num = +spli[i] + 0
  3727. sl.push(num)
  3728. }
  3729. this.auseList = sl
  3730. // console.log(this.auseList)
  3731. } else {
  3732. this.auseList = []
  3733. }
  3734. // var spli = item.associateDegrees.split(',')
  3735. // var sl = []
  3736. // for(var i in spli) {
  3737. // var num = +spli[i] + 0
  3738. // sl.push(num)
  3739. // }
  3740. // this.auseList = sl
  3741. // console.log(this.auseList)
  3742. this.changeParticipator();
  3743. this.getProjectBaseData(item.id);
  3744. this.getProjectKeyNodeData(item.id)
  3745. if (this.user.company.packageEngineering == 1) {
  3746. this.getProjectProfessions(item.id);
  3747. }
  3748. //获取项目的相关领导
  3749. // this.getProjectNotifyUserList(item.id);
  3750. this.getProjectAutorList(item.id);
  3751. // this.findUserInTree()
  3752. }
  3753. this.addFormVisible = true;
  3754. if (this.user.company.packageEngineering == 1) {
  3755. if (this.professionList.length == 0) {
  3756. this.getProfessionList();
  3757. }
  3758. }
  3759. },
  3760. //获取项目审核人
  3761. getProjectAutorList(projectId) {
  3762. this.http.post('/project-auditor/getList',{projectId: projectId},
  3763. res => {
  3764. if (res.code == "ok") {
  3765. this.addForm.auditUserIds = res.data.map(function(item) {
  3766. return item.auditorId;
  3767. });
  3768. this.$forceUpdate()
  3769. } else {
  3770. this.$message({
  3771. message: res.msg,
  3772. type: "error"
  3773. });
  3774. }
  3775. },
  3776. error => {
  3777. this.listLoading = false;
  3778. this.$message({
  3779. message: error,
  3780. type: "error"
  3781. });
  3782. }
  3783. );
  3784. },
  3785. getProjectBaseData(projectId) {
  3786. this.http.post('/project-basecost/get',{projectId: projectId},
  3787. res => {
  3788. if (res.code == "ok") {
  3789. this.projectBaseCostData = res.data;
  3790. } else {
  3791. this.$message({
  3792. message: res.msg,
  3793. type: "error"
  3794. });
  3795. }
  3796. },
  3797. error => {
  3798. this.listLoading = false;
  3799. this.$message({
  3800. message: error,
  3801. type: "error"
  3802. });
  3803. }
  3804. );
  3805. },
  3806. getProjectKeyNodeData(projectId) {
  3807. this.http.post('/project-key-nodes/get',{projectId: projectId},
  3808. res => {
  3809. if (res.code == "ok") {
  3810. this.projectKeyNodesData = res.data;
  3811. } else {
  3812. this.$message({
  3813. message: res.msg,
  3814. type: "error"
  3815. });
  3816. }
  3817. },
  3818. error => {
  3819. this.listLoading = false;
  3820. this.$message({
  3821. message: error,
  3822. type: "error"
  3823. });
  3824. }
  3825. );
  3826. },
  3827. //提交子项目创建修改请求
  3828. submitInsertSubProject () {
  3829. this.$refs.form2.validate(valid => {
  3830. if (valid) {
  3831. this.http.post('/sub-project/saveOrUpdate',this.temaddForm,
  3832. res => {
  3833. if (res.code == "ok") {
  3834. this.$message({
  3835. message: this.$t('operationissuccessful'),
  3836. type: "success"
  3837. });
  3838. this.subProject(this.currentProject);
  3839. this.addSubProject = false;
  3840. } else {
  3841. this.$message({
  3842. message: res.msg,
  3843. type: "error"
  3844. });
  3845. }
  3846. },
  3847. error => {
  3848. this.listLoading = false;
  3849. this.$message({
  3850. message: error,
  3851. type: "error"
  3852. });
  3853. }
  3854. );
  3855. }
  3856. });
  3857. },
  3858. // 项目基线合计
  3859. addUpfun() {
  3860. var total = 0;
  3861. for (var i=0;i<this.projectBaseCostData.length; i++) {
  3862. total += parseFloat(this.projectBaseCostData[i].baseAmount);
  3863. }
  3864. this.addForm.budget = total;
  3865. // var a = '0'
  3866. // var q = '0'
  3867. // var w = '0'
  3868. // var e = '0'
  3869. // var r = '0'
  3870. // // this.addForm.baseMan === undefined || this.addForm.baseMan === NaN ? this.addForm.baseMa = '0' : this.addForm.baseMan
  3871. // if (this.addForm.baseMan == undefined || this.addForm.baseMan == NaN) {
  3872. // a = 0
  3873. // } else {
  3874. // a = this.addForm.baseMan
  3875. // }
  3876. // if (this.addForm.baseFee !== undefined) q = this.addForm.baseFee
  3877. // if (this.addForm.baseOutsourcing !== undefined) w = this.addForm.baseOutsourcing
  3878. // if (this.addForm.baseRisk1 !== undefined) e = this.addForm.baseRisk1
  3879. // if (this.addForm.baseRisk2 !== undefined) r = this.addForm.baseRisk2
  3880. // this.addForm.budget = +a + +q + +w + +e + +r
  3881. },
  3882. submitInsert() {
  3883. this.$refs.form1.validate(valid => {
  3884. if (valid) {
  3885. if (this.user.company.packageEngineering == 1) {
  3886. if (!this.checkProjectProfession()) {//检查不通过,直接返回
  3887. return;
  3888. }
  3889. }
  3890. this.addLoading = true;
  3891. let formData = new FormData();
  3892. formData.append("name", this.addForm.name);
  3893. if(this.addForm.projectDesc != null) {
  3894. formData.append("projectDesc", this.addForm.projectDesc);
  3895. }
  3896. if(this.addForm.id != null) {
  3897. formData.append("id", this.addForm.id);
  3898. }
  3899. if(this.addForm.isPublic != null) {
  3900. formData.append("isPublic", this.addForm.isPublic);
  3901. }
  3902. if(this.addForm.userId.length != 0 && this.addForm.isPublic == 0) {
  3903. for(var j in this.addForm.userId) {
  3904. formData.append("userId", this.addForm.userId[j]);
  3905. }
  3906. }
  3907. if(this.addForm.inchargerId != null) {
  3908. formData.append("inchargerId", this.addForm.inchargerId);
  3909. }
  3910. if(this.addForm.code != null) {
  3911. formData.append("code", this.addForm.code);
  3912. }
  3913. if(this.addForm.planStartDate != null) {
  3914. formData.append("planStartDate", this.addForm.planStartDate);
  3915. }
  3916. if(this.addForm.planEndDate != null) {
  3917. formData.append("planEndDate", this.addForm.planEndDate);
  3918. }
  3919. if(this.addForm.level != null) {
  3920. formData.append("level", this.addForm.level);
  3921. }
  3922. if(this.addForm.contractAmount != null) {
  3923. formData.append("contractAmount", this.addForm.contractAmount);
  3924. }
  3925. if(this.contractAmountReasonShow){
  3926. formData.append("changeContractReason", this.addForm.changeContractReason);
  3927. }
  3928. if (this.projectBaseCostData != null) {
  3929. formData.append("projectBaseCostData", JSON.stringify(this.projectBaseCostData));
  3930. //计算总预算成本
  3931. if (this.addForm.budget == null) {
  3932. this.addForm.budget = 0;
  3933. }
  3934. formData.append("budget", this.addForm.budget);
  3935. }
  3936. if (this.addForm.customerId == null) {
  3937. formData.append("customerId", 0);
  3938. } else {
  3939. formData.append("customerId", this.addForm.customerId);
  3940. }
  3941. if (this.addForm.contractAmount) {
  3942. formData.append("contractAmount", this.addForm.contractAmount);
  3943. } else {
  3944. formData.append("contractAmount", 0);
  3945. }
  3946. if (this.chosenLeaders != null && this.chosenLeaders.length > 0) {
  3947. formData.append("chosenLeaders", JSON.stringify(this.chosenLeaders));
  3948. }
  3949. if (this.user.timeType.outputValueStatus == 1){
  3950. formData.append("outputValue",this.addForm.outputValue ? this.addForm.outputValue : 0)
  3951. }
  3952. var listId = []
  3953. var listName = []
  3954. for(var i in this.auseList) {
  3955. for(var j in this.ause) {
  3956. if(this.auseList[i] == this.ause[j].id) {
  3957. listId.push(this.ause[j].id);
  3958. listName.push(this.ause[j].name);
  3959. break;
  3960. }
  3961. }
  3962. }
  3963. listId.toString()
  3964. listName.toString()
  3965. formData.append("associateDegrees", listId)
  3966. formData.append("associateDegreeNames", listName)
  3967. //日报审核人
  3968. if (this.addForm.auditUserIds) {
  3969. formData.append("auditUserIds", JSON.stringify(this.addForm.auditUserIds));
  3970. }
  3971. if(this.addForm.category != null) {
  3972. formData.append("category", this.addForm.category);
  3973. }
  3974. if(this.user.timeType.mainProjectState == '1' && this.addForm.projectMainId) {
  3975. formData.append("projectMainId", this.addForm.projectMainId);
  3976. }
  3977. // 提交供应商
  3978. // 线判断是否有供应商
  3979. if(this.user.company.packageProvider) {
  3980. let suppStrName = []
  3981. for(let is in this.addForm.supplierId) {
  3982. for(let js in this.supplierList) {
  3983. if(this.addForm.supplierId[is] == this.supplierList[js].id) {
  3984. suppStrName.push(this.supplierList[js].providerName)
  3985. }
  3986. }
  3987. }
  3988. formData.append("providerNames", suppStrName.toString());
  3989. formData.append("providerIds", this.addForm.supplierId.toString());
  3990. }
  3991. // 判断公司id是否等于 936
  3992. if(this.user.companyId == '936') {
  3993. formData.append("contractCode", this.addForm.contractCode ? this.addForm.contractCode : '');
  3994. formData.append("warrantyStartDate", this.addForm.warrantyStartDate ? this.addForm.warrantyStartDate : '');
  3995. formData.append("warrantyEndDate", this.addForm.warrantyEndDate ? this.addForm.warrantyEndDate : '');
  3996. formData.append("projectCategorySub", this.addForm.projectCategorySub ? this.addForm.projectCategorySub : '');
  3997. formData.append("region", this.addForm.region ? this.addForm.region : '');
  3998. // 关键节点
  3999. formData.append("projectKeyNodesData", JSON.stringify(this.projectKeyNodesData));
  4000. }
  4001. // if(this.user.companyId == '428') {
  4002. // formData.append("projectCategorySub", this.addForm.projectCategorySub ? this.addForm.projectCategorySub : '');
  4003. // }
  4004. if(this.user.timeType.projectWithDept) {
  4005. if(this.addForm.deptId != null && this.addForm.deptId != '') {
  4006. formData.append("deptId", this.addForm.deptId[this.addForm.deptId.length - 1])
  4007. }
  4008. }
  4009. formData.append("buId", this.addForm.bu ? this.addForm.bu : '');
  4010. // formData.append("associateDegreeNames", listName)
  4011. //console.log("addform",this.addForm);
  4012. //return
  4013. this.http.uploadFile(this.port.project.add,formData,
  4014. res => {
  4015. this.addLoading = false;
  4016. if (res.code == "ok") {
  4017. this.$message({
  4018. message: (this.addForm.id!=null?this.$t('xiu-gai'):this.$t('create'))+this.$t('other.successful'),
  4019. type: "success"
  4020. });
  4021. this.addFormVisible = false;
  4022. this.getList();
  4023. if (this.user.company.packageEngineering == 1) {
  4024. this.saveProjectProfessions(res.data);
  4025. }
  4026. } else {
  4027. this.$message({
  4028. message: res.msg,
  4029. type: "error"
  4030. });
  4031. }
  4032. },
  4033. error => {
  4034. this.addLoading = false;
  4035. this.$message({
  4036. message: error,
  4037. type: "error"
  4038. });
  4039. });
  4040. }
  4041. });
  4042. },
  4043. cascaderChange(e) {
  4044. // console.log(e)
  4045. // console.log(this.addForm)
  4046. // if(e.length )
  4047. // console.log(e)
  4048. },
  4049. // 删除
  4050. deletePro(i, item) {
  4051. this.$confirm(this.$t('makesuretodeletetheitem')+"[" + item.name + "]"+this.$t('ma'),this.$t('deletetheproject'), {
  4052. confirmButtonText: this.$t('btn.determine'),
  4053. cancelButtonText: this.$t('btn.cancel'),
  4054. type: "warning"
  4055. })
  4056. .then(() => {
  4057. this.listLoading = true;
  4058. this.http.post(this.port.project.delete,{
  4059. id: item.id
  4060. },
  4061. res => {
  4062. this.listLoading = false;
  4063. if (res.code == "ok") {
  4064. this.$message({
  4065. message: this.$t('message.successfullyDeleted'),
  4066. type: "success"
  4067. });
  4068. this.getList();
  4069. this.addFormVisible = false
  4070. } else if (res.code == 'reconfirm') {
  4071. this.deleteAlertMsg = res.msg;
  4072. this.forceDeletePro(item.id);
  4073. } else {
  4074. this.$message({
  4075. message: res.msg,
  4076. type: "error"
  4077. });
  4078. }
  4079. },
  4080. error => {
  4081. this.listLoading = false;
  4082. this.$message({
  4083. message: error,
  4084. type: "error"
  4085. });
  4086. }
  4087. );
  4088. })
  4089. .catch(() => {});
  4090. },
  4091. // 模板下载
  4092. downloadmb(){
  4093. this.http.post('/project/getTemplate',{
  4094. companyId: this.user.companyId
  4095. },res => {
  4096. if(res.code == 'ok'){
  4097. var filePath = res.data;
  4098. const a = document.createElement('a'); // 创建a标签
  4099. var fileName = filePath.split('/')[2];
  4100. a.setAttribute('download', fileName);// download属性
  4101. a.setAttribute('href', filePath);// href链接
  4102. a.click(); //自执行点击事件
  4103. a.remove();
  4104. }else{
  4105. this.$message({
  4106. message: res.msg,
  4107. type: 'error'
  4108. })
  4109. }
  4110. },err => {
  4111. this.$message({
  4112. message: err,
  4113. type: 'error'
  4114. })
  4115. })
  4116. },
  4117. //强制删除项目
  4118. forceDeletePro(deleteProId) {
  4119. this.$confirm(this.deleteAlertMsg,this.$t('deletetheproject'), {
  4120. confirmButtonText: this.$t('btn.determine'),
  4121. cancelButtonText: this.$t('btn.cancel'),
  4122. type: "warning"
  4123. })
  4124. .then(() => {
  4125. this.listLoading = true;
  4126. this.http.post(this.port.project.delete,{
  4127. id: deleteProId ,force:1
  4128. },
  4129. res => {
  4130. this.listLoading = false;
  4131. if (res.code == "ok") {
  4132. this.$message({
  4133. message: this.$t('message.successfullyDeleted'),
  4134. type: "success"
  4135. });
  4136. this.getList();
  4137. this.addFormVisible = false;
  4138. } else {
  4139. this.$message({
  4140. message: res.msg,
  4141. type: "error"
  4142. });
  4143. }
  4144. },
  4145. error => {
  4146. this.listLoading = false;
  4147. this.$message({
  4148. message: error,
  4149. type: "error"
  4150. });
  4151. }
  4152. );
  4153. })
  4154. .catch(() => {});
  4155. },
  4156. detail(i) {
  4157. this.$router.push("/list/" + this.list[i].id + "/" + this.list[i].projectName);
  4158. },
  4159. // 获取部门
  4160. getDepartmentList() {
  4161. this.http.post( this.port.manage.depList, {},
  4162. res => {
  4163. if (res.code == "ok") {
  4164. let dptlist = JSON.parse(JSON.stringify(res.data));
  4165. this.departmentList = this.changeArr(dptlist);
  4166. } else {
  4167. this.$message({
  4168. message: res.msg,
  4169. type: "error"
  4170. });
  4171. }
  4172. },error => {
  4173. this.$message({
  4174. message: error,
  4175. type: "error"
  4176. });
  4177. });
  4178. },
  4179. changeArr(arr) {
  4180. for (var i = 0; i < arr.length; i++) {
  4181. if(arr[i].id != -1 && arr[i].id != 0) {
  4182. if (arr[i].children != null && arr[i].children.length>0) {
  4183. arr[i].children = this.changeArr(arr[i].children);
  4184. }
  4185. arr[i].id && (arr[i].value = arr[i].id);
  4186. delete arr[i].id;
  4187. }
  4188. }
  4189. for(var i in arr) {
  4190. if(arr[i].id == -1 || arr[i].id == 0) {
  4191. arr.splice(i,1)
  4192. }
  4193. }
  4194. return arr;
  4195. },
  4196. // 自定义组件事件
  4197. selectCal(obj) {
  4198. if(obj.distinction == '1') {
  4199. this.inchagerId = obj.id
  4200. this.manageSelect()
  4201. } else if(obj.distinction == '2') {
  4202. this.participationId = obj.id
  4203. this.participationSelect()
  4204. } else if(obj.distinction == '3') {
  4205. this.addForm.inchargerId = obj.id
  4206. // console.log(this.participator)
  4207. this.participator = JSON.parse(JSON.stringify(this.participator))
  4208. } else if(obj.distinction =='4') {
  4209. this.projectProfessionList[obj.other].inchargerId = obj.id
  4210. } else if(obj.distinction =='5') {
  4211. this.paramInchargerId = obj.id
  4212. } else if(obj.distinction == '10') {
  4213. let userList = obj.arrUserList
  4214. let arr = []
  4215. for(var i in userList) {
  4216. arr.push(userList[i].id)
  4217. }
  4218. this.addForm.auditUserIds = arr
  4219. } else if(obj.distinction == '11') {
  4220. let userList = obj.id
  4221. console.log(obj)
  4222. this.curProfessionRow.membList[obj.other].membId = userList
  4223. }
  4224. },
  4225. vueCasader(obj) {
  4226. if(obj.distinction == '32') {
  4227. let arr = []
  4228. arr.push(obj.id)
  4229. this.addForm.bu = arr.join(",")
  4230. }
  4231. }
  4232. },
  4233. created() {
  4234. let height = window.innerHeight;
  4235. this.tableHeight = height - 225;
  4236. const that = this;
  4237. window.onresize = function temp() {
  4238. that.tableHeight = window.innerHeight - 195;
  4239. };
  4240. },
  4241. mounted() {
  4242. this.userssHu()
  4243. this.getDepartment();
  4244. this.getDepartment2();
  4245. this.getList();
  4246. this.getUsers();
  4247. this.getCustomerList();
  4248. this.getProjectBaseConfigList();
  4249. this.getClfConfigList()
  4250. this.yanjiuzx()
  4251. // 判断是否有供应商字段
  4252. if(this.user.company.packageProvider == 1){
  4253. this.getSupplierList()
  4254. // this.getPhase()
  4255. }
  4256. if(this.user.company.packageProject == 1) {
  4257. this.obtainPhase()
  4258. }
  4259. // this.getSupplierList()
  4260. if(this.user.timeType.mainProjectState == 1){
  4261. this.getMainProject()
  4262. }
  4263. if(this.user.timeType.projectLevelState == 1){
  4264. this.getProjectLevel()
  4265. }
  4266. // 判断释放为专业版
  4267. if(this.user.company.packageProject == 1) {
  4268. this.importanceList = [{id:1,label:this.$t('zheng-chang')},{id:5,label:this.$t('di-feng-xian')},{id:6,label:this.$t('zhong-feng-xian')},{id:7,label:this.$t('gao-feng-xian')},{id:2,label:this.$t('jin-ji')},{id:3,label:this.$t('zhong-yao')},{id:4,label:this.$t('zhong-yao-qie-jin-ji')}]
  4269. } else {
  4270. this.importanceList = [{id:1,label:this.$t('zheng-chang')},{id:2,label:this.$t('jin-ji')},{id:3,label:this.$t('zhong-yao')},{id:4,label:this.$t('zhong-yao-qie-jin-ji')}]
  4271. }
  4272. // 获取部门
  4273. if(this.user.timeType.projectWithDept) {
  4274. this.getDepartmentList()
  4275. }
  4276. if(this.user.companyId == '936') {
  4277. this.getkeyNodes()
  4278. }
  4279. }
  4280. };
  4281. </script>
  4282. <style lang="scss" scoped>
  4283. .rg_span{
  4284. display: inline-block;
  4285. }
  4286. .rg_span span {
  4287. text-align: right;
  4288. box-sizing: border-box;
  4289. padding-right: 10px;
  4290. }
  4291. .el-dialog__title {
  4292. display: inline-table;
  4293. margin-top: 20px;
  4294. }
  4295. .addss {
  4296. width: 100%;
  4297. overflow: hidden;
  4298. white-space: nowrap;
  4299. text-overflow: ellipsis;
  4300. }
  4301. .keyNodes {
  4302. display: flex;
  4303. width: 100%;
  4304. box-sizing: border-box;
  4305. padding: 10px 30px;
  4306. }
  4307. .keyNodes .keyNodesTime {
  4308. width: 190px;
  4309. display: flex;
  4310. justify-content: center;
  4311. }
  4312. .keyNodes .keyNodesName {
  4313. width: 260px;
  4314. display: flex;
  4315. align-items: center;
  4316. overflow: hidden;
  4317. text-overflow: ellipsis;
  4318. }
  4319. // 111
  4320. </style>
  4321. <style>
  4322. .managePopperClass{
  4323. width: 190px;
  4324. }
  4325. .el-dropdown-link {
  4326. color: #409EFF;
  4327. }
  4328. .customdropdown{
  4329. margin-left: 10px;
  4330. }
  4331. .customdropdown .el-dropdown__caret-button{
  4332. height: 27px;
  4333. }
  4334. .customdropdown .el-button--mini:nth-child(1){
  4335. height: 27px;
  4336. }
  4337. .customdropdown_menu{
  4338. padding: 0;
  4339. }
  4340. .customdropdown_menu_btn{
  4341. border-color: transparent;
  4342. }
  4343. .ganttdialog .el-dialog__body{
  4344. height: 550px;
  4345. }
  4346. .toolbar_formitem_n1{
  4347. margin-right: 0 !important;
  4348. }
  4349. .wpgCssClass .el-form-item__label{
  4350. font-weight: 600;
  4351. }
  4352. .gongcheng .el-table .cell{
  4353. overflow: inherit !important;
  4354. }
  4355. </style>