253 lines
9.0 KiB
JavaScript
253 lines
9.0 KiB
JavaScript
|
|
"use strict";
|
||
|
|
const common_vendor = require("../../common/vendor.js");
|
||
|
|
const pages_supplierindex_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/gongyingshnagdownmenu.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 jumpother = () => {
|
||
|
|
common_vendor.index.navigateTo({
|
||
|
|
url: "/pages/yuangongindex/workjoin"
|
||
|
|
});
|
||
|
|
};
|
||
|
|
const buttonArray = common_vendor.ref(["信息变更", "员工功能", "员工功能"]);
|
||
|
|
const statusarray = ["loading", "success", "fail"];
|
||
|
|
const which = common_vendor.ref(0);
|
||
|
|
const clickSmallball = () => {
|
||
|
|
common_vendor.index.setStorageSync("jumpIndex", 4);
|
||
|
|
common_vendor.index.navigateTo({
|
||
|
|
url: "/pages/yuangongindex/message"
|
||
|
|
});
|
||
|
|
};
|
||
|
|
const searchjigou = () => {
|
||
|
|
common_vendor.index.navigateTo({
|
||
|
|
url: "/pages/supplierindex/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/supplierindex/workjoin`
|
||
|
|
});
|
||
|
|
};
|
||
|
|
const again = (item) => {
|
||
|
|
let data = {
|
||
|
|
orgCode: item.orgCode,
|
||
|
|
openId: common_vendor.index.getStorageSync("openid")
|
||
|
|
};
|
||
|
|
pages_supplierindex_api.applySupOrg(data).then((data2) => {
|
||
|
|
if (data2.success) {
|
||
|
|
common_vendor.index.requestSubscribeMessage({
|
||
|
|
// 这里填后台申请好的 templateId 数组
|
||
|
|
tmplIds: ["cWVzXm1C-iitx1gNFn1nZdijq9R_3fCv8vLbiqs9zww"],
|
||
|
|
success: (res) => {
|
||
|
|
popupshow.value = true;
|
||
|
|
setTimeout(() => {
|
||
|
|
loadingData();
|
||
|
|
}, 1e3);
|
||
|
|
},
|
||
|
|
fail: (err) => {
|
||
|
|
common_vendor.index.__f__("error", "at pages/supplierindex/index.vue:343", "订阅接口调用失败:", 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 = () => {
|
||
|
|
pages_supplierindex_api.getSuppliersOrgInfo().then((res) => {
|
||
|
|
menuArray.value = [];
|
||
|
|
res.result.records.forEach((element) => {
|
||
|
|
menuArray.value.push(element);
|
||
|
|
});
|
||
|
|
menuArray.value.push({
|
||
|
|
applyStatus: `-1`
|
||
|
|
});
|
||
|
|
});
|
||
|
|
};
|
||
|
|
const hong = common_vendor.ref(0);
|
||
|
|
const clickButton = (item, index) => {
|
||
|
|
if (index === 0) {
|
||
|
|
pages_supplierindex_api.getSupInfoByOpenId().then((res) => {
|
||
|
|
if (res.success) {
|
||
|
|
common_vendor.index.navigateTo({
|
||
|
|
url: `/pages/addsupplier/information?element=${JSON.stringify(res.result)}`
|
||
|
|
});
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}
|
||
|
|
};
|
||
|
|
const jumptolist = (res) => {
|
||
|
|
if (res) {
|
||
|
|
content.value = res;
|
||
|
|
show.value = true;
|
||
|
|
}
|
||
|
|
};
|
||
|
|
common_vendor.onShow(() => {
|
||
|
|
loadingData();
|
||
|
|
pages_supplierindex_api.isRead().then((res) => {
|
||
|
|
if (res.result) {
|
||
|
|
hong.value = res.result;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
});
|
||
|
|
common_vendor.onPullDownRefresh(() => {
|
||
|
|
loadingData();
|
||
|
|
pages_supplierindex_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/supplierindex/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.suppliersStatus !== "2"
|
||
|
|
}, item.suppliersStatus !== "2" ? {} : {}, {
|
||
|
|
b: item.suppliersStatus == "1"
|
||
|
|
}, item.suppliersStatus == "1" ? {
|
||
|
|
c: `https://www.focusnu.com/media/directive/index/refresh.png`,
|
||
|
|
d: common_vendor.o(loadingData, index)
|
||
|
|
} : {}, {
|
||
|
|
e: item.suppliersStatus == "1"
|
||
|
|
}, item.suppliersStatus == "1" ? {
|
||
|
|
f: `https://www.focusnu.com/media/directive/index/${statusarray[0]}.png`,
|
||
|
|
g: common_vendor.t(item.departName),
|
||
|
|
h: common_vendor.o(($event) => look(), index)
|
||
|
|
} : {}, {
|
||
|
|
i: item.suppliersStatus == `3`
|
||
|
|
}, item.suppliersStatus == `3` ? {
|
||
|
|
j: `https://www.focusnu.com/media/directive/index/${statusarray[2]}.png`,
|
||
|
|
k: common_vendor.t(item.departName),
|
||
|
|
l: common_vendor.o(($event) => jumptolist(item.auditContent), index),
|
||
|
|
m: common_vendor.o(($event) => again(item), index)
|
||
|
|
} : {}, {
|
||
|
|
n: item.suppliersStatus == `2`
|
||
|
|
}, item.suppliersStatus == `2` ? {
|
||
|
|
o: `https://www.focusnu.com/media/directive/index/addstaff/kaoqin.png`,
|
||
|
|
p: `https://www.focusnu.com/media/directive/index/addstaff/more.png`,
|
||
|
|
q: common_vendor.o(jumpother, index),
|
||
|
|
r: `https://www.focusnu.com/media/directive/index/addstaff/jineng.png`,
|
||
|
|
s: common_vendor.o(jineng, index),
|
||
|
|
t: `https://www.focusnu.com/media/directive/index/addstaff/yuangong.png`,
|
||
|
|
v: 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)
|
||
|
|
};
|
||
|
|
}),
|
||
|
|
w: `https://www.focusnu.com/media/directive/index/oldmanphoto/more.png`
|
||
|
|
} : {}, {
|
||
|
|
x: item.applyType == "1" && item.applyStatus == `-1`
|
||
|
|
}, item.applyType == "1" && item.applyStatus == `-1` ? {} : {}, {
|
||
|
|
y: item.applyStatus == `-1`
|
||
|
|
}, item.applyStatus == `-1` ? {
|
||
|
|
z: common_vendor.o(($event) => searchjigou(), index)
|
||
|
|
} : {}, {
|
||
|
|
A: 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.departName),
|
||
|
|
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-a4bedc7c"]]);
|
||
|
|
wx.createPage(MiniProgramPage);
|
||
|
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/supplierindex/index.js.map
|