projectApplication.vue 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215
  1. <template>
  2. <!-- 项目立项申请 -->
  3. <div class="projectApplication" v-loading="loading">
  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
  14. v-model="selectInp.filter"
  15. @change="getData"
  16. placeholder="我的项目"
  17. >
  18. <el-option label="所有项目" value=""></el-option>
  19. <el-option
  20. v-for="item in options.projectFilter"
  21. :key="item.courseId"
  22. :label="item.title"
  23. :value="item.courseId"
  24. >
  25. </el-option>
  26. </el-select>
  27. </div>
  28. <div class="selectsBlock">
  29. <div class="selectLabel">部门</div>
  30. <el-select
  31. v-model="selectInp.department"
  32. @change="getData"
  33. placeholder="请选择"
  34. >
  35. <el-option label="所有部门" value=""></el-option>
  36. <el-option
  37. v-for="item in options.department"
  38. :key="item.classid"
  39. :label="item.name"
  40. :value="item.classid"
  41. >
  42. </el-option>
  43. </el-select>
  44. </div>
  45. <div class="selectsBlock">
  46. <div class="selectLabel">分类</div>
  47. <el-select
  48. v-model="selectInp.sort"
  49. @change="getData"
  50. placeholder="请选择"
  51. >
  52. <el-option label="所有分类" value=""></el-option>
  53. <el-option
  54. v-for="item in options.sort"
  55. :key="item.typeid"
  56. :label="item.name"
  57. :value="item.typeid"
  58. >
  59. </el-option>
  60. </el-select>
  61. </div>
  62. <div class="selectsBlock">
  63. <div class="selectLabel">负责人</div>
  64. <el-select
  65. v-model="selectInp.person"
  66. @change="getData"
  67. placeholder="请选择"
  68. >
  69. <el-option label="所有负责人" value=""></el-option>
  70. <el-option
  71. v-for="(item, index) in options.person"
  72. :key="index"
  73. :label="item.pro_leader"
  74. :value="item.pro_leader"
  75. >
  76. </el-option>
  77. </el-select>
  78. </div>
  79. <div class="selectsBlock">
  80. <div class="selectLabel">状态</div>
  81. <el-select
  82. v-model="selectInp.state"
  83. @change="getData"
  84. placeholder="请选择"
  85. >
  86. <el-option label="所有状态" value="" />
  87. <el-option
  88. v-for="(item, index) in classType"
  89. :key="item.index"
  90. :label="item.title"
  91. :value="item.value"
  92. >
  93. </el-option>
  94. </el-select>
  95. </div>
  96. <div class="selectsBlock">
  97. <span class="selectLabel">年份</span>
  98. <el-select
  99. v-model="selectInp.year"
  100. @change="getData"
  101. placeholder="请选择"
  102. >
  103. <el-option label="所有年份" value="" />
  104. <el-option
  105. v-for="item in options.year"
  106. :key="item.time"
  107. :label="item.time + '年'"
  108. :value="item.time"
  109. >
  110. </el-option>
  111. </el-select>
  112. </div>
  113. </div>
  114. <div class="ProjectManagementQuery">
  115. <el-input
  116. v-model="input"
  117. placeholder="输入项目名称/负责人/老师"
  118. ></el-input>
  119. <el-button type="primary" class="btn" size="mini" @click="getData"
  120. >查询</el-button
  121. >
  122. </div>
  123. <div
  124. class="ProjectManagementQuery"
  125. style="margin-top: 60px"
  126. v-if="$store.state.userInfo.type == 0"
  127. >
  128. <el-button type="primary" class="btn" @click.stop="exportExcel"
  129. >导出EXCEL</el-button
  130. >
  131. </div>
  132. </div>
  133. <!-- 搜索框结束 -->
  134. <!-- 表格开始 -->
  135. <div>
  136. <div>
  137. <el-button style="font-size: 16px;" v-if="$store.state.userInfo.type == 0 || $store.state.userInfo.type == 3" size="mini" :type="!isPromotion?'primary':''" @click="selectAll">全部</el-button>
  138. <el-button style="font-size: 16px;" v-if="$store.state.userInfo.type == 0 || $store.state.userInfo.type == 3" size="mini" :type="isPromotion?'primary':''" @click="selectPromotion">2024年立项项目</el-button>
  139. <span style="font-size: 12px; margin-left: 10px"
  140. >共 {{ table.total }} 条</span
  141. >
  142. </div>
  143. <el-table
  144. ref="multipleTable"
  145. :data="tableData"
  146. tooltip-effect="dark"
  147. stripe
  148. class="fontSize"
  149. :header-cell-style="{ background: '#f2f2f2', color: '#000' }"
  150. @selection-change="handleSelectionChange"
  151. @cell-click="cellProjectClick"
  152. >
  153. <!-- selection-change批量选择功能后续可能用到 -->
  154. <!--
  155. <el-table-column
  156. type="selection"
  157. width="25"
  158. >
  159. </el-table-column> -->
  160. <el-table-column
  161. prop="ProjectNo"
  162. label="项目编号"
  163. align="center"
  164. min-width="20%"
  165. >
  166. </el-table-column>
  167. <el-table-column
  168. prop="title"
  169. label="项目名称"
  170. align="center"
  171. min-width="35%"
  172. >
  173. </el-table-column>
  174. <el-table-column
  175. prop="pro_leader"
  176. align="center"
  177. label="项目负责人"
  178. min-width="15%"
  179. >
  180. </el-table-column>
  181. <el-table-column
  182. prop="name"
  183. align="center"
  184. label="所在部门"
  185. min-width="20%"
  186. >
  187. </el-table-column>
  188. <el-table-column
  189. prop="sort"
  190. align="center"
  191. label="分类"
  192. min-width="20%"
  193. >
  194. </el-table-column>
  195. <el-table-column
  196. prop="fund"
  197. label="预算(万)"
  198. align="center"
  199. min-width="10%"
  200. >
  201. <template #default="scope">
  202. <div>
  203. {{ scope.row.fund / 10000 }}
  204. </div>
  205. </template>
  206. </el-table-column>
  207. <el-table-column
  208. prop="createTime"
  209. align="center"
  210. label="创建时间"
  211. min-width="25%"
  212. >
  213. <template #default="scope">
  214. <div>
  215. {{ scope.row.createTime.split(" ")[0] }}<br />{{
  216. scope.row.createTime.split(" ")[1]
  217. }}
  218. </div>
  219. </template>
  220. </el-table-column>
  221. <el-table-column
  222. prop="phone"
  223. align="center"
  224. label="联系电话"
  225. min-width="20%"
  226. >
  227. <template #default="scope">
  228. <div>
  229. {{
  230. scope.row.phone != null || scope.row.phone == ""
  231. ? scope.row.phone
  232. : "-"
  233. }}
  234. </div>
  235. </template>
  236. </el-table-column>
  237. <el-table-column
  238. prop="state"
  239. label="状态"
  240. align="center"
  241. min-width="20%"
  242. >
  243. <template #default="scope">
  244. <div>
  245. <!-- {{ scope.row.isupload+"-"+scope.row.isReturn }} -->
  246. <span v-if="scope.row.isReturn != 0">{{
  247. isReturnType[scope.row.isReturn]
  248. }}</span>
  249. <!-- {{scope.row.name + (scope.row.status==0?"":"(已屏蔽)")}} -->
  250. <!-- {{ (scope.row.isupload==0?"未审核": scope.row.data==1?"正在审核":"已审核") }} -->
  251. <span v-else>{{
  252. classType.find((i) => i.value == scope.row.isupload)["title"]
  253. }}</span>
  254. <!-- <span v-if="scope.row.isupload == 0">未审核</span>
  255. <span v-if="scope.row.isupload == 1">审核中</span>
  256. <span v-if="scope.row.isupload == 2">进行中</span>
  257. <span v-if="scope.row.isupload == 3">待结项</span>
  258. <span v-if="scope.row.isupload == 4">已结项</span> -->
  259. </div>
  260. </template>
  261. </el-table-column>
  262. <el-table-column
  263. prop="operation"
  264. width="370"
  265. align="center"
  266. label="操作"
  267. >
  268. <template #default="scope">
  269. <div class="operations">
  270. <!-- {{ scope.row.isupload }} -->
  271. <el-button
  272. type="primary"
  273. size="mini"
  274. @click.stop="lookDetail(scope.row.courseId, scope.row.typeid)"
  275. class="btnClass"
  276. >查看详情</el-button
  277. >
  278. <el-button
  279. type="primary"
  280. v-if="scope.row.isupload == 0"
  281. @click.stop="audit(scope.row, 0)"
  282. class="btnClass"
  283. >提交</el-button
  284. >
  285. <!--0申请人审核 -->
  286. <el-button
  287. type="primary"
  288. v-if="scope.row.isupload == 1"
  289. class="disa btnClass"
  290. >已提交</el-button
  291. >
  292. <el-button
  293. type="primary"
  294. v-if="
  295. [5, 6, 7].includes(scope.row.isupload) &&
  296. ![0, 3].includes($store.state.userInfo.type)
  297. "
  298. class="disa btnClass"
  299. size="mini"
  300. >审核中</el-button
  301. >
  302. <el-button
  303. type="primary"
  304. v-if="
  305. scope.row.isupload == 2 &&
  306. ![0, 3].includes($store.state.userInfo.type)
  307. "
  308. class="disa btnClass"
  309. size="mini"
  310. >待结项</el-button
  311. >
  312. <el-button
  313. type="primary"
  314. v-if="
  315. scope.row.isupload == 3 &&
  316. ![0, 3].includes($store.state.userInfo.type)
  317. "
  318. class="disa btnClass"
  319. size="mini"
  320. >结项中</el-button
  321. >
  322. <el-button
  323. type="primary"
  324. v-if="
  325. scope.row.isupload == 4 &&
  326. ![0, 3].includes($store.state.userInfo.type)
  327. "
  328. class="disa btnClass"
  329. size="mini"
  330. >已结项</el-button
  331. >
  332. <!--1管理员审核与院长 -->
  333. <el-button
  334. type="primary"
  335. v-if="
  336. scope.row.isupload > 1 &&
  337. [0, 3].includes($store.state.userInfo.type)
  338. "
  339. class="disa btnClass"
  340. >已提交</el-button
  341. >
  342. <el-button
  343. v-if="
  344. scope.row.isupload == 0 &&
  345. [0, 3].includes($store.state.userInfo.type)
  346. "
  347. type="primary"
  348. class="disa btnClass"
  349. size="mini"
  350. >审核</el-button
  351. >
  352. <el-button
  353. v-if="
  354. scope.row.isupload == 1 &&
  355. [0, 3].includes($store.state.userInfo.type)
  356. "
  357. type="primary"
  358. size="mini"
  359. class="btnClass"
  360. @click.stop="audit(scope.row, 1)"
  361. >审核</el-button
  362. >
  363. <el-button
  364. v-if="
  365. [3, 5, 6, 7].includes(scope.row.isupload) &&
  366. [0, 3].includes($store.state.userInfo.type)
  367. "
  368. type="primary"
  369. class="disa btnClass"
  370. size="mini"
  371. >审核中</el-button
  372. >
  373. <el-button
  374. v-if="
  375. scope.row.isupload == 2 &&
  376. [0, 3].includes($store.state.userInfo.type)
  377. "
  378. type="primary"
  379. class="disa btnClass"
  380. size="mini"
  381. >待结项</el-button
  382. >
  383. <el-button
  384. v-if="
  385. [4].includes(scope.row.isupload) &&
  386. [0, 3].includes($store.state.userInfo.type)
  387. "
  388. type="primary"
  389. class="disa btnClass"
  390. size="mini"
  391. >已结项</el-button
  392. >
  393. <!-- <el-button type="primary" size="mini" @click="appTable(scope.row.typeid,scope.row.courseId)" >申请表</el-button> -->
  394. <el-button
  395. type="primary"
  396. class="btnClass"
  397. size="mini"
  398. @click.stop="del(scope.row)"
  399. >删除</el-button
  400. >
  401. </div>
  402. </template>
  403. </el-table-column>
  404. </el-table>
  405. </div>
  406. <!-- 表格结束 -->
  407. <!-- 分页 -->
  408. <el-pagination
  409. @current-change="handleCurrentChange"
  410. :current-page="table.currentPage"
  411. :page-size="table.packageSize"
  412. layout=" prev, pager, next"
  413. background
  414. class="paginations"
  415. :total="table.total"
  416. >
  417. </el-pagination>
  418. <!-- 分页结束 -->
  419. <!-- 立项审核对话框开始 -->
  420. <el-dialog
  421. title="立项审核"
  422. :visible.sync="dialogVisible"
  423. class="pageSubmitData"
  424. width="700px"
  425. :before-close="init"
  426. >
  427. <div class="diaTit">
  428. <div class="spans">项目名称:</div>
  429. <div class="spanCon">{{ auditDialog.projectName }}</div>
  430. <div class="spans">项目负责人:</div>
  431. <div class="spanCon">{{ auditDialog.person }}</div>
  432. </div>
  433. <div class="diaTit1">
  434. <div class="spans1">所在部门</div>
  435. <div class="inp">
  436. <el-input
  437. disabled
  438. v-model="auditDialog.department"
  439. placeholder="所在部门"
  440. ></el-input>
  441. </div>
  442. </div>
  443. <div class="diaTit1">
  444. <div class="spans1">预算总经费</div>
  445. <div class="inp">
  446. <el-input
  447. disabled
  448. v-model="auditDialog.fund"
  449. placeholder="预算总经费"
  450. ></el-input>
  451. </div>
  452. </div>
  453. <div class="diaTit1">
  454. <div class="spans1">联系电话</div>
  455. <div class="inp">
  456. <el-input
  457. disabled
  458. v-model="auditDialog.tel"
  459. placeholder="联系电话"
  460. ></el-input>
  461. </div>
  462. </div>
  463. <!-- <div class="diaTit1" v-if="isManager == 1">
  464. <div class="spans1" style="position: relative; top: -24px">
  465. 驳回意见
  466. </div>
  467. <div class="inp">
  468. <el-input
  469. type="textarea"
  470. :rows="5"
  471. resize="none"
  472. placeholder="请输入修改建议等..."
  473. v-model="rejectApplyText"
  474. >
  475. </el-input>
  476. </div>
  477. </div> -->
  478. <div slot="footer" class="dialog-footer">
  479. <el-button
  480. type="primary"
  481. v-if="isManager == 0"
  482. @click="ApplyPersonCommit"
  483. class="AllDialogBtn"
  484. >确定</el-button
  485. >
  486. <el-button
  487. type="primary"
  488. v-if="isManager == 1"
  489. @click="ManagerCommit"
  490. class="AllDialogBtn"
  491. >立项通过</el-button
  492. >
  493. <el-tooltip
  494. v-if="isManager == 1"
  495. effect="light"
  496. content="(直接进入学校终审状态)"
  497. placement="top"
  498. >
  499. <el-button
  500. type="primary"
  501. @click="ManagerCommit2"
  502. class="AllDialogBtn"
  503. >
  504. 二次审核通过
  505. </el-button>
  506. </el-tooltip>
  507. <el-button
  508. type="primary"
  509. v-if="isManager == 1"
  510. @click="rejectApply"
  511. class="AllDialogBtn"
  512. >撤回</el-button
  513. >
  514. <el-button @click="init" class="AllDialogBtn">取消</el-button>
  515. </div>
  516. </el-dialog>
  517. <!-- 立项审核对话框结束 -->
  518. <!-- 删除通知开始 -->
  519. <el-dialog
  520. title="删除项目"
  521. :visible.sync="dialogVisible2"
  522. width="600px"
  523. class="pageSubmitData"
  524. >
  525. <div class="deleteContent">确定删除项目?</div>
  526. <span slot="footer" class="dialog-footer">
  527. <el-button type="primary" @click="dialogDel" class="AllDialogBtn"
  528. >确认</el-button
  529. >
  530. <el-button @click="init" class="AllDialogBtn">取消</el-button>
  531. </span>
  532. </el-dialog>
  533. <!-- 删除通知结束-->
  534. </div>
  535. </template>
  536. <script>
  537. // import XLSX from "xlsx";
  538. // import {MakerSpaceWord,MakerStudentWord,getWord} from '@/components/tool/getWord.js'
  539. // import MakerSpaceWordPreview from '@/components/MakerSpaceWordPreview.vue';
  540. // import studentMakerProjectPreview from '@/components/studentMakerProjectPreview.vue'
  541. export default {
  542. // components:{MakerSpaceWordPreview,studentMakerProjectPreview},
  543. data() {
  544. return {
  545. isPromotion: '',
  546. iid: "",
  547. loading: false,
  548. textarea: "",
  549. input: "",
  550. dialogVisible: false, //立项审核
  551. dialogVisible1: false, //立项撤回提交
  552. dialogVisible2: false, //删除
  553. WordPreview: false, //文档预览
  554. downloadWord: false, //申请表下载
  555. PreviewTid: "", //预览分类ID
  556. PreviewData: "", //预览数据
  557. rejectApplyText: "", //撤回-修改建议
  558. isManager: 0, //0申请人审核科----- 1管理员审核框
  559. // 分页数据
  560. table: {
  561. total: 0,
  562. packageSize: 7,
  563. currentPage: 1,
  564. },
  565. tableData: [], //列表数据
  566. classType: [
  567. { index: 0, value: "0", title: "未提交" },
  568. { index: 1, value: "1", title: "已提交" },
  569. { index: 2, value: "5", title: "所在学院/部门审核中" },
  570. { index: 3, value: "6", title: "双创学院审核中" },
  571. { index: 4, value: "7", title: "学校终审中" },
  572. { index: 5, value: "2", title: "待结项" },
  573. { index: 6, value: "3", title: "提交结项中" },
  574. { index: 7, value: "4", title: "已结项" },
  575. ],
  576. // "0":'未提交',
  577. // '1':"已提交",
  578. // '5':'所在学院/部门审核中',
  579. // '6':'双创学院审核中',
  580. // '7':'学校终审中',
  581. // '2':"待结项",
  582. // '3':"提交结项中",
  583. // '4':'已结项',
  584. isReturnType: {
  585. 5: "所在学院/部门审核驳回",
  586. 6: "双创学院审核驳回",
  587. 7: "学校终审驳回",
  588. },
  589. selectInp: {
  590. // 头部搜索框的内容
  591. filter: "",
  592. department: "",
  593. sort: "",
  594. person: "",
  595. state: "",
  596. year: "",
  597. },
  598. options: {
  599. //头部搜索框下拉框数据
  600. projectFilter: [], //项目筛选
  601. department: [], //部门
  602. sort: [], //分类
  603. person: [], //负责人
  604. state: [
  605. //状态
  606. // {
  607. // value: "",
  608. // label: "全部",
  609. // },
  610. // {
  611. // value: 0,
  612. // label: "未提交",
  613. // },
  614. // {
  615. // value: 1,
  616. // label: "已提交",
  617. // },
  618. // {
  619. // value: 2,
  620. // label: "进行中",
  621. // },
  622. // {
  623. // value: 3,
  624. // label: "待结项",
  625. // },
  626. // {
  627. // value: 4,
  628. // label: "已结项",
  629. // },
  630. ],
  631. year: [],
  632. },
  633. auditDialog: {
  634. //审核对话框数据
  635. projectName: "",
  636. person: "",
  637. department: "",
  638. fund: "",
  639. tel: "",
  640. // cid:''
  641. },
  642. };
  643. },
  644. methods: {
  645. selectAll() {
  646. console.log("所有");
  647. this.isPromotion = '';
  648. this.getData()
  649. },
  650. selectPromotion() {
  651. console.log("晋级");
  652. this.isPromotion = 1;
  653. this.getData()
  654. },
  655. init() {
  656. this.dialogVisible = false;
  657. this.dialogVisible1 = false;
  658. this.dialogVisible2 = false;
  659. },
  660. audit(val, num) {
  661. //审核按钮
  662. this.isManager = num;
  663. this.iid = val; //储存id给对话框
  664. // if (val.isupload==0) {
  665. this.dialogVisible = true;
  666. // console.log(val);
  667. this.auditDialog.projectName = val.title;
  668. this.auditDialog.person = val.pro_leader;
  669. this.auditDialog.department = val.name;
  670. this.auditDialog.fund = val.fund;
  671. this.auditDialog.tel = val.phone || "-";
  672. // this.auditDialog.cid=courseId
  673. // }
  674. },
  675. appTable(tid, pid) {
  676. //查看申请表
  677. // console.log();
  678. if (tid == "5e21b204-c206-11ed-a4cd-509a4c5b67cf") {
  679. // downloadFile('/file/附件2:2023年学生创客项目申报书模板(2).docx',"2023年学生创客项目申报书模板.docx",(_b)=>this.loading = _b);
  680. this.ajax
  681. .get(this.$store.state.api + "/SelectProjectWordMakerStudent", {
  682. uid: this.$store.state.userInfo.userid,
  683. pid: pid,
  684. })
  685. .then((res) => {
  686. // console.log(res['data']);
  687. let data = res["data"];
  688. this.downloadWord = true;
  689. // this.downWord(data)
  690. // this.PreviewData = [res['data'][0][0],res['data'][1]];
  691. // return console.log(this.PreviewData);
  692. // this.WordPreview = true;
  693. // this.PreviewTid = tid;
  694. })
  695. .catch((err) => {
  696. console.log(err);
  697. });
  698. } else if (tid == "5f7a66d5-c206-11ed-a4cd-509a4c5b67cf") {
  699. this.ajax
  700. .get(this.$store.state.api + "/SelectProjectWordMakerSpace", {
  701. uid: this.$store.state.userInfo.userid,
  702. pid: pid,
  703. })
  704. .then((res) => {
  705. this.PreviewData = [res["data"][0][0], res["data"][1]];
  706. this.WordPreview = true;
  707. this.PreviewTid = tid;
  708. // MakerSpaceWord(res['data'][0][0],res['data'][1]);
  709. })
  710. .catch((err) => {
  711. console.log(err);
  712. });
  713. } else {
  714. this.$message.error("错误");
  715. }
  716. },
  717. downWord(data) {
  718. if (this.PreviewTid == "5f7a66d5-c206-11ed-a4cd-509a4c5b67cf") {
  719. MakerSpaceWord(this.PreviewData[0], this.PreviewData[1]);
  720. } else {
  721. getWord(data[0][0]);
  722. }
  723. },
  724. ManagerCommit() {
  725. //先判断项目有没有被驳回
  726. let param = {
  727. pid: this.iid.courseId,
  728. };
  729. // return console.log(param);
  730. // console.log(param)
  731. this.ajax.get(this.$store.state.api + "/selectSign", param).then(
  732. (res) => {
  733. let isAgree =
  734. res.data[0].length > 0
  735. ? Math.max(...res.data[0].map((obj) => obj.isAgree))
  736. : 1;
  737. if (isAgree == 2) {
  738. let text = "项目已被驳回,原因为:";
  739. for (var i = 0; i < res.data[0].length; i++) {
  740. if (res.data[0][i].isAgree == 2) {
  741. text += res.data[0][i].text;
  742. }
  743. }
  744. this.$message.warning(text);
  745. return;
  746. } else {
  747. //立项审核对话框里面的管理员通过按钮
  748. // console.log(this.iid);
  749. let param = {
  750. uid: this.$store.state.userInfo.userid,
  751. pid: this.iid.courseId,
  752. num: 5,
  753. };
  754. this.ajax
  755. // .post(this.$store.state.api+"/ApproveProject",param)
  756. .post(this.$store.state.api + "/updateIsupload", param)
  757. .then(
  758. (res) => {
  759. // console.log(res);
  760. this.dialogVisible = false;
  761. this.$message.success("已通过");
  762. this.getData();
  763. },
  764. (err) => {
  765. console.log(err);
  766. }
  767. );
  768. }
  769. },
  770. (err) => {
  771. console.log(err);
  772. }
  773. );
  774. },
  775. ManagerCommit2() {
  776. //先判断项目有没有被驳回
  777. // let param = {
  778. // pid: this.iid.courseId,
  779. // };
  780. // return console.log(param);
  781. // console.log(param)
  782. // this.ajax.get(this.$store.state.api + "/selectSign", param).then(
  783. // (res) => {
  784. // let isAgree =
  785. // res.data[0].length > 0
  786. // ? Math.max(...res.data[0].map((obj) => obj.isAgree))
  787. // : 1;
  788. // if (isAgree == 2) {
  789. // let text = "项目已被驳回,原因为:";
  790. // for (var i = 0; i < res.data[0].length; i++) {
  791. // if (res.data[0][i].isAgree == 2) {
  792. // text += res.data[0][i].text;
  793. // }
  794. // }
  795. // this.$message.warning(text);
  796. // return;
  797. // } else {
  798. //立项审核对话框里面的管理员通过按钮
  799. // console.log(this.iid);
  800. let param = {
  801. uid: this.$store.state.userInfo.userid,
  802. pid: this.iid.courseId,
  803. num: 7,
  804. };
  805. this.ajax
  806. // .post(this.$store.state.api+"/ApproveProject",param)
  807. .post(this.$store.state.api + "/updateIsupload", param)
  808. .then(
  809. (res) => {
  810. // console.log(res);
  811. this.dialogVisible = false;
  812. this.$message.success("已通过");
  813. this.getData();
  814. },
  815. (err) => {
  816. console.log(err);
  817. }
  818. );
  819. // }
  820. // },
  821. // (err) => {
  822. // console.log(err);
  823. // }
  824. // );
  825. },
  826. ApplyPersonCommit() {
  827. //先判断项目有没有被驳回
  828. let param = {
  829. pid: this.iid.courseId,
  830. };
  831. // return console.log(param);
  832. // console.log(param)
  833. this.ajax.get(this.$store.state.api + "/selectSign", param).then(
  834. (res) => {
  835. let isAgree =
  836. res.data[0].length > 0
  837. ? Math.max(...res.data[0].map((obj) => obj.isAgree))
  838. : 1;
  839. if (isAgree == 2) {
  840. let text = "项目已被驳回,原因为:";
  841. for (var i = 0; i < res.data[0].length; i++) {
  842. if (res.data[0][i].isAgree == 2) {
  843. text += res.data[0][i].text;
  844. }
  845. }
  846. this.$message.warning(text);
  847. return;
  848. } else {
  849. //申请人审核按钮
  850. let param = {
  851. uid: this.$store.state.userInfo.userid,
  852. pid: this.iid.courseId,
  853. num: 1,
  854. };
  855. this.ajax
  856. .post(this.$store.state.api + "/updateIsupload", param) //updateIsupload
  857. .then((res) => {
  858. this.dialogVisible = false;
  859. this.$message.success("已提交");
  860. this.getData();
  861. });
  862. }
  863. },
  864. (err) => {
  865. console.log(err);
  866. }
  867. );
  868. },
  869. rejectApply() {
  870. //立项审核对话框里面的驳回申请
  871. let param = {
  872. uid: this.$store.state.userInfo.userid,
  873. pid: this.iid.courseId,
  874. num: 0,
  875. };
  876. this.ajax
  877. .post(this.$store.state.api + "/updateIsupload", param)
  878. .then((res) => {
  879. this.dialogVisible = false;
  880. this.$message.success("已撤回项目申请");
  881. this.getData();
  882. });
  883. },
  884. commit2(val) {
  885. //立项撤回对话框里面的确定撤回按钮
  886. this.dialogVisible1 = false;
  887. this.status--;
  888. },
  889. handleSelectionChange(val) {
  890. //批量选择功能后续可能用到
  891. // console.log(val);
  892. this.multipleSelection = val;
  893. },
  894. // 单元格被点击
  895. cellProjectClick(row, column, cell, event) {
  896. if (column.property != "operation") {
  897. this.lookDetail(row.courseId, row.typeid);
  898. }
  899. },
  900. lookDetail(val, tid) {
  901. this.$router.push(`/projectApplicationDetailMain?tid=${tid}&pid=${val}`);
  902. },
  903. // apply(){ //项目立项申请按钮
  904. // this.$router.push('/projectApplicationApplyMain')
  905. // },
  906. getData() {
  907. if (this.loading) return;
  908. //获取表格数据
  909. this.loading = true;
  910. let param = {
  911. uid: this.$store.state.userInfo.userid,
  912. pid: this.selectInp.filter, //筛选
  913. did: this.selectInp.department, //部门
  914. tid: this.selectInp.sort, //分类
  915. leader: this.selectInp.person, //负责人
  916. st: this.selectInp.state, //审核状态
  917. year: this.selectInp.year,
  918. textInp: encodeURIComponent(this.input),
  919. promotion: this.isPromotion,
  920. page: this.table.currentPage, //当前页
  921. lim: this.table.packageSize, //限制获取几条数据
  922. };
  923. // return console.log(param);
  924. // console.log(param)
  925. this.tableData = [];
  926. this.ajax.get(this.$store.state.api + "/SelectAllProject", param).then(
  927. (res) => {
  928. let data = res.data;
  929. console.log(data);
  930. if (data[0].length == 0 && data[5][0]["total"] != 0) {
  931. this.table.currentPage = 1;
  932. this.loading = false;
  933. return this.getData();
  934. }
  935. let a = this.options;
  936. this.tableData = data[0];
  937. a.projectFilter = data[1];
  938. a.department = data[2];
  939. a.sort = data[3];
  940. a.person = data[4];
  941. a.year = data[6];
  942. if (
  943. a.year.filter(
  944. (item) => item["time"] == new Date().getFullYear().toString()
  945. ).length == 0
  946. ) {
  947. a.year.push({ time: new Date().getFullYear().toString() });
  948. }
  949. this.table.total = data[5][0].total;
  950. // this.tableData.forEach(item=>{
  951. // if(item['time']!=null&&item['time']!=''){
  952. // item['time']=JSON.parse(item['time'])
  953. // }else{
  954. // item['time'] = []
  955. // }
  956. // })
  957. this.loading = false;
  958. // console.log(this.tableData)
  959. },
  960. (err) => {
  961. console.log(err);
  962. }
  963. );
  964. },
  965. del(val) {
  966. //表格删除按钮,点击显示删除对话框
  967. // console.log(val);
  968. this.dialogVisible2 = true;
  969. this.iid = val; //将要删除的id进行存储供删除对话框使用
  970. },
  971. dialogDel() {
  972. //确定删除这个项目
  973. // if (this.iid.userid == this.$store.state.userInfo.userid) {
  974. let param = {
  975. uid: this.$store.state.userInfo.userid,
  976. pid: this.iid.courseId,
  977. };
  978. this.ajax.post(this.$store.state.api + "/DeleteProject", param).then(
  979. (res) => {
  980. console.log(res);
  981. if (res.data) {
  982. this.$message.success("删除成功");
  983. this.getData();
  984. this.dialogVisible2 = false;
  985. return;
  986. } else {
  987. this.$message.error("删除失败");
  988. }
  989. },
  990. (err) => {
  991. console.log(err);
  992. }
  993. );
  994. // }
  995. },
  996. handleCurrentChange(val) {
  997. //当页数发生改变的时候调用获取列表数据请求
  998. // console.log(`当前页: ${val}`);
  999. this.table.currentPage = val;
  1000. this.getData();
  1001. },
  1002. // 导出Excel表格
  1003. exportExcel() {
  1004. this.$confirm("是否导出Excel?", "提示", {
  1005. confirmButtonText: "确定",
  1006. cancelButtonText: "取消",
  1007. })
  1008. .then(() => {
  1009. this.loading = true;
  1010. let param = {
  1011. uid: this.$store.state.userInfo.userid,
  1012. pid: this.selectInp.filter, //筛选
  1013. did: this.selectInp.department, //部门
  1014. tid: this.selectInp.sort, //分类
  1015. leader: this.selectInp.person, //负责人
  1016. st: this.selectInp.state, //审核状态
  1017. year: this.selectInp.year,
  1018. textInp: encodeURIComponent(this.input),
  1019. promotion: this.isPromotion,
  1020. page: 1, //当前页
  1021. lim: 99999999, //限制获取几条数据
  1022. };
  1023. this.ajax
  1024. .get(this.$store.state.api + "/SelectAllProject", param)
  1025. .then((res) => {
  1026. let _data = res.data[0];
  1027. let _array = [];
  1028. _data.forEach((item, index) => {
  1029. let _json = {};
  1030. let teacher = item.course_teacher
  1031. ? JSON.parse(item.course_teacher)
  1032. : [];
  1033. let student = item.course_student
  1034. ? JSON.parse(item.course_student)
  1035. : [];
  1036. let money = item.money ? JSON.parse(item.money) : {};
  1037. // _json["项目编号"] = item.ProjectNo;
  1038. _json["项目名称"] = item.title;
  1039. _json["项目负责人"] = item.pro_leader;
  1040. _json["小型仪器设备费"] = money["device"]
  1041. ? money["device"]
  1042. : "0";
  1043. _json["材料费"] = money["Material"] ? money["Material"] : "0";
  1044. _json["测试化验加工费"] = money["processing"]
  1045. ? money["processing"]
  1046. : "0";
  1047. _json["项目协作费"] = money["Collaboration"]
  1048. ? money["Collaboration"]
  1049. : "0";
  1050. _json["项目成果鉴定费"] = money["APPRAISAL"]
  1051. ? money["APPRAISAL"]
  1052. : "0";
  1053. _json["参展参赛费"] = money["entery"] ? money["entery"] : "0";
  1054. _json["创客交流活动费"] = money["activities"]
  1055. ? money["activities"]
  1056. : "0";
  1057. _json["知识产权事务费"] = money["Transaction"]
  1058. ? money["Transaction"]
  1059. : "0";
  1060. // _json["所在部门"] = item.name;
  1061. // _json["分类"] = item.sort;
  1062. // _json["预算(万)"] = item.fund / 10000;
  1063. // _json["创建时间"] = item.createTime;
  1064. // _json["联系电话"] = item.phone;
  1065. // _json["项目状态"] =
  1066. // item.isReturn == 0
  1067. // ? this.classType.find((i) => i.value == item.isupload)[
  1068. // "title"
  1069. // ]
  1070. // : this.isReturnType[item.isReturn];
  1071. // for (let i = 0; i < student.length; i++) {
  1072. // _json["学生成员" + (i + 1)] = student[i].name;
  1073. // _json["学生班级" + (i + 1)] = student[i].collage;
  1074. // }
  1075. // for (let i = 0; i < teacher.length; i++) {
  1076. // _json["指导老师" + (i + 1)] = teacher[i].name;
  1077. // }
  1078. _array.push(_json);
  1079. });
  1080. let XLSX = require("xlsx");
  1081. const workbook = XLSX.utils.book_new(); //创建一个新的工作簿对象
  1082. let ws = XLSX.utils.json_to_sheet(_array); //将json对象数组转化成工作表
  1083. ws["!cols"] = [
  1084. //设置每一列的宽度
  1085. { wch: 50 },
  1086. { wch: 20 },
  1087. { wch: 20 },
  1088. { wch: 20 },
  1089. { wch: 20 },
  1090. { wch: 20 },
  1091. { wch: 20 },
  1092. { wch: 20 },
  1093. { wch: 20 },
  1094. { wch: 20 },
  1095. { wch: 20 },
  1096. { wch: 20 },
  1097. { wch: 20 },
  1098. { wch: 20 },
  1099. { wch: 20 },
  1100. { wch: 20 },
  1101. { wch: 20 },
  1102. { wch: 20 },
  1103. { wch: 10 },
  1104. { wch: 10 },
  1105. { wch: 10 },
  1106. { wch: 10 },
  1107. { wch: 10 },
  1108. { wch: 10 },
  1109. { wch: 10 },
  1110. ];
  1111. XLSX.utils.book_append_sheet(workbook, ws, "sheet1"); //把sheet添加到workbook里,第三个参数是sheet名
  1112. XLSX.writeFile(workbook, "项目列表.xlsx");
  1113. this.loading = false;
  1114. console.log(_data);
  1115. });
  1116. })
  1117. .catch(() => {});
  1118. },
  1119. // getUser() {
  1120. // var request = new XMLHttpRequest();
  1121. // request.open("get", "http://10.16.30.130/sso/api", true);
  1122. // request.setRequestHeader(
  1123. // "Content-Type",
  1124. // "application/x-www-form-urlencoded"
  1125. // );
  1126. // request.send("");
  1127. // console.log(request);
  1128. // },
  1129. },
  1130. watch: {
  1131. //监视选择框的变化,实施刷新表格数据
  1132. // options:{
  1133. // handler(){
  1134. // immediate:true
  1135. // deep:true
  1136. // this.getData()
  1137. // }
  1138. // }
  1139. },
  1140. mounted() {
  1141. // 默认选择当前年份
  1142. this.selectInp.year = new Date().getFullYear().toString();
  1143. //跳转到此页面立刻获取数据
  1144. // this.getData(); //获取表格数据
  1145. // this.getUser();
  1146. // console.log(this.$store.state.userInfo.type);
  1147. },
  1148. activated() {
  1149. this.getData();
  1150. },
  1151. };
  1152. </script>
  1153. <style lang="less" scoped>
  1154. .projectApplication {
  1155. // .el-table::before{
  1156. // height: 0;
  1157. // }
  1158. .btnClass {
  1159. width: 70px !important;
  1160. max-width: 70px;
  1161. min-width: 70px;
  1162. }
  1163. /deep/.el-table__row {
  1164. .el-table__cell {
  1165. cursor: pointer;
  1166. }
  1167. .el-table__cell:nth-last-child(1) {
  1168. cursor: default;
  1169. }
  1170. }
  1171. .btnCss{
  1172. color: #409EFF;
  1173. border-color: #c6e2ff;
  1174. background-color: #ecf5ff;
  1175. }
  1176. }
  1177. </style>