list.vue 162 KB

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