ProjectManagementActivity.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <template>
  2. <!-- 项目管理 活动开展 -->
  3. <div class="ProjectManagement3" v-loading="loading">
  4. <!-- <div class="vfpHeader"> -->
  5. <!-- 详情页 -->
  6. <!-- <div class="titleOne">项目管理</div>
  7. <div class="smallTitle" style="left: 100px;">项目进展详情</div>
  8. <el-button type="primary" @click="back">返回</el-button>
  9. </div>
  10. <hr> -->
  11. <!-- 跳转导航开始 -->
  12. <!-- <div class="AppBar">
  13. <div @click="content">项目基本内容</div>
  14. <div @click="remark">项目详情</div>
  15. <div @click="remark2" class="AppBarActive">活动开展</div>
  16. <div @click="remark4">项目附件</div>
  17. <div @click="remark5">项目结题附件</div>
  18. </div> -->
  19. <!-- 跳转导航结束 -->
  20. <!-- 表格部分开始 -->
  21. <div class="projectBlock">
  22. <el-table
  23. :data="tableData"
  24. tooltip-effect="dark"
  25. stripe
  26. width="100%"
  27. class="fontSize"
  28. :header-cell-style="{ background: '#f2f2f2',color:'#000' }"
  29. >
  30. <el-table-column
  31. prop="title"
  32. label="活动名称"
  33. align="center"
  34. >
  35. </el-table-column>
  36. <el-table-column
  37. prop="pro_leader"
  38. label="负责人"
  39. align="center"
  40. >
  41. </el-table-column>
  42. <el-table-column
  43. prop="PName"
  44. label="关联项目"
  45. align="center"
  46. >
  47. </el-table-column>
  48. <el-table-column
  49. prop="money"
  50. label="预算经费"
  51. align="center"
  52. >
  53. </el-table-column>
  54. <el-table-column
  55. prop="name"
  56. label="所在部门"
  57. align="center"
  58. >
  59. </el-table-column>
  60. <el-table-column
  61. prop="date"
  62. label="活动时间"
  63. align="center"
  64. >
  65. <template #default="scope">
  66. {{ GetTime(scope.row.begin_at)}}
  67. </template>
  68. </el-table-column>
  69. <el-table-column
  70. prop="operation"
  71. label="操作"
  72. align="center"
  73. width="220"
  74. >
  75. <template #default="scope">
  76. <div class="operations">
  77. <el-button type="primary" size="mini" @click="detail(scope.row.acId)" style="background: #477edd">查看详情</el-button>
  78. <!-- <el-button type="primary" size="mini" @click='sqb' style="background: #477edd">申请表</el-button> -->
  79. </div>
  80. </template>
  81. </el-table-column>
  82. </el-table>
  83. </div>
  84. <!-- 表格部分结束 -->
  85. <!-- 分页 -->
  86. <el-pagination
  87. @current-change="handleCurrentChange"
  88. :current-page="table.currentPage"
  89. :page-size="table.packageSize"
  90. layout=" prev, pager, next"
  91. background
  92. class="paginations"
  93. :total="table.total">
  94. </el-pagination>
  95. <!-- 分页结束 -->
  96. </div>
  97. </template>
  98. <script>
  99. export default {
  100. props:['changeShow'],
  101. data() {
  102. return {
  103. loading:false,
  104. tableData:[], //项目列表数据
  105. table:{ // 分页数据
  106. total:0,
  107. packageSize:9,
  108. currentPage:1
  109. },
  110. }
  111. },
  112. methods:{
  113. getData(){
  114. this.loading = true;
  115. let param={
  116. uid:this.$store.state.userInfo.userid,
  117. pid:this.$route.query['pid'],
  118. cid:"",
  119. leader:'',
  120. state:"",
  121. type:0,
  122. input:"",
  123. page:this.table.currentPage,
  124. lim:this.table.packageSize
  125. }
  126. // console.log(param);
  127. this.ajax
  128. .get(this.$store.state.api+'/GetAllActivity',param)
  129. .then(res=>{
  130. this.tableData=res.data[0]
  131. this.table.total=res.data[4][0].total
  132. this.loading = false;
  133. },err=>{
  134. console.log(err);
  135. })
  136. },
  137. GetTime(data){
  138. let cdata = JSON.parse(data);
  139. if(cdata[0]==cdata[1])return cdata[0];
  140. let sp1 = cdata[0].split(" ")[0].split('-')
  141. let sp2 =cdata[1].split(" ")[0].split('-')
  142. if(sp1[0]==sp2[0]){
  143. if(sp1[1]==sp2[1]){
  144. return `${sp1[0]}-${sp1[1]}-${sp1[2]} 至 ${sp2[2]}`
  145. }else{
  146. return `${sp1[0]}-${sp1[1]}-${sp1[2]} 至 ${sp2[1]}-${sp2[2]}`
  147. }
  148. }else{
  149. return cdata[0]+" 至 "+cdata[1]
  150. }
  151. },
  152. handleCurrentChange(val) { //当页数发生改变的时候调用获取列表数据请求
  153. // console.log(`当前页: ${val}`);
  154. this.table.currentPage=val
  155. this.getData()
  156. },
  157. detail(Id){
  158. // this.$router.push(`/ProjectManagementMain?Id=${this.$route.query['Id']}&pid=${this.$route.query['pid']}&aid=${Id}`);
  159. this.changeShow(5,Id)
  160. },
  161. },
  162. mounted(){
  163. this.getData()
  164. }
  165. }
  166. </script>
  167. <style lang="less">
  168. .ProjectManagement3{
  169. .projectBlock{
  170. margin-top: 20px;
  171. }
  172. .pm1Tit{
  173. display: flex;
  174. margin-left: 20px;
  175. div{
  176. width: 130px;
  177. cursor: pointer;
  178. font-weight: 550;
  179. }
  180. .pr1TitBass{
  181. height: 2px;
  182. width: 100%;
  183. background: #3D67BC;
  184. }
  185. }
  186. }
  187. </style>