<template>
  <div class="auditWrapper">
    <section class="section1 public-flex">
      <div class="public-margin-r-20">
        <h4>投资项目</h4>
        <p class="projectNameTit">{{ detailInfo.projectName }}</p>
      </div>
    </section>
    <el-divider></el-divider>
    <section class="section3">

      <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane label="项目基本信息" name="0"></el-tab-pane>
        <el-tab-pane label="项目公司信息" name="1"></el-tab-pane>
        <el-tab-pane label="项目联系人信息" name="2"></el-tab-pane>
        <el-tab-pane label="项目融资信息" name="3"></el-tab-pane>
        <el-tab-pane label="商业计划书及其他" name="4"></el-tab-pane>
<!--        <el-tab-pane v-if="formAssess!=null" label="软件工程院评估意见" name="5"></el-tab-pane>-->
      </el-tabs>
      <section>
        <el-form ref="form" :model="form" label-width="160px" class="special-el-form">
          <div v-if="activeName === '0'" >
          <el-row :gutter="20" style="margin-left: 0px;margin-right: 0px;">
            <el-col :span="12">
              <el-form-item label="项目名称" prop="projectName">
                <el-input maxlength="100" v-model="form.projectName" placeholder="请输入项目名称" :disabled="type === '2'"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="渠道" prop="tProjectChannel.channelName">
                <el-select :disabled="type === '2'" v-model="form.tProjectChannel.channelName" placeholder="请选择" clearable>
                  <el-option v-for="item in channelList" :key="item.id" :label="item.channelName" :value="item.id"/>
                  <el-option label="直接触达" value="1" />
                  <el-option label="内部推荐" value="2" />
                  <el-option label="无" value="-1" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="初次接触日期" prop="contactDate">
                <el-date-picker
                  :disabled="type === '2'"
                  clearable
                  v-model="form.contactDate"
                  type="date"
                  value-format="yyyy-MM-dd"
                  placeholder="请选择初次接触日期">
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="所属组别">
                <el-select
                  v-model="form.tProjectChannel.channelGroup"
                  disabled
                  placeholder="请选择所属组别"
                >
                  <el-option
                    v-for="dict in dict.type.project_group"
                    :key="dict.value"
                    :label="dict.label"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="所属行业" prop="industry">
                <el-select
                  v-model="form.industry"
                  placeholder="请选择所属行业"
                  :disabled="type === '2'"
                >
                  <el-option
                    v-for="dict in dict.type.CUSTOMER_TRADE"
                    :key="dict.value"
                    :label="dict.label"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="项目负责人" prop="investHead">
                <el-input
                  v-if="type === '2'"
                  maxlength="30"
                  v-model="form.investHead"
                  :disabled="type === '2'"
                />
                <div
                  class="el-input__inner inputSimulation"
                  v-else
                >
                  {{ form.investHead ? form.investHead : "请选择项目负责人" }}
                </div>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="项目情况描述"
                prop="description"
                class="special-el-form-item"
              >
                <el-input
                  :disabled="type === '2'"
                  maxlength="200"
                  rows="4"
                  type="textarea"
                  v-model="form.description"
                  placeholder="请输入项目情况描述"
                />
              </el-form-item>
            </el-col>
            </el-row>
          </div>
          <div v-if="activeName === '1'">
            <el-row :gutter="20">
              <el-col :span="12">
                <el-form-item label="公司名称" prop="tProjectCompany.companyName">
                  <el-input
                    :disabled="type === '2'"
                    maxlength="100"
                    v-model="form.tProjectCompany.companyName"
                    placeholder="请输入公司名称"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="统一社会信用代码" prop="tProjectCompany.companyCode">
                  <el-input
                    :disabled="type === '2'"
                    maxlength="35"
                    v-model="form.tProjectCompany.companyCode"
                    placeholder="请输入企业统一社会信用代码"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="营业开始时间" prop="tProjectCompany.startTime">
                  <el-date-picker
                    :disabled="type === '2'"
                    clearable
                    v-model="form.tProjectCompany.startTime"
                    type="date"
                    value-format="yyyy-MM-dd"
                    placeholder="请选择营业开始时间"
                  >
                  </el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="营业结束时间" prop="tProjectCompany.endTime">
                  <el-date-picker
                    :disabled="type === '2'"
                    clearable
                    v-model="form.tProjectCompany.endTime"
                    type="date"
                    value-format="yyyy-MM-dd"
                    placeholder="请选择营业结束时间"
                  >
                  </el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item
                  label="注册资本(万元)"
                  prop="tProjectCompany.registeredCapital"
                >
                  <el-input
                    :disabled="type === '2'"
                    maxlength="20"
                    v-model="form.tProjectCompany.registeredCapital"
                    @input="
                  (value) =>
                    (form.tProjectCompany.registeredCapital = value
                      .replace(/[^0-9.]/g, '')
                      .replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/, '$1$2.$3')
                      .replace(/-/g, ''))
                "
                    placeholder="请输入注册资本"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="实缴资本(万元)" prop="tProjectCompany.paidCapital">
                  <el-input
                    :disabled="type === '2'"
                    maxlength="20"
                    v-model="form.tProjectCompany.paidCapital"
                    @input="
                  (value) =>
                    (form.tProjectCompany.paidCapital = value
                      .replace(/[^0-9.]/g, '')
                      .replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/, '$1$2.$3')
                      .replace(/-/g, ''))
                "
                    placeholder="请输入实缴资本"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="实控人" prop="tProjectCompany.actualBod">
                  <el-input
                    :disabled="type === '2'"
                    maxlength="25"
                    v-model="form.tProjectCompany.actualBod"
                    placeholder="请输入实控人"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="联系电话" prop="tProjectCompany.phone">
                  <el-input
                    :disabled="type === '2'"
                    maxlength="20"
                    v-model="form.tProjectCompany.phone"
                    placeholder="请输入联系电话"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="所属类型" prop="tProjectCompany.type">
                  <el-input
                    :disabled="type === '2'"
                    maxlength="25"
                    v-model="form.tProjectCompany.type"
                    placeholder="请输入所属类型"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="备案时间" prop="tProjectCompany.filingTime">
                  <el-date-picker
                    :disabled="type === '2'"
                    clearable
                    v-model="form.tProjectCompany.filingTime"
                    type="date"
                    value-format="yyyy-MM-dd"
                    placeholder="请选择备案时间"
                  >
                  </el-date-picker>
                </el-form-item>
              </el-col>
              <el-col>
                <el-form-item
                  label="注册地址"
                  prop="tProjectCompany.registeredAddress"
                  class="special-el-form-item"
                >
                  <el-input
                    :disabled="type === '2'"
                    type="textarea"
                    rows="4"
                    maxlength="100"
                    v-model="form.tProjectCompany.registeredAddress"
                    placeholder="请输入注册地址"
                  />
                </el-form-item>
              </el-col>
              <el-col>
                <el-form-item
                  label="办公地址"
                  prop="tProjectCompany.businessAddress"
                  class="special-el-form-item"
                >
                  <el-input
                    :disabled="type === '2'"
                    type="textarea"
                    rows="4"
                    maxlength="100"
                    v-model="form.tProjectCompany.businessAddress"
                    placeholder="请输入办公地址"
                  />
                </el-form-item>
              </el-col>
              <el-col>
                <el-form-item
                  label="公司附件"
                  prop="listFile"
                  class="special-el-form-item"
                >
                  <fileItem
                    ref="fileItem"
                    :id="form.id"
                    :is-detail="true"
                  ></fileItem>
                </el-form-item>
              </el-col>
            </el-row>
