Browse Source

优化功能

ymy 1 year ago
parent
commit
87dbd23235

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

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

+ 28 - 4
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>
@@ -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,'');
     }

+ 13 - 20
src/views/oms/order/components/loadOrderModal.vue

@@ -33,19 +33,6 @@
         </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">
@@ -76,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">
@@ -229,13 +229,6 @@ 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){

+ 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' 
         }]
       }

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

@@ -53,6 +53,10 @@ export default class OrderPay extends Vue {
         title:'更新的OMS数量',
         field:'updateQty',
         width:130
+      },{
+        title:'时间',
+        field:'respTime',
+        width:150
       }]
     }
   }

+ 18 - 0
src/views/oms/sourceShop/index.vue

@@ -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' }
             ]
           }
         },