makerfundApply.vue 40 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148
  1. <template>
  2. <!-- 创客资金申请表单 -->
  3. <div class="makerfundApply">
  4. <div class="vfpHeader">
  5. <div class="titleOne">创客资金申请</div>
  6. <el-button type="primary" @click="$router.back()">返回</el-button>
  7. </div>
  8. <hr>
  9. <!-- 项目名称、类型开始 -->
  10. <div class="Apply1">
  11. <div class="inpInterval">项目名称</div>
  12. <el-select v-model="selects.projectName" style="width: 30%;" placeholder="请选择">
  13. <el-option
  14. v-for="item in projectFilter"
  15. :key="item.id"
  16. :label="item.title"
  17. :value="item.id">
  18. </el-option>
  19. </el-select>
  20. </div>
  21. <div class="Apply1">
  22. <div class="inpInterval">项目类型</div>
  23. <el-select v-model="selects.projectType" placeholder="请选择">
  24. <el-option
  25. v-for="item in projectType"
  26. :key="item.id"
  27. :label="item.name"
  28. :value="item.name">
  29. </el-option>
  30. </el-select>
  31. </div>
  32. <!-- 项目名称、类型结束 -->
  33. <div class="tabTit">
  34. <div>
  35. <p>经费支出类别(单位:元)</p>
  36. </div>
  37. </div>
  38. <hr>
  39. <div class="moneyBlock" v-for="(item,index) in directFundBlock" :key="index"> <!-- 直接经费 -->
  40. <div class="howMoneyFlex">
  41. <div class="howMoney">
  42. <div class="inpInterval">直接经费</div>
  43. <el-select v-model="item.directFundData" placeholder="请选择">
  44. <el-option
  45. v-for="item in item.directFundSelects"
  46. :key="item.value"
  47. :label="item.label"
  48. :value="item.value">
  49. </el-option>
  50. </el-select>
  51. </div>
  52. <div class="howMoney">
  53. <div class="inpInterval twoStyle">预算</div>
  54. <el-input v-model="item.budget" type="number" class="inputNumber howMoneyInp" placeholder="金额"></el-input>
  55. </div>
  56. <div class="howMoney">
  57. <div class="inpInterval twoStyle">已支付</div>
  58. <el-input v-model="item.usedFund" type="number" class="inputNumber howMoneyInp" placeholder="金额"></el-input>
  59. </div>
  60. <div class="howMoney">
  61. <div class="inpInterval twoStyle">余额</div>
  62. <el-input disabled :value="item.budget - item.usedFund" type="number" class="inputNumber howMoneyInp" placeholder="金额"></el-input>
  63. </div>
  64. <el-button v-show="index!=0" type="primary" style="font-size: 16px;height: 40px;line-height: 0;" @click="delDerData(index)">删除</el-button>
  65. </div>
  66. <div class="howMoney" >
  67. <div class="inpInterval" style="position: relative;top:-20px">事由</div>
  68. <el-input
  69. type="textarea"
  70. :rows="3"
  71. class="textArea"
  72. resize="none"
  73. style="width:800px"
  74. placeholder="请输入内容"
  75. v-model="item.reason">
  76. </el-input>
  77. </div>
  78. </div>
  79. <div>
  80. <div class="addMoneyBtn" @click="addDirectFund">
  81. <div class="jia">+</div>添加
  82. </div>
  83. </div>
  84. <div> <!-- 间接经费 -->
  85. <div class="moneyBlock" v-for="(item,i) in indirectFundBlock" :key="i">
  86. <div class="howMoneyFlex">
  87. <div class="howMoney">
  88. <div class="inpInterval">间接经费</div>
  89. <el-select v-model="item.indirectFundData" placeholder="请选择">
  90. <el-option
  91. v-for="item in item.indirectFundSelects"
  92. :key="item.value"
  93. :label="item.label"
  94. :value="item.value">
  95. </el-option>
  96. </el-select>
  97. </div>
  98. <div class="howMoney">
  99. <div class="inpInterval twoStyle">预算</div>
  100. <el-input v-model="item.budget" type="number" class="inputNumber howMoneyInp" placeholder="金额"></el-input>
  101. </div>
  102. <div class="howMoney">
  103. <div class="inpInterval twoStyle">已支付</div>
  104. <el-input v-model="item.usedFund" type="number" class="inputNumber howMoneyInp" placeholder="金额"></el-input>
  105. </div>
  106. <div class="howMoney">
  107. <div class="inpInterval twoStyle">余额</div>
  108. <el-input disabled :value="item.budget - item.usedFund" type="number" class="inputNumber howMoneyInp" placeholder="金额"></el-input>
  109. </div>
  110. <el-button v-show="i!=0" type="primary" style="font-size: 16px;height: 40px;line-height: 0;" @click="delInDerData(i)">删除</el-button>
  111. </div>
  112. <div class="howMoney">
  113. <div class="inpInterval" style="position: relative;top:-20px">事由</div>
  114. <el-input
  115. type="textarea"
  116. :rows="3"
  117. class="textArea"
  118. resize="none"
  119. style="width:800px"
  120. placeholder="请输入内容"
  121. v-model="item.reason">
  122. </el-input>
  123. </div>
  124. </div>
  125. </div>
  126. <div>
  127. <div class="addMoneyBtn" @click="addIndirectFund">
  128. <div class="jia">+</div>添加
  129. </div>
  130. </div>
  131. <div class="moneyBlock"> <!-- 其他经费 -->
  132. <div class="howMoneyFlex">
  133. <div class="howMoney">
  134. <div class="inpInterval" >其他</div>
  135. <el-input v-model="residue.elseReason" placeholder="请输入内容"></el-input>
  136. </div>
  137. <div class="howMoney">
  138. <div class="inpInterval twoStyle">预算</div>
  139. <el-input v-model="residue.budget" type="number" class="inputNumber howMoneyInp" placeholder="金额"></el-input>
  140. </div>
  141. <div class="howMoney">
  142. <div class="inpInterval twoStyle">已支付</div>
  143. <el-input v-model="residue.usedFund" type="number" class="inputNumber howMoneyInp" placeholder="金额"></el-input>
  144. </div>
  145. <div class="howMoney">
  146. <div class="inpInterval twoStyle">余额</div>
  147. <el-input disabled :value="residue.budget - residue.usedFund" type="number" class="inputNumber howMoneyInp" placeholder="金额"></el-input>
  148. </div>
  149. </div>
  150. <div class="howMoney">
  151. <div class="inpInterval" style="position: relative;top:-20px">备注</div>
  152. <el-input
  153. type="textarea"
  154. :rows="3"
  155. resize="none"
  156. class="textArea"
  157. style="width:800px"
  158. placeholder="请输入内容"
  159. v-model="residue.reason">
  160. </el-input>
  161. </div>
  162. </div>
  163. <div> <!-- 附件上传 -->
  164. <div class="tabTit">
  165. <div><p>附件上传</p></div>
  166. </div>
  167. <hr>
  168. <el-progress v-show="progress.show" :percentage="progress.value" :format="ProgressFormat"></el-progress>
  169. <div style="display: flex;flex-wrap: wrap;width: 100%;margin-bottom: 45px;">
  170. <el-upload
  171. action="https://jsonplaceholder.typicode.com/posts/"
  172. list-type="picture-card"
  173. style="position: relative;margin-left: 10px;"
  174. disabled
  175. :on-remove="handleRemove">
  176. <BeUpload @getFile="getFile" :progress="progress" style="position: absolute;left: 0;width: 147px;height: 100%;opacity: 0;" class="uploadPic" :navName="'上传封面'" :accept="accept"></BeUpload>
  177. <i class="el-icon-plus"></i>
  178. </el-upload>
  179. <el-upload
  180. action="https://jsonplaceholder.typicode.com/posts/"
  181. list-type="picture-card"
  182. class="delUpload"
  183. style="position: relative;"
  184. v-show="file[0]"
  185. disabled
  186. v-for="(item,index) in this.file" :key="index"
  187. >
  188. <span class="delUploadBtnSty" @click="delUploadBtn(index)">×</span>
  189. <img style="position: absolute;left: -1px;top:-1px;width: 149px;height: 101%;border-radius: 5px;" :src="dialogImageUrl" alt="">
  190. <div style="position: absolute;left: -20%;bottom: -30px;width: 200px;height: 30px;color: #000;line-height: 30px;display: flex;justify-content: center;">{{ item.fileName }}</div>
  191. <!-- <img v-if="imageUrl" :src="imageUrl" class="avatar"> -->
  192. </el-upload>
  193. </div>
  194. </div>
  195. <div class="baseBtn">
  196. <div class="blockWidth">
  197. <el-button type="primary" @click="createFrom">生成表单</el-button>
  198. <el-button type="primary" @click="uploadData">提交</el-button>
  199. </div>
  200. </div>
  201. <!-- 提交对话框开始 -->
  202. <el-dialog
  203. title="提示"
  204. :visible.sync="submitHint"
  205. width="600px"
  206. class="projectApplicationfundAddDialog"
  207. :before-close="init">
  208. <div class="addDialogLogo">LOGO</div>
  209. <div class="deleteContent">确定提交?</div>
  210. <span slot="footer" class="dialog-footer">
  211. <el-button type="primary" @click="submitAll" class="AllDialogBtn">确认提交</el-button>
  212. <el-button @click="init" class="AllDialogBtn" size="small">取消</el-button>
  213. </span>
  214. </el-dialog>
  215. <!-- 提交对话框结束 -->
  216. <!-- 生成表单对话框开始 -->
  217. <el-dialog
  218. title="表单"
  219. :visible.sync="createFromDialog"
  220. width="60%"
  221. style="top: -150px;"
  222. class="createFromDialogSty"
  223. :before-close="init">
  224. <div class="addDialogLogo">LOGO</div>
  225. <div class="deleteContent">
  226. <table class="tableStyle" width="100%" border="1">
  227. <caption style="height: 40px;font-size: 22px;">学校创客专项资金使用申请表(单位:元)</caption>
  228. <caption style="height: 30px;text-align: left;">
  229. <div style="display: flex;">
  230. <div style="margin-right: 10px;"> 项目类型:</div>
  231. <el-checkbox-group v-model="checkList">
  232. <el-checkbox label="创客空间"></el-checkbox>
  233. <el-checkbox label="创客实践室"></el-checkbox>
  234. <el-checkbox label="个人创客"></el-checkbox>
  235. <el-checkbox label="活动创客"></el-checkbox>
  236. </el-checkbox-group>
  237. </div>
  238. </caption>
  239. <caption style="height: 30px;text-align: left;">项目名称:{{ selects.projectName }}</caption>
  240. <tr>
  241. <td>序号</td>
  242. <td>经济支出类别(A)</td>
  243. <td>预算</td>
  244. <td>已支付</td>
  245. <td>本次申请</td>
  246. <td>余额</td>
  247. <td style="width: 20%;">事由</td>
  248. </tr>
  249. <tr>
  250. <td>01</td>
  251. <td style="text-align: left;">一.经费支出</td>
  252. <td>0</td>
  253. <td>0</td>
  254. <td>0</td>
  255. <td>0</td>
  256. <td style="width: 20%;"></td>
  257. </tr>
  258. <tr>
  259. <td>02</td>
  260. <td style="text-align: left;">(一)直接费用</td>
  261. <td>0</td>
  262. <td>0</td>
  263. <td>0</td>
  264. <td>0</td>
  265. <td style="width: 20%;"></td>
  266. </tr>
  267. <tr>
  268. <td>03</td>
  269. <td style="text-align: left;">小型仪器设备费</td>
  270. <td>{{ directData.facility==0?'':directData.facility }}</td>
  271. <td>{{ usedDirectData.facility==0?'':usedDirectData.facility }}</td>
  272. <td></td>
  273. <td>0</td>
  274. <td style="width: 20%;">{{ directDataReason.reason }}</td>
  275. </tr>
  276. <tr>
  277. <td>04</td>
  278. <td style="text-align: left;">材料费</td>
  279. <td>{{ directData.cl==0?'':directData.cl }}</td>
  280. <td>{{ usedDirectData.cl==0?'':usedDirectData.cl }}</td>
  281. <td></td>
  282. <td>0</td>
  283. <td style="width: 20%;">{{ directDataReason.reason1 }}</td>
  284. </tr>
  285. <tr>
  286. <td>05</td>
  287. <td style="text-align: left;">测试化验加工费</td>
  288. <td>{{ directData.jg==0?'':directData.jg }}</td>
  289. <td>{{ usedDirectData.jg==0?'':usedDirectData.jg }}</td>
  290. <td></td>
  291. <td>0</td>
  292. <td style="width: 20%;">{{ directDataReason.reason2 }}</td>
  293. </tr>
  294. <tr>
  295. <td>06</td>
  296. <td style="text-align: left;">项目协作费</td>
  297. <td>{{ directData.xz==0?'':directData.xz }}</td>
  298. <td>{{ usedDirectData.xz==0?'':usedDirectData.xz }}</td>
  299. <td></td>
  300. <td>0</td>
  301. <td style="width: 20%;">{{ directDataReason.reason3 }}</td>
  302. </tr>
  303. <tr>
  304. <td>07</td>
  305. <td style="text-align: left;">其他支出</td>
  306. <td>{{ directData.qt==0?'':directData.qt }}</td>
  307. <td>{{ usedDirectData.qt==0?'':usedDirectData.qt }}</td>
  308. <td></td>
  309. <td>0</td>
  310. <td style="width: 20%;">{{ directDataReason.reason4 }}</td>
  311. </tr>
  312. <tr>
  313. <td>08</td>
  314. <td style="text-align: left;">(二)间接费用</td>
  315. <td>0</td>
  316. <td>0</td>
  317. <td>0</td>
  318. <td>0</td>
  319. <td style="width: 20%;"></td>
  320. </tr>
  321. <tr>
  322. <td>03</td>
  323. <td style="text-align: left;">项目成果鉴定费</td>
  324. <td>{{ indirectData.facility==0?'':indirectData.facility }}</td>
  325. <td>{{ usedInDirectData.facility==0?'':usedInDirectData.facility }}</td>
  326. <td></td>
  327. <td>0</td>
  328. <td style="width: 20%;">{{ indirectDataReason.reason }}</td>
  329. </tr>
  330. <tr>
  331. <td>04</td>
  332. <td style="text-align: left;">参展参赛费</td>
  333. <td>{{ indirectData.cl==0?'':indirectData.cl }}</td>
  334. <td>{{ usedInDirectData.cl==0?'':usedInDirectData.cl }}</td>
  335. <td></td>
  336. <td>0</td>
  337. <td style="width: 20%;">{{ indirectDataReason.reason1 }}</td>
  338. </tr>
  339. <tr>
  340. <td>05</td>
  341. <td style="text-align: left;">创客交流活动费</td>
  342. <td>{{ indirectData.jg==0?'':indirectData.jg }}</td>
  343. <td>{{ usedInDirectData.jg==0?'':usedInDirectData.jg }}</td>
  344. <td></td>
  345. <td>0</td>
  346. <td style="width: 20%;">{{ indirectDataReason.reason2 }}</td>
  347. </tr>
  348. <tr>
  349. <td>06</td>
  350. <td style="text-align: left;">知识产权事务费</td>
  351. <td>{{ indirectData.xz==0?'':indirectData.xz }}</td>
  352. <td>{{ usedInDirectData.xz==0?'':usedInDirectData.xz }}</td>
  353. <td></td>
  354. <td>0</td>
  355. <td style="width: 20%;">{{ indirectDataReason.reason3 }}</td>
  356. </tr>
  357. <tr>
  358. <td>07</td>
  359. <td style="text-align: left;">其他支出</td>
  360. <td>{{ indirectData.qt==0?'':indirectData.qt }}</td>
  361. <td>{{ usedInDirectData.qt==0?'':usedInDirectData.qt }}</td>
  362. <td></td>
  363. <td>0</td>
  364. <td style="width: 20%;">{{ indirectDataReason.reason4 }}</td>
  365. </tr>
  366. <!-- <tr v-for="(item,index) in items" :key="index">
  367. <td>{{ index+1 }}</td>
  368. <td style="text-align: left;">{{ item.fromSort }}</td>
  369. <td>{{ item.fromBudget }}</td>
  370. <td>{{ item.fromUsed }}</td>
  371. <td>{{ item.fromApp }}</td>
  372. <td>{{ item.fromBalance }}</td>
  373. <td style="width: 20%;">{{ item.fromReason }}</td>
  374. </tr> -->
  375. <tr>
  376. <td style="height: 80px;">备注</td>
  377. <td colspan="6" style="text-align:left;">{{ residue.reason }}</td>
  378. </tr>
  379. </table>
  380. </div>
  381. <span slot="footer" class="dialog-footer">
  382. <el-button type="primary" @click="submitCreateFrom" class="AllDialogBtn">确认</el-button>
  383. <el-button @click="createFromDialog = false" class="AllDialogBtn" size="small">取消</el-button>
  384. </span>
  385. </el-dialog>
  386. <!-- 生成表单对话框结束 -->
  387. </div>
  388. </template>
  389. <script>
  390. import BeUpload from "../../components/tool/beUpload.vue";
  391. import getExcel from "@/components/tool/getExcel";
  392. export default {
  393. components: {
  394. BeUpload,
  395. },
  396. data() {
  397. return {
  398. // items:[
  399. // {num:'01',fromSort:'一.经费支出',fromBudget:'0',fromUsed:'0',fromApp:'0',fromBalance:'0',fromReason:''},
  400. // {num:'02',fromSort:'(一)直接费用',fromBudget:'0',fromUsed:'0',fromApp:'0',fromBalance:'0',fromReason:''},
  401. // {num:'03',fromSort:'小型仪器设备费',fromBudget:'',fromUsed:'',fromApp:'',fromBalance:'0',fromReason:''},
  402. // {num:'04',fromSort:'材料费',fromBudget:'',fromUsed:'',fromApp:'',fromBalance:'0',fromReason:''},
  403. // {num:'05',fromSort:'测试化验加工费',fromBudget:'',fromUsed:'',fromApp:'',fromBalance:'0',fromReason:''},
  404. // {num:'06',fromSort:'项目协作费',fromBudget:'',fromUsed:'',fromApp:'',fromBalance:'0',fromReason:''},
  405. // {num:'07',fromSort:'其他支出',fromBudget:'',fromUsed:'',fromApp:'',fromBalance:'0',fromReason:''},
  406. // {num:'08',fromSort:'(二)间接费用',fromBudget:'0',fromUsed:'0',fromApp:'0',fromBalance:'0',fromReason:''},
  407. // {num:'09',fromSort:'项目成果鉴定费',fromBudget:'',fromUsed:'',fromApp:'',fromBalance:'0',fromReason:''},
  408. // {num:'10',fromSort:'参展参赛费',fromBudget:'',fromUsed:'',fromApp:'',fromBalance:'0',fromReason:''},
  409. // {num:'11',fromSort:'创客交流活动费',fromBudget:'',fromUsed:'',fromApp:'',fromBalance:'0',fromReason:''},
  410. // {num:'12',fromSort:'知识产权事务费',fromBudget:'',fromUsed:'',fromApp:'',fromBalance:'0',fromReason:''},
  411. // {num:'13',fromSort:'其他支出',fromBudget:'',fromUsed:'',fromApp:'',fromBalance:'0',fromReason:''},
  412. // ],
  413. checkList: [],
  414. accept:"*",
  415. submitHint:false, //提交按钮
  416. createFromDialog:false, //生成表单
  417. dialogImageUrl:require('../../assets/img/zzpic426.jpg'),
  418. disabled: false,
  419. file:[],
  420. selects:{
  421. projectName:'',
  422. projectType:''
  423. },
  424. progress:{ //进度条
  425. value:0,
  426. show:false
  427. },
  428. projectFilter:[], //项目名称
  429. projectType:[ //项目类型
  430. {
  431. id:1,
  432. name:'个人创客'
  433. },
  434. {
  435. id:2,
  436. name:'创客活动'
  437. },
  438. {
  439. id:3,
  440. name:'创客空间'
  441. },
  442. {
  443. id:4,
  444. name:'创客实践室'
  445. },
  446. ],
  447. directFundBlock:[ //直接经费
  448. {
  449. directFundData:'',
  450. directFundSelects:[
  451. {
  452. value:1,
  453. label:'小型仪器设备费'
  454. },
  455. {
  456. value:2,
  457. label:'材料费'
  458. },
  459. {
  460. value:3,
  461. label:'测试化验加工费'
  462. },
  463. {
  464. value:4,
  465. label:'项目协作费'
  466. },
  467. {
  468. value:5,
  469. label:'其他支出'
  470. },
  471. ],
  472. budget:'', //预算
  473. usedFund:'', //已使用
  474. reason:'' //理由
  475. }
  476. ],
  477. newDirectFundBlock:{ //添加直接经费
  478. directFundData:'',
  479. directFundSelects:[
  480. {
  481. value:1,
  482. label:'小型仪器设备费'
  483. },
  484. {
  485. value:2,
  486. label:'材料费'
  487. },
  488. {
  489. value:3,
  490. label:'测试化验加工费'
  491. },
  492. {
  493. value:4,
  494. label:'项目协作费'
  495. },
  496. {
  497. value:5,
  498. label:'其他支出'
  499. },
  500. ],
  501. budget:'', //预算
  502. usedFund:'', //已使用
  503. reason:'' //理由
  504. },
  505. indirectFundBlock:[ //间接经费
  506. {
  507. indirectFundData:'',
  508. indirectFundSelects:[
  509. {
  510. value:1,
  511. label:'项目成功鉴定费'
  512. },
  513. {
  514. value:2,
  515. label:'参展参赛费'
  516. },
  517. {
  518. value:3,
  519. label:'创客交流活动费'
  520. },
  521. {
  522. value:4,
  523. label:'知识产权事务费'
  524. },
  525. {
  526. value:5,
  527. label:'其他支出'
  528. },
  529. ],
  530. budget:'', //预算
  531. usedFund:'', //已使用
  532. reason:'' //理由
  533. }
  534. ],
  535. newIndirectFundBlock:{ //添加间接经费
  536. indirectFundData:'',
  537. indirectFundSelects:[
  538. {
  539. value:1,
  540. label:'项目成功鉴定费'
  541. },
  542. {
  543. value:2,
  544. label:'参展参赛费'
  545. },
  546. {
  547. value:3,
  548. label:'创客交流活动费'
  549. },
  550. {
  551. value:4,
  552. label:'知识产权事务费'
  553. },
  554. {
  555. value:5,
  556. label:'其他支出'
  557. },
  558. ],
  559. budget:'', //预算
  560. usedFund:'', //已使用
  561. reason:'' //理由
  562. },
  563. residue:{ //其他
  564. elseReason:'',
  565. budget:'',
  566. usedFund:'',
  567. reason:'',
  568. }
  569. ,
  570. directData:{ //直接经费预算
  571. facility:0,
  572. cl:0,
  573. jg:0,
  574. xz:0,
  575. qt:0,
  576. },
  577. directDataReason:{
  578. reason:'',
  579. reason1:'',
  580. reason2:'',
  581. reason3:'',
  582. reason4:''
  583. },
  584. usedDirectData:{ //直接经费已支出
  585. facility:0,
  586. cl:0,
  587. jg:0,
  588. xz:0,
  589. qt:0,
  590. },
  591. indirectData:{ //间接经费预算
  592. facility:0,
  593. cl:0,
  594. jg:0,
  595. xz:0,
  596. qt:0,
  597. },
  598. indirectDataReason:{ //间接理由
  599. reason:'',
  600. reason1:'',
  601. reason2:'',
  602. reason3:'',
  603. reason4:''
  604. },
  605. usedInDirectData:{ //间接经费已支出
  606. facility:0,
  607. cl:0,
  608. jg:0,
  609. xz:0,
  610. qt:0,
  611. reason:''
  612. },
  613. }
  614. },
  615. methods:{
  616. AllEquipment(){
  617. this.directFundBlock.forEach((e,i)=>{
  618. switch(e.directFundData)
  619. {
  620. case 1:
  621. this.directData.facility+=e.budget*1;
  622. this.usedDirectData.facility+=e.usedFund*1;
  623. this.directDataReason.reason=e.reason;
  624. // console.log(this.directData.facility);
  625. break;
  626. case 2:
  627. this.directData.cl+=e.budget*1;
  628. this.usedDirectData.cl+=e.usedFund*1;
  629. this.directDataReason.reason1=e.reason;
  630. // console.log(this.directData.cl);
  631. break;
  632. case 3:
  633. this.directData.jg=e.budget*1;
  634. this.usedDirectData.jg+=e.usedFund*1;
  635. this.directDataReason.reason2=e.reason;
  636. break;
  637. case 4:
  638. this.directData.xz=e.budget*1;
  639. this.usedDirectData.xz+=e.usedFund*1;
  640. this.directDataReason.reason3=e.reason;
  641. break;
  642. case 5:
  643. this.directData.qt=e.budget*1;
  644. this.usedDirectData.qt+=e.usedFund*1;
  645. this.directDataReason.reason4=e.reason;
  646. break;
  647. }
  648. })
  649. this.indirectFundBlock.forEach((e,i)=>{
  650. switch(e.indirectFundData)
  651. {
  652. case 1:
  653. this.indirectData.facility+=e.budget*1;
  654. this.usedInDirectData.facility+=e.usedFund*1;
  655. this.indirectDataReason.reason=e.reason;
  656. // console.log(this.directData.facility);
  657. break;
  658. case 2:
  659. this.indirectData.cl+=e.budget*1;
  660. this.usedInDirectData.cl+=e.usedFund*1;
  661. this.indirectDataReason.reason1=e.reason;
  662. // console.log(this.directData.cl);
  663. break;
  664. case 3:
  665. this.indirectData.jg=e.budget*1;
  666. this.usedInDirectData.jg+=e.usedFund*1;
  667. this.indirectDataReason.reason2=e.reason;
  668. break;
  669. case 4:
  670. this.indirectData.xz=e.budget*1;
  671. this.usedInDirectData.xz+=e.usedFund*1;
  672. this.indirectDataReason.reason3=e.reason;
  673. break;
  674. case 5:
  675. this.indirectData.qt=e.budget*1;
  676. this.usedInDirectData.qt+=e.usedFund*1;
  677. this.indirectDataReason.reason4=e.reason;
  678. break;
  679. }
  680. })
  681. },
  682. createFrom(){ // 显示表单对话框
  683. this.createFromDialog=true;
  684. this.directData={ //直接经费预算
  685. facility:0,
  686. cl:0,
  687. jg:0,
  688. xz:0,
  689. qt:0
  690. },
  691. this.usedDirectData={ //直接经费已支出
  692. facility:0,
  693. cl:0,
  694. jg:0,
  695. xz:0,
  696. qt:0
  697. },
  698. this.indirectData={ //间接经费预算
  699. facility:0,
  700. cl:0,
  701. jg:0,
  702. xz:0,
  703. qt:0
  704. },
  705. this.usedInDirectData={ //间接经费已支出
  706. facility:0,
  707. cl:0,
  708. jg:0,
  709. xz:0,
  710. qt:0
  711. },
  712. this.directDataReason={
  713. reason:'',
  714. reason1:'',
  715. reason2:'',
  716. reason3:'',
  717. reason4:''
  718. },
  719. this.indirectDataReason={ //间接理由
  720. reason:'',
  721. reason1:'',
  722. reason2:'',
  723. reason3:'',
  724. reason4:''
  725. },
  726. this.AllEquipment();
  727. },
  728. submitCreateFrom(){ //生成表单
  729. getExcel([this.directData,this.usedDirectData,this.indirectData,this.usedInDirectData,this.directDataReason,this.indirectDataReason])
  730. },
  731. ProgressFormat(value){ //进度条
  732. return value ==100?'100%':`${value}%`
  733. },
  734. delInDerData(index){ //删除间接经费
  735. this.indirectFundBlock.splice(index,1)
  736. },
  737. delDerData(index){ //删除直接经费
  738. console.log(index);
  739. this.directFundBlock.splice(index,1)
  740. },
  741. delUploadBtn(index){ //删除上传文件
  742. console.log(index);
  743. this.file.splice(index,1)
  744. this.$message.success('删除成功')
  745. },
  746. handleRemove(index) {
  747. console.log(index);
  748. },
  749. uploadData(){
  750. this.submitHint=true;
  751. },
  752. submitAll(){
  753. if(this.selects.projectName=='') return this.$message.error('请选择项目名称')
  754. if(this.selects.projectType=='') return this.$message.error('请选择项目类型')
  755. let dirSum = this.directFundBlock.reduce((per,cur)=>{
  756. return per*1+cur.budget*1
  757. },0)
  758. let indirSum =this.indirectFundBlock.reduce((per,cur)=>{
  759. return per*1+cur.budget*1
  760. },0)
  761. let allSum=dirSum+indirSum+this.residue.budget*1
  762. // console.log(allSum);
  763. let usedDirSum = this.directFundBlock.reduce((per,cur)=>{
  764. return per*1+cur.usedFund*1
  765. },0)
  766. let usedIndirSum =this.indirectFundBlock.reduce((per,cur)=>{
  767. return per*1+cur.usedFund*1
  768. },0)
  769. let usedAllSum=usedDirSum+usedIndirSum+this.residue.usedFund*1
  770. // console.log(usedAllSum);
  771. let param={
  772. uid:this.$store.state.userInfo.userid,
  773. cid:this.selects.projectName,
  774. type:this.selects.projectType,
  775. dir:JSON.stringify(this.directFundBlock),
  776. indir:JSON.stringify(this.indirectFundBlock),
  777. elseFund:JSON.stringify(this.residue),
  778. file:JSON.stringify(this.file),
  779. AllSum:allSum,
  780. usedSum:usedAllSum
  781. }
  782. this.ajax
  783. .post(this.$store.state.api+'/insertMakerFund',param)
  784. .then(res=>{
  785. console.log(res);
  786. if (res.data==1) {
  787. this.$router.push('/makerfund')
  788. return this.$message.success('创建成功')
  789. }else{
  790. this.$message.error('创建失败')
  791. }
  792. },err=>{
  793. console.log(err);
  794. })
  795. },
  796. getFile(val) { //上传文件
  797. this.file.push(val)
  798. this.progress.show = false;
  799. // this.imageUrl=require("../../assets/img/jj.jpg")
  800. },
  801. getData(){
  802. let param={
  803. uid:this.$store.state.userInfo.userid,
  804. fid:''
  805. }
  806. this.ajax
  807. .get(this.$store.state.api+'/SelectMakerFundSelects',param)
  808. .then(res=>{
  809. // console.log(res.data);
  810. this.projectFilter=res.data[1]
  811. },err=>{
  812. console.log(err);
  813. })
  814. },
  815. addDirectFund(){ //添加直接经费
  816. let ok=true;
  817. let oldArr={};
  818. Object.assign(oldArr,this.newDirectFundBlock)
  819. this.directFundBlock.forEach((e,i)=>{
  820. if (e.directFundData=='') {
  821. this.$message.error('请先填写直接经费类型')
  822. return ok=false
  823. }else{ //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  824. // oldArr.directFundSelects = oldArr.directFundSelects.filter((k)=>{
  825. // console.log(e.directFundSelects);
  826. // return k.value!=e.value
  827. // })
  828. }
  829. })
  830. if(!ok) return false
  831. this.directFundBlock.push(oldArr)
  832. for(let k in this.newDirectFundBlock) return this.newDirectFundBlock[k]=''
  833. },
  834. addIndirectFund(){ //添加间接经费
  835. // this.indirectFundBlock.push(this.newIndirectFundBlock)
  836. let oldArr={};
  837. Object.assign(oldArr,this.newIndirectFundBlock)
  838. this.indirectFundBlock.push(oldArr)
  839. for(let k in this.newIndirectFundBlock) return this.newIndirectFundBlock[k]=''
  840. },
  841. init(){
  842. //重置
  843. this.submitHint=false;
  844. this.createFromDialog=false;
  845. },
  846. },
  847. mounted(){
  848. this.getData()
  849. }
  850. }
  851. </script>
  852. <style lang="less">
  853. .makerfundApply{
  854. .delUpload{
  855. width: 147px;
  856. margin-left: 60px;
  857. margin-bottom: 62px;
  858. }
  859. .delUploadBtnSty{
  860. position: absolute;
  861. right: 0;top: 0px;
  862. line-height: 20px;
  863. display: flex;
  864. justify-content: center;
  865. width: 20px;
  866. height: 20px;
  867. font-size: 35px;
  868. z-index: 10;
  869. color: #fff;
  870. // background: #fff;
  871. }
  872. .avatar-uploader .el-upload { //文件上传
  873. border: 1px dashed #d9d9d9;
  874. border-radius: 6px;
  875. cursor: pointer;
  876. position: relative;
  877. overflow: hidden;
  878. }
  879. .avatar-uploader-icon {
  880. font-size: 28px;
  881. color: #8c939d;
  882. width: 178px;
  883. height: 178px;
  884. line-height: 178px;
  885. text-align: center;
  886. }
  887. .avatar {
  888. width: 178px;
  889. height: 178px;
  890. display: block;
  891. }
  892. //提交对话框开始
  893. .projectApplicationfundAddDialog{
  894. .el-dialog__header{
  895. display: flex;
  896. justify-content: center;
  897. }
  898. .el-dialog{
  899. border-radius: 5px;
  900. overflow: hidden;
  901. top: 10%;
  902. }
  903. .deleteContent{
  904. width: 100%;
  905. text-align: center;
  906. font-size: 22px;
  907. color: #000;
  908. }
  909. .addDialogLogo{
  910. width: 60px;
  911. height: 30px;
  912. border-radius: 5px;
  913. display: flex;
  914. justify-content: center;
  915. line-height: 30px;
  916. background: #f2f2f2;
  917. position: absolute;
  918. left: 20px; top: 15px;
  919. }
  920. .el-dialog__header{
  921. background: #32455b;
  922. }
  923. .el-dialog__title{
  924. color:#fff;
  925. display: flex;
  926. justify-content: center;
  927. font-size: 18px;
  928. position: relative;
  929. top: -2px;
  930. }
  931. .addDialogMid{
  932. box-sizing: border-box;
  933. padding:0 60px 0 10px;
  934. .addDialogTit{
  935. display: flex;
  936. span{
  937. width: 80px;
  938. line-height: 40px;
  939. text-align: left;
  940. }
  941. }
  942. .addDialogTit1{
  943. display: flex;
  944. justify-content: space-between;
  945. margin-bottom: 15px;
  946. }
  947. .addDialogTit2{
  948. margin-top: 10px;
  949. font-size: 18px;
  950. color: #000;
  951. text-indent: 2em;
  952. }
  953. .addDialogCon{
  954. margin-top: 20px;
  955. }
  956. }
  957. .dialog-footer{
  958. display: flex;
  959. justify-content: center;
  960. }
  961. }
  962. //提交对话框结束
  963. .createFromDialogSty{ //生成表单
  964. .el-dialog__header{
  965. display: flex;
  966. justify-content: center;
  967. }
  968. .el-dialog{
  969. border-radius: 5px;
  970. overflow: hidden;
  971. top: 10%;
  972. }
  973. .deleteContent{
  974. width: 100%;
  975. text-align: center;
  976. font-size: 22px;
  977. color: #000;
  978. }
  979. .addDialogLogo{
  980. width: 60px;
  981. height: 30px;
  982. border-radius: 5px;
  983. display: flex;
  984. justify-content: center;
  985. line-height: 30px;
  986. background: #f2f2f2;
  987. position: absolute;
  988. left: 20px; top: 15px;
  989. }
  990. .el-dialog__header{
  991. background: #32455b;
  992. }
  993. .el-dialog__title{
  994. color:#fff;
  995. display: flex;
  996. justify-content: center;
  997. font-size: 18px;
  998. position: relative;
  999. top: -2px;
  1000. }
  1001. .addDialogMid{
  1002. box-sizing: border-box;
  1003. padding:0 60px 0 10px;
  1004. .addDialogTit{
  1005. display: flex;
  1006. span{
  1007. width: 80px;
  1008. line-height: 40px;
  1009. text-align: left;
  1010. }
  1011. }
  1012. .addDialogTit1{
  1013. display: flex;
  1014. justify-content: space-between;
  1015. margin-bottom: 15px;
  1016. }
  1017. .addDialogTit2{
  1018. margin-top: 10px;
  1019. font-size: 18px;
  1020. color: #000;
  1021. text-indent: 2em;
  1022. }
  1023. .addDialogCon{
  1024. margin-top: 20px;
  1025. }
  1026. }
  1027. .dialog-footer{
  1028. display: flex;
  1029. justify-content: center;
  1030. }
  1031. }
  1032. .Apply1{ //顶部两个下拉框
  1033. height: 45px;
  1034. width: 100%;
  1035. display: flex;
  1036. justify-content: flex-start;
  1037. margin-top: 20px;
  1038. .inpName{
  1039. height: 40px;
  1040. outline:none ;
  1041. width: 600px;
  1042. border: #ccc 1px solid;
  1043. border-radius: 5px;
  1044. box-sizing: border-box;
  1045. padding: 1px 15px;
  1046. }
  1047. }
  1048. .moneyBlock{
  1049. max-width: 100%;
  1050. margin-bottom: 20px;
  1051. .howMoneyFlex{
  1052. display: flex;
  1053. flex-wrap: wrap;
  1054. }
  1055. .howMoney{
  1056. display: flex;
  1057. margin-right: 10px;
  1058. margin-bottom: 10px;
  1059. .howMoneyInp{
  1060. .el-input__inner{
  1061. width: 170px;
  1062. }
  1063. }
  1064. }
  1065. }
  1066. .inpInterval{
  1067. min-width: 70px;
  1068. display: inline-block;
  1069. text-align: justify;
  1070. text-justify:distribute-all-lines;
  1071. text-align-last: justify;
  1072. transform: translate(0,22%);
  1073. padding-right: 15px;
  1074. font-size: 16px;
  1075. }
  1076. .addMoneyBtn{ //添加样式
  1077. margin: 15px 85px 30px;
  1078. }
  1079. }
  1080. .tableStyle{
  1081. border-collapse:collapse;
  1082. font-size: 16px;
  1083. td{
  1084. // align-content: center;
  1085. height: 35px;
  1086. }
  1087. }
  1088. </style>