index.vue 3.43 KB
<!--
 * @Description:
 * @Autor: renchao
 * @LastEditTime: 2024-01-19 16:48:37
-->
<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 v-if="this.formData.showidea">
        <div class="invalid-reson">审批意见:</div>
        <el-input
          class="opinion"
          v-model="shyj"
          placeholder="请输入审批意见"
          type="textarea"
          :rows="4"></el-input>
      </div>
      <div style="text-align:center">
        <el-button @click="cancelBack">取消转出</el-button>
        <el-button type="primary" @click="submitForm">确定转出</el-button>
      </div>
    </div>
  </div>
</template>

<script>
  import { completeTask, getNextLinkInfo } from "@/api/workFlow.js";
  import { popupCacel } from "@/utils/popup.js";
  import { mapGetters } from "vuex";
  export default {
    props: {
      formData: {
        type: Object,
        default: {},
      },
    },

    data () {
      return {
        queryForm: {},
        shyj: "",
      };
    },
    methods: {
      /**
       * @description: submitForm
       * @author: renchao
       */
      commonOpinion () {
        this.$popup('常用意见', "workflow/components/dialog/commonOpinion", {
          title: "常用意见",
          width: '75%', // 初始化75% 不需要改的话 可以直接不要
          formData: {}, // 父组件传给子组件的参数
          cancel: function () { }, //取消事件的回调 没有按钮可以不需要
          confirm: function () { } //确认事件的回调 没有按钮可以不需要
        })
      },
      submitForm () {
        let that = this
        this.queryForm = {
          bsmSlsq: this.formData.bsmSlsq,
          shyj: this.shyj,
          stepform: JSON.stringify(this.formData.tabList),
        };
        completeTask(this.queryForm).then((res) => {
          if (res.code === 200) {
            popupCacel();
            that.$message.success("转件成功");
            setTimeout(() => {
              window.close();
              that.$emit("input", false);
              if (window.opener && window.opener.getBpageList) {
                window.opener.getBpageList();
              } else {
                window.opener.frames[0].getBpageList();
              }
            }, 360);
          } else {
            this.$message.error(res.message);
          }
        }).catch((error) => {
          // 可以添加适当的错误处理
          this.$message.error("提交任务失败");
        });
      },
      /**
       * @description: closeDialog
       * @author: renchao
       */
      cancelBack () {
        popupCacel();
      },
    },
  };
</script>
<style scoped lang="scss">
  @import "~@/styles/mixin.scss";
  .el-button {
    margin-top: 20px;
    margin-right: 10px;
  }

  .opinion {
    position: relative;
    font-size: 15px;
  }

  .opinion_btn {
    position: absolute;
    right: 35px;
    bottom: 80px;
  }
</style>