ProjectManagement5.vue 10.0 KB

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