This commit is contained in:
alirezakarari
2021-02-16 15:43:07 +03:30
parent 2f77bf9cf6
commit cf40a1f402
4 changed files with 141 additions and 108 deletions
@@ -26,11 +26,7 @@ export default [
slug: "personel",
icon: "AlignJustifyIcon",
i18n: "اطلاعات پرسنلی",
},
{
url: "/auth/register",
},
}
]
+59 -58
View File
@@ -197,32 +197,32 @@
</div>
</a-tab-pane>
<a-tab-pane :forceRender="true" key="3" tab="اطلاعات آموزشی">
<a-list :locale="{emptyText:'رکوردی وجود ندارد.'}" bordered item-layout="horizontal" >
<a-list-item class="grid grid-cols-3" v-for="(item,index) in training" :key="index" >
<div>
<a-tooltip placement="bottomRight">
<template slot="title">
<span>حذف</span>
</template>
<a-popconfirm
placement="right"
style="z-index: 999999999999"
title="آیا می خواهید حذف کنید؟"
ok-text="بله"
cancel-text="خیر"
@confirm="removeEdu(item)"
>
<a-button type="danger" class="mr-3">حذف</a-button>
</a-popconfirm>
</a-tooltip>
</div>
<div>{{ item.type }} : دسته گواهینامه</div>
<div style="direction: rtl">عنوان گواهینامه : {{ item.title }}</div>
</a-list-item>
</a-list>
<a-button class="mt-4" @click="showAddEducationalInformation=true;isAlertUpload = false">افزودن ردیف</a-button>
</a-tab-pane>
<!-- <a-tab-pane :forceRender="true" key="3" tab="اطلاعات آموزشی">-->
<!-- <a-list :locale="{emptyText:'رکوردی وجود ندارد.'}" bordered item-layout="horizontal" >-->
<!-- <a-list-item class="grid grid-cols-3" v-for="(item,index) in training" :key="index" >-->
<!-- <div>-->
<!-- <a-tooltip placement="bottomRight">-->
<!-- <template slot="title">-->
<!-- <span>حذف</span>-->
<!-- </template>-->
<!-- <a-popconfirm-->
<!-- placement="right"-->
<!-- style="z-index: 999999999999"-->
<!-- title="آیا می خواهید حذف کنید؟"-->
<!-- ok-text="بله"-->
<!-- cancel-text="خیر"-->
<!-- @confirm="removeEdu(item)"-->
<!-- >-->
<!-- <a-button type="danger" class="mr-3">حذف</a-button>-->
<!-- </a-popconfirm>-->
<!-- </a-tooltip>-->
<!-- </div>-->
<!-- <div>{{ item.type }} : دسته گواهینامه</div>-->
<!-- <div style="direction: rtl">عنوان گواهینامه : {{ item.title }}</div>-->
<!-- </a-list-item>-->
<!-- </a-list>-->
<!-- <a-button class="mt-4" @click="showAddEducationalInformation=true;isAlertUpload = false">افزودن ردیف</a-button>-->
<!-- </a-tab-pane>-->
<a-tab-pane :forceRender="true" key="4" tab="قراردادها">
<a-list :locale="{emptyText:'رکوردی وجود ندارد.'}" bordered item-layout="horizontal" >
<a-list-item class="grid grid-cols-4" v-for="(item,index) in contract" :key="index" >
@@ -387,7 +387,7 @@
</a-tab-pane>
<a-tab-pane :forceRender="true" key="7" tab="ارزیابی عملکرد">
<a-list :locale="{emptyText:'رکوردی وجود ندارد.'}" bordered item-layout="horizontal" >
<a-list-item class="grid grid-cols-3" v-for="(item,index) in educationalInformation" :key="index" >
<a-list-item class="grid grid-cols-3" v-for="(item,index) in estimate" :key="index" >
<div>
<a-tooltip placement="bottomRight">
<template slot="title">
@@ -399,7 +399,7 @@
title="آیا می خواهید حذف کنید؟"
ok-text="بله"
cancel-text="خیر"
@confirm="okDelete(item)"
@confirm="removeEstimate(item)"
>
<a-button type="danger" class="mr-3">حذف</a-button>
</a-popconfirm>
@@ -564,30 +564,6 @@
</div>
</a-form-item>
<a-form-item label="فایل">
<div class="dropbox">
<a-upload-dragger
v-decorator="[
'dragger',
{
valuePropName: 'fileList',
},
]"
name="files"
action="/upload.do"
>
<p class="ant-upload-drag-icon">
<a-icon type="inbox" />
</p>
<p class="ant-upload-text">
فایل را درگ کنید یا اینکه کاوش کنید.
</p>
<p class="ant-upload-hint">
تصویر که بارگذاری می کنید باید زیر ۵ مگابایت باشد.
</p>
</a-upload-dragger>
</div>
</a-form-item>
</a-form>
</a-modal>
@@ -705,7 +681,7 @@
showAddPerformance:false,
showAddDocument:false,
personel:{},
educationalInformation:[],
estimate:[],
writ:[],
training:[],
contract:[],
@@ -729,7 +705,7 @@
e.preventDefault();
this.fromPerformance.validateFields((err, values) => {
if (!err) {
this.educationalInformation.push(values);
this.estimate.push(values);
this.showAddPerformance = false;
this.$message.success('اطلاعات با موفقیت ثبت شد');
this.fromPerformance.resetFields()
@@ -754,6 +730,24 @@
this.contract.splice(index,1);
}
},
async removeEstimate(item)
{
if(item.id)
{
try {
await axios.post('/personnel/remove-estimate', {id:item.id});
await this.getdata(this.personel.id);
}catch (e)
{
throw e;
}
}
else
{
const index = this.estimate.indexOf(item);
this.getdata.splice(index,1);
}
},
addDocs(e){
e.preventDefault();
this.fromDocs.validateFields((err, values) => {
@@ -812,7 +806,7 @@
values.contract=this.contract;
values.writ=this.writ;
values.training = this.training
values.educationalInformation = this.educationalInformation
values.estimate = this.estimate
await axios.post('personnel/update',values);
this.getdata(this.personel.id);
this.$ntSet()
@@ -832,6 +826,7 @@
const personelData = await axios.post('/personnel/get-data', {id:id});
this.contract=personelData.data.contract;
this.writ=personelData.data.writ;
this.estimate=personelData.data.estimate;
}catch (error)
{
console.log(error);
@@ -839,9 +834,15 @@
}
},
okDelete(item){
const index = this.educationalInformation.indexOf(item)
this.educationalInformation.splice(index,1)
async okDelete(item){
try{
await axios.delete('remove/estimate',{id:item.id})
}catch (e) {
this.$ntSetError()
}
// const index = this.estimate.indexOf(item)
// this.estimate.splice(index,1)
},
async removeDocs(item){
+21 -5
View File
@@ -27,7 +27,7 @@
</a-menu-item>
<a-menu-item>
<a href="javascript:;" @click="showConfirme()">استخدام</a>
<a href="javascript:;" @click="showConfirme(text.record.id)">استخدام</a>
</a-menu-item>
</a-menu>
</a-dropdown>
@@ -471,7 +471,8 @@
values.interview_at = this.interview_at
values.id = id
await axios.post('proposal/update',values)
this.$message.success('اطلاعات با موفقیت کامل شد')
this.showAddMosahebeModal = false
this.$ntSet('اطلاعات با موفقیت کامل شد')
this.fromMosahebe.resetFields()
}
}catch (e) {
@@ -516,20 +517,35 @@
this.$message.error('خطا در دریافت اطلاعات');
});
},
showConfirme(){
this.$confirm({
showConfirme(id){
let self = this
this.$confirm({
title: 'آیا مطمئن به استخدام هستید ؟',
content: 'در صورتی که گزینه بله را انتخاب کنید کد پرسنلی برای فرد درخواست کننده در سیستم اختصاص خواهد یافت',
cancelText:'بی خیال ',
okText:'بله',
onOk() {
console.log('OK');
// 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',
});
},
},
+60 -40
View File
@@ -436,7 +436,7 @@
sub-title="لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از طراحان گرافیک است."
>
<template #extra>
<a-button>
<a-button @click="LoginUser">
اتمام
</a-button>
</template>
@@ -479,7 +479,7 @@
</div>
<div class="md:w-1/2">
<a-form-item label="سال خاتمه">
<a-input-number autocomplete="off" :disabled="is_check" :min="1350" :max="1401" v-decorator="['end',{rules: [{ required: is_check ? false : true, message: 'لطفا مقدار سال خاتمه را به درستی بین 1350 تا 1401 وارد کنید.' }]}]"/>
<a-input-number id="end" ref="end" autocomplete="off" :disabled="is_check" :min="1350" :max="1401" v-decorator="['end',{rules: [{ required: is_check ? false : true, message: 'لطفا مقدار سال خاتمه را به درستی بین 1350 تا 1401 وارد کنید.' }]}]"/>
</a-form-item>
</div>
<div class="md:w-1/3">
@@ -553,23 +553,13 @@
</a-modal>
<a-modal :visible="visibleAccept" title="شرایط و مقررات" @ok="visibleAccept = false" @cancel="visibleAccept = false" ok-text="باشه" cancel-text="انصراف">
اینجانب.... در تاریخ......... فرم بالا را تکمیل نموده و صحت کلیه اطلاعات تکمیل شده را تأیید می نمایم
اینجانب {{ fullName }} در تاریخ {{ date }} فرم بالا را تکمیل نموده و صحت کلیه اطلاعات تکمیل شده را تأیید می نمایم.
</a-modal>
<div class="mt-5">
<a-button v-if="current < 2" type="primary" @click="handleSubmit">
مرحله بعدی
</a-button>
<!-- <a-button-->
<!-- v-if="current == 2"-->
<!-- type="primary"-->
<!-- @click="handleSubmit"-->
<!-- >-->
<!-- ثبت اطلاعات-->
<!-- </a-button>-->
<!-- <a-button v-if="current > 0" style="margin-left: 8px" @click="prev">-->
<!-- قبلی-->
<!-- </a-button>-->
</div>
</vx-card>
@@ -622,22 +612,21 @@
loading:false,
editMode:false,
id:0,
tempRow:{}
tempRow:{},
fullName:'',
date:null
}
},
methods:{
addCity()
{
this.jobs.push({city:null,job:null})
//this.model.push(jobs);
//console.log(this.model);
},
number_insurance(e){
this.has_instructor = e.target.value
},
handleSubmit(e) {
e.preventDefault();
//console.log(this.formFirst.getFieldsValue(),'this.formFirst.getFieldsValue()');
if(this.current ==0)
{
this.formFirst.validateFields(async(err, values) => {
@@ -653,19 +642,16 @@
if (!err) {
try{
this.loading = true
console.log(values,'values')
values.model = this.formFirst.getFieldsValue();
//Object.assign(values,this.formFirst.getFieldsValue());
console.log(this.formFirst.getFieldsValue(),'this.formFirst.getFieldsValue()')
values.birth_date = this.birth_day
values.work = this.work
values.training = this.educational
values.academic = this.edu
await axios.post('register/save', values)
this.$message.success('اطلاعات با موفقیت کامل شد')
this.fromMosahebe.resetFields()
this.$ntSet()
// this.from.resetFields()
this.current++
}catch (e) {
this.$ntSetError()
@@ -687,6 +673,14 @@
this.$ntSetError()
}
},
async getDate(){
try{
const {data} = await axios.get('/register/date')
this.date = data
}catch (e) {
this.$ntSetError()
}
},
async getJob(){
try{
const {data} = await axios.post('/register/jobs')
@@ -702,10 +696,12 @@
},
openModalEducational(){
this.visibleEducational = true
this.editMode = false
this.formEducational.resetFields()
},
openModalWork(){
this.visibleWork = true
this.editMode = false
this.formWork.resetFields()
},
openModalEduModeEDit(item){
@@ -717,10 +713,14 @@
},
openModalEducationalEDit(item){
this.visibleEducational = true
this.editMode = true
this.tempRow = item
this.formEducational.setFieldsValue(item)
},
openModalWorkEDit(item){
this.visibleWork = true
this.editMode = true
this.tempRow = item
this.formWork.setFieldsValue(item)
},
cancelEdu(){
@@ -746,7 +746,6 @@
values.id = this.id
this.edu.push(values)
this.id +=1
///console.log(values,'values')
this.formEdu.resetFields()
this.visibleEdu = false
}
@@ -766,10 +765,18 @@
this.formEducational.validateFields(async(err, values) => {
if (!err) {
try{
this.educational.push(values)
console.log(values,'values')
this.formEducational.resetFields()
this.visibleEducational = false
if(this.editMode){
const find = this.educational.findIndex(item=> item.id == this.tempRow.id)
Object.assign(this.educational[find],values);
this.visibleEducational = false
}else{
values.id = this.id
this.educational.push(values)
this.id += 1
console.log(values,'values')
this.formEducational.resetFields()
this.visibleEducational = false
}
}catch (e) {
this.$ntSetError()
throw e
@@ -785,10 +792,17 @@
this.formWork.validateFields(async(err, values) => {
if (!err) {
try{
this.work.push(values)
console.log(values,'values')
this.formWork.resetFields()
this.visibleWork = false
if(this.editMode){
const find = this.work.findIndex(item=> item.id == this.tempRow.id)
Object.assign(this.work[find],values);
}else{
values.id = this.id
this.work.push(values)
this.id += 1
console.log(values,'values')
this.formWork.resetFields()
}
this.visibleWork = false
}catch (e) {
this.$ntSetError()
throw e
@@ -797,14 +811,9 @@
}
});
},
isChecked(e){
this.is_check = e.target.checked
// if(this.is_check){
// this.formEdu.resetField('end_now')
// }
},
isCheckedWork(e){
this.is_work_check = e.target.checked
if(this.is_work_check) this.formWork.resetFields('end')
},
removeEdu(item){
const index = this.edu.indexOf(item)
@@ -821,17 +830,28 @@
changeGrade(id){
console.log(id,'id')
this.find_grade = this.grade.find(item=>item.level == id)
},
isChecked(e){
this.is_check = e.target.checked
if(this.is_check) this.formEdu.resetFields('end')
},
openAccept(){
this.visibleAccept = true
this.visibleAccept = true;
this.fullName = this.from.getFieldValue('name');
this.getDate()
},
LoginUser(){
this.$router.push('/auth/login')
},
next() {
this.current++;
},
prev() {
this.current--;
},
}
},
computed:{
},
mounted() {
this.getCity()