ProjectManagement.vue 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261
  1. <template>
  2. <!-- 项目管理页面 -->
  3. <div class="ProjectManagement" 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. <span class="selectLabel">项目筛选</span>
  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. <span class="selectLabel">部门</span>
  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. <span class="selectLabel">分类</span>
  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. <span class="selectLabel">结题状态</span>
  64. <el-select
  65. v-model="selectInp.state"
  66. @change="getData"
  67. placeholder="请选择"
  68. >
  69. <el-option
  70. v-for="item in options.state"
  71. :key="item.value"
  72. :label="item.label"
  73. :value="item.value"
  74. >
  75. </el-option>
  76. </el-select>
  77. </div>
  78. <div class="selectsBlock">
  79. <span class="selectLabel">负责人</span>
  80. <el-select
  81. v-model="selectInp.leader"
  82. @change="getData"
  83. placeholder="请选择"
  84. >
  85. <el-option label="所有负责人" value=""></el-option>
  86. <el-option
  87. v-for="(item, index) in options.person"
  88. :key="index"
  89. :label="item.pro_leader"
  90. :value="item.pro_leader"
  91. >
  92. </el-option>
  93. </el-select>
  94. </div>
  95. <div class="selectsBlock">
  96. <span class="selectLabel">年份</span>
  97. <el-select
  98. v-model="selectInp.year"
  99. @change="getData"
  100. placeholder="请选择"
  101. >
  102. <el-option label="所有年份" value=""></el-option>
  103. <el-option
  104. v-for="(item, index) in options.yearData"
  105. :key="index"
  106. :label="item.time + '年'"
  107. :value="item.time"
  108. >
  109. </el-option>
  110. </el-select>
  111. </div>
  112. </div>
  113. <!-- <div class="ProjectManagementQuery" style="bottom: 0">
  114. <el-button type="primary" class="btn" size="mini" @click="openShare"
  115. >分配项目</el-button
  116. >
  117. </div> -->
  118. <div class="ProjectManagementQuery">
  119. <el-input
  120. v-model="selectText"
  121. placeholder="请输入项目名称/编号"
  122. ></el-input>
  123. <el-button type="primary" class="btn" size="mini" @click="getData"
  124. >查询</el-button
  125. >
  126. </div>
  127. </div>
  128. <!-- 搜索栏结束 -->
  129. <!-- 表格开始 -->
  130. <div>
  131. <el-table
  132. ref="multipleTable"
  133. :data="items"
  134. tooltip-effect="dark"
  135. stripe
  136. class="fontSize"
  137. :header-cell-style="{ background: '#f2f2f2', color: '#000' }"
  138. >
  139. <el-table-column
  140. prop="ProjectNo"
  141. label="项目编号"
  142. align="center"
  143. min-width="9%"
  144. >
  145. </el-table-column>
  146. <el-table-column
  147. prop="title"
  148. label="项目名称"
  149. align="center"
  150. min-width="10%"
  151. >
  152. </el-table-column>
  153. <el-table-column
  154. prop="pro_leader"
  155. align="center"
  156. label="项目负责人"
  157. min-width="9%"
  158. >
  159. </el-table-column>
  160. <el-table-column
  161. prop="dName"
  162. align="center"
  163. label="所在部门"
  164. min-width="10%"
  165. >
  166. </el-table-column>
  167. <el-table-column
  168. prop="tName"
  169. align="center"
  170. label="分类"
  171. min-width="10%"
  172. >
  173. </el-table-column>
  174. <el-table-column
  175. prop="fund"
  176. label="预算(万)"
  177. align="center"
  178. min-width="8%"
  179. >
  180. <template #default="scope">
  181. <div>
  182. {{ scope.row.fund / 10000 }}
  183. </div>
  184. </template>
  185. </el-table-column>
  186. <el-table-column
  187. prop="startTime"
  188. align="center"
  189. label="开始时间"
  190. min-width="9%"
  191. >
  192. <template #default="scope">
  193. <div>
  194. {{ scope.row.startTime.split(" ")[0] }}
  195. </div>
  196. </template>
  197. </el-table-column>
  198. <el-table-column
  199. prop="phone"
  200. align="center"
  201. label="联系电话"
  202. min-width="10%"
  203. >
  204. <template #default="scope">
  205. <div>
  206. {{
  207. scope.row.phone != null || scope.row.phone == ""
  208. ? scope.row.phone
  209. : "-"
  210. }}
  211. </div>
  212. </template>
  213. </el-table-column>
  214. <el-table-column
  215. prop="state"
  216. label="状态"
  217. align="center"
  218. min-width="6%"
  219. >
  220. <template #default="scope">
  221. <div>
  222. <!-- {{scope.row.name + (scope.row.status==0?"":"(已屏蔽)")}} -->
  223. <!-- {{ (scope.row.isupload==0?"未审核": scope.row.data==1?"正在审核":"已审核") }} -->
  224. <span v-if="scope.row.isupload == 0">未审核</span>
  225. <span v-if="scope.row.isupload == 1">审核中</span>
  226. <span v-if="scope.row.isupload == 2">进行中</span>
  227. <span v-if="scope.row.isupload == 3">待结项</span>
  228. <span v-if="scope.row.isupload == 4">已结项</span>
  229. </div>
  230. </template>
  231. </el-table-column>
  232. <el-table-column
  233. prop="operation"
  234. width="300"
  235. align="center"
  236. label="操作"
  237. >
  238. <template #default="scope">
  239. <div class="operations">
  240. <el-button
  241. type="primary"
  242. @click="scheduleDetail(scope.row.courseId, scope.row.typeid)"
  243. size="mini"
  244. >项目详情</el-button
  245. >
  246. <!-- <el-button
  247. type="primary"
  248. @click="fundStatus(scope.row.courseId)"
  249. size="mini"
  250. >资金情况</el-button
  251. > -->
  252. <el-button
  253. type="primary"
  254. v-show="scope.row.isupload == 2"
  255. @click="finish(scope.row)"
  256. size="mini"
  257. >提交结项</el-button
  258. >
  259. <el-button
  260. type="primary"
  261. v-show="scope.row.isupload == 3"
  262. @click="amendFinish(scope.row)"
  263. size="mini"
  264. >修改结项</el-button
  265. >
  266. <el-button
  267. type="primary"
  268. v-show="scope.row.isupload == 4"
  269. disabled
  270. class="disa"
  271. size="mini"
  272. >已结项</el-button
  273. >
  274. <el-button
  275. type="primary"
  276. @click="jump(scope.row.courseId)"
  277. size="mini"
  278. >打印结项书</el-button
  279. >
  280. </div>
  281. </template>
  282. </el-table-column>
  283. </el-table>
  284. </div>
  285. <!-- 表格结束 -->
  286. <!-- 提示哪些活动没有完成开始 -->
  287. <el-dialog
  288. title="提示"
  289. :visible.sync="NoReportActivity"
  290. width="600px"
  291. class="endDialog"
  292. >
  293. <div class="deleteContent">"{{ tit }}"项目</div>
  294. <div
  295. class="download checkActivity"
  296. v-show="checkActivityFinishData.length > 0"
  297. >
  298. <span style="color: black">未完结活动:</span
  299. ><span v-for="(item, index) in checkActivityFinishData" :key="index">{{
  300. item.title
  301. }}</span>
  302. </div>
  303. <div
  304. class="download checkActivity"
  305. v-show="checkFundFinishData.length > 0"
  306. >
  307. <span style="color: black">未完结资金:</span>
  308. <span
  309. style="cursor: pointer"
  310. @click="fundDetail(item.id, item.title, item.pid)"
  311. v-for="(item, index) in checkFundFinishData"
  312. :key="index"
  313. >{{ item.title }}/{{ item.applyfund - item.actualuse }}(元)</span
  314. >
  315. </div>
  316. <div
  317. slot="footer"
  318. class="dialog-footer"
  319. style="display: flex; justify-content: center"
  320. >
  321. <!-- <el-button type="primary" @click="init" class="AllDialogBtn">确认</el-button> -->
  322. <el-button @click="NoReportActivity = false" class="AllDialogBtn"
  323. >取消</el-button
  324. >
  325. </div>
  326. </el-dialog>
  327. <!-- 提示哪些活动没有完成结束 -->
  328. <!-- 分配项目给老师 -->
  329. <el-dialog
  330. title="提示"
  331. :visible.sync="shareDialog"
  332. width="600px"
  333. class="endDialog1"
  334. >
  335. <div>
  336. <el-select v-model="project" placeholder="请选择项目">
  337. <el-option
  338. v-for="item in allProject"
  339. :key="item.courseId"
  340. :label="item.title"
  341. :value="item.courseId"
  342. ></el-option>
  343. </el-select>
  344. </div>
  345. <el-input
  346. style="width: 50%; margin: 10px 0 0 0"
  347. v-model="un"
  348. @change="getPeople"
  349. placeholder="请输入姓名"
  350. ></el-input>
  351. <el-checkbox
  352. :indeterminate="isIndeterminate"
  353. v-model="checkAll"
  354. @change="handleCheckAllChange"
  355. style="padding: 15px 0 0 15px"
  356. >全选</el-checkbox
  357. >
  358. <el-checkbox-group
  359. v-loading="caseLoading"
  360. v-model="checkboxList"
  361. style="height: 400px; overflow: auto; padding: 0 0 0 15px"
  362. v-if="people.length"
  363. @change="handleCheckedAnliChange"
  364. >
  365. <el-checkbox
  366. v-for="item in people"
  367. :key="item.userid"
  368. :label="item.userid"
  369. >
  370. <div class="t_j_box">
  371. <el-tooltip
  372. placement="top"
  373. :content="item.username ? item.username : '暂无姓名'"
  374. >
  375. <span>{{ item.username ? item.username : "暂无姓名" }}</span>
  376. </el-tooltip>
  377. </div>
  378. </el-checkbox>
  379. </el-checkbox-group>
  380. <div
  381. slot="footer"
  382. class="dialog-footer"
  383. style="display: flex; justify-content: center"
  384. >
  385. <el-button
  386. type="primary"
  387. @click="setUseridInProject"
  388. class="AllDialogBtn"
  389. >确认</el-button
  390. >
  391. <el-button @click="shareDialog = false" class="AllDialogBtn"
  392. >取消</el-button
  393. >
  394. </div>
  395. </el-dialog>
  396. <!-- 结项书开始 -->
  397. <el-dialog title="结项书" :visible.sync="endDialog" class="endDialogBlock">
  398. <!-- <div class="deleteContent">"{{ tit }}"项目,是否确定完结?</div>
  399. <div class="download checkActivity" v-show="checkFundEndData.length>0">
  400. <span style="color: black;">剩余资金:</span>
  401. </div>
  402. <div class="deleteContent1">活动完结报告</div>
  403. <div class="download" v-for="item in file" :key="item.fid">
  404. <span>{{ item.fileName }}</span>
  405. <div class="downloadBtn">
  406. <el-button type="primary" @click="checkDelFile(item.url)" size="mini">删除文件</el-button>
  407. </div>
  408. </div>
  409. <el-progress v-show="progress.show" :percentage="progress.value" :format="ProgressFormat"></el-progress>
  410. <div class="addMoneyBtn" style="margin-left: 0;">
  411. <div class="jia">+</div>添加
  412. <div id="upFile">
  413. <beUpload @getFile="getFile" :navName="'上传文件'" :accept="accept" :progress="progress"> </beUpload>
  414. </div>
  415. </div> -->
  416. <Closingstatement
  417. ref="finalClo"
  418. :myArrayProp2.sync="myArrayProp"
  419. :iid="iid"
  420. :isDownPdf="isDownPdf"
  421. ></Closingstatement>
  422. <div
  423. slot="footer"
  424. class="dialog-footer"
  425. style="display: flex; justify-content: center"
  426. >
  427. <el-button type="primary" @click="ending" class="AllDialogBtn"
  428. >确认</el-button
  429. >
  430. <el-button type="primary" @click="getWord" class="AllDialogBtn"
  431. >下载表格</el-button
  432. >
  433. <el-button @click="endDialog = false" class="AllDialogBtn"
  434. >取消</el-button
  435. >
  436. </div>
  437. </el-dialog>
  438. <!-- 结项书结束 -->
  439. <!-- 分页 -->
  440. <el-pagination
  441. @current-change="handleCurrentChange"
  442. :current-page="table.currentPage"
  443. :page-size="table.packageSize"
  444. layout=" prev, pager, next"
  445. background
  446. class="paginations"
  447. :total="table.total"
  448. >
  449. </el-pagination>
  450. <!-- 分页结束 -->
  451. </div>
  452. </template>
  453. <script>
  454. import beUpload from "../../components/tool/beUpload";
  455. import Closingstatement from "./components/Closingstatement.vue";
  456. //下载pdf
  457. import { downloadPDF } from "@/components/tool/pdf";
  458. export default {
  459. components: { beUpload, Closingstatement },
  460. data() {
  461. return {
  462. isDownPdf: false,
  463. accept: "*",
  464. iid: "",
  465. selectText: "", //文字搜素框数据
  466. endDialog: false,
  467. DelFileDialog: false,
  468. NoReportActivity: false,
  469. loading: false,
  470. tit: "", //完结框项目名称
  471. items: [], //项目列表数据
  472. allProject: [],
  473. table: {
  474. // 分页数据
  475. total: 0,
  476. packageSize: 10,
  477. currentPage: 1,
  478. },
  479. progress: {
  480. //进度条
  481. value: 0,
  482. show: false,
  483. },
  484. DelFileData: {
  485. fid: "",
  486. fileName: "",
  487. },
  488. options: {
  489. //头部搜索框下拉框数据
  490. projectFilter: [], //项目筛选
  491. department: [], //部门
  492. sort: [], //分类
  493. person: [], //负责人
  494. state: [
  495. //状态
  496. {
  497. value: "",
  498. label: "全部",
  499. },
  500. {
  501. value: 2,
  502. label: "进行中",
  503. },
  504. {
  505. value: 3,
  506. label: "待结题",
  507. },
  508. {
  509. value: 4,
  510. label: "已结题",
  511. },
  512. ],
  513. yearData: [],
  514. },
  515. selectInp: {
  516. //select选定所显示的值
  517. filter: "", //不要带引号,select框是根据id来选择下面数据的
  518. department: "",
  519. sort: "",
  520. state: "",
  521. leader: "",
  522. year: new Date().getFullYear().toString(),
  523. },
  524. file: [],
  525. checkActivityFinishData: [], //未完成活动
  526. checkFundFinishData: [], //未完成资金
  527. // checkFundEndData:[],
  528. submitData: {
  529. //结项书要填写的数据
  530. brief: "",
  531. plan: "",
  532. technology: "",
  533. business: "",
  534. innovate: "",
  535. resultAccessory: [],
  536. firmAccessory: [],
  537. competitionAccessory: [],
  538. exchangeAccessory: [],
  539. conversionAccessory: [],
  540. talentsAccessory: [],
  541. targetPlan: "",
  542. realityResult: "",
  543. socialValue: "",
  544. taskAccessory: [],
  545. },
  546. myArrayProp: [], //结项书-后端获取的数据
  547. shareDialog: false,
  548. project: "",
  549. caseLoading: false,
  550. checkboxList: [],
  551. checkboxIdList: [],
  552. people: [],
  553. isIndeterminate: false,
  554. checkAll: false,
  555. un: "",
  556. // amendFinishArrayProp:[] //结项书-后端获取的修改结项数据
  557. };
  558. },
  559. methods: {
  560. handleCheckAllChange(val) {
  561. if (this.checkboxIdList.length == 0) {
  562. for (var i = 0; i < this.people.length; i++) {
  563. this.checkboxIdList.push(this.people[i].userid);
  564. }
  565. }
  566. this.checkboxList = val ? this.checkboxIdList : [];
  567. this.isIndeterminate = false;
  568. },
  569. handleCheckedAnliChange(value) {
  570. let checkedCount = this.checkboxList.length;
  571. this.checkAll = checkedCount === this.people.length;
  572. this.isIndeterminate =
  573. checkedCount > 0 && checkedCount < this.people.length;
  574. },
  575. fundDetail(val, tit, pid) {
  576. //跳转到未完结资金那里去
  577. // console.log(val);
  578. // window.open(`/#/makerfundDetails?Id=${val}`)
  579. this.$router.push(`/makerfundDetails?Id=${val}&tit=${tit}&paid=${pid}`);
  580. },
  581. ProgressFormat(value) {
  582. //进度条
  583. return value == 100 ? "100%" : `${value}%`;
  584. },
  585. checkDelFile(url) {
  586. //删除文件
  587. this.file = this.file.filter((item) => item.url != url);
  588. },
  589. getFile(val) {
  590. //上传文件
  591. this.file.push(val);
  592. // console.log(this.file);
  593. this.progress.show = false;
  594. },
  595. ending() {
  596. //结项书提交
  597. // return console.log(this.myArrayProp[0]);
  598. this.ajax
  599. .post(this.$store.state.api + "/updateClosingstatementData", {
  600. uid: this.$store.state.userInfo.userid,
  601. cid: this.iid,
  602. submitData: JSON.stringify(
  603. this.myArrayProp[0]["ClosingstatementData"]
  604. ),
  605. state: 3,
  606. })
  607. .then(
  608. (res) => {
  609. console.log(res);
  610. if (res.data == 1) {
  611. this.$message.success("提交成功");
  612. this.endDialog = false;
  613. this.progress.show = false;
  614. } else {
  615. this.$message.error("提交失败");
  616. }
  617. this.getData();
  618. },
  619. (err) => {
  620. console.log(err);
  621. }
  622. );
  623. this.endDialog = false;
  624. },
  625. scheduleDetail(val, tid) {
  626. //进度详情
  627. this.$router.push(`/ProjectManagementMain?Id=${tid}&pid=${val}`);
  628. },
  629. fundStatus(Id) {
  630. //资金情况
  631. // localStorage.setItem('pid',JSON.stringify(Id))
  632. this.$router.push(`/ProjectManagementFundDetail?pid=${Id}`);
  633. },
  634. finish(val) {
  635. this.myArrayProp = [];
  636. //结项对话框显示
  637. this.iid = val.courseId; // 提交结项时候的用
  638. this.checkActivityFinishData = []; //未完成项目
  639. this.checkFundFinishData = []; //未完成资金
  640. // this.checkFundEndData=[];
  641. this.ajax
  642. .get(this.$store.state.api + "/GetActivityNoReportByPId", {
  643. uid: this.$store.state.userInfo.userid,
  644. pid: val.courseId,
  645. })
  646. .then((res) => {
  647. if (res.data[0].length > 0 || res.data[1].length > 0) {
  648. this.checkActivityFinishData = res.data[0];
  649. if (res.data[1].length > 0) {
  650. let acsum = 0;
  651. let apsum = 0;
  652. res.data[1].forEach((e) => {
  653. e.applyfund = JSON.parse(e.applyfund);
  654. for (let k in e.applyfund) {
  655. acsum += e.applyfund[k] * 1;
  656. }
  657. e.applyfund = acsum;
  658. });
  659. res.data[1].forEach((e) => {
  660. if (e.actualuse != null) {
  661. e.actualuse = JSON.parse(e.actualuse);
  662. for (let k in e.actualuse) {
  663. apsum += e.actualuse[k] * 1;
  664. }
  665. e.actualuse = apsum;
  666. }
  667. });
  668. }
  669. this.checkFundFinishData = res.data[1];
  670. this.tit = val.title;
  671. this.NoReportActivity = true;
  672. } else {
  673. // this.myArrayProp=[]
  674. this.iid = val.courseId;
  675. //提交结项书版本
  676. this.ajax
  677. .get(this.$store.state.api + "/getClosingstatementData", {
  678. uid: this.$store.state.userInfo.userid,
  679. pid: val.courseId,
  680. })
  681. .then((res) => {
  682. let num = 0;
  683. res.data[1].forEach((i) => {
  684. //计算出已经使用过的金钱
  685. // console.log(i);
  686. i["actualuse"] = JSON.parse(i["actualuse"]);
  687. for (let key in i["actualuse"]) {
  688. if (i["actualuse"][key]) {
  689. num = i["actualuse"][key] * 1 + num;
  690. }
  691. }
  692. });
  693. console.log(num);
  694. let data = res.data[0];
  695. data[0].course_student = JSON.parse(data[0].course_student);
  696. data[0].course_teacher = JSON.parse(data[0].course_teacher);
  697. if (data[0].multiSelectProject != null) {
  698. data[0].multiSelectProject = JSON.parse(
  699. data[0].multiSelectProject
  700. );
  701. }
  702. data[0].money = JSON.parse(data[0].money);
  703. data[0].ClosingstatementData = data[0].ClosingstatementData
  704. ? JSON.parse(data[0].ClosingstatementData)
  705. : this.submitData;
  706. this.myArrayProp = data;
  707. this.myArrayProp[0].actualuse = num; //添加已经使用过的经费
  708. console.log(this.myArrayProp);
  709. // window.open(`/Closingstatement1?iid=${val.courseId}`);
  710. this.endDialog = true;
  711. })
  712. .catch((err) => {
  713. console.log(err);
  714. });
  715. }
  716. })
  717. .catch((err) => {
  718. console.log(err);
  719. });
  720. },
  721. amendFinish(val) {
  722. //修改结项按钮(获取结项时提交的文件)
  723. //#region 上传文件版本结项
  724. // this.checkFundEndData=[];
  725. // this.ajax.post(this.$store.state.api+"/UpdateAmendFinish",{
  726. // uid:this.$store.state.userInfo.userid,
  727. // pid:val
  728. // }).then(res=>{
  729. // console.log(res);
  730. // console.log(res.data);
  731. // if (res.data[0].length>0) {
  732. // let data=JSON.parse(res.data[0][0].endFile)
  733. // this.file=data;
  734. // }
  735. // // let data=JSON.parse(res.data[0][0].endFile)
  736. // this.tit=tit;
  737. // this.endDialog=true;
  738. // this.ClosingstatementData=val
  739. // // console.log(this.file);
  740. // }).catch(err=>{
  741. // console.log(err)
  742. // })
  743. //#endregion
  744. this.myArrayProp = [];
  745. this.submitData = {
  746. brief: "",
  747. plan: "",
  748. technology: "",
  749. business: "",
  750. innovate: "",
  751. resultAccessory: [],
  752. firmAccessory: [],
  753. competitionAccessory: [],
  754. exchangeAccessory: [],
  755. conversionAccessory: [],
  756. talentsAccessory: [],
  757. targetPlan: "",
  758. realityResult: "",
  759. socialValue: "",
  760. taskAccessory: [],
  761. };
  762. this.iid = val.courseId;
  763. //
  764. this.ajax
  765. .get(this.$store.state.api + "/selectAmendFinish", {
  766. uid: this.$store.state.userInfo.userid,
  767. pid: val.courseId,
  768. })
  769. .then((res) => {
  770. // return console.log(res);
  771. let num = 0;
  772. res.data[1].forEach((i) => {
  773. //计算出已经使用过的金钱
  774. // console.log(i);
  775. i["actualuse"] = JSON.parse(i["actualuse"]);
  776. for (let key in i["actualuse"]) {
  777. if (i["actualuse"][key]) {
  778. num = i["actualuse"][key] * 1 + num;
  779. }
  780. }
  781. });
  782. console.log(num);
  783. let data = res.data[0];
  784. data[0].course_student = JSON.parse(data[0].course_student);
  785. data[0].course_teacher = JSON.parse(data[0].course_teacher);
  786. data[0].multiSelectProject = JSON.parse(data[0].multiSelectProject);
  787. data[0].ClosingstatementData = JSON.parse(
  788. data[0].ClosingstatementData
  789. );
  790. data[0].money = JSON.parse(data[0].money);
  791. // data[0].multiSelectProject=JSON.parse(data[0].multiSelectProject)
  792. this.myArrayProp = data;
  793. this.myArrayProp[0].actualuse = num; //添加已经使用过的经费
  794. console.log(this.myArrayProp);
  795. this.endDialog = true;
  796. })
  797. .catch((err) => {
  798. console.log(err);
  799. });
  800. },
  801. handleCurrentChange(val) {
  802. //当页数发生改变的时候调用获取列表数据请求
  803. // console.log(`当前页: ${val}`);
  804. this.table.currentPage = val;
  805. this.getData();
  806. },
  807. openShare() {
  808. this.shareDialog = true;
  809. this.getPeople();
  810. this.getAllProject();
  811. },
  812. getPeople() {
  813. this.caseLoading = true;
  814. this.ajax
  815. .post(this.$store.state.api + "/selectAllUser", {
  816. n: this.un,
  817. })
  818. .then(
  819. (res) => {
  820. this.people = res.data[0];
  821. this.caseLoading = false;
  822. },
  823. (err) => {
  824. this.caseLoading = false;
  825. console.log(err);
  826. }
  827. );
  828. },
  829. setUseridInProject() {
  830. this.ajax
  831. .post(this.$store.state.api + "/updateProjectLookTeacher", {
  832. cid: this.project,
  833. look: this.checkboxList.join(","),
  834. })
  835. .then(
  836. (res) => {
  837. this.$message.success("分配成功");
  838. this.shareDialog = false;
  839. },
  840. (err) => {
  841. console.log(err);
  842. }
  843. );
  844. },
  845. getAllProject() {
  846. this.ajax.get(this.$store.state.api + "/selectAllProjectByAdmin").then(
  847. (res) => {
  848. this.allProject = res.data[0];
  849. },
  850. (err) => {
  851. console.log(err);
  852. }
  853. );
  854. },
  855. getData() {
  856. //获取渲染数据
  857. this.loading = true;
  858. let param = {
  859. uid: this.$store.state.userInfo.userid, //当前账号id
  860. pid: this.selectInp.filter, //筛选
  861. did: this.selectInp.department, //部门
  862. tid: this.selectInp.sort, //分类
  863. leader: this.selectInp.leader, //负责人
  864. endState: this.selectInp.state,
  865. year: this.selectInp.year, //年份
  866. textInp: this.selectText,
  867. page: this.table.currentPage, //当前页
  868. lim: this.table.packageSize, //限制获取几条数据
  869. };
  870. // console.log(param);
  871. this.ajax
  872. .get(this.$store.state.api + "/SelectAllProjectManagement", param)
  873. .then(
  874. (res) => {
  875. let data = res.data;
  876. // console.log(data)
  877. if (
  878. data[0].length == 0 &&
  879. data[5][0]["total"] != 0 &&
  880. this.table.currentPage != 1
  881. ) {
  882. this.table.currentPage = 1;
  883. return this.getData();
  884. }
  885. let a = this.options;
  886. this.items = data[0];
  887. a.projectFilter = data[1];
  888. a.department = data[2];
  889. a.sort = data[3];
  890. a.person = data[4];
  891. a.yearData = data[6];
  892. if (
  893. a.yearData.filter(
  894. (item) => item["time"] == new Date().getFullYear().toString()
  895. ).length == 0
  896. ) {
  897. a.yearData.push({ time: new Date().getFullYear().toString() });
  898. }
  899. this.table.total = data[5][0].total;
  900. this.loading = false;
  901. },
  902. (err) => {
  903. console.log(err);
  904. }
  905. );
  906. },
  907. jump(id){
  908. window.open(`/Closingstatement1?iid=${id}`);
  909. },
  910. getWord() {
  911. // let tableBox = this.$refs.finalClo.$refs.tableBox;
  912. // let tableBox2 = this.$refs.finalClo.$refs.tableBox2;
  913. // // let tableInnerHtml = "";
  914. // let tableInnerHtml2 = "";
  915. // let div = document.createElement("div");
  916. // div.className = "divCss";
  917. // let table = document.createElement("table");
  918. // table.className = "tableCss";
  919. // table.border = "1";
  920. // table.setAttribute('cellspacing', '0');
  921. // div.appendChild(table)
  922. // let num = 0;
  923. // for (var i = 0; i < tableBox.children.length; i++) {
  924. // let child = tableBox.children[i];
  925. // let childHeight = child.offsetHeight;
  926. // if (childHeight < 1500 && num + childHeight < 1500) {
  927. // // tableInnerHtml2 += child.innerHTML;
  928. // table.appendChild(child.cloneNode(true));
  929. // num += childHeight;
  930. // } else if (childHeight < 1800 && num + childHeight > 1800) {
  931. // num = childHeight;
  932. // tableBox2.appendChild(div);
  933. // div = document.createElement("div");
  934. // div.className = "divCss";
  935. // table = document.createElement("table");
  936. // table.className = "tableCss";
  937. // table.border = "1";
  938. // table.setAttribute('cellspacing', '0');
  939. // div.appendChild(table)
  940. // table.appendChild(child.cloneNode(true));
  941. // } else if (childHeight > 1800) {
  942. // num = childHeight;
  943. // tableBox2.appendChild(div);
  944. // div = document.createElement("div");
  945. // div.className = "divCss";
  946. // table = document.createElement("table");
  947. // table.className = "tableCss";
  948. // table.border = "1";
  949. // table.setAttribute('cellspacing', '0');
  950. // div.appendChild(table)
  951. // table.appendChild(child.cloneNode(true));
  952. // } else {
  953. // num = childHeight;
  954. // tableBox2.appendChild(div);
  955. // div = document.createElement("div");
  956. // div.className = "divCss";
  957. // table = document.createElement("table");
  958. // table.className = "tableCss";
  959. // table.border = "1";
  960. // table.setAttribute('cellspacing', '0');
  961. // div.appendChild(table)
  962. // table.appendChild(child.cloneNode(true));
  963. // }
  964. // }
  965. // tableBox2.innerHTML = tableInnerHtml;
  966. this.isDownPdf = true;
  967. this.$forceUpdate();
  968. setTimeout(() => {
  969. downloadPDF(
  970. this.$refs.finalClo.$refs.downPDF,
  971. this.myArrayProp[0].title + "申报书"
  972. );
  973. setTimeout(() => {
  974. this.isDownPdf = false;
  975. this.$forceUpdate();
  976. }, 500);
  977. }, 500);
  978. },
  979. },
  980. mounted() {
  981. this.getData(); //页面加载完成后自动获取渲染数据
  982. },
  983. };
  984. </script>
  985. <style lang="less">
  986. .ProjectManagement {
  987. // .pagination{
  988. // float: right;
  989. // margin: 0px 85px 10px;
  990. // }
  991. // .projectBlock{ //循环列表大框
  992. // width: 100%;
  993. // // height: 560px;
  994. // display: flex;
  995. // flex-wrap: wrap;
  996. // overflow:auto;
  997. // .classBlock{ //每个独立小框
  998. // flex-shrink: 0;
  999. // overflow: hidden;
  1000. // position: relative;
  1001. // margin-right: 20px;
  1002. // margin-bottom: 5px;
  1003. // width: 250px;
  1004. // height: 300px;
  1005. // background-color: rgb(255, 255, 255);
  1006. // // box-shadow: 1px 2px 3px #ccc;
  1007. // border: 1px solid #ccc;
  1008. // border-radius: 5px;
  1009. // display: flex;
  1010. // flex-direction: column;
  1011. // .projectBlockPosition{ //完成状态
  1012. // border-radius: 30px;
  1013. // position: absolute;
  1014. // top: 5px;
  1015. // left: 5px;
  1016. // width: 80px;
  1017. // height: 30px;
  1018. // display: flex;
  1019. // justify-content: center;
  1020. // align-items: center;
  1021. // background: #000;
  1022. // opacity: 0.7;
  1023. // font-size: 16px;
  1024. // color:#fff;
  1025. // // font-size: 14px;
  1026. // }
  1027. // img{
  1028. // width: 100%;
  1029. // height: 140px;
  1030. // object-fit: cover;
  1031. // }
  1032. // .classBlock1{ //中间栏
  1033. // margin-bottom: 10px;
  1034. // margin-top: 0px;
  1035. // box-sizing: border-box;
  1036. // padding: 0 5px;
  1037. // flex: 1;
  1038. // display: flex;
  1039. // flex-direction: column;
  1040. // justify-content: space-around;
  1041. // .classBlock2{ //项目名称
  1042. // margin-left: 5px;
  1043. // margin-bottom: 4px;
  1044. // margin-top: 4px;
  1045. // text-align: left;
  1046. // font-size: 16px;
  1047. // }
  1048. // .classBlock3{ //学校、姓名
  1049. // box-sizing: border-box;
  1050. // padding: 0 5px;
  1051. // font-size: 14px;
  1052. // width: 100%;
  1053. // // margin-top: 10px;
  1054. // display: flex;
  1055. // flex-wrap: wrap;
  1056. // color: #adacac;
  1057. // margin: 10px 0 0;
  1058. // }
  1059. // .classBlock4{ //博客、编号
  1060. // margin-top: 4px;
  1061. // }
  1062. // }
  1063. // .classBlockBtn{ //按钮栏
  1064. // box-sizing: border-box;
  1065. // padding:0 6px;
  1066. // display: flex;
  1067. // flex: 1;
  1068. // width: 100%;
  1069. // max-height: 40px;
  1070. // justify-content: space-around;
  1071. // align-items: center;
  1072. // background-color:#F5F4F4 ;
  1073. // span{
  1074. // font-size: 14px;
  1075. // color: black;
  1076. // transition: .1s;
  1077. // cursor: pointer;
  1078. // &:hover{
  1079. // color: #79a2ff;
  1080. // }
  1081. // }
  1082. // .bt1{
  1083. // width: 100px;
  1084. // height: 35px;
  1085. // font-size: 14px;
  1086. // }
  1087. // }
  1088. // }
  1089. // }
  1090. .endDialog {
  1091. //结项对话框的
  1092. .el-dialog__header {
  1093. display: flex;
  1094. justify-content: center;
  1095. box-sizing: border-box;
  1096. background: #32455b;
  1097. }
  1098. .el-dialog__title {
  1099. color: rgb(246, 247, 246);
  1100. display: flex;
  1101. font-size: 18px;
  1102. position: relative;
  1103. top: -2px;
  1104. justify-content: center;
  1105. }
  1106. .el-dialog {
  1107. width: 600px;
  1108. border-radius: 5px;
  1109. overflow: hidden;
  1110. }
  1111. .el-dialog__body {
  1112. box-sizing: border-box;
  1113. // padding: 30px 20px 0 20px;
  1114. padding: 0;
  1115. }
  1116. .deleteContent {
  1117. width: 100%;
  1118. font-size: 22px;
  1119. color: #000;
  1120. box-sizing: border-box;
  1121. // padding: 0 20px;
  1122. display: flex;
  1123. justify-content: center;
  1124. }
  1125. .deleteContent1 {
  1126. width: 100%;
  1127. text-align: left;
  1128. font-size: 18px;
  1129. font-weight: bold;
  1130. color: #000;
  1131. margin-top: 30px;
  1132. }
  1133. .download {
  1134. margin: 10px 0 20px;
  1135. width: 100%;
  1136. text-align: left;
  1137. font-size: 16px;
  1138. font-weight: bold;
  1139. color: #5391fd;
  1140. display: flex;
  1141. justify-content: space-between;
  1142. flex-wrap: wrap;
  1143. // background: #ccc;
  1144. }
  1145. .addDialogLogo {
  1146. width: 60px;
  1147. height: 30px;
  1148. display: flex;
  1149. justify-content: center;
  1150. line-height: 30px;
  1151. border-radius: 5px;
  1152. background: #f2f2f2;
  1153. position: absolute;
  1154. left: 20px;
  1155. top: 15px;
  1156. }
  1157. }
  1158. .endDialog1 {
  1159. .el-dialog__body {
  1160. display: flex;
  1161. flex-direction: column;
  1162. flex-wrap: nowrap;
  1163. align-items: flex-start;
  1164. }
  1165. }
  1166. .endDialogBlock {
  1167. //结项书弹框样式
  1168. .el-dialog__header {
  1169. display: flex;
  1170. justify-content: center;
  1171. box-sizing: border-box;
  1172. background: #32455b;
  1173. }
  1174. .el-dialog__title {
  1175. color: rgb(246, 247, 246);
  1176. display: flex;
  1177. font-size: 18px;
  1178. position: relative;
  1179. top: -2px;
  1180. justify-content: center;
  1181. }
  1182. .el-dialog {
  1183. width: 1300px;
  1184. border-radius: 5px;
  1185. overflow: hidden;
  1186. }
  1187. .el-dialog__body {
  1188. box-sizing: border-box;
  1189. // padding: 30px 20px 0 20px;
  1190. padding: 0;
  1191. }
  1192. .addDialogLogo {
  1193. width: 60px;
  1194. height: 30px;
  1195. display: flex;
  1196. justify-content: center;
  1197. line-height: 30px;
  1198. border-radius: 5px;
  1199. background: #f2f2f2;
  1200. position: absolute;
  1201. left: 20px;
  1202. top: 15px;
  1203. }
  1204. }
  1205. }
  1206. .checkActivity {
  1207. // float:left;
  1208. display: flex;
  1209. justify-content: flex-start !important;
  1210. span {
  1211. margin: 10px 20px;
  1212. }
  1213. }
  1214. </style>