Commit ddf97a9f by 吕明尚

优惠卷字段修改

parent 0f504466
......@@ -274,6 +274,15 @@
<dict-tag :options="dict.type.store_platform_type" :value="scope.row.platformType"/>
</template>
</el-table-column>
<el-table-column label="适用套餐" align="center" prop="packIds">
<template slot-scope="scope">
<div v-if="scope.row.packIds">
<dict-tag :options="packList" :value="scope.row.packIds.split(',')"/>
</div>
</template>
</el-table-column>
<el-table-column label="适用星期" align="center" prop="weeks" width="250px">
<template slot-scope="scope">
<dict-tag :options="dict.type.sunday_type" :value="scope.row.weeks"/>
......@@ -329,6 +338,7 @@ import { listConsumer, getConsumer, delConsumer, addConsumer, updateConsumer } f
import {listDuration} from "../../../api/system/coupon";
import {give} from "../../../api/system/consumerCoupon";
import moment from "moment";
import {query} from '@/api/system/pack';
export default {
name: "Consumer",
......@@ -397,8 +407,28 @@ export default {
},
created() {
this.getList();
this.onPackList();
},
methods: {
onPackList() {
query().then(res => {
this.packList = res.data.map(obj => {
return {
...obj,
raw: {
dictSort: 1,
dictValue: "1",
listClass: "primary",
cssClass: ''
},
value: obj.id.toString(),
label: obj.name,
}
})
this.$forceUpdate();
this.getList();
})
},
/** 查询会员用户列表 */
getList() {
this.loading = true;
......
......@@ -57,16 +57,16 @@
/>
</el-select>
</el-form-item>
<el-form-item label="适用套餐" prop="packageId">
<el-select v-model="queryParams.packageId" placeholder="请选择适用套餐" clearable>
<el-option
v-for="dict in packList"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="适用套餐" prop="packageId">-->
<!-- <el-select v-model="queryParams.packageId" placeholder="请选择适用套餐" clearable>-->
<!-- <el-option-->
<!-- v-for="dict in packList"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="使用状态" prop="useStatus">
<el-select v-model="queryParams.useStatus" placeholder="请选择使用状态" clearable>
<el-option
......@@ -198,10 +198,10 @@
<dict-tag :options="dict.type.store_order_type" :value="scope.row.orderType"/>
</template>
</el-table-column>
<el-table-column label="套餐" align="center" prop="packageId">
<el-table-column label="适用套餐" align="center" prop="packageId">
<template slot-scope="scope">
<div v-if="scope.row.packageId">
<dict-tag :options="packList" :value="scope.row.packageId"/>
<div v-if="scope.row.packIds">
<dict-tag :options="packList" :value="scope.row.packIds.split(',')"/>
</div>
</template>
</el-table-column>
......
......@@ -24,16 +24,16 @@
/>
</el-select>
</el-form-item>
<el-form-item label="适用套餐" prop="packageId">
<el-select v-model="queryParams.packageId" placeholder="请选择适用套餐" clearable>
<el-option
v-for="dict in packList"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="适用套餐" prop="packageId">-->
<!-- <el-select v-model="queryParams.packageId" placeholder="请选择适用套餐" clearable>-->
<!-- <el-option-->
<!-- v-for="dict in packList"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="有效期开始" prop="startDate">
<el-date-picker clearable
......@@ -132,11 +132,12 @@
<template slot-scope="scope">
<dict-tag :options="dict.type.sunday_type" :value="scope.row.weeks"/>
</template>
---------------
</el-table-column>
<el-table-column label="套餐" align="center" prop="packageId">
<el-table-column label="适用套餐" align="center" prop="packIds">
<template slot-scope="scope">
<div v-if="scope.row.packageId">
<dict-tag :options="packList" :value="scope.row.packageId"/>
<div v-if="scope.row.packIds">
<dict-tag :options="packList" :value="scope.row.packIds.split(',')"/>
</div>
</template>
</el-table-column>
......@@ -242,7 +243,7 @@
</div>
</el-form-item>
<el-form-item label="套餐" prop="packageId">
<el-select v-model="form.packageId" placeholder="请选择套餐" clearable>
<el-select v-model="form.packIds" placeholder="请选择套餐" multiple clearable>
<el-option
v-for="dict in packList"
:key="dict.value"
......@@ -431,7 +432,8 @@ export default {
createTime: null,
updateBy: null,
updateTime: null,
remark: null
remark: null,
packIds: []
};
this.resetForm("form");
},
......@@ -480,6 +482,7 @@ export default {
if (this.form.weeks) {
this.weeks = this.form.weeks.split(",")
}
this.form.packIds = this.form.packIds ? this.form.packIds.split(",") : []
this.open = true;
this.title = "修改优惠券";
});
......@@ -491,6 +494,9 @@ export default {
if (this.weeks.length) {
this.form.weeks = this.weeks.join();
}
if (this.form.packIds.length) {
this.form.packIds = this.form.packIds.join();
}
if (this.form.id != null) {
updateCoupon(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
......
......@@ -23,16 +23,16 @@
/>
</el-select>
</el-form-item>
<el-form-item label="适用套餐" prop="packageId">
<el-select v-model="queryParams.packageId" placeholder="请选择适用套餐" clearable>
<el-option
v-for="dict in packList"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="适用套餐" prop="packageId">-->
<!-- <el-select v-model="queryParams.packageId" placeholder="请选择适用套餐" clearable>-->
<!-- <el-option-->
<!-- v-for="dict in packList"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="有效期开始" prop="startDate">
......@@ -127,10 +127,10 @@
<dict-tag :options="dict.type.store_order_type" :value="scope.row.orderType"/>
</template>
</el-table-column>
<el-table-column label="套餐" align="center" prop="packageId">
<el-table-column label="适用套餐" align="center" prop="packIds">
<template slot-scope="scope">
<div v-if="scope.row.packageId">
<dict-tag :options="packList" :value="scope.row.packageId"/>
<div v-if="scope.row.packIds">
<dict-tag :options="packList" :value="scope.row.packIds.split(',')"/>
</div>
</template>
</el-table-column>
......@@ -251,7 +251,7 @@
</div>
</el-form-item>
<el-form-item label="套餐" prop="packageId">
<el-select v-model="form.packageId" placeholder="请选择套餐" clearable>
<el-select v-model="form.packIds" placeholder="请选择套餐" multiple clearable>
<el-option
v-for="dict in packList"
:key="dict.value"
......@@ -484,7 +484,8 @@ export default {
createTime: null,
updateBy: null,
updateTime: null,
remark: null
remark: null,
packIds: []
};
this.resetForm("form");
},
......@@ -540,7 +541,7 @@ export default {
if (this.form.weeks) {
this.weeks = this.form.weeks.split(",")
}
this.form.packIds = this.form.packIds ? this.form.packIds.split(",") : []
this.open = true;
this.title = "修改优惠券";
});
......@@ -552,6 +553,9 @@ export default {
if (this.weeks.length) {
this.form.weeks = this.weeks.join();
}
if (this.form.packIds.length) {
this.form.packIds = this.form.packIds.join();
}
this.form.storeIds = this.form.storeIds && this.form.storeIds.length ? this.form.storeIds.join() : ''
if (this.form.id != null) {
if (this.form.platformType === "美团") {
......@@ -565,10 +569,13 @@ export default {
});
} else {
addCoupon(this.form).then(response => {
if (response.data.code) {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
this.reset();
}
});
}
}
......
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