<template>
<div class="failModel"  style="width:665px; margin:0 auto;padding: 20px 90px 0 70px;">
  <Form ref='form' :model="info">
     <Row class="code-row-bg" >
       <Col span="24">
         <Form-item
           label="内容:"
           prop="errorMessage"
           :rules="[{ required: true, message: '请输入内容', trigger: 'blur' }]"
         >
           <Input
             v-model="info.errorMessage"
             type="textarea"
             :autosize="{minRows: 2,maxRows: 5}"
             placeholder="请输入内容"
           ></Input>
         </Form-item>
       </Col>
     </Row>
     <div style="text-align: center;">
       <Button type="warning" @click="save" >{{"保存"}}</Button>
       <Button @click="close">关闭</Button>
     </div>
   </Form>
   </div>
</template>

<script>
export default {
  props:{
    server: {
      type: Object,
      default() {
        return {};
      }
    },
    commet: {
      type: String,
      default() {
        return "";
      }
    },
    payLineDetailIds:{
      type:Array,
      default(){
        return []
      }
    },
    title:{
      type: String,
        default() {
          return "";
      }
    },
    btnName:{
      type: String,
      default() {
        return "";
      }
    }
  },
  data(){
    return{
      info:{
        errorMessage:this.commet
      }
    }
  },
  created(){
    this.$emit("SetTitle",this.title);
    this.$emit("SetPageSize", 700);
  },
  methods:{
    save(){
      let self = this;
      this.$refs.form.validate(valid => {
        if (!valid) {
          return;
        }})
        self.server[self.btnName]({
          errorMessage:self.info.errorMessage,
          payLineDetailIds:self.payLineDetailIds
        }).then(res=>{
          if(res.code=='1'){
            this.$Message.success("操作成功");
            this.$emit("Close", "success");
          }else{
            this.$Message.success(res.msg||'操作失败');
          }
        })
    },
    close() {
      this.$emit("Close");
    },
  }
}
</script>

<style lang="less" scoped>
 .failModel .ivu-input-wrapper{
    width: 80% !important;
 }
</style>
