Commit 63bc66f0 authored by Smile's avatar Smile

需求134后台-集运-包裹列表-转运

parent 74eb8c79
......@@ -50,6 +50,15 @@ export function getCons(id) {
})
}
// 获得集运包裹转运临时order
export function getTempOrderByConsIds(params){
return request({
url: '/ecw/cons/getTempOrderByConsIds',
method: 'get',
params
})
}
// 获得集运包裹主分页
export function getConsPage(query) {
return request({
......
This diff is collapsed.
......@@ -793,6 +793,7 @@ import {debounce} from "@/utils";
import {getOfferSelect, getOfferCheck} from "@/api/ecw/offer"
import Template from '@/views/cms/template/index.vue'
import {checkBillOfLadingService} from "@/api/ecw/box";
import {getTempOrderByConsIds} from "@/api/ecw/cons";
// 缓存默认的表单数据
let makeDefaultFormData = () => {
......@@ -853,6 +854,7 @@ export default {
routerList: [],
tradeCityList: [],
treeList: [],
consIds:[],
consignorContact: {}, // 发货联系人
consigneeContact: {}, // 收货联系人
/* consignee: null,
......@@ -1052,6 +1054,10 @@ export default {
editMode() {
return this.$route.path.indexOf('create') == -1
},
// 是否包裹转运
consMode() {
return this.$route.query.hasOwnProperty('consIds')
},
// 是否可以编辑商品基本信息(货值除外)
productEditable() {
// 非编辑模式 或者 未完成入仓
......@@ -1350,8 +1356,115 @@ export default {
this.initing = false
})
}
if (this.$route.query.hasOwnProperty('consIds')){
console.log("有没有包裹")
this.getTempOrderByConsIds()
}
},
methods: {
async getTempOrderByConsIds(){
//把传过来的consIds 2,3,4转成数组
this.consIds= this.$route.query.consIds.split(',')
getTempOrderByConsIds({ids: this.consIds.join(',')}).then(res=>{
this.form = Object.assign({}, {...res.data}, {orderItemVOList: []})
this.getOfferData()
this.getTradeCity()
this.getOpenedRouterList()
console.log("未找到选择的路线111111",this.routerList)
this.selectedRouter = this.routerList.find(item => item.id === this.form.lineId)
if (this.selectedRouter) {
this.form.destCountryId = this.selectedRouter.destCountryId
} else console.log("未找到选择的路线", this.routerList, this.selectedRouter)
console.log("国家ID", this.form.destCountryId)
console.log("res",res)
// 是否有收货人
this.hasConsignee = !!res.data.consigneeVO
// 每次编辑订单详情需要实时获取发货人当前信息
if (res.data.consignorVO) {
this.$set(this.form, 'consignorCompany', res.data.consignorVO.company)
this.$set(this.form, 'consignorCompanyEn', res.data.consignorVO.companyEn)
this.$set(this.form, 'consignorContactsId', res.data.consignorVO.customerContactsId)
this.$set(this.form, 'consignorCountryCode', res.data.consignorVO.countryCode.replace('+', ''))
this.$set(this.form, 'consignorEmail', res.data.consignorVO.email)
this.$set(this.form, 'consignorId', res.data.consignorVO.customerId)
this.$set(this.form, 'consignorName', res.data.consignorVO.name)
this.$set(this.form, 'consignorNameEn', res.data.consignorVO.nameEn)
this.$set(this.form, 'consignorPhone', res.data.consignorVO.phone)
this.getCustomer(res.data.consignorVO.customerId)
}
if (res.data.consigneeVO) {
this.$set(this.form, 'consigneeCompany', res.data.consigneeVO.company)
this.$set(this.form, 'consigneeCompanyEn', res.data.consigneeVO.companyEn)
this.$set(this.form, 'consigneeContactsId', res.data.consigneeVO.customerContactsId)
this.$set(this.form, 'consigneeCountryCode', res.data.consigneeVO.countryCode.replace('+', ''))
this.$set(this.form, 'consigneeEmail', res.data.consigneeVO.email)
this.$set(this.form, 'consigneeId', res.data.consigneeVO.customerId)
this.$set(this.form, 'consigneeName', res.data.consigneeVO.name)
this.$set(this.form, 'consigneeNameEn', res.data.consigneeVO.nameEn)
this.$set(this.form, 'consigneePhone', res.data.consigneeVO.phone)
}
// res.data.hasConsignee 订单冗余的发货人是否允许无收货人
// res.data.noConsignee 当前订单发货人是否允许无收货
// 如果已完成入仓,则需要监听必填内容,发生更改后需要填写审批表单
this.$nextTick(() => {
console.log('nextTick 订单渲染完成')
res.data.orderItemVOList.forEach(item => {
let newItem = {}
if (this.$route.query.copy && this.$route.query.copy == 1) {
newItem.link = item.link
newItem.prodId = item.prodId
newItem.prodTitleEn = item.prodTitleEn
newItem.prodTitleZh = item.prodTitleZh
newItem.prodAttrIds = item.prodAttrIds
newItem.prodType = item.prodType
newItem.volume = item.volume
newItem.weight = item.weight
newItem.quantity = item.quantity
newItem.num = item.num
newItem.worth = item.worth
newItem.boxGauge = item.boxGauge
newItem.brandType = item.brandType
}else {
newItem = item
}
newItem.prodAttrArr = newItem.prodAttrIds?.split(',').filter(item => item != '').map(attrId => +attrId) || []
this.form.orderItemVOList.push({...newItem})
})
// 已入仓后,必填字段修改则需要显示审批流
if (this.updateWorth == 1){
this.showWorkFlow = false
} else if (this.inWarehouse) {
Object.keys(this.rules).forEach(field => {
console.log("watch", field)
this.$watch(`form.${field}`, () => {
this.showWorkFlow = true
})
})
}
// 在初始化结束后transportId还会发生一次变化导致目的港清关被重置,所以需要延迟一下。暂不清楚原因
setTimeout(() => {
console.log('transportId', this.form.transportId)
console.log('portDestCustomsClear', this.form.portDestCustomsClear, res.data.portDestCustomsClear)
if (res.data.portDestCustomsClear) {
this.$set(this.form, 'portDestCustomsClear', res.data.portDestCustomsClear)
}
if (res.data.deliveryWay) {
this.$set(this.form, 'deliveryWay', res.data.deliveryWay)
}
this.$nextTick(() => {
this.initing = false
console.log("初始化完成 initing", this.initing)
})
}, 100)
})
})
},
async getTradeCity(a) {
let query = {}
if (this.form.channelId) {
......
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