[WIP] Добавил состояние отсутсвующих данных
This commit is contained in:
@@ -41,7 +41,8 @@
|
|||||||
:save-additional="saveDocs"
|
:save-additional="saveDocs"
|
||||||
)
|
)
|
||||||
.section-body.w-full.flex.flex-col.px-4.pt-3.pb-4.gap-y-4
|
.section-body.w-full.flex.flex-col.px-4.pt-3.pb-4.gap-y-4
|
||||||
.flex.flex-col(v-for="(item, key) in sectionInfo" class="gap-y-1.5")
|
.flex.flex-col(class="gap-y-1.5")
|
||||||
|
.flex.flex-col(v-for="(item, key) in sectionInfo" v-if="lackPass || lackAddress" class="gap-y-1.5")
|
||||||
span.title-section.font-semibold.text-xs(v-if="settings[section].options") {{settings[section].options[key]}}
|
span.title-section.font-semibold.text-xs(v-if="settings[section].options") {{settings[section].options[key]}}
|
||||||
span.title-section.font-semibold.text-xs(v-if="item.header") {{item.header}}
|
span.title-section.font-semibold.text-xs(v-if="item.header") {{item.header}}
|
||||||
client-detail-input.text-sm.text-sm.w-max-fit(
|
client-detail-input.text-sm.text-sm.w-max-fit(
|
||||||
@@ -49,7 +50,6 @@
|
|||||||
:style="{fontWeight:key === 'numba'&&600}",
|
:style="{fontWeight:key === 'numba'&&600}",
|
||||||
v-model:value="sectionInfo[key]",
|
v-model:value="sectionInfo[key]",
|
||||||
:width="settings[section].width"
|
:width="settings[section].width"
|
||||||
:sharp="settings[section].sharps[key]"
|
|
||||||
)
|
)
|
||||||
.copy.icon-copy.cursor-pointer(
|
.copy.icon-copy.cursor-pointer(
|
||||||
v-if="item.copy",
|
v-if="item.copy",
|
||||||
@@ -70,6 +70,8 @@
|
|||||||
@click="(e) => deleteDoc(e)"
|
@click="(e) => deleteDoc(e)"
|
||||||
)
|
)
|
||||||
span.text-sm {{item.title}}
|
span.text-sm {{item.title}}
|
||||||
|
.flex.justify-center.items.center(v-else)
|
||||||
|
.flex(@click="!lackPass") Добавить данные
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -93,6 +95,8 @@ export default {
|
|||||||
deleteDoc: Function,
|
deleteDoc: Function,
|
||||||
updateDocument: Function,
|
updateDocument: Function,
|
||||||
updateAddress: Function,
|
updateAddress: Function,
|
||||||
|
lackPass: Boolean,
|
||||||
|
lackAddress: Boolean,
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
|
|||||||
@@ -4,12 +4,14 @@
|
|||||||
v-model:section-info="dataDocument"
|
v-model:section-info="dataDocument"
|
||||||
section="pass"
|
section="pass"
|
||||||
:update-document="updateDocument"
|
:update-document="updateDocument"
|
||||||
|
:lack-pass="lackPass"
|
||||||
)
|
)
|
||||||
.flex.flex-col
|
.flex.flex-col
|
||||||
client-detail-info-section(
|
client-detail-info-section(
|
||||||
:section-info="dataAddress"
|
:section-info="dataAddress"
|
||||||
section="addresses"
|
section="addresses"
|
||||||
:update-address="updateAddress"
|
:update-address="updateAddress"
|
||||||
|
:lack-address="lackAddress"
|
||||||
)
|
)
|
||||||
.flex.flex-col
|
.flex.flex-col
|
||||||
client-detail-info-section(
|
client-detail-info-section(
|
||||||
@@ -34,6 +36,8 @@ export default {
|
|||||||
dataDocument: Object,
|
dataDocument: Object,
|
||||||
updateDocument: Function,
|
updateDocument: Function,
|
||||||
updateAddress: Function,
|
updateAddress: Function,
|
||||||
|
lackPass: Boolean,
|
||||||
|
lackAddress: Boolean,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
.input-wrapper.flex.gap-x-2.px-3.box-border.w-max-fit(class="py-2.5")
|
.input-wrapper.flex.gap-x-2.px-3.box-border.w-max-fit(class="py-2.5")
|
||||||
input.place-input.w-full.outline-0.text-sm.not-italic.resize-none(
|
textarea.place-input.w-full.outline-0.text-sm.not-italic.resize-none(
|
||||||
:rows="Math.ceil(value.length/heightInput)"
|
:rows="Math.ceil(value.length/heightInput)"
|
||||||
:value="value"
|
:value="value"
|
||||||
@input="$emit('update:value', $event.target.value)"
|
@input="$emit('update:value', $event.target.value)"
|
||||||
v-mask="sharp"
|
|
||||||
)
|
)
|
||||||
slot
|
slot
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
:delete-doc="deleteDoc"
|
:delete-doc="deleteDoc"
|
||||||
:update-document="postUpdateIdentityDocument"
|
:update-document="postUpdateIdentityDocument"
|
||||||
:update-address="postUpdateAddress"
|
:update-address="postUpdateAddress"
|
||||||
|
:lack-pass="lackPass"
|
||||||
|
:lack-address="lackAddress"
|
||||||
)
|
)
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -73,6 +75,8 @@ export default {
|
|||||||
dataClient: {},
|
dataClient: {},
|
||||||
docId: "",
|
docId: "",
|
||||||
addressId: "",
|
addressId: "",
|
||||||
|
lackPass: true,
|
||||||
|
lackAddress: true,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
@@ -215,17 +219,32 @@ export default {
|
|||||||
this.saveAddress(data.address[0]);
|
this.saveAddress(data.address[0]);
|
||||||
this.saveAttachments([...data.attachments]);
|
this.saveAttachments([...data.attachments]);
|
||||||
},
|
},
|
||||||
|
addDoc() {
|
||||||
|
this.lackPass = false;
|
||||||
|
},
|
||||||
|
|
||||||
saveIdentityDocument(data) {
|
saveIdentityDocument(data) {
|
||||||
|
if (
|
||||||
|
data?.series ||
|
||||||
|
data?.numba ||
|
||||||
|
data?.issued_by_org ||
|
||||||
|
data?.issued_by_org_code ||
|
||||||
|
data?.issued_by_date
|
||||||
|
) {
|
||||||
this.dataIdentityDocument = {
|
this.dataIdentityDocument = {
|
||||||
numba:
|
numba:
|
||||||
data?.series && data?.numba
|
data.series && data.numba ? data?.series + " " + data?.numba : "",
|
||||||
? data?.series + " " + data?.numba || ""
|
issued_by_org: data.issued_by_org ? data?.issued_by_org : "",
|
||||||
|
issued_by_org_code: data.issued_by_org_code
|
||||||
|
? data?.issued_by_org_code
|
||||||
|
: "",
|
||||||
|
issued_by_date: data.issued_by_date
|
||||||
|
? data?.issued_by_date.split("-").reverse().join(".")
|
||||||
: "",
|
: "",
|
||||||
issued_by_org: data?.issued_by_org || "",
|
|
||||||
issued_by_org_code: data?.issued_by_org_code || "",
|
|
||||||
issued_by_date:
|
|
||||||
data?.issued_by_date.split("-").reverse().join(".") || "",
|
|
||||||
};
|
};
|
||||||
|
} else {
|
||||||
|
this.lackPass = false;
|
||||||
|
}
|
||||||
this.docId = data?.id;
|
this.docId = data?.id;
|
||||||
},
|
},
|
||||||
postUpdateIdentityDocument() {
|
postUpdateIdentityDocument() {
|
||||||
@@ -243,9 +262,16 @@ export default {
|
|||||||
.then(() => this.fetchClientDetail(this.id));
|
.then(() => this.fetchClientDetail(this.id));
|
||||||
},
|
},
|
||||||
saveAddress(data) {
|
saveAddress(data) {
|
||||||
|
if (data?.join_adress) {
|
||||||
this.dataAddress = {
|
this.dataAddress = {
|
||||||
join_adress: data?.join_adress || "",
|
join_adress: data?.join_adress
|
||||||
|
? data?.join_adress
|
||||||
|
: (this.lackAddress = false),
|
||||||
};
|
};
|
||||||
|
} else {
|
||||||
|
this.lackAddress = false;
|
||||||
|
}
|
||||||
|
|
||||||
this.addressId = data?.id;
|
this.addressId = data?.id;
|
||||||
},
|
},
|
||||||
postUpdateAddress() {
|
postUpdateAddress() {
|
||||||
|
|||||||
Reference in New Issue
Block a user