- poster
This commit is contained in:
@@ -53,14 +53,14 @@ export default defineComponent({
|
||||
|
||||
const site = ref(globalStore.site)
|
||||
|
||||
const myorder = reactive(<IOrder>{
|
||||
let myorder = reactive(<IOrder>{
|
||||
idapp: process.env.APP_ID,
|
||||
quantity: 0,
|
||||
quantitypreordered: 0,
|
||||
idStorehouse: '',
|
||||
idGasordine: '',
|
||||
storehouse: {},
|
||||
gasordine: {},
|
||||
gasordine: {active: false},
|
||||
})
|
||||
|
||||
const storeSelected = ref('')
|
||||
@@ -148,8 +148,22 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
function initproduct() {
|
||||
|
||||
myorder.quantity = 0
|
||||
myorder.quantitypreordered = 0
|
||||
myorder.idStorehouse = ''
|
||||
myorder.idGasordine = ''
|
||||
|
||||
gasordineSelected.value = ''
|
||||
recgasordineSelected.value = null
|
||||
|
||||
}
|
||||
|
||||
function updateproduct() {
|
||||
|
||||
myproduct.value = products.getProductById(props.id)
|
||||
|
||||
// products.updateQuantityAvailable(myproduct.value._id)
|
||||
}
|
||||
|
||||
@@ -231,9 +245,16 @@ export default defineComponent({
|
||||
})
|
||||
|
||||
function updateLabel() {
|
||||
//labelDataRitiro.value = tools.getstrDateTime(recgasordineSelected.value.dataora_ritiro)
|
||||
labelDataArrivoMerce.value = tools.getstrDateShort(recgasordineSelected.value.data_arrivo_merce)
|
||||
labelDataRitiro.value = tools.getstrDateTime(recgasordineSelected.value.dataora_ritiro)
|
||||
if (recgasordineSelected.value) {
|
||||
//labelDataRitiro.value = tools.getstrDateTime(recgasordineSelected.value.dataora_ritiro)
|
||||
if (recgasordineSelected.value.data_arrivo_merce)
|
||||
labelDataArrivoMerce.value = tools.getstrDateShort(recgasordineSelected.value.data_arrivo_merce)
|
||||
if (recgasordineSelected.value.dataora_ritiro)
|
||||
labelDataRitiro.value = tools.getstrDateTime(recgasordineSelected.value.dataora_ritiro)
|
||||
} else {
|
||||
labelDataArrivoMerce.value = ''
|
||||
labelDataRitiro.value = ''
|
||||
}
|
||||
}
|
||||
|
||||
function mounted() {
|
||||
@@ -260,6 +281,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function load() {
|
||||
initproduct()
|
||||
updateproduct()
|
||||
// console.log('Load', myproduct.value.name)
|
||||
// console.log('created Cproductcard', code)
|
||||
@@ -275,7 +297,7 @@ export default defineComponent({
|
||||
if (myproduct.value.gasordines && myproduct.value.gasordines.length === 1) {
|
||||
myorder.idGasordine = myproduct.value.gasordines[0]._id
|
||||
gasordineSelected.value = myorder.idGasordine!
|
||||
}
|
||||
}
|
||||
|
||||
const ord = products.getOrderProductInCart(myproduct.value._id)
|
||||
if (ord) {
|
||||
@@ -285,7 +307,6 @@ export default defineComponent({
|
||||
if (ord.idGasordine) {
|
||||
gasordineSelected.value = ord.idGasordine!
|
||||
recgasordineSelected.value = myproduct.value.gasordines.find((rec: IGasordine) => rec._id === ord.idGasordine!)
|
||||
updateLabel()
|
||||
}
|
||||
|
||||
// Seleziona il Negozio che avevo già scelto nell'ordine !
|
||||
@@ -296,11 +317,12 @@ export default defineComponent({
|
||||
|
||||
if (gasordineSelected.value) {
|
||||
recgasordineSelected.value = myproduct.value.gasordines.find((rec: IGasordine) => rec._id === gasordineSelected.value)
|
||||
updateLabel()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
updateLabel()
|
||||
|
||||
// console.log('°°° ENDLOAD °°°')
|
||||
endload.value = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user