ready for rpa
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
// @ts-check
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
import {Call} from '@wailsio/runtime';
|
||||
|
||||
/**
|
||||
* @function Companies
|
||||
* @returns {Promise<Company[], void>}
|
||||
**/
|
||||
export async function Companies() {
|
||||
return Call.ByName("dbsrv.Srv.Companies", ...Array.prototype.slice.call(arguments, 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* @function CreateCompany
|
||||
* @param name {string}
|
||||
* @param memberNumber {string}
|
||||
* @param username {string}
|
||||
* @param password {string}
|
||||
* @returns {Promise<void>}
|
||||
**/
|
||||
export async function CreateCompany(name, memberNumber, username, password) {
|
||||
return Call.ByName("dbsrv.Srv.CreateCompany", ...Array.prototype.slice.call(arguments, 0));
|
||||
}
|
||||
43
app/frontend/bindings/lib/srv/Srv.js
Normal file
43
app/frontend/bindings/lib/srv/Srv.js
Normal file
@@ -0,0 +1,43 @@
|
||||
// @ts-check
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
import {Call} from '@wailsio/runtime';
|
||||
|
||||
/**
|
||||
* @function Companies
|
||||
* @returns {Promise<Company[], void>}
|
||||
**/
|
||||
export async function Companies() {
|
||||
return Call.ByName("srv.Srv.Companies", ...Array.prototype.slice.call(arguments, 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* @function CreateCompany
|
||||
* @param name {string}
|
||||
* @param memberNumber {string}
|
||||
* @param username {string}
|
||||
* @param password {string}
|
||||
* @returns {Promise<void>}
|
||||
**/
|
||||
export async function CreateCompany(name, memberNumber, username, password) {
|
||||
return Call.ByName("srv.Srv.CreateCompany", ...Array.prototype.slice.call(arguments, 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* @function Rpa
|
||||
* @param month {number}
|
||||
* @param year {number}
|
||||
* @returns {Promise<void>}
|
||||
**/
|
||||
export async function Rpa(month, year) {
|
||||
return Call.ByName("srv.Srv.Rpa", ...Array.prototype.slice.call(arguments, 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* @function UploadExcel
|
||||
* @returns {Promise<string>}
|
||||
**/
|
||||
export async function UploadExcel() {
|
||||
return Call.ByName("srv.Srv.UploadExcel", ...Array.prototype.slice.call(arguments, 0));
|
||||
}
|
||||
@@ -2,15 +2,6 @@
|
||||
<q-layout view="lHh Lpr lFf">
|
||||
<q-header elevated style="margin-top: 40px;">
|
||||
<q-toolbar>
|
||||
<q-btn
|
||||
flat
|
||||
dense
|
||||
round
|
||||
icon="menu"
|
||||
aria-label="Menu"
|
||||
@click="toggleLeftDrawer"
|
||||
/>
|
||||
|
||||
<q-toolbar-title>
|
||||
Bordro Robotu
|
||||
</q-toolbar-title>
|
||||
|
||||
@@ -17,12 +17,56 @@
|
||||
label="Yeni Şirket Ekle"
|
||||
color="primary"
|
||||
@click="createCompany"
|
||||
no-caps
|
||||
/>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-section>
|
||||
<div class="row q-col-gutter-sm items-center">
|
||||
<div class="col-shrink">
|
||||
<q-btn label="Excel Yükle"
|
||||
@click="upload"
|
||||
no-caps
|
||||
color="secondary"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-11 text-right">
|
||||
{{ ld.xlsFile }}
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<q-select v-model="ld.year" :options="[2024, 2025, 2026, 2027, 2028]"
|
||||
label="Aktarım Yıl"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<q-select v-model="ld.month" :options="[1,2,3,4,5,6,7,8,9,10,11,12]"
|
||||
label="Aktarım Ay"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-btn
|
||||
no-caps
|
||||
label="Aktarıma Başla"
|
||||
color="warning"
|
||||
class="full-width"
|
||||
@click="doRpa"
|
||||
:disable="!ld.xlsFile || !ld.companyID"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-section>
|
||||
<div style="max-height: 200px; overflow: scroll; border: 1px gray solid;" class="q-pa-xs">
|
||||
<span v-for="(ln, ndx) in ld.logProcess" :key="ndx">
|
||||
{{ ndx }} {{ ln }}
|
||||
</span>
|
||||
</div>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
|
||||
</q-page>
|
||||
@@ -32,17 +76,26 @@
|
||||
import { onMounted, reactive } from 'vue'
|
||||
import Company from 'components/dlg/Company.vue'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { Companies, CreateCompany } from 'app/bindings/lib/dbsrv/Srv'
|
||||
import { Companies, CreateCompany, Rpa, UploadExcel } from 'app/bindings/lib/srv/Srv'
|
||||
import * as wails from '@wailsio/runtime'
|
||||
|
||||
const $q = useQuasar()
|
||||
|
||||
const ld = reactive({
|
||||
companyID: null,
|
||||
companies: [],
|
||||
xlsFile: '',
|
||||
logProcess: [],
|
||||
year: 2024,
|
||||
month: 1,
|
||||
})
|
||||
|
||||
onMounted(()=> {
|
||||
onMounted(() => {
|
||||
getCompanies()
|
||||
|
||||
wails.Events.On('logProcess', function (ev) {
|
||||
ld.logProcess.push(ev.data)
|
||||
})
|
||||
})
|
||||
|
||||
const createCompany = function () {
|
||||
@@ -50,7 +103,7 @@ const createCompany = function () {
|
||||
component: Company,
|
||||
parent: this,
|
||||
// ----------------------
|
||||
// props that are passed to component instancde
|
||||
// props that are passed to component instance
|
||||
}).onOk(data => {
|
||||
CreateCompany(data.name, data.memberNumber, data.username, data.password)
|
||||
})
|
||||
@@ -61,7 +114,16 @@ const getCompanies = function () {
|
||||
Companies().then(res => {
|
||||
ld.companies.push(...res)
|
||||
})
|
||||
}
|
||||
|
||||
const upload = function () {
|
||||
UploadExcel().then(res => {
|
||||
ld.xlsFile = res
|
||||
})
|
||||
}
|
||||
|
||||
const doRpa = function () {
|
||||
Rpa(Math.trunc(ld.month), Math.trunc(ld.year)).catch(err => console.log(err))
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user