Эх сурвалжийг харах

新增功能:订单拉取记录

ymy 1 жил өмнө
parent
commit
25abf5839b

+ 9 - 0
src/api/omsOrder.ts

@@ -243,3 +243,12 @@ export function queryBySys(params:any){
 		method: 'GET'
 	})
 }
+
+//根据第三方系统查询记录
+export function pullRecord(params:any){
+	return request({
+		url: '/omsOrder/jstOrderJobLog/page',
+		params:params,
+		method: 'GET'
+	})
+}

+ 9 - 0
src/api/sourceShop.ts

@@ -9,6 +9,15 @@ export function query(params:any) {
 	})
 }
 
+//查询上游平台店铺
+export function queryShop(params:any) {
+	return request({
+		url: '/omsOrder/omsShop/queryBySourceId',
+		method: 'get',
+		params:params
+	})
+}
+
 //新增数据
 export function save(data:any) {
 	return request({

+ 6 - 6
src/views/audit/synchronous/components/synchronousOrderModal.vue

@@ -12,7 +12,7 @@
         </el-radio-group>
       </div>
       <div class="cont">
-        <div class="t-title"><span>* </span>店铺名称:</div>
+        <div class="t-title"><span>* </span>上游平台:</div>
         <div class="right-cont">
           <el-select v-model="shopId" size="mini" style="width:100%" placeholder="请选择" clearable @change="shopChange">
             <el-option
@@ -86,7 +86,7 @@
 <script lang="ts">
 import { Component, Prop, Vue, Watch } from "vue-property-decorator";
 import { pullItem } from '@/api/maindataMaterialRelevancy'
-import { query } from '@/api/shop'
+import { query } from '@/api/sourceShop'
 
 @Component
 export default class SynchronousOrderModal extends Vue {
@@ -145,8 +145,8 @@ export default class SynchronousOrderModal extends Vue {
     if(!this.shopId){
       msg = '店铺名称'
     }else{
-      value.shopId = this.shopId;
-      value.showName = this.shopName;
+      value.sourceId = this.shopId;
+      value.sourceName = this.shopName;
     }
     
     value.type = this.type;
@@ -231,8 +231,8 @@ export default class SynchronousOrderModal extends Vue {
       if (res.data && res.data.records) {
         for(const item of res.data.records) {
           this.shopOptions.push({
-            label: item.shopName,
-            value: item.shopId
+            label: item.sourceName,
+            value: item.id
           })
         }
       }

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

@@ -53,7 +53,7 @@
         </div>
         <el-collapse-item title="订单支付情况" name="4" class="add-order-item" v-if="orderValue.id">
           <div class="pay-row" v-if="orderValue.status != 'Split' && orderValue.status != 'Merged' && orderValue.status != 'Cancelled'">
-            <el-button type="text" v-if="!orderValue.pays || orderValue.pays.length == 0">快速支付</el-button>
+            <!-- <el-button type="text" v-if="!orderValue.pays || orderValue.pays.length == 0">快速支付</el-button> -->
             <div class="add-pay-btn" v-if="orderValue.status !== 'Delivering'  && orderValue.status !== 'Sent'">
               <el-button type="text" v-if="!showPay" @click="showPay = true">添加手工支付</el-button>
               <el-button v-else icon="el-icon-close" size="mini" circle @click="showPay = false"></el-button>

+ 67 - 21
src/views/oms/order/components/loadOrderModal.vue

@@ -12,11 +12,11 @@
         </el-radio-group>
       </div>
       <div class="cont">
-        <div class="title"><span>* </span>店铺名称:</div>
+        <div class="title"><span>* </span>上游平台:</div>
         <div class="right-cont">
-          <el-select v-model="shopId" size="mini" style="width:100%" placeholder="请选择" clearable @change="shopChange">
+          <el-select v-model="sourceId" size="mini" style="width:100%" placeholder="请选择" clearable @change="shopChange">
             <el-option
-              v-for="item in shopOptions"
+              v-for="item in sourceOptions"
               :key="item.value"
               :label="item.label"
               :value="item.value">
@@ -33,7 +33,19 @@
         </div>
       </template>
       <template v-if="type == 2">
-        
+        <div class="cont">
+          <div class="title"><span>* </span>店铺名称:</div>
+          <div class="right-cont">
+            <el-select v-model="shopid" size="mini" style="width:100%" placeholder="请选择" clearable @change="shopChange">
+              <el-option
+                v-for="item in shopOpions"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value">
+              </el-option>
+            </el-select>
+          </div>
+        </div>
         <div class="cont">
           <div class="title"><span>* </span>时间类型:</div>
           <div class="right-cont">
@@ -107,20 +119,22 @@
 <script lang="ts">
 import { Component, Prop, Vue, Watch } from "vue-property-decorator";
 import { pullOrder } from '@/api/omsOrder'
-import { query } from '@/api/sourceShop'
+import { query,queryShop } from '@/api/sourceShop'
 @Component
 export default class LoadOrderModal extends Vue {
   load = false;
   value = false;
   type=1;
-  shopName = '';
-  shopId:any = null;
-  shopOptions:Array<any>=[
+  sourceName = '';
+  sourceId:any = null;
+  sourceOptions:Array<any>=[
     // {
     // label:'犇云聚水潭店铺',
     // value:2
     // }
   ]
+  shopid=''
+  shopOpions:Array<any>=[]
   sourceIds=''; //线上订单号
   dateType:any='';
   dateTypeOptions=[{
@@ -182,24 +196,27 @@ export default class LoadOrderModal extends Vue {
   }
   shopChange(v:any){
     if(v){
-      for(const item of this.shopOptions){
+      for(const item of this.sourceOptions){
         if(item.value == v){
-          this.shopName = item.label
+          this.sourceName = item.label
           break;
         }
       }
+      this.getSourceShopList()
     }else{
-      this.shopName=''
+      this.sourceName=''
+      this.shopid=''
+      this.shopOpions=[]
     }
   }
   btn(){
     let value:any={};
     let msg = '';
-    if(!this.shopId){
-      msg = '店铺名称'
+    if(!this.sourceId){
+      msg = '上游平台'
     }
-    value.sourceId = this.shopId;
-    value.soueceName = this.shopName;
+    value.sourceId = this.sourceId;
+    value.soueceName = this.sourceName;
     value.type = this.type;
     if(this.type == 1){
       if(!this.sourceIds){
@@ -212,6 +229,14 @@ export default class LoadOrderModal extends Vue {
       value.sourceIds = this.sourceIds.split('\n');
     }else if(this.type == 2){
       let isS=false;
+      if(!this.shopid){
+        if(msg){
+          msg = msg + ',店铺名称'
+        }else{
+          msg = '店铺名称'
+        }
+      }
+      value.shopId = this.shopid
       for(const item of this.dateTypeOptions){
         if(item.value == this.dateType){
           isS = true;
@@ -276,17 +301,19 @@ export default class LoadOrderModal extends Vue {
   }
   clear(){
     this.type = 1;
-    this.shopName = '';
-    this.shopId = '';
+    this.sourceName = '';
+    this.sourceId = '';
     this.sourceIds = '';
     this.dateType = '';
     this.beginDate = '';
     this.endDate = '';
     this.time = null;
     this.status = '';
+    this.shopid = ''
   }
-  getShopList() {
-    this.shopOptions = []
+  //上游平台
+  getSourceList() {
+    this.sourceOptions = []
     this.load = true
     query({
       pageNo: 1,
@@ -295,7 +322,7 @@ export default class LoadOrderModal extends Vue {
       this.load = false
       if (res.data && res.data.records) {
         for(const item of res.data.records) {
-          this.shopOptions.push({
+          this.sourceOptions.push({
             label: item.sourceName,
             value: item.id
           })
@@ -305,8 +332,27 @@ export default class LoadOrderModal extends Vue {
       this.load = false
     })
   }
+  //店铺
+  getSourceShopList(){
+    this.shopOpions = []
+    queryShop({
+      sourceId:this.sourceId
+    }).then((res:any) => {
+      this.load = false
+      if (res.data) {
+        for(const item of res.data) {
+          this.shopOpions.push({
+            label: item.shopName,
+            value: item.shopId
+          })
+        }
+      }
+    }).catch(()=>{
+      this.load = false
+    })
+  }
   created() {
-    this.getShopList()
+    this.getSourceList()
   }
 }
 </script>

+ 122 - 0
src/views/oms/pullRecord/index.vue

@@ -0,0 +1,122 @@
+<template>
+  <div class="pull-record">
+    <module-view :propConfig="config" ref="view" v-loading="load" @pagination="pagination" @onRefresh="getList" @resert="queryList" @search="queryList" />
+  </div>
+</template>
+
+<script lang="ts">
+import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+import {pullRecord} from '@/api/omsOrder'
+@Component({components:{}})
+export default class OrderPay extends Vue {
+  config:any={
+    attr:{
+      calculateH:true
+    },
+    search:{
+      attr:{
+        size:'small'
+      },
+      columns:[
+        [{
+          label:'订单来源',
+          span: 8,
+          prop:'sourceName',
+          component:'by-input'
+        }]
+      ]
+    },
+    tool:{
+      tools:{
+        search:true,
+        refresh:true
+      }
+    },
+    table:{
+      attr:{
+        size:'mini',
+        seq:true,
+        // align:'center',
+      },
+      columns:[{
+        title:'订单来源',
+        field:'sourceName'
+      },{
+        title:'成功拉取数量',
+        field:'successQty',
+        width:130
+      },{
+        title:'新增的OMS数量',
+        field:'syncQty',
+        width:130
+      },{
+        title:'更新的OMS数量',
+        field:'updateQty',
+        width:130
+      }]
+    }
+  }
+  load=false
+  isSearch=false
+  timeNum = 0;
+  mounted(){
+    this.$nextTick(()=>{
+      this.getList()
+    })
+  }
+  //分页
+  pagination(){
+    if(this.isSearch){
+      this.queryList();
+    }else{
+      this.getList()
+    }
+  }
+  //列表请求(只有分页,不包含搜素条件)
+  getList(){
+    if(!this.$refs.view){
+      if(this.timeNum > 5){
+        return
+      }
+      setTimeout(()=>{
+        this.getList()
+      },500) 
+      this.timeNum ++;
+      return
+    }
+    this.isSearch = false;
+    let data = (this.$refs.view as any).getPage();
+    this.requestList(data);
+  }
+  //列表请求(包含分页和搜素条件)
+  queryList(){
+    this.isSearch = true;
+    let data = (this.$refs.view as any).getQuery();
+    this.requestList(data);
+  }
+  requestList(data:any){
+    this.load = true;
+    pullRecord(data).then((res:any) => {
+      this.load = false;
+      (this.$refs.view as any).setTableValue(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>
+.pull-record{
+  height: 100%;
+  width: 100%;
+  overflow-y: hidden;
+}
+</style>

+ 4 - 4
src/views/oms/sourceShop/index.vue

@@ -123,10 +123,10 @@ export default class SourceShop extends Vue {
         width:150,
         component:shopTag
       },
-      {
-        title:'租户id',
-        field:'tenantId',
-      },
+      // {
+      //   title:'租户id',
+      //   field:'tenantId',
+      // },
       {
         title:'状态',
         field:'status',