Commit b96ea9d5 authored by Marcus's avatar Marcus

特价组件流程测试 approveId

parent ddf16499
......@@ -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 = [
meta: {title: '特价申请', icon: '', activeMenu: '/offer/index'}
},
{
path: 'discount/:id(\\d+)',
path: 'discount/:offerProdId(\\d+)',
component: (resolve) => import('@/views/ecw/offer/specialDiscount'),
props: true,
name: 'discount',
......
......@@ -33,11 +33,12 @@
</template>
<script>
import {createOfferSpecial, getOffer, getOfferSpecial} from "@/api/ecw/offer"
import {createOfferSpecial, getOffer, getOfferSpecial, getOfferSpecialByApproveId} from "@/api/ecw/offer"
export default {
name: "specialDiscount",
props: {
offerProdId: String,
id: Number,
readonly: {
type: Boolean,
......@@ -45,19 +46,24 @@ export default {
}
},
created() {
// if(this.offerId){
// this.form.offerId = this.offerId
// }
// 临时
if(this.$route.query.offerId){
this.form.offerId = this.$route.query.offerId - 0
// this.getOffer()
}
this.form.offerProdId = this.id
// if(this.offerProdId){
// }else if(this.$route.query.offerProdId){
// this.form.offerProdId = this.$route.query.offerProdId - 0
// }
if(this.form.offerId) this.getOffer()
this.getOfferSpecial()
// 查看详情,列表进来的
if(this.offerProdId){
this.form.offerProdId = this.offerProdId - 0
this.getOfferSpecial()
}
// 从流程查看详情
if(this.id)
this.getOfferSpecialByApproveId()
},
data() {
return {
......@@ -78,27 +84,37 @@ export default {
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
// 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(this.form.offerProdId).then(r => {
this.follow = r.data
if (!this.form.offerId) {
this.form.offerId = r.data.offerId
}
})
},
getOfferSpecial(){
getOfferSpecial(this.form.offerProdId).then(r => {
getOfferSpecialByApproveId(){
getOfferSpecialByApproveId(this.id).then(r => {
this.follow = r.data
if (!this.form.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