"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 showshengao = common_vendor.ref(false); const showshengaolist = common_vendor.reactive( Array.from({ length: 61 }, (_, i) => { const v = 140 + i; return { value: String(v), label: `${v}cm` }; }) ); const confirmshowshengao = (item) => { form.height = item[0].value; form.showheight = item[0].label; }; const showtizhong = common_vendor.ref(false); const showtizhonglist = common_vendor.reactive( Array.from({ length: 41 }, (_, i) => { const v = 40 + i; return { value: String(v), label: `${v}kg` }; }) ); const confirmshowtizhong = (item) => { form.weight = item[0].value; form.showweight = item[0].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.maritalStatus = item[0].value; }; const confirmshowhealth = (item) => { form.healthStatus = item[0].value; }; const confirmshowface = (item) => { form.politicalAppearance = item[0].value; }; const confirmshowform = (item) => { form.hukouType = item[0].value; }; const form = common_vendor.reactive({ maritalStatus: "", tel: "", height: "", weight: "", healthStatus: "", politicalAppearance: "", contactName: "", contactTel: "", contactRelationship: "", hukouType: "", openId: common_vendor.index.getStorageSync("openid") }); function isValid11DigitNumber(val) { return /^(\d{11})$/.test(val); } const next = () => { if (!form.maritalStatus) { 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.contactName) { common_vendor.index.showToast({ title: "请填写紧急联系人", icon: "none" }); } else if (!form.contactTel) { common_vendor.index.showToast({ title: "请填写紧急联系人电话", icon: "none" }); } else if (!isValid11DigitNumber(form.contactTel)) { common_vendor.index.showToast({ title: "紧急联系人手机号格式错误", icon: "none" }); return; } else if (!form.contactRelationship) { common_vendor.index.showToast({ title: "请填写联系人和本人的关系", icon: "none" }); } else if (!form.hukouType) { 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")) { common_vendor.index.setStorageSync("isstaffchange", true); let data = common_vendor.index.getStorageSync("baddata"); const keys = [ "maritalStatus", "tel", "height", "weight", "healthStatus", "politicalAppearance", "contactName", "contactTel", "contactRelationship", "hukouType", "currentAddress" ]; keys.forEach((key) => { form[key] = data[key] || ""; }); form.height = Number(form.height); form.weight = Number(form.weight); form.showheight = form.height + "cm"; form.showweight = form.weight + "kg"; } else { common_vendor.index.setStorageSync("isstaffchange", false); } }); return (_ctx, _cache) => { return { a: common_vendor.o(goBack), b: `${common_vendor.index.getStorageSync("moveHeight") + 40}px`, c: `${common_vendor.index.getStorageSync("moveHeight") + 40}px`, d: form.maritalStatus, e: common_vendor.o(($event) => form.maritalStatus = $event.detail.value), f: common_vendor.o(($event) => showmarry.value = true), g: common_vendor.o(confirmmarry), h: common_vendor.o(($event) => showmarry.value = $event), i: common_vendor.p({ list: showmarrylist, modelValue: showmarry.value }), j: form.tel, k: common_vendor.o(($event) => form.tel = $event.detail.value), l: form.showheight, m: common_vendor.o(($event) => form.showheight = $event.detail.value), n: common_vendor.o(($event) => showshengao.value = true), o: common_vendor.o(confirmshowshengao), p: common_vendor.o(($event) => showshengao.value = $event), q: common_vendor.p({ list: showshengaolist, ["default-value"]: [showshengaolist.findIndex((item) => item.value == form.height)], modelValue: showshengao.value }), r: form.showweight, s: common_vendor.o(($event) => form.showweight = $event.detail.value), t: common_vendor.o(($event) => showtizhong.value = true), v: common_vendor.o(confirmshowtizhong), w: common_vendor.o(($event) => showtizhong.value = $event), x: common_vendor.p({ list: showtizhonglist, ["default-value"]: [showtizhonglist.findIndex((item) => item.value == form.weight)], modelValue: showtizhong.value }), y: form.healthStatus, z: common_vendor.o(($event) => form.healthStatus = $event.detail.value), A: common_vendor.o(($event) => showhealth.value = true), B: common_vendor.o(confirmshowhealth), C: common_vendor.o(($event) => showhealth.value = $event), D: common_vendor.p({ list: showhealthlist, modelValue: showhealth.value }), E: form.politicalAppearance, F: common_vendor.o(($event) => form.politicalAppearance = $event.detail.value), G: common_vendor.o(($event) => showface.value = true), H: common_vendor.o(confirmshowface), I: common_vendor.o(($event) => showface.value = $event), J: common_vendor.p({ list: showfacelist, modelValue: showface.value }), K: form.contactName, L: common_vendor.o(($event) => form.contactName = $event.detail.value), M: form.contactTel, N: common_vendor.o(($event) => form.contactTel = $event.detail.value), O: form.contactRelationship, P: common_vendor.o(($event) => form.contactRelationship = $event.detail.value), Q: form.hukouType, R: common_vendor.o(($event) => form.hukouType = $event.detail.value), S: common_vendor.o(($event) => showform.value = true), T: form.currentAddress, U: common_vendor.o(($event) => form.currentAddress = $event.detail.value), V: common_vendor.o(confirmshowform), W: common_vendor.o(($event) => showform.value = $event), X: common_vendor.p({ list: showformlist, modelValue: showform.value }), Y: 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