list.vue 188 KB

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