|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
|
- <!-- <el-form
|
|
|
|
|
|
|
+ <el-form
|
|
|
:model="queryParams"
|
|
:model="queryParams"
|
|
|
ref="queryForm"
|
|
ref="queryForm"
|
|
|
size="small"
|
|
size="small"
|
|
@@ -16,70 +16,52 @@
|
|
|
@keyup.enter.native="handleQuery"
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- <el-form-item label="优惠值" prop="discountValue">
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model="queryParams.discountValue"
|
|
|
|
|
- placeholder="请输入优惠值"
|
|
|
|
|
- clearable
|
|
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
|
|
- />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item label="门槛金额" prop="thresholdAmount">
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model="queryParams.thresholdAmount"
|
|
|
|
|
- placeholder="请输入门槛金额"
|
|
|
|
|
- clearable
|
|
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
|
|
- />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item label="获取方式" prop="obtainWay">
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model="queryParams.obtainWay"
|
|
|
|
|
- placeholder="请输入获取方式:1:手动领取 2,自动发放"
|
|
|
|
|
- clearable
|
|
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
|
|
- />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- <el-form-item label="有效天数" prop="termDays">
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model="queryParams.termDays"
|
|
|
|
|
- placeholder="请输入优惠券有效期天数,0"
|
|
|
|
|
- clearable
|
|
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
|
|
- />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item label="使用数量" prop="usedNum">
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model="queryParams.usedNum"
|
|
|
|
|
- placeholder="请输入已使用数量"
|
|
|
|
|
- clearable
|
|
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <el-form-item label="部门" prop="deptName">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="queryParams.deptId"
|
|
|
|
|
+ placeholder="请选择"
|
|
|
|
|
+ style="width: 100px"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in dept"
|
|
|
|
|
+ :key="item.deptId"
|
|
|
|
|
+ :label="item.deptName"
|
|
|
|
|
+ :value="item.deptId"
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-option>
|
|
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- <el-form-item label="限领数量" prop="userLimit">
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model="queryParams.userLimit"
|
|
|
|
|
- placeholder="请输入每个人限领的数量"
|
|
|
|
|
- clearable
|
|
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <el-form-item label="类型" prop="discountType">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="queryParams.discountType"
|
|
|
|
|
+ placeholder="请选择"
|
|
|
|
|
+ style="width: 100px"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in typeState"
|
|
|
|
|
+ :key="item.value"
|
|
|
|
|
+ :label="item.label"
|
|
|
|
|
+ :value="item.value"
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-option>
|
|
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="是否删除" prop="isDelete">
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model="queryParams.isDelete"
|
|
|
|
|
- placeholder="请输入是否删除0否1是"
|
|
|
|
|
- clearable
|
|
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <el-form-item label="状态" prop="status">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="queryParams.status"
|
|
|
|
|
+ placeholder="请选择"
|
|
|
|
|
+ style="width: 100px"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in serviceState"
|
|
|
|
|
+ :key="item.value"
|
|
|
|
|
+ :label="item.label"
|
|
|
|
|
+ :value="item.value"
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-option>
|
|
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
|
|
-
|
|
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
<el-button
|
|
<el-button
|
|
|
type="primary"
|
|
type="primary"
|
|
@@ -92,10 +74,10 @@
|
|
|
>重置</el-button
|
|
>重置</el-button
|
|
|
>
|
|
>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- </el-form> -->
|
|
|
|
|
|
|
+ </el-form>
|
|
|
|
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
<el-row :gutter="10" class="mb8">
|
|
|
- <!-- <el-col :span="1.5">
|
|
|
|
|
|
|
+ <el-col :span="1.5">
|
|
|
<el-button
|
|
<el-button
|
|
|
type="primary"
|
|
type="primary"
|
|
|
plain
|
|
plain
|
|
@@ -105,7 +87,7 @@
|
|
|
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
|
|
|
type="success"
|
|
type="success"
|
|
@@ -152,8 +134,9 @@
|
|
|
:data="couponList"
|
|
:data="couponList"
|
|
|
@selection-change="handleSelectionChange"
|
|
@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="优惠券id" align="center" prop="id" />
|
|
<el-table-column label="优惠券id" align="center" prop="id" />
|
|
|
|
|
+ <el-table-column label="部门" align="center" prop="deptName" />
|
|
|
<el-table-column label="优惠券名称" align="center" prop="name" />
|
|
<el-table-column label="优惠券名称" align="center" prop="name" />
|
|
|
<el-table-column label="优惠券类型" align="center" prop="type">
|
|
<el-table-column label="优惠券类型" align="center" prop="type">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
@@ -173,13 +156,24 @@
|
|
|
}}</span>
|
|
}}</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column label="优惠值" align="center" prop="discountValue" />
|
|
|
|
|
|
|
+ <el-table-column label="优惠值" align="center" prop="discountValue">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <span v-if="scope.row.discountType == 3">{{
|
|
|
|
|
+ scope.row.discountValue
|
|
|
|
|
+ }}</span>
|
|
|
|
|
+ <span v-if="scope.row.discountType == 2"
|
|
|
|
|
+ >{{ scope.row.rebValue }}折</span
|
|
|
|
|
+ >
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <!-- <el-table-column label="折扣值" align="center" prop="discountValue" v-if="couponList.discountType == 2"/> -->
|
|
|
|
|
+
|
|
|
<el-table-column label="门槛金额" align="center" prop="thresholdAmount" />
|
|
<el-table-column label="门槛金额" align="center" prop="thresholdAmount" />
|
|
|
- <el-table-column label="获取方式" align="center" prop="obtainWay">
|
|
|
|
|
|
|
+ <!-- <el-table-column label="获取方式" align="center" prop="obtainWay">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<span>{{ scope.row.obtainWay === 1 ? "手动领取" : "自动发放" }}</span>
|
|
<span>{{ scope.row.obtainWay === 1 ? "手动领取" : "自动发放" }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
|
|
|
|
+ </el-table-column> -->
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
label="优惠券有效期天数"
|
|
label="优惠券有效期天数"
|
|
|
align="center"
|
|
align="center"
|
|
@@ -187,22 +181,22 @@
|
|
|
/>
|
|
/>
|
|
|
<el-table-column label="优惠券配置状态" align="center" prop="status">
|
|
<el-table-column label="优惠券配置状态" align="center" prop="status">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- <span>{{ scope.row.status === 0 ? "未使用" : "进行中" }}</span>
|
|
|
|
|
|
|
+ <span>{{ scope.row.status === 0 ? "停用" : "已启用" }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column label="已使用数量" align="center" prop="usedNum" />
|
|
|
|
|
|
|
+ <!-- <el-table-column label="已使用数量" align="center" prop="usedNum" />
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
label="每个人限领的数量"
|
|
label="每个人限领的数量"
|
|
|
align="center"
|
|
align="center"
|
|
|
prop="userLimit"
|
|
prop="userLimit"
|
|
|
- />
|
|
|
|
|
|
|
+ /> -->
|
|
|
<!-- <el-table-column
|
|
<!-- <el-table-column
|
|
|
label="拓展参数字段,保留字段"
|
|
label="拓展参数字段,保留字段"
|
|
|
align="center"
|
|
align="center"
|
|
|
prop="extParam"
|
|
prop="extParam"
|
|
|
/>
|
|
/>
|
|
|
<el-table-column label="是否删除0否1是" align="center" prop="isDelete" /> -->
|
|
<el-table-column label="是否删除0否1是" align="center" prop="isDelete" /> -->
|
|
|
- <!-- <el-table-column
|
|
|
|
|
|
|
+ <el-table-column
|
|
|
label="操作"
|
|
label="操作"
|
|
|
align="center"
|
|
align="center"
|
|
|
class-name="small-padding fixed-width"
|
|
class-name="small-padding fixed-width"
|
|
@@ -225,7 +219,7 @@
|
|
|
>删除</el-button
|
|
>删除</el-button
|
|
|
>
|
|
>
|
|
|
</template>
|
|
</template>
|
|
|
- </el-table-column> -->
|
|
|
|
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
|
|
|
|
|
<pagination
|
|
<pagination
|
|
@@ -238,13 +232,24 @@
|
|
|
|
|
|
|
|
<!-- 添加或修改优惠券的规则信息对话框 -->
|
|
<!-- 添加或修改优惠券的规则信息对话框 -->
|
|
|
<el-dialog :title="title" :visible.sync="open" width="550px" append-to-body>
|
|
<el-dialog :title="title" :visible.sync="open" width="550px" append-to-body>
|
|
|
- <el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
|
|
|
|
|
|
+ <el-form ref="form" :model="form" label-width="100px">
|
|
|
|
|
+ <el-form-item label="部门" v-if="userDeptId == 100">
|
|
|
|
|
+ <el-select v-model="form.deptName" placeholder="请选择">
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ @click.native="handleSelectTeam(item)"
|
|
|
|
|
+ v-for="item in options"
|
|
|
|
|
+ :key="item.deptId"
|
|
|
|
|
+ :label="item.deptName"
|
|
|
|
|
+ :value="item.deptName"
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="优惠券名称" prop="name">
|
|
<el-form-item label="优惠券名称" prop="name">
|
|
|
<el-input
|
|
<el-input
|
|
|
v-model="form.name"
|
|
v-model="form.name"
|
|
|
placeholder="请输入优惠券名称,可以和活动名称保持一致"
|
|
placeholder="请输入优惠券名称,可以和活动名称保持一致"
|
|
|
/>
|
|
/>
|
|
|
-
|
|
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<!-- <el-form-item label="优惠券类型" prop="discountType">
|
|
<!-- <el-form-item label="优惠券类型" prop="discountType">
|
|
|
<el-input
|
|
<el-input
|
|
@@ -253,21 +258,48 @@
|
|
|
/>
|
|
/>
|
|
|
|
|
|
|
|
</el-form-item> -->
|
|
</el-form-item> -->
|
|
|
- <el-form-item label="优惠值" prop="discountValue">
|
|
|
|
|
|
|
+ <el-form-item label="优惠券类型" prop="discountValue">
|
|
|
|
|
+ <template>
|
|
|
|
|
+ <!-- <el-radio v-model="form.discountType" label="3">满减</el-radio>
|
|
|
|
|
+ <el-radio v-model="form.discountType" label="2">折扣券</el-radio> -->
|
|
|
|
|
+ <el-radio-group v-model="form.discountType" @change="handleChange">
|
|
|
|
|
+ <el-radio :label="3">满减</el-radio>
|
|
|
|
|
+ <el-radio :label="2">折扣券</el-radio>
|
|
|
|
|
+ </el-radio-group>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item
|
|
|
|
|
+ label="满减值"
|
|
|
|
|
+ prop="discountValue"
|
|
|
|
|
+ v-if="form.discountType == 3"
|
|
|
|
|
+ >
|
|
|
<el-input v-model="form.discountValue" placeholder="请输入优惠值" />
|
|
<el-input v-model="form.discountValue" placeholder="请输入优惠值" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
+ <el-form-item
|
|
|
|
|
+ label="折扣值"
|
|
|
|
|
+ prop="discountValue"
|
|
|
|
|
+ v-if="form.discountType == 2"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="form.rebValue"
|
|
|
|
|
+ placeholder="请输入折扣值(1-10)"
|
|
|
|
|
+ type="number"
|
|
|
|
|
+ :maxlength="3"
|
|
|
|
|
+ oninput="if(value<=0){value=null} if(value>10){value=10} if(value.length > 3){value = value.slice(0, 3)}"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="门槛金额" prop="thresholdAmount">
|
|
<el-form-item label="门槛金额" prop="thresholdAmount">
|
|
|
<el-input
|
|
<el-input
|
|
|
v-model="form.thresholdAmount"
|
|
v-model="form.thresholdAmount"
|
|
|
placeholder="请输入门槛金额"
|
|
placeholder="请输入门槛金额"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="获取方式:" prop="obtainWay">
|
|
|
|
|
|
|
+ <!-- <el-form-item label="获取方式:" prop="obtainWay">
|
|
|
<el-input
|
|
<el-input
|
|
|
v-model="form.obtainWay"
|
|
v-model="form.obtainWay"
|
|
|
placeholder="请输入获取方式:1:手动领取 2,自动发放"
|
|
placeholder="请输入获取方式:1:手动领取 2,自动发放"
|
|
|
/>
|
|
/>
|
|
|
- </el-form-item>
|
|
|
|
|
|
|
+ </el-form-item> -->
|
|
|
<el-form-item label="有效天数" prop="termDays">
|
|
<el-form-item label="有效天数" prop="termDays">
|
|
|
<el-input
|
|
<el-input
|
|
|
v-model="form.termDays"
|
|
v-model="form.termDays"
|
|
@@ -277,11 +309,21 @@
|
|
|
<!-- <el-form-item label="已使用数量" prop="usedNum">
|
|
<!-- <el-form-item label="已使用数量" prop="usedNum">
|
|
|
<el-input v-model="form.usedNum" placeholder="请输入已使用数量" />
|
|
<el-input v-model="form.usedNum" placeholder="请输入已使用数量" />
|
|
|
</el-form-item> -->
|
|
</el-form-item> -->
|
|
|
- <el-form-item label="限领数量" prop="userLimit">
|
|
|
|
|
|
|
+ <!-- <el-form-item label="限领数量" prop="userLimit">
|
|
|
<el-input
|
|
<el-input
|
|
|
v-model="form.userLimit"
|
|
v-model="form.userLimit"
|
|
|
placeholder="请输入每个人限领的数量"
|
|
placeholder="请输入每个人限领的数量"
|
|
|
/>
|
|
/>
|
|
|
|
|
+ </el-form-item> -->
|
|
|
|
|
+ <el-form-item label="是否启用" prop="discountValue">
|
|
|
|
|
+ <template>
|
|
|
|
|
+ <!-- <el-radio v-model="form.discountType" label="3">满减</el-radio>
|
|
|
|
|
+ <el-radio v-model="form.discountType" label="2">折扣券</el-radio> -->
|
|
|
|
|
+ <el-radio-group v-model="form.status">
|
|
|
|
|
+ <el-radio :label="0">关闭</el-radio>
|
|
|
|
|
+ <el-radio :label="1">启用</el-radio>
|
|
|
|
|
+ </el-radio-group>
|
|
|
|
|
+ </template>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<!-- <el-form-item label="是否删除0否1是" prop="isDelete">
|
|
<!-- <el-form-item label="是否删除0否1是" prop="isDelete">
|
|
|
<el-input
|
|
<el-input
|
|
@@ -306,12 +348,20 @@ import {
|
|
|
addCoupon,
|
|
addCoupon,
|
|
|
updateCoupon,
|
|
updateCoupon,
|
|
|
} from "@/api/system/coupon";
|
|
} from "@/api/system/coupon";
|
|
|
|
|
+import { listJs, getDept } from "@/api/system/js";
|
|
|
import { upload } from "@/api/public";
|
|
import { upload } from "@/api/public";
|
|
|
|
|
+import { getInfo } from "@/api/login";
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: "Coupon",
|
|
name: "Coupon",
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ userDeptId: "", //当前账号部门id
|
|
|
|
|
+ city: "",
|
|
|
|
|
+ deptId: null,
|
|
|
|
|
+ options: [], //优惠券部门
|
|
|
|
|
+ //优惠券类型
|
|
|
|
|
+ radio: "1",
|
|
|
// 遮罩层
|
|
// 遮罩层
|
|
|
loading: true,
|
|
loading: true,
|
|
|
// 选中数组
|
|
// 选中数组
|
|
@@ -337,7 +387,6 @@ export default {
|
|
|
pages: 1,
|
|
pages: 1,
|
|
|
name: null,
|
|
name: null,
|
|
|
type: null,
|
|
type: null,
|
|
|
- discountType: null,
|
|
|
|
|
discountValue: null,
|
|
discountValue: null,
|
|
|
thresholdAmount: null,
|
|
thresholdAmount: null,
|
|
|
obtainWay: null,
|
|
obtainWay: null,
|
|
@@ -348,6 +397,8 @@ export default {
|
|
|
extParam: null,
|
|
extParam: null,
|
|
|
isDelete: null,
|
|
isDelete: null,
|
|
|
handleWay: 0, //0默认,1新增,2修改,
|
|
handleWay: 0, //0默认,1新增,2修改,
|
|
|
|
|
+ discountType: null,
|
|
|
|
|
+ deptName: null,
|
|
|
},
|
|
},
|
|
|
// 表单参数
|
|
// 表单参数
|
|
|
form: {},
|
|
form: {},
|
|
@@ -364,7 +415,7 @@ export default {
|
|
|
{
|
|
{
|
|
|
required: true,
|
|
required: true,
|
|
|
message: "优惠券类型,1:普通券不能为空",
|
|
message: "优惠券类型,1:普通券不能为空",
|
|
|
- trigger: "change",
|
|
|
|
|
|
|
+ trigger: "blur",
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
|
discountType: [
|
|
discountType: [
|
|
@@ -375,7 +426,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
|
discountValue: [
|
|
discountValue: [
|
|
|
- { required: true, message: "优惠值不能为空", trigger: "blur" },
|
|
|
|
|
|
|
+ { required: false, message: "优惠值不能为空", trigger: "blur" },
|
|
|
],
|
|
],
|
|
|
obtainWay: [
|
|
obtainWay: [
|
|
|
{
|
|
{
|
|
@@ -402,18 +453,55 @@ export default {
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
|
},
|
|
},
|
|
|
|
|
+ serviceState: [
|
|
|
|
|
+ { value: 1, label: "启用中" },
|
|
|
|
|
+ { value: 0, label: "停用" },
|
|
|
|
|
+ ],
|
|
|
|
|
+ typeState: [
|
|
|
|
|
+ { value: 2, label: "折扣" },
|
|
|
|
|
+ { value: 3, label: "满减" },
|
|
|
|
|
+ ],
|
|
|
|
|
+ dept:[]
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
// this.getList();
|
|
// this.getList();
|
|
|
this.getCouponList();
|
|
this.getCouponList();
|
|
|
},
|
|
},
|
|
|
|
|
+ mounted() {
|
|
|
|
|
+ this.getInfo();
|
|
|
|
|
+ this.getDept();
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ handleSelectTeam(item) {
|
|
|
|
|
+ this.form.deptId = item.deptId;
|
|
|
|
|
+ this.form.deptName = item.deptName;
|
|
|
|
|
+ },
|
|
|
|
|
+ // 获取部门
|
|
|
|
|
+ getDept() {
|
|
|
|
|
+ // let data = {};
|
|
|
|
|
+ // data.deptId = deptId;
|
|
|
|
|
+ // data.nStatus = 0;
|
|
|
|
|
+ getDept().then((res) => {
|
|
|
|
|
+ this.dept = res.data
|
|
|
|
|
+ this.options = res.data;
|
|
|
|
|
+
|
|
|
|
|
+ // this.jsList = res.data;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ //选择部门
|
|
|
|
|
+ handleDeptChange(selection) {
|
|
|
|
|
+ this.form.deptId = selection.deptId;
|
|
|
|
|
+ this.form.deptName = selection.deptName;
|
|
|
|
|
+ // this.getJsList(selection.deptId)
|
|
|
|
|
+ },
|
|
|
|
|
+ handleChange() {
|
|
|
|
|
+ // this.form.discountValue = null
|
|
|
|
|
+ },
|
|
|
/** 查询优惠券的规则信息列表 */
|
|
/** 查询优惠券的规则信息列表 */
|
|
|
getList() {
|
|
getList() {
|
|
|
this.loading = true;
|
|
this.loading = true;
|
|
|
listCoupon().then((res) => {
|
|
listCoupon().then((res) => {
|
|
|
- console.log(res);
|
|
|
|
|
this.couponList = res.rows;
|
|
this.couponList = res.rows;
|
|
|
// this.total = res.total;
|
|
// this.total = res.total;
|
|
|
this.loading = false;
|
|
this.loading = false;
|
|
@@ -423,7 +511,7 @@ export default {
|
|
|
getCouponList(queryParams) {
|
|
getCouponList(queryParams) {
|
|
|
if (queryParams) {
|
|
if (queryParams) {
|
|
|
getCoupon(this.queryParams).then((res) => {
|
|
getCoupon(this.queryParams).then((res) => {
|
|
|
- console.log(res);
|
|
|
|
|
|
|
+
|
|
|
this.couponList = res.data.records;
|
|
this.couponList = res.data.records;
|
|
|
this.total = res.data.records.length;
|
|
this.total = res.data.records.length;
|
|
|
this.loading = false;
|
|
this.loading = false;
|
|
@@ -448,6 +536,7 @@ export default {
|
|
|
name: null,
|
|
name: null,
|
|
|
type: null,
|
|
type: null,
|
|
|
discountType: null,
|
|
discountType: null,
|
|
|
|
|
+ rebValue:null,
|
|
|
discountValue: null,
|
|
discountValue: null,
|
|
|
thresholdAmount: null,
|
|
thresholdAmount: null,
|
|
|
obtainWay: null,
|
|
obtainWay: null,
|
|
@@ -510,10 +599,40 @@ export default {
|
|
|
if (this.handleWay == 1) {
|
|
if (this.handleWay == 1) {
|
|
|
//1新增
|
|
//1新增
|
|
|
let data = this.form;
|
|
let data = this.form;
|
|
|
|
|
+ if(!data.deptName){
|
|
|
|
|
+ this.$modal.msgError("优惠券部门不能为空");
|
|
|
|
|
+ return
|
|
|
|
|
+ }else if(!data.name){
|
|
|
|
|
+ this.$modal.msgError("优惠券名称不能为空");
|
|
|
|
|
+ return
|
|
|
|
|
+ }else if(!data.discountType){
|
|
|
|
|
+ this.$modal.msgError("请选择优惠券类型");
|
|
|
|
|
+ return
|
|
|
|
|
+ }else if(data.discountType == 2 &&!data.rebValue){
|
|
|
|
|
+ this.$modal.msgError("优惠券折扣值不能为空");
|
|
|
|
|
+ return
|
|
|
|
|
+ }else if(data.discountType ==3 && !data.discountValue){
|
|
|
|
|
+ this.$modal.msgError("优惠券满减值不能为空");
|
|
|
|
|
+ return
|
|
|
|
|
+ }else if(!data.thresholdAmount){
|
|
|
|
|
+ this.$modal.msgError("优惠券门槛金额不能为空");
|
|
|
|
|
+ return
|
|
|
|
|
+ }else if(!data.termDays){
|
|
|
|
|
+ this.$modal.msgError("优惠券有效天数不能为空");
|
|
|
|
|
+ return
|
|
|
|
|
+ }else if(data.status == null){
|
|
|
|
|
+ this.$modal.msgError("请选择优惠券是否启用");
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ // else if(!data.userLimit){
|
|
|
|
|
+ // this.$modal.msgError("优惠券限领数量不能为空");
|
|
|
|
|
+ // return
|
|
|
|
|
+ // }
|
|
|
addCoupon(data).then((res) => {
|
|
addCoupon(data).then((res) => {
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
this.open = false;
|
|
this.open = false;
|
|
|
|
|
+ this.city = "";
|
|
|
this.getCouponList();
|
|
this.getCouponList();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -523,6 +642,7 @@ export default {
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
this.open = false;
|
|
this.open = false;
|
|
|
|
|
+ this.city = "";
|
|
|
this.getCouponList();
|
|
this.getCouponList();
|
|
|
} else {
|
|
} else {
|
|
|
this.$modal.msgSuccess(res.msg);
|
|
this.$modal.msgSuccess(res.msg);
|
|
@@ -572,6 +692,16 @@ export default {
|
|
|
`coupon_${new Date().getTime()}.xlsx`
|
|
`coupon_${new Date().getTime()}.xlsx`
|
|
|
);
|
|
);
|
|
|
},
|
|
},
|
|
|
|
|
+ getInfo() {
|
|
|
|
|
+ getInfo().then((res) => {
|
|
|
|
|
+ this.userDeptId = res.user.deptId;
|
|
|
|
|
+ this.form.deptId = res.user.deptId;
|
|
|
|
|
+ // this.deptId = res.user.dept.deptId;
|
|
|
|
|
+ // this.getblock(res.user.dept.deptId);
|
|
|
|
|
+ // this.columnar(res.user.dept.deptId);
|
|
|
|
|
+ // this.ranking(res.user.dept.deptId);
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|