<template>
  <div class="content-main">
    <div class="title-name">
      利润表
    </div>
     <el-form :inline="true" :model="formInline" class="demo-form-inline recordsDetailsTable">
    <div class="flexBox">
      <div class="floatLeft">填报单位：{{formInline.dwmc}}</div>
      <div class="floatRight">
        <span style="color: #FF0000;">*</span>填报期数：<el-date-picker
                :disabled="type == 'ck'"
                v-model="formInline.bbsj"
                type="month"
                placeholder="选择期数"
                format="yyyyMM"
                value-format="yyyyMM">
              </el-date-picker>
		<span style="margin-left: 10px;">单位：元</span>
      </div>
    </div>

      <table>
        <!-- <thead>
          <tr>
            <th>项目</th>
            <th>本期金额</th>
            <th>本年累计</th>
          </tr>
        </thead> -->
        <tbody>
          <tr v-for="(item,index) in formInline.detailList" :key='index'>
            <td>{{item.zbmc}}</td>
			<td v-if="item.zbz1 == '本期金额'">{{item.zbz1}}</td>
            <td v-else>
              <span v-if="type == 'ck' || item.zbmc == ''">{{item.zbz1}}</span>
              <el-input v-else clearable v-model="item.zbz1" placeholder="请输入"></el-input>
            </td>
			<td v-if="item.zbz2 == '本年累计'">{{item.zbz2}}</td>
            <td v-else>
              <span v-if="type == 'ck' || item.zbmc == ''">{{item.zbz2}}</span>
              <el-input v-else clearable v-model="item.zbz2" placeholder="请输入"></el-input>
            </td>
          </tr>
        </tbody>
      </table>
      <div style="text-align: center; margin-top: 20px">
        <!-- <el-button  v-if="type != 'ck'" type="primary"
          icon="iconfont iconchucun iconbaocun" @click="saveZc('0')">保存</el-button>
        <el-button v-if="type != 'ck'" type="primary"
          icon="iconfont icontijiao" @click="saveZc('1')">提交</el-button> -->
        <el-button @click="cancelClick" type="primary"
          icon="iconfont iconfanhui">返回</el-button>
      </div>

    </el-form>
  </div>
</template>

<script>
  import {
    financeReportSave,financeReportUpdate,financeReportInfo
  } from "@/api/cwbb/index";
  export default{
    data() {
      return {
        type:this.$route.query.type,
        formInline:{
          bbm:'03',
          bbsj:'',
           "createDate": "",
            "creator": "",
          "dwdm":sessionStorage.getItem("tyshxydm"),
          "dwmc": sessionStorage.getItem("orgName"),
          "id": "",
          "isDelete": 0,
          "kqdm": sessionStorage.getItem("tyshxydm")+'001',
          "kqmc": sessionStorage.getItem("orgName"),
          "remark": "",
          "status": 0,
          "updateDate": "",
          "updater": "",
          detailList:[
			{
			  zbmc:'项目',
			  zbz1:'本期金额',
			  zbz2:'本年累计',
			},
            {
              zbmc:'一、营业收入',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'减：营业成本',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'税金及附加',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'销售费用',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'管理费用',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'研发费用',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'财务费用',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'其中：利息费用',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'利息收入',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'加：其他收益',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'投资收益（损失以“-”号填列）',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'其中：对联营企业和合营企业的投资收益',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'公允价值变动收益（损失以“-”号填列）',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'资产减值损失（损失以“-”号填列）',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'资产处置收益（损失以“-”号填列）',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'二、营业利润（亏损以“-”号填列）',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'加：营业外收入',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'减：营业外支出',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'三、利润总额（亏损总额以“-”号填列）',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'减：所得税费用',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'四、净利润（净亏损以“-”号填列）',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'（一）持续经营净利润（净亏损以“-”号填列）',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'（二）终止经营净利润（净亏损以“-”号填列）',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'五、其他综合收益的税后净额',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'（一）不能重分类进损益的其他综合收益',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'1．重新计量设定受益计划变动额',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'（二）将重分类进损益的其他综合收益',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'1．权益法下可转损益的其他综合收益',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'2．可供出售金融资产公允价值变动损益',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'3．持有至到期投资重分类为可供出售金融资产损益',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'4．现金流量套期损益的有效部分',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'5．外币财务报表折算差额',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'六、综合收益总额',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'七、每股收益：',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'（一）基本每股收益',
              zbz1:'',
              zbz2:'',
            },
            {
              zbmc:'（二）稀释每股收益',
              zbz1:'',
              zbz2:'',
            }
          ],
        },
      }
    },
   created(){
         this.DetailLst(this.$route.query.id)
       },
       methods:{
         cancelClick(){
           this.$router.push({
             name: "profitSheet",
           });
         },
         DetailLst(id){
           if(id){
             var data={
               id:id
             }
             financeReportInfo(data).then(res =>{
               if(res.infoCode == 200){
                 this.formInline=res.data
               }else{
				   this.$message.error(res.msg);
			   }
             })
           }
         },
       }
     }
   </script>

   <style scoped lang="scss">
   .recordsDetailsTable{
       background-color: #fff;
       font-size: 14px;
       padding-bottom: 20px;
       table {
         width: 100%;
         margin-top: 10px;
         font-size: 14px;
       }

       td,
       th {
         text-align: center;
         border: 1px solid #eaeaea;
         word-wrap: break-word;
         height: 40px;
       }
       span,
       .el-input,
       .el-textarea {
         font-size: 12px;
       }
   }
   .title-name{
     text-align: center;
     font-size: 22px;
     font-weight: 600;
   }
   .line-box{
     display: flex;
   }
   .flexBox{
     line-height: 40px;
     height: 40px;
     text-align: center;
   }
   </style>