<!--            </el-form>-->
          </div>
          <div v-if="activeName === '2'">
            <el-row :gutter="20">
              <el-col :span="12">
                <el-form-item label="联系人姓名" prop="tProjectContacts.name">
                  <el-input
                    :disabled="type === '2'"
                    maxlength="25"
                    v-model="form.tProjectContacts.name"
                    placeholder="请输入联系人姓名"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="职位" prop="tProjectContacts.position">
                  <el-input
                    :disabled="type === '2'"
                    maxlength="25"
                    v-model="form.tProjectContacts.position"
                    placeholder="请输入职位"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="联系电话/微信" prop="tProjectContacts.contact">
                  <el-input
                    :disabled="type === '2'"
                    maxlength="25"
                    v-model="form.tProjectContacts.contact"
                    placeholder="请输入联系电话/微信"
                  />
                </el-form-item>
              </el-col>
            </el-row>
          </div>
          <div v-if="activeName === '3'" class="public-padded-20 detail-meeting">
<!--            <el-form :model="form" label-width="120px">-->
            <el-row :gutter="20">
              <el-col :span="12">
                <el-form-item label="项目融资阶段" prop="financingStage">
                  <el-select
                    :disabled="type === '2'"
                    v-model="form.financingStage"
                    placeholder="请选择项目融资阶段"
                  >
                    <el-option
                      v-for="dict in dict.type.financing_stage"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="预期融资金额(万元)" prop="financingMoney">
                  <el-input
                    :disabled="type === '2'"
                    maxlength="20"
                    v-model="form.financingMoney"
                    @input="
                  (value) =>
                    (form.financingMoney = value.replace(/\D/g, '').replace(/-/g, ''))
                "
                    placeholder="请输入预期融资金额"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="投后估值(万元)" prop="investValuation">
                  <el-input
                    :disabled="type === '2'"
                    maxlength="20"
                    v-model="form.investValuation"
                    @input="
                  (value) =>
                    (form.investValuation = value
                      .replace(/[^0-9.]/g, '')
                      .replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3')
                      .replace(/-/g, ''))
                "
                    placeholder="请输入投后估值"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="预计投资金额(万元)" prop="investMoney">
                  <el-input
                    :disabled="type === '2'"
                    maxlength="20"
                    v-model="form.investMoney"
                    @input="
                  (value) =>
                    (form.investMoney = value.replace(/\D/g, '').replace(/-/g, ''))
                "
                    placeholder="请输入预计投资金额"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="投资类型" prop="investType">
                  <el-select
                    v-model="form.investType"
                    placeholder="请选择投资类型"
                    :disabled="type === '2'"
                  >
                    <el-option
                      v-for="dict in dict.type.invest_type"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="投资策略" prop="investPloy">
                  <el-select
                    v-model="form.investPloy"
                    placeholder="请选择投资策略"
                    :disabled="type === '2'"
                  >
                    <el-option
                      v-for="dict in dict.type.invest_ploy"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="投资价值" prop="investWorth">
                  <el-select
                    v-model="form.investWorth"
                    placeholder="请选择投资价值"
                    :disabled="type === '2'"
                  >
                    <el-option
                      v-for="dict in dict.type.invest_worth"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col >
                <el-form-item
                  label="历次融资"
                  prop="previousFinancing"
                  class="special-el-form-item"
                >
                  <el-input
                    :disabled="type === '2'"
                    maxlength="200"
                    rows="4"
                    type="textarea"
                    v-model="form.previousFinancing"
                    placeholder="请输入历次融资"
                  />
                </el-form-item>
              </el-col>
              <el-col >
                <el-form-item
                  label="融资条件"
                  prop="financingCondition"
                  class="special-el-form-item"
                >
                  <el-input
                    :disabled="type === '2'"
                    maxlength="200"
                    rows="4"
                    type="textarea"
                    v-model="form.financingCondition"
                    placeholder="请输入融资条件"
                  />
                </el-form-item>
              </el-col>
              <el-col >
                <el-form-item
                  label="投资亮点"
                  prop="investSparkle"
                  class="special-el-form-item"
                >
                  <el-input
                    :disabled="type === '2'"
                    maxlength="200"
                    rows="4"
                    type="textarea"
                    v-model="form.investSparkle"
                    placeholder="请输入投资亮点"
                  />
                </el-form-item>
              </el-col>
              <el-col >
                <el-form-item
                  label="股权架构"
                  prop="shareholding"
                  class="special-el-form-item"
                >
                  <el-input
                    :disabled="type === '2'"
                    maxlength="200"
                    rows="4"
                    type="textarea"
                    v-model="form.shareholding"
                    placeholder="请输入股权架构"
                  />
                </el-form-item>
              </el-col>
            </el-row>
