projectSettlementDetailComment.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  1. <template>
  2. <!-- 项目结项 结项评语 -->
  3. <div class="projectSettlement2" v-loading="loading">
  4. <!-- 上传文件以及表格开始 -->
  5. <div class="pmInp">
  6. <beUpload @getFile="getFile" :progress="progress" :navName="'上传文件'" :accept="accept"></beUpload>
  7. </div>
  8. <!-- 表格部分开始 -->
  9. <el-progress v-show="progress.show" :percentage="progress.value" :format="ProgressFormat"></el-progress>
  10. <el-table
  11. :data="file"
  12. tooltip-effect="dark"
  13. stripe
  14. class="fontSize"
  15. :header-cell-style="{ background: '#f2f2f2',color:'#000' }"
  16. >
  17. <el-table-column
  18. prop="fileName"
  19. label="项目中期报告"
  20. align="center"
  21. >
  22. </el-table-column>
  23. <el-table-column
  24. prop="size"
  25. label="大小"
  26. align="center"
  27. >
  28. </el-table-column>
  29. <el-table-column
  30. prop="uploadTime"
  31. label="时间"
  32. align="center"
  33. >
  34. </el-table-column>
  35. <el-table-column
  36. prop="operation"
  37. align="center"
  38. label="操作"
  39. >
  40. <template #default="scope">
  41. <div class="operations">
  42. <el-button type="primary" size="mini" @click="checkFile(scope.row.url)" style="background: #477edd">明细查看</el-button>
  43. </div>
  44. </template>
  45. </el-table-column>
  46. </el-table>
  47. <!-- 多行文本框区域开始 -->
  48. <!-- <div class="PS2tabTit0">
  49. 结项评价
  50. </div>
  51. <div class="tabTit">
  52. <div><p>科研办</p></div>
  53. </div>
  54. <hr>
  55. <div class="ps1textArea">
  56. <el-input
  57. type="textarea"
  58. :rows="6"
  59. resize="none"
  60. class="textArea"
  61. placeholder="请输入内容"
  62. v-model="AllRemark.kRem">
  63. </el-input>
  64. </div>
  65. <div class="tabTit">
  66. <div><p>学术委员会</p></div>
  67. </div>
  68. <hr>
  69. <div class="ps1textArea">
  70. <el-input
  71. type="textarea"
  72. class="textArea"
  73. :rows="6"
  74. resize="none"
  75. placeholder="请输入内容"
  76. v-model="AllRemark.xRem">
  77. </el-input>
  78. </div>
  79. <div class="tabTit">
  80. <div><p>部门审核评语</p></div>
  81. </div>
  82. <hr>
  83. <div class="ps1textArea">
  84. <el-input
  85. type="textarea"
  86. :rows="6"
  87. resize="none"
  88. class="textArea"
  89. placeholder="请输入内容"
  90. v-model="AllRemark.bRem">
  91. </el-input>
  92. </div> -->
  93. <!-- 多行文本框区域结束 -->
  94. <div class="baseBtn">
  95. <div class="blockWidth">
  96. <el-button type="primary" class="backBtn" @click="submitRemark">提交</el-button>
  97. </div>
  98. </div>
  99. <!-- 提交对话框开始 -->
  100. <el-dialog
  101. title="提示"
  102. :visible.sync="dialogVisible1"
  103. width="600px"
  104. class="submitDialog">
  105. <div class="addDialogLogo">LOGO</div>
  106. <span class="deleteContent">确定提交?</span>
  107. <span slot="footer" class="dialog-footer">
  108. <el-button type="primary" @click="confirmSubmit" class="AllDialogBtn">确认提交</el-button>
  109. <el-button @click="dialogVisible1=false" class="AllDialogBtn">取消</el-button>
  110. </span>
  111. </el-dialog>
  112. <!-- 提交对话框结束-->
  113. <!-- 展示文档开始 -->
  114. <el-dialog
  115. title="展示文件"
  116. :visible.sync="showFile"
  117. width="80vw"
  118. class="addDialog showDialog"
  119. >
  120. <div class="addDialogLogo">LOGO</div>
  121. <div class="showFileArea">
  122. <!-- <vpdf v-if="/^\s*$/g.test(showFileUrl)&&showFileUrl.split('.')[showFileUrl.split('.').length-1]=='pdf'" :pdfUrl="showFileUrl"></vpdf> -->
  123. <vword
  124. style="width: 100%; height: 100%; overflow: auto"
  125. class="fullStyle"
  126. v-if="Wordss['type']!='pdf' && Wordss['name']!='图片'"
  127. :pdfUrl="'https://view.officeapps.live.com/op/view.aspx?src='+showFileUrl"
  128. ></vword>
  129. <vpdf
  130. style="width: 100%; height: 100%; overflow: auto"
  131. class="fullStyle"
  132. :pdfUrl="showFileUrl"
  133. v-if="Wordss['type']=='pdf'"
  134. ></vpdf>
  135. <img :src="showFileUrl" alt="图片哦" v-if="Wordss['name']=='图片'" style="width: auto;height: auto;max-width: 100%;max-height: 100%;">
  136. </div>
  137. </el-dialog>
  138. </div>
  139. </template>
  140. <script>
  141. import beUpload from '@/components/tool/beUpload'
  142. import vpdf from "@/components/vpdf.vue";
  143. import vword from "@/components/vword.vue";
  144. export default {
  145. components: { beUpload, vpdf, vword },
  146. data() {
  147. return {
  148. accept:"*",
  149. dialogVisible1:false,
  150. loading:false,
  151. showFile:false,
  152. showFileType: 0,
  153. showFileUrl: "",
  154. Wordss:{type:"",name:""},
  155. canonical:{
  156. Image:/^https?:\/\/(.+\/)+.+(\.(gif|png|jpg|jpeg|webp|svg|psd|bmp|tif))$/i,
  157. File:/^https?:\/\/(.+\/)+.+(\.(docx|xlsx|ppt|pdf))$/i
  158. },
  159. // tableData:[],
  160. file:[],
  161. progress:{ //进度条
  162. value:0,
  163. show:false
  164. },
  165. AllRemark:{
  166. kRem:'',
  167. xRem:'',
  168. bRem:''
  169. }
  170. }
  171. },
  172. methods:{
  173. ProgressFormat(value){ //进度条
  174. return value ==100?'100%':`${value}%`
  175. },
  176. //展示文件
  177. checkFile(url) {
  178. // console.log(url);
  179. this.showFileUrl = url;
  180. this.showFile = true;
  181. if(typeof url=='undefined')return {type:"",name:""};
  182. let urlSplit = url.split(".");
  183. const type = urlSplit[urlSplit.length-1]
  184. if(this.canonical.Image.test(url)){
  185. this.Wordss={type:type,name:"图片"}
  186. return console.log(this.Wordss);
  187. }
  188. if(this.canonical.File.test(url)){
  189. this.Wordss={type:type,name:"文档"}
  190. return console.log(this.Wordss);
  191. }
  192. else return this.Wordss={type:type,name:type}
  193. },
  194. confirmSubmit(){ //确定提交
  195. let param={
  196. uid:this.$store.state.userInfo.userid,
  197. pid:this.$route.query['pid'],
  198. file:JSON.stringify(this.file),
  199. remark:JSON.stringify(this.AllRemark)
  200. }
  201. this.ajax
  202. .post(this.$store.state.api+'/UpdateSettlementRemark',param)
  203. .then(res=>{
  204. console.log(res);
  205. this.dialogVisible1=false
  206. this.$message.success('提交成功')
  207. },err=>{
  208. console.log(err);
  209. })
  210. },
  211. submitRemark(){ //显示提交对话框
  212. this.dialogVisible1=true;
  213. },
  214. getFile(val) { //上传文件
  215. let param={
  216. uid:this.$store.state.userInfo.userid,
  217. pid:this.$route.query['pid'],
  218. file:JSON.stringify([...this.file,val]),
  219. remark:JSON.stringify(this.AllRemark)
  220. }
  221. this.ajax
  222. .post(this.$store.state.api+'/UpdateSettlementRemark',param)
  223. .then(res=>{
  224. if(res.data==1){
  225. this.$message.success('提交成功')
  226. }else{
  227. this.$message.error("提交失败")
  228. }
  229. this.getData();
  230. this.progress.show = false;
  231. },err=>{
  232. console.log(err);
  233. })
  234. },
  235. getData(){ //获取基础信息
  236. this.loading = true;
  237. let param={
  238. uid:this.$store.state.userInfo.userid,
  239. pid:this.$route.query['pid'],
  240. }
  241. this.ajax
  242. .get(this.$store.state.api+'/SelectSettlementRemark',param)
  243. .then(res=>{
  244. console.log(res);
  245. let data=res.data[0];
  246. console.log(data);
  247. this.file=JSON.parse(data[0].endFile)
  248. if(JSON.parse(data[0].endProjectRemark)!=null){
  249. this.AllRemark=JSON.parse(data[0].endProjectRemark)
  250. }
  251. this.loading = false;
  252. },err=>{
  253. console.log(err);
  254. })
  255. },
  256. },
  257. mounted(){
  258. this.getData()
  259. }
  260. }
  261. </script>
  262. <style lang="less">
  263. .projectSettlement2{
  264. .pmInp{
  265. width: 100%;
  266. margin: 10px 0 10px 0;
  267. display: flex;
  268. justify-content: flex-end;
  269. .btn{
  270. height: 30px;
  271. width: 100px;
  272. font-size: 16px;
  273. background: #477edd;
  274. // margin-left: 10px;
  275. }
  276. }
  277. .addDialog {
  278. font-size: 18px;
  279. .el-dialog {
  280. border-radius: 5px;
  281. overflow: hidden;
  282. }
  283. .deleteContent {
  284. width: 100%;
  285. margin: 30px 0;
  286. font-size: 22px;
  287. color: #000;
  288. }
  289. .addDialogLogo {
  290. width: 60px;
  291. height: 30px;
  292. border-radius: 5px;
  293. display: flex;
  294. justify-content: center;
  295. line-height: 30px;
  296. background: #f2f2f2;
  297. position: absolute;
  298. left: 20px; top: 15px;
  299. }
  300. .el-dialog__header {
  301. display: flex;
  302. justify-content: center;
  303. background: #32455b;
  304. }
  305. .el-dialog__title {
  306. color:#fff;
  307. display: flex;
  308. justify-content: center;
  309. font-size: 18px;
  310. position: relative;
  311. top: -2px;
  312. }
  313. .addDialogMid {
  314. box-sizing: border-box;
  315. padding: 0 60px 0 10px;
  316. .addDialogTit {
  317. display: flex;
  318. span {
  319. width: 80px;
  320. font-size: 16px;
  321. line-height: 40px;
  322. text-align: left;
  323. }
  324. }
  325. .addDialogTit1 {
  326. display: flex;
  327. justify-content: space-between;
  328. margin-bottom: 15px;
  329. }
  330. .addDialogTit2 {
  331. margin-top: 10px;
  332. font-size: 16px;
  333. color: #000;
  334. text-indent: 2em;
  335. }
  336. .addDialogCon {
  337. margin-top: 20px;
  338. }
  339. }
  340. }
  341. .submitDialog{
  342. font-size: 18px;
  343. .el-dialog{
  344. border-radius: 5px;
  345. overflow: hidden;
  346. }
  347. .deleteContent{
  348. font-size: 22px;
  349. color: #000;
  350. }
  351. .el-dialog__body{
  352. display: flex;
  353. justify-content: center;
  354. }
  355. .addDialogLogo{
  356. width: 60px;
  357. height: 30px;
  358. border-radius: 5px;
  359. display: flex;
  360. justify-content: center;
  361. line-height: 30px;
  362. background: #f2f2f2;
  363. position: absolute;
  364. left: 20px; top: 15px;
  365. }
  366. .el-dialog__header{
  367. background: #32455b;
  368. }
  369. .el-dialog__title{
  370. color:#fff;
  371. display: flex;
  372. justify-content: center;
  373. font-size: 18px;
  374. position: relative;
  375. top: -2px;
  376. }
  377. .addDialogMid{
  378. box-sizing: border-box;
  379. padding:0 60px 0 10px;
  380. .addDialogTit{
  381. display: flex;
  382. span{
  383. width: 80px;
  384. font-size: 16px;
  385. line-height: 40px;
  386. text-align: left;
  387. }
  388. }
  389. .addDialogTit1{
  390. display: flex;
  391. justify-content: space-between;
  392. margin-bottom: 15px;
  393. }
  394. .addDialogTit2{
  395. margin-top: 10px;
  396. font-size: 16px;
  397. color: #000;
  398. text-indent: 2em;
  399. text-align: left;
  400. line-height: 1.7em;
  401. }
  402. .addDialogCon{
  403. margin-top: 20px;
  404. }
  405. }
  406. .dialog-footer {
  407. display: flex;
  408. justify-content: center;
  409. box-sizing: border-box;
  410. // .btn5 {
  411. // font-size: 16px;
  412. // }
  413. }
  414. }
  415. .PS2tabTit0{
  416. width: 100%;
  417. text-align: left;
  418. margin: 20px 15px 20px 0px;
  419. color: #ccc;
  420. font-size: 22px;
  421. }
  422. }
  423. </style>