Commit c298c59d authored by zhengyi's avatar zhengyi

复制订单逻辑修改

parent 81ce44b0
......@@ -931,9 +931,9 @@
</template>
<script>
import cuihaiCombox from '../../components/cuihai-combox/cuihai-combox.vue'
import Drawee from "@/pages/create_order/components/drawee.vue";
export default {
import Drawee from "@/pages/create_order/components/drawee.vue";
export default {
components: {Drawee},
data() {
const currentDate = this.getDate({
......@@ -1204,8 +1204,13 @@
this.getClientaData()
if(op.id){
await this.$nextTick()
this.getOrderData(op.id)
this.orderId = op.id
this.orderId = op.id
if (op.copy && op.copy == 1){
this.getOrderData(op.id, true)
}else {
this.getOrderData(op.id, false)
}
}else{
this.setDefaultDrawee()
}
......@@ -1964,15 +1969,108 @@
})
},
getOrderData(id){
getOrderData(id, copy){
let that = this
that.$request.get('/app-api/my/order/get',{orderId:id}).then(async (res) => {
if(res.code==0&&res.data){
that.params = res.data
if (copy){
// 复制订单,需要将数据初始化
that.params.orderId = null
that.params.orderNo = null
that.params.containerNumber = null
that.params.tidanNo = null
that.params.parentOrderId = null
that.params.parentNumber = null
that.params.number = null
that.params.initialParentOrderId = null
that.params.initialParentOrderNo = null
that.params.noChargeRecord = null
that.params.oldNumbers = null
that.params.userId = 0
that.params.sumNum = null
that.params.sumQuantity = null
that.params.sumVolume = null
that.params.sumWeight = null
that.params.pickleType = null
that.params.pickRatio = null
that.params.pickNum = null
that.params.releaseRatio = null
that.params.cost = null
that.params.packingListUrl = null
that.params.commissionPayable = null
that.params.specialVWeight = null
that.params.handlerChannelAttrException = null
that.params.weightBeforePack = null
that.params.weightAfterPack = null
that.params.stockOverWeightLimit = null
that.params.firstStockedTime = null
that.params.isLimitUpdateConsignee = null
that.params.lockConsigneeDay = null
that.params.lockConsigneeTime = null
that.params.firstStockedTime = null
// 状态重置
that.params.status = 0
that.params.cargoControlStatus = 0
that.params.abnormalState = 0
that.params.inWarehouseState = 0
that.params.shipmentState = 0
that.params.auditType = 0
that.params.auditResult = null
that.params.airShipment = null
that.params.splitSeparateOrder = null
that.params.pickState = null
that.params.guanLianOrderStatus = null
that.params.oldInWarehouseState = null
that.params.oldStatus = null
that.params.oldShipmentState = null
// 时间重置
that.params.takeTime = null
that.params.unloadTime = null
that.params.rucangTime = null
that.params.loadTime = null
that.params.preLoadTime = null
that.params.deliveryDate = null
that.params.daogangTime = null
that.params.qingguanTime = null
that.params.splitTime = null
that.params.isException = null
that.params.exceptionReason = null
that.params.externalWarehouseJson = null
that.params.hasExitAndEntry = null
that.params.hasSendRucangSms = null
that.params.hasSendWarehouseInNotice = null
if (that.params.consignorVO){
that.params.consignorVO.id = null
that.params.consignorVO.orderId = null
}
if (that.params.consigneeVO){
that.params.consigneeVO.id = null
that.params.consigneeVO.orderId = null
}
}
// if(!that.params.number) that.params.number = ''
that.getType()
if(that.params.orderItemVOList.length>0){
that.params.orderItemVOList.forEach((item,index)=>{
if (this.$route.query.copy && this.$route.query.copy == 1) {
item = {
link: item.link,
prodId: item.prodId,
prodTitleEn: item.prodTitleEn,
prodTitleZh: item.prodTitleZh,
prodAttrIds: item.prodAttrIds,
prodType: item.prodType,
volume: item.volume,
weight: item.weight,
quantity: item.quantity,
num: item.num,
worth: item.worth,
boxGauge: item.boxGauge,
brand: item.brand,
brandType: item.brandType
}
}
if(item.prodAttrIds) item.prodAttrs = item.prodAttrIds.split(',')
})
}
......
......@@ -96,7 +96,7 @@
</view>
<view v-if="selectIndex==1||(selectIndex==0&&item.deliverGoods)" class="order-btn">
<view @click="toOrderInfo(item.orderId)">{{$lang.lang.order.see}}</view>
<view v-if='item.status==0||item.status==2' @click="toEditOrder(item.orderId)">{{$lang.lang.order.edit}}</view>
<view v-if='item.status==0||item.status==2' @click="toEditOrder(item.orderId, false)">{{$lang.lang.order.edit}}</view>
<view v-if='item.status==0||item.status==88' @click="delOrder(item.orderId)">{{$lang.lang.order.delete}}</view>
<view v-if='item.status==2&&item.status!=88' @click="cancelOrder(item.orderId)">{{$lang.lang.order.cancelOrder}}</view>
<view v-if='item.status==5&&item.status!=88' @click="returnOrder(index)">{{$lang.lang.order.exit}}</view>
......@@ -1154,10 +1154,16 @@
url:'../orderInfo/orderInfo?id='+id
})
},
toEditOrder(id){
uni.navigateTo({
url:'../create_order/create_order?id='+id
})
toEditOrder(id, copy){
if (copy){
uni.navigateTo({
url:'../create_order/create_order?id='+id +'&copy=1'
})
}else {
uni.navigateTo({
url:'../create_order/create_order?id='+id
})
}
},
toException(id){
uni.navigateTo({
......@@ -1354,9 +1360,10 @@
})
},*/
copy(orderId){
this.$request.post("/app-api/my/order/copy/" + orderId).then(res => {
this.toEditOrder(res.data)
})
this.toEditOrder(orderId, true)
// this.$request.post("/app-api/my/order/copy/" + orderId).then(res => {
// this.toEditOrder(res.data)
// })
}
},
......
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