Parcourir la source

4号工单。修复1号工单

逆水行舟 il y a 2 mois
Parent
commit
48eebdea21

+ 11 - 1
src/api/currency.ts

@@ -148,12 +148,21 @@ function wmsStore(ids: any) {
 //查询极智嘉商品库存
 function getJZJInventory(data: { wareHouseCode: string; items: string[] }) {
   return request({
-    url: "/omsOrder/geekPlus/queryProductInventory",
+    url: "/omsOrder/customProduct/queryProductInventory",
     method: "POST",
     data,
   });
 }
 
+//查看生命周期
+function showLifeCycle(params: { id: number }) {
+  return request({
+    url: "/omsOrder/customProduct/showLifeCycle",
+    method: "GET",
+    params,
+  }) as Promise<{ code: number; data: any; msg: string }>;
+}
+
 export default {
   treeList,
   treeUseList,
@@ -174,4 +183,5 @@ export default {
   outQueryBySku,
   wmsStore,
   getJZJInventory,
+  showLifeCycle,
 };

+ 8 - 0
src/api/omsOrder.ts

@@ -18,6 +18,14 @@ export function queryTimeOut(params: any, data?: any) {
     data: data,
   });
 }
+//提示超时订单
+export function tipOrderTimeOut(params: { pageSize: number; pageNum: number }) {
+  return request({
+    url: "/omsOrder/customOrder/queryTimeoutOrder",
+    method: "GET",
+    params,
+  }) as Promise<{ code: number; msg: string; total: number }>;
+}
 
 //按条码查询数据
 export function queryByBarCode(params: {

+ 12 - 1
src/api/orderConfig.ts

@@ -20,6 +20,17 @@ export function addOrderTimeConfig(data: {
     method: "POST",
   });
 }
+//修改订单时间配置
+export function updateOrderTimeConfig(data: {
+  id: number;
+  timeout: number;
+}): Promise<IOrderTimeResponse<IOrderTimeConfigItem[]>> {
+  return request({
+    url: "/omsOrder/orderConfig",
+    data,
+    method: "PUT",
+  });
+}
 
 //删除订单时间配置
 export function delOrderTimeConfig(
@@ -77,7 +88,7 @@ export interface IOrderTimeConfigItem {
 //订单时间配置响应数据
 export interface IOrderTimeResponse<T> {
   total: number;
-  rows: T[];
+  rows: T;
   code: number;
   msg: string;
 }

+ 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.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6IjAzZThjZDY0LWJiMjYtNDRmNS1iNGFmLTdiODY4ZDhjMDllNiIsInVzZXJuYW1lIjoiYWRtaW4ifQ.BWVusjGlCLpDZm16pYdY1FLGJjIfDmQCUS-MNLSMlOrncySsn3oXOAUg1fWhWOa6CeB3uIdlIK8AYLwScsCPkg";
+    return "eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6Ijg2ODM1N2M0LTEwOTgtNGNmZS05YWM1LTA0ZGRmYmIxZmVjNCIsInVzZXJuYW1lIjoiYWRtaW4ifQ.4OXHy4kWg_bsIYVb_LN5wnrFj2kKRIWfHG0k47GgjU0KtuY2wsmB-ldi03Pb5E9ppqj35k0uCAGXEJokcPvYbw";
   } else {
     return Cookies.get(TokenKey);
   }

+ 50 - 5
src/views/audit/store/components/liveView.vue

@@ -1,29 +1,74 @@
 <template>
     <el-drawer v-loading="load" title="查看生命周期" :visible.sync="drawer" @close="close" :direction="direction" size="50%">
         <div class="content">
-
-
+            <el-row :gutter="20">
+                <el-col :span="12">
+                    名称:{{ liveData.material?.name }}
+                </el-col>
+                <el-col :span="12">
+                    规格:{{ liveData.material?.materialSpec }}
+                </el-col>
+
+                <el-col :span="12">
+                    编号{{ liveData.materialSku?.skuCode }}
+                </el-col>
+                <el-col :span="12">
+                    分类:{{ liveData.materialCategory?.name }}
+                </el-col>
+            </el-row>
+            <p>OMS登记环节</p>
+            <by-table :propConfig="tableConfig1" ref="table1" />
+            <p>WMS仓储环节</p>
+            <by-table :propConfig="tableConfig1" ref="table2" />
+            <p>WMS物流运算环节</p>
+            <by-table :propConfig="tableConfig1" ref="table3" />
         </div>
     </el-drawer>
 </template>
 
 <script lang="ts">
 import { Component, Prop, Vue, Watch } from "vue-property-decorator";
-
+import api from "@/api/currency";
 
 @Component({ components: {} })
 export default class LiveView extends Vue {
     drawer = false;
     direction = 'rtl'
     data: any = {};
+    liveData: any = {};
     isSuccess = false;
     load = false;
+    tableConfig1: any = {
+        attr: {
+            size: 'mini',
+            align: 'left',
+            seq: true
+        },
+        columns: [{
+            title: '事项',
+            field: 'matter'
+        }, {
+            title: '操作人',
+            field: 'operator'
+        }, {
+            title: '时间',
+            field: 'time',
+        }]
+    }
     setShow(v: boolean) {
         this.drawer = v;
     }
-    setItem(data: any) {
+    async setItem(data: any) {
         this.data = data
-        console.info('data', data, this.data)
+        //console.info('data', data, this.data)
+        const res = await api.showLifeCycle({ id: this.data.id })
+        if (res.code === 200) {
+            this.liveData = res.data;
+            (this.$refs.table2 as any).setValue(this.liveData.warehousingList);
+            (this.$refs.table3 as any).setValue(this.liveData.logisticsList);
+        } else {
+            this.$message.error(res.msg)
+        }
     }
     close() {
         if (this.isSuccess) {

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

@@ -62,7 +62,12 @@
         {{ getFromText(row.operationFlag) }}
       </template>
     </vxe-column>
-    <vxe-column field="orderTimeout" title="待处理时长" width="110"></vxe-column>
+    <vxe-column field="orderTimeout" title="待处理时长" width="110">
+      <template #default="{ row }">
+        <span v-if="row.isOrderTimeout" style="color:red">{{ row.orderTimeout }}</span>
+        <span v-else="row.isOrderTimeout">{{ row.orderTimeout }}</span>
+      </template>
+    </vxe-column>
     <vxe-column field="shopName" title="店铺名称" width="140"></vxe-column>
     <vxe-column field="orderDate" title="订单日期" width="140">
       <!-- <template #default="{ row }">

+ 71 - 2
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>
@@ -210,8 +210,9 @@ import ExpressDeliveryModal from "./components/expressDeliveryModal.vue";
 import ImportExcelModel from "./components/importExcelModal.vue";
 import autoSplit from './components/autoSplit.vue'
 import AutoAudit from './components/autoAudit.vue'
-import { query, getProvince, smt, unSmt, purchaseQty, unCancel, resetQuestion, archive, merge, queryTimeOut, queryByBarCode, autoAudit } from '@/api/omsOrder'
+import { query, getProvince, smt, unSmt, purchaseQty, unCancel, resetQuestion, archive, merge, queryTimeOut, queryByBarCode, autoAudit, tipOrderTimeOut } from '@/api/omsOrder'
 import { queryAll } from '@/api/question'
+import { IOrderTimeConfigItem, IOrderTimeResponse, queryOrderTimeConfig } from "@/api/orderConfig";
 @Component({
   components: {
     filterInput, OrderCheckbox, OrderRadio, filterDate, OrderTool, OrderTable, AddOrder, InputSelect, OrderProduct,
@@ -510,11 +511,16 @@ export default class Order extends Vue {
   //省份
   provinceOptions: Array<any> = []
 
+  //订单超时配置
+  orderTimeConfigOptions: IOrderTimeConfigItem[] = []
+
   mounted() {
     this.getList();
     this.getProvince();
     this.getQuestionList();
     this.getQuesttion();
+    this.getOrderTimeOutList();
+    this.tipOrderTimeOut();
   }
   //自动拆分
   autoSplit() {
@@ -1181,6 +1187,7 @@ export default class Order extends Vue {
       this.page.pageNo = res.data.current;
       this.page.total = res.data.total;
       this.load = false;
+      this.handleTimeOutData();
       this.$forceUpdate();
     }).catch((err: any) => {
       this.load = false;
@@ -1214,6 +1221,7 @@ export default class Order extends Vue {
       this.page.pageNo = res.data.current;
       this.page.total = res.data.total;
       this.load = false;
+      this.handleTimeOutData();
       this.$forceUpdate();
     }).catch((err: any) => {
       this.load = false;
@@ -1336,6 +1344,67 @@ export default class Order extends Vue {
     (this.$refs.loadOrder as any).setShow(true);
   }
 
+  //获得订单超时设置
+  getOrderTimeOutList() {
+    this.load = true;
+    queryOrderTimeConfig({ pageSize: 20, pageNum: 1 }).then(res => {
+      if (res.code === 200) {
+        this.orderTimeConfigOptions = res.rows
+      }
+    })
+  }
+
+  //处理超时数据
+  handleTimeOutData() {
+    if (this.orderTimeConfigOptions.length == 0) return;
+    //遍历this.data
+    for (let i = 0; i < this.data.length; i++) {
+      if (!this.data[i].orderTimeout) continue;
+      //orderTimeout属性YYYY-MM-DD HH:mm:ss和当前时间比较,返回相差多少小时多少分钟,如:超时2小时23分
+      let time = this.data[i].orderTimeout.split(' ');
+      let date = time[0];
+      let time1 = time[1];
+      let date1 = date.split('-');
+      let time2 = time1.split(':');
+      let date2 = new Date();
+      date2.setFullYear(parseInt(date1[0]));
+      date2.setMonth(parseInt(date1[1]) - 1);
+      date2.setDate(parseInt(date1[2]));
+      date2.setHours(parseInt(time2[0]));
+      date2.setMinutes(parseInt(time2[1]));
+      date2.setSeconds(parseInt(time2[2]));
+      let diff = date2.getTime() - new Date().getTime();
+      let diffHour = diff / 1000 / 60 / 60;
+      if (diffHour < 0) {
+        //diffHour保留两位小数
+        let out = Math.abs(Math.round(diffHour * 100)) / 100;
+        //计算分钟,取整
+        let outMin = Math.abs(Math.round(diff / 1000 / 60)) % 60;
+        //out取整
+        out = Math.floor(out);
+
+        this.data[i].orderTimeout = "超时" + out + "小时" + outMin + "分";
+        if (out >= this.orderTimeConfigOptions[0].timeout!) {
+          this.data[i].isOrderTimeout = true;
+        }
+      }
+    }
+    this.$forceUpdate();
+  }
+
+  //提示超时订单
+  tipOrderTimeOut() {
+    tipOrderTimeOut({ pageSize: 20, pageNum: 1 }).then(res => {
+      if (res.code === 200) {
+        if (res.total === 0) return;
+        this.$notify.error({
+          title: '提示',
+          message: '有' + res.total + '条订单处理超时,请及时查看!',
+          position: 'bottom-right'
+        });
+      }
+    })
+  }
 }
 </script>
 

+ 27 - 8
src/views/orderConfig/orderTimeConfig/compoments/addConfig.vue

@@ -13,9 +13,10 @@
 
 <script lang="ts">
 import { Component, Prop, Vue, Watch } from "vue-property-decorator";
-import { addOrderTimeConfig } from '@/api/orderConfig'
+import { addOrderTimeConfig, updateOrderTimeConfig } from '@/api/orderConfig'
 @Component({ components: {} })
 export default class AddQuestModel extends Vue {
+    timerId: number = 0;
     value = false;
     load = false;
     config: any = {
@@ -49,19 +50,37 @@ export default class AddQuestModel extends Vue {
     setShow(v: boolean) {
         this.value = v;
     }
+    setValue(v: any) {
+        this.timerId = v.id;
+        (this.$refs.form as any).setValue(v);
+        console.log(this.timerId)
+    }
+    getValue() {
+        return (this as any).$lodash.cloneDeep(this.value);
+    }
     btn() {
         (this.$refs.form as any).validate({ noMsg: true }).then(() => {
             let data = (this.$refs.form as any).getValue() as { timeout: number };
             data.timeout = Number(data.timeout);
             //data.isSystem = this.isSystem;
             this.load = true;
-            addOrderTimeConfig(data).then(() => {
-                this.load = false;
-                this.$emit('handleSuccess');
-                this.value = false;
-            }).catch(() => {
-                this.load = false;
-            })
+            if (this.timerId === 0) {
+                addOrderTimeConfig({ timeout: data.timeout }).then(() => {
+                    this.load = false;
+                    this.$emit('handleSuccess');
+                    this.value = false;
+                }).catch(() => {
+                    this.load = false;
+                })
+            } else {
+                updateOrderTimeConfig({ id: this.timerId, timeout: data.timeout }).then(() => {
+                    this.load = false;
+                    this.$emit('handleSuccess');
+                    this.value = false;
+                }).catch(() => {
+                    this.load = false;
+                })
+            }
         }).catch(() => { })
     }
 }

+ 31 - 0
src/views/orderConfig/orderTimeConfig/index.vue

@@ -21,6 +21,7 @@ import { queryOrderTimeConfig, IOrderTimeConfigItem, IOrderTimeConfigRequest, IO
 import addConfig from './compoments/addConfig.vue';
 @Component({ components: { addConfig } })
 export default class OrderConfig extends Vue {
+    timer: any = null
     isHasOne = false;//是否有一条数据
     userInfo: any = {};
     tool = {
@@ -62,6 +63,21 @@ export default class OrderConfig extends Vue {
                         this.delHandle(row);
                     }
                 }
+            }, {
+                name: '修改',
+                event: {
+                    show: () => {
+                        let userInfo = this.$store.getters.userInfo;
+                        if (userInfo && userInfo.userName == 'admin') {
+                            return true
+                        } else {
+                            return false
+                        }
+                    },
+                    click: (row: any) => {
+                        this.updateHandle(row);
+                    }
+                }
             }]
         }]
     }
@@ -88,6 +104,9 @@ export default class OrderConfig extends Vue {
                 return;
             }
             (this.$refs.addConfig as any).setShow(true)
+            this.timer = setTimeout(() => {
+                (this.$refs.addConfig as any).setValue({ id: 0, timeout: '' });
+            }, 100);
         }
         if (e == 'onRefresh') {
             this.getList();
@@ -112,6 +131,15 @@ export default class OrderConfig extends Vue {
         this.getList();
     }
 
+    async updateHandle(row: any) {
+        //console.info(row.timeout)
+        (this.$refs.addConfig as any).setShow(true);
+        this.timer = setTimeout(() => {
+            (this.$refs.addConfig as any).setValue({ id: row.id, timeout: row.timeout });
+        }, 100)
+        //
+    }
+
     created() {
         this.userInfo = this.$store.getters.userInfo;
     }
@@ -120,6 +148,9 @@ export default class OrderConfig extends Vue {
             this.getList()
         })
     }
+    unmounted() {
+        clearTimeout(this.timer);
+    }
 }
 </script>
 

+ 1 - 7
src/views/waterShop/waterShop/index.vue

@@ -4,13 +4,7 @@
             @clickHandle="clickHandle" id="configTool" /> -->
         <!-- <module-view :propConfig="config" ref="view" @pagination="getList" @onRefresh="getList" /> -->
         <el-button type="default" @click="uploadWaterShop" size="small" style="margin-bottom: 10px;">同步店铺</el-button>
-        <by-table :propConfig="tableConfig" ref="table">
-            <template v-slot:ordered="{ row }">
-                <vxe-input v-if="userInfo && userInfo.userName == 'admin'" v-model="row.ordered" size="small"
-                    type="number"></vxe-input>
-                <span v-else>{{ row.ordered }}</span>
-            </template>
-        </by-table>
+        <by-table :propConfig="tableConfig" ref="table" />
     </div>
 
 </template>