Commit ee740730 by 吕明尚

显示领取记录适用门店

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