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

120 lines
4.3 KiB
JavaScript

"use strict";
const common_vendor = require("../../common/vendor.js");
const pages_yuangongindex_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) {
const hulijigouArray = common_vendor.ref([]);
const hulitarget = common_vendor.ref(-1);
const popupshow = common_vendor.ref(false);
const supervalue = common_vendor.ref("");
const jumpRuzhu = () => {
common_vendor.index.navigateTo({
url: "/pages/yuangongindex/workjoin"
});
};
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 = "";
};
const goBack = () => {
common_vendor.index.navigateBack();
};
const search = () => {
pages_yuangongindex_api.getOrgInfo(supervalue.value).then((res) => {
if (res.success) {
hulijigouArray.value = res.result.records;
}
});
};
const apply = () => {
let data = common_vendor.index.getStorageSync("staff");
data = {
...data,
employeeId: data.id,
id: null,
createTime: null,
updateBy: null,
updateTime: null,
orgCode: hulijigouArray.value[hulitarget.value].orgCode
};
pages_yuangongindex_api.Apply(data).then((data2) => {
if (data2.success) {
popupshow.value = true;
setTimeout(() => search(), 1e3);
}
});
};
search();
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.o(goBack),
b: common_vendor.o(search),
c: supervalue.value,
d: common_vendor.o(($event) => supervalue.value = $event.detail.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: hulitarget.value === index
}, hulitarget.value === index ? {} : {}, {
b: ((_a = item.employeesApiEntity) == null ? void 0 : _a.status) === `1`
}, ((_b = item.employeesApiEntity) == null ? void 0 : _b.status) === `1` ? {} : {}, {
c: ((_c = item.employeesApiEntity) == null ? void 0 : _c.status) === `2`
}, ((_d = item.employeesApiEntity) == null ? void 0 : _d.status) === `2` ? {} : {}, {
d: ((_e = item.employeesApiEntity) == null ? void 0 : _e.status) === `3`
}, ((_f = item.employeesApiEntity) == null ? void 0 : _f.status) === `3` ? {} : {}, {
e: common_vendor.t(item.departName),
f: index,
g: common_vendor.s(hulitarget.value === index ? {
border: `4rpx solid #0093FF`
} : {}),
h: 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-0e7ef1bb"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/yuangongindex/searchjigou.js.map