From 0769d4d67cda63676a3ccf6446e9f3280a9d52b4 Mon Sep 17 00:00:00 2001 From: Aqqil Azman Date: Thu, 25 Jul 2024 14:58:17 +0800 Subject: [PATCH] changed create_login_issue_remark_api into create_issue_remark --- .../AdminWorkFlowSectionComponent.vue | 57 +++++++++++-------- 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/resources/assets/vue/components/general/sections/AdminWorkFlowSectionComponent.vue b/resources/assets/vue/components/general/sections/AdminWorkFlowSectionComponent.vue index a5a4d276..ee00ee1f 100644 --- a/resources/assets/vue/components/general/sections/AdminWorkFlowSectionComponent.vue +++ b/resources/assets/vue/components/general/sections/AdminWorkFlowSectionComponent.vue @@ -346,11 +346,11 @@ export default { }, "1688_issue_order": { "answers": [ - { "text": "Amount not found", "next": "1688_issue_submit" }, - { "text": "Plus Member", "next": "1688_issue_submit" }, - { "text": "Others", "next": "1688_issue_others" }, - { "text": "Customer Did not verify 1688 account", "next": "1688_issue_submit" }, - { "text": "WorldFirst account linked another account", "next": "1688_issue_submit" }, + { "text": "Amount not found", "next": "Amount not found" }, + { "text": "Plus Member", "next": "Plus Member" }, + { "text": "Others", "next": "Others" }, + { "text": "Customer did not verify 1688 account", "next": "Customer did not verify 1688 account" }, + { "text": "WorldFirst account linked another account", "next": "WorldFirst account linked another account" }, ] }, "order_verify": { @@ -378,7 +378,7 @@ export default { "answers": [ { "text": "Wrong Pin Number", "next": "Wrong Pin Number" }, { "text": "Not Enough Stock", "next": "Not Enough Stock" }, - { "text": "Others", "next": "1688_issue_others" }, + { "text": "Others", "next": "Others" }, { "text": "No CrossBoarder", "next": "No CrossBoarder" }, { "text": "AngPau", "next": "AngPau" } ] @@ -459,8 +459,8 @@ export default { }, "issue_po": { "answers": [ - { "text": "Sensitive Goods", "next": "issue_submit" }, - { "text": "Others", "next": "po_others" }, + { "text": "Sensitive Goods", "next": "Sensitive Goods" }, + { "text": "Others", "next": "PO Others" }, { "text": "Stop Working", "next": "stop_working" }, { "text": "Next PO", "next": "approve_po" } ] @@ -525,33 +525,42 @@ export default { endWork() { this.stopTimer(); console.log("work is ended"); }, selectAnswer(nextQuestionId, goBack = false) { if (nextQuestionId === 'refresh_page') return window.location.reload(); - if (this.currentQuestionId === 'login_issue' || this.currentQuestionId === '1688_order_issue') { - if (nextQuestionId === 'refund_request') { - this.callApi(this.route('api.admin_work_flow.create_1688_login_issue_remark'), 'post', 'section', { - 'booking_id': this.currentOrder.booking_id, + if (this.currentQuestionId === 'issue_po') { + if (nextQuestionId === 'po_others') { + this.callApi(this.route('api.admin_work_flow.create_po_issue_remark'), 'post', 'section', { + 'marking': this.currentOrder.marking, + 'remark': 'PO Others', + 'user_id': this.$store.getters.getUserId, + }, false, false); + } else { + this.callApi(this.route('api.admin_work_flow.create_po_issue_remark'), 'post', 'section', { + 'marking': this.currentOrder.marking, 'remark': nextQuestionId, 'user_id': this.$store.getters.getUserId, }, false, false); + nextQuestionId = 'issue_submit'; + } + } + + if (this.currentQuestionId === 'login_issue' || this.currentQuestionId === '1688_issue_order' || this.currentQuestionId === '1688_order_issue') { + if (nextQuestionId === 'refund_request') { + this.callApi(this.route('api.admin_work_flow.create_issue_remark'), 'post', 'section', { + 'booking_id': this.currentOrder.booking_id, + 'remark': 'Order Cancelled', + 'user_id': this.$store.getters.getUserId, + }, false, false); nextQuestionId = 'refund_request'; } else if(nextQuestionId === '1688_issue_others') { - this.callApi(this.route('api.admin_work_flow.create_1688_login_issue_remark'), 'post', 'section', { + this.callApi(this.route('api.admin_work_flow.create_issue_remark'), 'post', 'section', { 'booking_id': this.currentOrder.booking_id, - 'remark': nextQuestionId, + 'remark': '1688 Others', 'user_id': this.$store.getters.getUserId, }, false, false); nextQuestionId = '1688_issue_others'; - } else if(nextQuestionId === 'po_others') { - this.callApi(this.route('api.admin_work_flow.create_approve_issue_remark'), 'post', 'section', { - 'booking_id': this.currentOrder.booking_id, - 'remark': nextQuestionId, - 'user_id': this.$store.getters.getUserId, - }, false, false); - nextQuestionId = 'po_others'; - } else { - this.callApi(this.route('api.admin_work_flow.create_1688_login_issue_remark'), 'post', 'section', { + this.callApi(this.route('api.admin_work_flow.create_issue_remark'), 'post', 'section', { 'booking_id': this.currentOrder.booking_id, 'remark': nextQuestionId, 'user_id': this.$store.getters.getUserId, @@ -606,7 +615,7 @@ export default { this.$store.dispatch('crudRequest', { endpoint: url, method, parameters: parameters }) .then(response => response.json().then(data => ({ data, ok: response.ok, status: response.status }))) .then(apiResponse => { - if (storeResponseBody) { + if (storeResponseBody) { this.externalApiResponse = apiResponse.data; }