zc.vue 2.94 KB
<!--
 * @Description:
 * @Autor: renchao
 * @LastEditTime: 2023-05-17 10:42:01
-->
<template>
  <div class="from-clues">
    <!-- 表单部分 -->
    <div class="from-clues-header">
      <el-form ref="queryForm" label-width="180px" v-if="this.formData.obj">
        <el-form-item label="下一环节名称:">
          {{ this.formData.obj.taskName }}
        </el-form-item>
        <el-form-item label="下一环节办理人:">
          {{ this.formData.obj.usernames.join(",") }}
        </el-form-item>
      </el-form>
      <el-form ref="queryForm" label-width="180px" v-else>
        <el-form-item label="">
        此环节为流程最后环节,转出后流程将结束
        </el-form-item>
      </el-form>
      <div class="invalid-reson">转出原因:</div>
      <el-input
        v-model="shyj"
        placeholder="请输入转出原因"
        type="textarea"
        :rows="4"
      ></el-input>
      <el-button style="float: right" @click="cancelBack">取消转出</el-button>
      <el-button type="primary" @click="submitForm" style="float: right"
        >确定转出</el-button
      >
    </div>
  </div>
</template>

<script>
import { completeTask, getNextLinkInfo } from "@/api/workFlow.js";
import { popupCacel } from "@/utils/popup.js";
export default {
  components: {},
  props: {
    formData: {
      type: Object,
      default: {},
    },
  },
  data() {
    return {
      queryForm: {},
      shyj: "",
    };
  },
  mounted() {
    //  this.queryForm= this.queryForm.obj
    console.log("formDataformDataformData", this.formData);
  },
  methods: {
    /**
     * @description: submitForm
     * @author: renchao
     */
    submitForm() {
      this.queryForm = {
        bsmSlsq: this.formData.bsmSlsq,
        shyj: this.shyj,
        stepform: JSON.stringify(this.formData.tabList),
      };
      console.log("this.queryForm", this.queryForm);
      completeTask(this.queryForm).then((res) => {
        if (res.code === 200) {
          this.$message.success("转件成功");
          // setTimeout(() => {
          //   window.opener = null;
          //   window.open("about:blank", "_self");
          //   window.close();
          //   this.$emit("input", false);
          // }, 1000);
            popupCacel();
               setTimeout(() => {
            // window.opener.location.reload(); //刷新父窗口
            if (window.opener && window.opener.getBpageList) {
              window.opener.getBpageList();
            } else {
              window.opener.frames[0].getBpageList();
            }
            window.close();
            this.$emit("input", false);
          }, 1000);
        }else{
          this.$message.error(res.message);
        }
      });
    },
    /**
     * @description: closeDialog
     * @author: renchao
     */
    cancelBack() {
      popupCacel();
    },
  },
};
</script>
<style scoped lang="scss">
@import "~@/styles/mixin.scss";
.el-button {
  margin-top: 20px;
  margin-right: 10px;
}
</style>