|
|
@@ -43,7 +43,8 @@
|
|
|
<button class="btn btn-sm ml-1 btn-outline-success" @click="showInterceptModel('修改')">订单修改</button>
|
|
|
@endcan
|
|
|
{{-- @can()--}}
|
|
|
- <button class="btn btn-sm ml-1 btn-success" @click="manualBack()">一键回传</button>
|
|
|
+ <button class="btn btn-sm ml-1 btn-success tooltipTarget" title="订单一键回传必须满足条件:订单状态为“分配完成,部分拣货,拣货完成,播种完成”;订单未冻结;订单有快递单号"
|
|
|
+ @click="manualBack()">一键回传</button>
|
|
|
{{-- @endcan--}}
|
|
|
</div>
|
|
|
<div class="modal fade " style="top: 20%" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
|
|
@@ -123,6 +124,7 @@
|
|
|
</div>
|
|
|
</td>
|
|
|
<td><span>@{{ order.notes }}</span></td>
|
|
|
+ <td><span>@{{ order.manualflag}}</span></td>
|
|
|
<td><span>@{{ order.erpcancelflag }}</span></td>
|
|
|
<td><span>@{{ order.picking_print_flag }}</span></td>
|
|
|
<td><span>@{{ order.edisendflag }}</span></td>
|
|
|
@@ -356,6 +358,7 @@
|
|
|
],
|
|
|
[
|
|
|
{name:'restrict_time',type:'select',tip:'查询限定时间范围',placeholder:'查询时间范围',data:[{name:'1',value:'一天内'},{name:'7',value:'一周内'},{name:"30",value:"一月内"},{name:"90",value:"本季度"}]},
|
|
|
+ {name:'manualflag',type:'select',tip:'是否人工回传',placeholder:'是否人工回传',data:[{name:'Y',value:'是'},{name:'N',value:'否'}]},
|
|
|
],
|
|
|
];
|
|
|
this.form = new query({
|
|
|
@@ -394,6 +397,7 @@
|
|
|
{value:"复核时间",col:"2"}
|
|
|
]},
|
|
|
{name:'notes',value: '备注'},
|
|
|
+ {name:'manualflag',value: '人工回传标记'},
|
|
|
{name:'erpcancelflag',value: '接口取消标记'},
|
|
|
{name:'picking_print_flag',value: '拣货单打印标记'},
|
|
|
{name:'edisendflag',value: '接口回传标记'},
|
|
|
@@ -1007,15 +1011,61 @@
|
|
|
manualBack(){
|
|
|
let _this=this;
|
|
|
let orders=[];
|
|
|
+ let fail=[];
|
|
|
+ let isGreater=false;
|
|
|
+ const start = new Date(new Date(new Date().toLocaleDateString()).getTime()+16*60*60*1000+30*60*1000);
|
|
|
if(checkData.length===0){tempTip.show('没有勾选记录');return;}
|
|
|
_this.orders.forEach(function(order){
|
|
|
+ if (new Date(new Date(order.addtime).getTime())>start) isGreater=true;
|
|
|
checkData.forEach(function (checkedId) {
|
|
|
if(order.orderno===checkedId){
|
|
|
- orders.push(order);
|
|
|
+ if (order.soreference5 //存在快递单号
|
|
|
+ && order.releasestatus!='H' //订单未冻结
|
|
|
+ && (order.sostatus=='40' ||
|
|
|
+ order.sostatus=='50' ||
|
|
|
+ order.sostatus=='60' ||
|
|
|
+ order.sostatus=='61')) //订单状态为 分配完成,部分拣货,拣货完成,或播种完成
|
|
|
+ {orders.push(order.orderno);}else {fail.push(order.orderno)}
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
+ let failText='';
|
|
|
+ fail.forEach(function (item){
|
|
|
+ failText += item + ','
|
|
|
+ });
|
|
|
+ if (isGreater){
|
|
|
+ if (!confirm('订单中包含16:30以后推送的订单,有超时揽收风险,是否确定操作?')) return;
|
|
|
+ }else {
|
|
|
+ if (!confirm('提前回传订单将无法取消,是否确定操作?')) return;
|
|
|
+ }
|
|
|
+ let url = '{{url('order/manualBack')}}';
|
|
|
+ window.axios.post(url, {ordernos:orders})
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.success) {
|
|
|
+ _this.orders.forEach(function (order){
|
|
|
+ res.data.successNo.forEach(function (success_item){
|
|
|
+ if (order.orderno==success_item)order.manualflag='Y';
|
|
|
+ })
|
|
|
+ })
|
|
|
+ res.data.failNo.forEach(function (item){
|
|
|
+ failText += item + ','
|
|
|
+ });
|
|
|
+ if (failText.length > 0) {
|
|
|
+ failText = failText.substr(0,failText.length - 1);
|
|
|
+ }
|
|
|
+ window.tempTip.setDuration(3000);
|
|
|
+ window.tempTip.showSuccess('回传成功!'+' 单号:'+failText+'不满足回传条件,系统已自动筛除');
|
|
|
+ this.$forceUpdate();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ window.tempTip.setDuration(3000);
|
|
|
+ window.tempTip.show('人工回传失败');
|
|
|
+ }).catch(err => {
|
|
|
+ window.tempTip.setDuration(3000);
|
|
|
+ window.tempTip.show("网络错误:" + err);
|
|
|
+ })
|
|
|
console.log(checkData,orders)
|
|
|
+ console.log(start)
|
|
|
},
|
|
|
},
|
|
|
});
|