Poter inserire un Ordine anche per un altra persona... (Modalità Cassa)
This commit is contained in:
@@ -14,6 +14,7 @@ import { shared_consts } from '@src/common/shared_vuejs'
|
||||
|
||||
import { CSingleCart } from '../CSingleCart'
|
||||
import { CTitleBanner } from '@components'
|
||||
import { CSelectUserActive } from '@src/components/CSelectUserActive'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CCart',
|
||||
@@ -30,7 +31,7 @@ export default defineComponent({
|
||||
},
|
||||
|
||||
},
|
||||
components: { CSingleCart, CTitleBanner },
|
||||
components: { CSingleCart, CTitleBanner, CSelectUserActive },
|
||||
setup(props) {
|
||||
const userStore = useUserStore()
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<q-spinner v-if="!endload" color="primary" size="3em" :thickness="2" />
|
||||
<div v-if="endload">
|
||||
<CSelectUserActive></CSelectUserActive>
|
||||
<div v-if="recOrderCart" class="panel">
|
||||
<div>
|
||||
<div class="container">
|
||||
|
||||
@@ -258,7 +258,6 @@ export default defineComponent({
|
||||
|
||||
function updateLabel() {
|
||||
if (myproduct.value.gasordine) {
|
||||
//labelDataRitiro.value = tools.getstrDateTime(recgasordineSelected.value.dataora_ritiro)
|
||||
if (myproduct.value.gasordine.data_arrivo_merce)
|
||||
labelDataArrivoMerce.value = tools.getstrDateShort(myproduct.value.gasordine.data_arrivo_merce)
|
||||
if (myproduct.value.gasordine.dataora_ritiro)
|
||||
@@ -267,6 +266,7 @@ export default defineComponent({
|
||||
labelDataArrivoMerce.value = ''
|
||||
labelDataRitiro.value = ''
|
||||
}
|
||||
updateTimerLabel()
|
||||
}
|
||||
|
||||
function mounted() {
|
||||
|
||||
@@ -604,12 +604,12 @@
|
||||
</q-item-section>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item v-if="myproduct.gasordine && myproduct.gasordine.active">
|
||||
<q-item v-if="myproduct.gasordine && myproduct.gasordine.active && (myproduct.gasordine.dataora_chiusura_ordini || editOn)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="blue" name="fas fa-hourglass-half" />
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section v-if="!!myproduct.gasordine.dataora_chiusura_ordini">
|
||||
<q-item-section>
|
||||
<q-item-label class="countdown_scadenza">
|
||||
<span v-if="timerLabelScadenza">{{ timerLabelScadenza }}</span>
|
||||
<span v-else-if="isOrdineChiuso()">{{
|
||||
|
||||
0
src/components/CSelectUserActive/CSelectUserActive.scss
Executable file
0
src/components/CSelectUserActive/CSelectUserActive.scss
Executable file
26
src/components/CSelectUserActive/CSelectUserActive.ts
Executable file
26
src/components/CSelectUserActive/CSelectUserActive.ts
Executable file
@@ -0,0 +1,26 @@
|
||||
import { defineComponent, ref } from 'vue'
|
||||
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useProducts } from '@store/Products'
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CSelectUserActive',
|
||||
props: {
|
||||
},
|
||||
components: {},
|
||||
setup(props, { emit }) {
|
||||
const { t } = useI18n()
|
||||
|
||||
const userStore = useUserStore()
|
||||
const productStore = useProducts()
|
||||
|
||||
return {
|
||||
userStore,
|
||||
productStore,
|
||||
t,
|
||||
tools,
|
||||
}
|
||||
},
|
||||
})
|
||||
22
src/components/CSelectUserActive/CSelectUserActive.vue
Executable file
22
src/components/CSelectUserActive/CSelectUserActive.vue
Executable file
@@ -0,0 +1,22 @@
|
||||
<template>
|
||||
<q-select
|
||||
v-if="tools.isSeller() && productStore.userActive"
|
||||
v-model="productStore.userActive"
|
||||
:options="userStore.usersList"
|
||||
label="Spesa dell'Utente:"
|
||||
filled
|
||||
:bg-color="userStore.my._id !== productStore.userActive._id ? 'green' : undefined"
|
||||
:option-label="(opt) => tools.getNomeUtenteEUsernameByRecUser(opt)"
|
||||
option-value="null"
|
||||
emit-value
|
||||
map-options
|
||||
@update:model-value="productStore.changeuserActive(productStore.userActive)"
|
||||
>
|
||||
</q-select>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CSelectUserActive.ts">
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import './CSelectUserActive.scss';
|
||||
</style>
|
||||
1
src/components/CSelectUserActive/index.ts
Executable file
1
src/components/CSelectUserActive/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export {default as CSelectUserActive} from './CSelectUserActive.vue'
|
||||
@@ -16,10 +16,12 @@ import coinsPopover from '../../layouts/toolbar/coinsPopover/coinsPopover.vue'
|
||||
import drawer from '../../layouts/drawer/drawer.vue'
|
||||
import { CMyAvatar } from '@/components/CMyAvatar'
|
||||
import { CMyFieldDb } from '@/components/CMyFieldDb'
|
||||
import { CSelectUserActive } from '@/components/CSelectUserActive'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { useTestStore } from '@store/testStore'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useProducts } from '@store/Products'
|
||||
|
||||
import MixinUsers from '../../mixins/mixin-users'
|
||||
import { CMyCart, CSigninNoreg } from '@/components'
|
||||
@@ -33,7 +35,8 @@ export default defineComponent({
|
||||
name: 'MyHeader',
|
||||
components: {
|
||||
drawer, messagePopover,
|
||||
CMyFieldDb, CMyAvatar, CSigninNoreg, CMyCart, notifPopover, coinsPopover
|
||||
CMyFieldDb, CMyAvatar, CSigninNoreg, CMyCart, notifPopover, coinsPopover,
|
||||
CSelectUserActive,
|
||||
},
|
||||
props: {
|
||||
extraContent: {
|
||||
@@ -66,6 +69,7 @@ export default defineComponent({
|
||||
|
||||
const userStore = useUserStore()
|
||||
const globalStore = useGlobalStore()
|
||||
const products = useProducts()
|
||||
const testStore = useTestStore()
|
||||
const notifStore = useNotifStore()
|
||||
|
||||
@@ -594,6 +598,8 @@ export default defineComponent({
|
||||
iconConn,
|
||||
clIconConn,
|
||||
toHome,
|
||||
products,
|
||||
userStore,
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -115,7 +115,12 @@
|
||||
<div v-if="site.confpages && site.confpages.showMsgs">
|
||||
<message-popover></message-popover>
|
||||
</div>
|
||||
<div v-if="site.confpages && site.confpages.showCoins || site.confpages.showRIS">
|
||||
<div
|
||||
v-if="
|
||||
(site.confpages && site.confpages.showCoins) ||
|
||||
site.confpages.showRIS
|
||||
"
|
||||
>
|
||||
<coinsPopover v-model="rightCoinsOpen"></coinsPopover>
|
||||
</div>
|
||||
<div v-if="site.confpages && site.confpages.showNotif">
|
||||
@@ -250,8 +255,11 @@
|
||||
@click="rightCartOpen = !rightCartOpen"
|
||||
>
|
||||
</q-btn>
|
||||
|
||||
<CSelectUserActive></CSelectUserActive>
|
||||
|
||||
<div v-if="tools.isLogged()" class="text-weight-bold text-cart">
|
||||
{{ $t('ecomm.carrello') }}
|
||||
{{ $t('ecomm.carrello_di', { user: products.userActive.username }) }}
|
||||
</div>
|
||||
<CMyCart v-if="isfinishLoading"></CMyCart>
|
||||
</q-drawer>
|
||||
|
||||
Reference in New Issue
Block a user