60 lines
3.7 KiB
JavaScript
60 lines
3.7 KiB
JavaScript
"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 method = {
|
|
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;
|
|
});
|
|
},
|
|
getHouseWorkLogs(id) {
|
|
common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.WorkOrder.HouseWorkLogs.List, { house_work_orders_id: id }).then((res) => {
|
|
WORKORDER_show_model.useModel.logsData.value = res == null ? void 0 : res.data;
|
|
});
|
|
},
|
|
toPageAddLogs() {
|
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
if (((_c = (_b = (_a = WORKORDER_show_model.useModel) == null ? void 0 : _a.dataShow) == null ? void 0 : _b.value) == null ? void 0 : _c.status) === "PendingPayment") {
|
|
common_vendor.index.navigateTo({
|
|
url: `/WORKORDER/poster/index?id=${(_f = (_e = (_d = WORKORDER_show_model.useModel) == null ? void 0 : _d.dataShow) == null ? void 0 : _e.value) == null ? void 0 : _f.id}&full_name=${(_j = (_i = (_h = (_g = WORKORDER_show_model.useModel) == null ? void 0 : _g.dataShow) == null ? void 0 : _h.value) == null ? void 0 : _i.asset_house) == null ? void 0 : _j.full_name}&amount=${(_m = (_l = (_k = WORKORDER_show_model.useModel) == null ? void 0 : _k.dataShow) == null ? void 0 : _l.value) == null ? void 0 : _m.amount}`
|
|
});
|
|
return;
|
|
}
|
|
if (((_p = (_o = (_n = WORKORDER_show_model.useModel) == null ? void 0 : _n.dataShow) == null ? void 0 : _o.value) == null ? void 0 : _p.status) === "Processing") {
|
|
common_vendor.index.navigateTo({
|
|
url: `/WORKORDER/update/index?id=${(_s = (_r = (_q = WORKORDER_show_model.useModel) == null ? void 0 : _q.dataShow) == null ? void 0 : _r.value) == null ? void 0 : _s.id}&projects_id=${(_v = (_u = (_t = WORKORDER_show_model.useModel) == null ? void 0 : _t.dataShow) == null ? void 0 : _u.value) == null ? void 0 : _v.asset_projects_id}`
|
|
});
|
|
}
|
|
},
|
|
handlePendingPaymentQrCode(e) {
|
|
},
|
|
handleCopyPhone() {
|
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
|
|
if ((_c = (_b = (_a = WORKORDER_show_model.useModel) == null ? void 0 : _a.dataShow) == null ? void 0 : _b.value) == null ? void 0 : _c.company_employee) {
|
|
common_vendor.index.makePhoneCall({
|
|
phoneNumber: (_g = (_f = (_e = (_d = WORKORDER_show_model.useModel) == null ? void 0 : _d.dataShow) == null ? void 0 : _e.value) == null ? void 0 : _f.company_employee) == null ? void 0 : _g.phone
|
|
});
|
|
return;
|
|
}
|
|
if ((_j = (_i = (_h = WORKORDER_show_model.useModel) == null ? void 0 : _h.dataShow) == null ? void 0 : _i.value) == null ? void 0 : _j.customer) {
|
|
common_vendor.index.makePhoneCall({
|
|
phoneNumber: (_n = (_m = (_l = (_k = WORKORDER_show_model.useModel) == null ? void 0 : _k.dataShow) == null ? void 0 : _l.value) == null ? void 0 : _m.customer) == null ? void 0 : _n.phone
|
|
});
|
|
return;
|
|
}
|
|
if ((_q = (_p = (_o = WORKORDER_show_model.useModel) == null ? void 0 : _o.dataShow) == null ? void 0 : _p.value) == null ? void 0 : _q.contact_phone) {
|
|
common_vendor.index.makePhoneCall({
|
|
phoneNumber: (_t = (_s = (_r = WORKORDER_show_model.useModel) == null ? void 0 : _r.dataShow) == null ? void 0 : _s.value) == null ? void 0 : _t.contact_phone
|
|
});
|
|
return;
|
|
}
|
|
common_vendor.index.showToast({
|
|
title: "暂无电话号码",
|
|
icon: "none"
|
|
});
|
|
}
|
|
};
|
|
exports.method = method;
|