George Williams 4 лет назад
Родитель
Сommit
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
 import { mapState, mapActions } from "vuex";
48
 import { mapState, mapActions } from "vuex";
49
 import makeOffer from "./makeOffer.vue";
49
 import makeOffer from "./makeOffer.vue";
50
 import listView from "../shared/listView.vue";
50
 import listView from "../shared/listView.vue";
51
+import Log from "../../assets/Log";
51
 
52
 
52
 export default {
53
 export default {
53
   name: "offers",
54
   name: "offers",
55
   data() {
56
   data() {
56
     return {
57
     return {
57
       item: {},
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
       formats: ["date", "text", "text", "text", "money", "money", "text"],
68
       formats: ["date", "text", "text", "text", "money", "money", "text"],
60
-      columnHeaders: ["", "", "description", "", "", "offerPrice", "offerBy"]
69
+      columnHeaders: ["", "", "description", "", "", "offerPrice", "offerBy"],
61
     };
70
     };
62
   },
71
   },
63
   methods: {
72
   methods: {
67
 
76
 
68
       const element = this.$refs.MyModalForm;
77
       const element = this.$refs.MyModalForm;
69
       $(element).modal("show");
78
       $(element).modal("show");
70
-    }
79
+    },
71
   },
80
   },
72
   computed: {
81
   computed: {
73
-    ...mapState("bid", ["bidItems"])
82
+    ...mapState("bid", ["bidItems"]),
74
   },
83
   },
75
   mounted() {
84
   mounted() {
76
-    this.getBids();
77
-  }
85
+    this.getBids(Log.getUser().username);
86
+  },
78
 };
87
 };
79
 </script>
88
 </script>

+ 3
- 2
src/store/modules/processFlow/bid.js Просмотреть файл

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

Загрузка…
Отмена
Сохранить