"use strict"; const common_vendor = require("../../common/vendor.js"); const WORKORDER_list_model = require("./model.js"); const common_libraries_apiLoading = require("../../common/libraries/apiLoading.js"); const gen_Apis = require("../../gen/Apis.js"); 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(); }, handleToDetail(e) { common_vendor.index.navigateTo({ url: `/WORKORDER/show/index?id=${e == null ? void 0 : e.id}` }); }, handleCopyPhone(e) { var _a, _b; if (e == null ? void 0 : e.company_employee) { common_vendor.index.makePhoneCall({ phoneNumber: (_a = e == null ? void 0 : e.company_employee) == null ? void 0 : _a.phone }); return; } if (e == null ? void 0 : e.customer) { common_vendor.index.makePhoneCall({ phoneNumber: (_b = e == null ? void 0 : e.customer) == null ? void 0 : _b.phone }); return; } if (e == null ? void 0 : e.contact_phone) { common_vendor.index.makePhoneCall({ phoneNumber: e == null ? void 0 : e.contact_phone }); return; } common_vendor.index.showToast({ title: "暂无电话号码", icon: "none" }); }, handleUpdateSetp(e) { 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}` }); }, 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}` }); } }; exports.method = method;