<template>
    <div>
      <span class="title-1">销售气量</span>
      <div class="text-1">
       <table>
         <tr>
           <td style="padding-top: 5%">
             <span style="color: #ffff2c;" :class="{'font-res':j0}">{{value}}</span>
             <br/>
             <img :class="{'sell-img0':!j0,'sell-img1':j0}" src="../../../../static/NewManageHome/01.png"/>
             <br/>
             <p :class="{'sell-font':j0}">年度总销售气量</p>
           </td>

         </tr>

       </table>
      </div>
      <img class="img-bottom" src="/static/NewManageHome/2.gif" />
    </div>
</template>

<script>
    import * as Util from "../../../stores/Util";
    import * as DataSql from "../../../stores/DataSql";
    import co from "co";

    export default {
      props: ['orgid'],
      name: "TextSellgas",
      data(){
          return{
            j0:true,
            value:'',
            resdata:''
          }
      },
      methods:{
        searchdata(){
          console.log('营业厅收入-------------------')
          let year = Util.toStandardDateString()
          let startDate = year.toString().substring(0, 4)
          let endDate = parseInt(startDate)+1
          // startDate.toString().substring(0,4)
          let sqldata = DataSql.getData(this,'saleValue',{startDate:startDate,endDate:endDate,orgid:this.orgid}, 'resdata')
          co(sqldata)

        }
      },

      ready(){
        //this.searchdata()
      },
      watch:{
        'resdata': {
          deep: true,
          handler(val) {
            console.log('resdata监听 进入年度销售气量查询====================================')
            console.log(val)
            if(val[0].value==='null'){
              this.value=0
            }else{
              this.value=val[0].value/1000
            }


          }
        },
        'orgid'(val){
          console.log('进入orgid监听=======================')
          console.log(val)
          // this.orgid
          clearInterval(this.timer);
          this.searchdata()
        },
      }
    }
</script>

<style scoped>

</style>
