list.vue 169 KB

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