|
@@ -13,12 +13,35 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="奖品类型" prop="prizeType">
|
|
|
- <el-select v-model="formData.prizeType" size="mini" placeholder="请选择任务状态">
|
|
|
+ <el-select
|
|
|
+ v-model="formData.prizeType" size="mini" placeholder="请选择奖品类型"
|
|
|
+ @change="(e) => formData.prizeNum = ''"
|
|
|
+ >
|
|
|
<el-option label="谢谢参与" :value="-1" />
|
|
|
<el-option label="普通奖品" :value="1" />
|
|
|
<el-option label="唯一性奖品" :value="2" />
|
|
|
+ <el-option label="代金券" :value="3" />
|
|
|
+ <el-option label="消费金" :value="4" />
|
|
|
+ <el-option label="现金余额" :value="5" />
|
|
|
+ <el-option label="优惠券" :value="6" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <div>
|
|
|
+ <el-form-item
|
|
|
+ v-if="formData.prizeType === 6" :label="`${'num字段'}\n${'(优惠券活动ID)'}`" prop="prizeNum"
|
|
|
+ style="white-space: pre-wrap;"
|
|
|
+ >
|
|
|
+ <el-select v-model="formData.prizeNum" size="mini" placeholder="请选择优惠券活动" filterable>
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in couponDataList" :key="item.activityId" :label="`${item.activityName}(${item.activityId})`"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-else prop="prizeNum" label="num字段">
|
|
|
+ <el-input v-model="formData.prizeNum" placeholder="请输入num字段(数量/商品ID)" style="width: 250px;"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
<el-form-item prop="totalStock" label="总库存">
|
|
|
<el-input v-model="formData.totalStock" placeholder="请输入总库存" style="width: 250px;"></el-input>
|
|
|
</el-form-item>
|
|
@@ -45,6 +68,7 @@
|
|
|
<script>
|
|
|
import { saveLotteryPrize, updateLotteryPrize, getByIdLotteryPrize } from '@/api/lotteryManagement/LotteryPrizes'
|
|
|
import { getPageLotteryActivities } from '@/api/lotteryManagement/lotteryActivities'
|
|
|
+import { getCouponData } from '@/api/active/active_coupon.js'
|
|
|
|
|
|
export default {
|
|
|
name: 'EditModal',
|
|
@@ -63,6 +87,7 @@ export default {
|
|
|
lotteryId: '',
|
|
|
prizeName: '',
|
|
|
prizeType: '',
|
|
|
+ prizeNum: '',
|
|
|
totalStock: '',
|
|
|
validStock: '',
|
|
|
remark: ''
|
|
@@ -86,7 +111,8 @@ export default {
|
|
|
{ pattern: /^(0|[1-9][0-9]*)$/, message: '请输入正整数' }
|
|
|
]
|
|
|
},
|
|
|
- activityList: []
|
|
|
+ activityList: [],
|
|
|
+ couponDataList: []
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -96,6 +122,8 @@ export default {
|
|
|
async initList() {
|
|
|
const res1 = await getPageLotteryActivities({ page: 1, pageSize: 9999 })
|
|
|
this.activityList = res1.data.list
|
|
|
+ const res2 = await getCouponData({ activityName: '', state: 3, page: 1, pageSize: 9999 })
|
|
|
+ this.couponDataList = res2.data.list
|
|
|
},
|
|
|
handleOpen(params = {}) {
|
|
|
this.modalOptions.title = params.id ? '编辑抽奖奖品' : '添加抽奖奖品'
|
|
@@ -117,6 +145,7 @@ export default {
|
|
|
lotteryId: res.data.lotteryId || '',
|
|
|
prizeName: res.data.prizeName || '',
|
|
|
prizeType: res.data.prizeType,
|
|
|
+ prizeNum: res.data.prizeNum,
|
|
|
totalStock: res.data.totalStock,
|
|
|
validStock: res.data.validStock,
|
|
|
remark: res.data.remark || ''
|