|
|
@ -198,6 +198,7 @@ |
|
|
|
@click="handleDelete(scope.row.coupon_id, scope.$index)" |
|
|
|
@click="handleDelete(scope.row.coupon_id, scope.$index)" |
|
|
|
>删除</el-button |
|
|
|
>删除</el-button |
|
|
|
> |
|
|
|
> |
|
|
|
|
|
|
|
<el-button type="text" size="small" @click="getCouponShopping(scope.row)">选择商品</el-button> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-table> |
|
|
@ -465,6 +466,25 @@ |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<el-dialog title="提示" :visible.sync="shopDialog" width="80%"> |
|
|
|
|
|
|
|
<el-table :data="shopList" style="width: 100%" @selection-change="handleSelectionChange" > |
|
|
|
|
|
|
|
<el-table-column type="selection" width="55"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column type="index" label="序号"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="store_name" align="center" label="商品名称"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="price" align="center" label="商品价格"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="image" align="center" label="商品主图"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
<img :src="scope.row.image" alt="" style="width:100px;height:100px;"> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="stock" align="center" label="库存"></el-table-column> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</el-table> |
|
|
|
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
|
|
|
<el-button @click="shopDialog = false">取 消</el-button> |
|
|
|
|
|
|
|
<el-button type="primary" @click="setCouponShoppingHandle">确 定</el-button> |
|
|
|
|
|
|
|
</span> |
|
|
|
|
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
@ -486,6 +506,8 @@ import { |
|
|
|
platIssueApi, |
|
|
|
platIssueApi, |
|
|
|
couponIssueStatusApi, |
|
|
|
couponIssueStatusApi, |
|
|
|
platRelateProLst, |
|
|
|
platRelateProLst, |
|
|
|
|
|
|
|
couponShopping, |
|
|
|
|
|
|
|
setCouponShopping |
|
|
|
} from "@/api/marketing"; |
|
|
|
} from "@/api/marketing"; |
|
|
|
import { |
|
|
|
import { |
|
|
|
issueApi, |
|
|
|
issueApi, |
|
|
@ -539,12 +561,53 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
couponDetail: {}, |
|
|
|
couponDetail: {}, |
|
|
|
type: 0, |
|
|
|
type: 0, |
|
|
|
|
|
|
|
shopDialog:false, |
|
|
|
|
|
|
|
shopList:[], |
|
|
|
|
|
|
|
multipleSelection: [], |
|
|
|
|
|
|
|
selectedCoupon:{} |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
mounted() { |
|
|
|
this.getList(1); |
|
|
|
this.getList(1); |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
|
|
|
|
handleSelectionChange(val){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.multipleSelection = val.map(item=>{ |
|
|
|
|
|
|
|
return item.product_id |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
setCouponShoppingHandle(){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setCouponShopping(this.selectedCoupon.coupon_id,{product_id:this.multipleSelection.join()}).then((res) => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.getList(1) |
|
|
|
|
|
|
|
this.shopDialog = false; |
|
|
|
|
|
|
|
}).catch(({ message }) => { |
|
|
|
|
|
|
|
this.$message.error(message); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.multipleSelection |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getCouponShopping(row){ |
|
|
|
|
|
|
|
this.selectedCoupon = row; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
couponShopping(row.coupon_id).then(res=>{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let shopList = [] |
|
|
|
|
|
|
|
res.data.list.forEach(item=>{ |
|
|
|
|
|
|
|
let obj = {} |
|
|
|
|
|
|
|
if(item.product){ |
|
|
|
|
|
|
|
Object.keys(item.product).forEach(p=>{ |
|
|
|
|
|
|
|
this.$set(obj,p,item.product[p]) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
shopList.push(obj) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.shopList = shopList; |
|
|
|
|
|
|
|
this.shopDialog = true; |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
// 删除 |
|
|
|
// 删除 |
|
|
|
handleDelete(id, idx) { |
|
|
|
handleDelete(id, idx) { |
|
|
|
this.$modalSureDelete(`删除优惠券将无法恢复,请谨慎操作!`).then(() => { |
|
|
|
this.$modalSureDelete(`删除优惠券将无法恢复,请谨慎操作!`).then(() => { |
|
|
|