list.vue 141 KB

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