edit dialog added

This commit is contained in:
hysn99
2024-04-02 09:51:14 +03:00
parent 5ec8f05e16
commit 321a76096f
6 changed files with 209 additions and 25 deletions

View File

@@ -0,0 +1,66 @@
<template>
<q-dialog ref="dialogRef" persistent @hide="onDialogHide">
<q-card style="width: 600px;">
<q-card-section class="bg-purple text-white">
<p>Şirket Adı: {{ props.name }}</p>
<!-- <span class="text-h6 text-weight-bolder">{{props.name}}</span> -->
</q-card-section>
<q-card-section>
<q-input v-model="ld.name" label="Şirket Adı"/>
<q-input v-model="ld.memberNumber" label="Üye No"/>
<q-input v-model="ld.userName" label="Kullanıcı Adı"/>
<q-input v-model="ld.password" label="Parola"/>
</q-card-section>
<q-card-actions align="right">
<q-btn label="İptal"
icon="cancel"
no-caps outline
@click="onDialogCancel"
/>
<q-btn label="Kaydet" no-caps outline color="positive"
icon="check"
@click="onDialogOK(toRaw(ld))"/>
</q-card-actions>
</q-card>
</q-dialog>
</template>
<script setup>
import { useDialogPluginComponent } from 'quasar'
import { reactive, toRaw ,defineProps } from 'vue'
defineEmits([
// REQUIRED; need to specify some events that your
// component will emit through useDialogPluginComponent()
...useDialogPluginComponent.emits,
])
const { dialogRef, onDialogHide, onDialogOK, onDialogCancel } = useDialogPluginComponent()
const props = defineProps({
name: String,
memberNumber: Number,
userName: String,
password: String
// companyName: String,
// initialMemberNumber: Number,
// username: String,
// password: String
})
const ld = reactive({
name: props.name || '',
memberNumber: props.memberNumber || 0,
userName: props.userName || '',
password: props.password || '',
})
console.log(props)
</script>
<style scoped>
</style>

View File

@@ -34,6 +34,13 @@
color="secondary"
/>
</div>
<div class="col-shrink">
<q-btn label="Düzenle"
@click="editCompany"
no-caps
color="secondary"
/>
</div>
<div class="col-11 text-right">
{{ ld.xlsFile }}
</div>
@@ -75,6 +82,7 @@
<script setup>
import { onMounted, reactive } from 'vue'
import Company from 'components/dlg/Company.vue'
import EditCompany from 'components/dlg/EditCompany.vue'
import { useQuasar } from 'quasar'
import { Companies, CreateCompany, Rpa, UploadExcel } from 'app/bindings/lib/srv/Srv'
import * as wails from '@wailsio/runtime'
@@ -98,6 +106,25 @@ onMounted(() => {
})
})
const editCompany = function () {
console.log(ld.companyID)
$q.dialog({
component: EditCompany,
parent: this,
componentProps: {
name: ld.companyID.Name,
memberNumber: ld.companyID.MemberNumber,
userName : ld.companyID.Username,
password : ld.companyID.Password,
},
// ----------------------
// props that are passed to component instance
}).onOk(data => {
CreateCompany(data.name, initialMemberNumber, data.username, data.password).then(()=>{
getCompanies()
})
})
}
const createCompany = function () {
$q.dialog({
component: Company,
@@ -115,6 +142,7 @@ const getCompanies = function () {
ld.companies.splice(0)
Companies().then(res => {
ld.companies.push(...res)
console.log(ld.companies)
})
}