"use strict"; const common_vendor = require("../../common/vendor.js"); const WORKORDER_show_model = require("./model.js"); const common_libraries_apiLoading = require("../../common/libraries/apiLoading.js"); const gen_Apis = require("../../gen/Apis.js"); 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) => { }); }; const method = { 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: "提示", content: "距离工单开始时间小于2小时,无法关闭工单!若需取消,请联系处理人员操作。", 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, handlePhoneCall() { var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z; 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; } if (((_r = (_q = (_p = WORKORDER_show_model.useModel) == null ? void 0 : _p.dataShow) == null ? void 0 : _q.value) == null ? void 0 : _r.status) === "Processing") { if ((_v = (_u = (_t = (_s = WORKORDER_show_model.useModel) == null ? void 0 : _s.dataShow) == null ? void 0 : _t.value) == null ? void 0 : _u.assign_employee) == null ? void 0 : _v.phone) { common_vendor.index.makePhoneCall({ phoneNumber: (_z = (_y = (_x = (_w = WORKORDER_show_model.useModel) == null ? void 0 : _w.dataShow) == null ? void 0 : _x.value) == null ? void 0 : _y.assign_employee) == null ? void 0 : _z.phone //仅为示例,并非真实的电话号码 }); } else { common_vendor.index.showToast({ title: "暂无电话号码", icon: "none" }); } return false; } }, 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}` }); } // handleEvaluate() { // // uni.navigateTo({ // // url: '/ME/user_evaluate/index' // // }) // useModel.showEvaluate.value = true // }, // handlepopupClose() { // useModel.showEvaluate.value = false // uni.showToast({ // title: '评价已提交', // icon: 'none' // }) // }, // handlePhoneCall() { // if (useModel?.dataShow?.value?.assign_employee?.phone) { // uni.makePhoneCall({ // phoneNumber: useModel?.dataShow?.value?.assign_employee?.phone //仅为示例,并非真实的电话号码 // }) // } else { // uni.showToast({ // title: '暂无电话号码', // icon: 'none' // }) // } // } }; exports.method = method;