逆水行舟 1 ay önce
ebeveyn
işleme
95d49bc006

+ 7 - 0
src/api/omsOrder.ts

@@ -352,6 +352,13 @@ export function autoAudit(data: any) {
     data: data,
   });
 }
+//获得智能审核设置数据
+export function autoAuditData() {
+  return request({
+    url: "/omsOrder/jobConfig/list",
+    method: "GET",
+  });
+}
 
 //获得聚水潭店铺列表
 export function waterShop() {

+ 1 - 1
src/benyun/utils/auth.ts

@@ -6,7 +6,7 @@ const ExpiresInKey = "AdminOMS-Expires-In";
 
 export function getToken() {
   if (process.env.NODE_ENV === "development") {
-    return "eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6ImQ2Y2JhODYxLTE3NzgtNDM2OS1hYmU0LTRmNDk0NzI1NTcwYiIsInVzZXJuYW1lIjoiYWRtaW4ifQ.KpYcuxOuFRr_OkROPEH0_7X8stC5CgE538ZUkM7MZHIhmx29kv5Mxgno84kWhBA_cy_8y3eApdOJY6-Rtl49dQ";
+    return "eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6IjhiN2ZkM2Q3LTEzN2ItNDU0NS1iYjliLTI4YjVmZGFiNWNjYSIsInVzZXJuYW1lIjoiYWRtaW4ifQ.tJoJXavNONcEWwAHwUX7VKiNSANToe5OCU1A-pkZGL2cnIXMdioyYyzV8QqOcN95RZTH447beLoejB0TpcSfnA";
   } else {
     return Cookies.get(TokenKey);
   }

+ 23 - 6
src/views/oms/B2BOrder/components/autoAudit.vue

@@ -14,6 +14,7 @@
 <script lang="ts">
 import { Component, Prop, Vue, Watch } from "vue-property-decorator";
 import { save } from '@/api/question'
+import { autoAuditData } from "@/api/omsOrder";
 @Component({ components: {} })
 export default class AutoAudit extends Vue {
     value = false;
@@ -66,16 +67,32 @@ export default class AutoAudit extends Vue {
     setShow(v: boolean) {
         this.value = v;
         setTimeout(() => {
-            let data = localStorage.getItem('autoAudit');
-            if (data) {
-                let v = JSON.parse(data);
-                v.jobState = v.jobState == 1 ? true : false;
-                (this.$refs.form as any).setValue(v);
-            }
+            this.autoAuditData();
         }, 200);
     }
+    autoAuditData() {
+        autoAuditData().then((res: any) => {
+            if (res.code != 200) return;
+            const resV = res.rows[0]
+            const v = {
+                jobState: resV.jobState === '1' ? true : false,
+                scheduleConf: resV.time == '1' ? '*/10 * * * *' : resV.time == '2' ? '*/30 * * * *' : '0 * * * *'
+            };
+            (this.$refs.form as any).setValue(v);
+        })
+    }
+
     btn() {
         let v = (this.$refs.form as any).getValue();
+        if (v.scheduleConf === '*/10 * * * *') {
+            v.time = '1'
+        }
+        if (v.scheduleConf === '*/30 * * * *') {
+            v.time = '2'
+        }
+        if (v.scheduleConf === '0 * * * *') {
+            v.time = '3'
+        }
         if (v.jobState === undefined || v.jobState === false) {
             v.jobState = 2
         } else {

+ 2 - 1
src/views/oms/B2BOrder/components/batchbyOneModal.vue

@@ -5,7 +5,7 @@
       <div class="err" v-if="failOrder.length > 0 && data.length > 1">
         <span>发货失败订单:</span>
         <span class="error-page" v-for="item of failOrder" @click="exchangeTag(item)" :key="item">【{{ item + 1
-        }}】</span>
+          }}】</span>
       </div>
       <div class="order-top" v-if="data.length > 1">
         <el-pagination background :page-size="1" :current-page="currentOrder + 1" layout="prev, pager, next"
@@ -518,6 +518,7 @@ export default class BatchbyOneModal extends Vue {
     this.drawer = v
   }
   emptyInventory(v: boolean) {
+    console.info("无库存提示....")
     this.isEmptyInventory = v;
   }
 

+ 1 - 0
src/views/oms/B2BOrder/components/carpoolModal.vue

@@ -290,6 +290,7 @@ export default class CarpoolModal extends Vue {
   }
 
   emptyInventory(v: boolean) {
+    console.info("无库存提示....");
     this.isEmptyInventory = v;
   }
 }

+ 2 - 0
src/views/oms/B2BOrder/components/deliveryGoodsInfo.vue

@@ -520,12 +520,14 @@ export default class DeliveryGoodsInfo extends Vue {
 
   //获得库存
   async getInventory() {
+
     let items: any = [];
     for (const item of this.value.subItem) {
       items.push(item.barCode)
     }
     if (this.value.subItem.length) {
       const res = await api.getJZJInventory({ wareHouseCode: '', items: items })
+      this.$emit('emptyInventory', false);
       if (res.data.code != 200) {
         this.$emit('emptyInventory', true);
         return;

+ 0 - 1
src/views/oms/B2BOrder/components/expressDeliveryModal.vue

@@ -421,7 +421,6 @@ export default class ExpressDeliveryModal extends Vue {
   }
   //判断库存是否充足
   checkInventory() {
-    let m = '';
     for (const item of this.value.subItem) {
       if (item.remainAmount <= 0) {
         return false;

+ 1 - 1
src/views/oms/B2BOrder/components/orderTable.vue

@@ -65,7 +65,7 @@
     <vxe-column field="orderTimeout" title="待处理时长" width="180">
       <template #header="{ column }">
         待处理时长
-        <el-tooltip class="item" effect="dark" :content="`监测订单创建后超时 [ ${orderTimeoutVal} ] 分钟未处理示为超时未处理,并提示超时标记。`"
+        <el-tooltip class="item" effect="dark" :content="`订单创建超过 [ ${orderTimeoutVal} ] 分钟未处理,将被视为超时订单。`"
           placement="top">
           <i class="el-icon-question"></i>
         </el-tooltip>

+ 11 - 11
src/views/oms/B2BOrder/index.vue

@@ -28,7 +28,7 @@
                   <div class="ques-list" v-show="showQues">
                     <template v-for="item of questData">
                       <el-checkbox :label="item.id" v-if="item.isShow == 1" :key="item.value">{{ item.type
-                      }}</el-checkbox>
+                        }}</el-checkbox>
                     </template>
                   </div>
                 </el-collapse-transition>
@@ -1352,8 +1352,8 @@ export default class Order extends Vue {
     queryOrderTimeConfig({ pageSize: 20, pageNum: 1 }).then(res => {
       if (res.code === 200) {
         this.orderTimeConfigOptions = res.rows
-        //将this.orderTimeConfigOptions[0].timeout的小时数值换成秒钟,如0.1小时=360秒
-        const tv = Number(this.orderTimeConfigOptions[0].timeout as number) * 60;
+
+        const tv = Number(this.orderTimeConfigOptions[0].timeout as number);
         (this.$refs.orderTable as any).setOrderTimeoutVal(tv);
       }
     })
@@ -1368,9 +1368,9 @@ export default class Order extends Vue {
       const to = this.data[i].orderTimeout;
       const cr = this.data[i].createTime;
 
-      //this.orderTimeConfigOptions[0].timeout的小时数值换成秒钟,如0.1小时=360秒
+      //this.orderTimeConfigOptions[0].timeout的小时数值换成秒钟
       let timeout: number = Number(this.orderTimeConfigOptions[0].timeout as number);
-      let timeoutSec = timeout * 60 * 60;
+      let timeoutSec = timeout * 60;
 
       //orderTimeout属性YYYY-MM-DD HH:mm:ss和当前时间比较,返回相差多少小时多少分钟,如:超时2小时23分
       let time = this.data[i].orderTimeout.split(' ');
@@ -1394,12 +1394,12 @@ export default class Order extends Vue {
       let diffMin = Math.floor(Math.abs((diff / 1000 / 60)));
       //计算小时
       let diffHour = Math.floor(Math.abs((diff / 1000 / 60 / 60)));
-      if (Math.abs(diffSec) === 0) {
-        this.data[i].orderTimeout = "未超时";// + ',' + to + ',' + cr;
-        continue;
-      }
-      if (diff >= timeoutSec) {
+      //this.data[i].orderTimeout = `${diffSec},${timeoutSec}`;
+      if (diffSec > timeoutSec) {
         this.data[i].isOrderTimeout = true;
+      } else {
+        this.data[i].orderTimeout = "未超时";// + ',' + to + ',' + cr + ',' + diffSec + ',' + timeoutSec;
+        continue;
       }
       console.info(diffSec, diffMin, diffHour, this.data[i].createTime, this.data[i].orderTimeout, timeoutSec, timeout);
       if (diffSec < 60 && diffSec > 0) {
@@ -1407,7 +1407,7 @@ export default class Order extends Vue {
         continue;
       }
       if (diffMin < 60) {
-        this.data[i].orderTimeout = "超时" + Math.abs(Math.round(diffSec)) + "分";
+        this.data[i].orderTimeout = "超时" + Math.abs(Math.round(diffMin)) + "分";// + ',' + to + ',' + cr + ',' + diffSec + ',' + timeoutSec;
         continue;
       }
       if (diffHour > 0) {