list.vue 178 KB

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