projectApplication.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622
  1. <template>
  2. <!-- 项目立项申请 -->
  3. <div class="projectApplication" v-loading="loading">
  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="selectInp">
  48. <div class="ProjectManagementQuery">
  49. <el-input v-model="selectText" @change="getData" placeholder="请输入项目名称"></el-input>
  50. <el-button type="primary" class="btn" @click="getData" size="mini">查询</el-button>
  51. </div>
  52. </div> -->
  53. <div class="selectsBlock">
  54. <div class="selectLabel">负责人</div>
  55. <el-select v-model="selectInp.person" @change="getData" placeholder="请选择">
  56. <el-option label="所有负责人" value=""></el-option>
  57. <el-option
  58. v-for="(item,index) in options.person"
  59. :key="index"
  60. :label="item.pro_leader"
  61. :value="item.pro_leader">
  62. </el-option>
  63. </el-select>
  64. </div>
  65. <div class="selectsBlock">
  66. <div class="selectLabel">状态</div>
  67. <el-select v-model="selectInp.state" @change="getData" placeholder="请选择">
  68. <el-option
  69. v-for="item in options.state"
  70. :key="item.value"
  71. :label="item.label"
  72. :value="item.value">
  73. </el-option>
  74. </el-select>
  75. </div>
  76. </div>
  77. <!-- 搜索框结束 -->
  78. <!-- 表格开始 -->
  79. <div>
  80. <el-table
  81. ref="multipleTable"
  82. :data="tableData"
  83. tooltip-effect="dark"
  84. stripe
  85. class="fontSize"
  86. :header-cell-style="{ background: '#f2f2f2',color:'#000' }"
  87. @selection-change="handleSelectionChange">
  88. <!-- selection-change批量选择功能后续可能用到 -->
  89. <!--
  90. <el-table-column
  91. type="selection"
  92. width="25"
  93. >
  94. </el-table-column> -->
  95. <el-table-column
  96. prop="ProjectNo"
  97. label="项目编号"
  98. align="center"
  99. min-width="9%">
  100. </el-table-column>
  101. <el-table-column
  102. prop="title"
  103. label="项目名称"
  104. align="center"
  105. min-width="10%">
  106. </el-table-column>
  107. <el-table-column
  108. prop="pro_leader"
  109. align="center"
  110. label="项目负责人"
  111. min-width="9%">
  112. </el-table-column>
  113. <el-table-column
  114. prop="name"
  115. align="center"
  116. label="所在部门"
  117. min-width="10%">
  118. </el-table-column>
  119. <el-table-column
  120. prop="sort"
  121. align="center"
  122. label="分类"
  123. min-width="10%">
  124. </el-table-column>
  125. <el-table-column
  126. prop="fund"
  127. label="预算(万)"
  128. align="center"
  129. min-width="8%">
  130. <template #default="scope">
  131. <div>
  132. {{ scope.row.fund/10000 }}
  133. </div>
  134. </template>
  135. </el-table-column>
  136. <el-table-column
  137. prop="startTime"
  138. align="center"
  139. label="开始时间"
  140. min-width="9%">
  141. </el-table-column>
  142. <el-table-column
  143. prop="phone"
  144. align="center"
  145. label="联系电话"
  146. min-width="10%">
  147. <template #default="scope">
  148. <div>
  149. {{ scope.row.phone!=null||scope.row.phone==''?scope.row.phone:"-" }}
  150. </div>
  151. </template>
  152. </el-table-column>
  153. <el-table-column
  154. prop="state"
  155. label="状态"
  156. align="center"
  157. min-width="6%">
  158. <template #default="scope">
  159. <div>
  160. <!-- {{scope.row.name + (scope.row.status==0?"":"(已屏蔽)")}} -->
  161. <!-- {{ (scope.row.isupload==0?"未审核": scope.row.data==1?"正在审核":"已审核") }} -->
  162. <span v-if="scope.row.isupload==0">未审核</span>
  163. <span v-if="scope.row.isupload==1">审核中</span>
  164. <span v-if="scope.row.isupload==2">进行中</span>
  165. <span v-if="scope.row.isupload==3">待结项</span>
  166. <span v-if="scope.row.isupload==4">已结项</span>
  167. </div>
  168. </template>
  169. </el-table-column>
  170. <el-table-column
  171. prop="operation"
  172. width="500"
  173. align="center"
  174. label="操作"
  175. >
  176. <template #default="scope">
  177. <div class="operations">
  178. <!-- {{ scope.row.isupload }} -->
  179. <el-button type="primary" size="mini" @click="lookDetail(scope.row.courseId,scope.row.typeid)">查看详情</el-button>
  180. <el-button type="primary" v-show="scope.row.isupload==0" @click="audit(scope.row,0)" size="mini" >审核</el-button> <!--0申请人审核 -->
  181. <el-button type="primary" v-show="scope.row.isupload==1 " class="disa" size="mini" >审核中</el-button>
  182. <el-button type="primary" v-show="scope.row.isupload==2" class="disa" size="mini">已审核</el-button>
  183. <el-button type="primary" v-show="scope.row.isupload==3" class="disa" size="mini">待结项</el-button>
  184. <el-button type="primary" v-show="scope.row.isupload==4" class="disa" size="mini">已结项</el-button>
  185. <el-button v-show="scope.row.isupload==0" type="primary" class="disa" size="mini">审核</el-button> <!--1管理员审核 -->
  186. <el-button v-show="scope.row.isupload==1" type="primary" size="mini" @click="audit(scope.row,1)">审核1</el-button>
  187. <el-button v-show="scope.row.isupload==2" type="primary" class="disa" size="mini">已审核</el-button>
  188. <el-button v-show="scope.row.isupload==3" type="primary" class="disa" size="mini">待结项</el-button>
  189. <el-button v-show="scope.row.isupload==4" type="primary" class="disa" size="mini">已结项</el-button>
  190. <!-- <el-button type="primary" size="mini" @click="appTable(scope.row.typeid,scope.row.courseId)" >申请表</el-button> -->
  191. <el-button type="primary" size="mini" @click="del(scope.row)">删除</el-button>
  192. </div>
  193. </template>
  194. </el-table-column>
  195. </el-table>
  196. </div>
  197. <!-- 表格结束 -->
  198. <!-- 分页 -->
  199. <el-pagination
  200. @current-change="handleCurrentChange"
  201. :current-page="table.currentPage"
  202. :page-size="table.packageSize"
  203. layout=" prev, pager, next"
  204. background
  205. class="paginations"
  206. :total="table.total">
  207. </el-pagination>
  208. <!-- 分页结束 -->
  209. <!-- 立项审核对话框开始 -->
  210. <el-dialog
  211. title="立项审核"
  212. :visible.sync="dialogVisible"
  213. class="pageSubmitData"
  214. width="700px"
  215. :before-close="init">
  216. <div class="diaTit">
  217. <div class="addDialogLogo">LOGO</div>
  218. <div class="spans">项目名称:</div>
  219. <div class="spanCon">{{ auditDialog.projectName }}</div>
  220. <div class="spans">项目负责人:</div>
  221. <div class="spanCon">{{ auditDialog.person }}</div>
  222. </div>
  223. <div class="diaTit1">
  224. <div class="spans1">所在部门</div>
  225. <div class="inp">
  226. <el-input disabled v-model="auditDialog.department" placeholder="所在部门"></el-input>
  227. </div>
  228. </div>
  229. <div class="diaTit1">
  230. <div class="spans1">预算总经费</div>
  231. <div class="inp">
  232. <el-input disabled v-model="auditDialog.fund" placeholder="预算总经费"></el-input>
  233. </div>
  234. </div>
  235. <div class="diaTit1">
  236. <div class="spans1">联系电话</div>
  237. <div class="inp">
  238. <el-input disabled v-model="auditDialog.tel" placeholder="联系电话"></el-input>
  239. </div>
  240. </div>
  241. <div class="diaTit1" v-show="isManager==1">
  242. <div class="spans1" style="position: relative;top:-24px">驳回意见</div>
  243. <div class="inp">
  244. <el-input
  245. type="textarea"
  246. :rows="5"
  247. resize="none"
  248. placeholder="请输入修改建议等..."
  249. v-model="rejectApplyText">
  250. </el-input>
  251. </div>
  252. </div>
  253. <div slot="footer" class="dialog-footer">
  254. <el-button type="primary" v-show="isManager==0" @click="ApplyPersonCommit" class="AllDialogBtn" >审核</el-button>
  255. <el-button type="primary" v-show="isManager==1" @click="ManagerCommit" class="AllDialogBtn" >通过</el-button>
  256. <el-button type="primary" v-show="isManager==1" @click="rejectApply" class="AllDialogBtn" >驳回</el-button>
  257. <el-button @click="init" class="AllDialogBtn">取消</el-button>
  258. </div>
  259. </el-dialog>
  260. <!-- 立项审核对话框结束 -->
  261. <!-- 删除通知开始 -->
  262. <el-dialog
  263. title="删除项目"
  264. :visible.sync="dialogVisible2"
  265. width="600px"
  266. class="pageSubmitData">
  267. <div class="addDialogLogo">LOGO</div>
  268. <div class="deleteContent">确定删除项目?</div>
  269. <span slot="footer" class="dialog-footer">
  270. <el-button type="primary" @click="dialogDel" class="AllDialogBtn">确认删除</el-button>
  271. <el-button @click="init" class="AllDialogBtn" >取消</el-button>
  272. </span>
  273. </el-dialog>
  274. <!-- 删除通知结束-->
  275. </div>
  276. </template>
  277. <script>
  278. import {MakerSpaceWord,MakerStudentWord,getWord} from '@/components/tool/getWord.js'
  279. import MakerSpaceWordPreview from '@/components/MakerSpaceWordPreview.vue';
  280. import studentMakerProjectPreview from '@/components/studentMakerProjectPreview.vue'
  281. export default {
  282. components:{MakerSpaceWordPreview,studentMakerProjectPreview},
  283. data() {
  284. return {
  285. iid:'',
  286. loading:false,
  287. textarea:'',
  288. input:'',
  289. dialogVisible:false,//立项审核
  290. dialogVisible1:false,//立项撤回提交
  291. dialogVisible2:false,//删除
  292. WordPreview:false,//文档预览
  293. downloadWord:false,//申请表下载
  294. PreviewTid:"",//预览分类ID
  295. PreviewData:"",//预览数据
  296. rejectApplyText:'', //驳回-修改建议
  297. isManager:0, //0申请人审核科----- 1管理员审核框
  298. // 分页数据
  299. table:{
  300. total:0,
  301. packageSize:7,
  302. currentPage:1
  303. },
  304. tableData:[], //列表数据
  305. selectInp:{ // 头部搜索框的内容
  306. filter:'',
  307. department:'',
  308. sort:'',
  309. person:'',
  310. state:'',
  311. },
  312. options:{ //头部搜索框下拉框数据
  313. projectFilter:[],//项目筛选
  314. department:[],//部门
  315. sort:[],//分类
  316. person:[],//负责人
  317. state:[//状态
  318. {
  319. value:'',
  320. label:'全部'
  321. },
  322. {
  323. value:0,
  324. label:'未审核'
  325. },
  326. {
  327. value:1,
  328. label:'审核中'
  329. },
  330. {
  331. value:2,
  332. label:'进行中'
  333. },
  334. {
  335. value:3,
  336. label:"待结项"
  337. },
  338. {
  339. value:4,
  340. label:"已结项"
  341. },
  342. ],
  343. },
  344. auditDialog:{ //审核对话框数据
  345. projectName:'',
  346. person:'',
  347. department:'',
  348. fund:'',
  349. tel:'',
  350. // cid:''
  351. }
  352. }
  353. },
  354. methods:{
  355. init(){
  356. this.dialogVisible=false;
  357. this.dialogVisible1=false;
  358. this.dialogVisible2=false;
  359. },
  360. audit(val,num){ //审核按钮
  361. this.isManager=num;
  362. this.iid=val //储存id给对话框
  363. // if (val.isupload==0) {
  364. this.dialogVisible=true;
  365. // console.log(val);
  366. this.auditDialog.projectName=val.title;
  367. this.auditDialog.person=val.pro_leader;
  368. this.auditDialog.department=val.name;
  369. this.auditDialog.fund=val.fund;
  370. this.auditDialog.tel=val.phone || '-';
  371. // this.auditDialog.cid=courseId
  372. // }
  373. },
  374. appTable(tid,pid){ //查看申请表
  375. // console.log();
  376. if(tid=="5e21b204-c206-11ed-a4cd-509a4c5b67cf"){
  377. // downloadFile('/file/附件2:2023年学生创客项目申报书模板(2).docx',"2023年学生创客项目申报书模板.docx",(_b)=>this.loading = _b);
  378. this.ajax.get(this.$store.state.api+"/SelectProjectWordMakerStudent",{
  379. uid:this.$store.state.userInfo.userid,
  380. pid:pid
  381. }).then(res=>{
  382. // console.log(res['data']);
  383. let data=res['data']
  384. this.downloadWord=true
  385. // this.downWord(data)
  386. // this.PreviewData = [res['data'][0][0],res['data'][1]];
  387. // return console.log(this.PreviewData);
  388. // this.WordPreview = true;
  389. // this.PreviewTid = tid;
  390. }).catch(err=>{
  391. console.log(err)
  392. })
  393. }else if(tid=="5f7a66d5-c206-11ed-a4cd-509a4c5b67cf"){
  394. this.ajax.get(this.$store.state.api+"/SelectProjectWordMakerSpace",{
  395. uid:this.$store.state.userInfo.userid,
  396. pid:pid
  397. }).then(res=>{
  398. this.PreviewData = [res['data'][0][0],res['data'][1]];
  399. this.WordPreview = true;
  400. this.PreviewTid = tid;
  401. // MakerSpaceWord(res['data'][0][0],res['data'][1]);
  402. }).catch(err=>{
  403. console.log(err)
  404. })
  405. }else{
  406. this.$message.error("错误")
  407. }
  408. },
  409. downWord(data){
  410. if(this.PreviewTid=='5f7a66d5-c206-11ed-a4cd-509a4c5b67cf'){
  411. MakerSpaceWord(this.PreviewData[0],this.PreviewData[1]);
  412. }else{
  413. getWord(data[0][0]);
  414. }
  415. },
  416. ManagerCommit(){ //立项审核对话框里面的管理员通过按钮
  417. // console.log(this.iid);
  418. let param={
  419. uid:this.$store.state.userInfo.userid,
  420. pid:this.iid.courseId,
  421. num:2
  422. }
  423. this.ajax
  424. // .post(this.$store.state.api+"/ApproveProject",param)
  425. .post(this.$store.state.api+"/updateIsupload",param)
  426. .then(res=>{
  427. // console.log(res);
  428. this.dialogVisible=false;
  429. this.$message.success('提交成功')
  430. this.getData()
  431. },err=>{
  432. console.log(err);
  433. })
  434. },
  435. ApplyPersonCommit(){ //申请人审核按钮
  436. let param={
  437. uid:this.$store.state.userInfo.userid,
  438. pid:this.iid.courseId,
  439. num:1
  440. }
  441. this.ajax
  442. .post(this.$store.state.api+"/updateIsupload",param) //updateIsupload
  443. .then(res=>{
  444. this.dialogVisible=false
  445. this.$message.success('已提交')
  446. this.getData()
  447. })
  448. },
  449. rejectApply(){ //立项审核对话框里面的驳回申请
  450. let param={
  451. uid:this.$store.state.userInfo.userid,
  452. pid:this.iid.courseId,
  453. num:0
  454. }
  455. this.ajax
  456. .post(this.$store.state.api+"/updateIsupload",param)
  457. .then(res=>{
  458. this.dialogVisible=false
  459. this.$message.success('已驳回项目申请')
  460. this.getData()
  461. })
  462. },
  463. commit2(val){ //立项撤回对话框里面的确定撤回按钮
  464. this.dialogVisible1=false;
  465. this.status--
  466. },
  467. handleSelectionChange(val) { //批量选择功能后续可能用到
  468. // console.log(val);
  469. this.multipleSelection = val;
  470. },
  471. lookDetail(val,tid){ //查看详情按钮
  472. // localStorage.setItem("pid",JSON.stringify(val))
  473. this.$router.push(`/projectApplicationDetailMain?tid=${tid}&pid=${val}`)
  474. },
  475. // apply(){ //项目立项申请按钮
  476. // this.$router.push('/projectApplicationApplyMain')
  477. // },
  478. getData(){ //获取表格数据
  479. this.loading = true;
  480. let param={
  481. uid:this.$store.state.userInfo.userid,
  482. pid:this.selectInp.filter, //筛选
  483. did:this.selectInp.department, //部门
  484. tid:this.selectInp.sort, //分类
  485. leader:this.selectInp.person, //负责人
  486. st:this.selectInp.state, //审核状态
  487. year:"",
  488. textInp:'',
  489. page:this.table.currentPage, //当前页
  490. lim:this.table.packageSize //限制获取几条数据
  491. }
  492. // return console.log(param);
  493. // console.log(param)
  494. this.ajax
  495. .get(this.$store.state.api+'/SelectAllProject',param)
  496. .then(res=>{
  497. let data=res.data;
  498. if (data[0].length==0 && data[5][0]['total'] != 0) {
  499. this.table.currentPage=1
  500. return this.getData()
  501. }
  502. let a=this.options;
  503. this.tableData=data[0];
  504. a.projectFilter=data[1];
  505. a.department=data[2];
  506. a.sort=data[3];
  507. a.person=data[4];
  508. this.table.total=data[5][0].total
  509. // this.tableData.forEach(item=>{
  510. // if(item['time']!=null&&item['time']!=''){
  511. // item['time']=JSON.parse(item['time'])
  512. // }else{
  513. // item['time'] = []
  514. // }
  515. // })
  516. this.loading = false;
  517. // console.log(this.tableData)
  518. },err=>{
  519. console.log(err);
  520. })
  521. },
  522. del(val) { //表格删除按钮,点击显示删除对话框
  523. // console.log(val);
  524. this.dialogVisible2=true
  525. this.iid=val //将要删除的id进行存储供删除对话框使用
  526. },
  527. dialogDel(){ //确定删除这个项目
  528. // console.log(this.iid)
  529. if (this.iid.userid == this.$store.state.userInfo.userid) {
  530. let param={
  531. uid:this.$store.state.userInfo.userid,
  532. pid:this.iid.courseId
  533. }
  534. this.ajax
  535. .post(this.$store.state.api+"/DeleteProject",param)
  536. .then(res=>{
  537. // console.log(res);
  538. if (res.data) {
  539. this.$message.success('删除成功')
  540. this.getData()
  541. this.dialogVisible2=false
  542. return
  543. }else{
  544. this.$message.error('删除失败')
  545. }
  546. },err=>{
  547. console.log(err);
  548. })
  549. }
  550. },
  551. handleCurrentChange(val) { //当页数发生改变的时候调用获取列表数据请求
  552. // console.log(`当前页: ${val}`);
  553. this.table.currentPage=val
  554. this.getData()
  555. },
  556. },
  557. watch:{ //监视选择框的变化,实施刷新表格数据
  558. // options:{
  559. // handler(){
  560. // immediate:true
  561. // deep:true
  562. // this.getData()
  563. // }
  564. // }
  565. },
  566. mounted(){ //跳转到此页面立刻获取数据
  567. this.getData(); //获取表格数据
  568. }
  569. }
  570. </script>
  571. <style lang="less">
  572. .projectApplication{
  573. .el-table::before{
  574. height: 0;
  575. }
  576. }
  577. </style>