invoiceDetail.js 4.47 KB
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_hotel = require("../../common/hotel.js");
require("../../common/request.js");
require("../../config.js");
require("../../common/login.js");
require("../../common/api.js");
const _sfc_main = {
  __name: "invoiceDetail",
  setup(__props) {
    const list = common_vendor.ref([]);
    const form = common_vendor.ref({});
    const nowAddress = common_vendor.ref({});
    const addressList = common_vendor.ref([]);
    common_vendor.index.getStorageSync("currUser");
    common_vendor.onShow(() => {
      list.value = [];
      getList();
    });
    let invoiceId;
    common_vendor.onLoad((option) => {
      invoiceId = option.invoiceId;
    });
    function getList() {
      common_hotel.getInvoiceDetailBills(invoiceId).then((res) => {
        list.value = res.rows;
        for (var bill of list.value) {
          bill.messageObj = JSON.parse(bill.message);
        }
      });
      common_hotel.getInvoiceDetail(invoiceId).then((res) => {
        form.value = res.data;
        if (form.value.invoiceForm != "1") {
          getAddressList();
        }
      });
    }
    function getAddressList() {
      common_hotel.addressList().then((res) => {
        addressList.value = res.rows;
        for (var a of addressList.value) {
          if (a.id == form.value.address) {
            nowAddress.value = a;
          }
        }
      });
    }
    return (_ctx, _cache) => {
      return common_vendor.e({
        a: common_vendor.f(list.value, (b, k0, i0) => {
          return common_vendor.e({
            a: b.orderType == 0
          }, b.orderType == 0 ? {
            b: common_vendor.t(b.name),
            c: common_vendor.t(b.messageObj.roomInfo),
            d: common_vendor.t(b.messageObj.roomStayDate),
            e: common_vendor.t(b.total)
          } : {}, {
            f: b.orderType == 1
          }, b.orderType == 1 ? {
            g: common_vendor.t(b.name),
            h: common_vendor.f(b.messageObj.carsList, (car, index, i1) => {
              return {
                a: common_vendor.t(car.name),
                b: common_vendor.t(car.num),
                c: index,
                d: car.num > 0
              };
            }),
            i: common_vendor.t(b.total)
          } : {}, {
            j: b.orderType == 2
          }, b.orderType == 2 ? {
            k: common_vendor.t(b.name),
            l: common_vendor.f(b.messageObj.foodsList, (n, index, i1) => {
              return common_vendor.e({
                a: n.num > 0
              }, n.num > 0 ? {
                b: common_vendor.t(n.name),
                c: common_vendor.t(n.categoryName),
                d: common_vendor.t(n.num)
              } : {}, {
                e: index
              });
            }),
            m: common_vendor.t(b.total)
          } : {}, {
            n: b.id
          });
        }),
        b: form.value.invoiceForm == "1"
      }, form.value.invoiceForm == "1" ? {} : {}, {
        c: form.value.invoiceForm == "2"
      }, form.value.invoiceForm == "2" ? {} : {}, {
        d: form.value.invoiceForm == "3"
      }, form.value.invoiceForm == "3" ? {} : {}, {
        e: common_vendor.t(form.value.total),
        f: form.value.invoiceForm == "1"
      }, form.value.invoiceForm == "1" ? {
        g: common_vendor.t(form.value.address)
      } : {
        h: common_vendor.t(nowAddress.value.contact),
        i: common_vendor.t(nowAddress.value.phone),
        j: common_vendor.t(nowAddress.value.addName)
      }, {
        k: form.value.invoiceType == "0",
        l: form.value.invoiceType == "1",
        m: common_vendor.t(form.value.invoiceTitle),
        n: form.value.invoiceType == "0"
      }, form.value.invoiceType == "0" ? {
        o: common_vendor.t(form.value.invoiceTfn)
      } : {}, {
        p: form.value.invoiceForm == "3" && form.value.invoiceType == "0"
      }, form.value.invoiceForm == "3" && form.value.invoiceType == "0" ? common_vendor.e({
        q: common_vendor.t(form.value.invoiceAddress),
        r: common_vendor.t(form.value.invoicePhone),
        s: common_vendor.t(form.value.invoiceBank),
        t: form.value.invoiceAccount
      }, form.value.invoiceAccount ? {
        v: common_vendor.t(form.value.invoiceAccount)
      } : {}) : {});
    };
  }
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-3297860d"], ["__file", "/Users/yangyang/project/j-mini/Venue/pages_hotel/hotel/invoiceDetail.vue"]]);
wx.createPage(MiniProgramPage);