chore: install prettier

This commit is contained in:
Viet An
2026-05-04 15:22:27 +07:00
parent 93d29ca7d8
commit bd58e2b847
267 changed files with 22950 additions and 13581 deletions

View File

@@ -1,31 +1,62 @@
<template>
<div>
<b-tooltip label="Bút toán hạch toán" position="is-left" type="is-primary">
<a class="mr-2" @click="list()">
<SvgIcon v-bind="{name: 'menu.png', type: 'gray', size: 16}"></SvgIcon>
</a>
<b-tooltip
label="Bút toán hạch toán"
position="is-left"
type="is-primary"
>
<a
class="mr-2"
@click="list()"
>
<SvgIcon v-bind="{ name: 'menu.png', type: 'gray', size: 16 }"></SvgIcon>
</a>
</b-tooltip>
<b-tooltip v-if="$getEditRights()" label="Hạch toán" position="is-left" type="is-primary">
<a class="mr-2" @click="entry()">
<SvgIcon v-bind="{name: 'usd.png', type: 'gray', size: 16}"></SvgIcon>
<b-tooltip
v-if="$getEditRights()"
label="Hạch toán"
position="is-left"
type="is-primary"
>
<a
class="mr-2"
@click="entry()"
>
<SvgIcon v-bind="{ name: 'usd.png', type: 'gray', size: 16 }"></SvgIcon>
</a>
</b-tooltip>
</div>
</template>
<script>
export default {
props: ['row', 'api', 'pagename'],
props: ["row", "api", "pagename"],
methods: {
list() {
let obj = {component: 'common/ViewList', title: this.$lang('entry'), width: '80%', height: '400px',
vbind: {vbind: {api: 'internalentry', setting: 'internal-entry-fields', filter: {account__code: this.row.code}}}}
this.$emit('open', {name: 'dataevent', data: {modal: obj}})
let obj = {
component: "common/ViewList",
title: this.$lang("entry"),
width: "80%",
height: "400px",
vbind: {
vbind: {
api: "internalentry",
setting: "internal-entry-fields",
filter: { account__code: this.row.code },
},
},
};
this.$emit("open", { name: "dataevent", data: { modal: obj } });
},
entry() {
let obj = {component: 'accounting/InternalDeposit', title: this.$lang('accounting-entry'), width: '1000px', height: '450px',
vbind: {row: this.row, api: this.api, pagename: this.pagename}}
this.$emit('open', {name: 'dataevent', data: {modal: obj}})
}
}
}
</script>
let obj = {
component: "accounting/InternalDeposit",
title: this.$lang("accounting-entry"),
width: "1000px",
height: "450px",
vbind: { row: this.row, api: this.api, pagename: this.pagename },
};
this.$emit("open", { name: "dataevent", data: { modal: obj } });
},
},
};
</script>

View File

@@ -1,8 +1,14 @@
<template>
<a class="mr-3" @click="$emit('edit')">
<a
class="mr-3"
@click="$emit('edit')"
>
<SvgIcon v-bind="{ name: 'pen1.svg', type: 'dark', size: 16 }"></SvgIcon>
</a>
<a @click="remove()" v-if="attrs.onRemove">
<a
@click="remove()"
v-if="attrs.onRemove"
>
<SvgIcon v-bind="{ name: 'bin1.svg', type: 'dark', size: 16 }"></SvgIcon>
</a>
</template>
@@ -13,4 +19,4 @@ const emit = defineEmits(["edit", "remove"]);
const remove = function () {
emit("remove");
};
</script>
</script>

View File

@@ -1,9 +1,16 @@
<template>
<span v-if="row.approver__fullname">{{ row.approver__fullname }}</span>
<a v-else @click="newLoan">
<a
v-else
@click="newLoan"
>
<span class="tooltip">
<span class="dot-twitter">+</span>
<span class="tooltiptext to-left" style="min-width: max-content">{{ label }}</span>
<span
class="tooltiptext to-left"
style="min-width: max-content"
>{{ label }}</span
>
</span>
</a>
</template>

View File

