瀏覽代碼

优化订单

ymy 1 年之前
父節點
當前提交
9045a679c2

+ 1 - 1
src/components/supplierModal/supplierModal.vue

@@ -5,7 +5,7 @@
       <span>{{title?title:'选择供应商'}}</span>
     </template>
     <template #default>
-      <module-view :propConfig="config" ref="view" @pagination="getList" @search="getList" @resert="getList" @clickHandle="clickHandle" />
+      <module-view :propConfig="config" ref="view" @pagination="getList" @search="getList" @resert="getList" @onRefresh="getList" />
     </template>
     <template #footer>
       <div class="btn">

+ 45 - 7
src/views/oms/order/components/addOrder.vue

@@ -35,6 +35,11 @@
         </el-collapse-item>
         <el-collapse-item title="买家信息" name="2" class="add-order-item">
           <by-form :propConfig="buyerInfoConfig" ref="infoform">
+            <template v-slot:shopBuyerId="{value}">
+              <el-input placeholder="请选择买家'" :value="value.shopBuyerId" @clear="clearBuyer" size="small" class="myinpuy-with-select" clearable>
+                <el-button slot="append" icon="el-icon-more" @click="showBuyer"></el-button>
+              </el-input>
+            </template>
             <template v-slot:receiverProvinceCode_desc='{ value }'>
               {{ value.receiverProvince + '-' + value.receiverCity + '-' + value.receiverDistrict + (value.receiverTown?'-'+value.receiverTown:'') }}
             </template>
@@ -167,6 +172,8 @@
       <shop-modal ref="shopModal" @shopSelect="shopSelect" />
       <!-- 标签 -->
       <labels-modal ref="labelsModal" @onChange="onChangeLabel" />
+      <!-- 买家 -->
+      <buyer-info-modal ref="buyerInfoModal" @confirm="confirmBuyerInfo" />
     </template>
     <template #footer v-if="!orderValue.id">
       <div class="btn">
@@ -186,7 +193,8 @@ import AddProductModal from "./addProductModal.vue";
 import EditProductModal from "./editProductModal.vue";
 import LabelsModal from "./labelsModal.vue";
 import ShopModal from "./shopModal.vue";
-@Component({components:{AddProductModal,EditProductModal,LabelsModal,ShopModal}})
+import BuyerInfoModal from "./buyerInfoModal.vue";
+@Component({components:{AddProductModal,EditProductModal,LabelsModal,ShopModal,BuyerInfoModal}})
 export default class AddOrder extends Vue {
   value=false;
   num:any=0;
@@ -418,7 +426,7 @@ export default class AddOrder extends Vue {
       size:'small',
       itemCount:4,
       rules:{
-        buyerId:[{
+        shopBuyerId:[{
           required: true, message: '买家账号不能为空!', trigger: 'blur'
         }],
         receiverDistrictCode:[{
@@ -437,9 +445,10 @@ export default class AddOrder extends Vue {
     columns:[
       [{
         span:6,
-        label:'买家账号',
-        prop:'buyerId',
-        component:'by-input',
+        label:'买家',
+        prop:'shopBuyerId',
+        slot:true,
+        // component:'by-input',
         // compConfig:{
         //   attr:{
         //     type:'integer'
@@ -902,6 +911,9 @@ export default class AddOrder extends Vue {
   setShow(v:boolean){
     this.value = v;
   }
+  showBuyer() {
+    (this.$refs.buyerInfoModal as any).setShow(true)
+  }
   showShop(){
     (this.$refs.shopModal as any).setShow(true);
   }
@@ -917,6 +929,12 @@ export default class AddOrder extends Vue {
     value.shopName = '';
     (this.$refs.baseform as any).setValue(value);
   }
+  clearBuyer(){
+    let value:any = (this.$refs.infoform as any).getValue();
+    value.buyerId = '';
+    value.shopBuyerId = '';
+    (this.$refs.infoform as any).setValue(value);
+  }
   setDetail(data:any){
     this.orderValue = data;
     if(this.orderValue.isPay == 0 || this.orderValue.isPay == 1){
@@ -1004,7 +1022,7 @@ export default class AddOrder extends Vue {
       payFormValue.orderId = this.orderValue.id;
       payFormValue.sourceFrom = this.orderValue.sourceFrom;
       payFormValue.isOrderPay = 1;
-      payFormValue.buyerId = this.orderValue.buyerId;
+      payFormValue.shopBuyerId = this.orderValue.shopBuyerId;
       payFormValue.shopId = this.orderValue.shopId;
       payFormValue.shopName = this.orderValue.shopName;
       payFormValue.status = this.orderValue.status;
@@ -1023,6 +1041,26 @@ export default class AddOrder extends Vue {
     })
     
   }
+  // 买家信息
+  confirmBuyerInfo(data:any) {
+    let v:any = {}
+    v.shopBuyerId = data[0].name
+    v.buyerId = data[0].id
+    v.receiverName = data[0].contacts
+    v.receiverProvince = data[0].province
+    v.receiverProvinceCode = data[0].provinceCode
+    v.receiverCity = data[0].city
+    v.receiverCityCode = data[0].cityCode
+    v.receiverDistrict = data[0].region
+    v.receiverDistrictCode = data[0].regionCode
+    v.receiverTownCode = data[0].streetCode
+    v.receiverTown = data[0].street
+    v.receiverAddress = data[0].address
+    v.receiverMobile = data[0].telephone
+    if(this.$refs.infoform){
+      (this.$refs.infoform as any).setValue(v)
+    }
+  }
   //添加商品
   toolAddProduct(){
     if(this.orderValue.id){
@@ -1095,7 +1133,7 @@ export default class AddOrder extends Vue {
       (this.$refs.baseform as any).setValue(info);
       //买家
       let buyerInfo:any={};
-      buyerInfo.buyerId = data.buyerId;
+      buyerInfo.shopBuyerId = data.shopBuyerId;
       buyerInfo.receiverName = data.receiverName;
       buyerInfo.receiverProvince=data.receiverProvince;//省
       buyerInfo.receiverProvinceCode=data.receiverProvinceCode; //省编码

+ 3 - 16
src/views/oms/order/components/batchbyOneModal.vue

@@ -171,8 +171,8 @@ export default class BatchbyOneModal extends Vue {
       this.$message('请阅读并同意运单协议!')
       return
     }
-    if(!this.data[this.currentOrder].tmsShipmentAddress || !this.data[this.currentOrder].tmsShipmentConsignor || !this.data[this.currentOrder].tmsUnloadingAddress || !this.data[this.currentOrder].tmsUnloadingConsignor){
-      this.$message("请编辑订单信息");
+    if(!this.data[this.currentOrder].tmsShipmentConsignor || !this.data[this.currentOrder].tmsUnloadingAddress || !this.data[this.currentOrder].tmsUnloadingConsignor){
+      this.$message("订单信息不完善,请前往编辑!");
       return
     }
     if(!this.currentPrice[this.data[this.currentOrder].omsOrderIds]){
@@ -180,10 +180,9 @@ export default class BatchbyOneModal extends Vue {
       return
     }
     if(this.data.length > 1){
-      
       let ids='';
       for(const item of this.data){
-        if(!item.tmsShipmentAddress || !item.tmsShipmentConsignor || !item.tmsUnloadingAddress || !item.tmsUnloadingConsignor){
+        if(!item.tmsShipmentConsignor || !item.tmsUnloadingAddress || !item.tmsUnloadingConsignor){
           ids = ids ? ids + ',' + item.omsOrderIds : String(item.omsOrderIds)
         }
       }
@@ -297,19 +296,11 @@ export default class BatchbyOneModal extends Vue {
     params.omsOrderIds = [item.omsOrderIds];
     params.tmsMaterials=[];
     if(item.subItem){
-      let skuIds:Array<any>=[];
       for(const i of item.subItem){
         params.tmsMaterials.push({
           storeHouseId:item.storeHouseId,
           materialSkuId:i.omsOrderItemId
         })
-        // if(skuIds.indexOf(item.omsOrderItemId) == -1){
-        //   skuIds.push(item.omsOrderItemId);
-        //   params.tmsMaterials.push({
-        //     storeHouseId:item.storeHouseId,
-        //     materialSkuId:i.omsOrderItemId
-        //   })
-        // }
       }
     }
     delete params.subItem;
@@ -414,10 +405,6 @@ export default class BatchbyOneModal extends Vue {
     params.planType = data.tmsTransportMethod;
     this.load = true;
     queryPricePackage(params).then((res:any) => {
-      // if(this.currentPrice && this.currentPrice[data.omsOrderIds]){
-      //   delete this.currentPrice[data.omsOrderIds]
-      // }
-      
       this.load=false;
       let current=null;
       for(let item of res.data[0].data){

+ 185 - 0
src/views/oms/order/components/buyerInfoModal.vue

@@ -0,0 +1,185 @@
+<template>
+  <vxe-modal v-model="value" id="buyerInfoModal" v-loading="load" :width="width?width+'px':'60%'" @show="show" :height="height?height+'px':'80%'" min-width="500" min-height="400" show-zoom resize transfer show-footer  :zIndex="zIndex">
+    <template #title>
+      <span>{{title?title:'选择买家'}}</span>
+    </template>
+    <template #default>
+      <module-view :propConfig="config" ref="view" @pagination="getList"  @search="getList" @onRefresh="getList" @resert="getList" />
+    </template>
+    <template #footer>
+      <div class="btn">
+        <el-button plain size="small" @click="value = false">取消</el-button>
+        <el-button type="primary" size="small" @click="confirm">确定</el-button>
+      </div>
+    </template>
+  </vxe-modal>
+</template>
+
+<script lang="ts">
+import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+@Component
+export default class BuyerInfoModal extends Vue {
+  value=false
+  data:Array<any>=[]
+  time:any;
+  timeNum = 0;
+  load=false;
+
+  @Prop()
+  title?:string
+
+  @Prop()
+  width?:number
+
+  @Prop()
+  height?:number
+
+  @Prop()
+  mulit?:boolean
+	
+	@Prop()
+	zIndex?:number
+
+  config:any={
+    attr:{
+      calculateH:true
+    },
+    search:{
+      attr:{
+        size:'mini',
+        
+      },
+      columns:[
+        [{
+          labelWidth:'120px',
+          span:10,
+          label:'名称',
+          prop:'name',
+          component:'by-input',
+          compConfig:{
+            attr:{
+              clearable:true,
+              placeholder:'请输入名称'
+            }
+          }
+        },{
+          labelWidth:'120px',
+          span:10,
+          label:'负责人',
+          prop:'contacts',
+          component:'by-input',
+          compConfig:{
+            attr:{
+              clearable:true,
+              placeholder:'请输入负责人'
+            }
+          }
+        }]
+      ]
+    },
+    tool:{
+      tools:{
+        search:true,
+        refresh:true
+      }
+    },
+    table:{
+      attr:{
+        size:'mini',
+        seq:true,
+        radio: true,
+        align:'center',
+        triggerRowCheck:'row',
+        pageSize:10
+      },
+      columns:[{
+        title:'名称',
+        field:'name'
+      },{
+        title:'负责人',
+        field:'contacts'
+      },{
+        title:'手机号',
+        field:'telephone'
+      }]
+    },
+  }
+
+  setShow(v:boolean){
+    this.value = v;
+  }
+
+  created(){
+    if(this.mulit){
+      this.config.table.attr.checkbox = true
+    }else{
+      this.config.table.attr.radio = true
+    }
+  }
+
+  //确定
+  confirm(){
+    let data:Array<any>=this.getSelectdata();
+    if(data.length == 0){
+      this.$message('请选择买家!')
+      return
+    }
+    this.$emit('confirm',data);
+    this.value = false;
+  }
+  //获取已选中表格数据
+  getSelectdata(){
+    let data:Array<any>=[];
+    if(this.$refs.view){
+      data = (this.$refs.view as any).getSelectData()
+    }
+    return data;
+  }
+  //显示弹窗
+  show(){
+    if(this.data.length ==0){
+      this.getList()
+    }
+    if(this.$refs.view){
+      (this.$refs.view as any).clearCheckboxRow();
+    }
+  }
+  getList(){
+    if(!this.$refs.view){
+      if(this.timeNum > 5){
+        return
+      }
+      setTimeout(()=>{
+        this.getList()
+      },500) 
+      this.timeNum ++;
+      return
+    }
+    let query:any = (this.$refs.view as any).getQuery();
+    query.isLikeSearch = '1';
+    this.load = true;
+    (this as any).$request({
+      url: '/maindata/maindataMaterialDistributor/page',
+      method: 'get',
+      params:query
+    }).then((res:any) => {
+      this.load = false;
+      if(res.data.records){
+        (this.$refs.view as any).setTableValue(res.data.records);
+        this.data = res.data.records;
+        let page={
+          pageNo: res.data.current, //当前页
+          pageSize: res.data.size, //每页条数
+          total: res.data.total //总条数
+        };
+        (this.$refs.view as any).setPage(page)
+      }
+    }).catch(()=>{
+      this.load = false;
+    })
+  }
+}
+</script>
+<style lang="scss" scoped>
+
+</style>

+ 0 - 9
src/views/oms/order/components/carpoolModal.vue

@@ -161,21 +161,12 @@ export default class CarpoolModal extends Vue {
     }
     params.tmsMaterials=[];
     if(this.value.subItem){
-      let skuIds:Array<any>=[];
       for(const item of this.value.subItem){
         params.tmsMaterials.push({
           storeHouseId:this.value.storeHouseId,
           materialSkuId:item.omsOrderItemId,
           qty: item.tmsQuantity
         })
-        // if(skuIds.indexOf(item.omsOrderItemId) == -1){
-        //   skuIds.push(item.omsOrderItemId);
-        //   params.tmsMaterials.push({
-        //     storeHouseId:this.value.storeHouseId,
-        //     materialSkuId:item.omsOrderItemId
-        //   })
-        // }
-        
       }
     }
     delete params.subItem;

+ 2 - 1
src/views/oms/order/components/deliveryGoodsInfo.vue

@@ -153,7 +153,7 @@
       </div>
     </div>
     <vxe-modal v-model="showModal" id="deliverInfoEdit" width="900" height="80%" @show="show" @hide="hide" title="编辑" resize show-zoom transfer show-footer>
-      <by-form :propConfig="config" ref="form" @formChange="formChange" />
+      <by-form :propConfig="config" v-if="showModal" ref="form" @formChange="formChange" />
       <template #footer>
         <div class="btn">
           <el-button plain size="small" @click="showModal = false">取消</el-button>
@@ -294,6 +294,7 @@ export default class DeliveryGoodsInfo extends Vue {
               tmsShipmentRegionNo: 'regionCode',
               tmsShipmentStreetNo: 'streetCode',
               tmsShipmentStreet: 'street',
+              tmsShipmentAddress:'address',
               storeHouseId: 'id'
             }
           }

+ 2 - 2
src/views/oms/order/components/orderTool.vue

@@ -14,13 +14,13 @@
         <el-dropdown-item command="reSmt">反提交</el-dropdown-item>
       </el-dropdown-menu>
     </el-dropdown>
-    <el-button type="text">设快递</el-button>
+    <!-- <el-button type="text">设快递</el-button>
     <el-dropdown split-button type="text" class="dropdown">
       设快递单号
       <el-dropdown-menu slot="dropdown">
         <el-dropdown-item>批量设置快递单号</el-dropdown-item>
       </el-dropdown-menu>
-    </el-dropdown>
+    </el-dropdown> -->
     <div class="split"></div>
     <el-button type="text" @click="handle('changeQues')">转异常</el-button>
     <el-button type="text" @click="handle('changeNormal')">转正常</el-button>

+ 1 - 1
src/views/oms/order/components/sendModeModal.vue

@@ -16,7 +16,7 @@
           <i class="el-icon-success"></i>
           <span>推荐</span>
         </div>
-        <div class="msg">处理后形成多张物流单<br />优惠多多</div>
+        <div class="msg">处理后形成多张物流单<br />优惠多多</div>
         <div class="moda-title">整车发货</div>
       </div>
       <div class="moda-item" :class="{'onModal': mode==='2'}" @click="modeHandle('2')">

+ 27 - 23
src/views/oms/order/index.vue

@@ -3,7 +3,10 @@
     <div class="order-left">
       <el-scrollbar class="search-content">
         <el-collapse v-model="activeNames" class="my-collapse">
-          <el-collapse-item title="基本信息" name="1">
+          <el-collapse-item name="1">
+            <template slot="title">
+              基本信息<i class="header-icon el-icon-info" title="精确搜索"></i>
+            </template>
             <input-select :options="myOptions" @input="parameChange" ref="searchCom01" />
             <input-select :options="outLineOptions" @input="parameChangeBase($event,'idType','idValue')" ref="searchCom02" />
             <input-select :options="buyerOptions" @input="parameChangeInfo($event,'receiverInfo','receiverValue')" ref="searchCom03" />
@@ -507,39 +510,39 @@ export default class Order extends Vue {
   modeChange(v:string){
     let data:Array<any>= (this.$refs.orderTable as any).getSelectData();
     switch(v){
-      case '0':
+      case '0': // 逐一发货
         if(this.$refs.batchbyOneModal){
           (this.$refs.batchbyOneModal as any).setShow(true);
           (this.$refs.batchbyOneModal as any).setValue(data);
         }
         break;
-      case '1':
-        if(this.$refs.carpoolModal){
+      case '1': // 整车发货
+        let isShow = true
+        for (const item of data) {
+          if(!(data[0].buyerId === item.buyerId && data[0].receiverName === item.receiverName && data[0].receiverTownCode === item.receiverTownCode && data[0].receiverAddress === item.receiverAddress && data[0].receiverMobile === item.receiverMobile)) {
+            isShow = false;
+            break
+          }
+        }
+        if(!isShow) {
+          this.$message({
+            message: '整车发货必须是同一买家!',
+            type: 'warning'
+          })
+        }
+        if(this.$refs.carpoolModal && isShow){
           (this.$refs.carpoolModal as any).setShow(true);
           (this.$refs.carpoolModal as any).setValue(data);
         }
         break;
-      case '2':
+      case '2': // 快递发货
         if(this.$refs.expressDeliveryModal){
           (this.$refs.expressDeliveryModal as any).setShow(true);
           (this.$refs.expressDeliveryModal as any).setValue(data);
         }
     }
-
-    // if(v == '0'){
-    //   if(this.$refs.batchbyOneModal){
-    //     (this.$refs.batchbyOneModal as any).setShow(true);
-    //     (this.$refs.batchbyOneModal as any).setValue(data);
-    //   }
-    // }
-    // if(v == '1'){
-    //   if(this.$refs.carpoolModal){
-    //     (this.$refs.carpoolModal as any).setShow(true);
-    //     (this.$refs.carpoolModal as any).setValue(data);
-    //   }
-    // }
   }
-  //z整车发货
+  //整车发货
   sendGoods(item:any){
     (this.$refs.batchbyOneModal as any).setShow(true);
     (this.$refs.batchbyOneModal as any).setValue([item]);
@@ -797,10 +800,11 @@ export default class Order extends Vue {
     this.value.includeSkuType = 1;
   }
   resert(){
-   this.clearSearchValue();
-
-   this.page.pageNo = 1;
-   this.getList();
+    this.clearSearchValue();
+    this.radio = ''
+    this.radio2 = ''
+    this.page.pageNo = 1;
+    this.getList();
   }
   //搜索
   search(){