makerfund.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  1. <template>
  2. <!-- 创客资金管理 -->
  3. <div class="makerfund">
  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. <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 filterSelects"
  17. :key="item.id"
  18. :label="item.title"
  19. :value="item.id">
  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 departmentSelect"
  29. :key="item.id"
  30. :label="item.name"
  31. :value="item.id">
  32. </el-option>
  33. </el-select>
  34. </div>
  35. <div class="selectsBlock">
  36. <div class="selectLabel">分类</div>
  37. <el-select v-model="selectInp.type" @change="getData" placeholder="请选择">
  38. <el-option label="所有分类" value=""></el-option>
  39. <el-option
  40. v-for="item in typeSelects"
  41. :key="item.value"
  42. :label="item.label"
  43. :value="item.value">
  44. </el-option>
  45. </el-select>
  46. </div>
  47. <div class="selectsBlock">
  48. <div class="selectLabel">负责人</div>
  49. <el-select v-model="selectInp.leader" @change="getData" placeholder="请选择">
  50. <el-option label="所有负责人" value=""></el-option>
  51. <el-option
  52. v-for="(item,index) in leaderSelects"
  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.status" @change="getData" placeholder="请选择">
  62. <el-option label="所有状态" value=""></el-option>
  63. <el-option
  64. v-for="item in statusSelects"
  65. :key="item.value"
  66. :label="item.label"
  67. :value="item.value">
  68. </el-option>
  69. </el-select>
  70. </div>
  71. </div>
  72. <div class="ProjectManagementQuery">
  73. <el-input v-model="input" placeholder="请输入资金编号"></el-input>
  74. <el-button type="primary" class="btn" size="mini" @click="getData">查询</el-button>
  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. >
  88. <el-table-column
  89. prop="fNo"
  90. label="资金编号"
  91. align="center"
  92. >
  93. </el-table-column>
  94. <el-table-column
  95. prop="title"
  96. label="活动名称"
  97. align="center"
  98. >
  99. </el-table-column>
  100. <el-table-column
  101. prop="pro_leader"
  102. align="center"
  103. label="负责人"
  104. >
  105. </el-table-column>
  106. <el-table-column
  107. align="center"
  108. prop="type"
  109. label="项目类型"
  110. >
  111. <template #default="scope">
  112. <div>
  113. <span v-show="scope.row.type==0">活动创客</span>
  114. <span v-show="scope.row.type==1">个人创客</span>
  115. </div>
  116. </template>
  117. </el-table-column>
  118. <el-table-column
  119. prop="applyfund"
  120. align="center"
  121. label="申请经费(元)"
  122. >
  123. </el-table-column>
  124. <el-table-column
  125. prop="actualuse"
  126. align="center"
  127. label="实际使用(元)"
  128. >
  129. <template #default="scope">
  130. <div>
  131. <span>{{ scope.row.actualuse==null?'':scope.row.actualuse }}</span>
  132. </div>
  133. </template>
  134. </el-table-column>
  135. <el-table-column
  136. prop="name"
  137. align="center"
  138. label="所在部门"
  139. >
  140. </el-table-column>
  141. <el-table-column
  142. prop="status"
  143. align="center"
  144. label="状态"
  145. >
  146. <template #default="scope">
  147. <div>
  148. <span v-show="scope.row.state==0">未审核</span>
  149. <span v-show="scope.row.state==1">待审核</span>
  150. <span v-show="scope.row.state==2">已审核</span>
  151. <span v-show="scope.row.state==3">已报销</span>
  152. </div>
  153. </template>
  154. </el-table-column>
  155. <el-table-column
  156. prop="time"
  157. align="center"
  158. label="申请时间"
  159. >
  160. </el-table-column>
  161. <el-table-column
  162. prop="operation"
  163. align="center"
  164. width="380"
  165. label="操作"
  166. >
  167. <template #default="scope">
  168. <div class="operations">
  169. <el-button type="primary" size="mini" @click="details(scope.row.fid,scope.row.title,scope.row.acId)">查看详情</el-button>
  170. <el-button type="primary" v-show="scope.row.state==0" size="mini" @click="Audit(scope.row,0)">审核</el-button>
  171. <el-button type="primary" v-show="scope.row.state==1" class="disa" size="mini">已审核</el-button>
  172. <el-button type="primary" v-show="scope.row.state!=1 && scope.row.state!=0" class="disa" size="mini">已审核</el-button>
  173. <!-- <el-button type="primary" v-show="scope.row.state==2" class="disa" size="mini">已审核</el-button> -->
  174. <el-button type="primary" v-show="scope.row.state==0" class="disa" size="mini">审核1</el-button>
  175. <el-button type="primary" @click="Audit(scope.row,1)" v-show="scope.row.state==1" size="mini">审核1</el-button>
  176. <el-button type="primary" v-show="scope.row.state==2" class="disa" size="mini">审核1</el-button>
  177. <el-button type="primary" v-show="scope.row.state==3" class="disa" size="mini">审核1</el-button>
  178. <el-button v-show="scope.row.state==0" class="disa" type="primary" size="mini">完结</el-button>
  179. <el-button v-show="scope.row.state==1" class="disa" type="primary" size="mini">完结</el-button>
  180. <el-button v-show="scope.row.state==2" @click="endDialogShow(scope.row.fid)" type="primary" size="mini">完结</el-button>
  181. <el-button v-show="scope.row.state==3" class="disa" type="primary" size="mini">已完结</el-button>
  182. </div>
  183. </template>
  184. </el-table-column>
  185. </el-table>
  186. </div>
  187. <!-- 表格结束 -->
  188. <!-- 分页 -->
  189. <el-pagination
  190. @current-change="handleCurrentChange"
  191. :current-page="table.currentPage"
  192. :page-size="table.packageSize"
  193. layout=" prev, pager, next"
  194. background
  195. class="paginations"
  196. :total="table.total">
  197. </el-pagination>
  198. <!-- 分页结束 -->
  199. <!-- 审核对话框开始 -->
  200. <el-dialog
  201. title="立项审核"
  202. :visible.sync="dialogVisible"
  203. width="750px"
  204. class="pageSubmitData"
  205. :before-close="init">
  206. <div class="diaTit1" style="margin-top: 0;">
  207. <div class="spans">项目名称:</div><div style="margin-right: 30px;color: #adadad;">{{ ProjectFundData.title }}</div>
  208. <div class="spans">项目负责人:</div><div style="color:#adadad">{{ ProjectFundData.pro_leader }}</div>
  209. </div>
  210. <div class="addDialogLogo">LOGO</div>
  211. <div class="diaTit1">
  212. <div class="spans1">所在部门</div>
  213. <div class="inp">
  214. <el-input v-model="ProjectFundData.name" disabled placeholder="信通学院"></el-input>
  215. </div>
  216. </div>
  217. <div class="diaTit1">
  218. <div class="spans1">使用经费</div>
  219. <div class="inp">
  220. <el-input v-model="ProjectFundData.actualuse" disabled></el-input>
  221. </div>
  222. </div>
  223. <div class="diaTit1">
  224. <div class="spans1">联系电话</div>
  225. <div class="inp">
  226. <el-input v-model="ProjectFundData.phone" disabled></el-input>
  227. </div>
  228. </div>
  229. <div class="diaTit1">
  230. <div class="spans1">项目类型</div>
  231. <div class="inp">
  232. <el-select v-model="ProjectFundData.type" disabled placeholder="个人创客">
  233. <el-option
  234. v-for="item in options"
  235. :key="item.value"
  236. :label="item.label"
  237. :value="item.value">
  238. </el-option>
  239. </el-select>
  240. </div>
  241. </div>
  242. <!-- <div style="display: flex;">
  243. <div class="diaTit5" style="display: flex;">
  244. <div class="spans1">预算</div>
  245. <div>
  246. <el-input v-model="ProjectFundData.fund" placeholder="6000"></el-input>
  247. </div>
  248. </div>
  249. <div class="diaTit5">
  250. <div class="spans1">已支付</div>
  251. <div>
  252. <el-input v-model="ProjectFundData.usedFund" disabled placeholder="-"></el-input>
  253. </div>
  254. </div>
  255. <div class="diaTit5">
  256. <div class="spans1">余额</div>
  257. <div>
  258. <el-input :value="ProjectFundData.fund - ProjectFundData.usedFund" placeholder="6000"></el-input>
  259. </div>
  260. </div>
  261. </div> -->
  262. <!-- <div class="diaTit1" v-show="isManager==1">
  263. <div class="spans1" style="position: relative;top:-20px">驳回意见</div>
  264. <el-input
  265. type="textarea"
  266. :rows="3"
  267. resize="none"
  268. style="width: 100%;"
  269. placeholder="请输入修改建议等..."
  270. v-model="textarea">
  271. </el-input>
  272. </div> -->
  273. <div slot="footer" class="dialog-footer">
  274. <el-button type="primary" @click="auditPass(1)" v-show="isManager==0" class="AllDialogBtn">审核</el-button>
  275. <el-button type="primary" @click="auditPass(2)" v-show="isManager==1" class="AllDialogBtn">审核通过</el-button>
  276. <el-button type="primary" v-show="isManager==1" @click="auditPass(0)" class="AllDialogBtn">驳回</el-button>
  277. <el-button @click="dialogVisible=false" class="AllDialogBtn">取消</el-button>
  278. </div>
  279. </el-dialog>
  280. <!-- 审核对话框结束 -->
  281. <!-- 完结对话框开始 -->
  282. <el-dialog
  283. title="提示"
  284. :visible.sync="dialogVisible1"
  285. width="600px"
  286. class="pageSubmitData">
  287. <div class="addDialogLogo">LOGO</div>
  288. <div class="deleteContent">确定完结?</div>
  289. <span slot="footer" class="dialog-footer">
  290. <el-button type="primary" @click="confirmEnd" class="AllDialogBtn">确认完结</el-button>
  291. <el-button @click="dialogVisible1=false" class="AllDialogBtn">取消</el-button>
  292. </span>
  293. </el-dialog>
  294. <!-- 完结对话框结束-->
  295. </div>
  296. </template>
  297. <script>
  298. // import downloadFile from '@/components/tool/downloadFile.js';
  299. // import getExcel from "@/components/tool/getExcel";
  300. export default {
  301. data() {
  302. return {
  303. selectInp:{ //搜索下拉框的值
  304. filter:'',
  305. department:'',
  306. type:'',
  307. leader:'',
  308. status:''
  309. },
  310. loading:false,
  311. ProjectFundData:{},
  312. projectFundState:'',
  313. isManager:'', //审核与驳回框的区别
  314. dialogVisible1:false,
  315. dialogVisible:false, //立即审核
  316. revocation:false, //撤回
  317. createFromDialog:false, //生成表单
  318. projectFilter:[], //项目名称
  319. textarea:'', //立项审核事由
  320. input:'',
  321. value:'',
  322. options:[
  323. {value:1,label:'个人创客'},
  324. {value:0,label:'活动创客'},
  325. ],
  326. status:'',
  327. table:{ // 分页数据
  328. total:0,
  329. packageSize:8,
  330. currentPage:1
  331. },
  332. filterSelects:[],
  333. departmentSelect:[],
  334. typeSelects:[
  335. {
  336. value:1,
  337. label:'个人创客'
  338. },
  339. {
  340. value:0,
  341. label:'活动创客'
  342. },
  343. ],
  344. leaderSelects:[],
  345. statusSelects:[
  346. {
  347. value:0,
  348. label:'未审核'
  349. },
  350. {
  351. value:1,
  352. label:'已审核'
  353. },
  354. ],
  355. tableData:[ ],//列表
  356. }
  357. },
  358. methods:{
  359. Audit(val,num){ //显示审核对话框
  360. // if (val.actualuse==0) return this.$message.error('请填写实际使用金额')
  361. console.log(val);
  362. this.isManager=num
  363. this.ProjectFundData=val;
  364. this.dialogVisible=true;
  365. },
  366. auditPass(val){ //审核通过
  367. // console.log(111);
  368. let param={
  369. uid:this.$store.state.userInfo.userid,
  370. fid:this.ProjectFundData.fid,
  371. status:val
  372. }
  373. this.ajax
  374. .post(this.$store.state.api+"/UpdateMakerFundState",param)
  375. .then(res=>{
  376. this.dialogVisible=false;
  377. if (res.data) {
  378. this.$message.success('审核成功')
  379. this.getData()
  380. }else{
  381. this.$message.error('审核失败')
  382. }
  383. },err=>{
  384. console.log(err);
  385. })
  386. },
  387. endDialogShow(val){ //完结对话框显示
  388. this.dialogVisible1=true
  389. this.projectFundState=val
  390. console.log(val);
  391. },
  392. confirmEnd(){ //确定完结
  393. let param={
  394. uid:this.$store.state.userInfo.userid,
  395. fid:this.projectFundState,
  396. status:3
  397. }
  398. console.log(param);
  399. this.ajax
  400. .post(this.$store.state.api+"/UpdateMakerFundState",param)
  401. .then(res=>{
  402. console.log(res);
  403. this.dialogVisible1=false
  404. if (res.data) {
  405. this.$message.success('完结成功')
  406. this.getData()
  407. }else{
  408. this.$message.error('完结失败')
  409. }
  410. },err=>{
  411. console.log(err);
  412. })
  413. },
  414. handleCurrentChange(val) { //当页数发生改变的时候调用获取列表数据请求
  415. // console.log(`当前页: ${val}`);
  416. this.table.currentPage=val
  417. this.getData()
  418. },
  419. getData(){
  420. // this.loading = true;
  421. let param={
  422. uid:this.$store.state.userInfo.userid,
  423. filter:this.selectInp.filter,
  424. department:this.selectInp.department,
  425. type:this.selectInp.type,
  426. leader:this.selectInp.leader,
  427. status:this.selectInp.status,
  428. inp:this.input,
  429. page:this.table.currentPage,
  430. lim:this.table.packageSize
  431. }
  432. // console.log(param);
  433. this.ajax
  434. .get(this.$store.state.api+'/selectAllFundApply',param)
  435. .then(res=>{
  436. let data=res.data;
  437. console.log(data);
  438. let AllFund=0
  439. if (data[0].length==0 && data[4][0]['total'] != 0) {
  440. this.table.currentPage=1
  441. this.getData()
  442. }
  443. // console.log(data[0][0]['applyfund']);
  444. // data[0][0]['applyfund'].fo
  445. data[0].forEach(e => {
  446. e.applyfund=JSON.parse(e.applyfund)
  447. for(let i in e.applyfund){
  448. AllFund+=e.applyfund[i]*1
  449. }
  450. e.applyfund=AllFund
  451. AllFund=0
  452. });
  453. data[0].forEach(e => {
  454. e.actualuse=JSON.parse(e.actualuse)
  455. for(let i in e.actualuse){
  456. AllFund+=e.actualuse[i]*1
  457. }
  458. e.actualuse=AllFund
  459. AllFund=0
  460. });
  461. console.log(data[0]);
  462. this.tableData=data[0];
  463. this.filterSelects=data[1];
  464. this.departmentSelect=data[2];
  465. this.leaderSelects=data[3];
  466. this.table.total=data[4][0].total
  467. this.loading = false;
  468. },err=>{
  469. console.log(err);
  470. })
  471. },
  472. apply(){ //创客资金申请跳转界面
  473. this.$router.push('/newMarkerfundApply')
  474. },
  475. init(){
  476. this.dialogVisible=false
  477. this.createFromDialog=false
  478. },
  479. details(Id,tit,aid){ //跳转详情页面
  480. // return console.log(Id,tit,aid);
  481. this.$router.push(`/newMarkerfundDetails?Id=${Id}&tit=${tit}&aid=${aid}`)
  482. }
  483. },
  484. mounted(){
  485. this.getData();
  486. }
  487. }
  488. </script>
  489. <style lang="less" scoped>
  490. .makerfund{
  491. // :deep(.el-table--scrollable-x .el-table__body-wrapper){
  492. // overflow-x: none;
  493. // }
  494. // .el-dialog{
  495. // border-radius: 5px;
  496. // overflow: hidden;
  497. // }
  498. .dialog-footer{
  499. width: 100%;
  500. display: flex;
  501. justify-content: center;
  502. }
  503. .dialog{//审核
  504. .el-dialog__header{
  505. background: #32455b;
  506. }
  507. .addDialogLogo{
  508. width: 60px;
  509. height: 30px;
  510. border-radius: 5px;
  511. display: flex;
  512. justify-content: center;
  513. line-height: 30px;
  514. background: #f2f2f2;
  515. position: absolute;
  516. left: 20px; top: 15px;
  517. }
  518. .el-dialog__title{
  519. color:#fff;
  520. display: flex;
  521. justify-content: center;
  522. font-size: 18px;
  523. position: relative;
  524. top: -2px;
  525. }
  526. .diaBtn{ //dialog按钮
  527. font-size: 16px;
  528. }
  529. .el-dialog__body{
  530. padding:30px 0px 30px 50px ;
  531. }
  532. .diaTit{
  533. width: 100%;
  534. display: flex;
  535. font-size: 16px;
  536. // margin-right: 20px;
  537. justify-content: flex-start;
  538. }
  539. .diaTit1{
  540. display: flex;
  541. margin-top: 20px;
  542. font-size: 16px;
  543. width: 91%;
  544. .spans{
  545. font-size: 16px;
  546. color: #000;
  547. box-sizing: border-box;
  548. padding-right: 10px;
  549. }
  550. }
  551. .spans1{
  552. color: #000;
  553. min-width: 70px;
  554. margin-right: 5px;
  555. display: inline-block;
  556. text-align: justify;
  557. text-justify:distribute-all-lines;
  558. text-align-last: justify;
  559. transform: translate(0,22%);
  560. padding-right: 15px;
  561. }
  562. // .el-input__inner{
  563. // width: 300px;
  564. // }
  565. .diaTit5{
  566. display: flex;
  567. margin-right: 15px;
  568. .el-input__inner{
  569. width: 100px;
  570. }
  571. }
  572. }
  573. }
  574. </style>