|
|
@@ -1,15 +1,18 @@
|
|
|
"use strict";
|
|
|
const common_vendor = require("../../common/vendor.js");
|
|
|
const utils_api = require("../../utils/api.js");
|
|
|
+const utils_des = require("../../utils/des.js");
|
|
|
if (!Array) {
|
|
|
const _easycom_uni_segmented_control2 = common_vendor.resolveComponent("uni-segmented-control");
|
|
|
+ const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
|
|
|
const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
|
|
|
- (_easycom_uni_segmented_control2 + _easycom_uni_popup2)();
|
|
|
+ (_easycom_uni_segmented_control2 + _easycom_uni_icons2 + _easycom_uni_popup2)();
|
|
|
}
|
|
|
const _easycom_uni_segmented_control = () => "../../uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.js";
|
|
|
+const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
|
|
|
const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
|
|
|
if (!Math) {
|
|
|
- (_easycom_uni_segmented_control + NoData + _easycom_uni_popup + Tabber)();
|
|
|
+ (_easycom_uni_segmented_control + _easycom_uni_icons + NoData + _easycom_uni_popup + Tabber)();
|
|
|
}
|
|
|
const Tabber = () => "../../components/tabber.js";
|
|
|
const NoData = () => "../../components/noData.js";
|
|
|
@@ -19,11 +22,14 @@ const _sfc_main = {
|
|
|
const activeCurrent = common_vendor.ref(0);
|
|
|
const currentPage = common_vendor.ref(1);
|
|
|
const total = common_vendor.ref(0);
|
|
|
- const controlList = ["待审核", "已拒绝", "已推送"];
|
|
|
+ const controlList = ["待审核", "已拒绝", "进校核销", "出校核销", "已完成"];
|
|
|
const list = common_vendor.ref([]);
|
|
|
const popup = common_vendor.ref(null);
|
|
|
const popObj = common_vendor.ref({});
|
|
|
+ const showSet = common_vendor.ref(false);
|
|
|
+ const configInfo = common_vendor.ref({});
|
|
|
common_vendor.onLoad(() => {
|
|
|
+ getConfig();
|
|
|
getData();
|
|
|
});
|
|
|
common_vendor.onReachBottom(() => {
|
|
|
@@ -37,14 +43,39 @@ const _sfc_main = {
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
+ const getConfig = async () => {
|
|
|
+ const res = await utils_api.myRequest({
|
|
|
+ url: "/wanzai/api/smartVisitorParentsConfig/getUserId",
|
|
|
+ data: {
|
|
|
+ userId: common_vendor.index.getStorageSync("userInfo").id
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (res.code == 200) {
|
|
|
+ showSet.value = true;
|
|
|
+ const result = JSON.parse(utils_des.decryptDes(res.data));
|
|
|
+ configInfo.value = result;
|
|
|
+ }
|
|
|
+ };
|
|
|
const getData = async () => {
|
|
|
+ let type;
|
|
|
+ if (activeCurrent.value == 0) {
|
|
|
+ type = 1;
|
|
|
+ } else if (activeCurrent.value == 1) {
|
|
|
+ type = 2;
|
|
|
+ } else if (activeCurrent.value == 2) {
|
|
|
+ type = 7;
|
|
|
+ } else if (activeCurrent.value == 3) {
|
|
|
+ type = 8;
|
|
|
+ } else if (activeCurrent.value == 4) {
|
|
|
+ type = 9;
|
|
|
+ }
|
|
|
const res = await utils_api.myRequest({
|
|
|
url: "/wanzai/api/smartVisitor/visitingAgencys",
|
|
|
data: {
|
|
|
currentPage: currentPage.value,
|
|
|
pageCount: 6,
|
|
|
userId: common_vendor.index.getStorageSync("userInfo").id,
|
|
|
- type: activeCurrent.value - 0 + 1
|
|
|
+ type
|
|
|
}
|
|
|
});
|
|
|
const result = res.data;
|
|
|
@@ -63,33 +94,56 @@ const _sfc_main = {
|
|
|
popObj.value = item;
|
|
|
popup.value.open();
|
|
|
};
|
|
|
- const handleReject = (id) => {
|
|
|
- handleExamine(id, 2);
|
|
|
+ const handleReject = (info) => {
|
|
|
+ handleExamine(info, 2);
|
|
|
};
|
|
|
- const handleAgree = (id) => {
|
|
|
- handleExamine(id, 1);
|
|
|
+ const handleAgree = (info) => {
|
|
|
+ handleExamine(info, 4);
|
|
|
};
|
|
|
- const handleExamine = (id, type) => {
|
|
|
+ const handleExamine = (info, type) => {
|
|
|
common_vendor.index.showModal({
|
|
|
title: "提示",
|
|
|
- content: type == 1 ? "确定同意并推送吗?" : "确定拒绝吗?",
|
|
|
+ content: type == 4 ? "确定同意吗?" : "确定拒绝吗?",
|
|
|
success: (res) => {
|
|
|
if (res.confirm) {
|
|
|
- handleExamineReq(id, type);
|
|
|
+ if (info.visitorType == 1) {
|
|
|
+ handleExamineReq(info.id, type);
|
|
|
+ } else {
|
|
|
+ handleExamineReq_other(info.id, type);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
const handleExamineReq = async (id, type) => {
|
|
|
await utils_api.myRequest({
|
|
|
- url: "/wanzai/api/smartVisitor/examineRecord",
|
|
|
+ url: "/wanzai/api/smartVisitor/parentsAudit",
|
|
|
+ data: {
|
|
|
+ id,
|
|
|
+ type
|
|
|
+ }
|
|
|
+ });
|
|
|
+ common_vendor.index.showToast({
|
|
|
+ title: type == 4 ? "已同意该审核" : "已拒绝该审核",
|
|
|
+ icon: "success",
|
|
|
+ duration: 2e3
|
|
|
+ });
|
|
|
+ setTimeout(() => {
|
|
|
+ list.value = [];
|
|
|
+ currentPage.value = 1;
|
|
|
+ getData();
|
|
|
+ }, 2e3);
|
|
|
+ };
|
|
|
+ const handleExamineReq_other = async (id, type) => {
|
|
|
+ await utils_api.myRequest({
|
|
|
+ url: "/wanzai/api/smartVisitor/restsAudit",
|
|
|
data: {
|
|
|
id,
|
|
|
type
|
|
|
}
|
|
|
});
|
|
|
common_vendor.index.showToast({
|
|
|
- title: type == 1 ? "已同意该审核" : "已拒绝该审核",
|
|
|
+ title: type == 4 ? "已同意该审核" : "已拒绝该审核",
|
|
|
icon: "success",
|
|
|
duration: 2e3
|
|
|
});
|
|
|
@@ -102,6 +156,12 @@ const _sfc_main = {
|
|
|
const closePop = () => {
|
|
|
popup.value.close();
|
|
|
};
|
|
|
+ const handleClickSet = () => {
|
|
|
+ let info = JSON.stringify(configInfo.value);
|
|
|
+ common_vendor.index.navigateTo({
|
|
|
+ url: `/pagesReservation/set/set?info=${info}`
|
|
|
+ });
|
|
|
+ };
|
|
|
return (_ctx, _cache) => {
|
|
|
return common_vendor.e({
|
|
|
a: common_vendor.o(onClickItem),
|
|
|
@@ -134,48 +194,56 @@ const _sfc_main = {
|
|
|
m: common_vendor.t(item.respondentName),
|
|
|
n: item.statuStr == "待审核"
|
|
|
}, item.statuStr == "待审核" ? {
|
|
|
- o: common_vendor.o(($event) => handleReject(item.id), item.id),
|
|
|
- p: common_vendor.o(($event) => handleAgree(item.id), item.id)
|
|
|
+ o: common_vendor.o(($event) => handleReject(item), item.id),
|
|
|
+ p: common_vendor.o(($event) => handleAgree(item), item.id)
|
|
|
} : {}, {
|
|
|
q: item.id,
|
|
|
r: common_vendor.o(($event) => handleClick(item), item.id)
|
|
|
});
|
|
|
}),
|
|
|
- d: !list.value.length
|
|
|
+ d: showSet.value
|
|
|
+ }, showSet.value ? {
|
|
|
+ e: common_vendor.p({
|
|
|
+ type: "gear-filled",
|
|
|
+ size: "18"
|
|
|
+ }),
|
|
|
+ f: common_vendor.o(handleClickSet)
|
|
|
+ } : {}, {
|
|
|
+ g: !list.value.length
|
|
|
}, !list.value.length ? {} : {}, {
|
|
|
- e: common_vendor.o(closePop),
|
|
|
- f: popObj.value.statuStr == "待审核"
|
|
|
+ h: common_vendor.o(closePop),
|
|
|
+ i: popObj.value.statuStr == "待审核"
|
|
|
}, popObj.value.statuStr == "待审核" ? {
|
|
|
- g: common_vendor.t(popObj.value.statuStr)
|
|
|
+ j: common_vendor.t(popObj.value.statuStr)
|
|
|
} : {}, {
|
|
|
- h: popObj.value.statuStr == "已拒绝"
|
|
|
+ k: popObj.value.statuStr == "已拒绝"
|
|
|
}, popObj.value.statuStr == "已拒绝" ? {
|
|
|
- i: common_vendor.t(popObj.value.statuStr)
|
|
|
+ l: common_vendor.t(popObj.value.statuStr)
|
|
|
} : {}, {
|
|
|
- j: popObj.value.statuStr == "已推送"
|
|
|
+ m: popObj.value.statuStr == "已推送"
|
|
|
}, popObj.value.statuStr == "已推送" ? {
|
|
|
- k: common_vendor.t(popObj.value.statuStr)
|
|
|
+ n: common_vendor.t(popObj.value.statuStr)
|
|
|
} : {}, {
|
|
|
- l: common_vendor.t(popObj.value.visitorType === 1 ? "学生家长预约" : "其他访客预约"),
|
|
|
- m: common_vendor.t(popObj.value.userName),
|
|
|
- n: common_vendor.t(popObj.value.userPhone),
|
|
|
- o: common_vendor.t(popObj.value.visitorTime),
|
|
|
- p: common_vendor.t(popObj.value.userNumber),
|
|
|
- q: common_vendor.t(popObj.value.visitReason),
|
|
|
- r: common_vendor.t(popObj.value.carNum ? popObj.value.carNum : "无"),
|
|
|
- s: common_vendor.t(popObj.value.peerNum ? popObj.value.carNum : "无"),
|
|
|
- t: common_vendor.t(popObj.value.visitorType === 1 ? "受访学生" : "受访人"),
|
|
|
- v: common_vendor.t(popObj.value.respondentName),
|
|
|
- w: common_vendor.t(popObj.value.responcode || popObj.value.respondentPhone),
|
|
|
- x: popObj.value.statuStr == "待审核"
|
|
|
+ o: common_vendor.t(popObj.value.visitorType === 1 ? "学生家长预约" : "其他访客预约"),
|
|
|
+ p: common_vendor.t(popObj.value.userName),
|
|
|
+ q: common_vendor.t(popObj.value.userPhone),
|
|
|
+ r: common_vendor.t(popObj.value.visitorTime),
|
|
|
+ s: common_vendor.t(popObj.value.userNumber),
|
|
|
+ t: common_vendor.t(popObj.value.visitReason),
|
|
|
+ v: common_vendor.t(popObj.value.carNum ? popObj.value.carNum : "无"),
|
|
|
+ w: common_vendor.t(popObj.value.peerNum ? popObj.value.carNum : "无"),
|
|
|
+ x: common_vendor.t(popObj.value.visitorType === 1 ? "受访学生" : "受访人"),
|
|
|
+ y: common_vendor.t(popObj.value.respondentName),
|
|
|
+ z: common_vendor.t(popObj.value.responcode || popObj.value.respondentPhone),
|
|
|
+ A: popObj.value.statuStr == "待审核"
|
|
|
}, popObj.value.statuStr == "待审核" ? {
|
|
|
- y: common_vendor.o(($event) => handleReject(popObj.value.id)),
|
|
|
- z: common_vendor.o(($event) => handleAgree(popObj.value.id))
|
|
|
+ B: common_vendor.o(($event) => handleReject(popObj.value)),
|
|
|
+ C: common_vendor.o(($event) => handleAgree(popObj.value))
|
|
|
} : {}, {
|
|
|
- A: common_vendor.sr(popup, "a46ecdc3-2", {
|
|
|
+ D: common_vendor.sr(popup, "a46ecdc3-3", {
|
|
|
"k": "popup"
|
|
|
}),
|
|
|
- B: common_vendor.p({
|
|
|
+ E: common_vendor.p({
|
|
|
type: "center",
|
|
|
["is-mask-click"]: false
|
|
|
})
|