enclosure-edit.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  1. <template>
  2. <div class="app-container">
  3. <h3 class="toolbar">
  4. <span class="title">加计扣除备查资料清单(<b style="color: red;font-size: 15px;">根据您填报的项目信息,系统自动将需要上传的文件列出,每种类型文件只能上传单个文件(大小限制4M),如有多个请打包上传!</b>)</span>
  5. <!-- <div class="tool">
  6. <el-button type="primary" plain icon="el-icon-download" size="mini" @click="handleDownloadBatch">批量下载</el-button>
  7. </div> -->
  8. </h3>
  9. <!-- 技术 -->
  10. <table class="table_register mt20" style="width: 100%;">
  11. <tr>
  12. <th colspan="4" class="th_title">项目计划书
  13. </th>
  14. </tr>
  15. <tr>
  16. <th>项目计划书导入</th>
  17. <td colspan="3">
  18. <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleUpload('9')" v-if="techFlag">上传</el-button>
  19. </td>
  20. </tr>
  21. <tr>
  22. <th>下载</th>
  23. <td colspan="3">
  24. <ul>
  25. <li v-for="(item, index) in list9" :key="index" style="margin: 2px;">
  26. <el-row :gutter="20">
  27. <el-col :span="12">
  28. <a :href="item.url">{{item.fileName}}</a>
  29. </el-col>
  30. <el-col :span="12">
  31. <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleDownload(item.id)">下载</el-button>
  32. <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleDelete(item.id)" v-if="techFlag">删除</el-button>
  33. </el-col>
  34. </el-row>
  35. </li>
  36. </ul>
  37. </td>
  38. </tr>
  39. </table>
  40. <table class="table_register mt20" style="width: 100%;">
  41. <tr>
  42. <th colspan="4" class="th_title">研究成果报告
  43. </th>
  44. </tr>
  45. <tr>
  46. <th>研究成果导入</th>
  47. <td colspan="3">
  48. <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleUpload('10')" v-if="techFlag">上传</el-button>
  49. <el-button type="primary" size="mini">
  50. <a href="/temp/研究成果报告模板.xls">模板下载</a>
  51. </el-button>
  52. </td>
  53. </tr>
  54. <tr>
  55. <th>下载</th>
  56. <td colspan="3">
  57. <ul>
  58. <li v-for="(item, index) in list10" :key="index" style="margin: 2px;">
  59. <el-row :gutter="20">
  60. <el-col :span="12">
  61. <a :href="item.url">{{item.fileName}}</a>
  62. </el-col>
  63. <el-col :span="12">
  64. <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleUpload(item.id)">下载</el-button>
  65. <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleDelete(item.id)" v-if="techFlag">删除</el-button>
  66. </el-col>
  67. </el-row>
  68. </li>
  69. </ul>
  70. </td>
  71. </tr>
  72. </table>
  73. <table class="table_register mt20" style="width: 100%;">
  74. <tr>
  75. <th colspan="4" class="th_title">自主、委托、合作研究开发项目计划书和企业有权部门关于自主、委托、合作研究开发项目立项的决议文件
  76. </th>
  77. </tr>
  78. <tr>
  79. <th>决议文件导入</th>
  80. <td colspan="3">
  81. <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleUpload('1')" v-if="techFlag">上传</el-button>
  82. <el-button type="primary" size="mini">
  83. <a href="/temp/项目立项书模板.doc">模板下载</a>
  84. </el-button>
  85. </td>
  86. </tr>
  87. <tr>
  88. <th>下载</th>
  89. <td colspan="3">
  90. <ul>
  91. <li v-for="(item, index) in list1" :key="index" style="margin: 2px;">
  92. <el-row :gutter="20">
  93. <el-col :span="12">
  94. <a :href="item.url">{{item.fileName}}</a>
  95. </el-col>
  96. <el-col :span="12">
  97. <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleUpload(item.id)">下载</el-button>
  98. <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleDelete(item.id)" v-if="techFlag">删除</el-button>
  99. </el-col>
  100. </el-row>
  101. </li>
  102. </ul>
  103. </td>
  104. </tr>
  105. </table>
  106. <table class="table_register mt20" style="width: 100%;">
  107. <tr>
  108. <th colspan="4" class="th_title">自主、委托、合作研究开发专门机构或项目组的编制情况和研发人员名单
  109. </th>
  110. </tr>
  111. <tr>
  112. <th>研发人员名单导入</th>
  113. <td colspan="3">
  114. <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleUpload('2')" v-if="techFlag">上传</el-button>
  115. <el-button type="primary" size="mini">
  116. <a href="/temp/项目负责人及研发人员模板.xls">模板下载</a>
  117. </el-button>
  118. </td>
  119. </tr>
  120. <tr>
  121. <th>下载</th>
  122. <td colspan="3">
  123. <ul>
  124. <li v-for="(item, index) in list2" :key="index" style="margin: 2px;">
  125. <el-row :gutter="20">
  126. <el-col :span="12">
  127. <a :href="item.url">{{item.fileName}}</a>
  128. </el-col>
  129. <el-col :span="12">
  130. <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleUpload(item.id)">下载</el-button>
  131. <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleDelete(item.id)" v-if="techFlag">删除</el-button>
  132. </el-col>
  133. </el-row>
  134. </li>
  135. </ul>
  136. </td>
  137. </tr>
  138. </table>
  139. <table class="table_register mt20" style="width: 100%;">
  140. <tr>
  141. <th colspan="4" class="th_title">经科技行政主管部门登记的委托、合作研究开发项目的合同
  142. </th>
  143. </tr>
  144. <tr>
  145. <th>研究开发合同导入</th>
  146. <td colspan="3">
  147. <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleUpload('3')" v-if="techFlag">上传</el-button>
  148. </td>
  149. </tr>
  150. <tr>
  151. <th>下载</th>
  152. <td colspan="3">
  153. <ul>
  154. <li v-for="(item, index) in list3" :key="index" style="margin: 2px;">
  155. <el-row :gutter="20">
  156. <el-col :span="12">
  157. <a :href="item.url">{{item.fileName}}</a>
  158. </el-col>
  159. <el-col :span="12">
  160. <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleUpload(item.id)">下载</el-button>
  161. <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleDelete(item.id)" v-if="techFlag">删除</el-button>
  162. </el-col>
  163. </el-row>
  164. </li>
  165. </ul>
  166. </td>
  167. </tr>
  168. </table>
  169. <table class="table_register mt20" style="width: 100%;">
  170. <tr>
  171. <th colspan="4" class="th_title">“研发支出”辅助账及汇总表
  172. </th>
  173. </tr>
  174. <tr>
  175. <th>“研发支出”辅助账及汇总表导入</th>
  176. <td colspan="3">
  177. <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleUpload('6')" v-if="techFlag">上传</el-button>
  178. </td>
  179. </tr>
  180. <tr>
  181. <th>下载</th>
  182. <td colspan="3">
  183. <ul>
  184. <li v-for="(item, index) in list6" :key="index" style="margin: 2px;">
  185. <el-row :gutter="20">
  186. <el-col :span="12">
  187. <a :href="item.url">{{item.fileName}}</a>
  188. </el-col>
  189. <el-col :span="12">
  190. <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleUpload(item.id)">下载</el-button>
  191. <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleDelete(item.id)" v-if="techFlag">删除</el-button>
  192. </el-col>
  193. </el-row>
  194. </li>
  195. </ul>
  196. </td>
  197. </tr>
  198. </table>
  199. <table class="table_register mt20" style="width: 100%;">
  200. <tr>
  201. <th colspan="4" class="th_title">企业如果已取得地市级(含)以上科技行政主管部门出具的鉴定意见,应作为资料留存备查
  202. </th>
  203. </tr>
  204. <tr>
  205. <th>科技主管部门鉴定意见导入</th>
  206. <td colspan="3">
  207. <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleUpload('7')" v-if="techFlag">上传</el-button>
  208. </td>
  209. </tr>
  210. <tr>
  211. <th>下载</th>
  212. <td colspan="3">
  213. <ul>
  214. <li v-for="(item, index) in list7" :key="index" style="margin: 2px;">
  215. <el-row :gutter="20">
  216. <el-col :span="12">
  217. <a :href="item.url">{{item.fileName}}</a>
  218. </el-col>
  219. <el-col :span="12">
  220. <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleUpload(item.id)">下载</el-button>
  221. <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleDelete(item.id)" v-if="techFlag">删除</el-button>
  222. </el-col>
  223. </el-row>
  224. </li>
  225. </ul>
  226. </td>
  227. </tr>
  228. </table>
  229. <!-- 财务 -->
  230. <table class="table_register mt20" style="width: 100%;">
  231. <tr>
  232. <th colspan="4" class="th_title">从事研发活动的人员(包括外聘人员)和用于研发活动的仪器、设备、无形资产的费用分配说明(包括工作使用情况记录及费用分配计算证据材料)
  233. </th>
  234. </tr>
  235. <tr>
  236. <th>费用分配说明导入</th>
  237. <td colspan="3">
  238. <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleUpload('4')" v-if="finFlag">上传</el-button>
  239. </td>
  240. </tr>
  241. <tr>
  242. <th>下载</th>
  243. <td colspan="3">
  244. <ul>
  245. <li v-for="(item, index) in list4" :key="index" style="margin: 2px;">
  246. <el-row :gutter="20">
  247. <el-col :span="12">
  248. <a :href="item.url">{{item.fileName}}</a>
  249. </el-col>
  250. <el-col :span="12">
  251. <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleUpload(item.id)">下载</el-button>
  252. <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleDelete(item.id)" v-if="finFlag">删除</el-button>
  253. </el-col>
  254. </el-row>
  255. </li>
  256. </ul>
  257. </td>
  258. </tr>
  259. </table>
  260. <table class="table_register mt20" style="width: 100%;">
  261. <tr>
  262. <th colspan="4" class="th_title">集中研发项目研发费决算表、集中研发项目费用分摊明细情况表和实际分享收益比例等资料
  263. </th>
  264. </tr>
  265. <tr>
  266. <th>资料导入</th>
  267. <td colspan="3">
  268. <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleUpload('5')"v-if="finFlag">上传</el-button>
  269. </td>
  270. </tr>
  271. <tr>
  272. <th>下载</th>
  273. <td colspan="3">
  274. <ul>
  275. <li v-for="(item, index) in list5" :key="index" style="margin: 2px;">
  276. <el-row :gutter="20">
  277. <el-col :span="12">
  278. <a :href="item.url">{{item.fileName}}</a>
  279. </el-col>
  280. <el-col :span="12">
  281. <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleUpload(item.id)">下载</el-button>
  282. <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleDelete(item.id)" v-if="finFlag">删除</el-button>
  283. </el-col>
  284. </el-row>
  285. </li>
  286. </ul>
  287. </td>
  288. </tr>
  289. </table>
  290. <table class="table_register mt20" style="width: 100%;">
  291. <tr>
  292. <th colspan="4" class="th_title">《研发费用加计扣除优惠明细表》(a107012,选择预缴享受的企业留存备查)
  293. </th>
  294. </tr>
  295. <tr>
  296. <th>优惠明细表导入</th>
  297. <td colspan="3">
  298. <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleUpload('8')" v-if="finFlag">上传</el-button>
  299. </td>
  300. </tr>
  301. <tr>
  302. <th>下载</th>
  303. <td colspan="3">
  304. <ul>
  305. <li v-for="(item, index) in list8" :key="index" style="margin: 2px;">
  306. <el-row :gutter="20">
  307. <el-col :span="12">
  308. <a :href="item.url">{{item.fileName}}</a>
  309. </el-col>
  310. <el-col :span="12">
  311. <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleUpload(item.id)">下载</el-button>
  312. <el-button type="primary" icon="el-icon-upload2" size="mini" @click="handleDelete(item.id)" v-if="finFlag">删除</el-button>
  313. </el-col>
  314. </el-row>
  315. </li>
  316. </ul>
  317. </td>
  318. </tr>
  319. </table>
  320. <upload-enclosure ref="uploadEnclosure" v-if="enclosureVisible" @refreshData="getList()" :dataId="dataId" :attachType="'PROJECT'"></upload-enclosure>
  321. </div>
  322. </template>
  323. <script>
  324. import {getEnclosureApi,deleteEnclosureApi,getProjectInfoApi,downloadApi} from '@/api/enterprise/project/project'
  325. import UploadEnclosure from './UploadEnclosure'
  326. import { getExtend, readBuffer, render } from '@/utils/util';
  327. import { parse } from 'qs';
  328. import axios from 'axios'
  329. import FileUpload from '@/components/FileUpload'
  330. export default {
  331. components: {
  332. UploadEnclosure,
  333. FileUpload
  334. },
  335. props: {
  336. type: {
  337. type: String
  338. }
  339. },
  340. data() {
  341. return {
  342. total: 0,
  343. enclosureVisible: false,
  344. list: [],
  345. id: this.$route.query.id,
  346. dataId: undefined,
  347. attachType: 'FINACIAL',
  348. loading: false,
  349. selectionList: [],
  350. ids: '',
  351. queryParams: {
  352. pageNum: 1,
  353. pageSize: 10
  354. },
  355. list1: [],
  356. list2: [],
  357. list3: [],
  358. list4: [],
  359. list5: [],
  360. list6: [],
  361. list7: [],
  362. list8: [],
  363. list9: [],
  364. list10: []
  365. };
  366. },
  367. computed: {
  368. userType() {
  369. return this.$store.state.user.userType
  370. },
  371. techFlag() {
  372. let roleType = this.$store.state.user.userType
  373. return this.type != 'view' ? ['ENT_TECH', 'ADMIN', 'ENT_ADMIN'].includes(roleType) : false //判断是否为技术
  374. },
  375. finFlag() {
  376. let roleType = this.$store.state.user.userType
  377. return this.type != 'view' ? ['ENT_FIN', 'ADMIN', 'ENT_ADMIN'].includes(roleType) : false //判断是否为财务
  378. }
  379. },
  380. created() {
  381. this.id = this.$route.query.id || undefined;
  382. if(this.id) {
  383. this.getList()
  384. }
  385. },
  386. methods: {
  387. getList() {
  388. getEnclosureApi(this.attachType,this.id).then(res => {
  389. if(res.code == 200) {
  390. this.list = res.data.records
  391. this.list1 = []
  392. this.list2 = []
  393. this.list3 = []
  394. this.list4 = []
  395. this.list5 = []
  396. this.list6 = []
  397. this.list7 = []
  398. this.list8 = []
  399. this.list9 = []
  400. this.list10 = []
  401. this.list.map(item => {
  402. if(item.fileType == 'file1') {
  403. this.list1.push(item)
  404. }
  405. if(item.fileType == 'file2') {
  406. this.list2.push(item)
  407. }
  408. if(item.fileType == 'file3') {
  409. this.list3.push(item)
  410. }
  411. if(item.fileType == 'file4') {
  412. this.list4.push(item)
  413. }
  414. if(item.fileType == 'file5') {
  415. this.list5.push(item)
  416. }
  417. if(item.fileType == 'file6') {
  418. this.list6.push(item)
  419. }
  420. if(item.fileType == 'file7') {
  421. this.list7.push(item)
  422. }
  423. if(item.fileType == 'file8') {
  424. this.list8.push(item)
  425. }
  426. if(item.fileType == null) {
  427. this.list9.push(item)
  428. }
  429. if(item.fileType == 'file10') {
  430. this.list10.push(item)
  431. }
  432. })
  433. this.total = res.data.total
  434. }
  435. })
  436. },
  437. handleUpload(type) {
  438. let params = {
  439. attachType: 'FINACIAL',
  440. fileType: 'file'+type,
  441. dataId: this.id
  442. }
  443. this.enclosureVisible = true
  444. this.$nextTick(() => {
  445. this.$refs.uploadEnclosure.init(params)
  446. })
  447. },
  448. handleDownload(id) {
  449. // window.open("http://124.232.146.72:7015/api/common/attach/"+row.id)
  450. downloadApi(id).then(res => {
  451. if (res) {
  452. let fileName = "账单";
  453. const content = res.data
  454. let fileTypeEx = '';
  455. if(fileExtension == 'zip') {
  456. fileTypeEx = 'application/zip'
  457. } else if(fileExtension == 'csv') {
  458. fileTypeEx = 'text/csv'
  459. }
  460. const blob = new Blob([content], { type: fileTypeEx })
  461. const elink = document.createElement('a')
  462. elink.download = fileName
  463. elink.style.display = 'none'
  464. elink.href = URL.createObjectURL(blob)
  465. document.body.appendChild(elink)
  466. elink.click()
  467. URL.revokeObjectURL(elink.href)
  468. document.body.removeChild(elink)
  469. }
  470. })
  471. },
  472. handleDownloadBatch() {
  473. if(this.selectionList.length <=0) {
  474. this.$message.error('请选择要下载的数据');
  475. return
  476. }
  477. window.open("http://124.232.146.72:7015/api/common/attach/"+this.ids)
  478. this.getList();
  479. },
  480. handleBatchDelte() {
  481. if(this.selectionList.length <=0) {
  482. this.$message.error('请选择要删除的数据');
  483. return
  484. }
  485. this.$confirm('请确认是否删除所选择的数据!', '提示').then(() => {
  486. deleteEnclosureApi(this.ids).then(res => {
  487. if(res.code == 200) {
  488. this.queryParams.pageNum = 1;
  489. this.getList();
  490. this.$modal.msgSuccess("删除成功");
  491. }
  492. })
  493. })
  494. },
  495. // 从url加载
  496. handleView(row) {
  497. let routeUrl = this.$router.resolve({
  498. path: '/enclosurePreview',
  499. query: {url: row.url,fileName: row.fileName,id: row.id}
  500. });
  501. window.open(routeUrl.href, "_blank");
  502. },
  503. handleDelete(id) {
  504. // const id = row.id;
  505. this.$confirm('是否确认删除该数据?', "警告", {
  506. confirmButtonText: "确定",
  507. cancelButtonText: "取消",
  508. type: "warning"
  509. }).then(function() {
  510. return deleteEnclosureApi(id);
  511. }).then(() => {
  512. this.queryParams.pageNum = 1;
  513. this.getList();
  514. this.$modal.msgSuccess("删除成功");
  515. })
  516. },
  517. // 取消全选
  518. selectAll(selection) {
  519. if (selection.length == 0) {
  520. let list = this.selectedList.filter(item => !this.list.some(ele => ele.id === item.id));
  521. this.selectionList = list;
  522. }
  523. },
  524. handleSelectionChange(val) {
  525. this.selectionList = val;
  526. if(this.selectionList.length > 0) {
  527. let selectionIds = []
  528. for (let i = 0, len = this.selectionList.length; i < len; i++) {
  529. selectionIds.push(this.selectionList[i].id)
  530. }
  531. this.ids = selectionIds.join(',')
  532. }else {
  533. this.ids = ''
  534. }
  535. }
  536. }
  537. };
  538. </script>
  539. </script>
  540. <style>
  541. </style>