[WIP] Изменил стили документов

This commit is contained in:
megavrilinvv
2022-11-21 22:01:50 +03:00
parent 27e29bf414
commit 053ece3c1f
7 changed files with 56 additions and 13 deletions

View File

@@ -40,7 +40,9 @@
:add-new-additional="addDocAdditional",
:save-additional="saveDocs"
)
.section-body.w-full.flex.flex-col.px-4.pt-3.pb-4.gap-y-4(v-if="this.isData || this.isAddress")
.section-body.w-full.flex.flex-col.px-4.pt-3.pb-4.gap-y-4(
v-if="this.isData || this.isAddress || this.isAttachments"
)
.flex.flex-col.gap-y-4
.flex.flex-col(v-for="(item, key) in sectionInfo", class="gap-y-1.5")
span.title-section.font-semibold.text-xs(
@@ -54,7 +56,7 @@
:placeholder="settings[section].placeholder[key]"
)
base-input.max-h-10.py-2.pl-3(
v-if="settings[section].options[key] === 'Дата выдачи' && isChange",
v-else-if="isChange && section !== 'docs'",
type="date",
v-model:value="sectionInfo.issued_by_date"
:max-date="`${currentYear}-12-31`",
@@ -83,13 +85,15 @@
)
.flex(v-if="item.name && !isChange")
span.text-sm.w-fit {{item.title}}
.flex.items-center(v-if="item.title")
.flex.items-center
.icon-cancel.cancel.cursor-pointer.pr-3.text-xsm(
v-if="isChange",
:id="item.id",
@click="(e) => deleteDoc(e)"
@click="deleteDoc(item.id)"
)
img(:src="iconDictionary[item?.document?.split('.')[1]]")
span.text-sm {{item.title}}
span.text-sm(v-if="item.document") {{`. ${item?.document?.split(".")[1]}`}}
.section-add-doc.flex.justify-center.items-center.cursor-pointer(
v-else,
@click="openAddDoc"
@@ -105,6 +109,9 @@ import TableAddingNewAdditional from "@/pages/clients/components/TableAddingNewA
import ClientDetailSectionAddress from "@/pages/clients/components/ClientDetailSectionAddress";
import BaseInput from "@/components/base/BaseInput";
import { detail } from "@/pages/clients/utils/tableConfig";
import pdfIcon from "@/assets/icons/pdf.svg";
import wordIcon from "@/assets/icons/word.svg";
import exelIcon from "@/assets/icons/exel.svg";
export default {
name: "ClientDetailInfoSection",
components: {
@@ -124,16 +131,17 @@ export default {
updateAddress: Function,
lackData: Boolean,
lackAddress: Boolean,
lackAttachments: Boolean,
dopeAddress: Object,
createAddress: Function,
createDocument: Function,
addressId: String,
attachmentId: String,
docId: String,
currentYear: Number,
},
data() {
return {
tip: "text",
additionalData: {
header: "",
value: "",
@@ -151,6 +159,8 @@ export default {
],
isData: true,
isAddress: true,
isAttachments: true,
iconDictionary: { doc: wordIcon, pdf: pdfIcon, xls: exelIcon },
};
},
computed: {
@@ -167,6 +177,8 @@ export default {
this.isData = true;
} else if (this.section === "addresses") {
this.isAddress = true;
} else if (this.section === "docs") {
this.isAttachments = true;
}
},
changeDoc() {
@@ -235,6 +247,12 @@ export default {
this.isAddress = newValue;
},
},
lackAttachments: {
immediate: true,
handler(newValue) {
this.isAttachments = newValue;
},
},
},
};
</script>

View File

@@ -25,6 +25,8 @@
section="docs",
:save-new-doc="saveNewDoc",
:delete-doc="deleteDoc"
:lack-attachments="lackAttachments"
:attachment-id="attachmentId"
)
</template>
@@ -44,10 +46,12 @@ export default {
updateAddress: Function,
lackData: Boolean,
lackAddress: Boolean,
lackAttachments: Boolean,
dopeAddress: Object,
createAddress: Function,
createDocument: Function,
addressId: String,
attachmentId: String,
docId: String,
currentYear: Number,
},

View File

@@ -80,7 +80,6 @@ export default {
immediate: true,
handler(newValue) {
if (newValue === false) {
console.log("work");
this.fetchDataClients();
}
},

View File

@@ -78,9 +78,11 @@
:lack-data="lackData"
:lack-address="lackAddress"
:dope-address="dopeAddress"
:lack-attachments="lackAttachments"
:create-address="postCreateAddress"
:create-document="postCreateIdentityDocument"
:address-id="addressId"
:attachment-id="attachmentId"
:doc-id="docId"
:current-year="currentYear"
)
@@ -132,8 +134,10 @@ export default {
dataClient: {},
docId: "",
addressId: "",
attachmentId: "",
lackData: true,
lackAddress: true,
lackAttachments: true,
dopeAddress: {
city: "",
region: "",
@@ -364,7 +368,14 @@ export default {
this.clearAddress();
},
saveAttachments(data) {
this.dataAttachments = [...data];
this.dataAttachments = [""];
if (data.find((e) => e.id)) {
this.dataAttachments = [...data];
this.lackAttachments = true;
this.attachmentId = this.dataAttachments[0].id;
} else {
this.lackAttachments = false;
}
},
openPopup(e) {
e.target.focus();
@@ -381,11 +392,10 @@ export default {
saveNewDoc(data) {
this.dataAttachments = [...this.dataDetail, ...data];
},
deleteDoc(e) {
e.stopPropagation();
this.dataAttachments = this.dataAttachments.filter(
(el) => el.id !== e.target.id
);
deleteDoc(id) {
fetchWrapper
.del(`general/attachment/${id}/delete/`)
.then(() => this.fetchClientDetail(this.id));
},
postCreateAddress() {
fetchWrapper
@@ -416,7 +426,7 @@ export default {
<style lang="sass" scoped>
.row-wrapper
border-bottom: 1px solid #D3D4DC
border-bottom: 1px solid var(--border-light-grey-color)
min-width: 1556px
.row-body
color: var(--font-dark-blue-color)