<template>
  <div>
    <xy-dialog ref="dialog" :width="50" :is-show.sync="isShow" :type="'form'" title="核对缴费单"
      :form="form">
      <template v-slot:fee_status>
        <div class="xy-table-item" style="padding:0">
          <div class="xy-table-item-label" style="font-weight: bold;width:0;padding:0">
            <span style="color: red;font-weight: bold;padding-right: 4px;"></span>
          </div>
          <div class="xy-table-item-content" style="flex-grow:1;text-align:center" v-if="row.fee_files && row.fee_files.length>0">
            <div v-for="item in row.fee_files">
              <img style="height:300px" :src="item.url" alt="">
            </div>
            <div>
              <el-button type="primary" style='margin:15px;' @click="updateFee(1)">已缴</el-button>
              <el-button type="primary" plain style='margin:15px;' @click="updateFee(2)">未缴</el-button>
            </div>
          </div>
        </div>
      </template>

      <template v-slot:footerContent>
        <div></div>
      </template>

    </xy-dialog>

  </div>
</template>

<script>
  import {save} from "@/api/apply/index"
  export default {
    components: {

    },
    data() {
      return {
        isShow: false,
        type: 'add',
        id: '',
        row:{},
        type_options: [{
          id: 1,
          value: '已缴'
        }, {
          id: 2,
          value: '未缴'
        }],
        form: {
          fee_status: '',
        },
      }
    },
    created() {},
    methods: {
      updateFee(status){
        console.log("status",status)
        save({
          id:this.row.id,
          fee_status:status,
        }).then(res => {
          this.$message({
            type: 'success',
            message: '核对成功'
          })
          this.isShow = false
          this.$emit('refresh')
        })
      },
    },
    watch: {
      isShow(newVal) {
        if (newVal) {

        } else {
          this.row = {}
        }
      },
    }

  }
</script>

<style scoped lang="scss">
  ::v-deep .fee_status{
    flex-basis: 100%;
  }
</style>
