Commit 7b2e4e04 by 吕明尚

优惠卷领取修改显示

parent 5c3e7a6c
...@@ -228,6 +228,8 @@ ...@@ -228,6 +228,8 @@
<dict-tag :options="dict.type.consumer_coupon_platform_type" :value="scope.row.platformType"/> <dict-tag :options="dict.type.consumer_coupon_platform_type" :value="scope.row.platformType"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="有效开始时段" align="center" prop="couponTimeStart"/>
<el-table-column label="有效结束时段" align="center" prop="couponTimeEnd"/>
<el-table-column label="有效期开始" align="center" prop="startDate" width="180"> <el-table-column label="有效期开始" align="center" prop="startDate" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') }}</span>
......
...@@ -71,7 +71,8 @@ ...@@ -71,7 +71,8 @@
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['system:coupon:add']" v-hasPermi="['system:coupon:add']"
>新增</el-button> >新增
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
...@@ -82,7 +83,8 @@ ...@@ -82,7 +83,8 @@
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['system:coupon:edit']" v-hasPermi="['system:coupon:edit']"
>修改</el-button> >修改
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
...@@ -93,7 +95,8 @@ ...@@ -93,7 +95,8 @@
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['system:coupon:remove']" v-hasPermi="['system:coupon:remove']"
>删除</el-button> >删除
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
...@@ -103,14 +106,15 @@ ...@@ -103,14 +106,15 @@
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['system:coupon:export']" v-hasPermi="['system:coupon:export']"
>导出</el-button> >导出
</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="couponList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="couponList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center"/>
<el-table-column label="优惠券名称" align="center" prop="name" /> <el-table-column label="优惠券名称" align="center" prop="name"/>
<el-table-column label="优惠券类型" align="center" prop="couponType"> <el-table-column label="优惠券类型" align="center" prop="couponType">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.store_coupon_type" :value="scope.row.couponType"/> <dict-tag :options="dict.type.store_coupon_type" :value="scope.row.couponType"/>
...@@ -134,6 +138,8 @@ ...@@ -134,6 +138,8 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="有效开始时段" align="center" prop="validStartTime" width="180"/>
<el-table-column label="有效结束时段" align="center" prop="validEndTime" width="180"/>
<!-- <el-table-column label="数量" align="center" prop="number"/>--> <!-- <el-table-column label="数量" align="center" prop="number"/>-->
<el-table-column label="说明" align="center" prop="remark"/> <el-table-column label="说明" align="center" prop="remark"/>
...@@ -145,14 +151,16 @@ ...@@ -145,14 +151,16 @@
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['system:coupon:edit']" v-hasPermi="['system:coupon:edit']"
>修改</el-button> >修改
</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['system:coupon:remove']" v-hasPermi="['system:coupon:remove']"
>删除</el-button> >删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -169,7 +177,7 @@ ...@@ -169,7 +177,7 @@
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="优惠券名称" prop="name"> <el-form-item label="优惠券名称" prop="name">
<el-input v-model="form.name" placeholder="请输入优惠券名称" /> <el-input v-model="form.name" placeholder="请输入优惠券名称"/>
</el-form-item> </el-form-item>
<el-form-item label="优惠券类型" prop="couponType"> <el-form-item label="优惠券类型" prop="couponType">
<el-select v-model="form.couponType" placeholder="请选择优惠券类型" disabled> <el-select v-model="form.couponType" placeholder="请选择优惠券类型" disabled>
...@@ -218,12 +226,34 @@ ...@@ -218,12 +226,34 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="有效开始时段" prop="validStartTime">
<el-time-select
v-model="form.validStartTime"
:picker-options="{
start: '00:00',
step: '00:30',
end: '24:00'
}"
placeholder="选择开始时段">
</el-time-select>
</el-form-item>
<el-form-item label="有效结束时段" prop="validEndTime">
<el-time-select
v-model="form.validEndTime"
:picker-options="{
start: '00:00',
step: '00:30',
end: '24:00'
}"
placeholder="选择结束时段">
</el-time-select>
</el-form-item>
<!-- <el-form-item label="数量" prop="number">--> <!-- <el-form-item label="数量" prop="number">-->
<!-- <el-input-number v-model="form.number" :min="0" :max="9999" label="优惠卷数量"/>--> <!-- <el-input-number v-model="form.number" :min="0" :max="9999" label="优惠卷数量"/>-->
<!-- &lt;!&ndash; <el-input v-model="form.number" type="textarea" placeholder="请输入数量" />&ndash;&gt;--> <!-- &lt;!&ndash; <el-input v-model="form.number" type="textarea" placeholder="请输入数量" />&ndash;&gt;-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<el-form-item label="说明" prop="remark"> <el-form-item label="说明" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -288,13 +318,29 @@ export default { ...@@ -288,13 +318,29 @@ export default {
{pattern: /^(([1-9]{1}\d*)|(0{1}))(\.\d{0,2})?$/, message: "请输入正确的优惠金额", trigger: "blur"} {pattern: /^(([1-9]{1}\d*)|(0{1}))(\.\d{0,2})?$/, message: "请输入正确的优惠金额", trigger: "blur"}
], ],
name: [ name: [
{ required: true, message: "优惠券名称不能为空", trigger: "blur" } {required: true, message: "优惠券名称不能为空", trigger: "blur"}
], ],
couponType: [ couponType: [
{ required: true, message: "优惠券类型不能为空", trigger: "change" } {required: true, message: "优惠券类型不能为空", trigger: "change"}
], ],
duration: [ duration: [
{ required: true, message: "时长不能为空", trigger: "blur" } {required: true, message: "时长不能为空", trigger: "blur"}
],
validEndTime: [
//结束时段必须大于开始时段
{
validator: (rule, value, callback) => {
if (this.form.validStartTime && this.form.validEndTime) {
if (this.form.validStartTime >= this.form.validEndTime) {
callback(new Error("结束时段必须大于开始时段"));
} else {
callback();
}
} else {
callback();
}
}, trigger: "blur"
}
], ],
} }
}; };
...@@ -304,11 +350,11 @@ export default { ...@@ -304,11 +350,11 @@ export default {
this.onPackList(); this.onPackList();
}, },
methods: { methods: {
onChangeStoreType(e){ onChangeStoreType(e) {
console.log(e) console.log(e)
this.form.storeType = e.join() this.form.storeType = e.join()
}, },
onChangeRoomType(e){ onChangeRoomType(e) {
console.log(e) console.log(e)
this.form.roomType = e.join() this.form.roomType = e.join()
}, },
...@@ -380,7 +426,7 @@ export default { ...@@ -380,7 +426,7 @@ export default {
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map(item => item.id)
this.single = selection.length!==1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
...@@ -405,10 +451,10 @@ export default { ...@@ -405,10 +451,10 @@ export default {
if (response.data.packageId) { if (response.data.packageId) {
this.form.packageId = response.data.packageId.toString(); this.form.packageId = response.data.packageId.toString();
} }
if(this.form.storeType){ if (this.form.storeType) {
this.storeType = this.form.storeType.split(",") this.storeType = this.form.storeType.split(",")
} }
if(this.form.roomType){ if (this.form.roomType) {
this.roomType = this.form.roomType.split(",") this.roomType = this.form.roomType.split(",")
} }
this.open = true; this.open = true;
...@@ -441,12 +487,13 @@ export default { ...@@ -441,12 +487,13 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除优惠券编号为"' + ids + '"的数据项?').then(function() { this.$modal.confirm('是否确认删除优惠券编号为"' + ids + '"的数据项?').then(function () {
return delCoupon(ids); return delCoupon(ids);
}).then(() => { }).then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => {
});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment