戴艳蓉 il y a 3 ans
Parent
commit
6356ae1d35
3 fichiers modifiés avec 36 ajouts et 2 suppressions
  1. 2 2
      src/App.vue
  2. 26 0
      src/mock/modules/stock.js
  3. 8 0
      src/mock/service/stock/stockWarning/index.js

+ 2 - 2
src/App.vue

@@ -6,7 +6,7 @@
 
 <script>
 import { JudgeEnvironment } from "@/utils/validate";
-import asyncRequest from "@/mock/service/stock/survey";
+import asyncRequest from "@/mock/service/stock/stockWarning";
 import { getCode } from "@/utils/dingding";
 export default {
   name: "App",
@@ -16,7 +16,7 @@ export default {
     };
   },
   async created() {
-    const res = await asyncRequest.log(this.parmValue);
+    const res = await asyncRequest.list(this.parmValue);
     console.log(res);
     // if (res && res.code === 0 && res.data) {
     //   this.tableData = res.data.list;

+ 26 - 0
src/mock/modules/stock.js

@@ -75,3 +75,29 @@ export function stockLog() {
 
 
 
+//库存预警列表
+export function orderWarnList() {
+  let model = JSON.parse(JSON.stringify(http)) 
+  let listModel= JSON.parse(JSON.stringify(list)) 
+  listModel.count = 100
+  listModel.list = []
+
+  for (let i = 0; i < 15; i++) {
+    listModel.list.push(Mock.mock({
+      orderNo: '@guid',//商品编号
+      'goods|1':  ['恰恰瓜子', '卫龙辣条', 'XX月饼', 'XX潮牌鞋', '可口可乐'],//商品名称
+      'attribute|1': ['红色-X码', '红色-m码', '红色-l码', '蓝色-l码', '蓝色-l码', '蓝色-l码', '整装'],//属性名称
+      'type|1': [ '潮牌', '休闲食品'],//分类
+      'unit|1': [ '件', '双', '袋', '盒', '桶'],//单位
+      "number|1-100":100,//可用库存
+      "warnNumber|1-50":50,//预警库存
+      addTime: '@datetime', //操作时间
+    }))
+  }
+  model.data = listModel
+  return {
+    url: 'stock/orderWarnList',
+    type: 'post',
+    data: model
+  }
+}

+ 8 - 0
src/mock/service/stock/stockWarning/index.js

@@ -0,0 +1,8 @@
+// 账号
+import http from '@/mock/axios'
+const api = 'stock/'
+export default {
+  // 分页查询
+  list:  (data, params) => http(api + 'orderWarnList', data, 'post', params),
+ 
+}