projectApplication.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689
  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=""></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=""></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=""></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"
  80. :header-cell-style="{ background: '#f2f2f2',color:'#000' }"
  81. @selection-change="handleSelectionChange">
  82. <!-- selection-change批量选择功能后续可能用到 -->
  83. <!--
  84. <el-table-column
  85. type="selection"
  86. width="25"
  87. >
  88. </el-table-column> -->
  89. <el-table-column
  90. prop="title"
  91. label="项目名称"
  92. align="center"
  93. min-width="10%">
  94. </el-table-column>
  95. <el-table-column
  96. prop="pro_leader"
  97. align="center"
  98. label="项目负责人"
  99. min-width="9%">
  100. </el-table-column>
  101. <el-table-column
  102. prop="name"
  103. align="center"
  104. label="所在部门"
  105. min-width="10%">
  106. </el-table-column>
  107. <el-table-column
  108. prop="money"
  109. label="预算(万)"
  110. align="center"
  111. min-width="8%">
  112. </el-table-column>
  113. <el-table-column
  114. prop="time"
  115. align="center"
  116. label="开始时间"
  117. min-width="11%">
  118. </el-table-column>
  119. <el-table-column
  120. prop="phone"
  121. align="center"
  122. label="联系电话"
  123. min-width="10%">
  124. </el-table-column>
  125. <el-table-column
  126. prop="state"
  127. label="状态"
  128. align="center"
  129. min-width="6%">
  130. <template #default="scope">
  131. <div>
  132. <!-- {{scope.row.name + (scope.row.status==0?"":"(已屏蔽)")}} -->
  133. <!-- {{ (scope.row.isupload==0?"未审核": scope.row.data==1?"正在审核":"已审核") }} -->
  134. <span v-if="scope.row.isupload==0">未审核</span>
  135. <span v-if="scope.row.isupload==1">审核中</span>
  136. <span v-if="scope.row.isupload==2">已审核</span>
  137. </div>
  138. </template>
  139. </el-table-column>
  140. <el-table-column
  141. prop="operation"
  142. width="350"
  143. align="center"
  144. label="操作"
  145. >
  146. <template #default="scope">
  147. <div class="operations">
  148. <!-- <el-button type="primary" > -->
  149. <!-- <el-link class="btt" type="primary" :underline="false"> -->
  150. <el-button type="primary" size="mini" @click="lookDetail(scope.row.courseId)">查看详情</el-button>
  151. <!-- <el-button type="primary" size="mini" @click="audit(scope.row)">{{(scope.row.data==1?"审核": scope.row.data==1?"正在审核":"审核")}}</el-button> -->
  152. <el-button v-show="scope.row.isupload==0" type="primary" style="width: 73.3px;" size="mini" @click="audit(scope.row)">审核</el-button>
  153. <el-button type="info" style="background-color: #c8c9cc;border-color: #c8c9cc;cursor: no-drop;" v-if="scope.row.isupload==1" size="mini">审核中</el-button>
  154. <el-button type="info" style="background-color: #c8c9cc;border-color: #c8c9cc;cursor: no-drop;" v-if="scope.row.isupload==2" size="mini">已审核</el-button>
  155. <el-button type="primary" size="mini" @click="appTable()" >申请表</el-button>
  156. <el-button type="primary" size="mini" @click="del(scope.row)">删除</el-button>
  157. <!-- </el-link> -->
  158. <!-- </el-button> -->
  159. </div>
  160. </template>
  161. </el-table-column>
  162. </el-table>
  163. </div>
  164. <!-- 表格结束 -->
  165. <!-- 分页 -->
  166. <el-pagination
  167. @current-change="handleCurrentChange"
  168. :current-page="table.currentPage"
  169. :page-size="table.packageSize"
  170. layout=" prev, pager, next"
  171. background
  172. class="paginations"
  173. :total="table.total">
  174. </el-pagination>
  175. <!-- 分页结束 -->
  176. <!-- 立项撤回对话框开始 -->
  177. <el-dialog
  178. title="立项撤回提交"
  179. :visible.sync="dialogVisible1"
  180. width="700px"
  181. class="dialogWidth"
  182. :before-close="init">
  183. <div class="diaTit">
  184. <div class="spans">项目名称</div>
  185. <div class="spanCon">:人工智能分链机器</div>
  186. <div class="spans" style="margin-left: 50px;">项目负责人</div>
  187. <div class="spanCon">:徐晓霞</div>
  188. </div>
  189. <div class="diaTit1">
  190. <div class="spans1">所在部门</div>
  191. <div>
  192. <el-input v-model="input" placeholder="信通学院"></el-input>
  193. </div>
  194. </div>
  195. <div class="diaTit1">
  196. <div class="spans1">预算总经费</div>
  197. <div>
  198. <el-input v-model="input" placeholder="6000"></el-input>
  199. </div>
  200. </div>
  201. <div class="diaTit1">
  202. <div class="spans1">联系电话</div>
  203. <div>
  204. <el-input v-model="input" placeholder="13854449525"></el-input>
  205. </div>
  206. </div>
  207. <div class="diaTit1">
  208. <div class="spans1" style="position: relative;top:-20px">撤回意见</div>
  209. <div>
  210. <el-input
  211. type="textarea"
  212. :rows="4"
  213. resize="none"
  214. placeholder="请输入内容"
  215. v-model="textarea">
  216. </el-input>
  217. </div>
  218. </div>
  219. <div slot="footer" class="dialog-footer">
  220. <el-button type="primary" @click="commit2" class="AllDialogBtn" >确认提交</el-button>
  221. <el-button @click="init" class="AllDialogBtn">取消</el-button>
  222. </div>
  223. </el-dialog>
  224. <!-- 立项撤回对话框开始 -->
  225. <!-- 立项审核对话框开始 -->
  226. <el-dialog
  227. title="立项审核"
  228. :visible.sync="dialogVisible"
  229. class="dialogWidth"
  230. :before-close="init">
  231. <div class="diaTit">
  232. <div class="addDialogLogo">LOGO</div>
  233. <div class="spans">项目名称</div>
  234. <div class="spanCon">:{{ auditDialog.projectName }}</div>
  235. <div class="spans" style="margin-left: 30px;">项目负责人</div>
  236. <div class="spanCon">:{{ auditDialog.person }}</div>
  237. </div>
  238. <div class="diaTit1">
  239. <div class="spans1">所在部门</div>
  240. <div>
  241. <el-input v-model="auditDialog.department" placeholder="信通学院"></el-input>
  242. </div>
  243. </div>
  244. <div class="diaTit1">
  245. <div class="spans1">预算总经费</div>
  246. <div>
  247. <el-input v-model="auditDialog.fund" placeholder="6000"></el-input>
  248. </div>
  249. </div>
  250. <div class="diaTit1">
  251. <div class="spans1">联系电话</div>
  252. <div>
  253. <el-input v-model="auditDialog.tel" placeholder="13854449525"></el-input>
  254. </div>
  255. </div>
  256. <div slot="footer" class="dialog-footer">
  257. <el-button type="primary" @click="commit" class="AllDialogBtn" >确认提交</el-button>
  258. <el-button @click="init" class="AllDialogBtn">取消</el-button>
  259. </div>
  260. </el-dialog>
  261. <!-- 立项审核对话框结束 -->
  262. <!-- 删除通知开始 -->
  263. <el-dialog
  264. title="删除项目"
  265. :visible.sync="dialogVisible2"
  266. width="600px"
  267. class="addDialog">
  268. <div class="addDialogLogo">LOGO</div>
  269. <span class="deleteContent">确定删除项目?</span>
  270. <span slot="footer" class="dialog-footer">
  271. <el-button type="primary" @click="dialogDel" class="AllDialogBtn">确认删除</el-button>
  272. <el-button @click="init" class="AllDialogBtn" >取消</el-button>
  273. </span>
  274. </el-dialog>
  275. <!-- 删除通知结束-->
  276. </div>
  277. </template>
  278. <script>
  279. export default {
  280. data() {
  281. return {
  282. iid:'',
  283. textarea:'',
  284. input:'',
  285. dialogVisible:false,//立项审核
  286. dialogVisible1:false,//立项撤回提交
  287. dialogVisible2:false,//删除
  288. // 分页数据
  289. table:{
  290. total:0,
  291. packageSize:7,
  292. currentPage:1
  293. },
  294. tableData:[], //列表数据
  295. selectInp:{ // 头部搜索框的内容
  296. filter:'',
  297. department:'',
  298. sort:'',
  299. person:'',
  300. state:'',
  301. },
  302. options:{ //头部搜索框下拉框数据
  303. projectFilter:[],//项目筛选
  304. department:[],//部门
  305. sort:[],//分类
  306. person:[],//负责人
  307. state:[//状态
  308. {
  309. value:'',
  310. label:'全部'
  311. },
  312. {
  313. value:0,
  314. label:'未审核'
  315. },
  316. {
  317. value:1,
  318. label:'正在审核'
  319. },
  320. {
  321. value:2,
  322. label:"已审核"
  323. },
  324. ],
  325. },
  326. auditDialog:{ //审核对话框数据
  327. projectName:'',
  328. person:'',
  329. department:'',
  330. fund:'',
  331. tel:''
  332. }
  333. }
  334. },
  335. methods:{
  336. init(){
  337. this.dialogVisible=false;
  338. this.dialogVisible1=false;
  339. this.dialogVisible2=false;
  340. },
  341. audit(val){ //审核按钮
  342. // if(this.status==-1){
  343. // this.dialogVisible=true;
  344. // return
  345. // }else if(this.status){
  346. // this.dialogVisible1=true;
  347. // return
  348. // }else{
  349. // this.dialogVisible=true;
  350. // }
  351. // console.log(val);
  352. // this.dialogVisible2=true
  353. this.iid=val //将要删除的id进行存储供删除对话框使用
  354. if (val.isupload==0) {
  355. this.dialogVisible=true;
  356. // console.log(val);
  357. this.auditDialog.projectName=val.title;
  358. this.auditDialog.person=val.pro_leader;
  359. this.auditDialog.department=val.name;
  360. this.auditDialog.fund=val.money;
  361. this.auditDialog.tel=val.phone;
  362. }
  363. },
  364. appTable(){ //查看申请表
  365. // window.open("https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E9%99%84%E4%BB%B6%202%EF%BC%9A%E5%88%9B%E5%AE%A2%E4%B8%93%E9%A1%B9%E8%B5%84%E9%87%91%E9%A1%B9%E7%9B%AE%E7%94%B3%E8%AF%B7%E8%A1%A8%EF%BC%88%E5%88%9B%E5%AE%A2%E6%B4%BB%E5%8A%A8%EF%BC%891681086540732.doc")
  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. .addDialog{ //删除对话框
  486. font-size: 18px;
  487. .el-dialog{
  488. border-radius: 5px;
  489. overflow: hidden;
  490. }
  491. .el-dialog__body{
  492. display: flex;
  493. justify-content: center;
  494. }
  495. .deleteContent{
  496. // margin: 30px 0;
  497. font-size: 22px;
  498. color: #000;
  499. }
  500. .addDialogLogo{
  501. width: 60px;
  502. height: 30px;
  503. display: flex;
  504. justify-content: center;
  505. line-height: 30px;
  506. border-radius: 5px;
  507. background: #f2f2f2;
  508. position: absolute;
  509. left: 20px; top: 15px;
  510. }
  511. .el-dialog__header{
  512. background: #32455b;
  513. position: relative;
  514. top: -2px;
  515. }
  516. .el-dialog__title{
  517. color:#fff;
  518. display: flex;
  519. justify-content: center;
  520. font-size: 18px;
  521. position: relative;
  522. top: -2px;
  523. }
  524. .addDialogMid{
  525. box-sizing: border-box;
  526. padding:0 60px 0 10px;
  527. .addDialogTit{
  528. display: flex;
  529. span{
  530. width: 80px;
  531. font-size: 16px;
  532. line-height: 40px;
  533. text-align: left;
  534. }
  535. }
  536. .addDialogTit1{
  537. display: flex;
  538. justify-content: space-between;
  539. margin-bottom: 15px;
  540. }
  541. .addDialogTit2{
  542. margin-top: 10px;
  543. font-size: 16px;
  544. color: #000;
  545. text-indent: 2em;
  546. }
  547. .addDialogCon{
  548. margin-top: 20px;
  549. }
  550. }
  551. .dialog-footer{
  552. display: flex;
  553. justify-content: center;
  554. box-sizing: border-box;
  555. }
  556. }
  557. .dialogWidth{ //立项审核对话框
  558. .el-input__inner{
  559. width: 300px;
  560. }
  561. .el-textarea__inner{
  562. width: 430px;
  563. }
  564. .el-dialog{
  565. width: 600px;
  566. border-radius: 5px;
  567. overflow: hidden;
  568. }
  569. .el-dialog__body{
  570. padding:30px 0px 30px 70px ;
  571. }
  572. .el-dialog__header{
  573. background: #32455b;
  574. }
  575. .el-dialog__title{
  576. color: #fff;
  577. position: relative;
  578. top: -2px;
  579. display: flex;
  580. justify-content: center;
  581. font-size: 18px;
  582. }
  583. .addDialogLogo{
  584. width: 60px;
  585. height: 30px;
  586. display: flex;
  587. justify-content: center;
  588. line-height: 30px;
  589. border-radius: 5px;
  590. background: #f2f2f2;
  591. position: absolute;
  592. left: 20px; top: 15px;
  593. }
  594. .diaTit{ //项目名称、负责人
  595. width: 100%;
  596. display: flex;
  597. .spans{
  598. width: 84px;
  599. font-size: 16px;
  600. margin-right: 10px;
  601. display: inline-block;
  602. text-align: justify;
  603. color: #000;
  604. font-size: 16px;
  605. text-justify:distribute-all-lines;
  606. text-align-last: justify;
  607. transform: translate(0,22%);
  608. margin-bottom: 10px;
  609. }
  610. }
  611. .spanCon{
  612. font-size: 16px;
  613. margin-top: 5px;
  614. color: #a0a0a0;
  615. width: 150px;
  616. overflow: hidden;
  617. white-space: nowrap;
  618. text-overflow: ellipsis;
  619. }
  620. .spans1{ //label
  621. min-width: 84px;
  622. font-size: 16px;
  623. color: #000;
  624. margin-right: 10px;
  625. display: inline-block;
  626. text-align: justify;
  627. text-justify:distribute-all-lines;
  628. text-align-last: justify;
  629. transform: translate(0,22%);
  630. }
  631. .diaTit1{ //label和input框
  632. display: flex;
  633. width: 80%;
  634. margin-top: 20px;
  635. }
  636. .dialog-footer{
  637. width: 100%;
  638. display: flex;
  639. justify-content: center;
  640. margin-bottom: 10px;
  641. }
  642. }
  643. }
  644. </style>