Commit a7509486 authored by dragondean@qq.com's avatar dragondean@qq.com

修复优惠空运线路的渠道字段不对导致的异常

parent 7264a2b3
......@@ -276,6 +276,7 @@ import Editor from '@/components/Editor'
import Selector from '@/components/Selector/index'
import {parseTime} from '@/utils/ruoyi'
import {str2arr} from '@/utils/index'
import item from '@/layout/components/Sidebar/Item.vue'
export default {
......@@ -447,6 +448,12 @@ export default {
getCoupon(this.$route.query.id).then((res) => {
this.form = res.data;
// 线路种的渠道字段跟价格模块不同,需要转换兼容
if(this.form.lineIds?.length) {
this.form.lineIds = this.form.lineIds.map(item => {
return {...item, shippingChannelId: item.channelId}
})
}
['orderAttr', 'isCargoControl', 'brand', 'documentDeclaration'].forEach(field => {
this.$set(this.form, field + 'Arr', str2arr(res.data[field]))
})
......@@ -663,13 +670,11 @@ export default {
})
this.$set(this.form, 'suitableProdType', this.isAllProduct ? 0 : 1)
let data = Object.assign({}, this.form, {discountDetailedVOs})
// 开始时间必填
if(!data.startTime)data.startTime = parseTime(Date.now()) // '2022-01-01 00:00:00'
// status必填
data.status = status
let data = Object.assign({}, this.form, {discountDetailedVOs})
// 开始时间必填
if(!data.startTime)data.startTime = parseTime(Date.now()) // '2022-01-01 00:00:00'
// status必填
data.status = status
data.couponIds = this.couponIds.join(',')
// 费用类型 1 运输费 2 清关费 3 总费用(优惠卷专用)
......@@ -683,6 +688,13 @@ export default {
}
this.$set(this.form, 'suitableProdType', this.isAllProduct ? 0 : 1)
// 优惠模块的线路渠道字段跟价格模块不同,需要转换
if(data.lineIds?.length){
data.lineIds = data.lineIds.map(item => {
return {...item, channelId: item.shippingChannelId}
})
}
// 修改的提交
if (data.couponId != null) {
updateCoupon(data).then((response) => {
......
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