set user-type for personel 1400-01-26

This commit is contained in:
sedmedgh
2022-04-15 18:01:40 +04:30
parent 0da413366b
commit 3844f39584
5 changed files with 81 additions and 42 deletions
+1 -1
View File
@@ -11,7 +11,7 @@
padding: .8rem 2.2rem;
width: 100%;
transition: all .5s;
z-index: 10000;
z-index: 100;
}
.navbar-sticky,
+2 -2
View File
@@ -582,7 +582,7 @@
{
text-align: right !important;
}
.ant-modal-mask
/* .ant-modal-mask
{
z-index: 9999999 !important;
}
@@ -592,7 +592,7 @@
}
.ant-select-dropdown{
z-index: 999999999!important;
}
}*/
.ant-modal-content
{
direction: ltr !important;
+5 -5
View File
@@ -2013,7 +2013,7 @@ export default {
</script>
<style>
<style lang="less">
.ant-pagination {
direction: ltr !important;
}
@@ -2029,7 +2029,7 @@ td, th {
.ant-tabs-content {
text-align: right !important;
}
/*
.ant-modal-mask {
z-index: 9999999 !important;
}
@@ -2040,7 +2040,7 @@ td, th {
.ant-select-dropdown {
z-index: 999999999 !important;
}
}*/
.ant-modal-content {
direction: ltr !important;
@@ -2055,9 +2055,9 @@ td, th {
margin-right: 25px;
}
.ant-dropdown, .ant-popover.ant-popover-placement-right {
/*.ant-dropdown, .ant-popover.ant-popover-placement-right {
z-index: 99999999999;
}
}*/
/*.ant-dropdown
{
+1 -1
View File
@@ -9,7 +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('unit', 'واحد کار').filterText())
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'))
+72 -33
View File
@@ -27,7 +27,7 @@
</a-menu-item>
<a-menu-item v-if="$getAccess('request.employment') && !text.record.employed">
<a href="javascript:;" @click="showConfirme(text.record.id)">استخدام</a>
<a href="javascript:;" @click="showSetEmployeModal(text.record.id)">استخدام</a>
</a-menu-item>
</a-menu>
</a-dropdown>
@@ -592,6 +592,33 @@
</a-modal>
<a-modal force-render v-model="setEmployeModel" :closable="false" ok-text="بله" cancel-text="خیر" @ok="setEmploye">
<template #title>
<div class="flex justify-between">
<div>
آیا مطمئن به استخدام هستید ؟
</div>
<a-icon type="question-circle" style="color:#faad14"/>
</div>
</template>
<a-spin type="loading" :spinning="loading">
<div>در صورتی که گزینه تایید را انتخاب نمایید فرد مورد نظر به عنوان پرسنل در سیستم ثبت می شود</div>
<a-form :form="fromPersonel">
<a-form-item label="نمایش برای نوع کاربری">
<a-select v-decorator="['user_type',{ rules:[{ required: true, message: 'نوع کاربری را وارد نمایید' }] }]" style="width: 120px">
<a-select-option v-for="item in userTypes" :value="item.id">
{{ item.value }}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="id" class="hidden">
<a-innput v-decorator="['id',{ rules:[{ required: true, message: 'نوع کاربری را وارد نمایید' }] }]" />
</a-form-item>
</a-form>
</a-spin>
</a-modal>
<!-- <a-modal :width="800" v-model="editInformationModal" title="ویرایش درخواست" :forceRender="true">
<template slot="footer">
<a-button key="back" @click="editInformationModal=false">
@@ -927,6 +954,10 @@ export default {
fromMosahebe0: this.$form.createForm(this, {name: 'coordinated'}),
fromMosahebe1: this.$form.createForm(this, {name: 'coordinated'}),
fromMosahebe2: this.$form.createForm(this, {name: 'coordinated'}),
fromPersonel: this.$form.createForm(this, {name: 'coordinated'}),
setEmployeModel: false,
loading: false,
userTypes: [],
}
},
computed: {
@@ -1080,52 +1111,60 @@ export default {
this.$message.error('خطا در دریافت اطلاعات');
});
},
showConfirme(id) {
let self = this
this.$confirm({
title: 'آیا مطمئن به استخدام هستید ؟',
content: 'در صورتی که گزینه تایید را انتخاب نمایید فرد مورد نظر به عنوان پرسنل در سیستم ثبت می شود ',
cancelText: 'انصراف',
okText: 'تایید',
onOk() {
// this.$message.success('درخواست شما ثبت شد.');
try {
console.log('OK');
axios.post(`proposal/set-personnel`, {id: id}).then((res) => {
console.log(`res`, res);
self.$message.success('اطلاعات با موفقیت ثبت شد.');
}).catch((error) => {
self.$message.error('این کاربر قبلا استخدام شده است.');
});
} catch ({message}) {
// this.$ntSetError(message)
}
},
onCancel() {
//console.log('Cancel');
},
//class: 'test',
});
showSetEmployeModal(id) {
this.setEmployeModel = true
this.fromPersonel.setFieldsValue({
id
})
},
async setEmploye(e) {
e.preventDefault();
this.fromPersonel.validateFields(async (err, values) => {
try {
if (!err) {
this.loading = true
await axios.post(`proposal/set-personnel`, values)
this.setEmployeModel = false
this.$message.success('اطلاعات با موفقیت ثبت شد.');
}
else{
this.$message.error('انتخاب نوع کاربر الزامی است')
}
} catch ({message}) {
this.$message.error('این کاربر قبلا استخدام شده است.')
} finally {
this.loading = false
}
})
},
async getUserTypes(){
try{
this.loading = true
const {data} = await axios.get('/permission/type')
this.userTypes = Object.values(data)
}catch (e) {
console.log("errr:",e)
}finally {
this.loading = false
}
},
},
created() {
async created() {
this.cols = TableCol.default;
await this.getUserTypes()
}
}
</script>
<style>
.ant-modal-mask {
/*.ant-modal-mask {
z-index: 9999999 !important;
}
.ant-modal-wrap {
z-index: 999999999 !important;
}
}*/
ant-modal-title {
margin-right: 1rem;