ProjectManagement4.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <template>
  2. <!-- 项目管理 项目附件 -->
  3. <div class="ProjectManagement4">
  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">活动开展</div>
  16. <div class="AppBarActive">项目附件</div>
  17. <div @click="remark5">项目结题附件</div>
  18. </div>
  19. <!-- 跳转导航结束 -->
  20. <div class="pmInp">
  21. <!-- <el-button type="primary" class="btn" size="mini">上传文件</el-button> -->
  22. <beUpload @getFile="getFile" :navName="'上传文件'" :accept="accept"></beUpload>
  23. </div>
  24. <!-- 表格开始 -->
  25. <el-table
  26. :data="tableData"
  27. tooltip-effect="dark"
  28. stripe
  29. style="height: 550px;"
  30. class="fontSize"
  31. :header-cell-style="{ background: '#f2f2f2',color:'#000' }"
  32. >
  33. <!-- <el-table-column
  34. prop="title"
  35. label="活动名称"
  36. align="center"
  37. >
  38. </el-table-column> -->
  39. <el-table-column
  40. prop="fileName"
  41. label="活动中期报告"
  42. align="center"
  43. >
  44. </el-table-column>
  45. <el-table-column
  46. prop="size"
  47. label="大小"
  48. align="center"
  49. >
  50. </el-table-column>
  51. <el-table-column
  52. prop="uploadTime"
  53. label="时间"
  54. align="center"
  55. >
  56. </el-table-column>
  57. <el-table-column
  58. prop="operation"
  59. align="center"
  60. label="操作"
  61. >
  62. <template #default="scope">
  63. <div class="operations">
  64. <el-button type="primary" class="bt1" size="mini" @click="lookDetails(scope.rows.id)" style="background: #477edd">详情查看</el-button>
  65. </div>
  66. </template>
  67. </el-table-column>
  68. </el-table>
  69. <!-- 表格结束 -->
  70. <!-- 分页 -->
  71. <el-pagination
  72. @current-change="handleCurrentChange"
  73. :current-page="table.currentPage"
  74. :page-size="table.packageSize"
  75. layout=" prev, pager, next"
  76. background
  77. class="pagination"
  78. :total="table.total">
  79. </el-pagination>
  80. <!-- 分页结束 -->
  81. </div>
  82. </template>
  83. <script>
  84. import beUpload from '../../components/tool/beUpload'
  85. export default {
  86. components:{beUpload},
  87. data() {
  88. return {
  89. accept:".doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
  90. table:{ // 分页数据
  91. total:0,
  92. packageSize:8,
  93. currentPage:1
  94. },
  95. tableData:[],
  96. }
  97. },
  98. methods:{
  99. getFile(val) { //上传文件
  100. this.file = val;
  101. let oldData = [];
  102. this.tableData.forEach(item=>oldData.push(item))
  103. oldData.push(val)
  104. let param={
  105. uid:this.$store.state.userInfo.userid,
  106. cid:JSON.parse(localStorage.getItem('pid')),
  107. projectFile:JSON.stringify(oldData)
  108. }
  109. this.ajax
  110. .post(this.$store.state.api+'/AddProjectFile',param)
  111. .then(res=>{
  112. // console.log(res);
  113. if (res.data==1) {
  114. this.$message.success('上传成功')
  115. this.getData()
  116. }else{
  117. this.$message.error('上传失败')
  118. }
  119. },err=>{
  120. console.log(err);
  121. })
  122. },
  123. handleCurrentChange(val) { //当页数发生改变的时候调用获取列表数据请求
  124. // console.log(`当前页: ${val}`);
  125. this.table.currentPage=val
  126. this.getData()
  127. },
  128. getData(){ //获取基础信息
  129. let param={
  130. uid:this.$store.state.userInfo.userid,
  131. pid:JSON.parse(localStorage.getItem('pid')),
  132. page:this.table.currentPage,
  133. lim:this.table.packageSize
  134. }
  135. // console.log(param);
  136. this.ajax
  137. .get(this.$store.state.api+'/SelectProjectFile',param)
  138. .then(res=>{
  139. // console.log(res.data);
  140. let k=[]
  141. res.data[0].forEach((e,i) => {
  142. // console.log(e);
  143. let { projectFile: l } = e;
  144. // console.log(l);
  145. k=JSON.parse(l)
  146. });
  147. // console.log(k);
  148. this.tableData=k
  149. },err=>{
  150. console.log(err);
  151. })
  152. },
  153. content(){
  154. this.$router.push('/ProjectManagement1')
  155. },
  156. remark(){
  157. this.$router.push('/ProjectManagement2')
  158. },
  159. remark2(){
  160. this.$router.push('/ProjectManagement3')
  161. },
  162. remark5(){
  163. this.$router.push('/ProjectManagement5')
  164. },
  165. backBtn2(){
  166. this.$router.push('/ProjectManagement1')
  167. },
  168. lookDetails(){
  169. console.log(111);
  170. },
  171. back(){
  172. this.$router.push('/ProjectManagement')
  173. },
  174. },
  175. mounted(){
  176. this.getData()
  177. }
  178. }
  179. </script>
  180. <style lang="less">
  181. .ProjectManagement4{
  182. .pagination{
  183. float: right;
  184. margin: 20px 55px 10px;
  185. }
  186. .pm1Tit{
  187. display: flex;
  188. margin-left: 20px;
  189. div{
  190. width: 130px;
  191. cursor: pointer;
  192. font-weight: 550;
  193. }
  194. .pr1TitBass{
  195. height: 2px;
  196. width: 100%;
  197. background: #3D67BC;
  198. }
  199. }
  200. .pmInp{
  201. width: 100%;
  202. display: flex;
  203. margin: 10px 0 10px 0;
  204. justify-content: flex-end;
  205. .btn{
  206. height: 30px;
  207. width: 100px;
  208. font-size: 16px !important;
  209. background: #477edd;
  210. margin-left: 10px;
  211. }
  212. }
  213. }
  214. </style>