<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:'02',
          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:'吸收投资收到的现金',
              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:'',
            }
          ],
        },
      }
    },
    created(){
      this.DetailLst(this.$route.query.id)
    },
    methods:{
      cancelClick(){
        this.$router.push({
          name: "cashFlowSheet",
        });
      },
      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>

