Commit 36fe9a3e authored by 刘斌's avatar 刘斌

fix: 完善文旅片区自定义部门

parent f2d8147e
......@@ -3,7 +3,7 @@
<van-form @submit="onSubmit" required="auto">
<div class="section-card">
<div class="section-title">基本信息</div>
<div class="form-item">
<div class="form-item" v-if="!hasDid">
<div class="item-label">所属板块 <span style="color: #ee0a24">*</span></div>
<van-field
v-model="form.plate"
......@@ -12,7 +12,7 @@
name="plateId"
class="custom-field"
placeholder="请选择所属板块"
:rules="[{ required: true, message: '请选择所属板块' }]"
:rules="[{ required: !hasDid, message: '请选择所属板块' }]"
:border="false"
@click="showPlatePicker = true"
>
......@@ -579,7 +579,7 @@
<!-- Row 2 -->
<div class="form-item">
<div class="item-label">出生年月</div>
<div class="item-label">出生年月 <span style="color: #ee0a24">*</span></div>
<div class="date-input-box" @click="onFamilyBirthClick(i)">
<span>{{ fm.birthDate || 'YYYY-MM-DD' }}</span>
<van-icon name="calendar-o" color="#969799" />
......@@ -588,7 +588,7 @@
<!-- Row 3 -->
<div class="form-item">
<div class="item-label">工作单位及职务</div>
<div class="item-label">工作单位及职务 <span style="color: #ee0a24">*</span></div>
<div class="custom-input">
<input v-model="fm.companyAndJob" placeholder="单位与职务" class="native-input" />
</div>
......@@ -596,7 +596,7 @@
<!-- Row 4 -->
<div class="form-item">
<div class="item-label">联系方式</div>
<div class="item-label">联系方式 <span style="color: #ee0a24">*</span></div>
<div class="custom-input">
<input v-model="fm.contact" type="tel" placeholder="手机号" class="native-input" />
</div>
......@@ -902,6 +902,12 @@ if (_tid) {
form.tid = _tid;
}
const _did = new URL(window.location.href).searchParams.get('did');
const hasDid = ref(!!_did);
if (_did) {
form.plateId = Number(_did);
}
const politicalOptions = [
{ value: '1', text: '党员' },
{ value: '2', text: '预备党员' },
......@@ -1205,6 +1211,10 @@ function loadCache() {
if (cached) {
const data = JSON.parse(cached);
Object.assign(form, data);
if (_did) {
form.plateId = Number(_did);
form.plate = '';
}
if (_tid) {
form.tid = _tid;
}
......@@ -1230,7 +1240,9 @@ const saveImmediately = () => {
};
onMounted(() => {
if (!hasDid.value) {
fetchPlateList();
}
loadCache();
const onVisibilityChange = () => {
if (document.visibilityState === 'hidden') saveImmediately();
......@@ -1293,7 +1305,7 @@ async function onSubmit() {
}
if (form.familyMembers && form.familyMembers.length > 0) {
for (const item of form.familyMembers) {
if (!item.name || !item.relation) {
if (!item.name || !item.relation || !item.birthDate || !item.companyAndJob || !item.contact) {
showFailToast('家庭成员信息不全!');
submitting.value = false;
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment