list.vue 143 KB

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