ymy 2 năm trước cách đây
mục cha
commit
42edbb0e66

+ 32 - 0
src/api/omsOrder.ts

@@ -6,4 +6,36 @@ export function query(data : any) {
 		method: 'POST',
 		data: data
 	})
+}
+
+export function getProvince(data:any){
+	return request({
+		url:'/omsOrder/omsArea/getByParentCode',
+		method:'Get',
+		params:data
+	})
+}
+
+export function save(data:any){
+	return request({
+		url: '/omsOrder/omsOrder/save',
+		method: 'POST',
+		data: data
+	})
+}
+
+export function smt(data:any){
+	return request({
+		url: '/omsOrder/omsOrder/submit',
+		method: 'POST',
+		data: data
+	})
+}
+
+export function unSmt(data:any){
+	return request({
+		url: '/omsOrder/omsOrder/unSubmit',
+		method: 'POST',
+		data: data
+	})
 }

+ 8 - 5
src/benyun/components/byForm/byForm.vue

@@ -182,16 +182,19 @@ export default class ByForm extends VueViews {
       }
   }
   //表单验证
-  validate():Promise<any>{
+  validate(parames?:any):Promise<any>{
     return new Promise((resolve:Function, reject:Function) => {
       (this as any).$refs.byForm.validate((valid:any) => {
           if (valid) {
             resolve(true)
           } else {
-            (this as any).$message({
-              message: '验证未通过,请检查!',
-              type: 'warning',
-            })
+            if(!parames || !parames.noMsg){
+              (this as any).$message({
+                message: '验证未通过,请检查!',
+                type: 'warning',
+              })
+            }
+            
             reject()
           }
         });

+ 1 - 2
src/benyun/components/byTable/byTable.vue

@@ -65,9 +65,8 @@
         </vxe-column>
     </template>
     </vxe-table>
-    <div class="page">
+    <div class="page" v-if="page.total > 0">
       <el-pagination
-        v-if="page.total > 0"
         @size-change="handleSizeChange"
         @current-change="handleCurrentChange"
         :current-page="page.pageNo"

+ 108 - 0
src/benyun/utils/accuracy.js

@@ -0,0 +1,108 @@
+// var floatObj = function () {
+  /*
+   * 判断obj是否为一个整数
+   */
+  function isInteger(obj) {
+    return Math.floor(obj) === obj
+  }
+
+  /*
+   * 将一个浮点数转成整数,返回整数和倍数。如 3.14 >> 314,倍数是 100
+   * @param floatNum {number} 小数
+   * @return {object}
+   *   {times:100, num: 314}
+   */
+  function toInteger(floatNum) {
+    var ret = {
+      times: 1,
+      num: 0
+    };
+    if (isInteger(floatNum)) {
+      ret.num = floatNum;
+      return ret
+    }
+    var strfi = floatNum + '';
+    var dotPos = strfi.indexOf('.');
+    var len = strfi.substr(dotPos + 1).length;
+    var times = Math.pow(10, len);
+    var intNum = parseInt(floatNum * times + 0.5, 10);
+    ret.times = times;
+    ret.num = intNum;
+    return ret
+  }
+
+  /*
+   * 核心方法,实现加减乘除运算,确保不丢失精度
+   * 思路:把小数放大为整数(乘),进行算术运算,再缩小为小数(除)
+   *
+   * @param a {number} 运算数1
+   * @param b {number} 运算数2
+   * @param op {string} 运算类型,有加减乘除(add/subtract/multiply/divide)
+   *
+   */
+  function operation(a, b, op) {
+    let a1 = a < 0 ? Math.abs(a) : a;
+    let b1 = b < 0 ? Math.abs(b) : b;
+    var o1 = toInteger(a1);
+    var o2 = toInteger(b1);
+    var n1 = a < 0 ? -o1.num : o1.num;
+    var n2 = b < 0 ? -o2.num : o2.num;
+    var t1 = o1.times;
+    var t2 = o2.times;
+    var max = t1 > t2 ? t1 : t2;
+    var result = null;
+    switch (op) {
+      case 'add':
+        if (t1 === t2) { // 两个小数位数相同
+          result = n1 + n2
+        } else if (t1 > t2) { // o1 小数位 大于 o2
+          result = n1 + n2 * (t1 / t2)
+        } else { // o1 小数位 小于 o2
+          result = n1 * (t2 / t1) + n2
+        }
+        return result / max;
+      case 'subtract':
+        if (t1 === t2) {
+          result = n1 - n2
+        } else if (t1 > t2) {
+          result = n1 - n2 * (t1 / t2)
+        } else {
+          result = n1 * (t2 / t1) - n2
+        }
+        return result / max;
+      case 'multiply':
+        result = (n1 * n2) / (t1 * t2);
+        return result;
+      case 'divide':
+        result = (n1 / n2) * (t2 / t1);
+        return result
+    }
+  }
+
+  // 加减乘除的四个接口
+  export function add(a, b) {
+    return operation(a, b, 'add')
+  }
+
+  export function subtract(a, b) {
+    return operation(a, b, 'subtract')
+  }
+
+  export function multiply(a, b) {
+    return operation(a, b, 'multiply')
+  }
+
+  export function divide(a, b) {
+    return operation(a, b, 'divide')
+  }
+
+//   // exports
+//   return {
+//     add: add,
+//     subtract: subtract,
+//     multiply: multiply,
+//     divide: divide
+//   }
+// }()
+
+ 

+ 197 - 12
src/views/oms/order/components/addOrder.vue

@@ -7,7 +7,7 @@
     <template #default>
       <el-collapse v-model="activeNames">
         <el-collapse-item title="基本信息" name="1" class="add-order-item">
-          <by-form :propConfig="config" ref="baseform"></by-form>
+          <by-form :propConfig="config" ref="baseform" @formChange="formChangeBase"></by-form>
         </el-collapse-item>
         <el-collapse-item title="买家信息" name="2" class="add-order-item">
           <by-form :propConfig="config2" ref="infoform">
@@ -21,6 +21,11 @@
         <el-collapse-item title="商品订单" name="3" class="add-order-item">
           <div class="addProductTool">
             <by-tool :propConfig="toolConfig"></by-tool>
+            <div class="preferential">
+              <div class="pre-title">抵扣金额<i class="el-icon-info" title="支持输入数字和百分比。若输入百分比,将自动计算折扣金额=商品成交总金额*百分比(举例:打9折,请输入10%),
+                只在订单创建时计算一次,在订单创建后修改商品价格不会自动计算,运费不参与折扣。"></i>:</div>
+              <el-input v-model="freeAmount" class="freeAmount" placeholder="请输入" size="mini" @input="freeAmountChange"></el-input>
+            </div>
           </div>
           
           <by-table :propConfig="tableConfig" ref="table">
@@ -34,12 +39,40 @@
               </div>
             </template>
             <template v-slot:qty='{ row }'>
-              <el-input v-model="row.qty" placeholder="数量" class="number-input" type="number" @input="qtyChange($event, row)"></el-input>
+              <el-input v-model="row.qty" placeholder="数量" class="number-input" size="mini" type="number" @input="qtyChange($event, row)"></el-input>
             </template>
             <template v-slot:price='{ row }'>
-              <el-input v-model="row.price" placeholder="单价" class="number-input" type="number" @input="priceChange($event, row)"></el-input>
+              <el-input v-model="row.price" placeholder="单价" class="number-input" size="mini" type="number" @input="priceChange($event, row)"></el-input>
             </template>
           </by-table>
+          <div class="product-row">
+            <div class="p-left">数量:{{ num }}</div>
+            <div class="p-right">
+              <div class="amount-title">商品成交总金额:</div>
+              <div class="amount-price">¥{{ productTotal }}</div>
+            </div>
+          </div>
+          <div class="product-row">
+            <div class="p-left"></div>
+            <div class="p-right">
+              <div class="amount-title">抵扣金额:</div>
+              <div class="amount-price">¥{{orderValue.freeAmount?orderValue.freeAmount:'0.00'}}</div>
+            </div>
+          </div>
+          <div class="product-row">
+            <div class="p-left"></div>
+            <div class="p-right">
+              <div class="amount-title">运费:</div>
+              <div class="amount-price">¥{{orderValue.freight?orderValue.freight:'0.00'}}</div>
+            </div>
+          </div>
+          <div class="product-row">
+            <div class="p-left"></div>
+            <div class="p-right">
+              <div class="amount-title">应付总金额:</div>
+              <div class="amount-price" style="color:#F00; font-size: 14px;">¥{{orderValue.payAmount?orderValue.payAmount:'0.00'}}</div>
+            </div>
+          </div>
         </el-collapse-item>
         <el-collapse-item title="订单支付情况" name="4" class="add-order-item">
           <el-radio-group v-model="radioPay" @input="inputPay" class="payType">
@@ -67,10 +100,15 @@
 </template>
 <script lang="ts">
 import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+import { save } from '@/api/omsOrder'
+import { add,multiply } from '@/benyun/utils/accuracy'
 
 @Component
 export default class AddOrder extends Vue {
   value=false;
+  num=0;
+  freeAmount="";
+  productTotal=0;
   productData:Array<any>=[]
   userName:any='';//用户信息
   orderValue:any={}; //新增订单值
@@ -118,10 +156,10 @@ export default class AddOrder extends Vue {
         span:6,
         label:'订单日期',
         prop:'orderDate',
-        component:'by-input',
+        component:'by-date-picker',
         compConfig:{
           attr:{
-            placeholder:'请输入订单日期',
+            // placeholder:'请输入订单日期',
             clearable:true
           }
         }
@@ -133,7 +171,7 @@ export default class AddOrder extends Vue {
         component:'by-input',
         compConfig:{
           attr:{
-            placeholder:'请输入订单日期',
+            placeholder:'请输入运费',
             clearable:true
           }
         }
@@ -221,6 +259,9 @@ export default class AddOrder extends Vue {
         label:'收货人',
         prop:'receiverName',
         component:'by-input',
+        rules:[{
+          required: true, message: '请输入名称', trigger: 'blur'
+        }],
         compConfig:{
           attr:{
             placeholder:'请输入收货人',
@@ -305,9 +346,9 @@ export default class AddOrder extends Vue {
   tableConfig:any={
     attr:{
       size:'small',
-      seq:true,
+      // seq:true,
       align:'center',
-      checkbox:true,
+      // checkbox:true,
     },
     columns:[{
       title:'名称|款式编码|商品编码',
@@ -346,7 +387,7 @@ export default class AddOrder extends Vue {
       width:100
     },{
       title:'库存',
-      field:'store',
+      field:'stock',
       width:100
     },{
       title:'操作',
@@ -654,6 +695,35 @@ export default class AddOrder extends Vue {
       createBy:this.userName
     });
     
+  }
+  //抵扣金额数值变化
+  freeAmountChange(v:any){
+    this.orderValue.freeAmount = 0;
+    if(v){
+      if(Number(v) >= 0){
+        this.orderValue.freeAmount = Number(v)
+      }else{
+        let arr = v.split("%");
+        if(arr.length == 2 && Number(arr[0]) > 0){
+          let nowData = (this.$refs.table as any).getValue();
+          let totalPrice:any = 0;
+          for(const item of nowData){
+            if(Number(item.amount)){
+              totalPrice = add(item.amount, totalPrice)
+            }
+          }
+          this.orderValue.freeAmount = multiply(totalPrice,Number(arr[0]))
+        }
+      }
+    }
+  }
+  formChangeBase(data:any){
+    if(!this.orderValue[data.code]){
+      Vue.set(this.orderValue, data.code, data.value);
+    }else{
+      this.orderValue[data.code] = data.value;
+    }
+    
   }
   confirmProduct(data:Array<any>){
     let nowData = (this.$refs.table as any).getValue();
@@ -685,7 +755,6 @@ export default class AddOrder extends Vue {
           nowData.push(obj)
         }
       }
-      console.log(nowData);
       (this.$refs.table as any).setValue(nowData);
       if(ids){
         this.$alert('编码“'+ids+'”已添加!', '提示', {
@@ -709,9 +778,87 @@ export default class AddOrder extends Vue {
       row.amount = 0
     }
   }
+  clearValue(){
+    (this.$refs.baseform as any).setValue({});
+    (this.$refs.infoform as any).setValue({});
+    (this.$refs.table as any).setValue([]);
+    if(this.$refs.payform){
+      (this.$refs.payform as any).setValue({});
+    }
+    (this.$refs.invoicesform as any).setValue({});
+  }
+  getOrderValue(){
+    this.orderValue = {};
+    let r = true;
+    (this.$refs.baseform as any).validate({noMsg:true}).then(()=>{
+      let baseInfo = (this.$refs.baseform as any).getValue();
+      for(const key in baseInfo){
+        this.orderValue[key] = baseInfo[key]
+      }
+    }).catch(()=>{
+      if(r){
+        (this as any).$message({
+          message: '验证未通过,请检查!',
+          type: 'warning',
+        })
+      }
+      r = false
+    });
+    (this.$refs.infoform as any).validate({noMsg:true}).then(()=>{
+      let infoValue = (this.$refs.infoform as any).getValue();
+      for(const key in infoValue){
+        this.orderValue[key] = infoValue[key]
+      }
+    }).catch(()=>{
+      if(r){
+        (this as any).$message({
+          message: '验证未通过,请检查!',
+          type: 'warning',
+        })
+      }
+      r = false
+    });
+    if(this.$refs.table){
+      let productOrder:Array<any> = (this.$refs.table as any).getValue();
+      this.orderValue.item = productOrder;
+    }
+    this.orderValue.status = null;
+    if(this.radioPay != 3){
+      if(this.radioPay == 1){
+        this.orderValue.status = 'WaitPay'
+      }else if(this.radioPay == 2){
+        this.orderValue.status = 'WaitConfirm'
+      }
+    }else{
+      (this.$refs.payform as any).validate({noMsg:true}).then(()=>{
+        this.orderValue.pays = [];
+        let payFormValue = (this.$refs.payform as any).getValue();
+        this.orderValue.pays.push(payFormValue);
+      }).catch(()=>{
+        if(r){
+          (this as any).$message({
+            message: '验证未通过,请检查!',
+            type: 'warning',
+          })
+        }
+        r = false
+      });
+    }
+    let invoiceValue = (this.$refs.invoicesform as any).getValue();
+    this.orderValue.invoices=[];
+    this.orderValue.invoices.push(invoiceValue);
+  }
   btn(){
-    let value = (this.$refs.infoform as any).getValue();
-    console.log(value);
+    this.getOrderValue();
+    setTimeout(()=>{
+      save({data:this.orderValue}).then((res:any) => {
+        (this as any).$message({
+          message: '订单添加成功!',
+          type: 'success',
+        })
+      }).catch((err:any) => {})
+    },500)
+    
   }
 }
 </script>
@@ -728,6 +875,18 @@ export default class AddOrder extends Vue {
 .addProductTool{
   width: 100%;
   padding-bottom: 8px;
+  display: flex;
+  justify-content: space-between;
+  .preferential{
+    width: 240px;
+    flex-shrink: 0;
+    display: flex;
+    align-items: center;
+    .pre-title{
+      width: 80px;
+      flex-shrink: 0;
+    }
+  }
 }
 .payType{
   padding-bottom: 16px;
@@ -746,6 +905,32 @@ export default class AddOrder extends Vue {
     }
   }
 }
+.product-row{
+  width: 100%;
+  display: flex;
+  align-items: center;
+  font-size: 12px;
+  padding: 4px 0;
+  .p-left,.p-right{
+    width: 50%;
+  }
+  .p-left{
+    text-align: right;
+  }
+  .p-right{
+    display: flex;
+    align-items: center;
+    .amount-title{
+      width: 70%;
+      text-align: right;
+      box-sizing: border-box;
+      padding-right: 8px;
+    }
+    .amount-price{
+      width: 30%;
+    }
+  }
+}
 </style>
 
 <style lang="scss">

+ 3 - 1
src/views/oms/order/components/filterMinMax.vue

@@ -23,7 +23,9 @@ export default class OrderProduct extends Vue {
 
   @Prop()
   maxField!:string
-
+  clear(){
+    this.value={}
+  }
   mininput(){
     this.$emit('change',this.value)
   }

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

@@ -10,7 +10,7 @@
 import { Component, Prop, Vue, Watch } from "vue-property-decorator";
 @Component
 export default class InputSelect extends Vue {
-  value='';
+  value:any='';
   select='';
   placeholder='';
 
@@ -24,6 +24,10 @@ export default class InputSelect extends Vue {
     }
   }
 
+  clear(){
+    this.value=""
+  }
+
   change(v:any){
     for(const item of this.options){
       if(item.value == v){

+ 11 - 4
src/views/oms/order/components/orderCheckbox.vue

@@ -33,7 +33,9 @@ export default class OrderCheckbox extends Vue {
   retType?:string
 
   clear(){
-    this.value = []
+    this.value = [];
+    this.checkAll = false;
+    this.isIndeterminate = false;
   }
 
   getValue(){
@@ -52,9 +54,14 @@ export default class OrderCheckbox extends Vue {
     }
   }
 
-  emitFun(){
+  emitFun(a?:boolean){
     let v:any = this.getValue();
-    this.$emit('checkboxChange',v);
+    if(a){
+      this.$emit('checkboxChange',[]);
+    }else{
+      this.$emit('checkboxChange',v);
+    }
+    
   }
 
   handleCheckAllChange(val:any){
@@ -65,7 +72,7 @@ export default class OrderCheckbox extends Vue {
       }
     }
     this.isIndeterminate = false;
-    this.emitFun();
+    this.emitFun(true);
   }
 
   handleCheckedItemChange(value:any,config:any){

+ 7 - 6
src/views/oms/order/components/orderTool.vue

@@ -2,12 +2,12 @@
   <div class="order-tool">
     <el-button type="text" @click="handle('addOrder')">新增订单</el-button>
     <div class="split"></div>
-    <el-dropdown split-button type="text" @click="auHandle">
+    <el-dropdown split-button type="text" @click="handle('smt')" @command="handleCommand">
         审批
       <el-dropdown-menu slot="dropdown">
-        <el-dropdown-item>反审批</el-dropdown-item>
-        <el-dropdown-item>批量审批</el-dropdown-item>
-        <el-dropdown-item>批量反审批</el-dropdown-item>
+        <el-dropdown-item command="reSmt">反审批</el-dropdown-item>
+        <!-- <el-dropdown-item>批量审批</el-dropdown-item>
+        <el-dropdown-item>批量反审批</el-dropdown-item> -->
       </el-dropdown-menu>
     </el-dropdown>
     <el-button type="text">设快递</el-button>
@@ -41,8 +41,9 @@
 import { Component, Prop, Vue, Watch } from "vue-property-decorator";
 @Component
 export default class OrderTool extends Vue {
-  auHandle(){
-    console.log('123')
+
+  handleCommand(n:string){
+    console.log(n)
   }
 
   handle(n:string){

+ 105 - 58
src/views/oms/order/index.vue

@@ -3,17 +3,17 @@
     <div class="order-left">
       <el-collapse v-model="activeNames" class="my-collapse">
         <el-collapse-item title="基本信息" name="1">
-          <input-select :options="myOptions" @input="parameChange" />
-          <input-select :options="outLineOptions" @input="parameChange" />
-          <input-select :options="buyerOptions" @input="parameChange" />
+          <input-select :options="myOptions" @input="parameChange" ref="searchCom01" />
+          <input-select :options="outLineOptions" @input="parameChange" ref="searchCom02" />
+          <input-select :options="buyerOptions" @input="parameChange" ref="searchCom03" />
         </el-collapse-item>
-        <order-checkbox title="订单状态" keyName="status" :options="statusOptions" noLimit @checkboxChange="onChange($event,'status')" />
-        <order-radio title="买家留言" keyName="buyerMessageFilter" :options="buyerMessageOptions" noLimit @radioChange="onChange($event,'buyerMessageFilter')">
+        <order-checkbox title="订单状态" keyName="status" ref="searchCom04" :options="statusOptions" noLimit @checkboxChange="onChange($event,'status')" />
+        <order-radio title="买家留言" keyName="buyerMessageFilter" ref="searchCom05" :options="buyerMessageOptions" noLimit @radioChange="onChange($event,'buyerMessageFilter')">
           <template v-slot:buyerMessage>
             <el-input style="width: 140px;" v-model="value.buyerMessageContent" size="mini" placeholder="留言内容"></el-input>
           </template>
         </order-radio>
-        <order-radio title="卖家备注" keyName="remarkFilter" :options="remarkFilterOptions" noLimit @radioChange="onChange($event,'remarkFilter')">
+        <order-radio title="卖家备注" keyName="remarkFilter" ref="searchCom06" :options="remarkFilterOptions" noLimit @radioChange="onChange($event,'remarkFilter')">
           <template v-slot:remarkFilter>
             <el-input style="width: 140px;" v-model="value.remarkContent" size="mini" placeholder="备注内容"></el-input>
           </template>
@@ -30,13 +30,13 @@
             </el-select>
             <i class="el-icon-info" title="附加订单时间限制,许多仅限待发货订单的查询条件将自动取消限制"></i>
           </div>
-          <filter-date @change="onChangeTime" />
+          <filter-date @change="onChangeTime" ref="searchCom07" />
           <div>付款后几小时未发货:</div>
           <div class="order-time">
             <el-input v-model="value.deliveryHours" class="deliveryHours-input" size="mini" type="number" style=""></el-input>
             <i class="el-icon-info" title="单位小时,不支持小数位。如果数值大于0,强制为未发货订单。同时勾选店铺可以实现不同平台的未发货时效查询"></i>
           </div>
-          <filterMinMax title="剩余发货时间(小时)" minField="deliveryRemainingMin" maxField="deliveryRemainingMax" @change="parameChange" />
+          <filterMinMax title="剩余发货时间(小时)" ref="searchCom08" minField="deliveryRemainingMin" maxField="deliveryRemainingMax" @change="parameChange" />
         </el-collapse-item>
         <!-- <el-collapse-item name="info">
           <template slot="title">
@@ -82,14 +82,14 @@
           </el-select>
           <order-product />
         </el-collapse-item> -->
-        <order-checkbox title="平台订单状态" keyName="shopStatusList" :options="shopStatusListOption" noLimit @checkboxChange="onChange($event,'shopStatusList')" />
-        <order-radio title="便签|线下备注 " keyName="noteFilter" :options="noteFilterOptions" noLimit @radioChange="onChange($event,'noteFilter')">
+        <order-checkbox title="平台订单状态" ref="searchCom09" keyName="shopStatusList" :options="shopStatusListOption" noLimit @checkboxChange="onChange($event,'shopStatusList')" />
+        <order-radio title="便签|线下备注" ref="searchCom10" keyName="noteFilter" :options="noteFilterOptions" noLimit @radioChange="onChange($event,'noteFilter')">
           <template v-slot:noteContent>
             <el-input style="width: 140px;" v-model="value.noteContent" size="mini" placeholder="备注内容"></el-input>
           </template>
         </order-radio>
-        <order-radio title="订单来源" keyName="sourceFrom" :options="sourceFromOptions" noLimit @radioChange="onChange($event,'sourceFrom')" />
-        <order-checkbox title="订单类型" keyName="type" :options="typeOption" noLimit @checkboxChange="onChange($event,'type')" />
+        <order-radio title="订单来源" keyName="sourceFrom" ref="searchCom11" :options="sourceFromOptions" noLimit @radioChange="onChange($event,'sourceFrom')" />
+        <order-checkbox title="订单类型" keyName="type" ref="searchCom12" :options="typeOption" noLimit @checkboxChange="onChange($event,'type')" />
         <el-collapse-item title="付款方式 & 是否付款" name="codAndPay">
           <div class="box01">
             <el-radio-group v-model="radio" @input="colChange">
@@ -106,7 +106,7 @@
             </el-radio-group>
           </div>
         </el-collapse-item>
-        <el-collapse-item title="标签&多标签 | 旗帜" name="flag">
+        <!-- <el-collapse-item title="标签&多标签 | 旗帜" name="flag">
           <div>包含旗帜</div>
           <div class="orderSelect">
             <el-select v-model="value.includeFlags" multiple collapse-tags size="mini" placeholder="请选择旗帜" clearable>
@@ -129,22 +129,22 @@
               </el-option>
             </el-select>
           </div>
-        </el-collapse-item>
-        <order-checkbox title="店铺" keyName="shopIdList" :options="shopIdListOptions" @checkboxChange="onChange($event,'shopIdList')" />
+        </el-collapse-item> -->
+        <order-checkbox title="店铺" ref="searchCom13" keyName="shopIdList" :options="shopIdListOptions" @checkboxChange="onChange($event,'shopIdList')" />
 
-        <order-checkbox title="省份" keyName="receiverProvinceCode" :options="provinceOptions" @checkboxChange="onChange($event,'receiverProvinceCode')" />
+        <order-checkbox title="省份" ref="searchCom14" keyName="receiverProvinceCode" :options="provinceOptions" @checkboxChange="onChange($event,'receiverProvinceCodeList')" />
       </el-collapse>
       <div class="searchHandle">
-        <el-button size="mini">重置</el-button>
+        <el-button size="mini" @click="resert">重置</el-button>
         <el-button type="primary" size="mini" @click="search">搜索</el-button>
       </div>
     </div>
     <div class="order-right">
       <div class="tool">
-        <order-tool @addOrder="addOrder"/>
+        <order-tool @addOrder="addOrder" @smt="smtOrder" @reSmt="reSmt"/>
       </div>
       <div class="table">
-        <order-table :data="data"/>
+        <order-table :data="data" ref="orderTable"/>
         <div class="page">
           <el-pagination v-if="page.total > 0" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page.pageNo" :page-size="page.pageSize"
             :layout="'total, sizes, prev, pager, next, jumper'" :total="page.total"></el-pagination>
@@ -166,7 +166,7 @@ import AddOrder from "./components/addOrder.vue";
 import InputSelect from "./components/inputSelect.vue";
 import OrderProduct from "./components/orderProduct.vue";
 import filterMinMax from './components/filterMinMax.vue'
-import { query } from '@/api/omsOrder'
+import { query,getProvince,smt,unSmt } from '@/api/omsOrder'
 @Component({components:{filterInput,OrderCheckbox,OrderRadio,filterDate,OrderTool,OrderTable,AddOrder,InputSelect,OrderProduct,filterMinMax}})
 export default class Order extends Vue {
   activeNames:Array<any>=['1']
@@ -179,23 +179,23 @@ export default class Order extends Vue {
     total: 0 //总条数
   }
   value:any={
-    sourceId:'',  //线上订单号
-    shopBuyerId:'', //买家昵称
-    buyerId:'', //买家ID
-    logisticsId:'', //快递单号
-    logisticsCompany:'', //快递公司
-    internationalLogisticsId:'', //国际物流单号
-    isSubmitte:'', //数据是否已提交
-    drpCoIdFrom:'', //分销商编号
-    drpCoIdTo:'', //供销商编号
-    sourceFrom:'', //订单来源
-    dateType:1,//时间类型
-    deliveryRemainingMin:0, //订单剩余发货时间(小时)-小于等于
-    deliveryRemainingMax:null, //订单剩余发货时间(小时)-大于等于
-    includeSkuType:1, //包含编码类型
-    type:'', //订单类型
-    status:'' , //订单状态
-    excludeSkuType:1, //排除编码类型
+    // sourceId:'',  //线上订单号
+    // shopBuyerId:'', //买家昵称
+    // buyerId:'', //买家ID
+    // logisticsId:'', //快递单号
+    // logisticsCompany:'', //快递公司
+    // internationalLogisticsId:'', //国际物流单号
+    // isSubmitte:'', //数据是否已提交
+    // drpCoIdFrom:'', //分销商编号
+    // drpCoIdTo:'', //供销商编号
+    // sourceFrom:'', //订单来源
+    // dateType:1,//时间类型
+    // deliveryRemainingMin:0, //订单剩余发货时间(小时)-小于等于
+    // deliveryRemainingMax:null, //订单剩余发货时间(小时)-大于等于
+    // includeSkuType:1, //包含编码类型
+    // type:'', //订单类型
+    // status:'' , //订单状态
+    // excludeSkuType:1, //排除编码类型
   }
   myOptions=[{
     label:'内部订单号',
@@ -437,36 +437,83 @@ export default class Order extends Vue {
   }]
 
   //省份
-  provinceOptions:Array<any>=[{
-    label:'北京',
-    value:'1'
-  },{
-    label:'天津',
-    value:'2'
-  },{
-    label:'上海',
-    value:'3'
-  },{
-    label:'河北省',
-    value:'4'
-  },{
-    label:'广西壮族自治区',
-    value:'5'
-  }]
-
+  provinceOptions:Array<any>=[]
 
   mounted(){
     this.getList()
+    this.getProvince()
+  }
+  resert(){
+    this.value={};
+    for(const key in this.$refs){
+      if(key.indexOf('searchCom') >= 0 && (this.$refs[key] as any).clear){
+        (this.$refs[key] as any).clear()
+      }
+    }
+    this.value.dateType = 1;
+    this.value.includeSkuType = 1;
   }
-
   search(){
     this.page.pageNo = 1;
-    this.getList(this.value)
+    this.getList();
   }
 
   addOrder(){
     (this.$refs.addOrder as any).setShow(true)
   }
+  smtOrder(){
+    let data:Array<any>= (this.$refs.orderTable as any).getValue();
+    if(data.length == 0){
+      this.$message('请选择订单!');
+    }
+    let ids:Array<any>=[];
+    for(const item of data){
+      ids.push(item.id)
+    }
+    smt({
+      ids:ids
+    }).then(() => {
+      (this as any).$message({
+        message: '订单审批成功!',
+        type: 'success'
+      });
+      this.getList();
+    })
+  }
+  reSmt(){
+    let data:Array<any>= (this.$refs.orderTable as any).getValue();
+    if(data.length == 0){
+      this.$message('请选择订单!');
+    }
+    let ids:Array<any>=[];
+    for(const item of data){
+      ids.push(item.id)
+    }
+    unSmt({
+      ids:ids
+    }).then(() => {
+      (this as any).$message({
+        message: '订单反审批成功!',
+        type: 'success'
+      });
+      this.getList();
+    })
+  }
+  getProvince(){
+    this.provinceOptions = [];
+    getProvince({
+      parentCode:'86'
+    }).then((res:any) => {
+      if(res.data){
+        for(const item of res.data){
+          this.provinceOptions.push({
+            label:item.name,
+            value:item.code
+          })
+        }
+      }
+    })
+  }
 
   //组件返回事件
   onChange(v:any,code:string){
@@ -504,8 +551,8 @@ export default class Order extends Vue {
     this.value.dateEnd = v[1];
   }
   //获取订单列表数据
-  getList(parames?:any){
-    let data:any = parames?(this as any).$lodash.cloneDeep(parames):{};
+  getList(){
+    let data:any =(this as any).$lodash.cloneDeep(this.value);
     data.pageNo = this.page.pageNo;
     data.pageSize = this.page.pageSize;
     query(data).then((res:any) => {

+ 1 - 0
tsconfig.json

@@ -12,6 +12,7 @@
     "forceConsistentCasingInFileNames": true,
     "useDefineForClassFields": true,
     "sourceMap": true,
+    "allowJs": true,
     "baseUrl": ".",
     "types": [
       "webpack-env"

+ 1 - 0
vue.config.js

@@ -31,6 +31,7 @@ module.exports = defineConfig({
     proxy: {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
+        ws:false,
         // target: `http://192.168.1.79:9207`,
         target: `http://192.168.2.202:8080`,
         // target: `http://192.168.2.202/prod-api/maindata`,