"use strict";
const common_vendor = require("../../../common/vendor.js");
const gen_Enums = require("../../../gen/Enums.js");
const INDEX_owner_audit_list_model = require("../model.js");
const INDEX_owner_audit_list_method = require("../method.js");
const common_libraries_apiLoading = require("../../../common/libraries/apiLoading.js");
const gen_Apis = require("../../../gen/Apis.js");
const common_libraries_naviHelper = require("../../../common/libraries/naviHelper.js");
require("../../../common/libraries/request.js");
require("../../../common/store/useWeAppAuthStore.js");
require("../../../common/libraries/setTabBar.js");
require("../../../common/store/useWorkStore.js");
if (!Array) {
  const _easycom_hs_enum_tag2 = common_vendor.resolveComponent("hs-enum-tag");
  const _easycom_hs_button2 = common_vendor.resolveComponent("hs-button");
  const _easycom_hs_popup_custom2 = common_vendor.resolveComponent("hs-popup-custom");
  (_easycom_hs_enum_tag2 + _easycom_hs_button2 + _easycom_hs_popup_custom2)();
}
const _easycom_hs_enum_tag = () => "../../../components/hs-enum-tag/hs-enum-tag.js";
const _easycom_hs_button = () => "../../../components/hs-button/hs-button.js";
const _easycom_hs_popup_custom = () => "../../../components/hs-popup-custom/hs-popup-custom.js";
if (!Math) {
  (_easycom_hs_enum_tag + _easycom_hs_button + _easycom_hs_popup_custom)();
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  __name: "OwnerAuditList",
  setup(__props) {
    const show = common_vendor.ref(false);
    const rejectReason = common_vendor.ref({ id: "", reason: "" });
    const handleClosePopup = () => {
      show.value = false;
    };
    const handleAuditShow = (e) => {
      show.value = true;
      rejectReason.value.id = e == null ? void 0 : e.id;
    };
    const handleSubmit = () => {
      var _a;
      if (!((_a = rejectReason.value) == null ? void 0 : _a.reason)) {
        return common_libraries_naviHelper.showToast("请输入理由!");
      }
      common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.Archive.HouseRegisters.Audit, {
        ...rejectReason.value,
        status: "Rejected"
      }).then((res) => {
        var _a2;
        common_libraries_naviHelper.showToast("提交成功！");
        show.value = false;
        (_a2 = INDEX_owner_audit_list_method.method) == null ? void 0 : _a2.handleSrarch();
        console.log(res);
      });
    };
    return (_ctx, _cache) => {
      var _a, _b;
      return {
        a: common_vendor.f((_b = (_a = common_vendor.unref(INDEX_owner_audit_list_model.useModel)) == null ? void 0 : _a.dataList) == null ? void 0 : _b.value, (i, index, i0) => {
          var _a2;
          return common_vendor.e({
            a: common_vendor.t((_a2 = i == null ? void 0 : i.asset_house) == null ? void 0 : _a2.full_name),
            b: "13ad4cd9-0-" + i0,
            c: common_vendor.p({
              value: i == null ? void 0 : i.approval_owner_status,
              Enums: common_vendor.unref(gen_Enums.HouseRegistersStatusEnum)
            }),
            d: common_vendor.n(`status_tab status_${i == null ? void 0 : i.approval_owner_status}`),
            e: common_vendor.f(i == null ? void 0 : i.customer_info, (k, idx, i1) => {
              return {
                a: common_vendor.t(k == null ? void 0 : k.name),
                b: common_vendor.t(k == null ? void 0 : k.phone),
                c: "13ad4cd9-1-" + i0 + "-" + i1,
                d: common_vendor.p({
                  value: k == null ? void 0 : k.residential_relation,
                  Enums: common_vendor.unref(gen_Enums.HouseOccupantsResidentialRelationEnum)
                }),
                e: `f_item_${index}_${idx}`
              };
            }),
            f: common_vendor.t(i == null ? void 0 : i.created_at),
            g: (i == null ? void 0 : i.approval_owner_status) === "Pending"
          }, (i == null ? void 0 : i.approval_owner_status) === "Pending" ? {
            h: common_vendor.o(($event) => handleAuditShow(i), `item_${index}`),
            i: "13ad4cd9-2-" + i0,
            j: common_vendor.p({
              label: "驳回",
              size: "sm",
              type: "display"
            }),
            k: common_vendor.o(($event) => {
              var _a3;
              return (_a3 = common_vendor.unref(INDEX_owner_audit_list_method.method)) == null ? void 0 : _a3.handleAudit(i);
            }, `item_${index}`),
            l: "13ad4cd9-3-" + i0,
            m: common_vendor.p({
              label: "审核通过",
              size: "sm",
              type: "primary"
            })
          } : {}, {
            n: `item_${index}`
          });
        }),
        b: rejectReason.value.reason,
        c: common_vendor.o(($event) => rejectReason.value.reason = $event.detail.value),
        d: common_vendor.o(handleClosePopup),
        e: common_vendor.p({
          label: "取消",
          size: "md",
          type: "display"
        }),
        f: common_vendor.o(handleSubmit),
        g: common_vendor.p({
          label: "提交",
          size: "md",
          type: "primary"
        }),
        h: common_vendor.p({
          show: show.value,
          mode: "center",
          title: "审核驳回"
        })
      };
    };
  }
});
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-13ad4cd9"], ["__file", "/Users/zsq/Sources/github/2025property-pay/pay-customer/src/INDEX/owner_audit_list/components/OwnerAuditList.vue"]]);
wx.createComponent(Component);
