yuanyiming 2 лет назад
Родитель
Сommit
35a1303611

+ 2 - 2
src/components/studentProjectWord.vue

@@ -22,13 +22,13 @@
       </tr>
       <tr id="radio">
         <td rowspan="2" colspan="2" ref="radio">项目分组</td><td>
-          <el-radio v-model="wordData.radio" label="1">创意组</el-radio>
+          <el-radio v-model="wordData.radio" label="ed917c55-f51d-11ed-a3f6-509a4c5b67cf">创意组</el-radio>
         </td>
         <td colspan="4">立项项目为新立项项目,项目成果应具有较好的创意和较为成型的产品原型或能提供较好的商业模式,产生较好的社会效益。</td>
       </tr> 
       <tr>
         <td>
-          <el-radio v-model="wordData.radio" label="2">初创组</el-radio>
+          <el-radio v-model="wordData.radio" label="f3068e26-f51d-11ed-a3f6-509a4c5b67cf">初创组</el-radio>
         </td>
         <td colspan="4">立项项目为学校已结题学生创客项目或已入驻学校创业孵化基地的学生初创企业项目(毕业两年内),项目成果应为原结题项目基础上的技术升级、企业注册、规模扩张。</td>
       </tr> 

+ 42 - 38
src/components/tool/getWord.js

@@ -4,6 +4,7 @@ import { getNowDate } from './Date';
 import { GetTime } from './Date';
 import FileSaver, { saveAs } from 'file-saver';
 import JSZipUtils from 'jszip-utils'
