diff --git a/src/components/couponDetail.vue b/src/components/couponDetail.vue index be77378..e9fb60f 100644 --- a/src/components/couponDetail.vue +++ b/src/components/couponDetail.vue @@ -490,7 +490,7 @@ import { import { Message } from '@arco-design/web-vue'; const { proxy } = getCurrentInstance(); import dayjs from 'dayjs'; -const emits = defineEmits(['closeChange', 'changeTimeRange', 'freshDetail']); +const emits = defineEmits(['closeChange', 'changeTimeRange', 'freshDetail','changeValue']); const props = defineProps({ // 是否显示 modalVisible: { @@ -556,6 +556,14 @@ const record_columns = [ slotName: 'created_at', }, ]; +const clearDate = () => { + valid_start_time.value = ''; + valid_end_time.value = ''; + emits('changeTimeRange', { + valid_start_time: '', + valid_end_time: '', + }); +}; //关闭启用弹框 const closeChangeOk = () => { isVisible.value = false; @@ -579,7 +587,9 @@ const handleGetProduct = async (name = '', id = '') => { }; const changeType = (val) => { showManjian.value = false; + emits('changeValue','with_amount'); showMinNumber.value = false; + emits('changeValue','min_usable_number'); if (val == 2) { showManjian.value = true; } else if (val == 3) { @@ -588,7 +598,9 @@ const changeType = (val) => { }; const changeValidType = (val) => { showTimeRange.value = false; + clearDate(); showValidDay.value = false; + emits('changeValue','valid_days'); if (val == 1) { showTimeRange.value = true; if (modalForm.value.valid_start_time) { @@ -603,9 +615,13 @@ const changeValidType = (val) => { }; const changeScope = (val) => { showConnectType.value = false; + emits('changeValue','inquiry_type'); showProduct.value = false; + emits('changeValue','product_id'); showManjian.value = false; + emits('changeValue','with_amount'); showMinNumber.value = false; + emits('changeValue','min_usable_number'); if (val == 1) { modalForm.coupon_type == 2 && (showManjian.value = true); modalForm.coupon_type == 3 && (showMinNumber.value = true); @@ -618,6 +634,7 @@ const changeScope = (val) => { }; const changeObject = (val) => { showDistributionDay.value = false; + emits('changeValue','distribution_with_day'); if (val == 4) { showDistributionDay.value = true; } @@ -660,23 +677,23 @@ const onOk = (dateString, date) => { } }); }; -const clearDate = () => { - valid_start_time.value = ''; - valid_end_time.value = ''; - emits('changeTimeRange', { - valid_start_time: '', - valid_end_time: '', - }); -}; + const changeStatus = () => { showConnectType.value = false; + //emits('changeValue','inquiry_type'); showProduct.value = false; + //emits('changeValue','product_id'); showManjian.value = false; + //emits('changeValue','with_amount'); showMinNumber.value = false; + //emits('changeValue','min_usable_number'); showDistributionDay.value = false; + //emits('changeValue','distribution_with_day'); showTimeRange.value = false; + //clearDate(); showValidDay.value = false; + //emits('changeValue','valid_days'); }; const handleClose = () => { emits('closeChange', (modalVisible.value = false)); diff --git a/src/views/coupon/coupon-list/index.vue b/src/views/coupon/coupon-list/index.vue index 1a6b1e1..70d9074 100644 --- a/src/views/coupon/coupon-list/index.vue +++ b/src/views/coupon/coupon-list/index.vue @@ -122,7 +122,7 @@ - + @@ -322,7 +322,9 @@ const isVisible=ref(false); modalForm.valid_end_time=''; modalForm.valid_type=''; modalForm.coupon_count=null; + modalForm.with_amount=null; modalForm.desc=''; + modalForm.coupon_price=null; modalForm.is_reissuable_after_expire=0; if(couponChild.value){ couponChild.value.changeStatus(); @@ -332,6 +334,9 @@ const isVisible=ref(false); modalForm.valid_start_time=data.valid_start_time; modalForm.valid_end_time=data.valid_end_time; }; + const changeValue=(type)=>{ + modalForm[type]=null; + } const cancelOk=()=>{ okVisible.value=false; }