list.vue 115 KB

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