add unit and delete personel 1400-01-25

This commit is contained in:
sedmedgh
2022-04-14 13:17:40 +04:30
parent f6df66c4ee
commit 0da413366b
2 changed files with 29 additions and 6 deletions
+28 -6
View File
@@ -10,9 +10,19 @@
<x-table ref="personelTbl" class="mt-4"
:model="cols">
<template slot="operator" slot-scope="text,record">
<a-button type="primary" @click="showPersonal(text.record)">
مشاهده و ویرایش اطلاعات
</a-button>
<div class="flex">
<a-button class="ml-2" type="primary" @click="showPersonal(text.record)">
مشاهده و ویرایش اطلاعات
</a-button>
<a-popconfirm v-if="$getAccess('personnel.delete')"
title="آیا می خواهید حذف کنید؟"
ok-text="بله"
cancel-text="خیر"
@confirm="deletePersonnel(text.record.id)"
>
<a-button type="danger"> حذف پرسنل</a-button>
</a-popconfirm>
</div>
</template>
<template slot="gender" slot-scope="text,record">
{{text.record.proposal.gender_str}}
@@ -20,9 +30,6 @@
<template slot="birth_date" slot-scope="text,record">
{{text.record.birth_date | jdate}}
</template>
<template slot="work_unit" slot-scope="text,record">
{{findWorkUnit(text.record.contract[0].work_unit)}}
</template>
</x-table>
<a-modal :maskClosable="false" :forceRender="true" width="90%" v-model="showPersonalModal"
title="ویرایش اطلاعات پرسنلی">
@@ -117,6 +124,9 @@
<a-form-item label="شغل متقاضی">
<input class="ant-input" autocomplete="off" v-decorator="['proposal.job_title']"/>
</a-form-item>
<a-form-item label="واحد کار متقاضی">
<input class="ant-input" autocomplete="off" v-decorator="['unit']"/>
</a-form-item>
<a-form-item label="نام پدر">
<input class="ant-input" autocomplete="off" v-decorator="['proposal.father_name']"/>
</a-form-item>
@@ -1299,6 +1309,18 @@ export default {
}
},
methods: {
async deletePersonnel(id) {
try {
this.showLoading = true
await axios.delete('/personnel/'+id);
this.showLoading = false
await this.$refs.personelTbl.fetch()
} catch (e) {
throw e;
this.showLoading = false
}
},
setMarriage_sts(event) {
this.flags.marriage_sts = event.target.value
},
+1
View File
@@ -9,6 +9,7 @@ tbl.add(new Xtc('ncode', 'کد ملی').filterText())
tbl.add(new Xtc('proposal.mobile', 'شماره تلفن').filterText().hidden())
tbl.add(new Xtc('proposal.iden_place', 'محل صدور').filterText().hidden())
tbl.add(new Xtc('proposal.birth_place', 'محل تولد').filterText().hidden())
tbl.add(new Xtc('unit', 'واحد کار').filterText().hidden())
tbl.add(new Xtc('birth_date', 'تاریخ تولد').filterDate().filterKey('birth_date').hidden().renderSlot('birth_date'))
tbl.add(new Xtc('proposal.gender', 'جنسیت').filterSelect({1: 'مرد', 2: 'زن'}).filterKey('proposal.gender').hidden().renderSlot('gender'))