list.vue 173 KB

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