list.vue 113 KB

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