@@ -1,15 +1,29 @@
<template>
<a class="has-text-link" @click="open">{{row['code']}}</a>
<a
class="has-text-link"
@click="open"
>{{ row["code"] }}</a
>
</template>
<script setup>
import { useStore } from '@/stores/index'
const store = useStore()
const emit = defineEmits(["clickevent"])
const props = defineProps({
row: Object
})
function open() {
emit('clickevent', {name: 'dataevent', data: {modal: {title: store.lang==='en'? 'Application' : 'Đơn vay',
height: '500px', width: '65%', component: 'application/ApplicationView', vbind:{row: props.row}}}})
}
</script>
import { useStore } from "@/stores/index";
const store = useStore();
const emit = defineEmits(["clickevent"]);
const props = defineProps({
row: Object,
});
function open() {
emit("clickevent", {
name: "dataevent",
data: {
modal: {
title: store.lang === "en" ? "Application" : "Đơn vay",
height: "500px",
width: "65%",
component: "application/ApplicationView",
vbind: { row: props.row },
},
},
});
}
</script>

View File

@@ -1,18 +1,32 @@
<template>
<a class="has-text-link" @click="open">{{row['collaborator__code']}}</a>
<a
class="has-text-link"
@click="open"
>{{ row["collaborator__code"] }}</a
>
</template>
<script setup>
import { useStore } from '@/stores/index'
const store = useStore()
const { $getdata } = useNuxtApp()
import { useStore } from "@/stores/index";
const store = useStore();
const { $getdata } = useNuxtApp();
const emit = defineEmits(["clickevent"])
const props = defineProps({
row: Object
})
async function open() {
let record = await $getdata('collaborator', {code: props.row.collaborator__code}, undefined, true)
emit('clickevent', {name: 'dataevent', data: {modal: {title: store.lang==='en'? 'Collaborator' : 'Cộng tác viên',
height: '400px', width: '60%', component: 'collaborator/CollaboratorView', vbind:{row: record}}}})
}
</script>
const emit = defineEmits(["clickevent"]);
const props = defineProps({
row: Object,
});
async function open() {
let record = await $getdata("collaborator", { code: props.row.collaborator__code }, undefined, true);
emit("clickevent", {
name: "dataevent",
data: {
modal: {
title: store.lang === "en" ? "Collaborator" : "Cộng tác viên",
height: "400px",
width: "60%",
component: "collaborator/CollaboratorView",
vbind: { row: record },
},
},
});
}
</script>

View File

@@ -1,15 +1,29 @@
<template>
<a class="has-text-link" @click="open">{{row['customer__code']}}</a>
<a
class="has-text-link"
@click="open"
>{{ row["customer__code"] }}</a
>
</template>
<script setup>
import { useStore } from '@/stores/index'
const store = useStore()
const emit = defineEmits(["clickevent"])
const props = defineProps({
row: Object
})
function open() {
emit('clickevent', {name: 'dataevent', data: {modal: {title: store.lang==='en'? 'Customer' : 'Khách hàng',
height: '500px', width: '60%', component: 'customer/CustomerView', vbind:{row: props.row}}}})
}
</script>
import { useStore } from "@/stores/index";
const store = useStore();
const emit = defineEmits(["clickevent"]);
const props = defineProps({
row: Object,
});
function open() {
emit("clickevent", {
name: "dataevent",
data: {
modal: {
title: store.lang === "en" ? "Customer" : "Khách hàng",
height: "500px",
width: "60%",
component: "customer/CustomerView",
vbind: { row: props.row },
},
},
});
}
</script>

View File

