<template>
  <!-- 项目立项申请预算经费表单 -->
    <div class="pAmid3">
      <!-- 左边栏 -->
      <div class="left">
        <div class="sx"> <!--圆球和竖线 -->
          <div class="qiu"></div>
        </div>
      <!-- 左边栏内容开始 -->
        <div class="leftTits">
          <div>月支出计划</div>
          <div>支出明细</div>
          <div>完成</div>
        </div>
      <!-- 左边栏内容结束 -->
      </div>

      <!-- 右边栏 -->
      <div class="right">

          <!-- 预算经费金额开始 -->
          <div class="vfpHeader">
            <div class="titleOne">预算经费</div>
            <el-button @click="back()" type="primary" size="mini">返回</el-button>
          </div>
          <hr>
          <div class="totalFund">
            <div class="totalFundLabel">预算总经费</div>
            <el-input v-model="data.fund" style="width: 180px;" placeholder="请输入内容"></el-input>
            <div style="line-height: 38px;margin-left: 5px;">(万)</div>
          </div>
          <!-- 预算经费金额结束 -->

          <!-- 设置经费和表格开始 -->
            <div class="tabTit">
              <div><p>经费月支出计划</p></div>
              <el-button type="primary">设置经费</el-button>
            </div>
            <el-table
              :data="data.tableData"
              tooltip-effect="dark"
              stripe
              :header-cell-style="{ background: '#f2f2f2',color:'#000' }"
              >             
              <el-table-column
                prop="projectName"
                label="1月"
                align="center"
                >
              </el-table-column>
              <el-table-column
                prop="projectName"
                label="2月"
                align="center"
                >
              </el-table-column>
              <el-table-column
                prop="projectName"
                label="3月"
                align="center"
                >
              </el-table-column>
              <el-table-column
                prop="projectName"
                label="4月"
                align="center"
                >
              </el-table-column>
              <el-table-column
                prop="projectName"
                label="5月"
                align="center"
                >
              </el-table-column>
              <el-table-column
                prop="projectName"
                label="6月"
                align="center"
                >
              </el-table-column>
              <el-table-column
                prop="projectName"
                label="7月"
                align="center"
                >
              </el-table-column>
              <el-table-column
                prop="projectName"
                label="8月"
                align="center"
                >
              </el-table-column>
              <el-table-column
                prop="projectName"
                label="9月"
                align="center"
                >
              </el-table-column>
              <el-table-column
                prop="projectName"
                label="10月"
                align="center"
                >
              </el-table-column>
              <el-table-column
                prop="projectName"
                label="11月"
                align="center"
                >
              </el-table-column>
              <el-table-column
                prop="projectName"
                label="12月"
                align="center"
                >
              </el-table-column>
              <el-table-column
                prop="remark"
                label="备注"
                align="center"
                >
              </el-table-column>
            </el-table>
          <!-- 设置经费和表格结束 -->



          <!-- 经费明细和表格开始 -->
            <div class="tabTit">
              <div><p>经费明细</p></div>
              <el-button type="primary" @click="addBtn">添加</el-button>
            </div>
            <el-table
              :data="data.tableData2"
              tooltip-effect="dark"
              stripe
              height="320px"
              class="fontSize"
              :header-cell-style="{ background: '#f2f2f2',color:'#000' }"
              >
              <el-table-column
                prop="sort"
                label="支出类别"
                align="center"
                >
              </el-table-column>
              <el-table-column
                prop="projectName"
                label="支出项目"
                align="center"
                >
              </el-table-column>
              <el-table-column
                prop="Fund"
                label="金额(元)"
                align="center"
                >
              </el-table-column>
              <el-table-column
                prop="remark"
                label="备注"
                align="center"
                width="300">
              </el-table-column>
             
            </el-table>
          <!-- 经费明细和表格结束 -->


          <div class="baseBtn">
            <div class="blockWidth">
              <el-button type="primary" class="backBtn" @click="back()">上一步</el-button>
              <el-button type="primary" class="backBtn"  @click="submit" >提交</el-button>
            </div>
          </div>
      </div>


    <!-- 经费明细添加按钮开始 -->
    <el-dialog
      title="经费明细"
      :visible.sync="addFundDialog"
      width="950px"
      class="fundDetail"
      :before-close="init">

      <div class="dialogTop">
          <div class="dagSpan">项目名称</div>
          <el-select style="width: 80%;" v-model="data.dialog.projectName" placeholder="请选择">
            <el-option
              v-for="item in data.dialog.nameOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value">
            </el-option>
          </el-select>
      </div>
      <div class="dialogTop">
          <div class="dagSpan">项目类型</div>
          <el-select v-model="data.dialog.value" placeholder="请选择">
            <el-option
              v-for="item in data.dialog.typeOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value">
            </el-option>
          </el-select>
      </div>


      <div class="tabTit">
        <div><p>添加经费明细</p></div>
      </div>
      <div class="dagInpS">
        <div class="dagInpS1">
          <div class="dagSpan">支出类别</div>
          <el-input v-model="data.dialog.type" placeholder="请输入内容"></el-input>
        </div>
        <div class="dagInpS1">
          <div class="dagSpan">支出项目</div>
          <el-input v-model="data.dialog.disburseProject" placeholder="请输入内容"></el-input>
        </div>
        <div class="dagInpS1">
          <div class="dagSpan">金额(元)</div>
          <el-input v-model="data.dialog.fund" placeholder="请输入内容"></el-input>
        </div>
      </div>

      <div class="dagInpS1">
          <div class="dagSpan" style="position:relative;top: -90px;">备注</div>
          <el-input
            type="textarea"
            :rows="5"
            resize="none"
            style="width: 80%;"
            placeholder="请输入内容"
            v-model="data.dialog.textarea">
          </el-input>
      </div>

      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="finish" class="btn5">完成</el-button>
      </div>
    </el-dialog>
    <!-- 经费明细添加按钮结束 -->
  </div>
    
