<template>
  <div>
    <el-dialog :visible.sync="visible" :append-to-body="appendToBody" :before-close="beforeClose" title="头像" width="370px" destroy-on-close>
      <el-form>
        <el-form-item prop="TERRITORIALITY" label="是否通过 ">
          <el-select v-model="value" placeholder="请选择">
            <el-option label="是" value="1"/>
            <el-option label="否" value="0"/>
          </el-select>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="visible = false">关 闭</el-button>
        <el-button type="primary" @click="sendMessage()">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import vueQr from 'vue-qr'
import Treeselect from '@riophae/vue-treeselect'
import { requestFN } from '@/utils/request'

export default {
  components: { Treeselect, vueQr },
  props: {
    appendToBody: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      visible: false,
      loading: false,
      value: null,
      heirloom: {}
    }
  },
  methods: {
    init(e) {
      this.visible = true
      this.heirloom = JSON.stringify(e)
    },
    beforeClose() {
    },
    sendMessage(row) {
      requestFN(
        '/xgf/user/approve',
        {
          list: this.heirloom,
          STATUS: this.value,
          tm: new Date().getTime()
        }
      ).then((data) => {
        this.$message.success('推送成功')
        this.visible = false
        this.$emit('refresh', '')
      })
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
