ProjectManagement5.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. <template>
  2. <!-- 项目管理 项目结题附件 -->
  3. <div class="ProjectManagement5">
  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 @click="remark4">项目附件</div>
  17. <div @click="remark5" class="AppBarActive">项目结题附件</div>
  18. </div>
  19. <!-- 跳转导航结束 -->
  20. <div class="pmInp">
  21. <!-- <el-button type="primary" class="btn" @click="addFile" 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. class="fontSize"
  30. :header-cell-style="{ background: '#f2f2f2',color:'#000' }"
  31. >
  32. <!-- <el-table-column
  33. prop="projectTitle"
  34. label="项目名称"
  35. align="center"
  36. >
  37. <template>
  38. <span>{{ title }}</span>
  39. </template>
  40. </el-table-column> -->
  41. <el-table-column
  42. prop="fileName"
  43. label="项目中期报告"
  44. align="center"
  45. >
  46. </el-table-column>
  47. <el-table-column
  48. prop="size"
  49. label="大小"
  50. align="center"
  51. >
  52. </el-table-column>
  53. <el-table-column
  54. prop="uploadTime"
  55. label="时间"
  56. align="center"
  57. >
  58. </el-table-column>
  59. <el-table-column
  60. prop="operation"
  61. align="center"
  62. label="操作"
  63. >
  64. <template #default="scope">
  65. <div class="operations">
  66. <el-button type="primary" size="mini" @click="checkFile(scope.row.url)" style="background: #477edd">明细查看</el-button>
  67. </div>
  68. </template>
  69. </el-table-column>
  70. </el-table>
  71. <!-- 展示文档开始 -->
  72. <el-dialog
  73. title="展示文件"
  74. :visible.sync="showFile"
  75. width="80vw"
  76. class="addDialog showDialog"
  77. >
  78. <div class="addDialogLogo">LOGO</div>
  79. <div class="showFileArea">
  80. <!-- <vpdf v-if="/^\s*$/g.test(showFileUrl)&&showFileUrl.split('.')[showFileUrl.split('.').length-1]=='pdf'" :pdfUrl="showFileUrl"></vpdf> -->
  81. <vword v-if="showFileType == 0" :pdfUrl="showFileUrl"></vword>
  82. <vpdf v-else :pdfUrl="showFileUrl"></vpdf>
  83. </div>
  84. </el-dialog>
  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. import beUpload from '../../components/tool/beUpload'
  100. import vpdf from "@/components/vpdf.vue";
  101. import vword from "@/components/vword.vue";
  102. export default {
  103. components: { beUpload, vpdf, vword },
  104. data() {
  105. return {
  106. accept:"*",
  107. // table:{ // 分页数据
  108. // total:0,
  109. // packageSize:8,
  110. // currentPage:1
  111. // },
  112. showFile:false,
  113. showFileType: 0,
  114. showFileUrl: "",
  115. title:"",
  116. tableData:[], //附件列表
  117. file:''
  118. }
  119. },
  120. methods:{
  121. //展示文件
  122. checkFile(url) {
  123. console.log(url);
  124. if (
  125. url.split(".")[url.split(".").length - 1].toLocaleUpperCase() == "PDF"
  126. ) {
  127. this.showFileUrl = url;
  128. this.showFileType = 1;
  129. } else {
  130. this.showFileUrl =
  131. "https://view.officeapps.live.com/op/view.aspx?src=" + url;
  132. this.showFileType = 0;
  133. }
  134. this.showFile = true;
  135. },
  136. getFile(val) { //上传文件
  137. this.file = val;
  138. let oldData = [];
  139. if (this.tableData!=null) {
  140. this.tableData.forEach(item=>oldData.push(item))
  141. oldData.push(val)
  142. }else{
  143. oldData.push(val)
  144. }
  145. let param={
  146. uid:this.$store.state.userInfo.userid,
  147. cid:JSON.parse(localStorage.getItem('pid')),
  148. projectFile:JSON.stringify(oldData)
  149. }
  150. this.ajax
  151. .post(this.$store.state.api+'/AddProjectManageFile',param)
  152. .then(res=>{
  153. console.log(res);
  154. if (res.data==1) {
  155. this.getData()
  156. this.$message.success('上传成功')
  157. }else{
  158. this.$message.error('上传失败')
  159. }
  160. },err=>{
  161. console.log(err);
  162. })
  163. },
  164. // handleCurrentChange(val) { //当页数发生改变的时候调用获取列表数据请求
  165. // // console.log(`当前页: ${val}`);
  166. // this.table.currentPage=val
  167. // this.getData()
  168. // },
  169. getData(){ //获取基础信息
  170. let param={
  171. uid:this.$store.state.userInfo.userid,
  172. pid:JSON.parse(localStorage.getItem('pid')),
  173. }
  174. // console.log(param);
  175. this.ajax
  176. .get(this.$store.state.api+'/SelectProjectManageFile',param)
  177. .then(res=>{
  178. console.log(res.data);
  179. let file = JSON.parse(res.data[0][0]['endFile']);
  180. this.tableData=file
  181. },err=>{
  182. console.log(err);
  183. })
  184. },
  185. content(){
  186. this.$router.push('/ProjectManagement1')
  187. },
  188. remark(){
  189. this.$router.push('/ProjectManagement2')
  190. },
  191. remark2(){
  192. this.$router.push('/ProjectManagement3')
  193. },
  194. remark4(){
  195. this.$router.push('/ProjectManagement4')
  196. },
  197. remark5(){
  198. this.$router.push('/ProjectManagement5')
  199. },
  200. // backBtn2(){
  201. // this.$router.push('/ProjectManagement1')
  202. // },
  203. // detail(){
  204. // },
  205. back(){
  206. this.$router.push('/ProjectManagement')
  207. },
  208. },
  209. mounted(){
  210. this.getData()
  211. }
  212. }
  213. </script>
  214. <style lang="less">
  215. .ProjectManagement5{
  216. .pagination{
  217. float: right;
  218. margin: 20px 55px 10px;
  219. }
  220. .addDialog {
  221. font-size: 18px;
  222. .el-dialog {
  223. border-radius: 5px;
  224. overflow: hidden;
  225. }
  226. .deleteContent {
  227. width: 100%;
  228. margin: 30px 0;
  229. font-size: 22px;
  230. color: #000;
  231. }
  232. .addDialogLogo {
  233. width: 60px;
  234. height: 30px;
  235. display: flex;
  236. justify-content: center;
  237. line-height: 30px;
  238. border-radius: 5px;
  239. background: #f2f2f2;
  240. position: absolute;
  241. left: 20px; top: 15px;
  242. }
  243. .el-dialog__header {
  244. display: flex;
  245. justify-content: center;
  246. background: #32455b;
  247. }
  248. .el-dialog__title {
  249. color:#fff;
  250. display: flex;
  251. justify-content: center;
  252. font-size: 18px;
  253. position: relative;
  254. top: -2px;
  255. }
  256. .addDialogMid {
  257. box-sizing: border-box;
  258. padding: 0 60px 0 10px;
  259. .addDialogTit {
  260. display: flex;
  261. span {
  262. width: 80px;
  263. font-size: 16px;
  264. line-height: 40px;
  265. text-align: left;
  266. }
  267. }
  268. .addDialogTit1 {
  269. display: flex;
  270. justify-content: space-between;
  271. margin-bottom: 15px;
  272. }
  273. .addDialogTit2 {
  274. margin-top: 10px;
  275. font-size: 16px;
  276. color: #000;
  277. text-indent: 2em;
  278. }
  279. .addDialogCon {
  280. margin-top: 20px;
  281. }
  282. }
  283. .dialog-footer {
  284. display: flex;
  285. justify-content: center;
  286. box-sizing: border-box;
  287. .btn5 {
  288. font-size: 16px;
  289. }
  290. }
  291. }
  292. .pm5footer{
  293. float: right;
  294. margin-top: 30px;
  295. .backBtn{
  296. background: #169bd5;
  297. float: right;
  298. width: 100px;
  299. }
  300. }
  301. .pm1Tit{
  302. display: flex;
  303. margin-left: 20px;
  304. div{
  305. width: 130px;
  306. cursor: pointer;
  307. font-weight: 550;
  308. }
  309. .pr1TitBass{
  310. height: 2px;
  311. width: 100%;
  312. background: #3D67BC;
  313. }
  314. }
  315. .pmInp{
  316. width: 100%;
  317. margin: 10px 0 10px 0;
  318. display: flex;
  319. justify-content: flex-end;
  320. .btn{
  321. height: 30px;
  322. width: 100px;
  323. font-size: 16px;
  324. background: #477edd;
  325. // margin-left: 10px;
  326. }
  327. }
  328. }
  329. </style>