324 lines
12 KiB
JavaScript
324 lines
12 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const pages_addstaff_api_addjigou = require("../addstaff/api/addjigou.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) {
|
|
(model + downMenu + _easycom_u_popup)();
|
|
}
|
|
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("");
|
|
const jineng = () => {
|
|
};
|
|
const buttonArray = common_vendor.ref(["信息变更", "员工功能", "员工功能"]);
|
|
const statusarray = ["loading", "success", "fail"];
|
|
const which = common_vendor.ref(0);
|
|
const clickSmallball = () => {
|
|
common_vendor.index.setStorageSync("jumpIndex", 2);
|
|
common_vendor.index.navigateTo({
|
|
url: "/pages/yuangongindex/message"
|
|
});
|
|
};
|
|
const searchjigou = () => {
|
|
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"
|
|
});
|
|
}
|
|
});
|
|
};
|
|
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({
|
|
url: `/pages/yuangongindex/workjoin`
|
|
});
|
|
};
|
|
const again = (item) => {
|
|
pages_addstaff_api_addjigou.getMessageList().then((res) => {
|
|
common_vendor.index.__f__("log", "at pages/yuangongindex/index.vue:364", "这里面有啥", res.result[0]);
|
|
let data = res.result[0];
|
|
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: item.orgCode
|
|
};
|
|
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(() => {
|
|
loadingData();
|
|
}, 1e3);
|
|
},
|
|
fail: (err) => {
|
|
common_vendor.index.__f__("error", "at pages/yuangongindex/index.vue:403", "订阅接口调用失败:", err);
|
|
common_vendor.index.showToast({
|
|
title: "订阅失败",
|
|
icon: "none"
|
|
});
|
|
}
|
|
});
|
|
}
|
|
});
|
|
});
|
|
};
|
|
const whichMenu = common_vendor.ref(0);
|
|
const swiperchange = (res) => {
|
|
whichMenu.value = res.detail.current;
|
|
which.value = res.detail.current;
|
|
};
|
|
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;
|
|
common_vendor.index.setStorageSync("moveHeight", moveHeight.value);
|
|
}
|
|
});
|
|
common_vendor.onUnmounted(() => {
|
|
});
|
|
const menuArray = common_vendor.ref([]);
|
|
const loadingData = () => {
|
|
common_vendor.index.getStorage({
|
|
key: "openid",
|
|
success: function(res) {
|
|
pages_yuangongindex_api.getIndex(res.data).then((res2) => {
|
|
menuArray.value = [];
|
|
res2.result.forEach((element) => {
|
|
if (element.applyType == "0" && element.applyStatus == "3")
|
|
;
|
|
else {
|
|
menuArray.value.push(element);
|
|
}
|
|
});
|
|
menuArray.value.push({
|
|
applyStatus: `-1`
|
|
});
|
|
});
|
|
pages_addstaff_api_addjigou.getMessageList().then((res2) => {
|
|
common_vendor.index.__f__("log", "at pages/yuangongindex/index.vue:477", "special", res2);
|
|
common_vendor.index.setStorageSync("staff", res2.result[0]);
|
|
});
|
|
}
|
|
});
|
|
};
|
|
const hong = common_vendor.ref(0);
|
|
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) => {
|
|
if (index === 0) {
|
|
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])}`
|
|
});
|
|
}
|
|
});
|
|
}
|
|
};
|
|
const jumptolist = (res) => {
|
|
if (res) {
|
|
content.value = res;
|
|
show.value = true;
|
|
}
|
|
};
|
|
common_vendor.onShow(() => {
|
|
loadingData();
|
|
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;
|
|
}
|
|
});
|
|
common_vendor.index.stopPullDownRefresh();
|
|
});
|
|
const popupshow = common_vendor.ref(false);
|
|
const jumpRuzhu = () => {
|
|
popupshow.value = false;
|
|
common_vendor.index.navigateTo({
|
|
url: "/pages/yuangongindex/workjoin"
|
|
});
|
|
};
|
|
return (_ctx, _cache) => {
|
|
var _a;
|
|
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({
|
|
show: show.value,
|
|
content: content.value
|
|
}),
|
|
g: common_vendor.f(menuArray.value, (item, index, i0) => {
|
|
return common_vendor.e({
|
|
a: !(item.applyStatus == "2" || item.applyType == "2")
|
|
}, !(item.applyStatus == "2" || item.applyType == "2") ? {} : {}, {
|
|
b: item.applyType == "1" && item.applyStatus == `1`
|
|
}, item.applyType == "1" && item.applyStatus == `1` ? {
|
|
c: `https://www.focusnu.com/media/directive/index/refresh.png`,
|
|
d: common_vendor.o(loadingData, index)
|
|
} : {}, {
|
|
e: item.applyType == "0" && item.applyStatus == `1`
|
|
}, item.applyType == "0" && item.applyStatus == `1` ? {
|
|
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)
|
|
} : {}, {
|
|
l: item.applyType == "1" && item.applyStatus == `1`
|
|
}, item.applyType == "1" && item.applyStatus == `1` ? {
|
|
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)
|
|
} : {}, {
|
|
p: item.applyType == "1" && item.applyStatus == `3`
|
|
}, item.applyType == "1" && item.applyStatus == `3` ? {
|
|
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(item), index)
|
|
} : {}, {
|
|
v: item.applyStatus == `2` || item.applyType == `2`
|
|
}, item.applyStatus == `2` || item.applyType == `2` ? {
|
|
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: common_vendor.o(jineng, index),
|
|
F: `https://www.focusnu.com/media/directive/index/addstaff/yuangong.png`,
|
|
G: common_vendor.f(buttonArray.value, (item0, index2, i1) => {
|
|
return {
|
|
a: `https://www.focusnu.com/media/directive/index/addstaff/${index2 + 2}.png`,
|
|
b: common_vendor.t(item0),
|
|
c: index2,
|
|
d: common_vendor.o(($event) => clickButton(item, index2), index2)
|
|
};
|
|
}),
|
|
H: `https://www.focusnu.com/media/directive/index/oldmanphoto/more.png`
|
|
} : {}, {
|
|
I: item.applyType == "1" && item.applyStatus == `-1`
|
|
}, item.applyType == "1" && item.applyStatus == `-1` ? {} : {}, {
|
|
J: item.applyStatus == `-1`
|
|
}, item.applyStatus == `-1` ? {
|
|
K: common_vendor.o(($event) => searchjigou(), index)
|
|
} : {}, {
|
|
L: index
|
|
});
|
|
}),
|
|
h: `100vh`,
|
|
i: which.value,
|
|
j: common_vendor.o(swiperchange),
|
|
k: common_vendor.f(menuArray.value, (item, index, i0) => {
|
|
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)
|
|
});
|
|
}),
|
|
l: common_vendor.t((_a = menuArray.value[which.value]) == null ? void 0 : _a.comName),
|
|
m: common_vendor.p({
|
|
itemTarget: 0
|
|
}),
|
|
n: common_vendor.o(($event) => jumpRuzhu()),
|
|
o: common_vendor.o(($event) => popupshow.value = $event),
|
|
p: common_vendor.p({
|
|
mode: "bottom",
|
|
["border-radius"]: "40",
|
|
modelValue: popupshow.value
|
|
})
|
|
});
|
|
};
|
|
}
|
|
};
|
|
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
|