Browse Source

优惠券时间限制修改

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

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

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

Loading…
Cancel
Save