list.vue 178 KB

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