@@ -1,8 +1,15 @@
<template>
<div>
<b-tooltip label="Mở file" position="is-left" type="is-link">
<a class="mr-3" @click="openFile(row)">
<SvgIcon v-bind="{name: 'open.svg', type: 'dark', size: 16}"></SvgIcon>
<b-tooltip
label="Mở file"
position="is-left"
type="is-link"
>
<a
class="mr-3"
@click="openFile(row)"
>
<SvgIcon v-bind="{ name: 'open.svg', type: 'dark', size: 16 }"></SvgIcon>
</a>
</b-tooltip>
<!-- <b-tooltip label="Tải xuống" position="is-left" type="is-link">
@@ -10,41 +17,55 @@
<SvgIcon v-bind="{name: 'download1.svg', type: 'dark', size: 16}"></SvgIcon>
</a>
</b-tooltip> -->
<b-tooltip label="Xóa" position="is-left" type="is-danger" v-if="disable? !disable.delete : true">
<b-tooltip
label="Xóa"
position="is-left"
type="is-danger"
v-if="disable ? !disable.delete : true"
>
<a @click="remove()">
<SvgIcon v-bind="{name: 'bin1.svg', type: 'dark', size: 16}"></SvgIcon>
<SvgIcon v-bind="{ name: 'bin1.svg', type: 'dark', size: 16 }"></SvgIcon>
</a>
</b-tooltip>
</div>
</template>
<script>
export default {
props: ['api', 'pagename', 'row', 'disable'],
props: ["api", "pagename", "row", "disable"],
methods: {
async openFile(row) {
let url = `${this.$getpath()}static/files/${row.file__file || row.file}`
window.open(url, '_blank')
let url = `${this.$getpath()}static/files/${row.file__file || row.file}`;
window.open(url, "_blank");
},
async downloadFile(url, fileName) {
// const response = await fetch(url, { method: "GET" });
// const blob = await response.blob();
const urlDownload = url //window.URL.createObjectURL(blob);
const urlDownload = url; //window.URL.createObjectURL(blob);
const link = document.createElement("a");
link.href = urlDownload;
link.setAttribute("download", fileName);
link.click();
},
async download(row) {
let url = `${this.$getpath()}static/files/${row.file__file || row.file}`
await this.downloadFile(url, row.file__file || row.file)
let url = `${this.$getpath()}static/files/${row.file__file || row.file}`;
await this.downloadFile(url, row.file__file || row.file);
},
remove() {
let text = 'Bạn có muốn xóa file <b>#file</b> không?'
text = text.replace('#file', this.row.file__name)
let obj = {component: 'dialog/Delete', title: this.$store.lang==='en'? 'Delete file' : 'Xóa file', width: '500px', height: '100px',
vbind: {content: text, duration: 10, vbind: {row: this.row, api: this.api, pagename: this.pagename}}}
this.$emit('open', {name: 'dataevent', data: {modal: obj}})
}
}
}
let text = "Bạn có muốn xóa file <b>#file</b> không?";
text = text.replace("#file", this.row.file__name);
let obj = {
component: "dialog/Delete",
title: this.$store.lang === "en" ? "Delete file" : "Xóa file",
width: "500px",
height: "100px",
vbind: {
content: text,
duration: 10,
vbind: { row: this.row, api: this.api, pagename: this.pagename },
},
};
this.$emit("open", { name: "dataevent", data: { modal: obj } });
},
},
};
</script>

View File

@@ -1,11 +1,21 @@
<template>
<a v-if="row.note" @click="showNote()">
<SvgIcon v-bind="{name: 'edit2.svg', type: 'findata', size: 20}"></SvgIcon>
<a
v-if="row.note"
@click="showNote()"
>
<SvgIcon v-bind="{ name: 'edit2.svg', type: 'findata', size: 20 }"></SvgIcon>
</a>
<a v-else @click="showNote()">
<a
v-else
@click="showNote()"
>
<span class="tooltip">
<span class="dot-twitter">+</span>
<span class="tooltiptext to-left" style="min-width: max-content;">{{ label }}</span>
<span
class="tooltiptext to-left"
style="min-width: max-content"
>{{ label }}</span
>
</span>
</a>
</template>
@@ -16,18 +26,27 @@ export default {
const store = useStore();
return { store };
},
props: ['row', 'pagename'],
props: ["row", "pagename"],
data() {
return {
label: this.store.lang==='en'? 'Note' : 'Ghi chú'
}
label: this.store.lang === "en" ? "Note" : "Ghi chú",
};
},
methods: {
showNote() {
this.$emit('clickevent', {name: 'dataevent',
data: {modal: {title: this.label, height: '330px', width: '700px', component: 'common/Note',
vbind:{row: this.row, pagename: this.pagename}}}})
}
}
}
</script>
this.$emit("clickevent", {
name: "dataevent",
data: {
modal: {
title: this.label,
height: "330px",
width: "700px",
component: "common/Note",
vbind: { row: this.row, pagename: this.pagename },
},
},
});
},
},
};
</script>

