123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447 |
- <template>
- <!-- 项目结项 结项评语 -->
- <div class="projectSettlement2" v-loading="loading">
- <!-- 上传文件以及表格开始 -->
- <div class="pmInp">
- <beUpload @getFile="getFile" :progress="progress" :navName="'上传文件'" :accept="accept"></beUpload>
- </div>
- <!-- 表格部分开始 -->
- <el-progress v-show="progress.show" :percentage="progress.value" :format="ProgressFormat"></el-progress>
- <el-table
- :data="file"
- tooltip-effect="dark"
- stripe
- class="fontSize"
- :header-cell-style="{ background: '#f2f2f2',color:'#000' }"
- >
- <el-table-column
- prop="fileName"
- label="项目中期报告"
- align="center"
- >
- </el-table-column>
-
- <el-table-column
- prop="size"
- label="大小"
- align="center"
- >
- </el-table-column>
-
- <el-table-column
- prop="uploadTime"
- label="时间"
- align="center"
- >
- </el-table-column>
- <el-table-column
- prop="operation"
- align="center"
- label="操作"
- >
- <template #default="scope">
- <div class="operations">
- <el-button type="primary" size="mini" @click="checkFile(scope.row.url)" style="background: #477edd">明细查看</el-button>
- </div>
- </template>
- </el-table-column>
- </el-table>
- <!-- 多行文本框区域开始 -->
- <!-- <div class="PS2tabTit0">
- 结项评价
- </div>
- <div class="tabTit">
- <div><p>科研办</p></div>
- </div>
- <hr>
- <div class="ps1textArea">
- <el-input
- type="textarea"
- :rows="6"
- resize="none"
- class="textArea"
- placeholder="请输入内容"
- v-model="AllRemark.kRem">
- </el-input>
- </div>
- <div class="tabTit">
- <div><p>学术委员会</p></div>
- </div>
- <hr>
- <div class="ps1textArea">
- <el-input
- type="textarea"
- class="textArea"
- :rows="6"
- resize="none"
- placeholder="请输入内容"
- v-model="AllRemark.xRem">
- </el-input>
- </div>
- <div class="tabTit">
- <div><p>部门审核评语</p></div>
- </div>
- <hr>
- <div class="ps1textArea">
- <el-input
- type="textarea"
- :rows="6"
- resize="none"
- class="textArea"
- placeholder="请输入内容"
- v-model="AllRemark.bRem">
- </el-input>
- </div> -->
- <!-- 多行文本框区域结束 -->
- <div class="baseBtn">
- <div class="blockWidth">
- <el-button type="primary" class="backBtn" @click="submitRemark">提交</el-button>
- </div>
- </div>
- <!-- 提交对话框开始 -->
- <el-dialog
- title="提示"
- :visible.sync="dialogVisible1"
- width="600px"
- class="submitDialog">
- <div class="addDialogLogo">LOGO</div>
- <span class="deleteContent">确定提交?</span>
- <span slot="footer" class="dialog-footer">
- <el-button type="primary" @click="confirmSubmit" class="AllDialogBtn">确认提交</el-button>
- <el-button @click="dialogVisible1=false" class="AllDialogBtn">取消</el-button>
- </span>
- </el-dialog>
- <!-- 提交对话框结束-->
- <!-- 展示文档开始 -->
- <el-dialog
- title="展示文件"
- :visible.sync="showFile"
- width="80vw"
- class="addDialog showDialog"
- >
- <div class="addDialogLogo">LOGO</div>
- <div class="showFileArea">
- <!-- <vpdf v-if="/^\s*$/g.test(showFileUrl)&&showFileUrl.split('.')[showFileUrl.split('.').length-1]=='pdf'" :pdfUrl="showFileUrl"></vpdf> -->
- <vword
- style="width: 100%; height: 100%; overflow: auto"
- class="fullStyle"
- v-if="Wordss['type']!='pdf' && Wordss['name']!='图片'"
- :pdfUrl="'https://view.officeapps.live.com/op/view.aspx?src='+showFileUrl"
- ></vword>
- <vpdf
- style="width: 100%; height: 100%; overflow: auto"
- class="fullStyle"
- :pdfUrl="showFileUrl"
- v-if="Wordss['type']=='pdf'"
- ></vpdf>
- <img :src="showFileUrl" alt="图片哦" v-if="Wordss['name']=='图片'" style="width: auto;height: auto;max-width: 100%;max-height: 100%;">
- </div>
- </el-dialog>
- </div>
- </template>
-
- <script>
- import beUpload from '@/components/tool/beUpload'
- import vpdf from "@/components/vpdf.vue";
- import vword from "@/components/vword.vue";
- export default {
- components: { beUpload, vpdf, vword },
- data() {
- return {
- accept:"*",
- dialogVisible1:false,
- loading:false,
- showFile:false,
- showFileType: 0,
- showFileUrl: "",
- Wordss:{type:"",name:""},
- canonical:{
- Image:/^https?:\/\/(.+\/)+.+(\.(gif|png|jpg|jpeg|webp|svg|psd|bmp|tif))$/i,
- File:/^https?:\/\/(.+\/)+.+(\.(docx|xlsx|ppt|pdf))$/i
- },
- // tableData:[],
- file:[],
- progress:{ //进度条
- value:0,
- show:false
- },
- AllRemark:{
- kRem:'',
- xRem:'',
- bRem:''
- }
- }
- },
- methods:{
- ProgressFormat(value){ //进度条
- return value ==100?'100%':`${value}%`
- },
- //展示文件
- checkFile(url) {
- // console.log(url);
- this.showFileUrl = url;
- this.showFile = true;
- if(typeof url=='undefined')return {type:"",name:""};
- let urlSplit = url.split(".");
- const type = urlSplit[urlSplit.length-1]
- if(this.canonical.Image.test(url)){
-
- this.Wordss={type:type,name:"图片"}
- return console.log(this.Wordss);
- }
- if(this.canonical.File.test(url)){
- this.Wordss={type:type,name:"文档"}
- return console.log(this.Wordss);
- }
- else return this.Wordss={type:type,name:type}
- },
- confirmSubmit(){ //确定提交
- let param={
- uid:this.$store.state.userInfo.userid,
- pid:this.$route.query['pid'],
- file:JSON.stringify(this.file),
- remark:JSON.stringify(this.AllRemark)
- }
- this.ajax
- .post(this.$store.state.api+'/UpdateSettlementRemark',param)
- .then(res=>{
- console.log(res);
- this.dialogVisible1=false
- this.$message.success('提交成功')
- },err=>{
- console.log(err);
- })
- },
- submitRemark(){ //显示提交对话框
- this.dialogVisible1=true;
- },
- getFile(val) { //上传文件
- let param={
- uid:this.$store.state.userInfo.userid,
- pid:this.$route.query['pid'],
- file:JSON.stringify([...this.file,val]),
- remark:JSON.stringify(this.AllRemark)
- }
- this.ajax
- .post(this.$store.state.api+'/UpdateSettlementRemark',param)
- .then(res=>{
- if(res.data==1){
- this.$message.success('提交成功')
- }else{
- this.$message.error("提交失败")
- }
- this.getData();
- this.progress.show = false;
-
- },err=>{
- console.log(err);
- })
- },
- getData(){ //获取基础信息
- this.loading = true;
- let param={
- uid:this.$store.state.userInfo.userid,
- pid:this.$route.query['pid'],
- }
- this.ajax
- .get(this.$store.state.api+'/SelectSettlementRemark',param)
- .then(res=>{
- console.log(res);
- let data=res.data[0];
- console.log(data);
- this.file=JSON.parse(data[0].endFile)
- if(JSON.parse(data[0].endProjectRemark)!=null){
- this.AllRemark=JSON.parse(data[0].endProjectRemark)
- }
- this.loading = false;
- },err=>{
- console.log(err);
- })
- },
- },
- mounted(){
- this.getData()
- }
- }
- </script>
-
- <style lang="less">
- .projectSettlement2{
- .pmInp{
- width: 100%;
- margin: 10px 0 10px 0;
- display: flex;
- justify-content: flex-end;
- .btn{
- height: 30px;
- width: 100px;
- font-size: 16px;
- background: #477edd;
- // margin-left: 10px;
- }
- }
- .addDialog {
- font-size: 18px;
- .el-dialog {
- border-radius: 5px;
- overflow: hidden;
- }
- .deleteContent {
- width: 100%;
- margin: 30px 0;
- font-size: 22px;
- color: #000;
- }
- .addDialogLogo {
- width: 60px;
- height: 30px;
- border-radius: 5px;
- display: flex;
- justify-content: center;
- line-height: 30px;
- background: #f2f2f2;
- position: absolute;
- left: 20px; top: 15px;
- }
- .el-dialog__header {
- display: flex;
- justify-content: center;
- background: #32455b;
- }
- .el-dialog__title {
- color:#fff;
- display: flex;
- justify-content: center;
- font-size: 18px;
- position: relative;
- top: -2px;
- }
- .addDialogMid {
- box-sizing: border-box;
- padding: 0 60px 0 10px;
- .addDialogTit {
- display: flex;
- span {
- width: 80px;
- font-size: 16px;
- line-height: 40px;
- text-align: left;
- }
- }
- .addDialogTit1 {
- display: flex;
- justify-content: space-between;
- margin-bottom: 15px;
- }
- .addDialogTit2 {
- margin-top: 10px;
- font-size: 16px;
- color: #000;
- text-indent: 2em;
- }
- .addDialogCon {
- margin-top: 20px;
- }
- }
-
- }
- .submitDialog{
- font-size: 18px;
- .el-dialog{
- border-radius: 5px;
- overflow: hidden;
- }
- .deleteContent{
- font-size: 22px;
- color: #000;
- }
- .el-dialog__body{
- display: flex;
- justify-content: center;
- }
- .addDialogLogo{
- width: 60px;
- height: 30px;
- border-radius: 5px;
- display: flex;
- justify-content: center;
- line-height: 30px;
- background: #f2f2f2;
- position: absolute;
- left: 20px; top: 15px;
- }
- .el-dialog__header{
- background: #32455b;
- }
- .el-dialog__title{
- color:#fff;
- display: flex;
- justify-content: center;
- font-size: 18px;
- position: relative;
- top: -2px;
- }
- .addDialogMid{
- box-sizing: border-box;
- padding:0 60px 0 10px;
- .addDialogTit{
- display: flex;
- span{
- width: 80px;
- font-size: 16px;
- line-height: 40px;
- text-align: left;
-
- }
- }
- .addDialogTit1{
- display: flex;
- justify-content: space-between;
- margin-bottom: 15px;
- }
- .addDialogTit2{
- margin-top: 10px;
- font-size: 16px;
- color: #000;
- text-indent: 2em;
- text-align: left;
- line-height: 1.7em;
- }
- .addDialogCon{
- margin-top: 20px;
- }
-
- }
- .dialog-footer {
- display: flex;
- justify-content: center;
- box-sizing: border-box;
- // .btn5 {
- // font-size: 16px;
- // }
- }
- }
- .PS2tabTit0{
- width: 100%;
- text-align: left;
- margin: 20px 15px 20px 0px;
- color: #ccc;
- font-size: 22px;
- }
- }
- </style>
|