- aggiunto bottone per Confermare tutti gli ordini

- 1 bottone per Consegnare e Pagare
This commit is contained in:
Surya Paolo
2024-02-16 14:11:12 +01:00
parent a82e07b4ce
commit 26e17f3398
4 changed files with 140 additions and 26 deletions

View File

@@ -785,8 +785,10 @@ export const useProducts = defineStore('Products', {
return ris
},
getOptions() {
return {}
getOptions(sendmail: boolean) {
return {
sendmail
}
},
async CreateOrdersCart({ cart_id, status, note }: { cart_id: string, status: number, note: string }) {
@@ -802,7 +804,7 @@ export const useProducts = defineStore('Products', {
let ris = null
ris = await Api.SendReq('/cart/' + this.userActive._id + '/createorderscart', 'POST', { cart_id, status, note, options: this.getOptions() })
ris = await Api.SendReq('/cart/' + this.userActive._id + '/createorderscart', 'POST', { cart_id, status, note, options: this.getOptions(true) })
.then((res) => {
if (res.data.status === shared_consts.OrderStatus.CHECKOUT_SENT) {
@@ -823,7 +825,7 @@ export const useProducts = defineStore('Products', {
return ris
},
async UpdateStatusCart({ ordercart_id, status }: { ordercart_id: string, status: number }) {
/*async UpdateStatusCart({ ordercart_id, status }: { ordercart_id: string, status: number }) {
const userStore = useUserStore()
const globalStore = useGlobalStore()
@@ -850,11 +852,9 @@ export const useProducts = defineStore('Products', {
})
return ris
},
},*/
async UpdateOrderCartStatus({ order_id, status }: { order_id: string, status: number }) {
async UpdateOrderCartStatus({ order_id, status, sendmail }: { order_id: string, status: number, sendmail: boolean }) {
const userStore = useUserStore()
const globalStore = useGlobalStore()
@@ -864,7 +864,7 @@ export const useProducts = defineStore('Products', {
let ris = null
ris = await Api.SendReq('/cart/' + this.userActive._id + '/ordercartstatus', 'POST', { order_id, status, options: this.getOptions() })
ris = await Api.SendReq('/cart/' + this.userActive._id + '/ordercartstatus', 'POST', { order_id, status, options: this.getOptions(sendmail) })
.then((res) => {
this.updateDataProduct(res)