projectApplication.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669
  1. <template>
  2. <!-- 项目立项申请 -->
  3. <div class="projectApplication">
  4. <div class="pAHeader">
  5. <div class="pAHeader1">项目立项申请</div>
  6. <el-button style="font-size: 16px;" @click="apply">项目立项申请</el-button>
  7. </div>
  8. <hr>
  9. <!-- 搜索框开始 -->
  10. <div class="selects">
  11. <div class="selectsBlock">
  12. <div class="selectLabel">项目筛选</div>
  13. <el-select v-model="selectInp.filter" @change="getData" placeholder="我的项目">
  14. <el-option label="所有项目" :value="0"></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. <div class="selectLabel">部门</div>
  25. <el-select v-model="selectInp.department" @change="getData" placeholder="请选择">
  26. <el-option label="所有部门" :value="0"></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. <div class="selectLabel">分类</div>
  37. <el-select v-model="selectInp.sort" @change="getData" placeholder="请选择">
  38. <el-option label="所有分类" :value="0"></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. <div class="selectLabel">负责人</div>
  49. <el-select v-model="selectInp.person" @change="getData" placeholder="请选择">
  50. <el-option label="所有负责人" :value="''"></el-option>
  51. <el-option
  52. v-for="(item,index) in options.person"
  53. :key="index"
  54. :label="item.pro_leader"
  55. :value="item.pro_leader">
  56. </el-option>
  57. </el-select>
  58. </div>
  59. <div class="selectsBlock">
  60. <div class="selectLabel">状态</div>
  61. <el-select v-model="selectInp.state" @change="getData" placeholder="请选择">
  62. <el-option
  63. v-for="item in options.state"
  64. :key="item.value"
  65. :label="item.label"
  66. :value="item.value">
  67. </el-option>
  68. </el-select>
  69. </div>
  70. </div>
  71. <!-- 搜索框结束 -->
  72. <!-- 表格开始 -->
  73. <div>
  74. <el-table
  75. ref="multipleTable"
  76. :data="tableData"
  77. tooltip-effect="dark"
  78. stripe
  79. class="fontSize core_dialogue"
  80. style="height: 481px;overflow: auto;"
  81. :header-cell-style="{ background: '#f2f2f2',color:'#000' }"
  82. @selection-change="handleSelectionChange">
  83. <!-- selection-change批量选择功能后续可能用到 -->
  84. <!--
  85. <el-table-column
  86. type="selection"
  87. width="25"
  88. >
  89. </el-table-column> -->
  90. <el-table-column
  91. prop="title"
  92. label="项目名称"
  93. align="center"
  94. min-width="10%">
  95. </el-table-column>
  96. <el-table-column
  97. prop="pro_leader"
  98. align="center"
  99. label="项目负责人"
  100. min-width="9%">
  101. </el-table-column>
  102. <el-table-column
  103. prop="name"
  104. align="center"
  105. label="所在部门"
  106. min-width="10%">
  107. </el-table-column>
  108. <el-table-column
  109. prop="money"
  110. label="预算(万)"
  111. align="center"
  112. min-width="8%">
  113. </el-table-column>
  114. <el-table-column
  115. prop="time"
  116. align="center"
  117. label="开始时间"
  118. min-width="10%">
  119. </el-table-column>
  120. <el-table-column
  121. prop="phone"
  122. align="center"
  123. label="联系电话"
  124. min-width="10%">
  125. </el-table-column>
  126. <el-table-column
  127. prop="state"
  128. label="状态"
  129. align="center"
  130. min-width="6%">
  131. <template #default="scope">
  132. <div>
  133. <!-- {{scope.row.name + (scope.row.status==0?"":"(已屏蔽)")}} -->
  134. <!-- {{ (scope.row.isupload==0?"未审核": scope.row.data==1?"正在审核":"已审核") }} -->
  135. <span v-if="scope.row.isupload==0">未审核</span>
  136. <span v-if="scope.row.isupload==1">审核中</span>
  137. <span v-if="scope.row.isupload==2">已审核</span>
  138. </div>
  139. </template>
  140. </el-table-column>
  141. <el-table-column
  142. prop="operation"
  143. width="350"
  144. align="center"
  145. label="操作"
  146. >
  147. <template #default="scope">
  148. <div class="operations">
  149. <!-- <el-button type="primary" > -->
  150. <!-- <el-link class="btt" type="primary" :underline="false"> -->
  151. <el-button type="primary" size="mini" @click="lookDetail(scope.row.courseId)">查看详情</el-button>
  152. <!-- <el-button type="primary" size="mini" @click="audit(scope.row)">{{(status==-1?"审核": status?"撤回":"审核")}}</el-button> -->
  153. <!-- <el-button type="primary" size="mini" @click="audit(scope.row)">{{(scope.row.data==1?"审核": scope.row.data==1?"正在审核":"审核")}}</el-button> -->
  154. <el-button v-if="scope.row.isupload==0" type="primary" style="width: 73.3px;" size="mini" @click="audit(scope.row)">审核</el-button>
  155. <el-button type="info" style="background-color: #c8c9cc;border-color: #c8c9cc;cursor: no-drop;" v-if="scope.row.isupload==1" size="mini">审核中</el-button>
  156. <el-button type="info" style="background-color: #c8c9cc;border-color: #c8c9cc;cursor: no-drop;" v-if="scope.row.isupload==2" size="mini">已审核</el-button>
  157. <el-button type="primary" size="mini" @click="appTable(scope)" >申请表</el-button>
  158. <el-button type="primary" size="mini" @click="del(scope.row)">删除</el-button>
  159. <!-- </el-link> -->
  160. <!-- </el-button> -->
  161. </div>
  162. </template>
  163. </el-table-column>
  164. </el-table>
  165. </div>
  166. <!-- 表格结束 -->
  167. <!-- 分页 -->
  168. <el-pagination
  169. @current-change="handleCurrentChange"
  170. :current-page="table.currentPage"
  171. :page-size="table.packageSize"
  172. layout=" prev, pager, next"
  173. background
  174. class="pagination"
  175. :total="table.total">
  176. </el-pagination>
  177. <!-- 分页结束 -->
  178. <!-- 立项撤回对话框开始 -->
  179. <el-dialog
  180. title="立项撤回提交"
  181. :visible.sync="dialogVisible1"
  182. width="700px"
  183. class="dialogWidth"
  184. :before-close="init">
  185. <div class="diaTit">
  186. <div class="spans">项目名称</div>
  187. <div class="spanCon">:人工智能分链机器</div>
  188. <div class="spans" style="margin-left: 50px;">项目负责人</div>
  189. <div class="spanCon">:徐晓霞</div>
  190. </div>
  191. <div class="diaTit1">
  192. <div class="spans1">所在部门</div>
  193. <div>
  194. <el-input v-model="input" placeholder="信通学院"></el-input>
  195. </div>
  196. </div>
  197. <div class="diaTit1">
  198. <div class="spans1">预算总经费</div>
  199. <div>
  200. <el-input v-model="input" placeholder="6000"></el-input>
  201. </div>
  202. </div>
  203. <div class="diaTit1">
  204. <div class="spans1">联系电话</div>
  205. <div>
  206. <el-input v-model="input" placeholder="13854449525"></el-input>
  207. </div>
  208. </div>
  209. <div class="diaTit1">
  210. <div class="spans1" style="position: relative;top:-20px">撤回意见</div>
  211. <div>
  212. <el-input
  213. type="textarea"
  214. :rows="4"
  215. resize="none"
  216. placeholder="请输入内容"
  217. v-model="textarea">
  218. </el-input>
  219. </div>
  220. </div>
  221. <div slot="footer" class="dialog-footer">
  222. <el-button type="primary" @click="commit2" class="diaBtn" >确认提交</el-button>
  223. <el-button @click="init" class="diaBtn">取消</el-button>
  224. </div>
  225. </el-dialog>
  226. <!-- 立项撤回对话框开始 -->
  227. <!-- 立项审核对话框开始 -->
  228. <el-dialog
  229. title="立项审核"
  230. :visible.sync="dialogVisible"
  231. class="dialogWidth"
  232. :before-close="init">
  233. <div class="diaTit">
  234. <div class="spans">项目名称</div>
  235. <div class="spanCon">:{{ auditDialog.projectName }}</div>
  236. <div class="spans" style="margin-left: 30px;">项目负责人</div>
  237. <div class="spanCon">:{{ auditDialog.person }}</div>
  238. </div>
  239. <div class="diaTit1">
  240. <div class="spans1">所在部门</div>
  241. <div>
  242. <el-input v-model="auditDialog.department" placeholder="信通学院"></el-input>
  243. </div>
  244. </div>
  245. <div class="diaTit1">
  246. <div class="spans1">预算总经费</div>
  247. <div>
  248. <el-input v-model="auditDialog.fund" placeholder="6000"></el-input>
  249. </div>
  250. </div>
  251. <div class="diaTit1">
  252. <div class="spans1">联系电话</div>
  253. <div>
  254. <el-input v-model="auditDialog.tel" placeholder="13854449525"></el-input>
  255. </div>
  256. </div>
  257. <div slot="footer" class="dialog-footer">
  258. <el-button type="primary" @click="commit" class="diaBtn" >确认提交</el-button>
  259. <el-button @click="init" class="diaBtn">取消</el-button>
  260. </div>
  261. </el-dialog>
  262. <!-- 立项审核对话框结束 -->
  263. <!-- 删除通知开始 -->
  264. <el-dialog
  265. title="删除项目"
  266. :visible.sync="dialogVisible2"
  267. width="600px"
  268. class="addDialog">
  269. <div class="addDialogLogo">LOGO</div>
  270. <span class="deleteContent">确定删除项目?</span>
  271. <span slot="footer" class="dialog-footer">
  272. <el-button type="primary" @click="dialogDel" class="btn5">确认删除</el-button>
  273. <el-button @click="init" class="btn5" >取消</el-button>
  274. </span>
  275. </el-dialog>
  276. <!-- 删除通知结束-->
  277. </div>
  278. </template>
  279. <script>
  280. export default {
  281. data() {
  282. return {
  283. iid:'',
  284. textarea:'',
  285. input:'',
  286. dialogVisible:false,//立项审核
  287. dialogVisible1:false,//立项撤回提交
  288. dialogVisible2:false,//删除
  289. // 分页数据
  290. table:{
  291. total:0,
  292. packageSize:8,
  293. currentPage:1
  294. },
  295. tableData:[], //列表数据
  296. selectInp:{ // 头部搜索框的内容
  297. filter:0,
  298. department:0,
  299. sort:0,
  300. person:'',
  301. state:99,
  302. },
  303. options:{ //头部搜索框下拉框数据
  304. projectFilter:[],//项目筛选
  305. department:[],//部门
  306. sort:[],//分类
  307. person:[],//负责人
  308. state:[//状态
  309. {
  310. value:99,
  311. label:'全部'
  312. },
  313. {
  314. value:0,
  315. label:'未审核'
  316. },
  317. {
  318. value:1,
  319. label:'正在审核'
  320. },
  321. {
  322. value:2,
  323. label:"已审核"
  324. },
  325. ],
  326. },
  327. auditDialog:{ //审核对话框数据
  328. projectName:'',
  329. person:'',
  330. department:'',
  331. fund:'',
  332. tel:''
  333. }
  334. }
  335. },
  336. methods:{
  337. init(){
  338. this.dialogVisible=false;
  339. this.dialogVisible1=false;
  340. this.dialogVisible2=false;
  341. },
  342. audit(val){ //审核按钮
  343. // if(this.status==-1){
  344. // this.dialogVisible=true;
  345. // return
  346. // }else if(this.status){
  347. // this.dialogVisible1=true;
  348. // return
  349. // }else{
  350. // this.dialogVisible=true;
  351. // }
  352. // console.log(val);
  353. // this.dialogVisible2=true
  354. this.iid=val //将要删除的id进行存储供删除对话框使用
  355. if (val.isupload==0) {
  356. this.dialogVisible=true;
  357. // console.log(val);
  358. this.auditDialog.projectName=val.title;
  359. this.auditDialog.person=val.pro_leader;
  360. this.auditDialog.department=val.name;
  361. this.auditDialog.fund=val.money;
  362. this.auditDialog.tel=val.phone;
  363. }
  364. },
  365. appTable(val){ //查看申请表
  366. },
  367. commit(){ //立项审核对话框里面的确定提交按钮
  368. // console.log(this.iid);
  369. let param={
  370. uid:this.$store.state.userInfo.userid,
  371. pid:this.iid.courseId
  372. }
  373. this.ajax
  374. .post(this.$store.state.api+"/ApproveProject",param)
  375. .then(res=>{
  376. // console.log(res);
  377. this.dialogVisible=false;
  378. this.$message.success('提交成功')
  379. this.getData()
  380. },err=>{
  381. console.log(err);
  382. })
  383. },
  384. commit2(val){ //立项撤回对话框里面的确定撤回按钮
  385. this.dialogVisible1=false;
  386. this.status--
  387. // console.log(this.status);
  388. },
  389. handleSelectionChange(val) { //批量选择功能后续可能用到
  390. // console.log(val);
  391. this.multipleSelection = val;
  392. },
  393. lookDetail(val){ //查看详情按钮
  394. // console.log(val);
  395. localStorage.setItem("pid",JSON.stringify(val))
  396. this.$router.push('/projectApplicationDetails')
  397. },
  398. apply(){ //项目立项申请按钮
  399. this.$router.push('/projectApplicationApplyMain')
  400. },
  401. getData(){ //获取表格数据
  402. let param={
  403. uid:this.$store.state.userInfo.userid,
  404. pid:this.selectInp.filter, //筛选
  405. did:this.selectInp.department, //部门
  406. tid:this.selectInp.sort, //分类
  407. leader:this.selectInp.person, //负责人
  408. st:this.selectInp.state, //审核状态
  409. textInp:'',
  410. page:this.table.currentPage, //当前页
  411. lim:this.table.packageSize //限制获取几条数据
  412. }
  413. // return console.log(param);
  414. // console.log(param)
  415. this.ajax
  416. .get(this.$store.state.api+'/SelectAllProject',param)
  417. .then(res=>{
  418. console.log(res.data);
  419. let data=res.data;
  420. let a=this.options;
  421. this.tableData=data[0];
  422. a.projectFilter=data[1];
  423. a.department=data[2];
  424. a.sort=data[3];
  425. a.person=data[4];
  426. this.table.total=data[5][0].total
  427. },err=>{
  428. console.log(err);
  429. })
  430. },
  431. del(val) { //表格删除按钮,点击显示删除对话框
  432. // console.log(val);
  433. this.dialogVisible2=true
  434. this.iid=val //将要删除的id进行存储供删除对话框使用
  435. },
  436. dialogDel(){ //确定删除这个项目
  437. // console.log(this.iid)
  438. if (this.iid.userid == this.$store.state.userInfo.userid) {
  439. let param={
  440. uid:this.$store.state.userInfo.userid,
  441. pid:this.iid.courseId
  442. }
  443. this.ajax
  444. .post(this.$store.state.api+"/DeleteProject",param)
  445. .then(res=>{
  446. // console.log(res);
  447. if (res.data) {
  448. this.$message.success('删除成功')
  449. this.getData()
  450. this.dialogVisible2=false
  451. return
  452. }else{
  453. this.$message.error('删除失败')
  454. }
  455. },err=>{
  456. console.log(err);
  457. })
  458. }
  459. },
  460. handleCurrentChange(val) { //当页数发生改变的时候调用获取列表数据请求
  461. // console.log(`当前页: ${val}`);
  462. this.table.currentPage=val
  463. this.getData()
  464. },
  465. },
  466. watch:{ //监视选择框的变化,实施刷新表格数据
  467. // options:{
  468. // handler(){
  469. // immediate:true
  470. // deep:true
  471. // this.getData()
  472. // }
  473. // }
  474. },
  475. mounted(){ //跳转到此页面立刻获取数据
  476. this.getData(); //获取表格数据
  477. }
  478. }
  479. </script>
  480. <style lang="less">
  481. .projectApplication{
  482. .el-table::before{
  483. height: 0;
  484. }
  485. .pagination{
  486. float: right;
  487. margin: 20px 35px 10px;
  488. }
  489. .addDialog{ //删除框
  490. font-size: 18px;
  491. .el-dialog{
  492. border-radius: 5px;
  493. overflow: hidden;
  494. }
  495. .deleteContent{
  496. margin: 30px 0;
  497. font-size: 22px;
  498. color: #000;
  499. }
  500. .addDialogLogo{
  501. width: 60px;
  502. height: 30px;
  503. line-height: 30px;
  504. background: #f2f2f2;
  505. position: absolute;
  506. left: 20px; top: 15px;
  507. }
  508. .el-dialog__header{
  509. background: #32455b;
  510. }
  511. .el-dialog__title{
  512. color:#fff;
  513. font-size: 22px;
  514. }
  515. .addDialogMid{
  516. box-sizing: border-box;
  517. padding:0 60px 0 10px;
  518. .addDialogTit{
  519. display: flex;
  520. span{
  521. width: 80px;
  522. font-size: 16px;
  523. line-height: 40px;
  524. text-align: left;
  525. }
  526. }
  527. .addDialogTit1{
  528. display: flex;
  529. justify-content: space-between;
  530. margin-bottom: 15px;
  531. }
  532. .addDialogTit2{
  533. margin-top: 10px;
  534. font-size: 16px;
  535. color: #000;
  536. text-indent: 2em;
  537. }
  538. .addDialogCon{
  539. margin-top: 20px;
  540. }
  541. }
  542. .dialog-footer{
  543. display: flex;
  544. justify-content: center;
  545. box-sizing: border-box;
  546. .btn5{
  547. font-size: 16px;
  548. }
  549. }
  550. }
  551. .dialogWidth{
  552. .el-input__inner{
  553. width: 300px;
  554. }
  555. .el-textarea__inner{
  556. width: 430px;
  557. }
  558. .el-dialog{
  559. width: 600px;
  560. border-radius: 5px;
  561. overflow: hidden;
  562. }
  563. .el-dialog__body{
  564. padding:30px 0px 30px 70px ;
  565. }
  566. .el-dialog__header{
  567. background: #32455b;
  568. }
  569. .el-dialog__title{
  570. color: #fff;
  571. position: relative;
  572. top: -5px;
  573. font-size: 18px;
  574. }
  575. .diaTit{ //项目名称、负责人
  576. width: 100%;
  577. display: flex;
  578. .spans{
  579. width: 84px;
  580. font-size: 16px;
  581. margin-right: 10px;
  582. display: inline-block;
  583. text-align: justify;
  584. color: #000;
  585. font-size: 16px;
  586. text-justify:distribute-all-lines;
  587. text-align-last: justify;
  588. transform: translate(0,22%);
  589. margin-bottom: 10px;
  590. }
  591. }
  592. .spanCon{
  593. font-size: 16px;
  594. margin-top: 5px;
  595. color: #a0a0a0;
  596. }
  597. .spans1{ //label
  598. min-width: 84px;
  599. font-size: 16px;
  600. color: #000;
  601. margin-right: 10px;
  602. display: inline-block;
  603. text-align: justify;
  604. text-justify:distribute-all-lines;
  605. text-align-last: justify;
  606. transform: translate(0,22%);
  607. }
  608. .diaTit1{ //label和input框
  609. display: flex;
  610. width: 80%;
  611. margin-top: 20px;
  612. }
  613. .dialog-footer{
  614. width: 100%;
  615. display: flex;
  616. justify-content: center;
  617. margin-bottom: 10px;
  618. .diaBtn{
  619. // width: 180px;
  620. // height: 35px;
  621. // line-height: 5px;
  622. font-size: 16px;
  623. }
  624. }
  625. }
  626. }
  627. </style>