ソースを参照

Fix to bids call.

master
George Williams 4年前
コミット
c0b51442ba
2個のファイルの変更18行の追加8行の削除
  1. 15
    6
      src/components/processFlow/offers.vue
  2. 3
    2
      src/store/modules/processFlow/bid.js

+ 15
- 6
src/components/processFlow/offers.vue ファイルの表示

@@ -48,6 +48,7 @@
48 48
 import { mapState, mapActions } from "vuex";
49 49
 import makeOffer from "./makeOffer.vue";
50 50
 import listView from "../shared/listView.vue";
51
+import Log from "../../assets/Log";
51 52
 
52 53
 export default {
53 54
   name: "offers",
@@ -55,9 +56,17 @@ export default {
55 56
   data() {
56 57
     return {
57 58
       item: {},
58
-      columns: ["date", "type", "shortDescription", "status", "price", "offer", "madeBy"],
59
+      columns: [
60
+        "date",
61
+        "type",
62
+        "shortDescription",
63
+        "status",
64
+        "price",
65
+        "offer",
66
+        "madeBy",
67
+      ],
59 68
       formats: ["date", "text", "text", "text", "money", "money", "text"],
60
-      columnHeaders: ["", "", "description", "", "", "offerPrice", "offerBy"]
69
+      columnHeaders: ["", "", "description", "", "", "offerPrice", "offerBy"],
61 70
     };
62 71
   },
63 72
   methods: {
@@ -67,13 +76,13 @@ export default {
67 76
 
68 77
       const element = this.$refs.MyModalForm;
69 78
       $(element).modal("show");
70
-    }
79
+    },
71 80
   },
72 81
   computed: {
73
-    ...mapState("bid", ["bidItems"])
82
+    ...mapState("bid", ["bidItems"]),
74 83
   },
75 84
   mounted() {
76
-    this.getBids();
77
-  }
85
+    this.getBids(Log.getUser().username);
86
+  },
78 87
 };
79 88
 </script>

+ 3
- 2
src/store/modules/processFlow/bid.js ファイルの表示

@@ -14,6 +14,7 @@ export default {
14 14
     },
15 15
     setBids(state, bid) {
16 16
       state.bidItems = bid;
17
+      alert(JSON.stringify(bid));
17 18
     },
18 19
     addToBids(state, bid) {
19 20
       state.bidItems.push(bid);
@@ -34,9 +35,9 @@ export default {
34 35
         .then(result => commit("addToBids", result.data))
35 36
         .catch(console.error);
36 37
     },
37
-    getBids({ commit }) {
38
+    getBids({ commit }, username) {
38 39
       axios
39
-        .get("/api/bid/GetBids/All")
40
+        .get(`/api/bid/GetBids/${username}`)
40 41
         .then(result => commit("setBids", result.data))
41 42
         .catch(console.error);
42 43
     },

読み込み中…
キャンセル
保存