list.vue 189 KB

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