list.vue 116 KB

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