list.vue 142 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059
  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-mouse-enter="hoverCall" @cell-mouse-leave="handCall" @cell-click="clickCell" :cell-class-name="tableCellClassName" :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;" @selection-change="checkedWudulist" @sort-change="tableSort">
  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="currentStage" 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 && rowid == scope.row.id" 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">
  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. rowid: ''
  908. };
  909. },
  910. // 过滤器
  911. filters: {
  912. numberToCurrency(value) {
  913. if (!value) return '0.00'
  914. // 将数值截取,保留两位小数
  915. value = value.toFixed(2)
  916. // 获取整数部分
  917. const intPart = Math.trunc(value)
  918. // 整数部分处理,增加,
  919. const intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
  920. // 预定义小数部分
  921. let floatPart = '.00'
  922. // 将数值截取为小数部分和整数部分
  923. const valueArray = value.toString().split('.')
  924. if (valueArray.length === 2) { // 有小数部分
  925. floatPart = valueArray[1].toString() // 取得小数部分
  926. return intPartFormat + '.' + floatPart
  927. }
  928. return intPartFormat + floatPart
  929. },
  930. mobans(value, valueList) {
  931. for(var i in valueList) {
  932. if(valueList[i].providerCateGoryName == value) {
  933. return valueList[i].providerInfoName
  934. }
  935. }
  936. },
  937. },
  938. watch: {
  939. filterText(val) {
  940. this.$refs.chooseMembTree.filter(val);
  941. },
  942. filterText2(val) {
  943. this.$refs.chooseMembTree2.filter(val);
  944. }
  945. },
  946. methods: {
  947. hoverCall(row) {
  948. this.rowid=row.id
  949. },
  950. handCall() {
  951. this.rowid = ''
  952. },
  953. // 获取阶段
  954. obtainPhase(item) {
  955. this.http.post('/stages/getProjectStages', {
  956. projectId: item.id
  957. },
  958. res => {
  959. if (res.code == "ok") {
  960. // this.phaseList = res.data
  961. this.$set(this, 'phaseList', res.data)
  962. } else {
  963. this.$message({
  964. message: res.msg,
  965. type: "error"
  966. });
  967. }
  968. },
  969. error => {
  970. this.$message({
  971. message: error,
  972. type: "error"
  973. });
  974. });
  975. },
  976. // 表格点击
  977. tableCellClassName({row, column, rowIndex, columnIndex}) {
  978. row.index=rowIndex;
  979. column.index=columnIndex;
  980. },
  981. clickCell(row,column) {
  982. console.log(this.permissions.projectManagement || this.user.id==row.inchargerId || this.user.id==row.creatorId)
  983. if(this.permissions.projectManagement || this.user.id==row.inchargerId || this.user.id==row.creatorId) {
  984. this.phaseProjectValie = row.currentStage ? row.currentStage : ''
  985. this.currentCell = row.index + ',' + column.index;
  986. if(column.index == 5) {
  987. this.phaseProjectId = row.id
  988. this.obtainPhase(row)
  989. }
  990. setTimeout(() => {
  991. // 获得焦点
  992. this.$refs[row.index + ',' + column.index].focus();
  993. })
  994. }
  995. },
  996. selectChange() {
  997. this.http.post('/project/changeCurrentStage', {
  998. projectId: this.phaseProjectId,
  999. currentStage: this.phaseProjectValie
  1000. },
  1001. res => {
  1002. if (res.code == "ok") {
  1003. this.getList()
  1004. } else {
  1005. this.$message({
  1006. message: res.msg,
  1007. type: "error"
  1008. });
  1009. }
  1010. },
  1011. error => {
  1012. this.$message({
  1013. message: error,
  1014. type: "error"
  1015. });
  1016. });
  1017. },
  1018. hideSelect() {
  1019. var that = this
  1020. setTimeout(() => {
  1021. that.currentCell = null
  1022. }, 500)
  1023. },
  1024. // 点击主项目事件
  1025. projectManagementChange() {
  1026. let categoryId = ''
  1027. for(var i in this.mainProjectList) {
  1028. if(this.mainProjectList[i].id == this.addForm.projectMainId) {
  1029. categoryId = this.mainProjectList[i].categoryId
  1030. }
  1031. }
  1032. categoryId == '' ? '' : this.addForm.category = categoryId
  1033. console.log(this.addForm)
  1034. },
  1035. tableSort({column, prop, order}){
  1036. if(prop == 'inchargerName' || prop == 'customerName' || prop == 'projectCode' || prop == 'categoryName' || prop == 'projectName' || prop == 'status' || prop == 'currentStage'){
  1037. this.sortOrder = order
  1038. this.sortProp = prop
  1039. this.getList()
  1040. }
  1041. },
  1042. //获取项目列表
  1043. getSupplierList() {
  1044. this.http.post('/provider-info/list', {
  1045. pageIndex: 1,
  1046. pageSize: 999,
  1047. keyword: ''
  1048. },
  1049. res => {
  1050. if (res.code == "ok") {
  1051. this.supplierList = res.data.records;
  1052. } else {
  1053. this.$message({
  1054. message: res.msg,
  1055. type: "error"
  1056. });
  1057. }
  1058. },
  1059. error => {
  1060. this.$message({
  1061. message: error,
  1062. type: "error"
  1063. });
  1064. });
  1065. },
  1066. addManPro(row) {
  1067. this.addFlgmainProjectDialog = true
  1068. if(!row) {
  1069. this.addMainForm = {
  1070. name: '',
  1071. id: '',
  1072. code: '',
  1073. categoryId: ''
  1074. }
  1075. } else {
  1076. this.addMainForm = {
  1077. id: row.id,
  1078. code: row.code,
  1079. name: row.name,
  1080. categoryId: row.categoryId,
  1081. }
  1082. }
  1083. },
  1084. // 获取主项目
  1085. getMainProject() {
  1086. this.http.post('/project-main/list',{},res => {
  1087. if(res.code == 'ok'){
  1088. this.mainProjectList = res.data
  1089. }else {
  1090. this.$message({
  1091. message: res.msg,
  1092. type: 'error'
  1093. })
  1094. }
  1095. },err => {
  1096. this.$message({
  1097. message: err,
  1098. type: 'error'
  1099. })
  1100. })
  1101. },
  1102. // 批量修改自定义维度
  1103. checkedWudulist(e){
  1104. console.log(e);
  1105. this.checkedProjectArr = e
  1106. },
  1107. batchSetWudulistBtn1(){
  1108. this.$refs.projectlistOfWudulist.clearSelection()
  1109. this.checkedWuduArr = [],
  1110. this.addGroupPersonData = {
  1111. group: null,
  1112. person: null,
  1113. personNames: ''
  1114. }
  1115. },
  1116. batchSetWudulistBtn2(e){
  1117. if(this.checkedProjectArr.length == 0){
  1118. this.$message('请选择项目')
  1119. return
  1120. }
  1121. this.checkoradd = e
  1122. this.checkedWuduDialog = true
  1123. },
  1124. batchSetWudulistBtn3(){
  1125. if(this.checkedWuduArr.length == 0){
  1126. this.$message('请选择' + this.user.timeType.customDegreeName)
  1127. return
  1128. }
  1129. let projectIds = []
  1130. for(let i=0; i<this.checkedProjectArr.length; i++){
  1131. projectIds.push(this.checkedProjectArr[i].id)
  1132. }
  1133. let degreeIds = []
  1134. let degreeNames = []
  1135. for(let s=0; s<this.checkedWuduArr.length; s++){
  1136. degreeIds.push(this.checkedWuduArr[s].id)
  1137. degreeNames.push(this.checkedWuduArr[s].name)
  1138. }
  1139. this.http.post('/project/saveBatchAccoDegrees',{
  1140. ids: JSON.stringify(projectIds),
  1141. associateDegrees: degreeIds.toString(),
  1142. associateDegreeNames: degreeNames.toString()
  1143. },res => {
  1144. if(res.code == 'ok'){
  1145. this.checkedWuduDialog = false
  1146. this.batchSetWudulistBtn1()
  1147. this.$message({
  1148. message: '设置成功',
  1149. type: 'success'
  1150. })
  1151. this.getList()
  1152. }else {
  1153. this.$message({
  1154. message: res.msg,
  1155. type: 'error'
  1156. })
  1157. }
  1158. },err => {
  1159. this.$message({
  1160. message: err,
  1161. type: 'error'
  1162. })
  1163. })
  1164. },
  1165. batchSetWudulistBtn4(){
  1166. if(this.checkedWuduArr.length == 0){
  1167. this.$message('请选择' + this.user.timeType.customDegreeName)
  1168. return
  1169. }
  1170. let projectIds = []
  1171. for(let i=0; i<this.checkedProjectArr.length; i++){
  1172. projectIds.push(this.checkedProjectArr[i].id)
  1173. }
  1174. let degreeIds = []
  1175. let degreeNames = []
  1176. for(let s=0; s<this.checkedWuduArr.length; s++){
  1177. degreeIds.push(this.checkedWuduArr[s].id)
  1178. degreeNames.push(this.checkedWuduArr[s].name)
  1179. }
  1180. this.http.post('/project/addBatchAccoDegrees',{
  1181. ids: JSON.stringify(projectIds),
  1182. associateDegrees: degreeIds.toString(),
  1183. associateDegreeNames: degreeNames.toString()
  1184. },res => {
  1185. if(res.code == 'ok'){
  1186. this.checkedWuduDialog = false
  1187. this.batchSetWudulistBtn1()
  1188. this.$message({
  1189. message: '添加成功',
  1190. type: 'success'
  1191. })
  1192. this.getList()
  1193. }else {
  1194. this.$message({
  1195. message: res.msg,
  1196. type: 'error'
  1197. })
  1198. }
  1199. },err => {
  1200. this.$message({
  1201. message: err,
  1202. type: 'error'
  1203. })
  1204. })
  1205. },
  1206. isSelectable(row,index){
  1207. if(row.creatorId == this.user.id || row.inchargerId == this.user.id || this.permissions.projectManagement){
  1208. return true
  1209. }else{
  1210. return false
  1211. }
  1212. },
  1213. test(row){
  1214. console.log(row);
  1215. },
  1216. // 批量添加分组参与人员
  1217. addGroupPerson(){
  1218. let proArr = []
  1219. if(this.checkedProjectArr.length == 0){
  1220. this.$message('请选择项目')
  1221. return
  1222. }
  1223. this.addGroupPersonBtnLoading = true
  1224. for(let i=0;i<this.checkedProjectArr.length;i++){
  1225. proArr.push(this.checkedProjectArr[i].id)
  1226. }
  1227. this.http.post('/project/getProjectsGroups',{
  1228. projectIdArray: JSON.stringify(proArr)
  1229. },res => {
  1230. if(res.code == 'ok'){
  1231. console.log('分组',res.data);
  1232. this.addGroupList = res.data
  1233. this.addGroupPersonBtnLoading = false
  1234. this.addGroupPersonDialog = true
  1235. }else {
  1236. this.$message({
  1237. message: res.msg,
  1238. type: 'error'
  1239. })
  1240. }
  1241. },err => {
  1242. this.$message({
  1243. message: err,
  1244. type: 'error'
  1245. })
  1246. })
  1247. },
  1248. addGroupPersonP(){
  1249. this.filterText2 = ''
  1250. this.addGroupPersonPdialog = true
  1251. },
  1252. addPersonCheck(){
  1253. var chosenList = this.$refs.chooseMembTree2.getCheckedNodes();
  1254. var list = chosenList.filter(item=>item.isUser == 1);
  1255. this.chosenMembCount = list.length;
  1256. console.log(list);
  1257. },
  1258. addPersonSure(){
  1259. this.addGroupPersonPdialog = false
  1260. let chosenList = this.$refs.chooseMembTree2.getCheckedNodes();
  1261. let list = chosenList.filter(item=>item.isUser == 1);
  1262. let listIDs = []
  1263. let listNames = ''
  1264. for(let i=0;i<list.length;i++){
  1265. listIDs.push(list[i].id)
  1266. listNames += list[i].label + ','
  1267. }
  1268. this.addGroupPersonData.person = listIDs
  1269. this.addGroupPersonData.personNames = listNames
  1270. },
  1271. addGroupPersonSure(){
  1272. if(this.addGroupPersonData.group.length == 0 || this.addGroupPersonData.person == null){
  1273. this.$message({
  1274. message: '请选择人员/分组',
  1275. type: 'warning'
  1276. })
  1277. return
  1278. }
  1279. let groupList = []
  1280. for(let i=0;i<this.addGroupPersonData.group.length;i++){
  1281. groupList = [...groupList,...this.addGroupPersonData.group[i]]
  1282. }
  1283. this.http.post('/project/batchAddMembToGroup',{
  1284. membIdArray: JSON.stringify(this.addGroupPersonData.person),
  1285. groupIds: JSON.stringify(groupList)
  1286. },res => {
  1287. if(res.code == 'ok'){
  1288. this.addGroupPersonDialog = false,
  1289. this.batchSetWudulistBtn1()
  1290. this.$message({
  1291. message: '添加成功',
  1292. type: 'success'
  1293. })
  1294. this.getList()
  1295. }else {
  1296. this.$message({
  1297. message: res.msg,
  1298. type: 'error'
  1299. })
  1300. }
  1301. },err => {
  1302. this.$message({
  1303. message: err,
  1304. type: 'error'
  1305. })
  1306. })
  1307. },
  1308. // 批量添加项目参与人
  1309. addProPreson(){
  1310. if(this.checkedProjectArr.length == 0){
  1311. this.$message('请选择项目')
  1312. return
  1313. }
  1314. this.addGroupPersonDialog = true
  1315. this.isAddGroupPerson = false
  1316. },
  1317. addProPersonSure(){
  1318. if(this.addGroupPersonData.person == null){
  1319. this.$message({
  1320. message: '请选择人员',
  1321. type: 'warning'
  1322. })
  1323. return
  1324. }
  1325. let proArr = []
  1326. for(let i=0;i<this.checkedProjectArr.length;i++){
  1327. proArr.push(this.checkedProjectArr[i].id)
  1328. // proArr += this.checkedProjectArr[i].id + ','
  1329. }
  1330. // proArr = proArr.substring(0,proArr.length - 1)
  1331. this.http.post('/project/batchSetParticipation',{
  1332. userIds: JSON.stringify(this.addGroupPersonData.person),
  1333. projectIdArray: JSON.stringify(proArr)
  1334. },res => {
  1335. if(res.code == 'ok'){
  1336. this.addGroupPersonDialog = false,
  1337. this.batchSetWudulistBtn1()
  1338. this.$message({
  1339. message: '添加成功',
  1340. type: 'success'
  1341. })
  1342. this.getList()
  1343. }else {
  1344. this.$message({
  1345. message: res.msg,
  1346. type: 'error'
  1347. })
  1348. }
  1349. },err => {
  1350. this.$message({
  1351. message: err,
  1352. type: 'error'
  1353. })
  1354. })
  1355. },
  1356. filterNode(value, data) {
  1357. if (!value) return true;
  1358. return data.label.indexOf(value) !== -1;
  1359. },
  1360. //重启项目
  1361. restartPro(row) {
  1362. this.http.post('/project/start',{id: row.id},
  1363. res => {
  1364. if (res.code == "ok") {
  1365. this.$message({
  1366. message: '重启成功',
  1367. type: "success"
  1368. });
  1369. row.status = 1;
  1370. } else {
  1371. this.$message({
  1372. message: res.msg,
  1373. type: "error"
  1374. });
  1375. }
  1376. },
  1377. error => {
  1378. this.$message({
  1379. message: error,
  1380. type: "error"
  1381. });
  1382. });
  1383. },
  1384. //撤销项目
  1385. cancelPro(row) {
  1386. this.http.post('/project/cancel',{id: row.id},
  1387. res => {
  1388. if (res.code == "ok") {
  1389. this.$message({
  1390. message: '撤销成功',
  1391. type: "success"
  1392. });
  1393. row.status = 3;
  1394. } else {
  1395. this.$message({
  1396. message: res.msg,
  1397. type: "error"
  1398. });
  1399. }
  1400. },
  1401. error => {
  1402. this.$message({
  1403. message: error,
  1404. type: "error"
  1405. });
  1406. });
  1407. },
  1408. // 暂停项目
  1409. suspendPro(row) {
  1410. this.http.post('/project/suspend',{id: row.id},
  1411. res => {
  1412. if (res.code == "ok") {
  1413. this.$message({
  1414. message: '暂停成功',
  1415. type: "success"
  1416. });
  1417. row.status = 4;
  1418. } else {
  1419. this.$message({
  1420. message: res.msg,
  1421. type: "error"
  1422. });
  1423. }
  1424. },
  1425. error => {
  1426. this.$message({
  1427. message: error,
  1428. type: "error"
  1429. });
  1430. });
  1431. },
  1432. //完成项目
  1433. finishPro(row) {
  1434. this.http.post('/project/finish',{id: row.id},
  1435. res => {
  1436. if (res.code == "ok") {
  1437. this.$message({
  1438. message: '项目完成',
  1439. type: "success"
  1440. });
  1441. row.status = 2;
  1442. } else {
  1443. this.$message({
  1444. message: res.msg,
  1445. type: "error"
  1446. });
  1447. }
  1448. },
  1449. error => {
  1450. this.$message({
  1451. message: error,
  1452. type: "error"
  1453. });
  1454. });
  1455. },
  1456. exportProjectData() {
  1457. //导出项目
  1458. this.http.post('/project/exportData',{},
  1459. res => {
  1460. if (res.code == "ok") {
  1461. var filePath = res.data;
  1462. const a = document.createElement('a'); // 创建a标签
  1463. a.setAttribute('download', '项目导出.xls');// download属性
  1464. a.setAttribute('href', filePath);// href链接
  1465. a.click(); //自执行点击事件
  1466. a.remove();
  1467. }
  1468. },
  1469. error => {
  1470. this.$message({
  1471. message: error,
  1472. type: "error"
  1473. });
  1474. }
  1475. );
  1476. },
  1477. userssHu() {
  1478. this.http.post('/time-type/getCompanyTimeSetting',{
  1479. companyId: this.user.companyId
  1480. },
  1481. res => {
  1482. if (res.code == "ok") {
  1483. this.yonghuUser = res.data
  1484. console.log(this.yonghuUser)
  1485. }
  1486. },
  1487. error => {
  1488. this.$message({
  1489. message: error,
  1490. type: "error"
  1491. });
  1492. }
  1493. );
  1494. },
  1495. yanjiuzx() {
  1496. this.http.post('/report-extra-degree/getAll ',{},
  1497. res => {
  1498. if (res.code == "ok") {
  1499. console.log(res, '过来的数据')
  1500. this.ause = res.data
  1501. } else {
  1502. this.$message({
  1503. message: res.msg,
  1504. type: "error"
  1505. });
  1506. }
  1507. },
  1508. error => {
  1509. this.$message({
  1510. message: error,
  1511. type: "error"
  1512. });
  1513. }
  1514. );
  1515. },
  1516. selectPublic() {
  1517. if (this.addForm.isPublic == 1) {
  1518. this.participator = this.users;
  1519. } else {
  1520. this.participator = [];
  1521. }
  1522. },
  1523. addPpMemb() {
  1524. //检查合计比例是否到达100%
  1525. let p = 0;
  1526. let hasNoMemb = false;
  1527. this.curProfessionRow.membList.forEach(m=>{
  1528. p += parseInt(m.percentage);
  1529. //检查人员是否选择
  1530. if (m.membId == null) {
  1531. hasNoMemb = true;
  1532. }
  1533. });
  1534. if (hasNoMemb) {
  1535. this.$message({
  1536. message: '专业人员不能为空',
  1537. type: "error"
  1538. });
  1539. return;
  1540. }
  1541. //检查人员不能重复
  1542. let hasDuplicate = false;
  1543. this.curProfessionRow.membList.forEach(m=>{
  1544. if (this.curProfessionRow.membList.filter(innerM=>innerM.membId == m.membId).length>1) {
  1545. hasDuplicate = true;
  1546. }
  1547. });
  1548. if (hasDuplicate) {
  1549. this.$message({
  1550. message: '专业人员不能重复',
  1551. type: "error"
  1552. });
  1553. return;
  1554. }
  1555. if (p != 100) {
  1556. this.$message({
  1557. message: '占比合计必须是100%',
  1558. type: "error"
  1559. });
  1560. return;
  1561. }
  1562. this.editPpMembDialog = false;
  1563. this.curProfessionRow.membList.forEach(m=>{
  1564. m.membName = this.participator.filter(p=>p.id == m.membId)[0].name;
  1565. });
  1566. this.projectProfessionItem.membList = JSON.parse(JSON.stringify(this.curProfessionRow.membList));
  1567. },
  1568. //删除专业人员
  1569. deleteMembItem(index) {
  1570. this.curProfessionRow.membList.splice(index,1);
  1571. },
  1572. //添加专业人员
  1573. addMembItem() {
  1574. if (this.curProfessionRow.membList == null) {
  1575. this.curProfessionRow.membList = [{membId:null, percentage:100}];
  1576. } else {
  1577. let p = 0;
  1578. this.curProfessionRow.membList.forEach(m=>{
  1579. p += parseInt(m.percentage);
  1580. });
  1581. this.curProfessionRow.membList.push({membId:null, percentage:100-p});
  1582. }
  1583. this.$forceUpdate();
  1584. },
  1585. showEditPpMembs(row) {
  1586. this.projectProfessionItem = row;
  1587. this.curProfessionRow = JSON.parse(JSON.stringify(row));
  1588. if (this.curProfessionRow.membList == null || this.curProfessionRow.membList.length == 0) {
  1589. this.curProfessionRow.membList = [{membId:null, percentage:100}];
  1590. }
  1591. this.editPpMembDialog = true;
  1592. },
  1593. getProjectNotifyUserList(projectId) {
  1594. this.http.post("/project-notify-user/get", {projectId: projectId},
  1595. res => {
  1596. if (res.code == "ok") {
  1597. var chosenLeaderIds = [];
  1598. var chosenLeaderNames = '';
  1599. var leaderList = res.data;
  1600. this.chosenLeaders = leaderList;
  1601. for(var j in leaderList) {
  1602. chosenLeaderIds.push(leaderList[j].userId)
  1603. chosenLeaderNames += leaderList[j].userName+',';
  1604. }
  1605. if (chosenLeaderNames.length > 0) {
  1606. chosenLeaderNames = chosenLeaderNames.substring(0, chosenLeaderNames.length -1);
  1607. }
  1608. this.addForm.notifyUserIds = chosenLeaderIds;
  1609. this.addForm.notifyUserNames = chosenLeaderNames;
  1610. } else {
  1611. this.$message({
  1612. message: res.msg,
  1613. type: "error"
  1614. });
  1615. }
  1616. },
  1617. error => {
  1618. this.$message({
  1619. message: error,
  1620. type: "error"
  1621. });
  1622. });
  1623. },
  1624. getProjectProfessions(projectId) {
  1625. this.http.post("/project-profession/get", {projectId: projectId},
  1626. res => {
  1627. if (res.code == "ok") {
  1628. this.projectProfessionList = res.data;
  1629. } else {
  1630. this.$message({
  1631. message: res.msg,
  1632. type: "error"
  1633. });
  1634. }
  1635. },
  1636. error => {
  1637. this.$message({
  1638. message: error,
  1639. type: "error"
  1640. });
  1641. });
  1642. },
  1643. checkProjectProfession() {
  1644. //检查合计比例是否到达100%
  1645. let p = 0;
  1646. let hasNoMemb = false;
  1647. let hasNoProfession = false;
  1648. let hasNoMembList = false;
  1649. this.projectProfessionList.forEach(m=>{
  1650. p += parseInt(m.percentage);
  1651. //检查人员是否选择
  1652. if (m.inchargerId == null) {
  1653. hasNoMemb = true;
  1654. }
  1655. if (m.professionId == null) {
  1656. hasNoProfession = true;
  1657. }
  1658. if (m.membList == null) {
  1659. hasNoMembList = true;
  1660. }
  1661. });
  1662. if (hasNoProfession) {
  1663. this.$message({
  1664. message: '专业不能为空',
  1665. type: "error"
  1666. });
  1667. return false;
  1668. }
  1669. if (hasNoMembList) {
  1670. this.$message({
  1671. message: '专业相关人员不能为空',
  1672. type: "error"
  1673. });
  1674. return false;
  1675. }
  1676. if (hasNoMemb) {
  1677. this.$message({
  1678. message: '专业负责人不能为空',
  1679. type: "error"
  1680. });
  1681. return false;
  1682. }
  1683. //检查专业不能重复
  1684. let hasDuplicate = false;
  1685. this.projectProfessionList.forEach(m=>{
  1686. if (this.projectProfessionList.filter(innerM=>innerM.professionId == m.professionId).length>1) {
  1687. hasDuplicate = true;
  1688. }
  1689. });
  1690. if (hasDuplicate) {
  1691. this.$message({
  1692. message: '专业不能重复',
  1693. type: "error"
  1694. });
  1695. return false;
  1696. }
  1697. if (this.projectProfessionList.length > 0 && p != 100) {
  1698. this.$message({
  1699. message: '专业占比合计必须是100%',
  1700. type: "error"
  1701. });
  1702. return false;
  1703. }
  1704. return true;
  1705. },
  1706. //保存项目专业
  1707. saveProjectProfessions(projectId) {
  1708. var list = this.projectProfessionList.filter(p=>p.professionId != null);
  1709. list.forEach(p=>p.inchargerName = this.participator.filter(m=>m.id == p.inchargerId)[0].name);
  1710. list.forEach(p=>p.professionName = this.professionList.filter(m=>m.id == p.professionId)[0].name);
  1711. this.http.post("/project-profession/modify", {projectId: projectId, json: JSON.stringify(list)},
  1712. res => {
  1713. if (res.code == "ok") {
  1714. return false;
  1715. } else {
  1716. this.$message({
  1717. message: res.msg,
  1718. type: "error"
  1719. });
  1720. }
  1721. },
  1722. error => {
  1723. this.$message({
  1724. message: error,
  1725. type: "error"
  1726. });
  1727. });
  1728. },
  1729. //删除项目专业
  1730. deleteItem(index) {
  1731. this.projectProfessionList.splice(index,1);
  1732. },
  1733. //添加项目专业
  1734. addItem() {
  1735. let p = 0;
  1736. this.projectProfessionList.forEach(m=>{
  1737. p += parseInt(m.percentage);
  1738. });
  1739. this.projectProfessionList.push( { professionId:null, inchargerId:null,membIds:[], percentage: 100-p});
  1740. },
  1741. getProfessionList() {
  1742. this.http.post("/profession/getAll", {},
  1743. res => {
  1744. if (res.code == "ok") {
  1745. var list = res.data;
  1746. this.professionList = list;
  1747. } else {
  1748. this.$message({
  1749. message: res.msg,
  1750. type: "error"
  1751. });
  1752. }
  1753. },
  1754. error => {
  1755. this.$message({
  1756. message: error,
  1757. type: "error"
  1758. });
  1759. });
  1760. },
  1761. restrictNumber(targetId) {
  1762. let inpu = document.getElementById(targetId);
  1763. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  1764. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  1765. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  1766. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  1767. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  1768. inpu.value = parseFloat(inpu.value);
  1769. }
  1770. },
  1771. showChooseLeaderTree() {
  1772. this.chosenMembCount = this.chosenLeaders.length;
  1773. this.chooseLeaderVisible = true;
  1774. },
  1775. onLeaderTreeItemChange() {
  1776. var chosenList = this.$refs.chooseLeaderTree.getCheckedNodes();
  1777. var list = chosenList.filter(item=>item.isUser == 1);
  1778. this.chosenMembCount = list.length;
  1779. },
  1780. showChooseMembTree() {
  1781. this.chosenMembCount = this.participator.length;
  1782. this.chooseParticipVisible = true;
  1783. this.filterText = ''
  1784. },
  1785. onTreeItemChange() {
  1786. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  1787. var list = chosenList.filter(item=>item.isUser == 1);
  1788. this.chosenMembCount = list.length;
  1789. },
  1790. findUserInTree() {
  1791. if (this.filterName == '') {
  1792. this.deptMembData = this.allMembData;
  1793. } else {
  1794. var list = this.findRecursively(this.filterName, this.allMembData);
  1795. this.deptMembData = list;
  1796. }
  1797. },
  1798. findRecursively(username, list) {
  1799. var filterList = [];
  1800. for (var i=0;i<list.length; i++) {
  1801. if (list[i].isUser == 1) {
  1802. if (list[i].label.indexOf(username) >= 0) {
  1803. //匹配上了
  1804. filterList.push(list[i]);
  1805. }
  1806. } else if (list[i].children != null && list[i].children.length > 0) {
  1807. var subList = this.findRecursively(username, list[i].children);
  1808. if (subList.length > 0) {
  1809. subList.forEach(s=>filterList.push(s));
  1810. }
  1811. }
  1812. }
  1813. return filterList;
  1814. },
  1815. //确定选择参与人
  1816. chooseParticip() {
  1817. this.chooseParticipVisible = false;
  1818. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  1819. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  1820. this.addForm.userNames = '';
  1821. this.addForm.userId = [];
  1822. this.participator = [];
  1823. for (var i=0;i<this.chosenMembList.length; i++) {
  1824. this.addForm.userId.push(this.chosenMembList[i].id);
  1825. this.addForm.userNames += this.chosenMembList[i].label+',';
  1826. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  1827. this.participator.push(item);
  1828. }
  1829. if (this.addForm.userNames.length > 0) {
  1830. this.addForm.userNames = this.addForm.userNames.substring(0, this.addForm.userNames.length-1);
  1831. }
  1832. },
  1833. //选中相关领导
  1834. chooseLeader() {
  1835. this.chooseLeaderVisible = false;
  1836. var chosenList = this.$refs.chooseLeaderTree.getCheckedNodes();
  1837. var chosenMembList = chosenList.filter(item=>item.isUser == 1);
  1838. this.addForm.notifyUserNames = '';
  1839. this.addForm.notifyUserIds = [];
  1840. this.chosenLeaders = [];
  1841. for (var i=0;i<chosenMembList.length; i++) {
  1842. this.addForm.notifyUserIds.push(chosenMembList[i].id);
  1843. this.addForm.notifyUserNames += chosenMembList[i].label+',';
  1844. var item = {userId:chosenMembList[i].id, userName:chosenMembList[i].label};
  1845. this.chosenLeaders.push(item);
  1846. }
  1847. if (this.addForm.notifyUserNames.length > 0) {
  1848. this.addForm.notifyUserNames = this.addForm.notifyUserNames.substring(0, this.addForm.notifyUserNames.length-1);
  1849. }
  1850. },
  1851. // 获取部门列表
  1852. getDepartment() {
  1853. this.http.post("/department/listAllMemb", {},
  1854. res => {
  1855. if (res.code == "ok") {
  1856. var list = res.data;
  1857. //设置员工到部门下面
  1858. this.setUserToDept(list);
  1859. this.deptMembData = list;
  1860. //用于筛选过滤
  1861. this.allMembData = JSON.parse(JSON.stringify(this.deptMembData));
  1862. } else {
  1863. this.$message({
  1864. message: res.msg,
  1865. type: "error"
  1866. });
  1867. }
  1868. },
  1869. error => {
  1870. this.$message({
  1871. message: error,
  1872. type: "error"
  1873. });
  1874. });
  1875. },
  1876. setUserToDept(list) {
  1877. for (var i in list) {
  1878. if (list[i].children != null) {
  1879. this.setUserToDept(list[i].children);
  1880. }
  1881. if (list[i].userList != null) {
  1882. if (list[i].children == null) {
  1883. list[i].children = [];
  1884. }
  1885. list[i].userList.forEach(element => {
  1886. var obj = {id: element.id, label:element.name, parentId:element.departmentId, isUser:1};
  1887. list[i].children.push(obj);
  1888. });
  1889. }
  1890. }
  1891. },
  1892. // 获取分类条目
  1893. getClfConfigList() {
  1894. this.http.get('/project-category/list',
  1895. res => {
  1896. if (res.code == "ok") {
  1897. this.baseClfList = res.data;
  1898. console.log("获取分类条目",res.data);
  1899. this.$forceUpdate();
  1900. } else {
  1901. this.$message({
  1902. message: res.msg,
  1903. type: "error"
  1904. });
  1905. }
  1906. },
  1907. error => {
  1908. this.$message({
  1909. message: error,
  1910. type: "error"
  1911. });
  1912. }
  1913. );
  1914. },
  1915. // 新增/编辑 分类条目
  1916. addNewClf(row) {
  1917. this.addClfDialog = true;
  1918. if (row == null) {
  1919. this.addClf = {}
  1920. } else {
  1921. this.addClf = row;
  1922. }
  1923. },
  1924. // 提交
  1925. submitClf() {
  1926. this.http.post('/project-category/addOrMod',this.addClf,
  1927. res => {
  1928. if (res.code == "ok") {
  1929. this.addClfDialog = false;
  1930. this.baseClfList = res.data;
  1931. // this.$forceUpdate();
  1932. // console.log(res.data);
  1933. } else {
  1934. this.$message({
  1935. message: res.msg,
  1936. type: "error"
  1937. });
  1938. }
  1939. },
  1940. error => {
  1941. this.$message({
  1942. message: error,
  1943. type: "error"
  1944. });
  1945. }
  1946. );
  1947. },
  1948. // 提交
  1949. submitManPro() {
  1950. this.http.post('/project-main/addOrMod',this.addMainForm,
  1951. res => {
  1952. if (res.code == "ok") {
  1953. this.addFlgmainProjectDialog = false;
  1954. this.getMainProject()
  1955. } else {
  1956. this.$message({
  1957. message: res.msg,
  1958. type: "error"
  1959. });
  1960. }
  1961. },
  1962. error => {
  1963. this.$message({
  1964. message: error,
  1965. type: "error"
  1966. });
  1967. }
  1968. );
  1969. },
  1970. // 删除
  1971. deleteClf(row) {
  1972. this.$confirm("该操作可能造成已有数据丢失,确定要删除吗?","删除分类条目", {
  1973. confirmButtonText: "确定",
  1974. cancelButtonText: "取消",
  1975. type: "warning"
  1976. })
  1977. .then(() => {
  1978. this.listLoading = true;
  1979. this.http.post('/project-category/delete',{
  1980. id: row.id
  1981. },
  1982. res => {
  1983. this.listLoading = false;
  1984. if (res.code == "ok") {
  1985. this.$message({
  1986. message: "删除成功",
  1987. type: "success"
  1988. });
  1989. this.getClfConfigList();
  1990. } else {
  1991. this.$message({
  1992. message: res.msg,
  1993. type: "error"
  1994. });
  1995. }
  1996. },
  1997. error => {
  1998. this.listLoading = false;
  1999. this.$message({
  2000. message: error,
  2001. type: "error"
  2002. });
  2003. }
  2004. );
  2005. })
  2006. .catch(() => {});
  2007. },
  2008. // 删除主项目
  2009. deleteManPro(row) {
  2010. this.$confirm("该操作可能造成已有数据丢失,确定要删除吗?","删除主项目", {
  2011. confirmButtonText: "确定",
  2012. cancelButtonText: "取消",
  2013. type: "warning"
  2014. })
  2015. .then(() => {
  2016. this.listLoading = true;
  2017. this.http.post('/project-main/delete',{
  2018. id: row.id
  2019. },
  2020. res => {
  2021. this.listLoading = false;
  2022. if (res.code == "ok") {
  2023. this.$message({
  2024. message: "删除成功",
  2025. type: "success"
  2026. });
  2027. this.getMainProject();
  2028. } else {
  2029. this.$message({
  2030. message: res.msg,
  2031. type: "error"
  2032. });
  2033. }
  2034. },
  2035. error => {
  2036. this.listLoading = false;
  2037. this.$message({
  2038. message: error,
  2039. type: "error"
  2040. });
  2041. }
  2042. );
  2043. })
  2044. .catch(() => {});
  2045. },
  2046. // 分类筛选
  2047. searchClfList(){
  2048. this.page = 1;
  2049. this.getList();
  2050. },
  2051. getProjectBaseConfigList() {
  2052. this.http.post('/project-basecost-setting/list',{},
  2053. res => {
  2054. if (res.code == "ok") {
  2055. this.baseCostItemList = res.data;
  2056. this.$forceUpdate();
  2057. } else {
  2058. this.$message({
  2059. message: res.msg,
  2060. type: "error"
  2061. });
  2062. }
  2063. },
  2064. error => {
  2065. this.$message({
  2066. message: error,
  2067. type: "error"
  2068. });
  2069. }
  2070. );
  2071. },
  2072. deleteBaseItem(row) {
  2073. this.$confirm("该操作可能造成已有数据丢失,确定要删除吗?","删除成本基线项", {
  2074. confirmButtonText: "确定",
  2075. cancelButtonText: "取消",
  2076. type: "warning"
  2077. })
  2078. .then(() => {
  2079. this.listLoading = true;
  2080. this.http.post('/project-basecost-setting/delete',{
  2081. id: row.id
  2082. },
  2083. res => {
  2084. this.listLoading = false;
  2085. if (res.code == "ok") {
  2086. this.$message({
  2087. message: "删除成功",
  2088. type: "success"
  2089. });
  2090. this.getProjectBaseConfigList();
  2091. } else {
  2092. this.$message({
  2093. message: res.msg,
  2094. type: "error"
  2095. });
  2096. }
  2097. },
  2098. error => {
  2099. this.listLoading = false;
  2100. this.$message({
  2101. message: error,
  2102. type: "error"
  2103. });
  2104. }
  2105. );
  2106. })
  2107. .catch(() => {});
  2108. },
  2109. submitInsertBaseItem() {
  2110. this.http.post('/project-basecost-setting/addOrMod',this.addForm,
  2111. res => {
  2112. if (res.code == "ok") {
  2113. this.addBaseItemDialog = false;
  2114. this.baseCostItemList = res.data;
  2115. this.$forceUpdate();
  2116. } else {
  2117. this.$message({
  2118. message: res.msg,
  2119. type: "error"
  2120. });
  2121. }
  2122. },
  2123. error => {
  2124. this.$message({
  2125. message: error,
  2126. type: "error"
  2127. });
  2128. }
  2129. );
  2130. },
  2131. showBaseCostItemDialog() {
  2132. this.showBaseConfig = true;
  2133. },
  2134. addNewBaseItem(row) {
  2135. this.addBaseItemDialog = true;
  2136. if (row == null) {
  2137. this.addForm = {alarmType: 0}
  2138. } else {
  2139. this.addForm = row;
  2140. }
  2141. },
  2142. //获取客户列表
  2143. getCustomerList() {
  2144. this.http.post('/customer-info/getAll', {
  2145. },
  2146. res => {
  2147. if (res.code == "ok") {
  2148. this.customerList = res.data;
  2149. } else {
  2150. this.$message({
  2151. message: res.msg,
  2152. type: "error"
  2153. });
  2154. }
  2155. },
  2156. error => {
  2157. this.$message({
  2158. message: error,
  2159. type: "error"
  2160. });
  2161. });
  2162. },
  2163. importProject(item) {
  2164. //首先判断文件类型
  2165. let str = item.file.name.split(".");
  2166. let format = str[str.length - 1];
  2167. if (format != "xls" && format != "xlsx") {
  2168. this.$message({
  2169. message: "请选择.xls或.xlsx文件",
  2170. type: "error"
  2171. });
  2172. } else {
  2173. this.listLoading = true;
  2174. let formData = new FormData();
  2175. formData.append("file", item.file);
  2176. formData.append("userId", this.user.id);
  2177. this.http.uploadFile('/project/importData', formData,
  2178. res => {
  2179. this.$refs.upload.clearFiles();
  2180. this.listLoading = false;
  2181. if (res.code == "ok") {
  2182. // this.$message({
  2183. // message: res.data,
  2184. // type: "success"
  2185. // },5000);
  2186. //弹窗显示
  2187. this.showImportResult = true;
  2188. this.importResultMsg = res.data;
  2189. this.getList();
  2190. } else {
  2191. this.$message({
  2192. message: res.msg,
  2193. type: "error"
  2194. });
  2195. }
  2196. },
  2197. error => {
  2198. this.$refs.upload.clearFiles();
  2199. this.listLoading = false;
  2200. this.$message({
  2201. message: error,
  2202. type: "error"
  2203. });
  2204. });
  2205. }
  2206. },
  2207. number(){
  2208. //     this.addForm.budget = this.addForm.budget.replace(/[^\.\d]/g,'');
  2209. // this.addForm.budget = this.addForm.budget.replace('.','');
  2210. },
  2211. deleteSubPro(subProject) {
  2212. this.$confirm("确定要删除子项目" + subProject.name + "吗?","删除子项目", {
  2213. confirmButtonText: "确定",
  2214. cancelButtonText: "取消",
  2215. type: "warning"
  2216. })
  2217. .then(() => {
  2218. this.listLoading = true;
  2219. this.http.post('/sub-project/deleteProject',{
  2220. id: subProject.id
  2221. },
  2222. res => {
  2223. this.listLoading = false;
  2224. if (res.code == "ok") {
  2225. this.$message({
  2226. message: "删除成功",
  2227. type: "success"
  2228. });
  2229. this.subProject(this.currentProject);
  2230. } else {
  2231. this.$message({
  2232. message: res.msg,
  2233. type: "error"
  2234. });
  2235. }
  2236. },
  2237. error => {
  2238. this.listLoading = false;
  2239. this.$message({
  2240. message: error,
  2241. type: "error"
  2242. });
  2243. }
  2244. );
  2245. })
  2246. .catch(() => {});
  2247. },
  2248. searchList() {
  2249. this.page = 1;
  2250. this.getList();
  2251. },
  2252. addNewSubProject(subProject) {
  2253. if (subProject == null) {
  2254. this.temaddForm = {projectId: this.currentProject.id, level:1}
  2255. } else {
  2256. this.temaddForm = JSON.parse(JSON.stringify(subProject));
  2257. }
  2258. this.addSubProject = true;
  2259. },
  2260. //显示子项目
  2261. subProject(item) {
  2262. this.subProjectVisible = true;
  2263. this.currentProject = item;
  2264. this.http.post('/sub-project/list', {
  2265. projectId: item.id
  2266. },
  2267. res => {
  2268. if (res.code == "ok") {
  2269. this.subProjectList = res.data;
  2270. } else {
  2271. this.$message({
  2272. message: res.msg,
  2273. type: "error"
  2274. });
  2275. }
  2276. },
  2277. error => {
  2278. this.$message({
  2279. message: error,
  2280. type: "error"
  2281. });
  2282. });
  2283. },
  2284. //显示用户详情
  2285. showUser(userId) {
  2286. this.userDetailVisible = true;
  2287. this.http.post(this.port.manage.userDetail, {
  2288. userId: userId
  2289. },
  2290. res => {
  2291. if (res.code == "ok") {
  2292. this.userDetail = res.data;
  2293. } else {
  2294. this.$message({
  2295. message: res.msg,
  2296. type: "error"
  2297. });
  2298. }
  2299. },
  2300. error => {
  2301. this.$message({
  2302. message: error,
  2303. type: "error"
  2304. });
  2305. });
  2306. },
  2307. //选择参与人
  2308. changeParticipator() {
  2309. //检查是否在参与人中,如果没有需要加入到参与人中
  2310. this.participator = [];
  2311. this.addForm.userId.forEach(u=>{
  2312. var list = this.users.filter(au=>au.id == u);
  2313. if (list.length > 0) {
  2314. var findUser = list[0];
  2315. this.participator.push(findUser);
  2316. } else {
  2317. console.log('未找到用户: '+u);
  2318. }
  2319. })
  2320. },
  2321. getUsers() {
  2322. this.http.post(this.port.manage.list, {
  2323. departmentId: -1,
  2324. pageIndex: 1,
  2325. pageSize: 99999
  2326. },
  2327. res => {
  2328. if (res.code == "ok") {
  2329. this.users = res.data.records;
  2330. } else {
  2331. this.$message({
  2332. message: res.msg,
  2333. type: "error"
  2334. });
  2335. }
  2336. },
  2337. error => {
  2338. this.$message({
  2339. message: error,
  2340. type: "error"
  2341. });
  2342. });
  2343. },
  2344. //分页
  2345. handleCurrentChange(val) {
  2346. this.page = val;
  2347. this.getList();
  2348. },
  2349. handleSizeChange(val) {
  2350. this.size = val;
  2351. localStorage.projectPageSize = this.size;
  2352. this.getList();
  2353. },
  2354. //获取项目列表
  2355. getList() {
  2356. this.listLoading = true;
  2357. let parameter = {
  2358. pageIndex: this.page,
  2359. pageSize: this.size,
  2360. keyword:this.keyword,
  2361. searchField: this.searchField,
  2362. status: this.status,
  2363. category: this.statusClf,
  2364. projectMainId: this.projectMainId
  2365. }
  2366. if(this.sortOrder){
  2367. if(this.sortProp == 'inchargerName'){
  2368. parameter.sortProp = "incharger_id"
  2369. }else if(this.sortProp == 'customerName'){
  2370. parameter.sortProp = "customer_id"
  2371. }else if(this.sortProp == 'projectCode'){
  2372. parameter.sortProp = 'project_code'
  2373. }else if(this.sortProp == 'categoryName'){
  2374. parameter.sortProp = 'category'
  2375. }else if(this.sortProp == 'projectName'){
  2376. parameter.sortProp = 'project_name'
  2377. }else if(this.sortProp == 'status'){
  2378. parameter.sortProp = 'status'
  2379. }else if(this.sortProp == 'currentStage'){
  2380. parameter.sortProp = 'current_stage'
  2381. }
  2382. if(this.sortOrder == 'descending'){
  2383. parameter.sortOrder = 0
  2384. }else if(this.sortOrder == 'ascending'){
  2385. parameter.sortOrder = 1
  2386. }
  2387. }
  2388. this.http.post(this.port.project.listPage, parameter,
  2389. res => {
  2390. this.listLoading = false;
  2391. if (res.code == "ok") {
  2392. var list = res.data.records;
  2393. for(var i in list) {
  2394. var participator = list[i].participator , str = "";
  2395. for(var j in participator) {
  2396. if(j == participator.length-1) {
  2397. str += participator[j].name
  2398. } else {
  2399. str += participator[j].name + ','
  2400. }
  2401. }
  2402. list[i].userNames = str;
  2403. }
  2404. this.showColumnWidth = this.showColumn(list)
  2405. this.list = list;
  2406. this.total = res.data.total;
  2407. this.$nextTick(()=>{
  2408. this.$refs.projectlistOfWudulist.doLayout();
  2409. })
  2410. this.listHeader = res.data.nameList
  2411. } else {
  2412. this.$message({
  2413. message: res.msg,
  2414. type: "error"
  2415. });
  2416. }
  2417. },
  2418. error => {
  2419. this.listLoading = false;
  2420. this.$message({
  2421. message: error,
  2422. type: "error"
  2423. });
  2424. });
  2425. },
  2426. showColumn(list){
  2427. if(!this.permissions.projectManagement){
  2428. let creat = false
  2429. let incha = false
  2430. for(let i in list){
  2431. if(this.user.id == list[i].creatorId){
  2432. creat = true
  2433. }
  2434. if(this.user.id == list[i].inchargerId){
  2435. incha = true
  2436. }
  2437. }
  2438. if(creat){
  2439. return '300'
  2440. }else {
  2441. if(incha){
  2442. return '210'
  2443. }else {
  2444. return '0'
  2445. }
  2446. }
  2447. }else {
  2448. return '300'
  2449. }
  2450. },
  2451. //显示新增界面
  2452. handleAdd(i, item) {
  2453. if(i == -1) {
  2454. this.title = "新增项目";
  2455. this.addForm = {
  2456. name: '',
  2457. isPublic:0,
  2458. userId: [],
  2459. userNames:'',
  2460. code:'',
  2461. inchargerId:null,
  2462. level:1,
  2463. customerId:null,
  2464. notifyUserNames:'',
  2465. chosenLeaders:[],
  2466. taskGpIncharge: 0,
  2467. category:null,
  2468. creatorId: this.user.id,
  2469. projectMainId: ''
  2470. }
  2471. this.projectBaseCostData = [];
  2472. this.auseList = [];
  2473. for (var m=0;m<this.baseCostItemList.length; m++) {
  2474. this.projectBaseCostData.push({baseId: this.baseCostItemList[m].id, baseName:this.baseCostItemList[m].name, baseAmount:0});
  2475. }
  2476. } else {
  2477. this.title = "修改项目";
  2478. var list = item.participator;
  2479. if (item.isPublic == 1) {
  2480. list = this.users;
  2481. }
  2482. var arr = [];
  2483. var names = '';
  2484. for(var j in list) {
  2485. arr.push(list[j].id)
  2486. names += list[j].name+',';
  2487. }
  2488. if (names.length > 0) {
  2489. names = names.substring(0, names.length -1);
  2490. }
  2491. this.addForm = {
  2492. id: item.id,
  2493. name: item.projectName,
  2494. isPublic: item.isPublic,
  2495. userId: arr,
  2496. userNames:names,
  2497. code:item.projectCode,
  2498. inchargerId: item.inchargerId,
  2499. level: item.level,
  2500. planStartDate: item.planStartDate,
  2501. planEndDate: item.planEndDate,
  2502. budget: item.budget,
  2503. baseMan: item.baseMan,
  2504. contractAmount: item.contractAmount,
  2505. baseFee: item.baseFee,
  2506. baseRisk1: item.baseRisk1,
  2507. baseRisk2: item.baseRisk2,
  2508. baseOutsourcing: item.baseOutsourcing,
  2509. customerId:item.customerId==0?null:item.customerId,
  2510. taskGpIncharge: item.taskGpIncharge,
  2511. category:item.category,
  2512. projectDesc: item.projectDesc,
  2513. projectMainId: item.projectMainId,
  2514. creatorId: item.creatorId
  2515. }
  2516. // 判断是否有供应商
  2517. if(this.user.company.packageProvider) {
  2518. // this.addForm.supplierId = item.providerIds.split(',')
  2519. if(item.providerIds) {
  2520. let arr = []
  2521. let zhhi = item.providerIds.split(',')
  2522. for(let i in zhhi) {
  2523. arr.push(+zhhi[i] + 0)
  2524. }
  2525. this.$set(this.addForm, 'supplierId', arr)
  2526. console.log( this.addForm.supplierId)
  2527. } else {
  2528. this.$set(this.addForm, 'supplierId', [])
  2529. }
  2530. }
  2531. // 判断是否有供应商结尾
  2532. this.deleteVif = item.creatorId
  2533. console.log("handleadd",this.deleteVif,this.addForm.id)
  2534. if(item.associateDegrees != null && item.associateDegrees != 'null' && item.associateDegrees != '') {
  2535. var spli = item.associateDegrees.split(',')
  2536. var sl = []
  2537. for(var i in spli) {
  2538. var num = +spli[i] + 0
  2539. sl.push(num)
  2540. }
  2541. this.auseList = sl
  2542. // console.log(this.auseList)
  2543. } else {
  2544. this.auseList = []
  2545. }
  2546. // var spli = item.associateDegrees.split(',')
  2547. // var sl = []
  2548. // for(var i in spli) {
  2549. // var num = +spli[i] + 0
  2550. // sl.push(num)
  2551. // }
  2552. // this.auseList = sl
  2553. // console.log(this.auseList)
  2554. this.changeParticipator();
  2555. this.getProjectBaseData(item.id);
  2556. if (this.user.company.packageEngineering == 1) {
  2557. this.getProjectProfessions(item.id);
  2558. }
  2559. //获取项目的相关领导
  2560. this.getProjectNotifyUserList(item.id);
  2561. this.getProjectAutorList(item.id);
  2562. }
  2563. this.addFormVisible = true;
  2564. if (this.user.company.packageEngineering == 1) {
  2565. if (this.professionList.length == 0) {
  2566. this.getProfessionList();
  2567. }
  2568. }
  2569. },
  2570. //获取项目审核人
  2571. getProjectAutorList(projectId) {
  2572. this.http.post('/project-auditor/getList',{projectId: projectId},
  2573. res => {
  2574. if (res.code == "ok") {
  2575. this.addForm.auditUserIds = res.data.map(function(item) {
  2576. return item.auditorId;
  2577. });
  2578. } else {
  2579. this.$message({
  2580. message: res.msg,
  2581. type: "error"
  2582. });
  2583. }
  2584. },
  2585. error => {
  2586. this.listLoading = false;
  2587. this.$message({
  2588. message: error,
  2589. type: "error"
  2590. });
  2591. }
  2592. );
  2593. },
  2594. getProjectBaseData(projectId) {
  2595. this.http.post('/project-basecost/get',{projectId: projectId},
  2596. res => {
  2597. if (res.code == "ok") {
  2598. this.projectBaseCostData = res.data;
  2599. } else {
  2600. this.$message({
  2601. message: res.msg,
  2602. type: "error"
  2603. });
  2604. }
  2605. },
  2606. error => {
  2607. this.listLoading = false;
  2608. this.$message({
  2609. message: error,
  2610. type: "error"
  2611. });
  2612. }
  2613. );
  2614. },
  2615. //提交子项目创建修改请求
  2616. submitInsertSubProject () {
  2617. this.$refs.form2.validate(valid => {
  2618. if (valid) {
  2619. this.http.post('/sub-project/saveOrUpdate',this.temaddForm,
  2620. res => {
  2621. if (res.code == "ok") {
  2622. this.$message({
  2623. message: "操作成功",
  2624. type: "success"
  2625. });
  2626. this.subProject(this.currentProject);
  2627. this.addSubProject = false;
  2628. } else {
  2629. this.$message({
  2630. message: res.msg,
  2631. type: "error"
  2632. });
  2633. }
  2634. },
  2635. error => {
  2636. this.listLoading = false;
  2637. this.$message({
  2638. message: error,
  2639. type: "error"
  2640. });
  2641. }
  2642. );
  2643. }
  2644. });
  2645. },
  2646. // 项目基线合计
  2647. addUpfun() {
  2648. var total = 0;
  2649. for (var i=0;i<this.projectBaseCostData.length; i++) {
  2650. total += parseFloat(this.projectBaseCostData[i].baseAmount);
  2651. }
  2652. this.addForm.budget = total;
  2653. // var a = '0'
  2654. // var q = '0'
  2655. // var w = '0'
  2656. // var e = '0'
  2657. // var r = '0'
  2658. // // this.addForm.baseMan === undefined || this.addForm.baseMan === NaN ? this.addForm.baseMa = '0' : this.addForm.baseMan
  2659. // if (this.addForm.baseMan == undefined || this.addForm.baseMan == NaN) {
  2660. // a = 0
  2661. // } else {
  2662. // a = this.addForm.baseMan
  2663. // }
  2664. // if (this.addForm.baseFee !== undefined) q = this.addForm.baseFee
  2665. // if (this.addForm.baseOutsourcing !== undefined) w = this.addForm.baseOutsourcing
  2666. // if (this.addForm.baseRisk1 !== undefined) e = this.addForm.baseRisk1
  2667. // if (this.addForm.baseRisk2 !== undefined) r = this.addForm.baseRisk2
  2668. // this.addForm.budget = +a + +q + +w + +e + +r
  2669. },
  2670. submitInsert() {
  2671. this.$refs.form1.validate(valid => {
  2672. if (valid) {
  2673. if (this.user.company.packageEngineering == 1) {
  2674. if (!this.checkProjectProfession()) {//检查不通过,直接返回
  2675. return;
  2676. }
  2677. }
  2678. this.addLoading = true;
  2679. let formData = new FormData();
  2680. formData.append("name", this.addForm.name);
  2681. if(this.addForm.projectDesc != null) {
  2682. formData.append("projectDesc", this.addForm.projectDesc);
  2683. }
  2684. if(this.addForm.id != null) {
  2685. formData.append("id", this.addForm.id);
  2686. }
  2687. if(this.addForm.isPublic != null) {
  2688. formData.append("isPublic", this.addForm.isPublic);
  2689. }
  2690. if(this.addForm.userId.length != 0 && this.addForm.isPublic == 0) {
  2691. for(var j in this.addForm.userId) {
  2692. formData.append("userId", this.addForm.userId[j]);
  2693. }
  2694. }
  2695. if(this.addForm.inchargerId != null) {
  2696. formData.append("inchargerId", this.addForm.inchargerId);
  2697. }
  2698. if(this.addForm.code != null) {
  2699. formData.append("code", this.addForm.code);
  2700. }
  2701. if(this.addForm.planStartDate != null) {
  2702. formData.append("planStartDate", this.addForm.planStartDate);
  2703. }
  2704. if(this.addForm.planEndDate != null) {
  2705. formData.append("planEndDate", this.addForm.planEndDate);
  2706. }
  2707. if(this.addForm.level != null) {
  2708. formData.append("level", this.addForm.level);
  2709. }
  2710. if(this.addForm.contractAmount != null) {
  2711. formData.append("contractAmount", this.addForm.contractAmount);
  2712. }
  2713. if (this.projectBaseCostData != null) {
  2714. formData.append("projectBaseCostData", JSON.stringify(this.projectBaseCostData));
  2715. //计算总预算成本
  2716. if (this.addForm.budget == null) {
  2717. this.addForm.budget = 0;
  2718. }
  2719. formData.append("budget", this.addForm.budget);
  2720. }
  2721. if (this.addForm.customerId == null) {
  2722. formData.append("customerId", 0);
  2723. } else {
  2724. formData.append("customerId", this.addForm.customerId);
  2725. }
  2726. if (this.chosenLeaders != null && this.chosenLeaders.length > 0) {
  2727. formData.append("chosenLeaders", JSON.stringify(this.chosenLeaders));
  2728. }
  2729. var listId = []
  2730. var listName = []
  2731. for(var i in this.auseList) {
  2732. for(var j in this.ause) {
  2733. if(this.auseList[i] == this.ause[j].id) {
  2734. listId.push(this.ause[j].id);
  2735. listName.push(this.ause[j].name);
  2736. break;
  2737. }
  2738. }
  2739. }
  2740. listId.toString()
  2741. listName.toString()
  2742. formData.append("associateDegrees", listId)
  2743. formData.append("associateDegreeNames", listName)
  2744. formData.append("taskGpIncharge", this.addForm.taskGpIncharge)
  2745. //日报审核人
  2746. formData.append("auditUserIds", JSON.stringify(this.addForm.auditUserIds));
  2747. if(this.addForm.category != null) {
  2748. formData.append("category", this.addForm.category);
  2749. }
  2750. if(this.user.timeType.mainProjectState == '1' && this.addForm.projectMainId) {
  2751. formData.append("projectMainId", this.addForm.projectMainId);
  2752. }
  2753. // 提交供应商
  2754. // 线判断是否有供应商
  2755. if(this.user.company.packageProvider) {
  2756. let suppStrName = []
  2757. for(let is in this.addForm.supplierId) {
  2758. for(let js in this.supplierList) {
  2759. if(this.addForm.supplierId[is] == this.supplierList[js].id) {
  2760. suppStrName.push(this.supplierList[js].providerName)
  2761. }
  2762. }
  2763. }
  2764. formData.append("providerNames", suppStrName.toString());
  2765. formData.append("providerIds", this.addForm.supplierId.toString());
  2766. }
  2767. // formData.append("associateDegreeNames", listName)
  2768. // console.log("addform",this.addForm);
  2769. // return
  2770. this.http.uploadFile(this.port.project.add,formData,
  2771. res => {
  2772. this.addLoading = false;
  2773. if (res.code == "ok") {
  2774. this.$message({
  2775. message: (this.addForm.id!=null?'修改':'创建')+"成功",
  2776. type: "success"
  2777. });
  2778. this.addFormVisible = false;
  2779. this.getList();
  2780. if (this.user.company.packageEngineering == 1) {
  2781. this.saveProjectProfessions(res.data);
  2782. }
  2783. } else {
  2784. this.$message({
  2785. message: res.msg,
  2786. type: "error"
  2787. });
  2788. }
  2789. },
  2790. error => {
  2791. this.addLoading = false;
  2792. this.$message({
  2793. message: error,
  2794. type: "error"
  2795. });
  2796. });
  2797. }
  2798. });
  2799. },
  2800. // 删除
  2801. deletePro(i, item) {
  2802. this.$confirm("确定要删除项目[" + item.name + "]吗?","删除项目", {
  2803. confirmButtonText: "确定",
  2804. cancelButtonText: "取消",
  2805. type: "warning"
  2806. })
  2807. .then(() => {
  2808. this.listLoading = true;
  2809. this.http.post(this.port.project.delete,{
  2810. id: item.id
  2811. },
  2812. res => {
  2813. this.listLoading = false;
  2814. if (res.code == "ok") {
  2815. this.$message({
  2816. message: "删除成功",
  2817. type: "success"
  2818. });
  2819. this.getList();
  2820. this.addFormVisible = false
  2821. } else if (res.code == 'reconfirm') {
  2822. this.deleteAlertMsg = res.msg;
  2823. this.forceDeletePro(item.id);
  2824. } else {
  2825. this.$message({
  2826. message: res.msg,
  2827. type: "error"
  2828. });
  2829. }
  2830. },
  2831. error => {
  2832. this.listLoading = false;
  2833. this.$message({
  2834. message: error,
  2835. type: "error"
  2836. });
  2837. }
  2838. );
  2839. })
  2840. .catch(() => {});
  2841. },
  2842. //强制删除项目
  2843. forceDeletePro(deleteProId) {
  2844. this.$confirm(this.deleteAlertMsg,"删除项目", {
  2845. confirmButtonText: "确定",
  2846. cancelButtonText: "取消",
  2847. type: "warning"
  2848. })
  2849. .then(() => {
  2850. this.listLoading = true;
  2851. this.http.post(this.port.project.delete,{
  2852. id: deleteProId ,force:1
  2853. },
  2854. res => {
  2855. this.listLoading = false;
  2856. if (res.code == "ok") {
  2857. this.$message({
  2858. message: "删除成功",
  2859. type: "success"
  2860. });
  2861. this.getList();
  2862. this.addFormVisible = false;
  2863. } else {
  2864. this.$message({
  2865. message: res.msg,
  2866. type: "error"
  2867. });
  2868. }
  2869. },
  2870. error => {
  2871. this.listLoading = false;
  2872. this.$message({
  2873. message: error,
  2874. type: "error"
  2875. });
  2876. }
  2877. );
  2878. })
  2879. .catch(() => {});
  2880. },
  2881. detail(i) {
  2882. this.$router.push("/list/" + this.list[i].id + "/" + this.list[i].projectName);
  2883. }
  2884. },
  2885. created() {
  2886. let height = window.innerHeight;
  2887. this.tableHeight = height - 195;
  2888. const that = this;
  2889. window.onresize = function temp() {
  2890. that.tableHeight = window.innerHeight - 195;
  2891. };
  2892. },
  2893. mounted() {
  2894. this.userssHu()
  2895. this.getDepartment();
  2896. this.getList();
  2897. this.getUsers();
  2898. this.getCustomerList();
  2899. this.getProjectBaseConfigList();
  2900. this.getClfConfigList()
  2901. this.yanjiuzx()
  2902. // 判断是否有供应商字段
  2903. if(this.user.company.packageProvider == 1){
  2904. this.getSupplierList()
  2905. }
  2906. // this.getSupplierList()
  2907. if(this.user.timeType.mainProjectState == 1){
  2908. this.getMainProject()
  2909. }
  2910. // 判断释放为专业版
  2911. if(this.user.company.packageProject == 1) {
  2912. this.importanceList = [{id:1,label:'正常'},{id:5,label:'低风险'},{id:6,label:'中风险'},{id:7,label:'高风险'},{id:2,label:'紧急'},{id:3,label:'重要'},{id:4,label:'重要且紧急'}]
  2913. } else {
  2914. this.importanceList = [{id:1,label:'正常'},{id:2,label:'紧急'},{id:3,label:'重要'},{id:4,label:'重要且紧急'}]
  2915. }
  2916. }
  2917. };
  2918. </script>
  2919. <style lang="scss" scoped>
  2920. .rg_span{
  2921. display: inline-block;
  2922. }
  2923. .rg_span span {
  2924. text-align: right;
  2925. box-sizing: border-box;
  2926. padding-right: 10px;
  2927. }
  2928. .el-dialog__title {
  2929. display: inline-table;
  2930. margin-top: 20px;
  2931. }
  2932. .addss {
  2933. width: 100%;
  2934. overflow: hidden;
  2935. white-space: nowrap;
  2936. text-overflow: ellipsis;
  2937. }
  2938. // 111
  2939. </style>
  2940. <style>
  2941. .el-dropdown-link {
  2942. color: #409EFF;
  2943. }
  2944. .customdropdown{
  2945. margin-left: 10px;
  2946. }
  2947. .customdropdown .el-dropdown__caret-button{
  2948. height: 27px;
  2949. }
  2950. .customdropdown .el-button--mini:nth-child(1){
  2951. height: 27px;
  2952. }
  2953. .customdropdown_menu{
  2954. padding: 0;
  2955. }
  2956. .customdropdown_menu_btn{
  2957. border-color: transparent;
  2958. }
  2959. .ganttdialog .el-dialog__body{
  2960. height: 550px;
  2961. }
  2962. .toolbar_formitem_n1{
  2963. margin-right: 0 !important;
  2964. }
  2965. </style>