Browse Source

支持优惠券发放

master
sj 2 years ago
parent
commit
4d93aae5d5
  1. 9
      src/api/bxg/yxStoreCoupon.js
  2. 19
      src/views/bxg/activity/coupon/form3.vue

9
src/api/bxg/yxStoreCoupon.js

@ -8,6 +8,15 @@ export function add(data) {
}) })
} }
//发放优惠券
export function give(data) {
return request({
url: '/bxg/api/yxStoreCoupon/give',
method: 'post',
data
})
}
export function del(id) { export function del(id) {
return request({ return request({
url: '/bxg/api/yxStoreCoupon/' + id, url: '/bxg/api/yxStoreCoupon/' + id,

19
src/views/bxg/activity/coupon/form3.vue

@ -87,10 +87,11 @@
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import checkPermission from '@/utils/permission' import checkPermission from '@/utils/permission'
import { add, edit } from '@/api/bxg/yxStoreCouponIssue' import { add, edit } from '@/api/bxg/yxStoreCouponIssue'
import {give} from '@/api/bxg/yxStoreCoupon'
import initData from '@/mixins/crud' import initData from '@/mixins/crud'
export default { export default {
mixins: [initData], mixins: [initData],
@ -135,7 +136,6 @@ export default {
methods: { methods: {
handleSelectionChange(val){ handleSelectionChange(val){
this.multipleSelection = val; this.multipleSelection = val;
console.log('this.multipleSelection',this.multipleSelection )
}, },
checkPermission, checkPermission,
beforeInit() { beforeInit() {
@ -153,7 +153,17 @@ export default {
this.dialog = false this.dialog = false
}, },
doSubmit() { doSubmit() {
this.loading = true this.loading = true
let data={
userIds:this.multipleSelection,
couponId:this.form.cid
}
give(data).then(res=>{
// if (res){
this.$message.success("发放成功")
this.loading=false
// }
})
}, },
doAdd() { doAdd() {
add(this.form).then(res => { add(this.form).then(res => {
@ -204,8 +214,7 @@ export default {
} }
} }
</script> </script>
<style scoped> <style scoped>
</style> </style>
Loading…
Cancel
Save