130 lines
6.2 KiB
JavaScript
Raw Normal View History

2025-08-29 09:51:02 +08:00
"use strict";
2025-12-15 18:19:04 +08:00
const common_vendor = require("../../common/vendor.js");
2025-08-29 09:51:02 +08:00
const WORKORDER_show_model = require("./model.js");
const common_libraries_apiLoading = require("../../common/libraries/apiLoading.js");
const gen_Apis = require("../../gen/Apis.js");
2025-10-29 13:53:05 +08:00
const common_libraries_day = require("../../common/libraries/day.js");
const getShow = (id) => {
common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.WorkOrder.HouseWorkOrders.Show, { id }).then((res) => {
WORKORDER_show_model.useModel.dataShow.value = res == null ? void 0 : res.data;
});
};
const getHouseWorkLogs = (id) => {
common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.WorkOrder.HouseWorkLogs.List, { house_work_orders_id: id }).then((res) => {
2026-01-30 09:54:26 +08:00
WORKORDER_show_model.useModel.logsData.value = res == null ? void 0 : res.data;
2025-10-29 13:53:05 +08:00
});
};
2025-08-29 09:51:02 +08:00
const method = {
2025-10-29 13:53:05 +08:00
getShow,
handleEvaluate() {
WORKORDER_show_model.useModel.showEvaluate.value = true;
},
handleClosed() {
var _a, _b, _c;
if (common_libraries_day.specificTime((_c = (_b = (_a = WORKORDER_show_model.useModel) == null ? void 0 : _a.dataShow) == null ? void 0 : _b.value) == null ? void 0 : _c.expect_start_time)) {
common_vendor.index.showModal({
title: "提示",
2026-01-30 09:54:26 +08:00
content: "当前时间距离您选择的“期望处理时间”已经不足2小时暂不支持关闭工单。若需取消请联系处理人员操作。",
2025-10-29 13:53:05 +08:00
cancelText: "点错了",
success: function(res) {
if (res.confirm) {
console.log("用户点击确定");
} else if (res.cancel) {
console.log("用户点击取消");
}
}
});
return false;
}
common_vendor.index.showModal({
title: "提示",
content: "关闭工单后无法继续操作,如需继续需要重新提交,您是否确认关闭",
cancelText: "点错了",
success: function(res) {
var _a2, _b2, _c2;
if (res.confirm) {
common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.WorkOrder.HouseWorkOrders.Close, {
id: (_c2 = (_b2 = (_a2 = WORKORDER_show_model.useModel) == null ? void 0 : _a2.dataShow) == null ? void 0 : _b2.value) == null ? void 0 : _c2.id
}).then((res2) => {
var _a3, _b3, _c3, _d, _e, _f;
getShow((_c3 = (_b3 = (_a3 = WORKORDER_show_model.useModel) == null ? void 0 : _a3.dataShow) == null ? void 0 : _b3.value) == null ? void 0 : _c3.id);
getHouseWorkLogs((_f = (_e = (_d = WORKORDER_show_model.useModel) == null ? void 0 : _d.dataShow) == null ? void 0 : _e.value) == null ? void 0 : _f.id);
});
console.log("用户点击确定");
} else if (res.cancel) {
console.log("用户点击取消");
}
}
});
},
handlepopupClose() {
WORKORDER_show_model.useModel.showEvaluate.value = false;
common_vendor.index.showToast({
title: "评价已提交",
icon: "none"
});
},
getHouseWorkLogs,
2026-01-30 09:54:26 +08:00
handleAcceptance() {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
2025-10-29 13:53:05 +08:00
if (((_c = (_b = (_a = WORKORDER_show_model.useModel) == null ? void 0 : _a.dataShow) == null ? void 0 : _b.value) == null ? void 0 : _c.status) === "PendingAcceptance") {
common_vendor.index.navigateTo({
url: `/WORKORDER/acceptance/index?id=${(_f = (_e = (_d = WORKORDER_show_model.useModel) == null ? void 0 : _d.dataShow) == null ? void 0 : _e.value) == null ? void 0 : _f.id}`
});
return false;
}
if (((_i = (_h = (_g = WORKORDER_show_model.useModel) == null ? void 0 : _g.dataShow) == null ? void 0 : _h.value) == null ? void 0 : _i.status) === "PendingPayment") {
common_vendor.index.navigateTo({
url: `/WORKORDER/pay/index?id=${(_l = (_k = (_j = WORKORDER_show_model.useModel) == null ? void 0 : _j.dataShow) == null ? void 0 : _k.value) == null ? void 0 : _l.id}`
});
return false;
}
if (((_o = (_n = (_m = WORKORDER_show_model.useModel) == null ? void 0 : _m.dataShow) == null ? void 0 : _n.value) == null ? void 0 : _o.status) === "Completed") {
WORKORDER_show_model.useModel.showEvaluate.value = true;
return false;
}
2026-01-30 09:54:26 +08:00
},
handlePhoneCall() {
var _a, _b, _c, _d, _e, _f, _g, _h;
if ((_d = (_c = (_b = (_a = WORKORDER_show_model.useModel) == null ? void 0 : _a.dataShow) == null ? void 0 : _b.value) == null ? void 0 : _c.assign_employee) == null ? void 0 : _d.phone) {
common_vendor.index.makePhoneCall({
phoneNumber: (_h = (_g = (_f = (_e = WORKORDER_show_model.useModel) == null ? void 0 : _e.dataShow) == null ? void 0 : _f.value) == null ? void 0 : _g.assign_employee) == null ? void 0 : _h.phone
//仅为示例,并非真实的电话号码
});
} else {
common_vendor.index.showToast({
title: "暂无电话号码",
icon: "none"
});
2025-10-29 13:53:05 +08:00
}
},
hadnleUpdateTime() {
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
if (common_libraries_day.specificTime((_c = (_b = (_a = WORKORDER_show_model.useModel) == null ? void 0 : _a.dataShow) == null ? void 0 : _b.value) == null ? void 0 : _c.expect_start_time)) {
common_vendor.index.showModal({
title: "提示",
content: "距离工单开始时间小于2小时不能修改处理时间若需要请联系处理人员操作。",
cancelText: "点错了",
success: function(res) {
if (res.confirm) {
console.log("用户点击确定");
} else if (res.cancel) {
console.log("用户点击取消");
}
}
});
return false;
}
common_vendor.index.navigateTo({
url: `/WORKORDER/update_work_time/index?id=${(_f = (_e = (_d = WORKORDER_show_model.useModel) == null ? void 0 : _d.dataShow) == null ? void 0 : _e.value) == null ? void 0 : _f.id}&day=${(_i = (_h = (_g = WORKORDER_show_model.useModel) == null ? void 0 : _g.dataShow) == null ? void 0 : _h.value) == null ? void 0 : _i.expect_start_time}`
});
},
handleRework() {
var _a, _b, _c;
common_vendor.index.navigateTo({
url: `/WORKORDER/update_work_rework/index?id=${(_c = (_b = (_a = WORKORDER_show_model.useModel) == null ? void 0 : _a.dataShow) == null ? void 0 : _b.value) == null ? void 0 : _c.id}`
2025-08-29 09:51:02 +08:00
});
}
};
exports.method = method;