operateList.js 8.8 KB
"use strict";
const common_vendor = require("../common/vendor.js");
const api_work = require("../api/work.js");
const store_modules_user = require("../store/modules/user.js");
if (!Array) {
  const _easycom_up_parse2 = common_vendor.resolveComponent("up-parse");
  const _easycom_up_modal2 = common_vendor.resolveComponent("up-modal");
  const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
  const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
  const _easycom_up_radio2 = common_vendor.resolveComponent("up-radio");
  const _easycom_up_radio_group2 = common_vendor.resolveComponent("up-radio-group");
  (_easycom_up_parse2 + _easycom_up_modal2 + _easycom_up_textarea2 + _easycom_up_input2 + _easycom_up_radio2 + _easycom_up_radio_group2)();
}
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";
const _easycom_up_textarea = () => "../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
const _easycom_up_input = () => "../uni_modules/uview-plus/components/u-input/u-input.js";
const _easycom_up_radio = () => "../uni_modules/uview-plus/components/u-radio/u-radio.js";
const _easycom_up_radio_group = () => "../uni_modules/uview-plus/components/u-radio-group/u-radio-group.js";
if (!Math) {
  (_easycom_up_parse + _easycom_up_modal + _easycom_up_textarea + _easycom_up_input + _easycom_up_radio + _easycom_up_radio_group)();
}
const _sfc_main = {
  __name: "operateList",
  props: {
    carInfo: {
      type: Object,
      require: true
    }
  },
  emits: ["refreshList"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const userStore = store_modules_user.useUserStore();
    const emit = __emit;
    const deptOptions = common_vendor.ref([]);
    const companyQueryParams = common_vendor.reactive({
      deptName: void 0,
      status: void 0
    });
    const deptId = common_vendor.ref(0);
    const current = common_vendor.ref(9);
    const showIssue = common_vendor.ref(false);
    const IssueMessage = common_vendor.ref("");
    const showReturn = common_vendor.ref(false);
    const returnContent = common_vendor.ref("");
    const showDefeat = common_vendor.ref(false);
    const DefeatContent = common_vendor.ref("");
    const showCompany = common_vendor.ref(false);
    const assessor = common_vendor.ref(false);
    const handleSuccess = () => {
      current.value = 0;
      common_vendor.index.showModal({
        title: "提示",
        content: "是否通过",
        success: function(res) {
          if (res.confirm) {
            api_work.disposeUser({ associationapprove: "0", associationapprovetype: "0", deptid: userStore.transferDeptId }, props.carInfo.taskId).then((res2) => {
              common_vendor.index.$u.toast("保单已通过");
              emit("refreshList");
            });
          } else if (res.cancel) {
            common_vendor.index.__f__("log", "at components/operateList.vue:103", "用户点击取消");
          }
        }
      });
    };
    const handleReturn = () => {
      current.value = 1;
      showReturn.value = true;
    };
    const handleInvalid = () => {
      current.value = 4;
      showDefeat.value = true;
    };
    const lookReason = async () => {
      current.value = 3;
      const { data } = await api_work.queryDefeatContent({
        processInstanceId: props.carInfo.processInstanceId,
        type: 0
      });
      IssueMessage.value = data.message;
      showIssue.value = true;
    };
    const handleUpdate = () => {
      current.value = 2;
      assessor.value = true;
      const id = props.carInfo.businessKey;
      common_vendor.index.navigateTo({
        url: `/pages/carDetail/carDetail?carInfoId=${id}&roleId=1`
      });
    };
    const handleCirculation = () => {
      current.value = 5;
      getDeptList();
      showCompany.value = true;
    };
    const getDeptList = () => {
      api_work.listDept(companyQueryParams).then((response) => {
        deptOptions.value = response.data.filter((item) => item.parentId === 100);
      });
    };
    const sunmitDeprecated = () => {
      const data = {
        associationapprove: "2",
        comment: DefeatContent.value
      };
      const taskId = props.carInfo.taskId;
      api_work.disposeUser(data, taskId).then((res) => {
        emit("refreshList");
        common_vendor.index.$u.toast("保单已作废");
        showDefeat.value = false;
      });
    };
    const sunmitReturn = () => {
      const data = {
        associationapprove: "1",
        comment: returnContent.value
      };
      const taskId = props.carInfo.taskId;
      api_work.disposeUser(data, taskId).then((res) => {
        emit("refreshList");
        common_vendor.index.$u.toast("保单退回");
        showReturn.value = false;
      });
    };
    const submitForm = () => {
      const data = {
        associationapprove: "0",
        associationapprovetype: "1",
        deptid: deptId.value.toString()
      };
      const taskId = props.carInfo.taskId;
      api_work.disposeUser(data, taskId).then((res) => {
        showCompany.value = false;
        emit("refreshList");
        common_vendor.index.$u.toast("保单已分配成功");
      });
    };
    return (_ctx, _cache) => {
      return common_vendor.e({
        a: __props.carInfo.policyStatus != "问题件" && assessor.value
      }, __props.carInfo.policyStatus != "问题件" && assessor.value ? {
        b: current.value === 0 ? 1 : "",
        c: common_vendor.o(handleSuccess)
      } : {}, {
        d: __props.carInfo.policyStatus != "问题件" && assessor.value
      }, __props.carInfo.policyStatus != "问题件" && assessor.value ? {
        e: current.value === 1 ? 1 : "",
        f: common_vendor.o(handleReturn)
      } : {}, {
        g: __props.carInfo.policyStatus != "问题件"
      }, __props.carInfo.policyStatus != "问题件" ? {
        h: current.value === 2 ? 1 : "",
        i: common_vendor.o(handleUpdate)
      } : {}, {
        j: __props.carInfo.policyStatus == "问题件"
      }, __props.carInfo.policyStatus == "问题件" ? {
        k: current.value === 3 ? 1 : "",
        l: common_vendor.o(lookReason)
      } : {}, {
        m: current.value === 4 ? 1 : "",
        n: common_vendor.o(handleInvalid),
        o: current.value === 5 ? 1 : "",
        p: common_vendor.o(handleCirculation),
        q: common_vendor.p({
          content: IssueMessage.value
        }),
        r: common_vendor.o(($event) => showIssue.value = false),
        s: common_vendor.p({
          show: showIssue.value,
          title: "作废备注"
        }),
        t: common_vendor.o(($event) => DefeatContent.value = $event),
        v: common_vendor.p({
          placeholder: "请输入内容",
          modelValue: DefeatContent.value
        }),
        w: common_vendor.o(sunmitDeprecated),
        x: common_vendor.o(($event) => showDefeat.value = false),
        y: common_vendor.p({
          show: showDefeat.value,
          showCancelButton: true,
          title: "填写作废内容"
        }),
        z: common_vendor.o(($event) => returnContent.value = $event),
        A: common_vendor.p({
          placeholder: "请输入内容",
          modelValue: returnContent.value
        }),
        B: common_vendor.o(sunmitReturn),
        C: common_vendor.o(($event) => showReturn.value = false),
        D: common_vendor.p({
          show: showReturn.value,
          showCancelButton: true,
          title: "填写退回内容"
        }),
        E: common_vendor.o(($event) => companyQueryParams.deptName = $event),
        F: common_vendor.p({
          placeholder: "请输入承保公司名称",
          prefixIcon: "search",
          modelValue: companyQueryParams.deptName
        }),
        G: common_vendor.o(getDeptList),
        H: common_vendor.f(deptOptions.value, (item, index, i0) => {
          return {
            a: index,
            b: "3d588709-9-" + i0 + ",3d588709-8",
            c: common_vendor.p({
              label: item.deptName,
              name: item.deptId
            })
          };
        }),
        I: common_vendor.o(($event) => deptId.value = $event),
        J: common_vendor.p({
          placement: "column",
          modelValue: deptId.value
        }),
        K: common_vendor.o(submitForm),
        L: common_vendor.o(($event) => showCompany.value = false),
        M: common_vendor.o(($event) => showCompany.value = false),
        N: common_vendor.p({
          show: showCompany.value,
          showCancelButton: true,
          closeOnClickOverlay: true,
          title: "选择分配项"
        })
      });
    };
  }
};
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-3d588709"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../.sourcemap/mp-weixin/components/operateList.js.map