<!--            </el-form>-->
          </div>
          <div v-if="activeName === '4'">
<!--            <el-form :model="tProjectCompany" label-width="120px">-->
            <el-row :gutter="20">
              <el-col>
                <el-form-item label="BP" prop="bpFile" class="special-el-form-item">
                  <fileItem ref="bpFileItem" :id="form.id" :is-detail="true" ></fileItem>
                </el-form-item>
              </el-col>
              <el-col>
                <el-form-item label="其他附件" prop="otherFile" class="special-el-form-item">
                  <fileItem ref="otherFileItem" :id="form.id" :is-detail="true"></fileItem>
                </el-form-item>
              </el-col>
              <el-col>
                <el-form-item label="备注" prop="mark" class="special-el-form-item">
                  <el-input
                    :disabled="type === '2'"
                    maxlength="200"
                    :readonly="type === '2' ? true : false"
                    rows="4"
                    type="textarea"
                    v-model="form.mark"
                    placeholder="请输入备注"
                  />
                </el-form-item>
              </el-col>
            </el-row>
          </div>
        </el-form>
<!--        <el-form ref="formAssess" :model="formAssess" label-width="160px" class="special-el-form">
          <div v-if="activeName === '5'">
            <el-row :gutter="20">
              <el-col>
                <el-form-item label="评估意见" prop="context" class="special-el-form-item">
                  <el-input
                    :disabled="type === '2'"
                    maxlength="200"
                    :readonly="type === '2' ? true : false"
                    rows="4"
                    type="textarea"
                    v-model="formAssess.context"
                    placeholder="请输入评估意见"
                  />
                </el-form-item>
              </el-col>
            </el-row>
          </div>
        </el-form>-->
      </section>
    </section>
