123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- export function getDetail(id, that) {
- that.$api.doRequest('get', 'freightReceivingDispatching/getFreightReceivingDispatching', {
- "id": id
- }).then(res => {
- if (res.data.code == 200) {
- that.purchaseOrder = res.data.data
- makeData(res.data.data,that)
- return res.data.data
- }else{
-
- }
-
- }).catch(res => {
- // uni.showToast({
- // title: res.data.message,
- // icon: 'none',
- // duration: 2000
- // })
- })
- }
- export function makeData(val,that) {
- //累加净重收发
- let _goodsPrice = val.goodsPrice;
- let _freightUnitPrice = val.freightUnitPrice
- let _data = val.freightReceivingDispatchingCars
- for (let i = 0; i < _data.length; i++) {
- if (_data[i].reciveNetWeight == null) {
- _data[i].reciveNetWeight = 0
- }
- if (_data[i].dispatchNetWeight == null) {
- _data[i].dispatchNetWeight = 0
- }
- //应付货款
- // if(_data[i].reciveNetWeight!=0&&_data[i].dispatchNetWeight!=0){
- // if(_data[i].reciveNetWeight-_data[i].dispatchNetWeight>0){
- // _data[i].goodsIngPayable = _data[i].reciveNetWeight*_goodsPrice
- // }else{
- // _data[i].goodsIngPayable = _data[i].dispatchNetWeight*_goodsPrice
- // }
- // }else{
- // _data[i].goodsIngPayable = _data[i].reciveNetWeight*_goodsPrice
- // }
- // 运费
- // _data[i].freightIngPayable =
- if (_data[i].reciveNetWeight != 0 && _data[i].dispatchNetWeight != 0) {
- if (_data[i].reciveNetWeight - _data[i].dispatchNetWeight > 0) {
- _data[i].freightIngPayable = _data[i].reciveNetWeight * _freightUnitPrice - _data[i]
- .freightDeductionAmount
- } else {
- _data[i].freightIngPayable = _data[i].dispatchNetWeight * _freightUnitPrice - _data[i]
- .freightDeductionAmount
- }
- } else {
- _data[i].freightIngPayable = _data[i].reciveNetWeight * _freightUnitPrice - _data[i]
- .freightDeductionAmount
- }
- that.radTotal.receipt += parseInt(_data[i].reciveNetWeight)
- that.radTotal.delivery += parseInt(_data[i].dispatchNetWeight)
- }
- }
|