|
@@ -101,7 +101,7 @@
|
|
<order-tool @addOrder="addOrder" @smt="smtOrder" @reSmt="reSmt" @loadOrder="loadOrder" @producePurchase="producePurchase" @cancelOrder="cancelOrder"
|
|
<order-tool @addOrder="addOrder" @smt="smtOrder" @reSmt="reSmt" @loadOrder="loadOrder" @producePurchase="producePurchase" @cancelOrder="cancelOrder"
|
|
@reCancelOrder="reCancelOrder" @updateRmk="updateRmk" @changeQues="changeQues" @changeNormal="changeNormal" @updateSalesman="updateSalesman"
|
|
@reCancelOrder="reCancelOrder" @updateRmk="updateRmk" @changeQues="changeQues" @changeNormal="changeNormal" @updateSalesman="updateSalesman"
|
|
@updateTag="updateTag" @addGift="addGift" @addProduct="addProduct" @updateFreight="updateFreight" @orderFile="orderFile" @batchSendGoods="batchSendGoods"
|
|
@updateTag="updateTag" @addGift="addGift" @addProduct="addProduct" @updateFreight="updateFreight" @orderFile="orderFile" @batchSendGoods="batchSendGoods"
|
|
- @importOrder="importOrder" />
|
|
|
|
|
|
+ @importOrder="importOrder" @autoMerge="autoMerge" @autoSplit="autoSplit" />
|
|
</div>
|
|
</div>
|
|
<div class="table">
|
|
<div class="table">
|
|
<order-table :data="data" ref="orderTable" class="order-table" @detail="detail" @mergeHandle="mergeHandle" @splitHandle="splitHandle" @sendGoods="sendGoods"
|
|
<order-table :data="data" ref="orderTable" class="order-table" @detail="detail" @mergeHandle="mergeHandle" @splitHandle="splitHandle" @sendGoods="sendGoods"
|
|
@@ -151,9 +151,11 @@
|
|
<!-- 物流信息 -->
|
|
<!-- 物流信息 -->
|
|
<logisticsInfo ref="logisticsInfo" />
|
|
<logisticsInfo ref="logisticsInfo" />
|
|
<!-- 快递发货 -->
|
|
<!-- 快递发货 -->
|
|
- <!-- <express-delivery-modal ref="expressDeliveryModal" @handleSuccess="handleSuccess" /> -->
|
|
|
|
|
|
+ <express-delivery-modal ref="expressDeliveryModal" @handleSuccess="handleSuccess" />
|
|
<!-- 上传excel -->
|
|
<!-- 上传excel -->
|
|
<ImportExcelModel ref="ImportExcelModel" @handleSuccess="handleSuccess" />
|
|
<ImportExcelModel ref="ImportExcelModel" @handleSuccess="handleSuccess" />
|
|
|
|
+ <!-- 自动拆分 -->
|
|
|
|
+ <autoSplit ref="autoSplit" @handleSuccess="handleSuccess" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -187,13 +189,15 @@ import batchbyOneModal from './components/batchbyOneModal.vue'
|
|
import carpoolModal from './components/carpoolModal.vue'
|
|
import carpoolModal from './components/carpoolModal.vue'
|
|
import DeliveryDetail from "./components/deliveryDetail.vue";
|
|
import DeliveryDetail from "./components/deliveryDetail.vue";
|
|
import LogisticsInfo from "./components/logisticsInfo.vue";
|
|
import LogisticsInfo from "./components/logisticsInfo.vue";
|
|
-// import ExpressDeliveryModal from "./components/expressDeliveryModal.vue";
|
|
|
|
|
|
+import ExpressDeliveryModal from "./components/expressDeliveryModal.vue";
|
|
import ImportExcelModel from "./components/importExcelModal.vue";
|
|
import ImportExcelModel from "./components/importExcelModal.vue";
|
|
-import { query,getProvince,smt,unSmt,purchaseQty,unCancel,resetQuestion,archive } from '@/api/omsOrder'
|
|
|
|
|
|
+import autoSplit from './components/autoSplit.vue'
|
|
|
|
+import { query,getProvince,smt,unSmt,purchaseQty,unCancel,resetQuestion,archive,merge } from '@/api/omsOrder'
|
|
import { queryAll } from '@/api/question'
|
|
import { queryAll } from '@/api/question'
|
|
@Component({components:{filterInput,OrderCheckbox,OrderRadio,filterDate,OrderTool,OrderTable,AddOrder,InputSelect,OrderProduct,
|
|
@Component({components:{filterInput,OrderCheckbox,OrderRadio,filterDate,OrderTool,OrderTable,AddOrder,InputSelect,OrderProduct,
|
|
filterMinMax,loadOrderModal,PurchaseModel,MergeModel,SplitModel,CancelOrderModel,QuestModel,SetQuesModal,UpdateRmkModal,UpdateSalerModal,
|
|
filterMinMax,loadOrderModal,PurchaseModel,MergeModel,SplitModel,CancelOrderModel,QuestModel,SetQuesModal,UpdateRmkModal,UpdateSalerModal,
|
|
- TabModal,AddProductModal,FreightModal,LabelsModal,SendModeModal,batchbyOneModal,carpoolModal,DeliveryDetail,LogisticsInfo,ImportExcelModel}})
|
|
|
|
|
|
+ TabModal,AddProductModal,FreightModal,LabelsModal,SendModeModal,batchbyOneModal,carpoolModal,DeliveryDetail,LogisticsInfo,ImportExcelModel,
|
|
|
|
+ autoSplit,ExpressDeliveryModal}})
|
|
export default class Order extends Vue {
|
|
export default class Order extends Vue {
|
|
activeNames:Array<any>=['1','statusList']
|
|
activeNames:Array<any>=['1','statusList']
|
|
radio=''
|
|
radio=''
|
|
@@ -472,6 +476,87 @@ export default class Order extends Vue {
|
|
this.getProvince();
|
|
this.getProvince();
|
|
this.getQuestionList();
|
|
this.getQuestionList();
|
|
}
|
|
}
|
|
|
|
+ //自动拆分
|
|
|
|
+ autoSplit(){
|
|
|
|
+ let newData:Array<any> = [];
|
|
|
|
+ let s=['WaitConfirm','Question','Split']
|
|
|
|
+ for(const item of this.data){
|
|
|
|
+ if(item.isSubmitted == 1 && item.pays && item.pays.length > 0 && (!item.operationFlag || item.operationFlag.indexOf('MERGE') == -1 && item.operationFlag.indexOf('SPLIT') == -1 && item.operationFlag.indexOf('JUSHUITAN') == -1) && s.indexOf(item.status) >= 0){
|
|
|
|
+ newData.push(item)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(newData.length == 0) {
|
|
|
|
+ this.$message('未有符合条件的订单!');
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ (this.$refs.autoSplit as any).setShow(true);
|
|
|
|
+ (this.$refs.autoSplit as any).setData(newData)
|
|
|
|
+ }
|
|
|
|
+ // 自动合并
|
|
|
|
+ autoMerge() {
|
|
|
|
+ let data:Array<any>= (this.$refs.orderTable as any).getSelectData();
|
|
|
|
+ if(data.length == 0) {
|
|
|
|
+ this.$message('请选择一个主订单!');
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(data.length > 1) {
|
|
|
|
+ this.$message('合并操作只能选择一个主订单!');
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ let r = false;
|
|
|
|
+ if(data[0].isSubmitted == 1 && data[0].pays && data[0].pays.length > 0 && (!data[0].operationFlag || data[0].operationFlag.indexOf('MERGE') == -1 && data[0].operationFlag.indexOf('SPLIT') == -1 && data[0].operationFlag.indexOf('JUSHUITAN') == -1) && (data[0].status == 'WaitConfirm' || data[0].status == 'Question')){
|
|
|
|
+ r = true;
|
|
|
|
+ }
|
|
|
|
+ if(!r) {
|
|
|
|
+ this.$message('选择的主订单不符合合并条件!');
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ let row = data[0]
|
|
|
|
+ let newData:Array<any> = [];
|
|
|
|
+ row.isMain = 1;
|
|
|
|
+ newData.push(row);
|
|
|
|
+ for(const item of this.data){
|
|
|
|
+ if(row.id != item.id && item.isSubmitted == 1 && row.shopId == item.shopId && row.shopName == item.shopName && row.buyerId == item.buyerId &&
|
|
|
|
+ row.receiverMobile == item.receiverMobile && row.receiverProvince == item.receiverProvince && row.receiverCity == item.receiverCity
|
|
|
|
+ && row.receiverDistrict == item.receiverDistrict && row.receiverTown == item.receiverTown && row.receiverAddress == item.receiverAddress
|
|
|
|
+ && item.pays && item.pays.length > 0 && item.operationFlag.indexOf('SPLIT') == -1 && item.operationFlag.indexOf('MERGE') == -1 && (item.status == 'WaitConfirm'
|
|
|
|
+ || item.status == 'Question')){
|
|
|
|
+ newData.push(item);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(newData.length == 1){
|
|
|
|
+ this.$message('未找到符合条件的合并订单!')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.$confirm('你确定将买家/分销商为“'+ row.buyerNickname +'”的订单进行合并?', '提示', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ }).then(() => {
|
|
|
|
+ let params:any={};
|
|
|
|
+ params.idList=[];
|
|
|
|
+ for(const item of newData){
|
|
|
|
+ if(item.isMain == 1){
|
|
|
|
+ params.id = item.id;
|
|
|
|
+ }else{
|
|
|
|
+ params.idList.push(item.id);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.load = true;
|
|
|
|
+ merge(params).then((res:any)=>{
|
|
|
|
+ this.load = false;
|
|
|
|
+ this.$message({
|
|
|
|
+ message:'自动合并成功!',
|
|
|
|
+ type:'success'
|
|
|
|
+ })
|
|
|
|
+ this.load = false;
|
|
|
|
+ this.getList();
|
|
|
|
+ }).catch((err:any) => {
|
|
|
|
+ this.load = false;
|
|
|
|
+ })
|
|
|
|
+ }).catch(() => { });
|
|
|
|
+ }
|
|
//上传excel
|
|
//上传excel
|
|
importOrder(){
|
|
importOrder(){
|
|
if(this.$refs.ImportExcelModel) {
|
|
if(this.$refs.ImportExcelModel) {
|
|
@@ -549,11 +634,11 @@ export default class Order extends Vue {
|
|
(this.$refs.carpoolModal as any).setValue(data);
|
|
(this.$refs.carpoolModal as any).setValue(data);
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
- // case '2': // 快递发货
|
|
|
|
- // if(this.$refs.expressDeliveryModal){
|
|
|
|
- // (this.$refs.expressDeliveryModal as any).setShow(true);
|
|
|
|
- // (this.$refs.expressDeliveryModal as any).setValue(data);
|
|
|
|
- // }
|
|
|
|
|
|
+ case '2': // 快递发货
|
|
|
|
+ if(this.$refs.expressDeliveryModal){
|
|
|
|
+ (this.$refs.expressDeliveryModal as any).setShow(true);
|
|
|
|
+ (this.$refs.expressDeliveryModal as any).setValue(data);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//整车发货
|
|
//整车发货
|