77 lines
2.9 KiB
JavaScript
Raw Permalink Normal View History

2025-12-19 09:46:56 +08:00
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_libraries_apiLoading = require("../../common/libraries/apiLoading.js");
const gen_Apis = require("../../gen/Apis.js");
2026-01-30 09:54:46 +08:00
const WORKORDER_list_model = require("./model.js");
2025-12-19 09:46:56 +08:00
const getList = () => {
var _a, _b;
common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.WorkOrder.HouseWorkOrders.List, (_b = (_a = WORKORDER_list_model.useModel) == null ? void 0 : _a.formData) == null ? void 0 : _b.value).then((res) => {
WORKORDER_list_model.useModel.listData.value = [...WORKORDER_list_model.useModel.listData.value, ...res == null ? void 0 : res.data];
WORKORDER_list_model.useModel.metaData.value = res == null ? void 0 : res.meta;
});
};
const handleSearch = () => {
WORKORDER_list_model.useModel.formData.value.page = 1;
WORKORDER_list_model.useModel.listData.value = [];
getList();
};
const method = {
getList,
handleChangeTabs(idx, e) {
WORKORDER_list_model.useModel.currentTabs.value = idx;
WORKORDER_list_model.useModel.formData.value.status = e == null ? void 0 : e.value;
handleSearch();
},
handleLoad(page) {
WORKORDER_list_model.useModel.formData.value.page = page;
getList();
},
2026-01-30 09:54:46 +08:00
handleCopyPhone(e) {
if (e == null ? void 0 : e.contact_phone) {
common_vendor.index.makePhoneCall({
phoneNumber: e == null ? void 0 : e.contact_phone
});
return;
}
if (e == null ? void 0 : e.reporter_phone) {
common_vendor.index.makePhoneCall({
phoneNumber: e == null ? void 0 : e.reporter_phone
});
return;
}
common_vendor.index.showToast({
title: "暂无电话号码",
icon: "none"
});
},
handleUpdateSetp(e) {
if ((e == null ? void 0 : e.type) === "SecurityInspection") {
common_vendor.index.navigateTo({
url: `/WORKORDER/show_patrol_task_locations/index?id=${e == null ? void 0 : e.id}`
});
return;
}
if ((e == null ? void 0 : e.type) === "RenovationInspection" || (e == null ? void 0 : e.type) === "RenovationAcceptance") {
common_vendor.index.navigateTo({
url: `/WORKORDER/patrol_update/index?id=${e == null ? void 0 : e.id}&type=${e == null ? void 0 : e.type}`
});
return;
}
common_vendor.index.navigateTo({
url: `/WORKORDER/update/index?id=${e == null ? void 0 : e.id}&projects_id=${e == null ? void 0 : e.asset_projects_id}&location=${e == null ? void 0 : e.location}`
});
},
2025-12-19 09:46:56 +08:00
handleToDetail(e) {
common_vendor.index.navigateTo({
url: `/WORKORDER/show/index?id=${e == null ? void 0 : e.id}`
});
2026-01-30 09:54:46 +08:00
},
handlePendingPaymentQrCode(e) {
var _a;
common_vendor.index.navigateTo({
url: `/WORKORDER/poster/index?id=${e == null ? void 0 : e.id}&full_name=${(_a = e == null ? void 0 : e.asset_house) == null ? void 0 : _a.full_name}&amount=${e == null ? void 0 : e.amount}`
});
2025-12-19 09:46:56 +08:00
}
};
exports.method = method;