ProjectManagement.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  1. <template>
  2. <!-- 项目管理页面 -->
  3. <div class="ProjectManagement">
  4. <div class="pAHeader">
  5. <div class="pAHeader1">项目管理</div>
  6. </div>
  7. <hr>
  8. <!-- 搜索栏开始 -->
  9. <div class="selectInp">
  10. <div class="manageSelects">
  11. <div class="selectsBlock">
  12. <span class="selectLabel">项目筛选</span>
  13. <el-select v-model="selectInp.filter" @change="getData" placeholder="我的项目">
  14. <el-option label="所有项目" value=""></el-option>
  15. <el-option
  16. v-for="item in options.projectFilter"
  17. :key="item.courseId"
  18. :label="item.title"
  19. :value="item.courseId">
  20. </el-option>
  21. </el-select>
  22. </div>
  23. <div class="selectsBlock">
  24. <span class="selectLabel">部门</span>
  25. <el-select v-model="selectInp.department" @change="getData" placeholder="请选择">
  26. <el-option label="所有部门" value=""></el-option>
  27. <el-option
  28. v-for="item in options.department"
  29. :key="item.classid"
  30. :label="item.name"
  31. :value="item.classid">
  32. </el-option>
  33. </el-select>
  34. </div>
  35. <div class="selectsBlock">
  36. <span class="selectLabel">分类</span>
  37. <el-select v-model="selectInp.sort" @change="getData" placeholder="请选择">
  38. <el-option label="所有分类" value=""></el-option>
  39. <el-option
  40. v-for="item in options.sort"
  41. :key="item.typeid"
  42. :label="item.name"
  43. :value="item.typeid">
  44. </el-option>
  45. </el-select>
  46. </div>
  47. <div class="selectsBlock">
  48. <span class="selectLabel">结题状态</span>
  49. <el-select v-model="selectInp.state" @change="getData" placeholder="请选择">
  50. <el-option
  51. v-for="item in options.state"
  52. :key="item.value"
  53. :label="item.label"
  54. :value="item.value">
  55. </el-option>
  56. </el-select>
  57. </div>
  58. <div class="selectsBlock">
  59. <span class="selectLabel">负责人</span>
  60. <el-select v-model="selectInp.leader" @change="getData" placeholder="请选择">
  61. <el-option label="所有负责人" value=""></el-option>
  62. <el-option
  63. v-for="(item,index) in options.person"
  64. :key="index"
  65. :label="item.pro_leader"
  66. :value="item.pro_leader">
  67. </el-option>
  68. </el-select>
  69. </div>
  70. </div>
  71. <div class="ProjectManagementQuery">
  72. <el-input v-model="selectText" style="340px" placeholder="请输入项目名称"></el-input>
  73. <el-button type="primary" class="btn" size="mini">查询</el-button>
  74. </div>
  75. </div>
  76. <!-- 搜索栏结束 -->
  77. <!-- 循环展示框列表开始 -->
  78. <div class="projectBlock core_dialogue">
  79. <div class="classBlock" v-for="(item,index) in items" :key="index">
  80. <div class="projectBlockPosition">
  81. <!-- {{ item.isupload }} -->
  82. <span v-if="item.isupload==0">未结题</span>
  83. <span v-if="item.isupload==1">进行中</span>
  84. <span v-if="item.isupload==2">已结题</span>
  85. </div>
  86. <img :src="item.image" alt="">
  87. <div class="classBlock1">
  88. <div class="classBlock2">{{ item.title }}</div>
  89. <div class="classBlock3">
  90. <div><span style="color: #000;">创建日期:</span>{{ item.time }}</div>
  91. <!-- <div>{{ item.pro_leader }}</div>
  92. <div>{{ item.name }}</div> -->
  93. </div>
  94. <div class="classBlock3 classBlock4">
  95. <div><span style="color: #000;">修改日期:</span>{{ item.updateTime}}</div>
  96. <!-- <div style="color:#9e9e9e">{{ item.typeName }}</div>
  97. <div>项目编号{{ index }}</div> -->
  98. </div>
  99. </div>
  100. <div class="classBlockBtn">
  101. <el-button type="primary" class="bt1" size="mini" @click="scheduleDetail(item.courseId)">进度详情</el-button>
  102. <el-button type="primary" class="bt1" size="mini" @click="fundStatus(item.courseId)">资金情况</el-button>
  103. <el-button type="primary" v-show="item.isupload==0" class="bt1" @click="$message.error('请先进行项目立项审核')" size="mini">结项</el-button>
  104. <!-- <el-button type="primary" v-show="item.isupload==1" class="bt1" size="mini" @click="finish(item.courseId,item.title)">结项</el-button> -->
  105. <el-button type="primary" v-show="item.isupload==1 && item.endFile==null" class="bt1" size="mini" @click="finish(item.courseId,item.title)">结项</el-button>
  106. <el-button type="primary" v-show="item.isupload==1 && item.endFile!=null" class="bt1" size="mini" @click="finish(item.courseId,item.title)">修改结项</el-button>
  107. <el-button type="primary" v-show="item.isupload==2" class="bt1" style="background-color: #c8c9cc;border-color: #c8c9cc;cursor: no-drop;" size="mini">已结项</el-button>
  108. </div>
  109. </div>
  110. </div>
  111. <!-- 循环展示框列表结束 -->
  112. <!-- 完结对话框开始 -->
  113. <el-dialog
  114. title="提示"
  115. :visible.sync="endDialog"
  116. width="600px"
  117. class="endDialog"
  118. :before-close="init">
  119. <div class="addDialogLogo">LOGO</div>
  120. <div class="deleteContent">"{{ tit }}"项目,是否确定完结?</div>
  121. <div class="deleteContent1">活动完结报告</div>
  122. <div class="download" v-for="item in file" :key="item.fid">
  123. <span>{{ item.fileName }}</span>
  124. <div class="downloadBtn">
  125. <el-button type="primary" @click="checkDelFile(item.url)" size="mini">删除文件</el-button>
  126. </div>
  127. </div>
  128. <div class="addMoneyBtn" style="margin-left: 0;">
  129. <div class="jia">+</div>添加
  130. <div id="upFile">
  131. <beUpload @getFile="getFile" :navName="'上传文件'" :accept="accept"> </beUpload>
  132. </div>
  133. </div>
  134. <div slot="footer" class="dialog-footer">
  135. <el-button type="primary" @click="ending" class="AllDialogBtn">确认提交</el-button>
  136. <el-button @click="init" class="AllDialogBtn">取消</el-button>
  137. </div>
  138. </el-dialog>
  139. <!-- 提示哪些活动没有完成开始 -->
  140. <el-dialog
  141. title="提示"
  142. :visible.sync="NoReportActivity"
  143. width="600px"
  144. class="endDialog"
  145. :before-close="init">
  146. <div class="addDialogLogo">LOGO</div>
  147. <div class="deleteContent">"{{ tit }}"项目,有以下活动未完结!</div>
  148. <div class="download checkActivity">
  149. <span v-for="(item,index) in checkActivityFinishData" :key="index">{{ item.title }}</span>
  150. </div>
  151. <div slot="footer" class="dialog-footer">
  152. <el-button type="primary" @click="init" class="AllDialogBtn">确认</el-button>
  153. <el-button @click="init" class="AllDialogBtn">取消</el-button>
  154. </div>
  155. </el-dialog>
  156. <!-- 提示哪些活动没有完成结束 -->
  157. <!-- 分页 -->
  158. <el-pagination
  159. @current-change="handleCurrentChange"
  160. :current-page="table.currentPage"
  161. :page-size="table.packageSize"
  162. layout=" prev, pager, next"
  163. background
  164. class="paginations"
  165. :total="table.total">
  166. </el-pagination>
  167. <!-- 分页结束 -->
  168. </div>
  169. </template>
  170. <script>
  171. import beUpload from '../../components/tool/beUpload'
  172. export default {
  173. components:{beUpload},
  174. data() {
  175. return {
  176. accept:"*",
  177. iid:'',
  178. selectText:'', //文字搜素框数据
  179. endDialog:false,
  180. DelFileDialog:false,
  181. NoReportActivity:false,
  182. tit:'', //完结框项目名称
  183. items:[], //项目列表数据
  184. table:{ // 分页数据
  185. total:0,
  186. packageSize:8,
  187. currentPage:1
  188. },
  189. DelFileData:{
  190. fid:"",
  191. fileName:"",
  192. },
  193. options:{ //头部搜索框下拉框数据
  194. projectFilter:[],//项目筛选
  195. department:[],//部门
  196. sort:[],//分类
  197. person:[],//负责人
  198. state:[//状态
  199. {
  200. value:'',
  201. label:'全部'
  202. },
  203. {
  204. value:0,
  205. label:'未审核'
  206. },
  207. {
  208. value:1,
  209. label:'正在审核'
  210. },
  211. {
  212. value:2,
  213. label:"已审核"
  214. },
  215. ],
  216. },
  217. selectInp:{ //select选定所显示的值
  218. filter:'', //不要带引号,select框是根据id来选择下面数据的
  219. department:'',
  220. sort:'',
  221. state:'',
  222. leader:'',
  223. },
  224. file:[],
  225. checkActivityFinishData:[],
  226. }
  227. },
  228. methods:{
  229. checkDelFile(url){ //删除文件
  230. this.file = this.file.filter(item=>item.url!=url);
  231. },
  232. getFile(val) {//上传文件
  233. // console.log(val);
  234. this.file.push(val);
  235. // console.log(this.file);
  236. },
  237. ending(){ //完结提交
  238. if(this.file=="")return this.$message.error("请上传完结报告");
  239. this.ajax.post(this.$store.state.api+"/UploadProjectManageFile",{
  240. uid:this.$store.state.userInfo.userid,
  241. cid:this.iid,
  242. file:JSON.stringify(this.file),
  243. num:1
  244. }).then(res=>{
  245. // console.log(res);
  246. if(res.data==1){
  247. this.$message.success("结项成功");
  248. this.endDialog = false;
  249. }else{
  250. this.$message.error("结项失败")
  251. }
  252. this.getData();
  253. })
  254. this.endDialog=false;
  255. },
  256. scheduleDetail(val){ //进度详情
  257. // console.log(val);
  258. localStorage.setItem('pid',JSON.stringify(val))
  259. this.$router.push(`/ProjectManagement1`)
  260. },
  261. fundStatus(Id){ //资金情况
  262. localStorage.setItem('pid',JSON.stringify(Id))
  263. this.$router.push(`/ProjectManagementFund1`)
  264. },
  265. init(){ //对话框重置
  266. this.endDialog=false;
  267. this.NoReportActivity = false;
  268. },
  269. finish(val,tit){ //结项对话框显示
  270. this.checkActivityFinishData = [];
  271. this.ajax.get(this.$store.state.api+"/GetActivityNoReportByPId",{
  272. uid:this.$store.state.userInfo.userid,
  273. pid:val
  274. }).then(res=>{
  275. if(res.data[0].length>0){
  276. this.checkActivityFinishData = res.data[0];
  277. this.tit = tit;
  278. this.NoReportActivity = true;
  279. }else{
  280. this.iid=val;
  281. this.tit=tit;
  282. this.endDialog=true;
  283. this.file=[];
  284. }
  285. }).catch(err=>{
  286. console.log(err)
  287. })
  288. },
  289. handleCurrentChange(val) { //当页数发生改变的时候调用获取列表数据请求
  290. // console.log(`当前页: ${val}`);
  291. this.table.currentPage=val
  292. this.getData()
  293. },
  294. getData(){ //获取渲染数据
  295. let param={
  296. uid:this.$store.state.userInfo.userid, //当前账号id
  297. pid:this.selectInp.filter, //筛选
  298. did:this.selectInp.department, //部门
  299. tid:this.selectInp.sort, //分类
  300. leader:this.selectInp.leader, //负责人
  301. st:this.selectInp.state, //审核状态
  302. textInp:this.selectText,
  303. page:this.table.currentPage, //当前页
  304. lim:this.table.packageSize, //限制获取几条数据
  305. }
  306. this.ajax
  307. .get(this.$store.state.api+'/SelectAllProject',param)
  308. .then(res=>{
  309. console.log(res.data);
  310. let data=res.data;
  311. let a=this.options;
  312. console.log(data[0]);
  313. this.items=data[0];
  314. a.projectFilter=data[1];
  315. a.department=data[2];
  316. a.sort=data[3];
  317. a.person=data[4];
  318. this.table.total=data[5][0].total
  319. },err=>{
  320. console.log(err);
  321. })
  322. }
  323. },
  324. watch:{ //监视选择框的变化,实施刷新表格数据
  325. selectText:{
  326. handler(){
  327. immediate:true
  328. deep:true
  329. this.getData()
  330. }
  331. }
  332. },
  333. mounted(){
  334. this.getData() //页面加载完成后自动获取渲染数据
  335. }
  336. }
  337. </script>
  338. <style lang="less">
  339. .ProjectManagement{
  340. .pagination{
  341. float: right;
  342. margin: 0px 85px 10px;
  343. }
  344. .projectBlock{ //循环列表大框
  345. width: 100%;
  346. // height: 560px;
  347. display: flex;
  348. flex-wrap: wrap;
  349. overflow:auto;
  350. .classBlock{ //每个独立小框
  351. flex-shrink: 0;
  352. overflow: hidden;
  353. position: relative;
  354. margin-right: 20px;
  355. margin-bottom: 5px;
  356. width: 320px;height: 260px;
  357. background-color: rgb(255, 255, 255);
  358. box-shadow: 1px 2px 3px #ccc;
  359. border: 1px solid #ccc;
  360. border-radius: 5px;
  361. display: flex;
  362. flex-direction: column;
  363. .projectBlockPosition{ //完成状态
  364. border-radius: 30px;
  365. position: absolute;
  366. top: 5px;
  367. left: 5px;
  368. width: 80px;
  369. height: 30px;
  370. display: flex;
  371. justify-content: center;
  372. align-items: center;
  373. background: #000;
  374. opacity: 0.7;
  375. font-size: 16px;
  376. color:#fff;
  377. // font-size: 14px;
  378. }
  379. img{
  380. width: 100%;height: 125px;
  381. object-fit: cover;
  382. }
  383. .classBlock1{ //中间栏
  384. margin-bottom: 10px;
  385. margin-top: 0px;
  386. box-sizing: border-box;
  387. padding: 0 5px;
  388. .classBlock2{ //项目名称
  389. margin-left: 5px;
  390. margin-bottom: 4px;
  391. margin-top: 4px;
  392. text-align: left;
  393. font-size: 18px;
  394. }
  395. .classBlock3{ //学校、姓名
  396. box-sizing: border-box;
  397. padding: 0 5px;
  398. font-size: 14px;
  399. width: 100%;
  400. // margin-top: 10px;
  401. display: flex;
  402. flex-wrap: wrap;
  403. color: #adacac;
  404. margin: 10px 0 0;
  405. }
  406. .classBlock4{ //博客、编号
  407. margin-top: 4px;
  408. }
  409. }
  410. .classBlockBtn{ //按钮栏
  411. box-sizing: border-box;
  412. padding:0 6px;
  413. display: flex;
  414. flex: 1;
  415. width: 100%;
  416. justify-content: center;
  417. align-items: center;
  418. background-color:#F5F4F4 ;
  419. .bt1{
  420. width: 100px;
  421. height: 35px;
  422. font-size: 14px;
  423. }
  424. }
  425. }
  426. }
  427. .endDialog{ //结项对话框的
  428. .el-dialog__header{
  429. display: flex;
  430. justify-content: center;
  431. box-sizing: border-box;
  432. background: #32455b;
  433. }
  434. .el-dialog__title{
  435. color:rgb(246, 247, 246);
  436. display: flex;
  437. font-size: 18px;
  438. position: relative;
  439. top: -2px;
  440. justify-content: center;
  441. }
  442. .el-dialog{
  443. width: 600px;
  444. border-radius: 5px;
  445. overflow: hidden;
  446. }
  447. .el-dialog__body{
  448. box-sizing: border-box;
  449. padding: 30px 20px 0 20px;
  450. }
  451. .deleteContent{
  452. width: 100%;
  453. font-size: 22px;
  454. color: #000;
  455. box-sizing: border-box;
  456. // padding: 0 20px;
  457. display: flex;
  458. justify-content: center;
  459. }
  460. .deleteContent1{
  461. width: 100%;
  462. text-align: left;
  463. font-size: 18px;
  464. font-weight: bold;
  465. color: #000;
  466. margin-top: 30px;
  467. }
  468. .download{
  469. margin: 10px 0 20px;
  470. width: 100%;
  471. text-align: left;
  472. font-size: 16px;
  473. font-weight: bold;
  474. color: #5391fd;
  475. display: flex;
  476. justify-content: space-between;
  477. // background: #ccc;
  478. }
  479. .addDialogLogo{
  480. width: 60px;
  481. height: 30px;
  482. display: flex;
  483. justify-content: center;
  484. line-height: 30px;
  485. border-radius: 5px;
  486. background: #f2f2f2;
  487. position: absolute;
  488. left: 20px; top: 15px;
  489. }
  490. }
  491. }
  492. .checkActivity{
  493. // float:left;
  494. display: flex;
  495. justify-content: flex-start !important;
  496. span{
  497. margin: 10px 20px;
  498. }
  499. }
  500. </style>