Commit 7bdab285 authored by zhengyi's avatar zhengyi

web端复制订单逻辑修改

parent 3401a4a2
...@@ -2064,12 +2064,87 @@ export default { ...@@ -2064,12 +2064,87 @@ export default {
consigneePhone: '' consigneePhone: ''
}) })
this.form.deliveryDate = res.data.deliveryDate this.form.deliveryDate = res.data.deliveryDate
if (this.$route.query.copy && this.$route.query.copy == 1) {
// 复制订单,需要将数据初始化
this.form.orderId = null
this.form.orderNo = null
this.form.containerNumber = null
this.form.tidanNo = null
this.form.parentOrderId = null
this.form.parentNumber = null
this.form.number = null
this.form.initialParentOrderId = null
this.form.initialParentOrderNo = null
this.form.noChargeRecord = null
this.form.oldNumbers = null
this.form.userId = 0
this.form.sumNum = null
this.form.sumQuantity = null
this.form.sumVolume = null
this.form.sumWeight = null
this.form.pickleType = null
this.form.pickRatio = null
this.form.pickNum = null
this.form.releaseRatio = null
this.form.cost = null
this.form.packingListUrl = null
this.form.commissionPayable = null
this.form.specialVWeight = null
this.form.handlerChannelAttrException = null
this.form.weightBeforePack = null
this.form.weightAfterPack = null
this.form.stockOverWeightLimit = null
this.form.firstStockedTime = null
this.form.isLimitUpdateConsignee = null
this.form.lockConsigneeDay = null
this.form.lockConsigneeTime = null
this.form.firstStockedTime = null
// 状态重置
this.form.status = 0
this.form.cargoControlStatus = 0
this.form.abnormalState = 0
this.form.inWarehouseState = 0
this.form.shipmentState = 0
this.form.auditType = 0
this.form.auditResult = null
this.form.airShipment = null
this.form.splitSeparateOrder = null
this.form.pickState = null
this.form.guanLianOrderStatus = null
this.form.oldInWarehouseState = null
this.form.oldStatus = null
this.form.oldShipmentState = null
// 时间重置
this.form.takeTime = null
this.form.unloadTime = null
this.form.rucangTime = null
this.form.loadTime = null
this.form.preLoadTime = null
this.form.deliveryDate = null
this.form.daogangTime = null
this.form.qingguanTime = null
this.form.splitTime = null
this.form.isException = null
this.form.exceptionReason = null
this.form.externalWarehouseJson = null
this.form.hasExitAndEntry = null
this.form.hasSendRucangSms = null
this.form.hasSendWarehouseInNotice = null
}
this.form.hasConsignee = res.data.hasConsignee this.form.hasConsignee = res.data.hasConsignee
if (!this.noConsignee){ if (!this.noConsignee){
// 不允许无收货人 // 不允许无收货人
this.form.hasConsignee = true this.form.hasConsignee = true
} }
if (res.data.consigneeVO && this.$route.query.copy && this.$route.query.copy == 1) {
res.data.consignorVO.id = null
res.data.consignorVO.orderId = null
}
if(res.data.consigneeVO){ if(res.data.consigneeVO){
if (this.$route.query.copy && this.$route.query.copy == 1) {
res.data.consigneeVO.id = null
res.data.consigneeVO.orderId = null
}
this.$set(this.form, 'consigneePhone', res.data.consigneeVO.phone) this.$set(this.form, 'consigneePhone', res.data.consigneeVO.phone)
this.$set(this.form, 'countryCode', res.data.consigneeVO.countryCode) this.$set(this.form, 'countryCode', res.data.consigneeVO.countryCode)
this.$set(this.form, 'consigneeCompany', res.data.consigneeVO.company) this.$set(this.form, 'consigneeCompany', res.data.consigneeVO.company)
...@@ -2094,11 +2169,30 @@ export default { ...@@ -2094,11 +2169,30 @@ export default {
} }
this.$nextTick(() => { this.$nextTick(() => {
res.data.orderItemVOList.forEach((item) => { res.data.orderItemVOList.forEach((item) => {
item.prodAttrArr = item.prodAttrIds 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.brand = item.brand
newItem.brandType = item.brandType
}else {
newItem = item
}
newItem.prodAttrArr = newItem.prodAttrIds
.split(',') .split(',')
.filter((item) => item != '') .filter((item) => item != '')
.map((attrId) => +attrId) .map((attrId) => +attrId)
this.form.orderItemVOList.push({ ...item }) this.form.orderItemVOList.push({ ...newItem })
}) })
}) })
}) })
......
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
header-align="center" header-align="center"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="scope.row.status <= 2" size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">{{ $t('postorder.edit') }}</el-button> <el-button v-if="scope.row.status <= 2" size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row, false)">{{ $t('postorder.edit') }}</el-button>
<el-button v-if="scope.row.status == 2" size="mini" type="text" icon="el-icon-delete" @click="oprateOrder(scope.row.orderId)">{{ $t('postorder.cancel') }}</el-button> <el-button v-if="scope.row.status == 2" size="mini" type="text" icon="el-icon-delete" @click="oprateOrder(scope.row.orderId)">{{ $t('postorder.cancel') }}</el-button>
<el-button v-if="scope.row.status == 5" size="mini" type="text" icon="el-icon-edit" @click="refundWarehouse(scope.row)">{{ $t('postorder.refundWarehouse') }}</el-button> <el-button v-if="scope.row.status == 5" size="mini" type="text" icon="el-icon-edit" @click="refundWarehouse(scope.row)">{{ $t('postorder.refundWarehouse') }}</el-button>
<el-button v-if="scope.row.abnormalState>1&&scope.row.status!=88" size="mini" type="text" icon="el-icon-edit" @click="handleAbnormal(scope.row.orderId)">{{ $t('postorder.abnormal') }}</el-button> <el-button v-if="scope.row.abnormalState>1&&scope.row.status!=88" size="mini" type="text" icon="el-icon-edit" @click="handleAbnormal(scope.row.orderId)">{{ $t('postorder.abnormal') }}</el-button>
...@@ -304,8 +304,12 @@ export default { ...@@ -304,8 +304,12 @@ export default {
this.handleQuery() this.handleQuery()
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row, copy) {
this.$router.push('jd-deliveryedit?id=' + row.orderId) if (copy) {
this.$router.push('jd-deliveryedit?id=' + row.orderId + '&copy=1')
} else {
this.$router.push('jd-deliveryedit?id=' + row.orderId)
}
}, },
handleDelete(id) { handleDelete(id) {
this.$confirm(this.$t('是否确认删除订单')).then(function() { this.$confirm(this.$t('是否确认删除订单')).then(function() {
...@@ -319,9 +323,10 @@ export default { ...@@ -319,9 +323,10 @@ export default {
}).catch(() => {}) }).catch(() => {})
}, },
handleCopy(row){ handleCopy(row){
copyOrder(row.orderId).then((res) => { this.handleUpdate({ orderId: row, copy: true })
this.handleUpdate({ orderId: res.data}) // copyOrder(row.orderId).then((res) => {
}) // this.handleUpdate({ orderId: res.data})
// })
}, },
oprateOrder(orderId) { oprateOrder(orderId) {
this.$confirm(this.$t('postorder.confirm')) this.$confirm(this.$t('postorder.confirm'))
......
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