<template>
    <div ref="viewFileDetailRef">
        <a-modal
            :title="title"
            width="40%"
            :visible="visible"
            :maskClosable="false"
            :getContainer ='()=>$refs.viewFileDetailRef'
            switchFullscreen
            @cancel="handleCancel"
            @ok="handleOk"
            >
                <div>
                  <JUpload v-model:value="obj.attachs" />
                </div>
        </a-modal>
    </div>
  </template>
  
  <script lang="ts" setup>
      import {ref} from 'vue';
      import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
      import {editSignSing} from '../salesOutboundForm.api';
      const emit = defineEmits([ 'success']); //定义emit
      var visible = ref(false);
      var title = ref('')
      var fatherId = ref('')
      var obj=ref({
        attachs:'',
      })
      function getTable(record){
          visible.value = true
          title.value ='签单(Signing)'
          obj.value.attachs = record.signing
          fatherId.value = record.id
      }
      function handleCancel(){
        visible.value = false;  
      }
      async function handleOk(){
        var params = {
          id: fatherId.value,
          signing: obj.value.attachs,
        };
        await editSignSing(params,handleCancel);
        emit('success')
      }
      defineExpose({
        getTable
      });
    </script>
  
  <style lang="less" scoped>
      /** 时间和数字输入框样式 */
    :deep(.ant-input-number) {
      width: 100%;
    }
  
    :deep(.ant-calendar-picker) {
      width: 100%;
    }
    /deep/.ant-modal-body{
      padding: 14px !important;
    }
  </style>
  