societyOrder.js 7.7 KB
"use strict";
const common_vendor = require("../../common/vendor.js");
const api_work = require("../../api/work.js");
if (!Array) {
  const _easycom_up_navbar2 = common_vendor.resolveComponent("up-navbar");
  const _easycom_up_empty2 = common_vendor.resolveComponent("up-empty");
  const _easycom_uni_pagination2 = common_vendor.resolveComponent("uni-pagination");
  const _easycom_up_parse2 = common_vendor.resolveComponent("up-parse");
  const _easycom_up_modal2 = common_vendor.resolveComponent("up-modal");
  (_easycom_up_navbar2 + _easycom_up_empty2 + _easycom_uni_pagination2 + _easycom_up_parse2 + _easycom_up_modal2)();
}
const _easycom_up_navbar = () => "../../uni_modules/uview-plus/components/u-navbar/u-navbar.js";
const _easycom_up_empty = () => "../../uni_modules/uview-plus/components/u-empty/u-empty.js";
const _easycom_uni_pagination = () => "../../uni_modules/uni-pagination/components/uni-pagination/uni-pagination.js";
const _easycom_up_parse = () => "../../uni_modules/uview-plus/components/u-parse/u-parse.js";
const _easycom_up_modal = () => "../../uni_modules/uview-plus/components/u-modal/u-modal.js";
if (!Math) {
  (_easycom_up_navbar + navTop + wordInfo + operateList + carCard + _easycom_up_empty + _easycom_uni_pagination + _easycom_up_parse + _easycom_up_modal)();
}
const carCard = () => "../../components/carCard.js";
const navTop = () => "../../components/navTop.js";
const wordInfo = () => "../../components/wordInfo.js";
const operateList = () => "../../components/operateList.js";
const _sfc_main = {
  __name: "societyOrder",
  setup(__props) {
    const List = common_vendor.ref([]);
    const allTotal = common_vendor.ref(0);
    const typeId = common_vendor.ref(0);
    const showFeedback = common_vendor.ref(false);
    const showDefeat = common_vendor.ref(false);
    const feedbakcForm = common_vendor.ref({
      policyNumber: "",
      message: ""
    });
    const defeatForm = common_vendor.ref({
      message: ""
    });
    const queryParams = common_vendor.reactive({
      pageNum: 1,
      pageSize: 10,
      type: 0
    });
    const tipContent = common_vendor.ref("");
    common_vendor.onLoad((options) => {
      typeId.value = Number(options.type);
      getList(typeId.value);
    });
    common_vendor.onPullDownRefresh(async () => {
      queryParams.pageNum = 1;
      List.value = [];
      getList(typeId.value);
    });
    const getList = (id) => {
      switch (id) {
        case 0:
          tipContent.value = "待处理";
          api_work.queryMyList(queryParams).then((res) => {
            List.value = res.data.rows || [];
            allTotal.value = res.data.total;
            common_vendor.index.stopPullDownRefresh();
          });
          break;
        case 1:
          tipContent.value = "已处理";
          api_work.queryProcessedList(queryParams).then((res) => {
            List.value = res.rows || [];
            allTotal.value = res.total;
            common_vendor.index.stopPullDownRefresh();
          });
          break;
        case 2:
          tipContent.value = "进行中";
          api_work.queryOngoingList(queryParams).then((res) => {
            List.value = res.rows || [];
            allTotal.value = res.total;
            common_vendor.index.stopPullDownRefresh();
          });
          break;
        case 3:
          tipContent.value = "已完结";
          api_work.queryEndedList(queryParams).then((res) => {
            List.value = res.rows || [];
            allTotal.value = res.total;
            common_vendor.index.stopPullDownRefresh();
          });
          break;
        case 4:
          tipContent.value = "已作废";
          api_work.queryDeprecatedList(queryParams).then((res) => {
            List.value = res.rows || [];
            allTotal.value = res.total;
            common_vendor.index.stopPullDownRefresh();
          });
          break;
      }
    };
    const lookDetail = (id) => {
      common_vendor.index.navigateTo({
        url: `/pages/carDetail/carDetail?carInfoId=${id}`
      });
    };
    const lookFeedback = (processInstanceId) => {
      api_work.queryResult({ processInstanceId }).then((res) => {
        var _a, _b;
        feedbakcForm.value.policyNumber = (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.policyNumber;
        feedbakcForm.value.message = (_b = res == null ? void 0 : res.data) == null ? void 0 : _b.message;
        showFeedback.value = true;
      });
    };
    const lookRemark = (processInstanceId) => {
      api_work.queryDefeatContent({ processInstanceId, type: 2 }).then((res) => {
        var _a;
        defeatForm.value.message = (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.message;
        showDefeat.value = true;
      });
    };
    const changeList = (index) => {
      queryParams.type = index;
      getList(typeId.value);
    };
    return (_ctx, _cache) => {
      return {
        a: common_vendor.p({
          placeholder: true,
          leftIconColor: "#fff",
          autoBack: true,
          bgColor: "transparent"
        }),
        b: queryParams.type === 0 ? 1 : "",
        c: common_vendor.o(($event) => changeList(0)),
        d: queryParams.type === 1 ? 1 : "",
        e: common_vendor.o(($event) => changeList(1)),
        f: common_vendor.f(List.value, (carItem, k0, i0) => {
          return common_vendor.e({
            a: "c7e48d8e-2-" + i0 + "," + ("c7e48d8e-1-" + i0),
            b: common_vendor.p({
              carNum: carItem.licensePlateNumber
            }),
            c: "c7e48d8e-3-" + i0 + "," + ("c7e48d8e-1-" + i0),
            d: common_vendor.p({
              phone: carItem.phone,
              userName: carItem.name,
              company: carItem.sysDeptName
            })
          }, typeId.value === 0 ? {
            e: common_vendor.o(getList, carItem.taskId),
            f: "c7e48d8e-4-" + i0 + "," + ("c7e48d8e-1-" + i0),
            g: common_vendor.p({
              carInfo: carItem
            })
          } : {}, {
            h: common_vendor.o(($event) => lookDetail(carItem.businessKey), carItem.taskId)
          }, typeId.value === 3 ? {
            i: common_vendor.o(($event) => lookFeedback(carItem.processInstanceId), carItem.taskId)
          } : {}, typeId.value === 4 ? {
            j: common_vendor.o(($event) => lookRemark(carItem.processInstanceId), carItem.taskId)
          } : {}, {
            k: carItem.taskId,
            l: "c7e48d8e-1-" + i0,
            m: common_vendor.p({
              tipContent: tipContent.value,
              carInfo: carItem
            })
          });
        }),
        g: typeId.value === 0,
        h: typeId.value === 3,
        i: typeId.value === 4,
        j: common_vendor.p({
          show: List.value.length == 0,
          mode: "list",
          text: "暂无待办事项"
        }),
        k: common_vendor.o(($event) => getList(typeId.value)),
        l: common_vendor.o(($event) => queryParams.pageNum = $event),
        m: common_vendor.p({
          total: allTotal.value,
          pageSize: queryParams.pageSize,
          modelValue: queryParams.pageNum
        }),
        n: List.value.length > 0,
        o: common_vendor.p({
          content: feedbakcForm.value.message
        }),
        p: common_vendor.o(($event) => showFeedback.value = false),
        q: common_vendor.p({
          show: showFeedback.value,
          title: "保单回馈"
        }),
        r: common_vendor.p({
          content: defeatForm.value.message
        }),
        s: common_vendor.o(($event) => showDefeat.value = false),
        t: common_vendor.p({
          show: showDefeat.value,
          title: "作废备注"
        })
      };
    };
  }
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-c7e48d8e"]]);
wx.createPage(MiniProgramPage);