<template>
    <div id="studentProjectWord">
        <div id="title">
            <div class="school">深圳技师学院</div>
            <div class="wordTitle">学 生 创 客 项 目 申 报 书</div>
            <div class="date">申请日期：{{downWordData.applicationDate}}</div>
        </div>
        <table border="1" cellspacing="0" class="table">
    
          <tr id="projectName">
            <td colspan="2" ref="projectName">项目名称</td><td colspan="5" v-text='downWordData.projectName'></td>
          </tr>
          <tr id="radio">
            <td rowspan="2" colspan="2" ref="radio">项目分组</td><td v-text="downWordData.radio=='ed917c55-f51d-11ed-a3f6-509a4c5b67cf'?'√ 创意组':'□ 创意组'">
            </td>
            <td colspan="4">立项项目为新立项项目，项目成果应具有较好的创意和较为成型的产品原型或能提供较好的商业模式，产生较好的社会效益。</td>
          </tr> 
          <tr>
            <td v-text="downWordData.radio=='ed917c55-f51d-11ed-a3f6-509a4c5b67cf'?'□ 初创组':'√ 初创组'">
            </td>
            <td colspan="4">立项项目为学校已结题学生创客项目或已入驻学校创业孵化基地的学生初创企业项目（毕业两年内），项目成果应为原结题项目基础上的技术升级、企业注册、规模扩张。</td>
          </tr> 
          <tr id="checkList" class="checkArea">
            <td colspan="2" ref="checkList">优先支持项目（可多选）</td> <td colspan="5">
              <span><span v-text="downWordData['checkList'].indexOf('1')!=-1?'√ ':'□ '"></span><span>大赛选拔项目</span></span>
              <span><span v-text="downWordData['checkList'].indexOf('2')!=-1?'√ ':'□ '"></span><span>落地注册项目</span></span>
              <span><span v-text="downWordData['checkList'].indexOf('3')!=-1?'√ ':'□ '"></span><span>社会征集项目</span></span>
              <span><span v-text="downWordData['checkList'].indexOf('4')!=-1?'√ ':'□ '"></span><span>产业命题项目</span></span>
              
              <!-- <el-checkbox-group v-model="downWordData.checkList">
                <el-checkbox label="1">大赛选拔项目</el-checkbox>
                <el-checkbox label="2">大赛选拔项目</el-checkbox>
                <el-checkbox label="3">社会征集项目</el-checkbox>
                <el-checkbox label="4">产业命题项目</el-checkbox>
              </el-checkbox-group> -->
            </td>
          </tr>
          <tr id="schoolRadio" class="checkArea">
            <td colspan="2" ref="schoolRadio">美丽校园改造项目（特色项目）</td> <td colspan="5">
              <span><span v-text="downWordData['schoolRadio']=='1'?'√ ':'□ '"></span><span>校园安全项目</span></span>
              <span><span v-text="downWordData['schoolRadio']=='2'?'√ ':'□ '"></span><span>环境治理项目</span></span>
              <span><span v-text="downWordData['schoolRadio']=='3'?'√ ':'□ '"></span><span>校园服务项目</span></span>
              <span><span v-text="downWordData['schoolRadio']=='4'?'√ ':'□ '"></span><span>文创装置项目</span></span>
              <!-- <el-radio v-model="downWordData.schoolRadio" label="1">校园安全项目</el-radio>
              <el-radio v-model="downWordData.schoolRadio" label="2">环境治理项目</el-radio>
              <el-radio v-model="downWordData.schoolRadio" label="3">校园服务项目</el-radio>
              <el-radio v-model="downWordData.schoolRadio" label="4">文创装置项目</el-radio> -->
            </td>
          </tr>
          <tr id="applyParsonRadio">
            <td colspan="2" ref="applyParsonRadio" >项 目 申 请 人</td><td colspan="2">
              <span v-text="downWordData['applyParsonRadio']=='1'?'√ ':'□ '"></span><span>在校学生</span>
              <!-- <el-radio v-model="downWordData.applyParsonRadio" label="1">在校学生</el-radio> -->
            </td><td colspan="3">
              <span v-text="downWordData['applyParsonRadio']=='2'?'√ ':'□ '"></span><span>入驻学校孵化基地的初创企业法人</span>
              <!-- <el-radio v-model="downWordData.applyParsonRadio" label="2">入驻学校孵化基地的初创企业法人</el-radio> -->
            </td>
          </tr>
          <tr id="applyParsonName">
            <td colspan="2" ref="applyParsonName">申 请 人 姓 名</td><td colspan="1" v-text="downWordData.applyParsonName">
            </td>
            <td ref="college">参与学院/公司</td><td v-text="downWordData.dp">
            </td><td ref="tel">联系电话</td><td v-text="downWordData.tel"></td>
          </tr>
          <tr id="beginTime">
            <td colspan="2" ref="beginTime">项 目 起 始 时 间</td><td colspan="2" v-text="downWordData.beginTime.split(' ')[0]"></td>
            <td ref="endTime">计划完成时间</td><td colspan="2" v-text="downWordData.endTime.split(' ')[0]"></td>
          </tr>
          <tr>
            <td colspan="2">项 目 组 人 数</td><td v-text="downWordData.studentS.length + downWordData.teacherS.length"></td>
            <td>参与学生人数</td><td v-text='downWordData.studentS.length'> </td>
            <td>参与教师人数</td><td v-text="downWordData.teacherS.length"></td>
          </tr>
          <tr id="studentS">
            <td :rowspan="downWordData.studentS.length+1" ref="studentS">项目组学生成员（至少2个学院以上学生构成，团队5人以上）</td><td>姓名</td><td colspan="2">所在学院/部门/专业</td><td colspan="3">项目组角色分工</td>
          </tr>
          <tr style="position: relative;" v-for="(item,index) in downWordData.studentS" :key="index+'a'">
            <td v-text="item.name"></td>
            <td colspan="2" v-text="item.collage"></td>
            <td colspan="3" v-text="item.work"></td>
          </tr>
          <tr id="teacherS">
            <td :rowspan="downWordData.teacherS.length+1" ref="teacherS">项目组指导教师（2个学院以上，团队2-3人）</td><td>姓名</td><td colspan="2">所在学院/部门/专业</td><td colspan="3">项目组角色分工</td>
          </tr>
          <tr style="position: relative !important;" v-for="(item,index) in downWordData.teacherS" :key="index+'b'">
            <td v-text="item.name"></td>
            <td colspan="2" v-text="item.collage"></td>
            <td colspan="3" v-text="item.work"></td>
          </tr>
          <tr id="brief">
            <td rowspan="5" ref="brief">研发内容</td><td colspan="6" class="textLeft">
              <p>项目简介（200-300字）</p>
              <span>
                {{ downWordData.brief }}
              </span>
            </td>
          </tr>
          <tr>
            <td style="text-align: left;" colspan="6" class="textLeft">
              <p>项目研发背景</p>
              <span v-text="downWordData.introduce.back"></span>
            </td>
          </tr>
          <tr>
            <td style="text-align: left;" colspan="6" class="textLeft">
              <p>项目创新点</p>
              <span v-text="downWordData.introduce.innovate"></span>
            </td>
          </tr>
          <tr>
            <td style="text-align: left;" colspan="6" class="textLeft">
              <p>技术研发路线</p>
              <span v-text="downWordData.introduce.path"></span>
            </td>
          </tr>
          <tr>
            <td style="text-align: left;" colspan="6" class="textLeft">
              <p>项目应用场景 </p>
              <span v-text="downWordData.introduce.scene"></span>
            </td>
          </tr>
          <tr>
            <td>商业模式及社会价值</td>
            <td style="text-align: left;" colspan="6" class="textLeft">
              <p>项目商业模式/社会价值</p>
              <span v-text="downWordData.introduce.worth"></span>
            </td>
          </tr>
          <tr>
            <td>团队优势</td>
            <td style="text-align: left;" colspan="6" class="textLeft">
              <p>团队构成及优势</p>
              <span v-text='downWordData.introduce.team'></span>
            </td>
          </tr>
          <tr>
            <td>研发成本</td>
            <td style="text-align: left;" colspan="6" class="textLeft">
              <p>研发成本来源及构成</p>
              <span v-text="downWordData.introduce.cost"></span>
            </td>
          </tr>
          <tr>
            <td rowspan="3">预期成果</td>
            <td style="text-align: left;" colspan="6" class="textLeft">
              <p>项目预期成果、数量及形式（产品原型/发明专利/双创竞赛/成果转化/社会效益）</p>
              <span v-text="downWordData.introduce.expectResults"></span>
            </td>
          </tr>
          <tr class="textLeft">
            <td style="text-align: left;" colspan="6">
              <p>学生创客人才培养预期成果、数量（教师填写）</p>
              <span v-text="downWordData.introduce.expectResultsTeacher"></span>
            </td>
          </tr>
          <tr class="textLeft">
            <td style="text-align: left;" colspan="6">
              <p>项目预期孵化、转化创业项目情况</p>
              <span v-text="downWordData.introduce.expectConversion"></span>
            </td>
          </tr>
          <tr>
            <td>实施计划</td>
            <td style="text-align: left;" colspan="6" class="textLeft">
              <span v-text="downWordData.introduce.plan"></span>
            </td>
          </tr>
          <tr id="fund">
            <td rowspan="12" ref="fund">预算经费</td><td>总经费</td><td colspan="5" v-text="reversedMessage==0?'':reversedMessage"></td>
          </tr>
          <tr>
            <td>支出类别</td><td colspan="2">支出项目</td><td>金额（元）</td><td colspan="4">备 注</td>
          </tr>
          <tr>
            <td rowspan="5">直接费用</td>
          </tr>
          <tr>
            <td colspan="2">小型仪器设备费</td>
            <td v-text="downWordData.fund.facility">
            </td><td colspan="2">
              项目开展所需的小型专用仪器设备、工具、配件购置或租赁费用。
            </td>
          </tr>
          <tr>
            <td colspan="2">材料费</td><td v-text="downWordData.fund.materials">
            </td><td colspan="2">
              项目开展需消耗的各种原材料、辅助材料等低值易耗品的采购费用。
            </td>
          </tr>
          <tr>
            <td colspan="2">测试化验加工费</td><td v-text="downWordData.fund.process">
            </td><td colspan="2">
              项目开展过程中支付给外单位的检验、测试、化验、计算、分析及加工费等费用。
            </td>
          </tr>
          <tr>
            <td colspan="2">项目协作费</td><td v-text="downWordData.fund.assist">
            </td><td colspan="2">
              按合同规定支付给协作单位的费用
            </td>
          </tr>
    
          <tr>
            <td rowspan="5">间接费用</td>
          </tr>
          <tr>
            <td colspan="2">项目成果鉴定费</td><td v-text="downWordData.fund.authenticate">
            </td><td colspan="2">
              学术会务费、评审费、鉴定费、成果集制作费等费用。
            </td>
          </tr>
          <tr>
            <td colspan="2">参展参赛费</td><td v-text="downWordData.fund.match">
            </td><td colspan="2">
              参加创客展会、竞赛等所需的报名费、展位费、布展费、宣传推广费及差旅费等费用。
            </td>
          </tr>
          <tr>
            <td colspan="2">创客交流活动费</td><td v-text="downWordData.fund.activity">
            </td><td colspan="2">
              创客交流活动中支付给校外专家的指导费、咨询费、授课费等费用。
            </td>
          </tr>
          <tr>
            <td colspan="2">知识产权事务费</td><td v-text="downWordData.fund.affair">
            </td><td colspan="2">
              论文版面费、专利及其他知识产权事务等费用。
            </td>
          </tr>
          <tr>
            <td>所在学院/部门意见</td><td colspan="6" class="textLeft" style="height:200px">
                <div style="text-align: right;font-size: 18px;width: 80%;margin-bottom: 20px;">负责人签章：</div>
                <div style="text-align: right;font-size: 18px;width: 90%;">年&nbsp;&nbsp;&nbsp; 月 &nbsp;&nbsp;&nbsp;日</div>
            </td>
          </tr>
          <tr>
            <td>财务部门意见</td><td colspan="6" class="textLeft" style="height:200px">
                <div style="text-align: right;font-size: 18px;width: 80%;margin-bottom: 20px;">负责人签章：</div>
                <div style="text-align: right;font-size: 18px;width: 90%;">年&nbsp;&nbsp;&nbsp; 月 &nbsp;&nbsp;&nbsp;日</div>
            </td>
          </tr>
          <tr>
            <td>创新创业学院审核意见</td><td colspan="6" class="textLeft" style="height:200px">
                <div style="text-align: right;font-size: 18px;width: 80%;margin-bottom: 20px;">负责人签章：</div>
                <div style="text-align: right;font-size: 18px;width: 90%;">年&nbsp;&nbsp;&nbsp; 月 &nbsp;&nbsp;&nbsp;日</div>
            </td>
          </tr>
        </table>
          <div class="notes">
            <span>备注：</span>
            <span>1.表格可顺延或另附页。</span>
            <span>2.优先支持项目需提供与研发项目相关的实证材料并查看原件。</span>
            <span>3.初创组已结题项目申请需提供结题验收证明、初创企业申请需提供入驻学校孵化基地协议书及公司营业执照。</span>
          </div>
          <el-button style="margin-top:20px" type="primary" @click="work">下载表格</el-button>
    </div>
    </template>
      
    <script>
      import {getWord} from '@/components/tool/getWord'
      export default {
        data() {
          return {
              downWordData:{
                applicationDate:'',//申请日期
                projectName:'',
                radio:'',
                checkList:[],
                schoolRadio:'',
                applyParsonRadio:'',
                applyParsonName:'',
                college:'',
                tel:'',
                beginTime:'',
                endTime:'',
                studentS:[
                    {name:'',collage:'',work:''},
                    {name:'',collage:'',work:''},
                    {name:'',collage:'',work:''},
                    {name:'',collage:'',work:''},
                    {name:'',collage:'',work:''},
                    {name:'',collage:'',work:''},
                ],
                teacherS:[
                    {name:'',collage:'',work:''},
                    {name:'',collage:'',work:''},
                ],
                brief:'',
                introduce:{
                    back:'',
                    innovate:'',
                    path:'',
                    scene:'',
                    worth:'',
                    team:'',
                    cost:'',
                    expectResults:'',
                    expectResultsTeacher:'',
                    expectConversion:'',
                    plan:''
                },
                total:'',
                fund:{
                    facility:'',
                    materials:'',
                    process:'',
                    assist:'',
                    authenticate:'',
                    match:'',
                    activity:'',
                    affair:''
                }
              },
              
            }
        },
        methods: {
          work(){
            this.$message.info("正在下载表格")
            getWord(this.downWordData)
          },
          getData(){
              let param={
                  uid:this.$store.state.userInfo.userid,
                  pid:this.$route.query['pid']
              }
              this.ajax
              .get(this.$store.state.api+'/studentProjectData',param)
              .then(res=>{
                  let data=res.data[0][0];
                  let wordData = {};
                  wordData.projectName=data.title;
                  wordData.radio=data.typeName;
                  wordData.checkList=JSON.parse(data.multiSelectProject);
                  wordData.schoolRadio=data.schoolRemould;
                  wordData.applyParsonRadio=data.projectApplyperson;
                  wordData.applyParsonName=data.pro_leader;
                  wordData.college=data.classid;
                  wordData.tel=data.phone;
                  wordData.beginTime=data.bTime;
                  wordData.endTime=data.eTime;
                  wordData.studentS=JSON.parse(data.course_student);
                  wordData.teacherS=JSON.parse(data.course_teacher);
                  wordData.brief=data.brief;
                  wordData.introduce=JSON.parse(data.chapters)
                  wordData.fund=JSON.parse(data.money)
                  this.downWordData={...wordData,...{etime:data.eTime,btime:data.bTime,dp:data.className}}
              },err=>{
                  console.log(err);
              })
          },
        },
        computed:{   //经费总合
          reversedMessage: function () {
            let num = 0;
            for(let i in this.downWordData.fund)num+=Number(this.downWordData.fund[i]);
            return num;
          }
        },
        mounted(){
          this.getData();
        }
      };
    </script>
      
    <style lang="less" scoped>
    #studentProjectWord{
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        background-color: #ffff;
        margin: 0;
        padding: 40px 100px;
        box-sizing:border-box;
        #title{
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            position: relative;
            // margin-top: 40px;
            .school{
                font-size: 2.5em;
                font-weight: bold;
                letter-spacing: 20px;
            }
            .wordTitle{
                font-size: 2em;
                letter-spacing: .15em;
                margin-bottom:40px ;
            }
            .date{
    
                font-size: 1em;
                position: absolute;
                bottom: 0;
                right: 100px;
                font-weight: bold;
            }
        }
        .table{
            border: none;
            width: 100%;
            border-top: solid 1px black;
            border-right:  solid 1px black;
            border-left:  solid 1px black;
            .textLeft{
              text-align: left ;
              vertical-align: top;
              position: relative;
              max-width:100% ;
              height: 200px;
              // white-space: nowrap;
              span{
                // white-space: nowrap;
                word-wrap: break-word;
                word-break: break-all;
              }
              :deep(.el-textarea__inner){
                border: none ;
                border-radius: 0px;
                text-align: left !important;
                font-size: 16px;
              }
            }
            tr{
              position: relative;
              td{
                border: none;
                border-bottom: solid 1px black;
                border-right: solid 1px black;
                height: 50px;
                text-align: center;
                line-height: 30px;
                width: 70px;
                box-sizing: border-box;
                padding: 5px;
              p{
                font-weight: 600;
              }
              :deep(.el-select .el-input .el-select__caret){
                display: none;
              }
              :deep(.el-textarea__inner){
                // padding: 0;
                border: none ;
                border-radius: 0px;
                text-align: center;
                font-size: 16px;
              }
              :deep(.el-input__inner){
                border: none ;
                border-radius: 0px;
                text-align: center;
                font-size: 16px;
              }
              :deep(input)::-webkit-outer-spin-button,
              :deep(input)::-webkit-inner-spin-button {
                -webkit-appearance: none;
              }
              :deep(input)[type="number"]{
                  -moz-appearance: textfield;
              }
            }
          }
            
        }
        .notes{
          width: 100%;
          display: flex;
          flex-direction:column;
        }
        
    }
      .checkArea{
        td{
          span{
          margin-left: 50px;
          span{
            margin: 0;
          }
        }
        }

      }
    
    </style>