makerActvity.vue 20 KB

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