{
    template:'${tmpl}',
    data:function(){
        return {
          id : "",
          pageSize : 500,
          currentPage : 1,
          datalist:[],
          successId:"",
          dialogFormVisible:false,
          form:{
            money:"",
            notes:""
          }
        };
    },
    mounted:function(){
      this.getList();
    },
    created:function(){
    },
    methods:{
      getList() {
        var self = this;
        var params = {
          search : {user_id : this.$root.currentUser.id}
        };
        params.pageInfo={pageSize:this.pageSize,pageNo:this.currentPage};
        params.pageType = 3;
        this.$root.postReq("/web/businessallotCtl/findAndCountAll", params).then(d=>{
          console.log(d);
          if(d.status == 0) {
            self.datalist = self.datalist.concat(d.data.rows);
            console.log("------------------self.datalist------------------");
            console.log(self.datalist);
          }
        });
      },
      edit(id){
        this.successId = id;
        this.dialogFormVisible = true;
      },
      success(){
        if(!this.form.money) {
          this.dialogFormVisible=false;
          this.$alert('请填写成单金额', '提示', {
             confirmButtonText: '确定',
             callback: action => {
             }
           });
          return;
        }
        if(isNaN(this.form.money)) {
          this.dialogFormVisible=false;
          this.$alert('成单金额必须为数字', '提示', {
             confirmButtonText: '确定',
             callback: action => {
             }
           });
          return;
        }
        var params={
          id:this.successId,
          money:this.form.money,
          reason:this.form.notes
        };
        var self=this;
        console.log("------------请求参数--------------");
        console.log(params);
        this.$root.postReq("/web/businessallotCtl/putsuccess",params).then(d=>{
          console.log(d);
          if(d.status==0){
            self.dialogFormVisible=false;
            self.$root.$refs.bottommenu.trigger("dealed");
          }
        });
      },
    },
    vname:"gsb-dealed"
}
