Commit c0ac3f38 by wangql

提交代码

1 parent 77598813
...@@ -95,5 +95,16 @@ const updateCouponApi = params => { ...@@ -95,5 +95,16 @@ const updateCouponApi = params => {
}) })
} }
//获取
const getAllGoodsApi = params => {
params.method = `scrm.api.shopmall.goods.page.curMerchant`
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
export default { getMerchantListApi, getVerificationListApi, effectiveCouponApi, codeVerificationApi, getCouponDetailApi, deleteCouponApi, createCouponApi, updateCouponApi } export default { getMerchantListApi, getVerificationListApi, effectiveCouponApi, codeVerificationApi, getCouponDetailApi, deleteCouponApi, createCouponApi, updateCouponApi, getAllGoodsApi }
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</span> </span>
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot> <slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot>
<div v-else-if="item.type === 'input'"> <div v-else-if="item.type === 'input'">
<el-input :placeholder="item.placeholder || '请输入' + item.label" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || 'auto' }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)"> <el-input :placeholder="item.placeholder || '请输入' + item.label" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || 'auto' }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)" @blur.native.capture="item.inputBlur">
<span v-if="item.prepend" slot="prepend">{{ item.prepend }}</span> <span v-if="item.prepend" slot="prepend">{{ item.prepend }}</span>
<span v-if="item.append" slot="append">{{ item.append }}</span> <span v-if="item.append" slot="append">{{ item.append }}</span>
</el-input> </el-input>
......
...@@ -24,6 +24,10 @@ ...@@ -24,6 +24,10 @@
<el-radio v-model="editForm.effectiveType" label="1" :disabled="apear!='couponAdd'"> <el-radio v-model="editForm.effectiveType" label="1" :disabled="apear!='couponAdd'">
<el-form-item prop="effectiveDays"> <el-form-item prop="effectiveDays">
领取后&nbsp;&nbsp;<el-input v-model="editForm.effectiveDays" style="width: 100px;" :disabled="apear!='couponAdd'|| editForm.effectiveType != 1" />&nbsp;&nbsp;天内有效 领取后&nbsp;&nbsp;<el-input v-model="editForm.effectiveDays" style="width: 100px;" :disabled="apear!='couponAdd'|| editForm.effectiveType != 1" />&nbsp;&nbsp;天内有效
<!-- <el-input v-model="editForm.effectiveDays" style="width: 250px;" :disabled="apear!='couponAdd'|| editForm.effectiveType != 1" >
<span slot="prepend">领取后</span>
<span slot="append">天内有效</span>
</el-input> -->
</el-form-item> </el-form-item>
</el-radio> </el-radio>
</template> </template>
...@@ -32,10 +36,15 @@ ...@@ -32,10 +36,15 @@
<el-radio v-model="editForm.barriers" label="2" :disabled="apear!='couponAdd' || editForm.way == 2"> <el-radio v-model="editForm.barriers" label="2" :disabled="apear!='couponAdd' || editForm.way == 2">
<el-form-item prop="full"> <el-form-item prop="full">
订单满<el-input v-model="editForm.full" placeholder="输入金额(元)" style="width: 110px;" :disabled="apear!='couponAdd'|| editForm.barriers != 2" />元可用 订单满<el-input v-model="editForm.full" placeholder="输入金额(元)" style="width: 110px;" :disabled="apear!='couponAdd'|| editForm.barriers != 2" />元可用
<span style="color:red" v-if="priceFlag">存在零售价低于代金券的商品</span>
</el-form-item> </el-form-item>
</el-radio> </el-radio>
</template> </template>
<template slot="denominationHtml">
<el-input v-model="editForm.denomination" style="width: 150px" :disabled="apear!='couponAdd'" @blur.native.capture="denominationBlur">
<span slot="append">元</span>
</el-input>
<span style="color:red;margin-left:15px" v-if="priceFlag">存在零售价低于代金券的商品</span>
</template>
<template slot="goodsHtml"> <template slot="goodsHtml">
<el-radio v-model="editForm.goods" label="1" :disabled="apear!='couponAdd'">全部商品可用</el-radio> <el-radio v-model="editForm.goods" label="1" :disabled="apear!='couponAdd'">全部商品可用</el-radio>
<el-radio v-model="editForm.goods" label="2" :disabled="apear!='couponAdd'">指定商品可用</el-radio><br> <el-radio v-model="editForm.goods" label="2" :disabled="apear!='couponAdd'">指定商品可用</el-radio><br>
...@@ -51,6 +60,21 @@ ...@@ -51,6 +60,21 @@
<el-button type="default" v-if="apear!='couponSee'" @click="handleCancel">取消</el-button> <el-button type="default" v-if="apear!='couponSee'" @click="handleCancel">取消</el-button>
<el-button type="default" v-if="apear=='couponSee'" @click="handleCancel">返回</el-button> <el-button type="default" v-if="apear=='couponSee'" @click="handleCancel">返回</el-button>
</div> </div>
<select-muti-pro-dialog v-if="isMutiSelectVisible" :isMutiSelectVisible="isMutiSelectVisible" :searchForm="searchProForm" :selectedProList="selectedProList" @handleMutiSelectConfirm="handleMutiSelectConfirm" @handleMutiSelectClose="handleMutiSelectClose">
<template slot="search">
<div class="flex">
<el-form :inline="true" :model="searchProForm">
<el-form-item label="商品名称:">
<el-input :size="size" v-model="searchProForm.name" placeholder="请输入商品名称" maxlength="20" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button :size="size" type="primary" @click="handleConfigSearch">查询</el-button>
<el-button :size="size" @click="handleConfigReset">重置</el-button>
</el-form-item>
</el-form>
</div>
</template>
</select-muti-pro-dialog>
</div> </div>
</template> </template>
...@@ -74,7 +98,11 @@ export default { ...@@ -74,7 +98,11 @@ export default {
id: '' id: ''
}, },
apear: '', apear: '',
minPirce: '',
//存在零售价低于代金券的商品
priceFlag: false, priceFlag: false,
// 商品-多选
isMutiSelectVisible: false,
editForm: { editForm: {
couponName: '', couponName: '',
way: '1', way: '1',
...@@ -82,6 +110,9 @@ export default { ...@@ -82,6 +110,9 @@ export default {
barriers: '1', barriers: '1',
goods: '1' goods: '1'
}, },
searchProForm: {
name: ''
},
editRule: { editRule: {
couponName: [{ required: true, message: '请输入优惠券名称', trigger: 'change' }], couponName: [{ required: true, message: '请输入优惠券名称', trigger: 'change' }],
effectiveType: [{ required: true, message: '请选择有效期', trigger: 'change' }], effectiveType: [{ required: true, message: '请选择有效期', trigger: 'change' }],
...@@ -117,11 +148,25 @@ export default { ...@@ -117,11 +148,25 @@ export default {
name: 'barriers', name: 'barriers',
addHtml: 'barriersHtml' addHtml: 'barriersHtml'
}, },
// {
// label: '面值',
// name: 'denomination',
// width: '150px',
// type: 'input',
// append: '元',
// suffixSlot: 'denomination',
// inputBlur: val => {
// if(val.target.value*100 > this.minPirce){
// this.priceFlag = true
// }else{
// this.priceFlag = false
// }
// }
// },
{ {
label: '面值', label: '面值',
name: 'denomination', name: 'denomination',
width: '150px', addHtml: 'denominationHtml'
type: 'input'
}, },
{ {
label: '库存', label: '库存',
...@@ -149,6 +194,7 @@ export default { ...@@ -149,6 +194,7 @@ export default {
this.routeInfo = this.$route.params this.routeInfo = this.$route.params
// this.title = this.titleObj[this.routeInfo.addOrEdit] // this.title = this.titleObj[this.routeInfo.addOrEdit]
this.routeInfo.addOrEdit != 1 ? this.getInfo() : '' this.routeInfo.addOrEdit != 1 ? this.getInfo() : ''
this.getAllGoods()
var id = this.routeInfo.id var id = this.routeInfo.id
var addOrEdit = this.routeInfo.addOrEdit var addOrEdit = this.routeInfo.addOrEdit
if (id) { if (id) {
...@@ -166,6 +212,65 @@ export default { ...@@ -166,6 +212,65 @@ export default {
}, },
methods: { methods: {
getAllGoods(goodsName){
var params = {
currentPage: 1,
pageNum: 1,
pageSize: 100000,
pageStart: 0,
goodsStatus: 1,
goodsName:''
}
if(goodsName){
params.goodsName = goodsName
}
this.$apis.couponManage.getAllGoodsApi(params).then(res => {
const goods = this.$common.utils.deepClone(res.list)
if(goods && goods.length > 0){
this.minPirce = goods[0].retailPrice
goods.forEach((item, index) => {
if(item.retailPrice < this.minPirce){
this.minPirce = item.retailPrice
}
})
}else{
this.priceFlag = true
}
})
},
//选择商品
chooseGoods(){
this.isMutiSelectVisible = !this.isMutiSelectVisible
},
handleConfigSearch(){
this.getAllGoods(this.searchProForm.name)
},
handleConfigReset(){
this.getAllGoods()
},
handleMutiSelectConfirm(selectedData) {
// this.editForm.goodsRefList = selectedData
this.handleMutiSelectClose()
},
handleMutiSelectClose() {
this.isMutiSelectVisible = !this.isMutiSelectVisible
},
denominationBlur(event){
if(event.target.value*100 > this.minPirce){
this.priceFlag = true
}else{
this.priceFlag = false
}
},
getInfo() { getInfo() {
// this.$apis.zoneList.getZoneInfoApi({ id: this.routeInfo.id }).then(res => { // this.$apis.zoneList.getZoneInfoApi({ id: this.routeInfo.id }).then(res => {
// this.editForm.zoneName = res.zoneName // this.editForm.zoneName = res.zoneName
......
...@@ -131,6 +131,13 @@ export default { ...@@ -131,6 +131,13 @@ export default {
label: '剩余', label: '剩余',
prop: 'residueAmount' prop: 'residueAmount'
}, },
// {
// label: '使用途径',
// name: 'useChannel',
// formatter: cellValue => {
// return this.baseData.useChannelList.find(item => item.confId == cellValue.useChannel).confName
// }
// },
{ {
label: '优惠券状态', label: '优惠券状态',
name: 'status', name: 'status',
...@@ -159,6 +166,13 @@ export default { ...@@ -159,6 +166,13 @@ export default {
confId: '3', confId: '3',
confName: '已失效' confName: '已失效'
}], }],
useChannelList: [{
confId: '1',
confName: '线上商品'
}, {
confId: '2',
confName: '到店核销'
}],
} }
} }
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!