feat: refs #6321 updates
This commit is contained in:
parent
24eaaacb19
commit
38d1beff5b
|
@ -21,7 +21,6 @@ const colorSpacer = '#ecf0f1';
|
|||
const compatibilityItem = (value) => `${100 * (value / MATCH_VALUES.length)}%`;
|
||||
const gradientStyle = (value) => {
|
||||
let color = 'white';
|
||||
console.error(value, extractNumericValue(compatibilityItem(value)));
|
||||
const perc = extractNumericValue(compatibilityItem(value));
|
||||
switch (true) {
|
||||
case perc >= 0 && perc < 33:
|
||||
|
@ -150,25 +149,25 @@ const columns = computed(() => [
|
|||
name: 'located',
|
||||
field: 'located',
|
||||
},
|
||||
{
|
||||
name: 'tableActions',
|
||||
align: 'left',
|
||||
actions: [
|
||||
{
|
||||
title: t('Open details'),
|
||||
icon: 'change_circle',
|
||||
show: (row) => isSelectionAvailable(row),
|
||||
action: (row) => {
|
||||
proposalSelected.value = [row];
|
||||
confirm();
|
||||
},
|
||||
isPrimary: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
// {
|
||||
// name: 'tableActions',
|
||||
// align: 'left',
|
||||
// actions: [
|
||||
// {
|
||||
// title: t('Open details'),
|
||||
// icon: 'change_circle',
|
||||
// show: (row) => isSelectionAvailable(row),
|
||||
// action: (row) => {
|
||||
// proposalSelected.value = [row];
|
||||
// confirm();
|
||||
// },
|
||||
// isPrimary: true,
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
]);
|
||||
|
||||
async function confirm() {
|
||||
async function confirm(row) {
|
||||
try {
|
||||
// const params = {
|
||||
// saleFk: saleFk.value,
|
||||
|
@ -176,7 +175,11 @@ async function confirm() {
|
|||
// quantity: quantity.value,
|
||||
// };
|
||||
// const { data } = await axios.post('Sales/replaceItem', params);
|
||||
const params = [saleFk.value, proposalSelected.value[0].id, quantity.value];
|
||||
const params = [
|
||||
saleFk.value,
|
||||
row ?? proposalSelected.value[0].id,
|
||||
quantity.value,
|
||||
];
|
||||
// const { data } = await axios.post('Applications/sale_replaceItem/execute-proc', {
|
||||
// schema: 'vn',
|
||||
// params,
|
||||
|
@ -278,6 +281,16 @@ const isSelectionAvailable = (itemProposal) => {
|
|||
{{ row.id }}
|
||||
</QTooltip>
|
||||
<!-- <QBtn flat color="blue" dense>{{ }}</QBtn> -->
|
||||
<QBtn
|
||||
icon="change_circle"
|
||||
color="primary"
|
||||
flat
|
||||
dense
|
||||
@click="confirm(row)"
|
||||
:disable="!isSelectionAvailable(row)"
|
||||
>
|
||||
<QTooltip> {{ t('Open_details') }}</QTooltip>
|
||||
</QBtn>
|
||||
<div
|
||||
id="middle"
|
||||
style="
|
||||
|
|
|
@ -139,34 +139,38 @@ function onTicketLackFetched(data) {
|
|||
<VnSubToolbar>
|
||||
<template #st-data>
|
||||
<QBtnGroup push style="column-gap: 1px">
|
||||
{{ selectedRows.length }}
|
||||
<TicketMassiveUpdate
|
||||
:disable="selectedRows.length < 2"
|
||||
:disable="selectedRows.length < 1"
|
||||
:label="t('negative.buttonsUpdate.item')"
|
||||
:tooltip="t('negative.detail.modal.changeItem.title')"
|
||||
>
|
||||
<ChangeItemDialog
|
||||
ref="changeItemDialogRef"
|
||||
@update-item="changeItemDialogRef.hide()"
|
||||
:selected-rows="selectedRows"
|
||||
></ChangeItemDialog>
|
||||
</TicketMassiveUpdate>
|
||||
<TicketMassiveUpdate
|
||||
:disable="selectedRows.length < 2"
|
||||
:disable="selectedRows.length < 1"
|
||||
:label="t('negative.buttonsUpdate.state')"
|
||||
:tooltip="t('negative.detail.modal.changeState.title')"
|
||||
>
|
||||
<ChangeStateDialog
|
||||
ref="changeStateDialogRef"
|
||||
@update-state="changeStateDialogRef.hide()"
|
||||
:selected-rows="selectedRows"
|
||||
></ChangeStateDialog>
|
||||
</TicketMassiveUpdate>
|
||||
<TicketMassiveUpdate
|
||||
:disable="selectedRows.length < 1"
|
||||
:label="t('negative.buttonsUpdate.quantity')"
|
||||
:tooltip="t('negative.detail.modal.changeQuantity.title')"
|
||||
@click="showChangeQuantityDialog = true"
|
||||
:disable="selectedRows.length < 2"
|
||||
>
|
||||
<ChangeQuantityDialog
|
||||
ref="changeQuantityDialogRef"
|
||||
@update-quantity="changeQuantityDialogRef.hide()"
|
||||
:selected-rows="selectedRows"
|
||||
>
|
||||
</ChangeQuantityDialog>
|
||||
|
|
|
@ -137,17 +137,17 @@ const columns = computed(() => [
|
|||
sortable: true,
|
||||
|
||||
// columnFilter: {
|
||||
columnField: {
|
||||
component: 'select',
|
||||
attrs: {
|
||||
event: console.error,
|
||||
// event: console.error,
|
||||
options: editableStates.value,
|
||||
'option-value': 'id',
|
||||
'option-label': 'name',
|
||||
// },
|
||||
},
|
||||
},
|
||||
// columnField: {
|
||||
// component: 'select',
|
||||
// event: getInputEvents,
|
||||
// attrs: {
|
||||
// event: (v) => console.error(v),
|
||||
// options: editableStates.value,
|
||||
// 'option-value': 'id',
|
||||
// 'option-label': 'name',
|
||||
// // },
|
||||
// },
|
||||
// },
|
||||
},
|
||||
{
|
||||
name: 'zoneName',
|
||||
|
@ -240,6 +240,16 @@ function onTicketLackFetched(data) {
|
|||
:right-search="false"
|
||||
v-model:selected="selectedRows"
|
||||
>
|
||||
<template #column-alertLevelCode="props">
|
||||
<VnSelect
|
||||
:options="editableStates"
|
||||
hide-selected
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
v-model="props.row.alertLevelCode"
|
||||
v-on="getInputEvents(props)"
|
||||
/>
|
||||
</template>
|
||||
<template #column-quantity="props">
|
||||
<VnInputNumber
|
||||
v-model.number="props.row.quantity"
|
||||
|
|
|
@ -2,15 +2,14 @@
|
|||
import { ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import axios from 'axios';
|
||||
import { useDialogPluginComponent } from 'quasar';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
const emit = defineEmits(['update-item']);
|
||||
|
||||
const editableItems = ref([]);
|
||||
const { t } = useI18n();
|
||||
const showChangeItemDialog = ref(false);
|
||||
const newItem = ref(null);
|
||||
const { dialogRef } = useDialogPluginComponent();
|
||||
const $props = defineProps({
|
||||
selectedRows: {
|
||||
type: Array,
|
||||
|
@ -27,10 +26,9 @@ const updateItem = async () => {
|
|||
})
|
||||
);
|
||||
await Promise.all(rowsToUpdate);
|
||||
emit('update-item');
|
||||
} catch (err) {
|
||||
return err;
|
||||
} finally {
|
||||
dialogRef.value.hide({ type: 'refresh', refresh: true });
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -45,12 +43,16 @@ const updateItem = async () => {
|
|||
<QCardSection class="row items-center justify-center column items-stretch">
|
||||
<span>{{ t('negative.detail.modal.changeItem.title') }}</span>
|
||||
<VnSelect
|
||||
:label="t('negative.detail.modal.changeItem.placeholder')"
|
||||
v-model="newItem"
|
||||
:options="editableItems"
|
||||
url="Items/WithName"
|
||||
:fields="['id', 'name']"
|
||||
:sort-by="['id DESC']"
|
||||
:options="items"
|
||||
option-label="name"
|
||||
option-value="code"
|
||||
/>
|
||||
option-value="id"
|
||||
v-model="newItem"
|
||||
@update:model-value="updateItem(row)"
|
||||
>
|
||||
</VnSelect>
|
||||
</QCardSection>
|
||||
<QCardActions align="right">
|
||||
<QBtn :label="t('globals.cancel')" color="primary" flat v-close-popup />
|
||||
|
|
|
@ -1,20 +1,19 @@
|
|||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { ref, defineEmits } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import axios from 'axios';
|
||||
import { useDialogPluginComponent } from 'quasar';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const showChangeQuantityDialog = ref(false);
|
||||
const newQuantity = ref(null);
|
||||
const { dialogRef } = useDialogPluginComponent();
|
||||
const $props = defineProps({
|
||||
selectedRows: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(['update-quantity']);
|
||||
const updateQuantity = async () => {
|
||||
showChangeQuantityDialog.value = true;
|
||||
const rowsToUpdate = $props.selectedRows.map(({ saleFk }) =>
|
||||
|
@ -25,10 +24,9 @@ const updateQuantity = async () => {
|
|||
|
||||
try {
|
||||
await Promise.all(rowsToUpdate);
|
||||
emit('update-quantity');
|
||||
} catch (err) {
|
||||
return err;
|
||||
} finally {
|
||||
dialogRef.value.hide({ type: 'refresh', refresh: true });
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -2,15 +2,14 @@
|
|||
import { ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import axios from 'axios';
|
||||
import { useDialogPluginComponent } from 'quasar';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
const emit = defineEmits(['update-state']);
|
||||
|
||||
const editableStates = ref([]);
|
||||
const { t } = useI18n();
|
||||
const showChangeStateDialog = ref(false);
|
||||
const newState = ref(null);
|
||||
const { dialogRef } = useDialogPluginComponent();
|
||||
const $props = defineProps({
|
||||
selectedRows: {
|
||||
type: Array,
|
||||
|
@ -27,10 +26,9 @@ const updateState = async () => {
|
|||
})
|
||||
);
|
||||
await Promise.all(rowsToUpdate);
|
||||
emit('update-state');
|
||||
} catch (err) {
|
||||
return err;
|
||||
} finally {
|
||||
dialogRef.value.hide({ type: 'refresh', refresh: true });
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue