hldy_xcx/unpackage/dist/dev/mp-weixin/pages/addstaff/information.js

245 lines
7.5 KiB
JavaScript
Raw Normal View History

2025-08-21 16:52:59 +08:00
"use strict";
const common_vendor = require("../../common/vendor.js");
if (!Array) {
const _easycom_u_select2 = common_vendor.resolveComponent("u-select");
_easycom_u_select2();
}
const _easycom_u_select = () => "../../uni_modules/vk-uview-ui/components/u-select/u-select.js";
if (!Math) {
_easycom_u_select();
}
const _sfc_main = {
__name: "information",
setup(__props) {
common_vendor.reactive(["", "", "", "", "", "", "", ""]);
const showmarry = common_vendor.ref(false);
const showmarrylist = common_vendor.reactive(
[
{
value: "已婚",
label: "已婚"
},
{
value: "未婚",
label: "未婚"
}
]
);
const showhealth = common_vendor.ref(false);
const showhealthlist = common_vendor.reactive(
[
{
value: "健康",
label: "健康"
},
{
value: "患病",
label: "患病"
}
]
);
const showface = common_vendor.ref(false);
const showfacelist = common_vendor.reactive(
[
{
value: "共产党员",
label: "共产党员"
},
{
value: "国民党",
label: "国民党"
},
{
value: "民主党",
label: "民主党"
},
{
value: "无党派",
label: "无党派"
}
]
);
const showform = common_vendor.ref(false);
const showformlist = common_vendor.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 = common_vendor.reactive({
marriedOrNot: "",
tel: "",
height: "",
weight: "",
healthStatus: "",
politicalAppearance: "",
emergencyContact: "",
emergencyTel: "",
emergencyRelationship: "",
hukouNature: ""
});
function isValid11DigitNumber(val) {
return /^(\d{11})$/.test(val);
}
const next = () => {
if (!form.marriedOrNot) {
common_vendor.index.showToast({
title: "请填写婚否",
icon: "error"
});
} else if (!form.tel) {
common_vendor.index.showToast({
title: "请填写联系电话",
icon: "error"
});
} else if (!isValid11DigitNumber(form.tel)) {
common_vendor.index.showToast({
title: "手机号格式错误",
icon: "error"
});
return;
} else if (!form.height) {
common_vendor.index.showToast({
title: "请填写身高",
icon: "error"
});
} else if (!form.weight) {
common_vendor.index.showToast({
title: "请填写体重",
icon: "error"
});
} else if (!form.healthStatus) {
common_vendor.index.showToast({
title: "请填写健康状态",
icon: "error"
});
} else if (!form.politicalAppearance) {
common_vendor.index.showToast({
title: "请填写政治面貌",
icon: "error"
});
} else if (!form.emergencyContact) {
common_vendor.index.showToast({
title: "请填写紧急联系人",
icon: "none"
});
} else if (!form.emergencyTel) {
common_vendor.index.showToast({
title: "请填写紧急联系人电话",
icon: "none"
});
} else if (!isValid11DigitNumber(form.emergencyTel)) {
common_vendor.index.showToast({
title: "紧急联系人手机号格式错误",
icon: "none"
});
return;
} else if (!form.emergencyRelationship) {
common_vendor.index.showToast({
title: "请填写联系人和本人的关系",
icon: "none"
});
} else if (!form.hukouNature) {
common_vendor.index.showToast({
title: "请填写户口性质",
icon: "error"
});
} else {
const data = form;
const merged2 = {
...common_vendor.index.getStorageSync("backhuancun"),
...data
};
common_vendor.index.setStorageSync("backhuancun", merged2);
common_vendor.index.navigateTo({
url: "/pages/addstaff/IDcard"
});
}
};
const goBack = () => {
common_vendor.index.navigateBack();
};
common_vendor.onLoad(() => {
if (common_vendor.index.getStorageSync("baddata")) {
let data = common_vendor.index.getStorageSync("baddata");
form = data;
}
});
return (_ctx, _cache) => {
return {
a: common_vendor.o(goBack),
b: form.marriedOrNot,
c: common_vendor.o(($event) => form.marriedOrNot = $event.detail.value),
d: common_vendor.o(($event) => showmarry.value = true),
e: common_vendor.o(confirmmarry),
f: common_vendor.o(($event) => showmarry.value = $event),
g: common_vendor.p({
list: showmarrylist,
modelValue: showmarry.value
}),
h: form.tel,
i: common_vendor.o(($event) => form.tel = $event.detail.value),
j: form.height,
k: common_vendor.o(($event) => form.height = $event.detail.value),
l: form.weight,
m: common_vendor.o(($event) => form.weight = $event.detail.value),
n: form.healthStatus,
o: common_vendor.o(($event) => form.healthStatus = $event.detail.value),
p: common_vendor.o(($event) => showhealth.value = true),
q: common_vendor.o(confirmshowhealth),
r: common_vendor.o(($event) => showhealth.value = $event),
s: common_vendor.p({
list: showhealthlist,
modelValue: showhealth.value
}),
t: form.politicalAppearance,
v: common_vendor.o(($event) => form.politicalAppearance = $event.detail.value),
w: common_vendor.o(($event) => showface.value = true),
x: common_vendor.o(confirmshowface),
y: common_vendor.o(($event) => showface.value = $event),
z: common_vendor.p({
list: showfacelist,
modelValue: showface.value
}),
A: form.emergencyContact,
B: common_vendor.o(($event) => form.emergencyContact = $event.detail.value),
C: form.emergencyTel,
D: common_vendor.o(($event) => form.emergencyTel = $event.detail.value),
E: form.emergencyRelationship,
F: common_vendor.o(($event) => form.emergencyRelationship = $event.detail.value),
G: form.hukouNature,
H: common_vendor.o(($event) => form.hukouNature = $event.detail.value),
I: common_vendor.o(($event) => showform.value = true),
J: common_vendor.o(confirmshowform),
K: common_vendor.o(($event) => showform.value = $event),
L: common_vendor.p({
list: showformlist,
modelValue: showform.value
}),
M: common_vendor.o(next)
};
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-5da0d94e"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/addstaff/information.js.map