|
@@ -3,17 +3,18 @@
|
|
|
title="订单发货(批量逐一发货)"
|
|
|
:visible.sync="drawer"
|
|
|
:direction="direction"
|
|
|
- size="40%">
|
|
|
+ size="50%">
|
|
|
<div class="content">
|
|
|
- <div class="order-top">
|
|
|
+ <div class="order-top" v-if="data.length > 1">
|
|
|
<el-pagination
|
|
|
background
|
|
|
:page-size="1"
|
|
|
layout="prev, pager, next"
|
|
|
- :total="10">
|
|
|
+ @current-change="currentChange"
|
|
|
+ :total="data.length">
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
- <deliveryGoodsInfo />
|
|
|
+ <deliveryGoodsInfo @editState="editState" @editResult="editResult" ref="info" />
|
|
|
<deliveryPrice />
|
|
|
</div>
|
|
|
<div class="space"></div>
|
|
@@ -38,17 +39,106 @@
|
|
|
import { Component, Prop, Vue, Watch } from "vue-property-decorator";
|
|
|
import DeliveryGoodsInfo from "./deliveryGoodsInfo.vue";
|
|
|
import DeliveryPrice from "./deliveryPrice.vue";
|
|
|
+import { add,multiply,subtract,divide } from '@/benyun/utils/accuracy'
|
|
|
+import { queryPricePackage } from '@/api/delivery'
|
|
|
@Component({components:{DeliveryGoodsInfo,DeliveryPrice}})
|
|
|
export default class DeliveryModal extends Vue {
|
|
|
drawer=false;
|
|
|
direction='rtl'
|
|
|
checked=false;
|
|
|
+ data:Array<any>=[];
|
|
|
+ currentOrder=0;
|
|
|
+ load = false;
|
|
|
setShow(v:boolean){
|
|
|
this.drawer=v;
|
|
|
}
|
|
|
+ editResult(v:any){
|
|
|
+ this.data[this.currentOrder] = v;
|
|
|
+ this.getPriceInfo();
|
|
|
+ }
|
|
|
+ currentChange(v:number){
|
|
|
+ this.currentOrder = v;
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ (this.$refs.info as any).setValue(this.data[this.currentOrder]);
|
|
|
+ })
|
|
|
+ // this.getPriceInfo();
|
|
|
+ }
|
|
|
+ setValue(data:Array<any>){
|
|
|
+ if(data && data.length > 0){
|
|
|
+ for(const item of data){
|
|
|
+ const requestId = new Date().getTime() + this.getUuid()
|
|
|
+ let obj:any={
|
|
|
+ requestId:requestId,
|
|
|
+ omsOrderIds:item.id,
|
|
|
+ tmsUnloadingProvince:item.receiverProvince,
|
|
|
+ tmsUnloadingProvinceNo:item.receiverProvinceCode,
|
|
|
+ tmsUnloadingCity:item.receiverCity,
|
|
|
+ tmsUnloadingCityNo:item.receiverCityCode,
|
|
|
+ tmsUnloadingRegion:item.receiverDistrict,
|
|
|
+ tmsUnloadingRegionNo:item.receiverDistrictCode,
|
|
|
+ tmsUnloadingStreet:item.receiverTown,
|
|
|
+ tmsUnloadingStreetNo:item.receiverTownCode,
|
|
|
+ tmsUnloadingAddress:item.receiverAddress,
|
|
|
+ tmsUnloadingConsignor:item.receiverName,
|
|
|
+ tmsUnloadingContacts:item.receiverMobile
|
|
|
+ };
|
|
|
+
|
|
|
+ obj.subItem=[];
|
|
|
+ if(item.items && item.items.length > 0){
|
|
|
+ for(const i of item.items){
|
|
|
+ let total:any = 0;
|
|
|
+ if(Number(i.qty) && Number(i.price)){
|
|
|
+ total = multiply(Number(i.qty),Number(i.price))
|
|
|
+ }
|
|
|
+
|
|
|
+ obj.subItem.push({
|
|
|
+ requestId:requestId,
|
|
|
+ omsOrderId:item.id,
|
|
|
+ omsOrderItemId:i.id,
|
|
|
+ tmsGoodsModel:i.styleId,
|
|
|
+ tmsGoodsCode:i.skuId,
|
|
|
+ tmsQuantity:i.qty,
|
|
|
+ tmsGoodsTotalPrice:total,
|
|
|
+ name:i.name,
|
|
|
+ price:i.price,
|
|
|
+ weight:i.weight
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.data.push(obj)
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.data = []
|
|
|
+ }
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ (this.$refs.info as any).setValue(this.data[this.currentOrder])
|
|
|
+ })
|
|
|
+ }
|
|
|
+ getUuid(){
|
|
|
+ return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
|
|
|
+ }
|
|
|
btn(){
|
|
|
|
|
|
}
|
|
|
+ getPriceInfo(){
|
|
|
+ let params:any={};
|
|
|
+ let data = this.data[this.currentOrder];
|
|
|
+ if(!data) return;
|
|
|
+ params.startAddressCode = data.tmsShipmentStreetNo;
|
|
|
+ params.endAddressCode = data.tmsUnloadingStreetNo;
|
|
|
+ params.goodsInfo={}
|
|
|
+ params.weight = 500;
|
|
|
+ params.volume = 100;
|
|
|
+ params.mileage = 1000;
|
|
|
+ queryPricePackage(params).then((res:any) => {
|
|
|
+
|
|
|
+ }).catch((err:any)=>{
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
+ editState(v:boolean){
|
|
|
+ this.drawer = v
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|