Merge branch 'dev' into Fix-IntegrationE2ETests
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jon Elias 2025-01-03 12:21:20 +00:00
commit 5fda8e0c89
2 changed files with 9 additions and 19 deletions

View File

@ -233,7 +233,7 @@ async function updateWarehouse(warehouseFk) {
</div> </div>
</template> </template>
</VnSubToolbar> </VnSubToolbar>
<QPage class="column items-center q-pa-md"> <QPage class="column items-center">
<QTable <QTable
:rows="itemBalances" :rows="itemBalances"
:columns="columns" :columns="columns"

View File

@ -53,7 +53,6 @@ const columns = computed(() => [
name: 'itemFk', name: 'itemFk',
...defaultColumnAttrs, ...defaultColumnAttrs,
isId: true, isId: true,
cardVisible: true,
columnField: { columnField: {
component: 'input', component: 'input',
type: 'number', type: 'number',
@ -65,14 +64,12 @@ const columns = computed(() => [
name: 'name', name: 'name',
...defaultColumnAttrs, ...defaultColumnAttrs,
create: true, create: true,
cardVisible: true,
}, },
{ {
label: t('item.fixedPrice.groupingPrice'), label: t('item.fixedPrice.groupingPrice'),
field: 'rate2', field: 'rate2',
name: 'rate2', name: 'rate2',
...defaultColumnAttrs, ...defaultColumnAttrs,
cardVisible: true,
component: 'input', component: 'input',
type: 'number', type: 'number',
}, },
@ -81,7 +78,6 @@ const columns = computed(() => [
field: 'rate3', field: 'rate3',
name: 'rate3', name: 'rate3',
...defaultColumnAttrs, ...defaultColumnAttrs,
cardVisible: true,
component: 'input', component: 'input',
type: 'number', type: 'number',
}, },
@ -91,7 +87,6 @@ const columns = computed(() => [
field: 'minPrice', field: 'minPrice',
name: 'minPrice', name: 'minPrice',
...defaultColumnAttrs, ...defaultColumnAttrs,
cardVisible: true,
component: 'input', component: 'input',
type: 'number', type: 'number',
}, },
@ -100,7 +95,6 @@ const columns = computed(() => [
field: 'started', field: 'started',
name: 'started', name: 'started',
format: ({ started }) => toDate(started), format: ({ started }) => toDate(started),
cardVisible: true,
...defaultColumnAttrs, ...defaultColumnAttrs,
columnField: { columnField: {
component: 'date', component: 'date',
@ -116,7 +110,6 @@ const columns = computed(() => [
field: 'ended', field: 'ended',
name: 'ended', name: 'ended',
...defaultColumnAttrs, ...defaultColumnAttrs,
cardVisible: true,
columnField: { columnField: {
component: 'date', component: 'date',
class: 'shrink', class: 'shrink',
@ -251,11 +244,14 @@ const upsertPrice = async (props, resetMinPrice = false) => {
} }
if (!changes.updates && !changes.creates) return; if (!changes.updates && !changes.creates) return;
const data = await upsertFixedPrice(row); const data = await upsertFixedPrice(row);
tableRef.value.CrudModelRef.formData[props.rowIndex] = data; Object.assign(tableRef.value.CrudModelRef.formData[props.rowIndex], data);
notify(t('globals.dataSaved'), 'positive');
tableRef.value.reload();
}; };
async function upsertFixedPrice(row) { async function upsertFixedPrice(row) {
const { data } = await axios.patch('FixedPrices/upsertFixedPrice', row); const { data } = await axios.patch('FixedPrices/upsertFixedPrice', row);
data.hasMinPrice = data.hasMinPrice ? 1 : 0;
return data; return data;
} }
@ -395,18 +391,11 @@ function handleOnDataSave({ CrudModelRef }) {
</template> </template>
</VnSubToolbar> </VnSubToolbar>
<VnTable <VnTable
@on-fetch="
(data) =>
data.forEach((item) => {
item.hasMinPrice = `${item.hasMinPrice !== 0}`;
})
"
:default-remove="false" :default-remove="false"
:default-reset="false" :default-reset="false"
:default-save="false" :default-save="false"
data-key="ItemFixedPrices" data-key="ItemFixedPrices"
url="FixedPrices/filter" url="FixedPrices/filter"
:order="['itemFk DESC', 'name DESC']"
save-url="FixedPrices/crud" save-url="FixedPrices/crud"
ref="tableRef" ref="tableRef"
dense dense
@ -498,14 +487,15 @@ function handleOnDataSave({ CrudModelRef }) {
<QCheckbox <QCheckbox
:model-value="props.row.hasMinPrice" :model-value="props.row.hasMinPrice"
@update:model-value="updateMinPrice($event, props)" @update:model-value="updateMinPrice($event, props)"
:false-value="'false'" :false-value="0"
:true-value="'true'" :true-value="1"
:toggle-indeterminate="false"
/> />
<VnInput <VnInput
class="col" class="col"
type="currency" type="currency"
mask="###.##" mask="###.##"
:disable="props.row.hasMinPrice === 1" :disable="props.row.hasMinPrice === 0"
v-model.number="props.row.minPrice" v-model.number="props.row.minPrice"
v-on="getRowUpdateInputEvents(props)" v-on="getRowUpdateInputEvents(props)"
> >