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
+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){