ソースを参照

Fix made to bids screen

master
George Williams 4年前
コミット
e429d504ed
2個のファイルの変更59行の追加57行の削除
  1. 39
    41
      src/components/processFlow/makeOffer.vue
  2. 20
    16
      src/store/modules/processFlow/bid.js

+ 39
- 41
src/components/processFlow/makeOffer.vue ファイルの表示

10
         class="btn btn-b-n"
10
         class="btn btn-b-n"
11
         style="width: 150px; height:40px;"
11
         style="width: 150px; height:40px;"
12
         data-dismiss="modal"
12
         data-dismiss="modal"
13
-      >
14
-        OK
15
-      </button>
13
+      >OK</button>
16
     </div>
14
     </div>
17
     <div v-else>
15
     <div v-else>
18
       <div v-if="!isSaved">
16
       <div v-if="!isSaved">
84
       <div v-if="!isSaved" class="container">
82
       <div v-if="!isSaved" class="container">
85
         <div class="row">
83
         <div class="row">
86
           <div algin="center" class="col">
84
           <div algin="center" class="col">
87
-            <button v-if="isMakeOffer" type="button" @click="SendOffer()" class="btn-solid-blue">
88
-              Send Offer
89
-            </button>
85
+            <button
86
+              v-if="isMakeOffer"
87
+              type="button"
88
+              @click="SendOffer()"
89
+              class="btn-solid-blue"
90
+            >Send Offer</button>
90
             <button
91
             <button
91
               v-if="!isMakeOffer && !isDecline && canEdit"
92
               v-if="!isMakeOffer && !isDecline && canEdit"
92
               type="submit"
93
               type="submit"
93
               @click="Accept()"
94
               @click="Accept()"
94
               class="btn btn-b-n"
95
               class="btn btn-b-n"
95
               style="width: 150px; height:40px;"
96
               style="width: 150px; height:40px;"
96
-            >
97
-              Accept
98
-            </button>
97
+            >Accept</button>
99
             <button
98
             <button
100
               v-if="!isMakeOffer && !isDecline && canEdit"
99
               v-if="!isMakeOffer && !isDecline && canEdit"
101
               type="button"
100
               type="button"
102
               @click="Decline()"
101
               @click="Decline()"
103
               class="btn btn-b-n"
102
               class="btn btn-b-n"
104
               style="width: 150px; height:40px;"
103
               style="width: 150px; height:40px;"
105
-            >
106
-              Decline
107
-            </button>
104
+            >Decline</button>
108
           </div>
105
           </div>
109
         </div>
106
         </div>
110
       </div>
107
       </div>
126
         @click="Complete()"
123
         @click="Complete()"
127
         class="btn btn-b-n"
124
         class="btn btn-b-n"
128
         style="width: 150px; height:40px;"
125
         style="width: 150px; height:40px;"
129
-      >
130
-        Complete
131
-      </button>
126
+      >Complete</button>
132
       <div v-if="isSaved">
127
       <div v-if="isSaved">
133
         <div class="form-group row">
128
         <div class="form-group row">
134
           <br />
129
           <br />
142
           class="btn btn-b-n"
137
           class="btn btn-b-n"
143
           style="width: 150px; height:40px;"
138
           style="width: 150px; height:40px;"
144
           data-dismiss="modal"
139
           data-dismiss="modal"
145
-        >
146
-          OK
147
-        </button>
140
+        >OK</button>
148
       </div>
141
       </div>
149
     </div>
142
     </div>
150
   </div>
143
   </div>
163
     canEdit: Boolean,
156
     canEdit: Boolean,
164
     item: Object,
157
     item: Object,
165
     bidId: Number,
158
     bidId: Number,
166
-    updateItem: Function
159
+    updateItem: Function,
167
   },
160
   },
168
   data() {
161
   data() {
169
     return {
162
     return {
171
       isSaved: false,
164
       isSaved: false,
172
       message: "",
165
       message: "",
173
       isInfo: true,
166
       isInfo: true,
174
-      isLoggedIn: Log.isLoggedIn()
167
+      isLoggedIn: Log.isLoggedIn(),
175
     };
168
     };
176
   },
169
   },
177
   methods: {
170
   methods: {
178
-    ...mapActions("bid", ["getBid", "saveBid", "acceptBid", "declineBid"]),
171
+    ...mapActions("bid", ["getTemplate", "saveBid", "acceptBid", "declineBid"]),
179
     SendOffer() {
172
     SendOffer() {
180
-      alert("Under Development");
181
-      // this.getBid(0);
182
-      // this.bidItem.id = 0;
183
-      // this.bidItem.amount = this.item.offer;
184
-      // this.bidItem.comment = this.item.comment;
185
-      // if (this.isProperty) {
186
-      //   this.bidItem.propertyId = this.item.id;
187
-      // } else {
188
-      //   this.bidItem.timeshareWeekId = this.item.id;
189
-      // }
190
-      // this.saveBid(this.bidItem);
173
+      //alert("Under Development");
174
+      this.bidItem.id = 0;
175
+
176
+      this.bidItem.amount = this.item.offer;
177
+      this.bidItem.comment = this.item.comment;
178
+      if (this.isProperty) {
179
+        this.bidItem.propertyId = this.item.id;
180
+      } else {
181
+        this.bidItem.timeshareWeekId = this.item.id;
182
+        if (this.item.isTender) {
183
+          this.bidItem.tenderWeek = this.item;
184
+        }
185
+      }
186
+      this.saveBid(this.bidItem);
191
 
187
 
192
-      // this.item = [];
193
-      // this.isSaved = true;
194
-      // this.message = "Offer was submitted.";
195
-      // this.isInfo = true;
188
+      this.isSaved = true;
189
+      this.isInfo = true;
190
+      this.message = "Offer was submitted.";
196
     },
191
     },
197
     Accept() {
192
     Accept() {
198
       this.acceptBid(this.item.id);
193
       this.acceptBid(this.item.id);
208
 
203
 
209
       const decline = {
204
       const decline = {
210
         id: this.item.id,
205
         id: this.item.id,
211
-        comment: this.item.declineReason
206
+        comment: this.item.declineReason,
212
       };
207
       };
213
 
208
 
214
       this.declineBid(decline);
209
       this.declineBid(decline);
215
       this.isSaved = true;
210
       this.isSaved = true;
216
       this.message = "Offer Declined.";
211
       this.message = "Offer Declined.";
217
       this.isInfo = false;
212
       this.isInfo = false;
218
-    }
213
+    },
219
   },
214
   },
