list.vue 174 KB

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