</template>

<script>
import { VueEditor } from "vue2-editor";
    export default {
      // 接收父组件传递回来的方法
      props:["data","next",'back','submitBtn','addFundDetail'],
      components:{
        VueEditor
      },
      data() {
        return {
          addFundDialog:false,
          // 经费明细添加按钮对话框下拉框
          
          
         
          
        }
      },
      methods:{
        
        init(){
          //重置
          this.addFundDialog=false;
        },
        finish(){
            this.addFundDetail()
            this.init()
        },
        backBtn(){
          // alert('333')
          this.next();
        },
        backBtn1(){
          this.back();
        },
        submit(){
          this.submitBtn();
          // this.dialogVisible1=true;
        },
        homeExit(){
          this.$router.push('/login')
        },
        addBtn(){
          this.addFundDialog=true;
        }
      }
    }
</script>

<style lang="less">
//对话框样式

.fundDetail{ //经费明细添加对话框，防止冲突
  .el-dialog__title{    
    font-size: 22px;
    font-weight: 600;
  }
  .el-dialog__body{
    padding-top: 0px;
  }
}



.dialogTop{   //对话框，名称、类型
    margin: 15px 0;
    display: flex;
    width: 80%;
}
.dagSpan{     // 对话框label
  min-width: 84px;
  font-size: 16px;
  margin-right: 10px;
  display: inline-block;
  text-align: justify;
  text-justify:distribute-all-lines;
  text-align-last: justify;
  transform: translate(0,22%);
  margin-bottom: 10px;
}




  .totalFund{   //预算总经费金额填写
    display: flex;
    width: 400px;
    line-height: 25px;
    margin: 15px 5px 30px;
    .totalFundLabel{
      width:90px;
      line-height: 38px;
      margin-right: 10px;
      text-justify:distribute-all-lines;
      text-align-last: justify;
    }
  }

  //经费明细dialog的样式
  .dagInpS{
      display: flex;
      width: 90%;
      margin-top: 20px;
    .dagInpS1{
      font-size: 16px;
      display: flex;
      margin-right: 25px;
      margin-bottom: 20px;
    }
  }
  .pAmid3{
    margin-top: 30px;
    width: 100%;
    display: flex;
    justify-content: center;
    box-sizing: border-box;
  }

.btn5{
  width: 130px;
  margin-right: 50px;
}
</style>