2025-09-02 16:45:54 +08:00
|
|
|
"use strict";
|
|
|
|
|
const common_vendor = require("../../common/vendor.js");
|
|
|
|
|
const pages_addstaff_api_addjigou = require("../addstaff/api/addjigou.js");
|
2025-09-09 17:45:04 +08:00
|
|
|
const pages_yuangongindex_api = require("./api.js");
|
2025-09-02 16:45:54 +08:00
|
|
|
if (!Math) {
|
|
|
|
|
(model + downMenu)();
|
|
|
|
|
}
|
|
|
|
|
const downMenu = () => "../../compontent/public/yuangongdownmenu.js";
|
|
|
|
|
const model = () => "../../compontent/public/model.js";
|
|
|
|
|
const _sfc_main = {
|
|
|
|
|
__name: "index",
|
|
|
|
|
setup(__props) {
|
|
|
|
|
const show = common_vendor.ref(false);
|
|
|
|
|
const content = common_vendor.ref("");
|
2025-09-29 10:40:43 +08:00
|
|
|
const buttonArray = common_vendor.ref(["信息变更", "员工功能", "员工功能"]);
|
2025-09-02 16:45:54 +08:00
|
|
|
const statusarray = ["loading", "success", "fail"];
|
|
|
|
|
const which = common_vendor.ref(0);
|
2025-09-15 17:23:33 +08:00
|
|
|
const clickSmallball = () => {
|
2025-09-19 17:12:59 +08:00
|
|
|
common_vendor.index.setStorageSync("jumpIndex", 1);
|
2025-09-15 17:23:33 +08:00
|
|
|
common_vendor.index.navigateTo({
|
|
|
|
|
url: "/pages/yuangongindex/message"
|
|
|
|
|
});
|
|
|
|
|
};
|
2025-09-09 17:45:04 +08:00
|
|
|
const searchjigou = () => {
|
2025-09-19 17:12:59 +08:00
|
|
|
common_vendor.index.requestSubscribeMessage({
|
|
|
|
|
// 这里填后台申请好的 templateId 数组
|
|
|
|
|
tmplIds: ["yvvhlRft1CAdtU-dWlCW8U63VnTwRU8w3gR0BUdqcWw"],
|
|
|
|
|
success: (res) => {
|
|
|
|
|
common_vendor.index.navigateTo({
|
|
|
|
|
url: "/pages/yuangongindex/searchjigou"
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
fail: (err) => {
|
|
|
|
|
common_vendor.index.navigateTo({
|
|
|
|
|
url: "/pages/yuangongindex/searchjigou"
|
|
|
|
|
});
|
|
|
|
|
}
|
2025-09-09 17:45:04 +08:00
|
|
|
});
|
|
|
|
|
};
|
2025-09-02 16:45:54 +08:00
|
|
|
const changecard = (e) => {
|
|
|
|
|
which.value = e;
|
|
|
|
|
whichMenu.value = which.value;
|
|
|
|
|
};
|
|
|
|
|
const moveend = () => {
|
|
|
|
|
which.value = menuArray.value.length;
|
|
|
|
|
whichMenu.value = which.value;
|
|
|
|
|
};
|
|
|
|
|
const look = (element) => {
|
|
|
|
|
common_vendor.index.navigateTo({
|
2025-09-10 17:23:15 +08:00
|
|
|
url: `/pages/yuangongindex/workjoin`
|
2025-09-02 16:45:54 +08:00
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
const again = (item) => {
|
|
|
|
|
common_vendor.index.navigateTo({
|
2025-09-10 17:23:15 +08:00
|
|
|
url: "/pages/yuangongindex/searchjigou"
|
2025-09-02 16:45:54 +08:00
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
const whichMenu = common_vendor.ref(0);
|
|
|
|
|
const swiperchange = (res) => {
|
|
|
|
|
whichMenu.value = res.detail.current;
|
|
|
|
|
which.value = res.detail.current;
|
|
|
|
|
};
|
2025-09-15 17:23:33 +08:00
|
|
|
const moveHeight = common_vendor.ref(0);
|
|
|
|
|
common_vendor.onMounted(() => {
|
|
|
|
|
let capsule = null;
|
|
|
|
|
if (typeof common_vendor.index.getMenuButtonBoundingClientRect === "function") {
|
|
|
|
|
try {
|
|
|
|
|
capsule = common_vendor.index.getMenuButtonBoundingClientRect();
|
|
|
|
|
} catch (e) {
|
|
|
|
|
capsule = null;
|
|
|
|
|
}
|
|
|
|
|
moveHeight.value = capsule.top;
|
|
|
|
|
}
|
2025-09-02 16:45:54 +08:00
|
|
|
});
|
|
|
|
|
common_vendor.onUnmounted(() => {
|
|
|
|
|
});
|
|
|
|
|
const menuArray = common_vendor.ref([]);
|
|
|
|
|
const loadingData = () => {
|
|
|
|
|
common_vendor.index.getStorage({
|
|
|
|
|
key: "openid",
|
|
|
|
|
success: function(res) {
|
2025-09-09 17:45:04 +08:00
|
|
|
pages_yuangongindex_api.getIndex(res.data).then((res2) => {
|
2025-09-15 17:23:33 +08:00
|
|
|
menuArray.value = [];
|
|
|
|
|
res2.result.forEach((element) => {
|
2025-09-29 10:40:43 +08:00
|
|
|
if (element.applyType == "0" && element.applyStatus == "3")
|
|
|
|
|
;
|
|
|
|
|
else {
|
|
|
|
|
menuArray.value.push(element);
|
|
|
|
|
}
|
2025-09-15 17:23:33 +08:00
|
|
|
});
|
2025-09-09 17:45:04 +08:00
|
|
|
menuArray.value.push({
|
2025-09-10 17:23:15 +08:00
|
|
|
applyStatus: `-1`
|
2025-09-09 17:45:04 +08:00
|
|
|
});
|
|
|
|
|
});
|
2025-09-25 17:30:11 +08:00
|
|
|
pages_addstaff_api_addjigou.getMessageList().then((res2) => {
|
2025-09-09 17:45:04 +08:00
|
|
|
common_vendor.index.setStorageSync("staff", res2.result[0]);
|
2025-09-02 16:45:54 +08:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
2025-09-15 17:23:33 +08:00
|
|
|
const hong = common_vendor.ref(0);
|
2025-09-23 17:15:17 +08:00
|
|
|
const changeStatus = (item, status) => {
|
|
|
|
|
let data = {
|
|
|
|
|
employeeId: item.employeesId,
|
|
|
|
|
status: status ? 2 : 3,
|
|
|
|
|
orgCode: item.orgCode
|
|
|
|
|
};
|
|
|
|
|
pages_yuangongindex_api.invitedConfirm(data).then((res) => {
|
|
|
|
|
if (res.success) {
|
|
|
|
|
loadingData();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
const clickButton = (item, index) => {
|
2025-09-29 10:40:43 +08:00
|
|
|
if (index === 0) {
|
2025-09-25 17:30:11 +08:00
|
|
|
pages_addstaff_api_addjigou.getMessageList(item.orgCode).then((res) => {
|
|
|
|
|
common_vendor.index.setStorageSync("changeyuangongorgCode", item.orgCode);
|
|
|
|
|
if (res.success) {
|
|
|
|
|
common_vendor.index.navigateTo({
|
|
|
|
|
url: `/pages/addstaff/all?element=${JSON.stringify(res.result[0])}`
|
|
|
|
|
});
|
|
|
|
|
}
|
2025-09-23 17:15:17 +08:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
2025-09-25 17:30:11 +08:00
|
|
|
const jumptolist = (res) => {
|
|
|
|
|
if (res) {
|
|
|
|
|
content.value = res;
|
|
|
|
|
show.value = true;
|
|
|
|
|
}
|
|
|
|
|
};
|
2025-09-09 17:45:04 +08:00
|
|
|
common_vendor.onShow(() => {
|
2025-09-02 16:45:54 +08:00
|
|
|
loadingData();
|
2025-09-25 17:30:11 +08:00
|
|
|
pages_yuangongindex_api.isRead().then((res) => {
|
|
|
|
|
if (res.result) {
|
|
|
|
|
hong.value = res.result;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
common_vendor.onPullDownRefresh(() => {
|
|
|
|
|
loadingData();
|
|
|
|
|
pages_yuangongindex_api.isRead().then((res) => {
|
|
|
|
|
if (res.result) {
|
|
|
|
|
hong.value = res.result;
|
2025-09-15 17:23:33 +08:00
|
|
|
}
|
2025-09-25 17:30:11 +08:00
|
|
|
});
|
|
|
|
|
common_vendor.index.stopPullDownRefresh();
|
2025-09-02 16:45:54 +08:00
|
|
|
});
|
|
|
|
|
return (_ctx, _cache) => {
|
2025-09-15 17:23:33 +08:00
|
|
|
return common_vendor.e({
|
|
|
|
|
a: hong.value
|
|
|
|
|
}, hong.value ? {
|
|
|
|
|
b: common_vendor.t(hong.value)
|
|
|
|
|
} : {}, {
|
|
|
|
|
c: `${moveHeight.value}px`,
|
|
|
|
|
d: common_vendor.o(clickSmallball),
|
|
|
|
|
e: common_vendor.o(($event) => show.value = false),
|
|
|
|
|
f: common_vendor.p({
|
2025-09-02 16:45:54 +08:00
|
|
|
show: show.value,
|
|
|
|
|
content: content.value
|
|
|
|
|
}),
|
2025-09-15 17:23:33 +08:00
|
|
|
g: common_vendor.f(menuArray.value, (item, index, i0) => {
|
2025-09-02 16:45:54 +08:00
|
|
|
return common_vendor.e({
|
2025-09-29 17:32:51 +08:00
|
|
|
a: !(item.applyStatus == "2" || item.applyType == "2")
|
|
|
|
|
}, !(item.applyStatus == "2" || item.applyType == "2") ? {} : {}, {
|
2025-09-29 10:40:43 +08:00
|
|
|
b: item.applyType == "1" && item.applyStatus == `1`
|
2025-09-25 17:30:11 +08:00
|
|
|
}, item.applyType == "1" && item.applyStatus == `1` ? {
|
2025-09-29 10:40:43 +08:00
|
|
|
c: `https://www.focusnu.com/media/directive/index/refresh.png`,
|
|
|
|
|
d: common_vendor.o(loadingData, index)
|
2025-09-02 16:45:54 +08:00
|
|
|
} : {}, {
|
2025-09-29 10:40:43 +08:00
|
|
|
e: item.applyType == "0" && item.applyStatus == `1`
|
2025-09-25 17:30:11 +08:00
|
|
|
}, item.applyType == "0" && item.applyStatus == `1` ? {
|
2025-09-29 10:40:43 +08:00
|
|
|
f: `https://www.focusnu.com/media/directive/index/yuangonginvited.png`,
|
|
|
|
|
g: common_vendor.t(item.comName),
|
|
|
|
|
h: common_vendor.t(item.orgLeader),
|
|
|
|
|
i: common_vendor.t(item.orgLeaderPhone),
|
|
|
|
|
j: common_vendor.o(($event) => changeStatus(item, false), index),
|
|
|
|
|
k: common_vendor.o(($event) => changeStatus(item, true), index)
|
2025-09-23 17:15:17 +08:00
|
|
|
} : {}, {
|
2025-09-29 10:40:43 +08:00
|
|
|
l: item.applyType == "1" && item.applyStatus == `1`
|
2025-09-25 17:30:11 +08:00
|
|
|
}, item.applyType == "1" && item.applyStatus == `1` ? {
|
2025-09-29 10:40:43 +08:00
|
|
|
m: `https://www.focusnu.com/media/directive/index/${statusarray[Number(item.applyStatus) - 1]}.png`,
|
|
|
|
|
n: common_vendor.t(item.comName),
|
|
|
|
|
o: common_vendor.o(($event) => look(), index)
|
2025-09-02 16:45:54 +08:00
|
|
|
} : {}, {
|
2025-09-29 10:40:43 +08:00
|
|
|
p: item.applyType == "1" && item.applyStatus == `3`
|
2025-09-25 17:30:11 +08:00
|
|
|
}, item.applyType == "1" && item.applyStatus == `3` ? {
|
2025-09-29 10:40:43 +08:00
|
|
|
q: `https://www.focusnu.com/media/directive/index/${statusarray[Number(item.applyStatus) - 1]}.png`,
|
|
|
|
|
r: common_vendor.t(item.comName),
|
|
|
|
|
s: common_vendor.o(($event) => jumptolist(item.auditContent), index),
|
|
|
|
|
t: common_vendor.o(($event) => again(), index)
|
2025-09-02 16:45:54 +08:00
|
|
|
} : {}, {
|
2025-09-29 17:32:51 +08:00
|
|
|
v: item.applyStatus == `2` || item.applyType == `2`
|
|
|
|
|
}, item.applyStatus == `2` || item.applyType == `2` ? {
|
2025-09-29 10:40:43 +08:00
|
|
|
w: `https://www.focusnu.com/media/directive/index/addstaff/top.png`,
|
|
|
|
|
x: `https://www.focusnu.com/media/directive/index/addstaff/more.png`,
|
|
|
|
|
y: `https://www.focusnu.com/media/directive/index/addstaff/00.png`,
|
|
|
|
|
z: `https://www.focusnu.com/media/directive/index/addstaff/01.png`,
|
|
|
|
|
A: `https://www.focusnu.com/media/directive/index/addstaff/02.png`,
|
|
|
|
|
B: `https://www.focusnu.com/media/directive/index/addstaff/kaoqin.png`,
|
|
|
|
|
C: `https://www.focusnu.com/media/directive/index/addstaff/more.png`,
|
|
|
|
|
D: `https://www.focusnu.com/media/directive/index/addstaff/jineng.png`,
|
|
|
|
|
E: `https://www.focusnu.com/media/directive/index/addstaff/yuangong.png`,
|
|
|
|
|
F: common_vendor.f(buttonArray.value, (item0, index2, i1) => {
|
2025-09-02 16:45:54 +08:00
|
|
|
return {
|
2025-09-29 10:40:43 +08:00
|
|
|
a: `https://www.focusnu.com/media/directive/index/addstaff/${index2 + 2}.png`,
|
2025-09-23 17:15:17 +08:00
|
|
|
b: common_vendor.t(item0),
|
|
|
|
|
c: index2,
|
|
|
|
|
d: common_vendor.o(($event) => clickButton(item, index2), index2)
|
2025-09-02 16:45:54 +08:00
|
|
|
};
|
2025-09-09 17:45:04 +08:00
|
|
|
})
|
|
|
|
|
} : {}, {
|
2025-09-29 10:40:43 +08:00
|
|
|
G: item.applyType == "1" && item.applyStatus == `-1`
|
2025-09-25 17:30:11 +08:00
|
|
|
}, item.applyType == "1" && item.applyStatus == `-1` ? {} : {}, {
|
2025-09-29 10:40:43 +08:00
|
|
|
H: item.applyStatus == `-1`
|
2025-09-10 17:23:15 +08:00
|
|
|
}, item.applyStatus == `-1` ? {
|
2025-09-29 10:40:43 +08:00
|
|
|
I: common_vendor.o(($event) => searchjigou(), index)
|
2025-09-02 16:45:54 +08:00
|
|
|
} : {}, {
|
2025-09-29 17:32:51 +08:00
|
|
|
J: item.applyStatus == `2` || item.applyType == `2`
|
|
|
|
|
}, item.applyStatus == `2` || item.applyType == `2` ? {
|
2025-09-29 10:40:43 +08:00
|
|
|
K: common_vendor.t(item.comName)
|
2025-09-15 17:23:33 +08:00
|
|
|
} : {}, {
|
2025-09-29 10:40:43 +08:00
|
|
|
L: index
|
2025-09-02 16:45:54 +08:00
|
|
|
});
|
|
|
|
|
}),
|
2025-09-15 17:23:33 +08:00
|
|
|
h: `100vh`,
|
|
|
|
|
i: which.value,
|
|
|
|
|
j: common_vendor.o(swiperchange),
|
|
|
|
|
k: common_vendor.f(menuArray.value, (item, index, i0) => {
|
2025-09-02 16:45:54 +08:00
|
|
|
return common_vendor.e({
|
|
|
|
|
a: index != menuArray.value.length - 1
|
|
|
|
|
}, index != menuArray.value.length - 1 ? {
|
|
|
|
|
b: common_vendor.n(whichMenu.value == index ? `black-box` : `gray-box`)
|
|
|
|
|
} : {}, {
|
|
|
|
|
c: index == menuArray.value.length - 1
|
|
|
|
|
}, index == menuArray.value.length - 1 ? {
|
|
|
|
|
d: `https://www.focusnu.com/media/directive/index/bluejia.png`,
|
|
|
|
|
e: common_vendor.o(moveend, index)
|
|
|
|
|
} : {}, {
|
|
|
|
|
f: index,
|
|
|
|
|
g: common_vendor.o(($event) => changecard(index), index)
|
|
|
|
|
});
|
|
|
|
|
}),
|
2025-09-15 17:23:33 +08:00
|
|
|
l: common_vendor.p({
|
2025-09-02 16:45:54 +08:00
|
|
|
itemTarget: 0
|
|
|
|
|
})
|
2025-09-15 17:23:33 +08:00
|
|
|
});
|
2025-09-02 16:45:54 +08:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-f6d04c18"]]);
|
|
|
|
|
wx.createPage(MiniProgramPage);
|
|
|
|
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/yuangongindex/index.js.map
|