Commit ee740730 by 吕明尚

显示领取记录适用门店

parent 6358c0f7
...@@ -418,7 +418,9 @@ export default { ...@@ -418,7 +418,9 @@ export default {
useStatus: null, useStatus: null,
isDelete: null, isDelete: null,
deleteBy: null, deleteBy: null,
deleteTime: null deleteTime: null,
phone: null,
nickName: null
}, },
// 表单参数 // 表单参数
form: {}, form: {},
......
...@@ -220,7 +220,7 @@ ...@@ -220,7 +220,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="套餐" prop="packageId"> <el-form-item label="套餐" prop="packageId">
<el-select v-model="form.packageId" placeholder="请选择套餐"> <el-select v-model="form.packageId" placeholder="请选择套餐" clearable>
<el-option <el-option
v-for="dict in packList" v-for="dict in packList"
:key="dict.value" :key="dict.value"
......
...@@ -134,14 +134,24 @@ ...@@ -134,14 +134,24 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="适用门店" align="center" prop="storeIdEnum" width="350"> <el-table-column label="适用门店" align="center" prop="storeIds" width="350">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.storeIdEnum" style="display: flex;flex-wrap: wrap;width: 100%;"> <div v-if="scope.row.storeIds" style="display: flex;flex-wrap: wrap;width: 100%;">
<dict-tag style="margin: 0 3px;" v-for="(item ,k) in scope.row.storeIdEnum" :key="k" :options="storeList" <dict-tag style="margin: 0 3px;" v-for="(item ,k) in scope.row.storeIds" :key="k" :options="storeList"
:value="item"/> :value="item"/>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="有效期开始" align="center" prop="startDate">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="有效期结束" align="center" prop="endDate">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="有效开始时段" align="center" prop="validStartTime" width="180"/> <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="validEndTime" width="180"/>
<!-- <el-table-column label="数量" align="center" prop="number"/>--> <!-- <el-table-column label="数量" align="center" prop="number"/>-->
...@@ -224,7 +234,7 @@ ...@@ -224,7 +234,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="套餐" prop="packageId"> <el-form-item label="套餐" prop="packageId">
<el-select v-model="form.packageId" placeholder="请选择套餐"> <el-select v-model="form.packageId" placeholder="请选择套餐" clearable>
<el-option <el-option
v-for="dict in packList" v-for="dict in packList"
:key="dict.value" :key="dict.value"
...@@ -233,25 +243,41 @@ ...@@ -233,25 +243,41 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="有效期开始" prop="startDate">
<el-date-picker clearable disabled
v-model="form.startDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择有效期开始">
</el-date-picker>
</el-form-item>
<el-form-item label="有效期结束" prop="endDate">
<el-date-picker clearable disabled
v-model="form.endDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择有效期结束">
</el-date-picker>
</el-form-item>
<el-form-item label="有效开始时段" prop="validStartTime"> <el-form-item label="有效开始时段" prop="validStartTime">
<el-time-select <el-time-select clearable
v-model="form.validStartTime" v-model="form.validStartTime"
:picker-options="{ :picker-options="{
start: '00:00', start: '00:00',
step: '00:30', step: '01:00',
end: '24:00' end: '23:00'
}" }"
placeholder="选择开始时段"> placeholder="选择开始时段">
</el-time-select> </el-time-select>
</el-form-item> </el-form-item>
<el-form-item label="有效结束时段" prop="validEndTime"> <el-form-item label="有效结束时段" prop="validEndTime">
<el-time-select <el-time-select clearable
v-model="form.validEndTime" v-model="form.validEndTime"
:picker-options="{ :picker-options="{
start: '00:00', start: '00:00',
step: '00:30', step: '01:00',
end: '24:00' end: '23:00'
}" }"
placeholder="选择结束时段"> placeholder="选择结束时段">
</el-time-select> </el-time-select>
</el-form-item> </el-form-item>
...@@ -278,6 +304,7 @@ import {storeList} from '@/api/system/store' ...@@ -278,6 +304,7 @@ import {storeList} from '@/api/system/store'
import {listGroup, getCoupon, delCoupon, addCoupon, updateCoupon} from "@/api/system/coupon"; import {listGroup, getCoupon, delCoupon, addCoupon, updateCoupon} from "@/api/system/coupon";
import {query} from '@/api/system/pack'; import {query} from '@/api/system/pack';
import queryShopDeal from "./queryShopDeal"; import queryShopDeal from "./queryShopDeal";
export default { export default {
name: "Coupon", name: "Coupon",
components: {queryShopDeal}, components: {queryShopDeal},
...@@ -302,7 +329,7 @@ export default { ...@@ -302,7 +329,7 @@ export default {
couponList: [], couponList: [],
packList: [], packList: [],
storeList: [], storeList: [],
storeIdEnum: [], storeIds: [],
// 弹出层标题 // 弹出层标题
title: "", title: "",
// 是否显示弹出层 // 是否显示弹出层
...@@ -316,6 +343,8 @@ export default { ...@@ -316,6 +343,8 @@ export default {
duration: null, duration: null,
minPrice: null, minPrice: null,
subPrice: null, subPrice: null,
validStartTime: null,
validEndTime: null,
useStatus: null, useStatus: null,
platformType: null, platformType: null,
startDate: null, startDate: null,
...@@ -363,7 +392,7 @@ export default { ...@@ -363,7 +392,7 @@ export default {
this.couponList = response.rows.map(item => { this.couponList = response.rows.map(item => {
return { return {
...item, ...item,
storeIdEnum: item.storeIdEnum ? item.storeIdEnum.split(",") : [] storeIds: item.storeIds && item.storeIds.length ? item.storeIds.split(",") : []
} }
}); });
this.total = response.total; this.total = response.total;
...@@ -462,6 +491,8 @@ export default { ...@@ -462,6 +491,8 @@ export default {
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const id = row.id || this.ids const id = row.id || this.ids
/**数组转字符串**/
getCoupon(id).then(response => { getCoupon(id).then(response => {
this.form = response.data; this.form = response.data;
this.form.platformType = "2"; this.form.platformType = "2";
...@@ -477,6 +508,10 @@ export default { ...@@ -477,6 +508,10 @@ export default {
if (this.form.roomType) { if (this.form.roomType) {
this.roomType = this.form.roomType.split(",") this.roomType = this.form.roomType.split(",")
} }
if (this.form.storeIds) {
this.storeIds = this.form.storeIds.split(",")
}
this.open = true; this.open = true;
this.title = "修改优惠券"; this.title = "修改优惠券";
}); });
...@@ -485,6 +520,7 @@ export default { ...@@ -485,6 +520,7 @@ export default {
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
this.form.storeIds = this.storeIds && this.storeIds.length ? this.storeIds.join() : ''
if (this.form.id != null) { if (this.form.id != null) {
if (this.form.platformType === "美团") { if (this.form.platformType === "美团") {
this.form.platformType = 2 this.form.platformType = 2
...@@ -524,13 +560,13 @@ export default { ...@@ -524,13 +560,13 @@ export default {
openShopDeal() { openShopDeal() {
this.$refs.select.show(); this.$refs.select.show();
}, },
queryShopDeal(name, startDate, endDate, subPrice, dealgroupId, storeIdEnum) { queryShopDeal(name, startDate, endDate, subPrice, dealgroupId, storeIds) {
this.form.name = name; this.form.name = name;
this.form.startDate = startDate; this.form.startDate = startDate;
this.form.endDate = endDate; this.form.endDate = endDate;
this.form.subPrice = subPrice; this.form.subPrice = subPrice;
this.form.dealgroupId = dealgroupId; this.form.dealgroupId = dealgroupId;
this.form.storeIdEnum = storeIdEnum; this.form.storeIds = storeIds;
} }
} }
......
...@@ -17,7 +17,13 @@ ...@@ -17,7 +17,13 @@
</el-table-column> </el-table-column>
<el-table-column label="套餐价格" align="center" prop="subPrice"/> <el-table-column label="套餐价格" align="center" prop="subPrice"/>
<el-table-column label="团购ID" align="center" prop="dealgroupId"/> <el-table-column label="团购ID" align="center" prop="dealgroupId"/>
<el-table-column label="适用门店id" align="center" prop="storeIdEnum"> <el-table-column label="适用门店id" align="center" prop="storeIds" width="350">
<template slot-scope="scope">
<div v-if="scope.row.storeIds" style="display: flex;flex-wrap: wrap;width: 100%;">
<dict-tag style="margin: 0 3px;" v-for="(item ,k) in scope.row.storeIds" :key="k" :options="storeList"
:value="item"/>
</div>
</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -27,7 +33,8 @@ ...@@ -27,7 +33,8 @@
</template> </template>
<script> <script>
import {queryshopdeal} from "@/api/system/coupon"; import {queryshopdeal, listGroup} from "@/api/system/coupon";
import {storeList} from '@/api/system/store'
export default { export default {
data() { data() {
...@@ -38,6 +45,9 @@ export default { ...@@ -38,6 +45,9 @@ export default {
total: 0, total: 0,
// 团购劵信息 // 团购劵信息
dataList: [], dataList: [],
storeList: [],
couponList: [],
storeIds: [],
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
...@@ -49,20 +59,44 @@ export default { ...@@ -49,20 +59,44 @@ export default {
methods: { methods: {
// 显示弹框 // 显示弹框
show() { show() {
this.onStoreList();
this.getList(); this.getList();
this.visible = true; this.visible = true;
}, },
clickRow(row) { clickRow(row) {
this.$emit('select', row.name, row.startDate, row.endDate, row.subPrice, row.dealgroupId, row.storeIdEnum); this.$emit('select', row.name, row.startDate, row.endDate, row.subPrice, row.dealgroupId, row.storeIds);
this.visible = false; this.visible = false;
}, },
// 查询表数据 // 查询表数据
getList() { getList() {
queryshopdeal().then(res => { queryshopdeal().then(res => {
this.dataList = res.data; this.dataList = res.data.map(item => {
return {
...item,
storeIds: item.storeIds ? item.storeIds.split(",") : []
}
});
this.total = res.total; this.total = res.total;
}); });
}, },
onStoreList() {
storeList().then(res => {
this.storeList = res.data.map(obj => {
return {
...obj,
raw: {
dictSort: 1,
dictValue: "1",
listClass: "primary",
cssClass: ''
},
value: obj.id.toString(),
label: obj.name,
}
})
this.$forceUpdate();
})
},
} }
}; };
</script> </script>
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