makerActvity.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618
  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="init">
  236. <div class="addDialogLogo">LOGO</div>
  237. <div class="deleteContent">"{{ endTable.title }}"项目活动,是否确定完结?</div>
  238. <div class="deleteContent1">活动完结报告</div>
  239. <div class="download" v-if="endTable.file!=''">
  240. <div>{{ endTable.file!=''&&endTable.file!=null?endTable.file.fileName:"" }}</div>
  241. </div>
  242. <div class="addMoneyBtn" style="margin-left: 0;" v-if="endTable.file==''||endTable.file==null">
  243. <div class="jia">+</div>添加
  244. <div id="upFile">
  245. <beUpload @getFile="getFile" :navName="'上传文件'" :accept="accept"> </beUpload>
  246. </div>
  247. </div>
  248. <div class="DelBtn" style="margin-left: 0;" v-if="endTable.file!=''&&endTable.file!=null">
  249. <el-button type="primary" @click="endTable.file=''">删除文件</el-button>
  250. </div>
  251. <div slot="footer" class="dialog-footer">
  252. <el-button type="primary" @click="ending" class="diaBtn">确认提交</el-button>
  253. <el-button @click="init" class="diaBtn">取消</el-button>
  254. </div>
  255. </el-dialog>
  256. <!-- 完结对话框结束 -->
  257. <el-pagination
  258. @current-change="CurrentChange"
  259. :page-size="Page.lim"
  260. layout=" prev, pager, next"
  261. background
  262. class="pagination"
  263. :total="Page.total">
  264. </el-pagination>
  265. </div>
  266. </template>
  267. <script>
  268. import beUpload from '../../components/tool/beUpload'
  269. export default {
  270. components:{beUpload},
  271. data() {
  272. return {
  273. accept:".doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
  274. status:1,
  275. textarea:'',
  276. input:'',
  277. endDialog:false, //完结对话框
  278. auditDialog:false, //审核对话框
  279. rejectDialog:false, //驳回对话框
  280. options:[],
  281. options1:[],
  282. options2:[],
  283. // 表格数据
  284. tableData:[],
  285. // 四个下拉框数据
  286. pavalues:{
  287. value:0,//项目ID
  288. value1:0,//部门ID
  289. value2:'',//负责人
  290. value3:99,//状态
  291. },
  292. Page:{
  293. nowPage:1,
  294. total:10,
  295. lim:10
  296. },
  297. processTable:{
  298. Id:"",
  299. name:"",
  300. leader:"",
  301. className:"",
  302. money:"",
  303. phone:""
  304. },
  305. endTable:{
  306. Id:"",
  307. title:"",
  308. file:"",
  309. }
  310. }
  311. },
  312. methods:{
  313. getFile(val) {//上传文件
  314. this.endTable.file = val;
  315. },
  316. init(){//重置
  317. this.auditDialog=false;
  318. this.endDialog=false;
  319. this.rejectDialog=false;
  320. },
  321. commit(){ // 活动审核对话框确定
  322. this.ajax.post(this.$store.state.api+"/UpdateActivityState",{
  323. uid:this.$store.state.userInfo.userid,
  324. aid:this.processTable.Id,
  325. st:1,
  326. }).then(res=>{
  327. if(res.data==1){
  328. this.$message.success("审核成功");
  329. this.auditDialog = false;
  330. for(let i in this.processTable)this.processTable[i] = '';
  331. this.getData()
  332. }else{
  333. this.$message.error("审核失败")
  334. }
  335. this.getData();
  336. }).catch(err=>{
  337. this.$message.error(err.message)
  338. })
  339. },
  340. // 驳回对话框确定
  341. commit2(){
  342. this.rejectDialog=false;
  343. this.status++
  344. },
  345. end(val){//完结按钮
  346. this.endTable.title = val.title;
  347. this.endTable.Id = val.acId;
  348. this.endTable.file = val.reportFile;
  349. this.endDialog=true;
  350. },
  351. ending(){ //完结提交
  352. if(this.endTable.file=="")return this.$message.error("请上传完结报告");
  353. this.ajax.post(this.$store.state.api+"/UploadActivityFile",{
  354. uid:this.$store.state.userInfo.userid,
  355. aid:this.endTable.Id,
  356. file:JSON.stringify(this.endTable.file),
  357. }).then(res=>{
  358. if(res.data==1){
  359. this.$message.success("结项成功");
  360. this.endDialog = false;
  361. }else{
  362. this.$message.error("结项失败")
  363. }
  364. this.getData();
  365. })
  366. // this.endDialog=false;
  367. },
  368. edit(){ // 申请表按钮
  369. },
  370. audi(row){ // 审核按钮
  371. this.processTable.Id = row.acId;
  372. this.processTable.name = row.title;
  373. this.processTable.leader = row.pro_leader;
  374. this.processTable.money = row.money,
  375. this.processTable.phone = row.phone,
  376. this.processTable.className = row.name;
  377. this.auditDialog = true;
  378. },
  379. makerActvityApply(){ // 创客活动申请按钮
  380. this.$router.push('/makerActvityApplyMain')
  381. },
  382. MADetails(Id){ // 查看详情
  383. this.$router.push(`/makerActvityDetails?Id=${Id}`)
  384. },
  385. CurrentChange(nowPage){
  386. this.Page.nowPage = nowPage;
  387. this.getData();
  388. },
  389. getData(){
  390. this.ajax.get(this.$store.state.api+"/GetAllActivity",{
  391. uid:this.$store.state.userInfo.userid,
  392. pid:this.pavalues.value,
  393. cid:this.pavalues.value1,
  394. leader:this.pavalues.value2,
  395. state:this.pavalues.value3,
  396. page:this.Page.nowPage,
  397. lim:this.Page.lim,
  398. }).then(res=>{
  399. let data = res.data;
  400. this.tableData = data[0];
  401. this.options = data[1];
  402. this.options1 = data[2];
  403. this.options2 = data[3];
  404. this.Page.total = data[4][0]['total'];
  405. }).catch(err=>{
  406. this.$message.error(err.message)
  407. })
  408. },
  409. GetTime(data){
  410. let cdata = JSON.parse(data);
  411. if(cdata[0]==cdata[1])return cdata[0];
  412. let sp1 = cdata[0].split('-')
  413. let sp2 =cdata[1].split('-')
  414. if(sp1[0]==sp2[0]){
  415. if(sp1[1]==sp2[1]){
  416. return `${sp1[0]}-${sp1[1]}-${sp1[2]} 至 ${sp2[2]}`
  417. }else{
  418. return `${sp1[0]}-${sp1[1]}-${sp1[2]} 至 ${sp2[1]}-${sp2[2]}`
  419. }
  420. }else{
  421. return cdata[0]+" 至 "+cdata[1]
  422. }
  423. }
  424. },
  425. mounted() {
  426. this.getData();
  427. },
  428. }
  429. </script>
  430. <style lang="less">
  431. .makerActvity{
  432. position: relative;
  433. width: 100%;
  434. height: 100%;
  435. .dialogWidth{
  436. .el-input__inner{
  437. width: 300px;
  438. }
  439. .el-textarea__inner{
  440. width: 380px;
  441. }
  442. .el-dialog{
  443. width: 600px;
  444. border-radius: 5px;
  445. overflow: hidden;
  446. }
  447. .el-dialog__body{
  448. padding:30px 0px 30px 90px ;
  449. }
  450. .el-dialog__header{
  451. background: #32455b;
  452. }
  453. .el-dialog__title{
  454. color: #fff;
  455. position: relative;
  456. top: -5px;
  457. font-size: 18px;
  458. }
  459. .diaTit{ //dialog项目名称、负责人
  460. width: 100%;
  461. display: flex;
  462. .spans{
  463. width: 84px;
  464. font-size: 16px;
  465. margin-right: 10px;
  466. display: inline-block;
  467. text-align: justify;
  468. color: #000;
  469. font-size: 16px;
  470. text-justify:distribute-all-lines;
  471. text-align-last: justify;
  472. transform: translate(0,22%);
  473. margin-bottom: 10px;
  474. }
  475. }
  476. .spanCon{
  477. font-size: 16px;
  478. margin-top: 5px;
  479. color: #a0a0a0;
  480. }
  481. .spans1{ //label
  482. min-width: 84px;
  483. font-size: 16px;
  484. color: #000;
  485. margin-right: 10px;
  486. display: inline-block;
  487. text-align: justify;
  488. text-justify:distribute-all-lines;
  489. text-align-last: justify;
  490. transform: translate(0,22%);
  491. }
  492. .diaTit1{ //label和input框
  493. display: flex;
  494. width: 80%;
  495. margin-top: 20px;
  496. }
  497. }
  498. .dialog-footer{
  499. width: 100%;
  500. display: flex;
  501. justify-content: center;
  502. .diaBtn{
  503. font-size: 16px;
  504. }
  505. }
  506. .endDialog{ //完结对话框的
  507. .el-dialog__header{
  508. display: flex;
  509. justify-content: center;
  510. box-sizing: border-box;
  511. background: #32455b;
  512. }
  513. .el-dialog__title{
  514. color:rgb(246, 247, 246);
  515. display: flex;
  516. justify-content: center;
  517. }
  518. .el-dialog{
  519. width: 600px;
  520. border-radius: 5px;
  521. overflow: hidden;
  522. }
  523. .deleteContent{
  524. width: 100%;
  525. font-size: 22px;
  526. color: #000;
  527. box-sizing: border-box;
  528. // padding: 0 20px;
  529. display: flex;
  530. justify-content: center;
  531. }
  532. .deleteContent1{
  533. width: 100%;
  534. text-align: left;
  535. font-size: 18px;
  536. font-weight: bold;
  537. color: #000;
  538. margin-top: 30px;
  539. }
  540. .download{
  541. margin: 50px 0 20px;
  542. width: 100%;
  543. text-align: left;
  544. font-size: 16px;
  545. font-weight: bold;
  546. color: #5391fd;
  547. }
  548. .addDialogLogo{
  549. width: 60px;
  550. height: 30px;
  551. line-height: 30px;
  552. background: #f2f2f2;
  553. position: absolute;
  554. left: 10px;
  555. top: 15px;
  556. text-align: center;
  557. }
  558. }
  559. }
  560. .pagination{
  561. // position: absolute;
  562. float: right;
  563. margin: 20px 35px 10px;
  564. }
  565. .downloadList{
  566. width: 80%;
  567. }
  568. </style>