Ver código fonte

Merge branch 'master' of https://git.cocorobo.cn/CocoRoboLabs/ssti-CollegeManage

Q-ABAB 2 anos atrás
pai
commit
a4998be475

+ 2 - 2
src/config/config.js

@@ -23,8 +23,8 @@ const store = new Vuex.Store({
         // api: 'https://pbl.cocorobo.cn/api/pbl/',
         // socket: "https://poll.cocorobo.cn",
         // socket: "http://localhost:1473",
-        api: 'http://10.3.16.226:7003/api',
-        // api: 'http://127.0.0.1:7003/api',
+        // api: 'http://10.3.16.226:7003/api',
+        api: 'http://127.0.0.1:7003/api',
         // api: 'http://localhost:5005',
 
     },

+ 8 - 3
src/views/projectManage/ProjectManagement.vue

@@ -108,7 +108,10 @@
             <div class="classBlockBtn">
               <el-button type="primary" class="bt1" size="mini" @click="scheduleDetail(item.courseId)">进度详情</el-button>
               <el-button type="primary" class="bt1" size="mini" @click="fundStatus(item.courseId)">资金情况</el-button>
-              <el-button type="primary" class="bt1" size="mini" @click="finish(item.courseId,item.title)">结项</el-button>
+              <el-button type="primary" class="bt1" size="mini" v-if="item.endProject==0" @click="finish(item.courseId,item.title)">结项</el-button>
+
+              <el-button type="info" class="bt1" style="background-color: #c8c9cc;border-color: #c8c9cc;cursor: no-drop;" v-if="item.endProject==1"  size="mini">已结项</el-button>
+              
             </div>
        
       </div>
@@ -224,8 +227,10 @@ import beUpload from '../../components/tool/beUpload'
           this.ajax.post(this.$store.state.api+"/UploadProjectManageFile",{
             uid:this.$store.state.userInfo.userid,
             cid:this.iid,
-            file:JSON.stringify(this.endTable.file),
+            file:JSON.stringify([this.endTable.file]),
+            num:1
           }).then(res=>{
+            console.log(res);
             if(res.data==1){
               this.$message.success("结项成功");
               this.endDialog = false;
@@ -249,7 +254,7 @@ import beUpload from '../../components/tool/beUpload'
         init(){       //对话框重置
           this.endDialog=false
         },
-        finish(val,tit){     //结项
+        finish(val,tit){     //结项对话框显示
           // console.log(val);
           this.iid=val
           this.tit=tit

+ 3 - 3
src/views/projectManage/ProjectManagement3.vue

@@ -120,7 +120,7 @@
         },
         methods:{
           getData(){
-            console.log(localStorage.getItem('pid'))
+            // console.log(localStorage.getItem('pid'))
             let param={
               uid:this.$store.state.userInfo.userid,
               pid:JSON.parse(localStorage.getItem('pid')),
@@ -130,11 +130,11 @@
               page:this.table.currentPage,
               lim:this.table.packageSize
             }
-            console.log(param);
+            // console.log(param);
             this.ajax
                   .get(this.$store.state.api+'/GetAllActivity',param)
                   .then(res=>{
-                    console.log(res.data);
+                    // console.log(res.data);
                     this.tableData=res.data[0]
                     this.table.total=res.data[4][0].total
                   },err=>{

+ 3 - 3
src/views/projectManage/ProjectManagement4.vue

@@ -33,14 +33,14 @@
 
         <el-table-column
           prop="title"
-          label="项目名称"
+          label="活动名称"
           align="center"
           >
         </el-table-column>
 
         <el-table-column
           prop="fileName"
-          label="项目中期报告"
+          label="活动中期报告"
           align="center"
           >
         </el-table-column>
@@ -117,7 +117,7 @@
               this.ajax
                     .get(this.$store.state.api+'/GetActivityFileByProjectId',param)
                     .then(res=>{
-                      console.log(res.data);
+                      // console.log(res.data);
                       let k=[]
                       res.data[0].forEach((e,i) => {
                         let { title: f, reportFile: l } = e;

+ 93 - 27
src/views/projectManage/ProjectManagement5.vue

@@ -18,7 +18,9 @@
       </div>
       <!-- 跳转导航结束 -->
       <div class="pmInp">
-          <el-button type="primary" class="btn" size="mini">上传文件</el-button>
+          <!-- <el-button type="primary" class="btn" @click="addFile" size="mini">上传文件</el-button> -->
+          <beUpload @getFile="getFile"  :navName="'上传文件'" :accept="accept"></beUpload>
+
         </div>
 
         <!-- 表格部分开始 -->
@@ -26,13 +28,19 @@
         :data="tableData"
         tooltip-effect="dark"
         stripe
-        height="500px"
+        height="550px"
         class="fontSize"
         :header-cell-style="{ background: '#f2f2f2',color:'#000' }"
         >
-       
         <el-table-column
-          prop="projectName"
+          prop="projectTitle"
+          label="项目名称"
+          align="center"
+         >
+        </el-table-column>
+
+        <el-table-column
+          prop="fileName"
           label="项目中期报告"
           align="center"
          >
@@ -46,7 +54,7 @@
         </el-table-column>
        
         <el-table-column
-          prop="date"
+          prop="uploadTime"
           label="时间"
           align="center"
           >
@@ -66,37 +74,91 @@
         </el-table>
 
 
-      <div class="pm5footer">
-        <!-- <el-button type="primary" class="backBtn" @click="backBtn2">返回</el-button>
-         -->
-         <el-pagination
+      <!-- 分页 -->
+      <el-pagination
+            @current-change="handleCurrentChange"
+            :current-page="table.currentPage"
+            :page-size="table.packageSize"
+            layout=" prev, pager, next"
             background
-            layout="prev, pager, next"
-            :total="1">
-        </el-pagination>
-      </div>
+            class="pagination"
+            :total="table.total">
+          </el-pagination>
+        <!-- 分页结束 -->
   
     </div>
   </template>
   
   <script>
+  import beUpload from '../../components/tool/beUpload'
+
       export default {
+        components:{beUpload},
         data() {
           return {
-            tableData:[{
-            projectName:'创业孵化基地企业情况信息表',
-            date:'2022年11月12日',
-            size:'50k'
-            },
-            {
-              projectName:'创业孵化基地企业情况信息表',
-              size:'50k',
-              date:'2022年11月12日',
-            }
-            ],
+          accept:".doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
+            table:{         // 分页数据
+              total:0,
+              packageSize:8,
+              currentPage:1
+            }, 
+            tableData:[],  //附件列表
+            file:''
           }
         },
         methods:{
+          getFile(val) {    //上传文件
+            this.file = val;
+            let param={
+                uid:this.$store.state.userInfo.userid,
+                cid:JSON.parse(localStorage.getItem('pid')),
+                projectFile:val
+            }
+            this.ajax
+                  .post(this.$store.state.api+'',param)
+                  .then(res=>{
+                    console.log(res);
+                  },err=>{
+                    console.log(err);
+                  })
+          },
+          handleCurrentChange(val) {   //当页数发生改变的时候调用获取列表数据请求
+            // console.log(`当前页: ${val}`);
+            this.table.currentPage=val
+            this.getData()
+          },
+          getData(){       //获取基础信息
+              let param={
+                uid:this.$store.state.userInfo.userid,
+                pid:JSON.parse(localStorage.getItem('pid')),
+                page:this.table.currentPage,
+                lim:this.table.packageSize
+              }
+              // console.log(param);
+              this.ajax
+                    .get(this.$store.state.api+'/SelectProjectManageFile',param)
+                    .then(res=>{
+                      let file = JSON.parse(res.data[0][0]['endFile']);
+                      file.forEach(item=>item.projectTitle = res.data[0][0]['title'])
+                      console.log(file)
+                      // res.data[0].forEach((e,i) => {
+                        // let { title: f, } = JSON.parse(e.endFile);
+                        // console.log(e.title);
+
+                        // console.log(JSON.parse(e.endFile));
+                        // JSON.parse(e.endFile).title=e.title
+                        // JSON.parse(e.endFile).forEach((o,i)=>{
+                        //     k.title=o.title
+                        // })
+                        // console.log(JSON.parse(e.endFile));
+                        // k.push(Object.assign({title:f},JSON.parse(l)))
+                      // });
+                      this.tableData=file
+                      // console.log(this.tableData);
+                    },err=>{
+                      console.log(err);
+                    })
+          },
           content(){
             this.$router.push('/ProjectManagement1')
           },
@@ -123,15 +185,19 @@
             this.$router.push('/ProjectManagement')
           },
         },
-        created(){
-          // this.value=(this.options[0].value)
+        mounted(){
+          this.getData()
         }
       }
   </script>
   
   <style lang="less">
   .ProjectManagement5{
-
+    .pagination{
+      float: right;
+      margin: 20px 55px 10px;
+    }
+  
 
     .pm5footer{
         float: right;

+ 24 - 25
src/views/projectManage/ProjectManagementFund2.vue

@@ -227,7 +227,7 @@
         data() {
           return {
             fundDetail:false,
-              projectNameOptions:[
+              projectNameOptions:[        //查看详情里面的
                 {
                   value: '1',
                   label: '北京烤鸭'
@@ -237,7 +237,7 @@
                   label: '胡辣汤'
                 },
               ],
-              projectTypeOptions:[
+              projectTypeOptions:[    //查看详情里面的
                   {
                     value: '1',
                     label: '军事'
@@ -247,7 +247,7 @@
                     label: '饮食'
                   },
               ],
-              fundOptions:[
+              fundOptions:[    //查看详情里面的
                   {
                     value: '1',
                     label: '10000'
@@ -262,28 +262,7 @@
                 projectType:'',
                 fund:''
               },
-              tableData:[{
-                projectName:'陆地游泳辅助器',
-                projectPerson:'王多鱼',
-                relevancy:'西虹市',
-                budget:'200万',
-                date:'2022年-11月-12日',
-                tel:'16625153432',
-                status:'已审核',
-                dept:'中德制造'
-              },
-              {
-                projectName:'北极运冰',
-                projectPerson:'王多鱼',
-                relevancy:'西虹市',
-                budget:'500万',
-                date:'2022年-11月-12日',
-                tel:'16625153432',
-                status:'已审核',
-                dept:'中德制造'
-
-              }
-              ],
+              tableData:[],  //列表展示数据
               datas:{
                 budget1:'',   //预算
                 budget2:'',
@@ -298,6 +277,26 @@
           }
         },
         methods:{
+        //   getData(){
+        //   this.ajax.get(this.$store.state.api+"/GetAllActivity",{
+        //     uid:this.$store.state.userInfo.userid,
+        //     pid:JSON.parse(localStorage.getItem('pid')),
+        //     cid:this.pavalues.value1,
+        //     leader:this.pavalues.value2,
+        //     state:this.pavalues.value3,
+        //     page:this.Page.nowPage,
+        //     lim:this.Page.lim,
+        //   }).then(res=>{
+        //     let data = res.data;
+        //     this.tableData = data[0];
+        //     this.options = data[1];
+        //     this.options1 = data[2];
+        //     this.options2 = data[3];
+        //     this.Page.total = data[4][0]['total'];
+        //   }).catch(err=>{
+        //     this.$message.error(err.message)
+        //   })
+        // },
           init(){
             this.fundDetail=false;
           },