Merge branch 'ASTRA-46' into 'master'
[WIP] Добавил автоматический поиск категорий льгот при вводе трех символов,... See merge request andrusyakka/urban-couscous!331
This commit is contained in:
@@ -5,7 +5,9 @@
|
||||
base-input(
|
||||
placeholder="Поиск",
|
||||
@keyup.enter="searchCategory",
|
||||
@input="searchCategory",
|
||||
v-model="searchBenefit",
|
||||
debounce="100",
|
||||
outlined,
|
||||
:width="300",
|
||||
iconLeft
|
||||
@@ -31,13 +33,13 @@
|
||||
.buttons-group.flex.py-4.px-8.justify-center
|
||||
base-button.text-base.font-semibold(outlined, :size="40", @click="closeModalCategories") Отменить
|
||||
base-button.text-base.font-semibold(
|
||||
v-if="selected.length > 0",
|
||||
v-if="selected[0]?.id",
|
||||
:size="40",
|
||||
@click="saveCategories(selected[0])"
|
||||
) Сохранить
|
||||
.right-side.flex.px-14.font-bold.relative
|
||||
q-icon(name="app:icon-cancel").text-sm.absolute.top-4.right-4.cursor-pointer(@click="closeModalCategories")
|
||||
.flex.py-10.gap-y-6.flex-col(v-if="selected.length > 0 && selected[0]?.name !== 'Без льготы'")
|
||||
.flex.py-10.gap-y-6.flex-col(v-if="selected[0]?.id && selected[0]?.name !== 'Без льготы'")
|
||||
.flex.text-6xl {{selected[0]?.name}}
|
||||
.flex.text-xm.flex-col.gap-y-3 Критерии:
|
||||
.flex.flex-col.gap-y-2
|
||||
@@ -69,6 +71,7 @@ export default {
|
||||
closeModalCategories: Function,
|
||||
saveCategories: Function,
|
||||
showModal: Boolean,
|
||||
basic: Object,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -103,7 +106,28 @@ export default {
|
||||
showModal: {
|
||||
immediate: true,
|
||||
handler(newVal) {
|
||||
if (!newVal) this.searchBenefit = "";
|
||||
if (!newVal) {
|
||||
this.searchBenefit = "";
|
||||
} else {
|
||||
this.selected.push(
|
||||
this.benefitData.find((e) => e.name === "Без льготы")
|
||||
);
|
||||
}
|
||||
},
|
||||
},
|
||||
benefitData: {
|
||||
immediate: true,
|
||||
deep: true,
|
||||
handler() {
|
||||
if (this.benefitData && this.showModal && !this.basic.id) {
|
||||
this.selected.push(
|
||||
this.benefitData.find((e) => e.name === "Без льготы")
|
||||
);
|
||||
} else if (this.basic.id) {
|
||||
this.selected.push(
|
||||
this.benefitData.find((e) => e.id === this.basic.id)
|
||||
);
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
:square="square",
|
||||
:standout="standout"
|
||||
:accept="accept",
|
||||
:debounce="debounce",
|
||||
hide-bottom-space
|
||||
)
|
||||
template(v-slot:prepend, v-if="iconLeft")
|
||||
@@ -75,6 +76,7 @@ export default {
|
||||
default: "",
|
||||
},
|
||||
mask: String,
|
||||
debounce: [String, Number],
|
||||
width: Number,
|
||||
maxLength: Number,
|
||||
textColor: String,
|
||||
|
||||
@@ -18,11 +18,18 @@
|
||||
)
|
||||
.label-field.font-sm.text-sm.whitespace-nowrap {{`${field.label} :`}}
|
||||
.avatar-field.flex.gap-3.items-center.h-10.w-10(v-if="field.type === 'avatar'")
|
||||
.flex.w-10.h-10(v-if="basic[insurance.insuranceKey][field.key]?.photo")
|
||||
.flex.w-10.h-10.relative(v-if="basic[insurance.insuranceKey][field.key]?.photo")
|
||||
img.avatar.object-cover(
|
||||
:src="basic[insurance.insuranceKey][field.key].photo",
|
||||
alt="AV"
|
||||
)
|
||||
q-badge.delete(
|
||||
floating,
|
||||
v-if="isEdit",
|
||||
@click="removeImage(insurance?.insuranceKey, field?.key)",
|
||||
rounded
|
||||
)
|
||||
q-icon(name="app:icon-cancel", size="8px")
|
||||
.replace-photo.font-medium.text-base.cursor-pointer(
|
||||
v-if="isEdit",
|
||||
@click="changeModal(insurance.insuranceKey)"
|
||||
@@ -57,6 +64,7 @@
|
||||
:close-modal-categories="closeModalCategories",
|
||||
:save-categories="saveCategories",
|
||||
:show-modal="showModalCategories",
|
||||
:basic="basic.benefit",
|
||||
@search="filterDataBenefit"
|
||||
)
|
||||
.flex.font-medium.text-smm.absolute.top-11(
|
||||
@@ -81,7 +89,7 @@
|
||||
q-icon.my-auto.text-lg.label-field.cursor-pointer(
|
||||
size="18px",
|
||||
name="app:icon-copy",
|
||||
v-if="checkCopiedFields(field.key)",
|
||||
v-if="checkCopiedFields(field.key, basic[insurance.insuranceKey])",
|
||||
@click="copyValue(basic[insurance.insuranceKey][field.key])"
|
||||
)
|
||||
</template>
|
||||
@@ -142,8 +150,16 @@ export default {
|
||||
localStorage.removeItem("searchBenefit", text);
|
||||
}
|
||||
},
|
||||
checkCopiedFields(key) {
|
||||
return !this.isEdit && this.copiedFields.some((elem) => elem === key);
|
||||
removeImage(docKey, field) {
|
||||
this.basic[docKey][field] = {};
|
||||
this.isCheckChange = true;
|
||||
},
|
||||
checkCopiedFields(key, item) {
|
||||
return (
|
||||
!this.isEdit &&
|
||||
this.copiedFields.some((elem) => elem === key) &&
|
||||
item[key]
|
||||
);
|
||||
},
|
||||
copyValue(text) {
|
||||
navigator.clipboard.writeText(text);
|
||||
@@ -370,4 +386,10 @@ export default {
|
||||
|
||||
.label-field
|
||||
color: var(--font-grey-color)
|
||||
|
||||
.q-badge
|
||||
padding: 4px
|
||||
cursor: pointer
|
||||
.delete
|
||||
background-color: var(--btn-red-color)
|
||||
</style>
|
||||
|
||||
@@ -292,29 +292,6 @@ export const baseInfoMenu = [
|
||||
];
|
||||
|
||||
export const baseInsuranceForm = [
|
||||
{
|
||||
insuranceLabel: "ДМС",
|
||||
insuranceKey: "insuranceDMS",
|
||||
fields: [
|
||||
{
|
||||
key: "series",
|
||||
label: "Серия",
|
||||
type: "text",
|
||||
inputMask: "####",
|
||||
},
|
||||
{
|
||||
key: "number",
|
||||
label: "Номер",
|
||||
type: "text",
|
||||
inputMask: "####-####-####",
|
||||
},
|
||||
{
|
||||
key: "photo",
|
||||
label: "Фото ДМС",
|
||||
type: "avatar",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
insuranceLabel: "ОМС",
|
||||
insuranceKey: "insuranceOMS",
|
||||
@@ -338,6 +315,29 @@ export const baseInsuranceForm = [
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
insuranceLabel: "ДМС",
|
||||
insuranceKey: "insuranceDMS",
|
||||
fields: [
|
||||
{
|
||||
key: "series",
|
||||
label: "Серия",
|
||||
type: "text",
|
||||
inputMask: "####",
|
||||
},
|
||||
{
|
||||
key: "number",
|
||||
label: "Номер",
|
||||
type: "text",
|
||||
inputMask: "####-####-####",
|
||||
},
|
||||
{
|
||||
key: "photo",
|
||||
label: "Фото ДМС",
|
||||
type: "avatar",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
insuranceLabel: "Категория льготы",
|
||||
insuranceKey: "benefit",
|
||||
|
||||
Reference in New Issue
Block a user