Commit 9eee52fe authored by Marcus's avatar Marcus

特价组件流程测试

parent 23f660d3
...@@ -92,7 +92,7 @@ export function createOfferSpecial(data) { ...@@ -92,7 +92,7 @@ export function createOfferSpecial(data) {
// 特价详情 // 特价详情
export function getOfferSpecial(offerProdId) { export function getOfferSpecial(offerProdId) {
return request({ return request({
url: '/ecw/offer/special/info/' + offerProdId + '?offerProdId=' + offerProdId, url: '/ecw/offer/special/info/' + offerProdId,
method: 'get' method: 'get'
}) })
} }
......
...@@ -275,7 +275,7 @@ export const constantRoutes = [ ...@@ -275,7 +275,7 @@ export const constantRoutes = [
meta: {title: '特价申请', icon: '', activeMenu: '/offer/index'} meta: {title: '特价申请', icon: '', activeMenu: '/offer/index'}
}, },
{ {
path: 'discount', path: 'discount/:id(\\d+)',
component: (resolve) => import('@/views/ecw/offer/specialDiscount'), component: (resolve) => import('@/views/ecw/offer/specialDiscount'),
props: true, props: true,
name: 'discount', name: 'discount',
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
prop="address" prop="address"
label="操作"> label="操作">
<template v-slot="{row}"> <template v-slot="{row}">
<el-button size="mini" type="text" v-hasPermi="['ecw:offer:update']" @click="$router.push(`/offer/discount?offerId=${row.offerId}&offerProdId=${row.offerProdId}`)">优惠申请</el-button> <el-button size="mini" type="text" v-hasPermi="['ecw:offer:update']" @click="$router.push(`/offer/discount/${row.offerProdId}?offerId=${row.offerId}`)">优惠申请</el-button>
<!-- <el-button size="mini" type="text" v-hasPermi="['ecw:offer:update']">佣金规则</el-button>--> <!-- <el-button size="mini" type="text" v-hasPermi="['ecw:offer:update']">佣金规则</el-button>-->
<!-- <el-button size="mini" type="text" v-hasPermi="['ecw:offer:update']">管理折扣</el-button>--> <!-- <el-button size="mini" type="text" v-hasPermi="['ecw:offer:update']">管理折扣</el-button>-->
</template> </template>
......
...@@ -38,27 +38,21 @@ import {createOfferSpecial, getOffer, getOfferSpecial} from "@/api/ecw/offer" ...@@ -38,27 +38,21 @@ import {createOfferSpecial, getOffer, getOfferSpecial} from "@/api/ecw/offer"
export default { export default {
name: "specialDiscount", name: "specialDiscount",
props: { props: {
id: Number
}, },
created() { created() {
// if(this.offerId){
// this.form.offerId = this.offerId
// }
if(this.$route.query.offerId){ if(this.$route.query.offerId){
this.form.offerId = this.$route.query.offerId - 0 this.form.offerId = this.$route.query.offerId - 0
} }
if(this.$route.query.offerProdId){ this.form.offerProdId = this.id
this.form.offerProdId = this.$route.query.offerProdId - 0 // if(this.offerProdId){
} // }else if(this.$route.query.offerProdId){
getOffer(this.form.offerId).then(r => { // this.form.offerProdId = this.$route.query.offerProdId - 0
const line = r.data.offerProdRespVOList.find(e => e.offerProdId = this.form.offerProdId) // }
console.log(line) if(this.form.offerId) this.getOffer()
const {
clearanceFreight,
seaFreight
} = line
this.form = {
...this.form,
clearanceFreight,
seaFreight
}
})
this.getOfferSpecial() this.getOfferSpecial()
}, },
data() { data() {
...@@ -80,9 +74,28 @@ export default { ...@@ -80,9 +74,28 @@ export default {
this.$message.success(r.msg || '提交成功') this.$message.success(r.msg || '提交成功')
}) })
}, },
getOffer(){
getOffer(this.form.offerId).then(r => {
const line = r.data.offerProdRespVOList.find(e => e.offerProdId = this.form.offerProdId)
console.log(line)
const {
clearanceFreight,
seaFreight
} = line
this.form = {
...this.form,
clearanceFreight,
seaFreight
}
})
},
getOfferSpecial(){ getOfferSpecial(){
getOfferSpecial(this.form.offerProdId).then(r => { getOfferSpecial(this.form.offerProdId).then(r => {
this.follow = r.data this.follow = r.data
if (!this.form.offerId) {
this.form.offerId = r.data.offerId
}
}) })
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment