{
  template:'${tmpl}',
  data:function(){
      return {
        multipleSelection: [],
        isSingleSelect:true,
        bizCode:"invoiceapply",
      }
  },
  mounted:function(){

  },
  created:function(){
    console.log(this.codePath);
    if(this.codePath.indexOf("myinvoiceapply")>=0){
      this.bizCode="myinvoiceapply";
    }else{
      this.bizCode="invoiceapply";
      this.isSingleSelect=false;
    }
  },
  methods:{
     onColFormater(row,column,cellvalue,index){
       if(column.property=="created_at"){
         var date = new Date(row["created_at"]);
         var time= date.toLocaleDateString();
         return time;
       }
       return cellvalue;
     },
     handleSelectionChange:function(val){
       this.multipleSelection = val;
       console.log(val);
     },
     onRowClick(row,key,e){
       if(key=="dealing"){
         if(row.invoiceStatus=="finished"){
           this.$message({
              type: 'warning',
              message: '该发票已开具'
            });
            return ;
         }
         if(row.invoiceType=="1"){
           this.$prompt("请填写电子发票链接","",{
             confirmButtonText: '确定',
             cancelButtonText: '取消',
           }).then(({value})=>{
             if(value){
               var that=this;
               this.$root.postReq("/web/invoiceapplyCtl/auditExpress", {id:row.id,opNotes:value}).then(function (d) {
                 if(d.status==0){
                   that.$message({
                      type: 'success',
                      message: '审核成功'
                    });
                   that.$refs.containerGrid.fetchData();
                 }
               })

             }else{
               this.$message({
                  type: 'warning',
                  message: '请输入电子发票链接'
                });
             }
           }).catch(()=>{

           })
         }else{
           this.$prompt("请输入快递单号","",{
             confirmButtonText: '确定',
             cancelButtonText: '取消',
           }).then(({value})=>{
             if(value){
               var that=this;
               this.$root.postReq("/web/invoiceapplyCtl/auditExpress", {id:row.id,opNotes:value}).then(function (d) {
                 if(d.status==0){
                   that.$message({
                      type: 'success',
                      message: '审核成功'
                    });
                   that.$refs.containerGrid.fetchData();
                 }
               })

             }else{
               this.$message({
                  type: 'warning',
                  message: '请输入快递单号'
                });
             }
           }).catch(()=>{

           })
         }
       }
     },

  },
  computed: Vuex.mapState({
    count:state=>state.count,
    headStyle:function(){
      return {"background-color":"white"};
    }
  }),
  vname:"gsb_myinvoiceapply"
}
