199 lines
8.6 KiB
JavaScript
199 lines
8.6 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const pages_yuangongindex_api = require("./api.js");
|
|
const pages_addstaff_api_addjigou = require("../addstaff/api/addjigou.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, _c;
|
|
if (hulitarget.value === index) {
|
|
hulitarget.value = -1;
|
|
buttonOpen.value = false;
|
|
} else {
|
|
hulitarget.value = index;
|
|
if ((((_a = hulijigouArray.value[index].employeesApiEntity) == null ? void 0 : _a.applyType) == 0 || ((_b = hulijigouArray.value[index].employeesApiEntity) == null ? void 0 : _b.applyType) == 1) && (hulijigouArray.value[index].employeesApiEntity.status == 1 || hulijigouArray.value[index].employeesApiEntity.status == 2) || ((_c = hulijigouArray.value[index].employeesApiEntity) == null ? void 0 : _c.applyType) == 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_yuangongindex_api.getOrgInfo(supervalue.value).then((res) => {
|
|
if (res.success) {
|
|
hulijigouArray.value = res.result.records;
|
|
}
|
|
});
|
|
};
|
|
const sumbit = common_vendor.ref(false);
|
|
const apply = () => {
|
|
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_addstaff_api_addjigou.getMessageList().then((res) => {
|
|
if (Array.isArray(res.result) && res.result.length === 0) {
|
|
common_vendor.index.setStorageSync("nostaffmessage", hulijigouArray.value[hulitarget.value].orgCode);
|
|
common_vendor.index.setStorageSync("specicalid", "");
|
|
common_vendor.index.setStorageSync("baddata", "");
|
|
common_vendor.index.setStorageSync("backhuancun", {});
|
|
common_vendor.index.navigateTo({
|
|
url: `/pages/addstaff/information`
|
|
});
|
|
} else {
|
|
pages_yuangongindex_api.Apply(data).then((data2) => {
|
|
if (data2.success) {
|
|
common_vendor.index.requestSubscribeMessage({
|
|
// 这里填后台申请好的 templateId 数组
|
|
tmplIds: ["cWVzXm1C-iitx1gNFn1nZdijq9R_3fCv8vLbiqs9zww"],
|
|
success: (res2) => {
|
|
popupshow.value = true;
|
|
setTimeout(() => search(), 1e3);
|
|
},
|
|
fail: (err) => {
|
|
common_vendor.index.__f__("error", "at pages/yuangongindex/searchjigou.vue:295", "订阅接口调用失败:", err);
|
|
common_vendor.index.showToast({
|
|
title: "订阅失败",
|
|
icon: "none"
|
|
});
|
|
}
|
|
});
|
|
}
|
|
setTimeout(() => sumbit.value = false, 1e3);
|
|
});
|
|
}
|
|
});
|
|
};
|
|
return (_ctx, _cache) => {
|
|
return common_vendor.e({
|
|
a: common_vendor.o(goBack),
|
|
b: `${common_vendor.index.getStorageSync("moveHeight") + 40}px`,
|
|
c: `${common_vendor.index.getStorageSync("moveHeight") + 40}px`,
|
|
d: common_vendor.o(search),
|
|
e: common_vendor.o([($event) => supervalue.value = $event.detail.value, detectinput]),
|
|
f: supervalue.value,
|
|
g: supervalue.value
|
|
}, supervalue.value ? {
|
|
h: common_vendor.o(clearvalue)
|
|
} : {}, {
|
|
i: common_vendor.o(search),
|
|
j: common_vendor.f(hulijigouArray.value, (item, index, i0) => {
|
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
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` && item.employeesApiEntity.applyType != `2`
|
|
}, ((_b = item.employeesApiEntity) == null ? void 0 : _b.status) === `1` && item.employeesApiEntity.applyType != `2` ? {
|
|
e: common_vendor.t(item.employeesApiEntity.applyType == "0" ? `待确认` : `申请中`)
|
|
} : {}, {
|
|
f: ((_c = item.employeesApiEntity) == null ? void 0 : _c.status) === `2` && item.employeesApiEntity.applyType != `2`
|
|
}, ((_d = item.employeesApiEntity) == null ? void 0 : _d.status) === `2` && item.employeesApiEntity.applyType != `2` ? {
|
|
g: common_vendor.t(item.employeesApiEntity.applyType == "0" ? `已接受` : `申请通过`)
|
|
} : {}, {
|
|
h: ((_e = item.employeesApiEntity) == null ? void 0 : _e.status) === `3` && item.employeesApiEntity.applyType != `2`
|
|
}, ((_f = item.employeesApiEntity) == null ? void 0 : _f.status) === `3` && item.employeesApiEntity.applyType != `2` ? {
|
|
i: common_vendor.t(item.employeesApiEntity.applyType == "0" ? `已拒绝` : `申请驳回`)
|
|
} : {}, {
|
|
j: ((_g = item.employeesApiEntity) == null ? void 0 : _g.status) === `1` && item.employeesApiEntity.applyType == `2`
|
|
}, ((_h = item.employeesApiEntity) == null ? void 0 : _h.status) === `1` && item.employeesApiEntity.applyType == `2` ? {} : {}, {
|
|
k: ((_i = item.employeesApiEntity) == null ? void 0 : _i.status) === `2` && item.employeesApiEntity.applyType == `2`
|
|
}, ((_j = item.employeesApiEntity) == null ? void 0 : _j.status) === `2` && item.employeesApiEntity.applyType == `2` ? {} : {}, {
|
|
l: ((_k = item.employeesApiEntity) == null ? void 0 : _k.status) === `3` && item.employeesApiEntity.applyType == `2`
|
|
}, ((_l = item.employeesApiEntity) == null ? void 0 : _l.status) === `3` && item.employeesApiEntity.applyType == `2` ? {} : {}, {
|
|
m: common_vendor.t(item.comRegisterAddress),
|
|
n: index,
|
|
o: common_vendor.s(hulitarget.value === index ? {
|
|
border: `4rpx solid #0093FF`
|
|
} : {}),
|
|
p: common_vendor.o(($event) => clickCard(index), index)
|
|
});
|
|
}),
|
|
k: buttonOpen.value
|
|
}, buttonOpen.value ? {
|
|
l: common_vendor.o(apply)
|
|
} : {}, {
|
|
m: common_vendor.o(($event) => jumpRuzhu()),
|
|
n: common_vendor.o(($event) => popupshow.value = $event),
|
|
o: common_vendor.p({
|
|
mode: "bottom",
|
|
["border-radius"]: "40",
|
|
modelValue: popupshow.value
|
|
})
|
|
});
|
|
};
|
|
}
|
|
});
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-0e7ef1bb"]]);
|
|
wx.createPage(MiniProgramPage);
|
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/yuangongindex/searchjigou.js.map
|