@@ -553,23 +553,13 @@
- اینجانب.... در تاریخ......... فرم بالا را تکمیل نموده و صحت کلیه اطلاعات تکمیل شده را تأیید می نمایم
+ اینجانب {{ fullName }} در تاریخ {{ date }} فرم بالا را تکمیل نموده و صحت کلیه اطلاعات تکمیل شده را تأیید می نمایم.
مرحله بعدی
-
-
-
-
-
-
-
-
-
-
@@ -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()