<template>
    <a-modal
      title="Set Notified Date"
      width="35%"
      :visible="visible"
      :maskClosable="false"
      switchFullscreen
      @ok = "handleOk"
      @cancel="handleCancel">
        <div>
          <a-card  :body-style="{ padding: '10px' }" :bordered="false" style="margin: 10px;">
            <div class="table-page-search-wrapper">
                <a-form :model="form" :label-col="labelCol" :wrapper-col="wrapperCol" >
                <a-row :gutter="24">
                    <a-col :md="24" :sm="24">
                        <a-form-item label="Notified Date">
                            <a-date-picker v-model:value="form.notified" value-format="YYYY-MM-DD" style="width: 100%;"/>
                        </a-form-item>
                    </a-col>
                </a-row>
            </a-form>
           </div>
        </a-card>
      </div>
    </a-modal>
</template>
<script lang="ts" setup>
    import {ref, reactive } from 'vue';
    import { defHttp } from '/@/utils/http/axios';
    import { message } from 'ant-design-vue';
    import { JDictSelectTag} from '/@/components/Form';
    var visible = ref(false);
    const emit = defineEmits([ 'success']); //定义emit
    var form = ref({
        notified :""
    });
    const labelCol = ref({
        xs: { span: 24 },
        sm: { span: 5 },
    });
    const wrapperCol = ref({
        xs: { span: 24 },
        sm: { span: 19 },
    });
    var fatherIds=ref("");
    function handleOk(){
        let params ={
            ids:fatherIds.value,
            notified:form.value.notified
        }
        defHttp
        .get({ url: '/saleCode/saleOrder/notifiedBatch',params}, { isTransformResponse: false })
        .then((res) => {
            if (res.success) {
                emit('success')
                handleCancel()
            }else{
                message.error(res.message);
            }
        })
    }
    function handleCancel(){
        visible.value = false;
        form.value.notified=''
        fatherIds.value = ''
    }
    function getTable(ids){
        visible.value = true
        fatherIds.value = ids
    }
    defineExpose({
        getTable
    });
</script>
<style scoped lang="less">
/deep/.ant-form-item{
    margin-bottom: 8px !important;
}
// /deep/.ant-table-wrapper .ant-table-thead > tr > th, .ant-table-wrapper .ant-table-thead > tr > td{
//     padding: 8px !important;
// }

</style>