ProjectManagement.vue 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220
  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. </div>
  275. </template>
  276. </el-table-column>
  277. </el-table>
  278. </div>
  279. <!-- 表格结束 -->
  280. <!-- 提示哪些活动没有完成开始 -->
  281. <el-dialog
  282. title="提示"
  283. :visible.sync="NoReportActivity"
  284. width="600px"
  285. class="endDialog"
  286. >
  287. <div class="deleteContent">"{{ tit }}"项目</div>
  288. <div
  289. class="download checkActivity"
  290. v-show="checkActivityFinishData.length > 0"
  291. >
  292. <span style="color: black">未完结活动:</span
  293. ><span v-for="(item, index) in checkActivityFinishData" :key="index">{{
  294. item.title
  295. }}</span>
  296. </div>
  297. <div
  298. class="download checkActivity"
  299. v-show="checkFundFinishData.length > 0"
  300. >
  301. <span style="color: black">未完结资金:</span>
  302. <span
  303. style="cursor: pointer"
  304. @click="fundDetail(item.id, item.title, item.pid)"
  305. v-for="(item, index) in checkFundFinishData"
  306. :key="index"
  307. >{{ item.title }}/{{ item.applyfund - item.actualuse }}(元)</span
  308. >
  309. </div>
  310. <div
  311. slot="footer"
  312. class="dialog-footer"
  313. style="display: flex; justify-content: center"
  314. >
  315. <!-- <el-button type="primary" @click="init" class="AllDialogBtn">确认</el-button> -->
  316. <el-button @click="NoReportActivity = false" class="AllDialogBtn"
  317. >取消</el-button
  318. >
  319. </div>
  320. </el-dialog>
  321. <!-- 提示哪些活动没有完成结束 -->
  322. <!-- 分配项目给老师 -->
  323. <el-dialog
  324. title="提示"
  325. :visible.sync="shareDialog"
  326. width="600px"
  327. class="endDialog1"
  328. >
  329. <div>
  330. <el-select v-model="project" placeholder="请选择项目">
  331. <el-option
  332. v-for="item in allProject"
  333. :key="item.courseId"
  334. :label="item.title"
  335. :value="item.courseId"
  336. ></el-option>
  337. </el-select>
  338. </div>
  339. <el-input
  340. style="width: 50%; margin: 10px 0 0 0"
  341. v-model="un"
  342. @change="getPeople"
  343. placeholder="请输入姓名"
  344. ></el-input>
  345. <el-checkbox
  346. :indeterminate="isIndeterminate"
  347. v-model="checkAll"
  348. @change="handleCheckAllChange"
  349. style="padding: 15px 0 0 15px"
  350. >全选</el-checkbox
  351. >
  352. <el-checkbox-group
  353. v-loading="caseLoading"
  354. v-model="checkboxList"
  355. style="height: 400px; overflow: auto; padding: 0 0 0 15px"
  356. v-if="people.length"
  357. @change="handleCheckedAnliChange"
  358. >
  359. <el-checkbox
  360. v-for="item in people"
  361. :key="item.userid"
  362. :label="item.userid"
  363. >
  364. <div class="t_j_box">
  365. <el-tooltip
  366. placement="top"
  367. :content="item.username ? item.username : '暂无姓名'"
  368. >
  369. <span>{{ item.username ? item.username : "暂无姓名" }}</span>
  370. </el-tooltip>
  371. </div>
  372. </el-checkbox>
  373. </el-checkbox-group>
  374. <div
  375. slot="footer"
  376. class="dialog-footer"
  377. style="display: flex; justify-content: center"
  378. >
  379. <el-button
  380. type="primary"
  381. @click="setUseridInProject"
  382. class="AllDialogBtn"
  383. >确认</el-button
  384. >
  385. <el-button @click="shareDialog = false" class="AllDialogBtn"
  386. >取消</el-button
  387. >
  388. </div>
  389. </el-dialog>
  390. <!-- 结项书开始 -->
  391. <el-dialog title="结项书" :visible.sync="endDialog" class="endDialogBlock">
  392. <!-- <div class="deleteContent">"{{ tit }}"项目,是否确定完结?</div>
  393. <div class="download checkActivity" v-show="checkFundEndData.length>0">
  394. <span style="color: black;">剩余资金:</span>
  395. </div>
  396. <div class="deleteContent1">活动完结报告</div>
  397. <div class="download" v-for="item in file" :key="item.fid">
  398. <span>{{ item.fileName }}</span>
  399. <div class="downloadBtn">
  400. <el-button type="primary" @click="checkDelFile(item.url)" size="mini">删除文件</el-button>
  401. </div>
  402. </div>
  403. <el-progress v-show="progress.show" :percentage="progress.value" :format="ProgressFormat"></el-progress>
  404. <div class="addMoneyBtn" style="margin-left: 0;">
  405. <div class="jia">+</div>添加
  406. <div id="upFile">
  407. <beUpload @getFile="getFile" :navName="'上传文件'" :accept="accept" :progress="progress"> </beUpload>
  408. </div>
  409. </div> -->
  410. <Closingstatement
  411. ref="finalClo"
  412. :myArrayProp="myArrayProp"
  413. :iid="iid"
  414. :isDownPdf="isDownPdf"
  415. ></Closingstatement>
  416. <div
  417. slot="footer"
  418. class="dialog-footer"
  419. style="display: flex; justify-content: center"
  420. >
  421. <el-button type="primary" @click="ending" class="AllDialogBtn"
  422. >确认</el-button
  423. >
  424. <el-button type="primary" @click="getWord" class="AllDialogBtn"
  425. >下载表格</el-button
  426. >
  427. <el-button @click="endDialog = false" class="AllDialogBtn"
  428. >取消</el-button
  429. >
  430. </div>
  431. </el-dialog>
  432. <!-- 结项书结束 -->
  433. <!-- 分页 -->
  434. <el-pagination
  435. @current-change="handleCurrentChange"
  436. :current-page="table.currentPage"
  437. :page-size="table.packageSize"
  438. layout=" prev, pager, next"
  439. background
  440. class="paginations"
  441. :total="table.total"
  442. >
  443. </el-pagination>
  444. <!-- 分页结束 -->
  445. </div>
  446. </template>
  447. <script>
  448. import beUpload from "../../components/tool/beUpload";
  449. import Closingstatement from "./components/Closingstatement.vue";
  450. //下载pdf
  451. import { downloadPDF } from "@/components/tool/pdf";
  452. export default {
  453. components: { beUpload, Closingstatement },
  454. data() {
  455. return {
  456. isDownPdf: false,
  457. accept: "*",
  458. iid: "",
  459. selectText: "", //文字搜素框数据
  460. endDialog: false,
  461. DelFileDialog: false,
  462. NoReportActivity: false,
  463. loading: false,
  464. tit: "", //完结框项目名称
  465. items: [], //项目列表数据
  466. allProject: [],
  467. table: {
  468. // 分页数据
  469. total: 0,
  470. packageSize: 10,
  471. currentPage: 1,
  472. },
  473. progress: {
  474. //进度条
  475. value: 0,
  476. show: false,
  477. },
  478. DelFileData: {
  479. fid: "",
  480. fileName: "",
  481. },
  482. options: {
  483. //头部搜索框下拉框数据
  484. projectFilter: [], //项目筛选
  485. department: [], //部门
  486. sort: [], //分类
  487. person: [], //负责人
  488. state: [
  489. //状态
  490. {
  491. value: "",
  492. label: "全部",
  493. },
  494. {
  495. value: 2,
  496. label: "进行中",
  497. },
  498. {
  499. value: 3,
  500. label: "待结题",
  501. },
  502. {
  503. value: 4,
  504. label: "已结题",
  505. },
  506. ],
  507. yearData: [],
  508. },
  509. selectInp: {
  510. //select选定所显示的值
  511. filter: "", //不要带引号,select框是根据id来选择下面数据的
  512. department: "",
  513. sort: "",
  514. state: "",
  515. leader: "",
  516. year: new Date().getFullYear().toString(),
  517. },
  518. file: [],
  519. checkActivityFinishData: [], //未完成活动
  520. checkFundFinishData: [], //未完成资金
  521. // checkFundEndData:[],
  522. submitData: {
  523. //结项书要填写的数据
  524. brief: "",
  525. plan: "",
  526. technology: "",
  527. business: "",
  528. innovate: "",
  529. resultAccessory: [],
  530. firmAccessory: [],
  531. competitionAccessory: [],
  532. exchangeAccessory: [],
  533. conversionAccessory: [],
  534. talentsAccessory: [],
  535. targetPlan: "",
  536. realityResult: "",
  537. socialValue: "",
  538. taskAccessory: [],
  539. },
  540. myArrayProp: [], //结项书-后端获取的数据
  541. shareDialog: false,
  542. project: "",
  543. caseLoading: false,
  544. checkboxList: [],
  545. checkboxIdList: [],
  546. people: [],
  547. isIndeterminate: false,
  548. checkAll: false,
  549. un: "",
  550. // amendFinishArrayProp:[] //结项书-后端获取的修改结项数据
  551. };
  552. },
  553. methods: {
  554. handleCheckAllChange(val) {
  555. if (this.checkboxIdList.length == 0) {
  556. for (var i = 0; i < this.people.length; i++) {
  557. this.checkboxIdList.push(this.people[i].userid);
  558. }
  559. }
  560. this.checkboxList = val ? this.checkboxIdList : [];
  561. this.isIndeterminate = false;
  562. },
  563. handleCheckedAnliChange(value) {
  564. let checkedCount = this.checkboxList.length;
  565. this.checkAll = checkedCount === this.people.length;
  566. this.isIndeterminate =
  567. checkedCount > 0 && checkedCount < this.people.length;
  568. },
  569. fundDetail(val, tit, pid) {
  570. //跳转到未完结资金那里去
  571. // console.log(val);
  572. // window.open(`/#/makerfundDetails?Id=${val}`)
  573. this.$router.push(`/makerfundDetails?Id=${val}&tit=${tit}&paid=${pid}`);
  574. },
  575. ProgressFormat(value) {
  576. //进度条
  577. return value == 100 ? "100%" : `${value}%`;
  578. },
  579. checkDelFile(url) {
  580. //删除文件
  581. this.file = this.file.filter((item) => item.url != url);
  582. },
  583. getFile(val) {
  584. //上传文件
  585. this.file.push(val);
  586. // console.log(this.file);
  587. this.progress.show = false;
  588. },
  589. ending() {
  590. //结项书提交
  591. // return console.log(this.myArrayProp[0]);
  592. this.ajax
  593. .post(this.$store.state.api + "/updateClosingstatementData", {
  594. uid: this.$store.state.userInfo.userid,
  595. cid: this.iid,
  596. submitData: JSON.stringify(
  597. this.myArrayProp[0]["ClosingstatementData"]
  598. ),
  599. state: 3,
  600. })
  601. .then(
  602. (res) => {
  603. console.log(res);
  604. if (res.data == 1) {
  605. this.$message.success("提交成功");
  606. this.endDialog = false;
  607. this.progress.show = false;
  608. } else {
  609. this.$message.error("提交失败");
  610. }
  611. this.getData();
  612. },
  613. (err) => {
  614. console.log(err);
  615. }
  616. );
  617. this.endDialog = false;
  618. },
  619. scheduleDetail(val, tid) {
  620. //进度详情
  621. this.$router.push(`/ProjectManagementMain?Id=${tid}&pid=${val}`);
  622. },
  623. fundStatus(Id) {
  624. //资金情况
  625. // localStorage.setItem('pid',JSON.stringify(Id))
  626. this.$router.push(`/ProjectManagementFundDetail?pid=${Id}`);
  627. },
  628. finish(val) {
  629. this.myArrayProp = [];
  630. //结项对话框显示
  631. this.iid = val.courseId; // 提交结项时候的用
  632. this.checkActivityFinishData = []; //未完成项目
  633. this.checkFundFinishData = []; //未完成资金
  634. // this.checkFundEndData=[];
  635. this.ajax
  636. .get(this.$store.state.api + "/GetActivityNoReportByPId", {
  637. uid: this.$store.state.userInfo.userid,
  638. pid: val.courseId,
  639. })
  640. .then((res) => {
  641. if (res.data[0].length > 0 || res.data[1].length > 0) {
  642. this.checkActivityFinishData = res.data[0];
  643. if (res.data[1].length > 0) {
  644. let acsum = 0;
  645. let apsum = 0;
  646. res.data[1].forEach((e) => {
  647. e.applyfund = JSON.parse(e.applyfund);
  648. for (let k in e.applyfund) {
  649. acsum += e.applyfund[k] * 1;
  650. }
  651. e.applyfund = acsum;
  652. });
  653. res.data[1].forEach((e) => {
  654. if (e.actualuse != null) {
  655. e.actualuse = JSON.parse(e.actualuse);
  656. for (let k in e.actualuse) {
  657. apsum += e.actualuse[k] * 1;
  658. }
  659. e.actualuse = apsum;
  660. }
  661. });
  662. }
  663. this.checkFundFinishData = res.data[1];
  664. this.tit = val.title;
  665. this.NoReportActivity = true;
  666. } else {
  667. // this.myArrayProp=[]
  668. this.iid = val.courseId;
  669. //提交结项书版本
  670. this.ajax
  671. .get(this.$store.state.api + "/getClosingstatementData", {
  672. uid: this.$store.state.userInfo.userid,
  673. pid: val.courseId,
  674. })
  675. .then((res) => {
  676. let num = 0;
  677. res.data[1].forEach((i) => {
  678. //计算出已经使用过的金钱
  679. // console.log(i);
  680. i["actualuse"] = JSON.parse(i["actualuse"]);
  681. for (let key in i["actualuse"]) {
  682. if (i["actualuse"][key]) {
  683. num = i["actualuse"][key] * 1 + num;
  684. }
  685. }
  686. });
  687. console.log(num);
  688. let data = res.data[0];
  689. data[0].course_student = JSON.parse(data[0].course_student);
  690. data[0].course_teacher = JSON.parse(data[0].course_teacher);
  691. if (data[0].multiSelectProject != null) {
  692. data[0].multiSelectProject = JSON.parse(
  693. data[0].multiSelectProject
  694. );
  695. }
  696. data[0].money = JSON.parse(data[0].money);
  697. data[0].ClosingstatementData = data[0].ClosingstatementData
  698. ? JSON.parse(data[0].ClosingstatementData)
  699. : this.submitData;
  700. this.myArrayProp = data;
  701. this.myArrayProp[0].actualuse = num; //添加已经使用过的经费
  702. console.log(this.myArrayProp);
  703. this.endDialog = true;
  704. })
  705. .catch((err) => {
  706. console.log(err);
  707. });
  708. }
  709. })
  710. .catch((err) => {
  711. console.log(err);
  712. });
  713. },
  714. amendFinish(val) {
  715. //修改结项按钮(获取结项时提交的文件)
  716. //#region 上传文件版本结项
  717. // this.checkFundEndData=[];
  718. // this.ajax.post(this.$store.state.api+"/UpdateAmendFinish",{
  719. // uid:this.$store.state.userInfo.userid,
  720. // pid:val
  721. // }).then(res=>{
  722. // console.log(res);
  723. // console.log(res.data);
  724. // if (res.data[0].length>0) {
  725. // let data=JSON.parse(res.data[0][0].endFile)
  726. // this.file=data;
  727. // }
  728. // // let data=JSON.parse(res.data[0][0].endFile)
  729. // this.tit=tit;
  730. // this.endDialog=true;
  731. // this.ClosingstatementData=val
  732. // // console.log(this.file);
  733. // }).catch(err=>{
  734. // console.log(err)
  735. // })
  736. //#endregion
  737. this.myArrayProp = [];
  738. this.submitData = {
  739. brief: "",
  740. plan: "",
  741. technology: "",
  742. business: "",
  743. innovate: "",
  744. resultAccessory: [],
  745. firmAccessory: [],
  746. competitionAccessory: [],
  747. exchangeAccessory: [],
  748. conversionAccessory: [],
  749. talentsAccessory: [],
  750. targetPlan: "",
  751. realityResult: "",
  752. socialValue: "",
  753. taskAccessory: [],
  754. };
  755. this.iid = val.courseId;
  756. //
  757. this.ajax
  758. .get(this.$store.state.api + "/selectAmendFinish", {
  759. uid: this.$store.state.userInfo.userid,
  760. pid: val.courseId,
  761. })
  762. .then((res) => {
  763. // return console.log(res);
  764. let num = 0;
  765. res.data[1].forEach((i) => {
  766. //计算出已经使用过的金钱
  767. // console.log(i);
  768. i["actualuse"] = JSON.parse(i["actualuse"]);
  769. for (let key in i["actualuse"]) {
  770. if (i["actualuse"][key]) {
  771. num = i["actualuse"][key] * 1 + num;
  772. }
  773. }
  774. });
  775. console.log(num);
  776. let data = res.data[0];
  777. data[0].course_student = JSON.parse(data[0].course_student);
  778. data[0].course_teacher = JSON.parse(data[0].course_teacher);
  779. data[0].multiSelectProject = JSON.parse(data[0].multiSelectProject);
  780. data[0].ClosingstatementData = JSON.parse(
  781. data[0].ClosingstatementData
  782. );
  783. data[0].money = JSON.parse(data[0].money);
  784. // data[0].multiSelectProject=JSON.parse(data[0].multiSelectProject)
  785. this.myArrayProp = data;
  786. this.myArrayProp[0].actualuse = num; //添加已经使用过的经费
  787. console.log(this.myArrayProp);
  788. this.endDialog = true;
  789. })
  790. .catch((err) => {
  791. console.log(err);
  792. });
  793. },
  794. handleCurrentChange(val) {
  795. //当页数发生改变的时候调用获取列表数据请求
  796. // console.log(`当前页: ${val}`);
  797. this.table.currentPage = val;
  798. this.getData();
  799. },
  800. openShare() {
  801. this.shareDialog = true;
  802. this.getPeople();
  803. this.getAllProject();
  804. },
  805. getPeople() {
  806. this.caseLoading = true;
  807. this.ajax
  808. .post(this.$store.state.api + "/selectAllUser", {
  809. n: this.un,
  810. })
  811. .then(
  812. (res) => {
  813. this.people = res.data[0];
  814. this.caseLoading = false;
  815. },
  816. (err) => {
  817. this.caseLoading = false;
  818. console.log(err);
  819. }
  820. );
  821. },
  822. setUseridInProject() {
  823. this.ajax
  824. .post(this.$store.state.api + "/updateProjectLookTeacher", {
  825. cid: this.project,
  826. look: this.checkboxList.join(","),
  827. })
  828. .then(
  829. (res) => {
  830. this.$message.success("分配成功");
  831. this.shareDialog = false;
  832. },
  833. (err) => {
  834. console.log(err);
  835. }
  836. );
  837. },
  838. getAllProject() {
  839. this.ajax.get(this.$store.state.api + "/selectAllProjectByAdmin").then(
  840. (res) => {
  841. this.allProject = res.data[0];
  842. },
  843. (err) => {
  844. console.log(err);
  845. }
  846. );
  847. },
  848. getData() {
  849. //获取渲染数据
  850. this.loading = true;
  851. let param = {
  852. uid: this.$store.state.userInfo.userid, //当前账号id
  853. pid: this.selectInp.filter, //筛选
  854. did: this.selectInp.department, //部门
  855. tid: this.selectInp.sort, //分类
  856. leader: this.selectInp.leader, //负责人
  857. endState: this.selectInp.state,
  858. year: this.selectInp.year, //年份
  859. textInp: this.selectText,
  860. page: this.table.currentPage, //当前页
  861. lim: this.table.packageSize, //限制获取几条数据
  862. };
  863. // console.log(param);
  864. this.ajax
  865. .get(this.$store.state.api + "/SelectAllProjectManagement", param)
  866. .then(
  867. (res) => {
  868. let data = res.data;
  869. // console.log(data)
  870. if (
  871. data[0].length == 0 &&
  872. data[5][0]["total"] != 0 &&
  873. this.table.currentPage != 1
  874. ) {
  875. this.table.currentPage = 1;
  876. return this.getData();
  877. }
  878. let a = this.options;
  879. this.items = data[0];
  880. a.projectFilter = data[1];
  881. a.department = data[2];
  882. a.sort = data[3];
  883. a.person = data[4];
  884. a.yearData = data[6];
  885. if (
  886. a.yearData.filter(
  887. (item) => item["time"] == new Date().getFullYear().toString()
  888. ).length == 0
  889. ) {
  890. a.yearData.push({ time: new Date().getFullYear().toString() });
  891. }
  892. this.table.total = data[5][0].total;
  893. this.loading = false;
  894. },
  895. (err) => {
  896. console.log(err);
  897. }
  898. );
  899. },
  900. getWord() {
  901. this.isDownPdf = true;
  902. this.$forceUpdate();
  903. setTimeout(() => {
  904. downloadPDF(
  905. this.$refs.finalClo.$refs.downPDF,
  906. this.myArrayProp[0].title + "申报书"
  907. );
  908. setTimeout(() => {
  909. this.isDownPdf = false;
  910. this.$forceUpdate();
  911. }, 500);
  912. }, 500);
  913. // const content = this.$refs.finalClo.$refs.downPDF;
  914. // const contentWidth = content.offsetWidth;
  915. // const contentHeight = content.offsetHeight;
  916. // const pdf = new jsPDF("p", "px", [contentWidth, contentHeight]);
  917. // let position = 0;
  918. // const imgWidth = pdf.internal.pageSize.getWidth();
  919. // const imgHeight = pdf.internal.pageSize.getHeight();
  920. // const canvas = await html2canvas(content, {
  921. // scrollY: -window.scrollY,
  922. // windowWidth: document.documentElement.offsetWidth,
  923. // });
  924. // const imgData = canvas.toDataURL("image/png");
  925. // pdf.addImage(imgData, "PNG", 0, position, imgWidth, imgHeight);
  926. // position -= imgHeight;
  927. // while (position > -contentHeight) {
  928. // pdf.addPage();
  929. // pdf.addImage(imgData, "PNG", 0, position, imgWidth, imgHeight);
  930. // position -= imgHeight;
  931. // }
  932. // pdf.save("exported.pdf");
  933. },
  934. },
  935. mounted() {
  936. this.getData(); //页面加载完成后自动获取渲染数据
  937. },
  938. };
  939. </script>
  940. <style lang="less">
  941. .ProjectManagement {
  942. // .pagination{
  943. // float: right;
  944. // margin: 0px 85px 10px;
  945. // }
  946. // .projectBlock{ //循环列表大框
  947. // width: 100%;
  948. // // height: 560px;
  949. // display: flex;
  950. // flex-wrap: wrap;
  951. // overflow:auto;
  952. // .classBlock{ //每个独立小框
  953. // flex-shrink: 0;
  954. // overflow: hidden;
  955. // position: relative;
  956. // margin-right: 20px;
  957. // margin-bottom: 5px;
  958. // width: 250px;
  959. // height: 300px;
  960. // background-color: rgb(255, 255, 255);
  961. // // box-shadow: 1px 2px 3px #ccc;
  962. // border: 1px solid #ccc;
  963. // border-radius: 5px;
  964. // display: flex;
  965. // flex-direction: column;
  966. // .projectBlockPosition{ //完成状态
  967. // border-radius: 30px;
  968. // position: absolute;
  969. // top: 5px;
  970. // left: 5px;
  971. // width: 80px;
  972. // height: 30px;
  973. // display: flex;
  974. // justify-content: center;
  975. // align-items: center;
  976. // background: #000;
  977. // opacity: 0.7;
  978. // font-size: 16px;
  979. // color:#fff;
  980. // // font-size: 14px;
  981. // }
  982. // img{
  983. // width: 100%;
  984. // height: 140px;
  985. // object-fit: cover;
  986. // }
  987. // .classBlock1{ //中间栏
  988. // margin-bottom: 10px;
  989. // margin-top: 0px;
  990. // box-sizing: border-box;
  991. // padding: 0 5px;
  992. // flex: 1;
  993. // display: flex;
  994. // flex-direction: column;
  995. // justify-content: space-around;
  996. // .classBlock2{ //项目名称
  997. // margin-left: 5px;
  998. // margin-bottom: 4px;
  999. // margin-top: 4px;
  1000. // text-align: left;
  1001. // font-size: 16px;
  1002. // }
  1003. // .classBlock3{ //学校、姓名
  1004. // box-sizing: border-box;
  1005. // padding: 0 5px;
  1006. // font-size: 14px;
  1007. // width: 100%;
  1008. // // margin-top: 10px;
  1009. // display: flex;
  1010. // flex-wrap: wrap;
  1011. // color: #adacac;
  1012. // margin: 10px 0 0;
  1013. // }
  1014. // .classBlock4{ //博客、编号
  1015. // margin-top: 4px;
  1016. // }
  1017. // }
  1018. // .classBlockBtn{ //按钮栏
  1019. // box-sizing: border-box;
  1020. // padding:0 6px;
  1021. // display: flex;
  1022. // flex: 1;
  1023. // width: 100%;
  1024. // max-height: 40px;
  1025. // justify-content: space-around;
  1026. // align-items: center;
  1027. // background-color:#F5F4F4 ;
  1028. // span{
  1029. // font-size: 14px;
  1030. // color: black;
  1031. // transition: .1s;
  1032. // cursor: pointer;
  1033. // &:hover{
  1034. // color: #79a2ff;
  1035. // }
  1036. // }
  1037. // .bt1{
  1038. // width: 100px;
  1039. // height: 35px;
  1040. // font-size: 14px;
  1041. // }
  1042. // }
  1043. // }
  1044. // }
  1045. .endDialog {
  1046. //结项对话框的
  1047. .el-dialog__header {
  1048. display: flex;
  1049. justify-content: center;
  1050. box-sizing: border-box;
  1051. background: #32455b;
  1052. }
  1053. .el-dialog__title {
  1054. color: rgb(246, 247, 246);
  1055. display: flex;
  1056. font-size: 18px;
  1057. position: relative;
  1058. top: -2px;
  1059. justify-content: center;
  1060. }
  1061. .el-dialog {
  1062. width: 600px;
  1063. border-radius: 5px;
  1064. overflow: hidden;
  1065. }
  1066. .el-dialog__body {
  1067. box-sizing: border-box;
  1068. padding: 30px 20px 0 20px;
  1069. }
  1070. .deleteContent {
  1071. width: 100%;
  1072. font-size: 22px;
  1073. color: #000;
  1074. box-sizing: border-box;
  1075. // padding: 0 20px;
  1076. display: flex;
  1077. justify-content: center;
  1078. }
  1079. .deleteContent1 {
  1080. width: 100%;
  1081. text-align: left;
  1082. font-size: 18px;
  1083. font-weight: bold;
  1084. color: #000;
  1085. margin-top: 30px;
  1086. }
  1087. .download {
  1088. margin: 10px 0 20px;
  1089. width: 100%;
  1090. text-align: left;
  1091. font-size: 16px;
  1092. font-weight: bold;
  1093. color: #5391fd;
  1094. display: flex;
  1095. justify-content: space-between;
  1096. flex-wrap: wrap;
  1097. // background: #ccc;
  1098. }
  1099. .addDialogLogo {
  1100. width: 60px;
  1101. height: 30px;
  1102. display: flex;
  1103. justify-content: center;
  1104. line-height: 30px;
  1105. border-radius: 5px;
  1106. background: #f2f2f2;
  1107. position: absolute;
  1108. left: 20px;
  1109. top: 15px;
  1110. }
  1111. }
  1112. .endDialog1 {
  1113. .el-dialog__body {
  1114. display: flex;
  1115. flex-direction: column;
  1116. flex-wrap: nowrap;
  1117. align-items: flex-start;
  1118. }
  1119. }
  1120. .endDialogBlock {
  1121. //结项书弹框样式
  1122. .el-dialog__header {
  1123. display: flex;
  1124. justify-content: center;
  1125. box-sizing: border-box;
  1126. background: #32455b;
  1127. }
  1128. .el-dialog__title {
  1129. color: rgb(246, 247, 246);
  1130. display: flex;
  1131. font-size: 18px;
  1132. position: relative;
  1133. top: -2px;
  1134. justify-content: center;
  1135. }
  1136. .el-dialog {
  1137. width: 1300px;
  1138. border-radius: 5px;
  1139. overflow: hidden;
  1140. }
  1141. .el-dialog__body {
  1142. box-sizing: border-box;
  1143. padding: 30px 20px 0 20px;
  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. }
  1159. .checkActivity {
  1160. // float:left;
  1161. display: flex;
  1162. justify-content: flex-start !important;
  1163. span {
  1164. margin: 10px 20px;
  1165. }
  1166. }
  1167. </style>