info.vue 63 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349
  1. <template>
  2. <div :style="'padding:20px 30px;background:#f7f7f7;min-height:'+tableHeight+'px;'">
  3. <div style="margin: 0 auto;width:1000px;">
  4. <el-row :gutter="20">
  5. <el-col :span="17" >
  6. <div class="box info">
  7. <label>基本信息<el-link v-if="user.id == project.creatorId || user.id == project.inchargerId" @click="showEdit" style="float:right;"><i class="el-icon-edit" ></i></el-link></label>
  8. <el-row :gutter="10" >
  9. <el-col :span="5" ><span class="gray_label">项目名称:</span></el-col><el-col :span="19" ><span >{{project.projectName}}</span></el-col>
  10. </el-row>
  11. <el-row :gutter="10">
  12. <el-col :span="5" ><span class="gray_label">状态:</span></el-col><el-col :span="7" ><span >{{project.status==null?'-':statusTxt[project.status]}}</span></el-col>
  13. <el-col :span="5" ><span class="gray_label">完成度: </span></el-col><el-col :span="7" ><span>
  14. <el-progress :percentage="project.progress == null?0:project.progress"></el-progress></span></el-col>
  15. </el-row>
  16. <el-row :gutter="10">
  17. <el-col :span="5" ><span class="gray_label">项目编码: </span></el-col><el-col :span="7" ><span >{{project.projectCode}}&nbsp;</span></el-col>
  18. <el-col :span="5" v-if="user.role>0 || user.id == project.creatorId || user.id == project.inchargerId"><span class="gray_label">合同金额:</span></el-col>
  19. <el-col :span="7" v-if="user.role>0 || user.id == project.creatorId || user.id == project.inchargerId">
  20. <span >{{project.contractAmount == null?'-':project.contractAmount | numberToCurrency}} 元</span></el-col>
  21. </el-row>
  22. <el-row :gutter="10">
  23. <el-col :span="5" ><span class="gray_label">项目级别: </span></el-col><el-col :span="7" ><span >{{levelTxt[project.level]}}</span></el-col>
  24. <el-col :span="5" ><span class="gray_label">创建日期:</span></el-col><el-col :span="7" ><span>{{project.createDate}}</span></el-col>
  25. </el-row>
  26. <el-row :gutter="10">
  27. <el-col :span="5" ><span class="gray_label">计划开始日期:</span></el-col><el-col :span="7" >
  28. <span >{{project.planStartDate==null?'-':project.planStartDate}}</span></el-col>
  29. <el-col :span="5" ><span class="gray_label">计划结束日期:</span></el-col><el-col :span="7" ><span>
  30. {{project.planEndDate == null?'-':project.planEndDate}}</span></el-col>
  31. </el-row>
  32. <el-row :gutter="10">
  33. <el-col :span="5" ><span class="gray_label">实际完成日期:</span></el-col><el-col :span="7" ><span>
  34. {{project.finishDate==null?'-':project.finishDate}}</span></el-col>
  35. </el-row>
  36. <el-row :gutter="10" v-if="yonghuUser.customDegreeActive == 1">
  37. <el-col :span="5" ><span class="gray_label">{{yonghuUser.customDegreeName}}:</span></el-col><el-col :span="18" ><span>
  38. {{project.associateDegreeNames}}</span></el-col>
  39. </el-row>
  40. </div>
  41. <div class="box" style="margin-top:10px;">
  42. <div><label>相关人员</label>
  43. <el-link v-if="user.id == project.creatorId || user.id == project.inchargerId" @click="showEditPar" style="float:right;"><i class="el-icon-edit" ></i></el-link>
  44. </div>
  45. <div style="margin-top:10px;color:#999;">负责人</div>
  46. <div><el-link style="margin:10px" @click="showUser(project.inchargerId)">{{project.inchargerName}}</el-link></div>
  47. <div v-show="project.isPublic == 0" style="color:#999;">参与人</div>
  48. <div v-show="project.isPublic == 0" >
  49. <el-link v-for="item in project.participationList" :key="item.id" style="margin:10px;" @click="showUser(item.id)">{{item.name}}</el-link>
  50. <el-button class="el-icon-plus" @click="addMembVisible=true" size="mini"></el-button>
  51. </div>
  52. </div>
  53. <div class="box info" style="margin-top:10px;" v-if="user.id == project.creatorId || user.id == project.inchargerId || user.role > 0">
  54. <div><label>成本基线<el-link v-if="user.id == project.creatorId || user.id == project.inchargerId" @click="showEditBase" style="float:right;"><i class="el-icon-edit" ></i></el-link></label>
  55. <el-row :gutter="10">
  56. <div v-for="item in projectBaseCostData" :key="item.id">
  57. <el-col :span="5" ><span class="gray_label">{{item.baseName}}:</span></el-col>
  58. <el-col :span="7" align="right" ><span style="padding-right:20px;">
  59. ¥{{item.baseAmount==null?'-':item.baseAmount | numberToCurrency}}</span></el-col>
  60. </div>
  61. </el-row>
  62. </div>
  63. </div>
  64. <!--项目相关工程专业 -->
  65. <div class="box info" style="margin-top:10px;" v-if="user.company.packageEngineering == 1">
  66. <div><label>相关工程专业<el-link v-if="user.id == project.creatorId || user.id == project.inchargerId" @click="showEditProfession" style="float:right;"><i class="el-icon-edit" ></i></el-link></label>
  67. <el-row :gutter="10" v-for="item in projectProfessionListOnPage" :key="item.id">
  68. <el-col :span="5" ><span >{{item.professionName}}</span></el-col>
  69. <el-col :span="2" ><span >{{item.percentage}}%</span></el-col>
  70. <el-col :span="14" ><span style="margin: 0 5px;font-size:13px;" v-for="memb in item.membList" :key="memb">{{memb.membName}}({{memb.percentage}}%)</span></el-col>
  71. <el-col :span="3" ><span >{{item.inchargerName}}</span></el-col>
  72. </el-row>
  73. </div>
  74. </div>
  75. <!--项目相关领导 -->
  76. <div class="box info" style="margin-top:10px;" >
  77. <div><label>相关领导<el-link v-if="user.id == project.creatorId || user.id == project.inchargerId" @click="showChooseLeaderTree" style="float:right;"><i class="el-icon-edit" ></i></el-link></label>
  78. </div>
  79. <el-row :gutter="10">
  80. <el-col :span="24" ><span v-for="item in chosenLeaders" :key="item.userId" style="margin-right:10px;">
  81. <el-link @click="showUser(item.userId)">{{item.userName}}</el-link>
  82. </span>
  83. </el-col>
  84. </el-row>
  85. </div>
  86. <div class="box" style="margin-top:10px;">
  87. <label>项目统计</label>
  88. <div>
  89. <el-row :gutter="10">
  90. <el-col :span="4" style="text-align:center;">
  91. <p style="color:#666;font-size:12px;">已完成</p>
  92. <p style="font-size:20px;font-weight:bold;color:green;">{{taskSum.finishCount}}</p>
  93. </el-col>
  94. <el-col :span="4" style="text-align:center;">
  95. <p style="color:#666;font-size:12px;">未完成</p>
  96. <p style="font-size:20px;color:blue;font-weight:bold;">{{taskSum.unfinishCount}}</p>
  97. </el-col>
  98. <el-col :span="4" style="text-align:center;">
  99. <p style="color:#666;font-size:12px;">已逾期</p>
  100. <p style="font-size:20px;color:red;font-weight:bold;">{{taskSum.timeupCount}}</p>
  101. </el-col>
  102. <el-col :span="4" style="text-align:center;">
  103. <p style="color:#666;font-size:12px;">待认领</p>
  104. <p style="font-size:20px;color:#orange;font-weight:bold;">{{taskSum.unassignCount}}</p>
  105. </el-col>
  106. <el-col :span="4" style="text-align:center;">
  107. <p style="color:#666;font-size:12px;">今日到期</p>
  108. <p style="font-size:20px;font-weight:bold;color:pink;">{{taskSum.todayTimeupCount}}</p>
  109. </el-col>
  110. <el-col :span="4" style="text-align:center;">
  111. <p style="color:#666;font-size:12px;">逾期完成</p>
  112. <p style="font-size:20px;font-weight:bold;color:gray;">{{taskSum.timeupFinishCount}}</p>
  113. </el-col>
  114. </el-row>
  115. </div>
  116. </div>
  117. </el-col>
  118. <el-col :span="7">
  119. <!--进度显示 -->
  120. <div v-if="user.company.packageEngineering == 1" style="margin-bottom:10px;background:#fff;border: 1px solid #eeeeee;border-radius:5px;min-height:305px;padding-left:5px;padding-right:5px;">
  121. <p><i class="el-icon-odometer"></i><span style="margin-left:5px;">完成情况</span></p>
  122. <el-divider></el-divider>
  123. <el-row><el-col :span="12"><span>项目总进度</span></el-col>
  124. <el-col :span="12"><el-progress :percentage="progressData.totalProjectProgress" ></el-progress></el-col></el-row>
  125. <p style="font-size:12px;color:#666;">各专业进度</p>
  126. <el-table :show-header="false" :data="progressData.professionList" row-key="id" size="small" :tree-props="{children: 'membList', hasChildren: 'hasChildren'}">
  127. <el-table-column
  128. prop="professionName">
  129. </el-table-column>
  130. <el-table-column
  131. prop="progress"
  132. width="100">
  133. <template slot-scope="scope">
  134. <el-progress :percentage="scope.row.progress" ></el-progress>
  135. </template>
  136. </el-table-column>
  137. </el-table>
  138. </div>
  139. <div style="background:#fff;border: 1px solid #eeeeee;border-radius:5px;min-height:547px;padding-left:5px;padding-right:5px;">
  140. <div>
  141. <p><i class="el-icon-trophy"></i><span style="margin-left:5px;">里程碑</span></p>
  142. </div>
  143. <el-timeline :reverse="reverse" style="padding-left: 3px;">
  144. <el-timeline-item
  145. v-for="(task, index) in mileStoneList"
  146. :key="index"
  147. :color="task.taskStatus==0?'#ddd':'#830BE2'"
  148. size="large"
  149. :timestamp="task.endDate">
  150. {{task.name}}
  151. </el-timeline-item>
  152. </el-timeline>
  153. </div>
  154. </el-col>
  155. </el-row>
  156. </div>
  157. <!--用户详细信息弹出框-->
  158. <el-dialog title="查看详情" v-if="userDetailVisible" :visible.sync="userDetailVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  159. <div class="line"><span>姓名</span><span>{{userDetail.name}}</span></div>
  160. <div class="line"><span>手机号码</span><span>{{userDetail.phone}}</span></div>
  161. <div class="line"><span>角色</span><span>{{roleArray[userDetail.role]}}</span></div>
  162. <div class="line"><span>部门</span><span>{{userDetail.departmentName}}</span></div>
  163. <div class="line" v-if="user.role>0&&user.role<=3"><span>成本</span><span>{{userDetail.cost}}元/小时</span></div>
  164. <div slot="footer" class="dialog-footer">
  165. <el-button type="primary" @click="userDetailVisible = false" >确定</el-button>
  166. </div>
  167. </el-dialog>
  168. <!--编辑基本信息界面-->
  169. <el-dialog :title="title" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth" width="600px">
  170. <el-form ref="basicInfoForm" :model="addForm" :rules="rules" label-width="120px">
  171. <el-form-item label="项目编号" >
  172. <el-input v-model="addForm.code" placeholder="请输入项目编号" clearable></el-input>
  173. </el-form-item>
  174. <el-form-item label="项目名称" prop="name">
  175. <el-input v-model="addForm.name" placeholder="请输入项目名称" clearable></el-input>
  176. </el-form-item>
  177. <el-form-item label="级别" >
  178. <el-select v-model="addForm.level" placeholder="请选择级别" style="width:32%;" >
  179. <el-option v-for="item in importanceList" :key="item.id" :label="item.label" :value="item.id"></el-option>
  180. </el-select>
  181. <span style="margin-left:50px;margin-right:10px;">合同金额</span>
  182. <el-input v-model="addForm.contractAmount" id="contractAmount" style="width:32%;"
  183. placeholder="整数" clearable @keyup.native="restrictNumber('contractAmount')"></el-input><span style="margin-left:10px;">元</span>
  184. </el-form-item>
  185. <el-form-item label="开始日期" prop="planStartDate">
  186. <el-date-picker v-model="addForm.planStartDate"
  187. :editable="false"
  188. format="yyyy-MM-dd"
  189. value-format="yyyy-MM-dd"
  190. :clearable="false" type="date"
  191. placeholder="选择日期"></el-date-picker>
  192. </el-form-item>
  193. <el-form-item label="截止日期" prop="planEndDate">
  194. <el-date-picker v-model="addForm.planEndDate"
  195. :editable="false"
  196. format="yyyy-MM-dd"
  197. value-format="yyyy-MM-dd"
  198. :clearable="false" type="date"
  199. placeholder="选择日期"></el-date-picker>
  200. </el-form-item>
  201. </el-form>
  202. <div slot="footer" class="dialog-footer">
  203. <el-button @click.native="addFormVisible = false">取消</el-button>
  204. <el-button type="primary" @click="submitInsert" :loading="addLoading">提交</el-button>
  205. </div>
  206. </el-dialog>
  207. <el-dialog title="校正成本基线" v-if="addBaseFormVisible" :visible.sync="addBaseFormVisible" :close-on-click-modal="false" customClass="customWidth" width="600px">
  208. <el-form ref="basicInfoForm" label-width="120px">
  209. <el-form-item v-for="(item, index) in modBaseCostData" :label="item.baseName" :key="item.id">
  210. <el-input :id="'baseCost'+index" v-model="item.baseAmount" placeholder="请输入" clearable @keyup.native="restrictNumber('baseCost'+index)"></el-input>
  211. </el-form-item>
  212. <el-form-item label="备注" >
  213. <el-input v-model="remark" placeholder="请输入校正原因" ></el-input>
  214. </el-form-item>
  215. </el-form>
  216. <div slot="footer" class="dialog-footer">
  217. <el-button @click.native="addBaseFormVisible = false">取消</el-button>
  218. <el-button type="primary" @click="adjustBase" :loading="addLoading">提交</el-button>
  219. </div>
  220. </el-dialog>
  221. <!--编辑参与人界面-->
  222. <el-dialog :title="title" v-if="pVisible" :visible.sync="pVisible" :close-on-click-modal="false" customClass="customWidth" width="600px">
  223. <el-form ref="participForm" :model="addForm" :rules="rules" label-width="120px">
  224. <el-form-item label="全部参与者">
  225. <el-select v-model="addForm.userId" multiple filterable placeholder="请选择参与者" style="width:100%;" @change="changeParticipator">
  226. <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id"></el-option>
  227. </el-select>
  228. </el-form-item>
  229. <el-form-item label="主要负责人" >
  230. <el-select v-model="addForm.inchargerId" filterable placeholder="请选择负责人" style="width:100%;" >
  231. <el-option v-for="item in project.participationList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  232. </el-select>
  233. </el-form-item>
  234. </el-form>
  235. <div slot="footer" class="dialog-footer">
  236. <el-button @click.native="pVisible = false">取消</el-button>
  237. <el-button type="primary" @click="submitParticip" :loading="addLoading">提交</el-button>
  238. </div>
  239. </el-dialog>
  240. <!--添加参与人界面-->
  241. <el-dialog title="添加参与人" v-if="addMembVisible" :visible.sync="addMembVisible" :close-on-click-modal="false" customClass="customWidth" width="600px">
  242. <el-form ref="addMembForm" :model="addMembForm" label-width="120px">
  243. <el-form-item label="新增参与者">
  244. <el-select v-model="addMembForm.userId" multiple filterable placeholder="请选择参与者" style="width:100%;" >
  245. <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id"></el-option>
  246. </el-select>
  247. </el-form-item>
  248. </el-form>
  249. <div slot="footer" class="dialog-footer">
  250. <el-button @click.native="addMembVisible = false">取消</el-button>
  251. <el-button type="primary" @click="submitAddMemb" :loading="addLoading">提交</el-button>
  252. </div>
  253. </el-dialog>
  254. <!--修改工程专业界面-->
  255. <el-dialog title="工程专业" v-if="editProfessionDialog" :visible.sync="editProfessionDialog"
  256. :close-on-click-modal="false" customClass="customWidth" width="1000px">
  257. <el-table :data="projectProfessionList" size="small" max-height="400" :key="Math.random()">
  258. <el-table-column prop="professionId" width="200">
  259. <template slot-scope="scope">
  260. <el-select v-model="scope.row.professionId" >
  261. <el-option v-for="item in professionList" :key="item.id" :label="item.name" :value="item.id"/>
  262. </el-select>
  263. </template>
  264. <template slot="header" >
  265. <span style="font-size:14px;font-weight:normal;">专业名称</span>
  266. </template>
  267. </el-table-column>
  268. <el-table-column prop="percentage" width="100" label="占比">
  269. <template slot-scope="scope">
  270. <el-input type="number" v-model="scope.row.percentage"></el-input>
  271. </template>
  272. </el-table-column>
  273. <el-table-column prop="membNames" label="相关人员及占比">
  274. <template slot-scope="scope">
  275. <span style="margin:0 5px;" v-for="item in scope.row.membList" :key="item.membId">{{item.membName}}({{item.percentage}}%)</span>
  276. <el-link @click="showEditPpMembs(scope.row)">{{(scope.row.membList == null || scope.row.membList.length == 0)?'设置专业参与人员':'设置'}}</el-link>
  277. </template>
  278. </el-table-column>
  279. <el-table-column prop="inchargerName" width="120" label="负责人">
  280. <template slot-scope="scope">
  281. <el-select v-model="scope.row.inchargerId" >
  282. <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id">
  283. </el-option>
  284. </el-select>
  285. </template>
  286. </el-table-column>
  287. <el-table-column width="80">
  288. <template slot-scope="scope">
  289. <el-button icon="el-icon-delete" size="mini" style="margin-left:10px;" @click.stop.native="deleteItem(scope.$index)"></el-button>
  290. </template>
  291. <template slot="header" >
  292. <el-link type="primary" :underline="false" @click="addItem">添加</el-link>
  293. </template>
  294. </el-table-column>
  295. </el-table>
  296. <div slot="footer" class="dialog-footer">
  297. <el-button @click.native="editProfessionDialog = false">取消</el-button>
  298. <el-button type="primary" @click="saveProjectProfessions" :loading="addLoading">提交</el-button>
  299. </div>
  300. </el-dialog>
  301. <!-- 项目专业人员的设置 -->
  302. <el-dialog title="设置项目专业人员" v-if="editPpMembDialog" :visible.sync="editPpMembDialog" :close-on-click-modal="false" customClass="customWidth" width="600px">
  303. <el-table :data="curProfessionRow.membList" height="400">
  304. <el-table-column prop="name" label="专业人员">
  305. <template slot-scope="scope">
  306. <el-select v-model="scope.row.membId" filterable placeholder="请选择专业参与人" style="width:100%;" >
  307. <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id">
  308. </el-option>
  309. </el-select>
  310. </template>
  311. </el-table-column>
  312. <el-table-column prop="percentage" width="120" label="占比(%)">
  313. <template slot-scope="scope">
  314. <el-input type="number" v-model="scope.row.percentage"></el-input>
  315. </template>
  316. </el-table-column>
  317. <el-table-column width="80">
  318. <template slot-scope="scope">
  319. <el-button icon="el-icon-delete" size="mini" style="margin-left:10px;" @click.stop.native="deleteMembItem(scope.$index)"></el-button>
  320. </template>
  321. <template slot="header" >
  322. <el-link @click="addMembItem">添加</el-link>
  323. </template>
  324. </el-table-column>
  325. </el-table>
  326. <div slot="footer" class="dialog-footer">
  327. <el-button @click="editPpMembDialog = false" >取消</el-button>
  328. <el-button type="primary" @click="addPpMemb" >确定</el-button>
  329. </div>
  330. </el-dialog>
  331. <!-- 按部门选择相关领导 -->
  332. <el-dialog title="选择相关领导" v-if="chooseLeaderVisible" :visible.sync="chooseLeaderVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  333. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  334. <div class="tree" style="height:400px">
  335. <el-scrollbar style="height:100%">
  336. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id"
  337. ref="chooseLeaderTree" @check-change="onLeaderTreeItemChange" :default-checked-keys="addForm.notifyUserIds"
  338. highlight-current ></el-tree>
  339. </el-scrollbar>
  340. </div>
  341. <div>已选中&nbsp;{{chosenMembCount}}&nbsp;人</div>
  342. <div slot="footer" class="dialog-footer">
  343. <el-button @click="chooseLeaderVisible = false" >取消</el-button>
  344. <el-button type="primary" @click="chooseLeader()" >确定</el-button>
  345. </div>
  346. </el-dialog>
  347. </div>
  348. </template>
  349. <style scoped>
  350. .fileTypeIcon {
  351. color:#20a0ff;font-size:20px;
  352. }
  353. .box {
  354. background:#fff;border: 1px solid #eeeeee;border-radius:5px;padding:10px;
  355. }
  356. .info span {
  357. color:#303133;
  358. }
  359. .gray_label {
  360. color:#999 !important;
  361. }
  362. .el-row {
  363. margin-top:10px;
  364. }
  365. .line {
  366. padding:10px;
  367. }
  368. .line span{
  369. font-size:15px;
  370. }
  371. .line span:nth-child(even){
  372. float:right;
  373. }
  374. </style>
  375. <script>
  376. import util from "../../common/js/util";
  377. export default {
  378. data() {
  379. return {
  380. remark:null,
  381. progressData:{},
  382. deptMembData: [
  383. {
  384. id: 0,
  385. label: '未分配',
  386. }
  387. ],
  388. chosenMembCount:0,
  389. chosenLeaders:[],
  390. chooseLeaderVisible:false,
  391. projectProfessionItem:null,
  392. curProfessionRow:null,
  393. editPpMembDialog:false,
  394. professionList:[],
  395. editProfessionDialog: false,
  396. projectProfessionList:[],
  397. modBaseCostData:[],
  398. projectBaseCostData:[],
  399. roleArray:["普通员工","超级管理员", "系统管理员", "公司高层","人事管理员", "项目管理员"],
  400. addBaseFormVisible:false,
  401. addMembVisible:false,
  402. addMembForm:{},
  403. pVisible:false,
  404. taskSum:{},
  405. participator:[],
  406. users:[],
  407. addForm:{},
  408. addFormVisible:false,
  409. userDetail:{},
  410. userDetailVisible: false,
  411. importanceList:[{id:1,label:'正常'},{id:2,label:'紧急'},{id:3,label:'重要'},{id:4,label:'重要且紧急'}],
  412. //1-一般,2-紧急,3-重要,4-重要且紧急
  413. levelTxt:["全部","正常","紧急","重要","重要且紧急"],
  414. //1-进行中,2-已完成,3-已撤销
  415. statusTxt: ["全部","进行中","已完成","已撤销"],
  416. mileStoneList:[],
  417. reverse:false,
  418. project:{},
  419. addFolderDialog: false,
  420. upLoading:false,
  421. keyword:null,
  422. user: JSON.parse(sessionStorage.getItem("user")),
  423. recentFiles: [],
  424. addLoading: false,
  425. curProjectId:null,
  426. title: "",
  427. rules: {
  428. name: [{ required: true, message: "请输入项目名称", trigger: "blur" }],
  429. },
  430. yonghuUser: []
  431. };
  432. },
  433. filters: {
  434. numberToCurrency(value) {
  435. console.log('info numberToCurrency='+value);
  436. if (!value || value=='-') return '0.00'
  437. value = value.toFixed(2)
  438. const intPart = Math.trunc(value)
  439. const intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
  440. let floatPart = '.00'
  441. const valueArray = value.toString().split('.')
  442. if (valueArray.length === 2) { // 有小数部分
  443. floatPart = valueArray[1].toString() // 取得小数部分
  444. return intPartFormat + '.' + floatPart
  445. }
  446. return intPartFormat + floatPart
  447. }
  448. },
  449. methods: {
  450. userssHu() {
  451. this.http.post('/time-type/getCompanyTimeSetting',{
  452. companyId: this.user.companyId
  453. },
  454. res => {
  455. if (res.code == "ok") {
  456. this.yonghuUser = res.data
  457. console.log(this.yonghuUser)
  458. }
  459. },
  460. error => {
  461. this.$message({
  462. message: error,
  463. type: "error"
  464. });
  465. }
  466. );
  467. },
  468. getProgressData() {
  469. this.http.post("/project-profession/getProgressData", {projectId: this.curProjectId},
  470. res => {
  471. if (res.code == "ok") {
  472. this.progressData = res.data;
  473. } else {
  474. this.$message({
  475. message: res.msg,
  476. type: "error"
  477. });
  478. }
  479. },
  480. error => {
  481. this.$message({
  482. message: error,
  483. type: "error"
  484. });
  485. });
  486. },
  487. setUserToDept(list) {
  488. for (var i in list) {
  489. if (list[i].children != null) {
  490. this.setUserToDept(list[i].children);
  491. }
  492. if (list[i].userList != null) {
  493. if (list[i].children == null) {
  494. list[i].children = [];
  495. }
  496. list[i].userList.forEach(element => {
  497. var obj = {id: element.id, label:element.name, parentId:element.departmentId, isUser:1};
  498. list[i].children.push(obj);
  499. });
  500. }
  501. }
  502. },
  503. // 获取部门列表
  504. getDepartment() {
  505. this.http.post("/department/listAllMemb", {},
  506. res => {
  507. if (res.code == "ok") {
  508. var list = res.data;
  509. //设置员工到部门下面
  510. this.setUserToDept(list);
  511. this.deptMembData = list;
  512. } else {
  513. this.$message({
  514. message: res.msg,
  515. type: "error"
  516. });
  517. }
  518. },
  519. error => {
  520. this.$message({
  521. message: error,
  522. type: "error"
  523. });
  524. });
  525. },
  526. getProjectNotifyUserList(projectId) {
  527. this.http.post("/project-notify-user/get", {projectId: projectId},
  528. res => {
  529. if (res.code == "ok") {
  530. var chosenLeaderIds = [];
  531. var chosenLeaderNames = '';
  532. var leaderList = res.data;
  533. this.chosenLeaders = leaderList;
  534. for(var j in leaderList) {
  535. chosenLeaderIds.push(leaderList[j].userId)
  536. chosenLeaderNames += leaderList[j].userName+',';
  537. }
  538. if (chosenLeaderNames.length > 0) {
  539. chosenLeaderNames = chosenLeaderNames.substring(0, chosenLeaderNames.length -1);
  540. }
  541. this.addForm.notifyUserIds = chosenLeaderIds;
  542. this.addForm.notifyUserNames = chosenLeaderNames;
  543. } else {
  544. this.$message({
  545. message: res.msg,
  546. type: "error"
  547. });
  548. }
  549. },
  550. error => {
  551. this.$message({
  552. message: error,
  553. type: "error"
  554. });
  555. });
  556. },
  557. showChooseLeaderTree() {
  558. this.chosenMembCount = this.chosenLeaders.length;
  559. this.chooseLeaderVisible = true;
  560. },
  561. onLeaderTreeItemChange() {
  562. var chosenList = this.$refs.chooseLeaderTree.getCheckedNodes();
  563. var list = chosenList.filter(item=>item.isUser == 1);
  564. this.chosenMembCount = list.length;
  565. },
  566. //选中相关领导
  567. chooseLeader() {
  568. this.chooseLeaderVisible = false;
  569. var chosenList = this.$refs.chooseLeaderTree.getCheckedNodes();
  570. var chosenMembList = chosenList.filter(item=>item.isUser == 1);
  571. this.addForm.notifyUserNames = '';
  572. this.addForm.notifyUserIds = [];
  573. this.chosenLeaders = [];
  574. for (var i=0;i<chosenMembList.length; i++) {
  575. this.addForm.notifyUserIds.push(chosenMembList[i].id);
  576. this.addForm.notifyUserNames += chosenMembList[i].label+',';
  577. var item = {userId:chosenMembList[i].id, userName:chosenMembList[i].label};
  578. this.chosenLeaders.push(item);
  579. }
  580. if (this.addForm.notifyUserNames.length > 0) {
  581. this.addForm.notifyUserNames = this.addForm.notifyUserNames.substring(0, this.addForm.notifyUserNames.length-1);
  582. }
  583. //提交数据修改
  584. this.http.post("/project-notify-user/modify", {projectId: this.curProjectId, chosenLeaders: JSON.stringify(this.chosenLeaders)},
  585. res => {
  586. if (res.code == "ok") {
  587. } else {
  588. this.$message({
  589. message: res.msg,
  590. type: "error"
  591. });
  592. }
  593. },
  594. error => {
  595. this.$message({
  596. message: error,
  597. type: "error"
  598. });
  599. });
  600. },
  601. restrictNumber(targetId) {
  602. let inpu = document.getElementById(targetId);
  603. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  604. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  605. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  606. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  607. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  608. inpu.value = parseFloat(inpu.value);
  609. }
  610. },
  611. addPpMemb() {
  612. //检查合计比例是否到达100%
  613. let p = 0;
  614. let hasNoMemb = false;
  615. this.curProfessionRow.membList.forEach(m=>{
  616. p += parseInt(m.percentage);
  617. //检查人员是否选择
  618. if (m.membId == null) {
  619. hasNoMemb = true;
  620. }
  621. });
  622. if (hasNoMemb) {
  623. this.$message({
  624. message: '专业人员不能为空',
  625. type: "error"
  626. });
  627. return;
  628. }
  629. //检查人员不能重复
  630. let hasDuplicate = false;
  631. this.curProfessionRow.membList.forEach(m=>{
  632. if (this.curProfessionRow.membList.filter(innerM=>innerM.membId == m.membId).length>1) {
  633. hasDuplicate = true;
  634. }
  635. });
  636. if (hasDuplicate) {
  637. this.$message({
  638. message: '专业人员不能重复',
  639. type: "error"
  640. });
  641. return;
  642. }
  643. if (p != 100) {
  644. this.$message({
  645. message: '占比合计必须是100%',
  646. type: "error"
  647. });
  648. return;
  649. }
  650. this.editPpMembDialog = false;
  651. this.curProfessionRow.membList.forEach(m=>{
  652. m.membName = this.participator.filter(p=>p.id == m.membId)[0].name;
  653. });
  654. this.projectProfessionItem.membList = JSON.parse(JSON.stringify(this.curProfessionRow.membList));
  655. },
  656. //删除专业人员
  657. deleteMembItem(index) {
  658. this.curProfessionRow.membList.splice(index,1);
  659. },
  660. //添加专业人员
  661. addMembItem() {
  662. if (this.curProfessionRow.membList == null) {
  663. this.curProfessionRow.membList = [{membId:null, percentage:100}];
  664. } else {
  665. let p = 0;
  666. this.curProfessionRow.membList.forEach(m=>{
  667. p += parseInt(m.percentage);
  668. });
  669. this.curProfessionRow.membList.push({membId:null, percentage:100-p});
  670. }
  671. this.$forceUpdate();
  672. },
  673. showEditPpMembs(row) {
  674. this.projectProfessionItem = row;
  675. this.curProfessionRow = JSON.parse(JSON.stringify(row));
  676. if (this.curProfessionRow.membList == null || this.curProfessionRow.membList.length == 0) {
  677. this.curProfessionRow.membList = [{membId:null, percentage:100}];
  678. }
  679. this.editPpMembDialog = true;
  680. },
  681. checkProjectProfession() {
  682. //检查合计比例是否到达100%
  683. let p = 0;
  684. let hasNoMemb = false;
  685. let hasNoProfession = false;
  686. let hasNoMembList = false;
  687. this.projectProfessionList.forEach(m=>{
  688. p += parseInt(m.percentage);
  689. //检查人员是否选择
  690. if (m.inchargerId == null) {
  691. hasNoMemb = true;
  692. }
  693. if (m.professionId == null) {
  694. hasNoProfession = true;
  695. }
  696. if (m.membList == null) {
  697. hasNoMembList = true;
  698. }
  699. });
  700. if (hasNoProfession) {
  701. this.$message({
  702. message: '专业不能为空',
  703. type: "error"
  704. });
  705. return false;
  706. }
  707. if (hasNoMembList) {
  708. this.$message({
  709. message: '专业相关人员不能为空',
  710. type: "error"
  711. });
  712. return false;
  713. }
  714. if (hasNoMemb) {
  715. this.$message({
  716. message: '专业负责人不能为空',
  717. type: "error"
  718. });
  719. return false;
  720. }
  721. //检查专业不能重复
  722. let hasDuplicate = false;
  723. this.projectProfessionList.forEach(m=>{
  724. if (this.projectProfessionList.filter(innerM=>innerM.professionId == m.professionId).length>1) {
  725. hasDuplicate = true;
  726. }
  727. });
  728. if (hasDuplicate) {
  729. this.$message({
  730. message: '专业不能重复',
  731. type: "error"
  732. });
  733. return false;
  734. }
  735. if (p != 100) {
  736. this.$message({
  737. message: '专业占比合计必须是100%',
  738. type: "error"
  739. });
  740. return false;
  741. }
  742. return true;
  743. },
  744. showEditProfession() {
  745. if (this.professionList.length == 0) {
  746. this.getProfessionList();
  747. }
  748. this.projectProfessionList = JSON.parse(JSON.stringify(this.projectProfessionListOnPage));
  749. this.editProfessionDialog = true;
  750. },
  751. getProjectProfessionList() {
  752. this.http.post("/project-profession/get", {projectId: this.curProjectId},
  753. res => {
  754. if (res.code == "ok") {
  755. this.projectProfessionListOnPage = res.data;
  756. } else {
  757. this.$message({
  758. message: res.msg,
  759. type: "error"
  760. });
  761. }
  762. },
  763. error => {
  764. this.$message({
  765. message: error,
  766. type: "error"
  767. });
  768. });
  769. },
  770. //保存项目专业
  771. saveProjectProfessions() {
  772. if (!this.checkProjectProfession()) {//检查不通过,直接返回
  773. return;
  774. }
  775. let projectId = this.curProjectId;
  776. var list = this.projectProfessionList.filter(p=>p.professionId != null);
  777. list.forEach(p=>p.inchargerName = this.participator.filter(m=>m.id == p.inchargerId)[0].name);
  778. list.forEach(p=>p.professionName = this.professionList.filter(m=>m.id == p.professionId)[0].name);
  779. this.http.post("/project-profession/modify", {projectId: projectId, json: JSON.stringify(list)},
  780. res => {
  781. if (res.code == "ok") {
  782. this.editProfessionDialog = false;
  783. this.projectProfessionListOnPage = res.data;
  784. this.$message({
  785. message: '修改成功',
  786. type: "success"
  787. });
  788. } else {
  789. this.$message({
  790. message: res.msg,
  791. type: "error"
  792. });
  793. }
  794. },
  795. error => {
  796. this.$message({
  797. message: error,
  798. type: "error"
  799. });
  800. });
  801. },
  802. //删除项目专业
  803. deleteItem(index) {
  804. this.projectProfessionList.splice(index,1);
  805. },
  806. //添加项目专业
  807. addItem() {
  808. let p = 0;
  809. this.projectProfessionList.forEach(m=>{
  810. p += parseInt(m.percentage);
  811. });
  812. this.projectProfessionList.push( { professionId:null, inchargerId:null,membIds:[], percentage: 100-p});
  813. },
  814. getProfessionList() {
  815. this.http.post("/profession/getAll", {},
  816. res => {
  817. if (res.code == "ok") {
  818. var list = res.data;
  819. this.professionList = list;
  820. } else {
  821. this.$message({
  822. message: res.msg,
  823. type: "error"
  824. });
  825. }
  826. },
  827. error => {
  828. this.$message({
  829. message: error,
  830. type: "error"
  831. });
  832. });
  833. },
  834. getProjectBaseData(projectId) {
  835. this.http.post('/project-basecost/get',{projectId: projectId},
  836. res => {
  837. if (res.code == "ok") {
  838. this.projectBaseCostData = res.data;
  839. } else {
  840. this.$message({
  841. message: res.msg,
  842. type: "error"
  843. });
  844. }
  845. },
  846. error => {
  847. this.$message({
  848. message: error,
  849. type: "error"
  850. });
  851. }
  852. );
  853. },
  854. adjustBase() {
  855. //如果没有做修改,不提交数据
  856. var hasChangeData = false;
  857. for (var i=0;i<this.modBaseCostData.length; i++) {
  858. var item = this.modBaseCostData[i];
  859. var oldAmount = this.projectBaseCostData.filter(p=>p.id == item.id)[0].baseAmount;
  860. if (item.baseAmount != oldAmount) {
  861. hasChangeData = true;
  862. break;
  863. }
  864. }
  865. if (!hasChangeData) {
  866. this.addBaseFormVisible = false;
  867. return;
  868. }
  869. this.http.post('/project/adjustBase', {
  870. id: this.addForm.id,
  871. contractAmount: this.addForm.contractAmount,
  872. baseCostData:JSON.stringify(this.modBaseCostData),
  873. remark: this.remark
  874. },
  875. res => {
  876. if (res.code == "ok") {
  877. this.getProjectBaseData(this.curProjectId);
  878. this.addBaseFormVisible = false;
  879. this.$message({
  880. message: '校正成功',
  881. type: "success"
  882. });
  883. this.$emit("basecost-change", null);
  884. } else {
  885. this.$message({
  886. message: res.msg,
  887. type: "error"
  888. });
  889. }
  890. },
  891. error => {
  892. this.$message({
  893. message: error,
  894. type: "error"
  895. });
  896. });
  897. },
  898. //提交添加参与人的请求
  899. submitAddMemb() {
  900. this.addLoading = true;
  901. let formData = new FormData();
  902. formData.append("id", this.curProjectId);
  903. if(this.addMembForm.userId.length != 0) {
  904. for(var j in this.addMembForm.userId) {
  905. formData.append("userId", this.addMembForm.userId[j]);
  906. }
  907. }
  908. this.http.uploadFile('/project/addMemb',formData,
  909. res => {
  910. this.addLoading = false;
  911. if (res.code == "ok") {
  912. this.$message({
  913. message: "添加成功",
  914. type: "success"
  915. });
  916. this.addMembVisible = false;
  917. this.getProjectInfo();
  918. } else {
  919. this.$message({
  920. message: res.msg,
  921. type: "error"
  922. });
  923. }
  924. },
  925. error => {
  926. this.addLoading = false;
  927. this.$message({
  928. message: error,
  929. type: "error"
  930. });
  931. });
  932. },
  933. editTask(task) {
  934. // this.addForm = JSON.parse(JSON.stringify(task));
  935. this.addFormVisible = true;
  936. this.addLoading = false;
  937. this.title = "编辑任务";
  938. this.getTaskDetail(task.id);
  939. },
  940. getProjectTaskSum() {
  941. this.http.post('/project/taskSum', {
  942. id: this.curProjectId
  943. },
  944. res => {
  945. if (res.code == "ok") {
  946. this.taskSum = res.data;
  947. } else {
  948. this.$message({
  949. message: res.msg,
  950. type: "error"
  951. });
  952. }
  953. },
  954. error => {
  955. this.$message({
  956. message: error,
  957. type: "error"
  958. });
  959. });
  960. },
  961. number(){  
  962.     this.addForm.contractAmount = this.addForm.contractAmount.replace(/[^\.\d]/g,'');
  963. this.addForm.contractAmount = this.addForm.contractAmount.replace('.','');
  964.   },
  965. //选择参与人
  966. changeParticipator() {
  967. //检查是否在参与人中,如果没有需要加入到参与人中
  968. console.log(this.addForm.userId);
  969. var find = false;
  970. this.project.participationList = [];
  971. this.addForm.userId.forEach(u=>{
  972. var findUser = this.users.filter(au=>au.id == u)[0];
  973. this.project.participationList.push(findUser);
  974. })
  975. },
  976. getUsers() {
  977. this.http.post(this.port.manage.list, {
  978. departmentId: -1,
  979. pageIndex: 1,
  980. pageSize: 99999
  981. },
  982. res => {
  983. if (res.code == "ok") {
  984. this.users = res.data.records;
  985. } else {
  986. this.$message({
  987. message: res.msg,
  988. type: "error"
  989. });
  990. }
  991. },
  992. error => {
  993. this.$message({
  994. message: error,
  995. type: "error"
  996. });
  997. });
  998. },
  999. submitParticip() {
  1000. this.addLoading = true;
  1001. let formData = new FormData();
  1002. if(this.addForm.id != null) {
  1003. formData.append("id", this.addForm.id);
  1004. }
  1005. formData.append("name", this.addForm.name);
  1006. if(this.addForm.userId.length != 0) {
  1007. for(var j in this.addForm.userId) {
  1008. formData.append("userId", this.addForm.userId[j]);
  1009. }
  1010. }
  1011. if(this.addForm.inchargerId != null) {
  1012. formData.append("inchargerId", this.addForm.inchargerId);
  1013. }
  1014. this.http.uploadFile(this.port.project.add,formData,
  1015. res => {
  1016. this.addLoading = false;
  1017. if (res.code == "ok") {
  1018. this.$message({
  1019. message: '修改成功',
  1020. type: "success"
  1021. });
  1022. this.pVisible = false;
  1023. this.getProjectInfo();
  1024. } else {
  1025. this.$message({
  1026. message: res.msg,
  1027. type: "error"
  1028. });
  1029. }
  1030. },
  1031. error => {
  1032. this.addLoading = false;
  1033. this.$message({
  1034. message: error,
  1035. type: "error"
  1036. });
  1037. });
  1038. },
  1039. submitInsert() {
  1040. this.$refs.basicInfoForm.validate(valid => {
  1041. if (valid) {
  1042. this.addLoading = true;
  1043. let formData = new FormData();
  1044. formData.append("name", this.addForm.name);
  1045. if(this.addForm.id != null) {
  1046. formData.append("id", this.addForm.id);
  1047. }
  1048. if(this.addForm.userId.length != 0) {
  1049. for(var j in this.addForm.userId) {
  1050. formData.append("userId", this.addForm.userId[j]);
  1051. }
  1052. }
  1053. if(this.addForm.inchargerId != null) {
  1054. formData.append("inchargerId", this.addForm.inchargerId);
  1055. }
  1056. if(this.addForm.code != null) {
  1057. formData.append("code", this.addForm.code);
  1058. }
  1059. if(this.addForm.planStartDate != null) {
  1060. formData.append("planStartDate", this.addForm.planStartDate);
  1061. }
  1062. if(this.addForm.planEndDate != null) {
  1063. formData.append("planEndDate", this.addForm.planEndDate);
  1064. }
  1065. if(this.addForm.level != null) {
  1066. formData.append("level", this.addForm.level);
  1067. }
  1068. if(this.addForm.contractAmount != null) {
  1069. formData.append("contractAmount", this.addForm.contractAmount);
  1070. }
  1071. this.http.uploadFile(this.port.project.add,formData,
  1072. res => {
  1073. this.addLoading = false;
  1074. if (res.code == "ok") {
  1075. this.$message({
  1076. message: (this.addForm.id!=null?'修改':'创建')+"成功",
  1077. type: "success"
  1078. });
  1079. this.addFormVisible = false;
  1080. this.getProjectInfo();
  1081. } else {
  1082. this.$message({
  1083. message: res.msg,
  1084. type: "error"
  1085. });
  1086. }
  1087. },
  1088. error => {
  1089. this.addLoading = false;
  1090. this.$message({
  1091. message: error,
  1092. type: "error"
  1093. });
  1094. });
  1095. }
  1096. });
  1097. },
  1098. showEditBase() {
  1099. this.addForm = JSON.parse(JSON.stringify(this.project));
  1100. var list = this.project.participationList , arr = [];
  1101. for(var j in list) {
  1102. arr.push(list[j].id)
  1103. }
  1104. this.addForm.userId = arr;
  1105. this.addForm.code = this.addForm.projectCode;
  1106. this.addForm.name = this.addForm.projectName;
  1107. this.modBaseCostData = JSON.parse(JSON.stringify(this.projectBaseCostData));
  1108. this.addBaseFormVisible = true;
  1109. },
  1110. showEdit() {
  1111. this.addForm = JSON.parse(JSON.stringify(this.project));
  1112. console.log('---'+this.addForm);
  1113. console.log(this.addForm.projectCode);
  1114. var list = this.project.participationList , arr = [];
  1115. for(var j in list) {
  1116. arr.push(list[j].id)
  1117. }
  1118. this.addForm.userId = arr;
  1119. this.addForm.code = this.addForm.projectCode;
  1120. this.addForm.name = this.addForm.projectName;
  1121. this.addFormVisible = true;
  1122. },
  1123. showEditPar() {
  1124. this.addForm = JSON.parse(JSON.stringify(this.project));
  1125. this.addForm.code = this.addForm.projectCode;
  1126. this.addForm.name = this.addForm.projectName;
  1127. //设置参与人
  1128. var list = this.project.participationList , arr = [];
  1129. for(var j in list) {
  1130. arr.push(list[j].id)
  1131. }
  1132. this.addForm.userId = arr;
  1133. console.log(this.addForm.userId );
  1134. this.pVisible = true;
  1135. },
  1136. //显示用户详情
  1137. showUser(userId) {
  1138. this.userDetailVisible = true;
  1139. this.http.post(this.port.manage.userDetail, {
  1140. userId: userId
  1141. },
  1142. res => {
  1143. if (res.code == "ok") {
  1144. this.userDetail = res.data;
  1145. } else {
  1146. this.$message({
  1147. message: res.msg,
  1148. type: "error"
  1149. });
  1150. }
  1151. },
  1152. error => {
  1153. this.$message({
  1154. message: error,
  1155. type: "error"
  1156. });
  1157. });
  1158. },
  1159. cursorOver(row, column, cell, event) {
  1160. this.currentDataId = row.id;
  1161. },
  1162. viewOnline(row) {
  1163. this.http.post('/pdf-file/getProjectFile', {fileId: row.id},
  1164. res => {
  1165. if (res.code == "ok") {
  1166. console.log(res.data+'----'+row.documentName);
  1167. let routeUrl = this.$router.resolve({
  1168. path: "/viewonline",
  1169. params: {serverFname:res.data, fileName:row.documentName}
  1170. });
  1171. sessionStorage.setItem("serverFname",res.data);
  1172. sessionStorage.setItem("fileName",row.documentName);
  1173. console.log(routeUrl.href);
  1174. window.open(routeUrl.href, '_blank');
  1175. } else {
  1176. this.$message({
  1177. message: res.msg,
  1178. type: 'error'
  1179. });
  1180. }
  1181. }, error => {
  1182. this.$message({
  1183. message: error,
  1184. type: 'error'
  1185. });
  1186. })
  1187. },
  1188. openWin(url) {
  1189. var el = document.createElement("a");
  1190. document.body.appendChild(el);
  1191. el.href = encodeURI(url);
  1192. el.target = '_blank';
  1193. el.click();
  1194. document.body.removeChild(el);
  1195. },
  1196. //获取里程碑文件
  1197. getMileStoneList() {
  1198. this.http.post('/task/getMileStoneList', {
  1199. projectId: this.curProjectId,
  1200. },
  1201. res => {
  1202. if (res.code == "ok") {
  1203. this.mileStoneList = res.data;
  1204. this.mileStoneList.unshift( {id:-1, name:'开始', taskStatus:1});
  1205. } else {
  1206. this.$message({
  1207. message: res.msg,
  1208. type: "error"
  1209. });
  1210. }
  1211. },
  1212. error => {
  1213. this.$message({
  1214. message: error,
  1215. type: "error"
  1216. });
  1217. });
  1218. },
  1219. getUsers() {
  1220. this.http.post(this.port.manage.list, {
  1221. departmentId: -1,
  1222. pageIndex: 1,
  1223. pageSize: 99999
  1224. },
  1225. res => {
  1226. if (res.code == "ok") {
  1227. this.users = res.data.records;
  1228. } else {
  1229. this.$message({
  1230. message: res.msg,
  1231. type: "error"
  1232. });
  1233. }
  1234. },
  1235. error => {
  1236. this.$message({
  1237. message: error,
  1238. type: "error"
  1239. });
  1240. });
  1241. },
  1242. //获取列表
  1243. getProjectInfo() {
  1244. this.listLoading = true;
  1245. this.http.post('/project/detail', {
  1246. id: this.curProjectId
  1247. },
  1248. res => {
  1249. this.listLoading = false;
  1250. if (res.code == "ok") {
  1251. this.project = res.data;
  1252. this.participator = this.project.participationList;
  1253. } else {
  1254. this.$message({
  1255. message: res.msg,
  1256. type: "error"
  1257. });
  1258. }
  1259. },
  1260. error => {
  1261. this.listLoading = false;
  1262. this.$message({
  1263. message: error,
  1264. type: "error"
  1265. });
  1266. });
  1267. this.getProjectProfessionList();
  1268. },
  1269. refreshPage() {
  1270. this.curProjectId = parseInt(this.$route.params.id);
  1271. this.getMileStoneList();
  1272. this.getProjectInfo();
  1273. this.getProjectTaskSum();
  1274. this.getProjectBaseData(this.curProjectId);
  1275. this.getProjectNotifyUserList(this.curProjectId);
  1276. this.getProgressData();
  1277. }
  1278. },
  1279. created() {
  1280. console.log('created===');
  1281. let height = window.innerHeight;
  1282. this.tableHeight = height - 160;
  1283. const that = this;
  1284. window.onresize = function temp() {
  1285. that.tableHeight = window.innerHeight - 160;
  1286. };
  1287. },
  1288. mounted() {
  1289. console.log('mounted===');
  1290. this.curProjectId = parseInt(this.$route.params.id);
  1291. this.getDepartment();
  1292. this.getUsers();
  1293. this.getMileStoneList();
  1294. this.getProjectInfo();
  1295. this.getProjectTaskSum();
  1296. this.getProjectBaseData(this.curProjectId);
  1297. this.getProjectNotifyUserList(this.curProjectId);
  1298. this.getProgressData();
  1299. this.userssHu()
  1300. }
  1301. };
  1302. </script>