220
   computed: {
215
   computed: {
221
-    ...mapState("bid", ["bidIt,em"])
216
+    ...mapState("bid", ["bidItem"]),
217
+  },
218
+  mounted() {
219
+    this.getTemplate();
222
   },
220
   },
223
   watch: {
221
   watch: {
224
     item() {
222
     item() {
225
       this.isSaved = false;
223
       this.isSaved = false;
226
       this.canEdit = this.item.statusCode === "E1";
224
       this.canEdit = this.item.statusCode === "E1";
227
-    }
228
-  }
225
+    },
226
+  },
229
 };
227
 };
230
 </script>
228
 </script>
231
 
229
 

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

1
-import axios from 'axios';
2
-import log from '../../../assets/Log';
1
+import axios from "axios";
2
+import log from "../../../assets/Log";
3
+import { result } from "lodash";
3
 
4
 
4
 export default {
5
 export default {
5
   namespaced: true,
6
   namespaced: true,
6
   state: {
7
   state: {
7
     bidItem: {},
8
     bidItem: {},
8
-    bidItems: [],
9
+    bidItems: []
9
   },
10
   },
10
   mutations: {
11
   mutations: {
11
     setBid(state, bid) {
12
     setBid(state, bid) {
20
     updateBidList(state, bid) {
21
     updateBidList(state, bid) {
21
       state.bidItems.find(item => item.id === bid.id).status = bid.status;
22
       state.bidItems.find(item => item.id === bid.id).status = bid.status;
22
       console.log(JSON.stringify(bid));
23
       console.log(JSON.stringify(bid));
23
-    },
24
+    }
24
   },
25
   },
25
   getters: {},
26
   getters: {},
26
   actions: {
27
   actions: {
28
+    getTemplate({ commit }) {
29
+      axios.get("/api/bid/GetNewBidTemplate").then(result => commit("setBid", result.data));
30
+    },
27
     getBid({ commit }, id) {
31
     getBid({ commit }, id) {
28
       axios
32
       axios
29
         .get(`/api/bid/${id}`)
33
         .get(`/api/bid/${id}`)
30
-        .then(result => commit('addToBids', result.data))
34
+        .then(result => commit("addToBids", result.data))
31
         .catch(console.error);
35
         .catch(console.error);
32
     },
36
     },
33
     getBids({ commit }) {
37
     getBids({ commit }) {
34
       axios
38
       axios
35
-        .get('/api/bid/GetBids/All')
36
-        .then(result => commit('setBids', result.data))
39
+        .get("/api/bid/GetBids/All")
40
+        .then(result => commit("setBids", result.data))
37
         .catch(console.error);
41
         .catch(console.error);
38
     },
42
     },
39
     saveBid({ commit }, item) {
43
     saveBid({ commit }, item) {
42
       }
46
       }
43
       console.log(JSON.stringify(item));
47
       console.log(JSON.stringify(item));
44
       axios
48
       axios
45
-        .post('/api/bid', item)
46
-        .then(result => commit('setBid', result.data))
49
+        .post("/api/bid", item)
50
+        .then(result => commit("setBid", result.data))
47
         .catch(console.error);
51
         .catch(console.error);
48
     },
52
     },
49
     updateBid({ commit }, item) {
53
     updateBid({ commit }, item) {
50
       axios
54
       axios
51
-        .put('/api/bid', item)
52
-        .then(result => commit('setBid', item))
55
+        .put("/api/bid", item)
56
+        .then(result => commit("setBid", item))
53
         .catch(console.error);
57
         .catch(console.error);
54
     },
58
     },
55
     acceptBid({ commit }, id) {
59
     acceptBid({ commit }, id) {
56
       axios
60
       axios
57
         .put(`/api/bid/AcceptBid/${id}`)
61
         .put(`/api/bid/AcceptBid/${id}`)
58
-        .then(result => commit('updateBidList', result.data))
62
+        .then(result => commit("updateBidList", result.data))
59
         .catch(console.error);
63
         .catch(console.error);
60
     },
64
     },
61
     declineBid({ commit }, item) {
65
     declineBid({ commit }, item) {
62
       axios
66
       axios
63
-        .put('/api/bid/DeclineBid', item)
64
-        .then(result => commit('updateBidList', result.data))
67
+        .put("/api/bid/DeclineBid", item)
68
+        .then(result => commit("updateBidList", result.data))
65
         .catch(console.error);
69
         .catch(console.error);
66
-    },
67
-  },
70
+    }
71
+  }
68
 };
72
 };

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