feat: 人员信息页面接口入参调整
parent
96303795ec
commit
40bfdf1cf7
|
@ -74,5 +74,5 @@ export const getHistoricalApprovalRecords = (params) => post("/app/Task/getHis",
|
|||
// ********************* start ***********************
|
||||
export const getIsUploadFace = (params) => post("/app/user/getUserFace", params); // 获取是否上传人脸信息
|
||||
export const getClassList = (params) => post("/app/stagestudentrelation/pageTaskByUser", params); //获取班级列表
|
||||
export const joinClass = (params) => post("/app/student/joinClass", params); //实名认证信息提交
|
||||
export const joinClass = (params) => uploads("/app/student/joinClass", params); // 实名认证信息提交
|
||||
// ********************* end ***********************
|
||||
|
|
|
@ -101,21 +101,24 @@ export default {
|
|||
// scanType: ['qrCode'], // 仅支持二维码扫码
|
||||
onlyFromCamera: false, // 是否只能从相机扫码,不允许从相册选择图片
|
||||
hideAlbum: false, // 隐藏相册,不允许从相册选择图片,只能从相机扫码
|
||||
success: function (res) {
|
||||
if (res.result === '0') {
|
||||
success: function (response) {
|
||||
const { id, type } = JSON.parse(response.result);
|
||||
if (type === '0') {
|
||||
// 签到二维码方式进入
|
||||
uni.$u.route({
|
||||
url: '/pages/train_management/realname_info_auth',
|
||||
params: {
|
||||
type: 'scan_face'
|
||||
type: 'scan_face',
|
||||
classId: id
|
||||
}
|
||||
})
|
||||
} else if (res.result === '1') {
|
||||
} else if (type === '1') {
|
||||
// 考试二维码方式进入
|
||||
uni.$u.route({
|
||||
url: '/pages/train_management/face_authentication',
|
||||
params: {
|
||||
type: 'learning_certification'
|
||||
type: 'learning_certification',
|
||||
classId: id
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -10,43 +10,31 @@
|
|||
<u--input v-model="ruleFormData.userInfo.name" placeholder="请输入姓名..." border="none"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item labelWidth="80" label="联系电话" prop="userInfo.phone" borderBottom required>
|
||||
<u--input v-model="ruleFormData.userInfo.phone" type="number" placeholder="请输入联系电话..."
|
||||
border="none"></u--input>
|
||||
<u--input v-model="ruleFormData.userInfo.phone" type="number" placeholder="请输入联系电话..." border="none"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item labelWidth="80" label="身份证号" prop="userInfo.userIdCard" borderBottom required>
|
||||
<u--input v-model="ruleFormData.userInfo.userIdCard" placeholder="请输入身份证号..." border="none"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item labelWidth="70" label="性别" prop="userInfo.sex" borderBottom required>
|
||||
<u-radio-group v-model="ruleFormData.userInfo.sex" placement="row" class="radio-group__style"
|
||||
@change="groupChange">
|
||||
<u-radio v-for="(item, index) in sexsList" :key="index" :label="item.name" :name="item.name">
|
||||
</u-radio>
|
||||
<u-radio-group v-model="ruleFormData.userInfo.sex" placement="row" class="radio-group__style">
|
||||
<u-radio v-for="(item, index) in sexsList" :key="index" :label="item.name" :name="item.name"> </u-radio>
|
||||
</u-radio-group>
|
||||
</u-form-item>
|
||||
<u-form-item labelWidth="70" label="学历" prop="userInfo.degreeOfEducation" borderBottom required
|
||||
@click="handleEducationClick">
|
||||
<u-form-item labelWidth="70" label="学历" prop="userInfo.degreeOfEducation" borderBottom required @click="handleEducationClick">
|
||||
<u--input v-model="ruleFormData.userInfo.degreeOfEducation" readonly placeholder="请选择学历..." border="none"></u--input>
|
||||
<!-- <u-action-sheet :show="showEducationPopper" :actions="educationActions" title="请选择学历"
|
||||
@close="showEducationPopper = false" @select="handleSelectEducation">
|
||||
</u-action-sheet> -->
|
||||
</u-form-item>
|
||||
<u-form-item labelWidth="70" label="职业" prop="userInfo.job" borderBottom required>
|
||||
<u--input v-model="ruleFormData.userInfo.job" placeholder="请输入职业..." border="none"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item labelWidth="125" label="职业资格等级证书" prop="userInfo.gradeCertificate" borderBottom required>
|
||||
<u-upload :fileList="ruleFormData.userInfo.gradeCertificate" :previewFullImage="true" @afterRead="afterRead"
|
||||
@delete="deletePic" name="1" multiple :maxCount="1"></u-upload>
|
||||
<u-upload :fileList="ruleFormData.userInfo.gradeCertificate" previewFullImage @afterRead="afterRead" @delete="deletePic" name="1" multiple :maxCount="1"></u-upload>
|
||||
</u-form-item>
|
||||
<u-form-item labelWidth="120" label="获得证书时间" prop="userInfo.certificateAcquisitionTime" borderBottom required
|
||||
@click="showCertificateGetTime">
|
||||
<u--input v-model="ruleFormData.userInfo.certificateAcquisitionTime" readonly placeholder="请选择获得证书时间..."
|
||||
border="none"></u--input>
|
||||
<u-form-item labelWidth="120" label="获得证书时间" prop="userInfo.certificateAcquisitionTime" borderBottom required @click="showCertificateGetTime">
|
||||
<u--input v-model="ruleFormData.userInfo.certificateAcquisitionTime" readonly placeholder="请选择获得证书时间..." border="none"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item label="手写签字" prop="userInfo.writeSign" borderBottom required labelPosition="top" labelWidth="auto">
|
||||
<view style="flex: 1;">
|
||||
<u-button type="primary" size="mini" text="签字"
|
||||
:customStyle="{ position: 'absolute', top: '-46upx', right: '20upx', width: '100upx' }"
|
||||
@click="signVisible = true" />
|
||||
<view style="flex: 1">
|
||||
<u-button type="primary" size="mini" text="签字" :customStyle="{ position: 'absolute', top: '-46upx', right: '20upx', width: '100upx' }" @click="signVisible = true" />
|
||||
<view v-if="ruleFormData.userInfo.writeSign">
|
||||
<u-image width="400rpx" height="200rpx" :src="ruleFormData.userInfo.writeSign" />
|
||||
</view>
|
||||
|
@ -57,19 +45,25 @@
|
|||
<view class="mt-10">
|
||||
<u-button type="primary" text="下一步" @click="$u.debounce(fnSubmit, 1000, true)" />
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<sign :signShow.sync="signVisible" @confirm="handleSign" />
|
||||
<u-datetime-picker :show="showCertificateGetTimePopper" mode="date" :round="12" :custom-style="{
|
||||
<u-datetime-picker
|
||||
:show="showCertificateGetTimePopper"
|
||||
mode="datetime"
|
||||
v-model="defaultDatetimePicker"
|
||||
:round="12"
|
||||
:custom-style="{
|
||||
borderRadius: '24rpx',
|
||||
overflow: 'hidden',
|
||||
'--picker-header-radius': '24rpx 24rpx 0 0',
|
||||
'--picker-confirm-radius': '12rpx'
|
||||
}" @confirm="handleCertificateGetTimeConfirm" @cancel="handleCertificateGetTimeCancel"></u-datetime-picker>
|
||||
}"
|
||||
@confirm="handleCertificateGetTimeConfirm"
|
||||
@cancel="handleCertificateGetTimeCancel"
|
||||
></u-datetime-picker>
|
||||
|
||||
<u-picker ref="uPicker" :show="singleChoice" :columns="singleChoiceColumns" keyName="NAME"
|
||||
@confirm="fnSingleChoiceConfirm" @cancel="fnSingleChoiceCancel"></u-picker>
|
||||
<u-picker ref="uPicker" :show="singleChoice" :columns="singleChoiceColumns" keyName="NAME" @confirm="fnSingleChoiceConfirm" @cancel="fnSingleChoiceCancel"></u-picker>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
@ -81,7 +75,7 @@ import { validateFieldPhone, validateFieldIdCard } from '@/utils/formValidateFie
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
routeQuery: {},
|
||||
routeQuery: {}, // 上一个页面带过来的路由参数
|
||||
sexsList: [
|
||||
{
|
||||
label: '1',
|
||||
|
@ -95,40 +89,7 @@ export default {
|
|||
singleChoice: false,
|
||||
showCertificateGetTimePopper: false,
|
||||
signVisible: false,
|
||||
educationActions: [
|
||||
{
|
||||
id: '0',
|
||||
name: '小学',
|
||||
},
|
||||
{
|
||||
id: '1',
|
||||
name: '初中',
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
name: '高中',
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
name: '大学专科',
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
name: '大学本科',
|
||||
},
|
||||
{
|
||||
id: '5',
|
||||
name: '研究生',
|
||||
},
|
||||
{
|
||||
id: '6',
|
||||
name: '博士',
|
||||
},
|
||||
{
|
||||
id: '7',
|
||||
name: '其他',
|
||||
}
|
||||
],
|
||||
defaultDatetimePicker: Number(new Date()),
|
||||
singleChoiceColumns: [],
|
||||
ruleFormData: {
|
||||
userInfo: {
|
||||
|
@ -140,7 +101,7 @@ export default {
|
|||
job: '', // 职业
|
||||
gradeCertificate: [], // 等级证书
|
||||
certificateAcquisitionTime: '', // 获取证书时间
|
||||
writeSign: '', // 手写签字
|
||||
writeSign: '' // 手写签字
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
|
@ -154,11 +115,11 @@ export default {
|
|||
{
|
||||
required: true,
|
||||
message: '请输入手机号',
|
||||
trigger: ['change', 'blur'],
|
||||
trigger: ['change', 'blur']
|
||||
},
|
||||
{
|
||||
validator: validateFieldPhone,
|
||||
trigger: ['change', 'blur'],
|
||||
trigger: ['change', 'blur']
|
||||
}
|
||||
],
|
||||
'userInfo.userIdCard': [
|
||||
|
@ -170,7 +131,7 @@ export default {
|
|||
},
|
||||
{
|
||||
validator: validateFieldIdCard,
|
||||
trigger: ['change', 'blur'],
|
||||
trigger: ['change', 'blur']
|
||||
}
|
||||
],
|
||||
'userInfo.sex': {
|
||||
|
@ -218,25 +179,21 @@ export default {
|
|||
},
|
||||
|
||||
onLoad(query) {
|
||||
this.routeQuery = query;
|
||||
this.routeQuery = query // 接收上一个页面传递过来的路由参数
|
||||
},
|
||||
|
||||
methods: {
|
||||
groupChange(n) {
|
||||
console.log('groupChange', n);
|
||||
},
|
||||
radioChange(n) {
|
||||
console.log('radioChange', n);
|
||||
},
|
||||
handleEducationClick() {
|
||||
this.$refs.uPicker.setIndexs([0])
|
||||
this.fnGetDataDictionary('d7d80f08d73a4accbccf4fd3d8d1d867')
|
||||
this.singleChoice = true
|
||||
},
|
||||
fnSingleChoiceConfirm(event) {
|
||||
console.log(event, "sdfasdgf")
|
||||
this.$set(this.ruleFormData.userInfo, 'degreeOfEducation', event.value[0].NAME)
|
||||
this.$set(this.ruleFormData.userInfo, 'degreeOfEducation' + '_BIANMA', event.value[0].BIANMA)
|
||||
this.fnSingleChoiceCancel()
|
||||
},
|
||||
fnSingleChoiceCancel() {
|
||||
this.singleChoice = false
|
||||
},
|
||||
async fnGetDataDictionary(DICTIONARIES_ID) {
|
||||
|
@ -246,71 +203,77 @@ export default {
|
|||
this.singleChoiceColumns = [resData.list]
|
||||
},
|
||||
handleSelectEducation(event) {
|
||||
this.ruleFormData.userInfo.degreeOfEducation = event.name;
|
||||
this.ruleFormData.userInfo.degreeOfEducation = event.name
|
||||
},
|
||||
async afterRead(event) {
|
||||
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
|
||||
let lists = [].concat(event.file);
|
||||
let fileListLen = this.ruleFormData.userInfo.gradeCertificate.length;
|
||||
let lists = [].concat(event.file)
|
||||
lists.map((item) => {
|
||||
this.ruleFormData.userInfo.gradeCertificate.push({
|
||||
...item,
|
||||
status: "uploading",
|
||||
message: "上传中",
|
||||
});
|
||||
});
|
||||
// console.log('this.ruleFormData.userInfo.gradeCertificate :>> ', this.ruleFormData.userInfo.gradeCertificate);
|
||||
// for (let i = 0; i < lists.length; i++) {
|
||||
// const result = await this.uploadFilePromise(lists[i].url);
|
||||
// let item = this.ruleFormData.userInfo.gradeCertificate[fileListLen];
|
||||
// this.ruleFormData.userInfo.gradeCertificate.splice(
|
||||
// fileListLen,
|
||||
// 1,
|
||||
// Object.assign(item, {
|
||||
// status: "success",
|
||||
// message: "",
|
||||
// url: result,
|
||||
// })
|
||||
// );
|
||||
// fileListLen++;
|
||||
// }
|
||||
status: 'success',
|
||||
message: ''
|
||||
})
|
||||
})
|
||||
},
|
||||
deletePic(event) {
|
||||
this.gradeCertificateList.splice(event.index, 1);
|
||||
this.ruleFormData.userInfo.gradeCertificate.splice(event.index, 1)
|
||||
},
|
||||
showCertificateGetTime() {
|
||||
this.showCertificateGetTimePopper = true;
|
||||
this.showCertificateGetTimePopper = true
|
||||
},
|
||||
handleCertificateGetTimeConfirm(event) {
|
||||
this.ruleFormData.userInfo.certificateAcquisitionTime = uni.$u.timeFormat(event.value, 'yyyy-mm-dd')
|
||||
this.ruleFormData.userInfo.certificateAcquisitionTime = uni.$u.timeFormat(event.value, 'yyyy-mm-dd hh:MM')
|
||||
this.handleCertificateGetTimeCancel()
|
||||
},
|
||||
handleCertificateGetTimeCancel() {
|
||||
this.showCertificateGetTimePopper = false;
|
||||
this.showCertificateGetTimePopper = false
|
||||
},
|
||||
handleSign(event) {
|
||||
this.ruleFormData.userInfo.writeSign = event.filePath;
|
||||
this.ruleFormData.userInfo.writeSign = event.filePath
|
||||
},
|
||||
async fnSubmit() {
|
||||
try {
|
||||
await this.$refs.uFormRef.validate()
|
||||
try {
|
||||
console.log("this.ruleFormData.userInfo : >>", this.ruleFormData.userInfo);
|
||||
|
||||
await joinClass({
|
||||
form: this.form,
|
||||
calssId: this.routeQuery.calssId,
|
||||
const classId = this.routeQuery.classId
|
||||
await this.$refs.uFormRef
|
||||
.validate()
|
||||
.then(async () => {
|
||||
let files = []
|
||||
if (this.ruleFormData.userInfo.gradeCertificate[0]) {
|
||||
files.push({
|
||||
name: 'certificatefile',
|
||||
file: this.ruleFormData.userInfo.gradeCertificate[0],
|
||||
uri: this.ruleFormData.userInfo.gradeCertificate[0].url
|
||||
})
|
||||
}
|
||||
if (this.ruleFormData.userInfo.writeSign) {
|
||||
files.push({
|
||||
name: 'signfile',
|
||||
uri: this.ruleFormData.userInfo.writeSign
|
||||
})
|
||||
}
|
||||
// const certificatefileLists = this.ruleFormData.userInfo.gradeCertificate.map(so => so.url); // 接入组合多个证书的上传, 返回数组
|
||||
const params = { ...this.ruleFormData.userInfo }
|
||||
delete params.gradeCertificate
|
||||
delete params.writeSign
|
||||
await joinClass({
|
||||
files,
|
||||
formData: { ...params, classId }
|
||||
})
|
||||
.then(() => {
|
||||
uni.$u.toast('保存成功')
|
||||
setTimeout(() => {
|
||||
uni.$u.route({
|
||||
url: '/pages/train_management/face_authentication',
|
||||
params: { ...this.routeQuery }
|
||||
params: { ...this.routeQuery, type: 'scan_face' }
|
||||
})
|
||||
} catch {
|
||||
}
|
||||
} catch {
|
||||
}, 1500)
|
||||
})
|
||||
.catch((err) => {
|
||||
if (err) uni.$u.toast(err.msg)
|
||||
})
|
||||
})
|
||||
.catch((e) => {
|
||||
uni.$u.toast('请补全必填项')
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue