hldy_xcx/pages/addstaff/information.vue

421 lines
9.6 KiB
Vue
Raw Normal View History

2025-08-21 16:52:59 +08:00
<template>
<div class="container">
<view class="title-back">
<view class="left-father" @click="goBack">
<image class="back-img" src="https://www.focusnu.com/media/directive/index/left.png" />
<view style="font-size: 30rpx;">入职登记表</view>
</view>
</view>
<view class="white-content">
<view class="content-title">
<view class="shu"></view>
<view class="content-weight">个人信息</view>
</view>
<view class="one" style="position: relative;" @click="showmarry = true">
<view class="one-left">婚否</view>
<input disabled style="cursor: not-allowed;pointer-events: none;" class="one-right" type="text"
placeholder="请选择婚否" v-model="form.marriedOrNot" />
<image class="triangle-down" src="https://www.focusnu.com/media/directive/login/xia.png" />
</view>
<u-select style="font-size: 35rpx;" v-model="showmarry" :list="showmarrylist"
@confirm="confirmmarry"></u-select>
<view class="one">
<view class="one-left">联系电话</view>
<input class="one-right" type="number" maxlength="11" placeholder="请输入联系电话" v-model="form.tel" />
</view>
<view class="one">
<view class="one-left">身高</view>
<input class="one-right" type="number" maxlength="11" placeholder="请输入身高(单位:CM)"
v-model="form.height" />
</view>
<view class="one">
<view class="one-left">体重</view>
<input class="one-right" type="number" maxlength="11" placeholder="请输入体重(单位:KG)"
v-model="form.weight" />
</view>
<view class="one" style="position: relative;" @click="showhealth = true">
<view class="one-left">健康状况</view>
<input disabled style="cursor: not-allowed;pointer-events: none;" class="one-right" type="text"
placeholder="请选择健康状况" v-model="form.healthStatus" />
<image class="triangle-down" src="https://www.focusnu.com/media/directive/login/xia.png" />
</view>
<u-select style="font-size: 35rpx;" v-model="showhealth" :list="showhealthlist"
@confirm="confirmshowhealth"></u-select>
<view class="one" style="position: relative;" @click="showface = true">
<view class="one-left">政治面貌</view>
<input disabled style="cursor: not-allowed;pointer-events: none;" class="one-right" type="text"
placeholder="请选择政治面貌" v-model="form.politicalAppearance" />
<image class="triangle-down" src="https://www.focusnu.com/media/directive/login/xia.png" />
</view>
<u-select style="font-size: 35rpx;" v-model="showface" :list="showfacelist"
@confirm="confirmshowface"></u-select>
<view class="one">
<view class="one-left">紧急联系人</view>
<input class="one-right" maxlength="11" placeholder="请输入紧急联系人" v-model="form.emergencyContact" />
</view>
<view class="one">
<view class="one-left">紧急联系人电话</view>
<input class="one-right" maxlength="11" type="number" placeholder="请输入紧急联系人电话"
v-model="form.emergencyTel" />
</view>
<view class="one">
<view class="one-left">联系人与本人关系</view>
<input class="one-right" maxlength="11" placeholder="请输入联系人与本人关系"
v-model="form.emergencyRelationship" />
</view>
<view class="one" style="position: relative;" @click="showform = true">
<view class="one-left">户口性质</view>
<input disabled style="cursor: not-allowed;pointer-events: none;" class="one-right" type="text"
placeholder="请选择户口性质" v-model="form.hukouNature" />
<image class="triangle-down" src="https://www.focusnu.com/media/directive/login/xia.png" />
</view>
<u-select style="font-size: 35rpx;" v-model="showform" :list="showformlist"
@confirm="confirmshowform"></u-select>
</view>
<view style="display: flex;width: 100%;">
<view class="finish-button" @click="next">
确认并继续
</view>
</view>
</div>
</template>
<script setup>
import {
ref,
reactive
} from 'vue'
import {
onLoad,
onShow
} from '@dcloudio/uni-app';
import {
base_url
} from '@/request/index.js';
import {
changemessage
} from './api/addjigou.js'
import model from "@/compontent/public/model.vue"
// const showmarry
const nameArray = ["姓名", "性别", "身份证号码", "民族", "出生日期", "住址", "签发机关", "有效期限"];
const textArray = reactive(["", "", "", "", "", "", "", ""]);
const states = ["审核中", "审核未通过", "审核通过"];
const showmarry = ref(false);
const showmarrylist = reactive(
[{
value: '已婚',
label: '已婚',
},
{
value: '未婚',
label: '未婚',
},
]
)
const showhealth = ref(false);
const showhealthlist = reactive(
[{
value: '健康',
label: '健康',
},
{
value: '患病',
label: '患病',
},
]
)
const showface = ref(false);
const showfacelist = reactive(
[{
value: '共产党员',
label: '共产党员',
},
{
value: '国民党',
label: '国民党',
},
{
value: '民主党',
label: '民主党',
},
{
value: '无党派',
label: '无党派',
},
]
)
const showform = ref(false);
const showformlist = reactive(
[{
value: '非农业',
label: '非农业',
},
{
value: '农业',
label: '农业',
},
]
)
const confirmmarry = (item) => {
form.marriedOrNot = item[0].value
}
const confirmshowhealth = (item) => {
form.healthStatus = item[0].value
}
const confirmshowface = (item) => {
form.politicalAppearance = item[0].value
}
const confirmshowform = (item) => {
form.hukouNature = item[0].value
}
const form = reactive({
marriedOrNot: "",
tel: "",
height: "",
weight: "",
healthStatus: "",
politicalAppearance: "",
emergencyContact: "",
emergencyTel: "",
emergencyRelationship: "",
hukouNature: ""
})
function isValid11DigitNumber(val) {
return /^(\d{11})$/.test(val);
}
const next = () => {
if (!form.marriedOrNot) {
uni.showToast({
title: '请填写婚否',
icon: 'error'
})
} else if (!form.tel) {
uni.showToast({
title: '请填写联系电话',
icon: 'error'
})
} else if (!isValid11DigitNumber(form.tel)) {
uni.showToast({
title: '手机号格式错误',
icon: 'error'
})
return
} else if (!form.height) {
uni.showToast({
title: '请填写身高',
icon: 'error'
})
} else if (!form.weight) {
uni.showToast({
title: '请填写体重',
icon: 'error'
})
} else if (!form.healthStatus) {
uni.showToast({
title: '请填写健康状态',
icon: 'error'
})
} else if (!form.politicalAppearance) {
uni.showToast({
title: '请填写政治面貌',
icon: 'error'
})
} else if (!form.emergencyContact) {
uni.showToast({
title: '请填写紧急联系人',
icon: 'none'
})
} else if (!form.emergencyTel) {
uni.showToast({
title: '请填写紧急联系人电话',
icon: 'none'
})
} else if (!isValid11DigitNumber(form.emergencyTel)) {
uni.showToast({
title: '紧急联系人手机号格式错误',
icon: 'none'
})
return
} else if (!form.emergencyRelationship) {
uni.showToast({
title: '请填写联系人和本人的关系',
icon: 'none'
})
} else if (!form.hukouNature) {
uni.showToast({
title: '请填写户口性质',
icon: 'error'
})
} else {
const data = form
const merged2 = {
...uni.getStorageSync('backhuancun'),
...data
};
uni.setStorageSync("backhuancun", merged2);
uni.navigateTo({
url: "/pages/addstaff/IDcard"
});
}
}
const goBack = () => {
uni.navigateBack()
}
onLoad(() => {
if (uni.getStorageSync('baddata')) {
let data = uni.getStorageSync('baddata');
form = data
}
})
</script>
<style lang="scss" scoped>
.container {
display: flex;
flex-direction: column;
min-height: 100vh;
width: 100%;
background-color: #F7F7F7;
position: relative;
.white-content {
width: 90%;
margin-left: 5%;
border-radius: 35rpx;
.content-title {
display: flex;
align-items: center;
height: 100rpx;
position: relative;
font-weight: 600;
.content-weight {
font-size: 32rpx;
}
.content-img {
position: absolute;
right: 0;
top: 0;
width: 400rpx;
height: 100%;
}
}
}
}
.finish-button {
display: flex;
justify-content: center;
align-items: center;
width: 80%;
height: 90rpx;
margin: 0rpx auto;
margin-bottom: 80rpx;
margin-top: 20rpx;
color: #fff;
background: linear-gradient(to left, #00C9FF, #0076FF);
border-radius: 35rpx;
font-size: 33rpx;
}
.title-back {
margin-top: 100rpx;
width: 100%;
height: 100rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.left-father {
display: flex;
align-items: center;
.back-img {
width: 45rpx;
height: 40rpx;
margin-left: 40rpx;
margin-right: 15rpx;
}
}
.shu {
width: 14rpx;
height: 36rpx;
background-color: #0097FF;
border-radius: 10rpx;
margin: 3rpx 20rpx 0 30rpx;
}
.line {
margin: 10rpx 0;
}
.one {
width: 90%;
margin-left: 5%;
height: 100rpx;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10rpx;
.one-left {
margin-left: 10rpx;
font-size: 30rpx;
}
.one-right {
font-size: 30rpx;
height: 100%;
color: #999999;
overflow: hidden;
/* 隐藏超出内容 */
white-space: nowrap;
/* 不换行 */
font-size: 25rpx;
text-overflow: ellipsis;
width: 350rpx;
display: flex;
}
.triangle-down {
position: absolute;
top: 50%;
transform: translateY(-50%);
right: 26rpx;
width: 20rpx;
height: 20rpx;
}
}
</style>