refactor: refs #8363 requested changes
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jon Elias 2025-03-24 14:04:36 +01:00
parent 461d48c69d
commit bbd771e61d
3 changed files with 25 additions and 13 deletions

View File

@ -7,7 +7,7 @@ import { beforeSave } from 'src/composables/updateMinPriceBeforeSave';
import FetchedTags from 'components/ui/FetchedTags.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import EditFixedPriceForm from 'src/components/EditFixedPriceForm.vue';
import EditFixedPriceForm from 'src/pages/Item/components/EditFixedPriceForm.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import RightMenu from 'src/components/common/RightMenu.vue';
import VnTable from 'src/components/VnTable/VnTable.vue';
@ -17,7 +17,7 @@ import { toDate } from 'src/filters';
import { isLower, isBigger } from 'src/filters/date.js';
import ItemFixedPriceFilter from './ItemFixedPriceFilter.vue';
import ItemDescriptorProxy from './Card/ItemDescriptorProxy.vue';
import CloneFixedPriceForm from 'src/components/CloneFixedPriceForm.vue';
import CloneFixedPriceForm from 'src/pages/Item/components/CloneFixedPriceForm.vue';
const stateStore = useStateStore();
const { t } = useI18n();
@ -39,7 +39,14 @@ const columns = computed(() => [
label: t('item.fixedPrice.itemFk'),
labelAbbreviation: 'Id',
toolTip: t('item.fixedPrice.itemFk'),
component: 'number',
component: 'select',
attrs: {
url: 'Items',
fields: ['id', 'name', 'subName'],
optionLabel: 'name',
optionValue: 'id',
uppercase: false,
},
columnFilter: {
inWhere: true,
},
@ -62,14 +69,7 @@ const columns = computed(() => [
label: t('globals.name'),
name: 'name',
create: true,
component: 'select',
attrs: {
url: 'Items',
fields: ['id', 'name', 'subName'],
optionLabel: 'name',
optionValue: 'name',
uppercase: false,
},
component: 'input',
isEditable: false,
},
{
@ -232,7 +232,7 @@ const dateStyle = (date) =>
v-model:selected="selectedRows"
:create="{
urlCreate: 'FixedPrices',
title: t('Create buy'),
title: t('Create fixed price'),
formInitialData: {},
onDataSaved: () => tableRef.reload(),
showSaveAndContinueBtn: true,
@ -398,4 +398,5 @@ tbody tr.highlight .q-td {
es:
Add fixed price: Añadir precio fijado
Edit fixed price(s): Editar precio(s) fijado(s)
Create fixed price: Crear precio fijado
</i18n>

View File

@ -66,8 +66,9 @@ const closeForm = () => {
<span class="title">{{ t('Edit') }}</span>
<span class="countLines">{{ ` ${rows.length} ` }}</span>
<span class="title">{{ t('buy(s)') }}</span>
<VnRow>
<VnRow class="q-mt-md">
<VnSelect
class="editOption"
:label="t('Field to edit')"
:options="fieldsOptions"
hide-selected
@ -75,6 +76,7 @@ const closeForm = () => {
v-model="selectedField"
data-cy="EditFixedPriceSelectOption"
@update:model-value="newValue = null"
:class="{ 'is-select': selectedField?.component === 'select' }"
/>
<component
:is="inputs[selectedField?.component || 'input']"
@ -129,6 +131,15 @@ const closeForm = () => {
}
</style>
<style lang="scss">
.editOption .q-field__inner .q-field__control {
padding: 0 !important;
}
.editOption.is-select .q-field__inner .q-field__control {
padding: 1px !important;
}
</style>
<i18n>
es:
Edit: Editar