<template>
  <el-dialog v-model="beiZhuDialog" title="备注" @closed="emit('close')">
    <el-input v-model="beiZhu" :maxlength="100" show-word-limit type="textarea"></el-input>
    <el-divider></el-divider>
    <el-button type="success" @click="baoCunClick">保存</el-button>
  </el-dialog>
</template>

<script name="BeiZhu" setup>
import {ref} from 'vue'
import {setlModifyReq} from '@/api/medical-insurance/si-setl-upload'
import {stringNotBlank} from "@/utils/blank-utils";

const emit = defineEmits(['baoCunHouGuanBi', 'close'])
const props = defineProps({
  data: {},
})

let beiZhuDialog = $ref(true)
const beiZhu = ref('')

const baoCunClick = () => {
  props.data.reqRemark = beiZhu.value
  setlModifyReq(props.data).then((res) => {
    emit('close')
    emit('baoCunHouGuanBi')
    beiZhu.value = ''
  })
}

onMounted(() => {
  if (stringNotBlank(props.data.dataChanges)) {
    beiZhu.value = props.data.dataChanges
  }
})

</script>

<style scoped></style>