<!--    <section v-if="form.taskDefKey=='softwareDept'">
      <el-form
        ref="formAssess"
        :model="formAssess"
        :rules="rulesAssess"
        label-width="120px"
      >
        <el-form-item label="评估意见" prop="context">
          <el-input
            maxlength="200"
            rows="4"
            type="textarea"
            v-model="formAssess.context"
            placeholder="请填写评估意见"
          >
          </el-input>
        </el-form-item>
      </el-form>
    </section>-->
    <section>
      <flowBase :procInstId="form.procInstId" v-if="form.procInstId"></flowBase>
    </section>
  </div>
</template>
<script>
import {getInvestInfo, investmentOpportunityComplete} from "@/api/project/investOpp/pool";
import { listChannel } from "@/api/invest/channel";
import fileItem from "../../invest/components/fileItem";
import flowBase from "../flowBase.vue";
import { mapGetters } from "vuex";


export default {
  props: {
    type: {
      type: String,
      default: "2", //1可编辑  2不可编辑
    }
  },
  components: { fileItem ,flowBase},
  dicts: [
    "CUSTOMER_TRADE",
    "project_group",
    "invest_type",
    "invest_ploy",
    "invest_worth",
    "financing_stage",
  ],
  data() {
    return {
      active: 0,
      detailInfo: {
        projectName: "",
      },
      activeName: "0",
      id: "",
      pInstId:null,
      rules1: {},
      channelList: [],
      fileList: [],
      fileListBP: [],
      fileListOther: [],
      // 表单参数
      form: {
        id: null,
        procInstId:null,
        taskDefKey:null,
        projectName: null,
        projectGroup: "",
        industry: null,
        recordDate: null,
        projectCode: null,
        channel: "",
        contactDate: null,
        projectDate: null,
        decisionDate: null,
        tProjectCompany: {
          companyName: null,
          companyCode: null,
          startTime: null,
          endTime: null,
          registeredCapital: null,
          registeredAddress: null,
          paidCapital: null,
          businessAddress: null,
          actualBod: null,
          phone: null,
          filingTime: null,
          type: null,
        },
        tProjectContacts: {
          name: null,
          position: null,
          contact: null,
        },
        tProjectChannel: {
          channelName: "",
          channelGroup: "",
        },

        description: null,
        projectContacts: null,
        investHead: null,
        previousFinancing: null,
        financingStage: null,
        financingCondition: null,
        financingMoney: null,
        financingDate: null,
        investSparkle: null,
        investValuation: null,
        investMoney: null,
        investType: null,
        investPloy: null,
        investWorth: null,
        shareholding: null,
        projectStage: null,
        projectState: null,
        mark: null,
        delFlag: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        listFile: null,
        bpFile: null,
        otherFile: null,
      },
      // 上传评估意见
      formAssess: {
        id: null,
        context: null,
        projectPoolId: null,
      },
      rulesAssess: {
        context: [{ required: true, trigger: "blur", message: "请输入" }],
      },
      flowBaseInfo:{
        comment:null
      },
      rulesFlow:{
        comment: [{ required: true, trigger: "blur", message: "请输入" }],
      }
    };
  },
  computed: {
    ...mapGetters(["user"]),
  },
  mounted() {
    new Promise((resolve, reject) => {
      listChannel({
        pageNum: 1,
        pageSize: 100,
      }).then((response) => {
        this.channelList = response.rows;
        resolve();
      });
    }).then(() => {
      if (this.id) {
        this.getPoolDetail(this.id,this.pInstId);
      } else {
        //this.reset();
      }
    });
  },
  created() {
    this.id = this.$route.query.id;
    this.pInstId = this.$route.query.pInstId;
    this.getPoolDetail(this.id,this.pInstId);
  },
  methods: {
    handleClick(tab, event) {
      let that = this;
      if (this.activeName === '1') {
        this.getPoolDetail(this.id,this.pInstId);
      }else if(this.activeName === '4'){
        this.getPoolDetail(this.id,this.pInstId);
      }
    },
    getPoolDetail(id,pInstId) {
      getInvestInfo(pInstId).then((response) => {
        this.form = response.data;
        this.detailInfo = response.data;
        this.formAssess = response.data.tProjectReview;
        let channeItem = this.channelList.find((item) => {
          if (this.form.channel == item.id) {
            return item;
          }
        });
        if (channeItem && channeItem.channelName) {
          this.form.tProjectChannel.channelName = channeItem.channelName;
          this.form.tProjectChannel.channelGroup = channeItem.channelGroup;
        } else {
          if(this.form.channel=="1") {
            this.form.tProjectChannel = {
              channelName: "直接触达",
              channelGroup: "",
            };
          }else if(this.form.channel=="2") {
            this.form.tProjectChannel = {
              channelName: "内部推荐",
              channelGroup: "",
            };
          }else{
            this.form.tProjectChannel = {
              channelName: "无",
              channelGroup: "",
            };
          }

        }

        setTimeout(() => {
          if(this.activeName==='1') {
            this.$refs.fileItem.handleButton();
            this.$refs.fileItem.fileList = [];
            this.$refs.fileItem.getListFileBusinessId(
              this.form.tProjectCompany.companyId
            );
          }else if(this.activeName==='4'){
            this.$refs.bpFileItem.handleButton();
            this.$refs.otherFileItem.handleButton();
            this.$refs.bpFileItem.fileList = [];
            this.$refs.bpFileItem.getListFileBusinessId(this.form.id, "9");
            this.$refs.otherFileItem.fileList = [];
            this.$refs.otherFileItem.getListFileBusinessId(this.form.id, "0");
          }
        }, 300);
      });
    },
    // 获取fileList
    getFileList(fileList) {
      if (fileList && fileList.length > 0) {
        this.fileList = fileList;
      } else {
        this.fileList = [];
      }
    },
    /*getBPFileList(fileList) {
      if (fileList && fileList.length > 0) {
        this.fileListBP = fileList;
        this.$refs.form.clearValidate(["bpFile"]);
      } else {
        this.fileList = [];
      }
    },*/
    getOtherFileList(fileList) {
      if (fileList && fileList.length > 0) {
        this.fileListOther = fileList;
      } else {
        this.fileList = [];
      }
    },
    /*返回*/
    goBack() {
      this.$router.go(-1);
    },
    //跳转到我的任务-项目机会
    goMyTask(){
      //this.$router.push({ path: "/myTask/project/investOpp/myTask"});
      // 关闭当前标签页并返回指定页面
      const obj = { path: "/myTask/project/investOpp/myTask", query: { t: Date.now()} };
      this.$tab.closeOpenPage(obj);
    },
    /** 加载审批任务弹框 */
    handleComplete(flag) {
      this.completeOpen = true;
      this.completeTitle = "流程审批";
      ///his.submitForm(flag);

      this.taskComplete(flag);
    },
    /** 用户审批任务 */
    taskComplete(flag) {
      if (!this.flowBaseInfo.comment) {
        this.$modal.msgError("请输入审批意见!");
        return;
      }
      if (this.form.taskDefKey=='softwareDept'&&!this.formAssess.context) {
          this.$modal.msgError("请输入评估意见!");
          return;
      }
      this.form.flag=flag;
      const params={
        projectPool: this.form,  // 拆分明确字段
        projectReview: this.formAssess,
        flowBaseInfo: this.flowBaseInfo
      }
      investmentOpportunityComplete(params).then(response => {
        this.$modal.msgSuccess(response.msg);
        this.goMyTask();
      });
      /*if (this.taskForm && this.formKeyExist) {
        // 表单是否禁用
        this.taskForm.formData.formData.disabled = true;
        // 是否显示按钮
        this.taskForm.formData.formData.formBtns = false;
        this.taskForm.variables = Object.assign({}, this.taskForm.variables, this.taskForm.formData.valData);
        this.taskForm.variables.variables = this.taskForm.formData.formData;
        investmentOpportunityComplete(this.taskForm).then(response => {
          this.$modal.msgSuccess(response.msg);
          this.goBack();
        });
      } else {
        // 流程设计人员类型配置为固定人员接收任务时,直接提交任务到下一步

      }*/
    },
    /** 申请流程表单数据提交 */
    submitForm(flag) {
      // 根据当前任务或者流程设计配置的下一步节点 todo 暂时未涉及到考虑网关、表达式和多节点情况
      const params = {taskId: this.taskForm.taskId}
      getNextFlowNode(params).then(res => {
        /*const data = res.data;
        this.taskForm.formData = formData;
        if (data) {
          if (data.dataType === 'dynamic') {
            if (data.type === 'assignee') { // 指定人员
              this.checkSendUser = true;
              this.checkType = "single";
            } else if (data.type === 'candidateUsers') {  // 候选人员(多个)
              this.checkSendUser = true;
              this.checkType = "multiple";
            } else if (data.type === 'candidateGroups') { // 指定组(所属角色接收任务)
              this.checkSendRole = true;
            } else { // 会签
              // 流程设计指定的 elementVariable 作为会签人员列表
              this.multiInstanceVars = data.vars;
              this.checkSendUser = true;
              this.checkType = "multiple";
            }
          }
        }
        this.completeOpen = true;
        this.completeTitle = "流程审批";*/
        this.$refs.vFormRef.getFormData().then(formData => {
          formData.auditPass=flag;
          Object.assign(this.taskForm.variables, formData);
          this.taskForm.variables.formJson = this.formJson;
          //console.log(this.taskForm, "流程审批提交表单数据1")
        }).catch(error => {
          // this.$modal.msgError(error)
        })
        const data = res.data;
        if (data) {
          if (data.dataType === 'dynamic') {
            if (data.type === 'assignee') { // 指定人员
              this.checkSendUser = true;
              this.checkType = "single";
            } else if (data.type === 'candidateUsers') {  // 候选人员(多个)
              this.checkSendUser = true;
              this.checkType = "multiple";
            } else if (data.type === 'candidateGroups') { // 指定组(所属角色接收任务)
              this.checkSendRole = true;
            } else { // 会签
              // 流程设计指定的 elementVariable 作为会签人员列表
              this.multiInstanceVars = data.vars;
              this.checkSendUser = true;
              this.checkType = "multiple";
            }
          }
        }
      })
    },

  },
};
</script>
<style lang="scss" scoped>
.auditWrapper {
  padding: 20px 0;
  width: 92%;
  margin: 0 auto;
  .section1 {
    p {
      font-size: 24px;
      font-weight: bold;
      margin: 0;
    }
    > div:first-child {
      // width: calc(100% - 700px);
      width: 100%;
    }
    .btnList {
      width: 700px;
      display: flex;
      justify-content: flex-end;
    }
  }
  .basicsInfo {
    font-size: 14px;
    background: #f1f1f1;
    margin-top: -24px;
    width: 100%;
    padding: 30px 20px 10px;
    div {
      color: #7e7d7d;
    }
    p {
      font-size: 16px;
      color: #333;
      font-weight: bold;
    }
  }
  .section3 {
    margin-top: 40px;
    .el-form-item {
      width: 100%; /* 让表单占满父容器 */
      min-width: 600px; /* 防止过小（可选） */
    }
    .special-el-form {
      margin-left: 0px;
      width: 100%;
    }

  }

}

</style>
