|
@@ -1,5 +1,8 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
+ <cu-custom :backUrl="'/pages/human/practice/register/RegistrationAddForm'" :isBack="true" bgColor="bg-gradual-blue" >
|
|
|
+ <block slot="content">实习登记</block>
|
|
|
+ </cu-custom>
|
|
|
<u--form :model="inputForm" labelWidth="100px" class="u-form" labelPosition="left" :rules="rules" ref="inputForm">
|
|
|
<u-form-item label="姓名" borderBottom prop="name">
|
|
|
<u--input placeholder='请填写姓名' v-model="inputForm.name"></u--input>
|
|
@@ -11,8 +14,7 @@
|
|
|
<u-form-item label="性别" borderBottom prop="sex">
|
|
|
<jp-picker v-model="inputForm.sex" rangeKey="label" rangeValue="value" :range="[
|
|
|
{ label: '男', value: '1' },
|
|
|
- { label: '女', value: '2' },
|
|
|
- { label: '其他', value: '3' }
|
|
|
+ { label: '女', value: '2' }
|
|
|
]"></jp-picker>
|
|
|
</u-form-item>
|
|
|
|
|
@@ -46,7 +48,7 @@
|
|
|
</u-form-item>
|
|
|
|
|
|
<!-- 添加按钮 -->
|
|
|
- <u-form-item label="实现经验">
|
|
|
+ <u-form-item label="实习经验">
|
|
|
<el-button type="primary" @click="addRow">新增</el-button>
|
|
|
</u-form-item>
|
|
|
|
|
@@ -57,7 +59,6 @@
|
|
|
<el-date-picker
|
|
|
v-model="scope.row.startTime"
|
|
|
type="date"
|
|
|
- value-format="YYYY-MM-DD"
|
|
|
placeholder="选择开始时间"
|
|
|
style="width:100%"
|
|
|
size="default"
|
|
@@ -71,7 +72,6 @@
|
|
|
<el-date-picker
|
|
|
v-model="scope.row.endTime"
|
|
|
type="date"
|
|
|
- value-format="YYYY-MM-DD"
|
|
|
placeholder="选择结束时间"
|
|
|
style="width:100%"
|
|
|
size="default"
|
|
@@ -131,6 +131,11 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
+ <u-form-item style="margin-top: 20px; text-align: center;">
|
|
|
+ <el-button type="primary" @click="saveForm" style="width: 100%;">
|
|
|
+ <span style="margin: 0 auto;">提交</span>
|
|
|
+ </el-button>
|
|
|
+ </u-form-item>
|
|
|
</u--form>
|
|
|
</view>
|
|
|
</template>
|
|
@@ -222,13 +227,25 @@
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- saveForm (callback) {
|
|
|
+ saveForm () {
|
|
|
//定义表单规则
|
|
|
this.$refs.inputForm.validate().then(res => {
|
|
|
uni.showLoading()
|
|
|
this.inputForm.type = '2'
|
|
|
+ this.inputForm.experiences.forEach(experience => {
|
|
|
+ experience.startTime = this.formatDate(experience.startTime);
|
|
|
+ experience.endTime = this.formatDate(experience.endTime);
|
|
|
+ });
|
|
|
+
|
|
|
registerService.save(this.inputForm).then((data) => {
|
|
|
- callback(data.businessTable, data.businessId)
|
|
|
+ // 接口调用成功,隐藏加载动画
|
|
|
+ uni.hideLoading();
|
|
|
+ // 弹出提交成功提示
|
|
|
+ uni.showToast({
|
|
|
+ title: '提交成功',
|
|
|
+ icon: 'success',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
}).catch((e)=>{
|
|
|
|
|
|
})
|
|
@@ -265,7 +282,13 @@
|
|
|
// 例如:this.$message.error('请输入正确的手机号码格式');
|
|
|
this.$message.error('请输入正确的手机号码格式')
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ formatDate(date) {
|
|
|
+ const year = date.getFullYear();
|
|
|
+ const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
|
+ const day = date.getDate().toString().padStart(2, '0');
|
|
|
+ return `${year}-${month}-${day}`;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|