makerfund.vue 20 KB

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