Commit b96ea9d5 authored by Marcus's avatar Marcus

特价组件流程测试 approveId

parent ddf16499
...@@ -97,3 +97,11 @@ export function getOfferSpecial(offerProdId) { ...@@ -97,3 +97,11 @@ export function getOfferSpecial(offerProdId) {
}) })
} }
// 特价详情
export function getOfferSpecialByApproveId(approveId) {
return request({
url: '/ecw/offer/special/info?approveId=' + approveId,
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/:id(\\d+)', path: 'discount/:offerProdId(\\d+)',
component: (resolve) => import('@/views/ecw/offer/specialDiscount'), component: (resolve) => import('@/views/ecw/offer/specialDiscount'),
props: true, props: true,
name: 'discount', name: 'discount',
......
...@@ -33,11 +33,12 @@ ...@@ -33,11 +33,12 @@
</template> </template>
<script> <script>
import {createOfferSpecial, getOffer, getOfferSpecial} from "@/api/ecw/offer" import {createOfferSpecial, getOffer, getOfferSpecial, getOfferSpecialByApproveId} from "@/api/ecw/offer"
export default { export default {
name: "specialDiscount", name: "specialDiscount",
props: { props: {
offerProdId: String,
id: Number, id: Number,
readonly: { readonly: {
type: Boolean, type: Boolean,
...@@ -45,19 +46,24 @@ export default { ...@@ -45,19 +46,24 @@ export default {
} }
}, },
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
// this.getOffer()
} }
this.form.offerProdId = this.id
// if(this.offerProdId){ // 查看详情,列表进来的
// }else if(this.$route.query.offerProdId){ if(this.offerProdId){
// this.form.offerProdId = this.$route.query.offerProdId - 0 this.form.offerProdId = this.offerProdId - 0
// }
if(this.form.offerId) this.getOffer()
this.getOfferSpecial() this.getOfferSpecial()
}
// 从流程查看详情
if(this.id)
this.getOfferSpecialByApproveId()
}, },
data() { data() {
return { return {
...@@ -78,27 +84,37 @@ export default { ...@@ -78,27 +84,37 @@ export default {
this.$message.success(r.msg || '提交成功') this.$message.success(r.msg || '提交成功')
}) })
}, },
getOffer(){ // getOffer(){
getOffer(this.form.offerId).then(r => { // getOffer(this.form.offerId).then(r => {
const line = r.data.offerProdRespVOList.find(e => e.offerProdId = this.form.offerProdId) // const line = r.data.offerProdRespVOList.find(e => e.offerProdId = this.form.offerProdId)
console.log(line) // console.log(line)
const { // const {
clearanceFreight, // clearanceFreight,
seaFreight // seaFreight
} = line // } = line
this.form = { // this.form = {
...this.form, // ...this.form,
clearanceFreight, // clearanceFreight,
seaFreight // seaFreight
// }
// })
// },
getOfferSpecial(){
getOfferSpecial(this.form.offerProdId).then(r => {
this.follow = r.data
if (!this.form.offerId) {
this.form.offerId = r.data.offerId
} }
}) })
}, },
getOfferSpecial(){ getOfferSpecialByApproveId(){
getOfferSpecial(this.form.offerProdId).then(r => { getOfferSpecialByApproveId(this.id).then(r => {
this.follow = r.data this.follow = r.data
if (!this.form.offerId) { if (!this.form.offerId) {
this.form.offerId = r.data.offerId this.form.offerId = r.data.offerId
this.form.offerProdId = r.data.offerProdId
this.form.clearanceFreight = this.form.offerSpecialApplyVO.clearanceFreight
this.form.seaFreight = this.form.offerSpecialApplyVO.seaFreight
} }
}) })
} }
......
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