makerActvity.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  1. <template>
  2. <!--创客活动 -->
  3. <div class="makerActvity">
  4. <div class="pAHeader">
  5. <div class="pAHeader1">创客活动</div>
  6. <el-button @click="makerActvityApply">创客活动申请</el-button>
  7. </div>
  8. <hr>
  9. <!-- 搜索框开始 -->
  10. <div class="selects">
  11. <div class="selectsBlock">
  12. <div class="selectLabel">项目筛选</div>
  13. <el-select v-model="pavalues.value" @change="getData" placeholder="请选择">
  14. <el-option label="所有项目" :value="0"/>
  15. <el-option
  16. v-for="item in options"
  17. :key="item.courseId"
  18. :label="item.title"
  19. :value="item.courseId">
  20. </el-option>
  21. </el-select>
  22. </div>
  23. <div class="selectsBlock">
  24. <div class="selectLabel">所在部门</div>
  25. <el-select v-model="pavalues.value1" @change="getData" placeholder="请选择">
  26. <el-option label="所有部门" :value="0"/>
  27. <el-option
  28. v-for="item in options1"
  29. :key="item.id"
  30. :label="item.name"
  31. :value="item.id">
  32. </el-option>
  33. </el-select>
  34. </div>
  35. <div class="selectsBlock">
  36. <div class="selectLabel">负责人</div>
  37. <el-select v-model="pavalues.value2" @change="getData" placeholder="请选择">
  38. <el-option label="所有负责人" value=""></el-option>
  39. <el-option
  40. v-for="item in options2"
  41. :key="item.pro_leader"
  42. :label="item.pro_leader"
  43. :value="item.pro_leader">
  44. </el-option>
  45. </el-select>
  46. </div>
  47. <div class="selectsBlock">
  48. <div class="selectLabel">状态</div>
  49. <el-select v-model="pavalues.value3" @change="getData" placeholder="请选择">
  50. <el-option label="所有状态" :value="99"/>
  51. <el-option label="未报销" :value="0"/>
  52. <el-option label="已报销" :value="1"/>
  53. </el-select>
  54. </div>
  55. </div>
  56. <!-- 搜索框结束 -->
  57. <!-- 表格开始 -->
  58. <el-table
  59. ref="multipleTable"
  60. :data="tableData"
  61. tooltip-effect="dark"
  62. stripe
  63. class="fontSize core_dialogue"
  64. style="height:65%;overflow: auto;"
  65. :header-cell-style="{ background: '#f2f2f2',color:'#000' }"
  66. >
  67. <el-table-column
  68. prop="title"
  69. label="活动名称"
  70. align="center"
  71. min-width="10%">
  72. </el-table-column>
  73. <el-table-column
  74. prop="pro_leader"
  75. label="负责人"
  76. align="center"
  77. min-width="7%">
  78. </el-table-column>
  79. <el-table-column
  80. prop="PName"
  81. align="center"
  82. label="关联项目"
  83. min-width="9%">
  84. </el-table-column>
  85. <el-table-column
  86. prop="money"
  87. align="center"
  88. label="预算经费(元)"
  89. min-width="8%">
  90. </el-table-column>
  91. <!-- <el-table-column
  92. prop="useBudget"
  93. align="center"
  94. label="实际使用(元)"
  95. min-width="8%">
  96. </el-table-column> -->
  97. <el-table-column
  98. prop="name"
  99. align="center"
  100. label="所在部门"
  101. min-width="8%">
  102. </el-table-column>
  103. <el-table-column
  104. prop="state"
  105. label="状态"
  106. align="center"
  107. min-width="7%">
  108. <template #default="scope">
  109. <span v-if="scope.row.state==0">未报销</span>
  110. <span v-if="scope.row.state==1">已报销</span>
  111. </template>
  112. </el-table-column>
  113. <el-table-column
  114. prop="begin_at"
  115. align="center"
  116. label="活动时间"
  117. min-width="10%">
  118. <template #default="scope">
  119. {{ GetTime(scope.row.begin_at)}}
  120. </template>
  121. </el-table-column>
  122. <el-table-column
  123. prop="operation"
  124. width="350"
  125. align="center"
  126. label="操作"
  127. >
  128. <template #default="scope">
  129. <div class="operations">
  130. <!-- <el-button type="primary" > -->
  131. <el-button type="primary" @click="MADetails(scope.row.acId)" size="mini">查看详情</el-button>
  132. <el-button type="primary" v-if="scope.row.state==0" @click="audi(scope.row)" size="mini">审核</el-button>
  133. <el-button type="info" disabled v-if="scope.row.state==1" @click="audi(scope.row)" size="mini">审核</el-button>
  134. <el-button type="primary" size="mini" @click="edit(scope)">申请表</el-button>
  135. <el-button type="primary" v-if="scope.row.reportFile==''||scope.row.reportFile==null" size="mini" @click="end(scope.row)" >完结</el-button>
  136. <el-button type="info" v-show="scope.row.reportFile!=''&&scope.row.reportFile!=null" size="mini" disabled>完结</el-button>
  137. <!-- </el-button> -->
  138. </div>
  139. </template>
  140. </el-table-column>
  141. </el-table>
  142. <!-- 表格结束 -->
  143. <!-- 活动审核对话框开始 -->
  144. <el-dialog
  145. title="活动审核"
  146. :visible.sync="auditDialog"
  147. class="dialogWidth"
  148. :before-close="init">
  149. <div class="diaTit">
  150. <div class="spans">项目名称:</div>
  151. <div class="spanCon">{{ processTable.name }}</div>
  152. <div class="spans" style="margin-left: 30px;">项目负责人:</div>
  153. <div class="spanCon">{{ processTable.leader }}</div>
  154. </div>
  155. <div class="diaTit1">
  156. <div class="spans1">所在部门</div>
  157. <div>
  158. <el-input disabled v-model="processTable.className"></el-input>
  159. </div>
  160. </div>
  161. <div class="diaTit1">
  162. <div class="spans1">预算总经费</div>
  163. <div>
  164. <el-input disabled v-model="processTable.money"></el-input>
  165. </div>
  166. </div>
  167. <div class="diaTit1">
  168. <div class="spans1">联系电话</div>
  169. <div>
  170. <el-input disabled v-model="processTable.phone"></el-input>
  171. </div>
  172. </div>
  173. <div slot="footer" class="dialog-footer">
  174. <el-button type="primary" @click="commit" class="diaBtn">确认提交</el-button>
  175. <el-button @click="init" class="diaBtn">取消</el-button>
  176. </div>
  177. </el-dialog>
  178. <!-- 活动审核对话框结束 -->
  179. <!-- 驳回提交对话框开始 -->
  180. <el-dialog
  181. title="驳回提交"
  182. :visible.sync="rejectDialog"
  183. class="dialogWidth"
  184. width="700px"
  185. :before-close="init">
  186. <div class="diaTit">
  187. <div class="spans">项目名称:</div>
  188. <div class="spanCon">{{ processTable.name }}</div>
  189. <div class="spans" style="margin-left: 30px;">项目负责人:</div>
  190. <div class="spanCon">{{ processTable.leader }}</div>
  191. </div>
  192. <div class="diaTit1">
  193. <div class="spans1">所在部门</div>
  194. <div>
  195. <el-input disabled v-model="processTable.className"></el-input>
  196. </div>
  197. </div>
  198. <div class="diaTit1">
  199. <div class="spans1">预算总经费</div>
  200. <div>
  201. <el-input disabled v-model="processTable.money"></el-input>
  202. </div>
  203. </div>
  204. <div class="diaTit1">
  205. <div class="spans1">联系电话</div>
  206. <div>
  207. <el-input disabled v-model="processTable.phone"></el-input>
  208. </div>
  209. </div>
  210. <div class="diaTit1">
  211. <div class="spans1" style="position: relative;top:-23px">撤回意见</div>
  212. <div>
  213. <el-input
  214. type="textarea"
  215. :rows="4"
  216. style="width:200px"
  217. resize="none"
  218. placeholder="请输入内容"
  219. v-model="textarea">
  220. </el-input>
  221. </div>
  222. </div>
  223. <div slot="footer" class="dialog-footer">
  224. <el-button type="primary" @click="commit2" class="diaBtn">确认提交</el-button>
  225. <el-button @click="init" class="diaBtn">取消</el-button>
  226. </div>
  227. </el-dialog>
  228. <!-- 驳回提交对话框结束 -->
  229. <!-- 完结对话框开始 -->
  230. <el-dialog
  231. title="提示"
  232. :visible.sync="endDialog"
  233. width="600px"
  234. class="endDialog"
  235. :before-close="cancelEndTableFile">
  236. <div class="addDialogLogo">LOGO</div>
  237. <div class="deleteContent">"{{ endTable.title }}"项目活动,是否确定完结?</div>
  238. <div class="deleteContent1">活动完结报告</div>
  239. <div class="download" v-for="item in endTable.file">
  240. <div>{{ item.fileName }}</div>
  241. <el-button type="primary" @click="delEndTableFile(item.fid)" size="mini">删除文件</el-button>
  242. </div>
  243. <div class="addMoneyBtn">
  244. <div class="jia">+</div>添加
  245. <div id="upFile">
  246. <beUpload @getFile="getFile" :navName="'上传文件'" :accept="accept"> </beUpload>
  247. </div>
  248. </div>
  249. <!-- <div class="DelBtn" style="margin-left: 0;" v-if="endTable.file!=''&&endTable.file!=null">
  250. <el-button type="primary" @click="endTable.file=''">删除文件</el-button>
  251. </div> -->
  252. <div slot="footer" class="dialog-footer">
  253. <el-button type="primary" @click="ending" class="diaBtn">确认提交</el-button>
  254. <el-button @click="cancelEndTableFile" class="diaBtn">取消</el-button>
  255. </div>
  256. </el-dialog>
  257. <!-- 完结对话框结束 -->
  258. <el-pagination
  259. @current-change="CurrentChange"
  260. :page-size="Page.lim"
  261. layout=" prev, pager, next"
  262. background
  263. class="pagination"
  264. :total="Page.total">
  265. </el-pagination>
  266. </div>
  267. </template>
  268. <script>
  269. import beUpload from '../../components/tool/beUpload'
  270. import { uuid } from 'vue-uuid';
  271. export default {
  272. components:{beUpload},
  273. data() {
  274. return {
  275. accept:".doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
  276. status:1,
  277. textarea:'',
  278. input:'',
  279. endDialog:false, //完结对话框
  280. auditDialog:false, //审核对话框
  281. rejectDialog:false, //驳回对话框
  282. options:[],
  283. options1:[],
  284. options2:[],
  285. // 表格数据
  286. tableData:[],
  287. // 四个下拉框数据
  288. pavalues:{
  289. value:0,//项目ID
  290. value1:0,//部门ID
  291. value2:'',//负责人
  292. value3:99,//状态
  293. },
  294. Page:{
  295. nowPage:1,
  296. total:10,
  297. lim:10
  298. },
  299. processTable:{
  300. Id:"",
  301. name:"",
  302. leader:"",
  303. className:"",
  304. money:"",
  305. phone:""
  306. },
  307. endTable:{
  308. Id:"",
  309. title:"",
  310. file:[],
  311. }
  312. }
  313. },
  314. methods:{
  315. getFile(val) {//上传文件
  316. val.fid = uuid.v1();
  317. this.endTable.file.push(val);
  318. },
  319. delEndTableFile(id){
  320. this.endTable.file = this.endTable.file.filter(item=>item.fid!=id);
  321. },
  322. cancelEndTableFile(){
  323. if(this.endTable.file.length>=1){
  324. this.$confirm('文件还未上传,确定取消吗?', '提示', {
  325. confirmButtonText: '确定',
  326. cancelButtonText: '取消',
  327. type: 'warning'
  328. }).then(() => {
  329. this.endDialog = false;
  330. })
  331. }else{
  332. this.endDialog = false;
  333. }
  334. },
  335. init(){//重置
  336. this.auditDialog=false;
  337. this.endDialog=false;
  338. this.rejectDialog=false;
  339. },
  340. commit(){ // 活动审核对话框确定
  341. this.ajax.post(this.$store.state.api+"/UpdateActivityState",{
  342. uid:this.$store.state.userInfo.userid,
  343. aid:this.processTable.Id,
  344. st:1,
  345. }).then(res=>{
  346. if(res.data==1){
  347. this.$message.success("审核成功");
  348. this.auditDialog = false;
  349. for(let i in this.processTable)this.processTable[i] = '';
  350. this.getData()
  351. }else{
  352. this.$message.error("审核失败")
  353. }
  354. this.getData();
  355. }).catch(err=>{
  356. this.$message.error(err.message)
  357. })
  358. },
  359. // 驳回对话框确定
  360. commit2(){
  361. this.rejectDialog=false;
  362. this.status++
  363. },
  364. end(val){//完结按钮
  365. this.endTable.title = val.title;
  366. this.endTable.Id = val.acId;
  367. this.endTable.file = val.reportFile==''||val.reportFile==null?[]:val.reportFile;
  368. this.endDialog=true;
  369. },
  370. ending(){ //完结提交
  371. if(this.endTable.file.length.length==0)return this.$message.error("请上传完结报告");
  372. this.ajax.post(this.$store.state.api+"/UploadActivityFile",{
  373. uid:this.$store.state.userInfo.userid,
  374. aid:this.endTable.Id,
  375. file:JSON.stringify(this.endTable.file),
  376. }).then(res=>{
  377. if(res.data==1){
  378. this.$message.success("结项成功");
  379. this.endDialog = false;
  380. }else{
  381. this.$message.error("结项失败")
  382. }
  383. this.getData();
  384. })
  385. // this.endDialog=false;
  386. },
  387. edit(){ // 申请表按钮
  388. },
  389. audi(row){ // 审核按钮
  390. this.processTable.Id = row.acId;
  391. this.processTable.name = row.title;
  392. this.processTable.leader = row.pro_leader;
  393. this.processTable.money = row.money,
  394. this.processTable.phone = row.phone,
  395. this.processTable.className = row.name;
  396. this.auditDialog = true;
  397. },
  398. makerActvityApply(){ // 创客活动申请按钮
  399. this.$router.push('/makerActvityApplyMain')
  400. },
  401. MADetails(Id){ // 查看详情
  402. this.$router.push(`/makerActvityDetails?Id=${Id}`)
  403. },
  404. CurrentChange(nowPage){
  405. this.Page.nowPage = nowPage;
  406. this.getData();
  407. },
  408. getData(){
  409. this.ajax.get(this.$store.state.api+"/GetAllActivity",{
  410. uid:this.$store.state.userInfo.userid,
  411. pid:this.pavalues.value,
  412. cid:this.pavalues.value1,
  413. leader:this.pavalues.value2,
  414. state:this.pavalues.value3,
  415. page:this.Page.nowPage,
  416. lim:this.Page.lim,
  417. }).then(res=>{
  418. let data = res.data;
  419. data[0].forEach(item=>item.reportFile = item.reportFile==''||item.reportFile==null?[]:JSON.parse(item.reportFile));
  420. this.tableData = data[0];
  421. this.options = data[1];
  422. this.options1 = data[2];
  423. this.options2 = data[3];
  424. this.Page.total = data[4][0]['total'];
  425. console.log(this.tableData)
  426. }).catch(err=>{
  427. this.$message.error(err.message)
  428. })
  429. },
  430. GetTime(data){
  431. let cdata = JSON.parse(data);
  432. if(cdata[0]==cdata[1])return cdata[0];
  433. let sp1 = cdata[0].split('-')
  434. let sp2 =cdata[1].split('-')
  435. if(sp1[0]==sp2[0]){
  436. if(sp1[1]==sp2[1]){
  437. return `${sp1[0]}-${sp1[1]}-${sp1[2]} 至 ${sp2[2]}`
  438. }else{
  439. return `${sp1[0]}-${sp1[1]}-${sp1[2]} 至 ${sp2[1]}-${sp2[2]}`
  440. }
  441. }else{
  442. return cdata[0]+" 至 "+cdata[1]
  443. }
  444. }
  445. },
  446. mounted() {
  447. this.getData();
  448. },
  449. }
  450. </script>
  451. <style lang="less">
  452. .makerActvity{
  453. position: relative;
  454. width: 100%;
  455. height: 100%;
  456. .dialogWidth{
  457. .el-input__inner{
  458. width: 300px;
  459. }
  460. .el-textarea__inner{
  461. width: 380px;
  462. }
  463. .el-dialog{
  464. width: 600px;
  465. border-radius: 5px;
  466. overflow: hidden;
  467. }
  468. .el-dialog__body{
  469. padding:30px 0px 30px 90px ;
  470. }
  471. .el-dialog__header{
  472. background: #32455b;
  473. }
  474. .el-dialog__title{
  475. color: #fff;
  476. position: relative;
  477. top: -5px;
  478. font-size: 18px;
  479. }
  480. .diaTit{ //dialog项目名称、负责人
  481. width: 100%;
  482. display: flex;
  483. .spans{
  484. width: 84px;
  485. font-size: 16px;
  486. margin-right: 10px;
  487. display: inline-block;
  488. text-align: justify;
  489. color: #000;
  490. font-size: 16px;
  491. text-justify:distribute-all-lines;
  492. text-align-last: justify;
  493. transform: translate(0,22%);
  494. margin-bottom: 10px;
  495. }
  496. }
  497. .spanCon{
  498. font-size: 16px;
  499. margin-top: 5px;
  500. color: #a0a0a0;
  501. }
  502. .spans1{ //label
  503. min-width: 84px;
  504. font-size: 16px;
  505. color: #000;
  506. margin-right: 10px;
  507. display: inline-block;
  508. text-align: justify;
  509. text-justify:distribute-all-lines;
  510. text-align-last: justify;
  511. transform: translate(0,22%);
  512. }
  513. .diaTit1{ //label和input框
  514. display: flex;
  515. width: 80%;
  516. margin-top: 20px;
  517. }
  518. }
  519. .dialog-footer{
  520. width: 100%;
  521. display: flex;
  522. justify-content: center;
  523. .diaBtn{
  524. font-size: 16px;
  525. }
  526. }
  527. .endDialog{ //完结对话框的
  528. .el-dialog__header{
  529. display: flex;
  530. justify-content: center;
  531. box-sizing: border-box;
  532. background: #32455b;
  533. }
  534. .el-dialog__title{
  535. color:rgb(246, 247, 246);
  536. display: flex;
  537. justify-content: center;
  538. }
  539. .el-dialog{
  540. width: 600px;
  541. border-radius: 5px;
  542. overflow: hidden;
  543. }
  544. .deleteContent{
  545. width: 100%;
  546. font-size: 22px;
  547. color: #000;
  548. box-sizing: border-box;
  549. // padding: 0 20px;
  550. display: flex;
  551. justify-content: center;
  552. }
  553. .deleteContent1{
  554. width: 100%;
  555. text-align: left;
  556. font-size: 18px;
  557. font-weight: bold;
  558. color: #000;
  559. margin-top: 30px;
  560. }
  561. .download{
  562. margin: 10px 0 10px;
  563. width: 100%;
  564. text-align: left;
  565. font-size: 16px;
  566. font-weight: bold;
  567. color: #5391fd;
  568. display: flex;
  569. justify-content: space-between;
  570. }
  571. .addDialogLogo{
  572. width: 60px;
  573. height: 30px;
  574. line-height: 30px;
  575. background: #f2f2f2;
  576. position: absolute;
  577. left: 10px;
  578. top: 15px;
  579. text-align: center;
  580. }
  581. }
  582. }
  583. .pagination{
  584. // position: absolute;
  585. float: right;
  586. margin: 20px 35px 10px;
  587. }
  588. .downloadList{
  589. width: 80%;
  590. }
  591. </style>