98 lines
3.5 KiB
JavaScript
98 lines
3.5 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const pages_addjigou_api_addjigou = require("../addjigou/api/addjigou.js");
|
|
const _sfc_main = {
|
|
__name: "workjoinsuccess",
|
|
setup(__props) {
|
|
common_vendor.ref(0);
|
|
const workArray = common_vendor.ref([]);
|
|
common_vendor.ref(false);
|
|
const statusarray = ["success", "loading", "success", "fail", "loading", "fail"];
|
|
const getData = () => {
|
|
common_vendor.index.getStorage({
|
|
key: "openid",
|
|
success: function(res) {
|
|
pages_addjigou_api_addjigou.getMessageListsuccess(res.data).then((res2) => {
|
|
const counts = {};
|
|
res2.result.forEach((item) => {
|
|
counts[item.pkId] = (counts[item.pkId] || 0) + 1;
|
|
});
|
|
const seenFirst = {};
|
|
const seenCount = {};
|
|
workArray.value = res2.result.map((item) => {
|
|
const {
|
|
pkId
|
|
} = item;
|
|
if (counts[pkId] > 1) {
|
|
if (!seenFirst[pkId]) {
|
|
item.ischange = true;
|
|
seenFirst[pkId] = true;
|
|
} else {
|
|
item.ischange = false;
|
|
}
|
|
} else {
|
|
item.ischange = true;
|
|
}
|
|
seenCount[pkId] = (seenCount[pkId] || 0) + 1;
|
|
item.isend = seenCount[pkId] === counts[pkId];
|
|
return item;
|
|
});
|
|
}).catch((err) => {
|
|
common_vendor.index.__f__("error", "at pages/login/workjoinsuccess.vue:130", err);
|
|
});
|
|
}
|
|
});
|
|
};
|
|
common_vendor.onLoad((options) => {
|
|
getData();
|
|
});
|
|
common_vendor.onPullDownRefresh(() => {
|
|
getData();
|
|
common_vendor.index.stopPullDownRefresh();
|
|
});
|
|
const goBack = () => {
|
|
common_vendor.index.navigateBack();
|
|
};
|
|
const again = (item) => {
|
|
let trans = item;
|
|
trans.id = null;
|
|
common_vendor.index.setStorageSync("baddata", trans);
|
|
common_vendor.index.setStorageSync("specicalid", trans.id);
|
|
common_vendor.index.setStorageSync("backhuancun", {});
|
|
common_vendor.index.navigateTo({
|
|
url: `/pages/addjigou/name`
|
|
});
|
|
};
|
|
const jumpToAll = (element) => {
|
|
common_vendor.index.navigateTo({
|
|
url: `/pages/addjigou/all?element=${JSON.stringify(element)}&special=1`
|
|
});
|
|
};
|
|
return (_ctx, _cache) => {
|
|
return common_vendor.e({
|
|
a: common_vendor.o(goBack),
|
|
b: !workArray.value.length
|
|
}, !workArray.value.length ? {} : {}, {
|
|
c: common_vendor.f(workArray.value, (item, index, i0) => {
|
|
return common_vendor.e({
|
|
a: common_vendor.t(item.comName),
|
|
b: common_vendor.t(item.isend ? `申请` : `变更`),
|
|
c: common_vendor.t(item.commitTime),
|
|
d: common_vendor.t(item.auditTime),
|
|
e: `https://www.focusnu.com/media/directive/index/${statusarray[Number(item.status)]}.png`,
|
|
f: item.modifyStatus === `0` && item.ischange
|
|
}, item.modifyStatus === `0` && item.ischange ? {
|
|
g: common_vendor.o(($event) => again(item), index)
|
|
} : {}, {
|
|
h: common_vendor.o(($event) => jumpToAll(item), index),
|
|
i: index
|
|
});
|
|
})
|
|
});
|
|
};
|
|
}
|
|
};
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-c1509caf"]]);
|
|
wx.createPage(MiniProgramPage);
|
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/login/workjoinsuccess.js.map
|