|
@@ -681,11 +681,16 @@ export default {
|
|
makeSure(){
|
|
makeSure(){
|
|
//获取当前派车的数量和预估吨位的总和
|
|
//获取当前派车的数量和预估吨位的总和
|
|
var sendCount = this.selectionList.length*this.uniteOrderPlanWeight;
|
|
var sendCount = this.selectionList.length*this.uniteOrderPlanWeight;
|
|
- //判断是否达到95%
|
|
|
|
- var canDo = ((this.totalWeight+sendCount)/this.number).toFixed(2);
|
|
|
|
- if(canDo>0.95){
|
|
|
|
- var canSend = Math.floor(((this.number*0.95)-this.totalWeight)/this.uniteOrderPlanWeight);
|
|
|
|
|
|
+ //判断是否达到总重量减80吨的重量
|
|
|
|
+ var canDo = ((this.number-80)-(this.totalWeight+sendCount));
|
|
|
|
+ if(canDo<0&&this.number>=100){
|
|
|
|
+ var canSend = Math.floor(((this.number-80)-this.totalWeight)/this.uniteOrderPlanWeight);
|
|
|
|
+ if(canSend<0){
|
|
|
|
+ canSend = 0;
|
|
|
|
+ }
|
|
this.$message.error('当前已派发吨数接近订单总吨数,最多还可派 ('+canSend+') 辆车!')
|
|
this.$message.error('当前已派发吨数接近订单总吨数,最多还可派 ('+canSend+') 辆车!')
|
|
|
|
+ }else if(this.number<100&&this.totalWeight>20){
|
|
|
|
+ this.$message.error('当前可派发车数已用完!')
|
|
}else{
|
|
}else{
|
|
let state = false;
|
|
let state = false;
|
|
var beReady = 0;
|
|
var beReady = 0;
|
|
@@ -740,6 +745,7 @@ export default {
|
|
},
|
|
},
|
|
//发送请求
|
|
//发送请求
|
|
sendRequest(beReady){
|
|
sendRequest(beReady){
|
|
|
|
+ console.log("send");
|
|
if(beReady==this.selectionList.length){
|
|
if(beReady==this.selectionList.length){
|
|
this.axios.post('/api/v1/ams/dispatchTruckOrderBySale',{
|
|
this.axios.post('/api/v1/ams/dispatchTruckOrderBySale',{
|
|
saleOrderId:this.$route.params.saleOrderId,
|
|
saleOrderId:this.$route.params.saleOrderId,
|
|
@@ -750,7 +756,7 @@ export default {
|
|
this.cancel();
|
|
this.cancel();
|
|
}else{
|
|
}else{
|
|
//若该销售订单的净重已达到97%!
|
|
//若该销售订单的净重已达到97%!
|
|
- this.$confirm("该销售订单的净重已达到97%! 是否仍然派车", "提示", {
|
|
|
|
|
|
+ this.$confirm("当前已派发吨数接近订单总吨数! 是否仍然派车", "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
cancelButtonText: "取消",
|
|
cancelButtonText: "取消",
|
|
type: "warning",
|
|
type: "warning",
|
|
@@ -931,7 +937,7 @@ export default {
|
|
if(res.data.data==null){
|
|
if(res.data.data==null){
|
|
this.receiveCarrierId = null;
|
|
this.receiveCarrierId = null;
|
|
this.receiveCarrierName = null;
|
|
this.receiveCarrierName = null;
|
|
- this.$message.warning('该收货单位尚未注册为承运商!')
|
|
|
|
|
|
+ this.$message.warning('该账号未注册为承运商!')
|
|
}else{
|
|
}else{
|
|
this.receiveCarrierId = res.data.data.carrierId;
|
|
this.receiveCarrierId = res.data.data.carrierId;
|
|
this.receiveCarrierName = res.data.data.carrierName;
|
|
this.receiveCarrierName = res.data.data.carrierName;
|