|
@@ -1,6 +1,18 @@
|
|
|
<template>
|
|
|
<div class="layout_container">
|
|
|
<header class="round-header">
|
|
|
+ <span>状态:</span>
|
|
|
+ <el-select
|
|
|
+ v-model="couponInquiry.state"
|
|
|
+ style="width: 100px"
|
|
|
+ >
|
|
|
+ <el-option value="ALL" label="全部"></el-option>
|
|
|
+ <el-option value="ACTIVATED" label="已激活"></el-option>
|
|
|
+ <el-option value="DEACTIVATED" label="已停用"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <span style="margin-left: 12px">创建时间:</span>
|
|
|
+ <CyDateRange />
|
|
|
+ <el-divider direction="vertical"></el-divider>
|
|
|
<el-button type="primary" icon="Refresh" @click="refreshCoupons(true)">刷新数据</el-button>
|
|
|
<el-button type="primary" icon="Plus" plain @click="createNewCoupon">新增优惠券</el-button>
|
|
|
</header>
|
|
@@ -296,7 +308,6 @@
|
|
|
></el-input-number>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
<div class="edit-coupon-line">
|
|
|
<div class="edit-coupon-line_label"><span class="required">*</span>下发方式:</div>
|
|
|
<div>
|
|
@@ -324,6 +335,7 @@ import {copyStrFunc} from "@/utils/public";
|
|
|
import {qrcanvas} from "qrcanvas";
|
|
|
import {ref} from "vue";
|
|
|
import SystemItemDrug from "@/components/system/item-drug/SystemItemDrug.vue";
|
|
|
+import useDateRange from "@/utils/cy-use/useDateRange";
|
|
|
|
|
|
const coupons = ref([])
|
|
|
|
|
@@ -392,12 +404,23 @@ function moneyStyle(m) {
|
|
|
return '¥' + m.toFixed(2);
|
|
|
}
|
|
|
|
|
|
+const {CyDateRange, dateRange} = useDateRange({shortcutsIndex: 2, clearable: false})
|
|
|
+const couponInquiry = reactive({
|
|
|
+ state: 'ACTIVATED',
|
|
|
+ start: null,
|
|
|
+ end: null
|
|
|
+})
|
|
|
+
|
|
|
function refreshCoupons(showSuccessMessage) {
|
|
|
- getAllCoupons().then(response => {
|
|
|
+ couponInquiry.start = dateRange.value.start
|
|
|
+ couponInquiry.end = dateRange.value.end
|
|
|
+ getAllCoupons(couponInquiry).then(response => {
|
|
|
coupons.value = response
|
|
|
if (showSuccessMessage) {
|
|
|
xcMessage.success('刷新数据成功')
|
|
|
}
|
|
|
+ }).catch(error => {
|
|
|
+ coupons.value = []
|
|
|
})
|
|
|
}
|
|
|
|