+// import {getNowDate} from '@/components/tool/Date.js'
 
 // import HTMLModule from 'docx'
 function MakerSpaceWord(data,fund){
@@ -460,49 +461,52 @@ function getWord(val){
         let zip=new PizZip(content);
 
         let doc=new Docxtemplater().loadZip(zip);
-        // return console.log(val);
-         console.log(val);
+        return console.log(val);
+
+        let studentS=JSON.parse(val.course_student)
+        let teacherS=JSON.parse(val.course_teacher)
+        let introduce=JSON.parse(val.chapters)
+        let multiSelectProject=JSON.parse(val.multiSelectProject)
 
-        
 
         //填写数据
         doc.setData({
-            nowTime:val.applicationDate,
-            projectName:val.projectName,
-            ing:val.radio=='1'?'√':'□',
-            ed:val.radio=='2'?'√':'□',
-            mone:val.checkList.includes('1')?'√':'□',
-            mtwo:val.checkList.includes('2')?'√':'□',
-            mthree:val.checkList.includes('3')?'√':'□',
-            mfour:val.checkList.includes('4')?'√':'□',
-            sone:val.schoolRadio.includes('1')?'√':'□',
-            stwo:val.schoolRadio.includes('2')?'√':'□',
-            sthree:val.schoolRadio.includes('3')?'√':'□',
-            sfour:val.schoolRadio.includes('4')?'√':'□',
-            stu:val.applyParsonRadio.includes('1')?'√':'□',
-            leg:val.applyParsonRadio.includes('2')?'√':'□',
-            appPeason:val.applyParsonName,
-            school:val.college,
-            tel:val.tel,
-            begin_at:val.beginTime,
-            plannedEnd_at:val.endTime,
-            allnum:val.studentS.length+val.teacherS.length,
-            snum:val.studentS.length,
-            tnum:val.teacherS.length,
-            student:val.studentS,
-            teacher:val.teacherS,
+            nowTime:getNowDate(1),//申请日期
+            projectName:val.title,
+            ing:val.typeName=='ed917c55-f51d-11ed-a3f6-509a4c5b67cf'?'√':'□',
+            ed:val.typeName=='f3068e26-f51d-11ed-a3f6-509a4c5b67cf'?'√':'□',
+            mone:multiSelectProject.includes('1')?'√':'□',
+            mtwo:multiSelectProject.includes('2')?'√':'□',
+            mthree:multiSelectProject.includes('3')?'√':'□',
+            mfour:multiSelectProject.includes('4')?'√':'□',
+            sone:val.schoolRemould.includes('1')?'√':'□',
+            stwo:val.schoolRemould.includes('2')?'√':'□',
+            sthree:val.schoolRemould.includes('3')?'√':'□',
+            sfour:val.schoolRemould.includes('4')?'√':'□',
+            stu:val.projectApplyperson.includes('1')?'√':'□',
+            leg:val.projectApplyperson.includes('2')?'√':'□',
+            appPeason:val.pro_leader,
+            school:val.name,
+            tel:val.phone,
+            begin_at:val.begin_at,
+            plannedEnd_at:val.plannedEnd_at,
+            allnum:studentS.length+teacherS.length,
+            snum:studentS.length,
+            tnum:teacherS.length,
+            student:studentS,
+            teacher:teacherS,
             brief:val.brief,
-            back:val.introduce.back,
-            innovate:val.introduce.innovate,
-            path:val.introduce.path,
-            scene:val.introduce.scene,
-            worth:val.introduce.worth,
-            team:val.introduce.team,
-            cost:val.introduce.cost,
-            expectResults:val.introduce.expectResults,
-            expectResultsTeacher:val.introduce.expectResultsTeacher,
-            expectConversion:val.introduce.expectConversion,
-            plan:val.introduce.plan,
+            back:introduce.back,
+            innovate:introduce.innovate,
+            path:introduce.path,
+            scene:introduce.scene,
+            worth:introduce.worth,
+            team:introduce.team,
+            cost:introduce.cost,
+            expectResults:introduce.expectResults,
+            expectResultsTeacher:introduce.expectResultsTeacher,
+            expectConversion:introduce.expectConversion,
+            plan:introduce.plan,
             total:val.total,
             facility:val.fund.facility,
             materials:val.fund.materials,

+ 11 - 29
src/views/projectApply/newStudentProjectApply.vue

@@ -47,12 +47,12 @@
         submitHint:false,
         wordData:{
           applicationDate:getNowDate(1),//申请日期
-          projectName:'',
-          radio: '',
-          checkList:[],
-          schoolRadio:'',
-          applyParsonRadio:'',
-          applyParsonName:'',
+          projectName:'元宇宙',
+          radio: '1',
+          checkList:['1','2'],
+          schoolRadio:'1',
+          applyParsonRadio:'1',
+          applyParsonName:'袁一鸣',
           college:'',
           tel:'16625153232',
           beginTime:'',
@@ -234,32 +234,11 @@
       },
 
       submitWord(){
-              // let pram = {
-              //     uid:this.$store.state.userInfo.userid,//用户ID
-              //     // pNo:result,//项目编号
-              //     tit:this.wordData['projectName'],//项目名称
-              //     radio:this.wordData['radio'],//项目分组
-              //     checkList:JSON.stringify(this.wordData['checkList']),//优先支持项目
-              //     schoolRadio:this.wordData['schoolRadio'],//美丽校园改造项目
-              //     applyParsonRadio:this.wordData['applyParsonRadio'],//项 目 申 请 人
-              //     applyParsonName:this.wordData['applyParsonName'],//申请人姓名
-              //     cid:this.wordData['college'],//学院ID,
-              //     tel:this.wordData['tel'],//联系电话
-              //     beh:this.wordData['beginTime'],//项目开始时间,
-              //     planEnd:this.wordData['endTime'],//计划完成时间,
-              //     cs:JSON.stringify(this.wordData['studentS']),//学生组,
-              //     ct:JSON.stringify(this.wordData['teacherS']),//教师组,
-              //     bf:this.wordData['brief'],//项目简介
-              //     introduce:this.wordData['introduce'],//项目详细
-              //     mon:JSON.stringify(this.wordData['fund']),//预算经费
-              //     f:this.wordData['total'],//总经费
-              //     apply:this.wordData['applicationDate'],//申请日期
-              //   }
-              // return  console.log(pram);
         getProjectNo("XM").then((result)=>{
                 let pram = {
                   uid:this.$store.state.userInfo.userid,//用户ID
                   pNo:result,//项目编号
+                  tid:"5e21b204-c206-11ed-a4cd-509a4c5b67cf",//特色创客空间建设项目分类ID
                   tit:this.wordData['projectName'],//项目名称
                   radio:this.wordData['radio'],//项目分组
                   checkList:JSON.stringify(this.wordData['checkList']),//优先支持项目
@@ -273,7 +252,7 @@
                   cs:JSON.stringify(this.wordData['studentS']),//学生组,
                   ct:JSON.stringify(this.wordData['teacherS']),//教师组,
                   bf:this.wordData['brief'],//项目简介
-                  introduce:this.wordData['introduce'],//项目详细
+                  introduce:JSON.stringify(this.wordData['introduce']),//项目详细
                   mon:JSON.stringify(this.wordData['fund']),//预算经费
                   f:this.wordData['total'],//总经费
                   apply:this.wordData['applicationDate'],//申请日期
@@ -281,12 +260,15 @@
                 this.ajax
                 .post(this.$store.state.api+'/studentProjectWordApply',pram)
                 .then(result=>{
+                  console.log(result);
                   if(result['data']==1){
                     this.$message.success("项目提交成功");
                     this.$router.push('/projectApplication')
                   }else{
                     this.$message.error("项目提交失败");
                   }
+                },err=>{
+                  console.log(err);
                 }).catch(err=>{
                   console.log(err);
                 })

+ 50 - 44
src/views/projectApply/projectApplication.vue

@@ -280,6 +280,28 @@
             </div>
       </el-dialog>
 <!-- 立项审核对话框结束 -->
+
+<!-- 下载申请表开始 -->
+
+      <el-dialog
+        title="下载申请表"
+        :visible.sync="downloadWord"
+        width="600px"
+        class="pageSubmitData">
+        <div class="addDialogLogo">LOGO</div>
+        <div class="deleteContent">确定下载申请表?</div>
+        <span slot="footer" class="dialog-footer">
+          <el-button type="primary" @click="downloadProjectWord" class="AllDialogBtn">下载</el-button>
+          <el-button @click="downloadWord=false" class="AllDialogBtn" >取消</el-button>
+        </span>
+      </el-dialog>
+
+<!-- 下载申请表结束 -->
+
+
+
+
+
 <!-- 删除通知开始 -->
       <el-dialog
       title="删除项目"
@@ -294,40 +316,12 @@
       </span>
       </el-dialog>
 <!-- 删除通知结束-->
-      <!-- 文档预览开始 -->
-        <el-dialog
-        title="文档预览"
-        :visible.sync="WordPreview"
-        width="60%"
-        class="pageSubmitData">
-        <div class="addDialogLogo">LOGO</div>
-        <MakerSpaceWordPreview v-if="PreviewTid == '5f7a66d5-c206-11ed-a4cd-509a4c5b67cf' && WordPreview " :data="PreviewData"/>
-        <studentMakerProjectPreview v-if="PreviewTid == '5e21b204-c206-11ed-a4cd-509a4c5b67cf' && WordPreview" :data="PreviewData"/>
-        <span slot="footer" class="dialog-footer">
-          <el-button type="primary" @click="downWord" class="AllDialogBtn">下载文档</el-button>
-          <el-button @click="WordPreview = false" class="AllDialogBtn" >取消</el-button>
-        </span>
-        </el-dialog>
-        
-      <!-- <el-dialog
-      title="文档预览"
-      :visible.sync="WordPreview"
-      width="60%"
-      class="pageSubmitData">
-      <div class="addDialogLogo">LOGO</div>
-      <MakerSpaceWordPreview v-if="PreviewTid == '5f7a66d5-c206-11ed-a4cd-509a4c5b67cf' && WordPreview" :data="PreviewData"/>
-      <studentMakerProjectPreview v-if="PreviewTid == '2f4c6e78-f2e7-11ed-a3f6-509a4c5b67cf' && WordPreview" :data="PreviewData"/>
-      <span slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="downWord" class="AllDialogBtn">下载文档</el-button>
-        <el-button @click="WordPreview = false" class="AllDialogBtn" >取消</el-button>
-      </span>
-      </el-dialog> -->
-      <!-- 文档预览结束 -->
+
   </div>
 </template>
 
 <script>
-import {MakerSpaceWord,MakerStudentWord} from '@/components/tool/getWord.js'
+import {MakerSpaceWord,MakerStudentWord,getWord} from '@/components/tool/getWord.js'
 import MakerSpaceWordPreview from '@/components/MakerSpaceWordPreview.vue';
 import studentMakerProjectPreview from '@/components/studentMakerProjectPreview.vue'
     export default {
@@ -342,10 +336,10 @@ import studentMakerProjectPreview from '@/components/studentMakerProjectPreview.
           dialogVisible1:false,//立项撤回提交
           dialogVisible2:false,//删除
           WordPreview:false,//文档预览
+          downloadWord:false,//申请表下载
           PreviewTid:"",//预览分类ID
           PreviewData:"",//预览数据
           rejectApplyText:'',  //驳回-修改建议
-
           isManager:0,  //0申请人审核科-----  1管理员审核框
           // 分页数据
           table:{
@@ -406,14 +400,7 @@ import studentMakerProjectPreview from '@/components/studentMakerProjectPreview.
         }
       },
       methods:{
-        downWord(){
-          if(this.PreviewTid=='5f7a66d5-c206-11ed-a4cd-509a4c5b67cf'){
-            MakerSpaceWord(this.PreviewData[0],this.PreviewData[1]);
-          }else{
-            console.log(11);
-            MakerStudentWord(this.PreviewData[0],this.PreviewData[1]);
-          }
-        },
+       
         init(){   
           this.dialogVisible=false;
           this.dialogVisible1=false;
@@ -436,6 +423,7 @@ import studentMakerProjectPreview from '@/components/studentMakerProjectPreview.
             
         },
         appTable(tid,pid){   //查看申请表
+          // console.log();
           if(tid=="5e21b204-c206-11ed-a4cd-509a4c5b67cf"){
             // downloadFile('/file/附件2:2023年学生创客项目申报书模板(2).docx',"2023年学生创客项目申报书模板.docx",(_b)=>this.loading = _b);
             this.ajax.get(this.$store.state.api+"/SelectProjectWordMakerStudent",{
@@ -443,11 +431,17 @@ import studentMakerProjectPreview from '@/components/studentMakerProjectPreview.
               pid:pid
             }).then(res=>{
               // console.log(res['data']);
-              this.PreviewData = [res['data'][0][0],res['data'][1]];
+              let data=res['data']
+              this.downloadWord=true
+              // this.downWord(data)
+              this.PreviewData=data
+              this.PreviewTid = tid;
+
+              // this.PreviewData = [res['data'][0][0],res['data'][1]];
               
               // return console.log(this.PreviewData);
-              this.WordPreview = true;
-              this.PreviewTid = tid;
+              // this.WordPreview = true;
+              // this.PreviewTid = tid;
             }).catch(err=>{
               console.log(err)
             })
@@ -466,8 +460,20 @@ import studentMakerProjectPreview from '@/components/studentMakerProjectPreview.
           }else{
             this.$message.error("错误")
           }
-
-
+        },
+        downloadProjectWord(){
+          if(this.PreviewTid=='5f7a66d5-c206-11ed-a4cd-509a4c5b67cf'){
+            MakerSpaceWord(this.PreviewData[0],this.PreviewData[1]);
+          }else{
+            getWord(this.PreviewData[0][0]);
+          }
+        },
+        downWord(data){
+          if(this.PreviewTid=='5f7a66d5-c206-11ed-a4cd-509a4c5b67cf'){
+            MakerSpaceWord(this.PreviewData[0],this.PreviewData[1]);
+          }else{
+            getWord(data[0][0]);
+          }
         },
         ManagerCommit(){    //立项审核对话框里面的管理员通过按钮
           // console.log(this.iid);