newNomMarkerFundApply.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  1. <template>
  2. <!-- 创客资金申请表单 -->
  3. <div>
  4. <div class="vfpHeader">
  5. <div class="titleOne">创客活动资金申请</div>
  6. </div>
  7. <hr>
  8. <!-- 项目名称、类型开始 -->
  9. <div class="Apply1">
  10. <div class="inpInterval">项目名称</div>
  11. <el-select v-model="projectName" style="width: 30%;" placeholder="请选择">
  12. <el-option
  13. v-for="item in projectFilter"
  14. :key="item.id"
  15. :label="item.title"
  16. :value="item.id">
  17. </el-option>
  18. </el-select>
  19. </div>
  20. <div class="tabTit">
  21. <div>
  22. <p>经费支出类别(单位:元)</p>
  23. </div>
  24. </div>
  25. <hr>
  26. <table border="1" cellspacing="0" class="table">
  27. <tr>
  28. <td colspan="2">经济支出类别</td><td>预算</td><td>已支付</td><td>本次申请</td><td>余额</td><td colspan="3">备注</td>
  29. </tr>
  30. <tr v-for="(item,index) in fundList" :key="index">
  31. <td colspan="2">{{ item.fundName }}</td>
  32. <td>
  33. {{item.budget}}
  34. </td>
  35. <td>
  36. {{item.havePaid}}
  37. </td>
  38. <td>
  39. <el-input
  40. type="number"
  41. autosize
  42. style="width: 100%;"
  43. resize="none"
  44. onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"
  45. placeholder="本次申请"
  46. v-model="item.thisApply">
  47. </el-input>
  48. </td>
  49. <td>
  50. {{ item.budget-item.havePaid-item.thisApply }}
  51. </td>
  52. <td colspan="3" style="box-sizing: border-box;padding: 0 10px;">
  53. {{ item.remark }}
  54. </td>
  55. </tr>
  56. <tr>
  57. <td>事由</td>
  58. <td colspan="10" class="textLeft">
  59. <el-input
  60. type="textarea"
  61. :autosize="{ minRows: 6, maxRows: 20}"
  62. style="width: 100%;"
  63. resize="none"
  64. placeholder=""
  65. v-model="intro">
  66. </el-input>
  67. </td>
  68. </tr>
  69. <tr>
  70. <td v-for="(i,k) in 9" :key="k" style="border: none;"></td>
  71. </tr>
  72. </table>
  73. <div class="baseBtn">
  74. <div class="blockWidth">
  75. <el-button type="primary" @click="download">生成表单</el-button>
  76. <el-button type="primary" @click="submitData">提交</el-button>
  77. </div>
  78. </div>
  79. <!-- 下载文档开始 -->
  80. <el-dialog
  81. title="生成Excel"
  82. :visible.sync="downLoadExcelDig"
  83. width="600px"
  84. class="pageSubmitData"
  85. >
  86. <div class="addDialogLogo">LOGO</div>
  87. <span class="deleteContent">确定生成Excel?</span>
  88. <span slot="footer" class="dialog-footer">
  89. <el-button type="primary" @click="downLoadExcel" class="AllDialogBtn">确认</el-button>
  90. <el-button @click="downLoadExcelDig = false" class="AllDialogBtn">取消</el-button>
  91. </span>
  92. </el-dialog>
  93. <!-- 下载文档结束-->
  94. <!-- 提交文档开始 -->
  95. <el-dialog
  96. title="提交"
  97. :visible.sync="submitDataDig"
  98. width="600px"
  99. class="pageSubmitData"
  100. >
  101. <div class="addDialogLogo">LOGO</div>
  102. <span class="deleteContent">确定提交?</span>
  103. <span slot="footer" class="dialog-footer">
  104. <el-button type="primary" @click="submitAll" class="AllDialogBtn">确认</el-button>
  105. <el-button @click="submitDataDig = false" class="AllDialogBtn">取消</el-button>
  106. </span>
  107. </el-dialog>
  108. <!-- 提交文档结束-->
  109. </div>
  110. </template>
  111. <script>
  112. import getFundNo from '@/components/tool/getProjectNo';
  113. import BeUpload from "../../components/tool/beUpload.vue";
  114. // import getExcel from "@/components/tool/getExcel";
  115. import {getExcel} from '@/components/tool/downloadExcel'
  116. export default {
  117. components: {
  118. BeUpload,
  119. },
  120. data() {
  121. return {
  122. projectFilter:[], //项目名称列表
  123. projectName:'', //所选名称
  124. downLoadExcelDig:false,//下载Excel对话框
  125. submitDataDig:false,//提交对话框
  126. allFund:'',//总经费
  127. fundList:[
  128. {fundName:'小型仪器设备费',budget:'',havePaid:0,thisApply:'',remark:'项目开展所需的小型专用仪器设备、工具、配件购置或租赁费用。'},
  129. {fundName:'材料费',budget:'',havePaid:0,thisApply:'',remark:'项目开展需消耗的各种原材料、辅助材料等低值易耗品的采购费用。'},
  130. {fundName:'测试化验加工费',budget:'',havePaid:0,thisApply:'',remark:'项目开展过程中支付给外单位的检验、测试、化验、计算、分析及加工费等费用。'},
  131. {fundName:'项目协作费',budget:'',havePaid:0,thisApply:'',remark:'按合同规定支付给协作单位的费用'},
  132. {fundName:'项目成功鉴定费',budget:'',havePaid:0,thisApply:'',remark:'学术会务费、评审费、鉴定费、成果集制作费等费用。'},
  133. {fundName:'参展参赛费',budget:'',havePaid:0,thisApply:'',remark:'参加创客展会、竞赛等所需的报名费、展位费、布展费、宣传推广费及差旅费等费用。'},
  134. {fundName:'创客交流活动费',budget:'',havePaid:0,thisApply:'',remark:'创客交流活动中支付给校外专家的指导费、咨询费、授课费等费用。'},
  135. {fundName:'知识产权事务费',budget:'',havePaid:0,thisApply:'',remark:'论文版面费、专利及其他知识产权事务等费用。'},
  136. ],
  137. intro:'', //事由
  138. }
  139. },
  140. methods:{
  141. getData(){ //获取活动经费的项目名称
  142. let param={
  143. uid:this.$store.state.userInfo.userid,
  144. type:1
  145. }
  146. this.ajax
  147. .get(this.$store.state.api+'/SelectMakerFundSelects',param)
  148. .then(res=>{
  149. let data=res.data[0]
  150. // console.log(data);
  151. this.projectFilter=data
  152. },err=>{
  153. console.log(err);
  154. })
  155. },
  156. getFundData(){
  157. // console.log(this.projectName);
  158. //total:总经费
  159. //小型仪器设备费:device deviceRemarks
  160. //材料费:Material MaterialRemarks
  161. //测试化验加工费:processing processingRemarks
  162. //项目协作费:Collaboration CollaborationRemarks
  163. //项目成果鉴定费:APPRAISAL APPRAISALRemarks
  164. //参展参赛费:entery enteryRemarks
  165. //创客交流活动费:activities activitiesRemarks
  166. //知识产权事务费:Transaction TransactionRemarks
  167. let param={
  168. uid:this.$store.state.userInfo.userid,
  169. aid:this.projectName,
  170. }
  171. this.ajax
  172. .get(this.$store.state.api+'/selectMarkerFundData',param)
  173. .then(res=>{
  174. console.log(res.data);
  175. let data=JSON.parse(res.data[0][0]['fund']);
  176. // let usedFund=JSON.parse(res.data[0][0]['usedFund']);
  177. // console.log(data);
  178. this.fundList[0].budget=data.device
  179. this.fundList[1].budget=data.Material
  180. this.fundList[2].budget=data.processing
  181. this.fundList[3].budget=data.Collaboration
  182. this.fundList[4].budget=data.APPRAISAL
  183. this.fundList[5].budget=data.entery
  184. this.fundList[6].budget=data.activities
  185. this.fundList[7].budget=data.Transaction
  186. let arr= res['data'][0].filter(e=>{
  187. return e.actualuse!=null
  188. })
  189. console.log(arr);
  190. // let isUse = arr;
  191. if (arr) {
  192. // console.log(111);
  193. arr.forEach(item=>{
  194. let JP = JSON.parse(item['actualuse']);
  195. this.fundList[0]['havePaid']+=Number(JP['device']);
  196. this.fundList[1]['havePaid']+=Number(JP['Material']);
  197. this.fundList[2]['havePaid']+=Number(JP['processing']);
  198. this.fundList[3]['havePaid']+=Number(JP['Collaboration']);
  199. this.fundList[4]['havePaid']+=Number(JP['APPRAISAL']);
  200. this.fundList[5]['havePaid']+=Number(JP['entery']);
  201. this.fundList[6]['havePaid']+=Number(JP['activities']);
  202. this.fundList[7]['havePaid']+=Number(JP['Transaction']);
  203. })
  204. }
  205. this.allFund=res.data[0][0]['money']
  206. },err=>{
  207. console.log(err);
  208. })
  209. },
  210. download(){
  211. if(!this.projectName) return this.$message.error('请选择项目名称')
  212. this.downLoadExcelDig=true
  213. },
  214. downLoadExcel(){ //生成表单
  215. getExcel(this.fundList,this.intro)
  216. this.downLoadExcelDig=false
  217. },
  218. submitData(){
  219. if(!this.projectName) return this.$message.error('请选择项目名称')
  220. let arr=[this.fundList[0].thisApply,this.fundList[1].thisApply,this.fundList[2].thisApply,this.fundList[3].thisApply,this.fundList[4].thisApply,this.fundList[5].thisApply,this.fundList[6].thisApply,this.fundList[7].thisApply]
  221. let arr2=[this.fundList[0].havePaid,this.fundList[1].havePaid,this.fundList[2].havePaid,this.fundList[3].havePaid,this.fundList[4].havePaid,this.fundList[5].havePaid,this.fundList[6].havePaid,this.fundList[7].havePaid]
  222. let fund=arr.reduce((prev,cur,index,arr) => {
  223. return prev + cur*1;
  224. },0);
  225. let fund2=arr2.reduce((prev,cur,index,arr) => {
  226. return prev + cur*1;
  227. },0);
  228. // return console.log(fund,fund2);
  229. if (fund+fund2>this.allFund) return this.$message.error('申请金额已大于预算')
  230. this.submitDataDig=true
  231. },
  232. submitAll(){ //提交创客资金申请
  233. getFundNo("ZJ").then((result)=>{
  234. let param={
  235. uid:this.$store.state.userInfo.userid,
  236. aid:this.projectName,
  237. fNo:result, //项目编号
  238. intro:this.intro,
  239. f:JSON.stringify({
  240. device:this.fundList[0].thisApply,
  241. Material:this.fundList[1].thisApply,
  242. processing:this.fundList[2].thisApply,
  243. Collaboration:this.fundList[3].thisApply,
  244. APPRAISAL:this.fundList[4].thisApply,
  245. entery:this.fundList[5].thisApply,
  246. activities:this.fundList[6].thisApply,
  247. Transaction:this.fundList[7].thisApply,
  248. })
  249. }
  250. this.ajax
  251. .post(this.$store.state.api+'/insertFundApply',param)
  252. .then(res=>{
  253. console.log(res);
  254. if(res.data==1){
  255. this.$message.success('提交成功')
  256. this.submitDataDig=false
  257. this.$router.push('/makerfund')
  258. }else{
  259. this.$message.error('提交失败')
  260. }
  261. },err=>{
  262. console.log(err);
  263. })
  264. })
  265. },
  266. },
  267. watch:{
  268. projectName:{
  269. handler(){
  270. immediate:true
  271. this.getFundData()
  272. }
  273. }
  274. },
  275. mounted(){
  276. this.getData()
  277. }
  278. }
  279. </script>
  280. <style lang="less" scoped>
  281. .inpInterval{ //label
  282. min-width: 80px;
  283. display: inline-block;
  284. text-align: justify;
  285. text-justify:distribute-all-lines;
  286. text-align-last: justify;
  287. transform: translate(0,22%);
  288. padding-right: 15px;
  289. font-size: 16px;
  290. }
  291. .Apply1{ //顶部两个下拉框
  292. height: 45px;
  293. width: 50%;
  294. display: flex;
  295. justify-content: flex-start;
  296. margin-top: 20px;
  297. }
  298. .fundType{
  299. width: 80%;
  300. margin-top: 30px;
  301. :deep(.el-input__inner){
  302. width: 200px;
  303. &::-webkit-outer-spin-button,
  304. &::-webkit-inner-spin-button {
  305. -webkit-appearance: none;
  306. }
  307. &[type="number"]{
  308. -moz-appearance: textfield;
  309. }
  310. }
  311. :deep(.el-textarea__inner){
  312. width: 80%;
  313. }
  314. .fundInp{
  315. display: flex;
  316. margin-bottom: 10px;
  317. }
  318. }
  319. .table{
  320. border: none;
  321. border-top: solid 1px black;
  322. // border-right: solid 1px black;
  323. width: 80%;
  324. margin: auto;
  325. margin-top: 30px;
  326. .textLeft{
  327. :deep(.el-textarea__inner){
  328. border: none ;
  329. border-radius: 0px;
  330. text-align: left !important;
  331. font-size: 16px;
  332. }
  333. }
  334. tr td{
  335. border: none;
  336. border-bottom: solid 1px black;
  337. border-right: solid 1px black;
  338. height: 50px;
  339. text-align: center;
  340. line-height: 30px;
  341. width: 9%;
  342. &:nth-child(1){
  343. border-left: solid 1px black;
  344. }
  345. p{
  346. font-weight: 600;
  347. }
  348. :deep(.el-select .el-input .el-select__caret){
  349. display: none;
  350. }
  351. :deep(.el-textarea__inner){
  352. // padding: 0;
  353. border: none ;
  354. border-radius: 0px;
  355. text-align: center;
  356. font-size: 16px;
  357. }
  358. :deep(.el-input__inner){
  359. border: none ;
  360. border-radius: 0px;
  361. text-align: center;
  362. font-size: 16px;
  363. //去除input number样式
  364. &::-webkit-outer-spin-button,
  365. &::-webkit-inner-spin-button {
  366. -webkit-appearance: none;
  367. }
  368. &[type="number"]{
  369. -moz-appearance: textfield;
  370. }
  371. }
  372. }
  373. }
  374. .textLeft{
  375. :deep(.el-textarea__inner){
  376. border: none ;
  377. border-radius: 0px;
  378. text-align: left !important;
  379. font-size: 16px;
  380. }
  381. }
  382. .delUpload{ //文件上传
  383. width: 147px;
  384. margin-left: 60px;
  385. margin-bottom: 62px;
  386. &:hover .maskLayer{
  387. display: block;
  388. }
  389. .maskLayer{
  390. background: #000;position: absolute;left: 0;top: 0;opacity: .4; width: 100%;height: 100%;border-radius: 5px;
  391. display: none;
  392. }
  393. .maskLayerI:hover{
  394. color: #fff;
  395. }
  396. :deep(.avatar-uploader .el-upload) { //文件上传
  397. border: 1px dashed #d9d9d9;
  398. border-radius: 6px;
  399. cursor: pointer;
  400. position: relative;
  401. overflow: hidden;
  402. }
  403. :deep(.avatar-uploader-icon) {
  404. font-size: 28px;
  405. color: #8c939d;
  406. width: 178px;
  407. height: 178px;
  408. line-height: 178px;
  409. text-align: center;
  410. }
  411. :deep(.avatar) {
  412. width: 178px;
  413. height: 178px;
  414. display: block;
  415. }
  416. }
  417. </style>