Initial commit
This commit is contained in:
31
app/components/menu/MenuAccount.vue
Normal file
31
app/components/menu/MenuAccount.vue
Normal file
@@ -0,0 +1,31 @@
|
||||
<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>
|
||||
<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'],
|
||||
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}})
|
||||
},
|
||||
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>
|
||||
16
app/components/menu/MenuAction.vue
Normal file
16
app/components/menu/MenuAction.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<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">
|
||||
<SvgIcon v-bind="{ name: 'bin1.svg', type: 'dark', size: 16 }"></SvgIcon>
|
||||
</a>
|
||||
</template>
|
||||
<script setup>
|
||||
import { useAttrs } from "vue";
|
||||
const attrs = useAttrs();
|
||||
const emit = defineEmits(["edit", "remove"]);
|
||||
const remove = function () {
|
||||
emit("remove");
|
||||
};
|
||||
</script>
|
||||
40
app/components/menu/MenuAdd.vue
Normal file
40
app/components/menu/MenuAdd.vue
Normal file
@@ -0,0 +1,40 @@
|
||||
<template>
|
||||
<span v-if="row.approver__fullname">{{ row.approver__fullname }}</span>
|
||||
<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>
|
||||
</a>
|
||||
</template>
|
||||
<script>
|
||||
import { useStore } from "@/stores/index";
|
||||
export default {
|
||||
setup() {
|
||||
const store = useStore();
|
||||
return { store };
|
||||
},
|
||||
props: ["row", "pagename"],
|
||||
data() {
|
||||
return {
|
||||
label: this.store.lang === "en" ? "Select appraiser" : "Chọn người thẩm định",
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
newLoan() {
|
||||
this.$emit("clickevent", {
|
||||
name: "dataevent",
|
||||
data: {
|
||||
modal: {
|
||||
title: this.label,
|
||||
height: "330px",
|
||||
width: "500px",
|
||||
component: "parameter/Approver",
|
||||
vbind: { row: this.row, pagename: this.pagename },
|
||||
},
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
15
app/components/menu/MenuApp.vue
Normal file
15
app/components/menu/MenuApp.vue
Normal file
@@ -0,0 +1,15 @@
|
||||
<template>
|
||||
<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>
|
||||
18
app/components/menu/MenuCollab.vue
Normal file
18
app/components/menu/MenuCollab.vue
Normal file
@@ -0,0 +1,18 @@
|
||||
<template>
|
||||
<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()
|
||||
|
||||
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>
|
||||
15
app/components/menu/MenuCust.vue
Normal file
15
app/components/menu/MenuCust.vue
Normal file
@@ -0,0 +1,15 @@
|
||||
<template>
|
||||
<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>
|
||||
50
app/components/menu/MenuFile.vue
Normal file
50
app/components/menu/MenuFile.vue
Normal file
@@ -0,0 +1,50 @@
|
||||
<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>
|
||||
</a>
|
||||
</b-tooltip>
|
||||
<!-- <b-tooltip label="Tải xuống" position="is-left" type="is-link">
|
||||
<a class="mr-3" @click="download(row)">
|
||||
<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">
|
||||
<a @click="remove()">
|
||||
<SvgIcon v-bind="{name: 'bin1.svg', type: 'dark', size: 16}"></SvgIcon>
|
||||
</a>
|
||||
</b-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: ['api', 'pagename', 'row', 'disable'],
|
||||
methods: {
|
||||
async openFile(row) {
|
||||
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 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)
|
||||
},
|
||||
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}})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
33
app/components/menu/MenuNote.vue
Normal file
33
app/components/menu/MenuNote.vue
Normal file
@@ -0,0 +1,33 @@
|
||||
<template>
|
||||
<a v-if="row.note" @click="showNote()">
|
||||
<SvgIcon v-bind="{name: 'edit2.svg', type: 'findata', size: 20}"></SvgIcon>
|
||||
</a>
|
||||
<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>
|
||||
</a>
|
||||
</template>
|
||||
<script>
|
||||
import { useStore } from "@/stores/index";
|
||||
export default {
|
||||
setup() {
|
||||
const store = useStore();
|
||||
return { store };
|
||||
},
|
||||
props: ['row', 'pagename'],
|
||||
data() {
|
||||
return {
|
||||
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>
|
||||
25
app/components/menu/MenuParam.vue
Normal file
25
app/components/menu/MenuParam.vue
Normal file
@@ -0,0 +1,25 @@
|
||||
<template>
|
||||
<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>
|
||||
</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>
|
||||
16
app/components/menu/MenuPayment.vue
Normal file
16
app/components/menu/MenuPayment.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<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>
|
||||
12
app/components/menu/MenuPhone.vue
Normal file
12
app/components/menu/MenuPhone.vue
Normal file
@@ -0,0 +1,12 @@
|
||||
<template>
|
||||
<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>
|
||||
Reference in New Issue
Block a user