list.vue 157 KB

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