Browse Source

优惠券时间限制修改

master
sj 2 years ago
parent
commit
3e3cb64443
  1. 25
      src/views/bxg/activity/coupon/form.vue
  2. 17
      src/views/bxg/activity/coupon/index.vue

25
src/views/bxg/activity/coupon/form.vue

@ -22,13 +22,18 @@
<!-- <el-form-item label="优惠券有效期限(天)">-->
<!-- <el-input-number v-model="form.couponTime" style="width: 300px;" />-->
<!-- </el-form-item>-->
<el-form-item label="优惠券有效期限">
<el-form-item label="有效期开始时间">
<el-date-picker
v-model="form.dataList"
type="datetimerange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="['00:00:00']">
v-model="form.useStartTime"
type="datetime"
placeholder="选择日期时间">
</el-date-picker>
</el-form-item>
<el-form-item label="有效期结束时间">
<el-date-picker
v-model="form.useEndTime"
type="datetime"
placeholder="选择日期时间">
</el-date-picker>
</el-form-item>
<el-form-item label="排序">
@ -49,6 +54,7 @@
<script>
import { add, edit } from '@/api/bxg/yxStoreCoupon'
import cgood from '@/views/components/goods'
import CRUD from "@crud/crud";
export default {
components: { cgood },
props: {
@ -74,7 +80,8 @@ export default {
couponPrice: 0,
useMinPrice: 0,
// couponTime: 1,
dataList:'',
useStartTime:'',
useEndTime:'',
sort: 0,
status: 1,
type: 0,
@ -102,7 +109,7 @@ export default {
doSubmit() {
this.loading = true
if (this.isAdd) {
// console.log('this.form',this.form);
// console.log(typeof(this.form.useStartTime),this.form.useStartTime);
this.doAdd()
} else this.doEdit()
},
@ -161,7 +168,7 @@ export default {
productId: '',
product: []
}
}
},
}
}
</script>

17
src/views/bxg/activity/coupon/index.vue

@ -31,11 +31,13 @@
</el-table-column>
<el-table-column prop="couponPrice" label="优惠券面值" />
<el-table-column prop="useMinPrice" label="优惠券最低消费" />
<el-table-column label="优惠券有效期限">
<template slot-scope="scope">
<span>{{ scope.row.couponTime }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="优惠券有效期限">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ scope.row.couponTime }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column prop="useStartTime" label="使用时间开始" width="200" />
<el-table-column prop="useEndTime" label="使用时间截止" width="200" />
<el-table-column prop="sort" label="排序" width="100" />
<el-table-column label="状态" width="100" align="center">
<template slot-scope="scope">
@ -156,6 +158,7 @@ export default {
this.$refs.form.dialog = true
},
edit(data) {
// console.log('data',typeof(data.useStartTime),data.useStartTime)
this.isAdd = false
const _this = this.$refs.form
_this.form = {
@ -164,7 +167,9 @@ export default {
integral: data.integral,
couponPrice: data.couponPrice,
useMinPrice: data.useMinPrice,
couponTime: data.couponTime,
useStartTime:new Date(data.useStartTime),
useEndTime:new Date(data.useEndTime),
// couponTime: data.couponTime,
sort: data.sort,
status: data.status,
type: data.type,

Loading…
Cancel
Save