project flow completed
This commit is contained in:
@@ -11,3 +11,11 @@ import {Call} from '@wailsio/runtime';
|
||||
export async function Create() {
|
||||
return Call.ByName("company.Company.Create", ...Array.prototype.slice.call(arguments, 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* @function Edit
|
||||
* @returns {Promise<void>}
|
||||
**/
|
||||
export async function Edit() {
|
||||
return Call.ByName("company.Company.Edit", ...Array.prototype.slice.call(arguments, 0));
|
||||
}
|
||||
|
||||
@@ -24,14 +24,27 @@ export async function CreateCompany(name, memberNumber, username, password) {
|
||||
return Call.ByName("srv.Srv.CreateCompany", ...Array.prototype.slice.call(arguments, 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* @function EditCompany
|
||||
* @param id {number}
|
||||
* @param name {string}
|
||||
* @param memberNumber {string}
|
||||
* @param username {string}
|
||||
* @param password {string}
|
||||
* @returns {Promise<void>}
|
||||
**/
|
||||
export async function EditCompany(id, name, memberNumber, username, password) {
|
||||
return Call.ByName("srv.Srv.EditCompany", ...Array.prototype.slice.call(arguments, 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* @function Rpa
|
||||
* @param companyName {string}
|
||||
* @param companyID {number}
|
||||
* @param month {number}
|
||||
* @param year {number}
|
||||
* @returns {Promise<void>}
|
||||
**/
|
||||
export async function Rpa(companyName, month, year) {
|
||||
export async function Rpa(companyID, month, year) {
|
||||
return Call.ByName("srv.Srv.Rpa", ...Array.prototype.slice.call(arguments, 0));
|
||||
}
|
||||
|
||||
|
||||
@@ -40,24 +40,19 @@ defineEmits([
|
||||
const { dialogRef, onDialogHide, onDialogOK, onDialogCancel } = useDialogPluginComponent()
|
||||
|
||||
const props = defineProps({
|
||||
id: Number,
|
||||
name: String,
|
||||
memberNumber: Number,
|
||||
userName: String,
|
||||
password: String
|
||||
// companyName: String,
|
||||
// initialMemberNumber: Number,
|
||||
// username: String,
|
||||
// password: String
|
||||
})
|
||||
const ld = reactive({
|
||||
id : props.id || 0,
|
||||
name: props.name || '',
|
||||
memberNumber: props.memberNumber || 0,
|
||||
userName: props.userName || '',
|
||||
password: props.password || '',
|
||||
})
|
||||
console.log(props)
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@@ -7,12 +7,18 @@
|
||||
<q-select v-model="ld.companyID"
|
||||
label="Şirket"
|
||||
option-label="Name"
|
||||
option-value="Name"
|
||||
option-value="Id"
|
||||
:options="ld.companies"
|
||||
map-options
|
||||
emit-value
|
||||
>
|
||||
<template v-slot:after>
|
||||
<q-btn
|
||||
label="Düzenle"
|
||||
color="primary"
|
||||
@click="editCompany"
|
||||
no-caps
|
||||
/>
|
||||
<q-btn
|
||||
label="Yeni Şirket Ekle"
|
||||
color="primary"
|
||||
@@ -34,13 +40,6 @@
|
||||
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>
|
||||
@@ -82,9 +81,9 @@
|
||||
<script setup>
|
||||
import { onMounted, reactive } from 'vue'
|
||||
import Company from 'components/dlg/Company.vue'
|
||||
import EditCompany from 'components/dlg/EditCompany.vue'
|
||||
import EditCompanyPage from 'components/dlg/EditCompany.vue'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { Companies, CreateCompany, Rpa, UploadExcel } from 'app/bindings/lib/srv/Srv'
|
||||
import { Companies, CreateCompany, Rpa, UploadExcel ,EditCompany} from 'app/bindings/lib/srv/Srv'
|
||||
import * as wails from '@wailsio/runtime'
|
||||
|
||||
const $q = useQuasar()
|
||||
@@ -102,27 +101,27 @@ onMounted(() => {
|
||||
getCompanies()
|
||||
|
||||
wails.Events.On('logProcess', function (ev) {
|
||||
console.log(ev.data)
|
||||
ld.logProcess.push(ev.data)
|
||||
console.log(ld.logProcess)
|
||||
})
|
||||
})
|
||||
|
||||
const editCompany = function () {
|
||||
console.log(ld.companyID)
|
||||
const selectedCompanyID = ld.companyID;
|
||||
const selectedCompany = ld.companies.find(company => company.Id === selectedCompanyID);
|
||||
$q.dialog({
|
||||
component: EditCompany,
|
||||
component: EditCompanyPage,
|
||||
parent: this,
|
||||
componentProps: {
|
||||
name: ld.companyID.Name,
|
||||
memberNumber: ld.companyID.MemberNumber,
|
||||
userName : ld.companyID.Username,
|
||||
password : ld.companyID.Password,
|
||||
id : parseInt(selectedCompany.Id),
|
||||
name: selectedCompany.Name,
|
||||
memberNumber: selectedCompany.MemberNumber,
|
||||
userName : selectedCompany.Username,
|
||||
password : selectedCompany.Password,
|
||||
},
|
||||
// ----------------------
|
||||
// props that are passed to component instance
|
||||
}).onOk(data => {
|
||||
CreateCompany(data.name, initialMemberNumber, data.username, data.password).then(()=>{
|
||||
EditCompany(data.id, data.name, data.memberNumber, data.userName, data.password).then(()=>{
|
||||
getCompanies()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user