View File

@@ -1,25 +1,42 @@
<template>
<a @click="changeStatus()" v-if="field==='status' && row[field]===1">
<span :style="style">{{row[column]}}</span>
<a
@click="changeStatus()"
v-if="field === 'status' && row[field] === 1"
>
<span :style="style">{{ row[column] }}</span>
</a>
<span :style="style" v-else>{{row[column]}}</span>
<span
:style="style"
v-else
>{{ row[column] }}</span
>
</template>
<script setup>
import { useStore } from '@/stores/index'
const store = useStore()
const emit = defineEmits(["clickevent"])
const props = defineProps({
row: Object,
field: String,
column: String,
param: String,
pagname: String
})
const params = store[props.param]
const found = params.find(v=>props.row[props.field]===v.id)
const style = found? `color:${found.color}` : undefined
function changeStatus() {
emit('clickevent', {name: 'dataevent', data: {modal: {title: store.lang==='vi'? 'Từ chối đơn vay' : 'Reject application',
height: '320px', width: '50%', component: 'application/RejectApp', vbind: {row: props.row, pagname: props.pagname}}}})
}
</script>
import { useStore } from "@/stores/index";
const store = useStore();
const emit = defineEmits(["clickevent"]);
const props = defineProps({
row: Object,
field: String,
column: String,
param: String,
pagname: String,
});
const params = store[props.param];
const found = params.find((v) => props.row[props.field] === v.id);
const style = found ? `color:${found.color}` : undefined;
function changeStatus() {
emit("clickevent", {
name: "dataevent",
data: {
modal: {
title: store.lang === "vi" ? "Từ chối đơn vay" : "Reject application",
height: "320px",
width: "50%",
component: "application/RejectApp",
vbind: { row: props.row, pagname: props.pagname },
},
},
});
}
</script>

View File

@@ -1,16 +1,30 @@
<template>
<a class="has-text-link" @click="open">{{row['payment_status__code']}}</a>
<a
class="has-text-link"
@click="open"
>{{ row["payment_status__code"] }}</a
>
</template>
<script setup>
const { $store } = useNuxtApp();
const emit = defineEmits(["clickevent"])
const props = defineProps({
row: Object,
api: String,
pagename: String
})
function open() {
emit('clickevent', {name: 'dataevent', data: {modal: {title: $store.lang==='en'? 'Payment status' : 'Trạng thái thanh toán',
height: '300px', width: '600px', component: 'application/CommPayment', vbind:{row: props.row, api: props.api, pagename: 'pagedata5'}}}})
}
</script>
const { $store } = useNuxtApp();
const emit = defineEmits(["clickevent"]);
const props = defineProps({
row: Object,
api: String,
pagename: String,
});
function open() {
emit("clickevent", {
name: "dataevent",
data: {
modal: {
title: $store.lang === "en" ? "Payment status" : "Trạng thái thanh toán",
height: "300px",
width: "600px",
component: "application/CommPayment",
vbind: { row: props.row, api: props.api, pagename: "pagedata5" },
},
},
});
}
</script>

View File

@@ -1,12 +1,26 @@
<template>
<a class="has-text-link" @click="open">{{row['phone']}}</a>
<a
class="has-text-link"
@click="open"
>{{ row["phone"] }}</a
>
</template>
<script setup>
const emit = defineEmits(["clickevent"])
const props = defineProps({
row: Object
})
function open() {
emit('clickevent', {name: 'dataevent', data: {modal: {title: 'Phone', height: '180px', width: '400px', component: 'common/Phone'}}})
}
</script>
const emit = defineEmits(["clickevent"]);
const props = defineProps({
row: Object,
});
function open() {
emit("clickevent", {
name: "dataevent",
data: {
modal: {
title: "Phone",
height: "180px",
width: "400px",
component: "common/Phone",
},
},
});
}
</script>