G<template>
  <div>
    <!-- 签名弹窗 -->
    <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="signForm" :model="form" :rules="rules" label-width="120px">
        <el-row>
          <el-col :span="24">
            <el-form-item :label="$t('form.qmyy')" prop="qmyy">
              <el-input type="text" v-model="form.qmyy" maxlength="50" readonly
                :placeholder="$t('form.placeholderInput')" />
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item :label="$t('form.remark')" prop="remark">
              <el-input type="textarea" v-model="form.remark" :rows="2" maxlength="500"
                :placeholder="$t('form.placeholderInput')">
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item :label="$t('form.signer')">
              <el-input type="text" v-model="form.qmrMc" maxlength="50" readonly
                :placeholder="$t('form.placeholderInput')" />
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item :label="$t('form.password')" prop="qmrmm">
              <el-input type="password" v-model="form.qmrmm" maxlength="20" :placeholder="$t('form.placeholderInput')" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="save">{{ $t('form.confirm') }}</el-button>
        <el-button @click="cancel">{{ $t('form.cancel') }}</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: "Sign",
  components: {  },
  data() {
    return {
      title:'',
      open: false,
      form: {
        qmyy:'',
        remark:'',
        qmrId:'',
        qmrMc:'',
        qmrmm:''
      },
      rules: {
        qmrmm: [{
          required: true,
          message: ' ',
          trigger: 'blur'
        }]
      }
    }
  },
  computed: {
  },
  created() {
  },
  methods: {
    show(title,qmyy) {
      this.title = title
      this.form = {
        qmyy:qmyy,
        remark:'',
        qmrId:this.$store.getters.id,
        qmrMc:this.$store.getters.nickName,
        qmrmm:''
      }
      this.resetForm("signForm")
      this.open = true
    },
    cancel() {
      this.open = false
    },
    save() {
      this.$refs["signForm"].validate(valid => {
        if (valid) {
          this.$emit('callback',this.form)
        }
      })
    }
  }
}
</script>
