ApproveReason.vue 991 Bytes
<template>
  <BasicModal
    v-bind="$attrs"
    destroyOnClose
    @register="register"
    title="申请原因"
    :helpMessage="['提示1', '提示2']"
    @open-change="handleShow"
    :bodyStyle="{ height: '200px' }"
    @ok="handleOk"
    z-index="9999"
  >
    <a-textarea v-model:value="input" :rows="7" />
  </BasicModal>
</template>
<script lang="ts" setup>
  import { ref, watch } from 'vue';
  import { BasicModal, useModalInner } from '@/components/Modal';
  import { orderAuth } from '/@/api/project/order';

  const emit = defineEmits(['success']);
  const input = ref('');
  const res = ref();
  const [register, { setModalProps, redoModalHeight, closeModal }] = useModalInner(async (data) => {
    res.value = data;
  });
  async function handleOk() {
    res.value.data.applyRemark = input.value;
    await orderAuth(res.value.data);
    emit('success');
    setTimeout(() => {
      closeModal();
    }, 50);
  }
  function handleShow() {
    closeModal();
  }
</script>