list.vue 156 KB

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