hldy_xcx/unpackage/dist/dev/mp-weixin/pages/oldmanindex/searchjigou.js

168 lines
6.0 KiB
JavaScript

"use strict";
const common_vendor = require("../../common/vendor.js");
const pages_oldmanindex_api = require("./api.js");
if (!Array) {
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
_easycom_u_popup2();
}
const _easycom_u_popup = () => "../../uni_modules/vk-uview-ui/components/u-popup/u-popup.js";
if (!Math) {
_easycom_u_popup();
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "searchjigou",
setup(__props) {
common_vendor.onShow(
() => search()
);
const hulijigouArray = common_vendor.ref([]);
const hulitarget = common_vendor.ref(-1);
const popupshow = common_vendor.ref(false);
const supervalue = common_vendor.ref("");
const jumpRuzhu = () => {
popupshow.value = false;
common_vendor.index.navigateTo({
url: "/pages/yuangongindex/workjoin"
});
};
let inputTimer = null;
const detectinput = () => {
if (inputTimer)
clearTimeout(inputTimer);
inputTimer = setTimeout(() => {
inputTimer = null;
search();
}, 600);
};
common_vendor.onUnmounted(() => {
if (inputTimer)
clearTimeout(inputTimer);
});
const buttonOpen = common_vendor.ref(false);
const clickCard = (index) => {
var _a, _b;
if (hulitarget.value === index) {
hulitarget.value = -1;
buttonOpen.value = false;
} else {
hulitarget.value = index;
if (((_a = hulijigouArray.value[index].employeesApiEntity) == null ? void 0 : _a.status) == 1 || ((_b = hulijigouArray.value[index].employeesApiEntity) == null ? void 0 : _b.status) == 2) {
buttonOpen.value = false;
} else {
buttonOpen.value = true;
}
}
};
const clearvalue = () => {
hulitarget.value = -1;
supervalue.value = "";
search();
};
const goBack = () => {
common_vendor.index.navigateBack();
};
const search = () => {
buttonOpen.value = false;
hulitarget.value = -1;
pages_oldmanindex_api.getOrgInfo(supervalue.value).then((res) => {
if (res.success) {
hulijigouArray.value = res.result.records;
}
});
};
const sumbit = common_vendor.ref(false);
const apply = () => {
if (sumbit.value) {
return;
}
sumbit.value = true;
let data = common_vendor.index.getStorageSync("staff");
data = {
...data,
dateOfBirth: data.birthDate,
marriedOrNot: data.maritalStatus,
address: data.address,
emergencyContact: data.contactName,
emergencyTel: data.contactTel,
emergencyRelationship: data.contactRelationship,
hukouNature: data.hukouType,
idCardPositive: data.cardZmPath,
idCardNegative: data.cardFmPath,
healthCertificatePositive: data.healthZmPath,
healthCertificateNegative: data.healthFmPath,
bankPositive: data.bankZmPath,
bankNegative: data.bankFmPath,
qualification: data.qualificationPath,
noCrimeCertificate: data.noCrimeCertificate,
houseAddress: data.idCardAddress,
employeeId: data.id,
id: null,
createTime: null,
updateBy: null,
updateTime: null,
orgCode: hulijigouArray.value[hulitarget.value].orgCode
};
pages_oldmanindex_api.Apply(data).then((data2) => {
if (data2.success) {
popupshow.value = true;
setTimeout(() => search(), 1e3);
}
setTimeout(() => sumbit.value = false, 1e3);
});
};
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.o(goBack),
b: common_vendor.o(search),
c: common_vendor.o([($event) => supervalue.value = $event.detail.value, detectinput]),
d: supervalue.value,
e: supervalue.value
}, supervalue.value ? {
f: common_vendor.o(clearvalue)
} : {}, {
g: common_vendor.o(search),
h: common_vendor.f(hulijigouArray.value, (item, index, i0) => {
var _a, _b, _c, _d, _e, _f;
return common_vendor.e({
a: common_vendor.t(item.departName),
b: common_vendor.t(item.comLegalPerson),
c: common_vendor.t(item.tel),
d: ((_a = item.employeesApiEntity) == null ? void 0 : _a.status) === `1`
}, ((_b = item.employeesApiEntity) == null ? void 0 : _b.status) === `1` ? {
e: common_vendor.t(item.employeesApiEntity.isInvited == "1" ? "申请中" : "待确认")
} : {}, {
f: ((_c = item.employeesApiEntity) == null ? void 0 : _c.status) === `2`
}, ((_d = item.employeesApiEntity) == null ? void 0 : _d.status) === `2` ? {
g: common_vendor.t(item.employeesApiEntity.isInvited == "1" ? "申请通过" : "已接受")
} : {}, {
h: ((_e = item.employeesApiEntity) == null ? void 0 : _e.status) === `3`
}, ((_f = item.employeesApiEntity) == null ? void 0 : _f.status) === `3` ? {
i: common_vendor.t(item.employeesApiEntity.isInvited == "1" ? "申请驳回" : "已拒绝")
} : {}, {
j: common_vendor.t(item.comRegisterAddress),
k: index,
l: common_vendor.s(hulitarget.value === index ? {
border: `4rpx solid #0093FF`
} : {}),
m: common_vendor.o(($event) => clickCard(index), index)
});
}),
i: buttonOpen.value
}, buttonOpen.value ? {
j: common_vendor.o(apply)
} : {}, {
k: common_vendor.o(($event) => jumpRuzhu()),
l: common_vendor.o(($event) => popupshow.value = $event),
m: common_vendor.p({
mode: "bottom",
["border-radius"]: "40",
modelValue: popupshow.value
})
});
};
}
});
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-35e6cd4d"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/oldmanindex/searchjigou.js.map