浏览代码

Merge branch 'master' of http://47.107.53.207:3000/ymy/oms

hcf 1 年之前
父节点
当前提交
149508a35f

+ 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({

+ 12 - 1
src/benyun/components/byInput/byInput.vue

@@ -4,6 +4,7 @@
   :suffix-icon="attrs.suffixIcon" :readonly="attrs.readonly" :autosize="attrs.autosize"></el-input>
   <vxe-input 
     v-else
+    ref="input"
     v-model="value"
     :placeholder="placeholder"
     :maxlength="attrs.maxlength"
@@ -25,8 +26,9 @@
 /*
 config:{
   attr:{
-    type:'text, number(数字), integer(整数),textarea,float(小数),password(密码)',
+    type:'text, number(数字), integer(整数),textarea,float(小数),password(密码),positiveNumber(正数),positiveInteger(正整数)',
     align:'left, center, right'
+    isPositiveNumber:false/true 是否为正数
     prefixIcon:''  //头部图标
     suffixIcon:''  //尾部图标
   }
@@ -88,7 +90,16 @@ export default class ByInput extends VueViews {
   }
 
   onChange(){
+    if(this.value) {
+      if(this.attrs.isPositiveNumber) {
+        if(Number(this.value) && Number(this.value) < 0){
+          this.$message('请输入正数!')
+          this.value = 0
+        }
+      }
+    }
     this.$emit('onChange',this.value);
+    
   }
 }
 </script>

+ 1 - 0
src/components/byLog/byLog.vue

@@ -74,6 +74,7 @@ export default class ByLog extends VueViews {
       pageNo:this.page.pageNo,
       pageSize:this.page.pageSize
     }
+    this.$emit('logBefore', parame)
     parame.success = (res:any) => {
       this.load = false;
       if(res.data && res.data.records){

+ 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
           })
         }
       }

+ 84 - 23
src/views/components/line01.vue

@@ -1,5 +1,11 @@
 <template>
-  <div class="chart" :id="id"></div>
+  <div class="chart-box">
+    <div class="title-top">
+      <span>每月店铺订单量日趋势</span>
+    </div>
+    <div class="chart" :id="id"></div>
+  </div>
+  
 </template>
 
 <script lang="ts">
@@ -12,7 +18,7 @@ export default class Line01 extends Vue {
   id=this.randomString();
 
   mounted(){
-    this.init()
+    this.getData()
   }
 
   randomString(){
@@ -22,20 +28,43 @@ export default class Line01 extends Vue {
       result += str[Math.floor(Math.random() * str.length)];
     return result;
   }
-  init(){
+  initChart(list:Array<any>){
+    if(!list) return
     let chartDom:any = document.getElementById(this.id);
     let myChart = echarts.init(chartDom);
     let option: EChartsOption;
-
+    let dataX:Array<any>=this.getDaysList()
+    let dataY:Array<any>=[]
+    for(const item of list) {
+      let obj:any={
+        name: item[0].shop_name,
+        type: 'line',
+        data: []
+      }
+      if(item){
+        for(const arr of dataX) {
+          let isAdd = false
+          for(const item2 of item){
+            if(arr == item2.day) {
+              obj.data.push(item2.total)
+              isAdd = true
+              break
+            }
+          }
+          if(!isAdd) {
+            obj.data.push(0)
+          }
+        }
+      }
+      dataY.push(obj)
+    }
     option = {
-      title: {
-        text: '每月成交量和退货量',
-      },
       tooltip: {
         trigger: 'axis'
       },
-      legend: {
-        data: ['成交量', '退货量',]
+      legend:{
+        show:true,
+        top:0
       },
       grid: {
         left: '3%',
@@ -51,33 +80,65 @@ export default class Line01 extends Vue {
       xAxis: {
         type: 'category',
         boundaryGap: false,
-        data: ['2022/08', '2022/09', '2022/10', '2022/11', '2022/12', '2023/01','2023/02','2023/03','2023/04','2023/05','2023/06','2023/07']
+        data: dataX
       },
       yAxis: {
         type: 'value'
       },
-      series: [
-        {
-          name: '成交量',
-          type: 'line',
-          data: [0, 0, 0, 0, 0, 0, 0, 0,70,380,500, 580]
-        },
-        {
-          name: '退货量',
-          type: 'line',
-          data: [0, 0, 0, 0, 0, 0, 0, 0,10,40,50, 62]
-        }
-      ]
+      series: dataY
     };
 
     option && myChart.setOption(option);
   }
+  getDaysList() {
+    let daysHandle = (n:number) => {
+      let dy = new Date()
+      dy.setTime(dy.getTime() - 3600 * 1000 * 24 * n)
+      let y = dy.getFullYear();
+      let m:any = dy.getMonth() + 1;
+      let d:any = dy.getDate();
+      m = m < 10 ? '0' + m : m;
+      d = d < 10 ? '0' + d : d;
+      return y + '-' + m + '-' + d;
+    }
+    let data:Array<any> = []
+    for(let i = 29; i >= 0; i--) {
+      data.push(daysHandle(i))
+    }
+    return data;
+  }
+  getData() {
+    (this as any).$request({
+      url:'/omsOrder/report/shopDaylyCount',
+      method: 'GET',
+    }).then((res:any) => {
+      if(res.data) {
+        this.initChart(res.data)
+      }
+    }).catch(() =>{})
+  }
 }
 </script>
 
 <style lang="scss" scoped>
-.chart{
+.chart-box{
   height: 100%;
   width: 100%;
+  .title-top{
+    height: 40px;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    position: relative;
+    width: 100%;
+    >span{
+      font-size: 16px;
+      font-weight: 700;
+    }
+  }
+}
+.chart{
+  height: calc(100% - 40px);
+  width: 100%;
 }
 </style>

+ 1 - 1
src/views/components/pie01.vue

@@ -5,7 +5,7 @@
       <el-select v-model="areatValue" size="mini" class="select" placeholder="请选择" @change="areaChange">
         <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
       </el-select>
-        </div>
+    </div>
     <div class="chart" :id="id"></div>
   </div>
 </template>

+ 29 - 5
src/views/oms/order/components/addOrder.vue

@@ -1,6 +1,6 @@
 <template>
   <vxe-modal v-model="value" id="addOrder" @show="show" width="70%" height="80%" min-width="460" min-height="320" 
-    show-zoom resize transfer :show-footer="!orderValue.id" @hide="hide" v-loading="load">
+    show-zoom resize transfer show-footer @hide="hide" v-loading="load">
     <template #title>
       <span>创建新订单</span>
     </template>
@@ -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>
@@ -173,11 +173,15 @@
       <labels-modal ref="labelsModal" @onChange="onChangeLabel" />
       <!-- 买家 -->
       <buyer-info-modal ref="buyerInfoModal" @confirm="confirmBuyerInfo" />
+      <el-drawer class="log-drawer" :size="600" append-to-body title="操作日志" :visible.sync="drawer" direction="rtl">
+        <byLog :propConfig="logConfig" ref="log" />
+      </el-drawer>
     </template>
-    <template #footer v-if="!orderValue.id">
+    <template #footer>
       <div class="btn">
-        <el-button type="primary" size="small" @click="btn('continue')">确定并继续</el-button>
-        <el-button type="primary" size="small" @click="btn">确定</el-button>
+        <el-button type="primary" size="small" v-if="!orderValue.id" @click="btn('continue')">确定并继续</el-button>
+        <el-button type="primary" size="small" v-if="!orderValue.id" @click="btn">确定</el-button>
+        <el-button icon="el-icon-edit-outline" circle v-if="orderValue.id" @click="logShow"></el-button>
       </div>
     </template>
     
@@ -195,6 +199,13 @@ import ShopModal from "./shopModal.vue";
 import BuyerInfoModal from "./buyerInfoModal.vue";
 @Component({components:{AddProductModal,EditProductModal,LabelsModal,ShopModal,BuyerInfoModal}})
 export default class AddOrder extends Vue {
+  logConfig:any={
+    request:{
+      url:'/omsOrder/omsOrderOperateLog/page',
+      method:'GET'
+    }
+  };
+  drawer=false;
   value=false;
   num:any=0;
   showPay = false;
@@ -893,6 +904,19 @@ export default class AddOrder extends Vue {
     }
     return t;
   }
+  logShow() {
+    if(!this.orderValue.id) return
+    this.drawer = true;
+    let data = {
+      orderNumber:this.orderValue.id
+    }
+    this.$nextTick(() => {
+      if (this.$refs.log) {
+        (this.$refs.log as any).setBillValue(data);
+        (this.$refs.log as any).request();
+      }
+    })
+  }
   setShow(v:boolean){
     this.value = v;
   }

+ 24 - 20
src/views/oms/order/components/expressDeliveryModal.vue

@@ -62,7 +62,7 @@
         </div>
       </div>
       <vxe-modal v-model="showModal" id="deliverInfoEdit" width="700" height="70%" @show="show" @hide="hide" title="编辑" resize show-zoom transfer show-footer>
-        <by-form :propConfig="config" ref="form" />
+        <by-form :propConfig="config" v-if="showModal" ref="form" />
         <template #footer>
           <div class="btn">
             <el-button plain size="small" @click="showModal = false">取消</el-button>
@@ -102,18 +102,20 @@ export default class ExpressDeliveryModal extends Vue {
   value:any = {}
   showModal=false;
   config:any={
-    size:'small',
-    labelWidth:'120px',
-    rules:{
-      tmsBusinessMan:[{
-        required: true, message: '业务员不能为空!', trigger: 'blur'
-      }],
-      tmsBusinessPhone:[{
-        required: true, message: '业务员手机不能为空!', trigger: 'blur'
-      }],
-      storeHouseId:[{
-        required: true, message: '请选择仓库!', trigger: 'change'
-      }]
+    attr:{
+      size:'small',
+      labelWidth:'120px',
+      rules:{
+        tmsBusinessMan:[{
+          required: true, message: '业务员不能为空!', trigger: 'blur'
+        }],
+        tmsBusinessPhone:[{
+          required: true, message: '业务员手机不能为空!', trigger: 'blur'
+        }],
+        storeHouseId:[{
+          required: true, message: '请选择仓库!', trigger: 'change'
+        }]
+      }
     },
     columns:[
       [{
@@ -142,6 +144,7 @@ export default class ExpressDeliveryModal extends Vue {
         component:'warehouse',
         compConfig:{
           attr:{
+            defaultIndex:0,
             placeholder:'请选择仓库',
             clearable:true
           }
@@ -274,10 +277,11 @@ export default class ExpressDeliveryModal extends Vue {
     if(this.$refs.form){
       (this.$refs.form as any).validate().then(()=>{
         this.value = (this.$refs.form as any).getValue();
-        this.getStoreCount(this.value);
-      })
+        this.showModal = false;
+        // this.getStoreCount(this.value);
+      }).catch(() => {})
     }
-    this.showModal = false;
+    
   }
   hide(){
     this.drawer = true;
@@ -335,10 +339,10 @@ export default class ExpressDeliveryModal extends Vue {
   }
   
   btn() {
-    if(this.stopHandle){
-      this.$message('库存不足!')
-      return
-    }
+    // if(this.stopHandle){
+    //   this.$message('库存不足!')
+    //   return
+    // }
     if(!this.checked){
       this.$message('请阅读并同意运单协议!')
       return

+ 1 - 0
src/views/oms/order/components/inputSelect.vue

@@ -38,6 +38,7 @@ export default class InputSelect extends Vue {
     }
   }
   input(v:any){
+    console.log(v)
     if(this.format && v){
       this.value=v.replace(this.format,'');
     }

+ 60 - 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,6 @@
         </div>
       </template>
       <template v-if="type == 2">
-        
         <div class="cont">
           <div class="title"><span>* </span>时间类型:</div>
           <div class="right-cont">
@@ -64,6 +63,19 @@
             </el-date-picker>
           </div>
         </div>
+        <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">订单状态:</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,7 @@ export default class LoadOrderModal extends Vue {
       value.sourceIds = this.sourceIds.split('\n');
     }else if(this.type == 2){
       let isS=false;
+      value.shopId = this.shopid
       for(const item of this.dateTypeOptions){
         if(item.value == this.dateType){
           isS = true;
@@ -276,17 +294,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 +315,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 +325,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>

+ 2 - 0
src/views/oms/order/components/purchaseModel.vue

@@ -56,6 +56,8 @@ export default class PurchaseModel extends Vue {
           required: true, message: '交货人不能为空!', trigger: 'blur'
         }],
         deliveryPhone:[{
+          required: true, message: '交货人不能为空!', trigger: 'blur'
+        },{
           validator: this.validatePhone, trigger: 'blur' 
         }]
       }

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

@@ -0,0 +1,126 @@
+<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
+      },{
+        title:'时间',
+        field:'respTime',
+        width:150
+      }]
+    }
+  }
+  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>

+ 22 - 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',
@@ -183,6 +183,24 @@ export default class SourceShop extends Vue {
             ],
             authStatus:[
               { required: true, message: '请选择授权状态', trigger: 'change' }
+            ],
+            appKey:[
+              {required: true, message: '请输入appKey', trigger: 'blur'}
+            ],
+            appSecret:[
+              {required: true, message: '请输入appSecret', trigger: 'blur'}
+            ],
+            accessToken:[
+              {required: true, message: '请输入accessToken', trigger: 'blur'}
+            ],
+            refreshToken:[
+              {required: true, message: 'refreshToken', trigger: 'blur'}
+            ],
+            authBegin:[
+              { required: true, message: '请选择授权开始时间', trigger: 'change' }
+            ],
+            authExpired:[
+              { required: true, message: '请选择授权过期时间', trigger: 'change' }
             ]
           }
         },