ProjectManagement.vue 36 KB

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